/* 全局样式 */

/* ========== CSS 变量 ========== */
:root {
    /* 品牌色 */
    --color-brand: #00a595;
    --color-brand-light: #00c4b4;
    --color-brand-dark: #00867a;

    /* 中性色 */
    --color-gray-50: #f9fafb;
    --color-gray-100: #f3f4f6;
    --color-gray-200: #e5e7eb;
    --color-gray-300: #d1d5db;
    --color-gray-400: #9ca3af;
    --color-gray-500: #6b7280;
    --color-gray-600: #4b5563;
    --color-gray-700: #374151;
    --color-gray-800: #1f2937;
    --color-gray-900: #111827;

    /* 语义色 */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;

    /* 背景/前景色 */
    --color-bg: #ffffff;
    --color-bg-subtle: #f9fafb;
    --color-text: #111827;
    --color-text-muted: #6b7280;
    --color-border: #e5e7eb;

    /* 字体 */
    --font-family-sans: 'Noto Sans SC', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    --font-family-mono: 'JetBrains Mono', 'Fira Code', Consolas, Monaco, 'Courier New', monospace;

    /* 字体大小 */
    --text-2xs: clamp(0.625rem, 0.6rem + 0.125vw, 0.75rem);
    --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
    --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
    --text-base: clamp(1rem, 0.9rem + 0.5vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
    --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
    --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 1.875rem);
    --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.25rem);
    --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3rem);
    --text-5xl: clamp(3rem, 2.25rem + 3.75vw, 3.75rem);
    --text-6xl: clamp(3.75rem, 2.75rem + 5vw, 4.5rem);

    /* 行高 */
    --leading-tight: 1.1;
    --leading-snug: 1.25;
    --leading-normal: 1.5;
    --leading-relaxed: 1.625;
    --heading-margin-bottom: clamp(0.5rem, 0.4rem + 0.5vw, 1rem);

    /* 间距 */
    --space-1: clamp(0.25rem, 0.2rem + 0.25vw, 0.375rem);
    --space-2: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --space-3: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --space-4: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --space-5: clamp(1.25rem, 1rem + 1.25vw, 2rem);
    --space-6: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
    --space-8: clamp(2rem, 1.6rem + 2vw, 3rem);
    --space-10: clamp(2.5rem, 2rem + 2.5vw, 4rem);
    --space-12: clamp(3rem, 2.4rem + 3vw, 5rem);
    --space-16: clamp(4rem, 3.2rem + 4vw, 6rem);

    /* Header 高度 */
    --header-height: clamp(56px, 2.38vw + 37.73px, 72px);

    /* 圆角 */
    --radius-sm: clamp(0.25rem, 0.2rem + 0.25vw, 0.375rem);
    --radius-md: clamp(0.375rem, 0.3rem + 0.375vw, 0.5rem);
    --radius-lg: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --radius-xl: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --radius-2xl: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --radius-full: 9999px;

    /* Gap 间距 */
    --gap-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
    --gap-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
    --gap-md: clamp(0.75rem, 0.6rem + 0.75vw, 1rem);
    --gap-lg: clamp(1rem, 0.8rem + 1vw, 1.5rem);
    --gap-xl: clamp(1.25rem, 1rem + 1.25vw, 2rem);
    --gap-2xl: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
    --gap-3xl: clamp(2rem, 1.6rem + 2vw, 3rem);

    /* 阴影 */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);

    /* 过渡 */
    --transition-fast: 150ms ease;
    --transition-normal: 300ms ease;
    --transition-slow: 500ms ease;
}

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    border: none;
    background: none;
    appearance: none;
}

html, body {
    width: 100%;
    height: 100%;
}

body {
    font-family: var(--font-family-sans);
    font-size: var(--text-base);
    line-height: var(--leading-normal);
    color: var(--color-text);
    background-color: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-sans);
    font-weight: 600;
    line-height: var(--leading-tight);
    color: var(--color-text);
    margin-bottom: var(--heading-margin-bottom);
}

h1 { font-size: var(--text-5xl); line-height: var(--leading-snug); }
h2 { font-size: var(--text-4xl); line-height: var(--leading-snug); }
h3 { font-size: var(--text-3xl); line-height: var(--leading-snug); }
h4 { font-size: var(--text-2xl); line-height: var(--leading-snug); }
h5 { font-size: var(--text-xl); line-height: var(--leading-snug); }
h6 { font-size: var(--text-lg); line-height: var(--leading-snug); }

