/* Shared design tokens and layout, loaded after module styles. */
:root {
  --ink: #223449;
  --muted: #64758a;
  --line: #dde5ee;
  --soft: #f3f6fa;
  --accent: #187f88;
  --accent-soft: #eaf5f5;
  --green: #22835d;
  --surface: #fff;
  --positive: #cf4c47;
  --negative: #22835d;
  --warning: #966a24;
  --shadow: 0 12px 36px #19324c0c;
  --research-stage-one: #eef5fa;
  --research-stage-two: #f2f6ed;
  --research-stage-three: #f4f0f9;
  --research-stage-four: #faf4eb;
  --research-concept: #966a24;
  --research-concept-soft: #fff7e9;
  font-synthesis: none;
}
body[data-view="auction"] { --accent: #996516; --accent-soft: #fcf5e8; }
body[data-view="high-move"] { --accent: #bd503d; --accent-soft: #fff1ec; }
body[data-view="nodes"] { --accent: #7556b0; --accent-soft: #f3effb; }
body[data-view="ladder"] { --accent: #c45045; --accent-soft: #fff1ed; }
body[data-view="research"] { --accent: #566cb4; --accent-soft: #f0f2fc; }
body[data-view="theme-research"] { --accent: #398060; --accent-soft: #edf6f1; }
body[data-view="theme-research"][data-research-theme="medical"] { --accent: #396fa4; --accent-soft: #edf4fb; }
body[data-view="theme-research"][data-research-theme="physical-ai"] { --accent: #7257a1; --accent-soft: #f3eef9; }
body[data-view="daily-ai-review"] { --accent: #536b85; --accent-soft: #eff3f8; }
body { min-width: 360px; background: #eef2f6; color: var(--ink); font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif; font-size: 13px; line-height: 1.5; }
.app-shell { min-width: 0; }
button, input, select, textarea { font-family: inherit; }
button { touch-action: manipulation; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid #408ba8; outline-offset: 3px; }
input[type="range"]:focus-visible { outline-offset: 6px; }
::selection { background: #d5eae9; color: #183c46; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 20px; color: white; background: #183449; border-radius: 6px; }
.skip-link:focus { top: 8px; }
.market-header { border-top: 3px solid #173749; background: #fff; box-shadow: 0 4px 16px #15334e0a; }
.nav-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 18px; align-items: center; min-height: 62px; border: 0; padding: 0 28px; overflow: visible; }
.member-button { grid-column: 1; grid-row: 1; display: flex; gap: 9px; align-items: center; margin: 0; padding: 8px 0; border: 0; background: none; border-radius: 0; color: #1d3b4e; text-align: left; }
.member-button span { margin: 0; color: inherit; }
.member-button .brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px 9px 9px 2px; color: #fff; background: #1b6671; font-size: 19px; font-weight: 500; }
.brand-name { font-size: 19px; letter-spacing: 1px; line-height: 1.1; }
.brand-name small { display: block; margin-top: 5px; font: 8px/1.2 system-ui, sans-serif; letter-spacing: 1.8px; color: #788a9b; }
.module-nav { grid-row: 1; grid-column: 2; display: flex; gap: 2px; min-width: 0; width: 100%; padding: 0; overflow-x: auto; scrollbar-width: thin; }
.nav-item { display: flex; flex: 1 0 auto; justify-content: center; align-items: center; gap: 5px; min-width: 0; padding: 10px 5px; border-radius: 7px; font-size: 12px; color: #62738a; transition: background .15s, color .15s; }
.nav-item::before { content: ''; display: inline-block; flex: 0 0 6px; width: 6px; height: 6px; border-radius: 2px; background: var(--nav-color, #187f88); margin: 0; }
.nav-item[data-view="auction"] { --nav-color: #b78b3d; }
.nav-item[data-view="high-move"] { --nav-color: #c97358; }
.nav-item[data-view="nodes"] { --nav-color: #9571bd; }
.nav-item[data-view="ladder"] { --nav-color: #ce645e; }
.nav-item[data-view="research"] { --nav-color: #6d7bc1; }
.nav-item[data-view="theme-research"] { --nav-color: #519976; }
.nav-item[data-view="daily-ai-review"] { --nav-color: #698398; }
.nav-item::after { display: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 20%, transparent); }
.nav-item:hover { background: #f2f5f8; }
.runtime-meta { grid-column: 3; grid-row: 1; display: flex; align-items: center; gap: 10px; margin-left: 0; padding: 8px 0; background: none; border: 0; font-size: 11px; }
.runtime-meta b { color: #536c80; font-variant-numeric: tabular-nums; }
.runtime-meta span:first-child { display: none; }
body[data-view="theme-research"] .runtime-meta > span:nth-child(2),
body[data-view="theme-research"] .runtime-meta > span:nth-child(4) { display: none; }
.runtime-meta em { color: #238564; }
.runtime-meta em::before { content: ''; display: inline-block; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: currentColor; }
.refresh-button, .runtime-meta .secondary-button { padding: 6px 11px; border-radius: 6px; color: #486278; border: 1px solid #dbe4ec; background: #fff; font-size: 11px; }
.refresh-button:hover { border-color: var(--accent); color: var(--accent); }
.date-toolbar { height: auto; min-height: 50px; gap: 7px; padding: 7px 28px; border-top: 1px solid #e6ebf1; background: #f9fbfd; }
.date-label, .date-action { height: 33px; padding: 0 12px; border-radius: 6px; font-size: 11px; }
.date-label { border-color: #d4dfe9; background: white; color: #3b536a; }
.date-action.selected { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 35%, white); background: var(--accent-soft); }
.date-current { margin-left: 8px; color: #38546d; white-space: nowrap; font-size: 12px; }
.timeline { max-width: 730px; margin-left: auto; padding-left: 18px; }
.timeline-labels { color: #6c7e90; font-size: 9px; }
.timeline output { padding: 5px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); font-size: 12px; }
.workspace { max-width: 1760px; padding: 14px 28px 24px; }
.module-shell { padding: 16px 20px 22px; border: 1px solid #dfe6ed; border-radius: 12px; box-shadow: var(--shadow); scroll-margin-top: calc(var(--header-height, 115px) + 8px); }
.module-head { align-items: center; gap: 12px; padding-bottom: 12px; }
.module-head h1 { margin-top: 0; font-size: 22px; letter-spacing: -.4px; }
.module-head small { font-size: 9px; font-weight: 700; letter-spacing: 1.5px; }
.module-actions { flex-wrap: wrap; justify-content: flex-end; max-width: 65%; gap: 8px; }
.module-state { max-width: 580px; padding: 5px 9px; border-radius: 5px; background: #f3f6f8; color: #63778c; font-size: 11px; overflow-wrap: anywhere; }
.module-state.connected { background: #edf7f1; color: #297653; }
.module-state.error { background: #fff0eb; color: #b34e34; }
.secondary-button { min-height: 31px; border-radius: 6px; font-size: 11px; color: #526a80; }
.primary-button { border-radius: 7px; }
#module-body { min-width: 0; }
.metric-card, .sentiment-metric { border-radius: 9px; }
.metric-card b, .sentiment-metric b { font-variant-numeric: tabular-nums; }
.stock-chip, .high-move-row { transition: background .12s; }
.stock-chip:hover { box-shadow: 0 2px 10px #2f476a10; }
.reason-panel, .node-reason-panel, .ladder-compare .reason-panel { top: calc(var(--header-height, 175px) + 14px); }
.dair-section-nav { top: var(--header-height, 175px); }
.dair-section { scroll-margin-top: calc(var(--header-height, 175px) + 60px); }
.loading-state, .empty-state { border-radius: 10px; color: #64788c; }
.date-picker { top: calc(var(--header-height, 115px) + 8px); max-height: calc(100dvh - var(--header-height, 115px) - 20px); left: 28px; right: 28px; padding: 18px; border-radius: 12px; box-shadow: 0 20px 80px #18304d30; }
.month-cards { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.day { min-height: 30px; font-size: 11px; }
.day.unavailable { color: #7b8895; }
.home-intro { padding: 44px 5%; min-height: 320px; border-radius: 14px; background: radial-gradient(ellipse at 90% 20%, #cce7e766, transparent 45%), radial-gradient(ellipse at 65% 95%, #e6dcf455, transparent 40%), #fff; }
.home-intro h1 { font-size: clamp(32px, 3.5vw, 54px); line-height: 1.3; color: #24475a; }
.home-intro p:not(.eyebrow) { color: #6e8090; font-size: 14px; }
.desk-footer { display: flex; justify-content: space-between; max-width: 1760px; margin: 0 auto; padding: 0 30px 24px; color: #728497; font-size: 10px; letter-spacing: .5px; }
.desk-footer .static-cadence { display: none; }
body[data-view="theme-research"] .desk-footer .market-cadence { display: none; }
body[data-view="theme-research"] .desk-footer .static-cadence { display: inline; }
.theme-research-shell, .daily-ai-review-shell { padding: 0; }
.theme-research-shell > .module-head, .daily-ai-review-shell > .module-head { padding: 14px 20px; }
.daily-ai-review-shell > .module-head { background: #fff; color: var(--ink); border-color: var(--line); }
.daily-ai-review-shell > .module-head small { color: var(--accent); }
.daily-ai-review-shell .secondary-button { color: #526a80; border-color: var(--line); }
.daily-ai-review-shell .module-state { background: #f3f6f8; color: #617387; }
.daily-ai-review-shell .module-state.connected { background: #edf7f1; color: #297653; }
.high-move-layout { grid-template-columns: 158px minmax(0, 1fr); align-items: start; gap: 14px; min-height: 0; margin-top: 12px; }
.high-move-sidebar { position: sticky; top: calc(var(--header-height, 175px) + 14px); display: flex; flex-direction: column; align-items: stretch; gap: 12px; min-height: 380px; padding: 18px 12px; border: 1px solid var(--line); background: #f7f9fc; color: #3b5063; }
.high-move-sidebar h2 { margin: 0 4px 4px; font-size: 16px; white-space: nowrap; }
.high-move-side-tab { width: 100%; margin: 0; padding: 10px 9px; }
.high-move-intro { margin-bottom: 12px; }
.high-move-detail, .high-move-detail-empty { min-height: 380px; }
.tr-app { min-height: 0; padding: 16px 20px 24px; }
.theme-research-shell #module-body { min-height: 0; }
.tr-landing-hero { min-height: 170px; padding: 24px 30px; }
.tr-landing-hero h1 { margin: 0; font-size: clamp(30px, 3vw, 42px); }
.tr-landing-principles span { padding: 12px 8px; }
.tr-topic-card { min-height: 210px; }
.tr-topic-card h2 { margin-top: 18px; }
.tr-research-main, .tr-search-results, .tr-search-company-list article { overflow-wrap: anywhere; }
@media (max-width: 1180px) {
  .tr-workbench { grid-template-columns: 195px minmax(0, 1fr); gap: 16px; }
  .tr-research-main .tr-branch-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-research-main .tr-company-layout { grid-template-columns: 1fr; }
  .tr-research-main .tr-concept-panel { position: static; min-height: 220px; }
  .tr-research-main .tr-concept-placeholder { min-height: 220px; }
  .tr-intro-content { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .tr-home-search-heading, .tr-home-search-help { align-items: start; flex-direction: column; gap: 8px; }
  .tr-topic-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-workbench { grid-template-columns: 1fr; }
  .tr-research-sidebar { position: static; }
  .tr-directory-toggle { display: block; width: 100%; padding: 10px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); color: var(--accent); text-align: left; }
  .tr-research-sidebar .tr-directory, .tr-research-sidebar > p { display: none; }
  .tr-research-sidebar.is-open .tr-directory { display: block; max-height: 400px; margin-top: 8px; }
  .tr-research-tools { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .tr-search-label { grid-column: 1 / -1; }
  .tr-research-main .tr-node-rule { flex-direction: row; }
  .tr-research-main .tr-company-layout { grid-template-columns: 1fr; }
  .tr-search-nodes, .tr-search-company-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tr-evidence-row { grid-template-columns: repeat(2, minmax(0, 1fr)) 27px; }
  .tr-evidence-row > button { grid-column: 3; grid-row: 1; }
}
@media (max-width: 650px) {
  .tr-home-search { padding: 16px; }
  .tr-home-search-heading h2 { font-size: 19px; }
  .tr-home-search-form { grid-template-columns: minmax(0, 1fr) auto; }
  .tr-home-search-form label { grid-column: 1 / -1; }
  .tr-home-search-results { grid-template-columns: 1fr; }
  .tr-topic-grid { grid-template-columns: 1fr; }
  .tr-research-tools { padding: 12px; gap: 10px; }
  .tr-research-main .tr-branch-grid { grid-template-columns: 1fr; }
  .tr-research-main .tr-node-hero { padding: 18px; }
  .tr-research-main .tr-node-rule { gap: 8px; flex-wrap: wrap; }
  .tr-research-main .tr-node-rule span { width: 100%; }
  .tr-map-viewport { overflow: visible; }
  .tr-industry-map { grid-template-columns: 1fr; min-width: 0; padding: 0; gap: 16px; }
  .tr-industry-map.is-multi-stage { grid-template-columns: 1fr; }
  .tr-map-stage { width: auto; }
  .tr-map-connections { display: none; }
  .tr-map-enter > p { font-size: 12px; }
  .tr-map-enter > b { font-size: 15px; }
  .tr-map-enter > span { font-size: 11px; }
  .tr-search-nodes, .tr-search-company-list { grid-template-columns: 1fr; }
  .tr-intro-content > section > p { font-size: 12px; }
  .tr-boundaries { grid-template-columns: 1fr; }
  .tr-company-section-head { align-items: start; flex-direction: column; }
  .tr-company-group > header > div { min-width: 0; }
  .tr-evidence-row, .tr-relationship-row { grid-template-columns: minmax(0, 1fr) 27px; }
  .tr-evidence-row > button { grid-column: 2; }
}
.dair-hero { padding: 28px 30px 20px; }
.dair-section { padding: 28px 30px; }
.dair-section-head { margin-bottom: 16px; }
.dair-section-head h2 { font-size: 25px; }
.research-list { max-height: min(68vh, 760px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding-right: 5px; }
.research-column-head { min-height: 0; padding-bottom: 10px; }
.research-column-head h2 { margin: 2px 0 0; }
.research-column { min-height: 0; }
.research-card { min-height: 84px; }
.research-card-title { line-height: 1.65; }
.research-list:focus-visible { outline-offset: -3px; }
.operator-dialog { width: min(460px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 14px; color: var(--ink); box-shadow: 0 25px 100px #102c4b40; }
.operator-dialog::backdrop { background: #16304366; backdrop-filter: blur(3px); }
.operator-dialog p { color: #6c7b8e; font-size: 12px; line-height: 1.8; }
.operator-dialog label { display: block; margin: 16px 0 7px; font-size: 12px; }
.operator-dialog input { width: 100%; padding: 11px; border: 1px solid #bfcdda; border-radius: 6px; }
.operator-actions { display: flex; justify-content: flex-end; gap: 10px; align-items: center; }
.operator-actions .primary-button { margin: 0; }
#operator-message { min-height: 22px; color: #ae513d; }
#operator-button.attention { border-color: #d08a4e; color: #996516; }
@media (min-width: 1600px) { .nav-main, .date-toolbar { padding-left: max(28px, calc((100vw - 1704px) / 2)); padding-right: max(28px, calc((100vw - 1704px) / 2)); } }
@media (max-width: 1250px) {
  .runtime-meta > span { display: none; }
}
@media (max-width: 1100px) {
  .nav-main { gap: 12px; padding: 0 18px; }
  .runtime-meta { gap: 10px; }
  .runtime-meta span:nth-child(4) { display: none; }
  .nav-item { gap: 5px; font-size: 12px; }
  .date-toolbar { padding: 10px 18px; }
  .workspace { padding: 16px; }
  .module-shell { padding: 18px; }
  .theme-research-shell, .daily-ai-review-shell { padding: 0; }
  .high-move-layout { grid-template-columns: 144px minmax(0, 1fr); gap: 10px; }
}
@media (max-width: 760px) {
  .app-shell .topbar { padding: 0 14px; gap: 14px; }
  .app-shell .market-status strong { display: none; }
  .ladder-page { padding: 24px 12px; }
  .ladder-page-head { align-items: flex-start; flex-direction: column; gap: 14px; }
  .ladder-page .date-display { text-align: left; }
  .ladder-page .stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder-page .ladder-board { padding: 14px; }
  .ladder-page .ladder-band { grid-template-columns: 40px minmax(0, 1fr); gap: 9px; }
  .ladder-page .board-title { flex-wrap: wrap; gap: 8px; }
  .nav-main { grid-template-columns: auto minmax(0, 1fr); gap: 0 8px; padding: 0 12px; }
  .runtime-meta { grid-column: 1 / -1; grid-row: 2; justify-content: flex-end; padding: 0 0 5px; }
  .runtime-meta > span { display: none; }
  .brand-name { font-size: 16px; white-space: nowrap; }
  .brand-name small { font-size: 7px; letter-spacing: 1px; }
  .module-nav { display: flex; overflow-x: auto; padding-bottom: 0; scrollbar-width: thin; }
  .nav-item { flex: 0 0 auto; padding: 10px 9px; }
  .tr-app { padding: 12px; }
  .tr-landing-hero { min-height: 0; gap: 14px; padding: 18px; }
  .tr-landing-hero h1 { font-size: 28px; }
  .tr-landing-principles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tr-landing-principles span { padding: 8px 3px; }
  .tr-landing-principles b { margin-bottom: 2px; font-size: 11px; }
  .tr-topic-card { min-height: 205px; padding: 20px 20px 76px; }
  .tr-topic-card h2 { margin: 14px 0 6px; font-size: 26px; }
  .tr-topic-card footer { right: 20px; bottom: 16px; left: 20px; }
  .dair-hero { padding: 20px 18px; }
  .dair-section { padding: 22px 18px; }
  .date-toolbar { flex-wrap: wrap; padding: 9px 12px; gap: 5px; }
  .date-label, .date-action { padding: 0 9px; }
  .date-current { margin-left: auto; font-size: 11px; }
  .timeline { flex-basis: 100%; max-width: none; padding: 0; margin: 5px 0 0; }
  .module-head { align-items: flex-start; flex-wrap: wrap; }
  .module-actions { max-width: 100%; justify-content: flex-start; }
  .module-state { max-width: 100%; }
  .module-head h1 { font-size: 21px; }
  .workspace { padding: 12px 8px 22px; }
  .module-shell { padding: 14px 12px; scroll-margin-top: calc(var(--header-height, 165px) + 8px); }
  .theme-research-shell, .daily-ai-review-shell { padding: 0; }
  .research-source-control { position: static; transform: none; margin-left: auto; }
  .date-picker { top: calc(var(--header-height, 165px) + 8px); max-height: calc(100dvh - var(--header-height, 165px) - 16px); left: 8px; right: 8px; padding: 14px; }
  .month-cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
  .high-move-layout { grid-template-columns: 108px minmax(0, 1fr); gap: 8px; }
  .high-move-main, .high-move-lists { grid-template-columns: minmax(0, 1fr); }
  .high-move-sidebar { top: calc(var(--header-height, 165px) + 8px); min-height: 0; padding: 12px 7px; }
  .high-move-sidebar > small { display: none; }
  .high-move-sidebar h2 { margin: 0 3px 2px; font-size: 13px; white-space: normal; }
  .high-move-side-tab { width: 100%; gap: 4px; padding: 8px 5px; font-size: 11px; }
  .high-move-side-tab b { display: none; }
  .high-move-intro { flex-wrap: wrap; }
  .high-move-intro h2 { font-size: 21px; }
  .ladder-layout, .research-grid, .research-columns { grid-template-columns: minmax(0, 1fr); }
  .reason-panel { position: static; }
  .ladder-compare { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ladder-column-current { order: 1; }
  .ladder-column-previous { order: 2; }
  .ladder-compare .reason-panel { order: 3; position: static; min-width: 0; min-height: 220px; scroll-margin-top: calc(var(--header-height, 220px) + 12px); }
  .ladder-column .stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder-column .stock-chip { min-height: 60px; padding: 8px; }
  .ladder-column .stock-chip b { font-size: 12px; }
  .ladder-column .stock-chip span, .ladder-column .stock-chip em { font-size: 10px; }
  .column-source { overflow-wrap: anywhere; font-size: 10px; }
  .reversal-grid { grid-template-columns: minmax(0, 1fr); }
  .desk-footer { gap: 12px; padding: 0 16px 18px; font-size: 9px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .ladder-compare { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ladder-compare .reason-panel { grid-column: 1 / -1; grid-row: 2; position: static; min-height: 180px; }
  .ladder-compare .reason-empty { padding: 40px 12px; }
  .ladder-column .stock-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }

@media (max-width: 900px) { .seed-leaders { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .high-move-layout--seeds { grid-template-columns: minmax(0, 1fr); }
  .high-move-layout--seeds .high-move-sidebar { position: static; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); min-height: 0; padding: 7px; gap: 7px; }
  .high-move-layout--seeds .high-move-nav-group { min-width: 0; }
  .high-move-layout--seeds .high-move-side-tab { font-size: 10px; padding: 5px 2px; }
}
@media (max-width: 600px) { .seed-theme { padding: 11px; } .seed-heading { flex-wrap: wrap; } .seed-heading h2 { font-size: 22px; } .seed-theme > header { flex-wrap: wrap; gap: 5px; } .seed-position, .seed-comment { display: block; } .seed-position > b, .seed-comment > b { display: block; margin-bottom: 4px; } }
