:root {
  color-scheme: light;
  --canvas: oklch(0.982 0.004 235);
  --surface: oklch(0.995 0.003 235);
  --muted-surface: oklch(0.955 0.008 235);
  --text: oklch(0.205 0.014 245);
  --muted: oklch(0.49 0.018 245);
  --border: oklch(0.885 0.011 240);
  --blue: oklch(0.55 0.17 252);
  --blue-soft: oklch(0.95 0.025 252);
  --up: oklch(0.57 0.21 25);
  --up-soft: oklch(0.965 0.025 25);
  --down: oklch(0.53 0.15 153);
  --down-soft: oklch(0.96 0.025 153);
  --amber: oklch(0.67 0.15 78);
  --amber-soft: oklch(0.965 0.025 78);
  --shadow: 0 12px 32px oklch(0.25 0.02 245 / 0.07);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { min-width: 320px; margin: 0; background: var(--canvas); color: var(--text); font-size: 14px; line-height: 1.55; }
a { color: var(--blue); text-decoration: none; }
button, input, select { font: inherit; letter-spacing: 0; }
button, select, input { border: 1px solid var(--border); border-radius: 6px; background: var(--surface); color: var(--text); }
button { cursor: pointer; }
button:hover { border-color: oklch(0.72 0.05 250); }
:focus-visible { outline: 3px solid oklch(0.72 0.12 250 / 0.42); outline-offset: 2px; }
.skip-link { position: fixed; top: -60px; left: 12px; z-index: 100; padding: 8px 12px; border-radius: 4px; background: var(--text); color: var(--surface); }
.skip-link:focus { top: 12px; }

.app-header { position: sticky; top: 0; z-index: 30; height: 62px; border-bottom: 1px solid var(--border); background: oklch(0.982 0.004 235 / 0.96); backdrop-filter: blur(8px); }
.header-inner { width: min(1360px, calc(100% - 40px)); height: 100%; margin: auto; display: flex; align-items: center; gap: 28px; }
.brand { min-width: max-content; display: flex; align-items: center; gap: 9px; color: var(--text); }
.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 6px; background: var(--text); color: var(--surface); font-size: 11px; font-weight: 850; }
.brand strong { font-size: 16px; }
.brand small { color: var(--blue); font-weight: 800; }
.desktop-nav { align-self: stretch; display: flex; }
.desktop-nav a { min-width: 68px; padding: 0 14px; display: grid; place-items: center; border-bottom: 2px solid transparent; color: var(--muted); }
.desktop-nav a[aria-current="page"] { border-color: var(--blue); color: var(--text); font-weight: 750; }
.system-state { min-width: 0; margin-left: auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.market-tag { padding: 3px 7px; border-radius: 4px; background: var(--muted-surface); color: var(--text); }
.state-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.state-dot.ok { background: var(--down); }
.state-dot.bad { background: var(--up); }

.content-shell { width: min(1360px, calc(100% - 40px)); margin: auto; padding: 34px 0 88px; }
.view, .today-grid > *, .game-layout > *, .detail-columns > *, .engine-row > * { min-width: 0; }
.view[hidden] { display: none; }
.page-heading { min-height: 58px; margin-bottom: 22px; display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; }
.page-heading h1 { margin: 3px 0 0; font-size: 25px; line-height: 1.2; font-weight: 780; }
.eyebrow { margin: 0; color: var(--blue); font-size: 12px; font-weight: 800; }
.updated-time, .page-heading > span, .page-heading > time { color: var(--muted); font-size: 12px; text-align: right; }
.section-heading { min-height: 40px; margin: 28px 0 11px; display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; }
.section-heading h2 { margin: 0; font-size: 17px; line-height: 1.25; }
.section-heading p { margin: 3px 0 0; color: var(--muted); font-size: 12px; }
.count-label { color: var(--muted); font-size: 12px; }
.text-link { font-weight: 700; }

.metric-band { min-height: 82px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: hidden; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); box-shadow: var(--shadow); }
.metric { min-width: 0; padding: 16px 18px; border-right: 1px solid var(--border); }
.metric:last-child { border-right: 0; }
.metric small { display: block; color: var(--muted); font-size: 11px; }
.metric strong { display: block; margin-top: 4px; font-size: 17px; line-height: 1.3; overflow-wrap: anywhere; }
.metric span { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.takeover { color: var(--blue); }

.forecast-section { margin-top: 8px; }
.status-chip { display: inline-flex; align-items: center; width: fit-content; padding: 4px 8px; border-radius: 4px; font-size: 11px; font-weight: 750; }
.status-chip.good { background: var(--down-soft); color: var(--down); }
.status-chip.bad { background: var(--up-soft); color: var(--up); }
.status-chip.neutral { background: var(--amber-soft); color: oklch(0.52 0.13 70); }
.forecast-board { min-height: 100px; border-top: 1px solid var(--border); }
.forecast-head, .forecast-row { min-width: 0; display: grid; grid-template-columns: minmax(150px, 1.2fr) minmax(100px, .8fr) minmax(160px, 1fr) minmax(160px, 1fr) minmax(120px, .8fr); gap: 14px; align-items: center; }
.forecast-head { min-height: 38px; color: var(--muted); font-size: 11px; }
.forecast-row { min-height: 64px; border-top: 1px solid var(--border); }
.forecast-cell strong, .stock-cell strong { display: block; overflow-wrap: anywhere; }
.forecast-cell small, .stock-cell small { color: var(--muted); font-size: 11px; }
.forecast-unpublished { min-height: 92px; padding: 20px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--amber-soft); }
.forecast-unpublished svg { flex: 0 0 auto; color: var(--amber); }
.forecast-unpublished strong, .forecast-unpublished span { display: block; }
.forecast-unpublished span { color: var(--muted); font-size: 12px; }