p { margin-bottom: var(--space-4); }

a {
    color: var(--color-brand);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover { color: var(--color-brand-light); }

.text-xs { font-size: var(--text-xs); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: var(--color-gray-100); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb { background: var(--color-gray-300); border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: var(--color-gray-400); }

/* ========== 页头全局样式 ========== */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background-color: var(--color-bg);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.container {
    width: 92%;
    max-width: 1400px;
    margin: 0 auto;
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
}

.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--color-brand);
    font-size: var(--text-xl);
    font-weight: 700;
}

.logo img {
    max-width: clamp(150px, 14.7vw, 206px);
    width: 100%;
    height: auto;
}

/* 导航 */
.site-nav {
    display: flex;
    align-items: center;
    margin-left: auto;
    margin-right: var(--space-6);
}

.nav-list {
    display: flex;
    align-items: center;
    gap: var(--gap-2xl);
    list-style: none;
}

.nav-link {
    display: block;
    padding: var(--space-2) 0;
    color: var(--color-text);
    font-size: var(--text-sm);
    font-weight: 400;
}

/* 右侧操作区 */
.header-actions {
    display: flex;
    align-items: center;
    gap: var(--gap-md);
}

/* 语言切换 */
.language-switcher {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: var(--gap-xs);
    padding: var(--space-2) var(--space-3);
    border: 0;
    color: var(--color-text);
    font-size: var(--text-sm);
    cursor: pointer;
}

.lang-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
}

.lang-dropdown {
    position: absolute;
    top: calc(100% + var(--space-2));
    right: 0;
    min-width: 120px;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
}

.lang-dropdown.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-dropdown li a {
    display: block;
    padding: var(--space-3) var(--space-4);
    color: var(--color-text);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: background-color var(--transition-fast);
}

.lang-dropdown li a:hover {
    background-color: var(--color-bg-subtle);
    color: var(--color-brand);
}

/* ========== 移动端菜单 - Checkbox Hack ========== */
.mobile-menu-toggle {
    display: none;
}

.mobile-menu-btn {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    padding: var(--space-2);
    background: transparent;
    border-radius: var(--radius-md);
    cursor: pointer;
    position: relative;
    z-index: 1001;
}

.hamburger-line {
    display: block;
    width: 20px;
    height: 2px;
    background-color: var(--color-text);
    border-radius: 2px;
    transition: all var(--transition-fast);
}

