:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --surface: #ffffff;
  --surface-muted: #eef3f8;
  --text: #142033;
  --muted: #657386;
  --line: #dde5ee;
  --accent: #1f6f8b;
  --accent-strong: #16546b;
  --ok: #1f7a46;
  --warn: #9d6008;
  --bad: #b42318;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", "Microsoft YaHei", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  cursor: pointer;
}

button.secondary {
  background: #fff;
  color: var(--accent);
}

button.secondary,
.button-link.secondary {
  background: #fff;
  color: var(--accent);
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  padding: 0 14px;
  text-decoration: none;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.workspace-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #102033;
  color: #c7d4e0;
  padding: 24px 18px;
}

.brand {
  display: grid;
  gap: 2px;
  margin-bottom: 28px;
}

.brand strong {
  color: #fff;
  font-size: 22px;
}

.brand span {
  color: #9eb0c4;
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-list a {
  display: flex;
  align-items: center;
  min-height: 38px;
  border-radius: 8px;
  padding: 0 14px;
  color: #c7d4e0;
  text-decoration: none;
  font-size: 14px;
}

.nav-list a[aria-current="page"] {
  background: #1f6f8b;
  color: #fff;
  font-weight: 700;
}

.app-shell {
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
}

.eyebrow,
.subtle,
.page-subtitle,
.stat-label,
.detail-item span,
.panel-heading p,
.row-sub {
  color: var(--muted);
  font-size: 12px;
}

.eyebrow {
  margin: 0 0 4px;
  font-weight: 700;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 30px;
  font-weight: 780;
}

h2 {
  font-size: 17px;
  font-weight: 760;
}

.page-subtitle {
  margin-top: 8px;
  font-size: 14px;
}

.toolbar,
.table-tools,
.pagination,
.action-group {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.segmented-control button {
  min-height: 34px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
}

.segmented-control button[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
}

.main-content,
.page-section {
  display: grid;
  gap: 14px;
}

.hidden {
  display: none !important;
}

.stat-grid {
  display: grid;
  gap: 14px;
}

.stat-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.stat-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.stat-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-copy-card strong {
  font-size: 16px !important;
  line-height: 1.5;
}

.summary-copy-card span {
  line-height: 1.55;
}

#marketSummaryEvidence .detail-item span {
  line-height: 1.6;
}

.two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.top-gap {
  margin-top: 14px;
}

.baimao-shell {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 128px);
}

.baimao-frame {
  width: 100%;
  min-height: calc(100vh - 220px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.company-analysis-shell {
  display: grid;
  gap: 14px;
  min-height: calc(100vh - 128px);
}

.company-analysis-status {
  min-height: 48px;
}

.company-analysis-summary {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.company-analysis-summary span {
  display: grid;
  gap: 6px;
  min-height: 96px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  color: var(--muted);
  padding: 14px;
  font-size: 12px;
}

.company-analysis-summary em {
  font-style: normal;
}

.company-analysis-summary b {
  color: var(--text);
  font-size: 30px;
  line-height: 1;
}

.company-analysis-summary small {
  color: var(--muted);
}

.company-analysis-tabs {
  display: block;
}

.company-analysis-strip-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.company-analysis-strip-heading {
  margin-bottom: 12px;
}

.company-analysis-strip-heading span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.company-analysis-layer-stage {
  overflow-x: auto;
  padding: 2px 2px 8px;
}

.company-analysis-layer-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(280px, 1fr));
  gap: 12px;
  min-width: 1480px;
}

.company-analysis-layer-card {
  --company-layer: #1f6f8b;
  --company-layer-soft: #eef7fb;
  display: grid;
  grid-template-rows: auto auto minmax(70px, auto) 96px 1fr;
  gap: 12px;
  min-height: 392px;
  border: 1px solid color-mix(in srgb, var(--company-layer) 34%, var(--line));
  border-radius: 8px;
  background: linear-gradient(180deg, var(--company-layer-soft) 0%, #fff 72%);
  padding: 14px;
}

.company-analysis-layer-card[aria-selected="true"] {
  outline: 2px solid var(--company-layer);
  outline-offset: 2px;
}

.company-analysis-layer-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.company-analysis-layer-card h3 {
  margin: 0;
  color: var(--company-layer);
  font-size: 19px;
  line-height: 1.22;
}

.company-analysis-layer-breakdown {
  color: #64748b;
  font-size: 11px;
  font-weight: 900;
}

.company-analysis-layer-count {
  min-height: 28px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--company-layer);
  padding: 0 10px;
  font-weight: 900;
  white-space: nowrap;
}

.company-analysis-layer-card p {
  margin: 0;
  color: #475569;
  font-size: 12px;
  line-height: 1.5;
}

.company-analysis-sub-tags,
.company-analysis-chip-cloud,
.company-analysis-detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.company-analysis-sub-tags {
  min-height: 96px;
  max-height: 96px;
  align-content: flex-start;
  overflow: hidden;
}

.company-analysis-sub-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid color-mix(in srgb, var(--company-layer) 28%, #dce6ef);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #334155;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.25;
}

.company-analysis-layer-card[data-company-analysis-layer="AI_L4_MODELS_RUNTIME"] .company-analysis-sub-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: 44px;
  gap: 8px;
}

.company-analysis-layer-card[data-company-analysis-layer="AI_L4_MODELS_RUNTIME"] .company-analysis-sub-tags span {
  display: flex;
  align-items: center;
  min-height: 44px;
  width: 100%;
  border-radius: 8px;
  padding: 7px 10px;
  background: #fff;
  white-space: normal;
  line-height: 1.25;
}

.company-analysis-chip-cloud {
  display: block;
  min-height: 74px;
  max-height: 92px;
  overflow: hidden;
  color: #94a3b8;
  line-height: 1.8;
}

.company-analysis-chip {
  position: relative;
  display: inline;
  appearance: none;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--company-layer);
  padding: 0;
  margin: 0;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.8;
  vertical-align: baseline;
  box-shadow: none;
}

