* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 点阵背景画布 ===== */
#dotBg {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

:root {
    --bg: #111;
    --card-bg: rgba(255,255,255,0.03);
    --card-border: rgba(255,255,255,0.06);
    --text: #ddd;
    --text-dim: #777;
    --text-muted: #555;
    --heading: #fff;
    --code-bg: #1a1a1a;
    --code-border: #222;
    --divider: rgba(255,255,255,0.05);
    --btn-bg: rgba(255,255,255,0.04);
    --btn-border: rgba(255,255,255,0.08);
    --btn-hover-bg: rgba(255,255,255,0.08);
    --btn-hover-border: rgba(255,255,255,0.15);
    --stat-bg: rgba(255,255,255,0.015);
    --stat-border: rgba(255,255,255,0.04);
    --note-bg: rgba(255,255,255,0.015);
    --note-border: rgba(255,255,255,0.08);
    --shadow: none;
}

[data-theme="light"] {
    --bg: #f5f5f7;
    --card-bg: #fff;
    --card-border: #e5e5e5;
    --text: #333;
    --text-dim: #888;
    --text-muted: #aaa;
    --heading: #111;
    --code-bg: #f0f0f3;
    --code-border: #e0e0e0;
    --divider: #eee;
    --btn-bg: #f5f5f5;
    --btn-border: #ddd;
    --btn-hover-bg: #eee;
    --btn-hover-border: #ccc;
    --stat-bg: #fafafa;
    --stat-border: #eee;
    --note-bg: #fafafa;
    --note-border: #ddd;
    --shadow: 0 1px 3px rgba(0,0,0,0.06);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.65;
    transition: background 0.3s, color 0.3s;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    position: relative;
    z-index: 1;
}

/* ===== 头部 ===== */
.header {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 80px 40px 60px;
    max-width: 1200px;
    margin: 0 auto;
}

.heading-group {
    display: inline-block;
}

.site-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--heading);
    letter-spacing: 1px;
}

.site-subtitle {
    font-size: 0.9rem;
    color: var(--text-dim);
    margin-top: 6px;
    letter-spacing: 0.5px;
}

/* ===== 流动光线 ===== */
.glow-line {
    position: relative;
    width: 320px;
    max-width: 85%;
    height: 4px;
    margin: 32px auto 0;
    overflow: hidden;
    border-radius: 4px;
}

.glow-line-inner {
    position: absolute;
    inset: 0;
    border-radius: 4px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(255,255,255,0.4) 15%, 
        rgba(255,255,255,0.15) 50%, 
        rgba(255,255,255,0.4) 85%, 
        transparent 100%
    );
    animation: flow 3s ease-in-out infinite;
}

@keyframes flow {
    0%   { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* 光线后方柔光 */
.glow-line::before {
    content: '';
    position: absolute;
    inset: -8px -20px;
    background: radial-gradient(ellipse at center, rgba(255,255,255,0.06) 0%, transparent 70%);
    border-radius: 4px;
    pointer-events: none;
}

[data-theme="light"] .glow-line-inner {
    background: linear-gradient(90deg, 
        transparent 0%, 
        rgba(0,0,0,0.25) 15%, 
        rgba(0,0,0,0.1) 50%, 
        rgba(0,0,0,0.25) 85%, 
        transparent 100%
    );
}

[data-theme="light"] .glow-line::before {
    background: radial-gradient(ellipse at center, rgba(0,0,0,0.04) 0%, transparent 70%);
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
    position: absolute;
    top: 80px;
    right: 40px;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--btn-border);
    background: var(--btn-bg);
    color: var(--text);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.theme-toggle:hover {
    background: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
}

/* ===== 双栏布局 ===== */
.layout {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 28px;
    align-items: start;
}

.col-left,
.col-right {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* ===== 卡片 ===== */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 36px;
    box-shadow: var(--shadow);
    transition: background 0.3s, border-color 0.3s;
}

.card h2 {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 28px;
}

/* ===== 统计 ===== */
.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px 14px;
}

.stat-item {
    padding: 28px 16px;
    background: var(--stat-bg);
    border-radius: 12px;
    border: 1px solid var(--stat-border);
    text-align: center;
    transition: background 0.3s, border-color 0.3s;
}

.stat-value {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--heading);
    line-height: 1.1;
}

.stat-label {
    font-size: 0.78rem;
    color: var(--text-dim);
    margin-top: 10px;
    letter-spacing: 0.5px;
}

/* ===== 说明 ===== */
.note-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.note-item {
    padding: 16px 18px;
    background: var(--note-bg);
    border-radius: 10px;
    font-size: 0.92rem;
    color: var(--text);
    border-left: 3px solid var(--note-border);
    transition: background 0.3s, border-color 0.3s;
}

/* ===== API端点 ===== */
.endpoint {
    margin-bottom: 32px;
    padding-bottom: 28px;
    border-bottom: 1px solid var(--divider);
}

.endpoint:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.endpoint h3 {
    font-size: 1.05rem;
    color: var(--heading);
    font-weight: 600;
    margin-bottom: 18px;
}

.endpoint h4 {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin: 16px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.endpoint p {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 10px 0 4px;
}

/* ===== 代码块 ===== */
pre {
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    border-radius: 8px;
    padding: 16px 20px;
    overflow-x: auto;
    font-size: 0.86rem;
    line-height: 1.8;
    margin: 4px 0;
    transition: background 0.3s, border-color 0.3s;
}

code {
    font-family: 'SF Mono', 'Fira Code', 'Consolas', monospace;
    color: var(--text);
}

/* ===== 快速测试 ===== */
.test-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

.btn {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    border-radius: 10px;
    background: var(--btn-bg);
    border: 1px solid var(--btn-border);
    transition: all 0.2s;
}

.btn:hover {
    background: var(--btn-hover-bg);
    border-color: var(--btn-hover-border);
    color: var(--heading);
}

/* ===== 响应式 ===== */
@media (max-width: 900px) {
    .layout {
        grid-template-columns: 1fr;
    }
    
    .header {
        padding: 50px 40px 40px;
    }
    
    .theme-toggle {
        top: 50px;
        right: 40px;
    }
    
    .site-title {
        font-size: 1.6rem;
    }
}

@media (max-width: 600px) {
    .container,
    .header {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .theme-toggle {
        top: 50px;
        right: 20px;
    }
    
    .card {
        padding: 24px 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px 10px;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .test-buttons {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}
