/* 基础样式变量 */
:root {
    --primary-color: #1d1d1f;
    --accent-color: #0071e3;
    --light-bg: #f5f5f7;
    --text-color: #1d1d1f;
    --border-color: #d2d2d7;
    --text-secondary: #86868b;
    --body-bg: #ffffff;
    --navbar-bg: rgba(255, 255, 255, 0.98);
    --card-bg: #ffffff;
    --footer-bg: var(--primary-color);
    --footer-text: #ffffff;
    --feature-text-color: #555555;
    --hamburger-color: var(--primary-color);
    --nav-mobile-bg: #ffffff;
    --card-shadow: rgba(0, 0, 0, 0.02);
    --scrollbar-track: var(--light-bg);
    --scrollbar-thumb: var(--primary-color);
    --nav-mobile-border: var(--border-color);
    --banner-overlay-bg: rgba(0, 0, 0, 0.45);
    --banner-sub-color: rgba(255, 255, 255, 0.9);
    --link-hover: #005bb5;
    --card-img-bg: var(--light-bg);
    --card-img-border: var(--border-color);
    --card-title: var(--primary-color);
    --nav-link-border: var(--border-color);
    --nav-mobile-shadow: rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] {
    --primary-color: #f5f5f7;
    --accent-color: #2997ff;
    --light-bg: #1c1c1e;
    --text-color: #f5f5f7;
    --border-color: #38383a;
    --text-secondary: #98989d;
    --body-bg: #000000;
    --navbar-bg: rgba(28, 28, 30, 0.98);
    --card-bg: #1c1c1e;
    --footer-bg: #1c1c1e;
    --footer-text: #f5f5f7;
    --feature-text-color: #a1a1a6;
    --hamburger-color: #f5f5f7;
    --nav-mobile-bg: #1c1c1e;
    --card-shadow: rgba(255, 255, 255, 0.05);
    --scrollbar-track: #1c1c1e;
    --scrollbar-thumb: #98989d;
    --nav-mobile-border: #38383a;
    --banner-overlay-bg: rgba(0, 0, 0, 0.6);
    --banner-sub-color: rgba(255, 255, 255, 0.85);
    --link-hover: #64b5f6;
    --card-img-bg: #2c2c2e;
    --card-img-border: #38383a;
    --card-title: #f5f5f7;
    --nav-link-border: #38383a;
    --nav-mobile-shadow: rgba(0, 0, 0, 0.4);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family:
        "Segoe UI",
        system-ui,
        -apple-system,
        sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: var(--body-bg);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 通用版块样式 */
.section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 1rem;
    flex: 1;
}

.section h2 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-weight: 600;
}

/* 通用标题 */
.section-title {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 3rem;
    color: var(--primary-color);
    font-weight: 600;
}

.section-title::after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 0.8rem auto 0;
    border-radius: 2px;
}

/* 通用文本 */
.section-text {
    text-align: center;
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--feature-text-color);
    max-width: 700px;
    margin: 0 auto;
}

.section-text a {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.section-text a:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* 成员区块 */
.member-section {
    max-width: 700px;
    margin: 0 auto 3rem;
    text-align: center;
}

.member-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* 导航栏样式 */
.navbar {
    background: var(--navbar-bg);
    padding: 1rem;
    position: sticky;
    top: 0;
    z-index: 250;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.navbar.shrink {
    padding: 0.5rem 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.nav-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 36px;
    width: auto;
    transition: height 0.3s ease;
}

.navbar.shrink .nav-logo img {
    height: 28px;
}

.nav-site-name {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
    white-space: nowrap;
}

.nav-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.nav-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: color 0.2s ease;
    border-radius: 4px;
}

.nav-link:hover,
.nav-link.active {
    color: var(--accent-color);
}

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 36px;
    height: 36px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 300;
}

.hamburger-line {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--hamburger-color);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.hamburger-line:nth-child(1) {
    margin-bottom: 6px;
}

.hamburger-line:nth-child(2) {
    margin-bottom: 6px;
}

.hamburger.active .hamburger-line:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}

.hamburger.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.hamburger.active .hamburger-line:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* 页面横幅 - 图片背景 + 居中粗体文本 */
.page-banner {
    position: relative;
    width: 100%;
    min-height: 520px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
}

.banner-overlay {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2.5rem 3rem;
}

.banner-overlay .banner-icon {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 1.2rem;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.3));
}

