/* Overview-only layout and motion. Full content remains keyboard-scrollable. */
.overview-dashboard { grid-template-areas: "hero coverage" "pipeline coverage" "recent jobs"; align-items: stretch; gap: 18px; }
.overview-dashboard > .overview-main, .overview-dashboard > .overview-side { display: contents; }
.overview-dashboard .overview-hero { grid-area: hero; margin: 0; padding: 20px 24px; }
.overview-dashboard .overview-hero .hero-kicker { margin-bottom: 8px; }
.overview-dashboard .overview-hero p { margin: 8px 0 14px; }
.overview-pipeline { grid-area: pipeline; }
.overview-recent { grid-area: recent; }
.overview-coverage { grid-area: coverage; display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.overview-jobs { grid-area: jobs; }
.overview-recent > .panel-header, .overview-jobs > .panel-header { min-height: 60px; padding: 14px 24px; }
.recent-backtests :is(th, td) { padding-top: 11px; padding-bottom: 11px; }
/* Shared result labels keep lifecycle and supporting quality notes distinct. */
.backtest-result-status { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; max-width: 100%; min-width: 0; white-space: normal; vertical-align: middle; }
.backtest-result-status > .badge { flex: none; white-space: nowrap; }
.result-quality-hints { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; max-width: 100%; min-width: 0; white-space: normal; }
.result-quality-hints > .result-quality-hint { min-width: 0; overflow-wrap: anywhere; }
.recent-backtests > table { width: 100%; table-layout: fixed; }
.recent-backtests :is(th, td) { padding-inline: 14px; }
.recent-backtests :is(th, td):nth-child(1) { width: 35%; white-space: normal; overflow-wrap: anywhere; }
.recent-backtests :is(th, td):nth-child(2) { width: 28%; white-space: normal; }
.recent-backtests :is(th, td):nth-child(3) { width: 21%; text-align: center; }
.recent-backtests :is(th, td):nth-child(4) { width: 16%; text-align: center; }
.recent-backtests td:first-child > .subtle { margin-top: 4px; white-space: nowrap; }
.recent-backtests .backtest-result-status { display: flex; align-items: flex-start; flex-direction: column; gap: 6px; }
.recent-backtests .result-quality-hints { display: flex; flex-direction: column; gap: 3px; }
.recent-backtests .link-button { white-space: nowrap; }
@media (max-width: 600px) {
  .recent-backtests > table, .recent-backtests tbody { display: block; }
  .recent-backtests thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .recent-backtests tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px 16px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
  .recent-backtests tbody tr:last-child { border-bottom: 0; }
  .recent-backtests tbody td:nth-child(n) { width: auto; min-width: 0; padding: 0; border: 0; }
  .recent-backtests td:nth-child(1) { grid-column: 1 / -1; }
  .recent-backtests td:nth-child(2) { grid-row: 2 / 4; }
  .recent-backtests td:nth-child(3) { grid-column: 2; grid-row: 2; text-align: right; }
  .recent-backtests td:nth-child(3)::before { content: "累计收益"; display: block; margin-bottom: 4px; color: var(--subtle); font-family: var(--font); font-size: var(--text-xs); }
  .recent-backtests td:nth-child(4) { grid-column: 2; grid-row: 3; text-align: right; }
}
.overview-jobs .jobs-list { padding: 0 24px 12px; max-height: none; }
.overview-jobs .job-card { padding: 12px 0; }
.overview-jobs .job-progress { margin-top: 9px; }
.overview-jobs .job-actions { margin-top: 8px; }
.overview-dashboard .section-gap { margin-top: 0; }
.overview-pipeline .panel-body { padding: 16px 20px 20px; }
.overview-pipeline .pipeline { gap: 10px; margin-top: 12px; }
.overview-pipeline .pipeline-step { padding: 12px 14px; }
.overview-pipeline .pipeline-step .step-number { margin-bottom: 8px; }
.overview-pipeline .pipeline-step .step-index { min-width: 0; padding: 0; border: 0; font: 500 var(--text-xs)/1.5 var(--font); color: var(--accent); }
.overview-pipeline .pipeline-step h3{ margin-top: 0; font-size: var(--text-md);line-height:var(--leading-heading);}
.overview-pipeline .pipeline-step p{ margin: 6px 0 10px; font-size: var(--text-xs); line-height:var(--leading-help); }
.overview-coverage .panel-header { flex-wrap: wrap; gap: 8px; }
.overview-coverage-heading { display: flex; align-items: center; gap: 10px; }
.overview-motion-toggle{ border: 1px solid var(--line); background: transparent; border-radius: 6px; padding:0 8px; color: var(--muted); font: var(--text-xs)/1.4 var(--font); white-space: nowrap;height:var(--control-height-compact);min-height:var(--control-height-compact);box-sizing:border-box;line-height:1.5;}
.overview-motion-toggle:hover, .overview-motion-toggle:focus-visible { color: var(--text); border-color: var(--accent); }
.overview-motion-toggle[hidden] { display: none; }
.overview-coverage-viewport { flex: 1 1 0; min-height: 0; max-height: none; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.overview-coverage-viewport[data-looping="true"] { scrollbar-width: none; }
.overview-coverage-viewport:focus-visible { outline: 1px solid var(--accent); outline-offset: -3px; }
.overview-coverage-viewport .coverage-row:last-child { border-bottom: 1px solid var(--line-soft); }
.overview-coverage .panel-header, .overview-coverage .table-footer { flex-shrink: 0; }
.overview-coverage .table-footer { margin-top: 0; }
.overview-ticker { min-width: 0; max-width: 100%; margin: -3px 0 22px; padding: 6px 16px 4px; border: 1px solid transparent; border-radius: 12px; background: linear-gradient(115deg, #121d22, #11171e 65%) padding-box, linear-gradient(110deg, #85c7ad70, #34434c88 45%, #85c7ad30) border-box; box-shadow: 0 0 24px #85c7ad08, inset 0 1px 0 #b4e4d509; overflow: hidden; }
.overview-ticker-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 0 2px; border: 0; color: var(--subtle); font-size: var(--text-xs); }
.overview-ticker-label { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 10px; }
.overview-ticker-label strong { color: var(--accent); font-size: var(--text-xs); font-weight: 500; letter-spacing: .4px; }
.overview-ticker-label [data-overview-ticker-date] { color: var(--subtle); font-size: var(--text-xs); }
.overview-ticker-viewport { width: 100%; max-width: 100%; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; scrollbar-color: var(--line) transparent; }
.overview-ticker-viewport[data-looping="true"] { scrollbar-width: none; }
.overview-ticker-viewport:focus-visible { outline: 1px solid var(--accent); outline-offset: -3px; }
.overview-ticker-track { display: flex; width: max-content; }
.overview-ticker-items { display: flex; align-items: center; width: max-content; margin: 0; padding: 0; list-style: none; }
.overview-ticker-item { display: flex; position: relative; align-items: baseline; gap: 16px; padding: 6px 26px 6px 16px; border: 0; white-space: nowrap; font-size: var(--text-xs); }
.overview-ticker-name { color: var(--text); }
.overview-ticker-item::after { content: ""; position: absolute; right: 0; top: 50%; transform: translateY(-50%); width: 1px; height: 20px; background: var(--subtle); opacity: .4; }
.overview-ticker-price { color: var(--text); font-variant-numeric: tabular-nums; }
.overview-ticker-item small{ display: block; margin-top: 3px; font-size: var(--text-xs); line-height:var(--leading-help); }
.overview-ticker-name small { color: var(--subtle); }
.overview-ticker-price { text-align: right; }
.overview-ticker-stale { color: #c4b68e; }
.overview-ticker-change { font-variant-numeric: tabular-nums; }
.overview-ticker-change.is-up { color: #de9b91; }
.overview-ticker-change.is-down { color: #85c7ad; }
.overview-ticker-change.is-flat { color: var(--muted); }
.overview-ticker-message { margin: 0; padding: 12px 14px; color: var(--subtle); font-size: var(--text-xs); }
@media (max-width: 1100px) {
  .overview-dashboard { grid-template-columns: minmax(0, 1.45fr) minmax(270px, 1fr); }
  .overview-pipeline .pipeline { grid-template-columns: 1fr; gap: 8px; }
  .overview-pipeline .pipeline-step { display: grid; grid-template-columns: 48px 1fr; gap: 0 12px; padding: 10px 12px; }
  .overview-pipeline .pipeline-step .step-number { grid-row: 1 / 4; align-items: flex-start; padding-top: 2px; margin: 0; }
  .overview-pipeline .step-number svg { display: none; }
  .overview-pipeline .pipeline-step a { grid-column: 2; }
  .overview-pipeline .pipeline-step p { margin: 4px 0 6px; }
}
@media (max-width: 900px) {
  .overview-dashboard { grid-template-columns: minmax(0, 1fr); grid-template-areas: "hero" "pipeline" "coverage" "recent" "jobs"; }
  .overview-coverage-viewport { flex: none; height: 260px; max-height: 260px; }
  .overview-ticker { margin-bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .overview-ticker-viewport, .overview-coverage-viewport { scroll-behavior: auto; }
}

/* Quiet update beacon and feathered edges keep the strip open and light. */
.overview-update-spark { position: relative; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); flex: none; margin: 0 3px; }
.overview-ticker-label[data-market-ready="true"] .overview-update-spark::after { content: ""; position: absolute; inset: -4px; border: 1px solid var(--accent); border-radius: 50%; animation: overview-update-pulse 2.8s ease-out infinite; }
.overview-ticker-label[data-market-ready="true"] strong { animation: overview-update-glow 3.6s ease-in-out infinite; }
.overview-ticker-label[data-market-ready="false"] .overview-update-spark { background: var(--subtle); }
.overview-ticker-label[data-market-ready="false"] strong { color: var(--muted); }
.overview-ticker .overview-motion-toggle { border-color: transparent; padding: 3px 0 3px 8px; font-size: var(--text-xs); color: var(--subtle); }
.overview-ticker .overview-motion-toggle:hover, .overview-ticker .overview-motion-toggle:focus-visible { color: var(--accent); }
.overview-ticker-viewport { mask-image: linear-gradient(to right, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.overview-ticker-name small { letter-spacing: .35px; font-variant-numeric: tabular-nums; }
@keyframes overview-update-pulse { 0% { transform: scale(.6); opacity: .65; } 75%, 100% { transform: scale(1.3); opacity: 0; } }
@keyframes overview-update-glow { 0%, 100% { text-shadow: 0 0 0 transparent; } 50% { text-shadow: 0 0 12px #85c7ad55; } }
@media (prefers-reduced-motion: reduce) { .overview-ticker-label[data-market-ready="true"] .overview-update-spark::after, .overview-ticker-label[data-market-ready="true"] strong { animation: none; } }

.overview-coverage .table-footer > span { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.coverage-pending { color: var(--accent); font-weight: 500; white-space: nowrap; animation: coverage-pending-glow 2.4s ease-in-out infinite; }
@keyframes coverage-pending-glow { 0%, 100% { opacity: 1; } 50% { opacity: .42; } }
@media (prefers-reduced-motion: reduce) { .coverage-pending { animation: none; } }
