:root {
    --text-base: 15px;
    --text-large: 1.5rem;
    --line-height: 1.6;
    --bg-color: #fafafa;
    --text-color: #222;
    --header-bg: #0070f3;
    --header-text: white;
    --main-bg: white;
    --main-shadow: rgba(0, 0, 0, 0.05);
    --link-color: #0070f3;
    --footer-color: #666;
    --lang-menu-bg: white;
    --lang-menu-text: #222;
    --lang-menu-hover: #f5f5f5;
    --lang-menu-shadow: rgba(0, 0, 0, 0.15);
    --card-bg: #f8f9fa;
    --card-hover: #e9ecef;
    --section-border: #e0e0e0;
    --code-bg: #f5f5f5;
    --code-text: #d63384;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #1a1a1a;
        --text-color: #e4e4e4;
        --header-bg: #0052b3;
        --header-text: #e4e4e4;
        --main-bg: #2a2a2a;
        --main-shadow: rgba(0, 0, 0, 0.3);
        --link-color: #4a9eff;
        --footer-color: #a0a0a0;
        --lang-menu-bg: #2a2a2a;
        --lang-menu-text: #e4e4e4;
        --lang-menu-hover: #3a3a3a;
        --lang-menu-shadow: rgba(0, 0, 0, 0.5);
        --card-bg: #333;
        --card-hover: #3d3d3d;
        --section-border: #444;
        --code-bg: #333;
        --code-text: #ff79c6;
    }
}

@media (min-width: 1024px) {
    :root {
        --text-base: 14.5px;
        --line-height: 1.65;
    }
}

body {
    font-family:
        -apple-system, BlinkMacSystemFont, "Helvetica Neue", "Segoe UI", Roboto,
        "PingFang SC", "Hiragino Sans GB", "Noto Sans CJK SC",
        "Microsoft YaHei", sans-serif;
    font-size: var(--text-base);
    line-height: var(--line-height);
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

header {
    background-color: var(--header-bg);
    color: var(--header-text);
    padding: 2rem 1rem;
    text-align: center;
    position: relative;
}

header h1 {
    font-size: var(--text-large);
    margin-bottom: 0.3rem;
}

header p {
    margin: 0.2rem 0 0;
    font-size: 0.95rem;
    opacity: 0.9;
}

main {
    max-width: 900px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.section {
    background: var(--main-bg);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--main-shadow);
    padding: 1.8rem 1.5rem;
    margin-bottom: 1.5rem;
}

.section h2 {
    color: var(--link-color);
    font-size: 1.3rem;
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.section h2 .icon {
    font-size: 1.5rem;
}

.section h3 {
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.section p {
    margin: 0.5rem 0 1rem;
    font-size: 0.97rem;
    line-height: 1.7;
}

.section ul {
    margin: 0.5rem 0 1rem 1.5rem;
    padding: 0;
}

.section ul li {
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
}

.section ul li strong {
    color: var(--link-color);
}

.faq-item {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
    transition: background 0.2s ease;
}

.faq-item:hover {
    background: var(--card-hover);
}

.faq-item h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--text-color);
}

.faq-item p {
    margin: 0;
    font-size: 0.93rem;
    line-height: 1.6;
    color: var(--text-color);
    opacity: 0.85;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 1rem;
}

.feature-card {
    background: var(--card-bg);
    border-radius: 8px;
    padding: 1.2rem;
    transition: transform 0.2s ease, background 0.2s ease;
}

.feature-card:hover {
    background: var(--card-hover);
    transform: translateY(-2px);
}

.feature-card h4 {
    margin: 0 0 0.5rem 0;
    font-size: 1rem;
    color: var(--link-color);
}

.feature-card p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    opacity: 0.85;
}

code {
    background: var(--code-bg);
    color: var(--code-text);
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    font-family: "SF Mono", Monaco, "Cascadia Code", "Courier New", monospace;
    font-size: 0.9em;
}

.steps {
    counter-reset: step-counter;
}

.steps li {
    counter-increment: step-counter;
    position: relative;
    padding-left: 2rem;
}

.steps li::before {
    content: counter(step-counter);
    position: absolute;
    left: 0;
    top: 0;
    background: var(--link-color);
    color: white;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
}

a {
    color: var(--link-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

footer {
    text-align: center;
    font-size: 0.9rem;
    color: var(--footer-color);
    margin: 2rem 0 3rem;
}

.lang-switch-container {
    position: absolute;
    right: 1rem;
    top: 1rem;
}

.lang-switch {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.lang-switch:hover {
    background: rgba(255, 255, 255, 0.35);
}

.lang-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    margin-top: 0.5rem;
    background: var(--lang-menu-bg);
    border-radius: 6px;
    box-shadow: 0 4px 12px var(--lang-menu-shadow);
    min-width: 120px;
    overflow: hidden;
    z-index: 1000;
}

.lang-option {
    display: block;
    width: 100%;
    padding: 0.6rem 1rem;
    border: none;
    background: var(--lang-menu-bg);
    color: var(--lang-menu-text);
    text-align: left;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background 0.2s ease;
}

.lang-option:hover {
    background: var(--lang-menu-hover);
}

@media (max-width: 600px) {
    header {
        padding: 1.5rem 1rem;
    }

    main {
        margin: 1rem auto;
    }

    .section {
        padding: 1.2rem 1rem;
        margin-bottom: 1rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    .section h2 {
        font-size: 1.15rem;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }
}