.banner-overlay h1 {
    font-size: 3.2rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.banner-overlay p {
    font-size: 1.25rem;
    color: var(--banner-sub-color);
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .page-banner {
        min-height: 380px;
    }

    .banner-overlay .banner-icon {
        width: 90px;
        height: 90px;
    }

    .banner-overlay h1 {
        font-size: 2.2rem;
    }

    .banner-overlay p {
        font-size: 1rem;
    }
}

/* 首页英雄区 */
.hero {
    background: var(--light-bg);
    color: var(--primary-color);
    padding: 6rem 1rem;
    text-align: center;
    position: relative;
    flex: 1;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.hero p {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* 网格布局（产品/文档通用） */
.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

/* 卡片样式 */
.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--card-bg);
    box-shadow: 0 4px 6px var(--card-shadow);
}

/* 图片占位框 */
.card-img {
    width: 100%;
    height: 200px;
    background: var(--card-img-bg);
    border-bottom: 1px solid var(--card-img-border);
}

.card-content {
    padding: 1.5rem;
}

.card-content h3 {
    margin-bottom: 0.5rem;
    color: var(--card-title);
    font-weight: 600;
}

.card-content p {
    color: var(--text-secondary);
}

/* 通用左右布局：左图，右上文本，右下链接 */
.feature-layout {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 3rem;
    align-items: center;
    width: 900px;
    margin: 0 auto;
}

.feature-layout .feature-img {
    width: 360px;
    height: 240px;
    object-fit: contain;
    border-radius: 12px;
    display: block;
}

.feature-layout .feature-text {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    overflow: hidden;
}

.feature-layout .feature-text h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--primary-color);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-layout .feature-text p {
    font-size: 1.05rem;
    line-height: 1.8;
    color: var(--feature-text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.feature-layout .feature-text .feature-link {
    color: var(--accent-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 1.05rem;
    transition: color 0.2s ease;
    display: inline-block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.feature-layout .feature-text .feature-link:hover {
    color: var(--link-hover);
    text-decoration: underline;
}

/* 关于我们版块 */
.about-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}

.about-img {
    width: 100%;
    height: 350px;
    background: var(--light-bg);
    border-radius: 8px;
}

.about-content {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.about-content p {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--about-text);
}

/* 时间轴样式 */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 2rem;
    border-left: 3px solid var(--primary-color);
}

.timeline-item {
    position: relative;
    margin-bottom: 2rem;
    padding-left: 1.5rem;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: -2.4rem;
    top: 0.5rem;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: var(--accent-color);
}

.timeline-item h4 {
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.timeline-item p {
    color: #666;
}

/* 页脚 */
.footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 2rem 1rem;
    margin-top: auto;
}

/* 产品横向滚动容器样式 */
.products-scroll-container {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    padding-bottom: 1rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.products-scroll-container .card {
    flex-shrink: 0;
    width: 300px;
    scroll-snap-align: start;
}

.products-scroll-container::-webkit-scrollbar {
    height: 6px;
}

.products-scroll-container::-webkit-scrollbar-track {
    background: var(--light-bg);
    border-radius: 3px;
}

.products-scroll-container::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
    opacity: 0.7;
}

.products-scroll-container::-webkit-scrollbar-thumb:hover {
    opacity: 1;
}

/* 响应式导航 - 窄窗口汉堡菜单 */
@media (max-width: 960px) {
    .hamburger {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: var(--nav-mobile-bg);
        flex-direction: column;
        padding: 4.5rem 1.5rem 2rem;
        gap: 0;
        box-shadow: -8px 0 24px var(--nav-mobile-shadow);
        transform: translateX(100%);
        z-index: 200;
        overflow-y: auto;
        transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-link {
        padding: 1rem 0.5rem;
        border-bottom: 1px solid var(--nav-link-border);
        width: 100%;
        text-align: left;
        font-size: 1.05rem;
        transition: background 0.2s ease;
    }

    .nav-link:hover {
        background: var(--light-bg);
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .contact-container {
        grid-template-columns: 1fr;
    }

    .about-container {
        grid-template-columns: 1fr;
    }

    .feature-layout {
        grid-template-columns: 1fr;
        max-width: 400px;
        text-align: center;
    }

    .feature-layout .feature-img {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 3 / 2;
        margin: 0 auto;
    }

    .feature-layout .feature-text {
        align-items: center;
    }

    .feature-layout .feature-text .feature-link {
        display: inline-block;
    }
}

/* 移动端菜单遮罩 - 仅在窄窗口生效 */
.nav-backdrop {
    display: none;
}

@media (max-width: 960px) {
    .nav-backdrop {
        display: block;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 150;
        opacity: 0;
        transition: opacity 0.35s ease;
        pointer-events: none;
    }

    .nav-backdrop.active {
        opacity: 1;
        pointer-events: auto;
    }
}

/* 禁止背景滚动 */
body.menu-open {
    overflow: hidden;
}

/* 主题切换按钮 */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    transition: color 0.2s ease;
    margin-left: 0.5rem;
}

.theme-toggle:hover {
    color: var(--accent-color);
}

.theme-toggle svg {
    width: 20px;
    height: 20px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
    display: none;
}

[data-theme="light"] .theme-toggle .icon-sun,
[data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* 语言切换按钮 */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.5rem;
    padding-left: 0.5rem;
    border-left: 1px solid var(--border-color);
}

.lang-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    border-radius: 4px;
    transition: all 0.2s ease;
}

.lang-btn:hover {
    color: var(--accent-color);
}

.lang-btn.active {
    color: var(--accent-color);
    background: var(--light-bg);
}

.nav-actions {
    display: flex;
    align-items: center;
}

@media (max-width: 960px) {
    .lang-switcher {
        border-left: none;
        margin-left: 0;
        padding-left: 0;
        margin-top: 1rem;
        padding-top: 1rem;
        border-top: 1px solid var(--nav-link-border);
        justify-content: center;
    }

    .theme-toggle {
        margin-left: 0;
    }

    .nav-actions {
        flex-direction: column;
        align-items: center;
    }
}
