/* Reset & Base */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans SC', sans-serif;
    line-height: 1.6;
    color: #1a1a2e;
    background: #f8f9fa;
    transition: background 0.3s, color 0.3s;
    overflow-x: hidden;
}

/* Dark Mode Variables */
body:not(.dark-mode) {
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-card: #ffffff;
    --bg-glass: rgba(255, 255, 255, 0.7);
    --text-primary: #1a1a2e;
    --text-secondary: #4a4a6a;
    --text-muted: #6c757d;
    --accent: #e94560;
    --accent-hover: #d63850;
    --accent-light: rgba(233, 69, 96, 0.1);
    --border-color: #e9ecef;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.12);
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: #1a1a2e;
    --footer-text: #adb5bd;
    --hero-overlay: linear-gradient(135deg, rgba(26, 26, 46, 0.85) 0%, rgba(233, 69, 96, 0.7) 100%);
}

body.dark-mode {
    --bg-primary: #0f0f23;
    --bg-secondary: #1a1a2e;
    --bg-card: #16213e;
    --bg-glass: rgba(22, 33, 62, 0.8);
    --text-primary: #e8e8f0;
    --text-secondary: #b0b0c8;
    --text-muted: #8a8aa0;
    --accent: #e94560;
    --accent-hover: #ff6b81;
    --accent-light: rgba(233, 69, 96, 0.2);
    --border-color: #2a2a4a;
    --shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 8px 30px rgba(0, 0, 0, 0.4);
    --nav-bg: rgba(15, 15, 35, 0.95);
    --footer-bg: #0a0a1a;
    --footer-text: #6c757d;
    --hero-overlay: linear-gradient(135deg, rgba(15, 15, 35, 0.9) 0%, rgba(233, 69, 96, 0.6) 100%);
}

body {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
}

h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.5rem, 3.5vw, 2.2rem); margin-bottom: 1.5rem; }
h3 { font-size: 1.25rem; margin-bottom: 0.75rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Container */
main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

section {
    padding: 4rem 0;
    opacity: 0;
    transform: translateY(30px);
    animation: fadeInUp 0.6s ease forwards;
}

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

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

/* Header & Navigation */
header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    transition: background 0.3s, border-color 0.3s;
}

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem;
    gap: 1rem;
}

nav > div:first-child {
    flex-shrink: 0;
}

nav ul {
    display: flex;
    list-style: none;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

nav ul li a {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    color: var(--text-secondary);
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.3s;
    position: relative;
}

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

nav ul li a.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
}

#darkModeToggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: all 0.3s;
    flex-shrink: 0;
}

#darkModeToggle:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: rotate(20deg);
}

/* Mobile Menu Button */
nav > button[aria-label="打开菜单"] {
    display: none;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
}

nav > button[aria-label="打开菜单"]:hover {
    background: var(--accent);
    color: #fff;
}

/* Hero Section */
#hero {
    background: var(--hero-overlay), url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 800"><defs><linearGradient id="g" x1="0%" y1="0%" x2="100%" y2="100%"><stop offset="0%" stop-color="%231a1a2e"/><stop offset="100%" stop-color="%23e94560"/></linearGradient></defs><rect fill="url(%23g)" width="1440" height="800"/><circle cx="200" cy="150" r="120" fill="rgba(255,255,255,0.05)"/><circle cx="1200" cy="500" r="180" fill="rgba(255,255,255,0.03)"/><circle cx="700" cy="650" r="100" fill="rgba(255,255,255,0.04)"/></svg>') center/cover no-repeat;
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem;
    border-radius: 0 0 3rem 3rem;
    margin: 0 -1.5rem;
    position: relative;
    overflow: hidden;
}

#hero > div {
    max-width: 800px;
    animation: fadeInUp 0.8s ease;
}

#hero h1 {
    color: #ffffff;
    text-shadow: 0 2px 20px rgba(0, 0, 0, 0.3);
    margin-bottom: 1rem;
}

#hero p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.15rem;
    margin-bottom: 2rem;
    text-shadow: 0 1px 10px rgba(0, 0, 0, 0.2);
}

#hero div > div {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

#hero a[role="button"] {
    display: inline-block;
    padding: 0.9rem 2.2rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
    text-decoration: none;
}

#hero a[role="button"]:first-child {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
}

#hero a[role="button"]:first-child:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.5);
}

#hero a[role="button"]:last-child {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

#hero a[role="button"]:last-child:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: #fff;
    transform: translateY(-3px);
}

/* About Section */
#about {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

#about:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* Features Section */
#features > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

#features article {
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 1.2rem;
    padding: 2rem 1.5rem;
    transition: all 0.4s;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

#features article::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent), #ff6b81, var(--accent));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.4s;
}

#features article:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
}

#features article:hover::before {
    transform: scaleX(1);
}

#features article h3 {
    color: var(--accent);
    margin-bottom: 0.75rem;
}

#features article p {
    font-size: 0.95rem;
    margin: 0;
}

