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

:root {
    --primary: #e30613;
    --primary-dark: #c00510;
    --primary-light: #ff3b3b;
    --bg: #f8f9fa;
    --bg-card: rgba(255, 255, 255, 0.75);
    --bg-glass: rgba(255, 255, 255, 0.2);
    --text: #1a1a2e;
    --text-light: #555;
    --text-white: #ffffff;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --radius: 16px;
    --radius-sm: 10px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
    --nav-height: 70px;
}

body.dark-mode {
    --bg: #0f0f1a;
    --bg-card: rgba(30, 30, 50, 0.8);
    --bg-glass: rgba(0, 0, 0, 0.3);
    --text: #eaeaea;
    --text-light: #aaa;
    --shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    --shadow-hover: 0 12px 40px rgba(0, 0, 0, 0.7);
}

html {
    scroll-behavior: smooth;
}

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: inherit;
    text-decoration: none;
}

img, svg {
    max-width: 100%;
    display: block;
}

ul, ol {
    list-style: none;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg);
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

/* ===== 导航栏 ===== */
header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--bg-glass);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background var(--transition);
}

body.dark-mode header {
    background: rgba(15, 15, 26, 0.7);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

nav {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: var(--nav-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

nav > div:first-child {
    display: flex;
    align-items: center;
    gap: 12px;
}

nav > div:first-child span {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 1px;
}

nav ul {
    display: flex;
    align-items: center;
    gap: 28px;
}

nav ul li a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-light);
    padding: 6px 0;
    position: relative;
    transition: color var(--transition);
}

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

nav ul li a:hover,
nav ul li a.active {
    color: var(--primary);
}

nav ul li a:hover::after,
nav ul li a.active::after {
    width: 100%;
}

#darkModeToggle,
#menuToggle {
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: background var(--transition), transform var(--transition);
    color: var(--text);
}

#darkModeToggle:hover,
#menuToggle:hover {
    background: rgba(227, 6, 19, 0.1);
    transform: scale(1.1);
}

#menuToggle {
    display: none;
    margin-left: 8px;
}

/* ===== 移动端导航 ===== */
@media (max-width: 768px) {
    #menuToggle {
        display: block;
    }

    nav ul {
        position: fixed;
        top: var(--nav-height);
        left: 0;
        width: 100%;
        background: var(--bg-glass);
        backdrop-filter: blur(30px);
        -webkit-backdrop-filter: blur(30px);
        flex-direction: column;
        padding: 20px 24px;
        gap: 16px;
        transform: translateY(-120%);
        opacity: 0;
        transition: transform 0.4s ease, opacity 0.4s ease;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    body.dark-mode nav ul {
        background: rgba(15, 15, 26, 0.85);
    }

    nav ul.active {
        transform: translateY(0);
        opacity: 1;
    }

    nav ul li a {
        font-size: 1.1rem;
        padding: 10px 0;
    }
}

/* ===== Hero 区域 ===== */
#hero {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 120px 24px 80px;
    position: relative;
    overflow: hidden;
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 40%, #2d0a0a 70%, #0f0f1a 100%);
}

#hero::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(227, 6, 19, 0.15) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255, 59, 59, 0.1) 0%, transparent 50%);
    animation: heroGlow 8s ease-in-out infinite alternate;
    pointer-events: none;
}

@keyframes heroGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, -20px) scale(1.1); }
}

#hero h1 {
    font-size: clamp(2.2rem, 6vw, 4.5rem);
    font-weight: 800;
    color: var(--text-white);
    text-shadow: 0 4px 30px rgba(227, 6, 19, 0.3);
    margin-bottom: 20px;
    letter-spacing: -1px;
    position: relative;
    z-index: 1;
    animation: fadeUp 1s ease forwards;
}