.company-analysis-chip::after {
  content: ", ";
  color: #94a3b8;
  font-weight: 700;
}

.company-analysis-chip:last-child::after {
  content: "";
}

.company-analysis-chip.is-secondary-layer {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
  color: color-mix(in srgb, var(--company-layer) 72%, #475569);
}

.company-analysis-chip:hover,
.company-analysis-chip[aria-pressed="true"] {
  background: transparent;
  color: #0f172a;
  text-decoration: underline;
  transform: none;
}

.company-analysis-chip:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 0;
  bottom: calc(100% + 8px);
  z-index: 20;
  width: 360px;
  max-width: min(360px, 72vw);
  white-space: pre-wrap;
  border-radius: 8px;
  background: #0f172a;
  color: #fff;
  padding: 12px 14px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.26);
  transform: translateY(-2px);
}

.company-analysis-controls {
  display: grid;
  grid-template-columns: repeat(6, minmax(128px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.company-analysis-controls label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
}

.company-analysis-controls select,
.company-analysis-controls input {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.company-analysis-controls button {
  min-height: 36px;
}

.company-analysis-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
}

.company-analysis-board,
.company-analysis-inventory {
  display: grid;
  gap: 10px;
}

.company-analysis-inventory-layer {
  --company-layer: #1f6f8b;
  --company-layer-soft: #eef7fb;
  border: 1px solid color-mix(in srgb, var(--company-layer) 34%, var(--line));
  border-radius: 8px;
  background: var(--company-layer-soft);
  overflow: hidden;
}

.company-analysis-inventory-layer > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 14px;
  color: var(--company-layer);
  font-size: 17px;
  font-weight: 900;
}

.company-analysis-inventory-layer > summary::-webkit-details-marker,
.company-analysis-sublayer > summary::-webkit-details-marker {
  display: none;
}

.company-analysis-inventory-layer > summary span,
.company-analysis-sublayer > summary span {
  color: #64748b;
  font-size: 12px;
}

.company-analysis-sublayer {
  margin: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  overflow: hidden;
}

.company-analysis-sublayer > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid #e2e8f0;
  color: #334155;
  font-weight: 900;
}

.company-analysis-row {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 0;
  border: 0;
  border-bottom: 1px solid #edf2f7;
  border-radius: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 12px;
  text-align: left;
}

.company-analysis-row:hover,
.company-analysis-row[aria-pressed="true"] {
  background: #f8fbfd;
}

.company-analysis-row:last-child {
  border-bottom: 0;
}

.company-analysis-row-title {
  display: flex;
  gap: 8px;
  align-items: baseline;
  flex-wrap: wrap;
}

.company-analysis-row-title b {
  min-width: 82px;
  font-size: 14px;
}

.company-analysis-row-title span {
  color: var(--company-layer, var(--accent));
  font-size: 12px;
  font-weight: 900;
}

.company-analysis-row-title em,
.company-analysis-row small {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.company-analysis-row-cross {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.company-analysis-row.is-note {
  color: var(--muted);
}

.company-analysis-detail {
  position: sticky;
  top: 18px;
  display: grid;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
}

.company-analysis-detail h3 {
  margin: 0;
  font-size: 22px;
}

.company-analysis-detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafc;
  color: #34445a;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
}

.company-analysis-detail-meta span.is-ok {
  border-color: #b7e2ca;
  background: #eaf8f0;
  color: var(--ok);
}

.company-analysis-detail-meta span.is-primary-layer {
  border-color: #bfdbfe;
  background: #eff6ff;
  color: #1d4ed8;
}

.company-analysis-detail-meta span.is-cross-layer {
  border-color: #d8b4fe;
  background: #faf5ff;
  color: #7e22ce;
}

.company-analysis-detail-meta span.is-review {
  border-color: #f1b8b4;
  background: #fff1f0;
  color: var(--bad);
}

.company-analysis-detail dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.company-analysis-detail dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.company-analysis-detail dd {
  margin: 2px 0 0;
  color: #34445a;
  font-size: 13px;
  line-height: 1.55;
}

.company-analysis-gap {
  border-left: 3px solid var(--warn);
  background: #fff7ed;
  color: #7c4a03;
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.45;
}

.company-analysis-frame {
  width: 100%;
  min-height: calc(100vh - 360px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.company-analysis-version-tools {
  display: grid;
  gap: 8px;
}

.company-analysis-version-tools label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.company-analysis-version-tools select {
  min-height: 36px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 10px;
}

.stat-card,
.panel,
.panel-surface {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.stat-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 134px;
  padding: 18px;
}

.stat-card.compact {
  min-height: 110px;
}

.stat-card strong {
  font-size: 32px;
  line-height: 1.05;
}

.highlight-card {
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.panel {
  padding: 16px;
}

.panel-inner {
  padding: 0;
  border: 0;
  box-shadow: none;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 14px;
}

.panel-surface {
  padding: 16px;
}

.inline-stat-row {
  display: flex;
  align-items: stretch;
  gap: 14px;
  flex-wrap: wrap;
}

.inline-stat-card {
  min-width: 220px;
  max-width: 280px;
}

.control-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.control-field {
  display: grid;
  gap: 6px;
}

.control-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.control-field input,
.control-field select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

.factor-condition-list {
  display: grid;
  gap: 10px;
}

.condition-rule-section {
  display: grid;
  gap: 10px;
}

.condition-rule-section h3 {
  margin: 4px 0 0;
  font-size: 13px;
  font-weight: 760;
  color: var(--muted);
}

.factor-condition-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) 96px minmax(120px, 180px) 42px;
  gap: 10px;
  align-items: end;
}

.factor-condition-row button {
  min-width: 42px;
  padding: 0;
}

.card-breakdown,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.status-chip,
.pill,
.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.status-chip {
  background: var(--surface-muted);
  color: var(--muted);
}

.status-completed,
.status-passed {
  background: #e5f5eb;
  color: var(--ok);
}

.status-partial,
.status-warning {
  background: #fff4df;
  color: var(--warn);
}

.status-failed {
  background: #fde8e7;
  color: var(--bad);
}

.status-missing {
  background: #ecf0f4;
  color: #5c6777;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

#strategyListTable .detail-table {
  min-width: 1080px;
  table-layout: auto;
}

#strategyListTable td:last-child {
  min-width: 190px;
}

#strategyListTable .action-group {
  flex-wrap: nowrap;
}

