/* Ciyuan Terminal UI v3
   Presentation only: business renderers and API contracts remain unchanged. */

:root,
html[data-theme="dark"] {
  color-scheme: dark;
  --background: #08090a;
  --surface: #111315;
  --card: #15181b;
  --surface-subtle: #0c0e10;
  --surface-raised: #181b1e;
  --sidebar: #0b0d0f;
  --topbar: rgba(12, 14, 16, .96);
  --input: #0a0c0e;
  --border: rgba(255, 255, 255, .08);
  --border-soft: rgba(255, 255, 255, .055);
  --text-primary: #e6e8eb;
  --text-secondary: #858b94;
  --text-tertiary: #5e646d;
  --text-strong: #f3f7ff;
  --accent: #4c8dff;
  --accent-contrast: #08090a;
  --accent-soft: rgba(76, 141, 255, .12);
  --accent-subtle: rgba(76, 141, 255, .065);
  --accent-border: rgba(76, 141, 255, .34);
  --accent-border-strong: rgba(76, 141, 255, .74);
  --success: #4fc38b;
  --success-soft: rgba(79, 195, 139, .1);
  --warning: #d8a956;
  --warning-soft: rgba(216, 169, 86, .1);
  --danger: #ee6b73;
  --danger-soft: rgba(238, 107, 115, .08);
  --danger-border: rgba(238, 107, 115, .22);
  --info: #4fd1ff;
  --hover: rgba(255, 255, 255, .035);
  --hover-soft: rgba(255, 255, 255, .022);
  --priority-surface: #110e10;
  --table-head: #0b0d0f;
  --chart-head: #0d0f11;
  --brand-tile: #08090a;
  --brand-shadow: 0 5px 18px rgba(23, 103, 255, .18);
  --shadow: 0 16px 36px rgba(0, 0, 0, .16);
}

html[data-theme="light"] {
  color-scheme: light;
  --background: #eef1f3;
  --surface: #ffffff;
  --card: #ffffff;
  --surface-subtle: #f7f8fa;
  --surface-raised: #e7ebee;
  --sidebar: #f8f9fa;
  --topbar: rgba(255, 255, 255, .96);
  --input: #ffffff;
  --border: #d6dce2;
  --border-soft: #e5e9ed;
  --text-primary: #15191e;
  --text-secondary: #59636e;
  --text-tertiary: #89929c;
  --text-strong: #0d1115;
  --accent: #2563eb;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(37, 99, 235, .10);
  --accent-subtle: rgba(37, 99, 235, .055);
  --accent-border: rgba(37, 99, 235, .30);
  --accent-border-strong: rgba(37, 99, 235, .68);
  --success: #168254;
  --success-soft: rgba(22, 130, 84, .09);
  --warning: #9a6617;
  --warning-soft: rgba(154, 102, 23, .09);
  --danger: #c63f4a;
  --danger-soft: rgba(198, 63, 74, .07);
  --danger-border: rgba(198, 63, 74, .20);
  --info: #426fc1;
  --hover: rgba(17, 17, 17, .035);
  --hover-soft: rgba(17, 17, 17, .022);
  --priority-surface: #fff8f8;
  --table-head: #f2f4f6;
  --chart-head: #f7f8fa;
  --brand-tile: #08090a;
  --brand-shadow: 0 5px 14px rgba(17, 17, 17, .16);
  --shadow: 0 10px 24px rgba(26, 31, 36, .08);
}

:root {
  --bg: var(--background);
  --panel: var(--surface);
  --panel-2: var(--card);
  --panel-3: var(--surface-subtle);
  --line: var(--border);
  --line-soft: var(--border-soft);
  --text: var(--text-primary);
  --muted: var(--text-secondary);
  --muted-2: var(--text-tertiary);
  --teal: var(--accent);
  --gold: var(--accent);
  --positive: var(--success);
  --red: var(--danger);
  --amber: var(--warning);
  --blue: var(--info);
  --cy-sidebar: 228px;
  --cy-command: 64px;
  --cy-radius: 3px;
}

html { background: var(--background); }

body.ciyuan-v2 {
  min-width: 0;
  margin: 0;
  background: var(--background);
  color: var(--text-primary);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-rendering: optimizeLegibility;
}

body.ciyuan-v2 *,
body.ciyuan-v2 *::before,
body.ciyuan-v2 *::after {
  box-sizing: border-box;
  letter-spacing: 0;
}

body.ciyuan-v2 ::selection { color: var(--accent-contrast); background: var(--accent); }
body.ciyuan-v2 a, body.ciyuan-v2 button { -webkit-tap-highlight-color: transparent; }
body.ciyuan-v2 .up, body.ciyuan-v2 .terminal-positive { color: var(--positive) !important; }
body.ciyuan-v2 .down { color: var(--red) !important; }
body.ciyuan-v2 .warn-text, body.ciyuan-v2 .terminal-warning { color: var(--amber) !important; }
body.ciyuan-v2 .terminal-danger { color: var(--danger) !important; }

html.cy-theme-changing body.ciyuan-v2,
html.cy-theme-changing body.ciyuan-v2 *,
html.cy-theme-changing body.ciyuan-v2 *::before,
html.cy-theme-changing body.ciyuan-v2 *::after {
  transition: color 300ms ease, background-color 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}

/* Application shell */
.cy-app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--cy-sidebar) minmax(0, 1fr);
  background: var(--background);
}

.cy-sidebar {
  position: sticky;
  top: 0;
  z-index: 70;
  height: 100vh;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 0 12px 14px;
  border-right: 1px solid var(--line);
  background: var(--sidebar);
}

.cy-brand {
  height: 72px;
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  color: var(--text);
  text-decoration: none;
}

.cy-brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: block;
  border: 1px solid var(--accent-border);
  border-radius: 4px;
  background: var(--brand-tile);
  object-fit: cover;
  box-shadow: var(--brand-shadow);
}
.cy-brand-copy { min-width: 0; display: grid; gap: 4px; }
.cy-brand-copy strong { font-family: inherit; font-size: 17px; font-weight: 700; line-height: 1; }
.cy-brand-copy small { color: var(--muted-2); font-size: 7px; font-weight: 650; line-height: 1; white-space: nowrap; }

.cy-nav { min-width: 0; display: grid; gap: 17px; padding: 20px 0; }
.cy-nav-section { min-width: 0; display: grid; gap: 3px; }
.cy-nav-label {
  display: block;
  padding: 0 10px 7px;
  color: var(--muted-2);
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.cy-nav a {
  position: relative;
  height: 34px;
  min-width: 0;
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 4px;
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 0;
  border-radius: 3px;
  color: var(--text-secondary);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  text-decoration: none;
}

.cy-nav a:hover { color: var(--text-primary); background: var(--hover); }
.cy-nav a.active { color: var(--text-strong); background: var(--accent-soft); }
.cy-nav a.active svg { color: var(--gold); }
.cy-nav a > b { width: 3px; height: 14px; border-radius: 2px; background: var(--gold); }
.cy-nav svg { width: 14px; height: 14px; color: var(--text-tertiary); stroke-width: 1.7; }
.cy-nav span[data-short-label] { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.cy-sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 9px;
  padding: 13px 10px 0;
  border-top: 1px solid var(--line);
}

.cy-sidebar-foot > div { display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 9px; }
.cy-sidebar-foot strong { color: var(--text-primary); font-size: 9px; font-weight: 650; }
.cy-sidebar-foot time { color: var(--muted); }
.cy-sidebar-foot .cy-system-label { justify-content: flex-start; margin-bottom: 3px; color: var(--positive); }
.cy-system-label strong { color: var(--positive); font-size: 8px; }
.cy-system-pulse { width: 6px; height: 6px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }

@media (min-width: 961px) {
  .cy-nav {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: var(--line) transparent;
    scrollbar-width: thin;
  }

  .cy-nav::-webkit-scrollbar { width: 4px; }
  .cy-nav::-webkit-scrollbar-thumb { background: var(--line); }
}

.cy-app-main { min-width: 0; }
.cy-page-stage { min-width: 0; }
.cy-page-stage > .portal-top,
body.ciyuan-v2[data-page="oi"] .cy-page-stage > .terminal-top { display: none !important; }

.cy-command-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-width: 0;
  min-height: var(--cy-command);
  display: grid;
  grid-template-columns: minmax(190px, .7fr) minmax(280px, 560px) minmax(190px, .7fr);
  align-items: center;
  gap: 22px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
  background: var(--topbar);
  backdrop-filter: blur(14px);
}

.cy-page-title { min-width: 0; display: grid; gap: 4px; }
.cy-page-title span { order: 1; color: var(--muted-2); font-size: 8px; font-weight: 700; }
.cy-page-title strong { order: 2; font-family: inherit; font-size: 14px; font-weight: 650; line-height: 1; }

.cy-command-search {
  min-width: 0;
  height: 36px;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 38px;
  align-items: center;
  border: 1px solid var(--accent-border);
  border-radius: 3px;
  background: var(--input);
  overflow: hidden;
}

.cy-command-search:focus-within { border-color: var(--accent-border-strong); box-shadow: 0 0 0 2px var(--accent-subtle); }
.cy-command-search > span { display: grid; place-items: center; color: var(--gold); }
.cy-command-search > span svg { width: 14px; height: 14px; }
.cy-command-search input { width: 100%; height: 100%; padding: 0 7px; border: 0 !important; outline: 0; background: transparent !important; color: var(--text); font-size: 12px; font-weight: 600; text-transform: uppercase; }
.cy-command-search input::placeholder { color: var(--text-tertiary); font-weight: 500; text-transform: none; }
body.ciyuan-v2 .cy-command-search button { width: 38px; height: 100%; display: grid; place-items: center; padding: 0; border: 0; border-left: 1px solid var(--line); border-radius: 0; background: var(--accent-subtle); color: var(--gold); }
.cy-command-search button svg { width: 13px; height: 13px; }

