/* ============================================================
   yifenduan_site · 主题色
   春考 = 紫 #7C3AED   夏考 = 淡蓝 #3B82F6
   配色 = 橙红 #FF6A33  绿青 #14B8A6
   ============================================================ */
:root {
    --c-purple: #7C3AED;
    --c-orange: #FF6A33;
    --c-blue:   #3B82F6;
    --c-teal:   #14B8A6;
    --c-bg:     #f5f7fb;
    --c-card:   #ffffff;
    --c-text:   #1f2330;
    --c-muted:  #8b91a0;
    --c-line:   #ecedf3;

    /* 默认（春考）= 紫 */
    --accent:        var(--c-purple);
    --accent-soft:   rgba(124, 58, 237, 0.10);
    --accent-soft-2: rgba(124, 58, 237, 0.06);
}
body[data-tab="xiakao"] {
    --accent:        var(--c-blue);
    --accent-soft:   rgba(59, 130, 246, 0.10);
    --accent-soft-2: rgba(59, 130, 246, 0.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
    background: var(--c-bg);
    color: var(--c-text);
    font-size: 14px;
    -webkit-tap-highlight-color: transparent;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }

/* ---------- Header ---------- */
.hdr {
    background: var(--c-card);
    padding: 12px 14px 0;
    border-bottom: 1px solid var(--c-line);
    position: sticky; top: 0; z-index: 10;
}
.hdr-inner {
    display: flex; align-items: center; gap: 10px;
    max-width: 1080px; margin: 0 auto;
}
.hdr-logo {
    width: 36px; height: 36px; border-radius: 8px;
    background: var(--accent); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 18px; font-weight: 700;
    box-shadow: 0 2px 8px var(--accent-soft);
    transition: background .25s;
}
.hdr-title-wrap { flex: 1; min-width: 0; }
.hdr-title {
    font-size: 17px; font-weight: 700; color: var(--c-text);
    line-height: 1.3;
}
.hdr-sub {
    font-size: 12px; color: var(--c-muted);
    margin-top: 2px;
}
.hdr-right { display: none; }
/* 旧的 pill-sel 已废弃，保留兜底防止旧缓存导致样式错乱 */
.pill-sel { display: none; }

.tabs {
    max-width: 1080px; margin: 12px auto 0;
    display: flex; gap: 18px;
    padding-top: 4px;
}
.tab {
    padding: 8px 4px 12px;
    color: var(--c-muted); font-size: 14px; font-weight: 500;
    cursor: pointer; position: relative;
    transition: color .15s;
}
.tab:hover { color: var(--c-text); }
.tab.on { color: var(--accent); font-weight: 600; }
.tab.on::after {
    content: ''; position: absolute;
    left: 0; right: 0; bottom: 0; height: 2.5px;
    background: var(--accent); border-radius: 2px;
}

/* ---------- Main container ---------- */
.main {
    max-width: 1080px; margin: 12px auto 0;
    padding: 0 12px 30px;
}

/* ---------- Selector bar （年份 / 类别） ---------- */
.selector-bar {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 10px; margin-bottom: 12px;
}
.sel-card {
    position: relative;
    background: var(--c-card); border-radius: 10px;
    padding: 9px 36px 9px 14px;
    box-shadow: 0 1px 6px rgba(31,35,48,.04);
    cursor: pointer;
    transition: box-shadow .15s, transform .05s;
    display: block;
}
.sel-card:hover { box-shadow: 0 2px 12px rgba(31,35,48,.08); }
.sel-card:active { transform: translateY(1px); }
.sel-lab {
    display: block;
    font-size: 11px; color: var(--c-muted);
    margin-bottom: 3px; font-weight: 500;
}
.sel-in {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 100%; border: 0; outline: 0;
    background: transparent; padding: 0;
    font-family: inherit;
    font-size: 15px; font-weight: 600;
    color: var(--accent);
    cursor: pointer;
}
.sel-in::-ms-expand { display: none; }
.sel-arrow {
    position: absolute; right: 14px; top: 50%;
    transform: translateY(-30%);
    color: var(--accent); font-size: 12px;
    pointer-events: none; font-weight: 700;
}

/* ---------- Search bar ---------- */
.search-bar {
    display: flex; gap: 10px; margin-bottom: 12px;
}
.search-in {
    flex: 1; padding: 12px 16px;
    border-radius: 10px;
    border: 1px solid var(--c-line); background: var(--c-card);
    font-size: 15px; color: var(--c-text);
    transition: border-color .15s;
}
.search-in:focus {
    outline: none; border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.search-in::placeholder { color: #b8bcc7; }
.btn-go {
    padding: 0 26px;
    border: 0; border-radius: 10px;
    background: var(--accent); color: #fff;
    font-size: 15px; font-weight: 600;
    cursor: pointer;
    transition: filter .15s;
    box-shadow: 0 3px 10px var(--accent-soft);
}
.btn-go:hover { filter: brightness(1.06); }
.btn-go:active { transform: translateY(1px); }

/* ---------- Stat card ---------- */
.stat-card {
    background: var(--c-card); border-radius: 12px;
    padding: 18px 16px 14px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(31,35,48,.04);
}
.stat-head {
    text-align: center; font-size: 15px;
    color: var(--c-text); font-weight: 500;
    padding-bottom: 14px; border-bottom: 1px solid var(--c-line);
    margin-bottom: 14px;
}
.stat-head-val {
    color: var(--accent); font-weight: 700; font-size: 19px;
    margin-left: 4px;
}
.stat-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    text-align: center;
}
.stat-cell { min-width: 0; }
.stat-lab { font-size: 12px; color: var(--c-muted); margin-bottom: 6px; }
.stat-val { font-size: 18px; font-weight: 700; color: var(--c-text); }
.stat-val.small { font-size: 15px; font-variant-numeric: tabular-nums; }

/* ---------- Chart ---------- */
.chart-card {
    background: var(--c-card); border-radius: 12px;
    padding: 12px 8px 8px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(31,35,48,.04);
    position: relative;
}
.chart-head {
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 8px 6px;
}
.chart-hint { font-size: 12px; color: var(--c-muted); }
.chart-pill {
    background: var(--accent); color: #fff;
    border-radius: 999px;
    padding: 4px 14px; font-size: 13px; font-weight: 600;
    min-width: 110px; text-align: center;
}
#chart { width: 100%; height: 320px; }

/* ---------- Equiv (历史同位次等效分数) ---------- */
.equiv-card {
    background: var(--c-card); border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(31,35,48,.04);
}
.equiv-title {
    font-size: 15px; font-weight: 600; color: var(--c-text);
    margin-bottom: 12px;
}
.equiv-list {
    display: grid; grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    text-align: center;
}
.eq-item {
    padding: 8px 4px;
    background: var(--accent-soft-2); border-radius: 10px;
}
.eq-score {
    font-size: 19px; font-weight: 700; color: var(--accent);
}
.eq-year { font-size: 12px; color: var(--c-muted); margin-top: 4px; }

/* ---------- Range tabs + Table ---------- */
.table-card {
    background: var(--c-card); border-radius: 12px;
    padding: 14px 12px;
    margin-bottom: 12px;
    box-shadow: 0 1px 6px rgba(31,35,48,.04);
}
.table-title {
    font-size: 15px; font-weight: 600; color: var(--c-text);
    margin-bottom: 12px;
}
.range-tabs {
    display: flex; gap: 8px; margin-bottom: 12px;
    overflow-x: auto; padding-bottom: 4px;
}
.rg-tab {
    flex: 0 0 auto;
    padding: 8px 16px; border-radius: 8px;
    background: #f1f2f8; color: var(--c-text);
    font-size: 13px; cursor: pointer;
    transition: all .15s;
    white-space: nowrap;
}
.rg-tab:hover { background: #e7e9f1; }
.rg-tab.on {
    background: var(--accent); color: #fff;
    box-shadow: 0 2px 8px var(--accent-soft);
}
.table-wrap {
    max-height: 460px; overflow-y: auto;
    border-radius: 8px;
}
.tbl {
    width: 100%; border-collapse: collapse;
    font-size: 14px;
}
.tbl thead th {
    background: #fafbfd; color: var(--c-muted);
    font-weight: 500; font-size: 13px;
    padding: 10px 6px; text-align: center;
    position: sticky; top: 0;
    border-bottom: 1px solid var(--c-line);
}
.tbl tbody td {
    padding: 12px 6px;
    text-align: center;
    border-bottom: 1px solid #f5f6fa;
    font-variant-numeric: tabular-nums;
}
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--accent-soft-2); }
.tbl .tb-score { font-weight: 700; color: var(--c-text); }

.empty {
    text-align: center; padding: 30px 10px;
    color: var(--c-muted); font-size: 13px;
}

/* ---------- Footer ---------- */
.foot {
    text-align: center; padding: 24px 16px 36px;
    color: var(--c-muted); font-size: 12px;
}
.foot p { margin: 4px 0; }
.foot a { color: var(--accent); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
    .hdr-title { font-size: 16px; }
    .pill-sel .bare-sel { font-size: 12px; padding: 4px 8px; max-width: 96px; }
    #chart { height: 280px; }
    .stat-val { font-size: 16px; }
    .stat-val.small { font-size: 13px; }
    .equiv-list { grid-template-columns: repeat(2, 1fr); }
    .eq-score { font-size: 17px; }
    .chart-pill { min-width: 0; padding: 4px 10px; }
}
@media (min-width: 900px) {
    .main { padding: 0 16px 40px; }
    #chart { height: 360px; }
}
