/* ============================================================
   全站通用头部 / 页脚 / 弹窗 —— 玫瑰奶油设计语言
   仅由 includes/header.php 引入，覆盖 css/style.css 中的旧样式
   ============================================================ */

:root {
    --cream: #fff9f6;
    --card: #fffdfb;
    --blush: #fdeef1;
    --rose: #d94f6a;
    --rose-dark: #b93a55;
    --rose-soft: #f4b7c4;
    --ink: #33272b;
    --muted: #8b767d;
    --faint: #b3a0a6;
    --line: #f0dfe3;
    --line-strong: #e6cdd3;
    --shadow-soft: 0 10px 30px rgba(140, 74, 90, .10);
    --shadow-card: 0 18px 44px rgba(140, 74, 90, .14);
    --font-serif: "Noto Serif SC", "Songti SC", "STSong", serif;
    --font-sans: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------------- 顶部导航 ---------------- */
header.site-header {
    position: sticky;
    top: 0;
    z-index: 200;
    background: rgba(255, 249, 246, .86);
    -webkit-backdrop-filter: blur(18px) saturate(1.2);
    backdrop-filter: blur(18px) saturate(1.2);
    border-bottom: 1px solid var(--line);
    padding: 0;
    margin: 0;
    box-shadow: 0 6px 24px rgba(140, 74, 90, .06);
}

.site-header .site-nav {
    max-width: 1240px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 12px 20px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
}

/* 覆盖 style.css 中 nav / header 的红色底 */
.site-header {
    background-color: rgba(255, 249, 246, .86);
}

.site-header .site-nav {
    background-color: transparent;
}

/* Logo */
.site-header .logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    text-decoration: none !important;
    color: var(--ink);
    flex-shrink: 0;
}

.site-header .logo:hover {
    color: var(--ink);
}

.site-header .logo-mark {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(145deg, #f7d3db, #eeb2bf);
    color: #fff;
    font-size: 16px;
    box-shadow: 0 6px 16px rgba(201, 88, 112, .28);
    transform: rotate(-6deg);
    transition: transform .3s ease;
}

.site-header .logo:hover .logo-mark {
    transform: rotate(6deg) scale(1.04);
}

.site-header .logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.15;
    font-family: var(--font-serif);
    font-size: 1.12rem;
    font-weight: 700;
    letter-spacing: .01em;
}

.site-header .logo-text small {
    font-family: var(--font-sans);
    font-size: .62rem;
    font-weight: 400;
    letter-spacing: .16em;
    color: var(--faint);
    margin-top: 3px;
}

/* 导航 */
.site-header ul.nav-links {
    display: flex !important;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: nowrap;
    white-space: nowrap;
    overflow: visible;
}

.site-header ul.nav-links li {
    margin: 0;
    flex-shrink: 0;
    list-style: none;
    position: relative;
}

.site-header ul.nav-links li > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 0;
    padding: 7px 11px;
    margin: 0;
    border-radius: 999px;
    color: var(--muted);
    font-size: .88rem;
    font-family: var(--font-sans);
    text-decoration: none;
    transition: color .22s ease, background .22s ease;
}

.site-header ul.nav-links li > a::before {
    display: none;
}

.site-header ul.nav-links li > a:hover,
.site-header ul.nav-links li > a:focus-visible {
    color: var(--rose-dark);
    background: var(--blush);
    text-decoration: none;
}

.site-header ul.nav-links li .fa-search {
    font-size: .95rem;
}

/* 登录 / 个人中心 胶囊 */
.site-header ul.nav-links li.nav-cta > a {
    background: linear-gradient(135deg, var(--rose), #e7748c);
    color: #fff;
    padding: 8px 18px;
    font-weight: 600;
    box-shadow: 0 8px 20px rgba(217, 79, 106, .28);
    margin-left: 6px;
}

.site-header ul.nav-links li.nav-cta > a:hover {
    color: #fff;
    background: linear-gradient(135deg, var(--rose-dark), #cf5f79);
    box-shadow: 0 10px 24px rgba(217, 79, 106, .34);
}

/* 消息角标 */
.site-header .nav-message > a {
    position: relative;
}

.site-header .unread-badge {
    background: var(--rose) !important;
    color: #fff !important;
    font-size: .66rem !important;
    padding: 1px 6px !important;
    border-radius: 999px !important;
    margin-left: 2px !important;
}

/* 下拉菜单 */
.site-header li.nav-dropdown > a .fa-caret-down,
.site-header li.nav-dropdown > a .fa-chevron-down {
    font-size: .62rem;
    opacity: .65;
    transition: transform .25s ease;
}

.site-header li.nav-dropdown:hover > a .fa-caret-down,
.site-header li.nav-dropdown:hover > a .fa-chevron-down {
    transform: rotate(180deg);
}

.site-header ul.nav-links li.nav-dropdown ul.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    left: 50%;
    transform: translate(-50%, 8px);
    min-width: 180px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--shadow-card);
    padding: 8px;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
    z-index: 300;
}