#strategyListTable .action-group button {
  min-height: 34px;
  padding: 0 10px;
}

#strategyLabPage {
  --accent: #0f9fa6;
  --accent-strong: #08777f;
  --strategy-accent: #0f9fa6;
  --strategy-blue: #3d7edb;
  --strategy-warn: #f3a21a;
  --strategy-green: #16985f;
  --strategy-red: #e3514f;
  --strategy-ink: #152235;
  --strategy-muted: #6a7788;
  --strategy-line: #dfe8f0;
  --strategy-soft: #f8fbfd;
  --strategy-accent-soft: #ecfbfb;
  gap: 14px;
}

#strategyLabPage .panel,
#strategyLabPage .stat-card {
  border-color: var(--strategy-line);
  box-shadow: 0 8px 24px rgba(21, 34, 53, 0.07);
}

#strategyLabPage .panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

#strategyLabPage .panel::before,
#strategySummaryCards .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--strategy-accent);
}

#strategyLabPage > .panel:nth-of-type(2)::before,
#strategySummaryCards .stat-card:nth-child(2)::before {
  background: var(--strategy-blue);
}

#strategyLabPage > .panel:nth-of-type(3)::before,
#strategySummaryCards .stat-card:nth-child(3)::before {
  background: var(--strategy-warn);
}

#strategySummaryCards .stat-card {
  position: relative;
  min-height: 110px;
  padding: 18px 18px 16px 88px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}

#strategySummaryCards .stat-card::after {
  content: "";
  position: absolute;
  left: 28px;
  top: 32px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(15, 159, 166, 0.18);
  border-radius: 8px;
  background: var(--strategy-accent-soft);
  box-shadow: 0 0 0 14px rgba(15, 159, 166, 0.06);
}

#strategySummaryCards .stat-card:nth-child(2)::after {
  border-color: rgba(61, 126, 219, 0.18);
  background: #eef5ff;
  box-shadow: 0 0 0 14px rgba(61, 126, 219, 0.06);
}

#strategySummaryCards .stat-card:nth-child(3)::after {
  border-color: rgba(243, 162, 26, 0.22);
  background: #fff7e8;
  box-shadow: 0 0 0 14px rgba(243, 162, 26, 0.08);
}

#strategyLabPage .stat-card strong {
  color: var(--strategy-ink);
  font-size: 28px;
}

#strategyLabPage .panel-heading {
  align-items: center;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f6;
}

#strategyLabPage .panel-heading h2 {
  color: var(--strategy-ink);
}

#strategyLabPage .panel-heading p {
  max-width: 760px;
  line-height: 1.6;
}

#strategyLabPage .table-tools {
  gap: 8px;
}

#strategyLabPage input:focus,
#strategyLabPage select:focus {
  border-color: rgba(15, 159, 166, 0.65);
  box-shadow: 0 0 0 3px rgba(15, 159, 166, 0.12);
  outline: none;
}

#strategyLabPage #strategySearchInput {
  width: min(360px, 100%);
  background: #fbfdff;
}

#runHighOpenTBacktestButton {
  min-width: 106px;
  border-color: var(--strategy-accent);
  background: var(--strategy-accent);
  box-shadow: 0 8px 16px rgba(15, 159, 166, 0.18);
  font-weight: 760;
}

#addTuningFactorButton {
  border-color: #cce9eb;
  background: #f6fcfc;
  color: var(--strategy-accent-strong);
  font-weight: 760;
}

.strategy-module-label {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  margin: 0 0 12px;
  color: var(--strategy-ink);
}

.strategy-module-label > span {
  display: inline-grid;
  min-width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 6px;
  background: var(--strategy-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.strategy-module-label strong {
  font-size: 14px;
  font-weight: 800;
}

.strategy-module-label small {
  color: var(--strategy-muted);
  font-size: 12px;
}

#strategyListTable {
  padding: 0;
  border: 1px solid #edf2f6;
  border-radius: 8px;
  background: #fff;
}

#strategyListTable .strategy-module-label {
  margin: 12px 12px 2px;
}

#strategyLabPage .detail-table {
  min-width: 0;
  border: 1px solid var(--strategy-line);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
}

#strategyLabPage .detail-table th {
  border-top: 0;
  background: #f7fafc;
  color: #465568;
  font-size: 12px;
}

#strategyLabPage .detail-table td {
  color: var(--strategy-ink);
}

#strategyLabPage .detail-table tbody tr {
  transition: background 0.16s ease, box-shadow 0.16s ease;
}

#strategyLabPage .detail-table tbody tr:hover {
  background: #fbfdff;
}

#strategyLabPage .detail-table tbody tr.is-selected {
  background: #eefafa;
  box-shadow: inset 4px 0 0 var(--strategy-accent);
}

#strategyLabPage .return-row-positive {
  background: rgba(22, 152, 95, 0.025);
}

#strategyLabPage .return-row-negative {
  background: rgba(227, 81, 79, 0.025);
}

#quantMonitorPage {
  --accent: #0f9fa6;
  --accent-strong: #08777f;
  --quant-blue: #3d7edb;
  --quant-green: #16985f;
  --quant-warn: #f3a21a;
  gap: 14px;
}

#quantMonitorPage .panel {
  position: relative;
  overflow: hidden;
}

#quantMonitorPage .panel::before,
#quantMonitorPage .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--accent);
}

#quantMonitorStrategiesPanel::before {
  background: var(--quant-blue) !important;
}

#quantMonitorKlinePanel::before {
  background: var(--quant-green) !important;
}

#quantMonitorPage .stat-card {
  position: relative;
  min-height: 108px;
  padding: 16px;
  box-shadow: 0 8px 24px rgba(21, 34, 53, 0.07);
}

