/* 全局重置与基础 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #0066a0;
    --primary-dark: #004b7a;
    --primary-light: #3399cc;
    --accent: #00a86b;
    --bg: #f0f4f8;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(255, 255, 255, 0.3);
    --text: #1a2a3a;
    --text-light: #4a5a6a;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.06);
    --radius: 16px;
    --transition: 0.3s ease;
    --glass-blur: blur(12px);
    --max-width: 1200px;
    --gradient-bg: linear-gradient(135deg, #0066a0, #00a86b, #3399cc);
    --gradient-banner: linear-gradient(135deg, #004b7a 0%, #0066a0 50%, #00a86b 100%);
    --nav-bg: rgba(255, 255, 255, 0.85);
    --footer-bg: #1a2a3a;
    --footer-text: #c0d0e0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1b2a;
        --card-bg: rgba(30, 50, 70, 0.7);
        --card-border: rgba(255, 255, 255, 0.08);
        --text: #e0e8f0;
        --text-light: #a0b0c0;
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        --nav-bg: rgba(13, 27, 42, 0.9);
        --footer-bg: #0a1520;
        --footer-text: #8090a0;
        --gradient-bg: linear-gradient(135deg, #003355, #007755, #226688);
        --gradient-banner: linear-gradient(135deg, #002244 0%, #004466 50%, #006655 100%);
    }
}

/* 容器 */
header, section, footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 20px;
}

/* 导航 */
header nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    background: var(--nav-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
    margin: 0 auto;
    max-width: var(--max-width);
    border: 1px solid var(--card-border);
    transition: background var(--transition);
}

header nav > a {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    letter-spacing: 1px;
    background: var(--gradient-bg);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header nav ul {
    list-style: none;
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

header nav ul li a {
    text-decoration: none;
    color: var(--text);
    font-weight: 500;
    padding: 8px 14px;
    border-radius: 30px;
    transition: all var(--transition);
    background: transparent;
    font-size: 0.95rem;
}

header nav ul li a:hover {
    background: var(--primary);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 102, 160, 0.3);
}

/* Banner 渐变区域 */
header > div {
    text-align: center;
    padding: 80px 20px 60px;
    background: var(--gradient-banner);
    border-radius: var(--radius);
    margin: 20px 0 40px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.8s ease;
}

header > div::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    animation: rotateGlow 20s linear infinite;
}

@keyframes rotateGlow {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

header > div h1 {
    font-size: 2.8rem;
    color: #fff;
    text-shadow: 0 4px 20px rgba(0,0,0,0.2);
    margin-bottom: 16px;
    letter-spacing: 2px;
    position: relative;
    z-index: 1;
}

header > div p {
    font-size: 1.3rem;
    color: rgba(255,255,255,0.9);
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    font-weight: 300;
}

/* 通用section */
section {
    margin: 60px auto;
    padding: 20px;
    animation: fadeInUp 0.6s ease both;
}

section:nth-child(2) { animation-delay: 0.1s; }
section:nth-child(3) { animation-delay: 0.2s; }
section:nth-child(4) { animation-delay: 0.3s; }
section:nth-child(5) { animation-delay: 0.4s; }
section:nth-child(6) { animation-delay: 0.5s; }
section:nth-child(7) { animation-delay: 0.6s; }
section:nth-child(8) { animation-delay: 0.7s; }
section:nth-child(9) { animation-delay: 0.8s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

h2 {
    font-size: 2rem;
    margin-bottom: 32px;
    color: var(--primary);
    position: relative;
    display: inline-block;
    padding-bottom: 8px;
}

h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: var(--gradient-bg);
    border-radius: 2px;
}

/* 卡片通用 */
section > div, section > article, #products > div, #solutions article, #cases article, #news article {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 24px;
    margin-bottom: 24px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
}

section > div:hover, section > article:hover, #products > div > article:hover, #solutions article:hover, #cases article:hover, #news article:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.1);
}

