/* ============================================================
   全局基础样式：导航橙条 / 页头面包屑 / 页脚 / CTA / 回到顶部 / 灯箱 / 主题切换 / 响应式
   本文件最后加载，确保覆盖各页样式、响应式与全局组件正确呈现
   ============================================================ */

/* ---------- CTA 区域 ---------- */
.cta-section {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: var(--white);
    text-align: center;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}
.cta-section::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(circle at 50% 50%, rgba(45, 143, 110, 0.1) 0%, transparent 60%);
}
.cta-section .container {
    position: relative;
    z-index: 2;
}
.cta-section h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 16px;
}
.cta-section p {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 32px;
}

/* ---------- 页面页头 + 面包屑 ---------- */
.page-banner {
    /* 深蓝渐变 + 细斜纹纹理 */
    background:
        repeating-linear-gradient(-45deg,
            rgba(255, 255, 255, 0.03) 0,
            rgba(255, 255, 255, 0.03) 2px,
            transparent 2px,
            transparent 26px),
        linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
    color: #fff;
    padding: 104px 0 40px; /* 顶部 80px 固定导航 + 24px 间距 */
    text-align: left;
}
.page-banner h1 {
    font-size: 1.9rem;
    font-weight: 700;
}
.crumb,
.breadcrumbs {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    margin-bottom: 10px;
}
.crumb a,
.breadcrumbs a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color 0.2s ease;
}
.crumb a:hover,
.breadcrumbs a:hover {
    color: var(--accent-light);
}
/* 浅色背景场景下的面包屑 */
.breadcrumbs {
    color: var(--text-sub);
}
.breadcrumbs a {
    color: var(--text-sub);
}
.breadcrumbs a:hover {
    color: var(--accent);
}
.breadcrumbs .sep {
    margin: 0 8px;
    color: var(--border);
}

/* ---------- 页脚 ---------- */
.footer {
    background: var(--primary-dark);
    color: rgba(255, 255, 255, 0.7);
    padding: 64px 0 28px;
}
.footer-grid {
    display: grid;
    /* 第一列(品牌)与后续列间距拉开；联系方式列进一步加宽 */
    grid-template-columns: 1.8fr 0.85fr 1fr 2fr 1fr;
    gap: 32px 72px;
}
.footer-brand .logo-full-img {
    height: 40px;
    margin-bottom: 16px;
    /* 深色页脚上 logo 全部转白 */
    filter: brightness(0) invert(1);
}
.footer-brand p {
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.8;
    font-size: 0.92rem;
}
.footer-col h5 {
    color: #fff;
    font-size: 1.05rem;
    margin-bottom: 18px;
    font-weight: 600;
}
.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}
.footer-col li {
    margin-bottom: 10px;
}
.footer-col a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s ease;
}
.footer-col a:hover {
    color: var(--accent-light);
}
.footer-contact .ic {
    display: none;
}
.footer-wechat .wechat-qr {
    width: 100%;           /* 撑满列宽，与标题/提示文字左右边缘对齐 */
    max-width: 150px;
    aspect-ratio: 1 / 1;   /* 保持正方形，二维码完整显示 */
    height: auto;
    background: #fff;
    border-radius: var(--radius);
    overflow: hidden;
    padding: 6px;
}
.footer-wechat .qr-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.footer-wechat .wechat-tip {
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.82rem;
    margin-top: 10px;
}
.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 40px;
    padding-top: 20px;
}
.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 24px;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.45);
}
.footer-meta a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
}
.footer-meta a:hover {
    color: var(--accent-light);
}

/* ---------- 导航橙条（JS 注入，跟随鼠标 / 常驻当前页） ---------- */
.nav-menu {
    position: relative;
}
.nav-indicator {
    position: absolute;
    bottom: -6px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    opacity: 0;
    pointer-events: none;
    transition: left 0.25s ease, width 0.25s ease, opacity 0.2s ease;
}
.nav-indicator-hover {
    z-index: 2;
}

/* ---------- 回到顶部 ---------- */
.back-to-top {
    position: fixed;
    right: 24px;
    bottom: 24px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 999px;
    background: transparent;
    color: var(--text-sub);
    border: 1px solid #b6bfc9;
    font-size: 12px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.3s ease;
    z-index: 800;
}
.back-to-top.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.back-to-top:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: #fff;
}
.back-to-top svg {
    width: 14px;
    height: 14px;
}
.back-to-top span {
    line-height: 1;
}