#quantMonitorPage .stat-card strong {
  font-size: 26px;
}

.quant-monitor-config-link,
.detail-link.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  border: 1px solid #cce9eb;
  border-radius: 6px;
  background: #f6fcfc;
  color: var(--accent-strong);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 760;
  text-decoration: none;
}

.quant-monitor-strategy-table,
.quant-monitor-kline-table {
  table-layout: fixed;
  min-width: 1080px;
}

.quant-monitor-strategy-table th:nth-child(1),
.quant-monitor-strategy-table td:nth-child(1) {
  width: 17%;
}

.quant-monitor-strategy-table th:nth-child(2),
.quant-monitor-strategy-table td:nth-child(2) {
  width: 9%;
}

.quant-monitor-strategy-table th:nth-child(4),
.quant-monitor-strategy-table td:nth-child(4) {
  width: 24%;
}

.quant-monitor-strategy-table th:nth-child(5),
.quant-monitor-strategy-table td:nth-child(5) {
  width: 9%;
}

.quant-monitor-strategy-table th:nth-child(8),
.quant-monitor-strategy-table td:nth-child(8) {
  width: 10%;
}

.quant-monitor-kline-table th:nth-child(1),
.quant-monitor-kline-table td:nth-child(1) {
  width: 12%;
}

.quant-monitor-kline-table th:nth-child(2),
.quant-monitor-kline-table td:nth-child(2) {
  width: 14%;
}

.quant-monitor-kline-table th:nth-child(7),
.quant-monitor-kline-table td:nth-child(7) {
  width: 12%;
}

.quant-monitor-kline-table th:nth-child(8),
.quant-monitor-kline-table td:nth-child(8) {
  width: 16%;
}

#strategyListTable .detail-table {
  min-width: 0;
  border-width: 0;
  border-top: 1px solid #edf2f6;
  border-radius: 0 0 8px 8px;
  table-layout: fixed;
  width: 100%;
}

#strategyListTable th:nth-child(1),
#strategyListTable td:nth-child(1) {
  width: 11%;
}

#strategyListTable th:nth-child(2),
#strategyListTable td:nth-child(2) {
  width: 15%;
}

#strategyListTable th:nth-child(3),
#strategyListTable td:nth-child(3) {
  width: 24%;
}

#strategyListTable th:nth-child(4),
#strategyListTable td:nth-child(4) {
  width: 8%;
}

#strategyListTable th:nth-child(5),
#strategyListTable td:nth-child(5) {
  width: 7%;
}

#strategyListTable th:nth-child(6),
#strategyListTable td:nth-child(6) {
  width: 10%;
}

#strategyListTable th:nth-child(7),
#strategyListTable td:nth-child(7) {
  width: 12%;
}

#strategyListTable th:nth-child(8),
#strategyListTable td:nth-child(8) {
  width: 13%;
  min-width: 0;
}

#strategyListTable .mono {
  color: var(--strategy-ink);
  font-weight: 760;
}

#strategyListTable tr.is-selected .mono,
#strategyListTable tr.is-selected strong {
  color: var(--strategy-accent-strong);
}

#strategyListTable .action-group button {
  min-height: 30px;
  border-radius: 6px;
  padding: 0 8px;
}

.strategy-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--strategy-muted);
  padding: 0 4px;
  font-size: 12px;
  font-weight: 760;
}

.strategy-toggle-button .toggle-knob {
  position: relative;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: #cfd8e3;
}

.strategy-toggle-button .toggle-knob::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(21, 34, 53, 0.22);
  transition: transform 0.16s ease;
}

.strategy-toggle-button.is-running {
  color: var(--strategy-accent-strong);
}

.strategy-toggle-button.is-running .toggle-knob {
  background: var(--strategy-accent);
}

.strategy-toggle-button.is-running .toggle-knob::after {
  transform: translateX(16px);
}

.danger-button {
  border-color: #ffd1d1 !important;
  background: #fff !important;
  color: var(--strategy-red) !important;
}

#strategyPagination {
  justify-content: flex-end;
  padding-right: 2px;
}

#strategyPagination button {
  min-width: 34px;
  padding: 0 10px;
}

#strategyLabPage .control-grid,
#strategyLabPage .control-grid + .control-field,
#strategyLabPage .factor-condition-list {
  border: 1px solid var(--strategy-line);
  border-radius: 8px;
  background: #fbfdff;
}

#strategyLabPage .control-grid {
  padding: 12px;
}

#strategyLabPage .control-grid + .control-field {
  padding: 12px;
}

#strategyLabPage .control-field span {
  color: #526174;
}

#strategyLabPage .control-field input,
#strategyLabPage .control-field select {
  border-color: #dce6ef;
  background: #fff;
}

#strategyLabPage .factor-condition-list {
  padding: 12px;
}

#strategyLabPage .condition-rule-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.9fr);
  gap: 14px;
}

