:root {
    color-scheme: light;
    --ink: #203126;
    --muted: #68776c;
    --line: #dce5dc;
    --paper: #fffdf7;
    --green: #406b4a;
    --green-soft: #e8f1e7;
    --gold: #f2cb79;
}

* { box-sizing: border-box; }
body { margin: 0; background: #eef3ec; color: var(--ink); font-family: "Segoe UI", "PingFang SC", sans-serif; }
button { font: inherit; cursor: pointer; }
.app-shell { width: min(980px, calc(100% - 32px)); margin: 32px auto; }
.hero { padding: 24px 4px; }
.hero h1, h2, p { margin-top: 0; }
.hero h1 { margin-bottom: 8px; font-size: clamp(2rem, 5vw, 3.4rem); letter-spacing: -.04em; }
.hero > p:last-child { color: var(--muted); margin-bottom: 0; }
.eyebrow { margin-bottom: 6px; color: var(--green); font-size: .75rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.recommend-card, .panel, .insight { background: var(--paper); border: 1px solid var(--line); border-radius: 22px; box-shadow: 0 14px 40px rgba(44,70,49,.06); }
.recommend-card { padding: clamp(22px, 5vw, 42px); border-top: 5px solid var(--gold); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin-bottom: 0; }
.section-heading.compact { align-items: center; }
.badge { padding: 7px 12px; border-radius: 99px; background: var(--green-soft); color: var(--green); font-size: .78rem; font-weight: 700; }
.recommend-numbers { display: flex; flex-wrap: wrap; gap: 12px; margin: 32px 0 22px; min-height: 72px; align-items: center; }
.number-ball { display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; background: var(--ink); color: white; font-size: 1.65rem; font-weight: 800; box-shadow: inset 0 -6px 0 rgba(0,0,0,.15); }
.reason, .hint, .empty-state { color: var(--muted); }
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 20px; }
.meta-item { padding: 12px 14px; background: #f4f7f1; border-radius: 12px; }
.meta-item span { display: block; color: var(--muted); font-size: .72rem; }
.meta-item strong { display: block; margin-top: 3px; }
.workspace { display: grid; grid-template-columns: 1fr 1.2fr; gap: 18px; margin-top: 18px; }
.panel, .insight { padding: 24px; }
.digit-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 22px 0 14px; }
.digit-btn { min-height: 48px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font-weight: 800; }
.digit-btn:hover, .digit-btn.selected { border-color: var(--green); background: var(--green-soft); }
.primary-btn { width: 100%; min-height: 48px; border: 0; border-radius: 12px; background: var(--green); color: white; font-weight: 800; }
.primary-btn:disabled { opacity: .45; cursor: not-allowed; }
.hint { margin: 10px 0 0; font-size: .8rem; text-align: center; }
.text-actions { display: flex; gap: 8px; }
.text-actions button { border: 0; background: transparent; color: var(--green); font-size: .82rem; }
.text-actions .danger-link { color: #a34a42; }
.history-list { display: flex; flex-wrap: wrap; gap: 8px; min-height: 80px; margin: 22px 0; align-content: flex-start; }
.history-number { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-soft); font-weight: 750; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); padding-top: 18px; }
.stats div { text-align: center; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 1.25rem; }
.stats span { color: var(--muted); font-size: .7rem; }
.insight { margin-top: 18px; box-shadow: none; }
.window-switch { display: flex; gap: 4px; padding: 3px; border-radius: 10px; background: #edf2eb; }
.window-switch button { border: 0; border-radius: 8px; padding: 7px 10px; background: transparent; color: var(--muted); font-size: .75rem; }
.window-switch button.active { background: white; color: var(--green); box-shadow: 0 2px 8px rgba(32,49,38,.08); font-weight: 750; }
.trend-summary { margin: 18px 0; color: var(--muted); }
.distribution-chart { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 22px; }
.distribution-row { display: grid; grid-template-columns: 26px 1fr 84px; align-items: center; gap: 10px; min-height: 30px; }
.distribution-digit { font-weight: 800; text-align: center; }
.distribution-track { height: 10px; overflow: hidden; border-radius: 99px; background: #e6ece4; }
.distribution-fill { display: block; height: 100%; min-width: 2px; border-radius: inherit; background: var(--green); }
.distribution-detail { color: var(--muted); font-size: .72rem; text-align: right; white-space: nowrap; }
footer { padding: 24px 4px; color: var(--muted); font-size: .75rem; text-align: center; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); padding: 10px 18px; border-radius: 99px; background: var(--ink); color: white; opacity: 0; pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
    .app-shell { width: min(100% - 20px, 980px); margin-top: 10px; }
    .workspace { grid-template-columns: 1fr; }
    .meta-grid { grid-template-columns: 1fr; }
    .number-ball { width: 56px; height: 56px; }
    .distribution-chart { grid-template-columns: 1fr; }
    .insight .section-heading { display: block; }
    .window-switch { width: fit-content; margin-top: 14px; }
}