/* ---------- 灯箱 ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 40px;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
    z-index: 1200;
}
.lightbox.active {
    opacity: 1;
    visibility: visible;
}
.lightbox-close {
    position: absolute;
    top: 24px;
    right: 32px;
    font-size: 36px;
    line-height: 1;
    color: #fff;
    background: none;
    border: none;
    cursor: pointer;
}
.lightbox-close:hover {
    opacity: 0.7;
}
#lightbox-img {
    max-width: 90%;
    max-height: 80%;
    border-radius: var(--radius);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}
#lightbox-caption {
    color: #fff;
    font-size: 0.95rem;
}

/* ---------- 主题切换 ---------- */
.theme-switcher {
    position: fixed;
    right: 24px;
    bottom: 88px; /* 悬浮于回到顶部按钮上方，不与页脚内容重叠 */
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}
.theme-switcher > button {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--white);
    color: var(--text-main);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    cursor: pointer;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease, background 0.15s ease;
}
.theme-switcher > button:hover {
    transform: translateY(-2px);
}
.theme-menu {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
    padding: 8px;
    display: none;
    flex-direction: column;
    gap: 2px;
    min-width: 200px;
}
.theme-switcher.open .theme-menu {
    display: flex;
}
.theme-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    border: none;
    background: transparent;
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 13px;
    color: var(--text-main);
    cursor: pointer;
    text-align: left;
    transition: background 0.15s ease;
}
.theme-menu button:hover {
    background: #f3f4f6;
}
.theme-menu button.active {
    background: var(--bg-gray);
}
.theme-menu .swatch {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    flex: 0 0 auto;
}
.theme-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--accent);
}
.theme-arrow {
    font-size: 10px;
}

/* ---------- 移动端汉堡按钮 ---------- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 40px;
    height: 40px;
    cursor: pointer;
}
.nav-toggle span {
    display: block;
    height: 2px;
    width: 22px;
    background: var(--primary);
    border-radius: 2px;
    transition: all 0.25s ease;
}
.nav-toggle.active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---------- 响应式 ---------- */
@media (max-width: 992px) {
    .footer-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 768px) {
    .page-banner {
        padding: 88px 0 28px;
    }
    .page-banner h1 {
        font-size: 1.4rem;
    }
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .nav-toggle {
        display: flex;
    }
    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        background: #fff;
        padding: 16px;
        gap: 4px;
        box-shadow: var(--shadow-md);
        transform: translateY(-200%);
        visibility: hidden;
        transition: transform 0.3s ease, visibility 0.3s ease;
    }
    .nav-menu.active {
        transform: translateY(0);
        visibility: visible;
    }
    .nav-indicator {
        display: none;
    }
    .nav-dropdown {
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        box-shadow: none;
        background: var(--bg-light);
        padding: 0 0 8px 16px;
    }
    .nav-menu li.has-dropdown.open .nav-dropdown {
        display: block;
    }
    .back-to-top {
        right: 16px;
        bottom: 16px;
    }
}
@media (max-width: 560px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- 主题变量覆盖（与主题切换器色板对应） ---------- */
html.theme-a {
    --primary: #1a3a5c;
    --primary-light: #2c5680;
    --primary-dark: #0f2942;
    --accent: #1ba3a3;
    --accent-light: #4cc7c7;
    --accent-dark: #138585;
}
html.theme-b {
    --primary: #2b2f77;
    --primary-light: #444aa0;
    --primary-dark: #191c4a;
    --accent: #00b4d8;
    --accent-light: #4fd6f2;
    --accent-dark: #0090ad;
}
html.theme-c {
    --primary: #14403a;
    --primary-light: #1f6157;
    --primary-dark: #0c2723;
    --accent: #c9a24b;
    --accent-light: #e2c07f;
    --accent-dark: #a8842f;
}
html.theme-d {
    --primary: #16324f;
    --primary-light: #23507c;
    --primary-dark: #0c1f33;
    --accent: #ff7a2f;
    --accent-light: #ffa266;
    --accent-dark: #e05e12;
}
html.theme-e {
    --primary: #0f3d3e;
    --primary-light: #1a615f;
    --primary-dark: #082726;
    --accent: #2bd96b;
    --accent-light: #6fe89c;
    --accent-dark: #1cae51;
}
html.theme-f {
    --primary: #1a2546;
    --primary-light: #2c3a6e;
    --primary-dark: #0e1530;
    --accent: #ff4d6d;
    --accent-light: #ff7e96;
    --accent-dark: #e23050;
}
html.theme-g {
    --primary: #286fb4;
    --primary-light: #4a8fcf;
    --primary-dark: #18456f;
    --accent: #df4c73;
    --accent-light: #ef7e9b;
    --accent-dark: #c4345a;
}