.condition-rule-block {
  min-width: 0;
  border: 1px solid var(--strategy-line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.condition-rule-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.condition-rule-title strong {
  font-size: 13px;
}

.condition-rule-title span {
  border-radius: 999px;
  background: var(--strategy-accent-soft);
  color: var(--strategy-accent-strong);
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 760;
}

.buy-rule-block {
  background: linear-gradient(180deg, #ffffff 0%, #fbfcfd 100%);
}

.buy-rule-block .condition-rule-title span {
  background: #eef1f5;
  color: #687586;
}

.condition-rule-stack {
  display: grid;
  gap: 8px;
}

#strategyLabPage .factor-condition-row {
  display: grid;
  grid-template-columns: 32px minmax(150px, 1fr) 96px minmax(120px, 160px) 34px;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid #e5edf4;
  border-radius: 8px;
  background: #fff;
}

.factor-condition-row.is-locked {
  background: #f7f9fb;
}

.rule-index {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  align-self: center;
  border-radius: 6px;
  background: var(--strategy-accent-soft);
  color: var(--strategy-accent-strong);
  font-size: 11px;
  font-weight: 800;
}

.buy-condition-row .rule-index {
  background: #eef1f5;
  color: #6a7788;
}

.factor-remove-button {
  min-width: 34px;
  height: 36px;
  color: #8a97a7;
}

.condition-connector {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  margin-left: 12px;
  border-radius: 999px;
  background: #e9f7f7;
  color: var(--strategy-accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.strategy-run-region {
  padding: 12px;
  border: 1px solid var(--strategy-line);
  border-radius: 8px;
  background: #fff;
}

.strategy-run-region .strategy-module-label {
  margin-bottom: 8px;
}

.strategy-run-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 70px;
  border: 1px solid #cfe6ed;
  border-left: 4px solid var(--strategy-accent);
  border-radius: 8px;
  background: #f5fbfe;
  padding: 12px 14px;
  color: var(--strategy-ink);
}

.strategy-run-banner div {
  display: grid;
  gap: 4px;
}

.strategy-run-banner strong {
  font-size: 14px;
}

.strategy-run-banner span:not(.status-chip) {
  color: var(--strategy-muted);
  font-size: 12px;
  line-height: 1.5;
}

.strategy-run-dirty {
  border-color: #f4d9a7;
  border-left-color: var(--strategy-warn);
  background: #fffaf1;
}

.strategy-run-error {
  border-color: #f4c9c6;
  border-left-color: var(--strategy-red);
  background: #fff6f5;
}

.strategy-run-loading {
  border-left-color: var(--strategy-blue);
  background: #f4f8ff;
}

.strategy-module-flash {
  animation: strategyFlash 1.2s ease;
}

@keyframes strategyFlash {
  0% {
    box-shadow: 0 0 0 0 rgba(15, 159, 166, 0.24);
  }
  100% {
    box-shadow: 0 0 0 16px rgba(15, 159, 166, 0);
  }
}

#highOpenTSymbolTable,
#highOpenTBucketTable,
#highOpenTDailyTable {
  padding: 12px;
  border: 1px solid var(--strategy-line);
  border-radius: 8px;
  background: #fff;
}

#highOpenTEventTable:empty {
  display: none;
}

#highOpenTSymbolTable .strategy-symbol-table {
  min-width: 980px;
}

#highOpenTSymbolTable .strategy-symbol-table button {
  border-color: #d7e6ed;
  background: #fff;
  color: var(--strategy-ink);
  font-size: 12px;
  font-weight: 760;
}

#highOpenTSymbolTable .strategy-symbol-table tr.is-selected button {
  border-color: #bde5e7;
  background: #f3fcfc;
  color: var(--strategy-accent-strong);
}

#strategyLabPage #highOpenTSelectedSecurityChart {
  min-height: 92px;
  border-style: dashed;
  background: #fbfdff;
}

#strategyLabPage #highOpenTSelectedSecurityChart:empty {
  display: none;
}

#strategyLabPage #highOpenTSelectedSecurityChart .strategy-module-label {
  margin-bottom: 8px;
}

#strategyLabPage #highOpenTSelectedSecurityChart .chart-empty {
  min-height: 38px;
  padding: 8px 12px;
}

#highOpenTSummaryCards {
  padding: 0;
}

#highOpenTSummaryCards .strategy-module-label {
  margin-bottom: 0;
}

#highOpenTSummaryCards .stat-card {
  position: relative;
  min-height: 118px;
  overflow: hidden;
}

#highOpenTSummaryCards .stat-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--strategy-accent);
}

#highOpenTSummaryCards .stat-card:nth-of-type(3)::before,
#highOpenTSummaryCards .stat-card:nth-of-type(4)::before {
  background: var(--strategy-warn);
}

.strategy-trade-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 14px;
}

.strategy-table-panel {
  min-width: 0;
  border: 1px solid var(--strategy-line);
  border-radius: 8px;
  background: #fff;
  overflow: auto;
}

.strategy-table-title {
  padding: 11px 12px;
  border-bottom: 1px solid var(--strategy-line);
  background: #f7fafc;
  color: var(--strategy-ink);
  font-size: 13px;
  font-weight: 800;
}

.strategy-table-panel .detail-table {
  border: 0 !important;
  border-radius: 0 !important;
}

.return-positive {
  color: var(--strategy-green, var(--ok));
}

.return-negative {
  color: var(--strategy-red, var(--bad));
}

.return-muted {
  color: var(--strategy-muted, var(--muted));
}

.security-return-modal {
  border-color: #dbe7ef;
}

.security-return-modal::before {
  content: "";
  display: block;
  height: 3px;
  background: var(--strategy-accent, #0f9fa6);
}

.security-return-modal .modal-header {
  background: #fff;
}

.security-return-modal .modal-body {
  background: #fbfdff;
}

.security-return-modal .price-chart-wrap,
.security-return-modal .table-wrap,
.security-return-modal .modal-stat-grid .stat-card {
  background: #fff;
}

.security-return-modal .stat-card strong {
  font-size: 26px;
  overflow-wrap: anywhere;
}

.price-chart-wrap {
  width: 100%;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
  padding: 12px;
}

.kg-graph-wrap {
  width: 100%;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #fbfdff 0%, #f6f9fc 100%);
  padding: 12px;
}

.price-chart-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.chart-caption strong {
  color: var(--text);
  font-size: 14px;
}

.kg-graph-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-axis,
.chart-label {
  fill: var(--muted);
  color: var(--muted);
  font-size: 12px;
}

.kg-edge {
  stroke: #b7c6d8;
  stroke-width: 1.5;
  stroke-opacity: 0.9;
}

.kg-edge-label {
  fill: var(--muted);
  font-size: 11px;
}

.kg-node-circle {
  stroke: #ffffff;
  stroke-width: 2;
}

.kg-node-label {
  fill: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.kg-node-meta {
  fill: var(--muted);
  font-size: 10px;
}

#knowledgeGraphPage > .stat-grid,
#knowledgeGraphPage > .panel {
  display: none;
}

#knowledgeGraphPage {
  --accent: #0f9fa6;
  --accent-strong: #08777f;
  --kg-accent: #0f9fa6;
  --kg-blue: #3d7edb;
  --kg-warn: #f3a21a;
  --kg-green: #16985f;
  --kg-red: #e3514f;
  --kg-ink: #152235;
  --kg-muted: #6a7788;
  --kg-line: #dfe8f0;
  --kg-soft: #f8fbfd;
  --kg-accent-soft: #ecfbfb;
}

