:root {
    color-scheme: light dark;
    --bg: #eef3f0;
    --surface: #f9fbfa;
    --surface-strong: #f2f6f4;
    --surface-muted: #e7eeea;
    --text: #17221d;
    --text-soft: #65726b;
    --line: #d4ded8;
    --line-strong: #bdcbc3;
    --accent: #16745d;
    --accent-strong: #0f5d4a;
    --accent-soft: #d9ede5;
    --negative: #a14c4c;
    --negative-soft: #f2e3e3;
    --shadow: 0 24px 70px rgba(31, 58, 46, 0.10);
    --radius: 14px;
    --font-sans: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", system-ui, sans-serif;
    --font-mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111814;
        --surface: #17201b;
        --surface-strong: #1b2721;
        --surface-muted: #223029;
        --text: #edf3ef;
        --text-soft: #a4b2aa;
        --line: #304039;
        --line-strong: #43564d;
        --accent: #63b99b;
        --accent-strong: #83cfb3;
        --accent-soft: #203d32;
        --negative: #e19a9a;
        --negative-soft: #452d2d;
        --shadow: 0 24px 70px rgba(2, 10, 6, 0.30);
    }
}

* {
    box-sizing: border-box;
}

html {
    background: var(--bg);
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    min-height: 100dvh;
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.6;
    text-rendering: optimizeLegibility;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
select {
    font: inherit;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    height: 68px;
    border-bottom: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.topbar__inner {
    width: min(1400px, calc(100% - 48px));
    height: 100%;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: baseline;
    gap: 14px;
    min-width: 0;
}

.brand__name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand__rule {
    color: var(--accent);
    font-family: var(--font-mono);
    font-size: 12px;
    font-weight: 700;
}

.data-freshness {
    display: flex;
    align-items: baseline;
    gap: 10px;
    color: var(--text-soft);
    font-size: 12px;
}

.data-freshness strong {
    color: var(--text);
    font-family: var(--font-mono);
    font-weight: 650;
}

.page-shell {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 34px 0 88px;
}

.section-label {
    margin: 0 0 12px;
    color: var(--accent);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
    gap: 64px;
    align-items: end;
    min-height: 190px;
    padding: 8px 0 30px;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(36px, 4.2vw, 58px);
    font-weight: 790;
    letter-spacing: -0.065em;
    line-height: 1.02;
}

.hero__copy > p:last-child {
    max-width: 620px;
    margin: 14px 0 0;
    color: var(--text-soft);
    font-size: 17px;
}

.hero__meta {
    margin: 0;
    display: grid;
    gap: 18px;
}

.hero__meta div {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
}

.hero__meta dt,
.hero__meta dd {
    margin: 0;
}

.hero__meta dt {
    color: var(--text-soft);
    font-size: 12px;
}

.hero__meta dd {
    font-family: var(--font-mono);
    font-size: 13px;
    font-weight: 650;
    text-align: right;
}

.recommendation-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.8fr) minmax(310px, 0.8fr);
    gap: 20px;
    align-items: stretch;
}

.decision-panel,
.context-panel,
.summary-band,
.update-band,
.history-section,
.error-state {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.decision-panel {
    min-height: 460px;
    padding: clamp(26px, 4vw, 48px);
    box-shadow: var(--shadow);
}

.decision-panel--bet {
    border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
}

.decision-panel__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 32px;
}

.decision-panel h2 {
    margin: 0;
    font-size: clamp(34px, 4.4vw, 54px);
    font-weight: 800;
    letter-spacing: -0.055em;
    line-height: 1.08;
}

