:root {
    --solo-bg: #fbf6ef;
    --solo-paper: #fffdf8;
    --solo-line: #eaded1;
    --solo-text: #202020;
    --solo-muted: #756f68;
    --solo-coral: #ec7457;
    --solo-coral-dark: #d85e43;
    --solo-teal: #2f817d;
    --solo-shadow: 0 18px 44px rgba(99, 73, 45, .10);
    --solo-nav-height: 82px;
}

/*
 * Solo+ 公開／會員頁面唯一共用導覽列。
 * Fragment 會自行載入本檔，各頁不需要重複引入。
 */
.solo-global-header,
.solo-global-header * {
    box-sizing: border-box;
}

.solo-global-header {
    position: sticky;
    top: 0;
    z-index: 2000;
    width: 100%;
    background: rgba(255, 250, 244, .96);
    border-bottom: 1px solid var(--solo-line);
    box-shadow: 0 8px 28px rgba(91, 64, 43, .045);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
}

.solo-global-header.admin-header {
    background: rgba(255, 247, 239, .97);
}

.solo-global-nav.container {
    width: min(calc(100% - 48px), 1580px);
    max-width: 1580px;
    min-height: var(--solo-nav-height);
    margin: 0 auto;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 26px;
}

.solo-global-brand {
    flex: 0 0 auto;
    color: var(--solo-coral-dark);
    font-family: "Noto Serif TC", "Times New Roman", serif;
    font-size: 39px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -1.5px;
    text-decoration: none;
}

.solo-global-brand:hover,
.solo-global-brand:focus-visible {
    color: var(--solo-coral-dark);
}

.solo-global-brand span {
    color: #ef886d;
}

.solo-global-brand small {
    margin-left: 8px;
    color: var(--solo-teal);
    font-family: "Noto Sans TC", sans-serif;
    font-size: 13px;
    font-weight: 900;
    letter-spacing: 0;
}

.solo-global-panel {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 18px;
}

.solo-global-menu {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(13px, 1.12vw, 23px);
}

.solo-global-menu a {
    position: relative;
    flex: 0 0 auto;
    min-height: 44px;
    padding: 12px 0 10px;
    color: #4b4640;
    border-bottom: 2px solid transparent;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: clamp(14px, .92vw, 16px);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: color .18s ease, border-color .18s ease;
}

.solo-global-menu a:hover,
.solo-global-menu a:focus-visible,
.solo-global-menu a.active {
    color: var(--solo-coral);
    border-bottom-color: var(--solo-coral);
    outline: none;
}

.solo-global-menu .admin-link {
    color: var(--solo-teal);
}

.solo-global-menu .admin-link.active,
.solo-global-menu .admin-link:hover,
.solo-global-menu .admin-link:focus-visible {
    color: #226b67;
    border-bottom-color: var(--solo-teal);
}