.kg-encyclopedia-shell {
  display: grid;
  gap: 14px;
}

.kg-topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.85fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--kg-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(21, 34, 53, 0.07);
}

.kg-topbar h2 {
  margin: 0 0 4px;
}

.kg-topbar p {
  margin: 0;
  color: var(--muted);
}

.kg-search-form,
.kg-filter-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.kg-filter-form {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  margin-bottom: 14px;
}

.kg-search-form input,
.kg-filter-form input,
.kg-filter-form select {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: inherit;
  background: #fff;
}

.kg-search-form button,
.kg-filter-form button {
  padding: 10px 14px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.kg-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 14px;
  align-items: start;
}

.kg-rail {
  display: none;
}

.kg-rail,
.kg-inspector,
.kg-panel {
  border: 1px solid var(--kg-line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(21, 34, 53, 0.07);
}

.kg-rail,
.kg-inspector {
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 0;
}

.kg-main-workspace {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.kg-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
}

.kg-panel::before,
.kg-inspector::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--kg-accent);
}

.kg-view-nav {
  display: grid;
  gap: 8px;
}

.kg-view-nav a {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
}

.kg-view-nav a.active {
  border-color: var(--accent);
  box-shadow: inset 4px 0 0 var(--accent);
  font-weight: 700;
}

.kg-rail-block,
.kg-search-results {
  display: grid;
  gap: 8px;
  margin-top: 16px;
}

.kg-mini-note {
  color: var(--muted);
  font-size: 12px;
}

.kg-result-list {
  display: grid;
  gap: 8px;
}

.kg-result-list a,
.kg-entity-card,
.kg-evidence-card {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
  color: var(--text);
}

.kg-result-list small,
.kg-entity-card p,
.kg-evidence-card p {
  margin: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.kg-definition-grid,
.kg-analysis-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.kg-card-meta,
.kg-evidence-title {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.kg-evidence-list {
  display: grid;
  gap: 10px;
}

.kg-candidate-edge {
  border-style: dashed;
  background: #fffaf0;
}

.kg-limit-panel {
  background: #fbfcfd;
}

.kg-limit-panel p {
  margin: 6px 0;
  color: var(--muted);
}

.kg-inspector-body {
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.kg-node-circle.kg-node-company {
  fill: #d9ecff;
  stroke: #2f6f8f;
}

.kg-node-circle.kg-node-theme {
  fill: #fff1cf;
  stroke: #b7791f;
}

.kg-node-circle.kg-node-business {
  fill: #def7e6;
  stroke: #3f7a4f;
}

.kg-edge.candidate {
  stroke-dasharray: 6 5;
  stroke: #c4a269;
  stroke-opacity: 0.72;
}

.kg-node-circle.kg-node-industry {
  fill: #eaf8f8;
  stroke: #0f9fa6;
}

.kg-company-hero {
  display: grid;
  gap: 16px;
}

.kg-company-title-row,
.kg-section-heading,
.kg-evidence-wall-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.kg-page-kicker {
  display: inline-flex;
  margin-bottom: 6px;
  color: var(--kg-accent-strong);
  font-size: 12px;
  font-weight: 800;
}

.kg-company-title-row h2 {
  font-size: 24px;
  color: var(--kg-ink);
}

.kg-company-title-row h2 span {
  color: var(--kg-muted);
  font-size: 15px;
  font-weight: 700;
}

.kg-company-title-row p,
.kg-section-heading p,
.kg-evidence-wall-heading p {
  margin-top: 6px;
  color: var(--kg-muted);
  font-size: 12px;
  line-height: 1.55;
}

.kg-company-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.kg-company-actions a,
.kg-evidence-source-button {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #cce9eb;
  border-radius: 6px;
  background: #f6fcfc;
  color: var(--kg-accent-strong);
  font-size: 12px;
  font-weight: 760;
  text-decoration: none;
}

.kg-company-summary-grid,
.kg-current-metric-strip,
.kg-segment-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.kg-summary-mini,
.kg-quote-metric,
.kg-segment-card,
.kg-chart-card,
.kg-financial-note-card {
  border: 1px solid #edf2f6;
  border-radius: 8px;
  background: #fff;
}

.kg-summary-mini,
.kg-quote-metric,
.kg-segment-card {
  display: grid;
  gap: 6px;
  min-height: 96px;
  padding: 14px;
}

.kg-summary-mini span,
.kg-quote-metric span,
.kg-segment-card span {
  color: var(--kg-muted);
  font-size: 12px;
  font-weight: 700;
}

.kg-summary-mini strong,
.kg-quote-metric strong,
.kg-segment-card strong {
  color: var(--kg-ink);
  font-size: 24px;
}

.kg-summary-mini small,
.kg-quote-metric small,
.kg-segment-card small {
  color: var(--kg-muted);
  font-size: 12px;
  line-height: 1.45;
}

.kg-company-tabs-panel {
  display: grid;
  gap: 14px;
}

.kg-company-tabs {
  display: inline-flex;
  width: fit-content;
  gap: 6px;
  padding: 4px;
  border: 1px solid var(--kg-line);
  border-radius: 8px;
  background: #f7fafc;
}

.kg-company-tab {
  min-height: 34px;
  border: 0;
  background: transparent;
  color: var(--kg-muted);
  font-weight: 760;
}

.kg-company-tab.active {
  background: var(--kg-accent);
  color: #fff;
  box-shadow: 0 6px 14px rgba(15, 159, 166, 0.18);
}

.kg-tab-content {
  display: grid;
  gap: 14px;
}

.kg-section-heading {
  padding-bottom: 10px;
  border-bottom: 1px solid #edf2f6;
}

.kg-chart-table-grid,
.kg-relations-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 12px;
  align-items: start;
}

.kg-chart-card,
.kg-financial-note-card {
  padding: 14px;
}

.kg-financial-note-card {
  display: grid;
  gap: 8px;
  background: #fbfdff;
}

.kg-financial-note-card p {
  color: var(--kg-muted);
  font-size: 12px;
  line-height: 1.6;
}

.kg-data-contract-list {
  display: grid;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid #edf2f6;
}

.kg-quality-warning {
  border-color: #f2d49b;
  background: #fff7e8;
  color: #8a5a00;
}

.kg-chart-empty {
  min-height: 260px;
  align-content: center;
}

.kg-financial-chart {
  width: 100%;
  min-height: 260px;
}

.kg-financial-bar {
  fill: rgba(15, 159, 166, 0.72);
}

.kg-financial-line {
  fill: none;
  stroke: var(--kg-warn);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.8;
}

.kg-financial-point {
  fill: var(--kg-warn);
  stroke: #fff;
  stroke-width: 2;
}

.kg-business-bars {
  display: grid;
  gap: 12px;
}

.kg-business-bar-row {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 40px;
  gap: 10px;
  align-items: center;
  color: var(--kg-ink);
  font-size: 12px;
}

.kg-business-bar-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef5;
}

.kg-business-bar {
  height: 100%;
  border-radius: inherit;
  background: var(--kg-accent);
}

.kg-segment-card {
  position: relative;
  overflow: hidden;
}

.kg-segment-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: var(--kg-accent);
}