#hero p {
    font-size: clamp(1rem, 2vw, 1.4rem);
    color: rgba(255, 255, 255, 0.8);
    max-width: 600px;
    margin-bottom: 40px;
    position: relative;
    z-index: 1;
    animation: fadeUp 1s ease 0.2s forwards;
    opacity: 0;
}

#hero div {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
    animation: fadeUp 1s ease 0.4s forwards;
    opacity: 0;
}

#hero div a {
    padding: 14px 40px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

#hero div a:first-child {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    box-shadow: 0 8px 25px rgba(227, 6, 19, 0.4);
}

#hero div a:first-child:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 12px 35px rgba(227, 6, 19, 0.6);
}

#hero div a:last-child {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

#hero div a:last-child:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

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

/* ===== 通用 Section ===== */
section {
    padding: 90px 24px;
    max-width: 1200px;
    margin: 0 auto;
}

section h2 {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    text-align: center;
    margin-bottom: 16px;
    color: var(--text);
    position: relative;
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--primary-light));
    margin: 12px auto 0;
    border-radius: 4px;
}

section > p {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 50px;
    color: var(--text-light);
    font-size: 1.05rem;
}

/* ===== About ===== */
#about {
    background: var(--bg);
    transition: background var(--transition);
}

#about > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

#about article {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 36px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition);
    cursor: default;
}

#about article:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

#about article h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--primary);
}

/* ===== Products ===== */
#products {
    background: linear-gradient(135deg, #f8f9fa 0%, #fff 100%);
    transition: background var(--transition);
}

body.dark-mode #products {
    background: linear-gradient(135deg, #0f0f1a 0%, #1a1a2e 100%);
}

#products > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
}

#products article {
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 36px 28px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transition: all var(--transition);
    display: flex;
    flex-direction: column;
}

#products article:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

#products article h3 {
    font-size: 1.3rem;
    margin-bottom: 12px;
    color: var(--primary);
}

#products article p {
    flex: 1;
    color: var(--text-light);
    margin-bottom: 20px;
}

#products article a {
    align-self: flex-start;
    padding: 10px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: #fff;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all var(--transition);
    box-shadow: 0 4px 15px rgba(227, 6, 19, 0.3);
}

#products article a:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(227, 6, 19, 0.5);
}

/* ===== Services ===== */
#services > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}

#services article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 30px 24px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition);
    text-align: center;
    position: relative;
    overflow: hidden;
}

#services article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 0;
    background: var(--primary);
    transition: height var(--transition);
}

#services article:hover::before {
    height: 100%;
}

#services article:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
}

#services article h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    color: var(--primary);
}

/* ===== Knowledge ===== */
#knowledge {
    background: var(--bg);
    transition: background var(--transition);
}

#knowledge > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
}

#knowledge article {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 28px 22px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all var(--transition);
}

#knowledge article:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary);
}

#knowledge article h3 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    color: var(--text);
}

#knowledge article p {
    color: var(--text-light);
    font-size: 0.95rem;
    margin-bottom: 16px;
}

#knowledge article a {
    color: var(--primary);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

#knowledge article a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== How To ===== */
#howto {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1a 100%);
    color: var(--text-white);
    border-radius: var(--radius) var(--radius) 0 0;
    max-width: 100%;
    padding: 90px 24px;
}

#howto h2 {
    color: #fff;
}

#howto h2::after {
    background: linear-gradient(90deg, var(--primary-light), #fff);
}

#howto ol {
    max-width: 700px;
    margin: 40px auto 0;
    counter-reset: step;
}

#howto ol li {
    counter-increment: step;
    padding: 18px 24px 18px 60px;
    position: relative;
    font-size: 1rem;
    line-height: 1.6;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background var(--transition);
}

#howto ol li::before {
    content: counter(step);
    position: absolute;
    left: 12px;
    top: 16px;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

#howto ol li:last-child {
    border-bottom: none;
}

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

/* ===== FAQ ===== */
#faq > div {
    max-width: 800px;
    margin: 0 auto;
}