.site-header ul.nav-links li.nav-dropdown ul.dropdown-menu li {
    margin: 0;
    width: auto;
}

.site-header ul.nav-links li.nav-dropdown ul.dropdown-menu li a {
    display: block;
    padding: 9px 14px;
    border-radius: 10px;
    color: var(--muted);
    font-size: .86rem;
    text-decoration: none;
}

.site-header ul.nav-links li.nav-dropdown ul.dropdown-menu li a::before {
    display: none;
}

.site-header ul.nav-links li.nav-dropdown ul.dropdown-menu li a:hover {
    background: var(--blush);
    color: var(--rose-dark);
    text-decoration: none;
}

@media (min-width: 849px) {
    /* 悬浮桥接区：避免鼠标从一级菜单移向二级菜单时经过间隙导致菜单关闭 */
    .site-header ul.nav-links li.nav-dropdown::after {
        content: '';
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        height: 16px;
    }

    .site-header ul.nav-links li.nav-dropdown:hover > ul.dropdown-menu,
    .site-header ul.nav-links li.nav-dropdown:focus-within > ul.dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translate(-50%, 0);
    }
}

/* 汉堡按钮 */
.site-header .hamburger {
    display: none !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--rose-dark);
    font-size: 1.05rem;
    cursor: pointer;
    flex-shrink: 0;
}

.site-header .hamburger:hover {
    background: var(--blush);
}

@media (max-width: 1100px) {
    .site-header ul.nav-links li > a {
        padding: 7px 8px;
        font-size: .84rem;
    }
}

