:root {
  color-scheme: dark;
  --bg: #080807;
  --panel: #0e0d0b;
  --panel-2: #13120f;
  --panel-3: #10100e;
  --line: #302d26;
  --line-soft: #211f1a;
  --text: #f2eee5;
  --muted: #928d83;
  --teal: #c8a866;
  --red: #df737b;
  --amber: #d7b970;
  --blue: #7ca3c7;
  --positive: #67b68b;
  --cy-sidebar: 196px;
  --cy-command: 58px;
  --cy-radius: 4px;
}

html,
body.ciyuan-v2 {
  min-width: 0;
  min-height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  letter-spacing: 0;
}

body.ciyuan-v2 {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

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

body.ciyuan-v2 button,
body.ciyuan-v2 input,
body.ciyuan-v2 select,
body.ciyuan-v2 textarea {
  font: inherit;
  letter-spacing: 0;
}

body.ciyuan-v2 button:focus-visible,
body.ciyuan-v2 input:focus-visible,
body.ciyuan-v2 select:focus-visible,
body.ciyuan-v2 textarea:focus-visible,
body.ciyuan-v2 a:focus-visible {
  outline: 2px solid rgba(87, 214, 177, .72);
  outline-offset: 2px;
}

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

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

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

.cy-brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  display: block;
}

.cy-brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.cy-brand-copy strong {
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: 17px;
  line-height: 1.05;
  font-weight: 700;
}
.cy-brand-copy small { color: var(--muted); font-size: 9px; line-height: 1.2; }

.cy-nav {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding-top: 14px;
}

.cy-nav a {
  min-width: 0;
  height: 38px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--cy-radius);
  color: var(--muted);
  text-decoration: none;
  font-size: 11px;
  font-weight: 760;
  transition: color .14s ease, border-color .14s ease, background .14s ease;
}

.cy-nav a:hover { color: var(--text); background: #11100e; }
.cy-nav a.active { border-color: #5b4d31; color: var(--text); background: #15130f; }
.cy-nav a.active svg { color: var(--teal); }
.cy-nav svg { width: 14px; height: 14px; color: #68736e; }
.cy-nav span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

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

.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(--teal); font-weight: 850; }
.cy-sidebar-foot time { color: var(--muted); }

.cy-app-main { min-width: 0; }

.cy-command-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  min-width: 0;
  min-height: var(--cy-command);
  display: grid;
  grid-template-columns: minmax(180px, auto) minmax(260px, 540px) minmax(210px, auto);
  align-items: center;
  gap: 18px;
  padding: 9px 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(8, 8, 7, .96);
  backdrop-filter: blur(12px);
}

.cy-page-title { min-width: 0; display: grid; gap: 2px; }
.cy-page-title strong {
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-size: 16px;
  line-height: 1.1;
  font-weight: 700;
}
.cy-page-title span { color: var(--muted); font-size: 9px; line-height: 1.25; }

.cy-command-search {
  min-width: 0;
  height: 36px;
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 42px;
  align-items: center;
  border: 1px solid #4a4233;
  border-radius: var(--cy-radius);
  background: #0b0b09;
  overflow: hidden;
}

.cy-command-search > span {
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
  text-align: center;
}

.cy-command-search input {
  min-width: 0;
  width: 100%;
  height: 100%;
  padding: 0 8px;
  border: 0;
  border-radius: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  text-transform: uppercase;
}

.cy-command-search button,
.cy-command-state button {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 0;
  color: var(--muted);
  background: transparent;
}

.cy-command-search button {
  width: 42px;
  height: 100%;
  border: 0;
  border-left: 1px solid #4a4233;
  background: #17140f;
}

.cy-command-search button:hover,
.cy-command-state button:hover { color: var(--teal); }
.cy-command-search svg,
.cy-command-state svg { width: 14px; height: 14px; }

.cy-command-state {
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

.cy-command-state small { color: #68736e; }
.cy-command-state button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: var(--cy-radius); }

.cy-live-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: var(--teal);
  box-shadow: 0 0 0 3px rgba(87, 214, 177, .12);
}

.cy-live-dot.degraded {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(233, 183, 90, .12);
}

.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-priority-banner {
  min-width: 0;
  height: 42px;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr) auto;
  align-items: center;
  gap: 0;
  border-bottom: 1px solid rgba(239, 116, 123, .45);
  background: #211316;
  color: #f5e9e7;
  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 rgba(239, 116, 123, .3);
  color: #ffb4b8;
  white-space: nowrap;
}