/* Checkbox 选中时的汉堡按钮动画 */
#mobileMenuToggle:checked ~ .header-actions .mobile-menu-btn .hamburger-line:nth-child(1),
.header-inner:has(#mobileMenuToggle:checked) .mobile-menu-btn .hamburger-line:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}

#mobileMenuToggle:checked ~ .header-actions .mobile-menu-btn .hamburger-line:nth-child(2),
.header-inner:has(#mobileMenuToggle:checked) .mobile-menu-btn .hamburger-line:nth-child(2) {
    opacity: 0;
}

#mobileMenuToggle:checked ~ .header-actions .mobile-menu-btn .hamburger-line:nth-child(3),
.header-inner:has(#mobileMenuToggle:checked) .mobile-menu-btn .hamburger-line:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ========== 页脚 ========== */
.site-footer {
    padding: var(--space-16) 0 var(--space-8);
    background-color: var(--color-gray-900);
    color: var(--color-gray-300);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1.5fr;
    gap: var(--gap-3xl);
    margin-bottom: var(--space-12);
}

.footer-section {
    min-width: 0;
}

.footer-title,
.footer-subtitle {
    font-weight: 600;
    color: #ffffff;
    margin-bottom: var(--space-4);
}

.footer-title { font-size: var(--text-xl); }
.footer-subtitle { font-size: var(--text-base); }

.footer-desc {
    font-size: var(--text-sm);
    line-height: var(--leading-relaxed);
    color: var(--color-gray-400);
    margin-bottom: 0;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: var(--space-3);
}

.footer-links a {
    color: var(--color-gray-400);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-contact {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-contact li {
    font-size: var(--text-sm);
    color: var(--color-gray-400);
    margin-bottom: var(--space-3);
    line-height: var(--leading-relaxed);
}

.social-links {
    display: flex;
    gap: var(--gap-md);
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--color-gray-800);
    border-radius: var(--radius-full);
    color: var(--color-gray-400);
    font-size: var(--text-sm);
    text-decoration: none;
    transition: all var(--transition-fast);
}

.social-link:hover {
    background: var(--color-brand);
    color: #ffffff;
}

/* 底部版权信息 */
.footer-bottom {
    padding-top: var(--space-8);
    border-top: 1px solid var(--color-gray-800);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright,
.icp {
    font-size: var(--text-sm);
    color: var(--color-gray-500);
    margin-bottom: 0;
}

/* ========== 页面标题 Banner ========== */
.page-banner {
    position: relative;
    padding: calc(var(--space-16) + var(--header-height) + 10px) 0 var(--space-16);
    text-align: center;
    margin-top: var(--header-height);
    overflow: hidden;
}
.page-banner .banner-overlay {
    position: absolute;
    inset: 0;
    background-color: var(--color-brand);
    opacity: 0.3;
    pointer-events: none;
    z-index: 1;
}
.page-banner .banner-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.page-banner::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(249, 250, 251, 0.1) 0%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.page-banner .container {
    position: relative;
    z-index: 1;
}

.page-title {
    font-size: var(--text-4xl);
    font-weight: 700;
    color: #ffffff;
    margin-bottom: var(--space-4);
    text-align: left;
}

.page-desc {
    font-size: var(--text-lg);
    color: #ffffff;
    margin-bottom: 0;
    text-align: left;
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
    .page-title {
        font-size: var(--text-4xl);
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--gap-xl);
    }

    /* 快速导航移到最后 */
    .footer-nav-section {
        order: 3;
    }

    /* 快速导航链接横排 */
    .footer-nav-section .footer-links {
        display: flex;
        flex-wrap: wrap;
        gap: var(--space-4);
    }

    .footer-nav-section .footer-links li {
        margin: 0;
    }
}

@media (max-width: 768px) {
    .page-banner {
        padding: calc(var(--space-10) + var(--header-height)) 0 var(--space-8);
    }

    .page-title {
        font-size: var(--text-3xl);
    }

    .page-desc {
        font-size: var(--text-base);
    }

    /* 页头响应式 */
    .header-inner {
        flex-wrap: wrap;
        position: relative;
    }

    .site-nav {
        display: none;
    }

    .header-actions {
        margin-left: auto;
        gap: var(--space-3);
    }

    .mobile-menu-btn {
        display: flex;
    }

    /* Checkbox 选中时导航全屏显示 */
    #mobileMenuToggle:checked ~ .site-nav,
    .header-inner:has(#mobileMenuToggle:checked) .site-nav {
        display: block;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--color-bg);
        z-index: 999;
        padding: var(--space-6);
        overflow-y: auto;
    }

    #mobileMenuToggle:checked ~ .site-nav .nav-list,
    .header-inner:has(#mobileMenuToggle:checked) .site-nav .nav-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
    }

    #mobileMenuToggle:checked ~ .site-nav .nav-item,
    .header-inner:has(#mobileMenuToggle:checked) .site-nav .nav-item {
        width: 100%;
    }

    #mobileMenuToggle:checked ~ .site-nav .nav-link,
    .header-inner:has(#mobileMenuToggle:checked) .site-nav .nav-link {
        padding: var(--space-4) var(--space-3);
        font-size: var(--text-lg);
        border-radius: var(--radius-md);
    }

    #mobileMenuToggle:checked ~ .site-nav .nav-link:active,
    .header-inner:has(#mobileMenuToggle:checked) .site-nav .nav-link:active {
        background: var(--color-bg-subtle);
    }

    .lang-current {
        display: none;
    }

    .lang-btn {
        padding: var(--space-2) 0;
    }

    /* 页脚响应式 */
    .site-footer {
        padding: var(--space-8) 0;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--gap-lg);
    }

    /* 隐藏快速导航 */
    .footer-nav-section {
        display: none;
    }

    .footer-bottom {
        flex-direction: column;
        gap: var(--space-3);
        text-align: center;
    }
}