.kg-segment-social::before {
  background: var(--kg-blue);
}

.kg-segment-fintech::before {
  background: var(--kg-green);
}

.kg-segment-cloud_ai::before {
  background: var(--kg-warn);
}

.kg-segment-card div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
}

.kg-segment-card p {
  color: var(--kg-muted);
  font-size: 12px;
}

.kg-relations-grid {
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
}

.kg-relations-grid > div {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.kg-relations-grid h3 {
  margin: 0;
  color: var(--kg-ink);
  font-size: 14px;
}

.kg-core-filings .detail-table,
.kg-company-tabs-panel .detail-table {
  border-color: var(--kg-line);
}

.kg-core-filings .detail-table th,
.kg-company-tabs-panel .detail-table th {
  background: #f7fafc;
  color: #465568;
}

.kg-search-strip .panel-heading {
  margin-bottom: 12px;
}

.kg-search-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.kg-search-result-grid a {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--kg-line);
  border-radius: 8px;
  background: #fff;
  color: var(--kg-ink);
  text-decoration: none;
}

.kg-search-result-grid small {
  color: var(--kg-muted);
}

.kg-evidence-wall {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 16px 12px 12px;
}

.kg-evidence-filter-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.kg-evidence-filter-row button {
  min-height: 30px;
  padding: 0 10px;
  border-color: #cce9eb;
  background: #f6fcfc;
  color: var(--kg-accent-strong);
  font-size: 12px;
  font-weight: 760;
}

.kg-evidence-filter-row button.active {
  border-color: var(--kg-accent);
  background: var(--kg-accent);
  color: #fff;
}

.kg-evidence-wall-list {
  display: grid;
  gap: 10px;
}

.kg-evidence-wall-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--kg-line);
  border-radius: 8px;
  background: #fff;
}

.kg-evidence-wall-card.selected {
  border-color: rgba(15, 159, 166, 0.75);
  box-shadow: 0 0 0 3px rgba(15, 159, 166, 0.12);
}

.kg-evidence-wall-card strong {
  color: var(--kg-ink);
  font-size: 14px;
}

.kg-evidence-wall-card p {
  color: var(--kg-muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.kg-evidence-card-top,
.kg-evidence-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.kg-evidence-card-top {
  justify-content: space-between;
}

.kg-evidence-meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  color: var(--kg-muted);
  font-size: 11px;
}

.kg-evidence-card-actions {
  justify-content: space-between;
}

.kg-selected-evidence-inline {
  display: grid;
  gap: 6px;
  padding: 8px;
  border-radius: 6px;
  background: #f7fafc;
}

@media (max-width: 1100px) {
  .kg-topbar,
  .kg-workbench,
  .kg-filter-form,
  .kg-company-summary-grid,
  .kg-current-metric-strip,
  .kg-segment-grid,
  .kg-chart-table-grid,
  .kg-relations-grid,
  .kg-search-result-grid {
    grid-template-columns: 1fr;
  }

  .kg-rail,
  .kg-inspector {
    position: static;
  }

  .kg-definition-grid,
  .kg-analysis-grid {
    grid-template-columns: 1fr;
  }
}

.chart-grid-line,
.chart-axis-line {
  stroke: #d7e1eb;
  stroke-width: 1;
}

.chart-zero-line {
  stroke: #8a98a8;
  stroke-width: 1;
  stroke-dasharray: 5 5;
}

.chart-price-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.chart-area {
  fill: rgba(31, 111, 139, 0.08);
}

.chart-point {
  stroke: #ffffff;
  stroke-width: 1.5;
}

.chart-point.positive {
  fill: #1b8f63;
}

.chart-point.negative {
  fill: #c45b4f;
}

.event-marker-line {
  stroke: #9fb0bf;
  stroke-width: 1;
  stroke-dasharray: 3 5;
  opacity: 0.58;
}

.event-return-label {
  fill: var(--text);
  font-size: 11px;
  font-weight: 760;
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
}

.security-chart-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.chart-empty {
  min-height: 300px;
}

table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-size: 13px;
}

.detail-table {
  min-width: 0;
  table-layout: fixed;
}

.detail-table th,
.detail-table td {
  overflow-wrap: anywhere;
}

th,
td {
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  white-space: nowrap;
}

.company-link {
  display: block;
  color: var(--text);
  font-weight: 780;
  text-decoration: none;
}

.company-link:hover,
.action-group a:hover,
.detail-link:hover {
  text-decoration: underline;
}

