/* 共用主導覽：結構由 shared/nav.js 輸出，樣式集中在這裡維護。 */
[data-site-nav] {
    display: block;
    min-height: 67px;
}

nav {
    min-height: 64px;
    display: flex;
    align-items: stretch;
    gap: 0;
    padding: 0;
    background: #fffdf6;
    border-bottom: 3px solid #111;
    box-sizing: border-box;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
}

nav .logo {
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 0 22px;
    background: #fffdf6;
    color: #111;
    border-right: 3px solid #111;
    font-size: 20px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.nav-mark {
    width: 30px;
    height: 30px;
    display: grid;
    flex: 0 0 auto;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    border: 2px solid #111;
    background: #111;
    gap: 2px;
}

.nav-mark i:nth-child(1) { background: #e3342f; }
.nav-mark i:nth-child(2) { background: #f2c230; }
.nav-mark i:nth-child(3) { background: #1f5fbf; }
.nav-mark i:nth-child(4) { background: #fffdf6; }

nav > a:not(.logo):not(.partner-link) {
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    color: #111;
    border-right: 3px solid #111;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    position: relative;
}

nav > a:not(.logo):not(.partner-link):hover,
nav > a:not(.logo):not(.partner-link).active {
    color: #111;
    background: #f2c230;
    text-decoration: none;
}

nav > a:not(.logo):not(.partner-link).active:before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 8px;
    background: #c9342b;
}

nav .spacer { flex: 1; }

nav .partner-link {
    min-height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    font-size: 14px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
    background: #111;
    color: #fffdf6;
    border-right: 0;
}

nav .partner-link:hover {
    background: #e3342f;
    color: #fffdf6;
}

@media (max-width: 768px) {
    [data-site-nav] {
        min-height: 235px;
    }

    nav {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        position: static;
        margin: 0;
        padding: 58px 0 0;
        border-left: 0;
        border-right: 0;
    }

    nav .logo {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 1000;
        grid-column: 1 / -1;
        width: 100%;
        min-height: 58px;
        padding: 0 24px;
        border-right: 0;
        border-bottom: 3px solid #111;
        font-size: 18px;
    }

    nav > a:not(.logo):not(.partner-link) {
        min-height: 58px;
        justify-content: center;
        padding: 0 8px;
        border-right-width: 2px;
        border-bottom: 3px solid #111;
        font-size: 14px;
        text-align: center;
    }

    nav > a:not(.logo):not(.partner-link):nth-of-type(4),
    nav > a:not(.logo):not(.partner-link):nth-of-type(7) {
        border-right: 0;
    }
    nav .spacer { display: none; }
    nav .partner-link {
        grid-column: 1 / -1;
        min-height: 52px;
        border-right: 0;
        border-bottom: 3px solid #111;
    }
}
