/* ============================================
   Kernel Pro — Download Center v2
   ============================================ */

:root {
    --bg-base:      #0c0d12;
    --bg-elevated:  #13141c;
    --bg-card:      #181924;
    --bg-card-hover:#1e2030;
    --bg-input:     #1a1b26;
    --text-primary:   #e4e6ed;
    --text-secondary: #8b8fa4;
    --text-muted:     #555871;
    --border:       #222436;
    --border-hover: #2e3148;
    --accent:       #4f7cff;
    --accent-dim:   rgba(79,124,255,0.12);
    --accent-hover: #3d6af0;
    --green:  #34d399;
    --red:    #f87171;
    --amber:  #fbbf24;
    --radius-sm:  8px;
    --radius-md:  12px;
    --radius-lg:  16px;
    --radius-pill: 100px;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.03);
    --shadow-float: 0 8px 32px rgba(0,0,0,0.5);
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Noto Sans SC', sans-serif;
    background: var(--bg-base);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
    font-size: 14px;
    letter-spacing: -0.011em;
}

/* ───── Top bar ───── */

.top {
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 10;
}
.top-inner {
    max-width: 640px;
    margin: 0 auto;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}
.top-icon {
    width: 32px; height: 32px;
    border-radius: 8px;
    object-fit: cover;
}
.top h1 {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.top .sub {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 1px;
}

/* ───── Main ───── */

.main {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 60px;
}

/* ───── Stats ───── */

.stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.stat {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 14px;
    text-align: center;
    box-shadow: var(--shadow-card);
}
.stat .n {
    font-size: 24px;
    font-weight: 800;
    letter-spacing: -0.03em;
    font-variant-numeric: tabular-nums;
    color: var(--accent);
}
.stat .l {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 2px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* ───── Chart ───── */

.chart-box {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-card);
}
.chart-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.chart-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}
.chart-meta {
    font-size: 11px;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.chart-body {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-base);
    padding: 4px;
}
.chart-body canvas {
    display: block;
    width: 100% !important;
    height: auto !important;
}

/* ───── Agreement ───── */

.agreement-block {
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}
.agreement-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.5;
    color: var(--text-secondary);
}
.agreement-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 16px; height: 16px;
    margin-top: 3px;
    accent-color: var(--accent);
    cursor: pointer;
}
.agreement-label a {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
}
.agreement-label a:hover { text-decoration: underline; }
.agreement-error {
    font-size: 11px;
    color: var(--red);
    margin-top: 6px;
    display: none;
}

/* ───── Download cards ───── */

.dl-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.dl-card {
    background: var(--bg-card);
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px;
    box-shadow: var(--shadow-card);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    transition: border-color 0.15s, background 0.15s;
}
.dl-card:hover {
    border-color: var(--border-hover);
    background: var(--bg-card-hover);
}

.dl-info { flex: 1; min-width: 0; }
.dl-title {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.dl-desc {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

.dl-btn {
    flex-shrink: 0;
    padding: 8px 18px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-pill);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.dl-btn:hover { background: var(--accent-hover); }
.dl-btn:active { transform: scale(0.96); }

.dl-btn.sec {
    background: transparent;
    color: var(--text-primary);
    border: 1px solid var(--border);
}
.dl-btn.sec:hover {
    background: var(--bg-card-hover);
    border-color: var(--border-hover);
}

/* ───── Responsive ───── */

@media (max-width: 480px) {
    .stats { grid-template-columns: 1fr; }
    .dl-card { flex-wrap: wrap; }
    .dl-btn { width: 100%; text-align: center; }
}
@media (min-width: 769px) {
    .main { padding: 24px 20px 60px; }
    .bars { height: 100px; }
}