/* Download Section */
#download {
    text-align: center;
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

#download > div {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

#download a[rel="nofollow"] {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 2.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 1.05rem;
    transition: all 0.3s;
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

#download a[rel="nofollow"]:hover {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(233, 69, 96, 0.3);
}

/* FAQ Section */
#faq > div {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

details {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 1rem;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: var(--shadow);
}

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

details[open] {
    border-color: var(--accent);
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.15);
}

summary {
    padding: 1.2rem 1.5rem;
    cursor: pointer;
    font-weight: 600;
    color: var(--text-primary);
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s;
}

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

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

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

details[open] summary {
    background: var(--accent-light);
}

details p {
    padding: 0 1.5rem 1.2rem;
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.7;
}

/* Knowledge Section */
#knowledge > div {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
}

#knowledge article {
    background: var(--bg-glass);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 1.2rem;
    padding: 2rem 1.5rem;
    transition: all 0.4s;
    box-shadow: var(--shadow);
    position: relative;
}

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

#knowledge article h3 {
    color: var(--text-primary);
    margin-bottom: 0.75rem;
}

#knowledge article p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
}

#knowledge article a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-weight: 600;
    color: var(--accent);
}

#knowledge article a::after {
    content: '→';
    transition: transform 0.3s;
}

#knowledge article a:hover::after {
    transform: translateX(4px);
}

/* How To Section */
#howto {
    background: var(--bg-card);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow);
}

#howto ol {
    list-style: none;
    counter-reset: step;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

#howto ol li {
    counter-increment: step;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 1rem;
    border-left: 4px solid var(--accent);
    transition: all 0.3s;
    position: relative;
}

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

#howto ol li:hover {
    transform: translateX(5px);
    box-shadow: var(--shadow);
}

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

/* Contact Section */
#contact {
    text-align: center;
    background: var(--bg-glass);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    margin: 2rem 0;
}

#contact dl {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

#contact dt {
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#contact dd {
    color: var(--text-primary);
    font-size: 1.1rem;
}

/* Footer */
footer {
    background: var(--footer-bg);
    color: var(--footer-text);
    padding: 3rem 1.5rem;
    margin-top: 4rem;
}

footer > div {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
}

footer p {
    color: var(--footer-text);
    margin: 0;
    font-size: 0.9rem;
}

footer nav ul {
    display: flex;
    list-style: none;
    gap: 1.5rem;
}

footer nav ul li a {
    color: var(--footer-text);
    font-size: 0.9rem;
    transition: color 0.3s;
}

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

/* Back to Top Button */
#backToTop {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(233, 69, 96, 0.4);
    transition: all 0.3s;
    z-index: 999;
}

#backToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(233, 69, 96, 0.5);
    background: var(--accent-hover);
}

/* Responsive */
@media (max-width: 768px) {
    nav {
        flex-wrap: wrap;
        padding: 0.5rem 1rem;
    }

    nav ul {
        display: none;
        width: 100%;
        flex-direction: column;
        gap: 0;
        background: var(--bg-card);
        border-radius: 1rem;
        padding: 0.5rem;
        box-shadow: var(--shadow);
        margin-top: 0.5rem;
    }

    nav ul.show {
        display: flex;
    }

    nav ul li a {
        display: block;
        padding: 0.75rem 1rem;
        border-radius: 8px;
    }

    nav > button[aria-label="打开菜单"] {
        display: block;
    }

    #hero {
        min-height: 60vh;
        padding: 4rem 1rem;
        border-radius: 0 0 2rem 2rem;
        margin: 0 -1rem;
    }

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

    #hero p {
        font-size: 1rem;
    }

    #hero a[role="button"] {
        padding: 0.8rem 1.8rem;
        font-size: 0.9rem;
    }

    section {
        padding: 2.5rem 0;
    }

    #features > div,
    #knowledge > div {
        grid-template-columns: 1fr;
    }

    #contact dl {
        grid-template-columns: 1fr;
    }

    footer > div {
        flex-direction: column;
        text-align: center;
    }

    footer nav ul {
        justify-content: center;
    }

    #backToTop {
        bottom: 1rem;
        right: 1rem;
        width: 44px;
        height: 44px;
    }

    #howto ol li {
        padding-left: 2.5rem;
    }

    #howto ol li::before {
        left: -0.5rem;
        width: 1.6rem;
        height: 1.6rem;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    html {
        font-size: 15px;
    }

    main {
        padding: 0 1rem;
    }

    #hero {
        padding: 3rem 1rem;
        min-height: 50vh;
    }

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

    #about,
    #download,
    #howto,
    #contact {
        padding: 2rem 1.2rem;
    }
}

/* Print Styles */
@media print {
    header,
    #backToTop,
    footer {
        display: none;
    }

    body {
        background: #fff;
        color: #000;
    }

    section {
        opacity: 1;
        transform: none;
        animation: none;
        page-break-inside: avoid;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus Styles */
:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--accent);
    color: #fff;
}

/* Smooth scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-hover);
}