.row-sub {
  display: block;
  margin-top: 2px;
  line-height: 1.45;
}

.action-group {
  flex-wrap: nowrap;
  white-space: nowrap;
}

.action-group a {
  color: var(--accent);
  text-decoration: none;
  font-size: 12px;
  font-weight: 760;
}

.action-group .active-action {
  border-radius: 999px;
  background: #e5f5eb;
  color: var(--ok);
  padding: 4px 9px;
}

.action-group .danger-link {
  color: var(--bad);
}

.tag {
  background: #e6f1f5;
  color: var(--accent-strong);
}

.info-banner {
  border: 1px solid #cfe3ec;
  border-radius: 8px;
  background: #f5fbfe;
  color: var(--accent-strong);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.42);
  padding: 24px;
}

.modal-panel {
  width: min(1120px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 22px 70px rgba(15, 23, 42, 0.28);
}

.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin-top: 2px;
}

.modal-body {
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding: 18px 20px 20px;
}

.security-return-modal .price-chart-wrap {
  box-shadow: none;
}

.modal-stat-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.return-positive {
  color: var(--ok);
}

.return-negative {
  color: var(--bad);
}

.empty-card {
  display: grid;
  place-items: center;
  min-height: 240px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: #fbfdff;
  padding: 16px;
  text-align: center;
}

.contributor-list,
.limitation-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.contributor-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7fafc;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text);
  white-space: nowrap;
}

.market-theme-table-wrap table {
  min-width: 1260px;
  table-layout: auto;
}

.market-theme-table-wrap th,
.market-theme-table-wrap td {
  vertical-align: top;
}

.market-theme-table-wrap td:nth-child(1) {
  min-width: 200px;
}

.market-theme-table-wrap td:nth-child(2) {
  min-width: 110px;
}

.market-theme-table-wrap td:nth-child(3),
.market-theme-table-wrap td:nth-child(4),
.market-theme-table-wrap td:nth-child(5),
.market-theme-table-wrap td:nth-child(6) {
  min-width: 96px;
  white-space: nowrap;
}

.market-theme-table-wrap td:nth-child(7) {
  min-width: 120px;
  white-space: nowrap;
}

.market-theme-table-wrap td:nth-child(8) {
  min-width: 280px;
}

.market-theme-table-wrap td:nth-child(9) {
  min-width: 88px;
  white-space: nowrap;
}

.market-theme-table-wrap .contributor-list {
  gap: 6px;
}

.market-theme-table-wrap .contributor-chip {
  align-items: flex-start;
  white-space: normal;
  line-height: 1.45;
}

.limitation-list .tag {
  white-space: normal;
  line-height: 1.45;
}

.detail-view,
.detail-list {
  display: grid;
  gap: 10px;
}

.detail-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.detail-header h2 {
  margin-bottom: 4px;
  font-size: 22px;
}

.detail-item {
  display: grid;
  gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.detail-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.detail-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.muted-row {
  color: #8996a8;
  background: #fbfcfd;
}

.empty,
.error-banner,
.warning-banner {
  display: flex;
  align-items: center;
  min-height: 72px;
  border-radius: 8px;
  padding: 14px;
}

.empty {
  color: var(--muted);
  background: #fbfcfd;
}

.error-banner {
  border: 1px solid #f1bbb6;
  background: #fff4f3;
  color: var(--bad);
}

.warning-banner {
  border: 1px solid #f1d7b1;
  background: #fffaf0;
  color: var(--warn);
}

input[type="search"],
input[type="text"],
input[type="number"],
input[type="date"],
select {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
}

input[type="search"] {
  width: min(340px, 100%);
}

select {
  width: min(280px, 100%);
}

.mono {
  font-family: Consolas, "Courier New", monospace;
}

@media (max-width: 1180px) {
  #strategyLabPage .condition-rule-section,
  .strategy-trade-detail-grid {
    grid-template-columns: 1fr;
  }

  #strategySummaryCards .stat-card {
    padding-left: 76px;
  }

  #strategySummaryCards .stat-card::after {
    left: 24px;
  }
}

@media (max-width: 1180px) {
  .stat-grid-four,
  .stat-grid-five,
  .stat-grid-three,
  .modal-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .control-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 940px) {
  .workspace-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .topbar,
  .panel-heading,
  .detail-header {
    grid-template-columns: 1fr;
    flex-direction: column;
    align-items: stretch;
  }

  .two-column,
  .company-analysis-controls,
  .company-analysis-workspace,
  .stat-grid-four,
  .stat-grid-five,
  .stat-grid-three,
  .modal-stat-grid {
    grid-template-columns: 1fr;
  }

  .control-grid {
    grid-template-columns: 1fr;
  }

  .factor-condition-row {
    grid-template-columns: 1fr;
  }

  #strategyLabPage .factor-condition-row {
    grid-template-columns: 1fr;
  }

  #strategySummaryCards .stat-card {
    padding-left: 18px;
  }

  #strategySummaryCards .stat-card::after {
    display: none;
  }

  .strategy-run-banner {
    align-items: flex-start;
    flex-direction: column;
  }

  .modal-backdrop {
    padding: 12px;
  }

  .modal-header {
    flex-direction: column;
  }

  .company-analysis-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .company-analysis-detail {
    position: static;
  }
}

@media (max-width: 560px) {
  .app-shell {
    padding: 14px;
  }

  .baimao-frame {
    min-height: 78vh;
  }

  .toolbar,
  .table-tools,
  .pagination,
  .company-analysis-version-tools,
  button,
  input[type="search"],
  input[type="text"],
  input[type="number"],
  input[type="date"],
  select {
    width: 100%;
  }

  .company-analysis-frame {
    min-height: 74vh;
  }

  .company-analysis-summary {
    grid-template-columns: 1fr;
  }

  .company-analysis-layer-strip {
    min-width: 1180px;
  }

  .company-analysis-chip:hover::after {
    width: 300px;
  }

  .stat-card strong {
    font-size: 28px;
  }
}