@media (max-width: 848px) {
    .site-header .site-nav {
        padding: 10px 16px;
    }

    .site-header .hamburger {
        display: inline-flex !important;
        color: var(--rose-dark) !important;
        font-size: 1.05rem !important;
    }

    .site-header ul.nav-links {
        position: absolute !important;
        top: calc(100% + 10px) !important;
        left: 12px !important;
        right: 12px !important;
        display: none !important;
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 2px !important;
        width: auto !important;
        margin: 0 !important;
        padding: 10px !important;
        background: var(--card) !important;
        border: 1px solid var(--line) !important;
        border-radius: 18px !important;
        box-shadow: var(--shadow-card) !important;
        max-height: calc(100vh - 110px) !important;
        overflow-y: auto !important;
        white-space: normal !important;
        z-index: 400 !important;
    }

    .site-header ul.nav-links.show {
        display: flex !important;
        animation: chromeMenuIn .22s ease;
    }

    .site-header ul.nav-links li {
        width: 100% !important;
        margin: 0 !important;
        text-align: left !important;
    }

    .site-header ul.nav-links li > a {
        display: flex !important;
        width: 100% !important;
        justify-content: flex-start !important;
        padding: 11px 14px !important;
        margin: 0 !important;
        border-radius: 12px !important;
        font-size: .95rem !important;
        background: transparent !important;
        color: var(--muted) !important;
        text-align: left !important;
    }

    .site-header ul.nav-links li > a:hover {
        background: var(--blush) !important;
        color: var(--rose-dark) !important;
    }

    .site-header ul.nav-links li.nav-cta > a {
        justify-content: center !important;
        margin: 6px 0 0 !important;
        background: linear-gradient(135deg, var(--rose), #e7748c) !important;
        color: #fff !important;
        box-shadow: 0 8px 20px rgba(217, 79, 106, .28) !important;
    }

    .site-header ul.nav-links li.nav-dropdown ul.dropdown-menu {
        position: static !important;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        display: none !important;
        box-shadow: none !important;
        border: none !important;
        background: var(--blush) !important;
        border-radius: 12px !important;
        margin: 4px 0 6px !important;
        padding: 6px !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .site-header ul.nav-links li.nav-dropdown.open ul.dropdown-menu {
        display: block !important;
    }

    .site-header ul.nav-links li.nav-dropdown ul.dropdown-menu li a {
        width: 100% !important;
        padding: 9px 12px !important;
        color: var(--muted) !important;
    }

    .site-header li.nav-dropdown > a .fa-caret-down,
    .site-header li.nav-dropdown > a .fa-chevron-down {
        margin-left: auto;
    }
}

@keyframes chromeMenuIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------------- Toast ---------------- */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 12px 32px rgba(76, 40, 50, .22);
    z-index: 9999;
    opacity: 0;
    transform: translateY(-16px);
    transition: all .3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-info { background: linear-gradient(135deg, #6d7fd8, #8b6bd6); }
.toast-success { background: linear-gradient(135deg, #4fa981, #3d8f6c); }
.toast-warning { background: linear-gradient(135deg, #e3a33f, #cf8a25); }
.toast-error { background: linear-gradient(135deg, #d94f6a, #b93a55); }

.toast-content { display: flex; align-items: center; gap: 10px; }
.toast-icon { font-size: 16px; }
.toast-message { font-size: 14px; }

/* ---------------- 页脚 ---------------- */
footer.site-footer {
    margin-top: 80px;
    background: linear-gradient(180deg, #fff9f6 0%, #fdf2f1 100%);
    border-top: 1px solid var(--line);
    color: var(--muted);
    padding: 56px 0 26px;
    position: relative;
}

footer.site-footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: min(360px, 60%);
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, transparent, var(--rose-soft), transparent);
}

.site-footer .footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 40px;
    padding: 0 24px;
}

.site-footer .footer-section h3 {
    margin: 0 0 14px;
    font-family: var(--font-serif);
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--ink);
    letter-spacing: .02em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-footer .footer-section h3::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--rose-soft);
}

.site-footer .footer-section p {
    color: var(--muted);
    line-height: 1.8;
    font-size: .88rem;
    margin-bottom: 10px;
}

.site-footer .footer-section ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.site-footer .footer-section ul li {
    margin-bottom: 8px;
}

.site-footer .footer-section ul li a {
    color: var(--muted);
    text-decoration: none;
    font-size: .88rem;
    transition: color .2s ease;
}

.site-footer .footer-section ul li a:hover {
    color: var(--rose-dark);
    text-decoration: none;
}

.site-footer .footer-contact a {
    color: var(--muted);
    text-decoration: none;
}

.site-footer .footer-contact a:hover {
    color: var(--rose-dark);
}

.site-footer .footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 22px 24px 0;
    border-top: 1px solid var(--line);
    text-align: center;
}

.site-footer .footer-stats {
    display: flex !important;
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-bottom: 16px !important;
    font-size: 12px !important;
    color: var(--faint) !important;
    line-height: 1.2 !important;
}

.site-footer .footer-stats > span {
    font-size: 12px !important;
    color: var(--faint) !important;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 5px 12px;
    white-space: nowrap;
}

.site-footer .footer-stats > span > span {
    border: none;
    background: transparent;
    padding: 0;
}

.site-footer .footer-copyright {
    margin: 0;
    font-size: .8rem;
    color: var(--faint);
    line-height: 1.9;
}

.site-footer .footer-copyright a {
    color: var(--faint) !important;
    text-decoration: none;
    transition: color .2s ease;
}

.site-footer .footer-copyright a:hover {
    color: var(--rose-dark) !important;
}

@media (max-width: 720px) {
    footer.site-footer {
        margin-top: 56px;
        padding-top: 40px;
    }

    .site-footer .footer-content {
        grid-template-columns: 1fr;
        gap: 26px;
        text-align: center;
        padding: 0 20px;
    }

    .site-footer .footer-section h3 {
        justify-content: center;
    }

    .site-footer .footer-bottom {
        padding: 18px 20px 0;
    }
}

/* ---------------- 弹窗（隐私政策 / 用户协议 / 同意） ---------------- */
.modal {
    display: none;
    position: fixed;
    z-index: 3000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(51, 39, 43, .55);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    overflow: auto;
}

.modal-content {
    background-color: var(--card);
    margin: 5% auto;
    padding: 0;
    border-radius: 18px;
    width: 86%;
    max-width: 800px;
    box-shadow: 0 30px 80px rgba(51, 39, 43, .3);
    animation: modalSlideIn .3s ease-out;
    overflow: hidden;
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-40px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 24px;
    background: linear-gradient(135deg, var(--rose), #e7748c);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 700;
}

.modal-header .close {
    color: #fff;
    font-size: 26px;
    font-weight: 300;
    cursor: pointer;
    line-height: 1;
    opacity: .85;
}

.modal-header .close:hover {
    opacity: 1;
}

.modal-body {
    padding: 24px;
    max-height: 62vh;
    overflow-y: auto;
    color: var(--ink);
}

.modal-body h3 {
    color: var(--ink);
    margin-top: 22px;
    margin-bottom: 10px;
    font-size: 1.02rem;
}

.modal-body p,
.modal-body ul,
.modal-body li {
    color: var(--muted);
    line-height: 1.8;
}

.modal-footer {
    padding: 16px 24px;
    text-align: right;
    border-top: 1px solid var(--line);
}

.close-btn {
    padding: 10px 24px;
    background: var(--rose);
    color: #fff;
    border: none;
    border-radius: 999px;
    cursor: pointer;
    font-size: .92rem;
    transition: background .3s ease;
}

.close-btn:hover {
    background: var(--rose-dark);
}
