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

:root {
    --primary: #1a3a5c;
    --primary-light: #2a5a8c;
    --primary-dark: #0f2136;
    --accent: #f0a500;
    --accent-light: #ffc233;
    --bg: #f5f7fa;
    --card-bg: rgba(255, 255, 255, 0.75);
    --text: #1a1a2e;
    --text-light: #555;
    --glass: rgba(255, 255, 255, 0.2);
    --glass-border: rgba(255, 255, 255, 0.3);
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --radius: 16px;
    --transition: 0.3s ease;
    --max-width: 1200px;
    --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

/* 暗色模式 */
@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0d1117;
        --card-bg: rgba(30, 40, 60, 0.75);
        --text: #e6edf3;
        --text-light: #8b949e;
        --shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
        --glass: rgba(255, 255, 255, 0.05);
        --glass-border: rgba(255, 255, 255, 0.1);
    }
}

/* 基础样式 */
html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.7;
    overflow-x: hidden;
    transition: background var(--transition), color var(--transition);
}

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

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

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

/* 滚动动画基础 */
section {
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.8s ease forwards;
}

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; }
section:nth-child(10) { animation-delay: 0.9s; }
section:nth-child(11) { animation-delay: 1.0s; }
section:nth-child(12) { animation-delay: 1.1s; }
section:nth-child(13) { animation-delay: 1.2s; }

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

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: background var(--transition);
}

nav {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0.8rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

nav a[title="酷超网络首页"] {
    flex-shrink: 0;
}

nav ul {
    list-style: none;
    display: flex;
    gap: 1.2rem;
    flex-wrap: wrap;
    padding: 0.5rem 0;
}

nav ul li a {
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 500;
    color: var(--text);
    position: relative;
    transition: background var(--transition), color var(--transition);
}

nav ul li a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width var(--transition);
}

nav ul li a:hover {
    background: var(--glass);
    color: var(--accent);
}

nav ul li a:hover::after {
    width: 60%;
}

/* 主内容区 */
main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem 4rem;
}

/* 通用标题 */
h1, h2, h3, h4 {
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.8rem; color: var(--primary); }
h3 { font-size: 1.3rem; color: var(--primary-light); }
h4 { font-size: 1.1rem; }

/* 卡片通用样式 */
section {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

section:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

/* Banner 渐变 */
#banner {
    background: linear-gradient(135deg, #1a3a5c 0%, #2a5a8c 40%, #1a3a5c 100%);
    color: #fff;
    border: none;
    text-align: center;
    padding: 4rem 2.5rem;
    position: relative;
    overflow: hidden;
}

#banner::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 50%, rgba(240,165,0,0.15) 0%, transparent 60%);
    animation: bannerGlow 10s ease-in-out infinite alternate;
}

@keyframes bannerGlow {
    0% { transform: translate(0, 0); }
    100% { transform: translate(10%, 10%); }
}

#banner h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

#banner p {
    font-size: 1.1rem;
    max-width: 800px;
    margin: 0.8rem auto;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

/* 圆角卡片细节 */
#about, #services, #solutions, #cases, #reviews, #news, #faq, #howto, #contact, #sitemap, #friends {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

#about h3, #services h3, #solutions h3, #cases h3, #reviews h3, #news h3, #howto h3, #howto h4 {
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
}

#about p, #services p, #solutions p, #cases p, #reviews p, #news p, #faq p, #howto p, #contact p {
    margin-bottom: 0.8rem;
    color: var(--text-light);
}

/* 新闻文章 */
#news article {
    padding: 1rem 0;
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition);
    border-radius: 8px;
    padding: 1rem;
}

#news article:hover {
    background: var(--glass);
}

#news article:last-child {
    border-bottom: none;
}

#news article a {
    display: inline-block;
    margin-top: 0.4rem;
    font-weight: 600;
    color: var(--accent);
}

#news article a:hover {
    text-decoration: underline;
}

/* FAQ details 毛玻璃细节 */
details {
    background: var(--glass);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.8rem 1.2rem;
    margin-bottom: 0.8rem;
    cursor: pointer;
    transition: background var(--transition), transform 0.2s;
}

details:hover {
    background: rgba(255,255,255,0.15);
    transform: scale(1.01);
}

details summary {
    font-weight: 600;
    color: var(--text);
    outline: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

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

details summary::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--accent);
    transition: transform 0.3s;
}

details[open] summary::after {
    transform: rotate(45deg);
}

details p {
    padding-top: 0.8rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* 联系、站点地图、友情链接 */
#contact p, #sitemap ul, #friends p {
    margin-bottom: 0.5rem;
}

#sitemap ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

#sitemap ul li a {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: var(--glass);
    border-radius: 8px;
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}

#sitemap ul li a:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

#friends a {
    margin: 0 0.3rem;
}

/* Footer */
footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
    text-align: center;
    border-top: 1px solid var(--glass-border);
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.8;
}

footer p {
    margin-bottom: 0.3rem;
}

/* 响应式布局 */
@media (max-width: 768px) {
    html { font-size: 14px; }

    nav {
        flex-direction: column;
        align-items: stretch;
        padding: 0.6rem 1rem;
    }

    nav a[title="酷超网络首页"] {
        margin-bottom: 0.5rem;
    }

    nav ul {
        justify-content: center;
        gap: 0.5rem;
    }

    nav ul li a {
        padding: 0.3rem 0.6rem;
        font-size: 0.9rem;
    }

    main {
        padding: 1rem 0.8rem 3rem;
    }

    section {
        padding: 1.5rem 1.2rem;
        margin-bottom: 1.5rem;
    }

    #banner {
        padding: 2.5rem 1.2rem;
    }

    #banner h1 {
        font-size: 1.8rem;
    }

    h1 { font-size: 1.8rem; }
    h2 { font-size: 1.5rem; }
    h3 { font-size: 1.15rem; }

    #sitemap ul {
        flex-direction: column;
        align-items: flex-start;
    }

    details {
        padding: 0.6rem 1rem;
    }
}

@media (max-width: 480px) {
    nav ul {
        gap: 0.3rem;
    }

    nav ul li a {
        font-size: 0.8rem;
        padding: 0.2rem 0.5rem;
    }

    section {
        padding: 1rem 0.8rem;
    }

    #banner h1 {
        font-size: 1.5rem;
    }
}

/* 暗色模式增强 */
@media (prefers-color-scheme: dark) {
    #banner {
        background: linear-gradient(135deg, #0f2136 0%, #1a3a5c 40%, #0f2136 100%);
    }

    #banner::before {
        background: radial-gradient(circle at 30% 50%, rgba(240,165,0,0.1) 0%, transparent 60%);
    }

    nav ul li a {
        color: var(--text);
    }

    section {
        border-color: rgba(255,255,255,0.05);
    }
}

/* 打印优化 */
@media print {
    header { position: static; }
    section { opacity: 1 !important; transform: none !important; animation: none !important; }
    body { background: #fff; color: #000; }
    #banner { background: #1a3a5c !important; color: #fff !important; }
}