/* 全站統一導覽列 — 桌面與手機樣式 */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(246, 239, 230, 0.78);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(240, 214, 158, 0.45);
    box-shadow: 0 10px 28px rgba(15, 28, 46, 0.10);
}

.top-nav-inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 5%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    height: var(--nav-h, 66px);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--bg-dark);
    white-space: nowrap;
    flex-shrink: 0;
}

.nav-logo {
    display: block;
    height: 34px;
    width: auto;
    object-fit: contain;
    filter: drop-shadow(0 6px 12px rgba(15, 28, 46, 0.12));
}

.nav-toggle {
    border: 1px solid rgba(240, 214, 158, 0.55);
    background: rgba(255, 255, 255, 0.35);
    color: var(--bg-dark);
    border-radius: 999px;
    height: 42px;
    padding: 0 14px;
    display: none;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
    transition: var(--transition, all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1));
    flex-shrink: 0;
}

.nav-toggle i {
    line-height: 1;
    font-size: 1rem;
    display: inline-block;
}

.nav-toggle .label {
    line-height: 1;
    font-size: 0.9rem;
    font-weight: 800;
}

.nav-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(15, 28, 46, 0.10);
}

.nav-toggle:focus-visible {
    outline: 3px solid rgba(240, 214, 158, 0.65);
    outline-offset: 3px;
}

.nav-menu {
    display: flex;
    align-items: stretch;
    gap: 4px;
    justify-content: flex-end;
}

.nav-item {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link,
.nav-button {
    appearance: none;
    border: 0;
    background: transparent;
    font-family: var(--font-sans, "Noto Sans TC", sans-serif);
    color: var(--bg-dark);
    text-decoration: none;
    cursor: pointer;
    padding: 0 12px;
    border-radius: 999px;
    font-weight: 800;
    letter-spacing: 0.2px;
    transition: var(--transition, all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1));
    display: grid;
    grid-auto-flow: column;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
    height: 52px;
    line-height: 1;
}

.nav-link::after {
    content: "";
    width: 16px;
    height: 16px;
    display: block;
    opacity: 0;
}

.nav-item:not([data-dropdown]) .nav-link::after {
    display: none;
}

.nav-item:not([data-dropdown]) .nav-link {
    grid-template-columns: auto;
    gap: 0;
    padding: 0 6px;
}

.nav-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
    text-align: center;
}

.nav-label .zh {
    font-family: var(--font-serif, "Noto Serif TC", serif);
    font-size: 0.98rem;
    letter-spacing: 1px;
    line-height: 1.05;
}

.nav-label .en {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.6px;
    color: rgba(44, 62, 80, 0.55);
    margin-top: 3px;
    line-height: 1.05;
}

.nav-button .chev {
    font-size: 0.85rem;
    color: rgba(44, 62, 80, 0.8);
    transition: transform 0.25s ease;
    width: 16px;
    height: 16px;
    display: grid;
    place-items: center;
}

.nav-item[data-open="true"] .nav-button .chev {
    transform: rotate(180deg);
}

.nav-link:hover,
.nav-button:hover {
    transform: translateY(-1px);
}

.nav-item:not([data-dropdown]) .nav-link:hover {
    background: transparent;
}

.nav-item:not([data-dropdown]) .nav-link .nav-label {
    border-radius: 999px;
    padding: 6px 10px;
    transition: background-color 0.25s ease;
}

.nav-item:not([data-dropdown]) .nav-link:hover .nav-label,
.nav-item[data-dropdown] .nav-button:hover {
    background: rgba(240, 214, 158, 0.22);
}

.dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 280px;
    margin-top: 10px;
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(240, 214, 158, 0.35);
    border-radius: 16px;
    box-shadow: 0 18px 45px rgba(15, 28, 46, 0.16);
    padding: 10px;
    display: none;
}

.nav-item[data-open="true"] > .dropdown {
    display: block;
}

.dropdown a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-dark, #2c3e50);
    transition: var(--transition, all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1));
    font-weight: 800;
}

.dropdown a:hover {
    background: rgba(240, 214, 158, 0.16);
}

.dropdown a .sub {
    font-weight: 600;
    font-size: 0.85rem;
    color: rgba(44, 62, 80, 0.65);
}

@media (min-width: 1201px) {
    .nav-menu {
        align-items: center;
    }

    .nav-link,
    .nav-button {
        transform: translateY(0);
    }

    .nav-link:hover,
    .nav-button:hover {
        transform: translateY(2px);
    }

    .nav-item[data-dropdown]::after {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 10px;
    }

    .nav-item[data-dropdown] > .dropdown::before {
        content: "";
        position: absolute;
        left: 0;
        right: 0;
        top: -10px;
        height: 10px;
    }
}

@media (max-width: 1200px) {
    body {
        --nav-h: 58px;
    }

    .nav-logo {
        height: 30px;
    }

    .nav-toggle {
        display: inline-flex;
        margin-left: auto;
    }

    .nav-menu {
        position: fixed;
        top: var(--nav-h, 58px);
        left: 0;
        right: 0;
        background: rgba(246, 239, 230, 0.96);
        border-bottom: 1px solid rgba(240, 214, 158, 0.45);
        box-shadow: 0 18px 45px rgba(15, 28, 46, 0.12);
        padding: 12px 5% 18px;
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        max-height: calc(100vh - var(--nav-h, 58px));
        overflow: auto;
    }

    .top-nav[data-mobile-open="true"] .nav-menu {
        display: flex;
    }

    .nav-item {
        display: block;
    }

    .nav-item[data-dropdown] {
        display: flex;
        flex-direction: column;
        align-items: stretch;
    }

    .nav-link,
    .nav-button {
        width: 100%;
        justify-content: space-between;
        padding: 12px 12px;
        border-radius: 14px;
        white-space: normal;
        height: auto;
        transform: none;
    }

    .nav-label {
        align-items: flex-start;
        text-align: left;
    }

    .dropdown {
        position: static;
        min-width: 0;
        box-shadow: none;
        border: 1px solid rgba(240, 214, 158, 0.28);
        background: rgba(255, 255, 255, 0.75);
        padding: 8px;
        margin: 6px 0 10px;
        display: none;
    }

    .nav-item[data-open="true"] > .dropdown {
        display: block;
    }
}
