/* Shared interaction polish: retain the native light palette and A-share semantics. */
:root { --muted: #627186; --surface-hover: #f1f6fd; --radius: 16px; }
[hidden] { display: none !important; }
html { scroll-padding-top: 7rem; }
body { font-weight: 400; }
button, input, select, summary { font-family: inherit; }
button, .btn { min-height: 40px; font-weight: 600; }
button:disabled:hover { transform: none; box-shadow: none; }
button:active:not(:disabled), .btn:active { filter: brightness(.97); }
button, a, input, select, summary { -webkit-tap-highlight-color: transparent; }
:where(button, a, input, select, summary):focus-visible { outline: 3px solid #1679ed; outline-offset: 3px; }
input, select { min-height: 42px; border-radius: 10px; font-weight: 400; }
input[type="checkbox"] { width: 18px; min-height: 18px; margin: 0; accent-color: var(--focus); }
input[type="search"] { appearance: auto; }
label { font-weight: 550; font-size: .85rem; }
main { width: min(100%, 1280px); padding: 32px clamp(18px, 3vw, 40px) 48px; }
main:focus { outline: none; }
h1 { font-size: clamp(1.8rem, 3vw, 2.4rem); font-weight: 730; letter-spacing: -.04em; }
h2 { font-weight: 680; letter-spacing: -.025em; }
h3 { font-weight: 650; }
p { overflow-wrap: anywhere; }
.skip-link { position: fixed; top: -100px; left: 18px; z-index: 3000; background: white; padding: 12px 18px; border-radius: 10px; }
.skip-link:focus { top: 12px; }
.topbar { position: sticky; top: 0; z-index: 100; min-height: 64px; background: rgba(255,255,255,.93); box-shadow: 0 1px 0 rgba(23,34,49,.03); }
.topbar nav { gap: 3px; }
.topbar nav a { min-height: 40px; display: inline-flex; align-items: center; font-weight: 550; font-size: .85rem; }
.topbar nav a[aria-current="page"] { background: #e9f2ff; color: #0866cc; font-weight: 650; }
.topbar .account { flex-shrink: 0; border-color: var(--line); background: transparent; }
.account-item { min-height: 36px; }
.account-username { max-width: 150px; overflow: hidden; text-overflow: ellipsis; font-weight: 550; }
.page-heading { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 28px; }
.page-heading h1 { margin: 4px 0 8px; }
.page-heading p { margin: 0; }
.page-eyebrow { display: block; color: var(--muted); font-size: .8rem; letter-spacing: .04em; margin: 0 0 6px; }
.dashboard-intro h1 { font-size: clamp(1.9rem, 3vw, 2.45rem); }
.dashboard-eyebrow { font-weight: 550; color: var(--muted); font-size: .8rem; }
.statusbar { box-shadow: none; }
.status-item { padding: 14px 16px; }
.status-item-label, .candidate-meta-label, .candidate-sector small, .live-clock { color: var(--muted); }
.status-item-value { font-weight: 600; font-size: .88rem; }
.status-secondary { display: block; font-size: .7rem; color: var(--muted); margin-top: 4px; font-variant-numeric: tabular-nums; }
.status-item-meta { color: var(--muted); font-weight: 450; }
.tasks { margin-bottom: 20px; }
.task { font-size: .75rem; font-weight: 450; }
.hero-title { font-size: 1.22rem; }
.hero-header { margin-bottom: 14px; }
.candidate-provenance { margin: 7px 0 0; font-size: .8rem; color: #49637e; }
.candidate-provenance[data-retained="true"] { padding: 9px 12px; background: #eaf1f9; border-radius: 9px; }
.dashboard-cards > .card { position: relative; min-height: 110px; padding: 18px 22px; border-radius: var(--radius); box-shadow: 0 2px 7px rgba(30,50,75,.025); transition: border-color .16s, box-shadow .16s; }
.dashboard-cards > .card:focus-within { outline: 3px solid var(--focus); outline-offset: 3px; }
.display-code, .ashare-pct, .ashare-price, td, .outcome-return { font-variant-numeric: tabular-nums; }
.card-open-detail { position: static; min-width: 40px; min-height: 44px; }
.card-open-detail::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); }
.card-open-detail:focus-visible { outline: none; }
.card-open-detail:hover { background: transparent; }
.hero-action-box { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; margin-top: 18px; }
.hero-action-button, .hero-history-button { min-height: 42px; padding: 9px 18px; font-size: .88rem; font-weight: 600; }
.hero-action-button.btn-refresh { margin-right: auto; }
.hero-action-button.btn-notify, .hero-history-button { background: transparent; border-color: transparent; color: #53667e; }
.hero-history-button:hover, .hero-action-button.btn-notify:hover { background: #e9f2ff; border-color: transparent; }
.refresh-progress { width: 100%; order: 4; }
.readonly-note { color: var(--muted); font-size: .73rem; margin-top: 14px; }
.readonly-note > span { display: none; }
.button-secondary { color: #42566e; border: 1px solid var(--line); background: #fff; }
.button-secondary:hover { color: #0866cc; background: #edf5ff; border-color: #bdd5f2; }
.list-status { color: var(--muted); font-size: .85rem; margin: 12px 0; }
.list-status[data-error="true"] { color: #b63838; }
.filters, .record-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px; padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.filters input, .record-filters input, .record-filters select { margin: 6px 0 0; }
.filters .repeat-filter { align-self: center; padding-top: 18px; }
.filters button { margin-bottom: 0; }
.table-wrap { overflow-x: auto; border-radius: 12px; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: .85rem; }
th { background: #f0f3f8; color: #53667e; font-weight: 600; text-align: left; border: 0; padding: 13px 16px; white-space: nowrap; }
td { padding: 14px 16px; border: 0; border-bottom: 1px solid #edf0f5; vertical-align: top; line-height: 1.65; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #f7faff; }
td small { display: block; font-size: .74rem; color: var(--muted); }
#load-more { display: block; margin: 20px auto; background: #fff; border-color: var(--line); color: var(--focus); }
#load-more:hover { background: #edf5ff; }
.empty-state { padding: 40px 24px; text-align: center; color: var(--muted); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.empty-state strong { display: block; color: #33445a; font-size: 1rem; margin-bottom: 8px; }
.outcome-editorial, .outcome-portfolio, .outcome-slot-card { border-radius: var(--radius); box-shadow: none; }
.outcome-editorial { margin-top: 30px; }
.editorial-kicker { font-family: var(--font-sans); font-weight: 550; color: var(--muted); letter-spacing: .04em; }
.outcome-range { flex-wrap: nowrap; padding: 4px; gap: 2px; border-radius: 12px; background: #e9edf3; }
.outcome-range button { border: 0; background: transparent; font-size: .85rem; min-height: 36px; white-space: nowrap; color: #627186; }
.outcome-range button:hover { background: #f6f8fc; color: #33445a; }
.outcome-range button.is-active { background: #fff; color: #1c2d42; box-shadow: 0 1px 4px rgba(30,50,75,.12); }
.outcome-page-status { border: 0; background: transparent; padding: 0; font-size: .85rem; color: var(--muted); }
.outcome-page-status[data-error="true"] { color: #b63838; }
.outcome-summary-card { padding: 18px 20px; background: #fff; border: 1px solid var(--line); border-radius: 14px; }
.outcome-editorial .outcome-summary-card { background: #f8fafd; border: 0; }
.outcome-summary-card strong { font-family: var(--font-sans); font-weight: 680; font-size: clamp(1.55rem, 3vw, 2rem); letter-spacing: -.03em; }
.outcome-summary-card span, .outcome-summary-card small { color: var(--muted); }
.outcome-disclaimer { border: 0; border-radius: 10px; background: #f0f3f8; color: #59697d; font-size: .8rem; }
.outcome-slot-stats dd { font-weight: 650; }
.outcome-slot-stats dt { font-size: .78rem; }
.backfill-details { color: var(--muted); font-size: .8rem; margin: 14px 0; }
summary { cursor: pointer; min-height: 40px; padding: 10px 0; list-style-position: inside; }
.backfill-details p { margin: 4px 0 0; padding: 12px 16px; border-radius: 10px; background: #eef2f7; line-height: 1.75; }
.outcome-record-grid { display: block; }
.outcome-day { margin: 10px 0; border: 1px solid var(--line); border-radius: 14px; background: #fff; overflow: hidden; }
.outcome-day > summary { padding: 16px 20px; color: #33445a; font-weight: 600; }
.outcome-day > summary span { float: right; font-weight: 400; color: var(--muted); font-size: .8rem; }
.outcome-day-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 0 16px 16px; }
.outcome-record-card { border: 1px solid var(--line); border-top: 1px solid var(--line) !important; border-radius: 10px; color: var(--fg) !important; background: #fbfcfe; }
.outcome-record-card h3 small { display: block; margin-top: 4px; font-family: var(--font-sans); font-size: .78rem; font-weight: 400; }
.outcome-price-line { font-family: var(--font-sans); font-size: .85rem; }
.outcome-record-card > .muted { font-size: .78rem; }
.outcome-return { font-weight: 650; }
.report-list { display: grid; gap: 12px; }
.report-card { padding: 22px 24px; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); }
.report-card:first-child { border-color: #c1d7f1; }
.report-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.report-header h2 { font-size: 1.12rem; margin: 0 0 6px; }
.report-header p { margin: 0; font-size: .82rem; color: var(--muted); }
.report-badge { font-size: .72rem; background: #edf5ff; color: #2165a9; padding: 3px 8px; border-radius: 6px; margin-left: 10px; white-space: nowrap; }
.report-body { white-space: pre-wrap; font-size: .9rem; line-height: 1.9; color: #42566e; border-top: 1px solid var(--line); padding-top: 16px; }
.report-detail > summary { color: var(--focus); font-size: .85rem; }
.report-diagnostics { color: var(--muted); font-size: .78rem; }
.report-diagnostics a { display: inline-block; min-height: 36px; }
.report-status { margin: 6px 0 0; color: #b63838; font-size: .8rem; }
#alerts-live { margin-bottom: 24px; }
#alerts-live > .muted { padding: 14px 18px; background: #edf3fa; border-radius: 12px; font-size: .85rem; }
.drawer-overlay { margin: 0; padding: 0; width: 100%; max-width: none; height: 100%; max-height: none; border: 0; background: transparent; backdrop-filter: none; }
.drawer-overlay:not([open]) { display: none !important; }
.drawer-overlay::backdrop { background: rgba(24,37,54,.28); backdrop-filter: blur(3px); }
.drawer-content { width: min(100%, 540px); max-width: none; padding: 24px 28px; border-radius: 20px 0 0 20px; box-shadow: -12px 0 60px rgba(23,34,49,.12); }
.drawer-header { position: sticky; top: -24px; padding: 14px 0; margin-top: -14px; background: rgba(255,255,255,.97); z-index: 1; }
.drawer-title { font-size: 1rem; color: var(--muted); font-weight: 550; }
.drawer-close { min-width: 56px; min-height: 40px; background: #eff3f8; border: 0; color: #42566e; }
.drawer-close:hover { background: #e2edf9; color: var(--focus); }
.detail-loading { padding: 40px 0; color: var(--muted); }
.detail-stock-name { margin-top: 22px; }
.kv { grid-template-columns: 5rem minmax(0,1fr); gap: 16px; padding-top: 20px; border-top: 1px solid var(--line); font-size: .9rem; }
.kv dt { color: var(--muted); font-weight: 450; }
.kv dd { margin: 0; overflow-wrap: anywhere; line-height: 1.75; }
.detail-factor-json { white-space: pre-wrap; overflow-wrap: anywhere; font-size: .75rem; padding: 14px; background: #f5f7fb; border-radius: 10px; }
.version-note { font-size: .72rem; color: var(--muted); padding-bottom: 24px; }
@media (max-width: 1000px) {
  .topbar { gap: 12px; padding: 10px 20px; }
  .topbar nav { order: 3; flex-basis: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .topbar nav a { flex-shrink: 0; }
  .statusbar { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .status-item { border-bottom: 1px solid var(--line); }
  .status-item:nth-child(3) { border-right: 0; }
  .status-item:nth-last-child(-n+2) { border-bottom: 0; }
  .dashboard-cards > .card { grid-template-columns: 2.5rem minmax(0,1fr) 7rem 3rem minmax(5rem,.75fr) 2rem; gap: 12px; padding: 16px; }
  .level-tag { min-width: 3rem; min-height: 3.4rem; }
  .outcome-page-header { flex-wrap: wrap; }
}
@media (max-width: 720px) {
  .outcome-day-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .dashboard-cards > .card { grid-template-columns: 2.2rem minmax(0,1fr) auto; gap: 10px; }
  .candidate-quote { grid-column: 3; grid-row: 1 / span 2; }
  .level-tag { grid-column: 2; grid-row: 2; min-height: 26px; padding: 3px 8px; font-size: .8rem; }
  .candidate-sector { grid-column: 2 / 4; grid-row: 3; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; align-items: baseline; gap: 8px; }
  .candidate-meta-label { display: none; }
  .candidate-sector strong { font-size: .85rem; }
  .card-open-detail { grid-column: 3; grid-row: 3; justify-self: end; min-height: 32px; }
  .candidate-sector { padding-right: 32px; }
  .dashboard-cards > .card { cursor: pointer; }
  .outcome-summary-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .outcome-slot-stats { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .filters > label:not(.repeat-filter), .record-filters > label { flex: 1 1 140px; }
  .filters input, .record-filters input, .record-filters select { max-width: none; }
  .report-header { align-items: flex-start; }
}
@media (max-width: 480px) {
  main { padding: 22px 16px 32px; }
  .topbar { flex-direction: row; align-items: center; gap: 8px; }
  .topbar .account { width: auto; margin-left: auto; }
  .account-username { max-width: 105px; }
  .topbar .brand { font-size: .95rem; }
  .statusbar { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .status-item { border-right: 1px solid var(--line); padding: 12px; }
  .status-item:nth-child(2n) { border-right: 0; }
  .status-item:last-child { grid-column: 1/-1; border-right: 0; }
  .status-item:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .status-item-label { font-size: .72rem; }
  .status-item-value { font-size: .81rem; }
  .status-secondary { font-size: .68rem; }
  .hero-action-box { justify-content: center; }
  .hero-action-button.btn-refresh { width: 100%; margin-right: 0; }
  .hero-history-button, .hero-action-button.btn-notify { font-size: .8rem; }
  .readonly-note { text-align: center; display: block; }
  .outcome-editorial { padding: 18px 14px; }
  .outcome-summary-card { padding: 14px 12px; }
  .outcome-day-grid { grid-template-columns: 1fr; }
  .outcome-slot-stats div { padding: 10px 2px; }
  .outcome-slot-stats dd { font-size: 1rem; }
  .outcome-day > summary { padding: 14px; }
  .report-card { padding: 18px; }
  .report-header { flex-wrap: wrap; }
  .drawer-content { border-radius: 0; padding: 20px; }
  .drawer-header { top: -20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; scroll-behavior: auto !important; }
}
@media (prefers-reduced-transparency: reduce) { .topbar, .drawer-header { background: #fff; backdrop-filter: none; } .drawer-overlay::backdrop { backdrop-filter: none; } }
@media (prefers-contrast: more) { :root { --muted: #45566d; --line: #aab6c6; } .status-item-label, .display-code, .candidate-sector small { color: #45566d; } }