details {
    background: var(--bg-card);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: all var(--transition);
    overflow: hidden;
}

details:hover {
    box-shadow: var(--shadow-hover);
}

details[open] {
    border-color: var(--primary);
}

summary {
    padding: 18px 24px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: color var(--transition);
    user-select: none;
    list-style: none;
}

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

summary::after {
    content: '+';
    font-size: 1.4rem;
    font-weight: 300;
    color: var(--primary);
    transition: transform var(--transition);
}

details[open] summary::after {
    content: '−';
    transform: rotate(180deg);
}

details p {
    padding: 0 24px 20px;
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== Contact ===== */
#contact address {
    max-width: 500px;
    margin: 0 auto;
    background: var(--bg-card);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 36px 32px;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid rgba(255, 255, 255, 0.1);
    font-style: normal;
    transition: all var(--transition);
}

#contact address:hover {
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-light);
}

#contact address p {
    margin-bottom: 12px;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

#contact address a {
    color: var(--primary);
    font-weight: 500;
    transition: color var(--transition);
}

#contact address a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* ===== Download Section ===== */
#download {
    text-align: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff;
    border-radius: 0 0 var(--radius) var(--radius);
    max-width: 100%;
    padding: 80px 24px;
}

#download h2 {
    color: #fff;
}

#download h2::after {
    background: rgba(255, 255, 255, 0.6);
}

#download p {
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 36px;
}

#download div {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

#download div a {
    padding: 14px 44px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: all var(--transition);
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

#download div a:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.3);
    background: #f0f0f0;
}

/* ===== Footer ===== */
footer {
    background: #0f0f1a;
    color: rgba(255, 255, 255, 0.8);
    padding: 60px 24px 30px;
}

footer > div:first-child {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
}

footer h3 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 16px;
    position: relative;
    padding-bottom: 8px;
}

footer h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--primary);
}

footer p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.6);
}

footer ul li {
    margin-bottom: 8px;
}

footer ul li a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.9rem;
    transition: color var(--transition);
}

footer ul li a:hover {
    color: var(--primary-light);
}

footer > p {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.4);
}

/* ===== Back to Top ===== */
#backToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 48px;
    height: 48px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 50%;
    font-size: 1.4rem;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(227, 6, 19, 0.4);
    transition: all var(--transition);
    display: none;
    z-index: 999;
}

#backToTop:hover {
    transform: translateY(-4px) scale(1.1);
    box-shadow: 0 8px 30px rgba(227, 6, 19, 0.6);
    background: var(--primary-dark);
}

/* ===== 响应式微调 ===== */
@media (max-width: 480px) {
    section {
        padding: 60px 16px;
    }

    #hero {
        padding: 100px 16px 60px;
    }

    #hero div a {
        padding: 12px 30px;
        font-size: 0.9rem;
    }

    #contact address {
        padding: 24px 20px;
    }

    #download div a {
        padding: 12px 32px;
    }

    footer > div:first-child {
        gap: 24px;
    }
}

/* ===== 滚动动画 (Intersection Observer 备用) ===== */
section {
    opacity: 0;
    transform: translateY(30px);
    animation: sectionFadeIn 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; }

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

/* ===== 暗色模式特别调整 ===== */
body.dark-mode #hero {
    background: linear-gradient(135deg, #0a0a12 0%, #14142a 40%, #1f0808 70%, #0a0a12 100%);
}

body.dark-mode #howto {
    background: linear-gradient(135deg, #14142a 0%, #0a0a12 100%);
}

body.dark-mode #download {
    background: linear-gradient(135deg, #a0040e, var(--primary-dark));
}

body.dark-mode details summary {
    color: var(--text);
}

body.dark-mode details p {
    color: var(--text-light);
}

/* ===== 打印优化 ===== */
@media print {
    header, #backToTop, footer {
        display: none;
    }
    section {
        opacity: 1;
        transform: none;
        animation: none;
        page-break-inside: avoid;
    }
}