.zone-mark {
    width: 92px;
    min-width: 92px;
    aspect-ratio: 1;
    display: grid;
    place-content: center;
    text-align: center;
    border-radius: var(--radius);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.zone-mark strong {
    font-family: var(--font-mono);
    font-size: 32px;
    line-height: 1;
}

.zone-mark span {
    margin-top: 8px;
    font-size: 11px;
    font-weight: 750;
}

.decision-reason {
    max-width: 680px;
    margin: 22px 0 0;
    color: var(--text-soft);
    font-size: 16px;
}

.empty-decision {
    min-height: 145px;
    margin: 26px 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.empty-decision strong {
    font-family: var(--font-mono);
    font-size: clamp(42px, 6vw, 76px);
    font-weight: 750;
    letter-spacing: -0.06em;
    line-height: 1;
}

.empty-decision span {
    margin-top: 12px;
    color: var(--text-soft);
}

.candidate-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin: 34px 0;
}

.candidate {
    min-height: 154px;
    padding: 22px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
    border-radius: var(--radius);
    background: var(--accent-soft);
}

.candidate__zodiac {
    color: var(--accent-strong);
    font-size: 34px;
    font-weight: 850;
    line-height: 1;
}

.candidate__amount {
    margin-top: 24px;
    font-family: var(--font-mono);
    font-size: 18px;
    font-weight: 750;
}

.candidate__note {
    color: var(--text-soft);
    font-size: 11px;
}

.decision-totals {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}

.decision-totals div {
    min-width: 0;
    padding: 22px 18px 0 0;
}

.decision-totals div + div {
    padding-left: 18px;
    border-left: 1px solid var(--line);
}

.decision-totals dt,
.decision-totals dd {
    margin: 0;
}

.decision-totals dt {
    color: var(--text-soft);
    font-size: 11px;
}

.decision-totals dd {
    margin-top: 5px;
    overflow: hidden;
    font-family: var(--font-mono);
    font-size: clamp(14px, 1.5vw, 18px);
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.context-panel {
    padding: 34px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 34px;
}

.context-list {
    margin: 0;
}

.context-title {
    margin: 0 0 14px;
    font-size: 16px;
    letter-spacing: -0.02em;
}

.context-list div {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 20px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}

.context-list dt,
.context-list dd {
    margin: 0;
}

.context-list dt {
    color: var(--text-soft);
}

.context-list dd {
    font-weight: 750;
}

.stage-block h3 {
    margin: 0 0 14px;
    font-size: 14px;
}

.stage-rail {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stage-rail__item {
    min-width: 0;
    padding: 12px 8px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
    text-align: center;
}

.stage-rail__item strong,
.stage-rail__item span {
    display: block;
}

.stage-rail__item strong {
    font-family: var(--font-mono);
}

.stage-rail__item span {
    margin-top: 3px;
    color: var(--text-soft);
    font-size: 10px;
}

.stage-rail__item.is-current {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.model-note {
    margin: 0;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    color: var(--text-soft);
    font-size: 12px;
}

.summary-band {
    margin-top: 20px;
    padding: 34px;
    display: grid;
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
    gap: 44px;
    align-items: center;
}

.summary-band h2,
.update-band h2,
.history-heading h2 {
    margin: 0;
    font-size: clamp(26px, 3vw, 38px);
    letter-spacing: -0.04em;
    line-height: 1.12;
}

.summary-band__intro > p:last-child,
.update-band > div > p:last-child,
.history-heading > div > p:last-child {
    margin: 12px 0 0;
    color: var(--text-soft);
}

.summary-metrics {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
}

.summary-metrics div {
    min-width: 0;
    padding: 12px 22px;
    border-left: 1px solid var(--line);
}

.summary-metrics dt,
.summary-metrics dd {
    margin: 0;
}

.summary-metrics dt {
    color: var(--text-soft);
    font-size: 11px;
}

.summary-metrics dd {
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: clamp(16px, 2vw, 22px);
    font-weight: 750;
    white-space: nowrap;
}

.update-band {
    margin-top: 20px;
    padding: 34px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: center;
}

.update-status {
    margin: 0;
    display: grid;
    grid-template-columns: 0.8fr 1.2fr;
    gap: 12px;
}

.update-status div {
    min-width: 0;
    padding: 16px;
    border-radius: var(--radius);
    background: var(--surface-strong);
}

.update-status dt,
.update-status dd {
    margin: 0;
}

.update-status dt {
    color: var(--text-soft);
    font-size: 11px;
}

.update-status dd {
    margin-top: 5px;
    font-size: 12px;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.history-section {
    margin-top: 20px;
    overflow: hidden;
}

.history-heading {
    padding: 34px 34px 22px;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
}

.records-page .history-heading {
    padding: 26px 30px 18px;
}

.history-count {
    min-width: 110px;
    text-align: right;
}

.history-count strong,
.history-count span {
    display: block;
}

.history-count strong {
    font-family: var(--font-mono);
    font-size: 28px;
    line-height: 1;
}

.history-count span {
    margin-top: 5px;
    color: var(--text-soft);
    font-size: 11px;
}

.history-controls {
    padding: 18px 34px;
    display: grid;
    grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.35fr);
    gap: 14px;
    border-top: 1px solid var(--line);
    background: var(--surface-strong);
}

.records-page .history-controls {
    padding: 14px 30px;
}

.history-controls label {
    display: grid;
    gap: 7px;
}

.history-controls label > span {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.history-controls input,
.history-controls select {
    width: 100%;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    outline: none;
    background: var(--surface);
    color: var(--text);
}

.history-controls input::placeholder {
    color: color-mix(in srgb, var(--text-soft) 80%, transparent);
}

.history-controls input:focus,
.history-controls select:focus,
.table-wrap:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.table-wrap {
    max-height: 760px;
    overflow: auto;
    border-top: 1px solid var(--line);
    outline: none;
}

table {
    width: 100%;
    min-width: 1480px;
    border-collapse: collapse;
    font-size: 12px;
}

.records-table {
    min-width: 1080px;
    table-layout: auto;
}

.records-table th,
.records-table td {
    padding-inline: 12px;
}

.records-table th:first-child,
.records-table td:first-child {
    position: sticky;
    left: 0;
}

.records-table th:first-child {
    z-index: 4;
}

.records-table td:first-child {
    z-index: 1;
    background: inherit;
}

caption {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

thead {
    position: sticky;
    top: 0;
    z-index: 2;
}

th {
    padding: 13px 14px;
    border-bottom: 1px solid var(--line-strong);
    background: var(--surface-muted);
    color: var(--text-soft);
    font-weight: 750;
    text-align: left;
    white-space: nowrap;
}

td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-mono);
    white-space: nowrap;
}

tbody tr {
    background: var(--surface);
}

tbody tr:hover {
    background: var(--surface-strong);
}

.issue-cell strong,
.issue-cell span,
.cell-sub {
    display: block;
}

.issue-cell span,
.cell-sub {
    margin-top: 2px;
    color: var(--text-soft);
    font-family: var(--font-sans);
    font-size: 10px;
}

.zodiac-cell,
.actual-zodiac {
    font-family: var(--font-sans);
    font-size: 13px;
    font-weight: 750;
}

.actual-zodiac {
    color: var(--accent-strong);
}

.special-prediction--hit {
    display: inline-block;
    padding: 2px 5px;
    border-radius: 4px;
    background: #16a34a;
    color: #fff;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.draw-result {
    display: inline-flex;
    align-items: center;
    gap: 18px;
    white-space: nowrap;
}

.result-badge {
    display: inline-flex;
    min-width: 52px;
    justify-content: center;
    padding: 3px 8px;
    border-radius: var(--radius);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 800;
}

.result-badge--命中 {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.result-badge--未命中 {
    background: var(--negative-soft);
    color: var(--negative);
}

.result-badge--pingma-hit {
    background: #22c55e;
    color: #fff;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}
.result-badge--pingma-hit::before {
    content: "✓ ";
    font-size: 11px;
}

.result-badge--pingma-special-hit {
    min-width: 96px;
    background: var(--warn-soft);
    color: var(--warn);
    border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
    white-space: nowrap;
}

.records-page .result-badge--pingma-special-hit {
    background: #22c55e;
    color: #fff;
    border: 0;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.risk-summary,
.risk-summary__item {
    display: inline-flex;
    align-items: center;
}

.risk-summary {
    gap: 12px;
}

.risk-summary__item {
    gap: 5px;
}

.risk-summary__label {
    color: var(--text-soft);
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 800;
}

.pingma-summary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pingma-summary__zodiac {
    color: var(--risk-pingma);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 850;
}

.pingma-pred--hit {
    background: #22c55e !important;
    color: #fff !important;
    border-radius: 6px;
    font-weight: 900;
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.5);
}

@media (prefers-color-scheme: dark) {
    .result-badge--pingma-hit,
    .records-page .result-badge--pingma-special-hit {
        background: #16a34a;
        color: #fff;
        box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
    }
    .pingma-pred--hit {
        background: #16a34a !important;
        color: #fff !important;
        box-shadow: 0 0 8px rgba(22, 163, 74, 0.5);
    }
}

.result-badge--未下注 {
    background: var(--surface-muted);
    color: var(--text-soft);
}

.money-positive {
    color: var(--accent-strong);
    font-weight: 750;
}

.money-negative {
    color: var(--negative);
    font-weight: 750;
}

.table-empty {
    padding: 48px 24px;
    color: var(--text-soft);
    text-align: center;
}

.table-load-state {
    min-height: 44px;
    padding: 12px 16px;
    color: var(--text-soft);
    text-align: center;
}

.table-load-state button {
    border: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}

.error-state {
    max-width: 760px;
    margin: 12vh auto 0;
    padding: 48px;
}

.error-state h1 {
    margin: 0;
    font-size: 42px;
    letter-spacing: -0.05em;
}

.error-state p:not(.section-label) {
    color: var(--text-soft);
}

.footer {
    width: min(1400px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 0 38px;
    color: var(--text-soft);
    font-size: 11px;
}

[hidden] {
    display: none !important;
}

@media (max-width: 1040px) {
    .recommendation-grid,
    .summary-band {
        grid-template-columns: 1fr;
    }

    .context-panel {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .model-note {
        grid-column: 1 / -1;
    }
}

@media (max-width: 767px) {
    .topbar__inner,
    .page-shell,
    .footer {
        width: min(100% - 28px, 1400px);
    }

    .brand__rule,
    .data-freshness span {
        display: none;
    }

    .page-shell {
        padding-top: 28px;
    }

    .hero {
        grid-template-columns: 1fr;
        gap: 26px;
        min-height: 0;
        padding: 12px 0 34px;
    }

    .hero h1 {
        font-size: clamp(38px, 12vw, 54px);
    }

    .hero__meta dd {
        text-align: left;
    }

    .decision-panel,
    .context-panel,
    .summary-band,
    .update-band {
        padding: 24px;
    }

    .decision-panel {
        min-height: 0;
    }

    .decision-panel__header {
        gap: 16px;
    }

    .zone-mark {
        width: 72px;
        min-width: 72px;
    }

    .zone-mark strong {
        font-size: 25px;
    }

    .decision-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 18px;
    }

    .decision-totals div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .context-panel,
    .update-band {
        grid-template-columns: 1fr;
    }

    .summary-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .summary-metrics div:nth-child(odd) {
        border-left: 0;
    }

    .update-status,
    .history-controls {
        grid-template-columns: 1fr;
    }

    .history-heading {
        padding: 26px 22px 18px;
        align-items: flex-start;
    }

    .records-page .history-heading {
        flex-direction: column;
    }

    .history-controls {
        padding: 18px 22px;
    }

    .table-wrap {
        max-height: 680px;
    }
}

@media (prefers-reduced-transparency: reduce) {
    .topbar {
        background: var(--bg);
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ──────────────────────────────────────────────
   新增：登录、导航、双模型卡片、记录查询等组件
   ────────────────────────────────────────────── */
:root {
    --risk-high: #b4543a;
    --risk-high-soft: #f6e7e1;
    --risk-med: #2f6f8f;
    --risk-med-soft: #e2eef4;
    --risk-pingma: #7b5ea7;
    --risk-pingma-soft: #ece6f5;
    --warn: #9a6b1f;
    --warn-soft: #f5ecd8;
}

@media (prefers-color-scheme: dark) {
    :root {
        --risk-high: #e0907a;
        --risk-high-soft: #3a2620;
        --risk-med: #7fb6d6;
        --risk-med-soft: #1d2e36;
        --risk-pingma: #b89dd6;
        --risk-pingma-soft: #2a2235;
        --warn: #d8b06a;
        --warn-soft: #332a18;
    }
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    font-weight: 700;
    cursor: pointer;
    transition: border-color var(--transition-fast, 150ms ease), background 150ms ease, transform 150ms ease;
}

.btn:hover {
    border-color: var(--accent);
}

.btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn--primary {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.btn--primary:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
}

.btn--ghost {
    background: var(--surface-strong);
}

/* 导航 */
.nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav__link {
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    color: var(--text-soft);
    transition: background 150ms ease, color 150ms ease;
}

.nav__link:hover {
    background: var(--surface-muted);
    color: var(--text);
}

.nav__link--active {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

/* 登录 */
.auth-body {
    display: grid;
    place-items: center;
    min-height: 100dvh;
    padding: 24px;
}

.auth-shell {
    width: min(420px, 100%);
}

.auth-card {
    padding: 40px 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.auth-brand {
    display: flex;
    align-items: baseline;
    gap: 12px;
    margin-bottom: 26px;
}

.auth-form {
    display: grid;
    gap: 16px;
    margin-top: 8px;
}

.auth-form label {
    display: grid;
    gap: 7px;
}

.auth-form label > span {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.auth-form input {
    height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.auth-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.auth-sub {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 14px;
}

.auth-error {
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: var(--radius);
    background: var(--negative-soft);
    color: var(--negative);
    font-size: 13px;
    font-weight: 700;
}

/* 本金栏 */
.capital-bar {
    margin-top: 22px;
    padding: 22px 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.capital-form {
    display: flex;
    align-items: flex-end;
    gap: 14px;
    flex-wrap: wrap;
}

.capital-form label {
    display: grid;
    gap: 7px;
}

.capital-form label > span {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.capital-form input {
    width: 200px;
    height: 44px;
    padding: 0 13px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.capital-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.capital-note {
    margin: 12px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

/* 双模型卡片 */
.model-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    align-items: stretch;
}

.model-card {
    padding: clamp(24px, 3vw, 36px);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
}

.model-card--high {
    border-color: color-mix(in srgb, var(--risk-high) 45%, var(--line));
}

.model-card--med {
    border-color: color-mix(in srgb, var(--risk-med) 45%, var(--line));
}

.model-card--pingma {
    border-color: color-mix(in srgb, var(--risk-pingma) 45%, var(--line));
}

.model-card__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
}

.model-card__head h2 {
    margin: 8px 0 0;
    font-size: clamp(24px, 3vw, 32px);
    letter-spacing: -0.04em;
}

.model-tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
}

.model-tag--high {
    background: var(--risk-high-soft);
    color: var(--risk-high);
}

.model-tag--med {
    background: var(--risk-med-soft);
    color: var(--risk-med);
}

.model-tag--pingma {
    background: var(--risk-pingma-soft);
    color: var(--risk-pingma);
}

.model-reason {
    margin: 18px 0 0;
    color: var(--text-soft);
    font-size: 15px;
}

.candidate--dual {
    border-color: color-mix(in srgb, var(--accent) 28%, var(--line));
}

.model-totals {
    margin: 28px 0 0;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-top: 1px solid var(--line);
}

.model-totals div {
    min-width: 0;
    padding: 20px 16px 0 0;
}

.model-totals div + div {
    padding-left: 16px;
    border-left: 1px solid var(--line);
}

.model-totals dt {
    color: var(--text-soft);
    font-size: 11px;
}

.model-totals dd {
    margin: 5px 0 0;
    font-family: var(--font-mono);
    font-size: clamp(13px, 1.4vw, 16px);
    font-weight: 750;
}

.skip-banner {
    margin-top: 22px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
    text-align: center;
}

.skip-banner h2 {
    margin: 0 0 8px;
    font-size: 26px;
    letter-spacing: -0.03em;
}

.skip-banner p {
    margin: 0;
    color: var(--text-soft);
}

/* 数据更新卡片 */
.update-card {
    margin-top: 22px;
    padding: 30px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.update-card__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
}

.update-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.update-hint {
    color: var(--text-soft);
    font-size: 12px;
}

.manual-form {
    margin-top: 24px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 14px;
}

.manual-title {
    margin: 0;
    color: var(--text-soft);
    font-size: 13px;
    font-weight: 700;
}

.manual-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
}

.manual-grid label {
    display: grid;
    gap: 6px;
}

.manual-grid label > span {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.manual-grid input,
.manual-grid select {
    height: 42px;
    padding: 0 10px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.manual-grid input:focus,
.manual-grid select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

/* 对比卡片 */
.compare-grid {
    margin-top: 22px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
}

.compare-card {
    padding: 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.compare-card header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.compare-card header h2 {
    margin: 0;
    font-size: 20px;
    letter-spacing: -0.02em;
}

.compare-metrics {
    margin: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px 8px;
}

.compare-metrics div {
    min-width: 0;
}

.compare-metrics dt {
    color: var(--text-soft);
    font-size: 11px;
}

.compare-metrics dd {
    margin: 4px 0 0;
    font-family: var(--font-mono);
    font-size: clamp(15px, 2vw, 19px);
    font-weight: 750;
}

.footer-note {
    margin: 20px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

/* 提示横幅 */
.flash {
    margin: 0 0 8px;
    padding: 14px 18px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 700;
}

.flash--ok {
    background: var(--accent-soft);
    color: var(--accent-strong);
}

.flash--error {
    background: var(--negative-soft);
    color: var(--negative);
}

/* 记录查询 */
.issue-query {
    display: flex;
    align-items: flex-end;
    gap: 10px;
}

.issue-query label {
    display: grid;
    gap: 6px;
}

.issue-query label > span {
    color: var(--text-soft);
    font-size: 11px;
    font-weight: 700;
}

.issue-query input {
    width: 180px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--line-strong);
    border-radius: var(--radius);
    background: var(--surface);
    color: var(--text);
    outline: none;
}

.issue-query input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}

.flat-cell {
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-soft);
}

.pingma-level-bar {
    display: flex;
    gap: 6px;
    margin: 14px 0 0;
}

.pingma-level-dot {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: var(--surface-muted);
}

.pingma-level-dot.is-active {
    background: var(--risk-pingma);
}

.pingma-level-dot.is-done {
    background: color-mix(in srgb, var(--risk-pingma) 40%, var(--surface-muted));
}

.pingma-freq-detail {
    margin: 10px 0 0;
    color: var(--text-soft);
    font-size: 12px;
}

.pingma-freq-detail strong {
    color: var(--risk-pingma);
    font-family: var(--font-mono);
}

/* 单期详情 */
.detail-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 8px 0 24px;
}

.detail-hero h1 {
    margin: 0;
    font-size: clamp(34px, 4vw, 50px);
    letter-spacing: -0.05em;
}

.detail-date {
    margin: 6px 0 0;
    color: var(--text-soft);
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
}

.detail-card {
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.detail-card h2 {
    margin: 0 0 16px;
    font-size: 18px;
    letter-spacing: -0.02em;
}

.detail-list {
    margin: 0;
    display: grid;
    gap: 14px;
}

.detail-list div {
    display: grid;
    grid-template-columns: 110px minmax(0, 1fr);
    gap: 16px;
    align-items: baseline;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
}

.detail-list dt {
    color: var(--text-soft);
    font-size: 12px;
}

.detail-list dd {
    margin: 0;
    font-weight: 750;
}

.flat-line {
    font-size: 15px;
}

.actual-zodiac.big {
    font-size: 22px;
}

.streak-card {
    margin-top: 20px;
    padding: 26px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
}

.streak-card h2 {
    margin: 0 0 16px;
    font-size: 18px;
}

.streak-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.streak-item {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface-strong);
}

.streak-item--hit {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.streak-item strong {
    display: block;
    font-size: 18px;
}

.streak-item span {
    color: var(--text-soft);
    font-size: 12px;
}

@media (max-width: 1200px) {
    .model-grid,
    .compare-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .model-grid,
    .compare-grid,
    .detail-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .model-totals {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        row-gap: 16px;
    }

    .model-totals div:nth-child(3) {
        padding-left: 0;
        border-left: 0;
    }

    .compare-metrics {
        grid-template-columns: repeat(2, 1fr);
    }

    .detail-list div {
        grid-template-columns: 90px minmax(0, 1fr);
    }

    .issue-query {
        width: 100%;
    }

    .issue-query input {
        width: 100%;
    }
}