/* 产品网格 */
#products > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    background: transparent;
    backdrop-filter: none;
    border: none;
    box-shadow: none;
    padding: 0;
    margin: 0;
}

#products > div > article {
    margin: 0;
}

#products h3, #solutions h3, #cases h3, #news h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--primary-dark);
}

#products p, #solutions p, #cases p, #news p {
    color: var(--text-light);
    font-size: 0.95rem;
}

/* 新闻中心特殊样式 */
#news article {
    position: relative;
    padding: 20px 24px;
}

#news article h3 {
    font-size: 1.15rem;
    margin-bottom: 6px;
}

#news article p:first-of-type {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 8px;
}

#news article a {
    display: inline-block;
    margin-top: 10px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color var(--transition);
}

#news article a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* FAQ details 样式 */
#faq details {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px 20px;
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    transition: all var(--transition);
    cursor: pointer;
}

#faq details:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
}

#faq summary {
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--primary-dark);
    outline: none;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
}

#faq summary::-webkit-details-marker {
    display: none;
}

#faq summary::before {
    content: '▸';
    transition: transform 0.3s;
    color: var(--primary);
    font-size: 1.2rem;
}

#faq details[open] summary::before {
    transform: rotate(90deg);
}

#faq details p {
    margin-top: 12px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* HowTo 样式 */
#howto {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 32px;
    box-shadow: var(--shadow);
}

#howto h2 {
    margin-top: 0;
}

#howto ol {
    padding-left: 24px;
    margin: 16px 0;
}

#howto ol li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: var(--text);
}

#howto ol li strong {
    color: var(--primary);
}

#howto p {
    color: var(--text-light);
    margin-bottom: 8px;
}

/* 联系我们 */
#contact {
    text-align: center;
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 40px 24px;
    box-shadow: var(--shadow);
}

#contact p {
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--text-light);
}

#contact p:first-of-type {
    font-weight: 600;
    color: var(--text);
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 40px 20px 24px;
    border-radius: var(--radius) var(--radius) 0 0;
    margin-top: 60px;
    text-align: center;
    max-width: 100%;
    width: 100%;
}

footer nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 24px;
}

footer nav a {
    color: var(--footer-text);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color var(--transition);
}

footer nav a:hover {
    color: #fff;
}

footer p {
    font-size: 0.85rem;
    margin-bottom: 8px;
    opacity: 0.8;
}

footer a {
    color: var(--primary-light);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* 滚动动画（基于Intersection Observer 由JS触发，这里预留样式） */
.scroll-animate {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.scroll-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* 响应式 */
@media (max-width: 768px) {
    header nav {
        flex-direction: column;
        gap: 12px;
        padding: 12px 16px;
    }

    header nav ul {
        justify-content: center;
        gap: 6px;
    }

    header nav ul li a {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    header > div {
        padding: 50px 16px 40px;
    }

    header > div h1 {
        font-size: 1.8rem;
    }

    header > div p {
        font-size: 1rem;
    }

    h2 {
        font-size: 1.5rem;
    }

    #products > div {
        grid-template-columns: 1fr;
    }

    section {
        margin: 40px auto;
        padding: 12px;
    }

    #howto {
        padding: 20px;
    }

    footer nav {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    header > div h1 {
        font-size: 1.4rem;
    }

    header > div p {
        font-size: 0.9rem;
    }

    header nav ul {
        gap: 4px;
    }

    header nav ul li a {
        font-size: 0.75rem;
        padding: 4px 10px;
    }

    #faq summary {
        font-size: 0.95rem;
    }
}

/* 辅助类 */
a {
    color: var(--primary);
    transition: color var(--transition);
}

a:hover {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

/* 平滑滚动 */
html {
    scroll-padding-top: 80px;
}

/* 选中文字颜色 */
::selection {
    background: var(--primary);
    color: #fff;
}