.today-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr); gap: 36px; }
.sector-lanes { min-height: 92px; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.sector-item { min-width: 0; padding: 13px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.sector-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; font-weight: 720; }
.sector-title span:first-child { overflow-wrap: anywhere; }
.bias-value, .up { color: var(--up); font-weight: 750; }
.down { color: var(--down); font-weight: 750; }
.bias-track { height: 4px; margin-top: 15px; overflow: hidden; border-radius: 2px; background: var(--muted-surface); }
.bias-track span { display: block; height: 100%; background: var(--up); }
.compact-list { min-height: 90px; }
.compact-row { min-width: 0; min-height: 58px; display: grid; grid-template-columns: minmax(110px, 1fr) 92px 88px; gap: 12px; align-items: center; border-bottom: 1px solid var(--border); }
.compact-row > * { min-width: 0; }
.compact-row strong, .compact-row span { overflow-wrap: anywhere; }
.compact-row .type { color: var(--blue); font-size: 11px; font-weight: 700; }

.news-section { margin-top: 8px; }
.news-columns { min-height: 390px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: 6px; background: var(--surface); overflow: hidden; }
.news-lane { min-width: 0; }
.news-lane + .news-lane { border-left: 1px solid var(--border); }
.news-lane-head { height: 46px; padding: 0 15px; display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); background: var(--muted-surface); }
.news-lane-head strong { font-size: 13px; }
.news-lane-head span { color: var(--muted); font-size: 11px; }
.news-ticker { height: 344px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scroll-behavior: auto; }
.news-ticker:focus-visible { outline-offset: -3px; }
.news-track { min-height: 100%; }
.news-repeat { display: block; }
.news-item { min-width: 0; min-height: 104px; padding: 13px 15px; display: grid; grid-template-columns: minmax(0, 1fr) 18px; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); color: var(--text); }
.news-item:hover, .news-item:focus-visible { background: var(--blue-soft); }
.news-item > svg { width: 16px; height: 16px; color: var(--muted); }
.news-copy { min-width: 0; }
.news-item h3 { margin: 0; font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.news-item p { margin: 5px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.news-meta { margin-top: 7px; display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 10px; }
.news-meta span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.news-meta time { flex: 0 0 auto; }

.game-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr); gap: 34px; }
.s-game-list, .watch-list, .game-list { min-height: 90px; }
.s-game { padding: 20px; border: 1px solid oklch(0.83 0.07 25); border-radius: 6px; background: var(--up-soft); }
.s-game + .s-game { margin-top: 10px; }
.s-game-top, .game-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.level-badge { flex: 0 0 auto; min-width: 34px; height: 30px; padding: 0 8px; display: grid; place-items: center; border-radius: 4px; background: var(--text); color: var(--surface); font-weight: 850; }
.level-badge.a { background: var(--blue); }
.level-badge.b { background: var(--muted); }
.game-title { min-width: 0; flex: 1; }
.game-title h3 { margin: 0; font-size: 16px; line-height: 1.4; overflow-wrap: anywhere; }
.game-title p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.score-block { flex: 0 0 auto; text-align: right; }
.score-block strong { display: block; font-size: 19px; }
.score-block small { color: var(--muted); }
.trace-row { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 6px; }
.trace-tag { padding: 3px 7px; border: 1px solid var(--border); border-radius: 4px; background: var(--surface); color: var(--muted); font-size: 11px; }
.detail-button, .icon-text-button { min-height: 36px; padding: 0 11px; display: inline-flex; align-items: center; gap: 7px; }
.detail-button { margin-top: 15px; color: var(--blue); font-weight: 700; }
.detail-button svg, .icon-text-button svg { width: 16px; height: 16px; }
.watch-item { padding: 13px 0; border-bottom: 1px solid var(--border); }
.watch-item strong, .watch-item span { display: block; }
.watch-item strong { font-size: 13px; }
.watch-item span { margin-top: 4px; color: var(--muted); font-size: 11px; }
.game-row { padding: 16px 0; border-bottom: 1px solid var(--border); }
.game-row .game-row-top { align-items: center; }
.game-facts { margin-top: 12px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.fact { min-width: 0; padding: 8px 10px; background: var(--muted-surface); border-radius: 4px; }
.fact small, .fact strong { display: block; }
.fact small { color: var(--muted); font-size: 10px; }
.fact strong { margin-top: 2px; overflow-wrap: anywhere; }
.validation-strip { min-height: 72px; display: flex; flex-wrap: wrap; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.validation-item { min-width: 150px; flex: 1; padding: 14px; border-right: 1px solid var(--border); }
.validation-item:last-child { border-right: 0; }
.validation-item small, .validation-item strong { display: block; }
.validation-item small { color: var(--muted); font-size: 11px; }
.validation-item strong { overflow-wrap: anywhere; word-break: break-word; }

.game-detail { min-height: 400px; margin-top: 20px; }
.detail-hero { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(320px, .7fr); overflow: hidden; border: 1px solid oklch(0.83 0.07 25); border-radius: 6px; background: var(--up-soft); }
.detail-intro { padding: 28px; }
.detail-intro h1 { margin: 12px 0 8px; font-size: 24px; line-height: 1.35; overflow-wrap: anywhere; }
.detail-intro p { max-width: 70ch; color: var(--muted); }
.detail-image { position: relative; min-height: 240px; background: var(--muted-surface); }
.detail-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.ai-label { position: absolute; right: 8px; bottom: 8px; padding: 3px 6px; border-radius: 3px; background: oklch(0.2 0.01 245 / .82); color: var(--surface); font-size: 10px; }
.detail-columns { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 34px; }
.path-item { padding: 14px 0; border-bottom: 1px solid var(--border); }
.path-header { display: grid; grid-template-columns: 1fr 54px; gap: 12px; }
.path-item p { margin: 5px 0; color: var(--muted); font-size: 12px; }
.probability-track { height: 5px; margin-top: 9px; overflow: hidden; border-radius: 3px; background: var(--muted-surface); }
.probability-track span { display: block; height: 100%; background: var(--blue); }
.evidence-item { padding: 12px 0; border-bottom: 1px solid var(--border); }
.evidence-item a, .evidence-item strong { display: block; color: var(--text); font-weight: 700; overflow-wrap: anywhere; }
.evidence-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; }

.definition-band { padding: 14px 16px; display: grid; grid-template-columns: 180px 1fr; gap: 16px; border: 1px solid var(--border); border-radius: 6px; background: var(--blue-soft); }
.definition-band span { color: var(--muted); }
.filter-bar { margin-top: 18px; padding: 12px; display: grid; grid-template-columns: 180px 220px minmax(200px, 1fr); gap: 12px; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.filter-bar label > span { display: block; margin-bottom: 4px; color: var(--muted); font-size: 11px; }
.filter-bar select, .filter-bar input { width: 100%; height: 38px; padding: 0 10px; }
.opportunity-list { min-height: 180px; margin-top: 18px; }
.opportunity-row { padding: 16px 0; display: grid; grid-template-columns: minmax(140px, 1.1fr) 100px minmax(130px, .9fr) minmax(120px, .8fr) minmax(120px, .8fr) 80px; gap: 14px; align-items: center; border-bottom: 1px solid var(--border); }
.opportunity-row > * { min-width: 0; }
.trade-cell small, .trade-cell strong { display: block; }
.trade-cell small { color: var(--muted); font-size: 10px; }
.trade-cell strong { margin-top: 2px; overflow-wrap: anywhere; }
.opportunity-reason { grid-column: 1 / -1; margin: -6px 0 0; padding-top: 10px; border-top: 1px dashed var(--border); color: var(--muted); font-size: 12px; }

.mechanism-flow { min-height: 78px; display: flex; align-items: stretch; overflow-x: auto; border: 1px solid var(--border); border-radius: 6px; background: var(--surface); }
.mechanism-step { min-width: 150px; flex: 1; padding: 16px 12px; position: relative; display: grid; place-items: center; text-align: center; border-right: 1px solid var(--border); font-weight: 700; }
.mechanism-step:last-child { border-right: 0; }
.mechanism-step small { display: block; color: var(--blue); }
.engine-list { min-height: 220px; }
.engine-row { padding: 17px 0; display: grid; grid-template-columns: 56px minmax(160px, .9fr) minmax(220px, 1.2fr) 110px minmax(220px, 1.2fr); gap: 16px; align-items: start; border-bottom: 1px solid var(--border); }
.engine-code { width: 42px; height: 34px; display: grid; place-items: center; border-radius: 4px; background: var(--text); color: var(--surface); font-weight: 850; }
.engine-code.authority { background: var(--blue); }
.engine-role strong, .engine-role span { display: block; }
.engine-role span, .engine-io, .recent-signal { color: var(--muted); font-size: 11px; }
.engine-io, .recent-signal { overflow-wrap: anywhere; word-break: break-word; }
.engine-io strong { display: block; color: var(--text); font-size: 11px; }
.run-state strong, .run-state small { display: block; }
.run-state small { color: var(--muted); font-size: 10px; }
.recent-signal + .recent-signal { margin-top: 5px; }

.tab-bar { margin: 24px 0 0; display: flex; gap: 4px; border-bottom: 1px solid var(--border); }
.tab-bar button { min-width: 76px; height: 38px; border: 0; border-bottom: 2px solid transparent; border-radius: 0; background: transparent; color: var(--muted); }
.tab-bar button[aria-selected="true"] { border-color: var(--blue); color: var(--text); font-weight: 750; }
.validation-content { min-height: 240px; }
.validation-row { padding: 13px 0; display: grid; grid-template-columns: minmax(150px, 1fr) 100px 100px 90px minmax(160px, 1fr); gap: 14px; align-items: center; border-bottom: 1px solid var(--border); }
.validation-row > * { min-width: 0; overflow-wrap: anywhere; }
.result-good { color: var(--down); font-weight: 750; }
.result-bad { color: var(--up); font-weight: 750; }
.method-copy { max-width: 75ch; padding: 24px 0; }
.method-copy h2 { margin: 0 0 10px; }
.method-copy p, .method-copy li { color: var(--muted); }

.empty { min-height: 90px; padding: 18px; display: grid; place-items: center; border: 1px dashed var(--border); border-radius: 6px; color: var(--muted); text-align: center; }
.error-banner { margin-bottom: 18px; padding: 10px 12px; border: 1px solid oklch(0.82 0.08 25); border-radius: 6px; background: var(--up-soft); color: var(--up); }
.skeleton-block:empty { position: relative; overflow: hidden; border-radius: 6px; background: var(--muted-surface); }
.skeleton-block:empty::after { content: ""; position: absolute; inset: 0; background: oklch(0.995 0.003 235 / .6); transform: translateX(-100%); animation: loading 1.15s infinite; }
.mobile-nav { display: none; }
@keyframes loading { to { transform: translateX(100%); } }

@media (max-width: 980px) {
  .header-inner, .content-shell { width: min(100% - 28px, 760px); }
  .desktop-nav { display: none; }
  .content-shell { padding: 26px 0 calc(86px + env(safe-area-inset-bottom)); }
  .page-heading { min-height: auto; align-items: flex-start; }
  .today-grid, .game-layout, .detail-columns { grid-template-columns: 1fr; gap: 4px; }
  .today-grid > section, .game-layout > section, .game-layout > aside { width: 100%; min-width: 0; overflow: hidden; }
  .sector-lanes { display: flex; overflow-x: auto; padding-bottom: 5px; scroll-snap-type: x mandatory; }
  .sector-item { flex: 0 0 168px; scroll-snap-align: start; }
  .detail-hero { grid-template-columns: 1fr; }
  .detail-image { min-height: 200px; }
  .engine-row { grid-template-columns: 50px minmax(150px, 1fr) 110px; }
  .engine-io, .engine-recent { grid-column: 2 / -1; }
  .mobile-nav { position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; height: calc(64px + env(safe-area-inset-bottom)); padding: 5px 8px env(safe-area-inset-bottom); display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border-top: 1px solid var(--border); background: oklch(0.995 0.003 235 / .98); box-shadow: 0 -8px 22px oklch(0.25 0.01 245 / .06); }
  .mobile-nav a { min-width: 0; display: grid; place-items: center; align-content: center; color: var(--muted); }
  .mobile-nav svg { width: 19px; height: 19px; }
  .mobile-nav small { margin-top: 2px; font-size: 10px; }
  .mobile-nav a[aria-current="page"] { color: var(--blue); }
}

@media (max-width: 620px) {
  .app-header { height: 56px; }
  .brand-mark { width: 30px; height: 30px; }
  .system-state #health-label { display: none; }
  .page-heading h1 { font-size: 22px; }
  .metric-band { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .metric:nth-child(2) { border-right: 0; }
  .metric:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .metric { padding: 13px; }
  .forecast-head { display: none; }
  .forecast-row { padding: 13px 0; grid-template-columns: minmax(120px, 1fr) 90px 90px; }
  .forecast-row > :nth-child(4), .forecast-row > :nth-child(5) { grid-column: span 1; }
  .news-columns { grid-template-columns: 1fr; }
  .news-lane + .news-lane { border-left: 0; border-top: 1px solid var(--border); }
  .news-ticker { height: 300px; }
  .game-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .definition-band { grid-template-columns: 1fr; gap: 5px; }
  .filter-bar { grid-template-columns: 1fr; }
  .opportunity-row { grid-template-columns: minmax(130px, 1fr) 100px; gap: 11px; }
  .opportunity-reason { grid-column: 1 / -1; }
  .engine-row { grid-template-columns: 44px minmax(0, 1fr) 92px; gap: 10px; }
  .engine-code { width: 38px; }
  .validation-strip { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .validation-item { min-width: 0; border-bottom: 1px solid var(--border); }
  .validation-row { grid-template-columns: minmax(120px, 1fr) 90px 80px; }
  .validation-row > :nth-child(4), .validation-row > :nth-child(5) { grid-column: 2 / -1; }
  .detail-intro { padding: 20px; }
  .detail-intro h1 { font-size: 20px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