.cy-command-state { min-width: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.cy-command-state small { color: var(--muted-2); }
body.ciyuan-v2 .cy-command-state button { width: 30px; height: 30px; display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 3px; background: transparent; color: var(--muted); }
body.ciyuan-v2 .cy-command-state button:hover { border-color: var(--accent-border); color: var(--gold); background: var(--accent-subtle); }
.cy-command-state button svg { width: 14px; height: 14px; }
.cy-live-dot { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: var(--positive); box-shadow: 0 0 0 3px var(--success-soft); }
.cy-live-dot.degraded { background: var(--amber); box-shadow: 0 0 0 3px var(--warning-soft); }

.cy-priority-banner {
  height: 36px;
  min-width: 0;
  display: grid;
  grid-template-columns: 142px minmax(0, 1fr) auto;
  align-items: center;
  border-bottom: 1px solid var(--danger-border);
  background: var(--priority-surface);
  overflow: hidden;
}
.cy-priority-banner[hidden] { display: none !important; }
.cy-priority-label { height: 100%; display: flex; align-items: center; gap: 7px; padding: 0 14px; border-right: 1px solid var(--danger-border); color: var(--red); white-space: nowrap; }
.cy-priority-label svg { width: 13px; height: 13px; }
.cy-priority-label strong { font-size: 10px; }
.cy-priority-label span { color: var(--text-tertiary); font-size: 8px; }
.cy-priority-track { min-width: 0; overflow: hidden; }
.cy-priority-items { width: max-content; min-width: 100%; display: flex; align-items: center; animation: cy-priority-marquee 42s linear infinite; }
.cy-priority-banner:hover .cy-priority-items, .cy-priority-banner.paused .cy-priority-items { animation-play-state: paused; }
.cy-priority-item { min-width: max-content; display: inline-flex; align-items: baseline; gap: 8px; padding: 0 20px; border-right: 1px solid var(--line-soft); color: var(--text-primary); text-decoration: none; font-size: 10px; white-space: nowrap; }
.cy-priority-item:hover { color: var(--text-strong); background: var(--hover-soft); }
.cy-priority-item b { color: var(--text-strong); font-size: 12px; }
.cy-priority-item span, .cy-priority-item small { color: var(--muted); }
.cy-priority-item strong { color: var(--red); }
.cy-priority-item em { color: var(--gold); font-style: normal; }
.cy-priority-item small { max-width: 300px; overflow: hidden; text-overflow: ellipsis; }
.cy-priority-actions { height: 100%; display: flex; align-items: center; gap: 1px; padding: 0 7px; border-left: 1px solid var(--line-soft); }
.cy-priority-actions button { width: 26px; height: 26px; display: grid; place-items: center; padding: 0; border: 0; background: transparent; color: var(--muted); }
.cy-priority-actions svg { width: 13px; height: 13px; }

@keyframes cy-priority-marquee { from { transform: translateX(0); } to { transform: translateX(-22%); } }

/* Shared terminal primitives */
body.ciyuan-v2 input,
body.ciyuan-v2 select,
body.ciyuan-v2 button { border-radius: 3px; }

.terminal-page-head {
  min-height: 92px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 7px 0 19px;
  border-bottom: 1px solid var(--line);
}
.terminal-page-head h1 { margin: 6px 0 7px; font-family: inherit; font-size: 22px; font-weight: 650; line-height: 1.15; }
.terminal-page-head p { margin: 0; color: var(--muted); font-size: 10px; }
.terminal-eyebrow { color: var(--gold); font-size: 8px; font-weight: 750; }
.terminal-primary-link { height: 32px; display: inline-flex; align-items: center; gap: 7px; padding: 0 11px; border: 1px solid var(--accent-border); border-radius: 3px; color: var(--text-primary); background: var(--accent-subtle); font-size: 10px; font-weight: 650; text-decoration: none; white-space: nowrap; }
.terminal-primary-link:hover { border-color: var(--gold); background: var(--accent-soft); }
.terminal-primary-link svg { width: 13px; height: 13px; }

.terminal-section { min-width: 0; border-top: 1px solid var(--line); background: transparent; }
.terminal-section-head { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.terminal-section-head > div { min-width: 0; display: grid; gap: 4px; }
.terminal-section-head span { color: var(--muted-2); font-size: 8px; font-weight: 700; }
.terminal-section-head strong { color: var(--text); font-size: 13px; font-weight: 650; }
.terminal-section-head > a { color: var(--gold); font-size: 9px; text-decoration: none; }
.terminal-section-head > b { color: var(--positive); font-size: 8px; font-weight: 700; }
.terminal-column-labels { min-height: 28px; display: grid; align-items: center; border-bottom: 1px solid var(--line-soft); color: var(--muted-2); font-size: 8px; }

/* Dashboard */
body.ciyuan-v2 .portal-shell.terminal-dashboard { width: auto; max-width: none; min-width: 0; margin: 0; padding: 18px 24px 40px; gap: 0; }
.terminal-status-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.terminal-status-grid > div { min-width: 0; min-height: 94px; display: grid; align-content: center; gap: 5px; padding: 14px 18px; border-right: 1px solid var(--line); }
.terminal-status-grid > div:last-child { border-right: 0; }
.terminal-status-grid span, .terminal-status-grid small { color: var(--muted); font-size: 9px; }
.terminal-status-grid strong { overflow: hidden; color: var(--text); font-size: 24px; font-weight: 620; line-height: 1.05; text-overflow: ellipsis; white-space: nowrap; }
.terminal-ai-insight { min-width: 0; display: grid; grid-template-columns: 180px repeat(4, minmax(180px, 1fr)); border-bottom: 1px solid var(--line); background: var(--accent-subtle); }
.terminal-ai-insight > header, .terminal-ai-insight > div { min-width: 0; min-height: 108px; display: grid; align-content: center; gap: 6px; padding: 14px 16px; border-right: 1px solid var(--line); }
.terminal-ai-insight > div:last-child { border-right: 0; }
.terminal-ai-insight > header { grid-template-columns: 22px minmax(0, 1fr); }
.terminal-ai-insight > header svg { grid-row: 1 / 3; align-self: center; width: 17px; height: 17px; color: var(--accent); }
.terminal-ai-insight > header span, .terminal-ai-insight > div > span { color: var(--text-tertiary); font-size: 8px; font-weight: 700; }
.terminal-ai-insight > header strong { color: var(--text-primary); font-size: 13px; font-weight: 650; }
.terminal-ai-insight > div > strong { color: var(--text-primary); font-size: 12px; font-weight: 620; line-height: 1.5; }
.terminal-ai-insight > div > small { color: var(--text-secondary); font-size: 8px; line-height: 1.45; }
.terminal-ai-judgment > strong { white-space: normal !important; }
.terminal-ai-confidence > strong { display: flex; align-items: baseline; gap: 2px; }
.terminal-ai-confidence > strong b { font-size: 22px; font-weight: 620; }
.terminal-ai-confidence > div { width: 100%; height: 3px; background: var(--border); overflow: hidden; }
.terminal-ai-confidence > div i { display: block; width: 0; height: 100%; background: var(--accent); transition: width 300ms ease; }
.terminal-dashboard-grid { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 28px; padding-top: 24px; }
.terminal-dashboard-main, .terminal-dashboard-aside { min-width: 0; display: grid; align-content: start; gap: 26px; }
.terminal-signal-labels { grid-template-columns: 72px minmax(190px, 1fr) 150px minmax(190px, 1fr); padding: 0 10px; }

body.ciyuan-v2[data-page="radar"] .portal-list,
body.ciyuan-v2[data-page="radar"] .portal-events,
body.ciyuan-v2[data-page="radar"] .quality-board { padding: 0; }
body.ciyuan-v2[data-page="radar"] .portal-signal { min-height: 72px; display: grid; grid-template-columns: 62px minmax(190px, 1fr) 140px minmax(190px, 1fr); align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; box-shadow: none; }
body.ciyuan-v2[data-page="radar"] .portal-signal:hover,
body.ciyuan-v2[data-page="radar"] .portal-event:hover { background: var(--hover-soft); }
body.ciyuan-v2[data-page="radar"] .portal-signal > .signal-score { width: 48px; height: 42px; display: grid; place-content: center; gap: 2px; border: 1px solid var(--accent-border); border-radius: 2px; color: var(--gold); text-align: center; }
body.ciyuan-v2[data-page="radar"] .signal-score b { font-size: 14px; line-height: 1; }
body.ciyuan-v2[data-page="radar"] .signal-score small { color: var(--text-tertiary); font-size: 7px; font-weight: 600; }
body.ciyuan-v2[data-page="radar"] .signal-score.rank-s { color: var(--text-strong); background: var(--accent-soft); border-color: var(--accent); }
body.ciyuan-v2[data-page="radar"] .signal-score.rank-a { color: var(--success); border-color: var(--success); }
body.ciyuan-v2[data-page="radar"] .signal-score.rank-b { color: var(--info); border-color: var(--info); }
body.ciyuan-v2[data-page="radar"] .signal-score.rank-watch { color: var(--text-secondary); border-color: var(--border); }
body.ciyuan-v2[data-page="radar"] .portal-signal > span { min-width: 0; }
body.ciyuan-v2[data-page="radar"] .portal-signal > span b { display: block; color: var(--text); font-size: 14px; }
body.ciyuan-v2[data-page="radar"] .portal-signal > span small { display: block; margin-top: 5px; overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
body.ciyuan-v2[data-page="radar"] .portal-signal > em { color: var(--text); font-size: 10px; font-style: normal; }
body.ciyuan-v2[data-page="radar"] .portal-signal > i { min-width: 0; display: grid; gap: 4px; color: var(--muted); font-size: 9px; font-style: normal; }
body.ciyuan-v2[data-page="radar"] .portal-signal > i span, body.ciyuan-v2[data-page="radar"] .portal-signal > i small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.ciyuan-v2[data-page="radar"] .portal-signal > i span { color: var(--text-primary); }
body.ciyuan-v2[data-page="radar"] .portal-signal > i small { color: var(--text-secondary); font-size: 8px; }
body.ciyuan-v2[data-page="radar"] .portal-event { min-height: 68px; display: grid; grid-template-columns: minmax(120px, .7fr) minmax(180px, 1.1fr) minmax(180px, 1fr); align-items: center; gap: 12px; padding: 10px; border: 0; border-bottom: 1px solid var(--line-soft); border-radius: 0; background: transparent; }
body.ciyuan-v2[data-page="radar"] .portal-event span b { color: var(--text); font-size: 13px; }
body.ciyuan-v2[data-page="radar"] .portal-event span small { display: block; margin-top: 4px; color: var(--gold); font-size: 8px; }
body.ciyuan-v2[data-page="radar"] .portal-event strong { color: var(--text-primary); font-size: 10px; font-weight: 550; }
body.ciyuan-v2[data-page="radar"] .portal-event em { color: var(--muted); font-size: 9px; font-style: normal; }
body.ciyuan-v2[data-page="radar"] .quality-row { min-height: 48px; display: grid; grid-template-columns: minmax(0, 1fr) 52px 58px 42px; align-items: center; gap: 8px; padding: 7px 0; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; }
body.ciyuan-v2[data-page="radar"] .quality-row span { color: var(--text-primary); font-size: 10px; }
body.ciyuan-v2[data-page="radar"] .quality-row span small { display: block; margin-top: 3px; overflow: hidden; color: var(--muted-2); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
body.ciyuan-v2[data-page="radar"] .quality-row strong, body.ciyuan-v2[data-page="radar"] .quality-row em, body.ciyuan-v2[data-page="radar"] .quality-row i { font-size: 9px; font-style: normal; text-align: right; }
.terminal-intelligence-note { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 12px; padding: 16px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.terminal-intelligence-note > svg { width: 18px; height: 18px; color: var(--gold); }
.terminal-intelligence-note div { display: grid; gap: 5px; }
.terminal-intelligence-note span { color: var(--muted-2); font-size: 8px; font-weight: 700; }
.terminal-intelligence-note strong { font-size: 11px; }
.terminal-intelligence-note p { margin: 0; color: var(--muted); font-size: 9px; line-height: 1.7; }

/* Monitoring and research surfaces */
.spec-system, .dw-terminal, .arb-terminal { padding: 22px 24px 44px; }
.spec-system-head, .dw-head, .arb-head { padding: 3px 0 20px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
.spec-system-head h1, .dw-head h1, .arb-head h1 { font-family: inherit; font-size: 22px; font-weight: 650; }
.spec-system-head p, .dw-head p, .arb-head p { color: var(--muted); font-size: 10px; }
.dw-kicker, .arb-kicker { color: var(--gold); font-size: 8px; }

.spec-notices, .dw-notice, .arb-notice { border: 0; border-left: 2px solid var(--gold); background: var(--accent-subtle); color: var(--text-secondary); }
.dw-rule-pools { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 16px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-rule-pools > div { min-width: 0; min-height: 82px; display: grid; align-content: center; gap: 4px; padding: 12px 15px; border-right: 1px solid var(--line-soft); }
.dw-rule-pools > div:last-child { border-right: 0; }
.dw-rule-pools span, .dw-rule-pools small { overflow: hidden; color: var(--text-secondary); font-size: 8px; line-height: 1.4; text-overflow: ellipsis; white-space: nowrap; }
.dw-rule-pools span { color: var(--gold); font-weight: 700; }
.dw-rule-pools strong { overflow: hidden; color: var(--text-primary); font-size: 11px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.spec-path-nav, .spec-kpis, .dw-kpis, .arb-kpis, .arb-quality, .arb-safety-grid { border-color: var(--line); background: transparent; }
body.ciyuan-v2 .spec-path-nav { border-top: 0; border-right: 0; border-left: 0; }
body.ciyuan-v2 .spec-kpis { border-top: 0; border-right: 0; border-left: 0; }
.spec-path-nav button, .spec-kpis > button, .dw-kpis > div, .arb-kpis > div, .arb-quality > div, .arb-safety-grid > div { border-color: var(--line); background: transparent; }
.spec-path-nav button:hover, .spec-kpis > button:hover { background: var(--hover-soft); }
.spec-path-nav button.active, .spec-kpis > button.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px var(--gold); }
.spec-path-nav button.active > svg { color: var(--gold); }
.spec-toolbar, .spec-list-panel, .spec-detail-panel, .dw-rule-card, .arb-table-wrap { border-color: var(--line); border-radius: 0; background: transparent; }
body.ciyuan-v2 .spec-toolbar { border-right: 0; border-left: 0; }
body.ciyuan-v2 .spec-list-panel, body.ciyuan-v2 .spec-detail-panel { border-right: 0; border-left: 0; }
.spec-panel-head, .dw-section-head, .arb-section-head { border-color: var(--line); }
.spec-candidate, .dw-symbol { border-color: var(--line-soft); background: transparent; }
.spec-candidate:hover, .dw-symbol:hover { background: var(--hover-soft); }
.spec-candidate.selected, .dw-symbol.active { background: var(--accent-soft); box-shadow: inset 2px 0 var(--gold); }
.spec-stage, .spec-grade, .dw-state, .arb-state { border-radius: 2px; }
.spec-detail-summary, .spec-detail-primary, .spec-detail-lower, .spec-methodology, .spec-evidence-dossier, .spec-evidence-status, .spec-chain-coverage { border-color: var(--line); background: transparent; }
.spec-detail-summary > div, .spec-detail-primary > section, .spec-detail-lower > section { border-color: var(--line-soft); }
.spec-flow > div::before { border-color: var(--gold); color: var(--gold); }
.spec-score-bar i { background: var(--gold); }

.dw-layout { grid-template-columns: 220px minmax(0, 1fr); gap: 24px; }
.dw-signal-summary { display: grid; grid-template-columns: 1.05fr 1.4fr 1.4fr .75fr; border-bottom: 1px solid var(--line); }
.dw-signal-summary > div { min-width: 0; min-height: 86px; display: grid; align-content: center; gap: 5px; padding: 13px 15px; border-right: 1px solid var(--line); }
.dw-signal-summary > div:last-child { border-right: 0; }
.dw-signal-summary span, .dw-signal-summary small { overflow: hidden; color: var(--muted); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dw-signal-summary strong { overflow: hidden; color: var(--text-primary); font-size: 12px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dw-signal-summary .dw-signal-primary span { color: var(--gold); font-size: 8px; font-weight: 700; }
.dw-signal-summary .dw-signal-primary strong { color: var(--text); font-size: 18px; }
.dw-signal-summary .dw-signal-primary strong.active { color: var(--positive); }
.dw-rule-card { border-top: 1px solid var(--line); border-right: 0; border-bottom: 1px solid var(--line); border-left: 0; }
.dw-rule-card > header, .dw-rule-primary, .dw-rule-card > footer, .dw-wall-grid > div, .dw-volume { border-color: var(--line-soft); }
.dw-rule-card > header span, .dw-volume.hit > strong, .dw-volume.hit em { color: var(--gold); }
.dw-volume.hit { background: var(--accent-subtle); }
.dw-table th, .arb-table th { color: var(--muted-2); background: var(--table-head); }
.dw-table td, .arb-table td { border-color: var(--line-soft); }
.dw-table tbody tr:hover td, .arb-table tbody tr:hover td { background: var(--hover-soft); }
.dw-history-summary { margin-top: 24px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-history-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dw-history-grid > div { min-width: 0; min-height: 88px; display: grid; align-content: center; gap: 5px; padding: 13px 15px; border-right: 1px solid var(--line); }
.dw-history-grid > div:last-child { border-right: 0; }
.dw-history-grid span, .dw-history-grid small { overflow: hidden; color: var(--text-secondary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dw-history-grid strong { color: var(--text-primary); font-size: 20px; font-weight: 620; }
.dw-kucoin-scan { margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-kucoin-scan > .dw-section-head { padding: 13px 0; }
.dw-kucoin-kpis, .dw-kucoin-rule { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.dw-kucoin-kpis > div, .dw-kucoin-rule > div { min-width: 0; min-height: 82px; display: grid; align-content: center; gap: 5px; padding: 12px 15px; border-right: 1px solid var(--line-soft); }
.dw-kucoin-kpis > div:last-child, .dw-kucoin-rule > div:last-child { border-right: 0; }
.dw-kucoin-kpis span, .dw-kucoin-rule span, .dw-kucoin-kpis small, .dw-kucoin-rule small { overflow: hidden; color: var(--text-secondary); font-size: 8px; line-height: 1.45; text-overflow: ellipsis; white-space: nowrap; }
.dw-kucoin-kpis strong, .dw-kucoin-rule strong { overflow: hidden; color: var(--text-primary); font-size: 12px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.dw-kucoin-rule { background: var(--accent-subtle); }
.dw-kucoin-rule span { color: var(--gold); font-weight: 700; }
.dw-kucoin-table td small { display: block; margin-top: 4px; color: var(--text-secondary); font-size: 8px; }
.dw-view[hidden] { display: none !important; }
.dw-view-tabs { height: 48px; display: flex; align-items: end; gap: 24px; margin-top: 10px; border-bottom: 1px solid var(--line); }
.dw-view-tabs button { height: 48px; display: inline-flex; align-items: center; gap: 7px; padding: 0 2px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-secondary); cursor: pointer; font-size: 10px; }
.dw-view-tabs button:hover { color: var(--text-primary); }
.dw-view-tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }
.dw-view-tabs svg { width: 14px; height: 14px; }
.dw-tracking-intro { margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-tracking-section { margin-top: 34px; padding-top: 12px; border-top: 1px solid var(--line); }
.dw-tracking-section .dw-tracking-intro { margin-top: 0; }
.dw-tracking-intro > header { min-height: 76px; display: grid; grid-template-columns: minmax(220px, .45fr) minmax(0, 1fr); align-items: center; gap: 24px; padding: 12px 15px; border-bottom: 1px solid var(--line-soft); }
.dw-tracking-intro > header div { display: grid; gap: 4px; }
.dw-tracking-intro > header span { color: var(--gold); font-size: 8px; font-weight: 700; }
.dw-tracking-intro > header strong { color: var(--text-primary); font-size: 19px; font-weight: 630; }
.dw-tracking-intro > header p { margin: 0; color: var(--text-secondary); font-size: 10px; line-height: 1.7; }
.dw-tracking-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dw-tracking-kpis > div { min-width: 0; min-height: 88px; display: grid; align-content: center; gap: 5px; padding: 12px 15px; border-right: 1px solid var(--line-soft); }
.dw-tracking-kpis > div:last-child { border-right: 0; }
.dw-tracking-kpis span, .dw-tracking-kpis small { overflow: hidden; color: var(--text-secondary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dw-tracking-kpis strong { color: var(--text-primary); font-size: 21px; font-weight: 620; }
.dw-tracking-intro > aside { min-height: 38px; display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-top: 1px solid var(--line-soft); color: var(--text-secondary); font-size: 9px; line-height: 1.5; }
.dw-tracking-intro > aside svg { width: 13px; height: 13px; flex: 0 0 13px; color: var(--gold); }
.dw-tracking-toolbar { min-height: 56px; display: grid; grid-template-columns: minmax(220px, 1fr) 140px 160px auto; align-items: center; gap: 10px; margin-top: 18px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-tracking-toolbar label { height: 34px; display: grid; grid-template-columns: 30px minmax(0, 1fr); align-items: center; border: 1px solid var(--line-soft); }
.dw-tracking-toolbar label svg { width: 13px; height: 13px; justify-self: center; color: var(--text-tertiary); }
.dw-tracking-toolbar input, .dw-tracking-toolbar select { min-width: 0; height: 32px; border: 0; outline: 0; background: transparent; color: var(--text-primary); font: inherit; font-size: 10px; }
.dw-tracking-toolbar select { padding: 0 9px; border: 1px solid var(--line-soft); }
.dw-tracking-toolbar > span { color: var(--text-secondary); font-size: 9px; white-space: nowrap; }
.dw-tracking-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; margin-top: 18px; }
.dw-tracking-assets, .dw-tracking-detail { min-width: 0; border-top: 1px solid var(--line); }
.dw-tracking-asset-list { max-height: 760px; overflow-y: auto; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line); scrollbar-width: thin; }
.dw-tracking-asset { width: 100%; min-height: 92px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; padding: 11px 12px; border: 0; border-bottom: 1px solid var(--line-soft); background: transparent; color: var(--text-primary); text-align: left; cursor: pointer; }
.dw-tracking-asset:last-child { border-bottom: 0; }
.dw-tracking-asset:hover { background: var(--hover-soft); }
.dw-tracking-asset.active { background: var(--accent-soft); box-shadow: inset 2px 0 var(--gold); }
.dw-tracking-asset > span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.dw-tracking-asset > span strong { font-size: 15px; }
.dw-tracking-asset em { padding: 2px 4px; border: 1px solid var(--line); color: var(--text-secondary); font-size: 7px; font-style: normal; white-space: nowrap; }
.dw-tracking-asset em.active { color: var(--positive); border-color: var(--success); }
.dw-tracking-asset em.cooling { color: var(--gold); border-color: var(--accent-border); }
.dw-tracking-asset > b { font-size: 10px; font-weight: 600; text-align: right; white-space: nowrap; }
.dw-tracking-asset > b i { color: var(--text-secondary); font-style: normal; font-weight: 400; }
.dw-tracking-asset > small { overflow: hidden; color: var(--text-secondary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dw-tracking-asset > time { color: var(--text-tertiary); font-size: 8px; text-align: right; white-space: nowrap; }
.dw-tracking-detail-body { border-bottom: 1px solid var(--line); }
.dw-tracking-detail-head { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 11px 14px; border-bottom: 1px solid var(--line-soft); }
.dw-tracking-detail-head > div { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 5px 10px; }
.dw-tracking-detail-head span { color: var(--gold); font-size: 8px; }
.dw-tracking-detail-head strong { color: var(--text-primary); font-size: 20px; font-weight: 650; }
.dw-tracking-detail-head small { grid-column: 1 / -1; overflow: hidden; color: var(--text-secondary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dw-tracking-detail-head a { display: inline-flex; align-items: center; gap: 5px; color: var(--gold); font-size: 9px; text-decoration: none; white-space: nowrap; }
.dw-tracking-detail-head svg { width: 12px; height: 12px; }
.dw-tracking-position, .dw-tracking-window-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.dw-tracking-position > div, .dw-tracking-window-grid > div { min-width: 0; min-height: 92px; display: grid; align-content: center; gap: 5px; padding: 11px 12px; border-right: 1px solid var(--line-soft); }
.dw-tracking-position > div:last-child, .dw-tracking-window-grid > div:last-child { border-right: 0; }
.dw-tracking-position span, .dw-tracking-position small, .dw-tracking-window-grid span, .dw-tracking-window-grid small, .dw-tracking-window-grid i { overflow: hidden; color: var(--text-secondary); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.dw-tracking-position strong, .dw-tracking-window-grid strong { color: var(--text-primary); font-size: 16px; font-weight: 620; }
.dw-tracking-window-grid > div.unavailable { opacity: .55; }
.dw-push-timeline > header { min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line-soft); }
.dw-push-timeline > header div { display: grid; gap: 3px; }
.dw-push-timeline > header strong { font-size: 12px; }
.dw-push-timeline > header span, .dw-push-timeline > header small { color: var(--text-secondary); font-size: 8px; }
.dw-push-timeline-head, .dw-push-timeline-row { min-width: 760px; display: grid; grid-template-columns: minmax(230px, 1.5fr) minmax(96px, .65fr) repeat(4, minmax(68px, .45fr)); align-items: center; }
.dw-push-timeline { overflow-x: auto; }
.dw-push-timeline-head { min-height: 32px; color: var(--text-tertiary); background: var(--table-head); font-size: 8px; }
.dw-push-timeline-head > span, .dw-push-timeline-row > * { min-width: 0; padding: 7px 10px; }
.dw-push-timeline-row { min-height: 68px; border-top: 1px solid var(--line-soft); font-size: 9px; }
.dw-push-timeline-row > div { display: grid; gap: 3px; }
.dw-push-timeline-row time, .dw-push-timeline-row small { overflow: hidden; color: var(--text-secondary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dw-push-timeline-row strong { overflow: hidden; color: var(--text-primary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.dw-push-timeline-row > span { color: var(--text-secondary); }

/* Push continuity */
.dw-follow-overview { display: grid; grid-template-columns: 220px minmax(0, 1fr); border-bottom: 1px solid var(--line); }
.dw-follow-state { min-width: 0; min-height: 126px; display: grid; align-content: center; gap: 6px; padding: 14px; border-right: 1px solid var(--line-soft); }
.dw-follow-state > span { color: var(--gold); font-size: 7px; font-weight: 700; }
.dw-follow-state > strong { color: var(--text-primary); font-size: 20px; font-weight: 650; }
.dw-follow-state > p { margin: 0; color: var(--text-secondary); font-size: 9px; line-height: 1.5; }
.dw-follow-state > small { color: var(--text-tertiary); font-size: 7px; }
.dw-follow-state.responded > strong { color: var(--positive); }
.dw-follow-state.drawdown > strong, .dw-follow-state.unavailable > strong { color: var(--red); }
.dw-follow-state.capital > strong, .dw-follow-state.building > strong { color: var(--gold); }
.dw-follow-metrics { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dw-follow-metrics > div { min-width: 0; display: grid; align-content: center; gap: 5px; padding: 12px; border-right: 1px solid var(--line-soft); }
.dw-follow-metrics > div:last-child { border-right: 0; }
.dw-follow-metrics span, .dw-follow-metrics small { overflow: hidden; color: var(--text-secondary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dw-follow-metrics strong { overflow: hidden; color: var(--text-primary); font-size: 14px; font-weight: 620; text-overflow: ellipsis; white-space: nowrap; }
.dw-follow-evidence { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dw-follow-evidence > div { min-width: 0; min-height: 112px; display: grid; align-content: center; gap: 5px; padding: 12px 14px; border-right: 1px solid var(--line-soft); }
.dw-follow-evidence > div:last-child { border-right: 0; }
.dw-follow-evidence span { color: var(--gold); font-size: 8px; font-weight: 650; }
.dw-follow-evidence strong { color: var(--text-primary); font-size: 12px; font-weight: 620; }
.dw-follow-evidence p { margin: 0; color: var(--text-secondary); font-size: 8px; line-height: 1.55; }
.dw-follow-evidence time { color: var(--text-tertiary); font-size: 7px; }
.dw-current-progress { border-bottom: 1px solid var(--line); }
.dw-current-progress > header { min-height: 58px; display: grid; grid-template-columns: minmax(170px, .4fr) minmax(0, 1fr); align-items: center; gap: 18px; padding: 9px 13px; border-bottom: 1px solid var(--line-soft); }
.dw-current-progress > header div { display: grid; gap: 3px; }
.dw-current-progress > header span { color: var(--gold); font-size: 7px; font-weight: 700; }
.dw-current-progress > header strong { color: var(--text-primary); font-size: 12px; font-weight: 630; }
.dw-current-progress > header p { margin: 0; color: var(--text-secondary); font-size: 8px; line-height: 1.55; }
.dw-latest-progress > div { min-height: 48px; display: grid; grid-template-columns: 116px 42px minmax(110px, .75fr) 90px minmax(130px, 1fr); align-items: center; gap: 8px; padding: 0 12px; border-bottom: 1px solid var(--line-soft); }
.dw-latest-progress > div:last-child { border-bottom: 0; }
.dw-latest-progress time, .dw-latest-progress small { overflow: hidden; color: var(--text-secondary); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.dw-latest-progress span { padding: 2px 5px; border: 1px solid var(--accent-border); color: var(--gold); font-size: 7px; text-align: center; }
.dw-latest-progress strong, .dw-latest-progress em { overflow: hidden; color: var(--text-primary); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.dw-advanced-research, .dw-history-events { border-bottom: 1px solid var(--line); }
.dw-advanced-research > summary, .dw-history-events > summary { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 13px; list-style: none; cursor: pointer; }
.dw-advanced-research > summary::-webkit-details-marker, .dw-history-events > summary::-webkit-details-marker { display: none; }
.dw-advanced-research > summary:hover, .dw-history-events > summary:hover { background: var(--hover-soft); }
.dw-advanced-research > summary div, .dw-history-events > summary div { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; gap: 4px 10px; }
.dw-advanced-research > summary span, .dw-history-events > summary span { color: var(--gold); font-size: 7px; font-weight: 700; }
.dw-advanced-research > summary strong, .dw-history-events > summary strong { color: var(--text-primary); font-size: 12px; font-weight: 630; }
.dw-advanced-research > summary small, .dw-history-events > summary small { grid-column: 1 / -1; color: var(--text-secondary); font-size: 8px; }
.dw-advanced-research > summary em, .dw-history-events > summary em { flex: 0 0 auto; color: var(--text-tertiary); font-size: 8px; font-style: normal; }
.dw-advanced-research[open] > summary, .dw-history-events[open] > summary { border-bottom: 1px solid var(--line-soft); background: var(--table-head); }
.dw-advanced-research[open] > summary em::before, .dw-history-events[open] > summary em::before { content: "已展开 · "; color: var(--gold); }
.dw-history-events .dw-event-timeline { border-bottom: 0; }

/* Push Evidence Ledger v2 */
.dw-reaction-section, .dw-signal-type-study, .dw-event-timeline { border-bottom: 1px solid var(--line); }
.dw-reaction-section > header, .dw-signal-type-study > header, .dw-event-timeline > header { min-height: 64px; display: grid; grid-template-columns: minmax(180px, .42fr) minmax(0, 1fr); align-items: center; gap: 20px; padding: 10px 13px; border-bottom: 1px solid var(--line-soft); }
.dw-reaction-section > header div, .dw-signal-type-study > header div, .dw-event-timeline > header div { display: grid; gap: 4px; }
.dw-reaction-section > header span, .dw-signal-type-study > header span, .dw-event-timeline > header span { color: var(--gold); font-size: 7px; font-weight: 700; }
.dw-reaction-section > header strong, .dw-signal-type-study > header strong, .dw-event-timeline > header strong { color: var(--text-primary); font-size: 13px; font-weight: 630; }
.dw-reaction-section > header p, .dw-signal-type-study > header p, .dw-event-timeline > header p { margin: 0; color: var(--text-secondary); font-size: 8px; line-height: 1.6; }
.dw-reaction-chart { min-width: 0; padding: 10px 8px 0; background: var(--chart-head); }
.dw-reaction-chart svg { width: 100%; height: 258px; display: block; overflow: visible; }
.dw-reaction-chart .grid { stroke: var(--line-soft); stroke-width: 1; vector-effect: non-scaling-stroke; }
.dw-reaction-chart .zero { stroke: var(--text-tertiary); stroke-width: 1; stroke-dasharray: 3 4; vector-effect: non-scaling-stroke; }
.dw-reaction-chart .axis-value { fill: var(--text-tertiary); font-size: 8px; text-anchor: end; }
.dw-reaction-chart .axis-label { fill: var(--text-secondary); font-size: 8px; text-anchor: middle; }
.dw-reaction-chart .axis-label.unavailable { fill: var(--text-tertiary); }
.dw-reaction-chart .quartile-band { fill: var(--accent-soft); stroke: none; }
.dw-reaction-chart .event-line { fill: none; stroke: var(--text-tertiary); stroke-width: .7; opacity: .23; vector-effect: non-scaling-stroke; }
.dw-reaction-chart .median-line { fill: none; stroke: var(--gold); stroke-width: 2; vector-effect: non-scaling-stroke; }
.dw-reaction-chart .median-point { fill: var(--surface); stroke: var(--gold); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.dw-reaction-values { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line-soft); }
.dw-reaction-values > div { min-width: 0; min-height: 72px; display: grid; align-content: center; gap: 4px; padding: 9px 10px; border-right: 1px solid var(--line-soft); }
.dw-reaction-values > div:last-child { border-right: 0; }
.dw-reaction-values span, .dw-reaction-values small { overflow: hidden; color: var(--text-secondary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.dw-reaction-values strong { color: var(--text-primary); font-size: 13px; font-weight: 620; }
.dw-reaction-values .unavailable { opacity: .48; }
.dw-reaction-empty { min-height: 100px; display: grid; place-items: center; color: var(--text-tertiary); font-size: 9px; }
.dw-timing-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.dw-timing-panel { min-width: 0; padding: 12px 13px 11px; border-right: 1px solid var(--line-soft); }
.dw-timing-panel:last-child { border-right: 0; }
.dw-timing-panel > header { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.dw-timing-panel > header div { display: grid; gap: 3px; }
.dw-timing-panel > header span { color: var(--text-tertiary); font-size: 7px; }
.dw-timing-panel > header strong { font-size: 11px; font-weight: 620; }
.dw-timing-panel > header > b { color: var(--gold); font-size: 14px; font-weight: 650; white-space: nowrap; }
.dw-timing-panel.drawdown > header > b { color: var(--red); }
.dw-timing-bars { display: grid; gap: 6px; }
.dw-timing-bars > div { display: grid; grid-template-columns: 52px minmax(0, 1fr) 26px; align-items: center; gap: 8px; color: var(--text-secondary); font-size: 8px; }
.dw-timing-bars i { height: 4px; overflow: hidden; background: var(--surface-raised); }
.dw-timing-bars i b { height: 100%; display: block; background: var(--gold); }
.dw-timing-panel.drawdown .dw-timing-bars i b { background: var(--red); }
.dw-timing-bars em { color: var(--text-tertiary); font-style: normal; text-align: right; }
.dw-timing-panel > footer { margin-top: 10px; color: var(--text-tertiary); font-size: 7px; line-height: 1.5; }
.dw-signal-type-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dw-signal-type-grid > article { min-width: 0; min-height: 174px; display: grid; grid-template-rows: auto 1fr auto auto; border-right: 1px solid var(--line-soft); }
.dw-signal-type-grid > article:last-child { border-right: 0; }
.dw-signal-type-grid article > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.dw-signal-type-grid article > header span { color: var(--gold); font-size: 10px; font-weight: 620; }
.dw-signal-type-grid article.capital_change > header span { color: var(--info); }
.dw-signal-type-grid article > header strong { color: var(--text-secondary); font-size: 8px; font-weight: 500; }
.dw-signal-type-grid article > div { display: grid; align-content: center; gap: 4px; padding: 9px 10px; }
.dw-signal-type-grid article > div span, .dw-signal-type-grid article > div small { color: var(--text-secondary); font-size: 8px; }
.dw-signal-type-grid article > div strong { font-size: 16px; font-weight: 630; }
.dw-signal-type-grid dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--line-soft); }
.dw-signal-type-grid dl > div { display: grid; gap: 3px; padding: 7px 10px; border-right: 1px solid var(--line-soft); }
.dw-signal-type-grid dl > div:last-child { border-right: 0; }
.dw-signal-type-grid dt { color: var(--text-tertiary); font-size: 7px; }
.dw-signal-type-grid dd { margin: 0; color: var(--text-primary); font-size: 9px; }
.dw-signal-type-grid article > footer { overflow: hidden; padding: 7px 10px; border-top: 1px solid var(--line-soft); color: var(--text-tertiary); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.dw-asset-events { display: grid; }
.dw-asset-event { border-bottom: 1px solid var(--line-soft); }
.dw-asset-event:last-child { border-bottom: 0; }
.dw-asset-event > header { min-height: 50px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 11px; background: var(--table-head); }
.dw-asset-event > header div { display: flex; align-items: baseline; gap: 10px; }
.dw-asset-event > header time { color: var(--text-secondary); font-size: 8px; }
.dw-asset-event > header strong { font-size: 10px; font-weight: 620; }
.dw-asset-event > header em { padding: 2px 5px; border: 1px solid var(--line); color: var(--text-secondary); font-size: 7px; font-style: normal; }
.dw-asset-event > header em.complete { color: var(--positive); border-color: var(--success); }
.dw-asset-event > header em.active { color: var(--gold); border-color: var(--accent-border); }
.dw-event-categories { min-height: 36px; display: flex; align-items: center; gap: 6px; padding: 6px 11px; border-bottom: 1px solid var(--line-soft); }
.dw-event-categories span, .dw-event-lifecycle span { padding: 2px 5px; border: 1px solid var(--accent-border); color: var(--gold); font-size: 7px; white-space: nowrap; }
.dw-event-categories span.capital_change, .dw-event-lifecycle span.capital_change { color: var(--info); border-color: color-mix(in srgb, var(--info) 34%, transparent); }
.dw-event-path { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.dw-event-path > div { min-width: 0; min-height: 54px; display: grid; align-content: center; gap: 4px; padding: 6px 9px; border-right: 1px solid var(--line-soft); }
.dw-event-path > div:last-child { border-right: 0; }
.dw-event-path span { color: var(--text-tertiary); font-size: 7px; }
.dw-event-path strong { color: var(--text-primary); font-size: 10px; font-weight: 620; }
.dw-event-path .unavailable { opacity: .42; }
.dw-event-windows { min-height: 38px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.dw-event-windows span { min-width: 0; padding: 8px 11px; border-right: 1px solid var(--line-soft); color: var(--text-secondary); font-size: 8px; }
.dw-event-windows span:last-child { border-right: 0; }
.dw-event-windows b { margin-left: 5px; color: var(--text-primary); font-weight: 620; }
.dw-asset-event details { padding: 0 11px; }
.dw-asset-event summary { min-height: 38px; display: flex; align-items: center; color: var(--text-secondary); font-size: 8px; cursor: pointer; }
.dw-event-lifecycle { padding-bottom: 9px; border-top: 1px solid var(--line-soft); }
.dw-event-lifecycle > div { min-height: 42px; display: grid; grid-template-columns: 116px 64px minmax(110px, .8fr) 96px minmax(140px, 1fr); align-items: center; gap: 8px; border-bottom: 1px solid var(--line-soft); }
.dw-event-lifecycle > div:last-child { border-bottom: 0; }
.dw-event-lifecycle time, .dw-event-lifecycle small { overflow: hidden; color: var(--text-secondary); font-size: 7px; text-overflow: ellipsis; white-space: nowrap; }
.dw-event-lifecycle strong, .dw-event-lifecycle em { overflow: hidden; color: var(--text-primary); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }

.arb-notice { margin-top: 16px; }
.arb-kpis strong, .arb-quality strong { font-weight: 620; }
.arb-strategy-tabs { border-color: var(--line); }
.arb-strategy-tabs button { border-color: var(--line-soft); background: transparent; }
.arb-strategy-tabs button.active { color: var(--gold); background: var(--accent-soft); }
.arb-table .positive { color: var(--positive); }
.arb-table .negative { color: var(--red); }

/* OI workbench */
body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { grid-template-columns: minmax(0, 1fr) 318px; gap: 16px; padding: 16px 20px 36px; }
body.ciyuan-v2[data-page="oi"] .news-sidebar,
body.ciyuan-v2[data-page="oi"] .exchange-tabs,
body.ciyuan-v2[data-page="oi"] .contract-strip,
body.ciyuan-v2[data-page="oi"] .chart-panel,
body.ciyuan-v2[data-page="oi"] .table-panel,
body.ciyuan-v2[data-page="oi"] .alerts-panel,
body.ciyuan-v2[data-page="oi"] .live-tape-panel,
body.ciyuan-v2[data-page="oi"] .oi-quality-panel,
body.ciyuan-v2[data-page="oi"] .symbol-overview { border-color: var(--line); border-radius: 0; background: transparent; box-shadow: none; }
body.ciyuan-v2[data-page="oi"] .news-sidebar { height: 70px; grid-template-rows: 70px; }
body.ciyuan-v2[data-page="oi"] .event-radar-strip { border-color: var(--line); }
body.ciyuan-v2[data-page="oi"] .event-strip-card { border-color: var(--line-soft); background: transparent; }
body.ciyuan-v2[data-page="oi"] .event-strip-card.long { border-left-color: var(--positive); }
body.ciyuan-v2[data-page="oi"] .event-strip-card.short { border-left-color: var(--red); }
body.ciyuan-v2[data-page="oi"] .exchange-tabs button { border-color: var(--line-soft); background: transparent; }
body.ciyuan-v2[data-page="oi"] .exchange-tabs button.active { color: var(--text); background: var(--accent-soft); box-shadow: inset 0 -2px var(--gold); }
body.ciyuan-v2[data-page="oi"] .contract-strip { height: 84px; flex-basis: 84px; }
body.ciyuan-v2[data-page="oi"] .contract-main, body.ciyuan-v2[data-page="oi"] .contract-stat { border-color: var(--line-soft); }
body.ciyuan-v2[data-page="oi"] .chart-panel { min-height: 500px; }
body.ciyuan-v2[data-page="oi"] .panel-head, body.ciyuan-v2[data-page="oi"] .chart-toolbar { border-color: var(--line); background: var(--chart-head); }
body.ciyuan-v2[data-page="oi"] .rightbar { gap: 16px; }
body.ciyuan-v2[data-page="oi"] .main { grid-row: 1; }
body.ciyuan-v2[data-page="oi"] .main > .exchange-tabs { order: 1; }
body.ciyuan-v2[data-page="oi"] .main > .contract-strip { order: 2; }
body.ciyuan-v2[data-page="oi"] .main > .symbol-overview { order: 3; }
body.ciyuan-v2[data-page="oi"] .main > .news-sidebar { order: 4; }
body.ciyuan-v2[data-page="oi"] .main > .chart-panel { order: 5; }
body.ciyuan-v2[data-page="oi"] .main > .oi-quality-panel { order: 6; }
body.ciyuan-v2[data-page="oi"] .main > .table-panel { order: 7; }
body.ciyuan-v2[data-page="oi"] .rightbar { grid-row: 1; }
body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel,
body.ciyuan-v2[data-page="oi"] .rightbar .live-tape-panel { border-top: 1px solid var(--line); }
body.ciyuan-v2[data-page="oi"] .alert, body.ciyuan-v2[data-page="oi"] .anomaly-card { border-color: var(--line-soft); background: transparent; }
body.ciyuan-v2[data-page="oi"] .anomaly-card.warn, body.ciyuan-v2[data-page="oi"] .anomaly-card.critical { background: var(--danger-soft); }

/* Strategy, settings and evidence */
body.ciyuan-v2[data-page="strategy"] .strategy-shell { padding: 16px 20px 40px; }
body.ciyuan-v2[data-page="strategy"] .strategy-chart-panel,
body.ciyuan-v2[data-page="strategy"] .strategy-replay-panel,
body.ciyuan-v2[data-page="strategy"] .strategy-backtest-panel,
body.ciyuan-v2[data-page="strategy"] .strategy-sidebar { border-color: var(--line); border-radius: 0; background: transparent; box-shadow: none; }
body.ciyuan-v2[data-page="strategy"] .strategy-toolbar, body.ciyuan-v2[data-page="strategy"] .strategy-panel-head { border-color: var(--line); background: var(--chart-head); }
body.ciyuan-v2[data-page="strategy"] .strategy-chip, body.ciyuan-v2[data-page="strategy"] .strategy-field select { border-color: var(--line); background: var(--surface-subtle); }
body.ciyuan-v2[data-page="strategy"] .strategy-chip.active { color: var(--gold); border-color: var(--accent-border); background: var(--accent-soft); }

body.ciyuan-v2[data-page="settings"] .portal-shell { padding: 22px 24px 44px; }
body.ciyuan-v2[data-page="settings"] .portal-hero { min-height: 90px; padding: 0 0 18px; border: 0; border-bottom: 1px solid var(--line); background: transparent; }
body.ciyuan-v2[data-page="settings"] .portal-panel { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
body.ciyuan-v2[data-page="settings"] .portal-panel-head { border-color: var(--line); }
body.ciyuan-v2[data-page="settings"] .setting-row, body.ciyuan-v2[data-page="settings"] .quality-row { border-color: var(--line-soft); background: transparent; }
body.ciyuan-v2 .portal-action { border-color: var(--accent-border); background: var(--accent-subtle); color: var(--text-primary); }
body.ciyuan-v2[data-page="settings"] .source-registry-panel { grid-column: 1 / -1; }
.source-registry { min-width: 0; }
.source-mode { min-height: 52px; display: grid; grid-template-columns: 94px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.source-mode > span, .source-mode > small { color: var(--text-tertiary); font-size: 9px; }
.source-mode > strong { color: var(--text-primary); font-size: 11px; }
.source-mode-fallback > strong { color: var(--warning); }
.source-mode-degraded > strong { color: var(--danger); }
.source-overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.source-overview > div { min-height: 68px; display: flex; flex-direction: column; justify-content: center; padding: 10px 14px; border-right: 1px solid var(--line-soft); }
.source-overview > div:last-child { border-right: 0; }
.source-overview span, .source-overview small { color: var(--text-tertiary); font-size: 8px; }
.source-overview strong { margin: 4px 0; color: var(--text-primary); font-size: 17px; font-variant-numeric: tabular-nums; }
.source-overview .has-issue strong { color: var(--warning); }
.source-layer { border-bottom: 1px solid var(--line); }
.source-layer:last-child { border-bottom: 0; }
.source-layer > header { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 12px; background: var(--surface-subtle); border-bottom: 1px solid var(--line-soft); }
.source-layer > header span { color: var(--text-primary); font-size: 10px; font-weight: 700; }
.source-layer > header small { color: var(--text-tertiary); font-size: 8px; }
.source-registry-head, .source-registry-row { display: grid; grid-template-columns: minmax(135px, 1.15fr) 76px 68px minmax(145px, 1.2fr) minmax(145px, 1.15fr) minmax(165px, 1.35fr); align-items: center; gap: 10px; padding: 8px 12px; }
.source-registry-head { min-height: 34px; border-bottom: 1px solid var(--line); color: var(--text-tertiary); font-size: 8px; text-transform: uppercase; }
.source-registry-row { min-height: 54px; border-bottom: 1px solid var(--line-soft); color: var(--text-secondary); font-size: 9px; font-variant-numeric: tabular-nums; }
.source-registry-row:last-child { border-bottom: 0; }
.source-registry-row > * { min-width: 0; }
.source-registry-row span { overflow: hidden; text-overflow: ellipsis; }
.source-registry-row b { display: block; overflow: hidden; color: var(--text-primary); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.source-registry-row small { display: block; margin-top: 3px; overflow: hidden; color: var(--text-tertiary); font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.source-registry-row > strong { display: inline-flex; align-items: center; gap: 6px; color: var(--text-secondary); font-size: 9px; }
.source-registry-row > strong i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; }
.source-registry-row.source-fresh > strong { color: var(--success); }
.source-registry-row.source-aging > strong { color: var(--warning); }
.source-registry-row.source-stale { opacity: .62; }
.source-registry-row.source-unavailable > strong { color: var(--danger); }
.dw-cross-source { margin-bottom: 10px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-cross-source > header { min-height: 42px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); }
.dw-cross-source > header strong { color: var(--text-primary); font-size: 10px; }
.dw-cross-source > header span { color: var(--text-tertiary); font-size: 8px; text-align: right; }
.dw-cross-source > div { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dw-cross-source-item { min-height: 72px; display: flex; flex-direction: column; justify-content: center; padding: 10px; border-right: 1px solid var(--line-soft); }
.dw-cross-source-item:last-child { border-right: 0; }
.dw-cross-source-item span, .dw-cross-source-item small { color: var(--text-tertiary); font-size: 8px; }
.dw-cross-source-item strong { margin: 5px 0; color: var(--text-primary); font-size: 13px; }

@media (max-width: 720px) {
  .source-mode { grid-template-columns: 72px minmax(0, 1fr); }
  .source-mode > small { grid-column: 2; }
  .source-registry-head { display: none; }
  .source-overview { grid-template-columns: 1fr; }
  .source-overview > div { min-height: 56px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .source-overview > div:last-child { border-bottom: 0; }
  .source-registry-row { grid-template-columns: minmax(0, 1fr) 78px 64px; gap: 7px; padding: 10px; }
  .source-registry-row > span:nth-child(4), .source-registry-row > span:nth-child(5), .source-registry-row > span:nth-child(6) { grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line-soft); }
  .dw-cross-source > header { align-items: flex-start; flex-direction: column; }
  .dw-cross-source > header span { text-align: left; }
  .dw-cross-source > div { grid-template-columns: 1fr; }
  .dw-cross-source-item { min-height: 60px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-cross-source-item:last-child { border-bottom: 0; }
}

body.ciyuan-v2[data-page="chips"] .evidence-shell { background: var(--background); }
body.ciyuan-v2[data-page="chips"] .evidence-head,
body.ciyuan-v2[data-page="chips"] .evidence-source-panel,
body.ciyuan-v2[data-page="chips"] .evidence-object-panel,
body.ciyuan-v2[data-page="chips"] .evidence-detail-panel { border-color: var(--line); border-radius: 0; background: transparent; }

body.ciyuan-v2 .portal-error { color: var(--red); }
body.ciyuan-v2 .portal-empty { color: var(--muted); }

/* Day Research Mode: neutralize legacy dark surfaces without touching render logic. */
html[data-theme="light"] body.ciyuan-v2 input,
html[data-theme="light"] body.ciyuan-v2 select,
html[data-theme="light"] body.ciyuan-v2 textarea {
  border-color: var(--border);
  background: var(--input);
  color: var(--text-primary);
}
html[data-theme="light"] body.ciyuan-v2 button { border-color: var(--border); background: var(--surface-subtle); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2 .cy-command-state button,
html[data-theme="light"] body.ciyuan-v2 .cy-priority-actions button,
html[data-theme="light"] body.ciyuan-v2 .spec-candidate,
html[data-theme="light"] body.ciyuan-v2 .dw-symbol { background: transparent; }
html[data-theme="light"] body.ciyuan-v2 button.active { border-color: var(--accent-border); background: var(--accent-soft); color: var(--accent); }
html[data-theme="light"] body.ciyuan-v2 .cy-command-search button { background: var(--accent-subtle); color: var(--accent); }
html[data-theme="light"] body.ciyuan-v2 thead { background: var(--table-head); color: var(--text-secondary); }
html[data-theme="light"] body.ciyuan-v2 input::placeholder,
html[data-theme="light"] body.ciyuan-v2 textarea::placeholder { color: var(--text-tertiary); }
html[data-theme="light"] body.ciyuan-v2 .portal-hero,
html[data-theme="light"] body.ciyuan-v2 .portal-panel,
html[data-theme="light"] body.ciyuan-v2 .signal-card,
html[data-theme="light"] body.ciyuan-v2 .watch-card { background: transparent; color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2 .spec-sort,
html[data-theme="light"] body.ciyuan-v2 .spec-search,
html[data-theme="light"] body.ciyuan-v2 .spec-panel-head,
html[data-theme="light"] body.ciyuan-v2 .spec-coverage-strip,
html[data-theme="light"] body.ciyuan-v2 .spec-detail-summary,
html[data-theme="light"] body.ciyuan-v2 .spec-chart-box,
html[data-theme="light"] body.ciyuan-v2 .spec-chart-readout,
html[data-theme="light"] body.ciyuan-v2 .spec-decision,
html[data-theme="light"] body.ciyuan-v2 .spec-onchain,
html[data-theme="light"] body.ciyuan-v2 .spec-methodology,
html[data-theme="light"] body.ciyuan-v2 .discovery-chart-box,
html[data-theme="light"] body.ciyuan-v2 .discovery-fact-box,
html[data-theme="light"] body.ciyuan-v2 .detail-intel-head,
html[data-theme="light"] body.ciyuan-v2 .detail-market-chart,
html[data-theme="light"] body.ciyuan-v2 .detail-intel-section h3 { background: var(--surface); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2 .spec-score > i { background: var(--border); }
html[data-theme="light"] body.ciyuan-v2 .spec-chart-readout,
html[data-theme="light"] body.ciyuan-v2 .spec-decision li,
html[data-theme="light"] body.ciyuan-v2 .spec-methodology > p,
html[data-theme="light"] body.ciyuan-v2 .detail-intel-head strong { color: var(--text-secondary); }
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .chart-canvas-wrap,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .panel-head,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .chart-toolbar,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] thead,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .overview-exchange,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .oi-range-summary,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .watch-custom-head,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .detail-drawer,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .oi-quality-panel,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .table-panel,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .alerts-panel,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .live-tape-panel { background: var(--surface); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .overview-exchange.active { background: var(--accent-soft); color: var(--accent); }
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-toolbar,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-panel-head,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-chart-wrap,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .backtest-table-head { background: var(--surface); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .top-controls.strategy-controls,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-chart-toolbar,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-sidebar > section,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-side > section { background: var(--surface); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-candle-readout { background: var(--surface-raised); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-candle-readout strong,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-candle-readout span,
html[data-theme="light"] body.ciyuan-v2[data-page="strategy"] .strategy-candle-readout b { color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-head,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-head-state button,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-principles,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-toolbar,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-toolbar form,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-layout,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-dossier > header,
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-queue > header { background: var(--surface); color: var(--text-primary); }
html[data-theme="light"] body.ciyuan-v2[data-page="chips"] .evidence-row span,
html[data-theme="light"] body.ciyuan-v2 .arb-table td,
html[data-theme="light"] body.ciyuan-v2 .arb-route b,
html[data-theme="light"] body.ciyuan-v2 .dw-table td,
html[data-theme="light"] body.ciyuan-v2 .dw-volume > small { color: var(--text-primary); }

/* Intelligence v3.1: trust and attention primitives */
.data-confidence {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-secondary);
  font-size: 8px;
  font-style: normal;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}
.data-confidence i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 2px var(--border-soft); }
.data-confidence b, .data-confidence em { color: inherit; font: inherit; font-style: normal; }
.data-confidence em { opacity: .72; }
.data-confidence.trust-fresh { color: var(--success); }
.data-confidence.trust-aging { color: var(--warning); }
.data-confidence.trust-stale { color: var(--text-tertiary); }
.data-confidence.trust-unavailable { color: var(--danger); }
.data-trust-meta { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; color: var(--text-tertiary); font-size: 8px; line-height: 1.45; }
.data-trust-meta > span:not(.data-confidence) { white-space: nowrap; }
.trust-surface-aging { background-color: var(--warning-soft) !important; }
.trust-surface-stale { opacity: .58; }
.trust-surface-unavailable { opacity: .52; }
.trust-surface-stale:hover, .trust-surface-unavailable:hover { opacity: .72; }
.rank-paused { color: var(--text-tertiary) !important; border-color: var(--border) !important; background: transparent !important; }

/* Dashboard attention queue */
.today-focus { border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.today-focus-head { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.today-focus-head > div { min-width: 0; display: grid; grid-template-columns: auto auto minmax(0, 1fr); align-items: baseline; gap: 8px 13px; }
.today-focus-head span { color: var(--gold); font-size: 8px; font-weight: 700; }
.today-focus-head strong { color: var(--text-primary); font-size: 16px; font-weight: 650; }
.today-focus-head small { color: var(--text-secondary); font-size: 9px; }
.today-focus-head a { display: inline-flex; align-items: center; gap: 7px; color: var(--text-secondary); font-size: 9px; text-decoration: none; white-space: nowrap; }
.today-focus-head a:hover { color: var(--gold); }
.today-focus-head svg { width: 13px; height: 13px; }
.today-focus-list { display: grid; }
.today-focus-row { min-width: 0; min-height: 118px; display: grid; grid-template-columns: 34px minmax(220px, .72fr) minmax(220px, 1fr) minmax(190px, .82fr) minmax(190px, .9fr); align-items: stretch; color: inherit; border-bottom: 1px solid var(--line-soft); text-decoration: none; }
.today-focus-row:last-child { border-bottom: 0; }
.today-focus-row:first-child { box-shadow: inset 2px 0 var(--gold); background-color: var(--accent-subtle); }
.today-focus-row:hover { background-color: var(--hover); }
.today-focus-index { padding: 18px 0 0 10px; color: var(--gold); font-size: 10px; }
.today-focus-row > div { min-width: 0; display: grid; align-content: center; gap: 6px; padding: 14px 16px; border-left: 1px solid var(--line-soft); }
.today-focus-row > div > span { color: var(--text-tertiary); font-size: 8px; font-weight: 650; text-transform: uppercase; }
.today-focus-row > div > strong { overflow: hidden; color: var(--text-primary); font-size: 11px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; }
.today-focus-row > div > small { overflow: hidden; color: var(--text-secondary); font-size: 9px; line-height: 1.45; text-overflow: ellipsis; }
.today-focus-object { grid-template-columns: 46px minmax(0, 1fr); grid-template-rows: auto auto auto; column-gap: 10px !important; }
.today-focus-object .signal-score { grid-row: 1 / 3; width: 44px; height: 44px; display: grid; place-content: center; text-align: center; border: 1px solid var(--accent-border); border-radius: 2px; }
.today-focus-object .signal-score b { color: inherit; font-size: 16px; }
.today-focus-object .signal-score small { color: inherit; font-size: 7px; }
.today-focus-object > strong { font-size: 17px !important; }
.today-focus-object > .data-trust-meta { grid-column: 1 / -1; padding-top: 2px; }
.today-focus-empty { min-height: 84px; display: grid; place-content: center; gap: 5px; color: var(--text-secondary); text-align: center; }
.today-focus-empty strong { color: var(--text-primary); font-size: 11px; }
.today-focus-empty span { font-size: 9px; }
.terminal-secondary-details { border: 0; }
.terminal-secondary-details > summary { display: none; }
.terminal-secondary-content { display: block; }

/* Trust strips across live modules */
.contract-trust, .dw-data-trust, .arb-data-trust { display: grid; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.contract-trust { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dw-data-trust, .arb-data-trust { grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 14px 0 18px; }
.contract-trust > div, .dw-data-trust > div, .arb-data-trust > div { min-width: 0; min-height: 74px; display: grid; align-content: center; gap: 6px; padding: 10px 12px; border-right: 1px solid var(--line-soft); }
.contract-trust > div:last-child, .dw-data-trust > div:last-child, .arb-data-trust > div:last-child { border-right: 0; }
.contract-trust > div > span, .dw-data-trust > div > span, .arb-data-trust > div > span { color: var(--text-secondary); font-size: 8px; }
.contract-trust .data-trust-meta, .dw-data-trust .data-trust-meta, .arb-data-trust .data-trust-meta { display: grid; grid-template-columns: auto minmax(0, 1fr); }
.contract-trust .data-trust-meta > span:not(.data-confidence), .dw-data-trust .data-trust-meta > span:not(.data-confidence), .arb-data-trust .data-trust-meta > span:not(.data-confidence) { overflow: hidden; text-overflow: ellipsis; }
.dw-rule-card footer .data-confidence { margin-left: 8px; }

/* Unified object detail */
.object-detail-index { position: sticky; top: calc(var(--cy-command) + 2px); z-index: 12; min-width: 0; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--topbar); backdrop-filter: blur(12px); }
.object-detail-index a { min-width: 0; height: 42px; display: flex; align-items: center; gap: 7px; padding: 0 11px; overflow: hidden; color: var(--text-secondary); border-right: 1px solid var(--line-soft); font-size: 9px; text-decoration: none; text-overflow: ellipsis; white-space: nowrap; }
.object-detail-index a:last-child { border-right: 0; }
.object-detail-index a:hover { color: var(--text-primary); background: var(--hover); }
.object-detail-index a b { color: var(--gold); font-size: 8px; }
.object-detail-section { scroll-margin-top: calc(var(--cy-command) + 50px); border-bottom: 1px solid var(--line); }
.object-detail-section-head { min-height: 68px; display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: center; gap: 12px; padding: 10px 0; }
.object-detail-section-head > b { color: var(--gold); font-size: 11px; font-weight: 650; }
.object-detail-section-head > div { display: grid; gap: 5px; }
.object-detail-section-head strong { color: var(--text-primary); font-size: 14px; font-weight: 650; }
.object-detail-section-head span { color: var(--text-secondary); font-size: 9px; }
.object-detail-section-body { min-width: 0; padding: 0 0 22px 46px; }
.object-detail-section .spec-detail-summary { margin: 0; border-right: 0; border-left: 0; }
.object-trust-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.object-trust-item { min-width: 0; min-height: 108px; display: grid; align-content: center; gap: 6px; padding: 12px; border-right: 1px solid var(--line-soft); }
.object-trust-item:last-child { border-right: 0; }
.object-trust-item > span { color: var(--text-secondary); font-size: 8px; }
.object-trust-item > strong { overflow: hidden; color: var(--text-primary); font-size: 15px; font-weight: 620; text-overflow: ellipsis; }
.object-trust-item .data-trust-meta { display: grid; gap: 3px; }
.object-change { display: grid; grid-template-columns: minmax(180px, 1.15fr) repeat(4, minmax(145px, 1fr)); margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.object-change > header, .object-change > div { min-width: 0; min-height: 94px; display: grid; align-content: center; gap: 5px; padding: 11px 13px; border-right: 1px solid var(--line-soft); }
.object-change > div:last-child { border-right: 0; }
.object-change span, .object-change small { overflow: hidden; color: var(--text-secondary); font-size: 8px; line-height: 1.45; text-overflow: ellipsis; }
.object-change header > span { color: var(--gold); font-size: 7px; font-weight: 700; }
.object-change strong { overflow: hidden; color: var(--text-primary); font-size: 10px; font-weight: 600; line-height: 1.45; text-overflow: ellipsis; }
.object-detail-section .spec-decision { width: 100%; display: grid; grid-template-columns: 1.1fr repeat(3, minmax(0, 1fr)); border: 1px solid var(--line); background: transparent; }
.object-detail-section .spec-decision > header, .object-detail-section .spec-decision > section { min-width: 0; border-right: 1px solid var(--line-soft); border-bottom: 0; }
.object-detail-section .spec-decision > section:last-child { border-right: 0; }
.object-detail-section .spec-chart-box, .object-market-windows, .object-history-timeline { margin: 0; border: 1px solid var(--line); background: transparent; }
.object-market-windows, .spec-exchanges, .object-history-timeline { margin-top: 12px; }
.object-market-windows > header, .object-history-timeline > header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 12px; border-bottom: 1px solid var(--line); }
.object-market-windows > header strong, .object-history-timeline > header strong { font-size: 11px; }
.object-market-windows > header span, .object-history-timeline > header span { color: var(--text-secondary); font-size: 8px; }
.object-detail-section .spec-onchain, .object-detail-section .spec-methodology { margin: 0; }
.object-ai-summary { display: grid; grid-template-columns: minmax(260px, 1.4fr) repeat(3, minmax(170px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.object-ai-summary > div { min-width: 0; min-height: 116px; display: grid; align-content: center; gap: 7px; padding: 14px 16px; border-right: 1px solid var(--line-soft); }
.object-ai-summary > div:last-child { border-right: 0; }
.object-ai-summary span { color: var(--text-tertiary); font-size: 8px; font-weight: 650; }
.object-ai-summary strong { color: var(--text-primary); font-size: 11px; font-weight: 600; line-height: 1.5; }
.object-ai-summary small, .object-ai-summary p { margin: 0; color: var(--text-secondary); font-size: 9px; line-height: 1.55; }
.object-ai-lead > span { color: var(--gold); }
.object-ai-lead > strong { font-size: 14px; }

/* Evidence Engine */
.evidence-strength-compact { width: 50px; min-width: 50px; min-height: 46px; display: grid !important; place-content: center; gap: 1px; padding: 4px; border: 1px solid var(--accent-border); border-radius: 2px; color: var(--gold); text-align: center; }
.evidence-strength-compact b { display: block; color: inherit !important; font-size: 15px !important; font-weight: 650; line-height: 1; }
.evidence-strength-compact small, .evidence-strength-compact em { display: block; margin: 0 !important; color: var(--text-secondary) !important; font-size: 7px !important; font-style: normal; line-height: 1.25; white-space: nowrap; }
body.ciyuan-v2[data-page="radar"] .portal-signal > .evidence-strength-compact { width: 50px; min-width: 50px; }
.today-focus-object .evidence-strength-compact { grid-row: 1 / 3; width: 48px; min-width: 48px; min-height: 48px; }

.evidence-strength { min-width: 0; display: grid; grid-template-columns: 190px minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.evidence-strength > header { min-height: 88px; display: grid; align-content: center; gap: 5px; padding: 12px 14px; border-right: 1px solid var(--line-soft); }
.evidence-strength > header span { color: var(--gold); font-size: 8px; font-weight: 700; }
.evidence-strength > header strong { color: var(--text-primary); font-size: 16px; font-weight: 620; }
.evidence-strength > header small { color: var(--text-secondary); font-size: 9px; }
.evidence-coverage-matrix { display: grid; grid-template-columns: repeat(4, minmax(82px, 1fr)); }
.evidence-coverage-matrix > span { min-width: 0; min-height: 88px; display: flex; align-items: center; justify-content: center; gap: 6px; padding: 10px; border-right: 1px solid var(--line-soft); color: var(--text-secondary); font-size: 9px; white-space: nowrap; }
.evidence-coverage-matrix > span:last-child { border-right: 0; }
.evidence-coverage-matrix i, .asset-intelligence-profile > div > span i { width: 6px; height: 6px; flex: 0 0 6px; border-radius: 50%; background: currentColor; }
.evidence-known { color: var(--success) !important; }
.evidence-unknown { color: var(--text-tertiary) !important; opacity: .72; }
.evidence-coverage-matrix b { color: inherit; font-size: 9px; }

.asset-intelligence-profile { min-width: 0; display: grid; grid-template-columns: 220px minmax(0, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: transparent; }
.asset-intelligence-profile > header { min-height: 84px; display: grid; align-content: center; gap: 5px; padding: 12px 14px; border-right: 1px solid var(--line-soft); }
.asset-intelligence-profile > header span { color: var(--gold); font-size: 8px; font-weight: 700; }
.asset-intelligence-profile > header strong { color: var(--text-primary); font-size: 13px; font-weight: 620; }
.asset-intelligence-profile > header small { color: var(--text-secondary); font-size: 8px; }
.asset-intelligence-profile > div { min-width: 0; display: grid; grid-template-columns: repeat(4, minmax(100px, 1fr)); }
.asset-intelligence-profile > div > span { min-width: 0; min-height: 84px; display: grid; grid-template-columns: 8px minmax(0, 1fr); align-content: center; gap: 4px 7px; padding: 10px 12px; border-right: 1px solid var(--line-soft); }
.asset-intelligence-profile > div > span:last-child { border-right: 0; }
.asset-intelligence-profile > div > span i { grid-row: 1 / 3; align-self: center; }
.asset-intelligence-profile > div > span b { overflow: hidden; color: var(--text-primary); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.asset-intelligence-profile > div > span small { color: inherit; font-size: 8px; }
.directed-asset-profile { margin: 18px 0 4px; }

.object-evidence-summary { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.object-evidence-summary > div { min-width: 0; min-height: 144px; display: grid; align-content: start; gap: 7px; padding: 15px 16px; border-right: 1px solid var(--line-soft); }
.object-evidence-summary > div:last-child { border-right: 0; }
.object-evidence-summary span { color: var(--gold); font-size: 8px; font-weight: 700; }
.object-evidence-summary strong { color: var(--text-primary); font-size: 12px; font-weight: 620; }
.object-evidence-summary p, .object-evidence-summary ul { margin: 0; color: var(--text-secondary); font-size: 9px; line-height: 1.65; }
.object-evidence-summary ul { padding-left: 15px; }
.object-evidence-summary li + li { margin-top: 3px; }
.object-risk-evidence { background: var(--danger-soft); }
.object-evidence-next { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.object-evidence-next > div { min-height: 78px; display: grid; align-content: center; gap: 5px; padding: 11px 14px; border-right: 1px solid var(--line-soft); }
.object-evidence-next > div span { color: var(--text-secondary); font-size: 8px; }
.object-evidence-next > div strong { color: var(--text-primary); font-size: 10px; font-weight: 600; line-height: 1.5; }
.object-evidence-next > small { grid-column: 1 / -1; min-height: 38px; display: flex; align-items: center; gap: 9px; padding: 7px 14px; color: var(--text-secondary); border-top: 1px solid var(--line-soft); font-size: 8px; }

.spec-timeline > .spec-timeline-head, .spec-timeline > .spec-timeline-row { min-height: 40px; display: grid !important; grid-template-columns: 112px minmax(110px, .75fr) minmax(180px, 1fr) minmax(180px, 1.15fr) !important; align-items: center; gap: 10px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.spec-timeline > .spec-timeline-head { position: sticky; top: 0; z-index: 2; min-height: 30px; color: var(--text-tertiary); background: var(--table-head); font-size: 8px; }
.spec-timeline > .spec-timeline-row time, .spec-timeline > .spec-timeline-row span, .spec-timeline > .spec-timeline-row em { min-width: 0; overflow: hidden; color: var(--text-secondary); font-size: 8px; font-style: normal; text-overflow: ellipsis; white-space: nowrap; }
.spec-timeline > .spec-timeline-row strong { color: var(--text-primary); font-size: 9px; }
.spec-timeline > .spec-timeline-row.burst strong { color: var(--danger); }

.dw-rule-explanation { display: grid; grid-template-columns: 1.1fr 1.4fr .6fr; border-top: 1px solid var(--line-soft); }
.dw-rule-explanation > div { min-width: 0; min-height: 60px; display: grid; align-content: center; gap: 4px; padding: 9px 11px; border-right: 1px solid var(--line-soft); }
.dw-rule-explanation > div:last-child { border-right: 0; }
.dw-rule-explanation span { color: var(--text-tertiary); font-size: 8px; }
.dw-rule-explanation strong { overflow: hidden; color: var(--text-primary); font-size: 9px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.dw-volume > .dw-rule-explanation { margin: 7px -10px -2px; }
.dw-evidence-note { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 14px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dw-evidence-note > div { min-width: 0; min-height: 70px; display: grid; align-content: center; gap: 5px; padding: 10px 13px; border-right: 1px solid var(--line-soft); }
.dw-evidence-note > div:last-child { border-right: 0; }
.dw-evidence-note span { color: var(--text-tertiary); font-size: 8px; }
.dw-evidence-note strong { color: var(--text-primary); font-size: 9px; font-weight: 600; line-height: 1.5; }
.dw-data-trust.dw-data-trust-1 { grid-template-columns: 1fr; }
.dw-data-trust.dw-data-trust-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

body.ciyuan-v2[data-page="chips"] .evidence-row .data-confidence { justify-self: end; }
body.ciyuan-v2[data-page="chips"] .evidence-row > small { grid-column: 2; }
body.ciyuan-v2[data-page="chips"] .dossier-band > .data-trust-meta { padding: 9px 12px; border-top: 1px solid var(--line-soft); }

@media (prefers-reduced-motion: reduce) {
  html.cy-theme-changing body.ciyuan-v2,
  html.cy-theme-changing body.ciyuan-v2 *,
  html.cy-theme-changing body.ciyuan-v2 *::before,
  html.cy-theme-changing body.ciyuan-v2 *::after { transition: none; }
}

@media (max-width: 1320px) {
  :root { --cy-sidebar: 200px; }
}

@media (max-width: 1180px) {
  :root { --cy-sidebar: 198px; }
  .terminal-dashboard-grid { grid-template-columns: minmax(0, 1fr) 290px; gap: 20px; }
  .terminal-signal-labels, body.ciyuan-v2[data-page="radar"] .portal-signal { grid-template-columns: 58px minmax(160px, 1fr) 115px minmax(150px, .9fr); }
  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { grid-template-columns: 1fr; }
  body.ciyuan-v2[data-page="oi"] .rightbar { position: static; grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; height: auto; }
}

@media (max-width: 960px) {
  .cy-app-shell { display: block; }
  .cy-sidebar { position: sticky; top: 0; z-index: 80; width: 100%; height: 78px; display: grid; grid-template-columns: 116px minmax(0, 1fr); padding: 0; border-right: 0; border-bottom: 1px solid var(--line); overflow: hidden; }
  .cy-brand { width: 116px; height: 78px; min-height: 78px; gap: 8px; padding: 0 12px; border-right: 1px solid var(--line); border-bottom: 0; }
  .cy-brand-mark { width: 32px; height: 32px; flex-basis: 32px; }
  .cy-brand-copy strong { font-size: 14px; }
  .cy-brand-copy small { display: none; }
  .cy-nav { min-width: 0; display: flex; align-items: stretch; gap: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
  .cy-nav::-webkit-scrollbar { display: none; }
  .cy-nav-section { display: flex; flex: 0 0 auto; gap: 0; }
  .cy-nav-label { display: none; }
  .cy-nav a { width: 76px; height: 78px; display: grid; grid-template-columns: 1fr; grid-template-rows: 22px 18px; place-content: center; justify-items: center; gap: 5px; padding: 0 7px; border-radius: 0; font-size: 9px; }
  .cy-nav a > b { position: absolute; right: auto; bottom: 0; left: 22px; width: 32px; height: 2px; }
  .cy-nav svg { width: 15px; height: 15px; }
  .cy-sidebar-foot { display: none; }
  .cy-command-bar { top: 78px; grid-template-columns: minmax(150px, .6fr) minmax(240px, 1fr) auto; padding: 10px 14px; }
  .cy-priority-banner { grid-template-columns: 118px minmax(0, 1fr) auto; }
  .cy-priority-label span { display: none; }
  .terminal-dashboard-grid { grid-template-columns: 1fr; }
  .terminal-dashboard-aside { grid-template-columns: minmax(0, 1fr) minmax(250px, .7fr); }
  .spec-system, .dw-terminal, .arb-terminal { padding: 18px 16px 38px; }
  .dw-signal-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-signal-summary > div:nth-child(2) { border-right: 0; }
  .dw-signal-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .today-focus-row { grid-template-columns: 30px minmax(190px, .8fr) minmax(180px, 1fr) minmax(170px, .85fr); }
  .today-focus-risk { grid-column: 2 / -1; border-top: 1px solid var(--line-soft); }
  .object-trust-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .object-trust-item:nth-child(3) { border-right: 0; }
  .object-trust-item:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .object-change { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-change > header { grid-column: 1 / -1; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .object-change > div:nth-of-type(2), .object-change > div:nth-of-type(4) { border-right: 0; }
  .object-change > div:nth-of-type(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .object-detail-section .spec-decision { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-detail-section .spec-decision > header { border-bottom: 1px solid var(--line-soft); }
  .object-detail-section .spec-decision > section:nth-of-type(1) { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .object-ai-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-ai-summary > div:nth-child(2) { border-right: 0; }
  .object-ai-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .object-evidence-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-evidence-summary > div:nth-child(2) { border-right: 0; }
  .object-evidence-summary > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .evidence-coverage-matrix { grid-template-columns: repeat(2, minmax(82px, 1fr)); }
  .evidence-coverage-matrix > span:nth-child(2n) { border-right: 0; }
  .evidence-coverage-matrix > span:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 720px) {
  .cy-command-bar { min-height: 58px; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
  .cy-page-title { display: none; }
  .cy-command-state > span:not(.cy-live-dot), .cy-command-state > small { display: none; }
  .cy-command-search { height: 36px; }
  .cy-priority-banner { height: 34px; grid-template-columns: 98px minmax(0, 1fr) 66px; }
  .cy-priority-label { padding: 0 10px; }
  .cy-priority-label strong { font-size: 9px; }
  .cy-priority-actions button:nth-child(2) { display: none; }
  .cy-priority-item { padding: 0 14px; }
  .cy-priority-item small { display: none; }
  body.ciyuan-v2 .portal-shell.terminal-dashboard { padding: 13px 14px 32px; }
  .terminal-page-head { min-height: 86px; align-items: flex-start; flex-direction: column; gap: 13px; padding-bottom: 15px; }
  .terminal-page-head h1 { font-size: 19px; }
  .terminal-primary-link { align-self: stretch; justify-content: center; }
  .today-focus-head { min-height: 52px; }
  .today-focus-head > div { grid-template-columns: auto auto; }
  .today-focus-head small, .today-focus-head > a { display: none; }
  .today-focus-row { min-height: 0; grid-template-columns: 24px minmax(0, 1fr); }
  .today-focus-row:not(:first-child) { display: none; }
  .today-focus-index { grid-row: 1 / 5; padding: 14px 0 0 5px; }
  .today-focus-row > div { grid-column: 2; min-height: 72px; padding: 10px 11px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); }
  .today-focus-row > .today-focus-object { min-height: 78px; border-top: 0; }
  .today-focus-row > div > strong { white-space: normal; }
  .today-focus-object .signal-score, .today-focus-object .evidence-strength-compact { width: 42px; min-width: 42px; min-height: 42px; }
  .today-focus-object > .data-trust-meta > span:nth-of-type(n+3) { display: none; }
  .today-focus-why small { display: none; }
  .terminal-secondary-details { margin-top: 12px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .terminal-secondary-details > summary { min-height: 44px; display: grid; grid-template-columns: minmax(0, 1fr) auto 16px; align-items: center; gap: 8px; color: var(--text-secondary); cursor: pointer; list-style: none; }
  .terminal-secondary-details > summary::-webkit-details-marker { display: none; }
  .terminal-secondary-details > summary span { color: var(--text-primary); font-size: 10px; font-weight: 600; }
  .terminal-secondary-details > summary small { font-size: 8px; }
  .terminal-secondary-details > summary svg { width: 13px; height: 13px; transition: transform 160ms ease; }
  .terminal-secondary-details[open] > summary svg { transform: rotate(180deg); }
  .terminal-secondary-details[open] .terminal-secondary-content { padding-top: 12px; }
  .terminal-status-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .terminal-status-grid > div { min-height: 82px; padding: 11px 12px; }
  .terminal-status-grid > div:nth-child(2) { border-right: 0; }
  .terminal-status-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .terminal-status-grid strong { font-size: 20px; }
  .terminal-ai-insight { grid-template-columns: 1fr; }
  .terminal-ai-insight > header { grid-column: 1 / -1; min-height: 62px; border-right: 0; border-bottom: 1px solid var(--line); }
  .terminal-ai-insight > div { min-height: 76px; padding: 11px 12px; border-right: 0; border-bottom: 1px solid var(--line); }
  .terminal-ai-insight > div:last-child { border-bottom: 0; }
  .terminal-dashboard-grid { padding-top: 20px; }
  .terminal-dashboard-aside { grid-template-columns: 1fr; }
  .terminal-column-labels { display: none; }
  body.ciyuan-v2[data-page="radar"] .portal-signal { grid-template-columns: 42px minmax(0, 1fr) auto; gap: 8px; padding-inline: 2px; }
  body.ciyuan-v2[data-page="radar"] .portal-signal > .signal-score, body.ciyuan-v2[data-page="radar"] .portal-signal > .evidence-strength-compact { width: 42px; min-width: 42px; min-height: 42px; }
  body.ciyuan-v2[data-page="radar"] .portal-signal > em { text-align: right; }
  body.ciyuan-v2[data-page="radar"] .portal-signal > i { grid-column: 2 / -1; }
  body.ciyuan-v2[data-page="radar"] .portal-event { grid-template-columns: minmax(100px, .7fr) minmax(0, 1fr); gap: 8px; padding-inline: 2px; }
  body.ciyuan-v2[data-page="radar"] .portal-event em { grid-column: 1 / -1; }
  .spec-system-head, .dw-head, .arb-head { align-items: flex-start; flex-direction: column; }
  .contract-trust { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .contract-trust > div:nth-child(2) { border-right: 0; }
  .contract-trust > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .dw-data-trust, .arb-data-trust { grid-template-columns: 1fr; }
  .dw-data-trust > div, .arb-data-trust > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-data-trust > div:last-child, .arb-data-trust > div:last-child { border-bottom: 0; }
  .object-detail-index { top: calc(var(--cy-command) + 78px); display: flex; overflow-x: auto; scrollbar-width: none; }
  .object-detail-index::-webkit-scrollbar { display: none; }
  .object-detail-index a { flex: 0 0 auto; min-width: 106px; }
  .object-detail-section { scroll-margin-top: calc(var(--cy-command) + 126px); }
  .object-detail-section-head { min-height: 58px; grid-template-columns: 26px minmax(0, 1fr); gap: 8px; }
  .object-detail-section-head strong { font-size: 12px; }
  .object-detail-section-body { padding: 0 0 18px; }
  .object-trust-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .object-trust-item { min-height: 98px; padding: 10px; }
  .object-trust-item:nth-child(n) { border-right: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); }
  .object-trust-item:nth-child(2n) { border-right: 0; }
  .object-trust-item:last-child { grid-column: 1 / -1; border-right: 0; border-bottom: 0; }
  .object-change { grid-template-columns: 1fr; }
  .object-change > header, .object-change > div { min-height: 78px; grid-column: 1; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .object-change > div:last-child { border-bottom: 0; }
  .object-detail-section .spec-decision { grid-template-columns: 1fr; }
  .object-detail-section .spec-decision > header, .object-detail-section .spec-decision > section { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .object-detail-section .spec-decision > section:last-child { border-bottom: 0; }
  .object-market-windows > header, .object-history-timeline > header { align-items: flex-start; flex-direction: column; }
  .object-ai-summary { grid-template-columns: 1fr; }
  .object-ai-summary > div { min-height: 92px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .object-ai-summary > div:last-child { border-bottom: 0; }
  .asset-intelligence-profile, .evidence-strength { grid-template-columns: 1fr; }
  .asset-intelligence-profile > header, .evidence-strength > header { min-height: 70px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .asset-intelligence-profile > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .asset-intelligence-profile > div > span { min-height: 66px; border-bottom: 1px solid var(--line-soft); }
  .asset-intelligence-profile > div > span:nth-child(2n) { border-right: 0; }
  .asset-intelligence-profile > div > span:nth-last-child(-n+2) { border-bottom: 0; }
  .object-evidence-summary { grid-template-columns: 1fr; }
  .object-evidence-summary > div { min-height: 106px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .object-evidence-summary > div:last-child { border-bottom: 0; }
  .object-evidence-next { grid-template-columns: 1fr; }
  .object-evidence-next > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .spec-timeline > .spec-timeline-head { display: none !important; }
  .spec-timeline > .spec-timeline-row { grid-template-columns: 82px minmax(0, 1fr) !important; grid-template-rows: auto auto; gap: 4px 9px; }
  .spec-timeline > .spec-timeline-row time { grid-row: 1 / 3; }
  .spec-timeline > .spec-timeline-row span, .spec-timeline > .spec-timeline-row em { grid-column: 2; white-space: normal; }
  .dw-rule-explanation { grid-template-columns: 1fr; }
  .dw-rule-explanation > div { min-height: 50px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-rule-explanation > div:last-child { border-bottom: 0; }
  .dw-evidence-note { grid-template-columns: 1fr; }
  .dw-evidence-note > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-evidence-note > div:last-child { border-bottom: 0; }
  .dw-layout { grid-template-columns: 1fr; }
  .dw-signal-summary > div { min-height: 78px; padding: 11px 10px; }
  .dw-signal-summary .dw-signal-primary strong { font-size: 16px; }
  .dw-history-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-history-grid > div:nth-child(2) { border-right: 0; }
  .dw-history-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .dw-rule-pools, .dw-kucoin-kpis, .dw-kucoin-rule { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-rule-pools > div:nth-child(2), .dw-kucoin-kpis > div:nth-child(2), .dw-kucoin-kpis > div:nth-child(4), .dw-kucoin-rule > div:nth-child(2), .dw-kucoin-rule > div:nth-child(4) { border-right: 0; }
  .dw-rule-pools > div:first-child, .dw-kucoin-kpis > div:nth-child(-n+2), .dw-kucoin-rule > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { padding: 10px 10px 28px; }
  body.ciyuan-v2[data-page="oi"] .rightbar { grid-template-columns: 1fr; }
  body.ciyuan-v2[data-page="oi"] .contract-strip { height: auto; min-height: 166px; flex: 0 0 auto; overflow: visible; }
  body.ciyuan-v2[data-page="settings"] .portal-shell { padding: 16px 14px 36px; }
}

@media (max-width: 720px) {
  .dw-tracking-intro > header { grid-template-columns: 1fr; gap: 7px; padding-block: 14px; }
  .dw-tracking-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-tracking-kpis > div:nth-child(2) { border-right: 0; }
  .dw-tracking-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .dw-tracking-layout { grid-template-columns: 1fr; gap: 18px; }
  .dw-tracking-asset-list { max-height: 420px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-tracking-asset:nth-child(odd) { border-right: 1px solid var(--line-soft); }
  .dw-follow-overview { grid-template-columns: 190px minmax(0, 1fr); }
  .dw-follow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-follow-metrics > div:nth-child(2) { border-right: 0; }
  .dw-follow-metrics > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .dw-tracking-position, .dw-tracking-window-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-tracking-position > div:nth-child(2), .dw-tracking-window-grid > div:nth-child(2) { border-right: 0; }
  .dw-tracking-position > div:nth-child(-n+2), .dw-tracking-window-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .dw-reaction-values, .dw-event-path { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .dw-reaction-values > div:nth-child(3n), .dw-event-path > div:nth-child(3n) { border-right: 0; }
  .dw-reaction-values > div:nth-child(-n+3), .dw-event-path > div:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .dw-signal-type-grid { grid-template-columns: 1fr; }
  .dw-signal-type-grid > article { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-signal-type-grid > article:last-child { border-bottom: 0; }
  .dw-event-lifecycle > div { grid-template-columns: 102px 62px minmax(100px, 1fr) 90px; }
  .dw-event-lifecycle small { grid-column: 1 / -1; padding-bottom: 6px; }
}

@media (max-width: 430px) {
  .cy-sidebar { grid-template-columns: 74px minmax(0, 1fr); }
  .cy-brand { width: 74px; justify-content: center; padding: 0; }
  .cy-brand-copy { display: none; }
  .cy-nav a { width: 68px; }
  .cy-nav a > b { left: 18px; }
  .cy-command-bar { padding-inline: 10px; }
  .terminal-status-grid > div { min-height: 78px; }
  .terminal-status-grid span, .terminal-status-grid small { font-size: 8px; }
  .terminal-status-grid strong { font-size: 18px; }
  .spec-system, .dw-terminal, .arb-terminal { padding-inline: 10px; }
  .dw-view-tabs { gap: 18px; }
  body.dw-unified-directed .dw-tracking-intro > header { min-height: 72px; }
  body.dw-unified-directed .dw-tracking-intro > header p { font-size: 8px; line-height: 1.5; }
  body.dw-unified-directed .dw-tracking-intro > aside { display: none; }
  body.dw-unified-directed .dw-tracking-toolbar { margin-top: 10px; }
  .dw-tracking-intro > header { grid-template-columns: 1fr; gap: 7px; padding-block: 14px; }
  .dw-tracking-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-tracking-kpis > div:nth-child(2) { border-right: 0; }
  .dw-tracking-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .dw-tracking-toolbar { grid-template-columns: minmax(0, 1fr) auto; padding-block: 9px; }
  .dw-tracking-toolbar label { grid-column: 1 / -1; }
  .dw-tracking-toolbar select { width: 150px; }
  .dw-tracking-layout { grid-template-columns: 1fr; gap: 18px; }
  body.dw-unified-directed .dw-tracking-detail { order: -1; }
  .dw-tracking-asset-list { max-height: 420px; display: grid; grid-template-columns: 1fr; }
  .dw-tracking-asset:nth-child(odd) { border-right: 0; }
  .dw-tracking-detail-head { align-items: flex-start; flex-direction: column; }
  .dw-tracking-detail-head > div { width: 100%; grid-template-columns: auto minmax(0, 1fr); }
  .dw-tracking-detail-head small { grid-column: 1 / -1; white-space: normal; }
  .dw-follow-overview { grid-template-columns: 1fr; }
  .dw-follow-state { min-height: 112px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-follow-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-follow-metrics > div { min-height: 82px; }
  .dw-follow-evidence { grid-template-columns: 1fr; }
  .dw-follow-evidence > div { min-height: 98px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-follow-evidence > div:last-child { border-bottom: 0; }
  .dw-current-progress > header { grid-template-columns: 1fr; gap: 5px; padding-block: 11px; }
  .dw-latest-progress > div { grid-template-columns: minmax(0, 1fr) auto; gap: 5px 8px; padding: 9px 11px; }
  .dw-latest-progress time { grid-column: 1; }
  .dw-latest-progress span { grid-column: 2; grid-row: 1; }
  .dw-latest-progress strong { grid-column: 1; }
  .dw-latest-progress em { grid-column: 2; text-align: right; }
  .dw-latest-progress small { grid-column: 1 / -1; white-space: normal; }
  .dw-advanced-research > summary, .dw-history-events > summary { align-items: flex-start; }
  .dw-advanced-research > summary div, .dw-history-events > summary div { grid-template-columns: 1fr; gap: 3px; }
  .dw-advanced-research > summary small, .dw-history-events > summary small { grid-column: 1; line-height: 1.5; }
  .dw-tracking-position, .dw-tracking-window-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dw-tracking-position > div:nth-child(2), .dw-tracking-window-grid > div:nth-child(2) { border-right: 0; }
  .dw-tracking-position > div:nth-child(-n+2), .dw-tracking-window-grid > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .dw-reaction-section > header, .dw-signal-type-study > header, .dw-event-timeline > header { grid-template-columns: 1fr; gap: 6px; padding-block: 12px; }
  .dw-reaction-chart { padding-inline: 0; }
  .dw-reaction-chart svg { height: 220px; }
  .dw-timing-grid { grid-template-columns: 1fr; }
  .dw-timing-panel { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-timing-panel:last-child { border-bottom: 0; }
  .dw-event-windows { grid-template-columns: 1fr; }
  .dw-event-windows span { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .dw-event-windows span:last-child { border-bottom: 0; }
  .dw-asset-event > header { align-items: flex-start; }
  .dw-asset-event > header div { display: grid; gap: 4px; }
  .dw-event-lifecycle > div { grid-template-columns: 1fr auto; gap: 5px 8px; padding: 8px 0; }
  .dw-event-lifecycle time { grid-column: 1; }
  .dw-event-lifecycle span { grid-column: 2; grid-row: 1; }
  .dw-event-lifecycle strong { grid-column: 1; }
  .dw-event-lifecycle em { grid-column: 2; text-align: right; }
  .dw-event-lifecycle small { grid-column: 1 / -1; padding: 0; white-space: normal; }
  .object-trust-grid { grid-template-columns: 1fr; }
  .object-trust-item,
  .object-trust-item:nth-child(n),
  .object-trust-item:nth-child(2n),
  .object-trust-item:last-child {
    min-height: 82px;
    grid-column: 1;
    grid-template-columns: minmax(70px, .42fr) minmax(0, 1fr);
    align-items: center;
    align-content: center;
    gap: 5px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line-soft);
  }
  .object-trust-item:last-child { border-bottom: 0; }
  .object-trust-item > strong { text-align: right; }
  .object-trust-item .data-trust-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: flex-start;
    gap: 3px 8px;
  }
  .object-trust-item .data-trust-meta > span:not(.data-confidence) {
    min-width: 0;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Visual Intelligence v4: hierarchy, live feedback and alert affordances. */
.cy-sidebar { box-shadow: 8px 0 26px rgba(0, 0, 0, .08); }
.cy-command-bar { box-shadow: 0 5px 18px rgba(0, 0, 0, .07); }
html[data-theme="light"] .cy-command-bar,
html[data-theme="light"] .cy-sidebar { box-shadow: 0 8px 24px rgba(26, 31, 36, .06); }

.cy-page-stage { animation: cy-stage-enter 280ms cubic-bezier(.2, .75, .25, 1) both; }
.cy-system-pulse,
.cy-live-dot:not(.degraded) { animation: cy-system-breathe 2.8s ease-in-out infinite; }
.cy-priority-banner { height: 40px; box-shadow: inset 3px 0 var(--danger); }
.cy-priority-banner.has-new-alert { animation: cy-alert-arrival 720ms ease-out both; }
.cy-priority-actions button:hover { color: var(--text-strong); background: var(--hover); }
#cyPrioritySound[data-state="ready"] { color: var(--success); }
#cyPrioritySound[data-state="locked"] { color: var(--warning); animation: cy-sound-ready 1.5s ease-in-out infinite; }
#cyPrioritySound[data-state="off"] { color: var(--text-tertiary); }
#cyPriorityTestSound { color: var(--accent); }
.cy-data-flash { animation: cy-value-flash 680ms ease-out both; }

/* Action center: important objects first, supporting evidence second. */
body.ciyuan-v2[data-page="discovery"] .spec-system-head,
body.ciyuan-v2[data-page="discovery"] .spec-kpis,
body.ciyuan-v2[data-page="discovery"] .spec-toolbar,
body.ciyuan-v2[data-page="discovery"] .spec-list-panel,
body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip,
body.ciyuan-v2[data-page="discovery"] .spec-detail-panel {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
body.ciyuan-v2[data-page="discovery"] .spec-system-head { padding: 16px 18px; border-top: 2px solid var(--accent); }
body.ciyuan-v2[data-page="discovery"] .spec-path-nav {
  width: fit-content;
  max-width: 100%;
  display: flex;
  gap: 0;
  align-self: flex-start;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
body.ciyuan-v2[data-page="discovery"] .spec-path-nav::-webkit-scrollbar { display: none; }
body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button {
  width: auto;
  min-width: 130px;
  height: 40px;
  min-height: 40px;
  grid-template-columns: 18px minmax(72px, auto) auto;
  gap: 7px;
  padding: 0 11px;
  border: 0;
  border-right: 1px solid var(--border-soft);
  background: transparent;
}
body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button:last-child { border-right: 0; }
body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button small { display: none; }
body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button strong { font-size: 9px; }
body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button b { font-size: 10px; }
body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button svg { width: 13px; height: 13px; }
body.ciyuan-v2[data-page="discovery"] .spec-kpis { gap: 0; }
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button {
  grid-template-columns: 28px minmax(0, 1fr) auto;
  padding: 12px 14px;
  background: var(--surface);
  transition: background 160ms ease, box-shadow 160ms ease;
}
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button > svg {
  grid-column: 1;
  grid-row: 1 / 3;
  align-self: center;
  width: 17px;
  height: 17px;
  color: var(--text-tertiary);
}
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button > span { grid-column: 2; grid-row: 1; }
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button > strong { grid-column: 3; grid-row: 1 / 3; }
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button > small { grid-column: 2; grid-row: 2; }
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button:hover > svg,
body.ciyuan-v2[data-page="discovery"] .spec-kpis > button.active > svg { color: var(--accent); }
body.ciyuan-v2[data-page="discovery"] .spec-panel-head,
body.ciyuan-v2[data-page="discovery"] .spec-detail-head { background: var(--surface-subtle); }
body.ciyuan-v2[data-page="discovery"] .spec-candidate,
body.ciyuan-v2[data-page="discovery"] .co-data-row { transition: background 160ms ease, transform 160ms ease, box-shadow 160ms ease; }
body.ciyuan-v2[data-page="discovery"] .spec-candidate:hover { transform: translateX(2px); }
body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip > div {
  grid-template-columns: 25px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 9px;
  background: var(--surface-subtle);
}
body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip > div > svg {
  grid-column: 1;
  grid-row: 1 / 4;
  align-self: center;
  width: 15px;
  height: 15px;
  color: var(--accent);
}
body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip > div > span,
body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip > div > strong,
body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip > div > small { grid-column: 2; }

/* OI workbench: primary market state, chart, then secondary evidence. */
body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { gap: 12px; }
body.ciyuan-v2[data-page="oi"] .main,
body.ciyuan-v2[data-page="oi"] .rightbar { gap: 12px; }
body.ciyuan-v2[data-page="oi"] .exchange-tabs,
body.ciyuan-v2[data-page="oi"] .contract-strip,
body.ciyuan-v2[data-page="oi"] .contract-trust,
body.ciyuan-v2[data-page="oi"] .chart-panel,
body.ciyuan-v2[data-page="oi"] .table-panel,
body.ciyuan-v2[data-page="oi"] .alerts-panel,
body.ciyuan-v2[data-page="oi"] .live-tape-panel,
body.ciyuan-v2[data-page="oi"] .oi-quality-panel,
body.ciyuan-v2[data-page="oi"] .symbol-overview,
body.ciyuan-v2[data-page="oi"] .observe-list,
body.ciyuan-v2[data-page="oi"] .candidate-list,
body.ciyuan-v2[data-page="oi"] .watchlist,
body.ciyuan-v2[data-page="oi"] .exchange-status,
body.ciyuan-v2[data-page="oi"] .news-sidebar {
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}
body.ciyuan-v2[data-page="oi"] .exchange-tabs button { background: var(--surface); transition: color 160ms ease, background 160ms ease; }
body.ciyuan-v2[data-page="oi"] .contract-strip { border-top: 2px solid var(--accent); }
body.ciyuan-v2[data-page="oi"] .contract-main,
body.ciyuan-v2[data-page="oi"] .contract-stat { background: var(--surface); }
body.ciyuan-v2[data-page="oi"] .contract-stat > span { display: flex; align-items: center; gap: 6px; }
body.ciyuan-v2[data-page="oi"] .contract-stat > span svg { width: 12px; height: 12px; color: var(--accent); }
body.ciyuan-v2[data-page="oi"] .contract-stat strong { color: var(--text-strong); font-size: 16px; font-weight: 700; }
body.ciyuan-v2[data-page="oi"] .contract-stat.big strong { font-size: 21px; }
body.ciyuan-v2[data-page="oi"] .chart-panel { border-top: 2px solid var(--accent); }
body.ciyuan-v2[data-page="oi"] .panel-head,
body.ciyuan-v2[data-page="oi"] .chart-toolbar,
body.ciyuan-v2[data-page="oi"] .tape-head,
body.ciyuan-v2[data-page="oi"] .side-head,
body.ciyuan-v2[data-page="oi"] .watch-custom-head,
body.ciyuan-v2[data-page="oi"] .status-title { background: var(--surface-subtle); }
body.ciyuan-v2[data-page="oi"] .tool-tabs button { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
body.ciyuan-v2[data-page="oi"] .tool-tabs button svg,
body.ciyuan-v2[data-page="oi"] .alerts-panel h2 svg { width: 13px; height: 13px; }
body.ciyuan-v2[data-page="oi"] .alerts-panel h2 { display: flex; align-items: center; gap: 7px; }
body.ciyuan-v2[data-page="oi"] .alerts-panel h2 svg { color: var(--danger); }
body.ciyuan-v2[data-page="oi"] .alert,
body.ciyuan-v2[data-page="oi"] .anomaly-card,
body.ciyuan-v2[data-page="oi"] .tape-item,
body.ciyuan-v2[data-page="oi"] .observe-item,
body.ciyuan-v2[data-page="oi"] .candidate-item,
body.ciyuan-v2[data-page="oi"] .watch-item { background: var(--surface); transition: background 160ms ease, transform 160ms ease; }
body.ciyuan-v2[data-page="oi"] .alert:hover,
body.ciyuan-v2[data-page="oi"] .anomaly-card:hover,
body.ciyuan-v2[data-page="oi"] .tape-item:hover { transform: translateX(2px); }
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .chart-canvas-wrap { border-top: 1px solid #252a2f; background: #0d1013; }
body.ciyuan-v2[data-page="oi"] .detail-drawer[aria-hidden="true"] { display: none; }

@keyframes cy-stage-enter { from { opacity: 0; } to { opacity: 1; } }
@keyframes cy-system-breathe { 0%, 100% { opacity: .72; box-shadow: 0 0 0 3px var(--success-soft); } 50% { opacity: 1; box-shadow: 0 0 0 5px var(--success-soft); } }
@keyframes cy-alert-arrival { 0% { background: var(--danger-soft); box-shadow: inset 5px 0 var(--danger), 0 0 0 1px var(--danger-border); } 100% { background: var(--priority-surface); box-shadow: inset 3px 0 var(--danger); } }
@keyframes cy-sound-ready { 0%, 100% { opacity: .62; } 50% { opacity: 1; } }
@keyframes cy-value-flash { 0% { color: var(--accent); text-shadow: 0 0 12px var(--accent-soft); } 100% { text-shadow: none; } }

@media (max-width: 700px) {
  .cy-priority-banner { grid-template-columns: 104px minmax(0, 1fr) 82px; }
  #cyPriorityPause { display: none; }
  .cy-priority-actions { padding-inline: 2px; }
  body.ciyuan-v2[data-page="discovery"] .spec-system-head,
  body.ciyuan-v2[data-page="discovery"] .spec-kpis,
  body.ciyuan-v2[data-page="discovery"] .spec-toolbar,
  body.ciyuan-v2[data-page="discovery"] .spec-list-panel,
  body.ciyuan-v2[data-page="discovery"] .spec-coverage-strip,
  body.ciyuan-v2[data-page="discovery"] .spec-detail-panel { box-shadow: none; }
  body.ciyuan-v2[data-page="discovery"] .spec-kpis > button { padding: 10px; }
  body.ciyuan-v2[data-page="discovery"] .spec-path-nav { width: 100%; }
  body.ciyuan-v2[data-page="discovery"] .spec-path-nav > button { min-width: 118px; }
  body.ciyuan-v2[data-page="oi"] .exchange-tabs,
  body.ciyuan-v2[data-page="oi"] .contract-strip,
  body.ciyuan-v2[data-page="oi"] .chart-panel,
  body.ciyuan-v2[data-page="oi"] .table-panel,
  body.ciyuan-v2[data-page="oi"] .alerts-panel,
  body.ciyuan-v2[data-page="oi"] .live-tape-panel,
  body.ciyuan-v2[data-page="oi"] .oi-quality-panel,
  body.ciyuan-v2[data-page="oi"] .symbol-overview { box-shadow: none; }
  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto;
    align-items: start;
  }
}

@media (max-width: 1180px) {
  body.ciyuan-v2[data-page="oi"] .main { grid-column: 1; grid-row: 1; }
  body.ciyuan-v2[data-page="oi"] .rightbar { grid-column: 1; grid-row: 2; }
}

@media (prefers-reduced-motion: reduce) {
  .cy-page-stage,
  .cy-system-pulse,
  .cy-live-dot,
  .cy-priority-banner.has-new-alert,
  #cyPrioritySound[data-state="locked"],
  .cy-data-flash { animation: none !important; }
  body.ciyuan-v2 .spec-candidate,
  body.ciyuan-v2 .alert,
  body.ciyuan-v2 .anomaly-card,
  body.ciyuan-v2 .tape-item { transition: none !important; }
}

/* Terminal Tech v5: blue identity and a data-first OI command surface. */
.cy-brand-mark {
  border: 1px solid var(--accent-border);
  box-shadow: var(--brand-shadow), 0 0 0 1px rgba(79, 209, 255, .08);
}
.cy-brand-copy small { color: var(--accent); }
.cy-nav a.active {
  color: var(--text-strong);
  background: var(--accent-subtle);
  box-shadow: inset 2px 0 var(--accent);
}
.cy-nav a.active > i { color: var(--accent); filter: drop-shadow(0 0 5px rgba(76, 141, 255, .38)); }
.cy-command-bar { border-bottom-color: var(--accent-border); }
.cy-page-title > span { color: var(--accent); }
.cy-command-search:focus-within { border-color: var(--accent-border-strong); box-shadow: 0 0 0 3px var(--accent-soft); }

body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app {
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 14px;
  padding: 14px 18px 40px;
}
body.ciyuan-v2[data-page="oi"] .main,
body.ciyuan-v2[data-page="oi"] .rightbar { gap: 10px; }
body.ciyuan-v2[data-page="oi"] .main > .exchange-tabs { order: 1; }
body.ciyuan-v2[data-page="oi"] .main > .contract-strip { order: 2; }
body.ciyuan-v2[data-page="oi"] .main > .contract-trust { order: 3; }
body.ciyuan-v2[data-page="oi"] .main > .oi-command-deck { order: 4; }
body.ciyuan-v2[data-page="oi"] .main > .chart-panel { order: 5; }
body.ciyuan-v2[data-page="oi"] .main > .oi-quality-panel { order: 6; }
body.ciyuan-v2[data-page="oi"] .main > .symbol-overview { order: 7; }
body.ciyuan-v2[data-page="oi"] .main > .news-sidebar { order: 8; }
body.ciyuan-v2[data-page="oi"] .main > .table-panel { order: 9; }

body.ciyuan-v2[data-page="oi"] .exchange-tabs {
  height: 42px;
  flex-basis: 42px;
  padding: 3px;
  border-color: var(--accent-border);
  background: var(--surface-subtle);
}
body.ciyuan-v2[data-page="oi"] .exchange-tabs button { min-width: 98px; height: 34px; }
body.ciyuan-v2[data-page="oi"] .exchange-tabs button.active {
  color: var(--text-strong);
  background: var(--accent-soft);
  box-shadow: inset 0 -2px var(--accent);
}
body.ciyuan-v2[data-page="oi"] .exchange-tabs button.active small { color: var(--info); }
body.ciyuan-v2[data-page="oi"] .contract-strip {
  height: 82px;
  flex-basis: 82px;
  border-color: var(--accent-border);
  border-top: 2px solid var(--accent);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .13);
}
body.ciyuan-v2[data-page="oi"] .contract-main { background: var(--accent-subtle); }
body.ciyuan-v2[data-page="oi"] .contract-main h1 { color: var(--text-strong); font-size: 18px; }
body.ciyuan-v2[data-page="oi"] .contract-stat > span svg { color: var(--info); }
body.ciyuan-v2[data-page="oi"] .contract-stat strong { transition: color 180ms ease, text-shadow 180ms ease; }
body.ciyuan-v2[data-page="oi"] .contract-trust { border-color: var(--border); background: var(--surface-subtle); }

body.ciyuan-v2[data-page="oi"] .oi-command-deck {
  min-width: 0;
  border: 1px solid var(--accent-border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(0, 0, 0, .14), inset 0 1px rgba(79, 209, 255, .05);
  overflow: hidden;
}
body.ciyuan-v2[data-page="oi"] .oi-command-head {
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(190px, 1fr) 88px auto;
  align-items: center;
  gap: 12px;
  padding: 7px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
}
body.ciyuan-v2[data-page="oi"] .oi-live-core { min-width: 0; display: flex; align-items: center; gap: 9px; }
body.ciyuan-v2[data-page="oi"] .oi-live-core > div { min-width: 0; display: grid; gap: 3px; }
body.ciyuan-v2[data-page="oi"] .oi-live-core strong { color: var(--text-strong); font-size: 10px; font-weight: 760; }
body.ciyuan-v2[data-page="oi"] .oi-live-core small { overflow: hidden; color: var(--text-secondary); font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
body.ciyuan-v2[data-page="oi"] .oi-core-pulse {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border: 1px solid var(--info);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 12px rgba(76, 141, 255, .55);
  animation: oi-core-live 1.8s ease-in-out infinite;
}
body.ciyuan-v2[data-page="oi"] .oi-command-deck[data-feed-state="partial"] .oi-core-pulse { border-color: var(--warning); background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
body.ciyuan-v2[data-page="oi"] .oi-command-deck[data-feed-state="empty"] .oi-core-pulse { border-color: var(--text-tertiary); background: var(--text-tertiary); box-shadow: none; animation: none; }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars { height: 22px; display: flex; align-items: end; justify-content: center; gap: 4px; }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars i { width: 3px; height: 6px; background: var(--accent); opacity: .38; animation: oi-packet 1.2s ease-in-out infinite; }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars i:nth-child(2) { height: 13px; animation-delay: -1s; }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars i:nth-child(3) { height: 19px; animation-delay: -.8s; background: var(--info); }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars i:nth-child(4) { height: 10px; animation-delay: -.6s; }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars i:nth-child(5) { height: 17px; animation-delay: -.4s; background: var(--info); }
body.ciyuan-v2[data-page="oi"] .oi-packet-bars i:nth-child(6) { height: 8px; animation-delay: -.2s; }
body.ciyuan-v2[data-page="oi"] .oi-transport-metrics { display: flex; align-items: center; justify-content: flex-end; gap: 14px; }
body.ciyuan-v2[data-page="oi"] .oi-transport-metrics span { display: grid; grid-template-columns: auto auto; gap: 5px; color: var(--text-tertiary); font-size: 8px; white-space: nowrap; }
body.ciyuan-v2[data-page="oi"] .oi-transport-metrics b { color: var(--text-primary); font-size: 9px; font-weight: 690; }
body.ciyuan-v2[data-page="oi"] .oi-structure-rail { min-width: 0; max-height: 248px; overflow: auto; scrollbar-width: thin; }
body.ciyuan-v2[data-page="oi"] .oi-structure-head,
body.ciyuan-v2[data-page="oi"] .oi-structure-row {
  min-width: 650px;
  display: grid;
  grid-template-columns: minmax(112px, 1.2fr) repeat(5, minmax(72px, .78fr)) 62px;
  align-items: stretch;
}
body.ciyuan-v2[data-page="oi"] .oi-structure-head { min-height: 26px; color: var(--text-tertiary); background: var(--surface); font-size: 7px; text-transform: uppercase; }
body.ciyuan-v2[data-page="oi"] .oi-structure-head > span { display: flex; align-items: center; justify-content: center; padding: 5px 7px; border-right: 1px solid var(--border-soft); }
body.ciyuan-v2[data-page="oi"] .oi-structure-head > span:first-child { justify-content: flex-start; }
body.ciyuan-v2[data-page="oi"] .oi-structure-row {
  width: 100%;
  height: 43px;
  padding: 0;
  border: 0;
  border-top: 1px solid var(--border-soft);
  border-radius: 0;
  background: transparent;
  color: var(--text-primary);
  text-align: left;
  transition: background 150ms ease, box-shadow 150ms ease;
}
body.ciyuan-v2[data-page="oi"] .oi-structure-row:hover { background: var(--hover); }
body.ciyuan-v2[data-page="oi"] .oi-structure-row.active { background: var(--accent-subtle); box-shadow: inset 2px 0 var(--accent); }
body.ciyuan-v2[data-page="oi"] .oi-structure-source,
body.ciyuan-v2[data-page="oi"] .oi-structure-fresh,
body.ciyuan-v2[data-page="oi"] .oi-heat-cell { min-width: 0; display: flex; flex-direction: column; justify-content: center; padding: 5px 8px; border-right: 1px solid var(--border-soft); }
body.ciyuan-v2[data-page="oi"] .oi-structure-source b { color: var(--text-strong); font-size: 10px; }
body.ciyuan-v2[data-page="oi"] .oi-structure-source small,
body.ciyuan-v2[data-page="oi"] .oi-heat-cell small,
body.ciyuan-v2[data-page="oi"] .oi-structure-fresh small { margin-top: 2px; color: var(--text-tertiary); font-size: 7px; }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell { align-items: center; text-align: center; }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell b { font-size: 9px; font-weight: 720; }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.up b { color: var(--success); }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.down b { color: var(--danger); }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.medium.up,
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.strong.up { background: var(--success-soft); }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.medium.down,
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.strong.down { background: var(--danger-soft); }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.strong { box-shadow: inset 0 -2px currentColor; }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.pending { color: var(--warning); background: var(--warning-soft); }
body.ciyuan-v2[data-page="oi"] .oi-heat-cell.unavailable { opacity: .46; }
body.ciyuan-v2[data-page="oi"] .oi-structure-fresh { align-items: flex-end; border-right: 0; text-align: right; }
body.ciyuan-v2[data-page="oi"] .oi-structure-fresh b { font-size: 9px; }
body.ciyuan-v2[data-page="oi"] .oi-structure-empty { min-height: 72px; display: flex; align-items: center; justify-content: center; color: var(--text-tertiary); font-size: 9px; }
body.ciyuan-v2[data-page="oi"] .oi-structure-rail.is-updated .oi-structure-row { animation: oi-row-arrive 260ms ease-out both; }

body.ciyuan-v2[data-page="oi"] .chart-panel {
  position: relative;
  height: 624px;
  min-height: 624px;
  border-color: var(--accent-border);
  border-top: 2px solid var(--accent);
  box-shadow: 0 16px 38px rgba(0, 0, 0, .16);
}
body.ciyuan-v2[data-page="oi"] .chart-toolbar { background: var(--surface-subtle); }
body.ciyuan-v2[data-page="oi"] .tool-tabs button.active,
body.ciyuan-v2[data-page="oi"] .oi-metric-tabs button.active,
body.ciyuan-v2[data-page="oi"] .range-buttons button.active { color: var(--accent-contrast); background: var(--accent); }
body.ciyuan-v2[data-page="oi"] .chart-canvas-wrap { isolation: isolate; background: #090d12; }
body.ciyuan-v2[data-page="oi"] .chart-canvas-wrap::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: var(--info);
  opacity: 0;
  pointer-events: none;
  animation: oi-chart-scan 6s linear infinite;
}
body.ciyuan-v2[data-page="oi"] #chart { position: relative; z-index: 1; }
body.ciyuan-v2[data-page="oi"] .oi-range-summary,
body.ciyuan-v2[data-page="oi"] .range-buttons { background: #0c1118; }
body.ciyuan-v2[data-page="oi"] .rightbar { top: calc(var(--cy-command) + 14px); height: calc(100vh - var(--cy-command) - 28px); }
body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel { border-color: var(--danger-border); box-shadow: inset 2px 0 var(--danger); }
body.ciyuan-v2[data-page="oi"] .alert.empty { grid-template-columns: 46px minmax(0, 1fr); }
body.ciyuan-v2[data-page="oi"] .alert.empty .alert-msg { min-width: 0; overflow-wrap: anywhere; }
body.ciyuan-v2[data-page="oi"] .rightbar .live-tape-panel { border-color: var(--accent-border); box-shadow: inset 2px 0 var(--accent); }
body.ciyuan-v2[data-page="oi"] .news-sidebar { height: 78px; grid-template-rows: 78px; border-color: var(--accent-border); }
body.ciyuan-v2[data-page="oi"] .event-strip-card { min-height: 76px; height: 76px; }

html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .oi-range-summary,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .range-buttons { background: var(--surface-subtle); }
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .oi-command-deck,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .oi-command-head,
html[data-theme="light"] body.ciyuan-v2[data-page="oi"] .oi-structure-head { background: var(--surface); }

@keyframes oi-core-live { 0%, 100% { transform: scale(.82); opacity: .68; } 50% { transform: scale(1); opacity: 1; } }
@keyframes oi-packet { 0%, 100% { transform: scaleY(.45); opacity: .28; } 50% { transform: scaleY(1); opacity: .9; } }
@keyframes oi-row-arrive { from { opacity: .45; transform: translateX(3px); } to { opacity: 1; transform: translateX(0); } }
@keyframes oi-chart-scan { 0%, 15% { left: 0; opacity: 0; } 20% { opacity: .42; } 72% { opacity: .22; } 78%, 100% { left: 100%; opacity: 0; } }

@media (max-width: 1180px) {
  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { grid-template-columns: minmax(0, 1fr); }
  body.ciyuan-v2[data-page="oi"] .main { grid-column: 1; grid-row: 1; }
  body.ciyuan-v2[data-page="oi"] .rightbar { position: static; grid-column: 1; grid-row: 2; height: auto; overflow: visible; }
  body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel { min-height: 300px; }
}

@media (max-width: 700px) {
  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { width: 100%; padding: 8px 8px 28px; gap: 8px; }
  body.ciyuan-v2[data-page="oi"] .main { width: 100%; gap: 8px; }
  body.ciyuan-v2[data-page="oi"] .contract-strip {
    height: 78px;
    min-height: 78px;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  body.ciyuan-v2[data-page="oi"] .contract-strip::-webkit-scrollbar { display: none; }
  body.ciyuan-v2[data-page="oi"] .contract-main { min-width: 150px; flex: 0 0 150px; }
  body.ciyuan-v2[data-page="oi"] .contract-stat { min-width: 112px; flex: 0 0 112px; padding: 0 10px; }
  body.ciyuan-v2[data-page="oi"] .contract-stat.big { min-width: 132px; flex-basis: 132px; }
  body.ciyuan-v2[data-page="oi"] .contract-stat strong,
  body.ciyuan-v2[data-page="oi"] .contract-stat.big strong { font-size: 14px; }
  body.ciyuan-v2[data-page="oi"] .contract-trust { display: flex; overflow-x: auto; scrollbar-width: none; }
  body.ciyuan-v2[data-page="oi"] .contract-trust::-webkit-scrollbar { display: none; }
  body.ciyuan-v2[data-page="oi"] .contract-trust > div { min-width: 168px; min-height: 72px; flex: 0 0 168px; border-bottom: 0 !important; }
  body.ciyuan-v2[data-page="oi"] .oi-command-head { grid-template-columns: minmax(0, 1fr) auto; gap: 8px; padding: 7px 9px; }
  body.ciyuan-v2[data-page="oi"] .oi-packet-bars { display: none; }
  body.ciyuan-v2[data-page="oi"] .oi-transport-metrics { gap: 8px; }
  body.ciyuan-v2[data-page="oi"] .oi-transport-metrics span:first-child { display: none; }
  body.ciyuan-v2[data-page="oi"] .oi-structure-rail { max-height: 218px; overflow-x: auto; }
  body.ciyuan-v2[data-page="oi"] .oi-structure-head,
  body.ciyuan-v2[data-page="oi"] .oi-structure-row { min-width: 620px; }
  body.ciyuan-v2[data-page="oi"] .chart-panel { height: 590px; min-height: 590px; grid-template-rows: auto auto minmax(350px, 1fr) 34px; }
  body.ciyuan-v2[data-page="oi"] .chart-toolbar {
    display: grid;
    grid-template-columns: minmax(150px, 1fr) minmax(118px, auto);
    align-items: center;
    gap: 6px;
    overflow: visible;
  }
  body.ciyuan-v2[data-page="oi"] .tool-tabs { min-width: 0; }
  body.ciyuan-v2[data-page="oi"] .tool-tabs button { min-width: 0; flex: 1; padding: 0 6px; }
  body.ciyuan-v2[data-page="oi"] .oi-metric-tabs { min-width: 0; grid-template-columns: repeat(2, minmax(54px, 1fr)); }
  body.ciyuan-v2[data-page="oi"] .oi-metric-tabs button { min-width: 0; padding: 0 5px; }
  body.ciyuan-v2[data-page="oi"] .chart-select-group { min-width: 0; grid-template-columns: auto minmax(0, 1fr); }
  body.ciyuan-v2[data-page="oi"] .chart-select-group select { width: 100%; min-width: 0; }
  body.ciyuan-v2[data-page="oi"] .legend { display: none; }
  body.ciyuan-v2[data-page="oi"] .news-sidebar { height: 72px; grid-template-rows: 72px; }
  body.ciyuan-v2[data-page="oi"] .event-strip-card { min-height: 70px; height: 70px; }
  body.ciyuan-v2[data-page="oi"] .rightbar { width: 100%; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  body.ciyuan-v2[data-page="oi"] .oi-core-pulse,
  body.ciyuan-v2[data-page="oi"] .oi-packet-bars i,
  body.ciyuan-v2[data-page="oi"] .oi-structure-rail.is-updated .oi-structure-row,
  body.ciyuan-v2[data-page="oi"] .chart-canvas-wrap::after { animation: none !important; }
}

/* Wide terminal frame: keep both context rails anchored while the workbench scrolls. */
html {
  width: 100%;
  overflow-x: clip;
  overflow-y: auto;
}

body.ciyuan-v2 {
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
}

.cy-app-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  align-items: start;
}

.cy-sidebar { align-self: start; }

.cy-app-main,
.cy-page-stage,
body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app {
  width: 100%;
  max-width: none;
}

@media (min-width: 961px) {
  .cy-sidebar {
    position: fixed;
    inset: 0 auto 0 0;
    width: var(--cy-sidebar);
    height: 100dvh;
  }
  .cy-app-main { grid-column: 2; }
}

/* Browser zoom and compact desktop widths keep a usable right evidence rail. */
@media (min-width: 1041px) and (max-width: 1480px) {
  :root { --cy-sidebar: 76px; }

  .cy-sidebar { padding: 0 8px 12px; }
  .cy-brand { justify-content: center; padding-inline: 0; }
  .cy-brand-copy,
  .cy-nav-label,
  .cy-sidebar-foot { display: none; }
  .cy-nav { gap: 8px; padding-top: 14px; }
  .cy-nav-section { gap: 5px; }
  .cy-nav a {
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
  }
  .cy-nav a > span { display: none; }
  .cy-nav a > b {
    position: absolute;
    right: -8px;
    width: 2px;
    height: 20px;
  }
  .cy-nav svg { width: 17px; height: 17px; }

  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app {
    grid-template-columns: minmax(0, 1fr) 300px;
    padding-inline: 14px;
  }
  body.ciyuan-v2[data-page="oi"] .main {
    grid-column: 1;
    grid-row: 2;
  }
  body.ciyuan-v2[data-page="oi"] .rightbar {
    position: sticky;
    top: calc(var(--cy-command) + 14px);
    grid-column: 2;
    grid-row: 2;
    width: auto;
    height: calc(100dvh - var(--cy-command) - 28px);
    display: flex;
    overflow-x: hidden;
    overflow-y: auto;
  }
}

@media (min-width: 1041px) and (max-width: 1120px) {
  body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel,
  body.ciyuan-v2[data-page="oi"] .rightbar .live-tape-panel { display: grid; }
}

@media (min-width: 961px) and (max-width: 1040px) {
  :root { --cy-sidebar: 76px; }
  .cy-sidebar { padding-inline: 8px; }
  .cy-brand { justify-content: center; padding-inline: 0; }
  .cy-brand-copy,
  .cy-nav-label,
  .cy-sidebar-foot,
  .cy-nav a > span { display: none; }
  .cy-nav a { display: flex; align-items: center; justify-content: center; padding: 0; }
  .cy-nav a > b { position: absolute; right: -8px; }
}

/* OI evidence path: compact facts around the chart, not another history ledger. */
body.ciyuan-v2[data-page="oi"] .chart-panel {
  height: 704px;
  min-height: 704px;
  grid-template-rows: auto auto auto minmax(390px, 1fr) 34px;
}

body.ciyuan-v2[data-page="oi"] .oi-event-chain {
  min-width: 0;
  min-height: 88px;
  display: grid;
  grid-template-columns: 1.05fr .9fr 1.35fr;
  border-bottom: 1px solid var(--border);
  background: var(--surface-subtle);
  overflow: hidden;
}

body.ciyuan-v2[data-page="oi"] .oi-event-chain > section {
  min-width: 0;
  padding: 8px 10px;
  border-right: 1px solid var(--border);
}

body.ciyuan-v2[data-page="oi"] .oi-event-chain > section:last-child { border-right: 0; }
body.ciyuan-v2[data-page="oi"] .oi-event-chain header {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  color: var(--text-secondary);
  font-size: 9px;
}
body.ciyuan-v2[data-page="oi"] .oi-event-chain header span { color: var(--accent); font-family: var(--font-mono); }
body.ciyuan-v2[data-page="oi"] .oi-event-chain header strong { color: var(--text-primary); font-size: 10px; }
body.ciyuan-v2[data-page="oi"] .oi-event-chain header small { margin-left: auto; color: var(--text-tertiary); }
.chain-line,
.chain-current,
.chain-check { min-width: 0; display: grid; align-items: center; gap: 5px; }
.chain-line { grid-template-columns: 56px minmax(74px, .8fr) minmax(0, 1fr); min-height: 18px; font-size: 9px; }
.chain-line time,
.chain-line span,
.chain-current span,
.chain-check span { min-width: 0; overflow: hidden; color: var(--text-tertiary); text-overflow: ellipsis; white-space: nowrap; }
.chain-line strong { min-width: 0; overflow: hidden; color: var(--text-secondary); text-overflow: ellipsis; white-space: nowrap; }
.chain-line.muted { grid-template-columns: minmax(110px, auto) minmax(0, 1fr); opacity: .7; }
.chain-current { grid-template-columns: minmax(0, 1fr) auto auto; }
.chain-current > strong { grid-column: 1 / -1; color: var(--text-primary); font-size: 11px; }
.chain-current b { font-family: var(--font-mono); font-size: 10px; }
.chain-checks { display: grid; gap: 3px; }
.chain-check { grid-template-columns: 24px 58px minmax(0, 1fr); min-height: 17px; font-size: 9px; }
.chain-check b { color: var(--text-secondary); font-family: var(--font-mono); }
.chain-check strong { font-family: var(--font-mono); }
.chain-check.reached { background: var(--accent-soft); box-shadow: inset 2px 0 var(--accent); }
.chain-empty { display: flex; align-items: center; padding: 0 12px; color: var(--text-tertiary); font-size: 10px; }

.chart-event-markers {
  position: absolute;
  z-index: 4;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.chart-event-markers button {
  position: absolute;
  top: 18px;
  bottom: 32px;
  width: 1px;
  padding: 0;
  border: 0;
  background: color-mix(in srgb, var(--accent) 42%, transparent);
  pointer-events: auto;
  cursor: pointer;
}
.chart-event-markers button i {
  position: absolute;
  top: 0;
  left: -3px;
  width: 7px;
  height: 7px;
  border: 1px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.chart-event-markers button span {
  position: absolute;
  top: 10px;
  left: 5px;
  max-width: 72px;
  overflow: hidden;
  color: var(--accent);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 700px) {
  body.ciyuan-v2[data-page="oi"] .chart-panel {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto 420px auto;
  }
  body.ciyuan-v2[data-page="oi"] .oi-event-chain {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    overflow: visible;
  }
  body.ciyuan-v2[data-page="oi"] .oi-event-chain > section {
    min-width: 0;
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }
  body.ciyuan-v2[data-page="oi"] .oi-event-chain > section:last-child { border-bottom: 0; }
}

/* Focus mode keeps the operational path visible and moves repeated raw detail behind one control. */
.cy-density-toggle[aria-pressed="true"] {
  color: var(--accent) !important;
  border-color: var(--accent-border) !important;
  background: var(--accent-soft) !important;
}

body.ciyuan-v2[data-density="focus"] .cy-priority-label > span,
body.ciyuan-v2[data-density="focus"] .cy-priority-item small { display: none; }
body.ciyuan-v2[data-density="focus"] .cy-priority-banner { min-height: 44px; }

body.ciyuan-v2[data-density="focus"][data-page="oi"] #contractTrust,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .main > .news-sidebar,
body.ciyuan-v2[data-density="focus"][data-page="oi"] #oiQualityPanel,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .table-panel,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .rightbar .candidate-head,
body.ciyuan-v2[data-density="focus"][data-page="oi"] #candidateList,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .rightbar .live-tape-panel,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .rightbar .alerts-panel,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .rightbar .status-title,
body.ciyuan-v2[data-density="focus"][data-page="oi"] #exchangeStatus { display: none; }

body.ciyuan-v2[data-density="focus"][data-page="oi"] .symbol-overview .overview-kpis {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
body.ciyuan-v2[data-density="focus"][data-page="oi"] .symbol-overview .overview-kpis > div:nth-child(n + 4),
body.ciyuan-v2[data-density="focus"][data-page="oi"] .symbol-overview .overview-exchanges { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-packet-bars { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-command-head { grid-template-columns: minmax(0, 1fr) auto; }
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-transport-metrics span:first-child { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-head,
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-row {
  min-width: 0;
  grid-template-columns: minmax(120px, 1.3fr) repeat(2, minmax(74px, .9fr)) 62px;
}
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-head > :nth-child(2),
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-row > :nth-child(2),
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-head > :nth-child(5),
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-row > :nth-child(5),
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-head > :nth-child(6),
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-row > :nth-child(6) { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-rail { max-height: 220px; }
body.ciyuan-v2[data-density="focus"][data-page="oi"] .chart-panel {
  height: 628px;
  min-height: 628px;
}
body.ciyuan-v2[data-density="focus"][data-page="oi"] .rightbar { gap: 8px; }

body.ciyuan-v2[data-density="focus"][data-page="directed"] .dw-head p,
body.ciyuan-v2[data-density="focus"][data-page="directed"] #dwKpis,
body.ciyuan-v2[data-density="focus"][data-page="directed"] #dwAssetProfile,
body.ciyuan-v2[data-density="focus"][data-page="directed"] .dw-history-summary,
body.ciyuan-v2[data-density="focus"][data-page="directed"] .dw-history,
body.ciyuan-v2[data-density="focus"][data-page="directed"] #dwKucoinKpis,
body.ciyuan-v2[data-density="focus"][data-page="directed"] .dw-tracking-intro { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="directed"] #dwKucoinAlerts tr:nth-child(n + 9),
body.ciyuan-v2[data-density="focus"][data-page="directed"] #dwTrackingAssets > :nth-child(n + 13) { display: none; }

body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-head p,
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-presets,
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-method { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-summary > :nth-child(2),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-summary > :nth-child(4),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-happening-rows > :nth-child(n + 4),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-columns > :nth-child(6),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-columns > :nth-child(7),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-columns > :nth-child(8),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-columns > :nth-child(9),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-data-row > :nth-child(6),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-data-row > :nth-child(7),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-data-row > :nth-child(8),
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-data-row > :nth-child(9) { display: none; }
body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-row {
  grid-template-columns: minmax(104px, .9fr) minmax(108px, .95fr) minmax(76px, .7fr) minmax(96px, .82fr) minmax(86px, .72fr) minmax(78px, .68fr) minmax(76px, .66fr);
}

body.ciyuan-v2[data-density="focus"][data-page="discovery"] #discoveryKpis,
body.ciyuan-v2[data-density="focus"][data-page="discovery"] #discoveryEvidence { display: none; }

@media (max-width: 700px) {
  body.ciyuan-v2[data-density="focus"] .cy-priority-banner { grid-template-columns: 92px minmax(0, 1fr) 82px; }
  body.ciyuan-v2[data-density="focus"] .cy-priority-label strong { font-size: 9px; }
  body.ciyuan-v2[data-density="focus"][data-page="oi"] .contract-strip { height: 72px; min-height: 72px; }
  body.ciyuan-v2[data-density="focus"][data-page="oi"] .contract-stat:nth-of-type(n + 5) { display: none; }
  body.ciyuan-v2[data-density="focus"][data-page="oi"] .chart-panel {
    height: auto;
    min-height: 0;
    grid-template-rows: auto auto auto 400px auto;
  }
  body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-head,
  body.ciyuan-v2[data-density="focus"][data-page="oi"] .oi-structure-row { min-width: 0; }
  body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-row {
    grid-template-columns: minmax(108px, 1.1fr) minmax(94px, .85fr) minmax(68px, .62fr) minmax(82px, .75fr) minmax(72px, .64fr) minmax(68px, .6fr) minmax(66px, .6fr);
    column-gap: 7px;
    padding-inline: 8px;
  }
  body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-row > :nth-child(2) small,
  body.ciyuan-v2[data-density="focus"][data-page="leverage"] .lv-row > :nth-child(5) small { display: none; }
}