.solo-global-actions {
    flex: 0 0 auto;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.solo-global-actions a,
.solo-global-actions button {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: 1px solid var(--solo-line);
    border-radius: 15px;
    font-family: "Noto Sans TC", "Microsoft JhengHei", sans-serif;
    font-size: 15px;
    font-weight: 900;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: transform .18s ease, color .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.solo-global-actions a:hover,
.solo-global-actions button:hover,
.solo-global-actions a:focus-visible,
.solo-global-actions button:focus-visible {
    transform: translateY(-1px);
    outline: none;
}

.solo-global-actions .btn-login,
.solo-global-actions .logout-form button {
    color: #514c47;
    background: #fffaf4;
    border-color: #e5bda9;
}

.solo-global-actions .btn-login:hover,
.solo-global-actions .logout-form button:hover {
    color: var(--solo-coral);
    background: #fff6ef;
    border-color: var(--solo-coral);
}

.solo-global-actions .btn-register {
    color: #fff;
    background: var(--solo-coral);
    border-color: var(--solo-coral);
    box-shadow: 0 12px 28px rgba(236, 116, 87, .18);
}

.solo-global-actions .btn-register:hover {
    color: #fff;
    background: var(--solo-coral-dark);
    border-color: var(--solo-coral-dark);
    box-shadow: 0 14px 30px rgba(216, 94, 67, .22);
}

.solo-global-actions .btn-member {
    color: var(--solo-teal);
    background: rgba(255, 255, 255, .76);
    border-color: rgba(47, 129, 125, .30);
}

.solo-global-actions .btn-member:hover {
    color: #226b67;
    background: #f0faf7;
    border-color: rgba(47, 129, 125, .48);
}

.solo-global-actions .logout-form {
    display: inline-flex;
    align-items: center;
    margin: 0;
}

.solo-nav-toggle {
    display: none;
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    margin-left: auto;
    padding: 0;
    place-items: center;
    border: 1px solid var(--solo-line);
    border-radius: 14px;
    background: #fffaf4;
    color: #4b4640;
    cursor: pointer;
}

.solo-nav-toggle-icon,
.solo-nav-toggle-icon::before,
.solo-nav-toggle-icon::after {
    width: 20px;
    height: 2px;
    display: block;
    border-radius: 999px;
    background: currentColor;
    transition: transform .2s ease, opacity .2s ease;
}

.solo-nav-toggle-icon {
    position: relative;
}

.solo-nav-toggle-icon::before,
.solo-nav-toggle-icon::after {
    position: absolute;
    left: 0;
    content: "";
}

.solo-nav-toggle-icon::before { top: -6px; }
.solo-nav-toggle-icon::after { top: 6px; }

.solo-nav-open .solo-nav-toggle-icon {
    background: transparent;
}

.solo-nav-open .solo-nav-toggle-icon::before {
    top: 0;
    transform: rotate(45deg);
}

.solo-nav-open .solo-nav-toggle-icon::after {
    top: 0;
    transform: rotate(-45deg);
}

.solo-nav-backdrop {
    display: none;
    appearance: none;
    border: 0;
    padding: 0;
}

/* 共用二級導覽：保留各功能頁自己的捷徑，但不再複製 Solo+ 主 Header。 */
.solo-section-nav {
    width: min(calc(100% - 48px), 1500px);
    margin: 14px auto 0;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    background: rgba(255, 255, 255, .80);
    border: 1px solid rgba(234, 222, 209, .92);
    border-radius: 17px;
    box-shadow: 0 8px 24px rgba(91, 64, 43, .045);
    scrollbar-width: thin;
}

.solo-section-nav a {
    flex: 0 0 auto;
    padding: 9px 13px;
    color: #5b544d;
    border-radius: 11px;
    font-size: 14px;
    font-weight: 800;
    white-space: nowrap;
    text-decoration: none;
}

.solo-section-nav a:hover,
.solo-section-nav a.active {
    color: var(--solo-coral-dark);
    background: #fff2ea;
}

/* Admin 仍沿用既有 fragment；桌面寬度不足時可水平捲動。 */
.admin-header .solo-global-menu {
    overflow-x: auto;
    scrollbar-width: thin;
}

.admin-header .solo-global-menu a {
    font-size: 13px;
}

@media (max-width: 1480px) and (min-width: 1181px) {
    .solo-global-nav.container {
        width: min(calc(100% - 32px), 1460px);
        gap: 18px;
    }

    .solo-global-brand {
        font-size: 35px;
    }

    .solo-global-menu {
        gap: 12px;
    }

    .solo-global-menu a {
        font-size: 13.5px;
    }

    .solo-global-actions a,
    .solo-global-actions button {
        padding-inline: 15px;
    }
}

@media (max-width: 1180px) {
    body.solo-nav-open {
        overflow: hidden;
    }

    .solo-global-nav.container {
        width: min(calc(100% - 28px), 100%);
        min-height: 70px;
        padding: 10px 0;
    }

    .solo-global-brand {
        font-size: 35px;
    }

    .solo-nav-toggle {
        display: grid;
    }

    .solo-global-panel {
        position: fixed;
        top: 0;
        right: 0;
        z-index: 2002;
        width: min(420px, calc(100vw - 34px));
        height: 100dvh;
        padding: 84px 22px 24px;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 18px;
        overflow-y: auto;
        background: #fffaf4;
        border-left: 1px solid var(--solo-line);
        box-shadow: -22px 0 50px rgba(75, 52, 35, .17);
        transform: translateX(105%);
        visibility: hidden;
        transition: transform .24s ease, visibility .24s ease;
    }

    .solo-nav-open .solo-global-panel {
        transform: translateX(0);
        visibility: visible;
    }

    .solo-global-menu {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
    }

    .solo-global-menu a {
        width: 100%;
        min-height: 46px;
        padding: 13px 4px;
        border-bottom: 1px solid rgba(234, 222, 209, .82);
        font-size: 15px;
    }

    .solo-global-menu a.active {
        padding-left: 12px;
        background: #fff1e8;
        border-bottom-color: rgba(236, 116, 87, .26);
        border-radius: 10px;
    }

    .solo-global-actions {
        width: 100%;
        margin-left: 0;
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: stretch;
    }

    .solo-global-actions a,
    .solo-global-actions button,
    .solo-global-actions .logout-form {
        width: 100%;
    }

    .solo-nav-open .solo-nav-toggle {
        position: fixed;
        top: 12px;
        right: 16px;
        z-index: 2004;
    }

    .solo-nav-backdrop {
        position: fixed;
        inset: 0;
        z-index: 2001;
        width: 100%;
        height: 100%;
        background: rgba(29, 23, 19, .42);
    }

    .solo-nav-open .solo-nav-backdrop {
        display: block;
    }

    .admin-header .solo-global-nav {
        flex-wrap: wrap;
    }

    .admin-header .solo-global-menu,
    .admin-header .solo-global-actions {
        display: none;
        width: 100%;
    }

    .solo-nav-open .admin-header .solo-global-menu {
        order: 3;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        max-height: calc(100dvh - 150px);
        overflow-y: auto;
    }

    .solo-nav-open .admin-header .solo-global-actions {
        order: 4;
        display: flex;
        padding-bottom: 10px;
    }

    .admin-header .solo-global-menu a {
        width: 100%;
        padding: 12px 4px;
    }

    .solo-section-nav {
        width: min(calc(100% - 28px), 100%);
        margin-top: 10px;
    }
}

@media (max-width: 560px) {
    .solo-global-nav.container {
        width: calc(100% - 24px);
    }

    .solo-global-brand {
        font-size: 32px;
    }

    .solo-global-panel {
        width: min(360px, calc(100vw - 20px));
        padding-inline: 18px;
    }

    .solo-global-actions {
        grid-template-columns: 1fr;
    }

    .solo-section-nav {
        width: calc(100% - 24px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .solo-global-header *,
    .solo-global-panel {
        scroll-behavior: auto !important;
        transition: none !important;
    }
}