.cy-priority-label svg { width: 15px; height: 15px; color: #ef747b; }
.cy-priority-label strong { font-size: 11px; font-weight: 850; }
.cy-priority-label span { color: #d8898f; font-size: 9px; }

.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 38s 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 24px;
  border-right: 1px solid rgba(239, 116, 123, .2);
  color: #f5e9e7;
  text-decoration: none;
  font-size: 11px;
  white-space: nowrap;
}

.cy-priority-item:hover { color: #fff; background: rgba(255, 255, 255, .035); }
.cy-priority-item b { color: #fff; font-size: 13px; }
.cy-priority-item span { color: #d0aaa8; }
.cy-priority-item strong { color: #ff9da2; font-size: 12px; }
.cy-priority-item em { color: #e6c5a0; font-style: normal; }
.cy-priority-item small { max-width: 290px; overflow: hidden; text-overflow: ellipsis; color: #b99796; }

.cy-priority-actions {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 0 8px;
  border-left: 1px solid rgba(239, 116, 123, .3);
}

.cy-priority-actions button {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 0;
  background: transparent;
  color: #d9a9aa;
  cursor: pointer;
}

.cy-priority-actions button:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.cy-priority-actions svg { width: 14px; height: 14px; }

body.ciyuan-v2 .portal-panel-head > a {
  color: var(--teal);
  font-size: 10px;
  text-decoration: none;
}
body.ciyuan-v2 .portal-panel-head > a:hover { color: #fff; }

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

body.ciyuan-v2 input,
body.ciyuan-v2 select,
body.ciyuan-v2 button {
  border-color: var(--line);
  border-radius: var(--cy-radius);
  background: #0d1210;
  color: var(--text);
}

body.ciyuan-v2 button:hover { border-color: #3a4741; }
body.ciyuan-v2 .up { color: var(--positive) !important; }
body.ciyuan-v2 .down { color: var(--red) !important; }
body.ciyuan-v2 .warn-text { color: var(--amber) !important; }

/* Radar, signals, watchlist and settings */
body.ciyuan-v2 .portal-shell {
  width: auto;
  max-width: none;
  min-width: 0;
  margin: 0;
  padding: 16px 18px 28px;
  gap: 12px;
  align-content: start;
}

body.ciyuan-v2 .portal-hero {
  min-height: 86px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

body.ciyuan-v2 .portal-hero.compact-hero { min-height: 78px; }
body.ciyuan-v2 .portal-hero h1 { margin: 0 0 7px; font-size: 20px; line-height: 1.1; }
body.ciyuan-v2 .portal-hero p { max-width: 760px; color: var(--muted); font-size: 11px; line-height: 1.55; }

body.ciyuan-v2 .portal-action {
  height: 32px;
  padding: 0 12px;
  border: 1px solid #34423c;
  border-radius: var(--cy-radius);
  background: #17201c;
  color: var(--text);
  font-size: 10px;
}

body.ciyuan-v2 .portal-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 12px;
}

body.ciyuan-v2 .portal-grid > .signal-panel { grid-column: span 7; grid-row: auto; }
body.ciyuan-v2 .portal-grid > .event-panel { grid-column: span 5; }
body.ciyuan-v2 .portal-grid > .quality-panel { grid-column: 1 / -1; }

body.ciyuan-v2 .portal-panel,
body.ciyuan-v2 .signal-health-strip,
body.ciyuan-v2 .signal-toolbar,
body.ciyuan-v2 .signal-workspace,
body.ciyuan-v2 .twitter-health-strip,
body.ciyuan-v2 .twitter-toolbar,
body.ciyuan-v2 .twitter-workspace {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

body.ciyuan-v2 .portal-panel-head,
body.ciyuan-v2 .signal-insight-head,
body.ciyuan-v2 .twitter-section-head {
  min-height: 42px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line-soft);
}

body.ciyuan-v2 .portal-list,
body.ciyuan-v2 .portal-events,
body.ciyuan-v2 .quality-board,
body.ciyuan-v2 .settings-board,
body.ciyuan-v2 .watch-table { padding: 0; }

body.ciyuan-v2 .portal-signal,
body.ciyuan-v2 .portal-event,
body.ciyuan-v2 .quality-row,
body.ciyuan-v2 .setting-row {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

body.ciyuan-v2 .portal-signal:last-child,
body.ciyuan-v2 .portal-event:last-child,
body.ciyuan-v2 .quality-row:last-child,
body.ciyuan-v2 .setting-row:last-child { border-bottom: 0; }

body.ciyuan-v2 .portal-signal:hover,
body.ciyuan-v2 .portal-event:hover { background: rgba(87, 214, 177, .055); }

body.ciyuan-v2 .watch-layout,
body.ciyuan-v2 .settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, .65fr);
  grid-template-rows: none;
  gap: 12px;
}

body.ciyuan-v2 .watch-kpis {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}

body.ciyuan-v2 .watch-kpis > div {
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

body.ciyuan-v2 .watch-kpis > div:last-child { border-right: 0; }

body.ciyuan-v2 .watch-card {
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

body.ciyuan-v2[data-page="watchlist"] .watch-layout {
  grid-template-columns: minmax(0, 1fr) minmax(340px, 410px);
  align-items: start;
}

body.ciyuan-v2[data-page="watchlist"] .watch-table {
  max-height: none;
  overflow: visible;
}

body.ciyuan-v2[data-page="watchlist"] .watch-signal-panel {
  position: sticky;
  top: 12px;
  align-self: start;
}

body.ciyuan-v2[data-page="watchlist"] .watch-signal-panel .portal-list {
  max-height: calc(100vh - 110px);
  overflow: auto;
}

body.ciyuan-v2[data-page="watchlist"] .watch-card {
  padding: 14px 12px;
}

/* OI workbench */
body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app {
  min-width: 0;
  min-height: calc(100vh - var(--cy-command));
  display: grid;
  grid-template-columns: minmax(0, 1fr) 312px;
  grid-template-rows: auto auto;
  gap: 12px;
  align-items: start;
  padding: 12px 16px 28px;
  overflow: visible;
}

body.ciyuan-v2[data-page="oi"] .news-sidebar {
  position: static;
  grid-column: 1 / -1;
  grid-row: 1;
  width: auto;
  height: 72px;
  min-height: 0;
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  grid-template-rows: 72px;
  gap: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  overflow: hidden;
}

body.ciyuan-v2[data-page="oi"] .news-search-row {
  display: none !important;
}

body.ciyuan-v2[data-page="oi"] .news-search-row input { height: 28px; }

body.ciyuan-v2[data-page="oi"] .news-head {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 9px 11px;
  border: 0;
}

body.ciyuan-v2[data-page="oi"] .news-head strong { font-size: 11px; white-space: nowrap; }
body.ciyuan-v2[data-page="oi"] .news-head span { font-size: 9px; text-align: left; }

body.ciyuan-v2[data-page="oi"] .event-radar-strip {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden;
  border-left: 1px solid var(--line);
}

body.ciyuan-v2[data-page="oi"] .event-strip-card {
  width: 330px;
  min-width: 330px;
  min-height: 70px;
  height: 70px;
  display: grid;
  grid-template-rows: 18px minmax(28px, auto) 18px;
  gap: 3px;
  padding: 7px 9px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

body.ciyuan-v2[data-page="oi"] .event-strip-card:hover { background: rgba(87, 214, 177, .05); }
body.ciyuan-v2[data-page="oi"] .event-strip-card.long { border-left: 2px solid var(--teal); }
body.ciyuan-v2[data-page="oi"] .event-strip-card.short { border-left: 2px solid var(--red); }
body.ciyuan-v2[data-page="oi"] .event-strip-title { font-size: 10px; line-height: 1.35; max-height: 29px; overflow: hidden; }
body.ciyuan-v2[data-page="oi"] .event-strip-original { display: none; }
body.ciyuan-v2[data-page="oi"] .event-strip-metrics { grid-template-columns: 64px repeat(3, 1fr); font-size: 9px; }

body.ciyuan-v2[data-page="oi"] .main {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  overflow: visible;
}

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 > .chart-panel { order: 3; }
body.ciyuan-v2[data-page="oi"] .main > .oi-quality-panel { order: 4; }
body.ciyuan-v2[data-page="oi"] .main > .symbol-overview { order: 5; }
body.ciyuan-v2[data-page="oi"] .main > .table-panel { order: 6; }

body.ciyuan-v2[data-page="oi"] .exchange-tabs {
  height: 44px;
  flex: 0 0 44px;
  gap: 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}

body.ciyuan-v2[data-page="oi"] .exchange-tabs button {
  min-width: 104px;
  height: 34px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-radius: 0;
}

body.ciyuan-v2[data-page="oi"] .exchange-tabs button.active {
  color: var(--text);
  background: #17201c;
  box-shadow: inset 0 -2px 0 var(--teal);
}

body.ciyuan-v2[data-page="oi"] .contract-strip {
  height: 78px;
  flex: 0 0 78px;
  grid-template-columns: minmax(190px, 1.3fr) repeat(6, minmax(92px, .78fr));
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
}

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"] .contract-stat.big strong { font-size: 18px; }
body.ciyuan-v2[data-page="oi"] .contract-stat strong { font-size: 15px; }

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"] .symbol-overview,
body.ciyuan-v2[data-page="oi"] .oi-quality-panel,
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 {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

body.ciyuan-v2[data-page="oi"] .chart-panel {
  height: 594px;
  min-height: 594px;
  display: grid;
  grid-template-rows: auto auto minmax(400px, 1fr) 34px;
}

body.ciyuan-v2[data-page="oi"] .chart-toolbar {
  min-height: 44px;
  height: auto;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 7px 10px;
  border-bottom-color: var(--line-soft);
}

body.ciyuan-v2[data-page="oi"] .tool-tabs,
body.ciyuan-v2[data-page="oi"] .oi-metric-tabs {
  border: 1px solid var(--line);
  border-radius: var(--cy-radius);
  overflow: hidden;
}

body.ciyuan-v2[data-page="oi"] .tool-tabs { display: flex; gap: 0; }
body.ciyuan-v2[data-page="oi"] .tool-tabs button,
body.ciyuan-v2[data-page="oi"] .oi-metric-tabs button {
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
}

body.ciyuan-v2[data-page="oi"] .tool-tabs button:last-child,
body.ciyuan-v2[data-page="oi"] .oi-metric-tabs button:last-child { border-right: 0; }

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: #07100c;
  background: var(--teal);
  box-shadow: none;
}

body.ciyuan-v2[data-page="oi"] .legend { margin-left: auto; font-size: 9px; }

body.ciyuan-v2[data-page="oi"] .oi-range-summary {
  min-height: 68px;
  grid-template-columns: 170px minmax(0, 1fr);
  border-bottom-color: var(--line-soft);
  background: #0c110f;
}

body.ciyuan-v2[data-page="oi"] .summary-title,
body.ciyuan-v2[data-page="oi"] .summary-kpis div { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="oi"] .chart-canvas-wrap { background: #0b0f0d; }
body.ciyuan-v2[data-page="oi"] #chart { min-height: 400px; }

body.ciyuan-v2[data-page="oi"] .range-buttons {
  border-top-color: var(--line-soft);
  background: #0c110f;
}

body.ciyuan-v2[data-page="oi"] .oi-quality-panel { min-height: 64px; }
body.ciyuan-v2[data-page="oi"] .quality-cell { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="oi"] .symbol-overview {
  min-height: 112px;
  border-radius: 0;
}

body.ciyuan-v2[data-page="oi"] .overview-head,
body.ciyuan-v2[data-page="oi"] .overview-kpis,
body.ciyuan-v2[data-page="oi"] .overview-kpis div { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="oi"] .overview-exchange {
  border-color: var(--line-soft);
  border-radius: 0;
  background: #0c110f;
}

body.ciyuan-v2[data-page="oi"] .table-panel {
  min-height: 430px;
  grid-template-rows: 42px minmax(380px, auto);
}

body.ciyuan-v2[data-page="oi"] .table-panel .panel-head,
body.ciyuan-v2[data-page="oi"] th,
body.ciyuan-v2[data-page="oi"] td { border-color: var(--line-soft); }
body.ciyuan-v2[data-page="oi"] thead { background: #0c110f; }

body.ciyuan-v2[data-page="oi"] .rightbar {
  position: sticky;
  top: calc(var(--cy-command) + 12px);
  grid-column: 2;
  grid-row: 2;
  width: auto;
  height: calc(100vh - var(--cy-command) - 24px);
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
}

body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel {
  order: -4;
  min-height: 360px;
  flex: 0 0 auto;
  grid-template-rows: 42px minmax(150px, 1fr) 26px auto;
}

body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel .panel-head { height: 42px; }
body.ciyuan-v2[data-page="oi"] .rightbar .alerts { max-height: 230px; }

body.ciyuan-v2[data-page="oi"] .rightbar .live-tape-panel {
  order: -3;
  min-height: 180px;
  max-height: 220px;
  flex: 0 0 200px;
  grid-template-rows: 38px minmax(0, 1fr);
}

body.ciyuan-v2[data-page="oi"] .rightbar .tape-head {
  padding: 8px 10px;
  border-bottom-color: var(--line-soft);
}

body.ciyuan-v2[data-page="oi"] .rightbar .tape-head span { display: block; }
body.ciyuan-v2[data-page="oi"] .rightbar .live-tape { padding: 0; }
body.ciyuan-v2[data-page="oi"] .rightbar .tape-item {
  height: 38px;
  padding: 0 9px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-radius: 0;
  background: transparent;
}

body.ciyuan-v2[data-page="oi"] .rightbar .watch-custom-head,
body.ciyuan-v2[data-page="oi"] .rightbar .side-head,
body.ciyuan-v2[data-page="oi"] .rightbar .status-title {
  flex: 0 0 auto;
  min-height: 34px;
  margin: 0;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 0;
  background: #0c110f;
}

body.ciyuan-v2[data-page="oi"] .rightbar .observe-list { min-height: 72px; max-height: 142px; margin: -10px 0 0; }
body.ciyuan-v2[data-page="oi"] .rightbar .candidate-list { min-height: 84px; max-height: 190px; margin-top: -10px; }
body.ciyuan-v2[data-page="oi"] .rightbar .watchlist { min-height: 100px; max-height: 230px; margin-top: -10px; }
body.ciyuan-v2[data-page="oi"] .rightbar .exchange-status { min-height: 100px; max-height: 180px; margin-top: -10px; }

body.ciyuan-v2[data-page="oi"] .rightbar .observe-item,
body.ciyuan-v2[data-page="oi"] .rightbar .candidate-item,
body.ciyuan-v2[data-page="oi"] .rightbar .watch-item,
body.ciyuan-v2[data-page="oi"] .rightbar .status-row,
body.ciyuan-v2[data-page="oi"] .rightbar .alert { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="oi"] .anomaly-card {
  border-color: var(--line-soft);
  border-radius: 0;
  background: #0c110f;
}

body.ciyuan-v2[data-page="oi"] .anomaly-card.warn,
body.ciyuan-v2[data-page="oi"] .anomaly-card.critical { background: #0c110f; }

body.ciyuan-v2[data-page="oi"] .detail-drawer {
  top: var(--cy-command);
  height: calc(100vh - var(--cy-command));
  border-color: var(--line);
  background: #0b0f0d;
}

/* Live signals */
body.ciyuan-v2[data-page="signals"] .signals-shell { align-content: start; }

body.ciyuan-v2[data-page="signals"] .signal-health-strip,
body.ciyuan-v2[data-page="twitter"] .twitter-health-strip {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.ciyuan-v2[data-page="signals"] .signal-health-strip > div,
body.ciyuan-v2[data-page="twitter"] .twitter-health-strip > div {
  min-height: 72px;
  padding: 10px 14px;
  border-right: 1px solid var(--line-soft);
}

body.ciyuan-v2[data-page="signals"] .signal-health-strip > div:last-child,
body.ciyuan-v2[data-page="twitter"] .twitter-health-strip > div:last-child { border-right: 0; }

body.ciyuan-v2[data-page="signals"] .signal-depth-coverage {
  min-width: 0;
  display: flex;
  gap: 0;
  border: 1px solid var(--line-soft);
  background: #0b100e;
  overflow-x: auto;
  scrollbar-width: thin;
}

body.ciyuan-v2[data-page="signals"] .signal-depth-coverage > div {
  min-width: 142px;
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  gap: 3px 8px;
  padding: 8px 11px;
  border-right: 1px solid var(--line-soft);
}

body.ciyuan-v2[data-page="signals"] .signal-depth-coverage strong { font-size: 11px; }
body.ciyuan-v2[data-page="signals"] .signal-depth-coverage span { font-size: 10px; }
body.ciyuan-v2[data-page="signals"] .signal-depth-coverage small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 9px;
  white-space: nowrap;
}

body.ciyuan-v2[data-page="signals"] .signal-toolbar,
body.ciyuan-v2[data-page="twitter"] .twitter-toolbar {
  min-height: 48px;
  padding: 8px;
}

body.ciyuan-v2[data-page="signals"] .signal-segments,
body.ciyuan-v2[data-page="twitter"] .twitter-segments {
  border-color: var(--line);
  border-radius: var(--cy-radius);
  background: #0c110f;
}

body.ciyuan-v2[data-page="signals"] .signal-segments button,
body.ciyuan-v2[data-page="twitter"] .twitter-segments button {
  border-color: var(--line);
  background: transparent;
}

body.ciyuan-v2[data-page="signals"] .signal-segments button.active,
body.ciyuan-v2[data-page="twitter"] .twitter-segments button.active {
  color: #07100c;
  background: var(--teal);
}

body.ciyuan-v2[data-page="signals"] .signal-workspace {
  grid-template-columns: minmax(0, 1fr) 304px;
  overflow: hidden;
}

body.ciyuan-v2[data-page="signals"] .signal-feed { max-height: none; min-height: 540px; overflow: visible; }
body.ciyuan-v2[data-page="signals"] .signal-insights { border-left-color: var(--line-soft); background: #0c110f; }
body.ciyuan-v2[data-page="signals"] .signal-insights > section + section { border-color: var(--line-soft); }
body.ciyuan-v2[data-page="signals"] .signal-column-head,
body.ciyuan-v2[data-page="signals"] .market-signal-row { border-color: var(--line-soft); }
body.ciyuan-v2[data-page="signals"] .market-signal-row:hover { background: rgba(87, 214, 177, .05); }

/* X monitor */
body.ciyuan-v2[data-page="twitter"] .twitter-shell { align-content: start; }
body.ciyuan-v2[data-page="twitter"] .twitter-workspace {
  grid-template-columns: minmax(0, 1fr) 330px;
  overflow: hidden;
}

body.ciyuan-v2[data-page="twitter"] .twitter-watch-region {
  border-left: 1px solid var(--line-soft);
  background: #0c110f;
}

body.ciyuan-v2[data-page="twitter"] .twitter-event,
body.ciyuan-v2[data-page="twitter"] .twitter-watch-row,
body.ciyuan-v2[data-page="twitter"] .twitter-admin-form,
body.ciyuan-v2[data-page="twitter"] .twitter-add-form { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="twitter"] .twitter-event:hover { background: rgba(87, 214, 177, .045); }
body.ciyuan-v2[data-page="twitter"] .twitter-event-rail span { border-radius: var(--cy-radius); background: #15211c; color: var(--teal); }
body.ciyuan-v2[data-page="twitter"] .twitter-media img { border-color: var(--line); border-radius: var(--cy-radius); }
body.ciyuan-v2[data-page="twitter"] .twitter-admin-form,
body.ciyuan-v2[data-page="twitter"] .twitter-add-form { background: #0a0f0d; }

/* Strategy workbench */
body.ciyuan-v2[data-page="strategy"] {
  --bg: #0a0d0c;
  --panel: #0f1412;
  --panel-2: #141a17;
  --panel-3: #111714;
  --line: #27302c;
  --line-soft: #1c2421;
  --text: #f0f4f2;
  --muted: #89958f;
  --teal: #57d6b1;
  --red: #ef747b;
  --amber: #e9b75a;
  --blue: #6da8ff;
}

body.ciyuan-v2[data-page="strategy"] .cy-page-stage > .strategy-top {
  position: static;
  min-width: 0;
  min-height: 50px;
  height: auto;
  display: flex;
  justify-content: flex-end;
  padding: 8px 16px 0;
  border: 0;
  background: transparent;
}

body.ciyuan-v2[data-page="strategy"] .strategy-top > .strategy-nav,
body.ciyuan-v2[data-page="strategy"] .strategy-top > .top-brand { display: none; }

body.ciyuan-v2[data-page="strategy"] .strategy-top .strategy-controls {
  width: 100%;
  min-width: 0;
  min-height: 42px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  background: var(--panel);
}

body.ciyuan-v2[data-page="strategy"] .strategy-controls > .global-search { display: none; }
body.ciyuan-v2[data-page="strategy"] .strategy-field { min-width: 104px; height: 32px; display: grid; grid-template-columns: auto minmax(64px, 1fr); grid-template-rows: 1fr; align-items: center; gap: 6px; }
body.ciyuan-v2[data-page="strategy"] .strategy-field > span { white-space: nowrap; }
body.ciyuan-v2[data-page="strategy"] .strategy-field select { height: 30px; border-radius: var(--cy-radius); background: #0c110f; }
body.ciyuan-v2[data-page="strategy"] .strategy-secondary-controls { display: flex; align-items: center; gap: 8px; }
body.ciyuan-v2[data-page="strategy"] .strategy-secondary-controls {
  position: static;
  top: auto;
  right: auto;
  z-index: auto;
  width: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}
body.ciyuan-v2[data-page="strategy"] .strategy-secondary-controls > button { width: 62px; height: 30px; margin: 0; }
body.ciyuan-v2[data-page="strategy"] .strategy-options-toggle { display: none; }

body.ciyuan-v2[data-page="strategy"] .strategy-workbench {
  width: auto;
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  padding: 12px 16px 28px;
}

body.ciyuan-v2[data-page="strategy"] .strategy-upper {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 12px;
}

body.ciyuan-v2[data-page="strategy"] .strategy-chart-panel,
body.ciyuan-v2[data-page="strategy"] .strategy-side section,
body.ciyuan-v2[data-page="strategy"] .strategy-replay-panel,
body.ciyuan-v2[data-page="strategy"] .strategy-backtest-panel {
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

body.ciyuan-v2[data-page="strategy"] .strategy-chart-panel {
  min-height: 664px;
  grid-template-rows: 58px auto minmax(548px, calc(100vh - 232px));
}

body.ciyuan-v2[data-page="strategy"] .strategy-head,
body.ciyuan-v2[data-page="strategy"] .strategy-chart-toolbar,
body.ciyuan-v2[data-page="strategy"] .strategy-subhead,
body.ciyuan-v2[data-page="strategy"] .strategy-replay-context,
body.ciyuan-v2[data-page="strategy"] .strategy-backtest-assumptions,
body.ciyuan-v2[data-page="strategy"] .strategy-backtest-kpis,
body.ciyuan-v2[data-page="strategy"] #strategyPathChart { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="strategy"] .strategy-chart-toolbar,
body.ciyuan-v2[data-page="strategy"] .backtest-table-head { background: #0c110f; }
body.ciyuan-v2[data-page="strategy"] .strategy-chart-wrap { background: #0b0f0d; }
body.ciyuan-v2[data-page="strategy"] .strategy-live { border-radius: var(--cy-radius); background: rgba(87, 214, 177, .05); }

body.ciyuan-v2[data-page="strategy"] .strategy-side {
  position: sticky;
  top: calc(var(--cy-command) + 12px);
  min-width: 0;
  align-self: start;
  display: grid;
  gap: 12px;
}

body.ciyuan-v2[data-page="strategy"] .strategy-side section { padding: 15px; }
body.ciyuan-v2[data-page="strategy"] .strategy-score,
body.ciyuan-v2[data-page="strategy"] .strategy-list div,
body.ciyuan-v2[data-page="strategy"] .strategy-oi-link { border-color: var(--line-soft); }

body.ciyuan-v2[data-page="strategy"] .strategy-analysis { gap: 12px; margin-top: 0; }
body.ciyuan-v2[data-page="strategy"] .strategy-signal-detail.buy { border-left-color: var(--teal); }
body.ciyuan-v2[data-page="strategy"] .strategy-signal-detail.sell { border-left-color: var(--red); }

body.ciyuan-v2[data-page="strategy"] .strategy-backtest-kpis div,
body.ciyuan-v2[data-page="strategy"] .replay-row,
body.ciyuan-v2[data-page="strategy"] .backtest-row { border-color: var(--line-soft); background: transparent; }

body.ciyuan-v2[data-page="strategy"] .strategy-backtest-kpis div { border-radius: 0; }
body.ciyuan-v2[data-page="strategy"] .replay-row:hover,
body.ciyuan-v2[data-page="strategy"] .backtest-row:hover { background: rgba(87, 214, 177, .035); }

/* Access gate */
body.ciyuan-v2 .access-gate { background: rgba(8, 11, 10, .92); }
body.ciyuan-v2 .access-box {
  border-color: var(--line);
  border-radius: var(--cy-radius);
  background: var(--panel);
  box-shadow: 0 22px 70px rgba(0, 0, 0, .45);
}

@media (max-width: 1320px) {
  :root { --cy-sidebar: 174px; }
  .cy-command-bar { grid-template-columns: minmax(150px, auto) minmax(240px, 1fr) auto; padding-inline: 16px; }
  .cy-command-state small { display: none; }

  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app {
    grid-template-columns: minmax(0, 1fr) 290px;
    padding-inline: 12px;
  }

  body.ciyuan-v2[data-page="oi"] .contract-strip {
    grid-template-columns: minmax(180px, 1.25fr) repeat(5, minmax(86px, .78fr));
  }

  body.ciyuan-v2[data-page="oi"] .contract-stat:last-child { display: none; }
  body.ciyuan-v2[data-page="strategy"] .strategy-upper { grid-template-columns: minmax(0, 1fr) 280px; }
}

@media (max-width: 1120px) {
  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: 2; }
  body.ciyuan-v2[data-page="oi"] .rightbar {
    position: static;
    grid-column: 1;
    grid-row: 3;
    height: auto;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
    overflow: visible;
  }

  body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel,
  body.ciyuan-v2[data-page="oi"] .rightbar .live-tape-panel { min-height: 330px; max-height: 330px; flex: none; }
  body.ciyuan-v2[data-page="oi"] .rightbar .watch-custom-head,
  body.ciyuan-v2[data-page="oi"] .rightbar .side-head,
  body.ciyuan-v2[data-page="oi"] .rightbar .status-title,
  body.ciyuan-v2[data-page="oi"] .rightbar .observe-list,
  body.ciyuan-v2[data-page="oi"] .rightbar .candidate-list,
  body.ciyuan-v2[data-page="oi"] .rightbar .watchlist,
  body.ciyuan-v2[data-page="oi"] .rightbar .exchange-status { display: none; }

  body.ciyuan-v2[data-page="signals"] .signal-workspace,
  body.ciyuan-v2[data-page="twitter"] .twitter-workspace { grid-template-columns: minmax(0, 1fr); }
  body.ciyuan-v2[data-page="signals"] .signal-insights,
  body.ciyuan-v2[data-page="twitter"] .twitter-watch-region { border-left: 0; border-top: 1px solid var(--line-soft); }

  body.ciyuan-v2[data-page="strategy"] .strategy-upper { grid-template-columns: minmax(0, 1fr); }
  body.ciyuan-v2[data-page="strategy"] .strategy-side { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .cy-app-shell { display: block; }

  .cy-priority-banner {
    height: 38px;
    grid-template-columns: 118px minmax(0, 1fr) auto;
  }
  .cy-priority-label { padding: 0 9px; gap: 5px; }
  .cy-priority-label strong { font-size: 10px; }
  .cy-priority-label span { display: none; }
  .cy-priority-item { gap: 6px; padding: 0 16px; font-size: 10px; }
  .cy-priority-item small { max-width: 180px; }
  .cy-priority-actions { padding: 0 4px; }

  .cy-sidebar {
    position: sticky;
    top: 0;
    width: 100%;
    height: auto;
    padding: 8px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cy-brand { min-height: 38px; padding: 0 2px 8px; }
  .cy-brand-mark { width: 28px; height: 28px; flex-basis: 28px; }
  .cy-brand-copy strong { font-size: 15px; }
  .cy-nav { display: flex; gap: 4px; padding-top: 7px; overflow-x: auto; scrollbar-width: none; }
  .cy-nav a { min-width: 84px; height: 31px; grid-template-columns: 18px auto; padding: 0 7px; font-size: 9px; }
  .cy-nav svg { width: 12px; height: 12px; }
  .cy-sidebar-foot { display: none; }

  .cy-command-bar {
    position: sticky;
    top: 86px;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 52px;
    padding: 8px 12px;
  }

  .cy-page-title { display: none; }
  .cy-command-search { height: 34px; }
  .cy-command-state > span:not(.cy-live-dot),
  .cy-command-state > small { display: none; }

  body.ciyuan-v2 .portal-shell { padding: 10px 12px 24px; }
  body.ciyuan-v2 .portal-grid > .portal-panel { grid-column: 1 / -1 !important; }
  body.ciyuan-v2 .watch-layout,
  body.ciyuan-v2 .settings-layout { grid-template-columns: minmax(0, 1fr); }

  body.ciyuan-v2[data-page="watchlist"] .watch-signal-panel {
    position: static;
  }

  body.ciyuan-v2[data-page="watchlist"] .watch-signal-panel .portal-list {
    max-height: none;
    overflow: visible;
  }

  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app { padding: 10px 12px 24px; }
  body.ciyuan-v2[data-page="strategy"] .cy-page-stage > .strategy-top { padding: 8px 12px 0; }
  body.ciyuan-v2[data-page="strategy"] .strategy-workbench { padding: 10px 12px 24px; }
}

@media (max-width: 720px) {
  .cy-command-bar { top: 86px; }

  body.ciyuan-v2 .portal-hero {
    min-height: 74px;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 14px;
  }

  body.ciyuan-v2 .portal-hero h1 { font-size: 17px; }
  body.ciyuan-v2 .portal-hero p { font-size: 10px; }

  body.ciyuan-v2[data-page="watchlist"] .watch-kpis > div:nth-child(2) { border-right: 0; }
  body.ciyuan-v2[data-page="watchlist"] .watch-kpis > div:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  body.ciyuan-v2[data-page="watchlist"] .watch-card { padding-inline: 10px; }
  body.ciyuan-v2[data-page="watchlist"] .watch-card-actions { flex-wrap: wrap; }

  body.ciyuan-v2[data-page="oi"] .news-sidebar {
    height: 82px;
    grid-template-columns: 1fr;
    grid-template-rows: 82px;
  }

  body.ciyuan-v2[data-page="oi"] .news-head { display: none; }
  body.ciyuan-v2[data-page="oi"] .event-radar-strip { grid-column: 1; grid-row: 1; border-left: 0; }
  body.ciyuan-v2[data-page="oi"] .event-strip-card { min-width: 300px; width: 300px; }

  body.ciyuan-v2[data-page="oi"] .exchange-tabs { order: 2; }
  body.ciyuan-v2[data-page="oi"] .contract-strip {
    height: auto;
    min-height: 150px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.ciyuan-v2[data-page="oi"] .contract-main { grid-column: 1 / -1; min-height: 58px; border-right: 0; border-bottom: 1px solid var(--line-soft); }
  body.ciyuan-v2[data-page="oi"] .contract-stat { min-height: 54px; border-bottom: 1px solid var(--line-soft); }
  body.ciyuan-v2[data-page="oi"] .contract-stat:nth-child(n+5) { display: none; }

  body.ciyuan-v2[data-page="oi"] .chart-panel { height: 600px; min-height: 600px; grid-template-rows: auto auto minmax(390px, 1fr) auto; }
  body.ciyuan-v2[data-page="oi"] .chart-toolbar { align-items: flex-start; }
  body.ciyuan-v2[data-page="oi"] .legend { width: 100%; margin-left: 0; overflow-x: auto; }
  body.ciyuan-v2[data-page="oi"] .oi-range-summary { grid-template-columns: 1fr; }
  body.ciyuan-v2[data-page="oi"] .summary-title { display: none; }
  body.ciyuan-v2[data-page="oi"] .summary-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ciyuan-v2[data-page="oi"] .summary-kpis div:nth-child(n+5) { display: none; }
  body.ciyuan-v2[data-page="oi"] .range-buttons .hint { display: none; }
  body.ciyuan-v2[data-page="oi"] .range-buttons #status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  body.ciyuan-v2[data-page="oi"] .oi-quality-panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ciyuan-v2[data-page="oi"] .quality-cell:nth-child(2) { border-right: 0; }
  body.ciyuan-v2[data-page="oi"] .quality-cell:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  body.ciyuan-v2[data-page="oi"] .symbol-overview { grid-template-columns: 1fr; grid-template-rows: auto auto auto; }
  body.ciyuan-v2[data-page="oi"] .overview-head { border-right: 0; }
  body.ciyuan-v2[data-page="oi"] .overview-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ciyuan-v2[data-page="oi"] .overview-kpis div:nth-child(n+5) { display: none; }

  body.ciyuan-v2[data-page="oi"] .rightbar { grid-template-columns: minmax(0, 1fr); }
  body.ciyuan-v2[data-page="oi"] .rightbar .alerts-panel,
  body.ciyuan-v2[data-page="oi"] .rightbar .live-tape-panel { min-height: 340px; max-height: none; }

  body.ciyuan-v2[data-page="signals"] .signal-health-strip,
  body.ciyuan-v2[data-page="twitter"] .twitter-health-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ciyuan-v2[data-page="signals"] .signal-toolbar,
  body.ciyuan-v2[data-page="twitter"] .twitter-toolbar { grid-template-columns: minmax(0, 1fr) 76px; }
  body.ciyuan-v2[data-page="signals"] .signal-segments,
  body.ciyuan-v2[data-page="twitter"] .twitter-segments { grid-column: 1 / -1; }

  body.ciyuan-v2[data-page="strategy"] .strategy-top .strategy-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ciyuan-v2[data-page="strategy"] .strategy-field { width: 100%; }
  body.ciyuan-v2[data-page="strategy"] .strategy-secondary-controls { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) 62px; }
  body.ciyuan-v2[data-page="strategy"] .strategy-chart-panel { min-height: 620px; grid-template-rows: auto auto 500px; }
  body.ciyuan-v2[data-page="strategy"] .strategy-side { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 480px) {
  .cy-priority-banner { grid-template-columns: 106px minmax(0, 1fr) 34px; }
  .cy-priority-label { padding: 0 7px; }
  .cy-priority-label strong { font-size: 9px; }
  .cy-priority-item { padding: 0 12px; }
  .cy-priority-item span,
  .cy-priority-item em,
  .cy-priority-item small { display: none; }
  .cy-priority-actions button:first-child { display: none; }

  .cy-nav { overflow-x: visible; }
  .cy-nav a { min-width: 0; flex: 1 1 0; grid-template-columns: 14px minmax(0, 1fr); gap: 5px; padding-inline: 5px; }
  .cy-nav a span { overflow: visible; font-size: 0; text-overflow: clip; }
  .cy-nav a span::after { content: attr(data-short-label); font-size: 9px; }
  .cy-command-search { grid-template-columns: 44px minmax(0, 1fr) 38px; }
  .cy-command-search button { width: 38px; }
  .cy-command-state { gap: 6px; }

  body.ciyuan-v2 .portal-shell,
  body.ciyuan-v2[data-page="oi"] .cy-page-stage > .app,
  body.ciyuan-v2[data-page="strategy"] .strategy-workbench { padding-inline: 8px; }

  body.ciyuan-v2[data-page="signals"] .signal-health-strip,
  body.ciyuan-v2[data-page="twitter"] .twitter-health-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  body.ciyuan-v2[data-page="signals"] .signal-health-strip > div,
  body.ciyuan-v2[data-page="twitter"] .twitter-health-strip > div { min-height: 64px; border-bottom: 1px solid var(--line-soft); }
  body.ciyuan-v2[data-page="signals"] .signal-health-strip > div:nth-child(2n),
  body.ciyuan-v2[data-page="twitter"] .twitter-health-strip > div:nth-child(2n) { border-right: 0; }

  body.ciyuan-v2[data-page="oi"] .chart-panel { height: 580px; min-height: 580px; }
  body.ciyuan-v2[data-page="oi"] .chart-select-group { width: calc(50% - 4px); grid-template-columns: auto minmax(0, 1fr); }
  body.ciyuan-v2[data-page="oi"] .chart-select-group select { min-width: 0; width: 100%; }
  body.ciyuan-v2[data-page="oi"] .anomaly-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

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

/* Speculative system: one evidence model, two execution paths. */
.spec-system {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 10px;
  padding: 18px 20px 42px;
}

.spec-system-head {
  min-width: 0;
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  background: #0d1210;
}
.spec-system-head > div:first-child { min-width: 0; }
.spec-system-head h1 { margin: 0; font-size: 22px; line-height: 1.15; letter-spacing: 0; }
.spec-system-head p { margin: 6px 0 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.spec-system-state { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 9px; white-space: nowrap; }
.spec-system-state button,
.spec-detail-actions button {
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: var(--cy-radius);
  background: #111815;
  color: var(--text);
  cursor: pointer;
}
.spec-system-state button { width: 32px; padding: 0; }
.spec-system-state button:hover,
.spec-detail-actions button:not(:disabled):hover { color: var(--teal); border-color: rgba(87, 214, 177, .5); }
.spec-system-state svg,
.spec-detail-actions svg { width: 13px; height: 13px; }

.spec-notices { min-width: 0; display: grid; gap: 5px; }
.spec-notice {
  min-width: 0;
  min-height: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border: 1px solid rgba(233, 183, 90, .22);
  background: rgba(233, 183, 90, .045);
  color: #d9bb83;
  font-size: 9px;
  line-height: 1.4;
}
.spec-notice.ok { border-color: rgba(87, 214, 177, .2); background: rgba(87, 214, 177, .04); color: #9edcc9; }
.spec-notice svg { width: 13px; height: 13px; flex: 0 0 13px; }
.spec-notice span { min-width: 0; }

.spec-path-nav {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #0b100e;
}
.spec-path-nav button {
  min-width: 0;
  min-height: 64px;
  display: grid;
  grid-template-columns: 25px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  text-align: left;
  cursor: pointer;
}
.spec-path-nav button:last-child { border-right: 0; }
.spec-path-nav button:hover { background: rgba(87, 214, 177, .035); color: var(--text); }
.spec-path-nav button.active { border-bottom-color: var(--teal); background: rgba(87, 214, 177, .075); color: var(--text); }
.spec-path-nav button > svg { width: 16px; height: 16px; color: #65716b; }
.spec-path-nav button.active > svg { color: var(--teal); }
.spec-path-nav button > span { min-width: 0; display: grid; gap: 3px; }
.spec-path-nav strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; }
.spec-path-nav small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-path-nav b { color: var(--text); font-size: 17px; }

.spec-kpis {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: var(--panel);
}
.spec-kpis > button {
  min-width: 0;
  min-height: 66px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  gap: 4px 10px;
  padding: 10px 13px;
  border: 0;
  border-right: 1px solid var(--line-soft);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.spec-kpis > button:last-child { border-right: 0; }
.spec-kpis > button:hover { background: rgba(87, 214, 177, .04); }
.spec-kpis > button:focus-visible { outline: 1px solid var(--teal); outline-offset: -2px; }
.spec-kpis > button.active { background: rgba(87, 214, 177, .105); box-shadow: inset 0 -2px var(--teal); }
.spec-kpis > button.active span,
.spec-kpis > button.active small { color: var(--teal); }
.spec-kpis span { color: var(--muted); font-size: 9px; }
.spec-kpis strong { grid-column: 2; grid-row: 1 / 3; align-self: center; font-size: 24px; line-height: 1; }
.spec-kpis small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }

.spec-toolbar {
  min-width: 0;
  min-height: 46px;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  align-items: center;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  background: #0d1210;
}
.spec-search {
  min-width: 0;
  height: 32px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  border: 1px solid var(--line);
  background: #080d0b;
}
.spec-search svg { width: 13px; height: 13px; margin: auto; color: #647069; }
.spec-search input { min-width: 0; width: 100%; height: 30px; padding: 0 8px 0 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 10px; }
.spec-sort { height: 32px; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; border: 1px solid var(--line); background: #080d0b; }
.spec-sort span { padding-left: 9px; color: var(--muted); font-size: 9px; }
.spec-sort select { min-width: 0; height: 30px; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 9px; }
.spec-toolbar > span { color: var(--muted); font-size: 9px; white-space: nowrap; }

.spec-list-panel,
.spec-detail-panel {
  min-width: 0;
  border: 1px solid var(--line);
  background: var(--panel);
  overflow: hidden;
}
.spec-panel-head {
  min-width: 0;
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  background: #0d1210;
}
.spec-panel-head > div:first-child { min-width: 0; display: grid; gap: 3px; }
.spec-panel-head strong { font-size: 11px; }
.spec-panel-head span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-panel-head > b { color: var(--muted); font-size: 11px; }
.spec-list-head,
.spec-candidate {
  min-width: 0;
  display: grid;
  grid-template-columns: 34px minmax(145px, .8fr) 170px minmax(112px, .7fr) minmax(220px, 1.35fr) minmax(112px, .62fr);
  gap: 9px;
}
.spec-list-head {
  align-items: center;
  min-height: 29px;
  padding: 0 12px;
  border-bottom: 1px solid var(--line-soft);
  color: #68736e;
  font-size: 8px;
}
.spec-candidate {
  width: 100%;
  min-height: 91px;
  align-items: center;
  padding: 10px 12px 8px;
  border: 0;
  border-bottom: 1px solid var(--line-soft);
  border-left: 3px solid transparent;
  background: transparent;
  color: var(--text);
  text-align: left;
  white-space: normal;
  cursor: pointer;
}
.spec-candidate:last-child { border-bottom: 0; }
.spec-candidate:hover { background: rgba(87, 214, 177, .035); }
.spec-candidate.selected { border-left-color: var(--teal); background: rgba(87, 214, 177, .075); }
.spec-candidate.stage-ambush { border-left-color: rgba(109, 168, 255, .7); }
.spec-candidate.stage-momentum { border-left-color: rgba(233, 183, 90, .75); }
.spec-candidate.stage-tracking { border-left-color: rgba(87, 214, 177, .62); }
.spec-candidate.stage-risk { border-left-color: rgba(239, 93, 99, .78); }
.spec-rank { align-self: start; padding-top: 3px; color: #59645f; font-size: 10px; font-weight: 800; }
.spec-object { min-width: 0; display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 4px 7px; }
.spec-object strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.spec-object em { width: max-content; max-width: 100%; padding: 2px 4px; border: 1px solid var(--line); color: var(--muted); font-size: 8px; font-style: normal; white-space: nowrap; }
.stage-ambush .spec-object em { border-color: rgba(109, 168, 255, .35); color: #91bcff; }
.stage-momentum .spec-object em { border-color: rgba(233, 183, 90, .4); color: var(--amber); }
.stage-tracking .spec-object em { border-color: rgba(87, 214, 177, .35); color: var(--teal); }
.stage-risk .spec-object em { border-color: rgba(239, 93, 99, .4); color: var(--red); }
.spec-object small { grid-column: 1 / -1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-dual-score { min-width: 0; display: grid; gap: 8px; }
.spec-score { min-width: 0; display: grid; gap: 3px; }
.spec-score > span { display: flex; justify-content: space-between; gap: 6px; color: var(--muted); font-size: 8px; }
.spec-score b { color: var(--text); font-size: 9px; }
.spec-score > i { height: 3px; overflow: hidden; background: #202824; }
.spec-score > i > em { height: 100%; display: block; background: var(--blue); }
.spec-score.momentum > i > em { background: var(--amber); }
.spec-structure,
.spec-path,
.spec-quality { min-width: 0; display: grid; align-content: center; gap: 5px; }
.spec-structure b,
.spec-path b,
.spec-quality b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 10px; font-weight: 800; }
.spec-structure small,
.spec-path small,
.spec-quality small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-path b i { font-style: normal; }
.spec-row-note {
  min-width: 0;
  grid-column: 2 / -1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #7f8b85;
  font-size: 8px;
}
.spec-candidate.watch-only .spec-missing { grid-column: 3; color: var(--muted); font-size: 9px; line-height: 1.45; }

.spec-coverage-strip {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line);
  background: #0b100e;
}
.spec-coverage-strip > div { min-width: 0; min-height: 58px; display: grid; align-content: center; gap: 3px; padding: 8px 11px; border-right: 1px solid var(--line-soft); }
.spec-coverage-strip > div:last-child { border-right: 0; }
.spec-coverage-strip span,
.spec-coverage-strip small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-coverage-strip strong { font-size: 10px; }

.spec-detail-head { min-height: 52px; }
.spec-detail-actions { display: flex; gap: 5px; }
.spec-detail-actions button { font-size: 9px; }
.spec-detail-actions button:disabled { opacity: .4; cursor: not-allowed; }
.spec-detail-actions button:nth-child(2) { border-color: rgba(87, 214, 177, .35); color: var(--teal); }
.spec-detail-content { min-width: 0; padding: 10px; }
.spec-detail-summary { min-width: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--line-soft); background: #090e0c; }
.spec-detail-summary > div { min-width: 0; min-height: 66px; display: grid; align-content: center; gap: 4px; padding: 8px 10px; border-right: 1px solid var(--line-soft); }
.spec-detail-summary > div:last-child { border-right: 0; }
.spec-detail-summary span,
.spec-detail-summary small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-detail-summary strong { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.spec-detail-primary { min-width: 0; display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(285px, .65fr); border: 1px solid var(--line-soft); border-top: 0; }
.spec-chart-box { min-width: 0; border-right: 1px solid var(--line-soft); background: #080d0b; }
.spec-chart-box > header,
.spec-detail-lower > section > header,
.spec-onchain > header,
.spec-exchanges > header {
  min-width: 0;
  min-height: 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
}
.spec-chart-box > header > div { min-width: 0; display: grid; gap: 2px; }
.spec-chart-box header strong,
.spec-detail-lower header strong,
.spec-onchain header strong,
.spec-exchanges header strong { font-size: 10px; }
.spec-chart-box header span,
.spec-detail-lower header span,
.spec-onchain header span,
.spec-exchanges header span { color: var(--muted); font-size: 8px; }
.spec-period-tabs { display: flex; gap: 2px; }
.spec-period-tabs button { height: 24px; min-width: 34px; padding: 0 6px; border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 8px; cursor: pointer; }
.spec-period-tabs button.active { border-color: rgba(87, 214, 177, .45); background: rgba(87, 214, 177, .09); color: var(--teal); }
.spec-chart { position: relative; min-width: 0; padding: 8px 10px 9px; }
.spec-chart svg { width: 100%; height: auto; min-height: 245px; display: block; overflow: visible; }
.spec-chart svg text { fill: #65716b; font-size: 8px; }
.spec-chart-grid { stroke: #1a221f; stroke-width: 1; }
.spec-chart-price,
.spec-chart-oi { fill: none; stroke-width: 2; vector-effect: non-scaling-stroke; }
.spec-chart-price { stroke: var(--amber); }
.spec-chart-oi { stroke: var(--teal); }
.spec-chart-marker { stroke: rgba(239, 116, 123, .7); stroke-width: 1; stroke-dasharray: 3 4; }
.spec-chart-hit { fill: transparent; pointer-events: all; cursor: crosshair; }
.spec-chart-crosshair { stroke: #d7e0db; stroke-width: 1; stroke-dasharray: 2 3; pointer-events: none; }
.spec-chart-dot { stroke: #07100c; stroke-width: 2; pointer-events: none; }
.spec-chart-dot.price { fill: var(--amber); }
.spec-chart-dot.oi { fill: var(--teal); }
.spec-chart-readout { min-height: 18px; padding: 4px 7px; border: 1px solid var(--line-soft); background: #0c1210; color: #b7c2bd; font-size: 8px; }
.spec-chart-axis { position: relative; height: 17px; color: var(--muted); font-size: 8px; }
.spec-chart-axis span { position: absolute; transform: translateX(-50%); }
.spec-chart-legend { display: flex; justify-content: flex-end; gap: 12px; color: var(--muted); font-size: 8px; }
.spec-chart-legend span::before { content: ""; display: inline-block; width: 11px; height: 2px; margin: 0 4px 2px 0; background: currentColor; }
.spec-chart-legend .price { color: var(--amber); }
.spec-chart-legend .oi { color: var(--teal); }
.spec-chart-legend .event { color: var(--red); }
.spec-chart-legend .event::before { width: 1px; height: 9px; margin-bottom: -2px; }
.spec-chart-empty { min-height: 250px; display: grid; place-items: center; padding: 18px; color: var(--muted); font-size: 10px; text-align: center; }

.spec-decision { min-width: 0; background: #0b110f; }
.spec-decision > header { min-width: 0; min-height: 53px; display: grid; align-content: center; gap: 5px; padding: 9px 11px; border-bottom: 1px solid var(--line-soft); }
.spec-decision > header em { width: max-content; padding: 2px 5px; border: 1px solid var(--line); color: var(--muted); font-size: 8px; font-style: normal; }
.spec-decision > header em.ambush { border-color: rgba(109, 168, 255, .4); color: #91bcff; }
.spec-decision > header em.momentum { border-color: rgba(233, 183, 90, .45); color: var(--amber); }
.spec-decision > header em.tracking { border-color: rgba(87, 214, 177, .4); color: var(--teal); }
.spec-decision > header strong { font-size: 9px; line-height: 1.45; }
.spec-detail-scores { display: grid; gap: 10px; padding: 10px 11px; border-bottom: 1px solid var(--line-soft); }
.spec-decision > section { padding: 8px 11px; border-bottom: 1px solid var(--line-soft); }
.spec-decision > section:last-child { border-bottom: 0; }
.spec-decision h3 { margin: 0 0 6px; color: var(--muted); font-size: 8px; font-weight: 800; }
.spec-decision ul { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.spec-decision li { position: relative; padding-left: 10px; color: #b9c5bf; font-size: 8px; line-height: 1.45; }
.spec-decision li::before { content: ""; position: absolute; top: 5px; left: 0; width: 4px; height: 4px; background: var(--teal); }
.spec-decision .counter li { color: #d6b77b; }
.spec-decision .counter li::before { background: var(--amber); }
.spec-decision li.muted { color: var(--muted); }

.spec-onchain { min-width: 0; border: 1px solid var(--line-soft); border-top: 0; background: #090f0c; }
.spec-onchain.evidence-ok { box-shadow: inset 3px 0 #57d6b1; }
.spec-onchain.evidence-pending { box-shadow: inset 3px 0 #e9b75a; }
.spec-onchain.evidence-bad { box-shadow: inset 3px 0 #ef747b; }
.spec-chain-coverage { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.spec-chain-coverage > div { min-width: 0; min-height: 54px; display: grid; align-content: center; gap: 3px; padding: 8px 10px; border-right: 1px solid var(--line-soft); }
.spec-chain-coverage > div:last-child { border-right: 0; }
.spec-chain-coverage span,
.spec-chain-coverage small { color: var(--muted); font-size: 9px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-chain-coverage b { font-size: 11px; }
.spec-flow { min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line-soft); }
.spec-flow > div { min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 38px; padding: 7px 10px; border-right: 1px solid var(--line-soft); }
.spec-flow > div:last-child { border-right: 0; }
.spec-flow span { color: var(--muted); font-size: 8px; }
.spec-flow b { font-size: 10px; }
.spec-onchain > p { margin: 0; padding: 8px 10px; border-bottom: 1px solid var(--line-soft); color: #c3a96f; font-size: 8px; line-height: 1.45; }
.spec-chain-facts { max-height: 150px; overflow: auto; }
.spec-chain-facts > div { min-width: 0; min-height: 34px; display: grid; grid-template-columns: 105px minmax(0, 1fr) auto; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.spec-chain-facts > div:last-child { border-bottom: 0; }
.spec-chain-facts time { color: var(--muted); }
.spec-chain-facts span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spec-chain-facts a { color: var(--teal); text-decoration: none; }
.spec-onchain > footer { min-height: 38px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 7px 10px; border-top: 1px solid var(--line-soft); color: var(--muted); font-size: 9px; }
.spec-onchain > footer a { color: var(--teal); text-decoration: none; white-space: nowrap; }
.spec-evidence-gaps { border-top: 1px solid var(--line-soft); padding: 7px 10px; color: #d6b77b; font-size: 9px; }
.spec-evidence-gaps summary { cursor: pointer; }
.spec-evidence-gaps ul { margin: 7px 0 0; padding-left: 18px; }
.spec-methodology { min-width: 0; border: 1px solid var(--line-soft); border-top: 0; background: #0b100e; }
.spec-methodology > header { min-height: 40px; display: flex; align-items: center; justify-content: space-between; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); }
.spec-methodology > header strong { font-size: 10px; }
.spec-methodology > header span { color: var(--muted); font-size: 9px; }
.spec-methodology > div { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spec-methodology > div > div { min-width: 0; min-height: 58px; display: grid; align-content: center; gap: 3px; padding: 8px 10px; border-right: 1px solid var(--line-soft); }
.spec-methodology > div > div:last-child { border-right: 0; }
.spec-methodology span,
.spec-methodology small { color: var(--muted); font-size: 9px; }
.spec-methodology b { font-size: 11px; }
.spec-methodology > p { margin: 0; padding: 8px 10px; border-top: 1px solid var(--line-soft); color: #b9c5bf; font-size: 9px; line-height: 1.5; }

.spec-detail-lower { min-width: 0; display: grid; grid-template-columns: 1fr 1fr; border: 1px solid var(--line-soft); border-top: 0; }
.spec-detail-lower > section { min-width: 0; }
.spec-detail-lower > section:first-child { border-right: 1px solid var(--line-soft); }
.spec-window-table > div { min-width: 0; min-height: 38px; display: grid; grid-template-columns: 38px 90px 90px minmax(0, 1fr); align-items: center; gap: 7px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.spec-window-table > div:last-child { border-bottom: 0; }
.spec-window-table small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.spec-timeline { max-height: 150px; overflow: auto; }
.spec-timeline > div { min-width: 0; min-height: 36px; display: grid; grid-template-columns: 105px minmax(90px, .7fr) minmax(0, 1fr); align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.spec-timeline time,
.spec-timeline span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); }
.spec-exchanges { min-width: 0; border: 1px solid var(--line-soft); border-top: 0; }
.spec-exchanges > div > div { min-width: 0; min-height: 43px; display: grid; grid-template-columns: minmax(105px, .9fr) minmax(95px, .8fr) 1fr 1fr 1fr; align-items: center; gap: 8px; padding: 7px 10px; border-bottom: 1px solid var(--line-soft); font-size: 8px; }
.spec-exchanges > div > div:last-child { border-bottom: 0; }
.spec-exchanges strong,
.spec-exchanges span { min-width: 0; display: grid; gap: 3px; }
.spec-exchanges small { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-size: 8px; }
.spec-empty { min-height: 150px; display: grid; align-content: center; justify-items: center; gap: 5px; padding: 18px; color: var(--muted); text-align: center; }
.spec-empty strong { color: var(--text); font-size: 10px; }
.spec-empty span { max-width: 360px; font-size: 8px; line-height: 1.5; }
.spec-empty.small { min-height: 72px; }
.muted { color: var(--muted) !important; }

@media (max-width: 1180px) {
  .spec-list-head,
  .spec-candidate { grid-template-columns: 30px minmax(135px, .9fr) 155px minmax(200px, 1.35fr) minmax(105px, .65fr); }
  .spec-list-head span:nth-child(4),
  .spec-candidate .spec-structure { display: none; }
  .spec-row-note { grid-column: 2 / -1; }
  .spec-detail-summary { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec-detail-summary > div:nth-child(3) { border-right: 0; }
  .spec-detail-summary > div:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .spec-detail-summary > div:last-child { grid-column: 1 / -1; border-top: 1px solid var(--line-soft); }
}

@media (max-width: 900px) {
  .spec-system { padding: 10px 12px 30px; }
  .spec-path-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-path-nav button:nth-child(2) { border-right: 0; }
  .spec-path-nav button:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .spec-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-kpis > button:nth-child(2) { border-right: 0; }
  .spec-kpis > button:nth-child(-n+2) { border-bottom: 1px solid var(--line-soft); }
  .spec-toolbar { grid-template-columns: minmax(0, 1fr) 170px; }
  .spec-toolbar > span { grid-column: 1 / -1; }
  .spec-detail-primary { grid-template-columns: 1fr; }
  .spec-chart-box { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .spec-coverage-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .spec-coverage-strip > div:nth-child(3) { border-right: 0; }
  .spec-coverage-strip > div:nth-child(-n+3) { border-bottom: 1px solid var(--line-soft); }
  .spec-detail-lower { grid-template-columns: 1fr; }
  .spec-detail-lower > section:first-child { border-right: 0; border-bottom: 1px solid var(--line-soft); }
}

@media (max-width: 680px) {
  .spec-system { padding-inline: 8px; gap: 8px; }
  .spec-system-head { min-height: 82px; align-items: flex-start; flex-direction: column; gap: 9px; padding: 11px; }
  .spec-system-head h1 { font-size: 19px; }
  .spec-system-state { width: 100%; justify-content: space-between; gap: 7px; }
  .spec-path-nav button { min-height: 57px; grid-template-columns: 20px minmax(0, 1fr) auto; gap: 6px; padding: 7px 8px; }
  .spec-path-nav small { display: none; }
  .spec-kpis > button { min-height: 60px; padding: 8px 10px; }
  .spec-kpis strong { font-size: 20px; }
  .spec-toolbar { grid-template-columns: minmax(0, 1fr) 122px; }
  .spec-sort { grid-template-columns: minmax(0, 1fr); }
  .spec-sort > span { display: none; }
  .spec-toolbar > span { display: none; }
  .spec-list-head { display: none; }
  .spec-candidate {
    min-height: 137px;
    grid-template-columns: 28px minmax(0, 1fr) minmax(105px, .8fr);
    grid-template-rows: 41px 45px 25px;
    gap: 5px 8px;
    padding: 9px 8px 7px;
  }
  .spec-rank { grid-column: 1; grid-row: 1; }
  .spec-object { grid-column: 2; grid-row: 1; }
  .spec-dual-score { grid-column: 3; grid-row: 1 / 3; }
  .spec-path { grid-column: 2; grid-row: 2; }
  .spec-quality { grid-column: 1 / 3; grid-row: 3; display: flex; align-items: center; gap: 7px; }
  .spec-quality small { flex: 1; }
  .spec-row-note { grid-column: 3; grid-row: 3; align-self: center; }
  .spec-candidate.watch-only .spec-missing { grid-column: 3; grid-row: 1 / 3; }
  .spec-coverage-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-coverage-strip > div:nth-child(3) { border-right: 1px solid var(--line-soft); }
  .spec-coverage-strip > div:nth-child(2n) { border-right: 0; }
  .spec-coverage-strip > div:nth-child(-n+4) { border-bottom: 1px solid var(--line-soft); }
  .spec-coverage-strip > div:last-child { grid-column: 1 / -1; }
  .spec-detail-head { align-items: flex-start; flex-direction: column; }
  .spec-detail-actions { width: 100%; }
  .spec-detail-actions button { flex: 1; min-width: 0; padding: 0 5px; }
  .spec-detail-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-detail-summary > div { min-height: 58px; }
  .spec-detail-summary > div:nth-child(3) { border-right: 1px solid var(--line-soft); }
  .spec-detail-summary > div:nth-child(2n) { border-right: 0; }
  .spec-detail-summary > div:nth-child(-n+4) { border-bottom: 1px solid var(--line-soft); }
  .spec-chart-box > header { align-items: flex-start; flex-direction: column; }
  .spec-chart { padding-inline: 4px; }
  .spec-chart svg { min-height: 210px; }
  .spec-flow { grid-template-columns: 1fr; }
  .spec-chain-coverage { grid-template-columns: 1fr; }
  .spec-chain-coverage > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .spec-chain-coverage > div:last-child { border-bottom: 0; }
  .spec-flow > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .spec-flow > div:last-child { border-bottom: 0; }
  .spec-chain-facts > div,
  .spec-timeline > div { grid-template-columns: 84px minmax(0, 1fr); }
  .spec-chain-facts a { grid-column: 2; }
  .spec-timeline span { grid-column: 2; }
  .spec-window-table > div { grid-template-columns: 34px 1fr 1fr; }
  .spec-window-table small { grid-column: 2 / -1; }
  .spec-exchanges > div > div { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spec-exchanges > div > div > span:last-child { grid-column: 1 / -1; }
  .spec-methodology > div { grid-template-columns: 1fr; }
  .spec-methodology > div > div { border-right: 0; border-bottom: 1px solid var(--line-soft); }
  .spec-methodology > div > div:last-child { border-bottom: 0; }
}

/* Ciyuan atelier palette: quiet black, ivory typography and restrained metal accents. */
body.ciyuan-v2 .spec-system-head h1,
body.ciyuan-v2 .spec-panel-head strong,
body.ciyuan-v2 .portal-hero h1,
body.ciyuan-v2 .oi-workspace h1 {
  font-family: "Songti SC", STSong, "Noto Serif CJK SC", serif;
  font-weight: 700;
}

body.ciyuan-v2 .spec-path-nav button:hover,
body.ciyuan-v2 .spec-kpis > button:hover {
  background: rgba(200, 168, 102, .035);
}

body.ciyuan-v2 .spec-path-nav button.active,
body.ciyuan-v2 .spec-kpis > button.active,
body.ciyuan-v2 .spec-candidate.selected {
  background: rgba(200, 168, 102, .075);
}

body.ciyuan-v2 .spec-system-head,
body.ciyuan-v2 .spec-list-panel,
body.ciyuan-v2 .spec-detail-panel,
body.ciyuan-v2 .spec-toolbar,
body.ciyuan-v2 .spec-coverage-strip,
body.ciyuan-v2 .spec-path-nav,
body.ciyuan-v2 .spec-kpis {
  box-shadow: none;
}

body.ciyuan-v2 button,
body.ciyuan-v2 select,
body.ciyuan-v2 input {
  border-radius: 3px;
}

body.ciyuan-v2 ::selection {
  color: #080807;
  background: #c8a866;
}
