:root {
  --surface: #161b22;
  --surface-soft: #0d1117;
  --surface-panel: #161b22;
  --surface-lift: #1c2333;
  --surface-wash: #010409;
  --text: #e6edf3;
  --muted: #7d8590;
  --line: #21262d;
  --line-strong: #30363d;
  --accent: #58a6ff;
  --accent-soft: rgba(88, 166, 255, 0.12);
  --positive: #f85149;
  --negative: #3fb950;
  --blue: #58a6ff;
  --green: #3fb950;
  --green-soft: rgba(63, 185, 80, 0.12);
  --red: #f85149;
  --red-soft: rgba(248, 81, 73, 0.12);
  --yellow: #d29922;
  --yellow-soft: rgba(210, 153, 34, 0.12);
  --warning: var(--yellow);
  --warning-soft: var(--yellow-soft);
  --ink: var(--text);
  --radius: 10px;
  --shadow-panel: 0 8px 24px rgba(0, 0, 0, 0.36);
  --shadow-soft: 0 1px 3px rgba(0, 0, 0, 0.3);
  --font-ui: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, monospace;
}

body.theme-light {
  --surface: #ffffff;
  --surface-soft: #f5f6f8;
  --surface-panel: #ffffff;
  --surface-lift: #f3f4f6;
  --surface-wash: #f6f8fa;
  --text: #1f2328;
  --muted: #656d76;
  --line: #d0d7de;
  --line-strong: #afb8c1;
  --accent: #0969da;
  --accent-soft: rgba(9, 105, 218, 0.10);
  --positive: #cf222e;
  --negative: #1a7f37;
  --blue: #0969da;
  --green: #1a7f37;
  --green-soft: rgba(26, 127, 55, 0.10);
  --red: #cf222e;
  --red-soft: rgba(207, 34, 46, 0.10);
  --yellow: #9a6700;
  --yellow-soft: rgba(154, 103, 0, 0.10);
  --warning: var(--yellow);
  --warning-soft: var(--yellow-soft);
  --ink: #1f2328;
  --shadow-panel: 0 8px 24px rgba(31, 35, 40, 0.12);
  --shadow-soft: 0 1px 3px rgba(31, 35, 40, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--surface-soft);
  color: var(--text);
  font-family: var(--font-ui);
  letter-spacing: 0;
  overflow-x: clip;
}

body.theme-light {
  background: var(--surface-soft);
}

#root {
  min-height: 100vh;
  max-width: 100%;
}

.boot-fallback {
  display: grid;
  min-height: 100vh;
  place-items: center;
  background: var(--surface-soft);
}

.boot-brand {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 36px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  animation: awa-breathe 1.6s ease-in-out infinite;
}

.boot-error {
  box-sizing: border-box;
  min-height: 100vh;
  margin: 0;
  padding: 24px;
  color: var(--down);
  white-space: pre-wrap;
}

@keyframes awa-breathe {
  0%,
  100% {
    opacity: 0.42;
    transform: scale(0.96);
  }

  50% {
    opacity: 1;
    transform: scale(1);
  }
}

.ant-app-shell {
  min-height: 100vh;
  min-width: 0;
  max-width: 100%;
  background: var(--surface-soft);
  overflow-x: clip;
}

.theme-light.ant-app-shell,
body.theme-light .ant-app-shell {
  background: var(--surface-soft);
}

.app-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  overflow: hidden;
}

.app-workspace {
  min-width: 0;
}

.brand-block {
  flex: 0 0 auto;
  min-height: 36px;
  display: grid;
  grid-template-columns: 44px;
  grid-template-rows: 36px;
  align-items: center;
  padding: 0;
}

.brand-block .ant-typography {
  margin: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 44px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--accent);
  font-size: 14px;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1;
  background: var(--accent-soft);
}

.brand-block .brand-mark {
  grid-row: 1;
}

.brand-title {
  display: none;
}

.brand-subtitle {
  display: none;
}

.mobile-brand {
  display: none;
}

.theme-light .brand-mark,
body.theme-light .brand-mark {
  color: #111111;
  background: rgba(17, 17, 17, 0.04);
}

.sider-status {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: var(--surface-lift);
}

.theme-switch-box {
  display: flex;
  align-items: center;
  min-width: 0;
}

.theme-switch-box .ant-segmented {
  background: var(--surface-lift);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  min-height: 52px;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  padding: 8px 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(1, 4, 9, 0.94);
  line-height: 1;
  backdrop-filter: blur(14px);
}

.theme-light .app-header,
body.theme-light .app-header {
  background: rgba(255, 255, 255, 0.94);
}

.app-header .ant-typography {
  margin: 0;
}

.refresh-field {
  display: flex;
  align-items: center;
  min-width: 82px;
}

.refresh-field .ant-input-number {
  width: 82px;
}

.top-nav-menu {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 2px;
  overflow: hidden;
}

.top-nav-item,
.top-nav-more {
  flex: 0 0 auto;
  width: auto;
  height: 34px;
  padding-inline: 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
  text-align: center;
}

.top-nav-item.ant-btn-primary {
  color: var(--text);
  background: var(--accent-soft);
  border-color: var(--line);
}

.top-nav-item .nav-label {
  width: 100%;
}

.top-nav-item.ant-btn-text:hover,
.top-nav-more:hover {
  color: var(--text) !important;
  background: var(--surface-lift) !important;
}

.nav-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.nav-icon {
  font-size: 14px;
  line-height: 1;
}

.nav-text {
  line-height: 1;
}

.top-nav-more.is-active {
  color: var(--text);
  border-color: var(--accent);
  background: var(--surface-lift);
}

.mobile-bottom-nav {
  display: none;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding: 14px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
}

.header-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: nowrap;
}

.header-status-tag {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.header-icon-button {
  white-space: nowrap;
}

.account-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-inline: 8px 10px;
  max-width: 132px;
}

.account-avatar {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--surface-lift);
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.account-name {
  max-width: 86px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-caret {
  color: var(--muted);
  font-size: 11px;
}

.account-menu-head {
  display: grid;
  gap: 6px;
  min-width: 150px;
  padding: 2px 0;
}

.auth-hint {
  margin-bottom: 14px;
}

.auth-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 10px;
}

.login-required-card .ant-card-body {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
}

.app-content {
  width: min(100% - 32px, 1480px);
  min-width: 0;
  margin: 0 auto;
  padding: 24px 0 48px;
}

.eyebrow {
  display: block;
  margin-bottom: 7px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.full-width {
  width: 100%;
}

.ant-card {
  color: var(--text);
  background: var(--surface-panel);
  border-radius: var(--radius);
  border-color: var(--line);
  box-shadow: var(--shadow-soft);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.ant-card-head {
  color: var(--text);
  border-color: var(--line);
  background: transparent;
}

.ant-card-body {
  color: var(--text);
}

.app-page-head {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 20px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
  box-shadow: var(--shadow-panel);
}

body.theme-light .app-page-head {
  background: var(--surface-panel);
}

.editor-card,
.holding-card,
.detail-section-card,
.knowledge-category-detail,
.knowledge-category-list,
.system-card,
.login-required-card {
  background: var(--surface-panel);
  border-color: var(--line);
}

.holding-card,
.editor-card,
.detail-section-card {
  overflow: hidden;
}

/* Hover panels extend below the metrics grid and must remain visible. */
.holding-card,
.holding-card .ant-card-body {
  overflow: visible;
}

/* Lift the whole card above its grid siblings while the popover is open. */
.holding-card:has(.chip-distribution-hover:hover),
.holding-card:has(.chip-distribution-hover:focus-visible) {
  position: relative;
  z-index: 30;
}

.app-page-head h2.ant-typography {
  margin: 0;
  color: var(--text);
  font-size: 24px;
}

.page-head-subtitle {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 14px;
}

.page-head-side {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.page-head-actions {
  flex: 0 0 auto;
}

.app-page-head .eyebrow {
  color: var(--accent);
}

.ant-menu-light.ant-menu-root.ant-menu-inline {
  border-inline-end: 0;
}

.ant-menu-item {
  border-radius: 0;
  margin-inline: 0;
  width: 100%;
}

.ant-menu-light .ant-menu-item-selected {
  background: var(--text);
  color: var(--surface);
}

.ant-btn {
  border-radius: var(--radius);
  box-shadow: none;
  font-weight: 650;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.ant-btn:active {
  transform: translateY(1px);
}

.ant-btn-default {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-lift);
}

.ant-btn-default:hover,
.ant-btn-default:focus-visible {
  color: var(--accent) !important;
  border-color: var(--line-strong) !important;
  background: var(--surface-lift) !important;
}

.ant-btn-primary {
  color: #ffffff;
  background: var(--accent);
  border-color: var(--accent);
}

.ant-btn-primary:hover,
.ant-btn-primary:focus-visible {
  color: #ffffff !important;
  filter: brightness(1.08);
}

.ant-input,
.ant-input-number,
.ant-select-selector {
  color: var(--text) !important;
  border-color: var(--line) !important;
  border-radius: var(--radius) !important;
  background: var(--surface-lift) !important;
}

.ant-input:focus,
.ant-input-focused,
.ant-input-number-focused,
.ant-select-focused .ant-select-selector {
  border-color: var(--accent) !important;
  box-shadow: 0 0 0 3px var(--accent-soft) !important;
}

.ant-input::placeholder {
  color: var(--muted) !important;
}

.ant-typography,
.ant-form-item-label > label,
.ant-tabs-tab,
.ant-table,
.ant-descriptions,
.ant-list,
.ant-modal {
  color: var(--text);
}

.ant-typography-secondary,
.ant-typography.ant-typography-secondary,
.ant-form-item-extra {
  color: var(--muted) !important;
}

.ant-tabs .ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn,
.ant-tabs .ant-tabs-tab:hover {
  color: var(--accent);
}

.ant-tabs-ink-bar {
  background: var(--accent);
}

.ant-tag {
  border-color: var(--line);
  color: var(--text);
  background: var(--surface-lift);
  border-radius: 999px;
  margin-inline-end: 4px;
  font-weight: 600;
}

.ant-modal-content,
.ant-modal-header {
  color: var(--text);
  background: var(--surface-panel) !important;
}

.ant-modal-title {
  color: var(--text) !important;
}

.ant-modal-close {
  color: var(--muted) !important;
}

.ant-table-wrapper .ant-table,
.ant-table-wrapper .ant-table-thead > tr > th,
.ant-table-wrapper .ant-table-tbody > tr > td {
  color: var(--text);
  border-color: var(--line);
  background: var(--surface-panel);
}

.ant-table-wrapper .ant-table-thead > tr > th {
  color: var(--muted);
  background: var(--surface-wash);
  font-weight: 700;
}

.ant-table-wrapper .ant-table-tbody > tr:hover > td {
  background: var(--surface-lift) !important;
}

.ant-select-dropdown,
.ant-dropdown-menu,
.ant-picker-dropdown,
.ant-tooltip-inner {
  color: var(--text);
  border: 1px solid var(--line);
  background: var(--surface-panel) !important;
}

.ant-select-item,
.ant-dropdown-menu-item {
  color: var(--text) !important;
}

.ant-select-item-option-active,
.ant-select-item-option-selected,
.ant-dropdown-menu-item:hover {
  background: var(--surface-lift) !important;
}

.ant-empty-description,
.ant-list-item-meta-title,
.ant-list-item-meta-description,
.ant-descriptions-item-label,
.ant-descriptions-item-content {
  color: var(--text) !important;
}

.ant-descriptions-view,
.ant-descriptions-row,
.ant-descriptions-item-label,
.ant-descriptions-item-content,
.ant-list-item {
  border-color: var(--line) !important;
}

.ant-descriptions-item-label {
  background: var(--surface-lift) !important;
}

.ant-alert {
  border-color: var(--line);
  background: var(--surface-lift);
  color: var(--text);
}

.metric-card {
  height: 92px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0)), var(--surface-panel);
}

.metric-card-clickable {
  cursor: pointer;
}

.metric-card-clickable:hover,
.metric-card-clickable:focus-within {
  border-color: var(--accent);
  background: var(--surface-lift);
}

.metric-card .ant-card-body {
  height: 100%;
  padding: 14px 16px;
}

.metric-card-inner {
  height: 100%;
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
}

.metric-card-label,
.metric-card .ant-typography.metric-card-label {
  display: block;
  min-width: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-card-value,
.metric-card .ant-typography.metric-card-value {
  display: block;
  min-width: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.12;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.summary-signal-list {
  max-height: min(620px, calc(100vh - 220px));
  overflow: auto;
}

.summary-signal-list .ant-list-item {
  padding: 10px 0;
}

.summary-signal-item {
  width: 100%;
  display: grid;
  gap: 6px;
}

.summary-signal-head,
.summary-signal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.summary-signal-meta {
  justify-content: flex-start;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 12px;
}

.summary-signal-meta span {
  padding: 2px 6px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  border-radius: 999px;
  white-space: nowrap;
}

.summary-signal-title {
  color: var(--text);
  font-weight: 700;
  line-height: 1.45;
}

.summary-signal-reason {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.dashboard-view,
.position-view {
  min-width: 0;
}

.market-terminal-head {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface-panel);
}

.market-terminal-title {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.market-terminal-title strong {
  color: var(--text);
  font-size: 16px;
}

.market-terminal-title em,
.market-terminal-eyebrow {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  white-space: nowrap;
}

.market-terminal-eyebrow {
  color: var(--accent);
  letter-spacing: 0.08em;
}

.market-index-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  border: 1px solid var(--line);
  background: var(--surface-panel);
}

.market-index-item {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  gap: 3px 8px;
  padding: 11px 14px;
  border-right: 1px solid var(--line);
}

.market-index-item:last-child {
  border-right: 0;
}

.market-index-item span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-index-item strong,
.market-index-item em {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.market-index-item strong {
  grid-column: 1;
  color: var(--text);
  font-size: 16px;
}

.market-index-item em {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 13px;
  font-style: normal;
}

.market-data-empty {
  padding: 14px;
  color: var(--muted);
  font-size: 12px;
}

.market-quality-notice,
.market-panel-notice {
  display: grid;
  gap: 5px;
  min-height: 88px;
  align-content: center;
  padding: 13px 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.market-quality-notice {
  min-height: 66px;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  background: var(--surface-panel);
}

.market-quality-notice strong,
.market-panel-notice strong {
  color: var(--text);
  font-size: 13px;
}

.market-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 1px;
  border: 1px solid var(--line);
  background: var(--line);
}

.market-kpi {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 11px 13px;
  background: var(--surface-panel);
}

.market-kpi span,
.market-kpi em {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow-wrap: anywhere;
  white-space: normal;
}

.market-kpi strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.tick-dashboard {
  display: grid;
  gap: 6px;
  width: 100%;
  min-width: 0;
}

.tick-dashboard .market-terminal-head,
.tick-dashboard .market-index-strip,
.tick-dashboard .market-kpi-grid,
.tick-panel {
  border-color: var(--line-strong);
  border-radius: 10px;
  background: var(--surface-panel);
  box-shadow: var(--shadow-soft);
}

.tick-dashboard .market-terminal-head {
  min-height: 44px;
  padding: 6px 10px;
}

.tick-dashboard .market-index-strip,
.tick-dashboard .market-kpi-grid {
  gap: 6px;
  border: 0;
  background: transparent;
}

.tick-dashboard .market-index-item,
.tick-dashboard .market-kpi {
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-panel);
}

.tick-dashboard .market-index-item {
  min-height: 70px;
  padding: 10px 12px;
}

.tick-dashboard .market-kpi {
  min-height: 102px;
  padding: 10px 12px;
}

.tick-dashboard .market-kpi strong {
  font-size: 22px;
}

.tick-dashboard .market-kpi-compact strong {
  font-size: clamp(15px, 1.28vw, 21px);
  letter-spacing: 0;
  white-space: nowrap;
}

.tick-dashboard-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(270px, 0.32fr);
  gap: 6px;
  min-width: 0;
}

.dashboard-deferred-panel {
  min-height: 108px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--muted-text, #8c8c8c);
  font-size: 13px;
  border: 1px solid var(--panel-border, rgba(127, 127, 127, 0.2));
  background: var(--panel-bg, rgba(127, 127, 127, 0.04));
}

.dashboard-deferred-details {
  min-height: 112px;
  display: grid;
  gap: 12px;
}

.dashboard-deferred-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: dashboard-deferred-spin 0.7s linear infinite;
}

@keyframes dashboard-deferred-spin {
  to { transform: rotate(360deg); }
}

.tick-dashboard-main,
.tick-dashboard-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 6px;
}

.tick-core-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.tick-heat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.tick-stock-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.tick-panel {
  min-width: 0;
  padding: 10px;
}

.tick-panel-head {
  min-width: 0;
  min-height: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.tick-panel-head h2 {
  min-width: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  line-height: 1.2;
}

.tick-panel-mark {
  width: 3px;
  height: 17px;
  border-radius: 99px;
  background: var(--accent);
  box-shadow: 0 0 9px var(--accent-soft);
}

.tick-panel-hint {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tick-distribution-bars {
  height: 124px;
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
  gap: 5px;
}

.tick-distribution-bar {
  min-width: 0;
  height: 100%;
  display: grid;
  grid-template-rows: 16px minmax(0, 1fr) 21px;
  align-items: end;
  justify-items: center;
  gap: 3px;
}

.tick-distribution-count,
.tick-distribution-bar small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
  white-space: nowrap;
}

.tick-distribution-bar i {
  width: min(16px, 78%);
  min-height: 4px;
  border-radius: 5px;
  align-self: end;
}

.tick-distribution-bar i.up,
.tick-breadth-up {
  background: var(--red);
}

.tick-distribution-bar i.down,
.tick-breadth-down {
  background: var(--green);
}

.tick-breadth-flat {
  background: var(--muted);
}

.tick-breadth-track {
  height: 12px;
  display: flex;
  overflow: hidden;
  margin-top: 9px;
  border-radius: 999px;
  background: var(--surface-lift);
}

.tick-breadth-track i {
  display: block;
  min-width: 0;
}

.tick-breadth-labels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
}

.tick-breadth-labels span {
  color: var(--muted);
  text-align: center;
}

.tick-breadth-labels strong:last-child {
  text-align: right;
}

.tick-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.tick-mini-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 9px;
}

.tick-mini-grid > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-soft);
}

.tick-mini-grid span,
.tick-mini-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tick-mini-grid span {
  color: var(--muted);
  font-size: 10px;
}

.tick-mini-grid strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
}

.accent-text {
  color: var(--accent) !important;
}

.tick-radar-wrap {
  display: grid;
  place-items: center;
  min-height: 220px;
}

.tick-radar {
  width: min(100%, 235px);
  height: 220px;
  overflow: visible;
}

.tick-radar-grid {
  fill: color-mix(in srgb, var(--surface-lift) 70%, transparent);
  stroke: var(--line-strong);
  stroke-width: 1.2;
}

.tick-radar-grid.is-inner {
  fill: transparent;
  stroke: var(--line);
}

.tick-radar-axis {
  stroke: var(--line);
}

.tick-radar text {
  fill: var(--muted);
  font-family: var(--font-ui);
  font-size: 10px;
}

.tick-radar-shape {
  fill: rgba(255, 170, 0, 0.14);
  stroke: #f59e0b;
  stroke-width: 2.2;
}

.tick-radar-point {
  fill: #f59e0b;
}

.tick-radar-score-bg {
  fill: var(--surface-panel);
  stroke: color-mix(in srgb, #f59e0b 45%, var(--line));
}

.tick-radar text.tick-radar-score {
  fill: var(--text);
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 800;
}

.tick-trend-stack {
  display: grid;
  gap: 8px;
}

.tick-monitor-line {
  display: grid;
  gap: 4px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}

.tick-monitor-line span {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.tick-monitor-line em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

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

.tick-dimension-col {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.tick-dimension-col > strong {
  font-size: 11px;
}

.tick-dimension-col.up > strong {
  color: var(--red);
}

.tick-dimension-col.down > strong {
  color: var(--green);
}

.tick-dimension-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 15px minmax(0, 1fr) auto;
  align-items: center;
  gap: 5px;
  min-height: 45px;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-lift);
}

.tick-dimension-row > span,
.tick-dimension-row small {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 9px;
}

.tick-dimension-row div {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.tick-dimension-row b,
.tick-dimension-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tick-dimension-row b {
  color: var(--text);
  font-size: 11px;
}

.tick-dimension-row em,
.tick-stock-value {
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  text-align: right;
  white-space: nowrap;
}

.tick-stock-list {
  display: grid;
  gap: 5px;
}

.tick-stock-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  min-height: 52px;
  padding: 7px;
  border: 1px solid transparent;
  border-radius: 7px;
  background: var(--surface-lift);
}

.tick-stock-row > span,
.tick-stock-row small,
.tick-stock-value em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

.tick-stock-row > div:nth-child(2) {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.tick-stock-row b,
.tick-stock-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tick-stock-row b {
  color: var(--text);
  font-size: 13px;
}

.tick-stock-value {
  display: grid;
  gap: 2px;
}

.tick-stock-value strong {
  font-size: 12px;
}

.tick-empty {
  margin: 0;
  padding: 18px 6px;
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.tick-ladder {
  display: grid;
  gap: 8px;
}

.tick-seal-rate {
  display: flex;
  justify-content: space-between;
  padding: 8px;
  border-radius: 7px;
  background: var(--surface-lift);
  color: var(--muted);
  font-size: 11px;
}

.tick-seal-rate strong {
  color: var(--accent);
  font-family: var(--font-mono);
}

.tick-ladder-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 7px;
  background: var(--surface-lift);
}

.tick-ladder-row > strong {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 14px;
}

.tick-ladder-row > i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-wash);
}

.tick-ladder-row > i > b {
  display: block;
  height: 100%;
  min-width: 8px;
  border-radius: inherit;
  background: var(--red);
}

.tick-ladder-row em {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 11px;
  font-style: normal;
  text-align: right;
}

.tick-ladder-row small {
  grid-column: 2 / -1;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tick-monitor {
  display: grid;
  gap: 6px;
  min-height: 170px;
}

.tick-monitor > button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
  align-items: center;
  gap: 8px;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--surface-lift);
  color: var(--text);
  cursor: pointer;
}

.tick-monitor > button > .tick-monitor-name {
  min-width: 0;
  font-size: 12px;
  font-weight: 650;
  line-height: 17px;
  overflow-wrap: anywhere;
}

.tick-monitor .signal-badge-wrap {
  min-width: 0;
  display: grid;
  grid-template-columns: max-content;
  justify-items: end;
  flex: 0 1 auto;
  gap: 4px;
}

.tick-monitor .signal-badge-wrap .ant-tag {
  max-width: 142px;
  min-width: 0;
  margin-inline-end: 0;
  font-size: 11px;
  line-height: 17px;
  padding-block: 1px;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.tick-monitor .signal-badge-wrap .ant-tag:first-child {
  max-width: 96px;
}

.tick-monitor-empty {
  min-height: 128px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.terminal-market-row {
  width: 100%;
}

.terminal-position-panel .ant-card-body {
  padding: 4px 12px 12px;
  min-width: 0;
  overflow: hidden;
}

.terminal-position-panel .ant-table-wrapper {
  max-width: 100%;
}

.terminal-stock-name,
.terminal-signal-cell {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.terminal-signal-cell > .ant-typography {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.terminal-exposure-panel .ant-card-body {
  display: grid;
  gap: 14px;
}

.terminal-exposure-kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
}

.terminal-exposure-kpis > div {
  min-width: 0;
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.terminal-exposure-kpis > div:nth-child(2n) {
  border-right: 0;
}

.terminal-exposure-kpis > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.terminal-exposure-kpis span {
  color: var(--muted);
  font-size: 11px;
}

.terminal-exposure-kpis strong {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.market-list {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.market-list-title {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.market-list-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) 56px 42px;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 6px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 11px;
}

.market-list-rank,
.market-list-row span,
.market-list-row em {
  color: var(--muted);
  font-family: var(--font-mono);
  font-style: normal;
}

.market-list-row strong {
  min-width: 0;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-list-up .market-list-row em {
  color: var(--positive);
}

.market-list-down .market-list-row em {
  color: var(--negative);
}

.dashboard-page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.dashboard-page-header h2.ant-typography {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 24px;
}

.review-overview-bar {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.review-overview-bar > div {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.review-overview-title {
  color: var(--text);
  font-size: 16px;
}

.review-overview-note {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-overview-bar .ant-btn {
  flex: 0 0 auto;
}

.portfolio-summary-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.portfolio-summary-card {
  min-height: 116px;
  border-color: var(--line);
  background: var(--surface-panel);
  box-shadow: var(--shadow-soft);
}

.portfolio-summary-card .ant-card-body {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px;
}

.portfolio-summary-card.highlight {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--surface-panel), var(--accent-soft));
}

.summary-icon {
  flex: 0 0 auto;
  font-size: 26px;
  line-height: 1;
}

.summary-content {
  min-width: 0;
}

.summary-label {
  margin-bottom: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.summary-value {
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-sub {
  margin-top: 3px;
  font-size: 12px;
  font-weight: 650;
}

.dashboard-panel {
  height: auto;
}

.dashboard-primary-row > .ant-col:first-child > .dashboard-panel {
  height: 100%;
}

.dashboard-primary-row > .ant-col:last-child {
  display: flex;
  flex-direction: column;
}

.dashboard-main-panel .ant-card-body {
  padding-top: 10px;
}

.dashboard-panel + .dashboard-panel {
  margin-top: 16px;
}

.sector-rank-panel .ant-card-body {
  padding-top: 12px;
}

.sector-rank-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.sector-rank-list {
  min-width: 0;
  display: grid;
  gap: 7px;
}

.sector-rank-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.sector-rank-row {
  min-width: 0;
  min-height: 32px;
  display: grid;
  grid-template-columns: 26px minmax(84px, 1.35fr) 64px 64px 80px 76px minmax(76px, 1fr);
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}

.sector-rank-up .sector-rank-row:nth-child(-n + 4) {
  border-color: color-mix(in srgb, var(--positive) 28%, var(--line));
}

.sector-rank-down .sector-rank-row:nth-child(-n + 4) {
  border-color: color-mix(in srgb, var(--negative) 28%, var(--line));
}

.sector-rank-index {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-lift);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
}

.sector-rank-name,
.sector-rank-leader {
  min-width: 0;
  color: var(--text);
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sector-rank-leader {
  color: var(--muted);
  font-weight: 650;
}

.sector-rank-meta,
.sector-rank-row .positive-text,
.sector-rank-row .negative-text {
  min-width: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.sector-rank-meta {
  color: var(--muted);
}

.money-flow-panel .ant-card-body {
  padding-top: 12px;
}

.money-flow-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.money-flow-fallback-note {
  margin-bottom: 10px;
  padding: 7px 10px;
  border: 1px solid color-mix(in srgb, #d6a100 28%, var(--line));
  border-radius: 8px;
  color: var(--muted);
  background: color-mix(in srgb, #f5c542 12%, var(--surface-soft));
  font-size: 12px;
  line-height: 1.5;
}

.money-flow-source-meta {
  min-width: 0;
  margin: -2px 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-flow-fallback-compact {
  margin-top: -2px;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}

.money-flow-metric,
.money-flow-state {
  min-width: 0;
  min-height: 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.money-flow-metric span,
.money-flow-state span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.money-flow-metric strong {
  min-width: 0;
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-flow-metric em {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-flow-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.money-flow-stock-section {
  min-width: 0;
  display: grid;
  gap: 8px;
}

.money-flow-rank,
.money-flow-watch {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 7px;
}

.money-flow-rank-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.money-flow-rank-row,
.money-flow-watch-row {
  min-width: 0;
  min-height: 32px;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}

.money-flow-rank-row {
  display: grid;
  grid-template-columns: 26px minmax(82px, 1fr) 72px 58px minmax(64px, 0.8fr);
}

.money-flow-rank-row-fallback {
  grid-template-columns: 26px minmax(92px, 1.2fr) 70px minmax(82px, 1fr) minmax(70px, 0.9fr);
}

.money-flow-watch-list {
  display: grid;
  gap: 7px;
}

.money-flow-stock-list {
  min-width: 0;
  display: grid;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.money-flow-stock-row {
  min-width: 920px;
  min-height: 34px;
  display: grid;
  grid-template-columns: minmax(130px, 1.2fr) 58px repeat(7, minmax(82px, 0.8fr)) 58px;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  font-size: 12px;
}

.dashboard-rank-row > .ant-col {
  display: flex;
}

.dashboard-rank-row .dashboard-panel {
  width: 100%;
}

.money-flow-stock-head {
  min-height: 28px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
  font-weight: 750;
}

.money-flow-watch-row {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) 78px 92px auto;
}

.money-flow-rank-index {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-lift);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.money-flow-rank-name,
.money-flow-watch-name,
.money-flow-watch-code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-flow-rank-name,
.money-flow-watch-name {
  color: var(--text);
  font-weight: 750;
}

.money-flow-rank-meta,
.money-flow-rank-row .positive-text,
.money-flow-rank-row .negative-text,
.money-flow-watch-row .positive-text,
.money-flow-watch-row .negative-text,
.money-flow-stock-row .positive-text,
.money-flow-stock-row .negative-text,
.money-flow-stock-row > span {
  min-width: 0;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.money-flow-rank-meta,
.money-flow-watch-code {
  color: var(--muted);
}

.money-flow-watch-main {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.dashboard-snapshot-list {
  display: grid;
  gap: 10px;
}

.dashboard-snapshot-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.dashboard-snapshot-row:last-child {
  border-bottom: 0;
}

.dashboard-snapshot-row span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-snapshot-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

.position-bar-item {
  display: grid;
  gap: 6px;
}

.position-bar-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.position-bar-label {
  min-width: 0;
  color: var(--text);
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.position-bar-pct,
.position-bar-val {
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  white-space: nowrap;
}

.position-bar-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-lift);
}

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

.dashboard-signal-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.dashboard-signal-item {
  min-height: 64px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.dashboard-signal-item span {
  color: var(--muted);
  font-size: 12px;
}

.dashboard-signal-item strong {
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  font-family: var(--font-mono);
}

.dashboard-signal-item.signal-positive {
  border-color: color-mix(in srgb, var(--positive) 34%, var(--line));
  background: var(--red-soft);
}

.dashboard-signal-item.signal-negative {
  border-color: color-mix(in srgb, var(--negative) 34%, var(--line));
  background: var(--green-soft);
}

.dashboard-mini-list .ant-list-item {
  padding: 9px 0;
}

.dashboard-mini-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dashboard-mini-main,
.dashboard-mini-side {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-mini-main {
  flex-wrap: wrap;
}

.dashboard-mini-side {
  justify-content: flex-end;
  flex: 0 0 auto;
}

.dashboard-alert-list,
.watch-preview-list {
  display: grid;
  gap: 10px;
}

.dashboard-alert-item {
  width: 100%;
  display: grid;
  gap: 6px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  color: var(--text);
}

.dashboard-alert-item:last-child {
  border-bottom: 0;
}

.dashboard-alert-head,
.watch-preview-side {
  display: flex;
  align-items: center;
  gap: 8px;
}

.dashboard-alert-head,
.watch-preview-row {
  justify-content: space-between;
}

.dashboard-alert-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.dashboard-alert-title {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.dashboard-alert-reason {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.watch-preview-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.watch-preview-row:last-child {
  border-bottom: 0;
}

.watch-preview-row > div:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.watch-preview-row > div:first-child .ant-typography {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-preview-side {
  flex: 0 0 auto;
  justify-content: flex-end;
  max-width: 170px;
}

.watch-preview-side > .ant-typography {
  min-width: 48px;
  text-align: right;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.watch-preview-side .signal-badge-wrap {
  justify-content: flex-end;
}

.watch-preview-side .ant-tag {
  max-width: 92px;
  margin-inline-end: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.watch-preview-side .signal-badge-wrap .ant-tag:not(:first-child) {
  display: none;
}

.watch-preview-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
}

.review-trend-panel {
  overflow: hidden;
}

.review-trend-summary,
.review-trend-legend,
.review-trade-editor-head {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.review-trend-summary {
  padding-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.review-trend-summary strong {
  font-family: var(--font-mono);
}

.review-trend-legend {
  justify-content: flex-end;
  padding: 0 4px 4px;
  color: var(--muted);
  font-size: 12px;
}

.review-legend-line,
.review-legend-bar {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.review-legend-line::before,
.review-legend-bar::before {
  content: "";
  display: block;
  width: 15px;
  height: 3px;
  background: var(--accent);
}

.review-legend-bar::before {
  width: 8px;
  height: 12px;
  background: var(--positive);
}

.review-chart-scroll {
  width: 100%;
  overflow-x: auto;
}

.review-trend-chart {
  display: block;
  width: 100%;
  min-width: 620px;
  height: 188px;
}

.review-chart-grid {
  stroke: var(--line);
  stroke-width: 1;
}

.review-chart-axis {
  fill: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
}

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

.review-rate-point {
  fill: var(--surface);
  stroke: var(--accent);
  stroke-width: 2;
}

.review-pnl-bar.positive {
  fill: var(--positive);
  opacity: 0.72;
}

.review-pnl-bar.negative {
  fill: var(--negative);
  opacity: 0.72;
}

.review-rule-alert {
  margin-bottom: 16px;
}

.review-ai-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  margin: 0 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.review-ai-draft {
  margin: 0 0 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.review-ai-draft pre {
  margin: 8px 0 0;
  color: var(--text);
  font: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.review-allocation-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 6px;
}

.review-allocation-item {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.review-allocation-item .ant-form-item:last-child {
  margin-bottom: 0;
}

.review-trade-editor-head {
  justify-content: space-between;
  margin: 6px 0 10px;
}

.review-detail-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.review-detail-metrics > .ant-col {
  max-width: none;
  width: auto;
}

.review-plan-description {
  margin-bottom: 16px;
}

.review-detail-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.review-detail-notes section {
  min-height: 92px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.review-detail-notes .ant-typography {
  margin: 6px 0 0;
  white-space: pre-wrap;
}

.backtest-rule-row {
  align-items: stretch;
}

.backtest-rule-row .ant-col {
  display: flex;
}

.rule-card {
  width: 100%;
  height: 92px;
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-lift);
  overflow: hidden;
}

.rule-card-label {
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}

.rule-card-value {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  font-size: 16px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.editor-card .ant-form-item {
  margin-bottom: 0;
}

.strategy-sync-note {
  min-height: 28px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  overflow: hidden;
  white-space: nowrap;
}

.strategy-sync-note .ant-tag {
  flex: 0 0 auto;
  margin-inline-end: 0;
}

.strategy-sync-note .ant-typography {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.holding-card {
  height: 100%;
}

.clickable-card {
  cursor: pointer;
}

.clickable-card:hover {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft), transparent), var(--surface-panel);
}

.holding-card .ant-card-head-title {
  min-width: 0;
  padding: 10px 0;
}

.holding-card-head {
  min-height: 46px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.holding-card-title {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.holding-card-title .ant-space {
  min-width: 0;
}

.holding-card-side {
  flex: 0 0 auto;
  min-width: 132px;
  display: grid;
  justify-items: end;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.holding-card-actions {
  justify-content: flex-end;
  row-gap: 4px;
}

.holding-card-actions .ant-btn {
  min-width: 58px;
}

.holding-card-signals {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.holding-card-signals .signal-note {
  margin-top: 0;
}

.holding-card-signals .six-pulse-lights {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.watchlist-table-card {
  overflow: hidden;
}

.watchlist-table .ant-table-tbody > tr {
  cursor: pointer;
}

.watchlist-table .ant-table-tbody > tr > td {
  white-space: nowrap;
}

.watchlist-table .ant-table-cell:last-child {
  white-space: normal;
}

.watchlist-score {
  white-space: nowrap;
}

.holding-metrics {
  margin-bottom: 14px;
}

.chip-distribution-hover,
.chip-distribution-detail {
  position: relative;
  min-width: 0;
  outline: none;
  z-index: 2;
}

.chip-distribution-hover:hover,
.chip-distribution-hover:focus-visible,
.chip-distribution-detail:hover,
.chip-distribution-detail:focus-visible {
  z-index: 20;
}

.chip-distribution-summary {
  cursor: default;
  overflow: hidden;
}

.chip-distribution-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--text);
  font-weight: 650;
}

.chip-distribution-summary .ant-typography,
.chip-distribution-summary > div,
.chip-distribution-summary > strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-info-icon {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  border: 1px solid var(--muted);
  border-radius: 50%;
  color: var(--muted);
  font: 700 11px/1 Georgia, serif;
}

.chip-distribution-chevron {
  margin-left: auto;
  color: var(--muted);
  font-size: 24px;
  font-weight: 300;
  line-height: 14px;
}

.chip-distribution-hint {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip-distribution-hover:hover .chip-distribution-popover,
.chip-distribution-hover:focus-visible .chip-distribution-popover,
.chip-distribution-detail:hover .chip-distribution-popover,
.chip-distribution-detail:focus-visible .chip-distribution-popover {
  visibility: visible;
  opacity: 1;
  transform: translate(-50%, 0);
}

.chip-distribution-popover {
  position: absolute;
  z-index: 1000;
  top: calc(100% + 8px);
  left: 50%;
  width: min(380px, calc(100vw - 32px));
  padding: 13px 13px 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-panel);
  box-shadow: 0 14px 34px rgba(15, 23, 42, .16);
  visibility: hidden;
  opacity: 0;
  transform: translate(-50%, -4px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
  pointer-events: none;
}

.chip-distribution-detail .chip-distribution-popover {
  top: calc(100% + 6px);
  width: min(410px, calc(100vw - 48px));
}

.chip-distribution-popover-head,
.chip-distribution-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
}

.chip-distribution-popover-head > div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.chip-distribution-popover-head strong {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.chip-distribution-popover-head > strong {
  font-size: 13px;
  white-space: nowrap;
}

.chip-distribution-date {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.chip-distribution-svg {
  display: block;
  width: 100%;
  height: auto;
  margin: 4px 0 3px;
}

.chip-axis {
  stroke: var(--line);
  stroke-width: 1.2;
}

.chip-axis-label {
  fill: var(--muted);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

.chip-bar {
  shape-rendering: crispEdges;
}

.chip-bar-profit {
  fill: #ed5b4f;
  background: #ed5b4f;
}

.chip-bar-locked {
  fill: #21a879;
  background: #21a879;
}

.chip-line-average,
.chip-line-support,
.chip-line-pressure {
  stroke-width: 1.3;
}

.chip-line-average {
  stroke: #e9a348;
}

.chip-line-support {
  stroke: #4d86eb;
}

.chip-line-pressure {
  stroke: #ad6be8;
}

.chip-marker-label {
  fill: #fff;
  font-size: 10px;
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.chip-badge-average {
  fill: #fff0dc;
}

.chip-badge-support {
  fill: #e5efff;
}

.chip-badge-pressure {
  fill: #f1e4ff;
}

.chip-marker-label.chip-badge-average {
  fill: #e9a348;
}

.chip-marker-label.chip-badge-support {
  fill: #4d86eb;
}

.chip-marker-label.chip-badge-pressure {
  fill: #ad6be8;
}

.chip-distribution-bars {
  display: grid;
  gap: 1px;
  margin: 5px 0;
}

.chip-distribution-bar-row {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 40px;
  align-items: center;
  gap: 5px;
  min-height: 4px;
}

.chip-bar-track {
  height: 4px;
  border-radius: 2px;
  background: var(--surface-soft);
  overflow: hidden;
}

.chip-bar-track .chip-bar {
  display: block;
  height: 100%;
  min-width: 2px;
  border-radius: inherit;
}

.chip-distribution-empty {
  padding: 18px 4px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.chip-distribution-legend {
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 6px;
  border-top: 1px solid var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
}

.chip-distribution-legend span,
.chip-distribution-legend > div {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.chip-distribution-legend i {
  width: 11px;
  height: 3px;
  display: inline-block;
  border-radius: 1px;
}

.chip-legend-average {
  background: #e9a348;
}

.chip-legend-support {
  background: #4d86eb;
}

.chip-legend-pressure {
  background: #ad6be8;
}

.holding-flow-chart {
  margin: 0 0 14px;
  padding: 9px 10px 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.holding-flow-chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.holding-flow-chart-head strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.holding-flow-bars {
  position: relative;
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  align-items: stretch;
  height: 58px;
  gap: 4px;
}

.holding-flow-baseline {
  position: absolute;
  z-index: 0;
  right: 0;
  left: 0;
  top: 50%;
  border-top: 1px solid var(--line-strong);
}

.holding-flow-column {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 100%;
}

.holding-flow-bar {
  position: absolute;
  right: 12%;
  left: 12%;
  min-height: 0;
  border-radius: 2px;
}

.holding-flow-bar-positive {
  background: var(--positive);
}

.holding-flow-bar-negative {
  background: var(--negative);
}

.holding-flow-labels {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 4px;
  margin-top: 3px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
}

.holding-detail-modal .ant-modal-body {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.detail-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-right: 24px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) 420px;
  gap: 14px;
}

.detail-main,
.detail-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.detail-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-metric {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
}

.detail-metric .ant-typography {
  margin: 0;
  overflow-wrap: anywhere;
}

.detail-metric.positive .ant-typography:last-child {
  color: var(--positive);
}

.detail-metric.negative .ant-typography:last-child {
  color: var(--negative);
}

.cost-estimate-hover {
  position: relative;
  min-width: 0;
  outline: none;
}

.cost-estimate-hover:hover .cost-estimate-tooltip,
.cost-estimate-hover:focus-visible .cost-estimate-tooltip {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.cost-estimate-tooltip {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  left: 0;
  width: max-content;
  max-width: min(360px, calc(100vw - 32px));
  padding: 9px 11px;
  color: var(--text);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface-panel);
  box-shadow: var(--shadow-panel);
  font-size: 12px;
  line-height: 1.55;
  white-space: normal;
  pointer-events: none;
  visibility: hidden;
  opacity: 0;
  transform: translateY(-3px);
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.detail-metric-grid .cost-estimate-hover .cost-estimate-tooltip {
  top: calc(100% + 6px);
}

.holding-metrics .cost-estimate-hover .cost-estimate-tooltip {
  left: 50%;
  transform: translate(-50%, -3px);
}

.holding-metrics .cost-estimate-hover:hover .cost-estimate-tooltip,
.holding-metrics .cost-estimate-hover:focus-visible .cost-estimate-tooltip {
  transform: translate(-50%, 0);
}

.detail-chart-wrap {
  min-height: 292px;
}

.detail-data-empty {
  min-height: 250px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.detail-data-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 28px;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-data-status .ant-typography {
  font-size: 12px;
}

.detail-chart-wrap .holding-kline {
  margin-top: 0;
}

.detail-section-card .ant-card-head {
  min-height: 40px;
}

.detail-section-card .ant-card-head-title,
.detail-section-card .ant-card-extra {
  padding: 8px 0;
}

.detail-strategy-summary {
  min-height: 116px;
  display: grid;
  align-content: start;
  gap: 8px;
  margin-top: 10px;
}

.detail-backtest-tools {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1.45;
}

.detail-backtest-select {
  min-width: 220px;
  flex: 1 1 220px;
}

.detail-backtest-result {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin: 8px 0;
}

.detail-backtest-result .detail-metric {
  min-height: 52px;
  padding: 6px 8px;
}

.detail-backtest-chart {
  height: 280px;
  border: 1px solid var(--line);
  background: var(--surface-panel);
}

.detail-backtest-chart .backtest-chart {
  height: 278px;
  border: 0;
}

.kronos-tools {
  min-height: 34px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.kronos-result {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.kronos-result .detail-metric {
  min-height: 52px;
  padding: 6px 8px;
}

.kronos-result .detail-metric .ant-typography:last-child {
  color: var(--text);
  font-size: 16px;
  font-weight: 800;
}

.theme-light .kronos-result .detail-metric,
body.theme-light .kronos-result .detail-metric {
  background: #f8fafc;
}

.theme-light .kronos-result .detail-metric.positive .ant-typography:last-child,
body.theme-light .kronos-result .detail-metric.positive .ant-typography:last-child {
  color: #b91c1c;
}

.theme-light .kronos-result .detail-metric.negative .ant-typography:last-child,
body.theme-light .kronos-result .detail-metric.negative .ant-typography:last-child {
  color: #15803d;
}

.kronos-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.kronos-warning {
  display: block;
  font-size: 12px;
  line-height: 1.5;
}

.analysis-box {
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.analysis-box-clickable {
  width: 100%;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.analysis-box-clickable:hover,
.mini-metric-clickable:hover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mini-metric-clickable {
  cursor: pointer;
  outline: none;
}

.mini-metric-clickable:focus-visible,
.analysis-box-clickable:focus-visible {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}

.news-modal-title {
  display: grid;
  gap: 4px;
}

.news-overview {
  display: grid;
  gap: 12px;
}

.news-score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.news-score-card {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.news-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.news-reasons span {
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.news-list {
  max-height: 420px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.news-list .ant-list-item {
  padding: 10px 12px;
}

.news-item-head {
  margin-bottom: 5px;
}

.news-item-title {
  display: block;
  color: var(--text);
  font-weight: 650;
  line-height: 1.45;
}

.news-item-title:hover {
  color: var(--accent);
}

.ai-floating-button {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  width: 52px;
  height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #ffffff;
  cursor: pointer;
  font-weight: 700;
  border-radius: 999px;
  box-shadow: var(--shadow-panel);
}

.ai-bot-mark {
  width: 100%;
  height: 100%;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 999px;
  background: transparent;
  font-size: 14px;
  line-height: 1;
}

.ai-floating-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 1200;
  width: min(760px, calc(100vw - 32px));
  height: min(760px, calc(100vh - 48px));
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}

.ai-floating-head {
  min-height: 58px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border-bottom: 1px solid var(--line);
}

.ai-floating-head > div:first-child {
  display: grid;
  gap: 2px;
}

.ai-panel {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr);
}

.ai-panel-status {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 12px 0;
  flex-wrap: wrap;
}

.ai-config-alert {
  width: 100%;
  margin-top: 8px;
}

.ai-chat-shell {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 12px;
}

.ai-chat-main {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.ai-chat-toolbar {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.ai-message-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 16px;
  overflow: auto;
  background: var(--surface-soft);
}

.ai-message {
  max-width: 88%;
  display: grid;
  gap: 4px;
}

.ai-message.user {
  justify-self: end;
}

.ai-message.assistant {
  justify-self: start;
}

.ai-message-role {
  color: var(--muted);
  font-size: 12px;
}

.ai-message.user .ai-message-role {
  text-align: right;
}

.ai-message-content {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.ai-message-content.ai-markdown-body {
  white-space: normal;
  overflow-wrap: anywhere;
}

.ai-markdown-body > *:first-child {
  margin-top: 0;
}

.ai-markdown-body > *:last-child {
  margin-bottom: 0;
}

.ai-markdown-body p {
  margin: 0 0 12px;
}

.ai-markdown-body h3,
.ai-markdown-body h4,
.ai-markdown-body h5 {
  margin: 16px 0 8px;
  color: var(--text);
  font-weight: 800;
}

.ai-markdown-body ul {
  margin: 0 0 12px 18px;
  padding: 0;
}

.ai-markdown-body li {
  margin: 4px 0;
}

.ai-markdown-body pre {
  margin: 0 0 12px;
  padding: 10px 12px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  white-space: pre-wrap;
}

.ai-markdown-body .markdown-table-wrap {
  max-width: 100%;
  margin: 10px 0 14px;
}

.ai-markdown-body .markdown-table {
  min-width: 420px;
}

.ai-message.user .ai-message-content {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.ai-message-meta {
  font-size: 12px;
}

.ai-action-proposal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.ai-chat-footer {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid var(--line);
}

.ai-command-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.ai-command-row .ant-btn {
  flex: 0 0 auto;
}

.ai-composer {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 76px;
  gap: 8px;
  align-items: end;
}

.ai-composer textarea.ant-input {
  resize: none;
}

.ai-knowledge-side {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--surface);
  overflow: hidden;
}

.ai-side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.ai-knowledge-list {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  overflow: auto;
}

.ai-knowledge-item {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  text-align: left;
  cursor: pointer;
}

.ai-knowledge-item .ant-typography {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ai-knowledge-item:hover,
.ai-knowledge-item:focus-visible {
  border-color: var(--line-strong);
  background: var(--surface-lift);
}

.ai-context-line {
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-metric {
  min-height: 60px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  font-variant-numeric: tabular-nums;
}

.mini-metric .ant-typography {
  margin: 0;
  overflow-wrap: anywhere;
}

.holding-kline {
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface-panel);
}

.six-pulse-lights {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius) var(--radius) 0 0;
  background: var(--surface-panel);
  font-size: 12px;
  overflow: hidden;
}

.six-pulse-lights + .holding-kline {
  margin-top: 0;
  border-radius: 0 0 var(--radius) var(--radius);
}

.six-pulse-title { font-weight: 700; white-space: nowrap; }
.six-pulse-summary { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.six-pulse-summary.is-buy { color: var(--positive); }
.six-pulse-summary.is-weak { color: var(--negative); }
.six-pulse-light-list { display: flex; align-items: center; gap: 8px; min-width: 0; }
.six-pulse-light { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); white-space: nowrap; }
.six-pulse-light i { width: 8px; height: 8px; border-radius: 50%; background: #d4380d; box-shadow: 0 0 0 2px color-mix(in srgb, #d4380d 16%, transparent); }
.six-pulse-light.is-on { color: var(--text); }
.six-pulse-light.is-on i { background: #389e0d; box-shadow: 0 0 0 2px color-mix(in srgb, #389e0d 16%, transparent); }

@media (max-width: 640px) {
  .six-pulse-lights { gap: 7px; padding: 6px 8px; overflow-x: auto; scrollbar-width: none; }
  .six-pulse-lights::-webkit-scrollbar { display: none; }
  .six-pulse-light-list { gap: 6px; }
  .six-pulse-light { font-size: 11px; }
}

.kline-svg {
  display: block;
  width: 100%;
  height: auto;
  border: 0;
  background: transparent;
}

.backtest-chart {
  width: 100%;
  height: 568px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
  overflow: hidden;
}

.theme-light .backtest-chart,
body.theme-light .backtest-chart,
.theme-light .holding-kline,
body.theme-light .holding-kline {
  background: #ffffff;
}

.theme-light .holding-kline,
body.theme-light .holding-kline,
.theme-light .backtest-chart,
body.theme-light .backtest-chart {
  border-color: #d9dde3;
}

.theme-light .holding-kline svg,
body.theme-light .holding-kline svg,
.theme-light .backtest-chart svg,
body.theme-light .backtest-chart svg {
  background: #ffffff;
}

.theme-light .backtest-chart > div,
body.theme-light .backtest-chart > div,
.theme-light .detail-backtest-chart,
body.theme-light .detail-backtest-chart {
  background: #ffffff !important;
}

.theme-light .kline-svg,
body.theme-light .kline-svg {
  background: transparent;
}

.strategy-card {
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.strategy-empty {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.strategy-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.strategy-card .ant-tabs-nav {
  margin-bottom: 6px;
}

.strategy-card .ant-tabs-tab {
  padding: 5px 0;
  white-space: nowrap;
}

.strategy-card .ant-tabs-tab-btn {
  font-size: 13px;
}

.strategy-select {
  width: 100%;
  margin-bottom: 8px;
}

.strategy-body-compact {
  min-height: 132px;
  display: grid;
  align-content: start;
  gap: 6px;
}

.strategy-main-line {
  min-height: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.strategy-main-line .ant-tag {
  margin-inline-end: 0;
}

.strategy-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-name-button {
  min-width: 0;
  max-width: 260px;
  height: auto;
  padding: 0;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-name-button:hover {
  color: var(--accent);
}

.strategy-code-tag {
  flex: 0 0 auto;
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strategy-meta-line {
  min-height: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
  white-space: nowrap;
}

.strategy-meta-line span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.strategy-rule-line {
  display: -webkit-box;
  min-height: 40px;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.strategy-execution-note,
.detail-strategy-note {
  display: block;
  min-height: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composite-breakdown {
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.composite-breakdown-group {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-height: 24px;
}

.composite-breakdown-title {
  font-size: 12px;
  white-space: nowrap;
}

.composite-breakdown-items {
  display: flex;
  min-width: 0;
  gap: 6px;
  overflow: hidden;
}

.composite-breakdown-items span {
  flex: 0 1 auto;
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-lift);
  color: var(--text);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.composite-breakdown-items span.score-positive {
  border-color: rgba(74, 222, 128, 0.32);
  color: var(--positive);
}

.composite-breakdown-items span.score-negative {
  border-color: rgba(248, 113, 113, 0.36);
  color: var(--negative);
}

.strategy-stat-line {
  min-height: 22px;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
}

.strategy-stat-line span {
  flex: 0 1 auto;
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-reasons {
  display: flex;
  gap: 6px;
  overflow: hidden;
}

.strategy-reasons span {
  flex: 0 1 auto;
  min-width: 0;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-explain-head,
.strategy-explain-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.strategy-explain-card .ant-card-body {
  padding: 10px 12px;
}

.strategy-explain-reasons {
  display: grid;
  gap: 6px;
  color: var(--text);
  line-height: 1.55;
}

.strategy-explain-reasons div,
.strategy-explain-stats span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.strategy-explain-stats span {
  font-size: 12px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* ---- Tab-based Strategy Panel ---- */
.strategy-card-tabbed {
  padding: 8px 12px 12px;
}

.strategy-card-tabbed .strategy-tabs {
  margin-bottom: 0;
}

.strategy-card-tabbed .strategy-tabs .ant-tabs-nav {
  margin-bottom: 8px;
}

.strategy-card-tabbed .strategy-tabs .ant-tabs-tab {
  padding: 4px 0;
}

.strategy-card-tabbed .strategy-tabs .ant-tabs-tab-btn {
  font-size: 13px;
}

.strategy-tab-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.strategy-tab-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--muted);
}

.strategy-tab-dot-buy {
  background: var(--positive);
}

.strategy-tab-dot-sell {
  background: var(--negative);
}

.strategy-tab-dot-watch {
  background: var(--warning, #faad14);
}

.strategy-tab-score {
  font-size: 11px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.strategy-tab-score.score-positive {
  color: var(--positive);
}

.strategy-tab-score.score-negative {
  color: var(--negative);
}

/* Tab composite summary card */
.strategy-tab-composite {
  padding: 8px 10px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.strategy-tab-composite-buy {
  border-color: rgba(248, 113, 113, 0.32);
  background: rgba(248, 113, 113, 0.08);
}

.strategy-tab-composite-sell {
  border-color: rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.08);
}

.strategy-tab-composite-head {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-tab-composite-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.strategy-tab-composite-score {
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}

.strategy-tab-composite-score.score-positive {
  color: var(--positive);
}

.strategy-tab-composite-score.score-negative {
  color: var(--negative);
}

.strategy-tab-composite-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

.ops-summary-card,
.ops-table-card {
  border-radius: 8px;
}

.ops-table-card .ant-table {
  background: transparent;
}

.ops-table-card .ant-table-thead > tr > th {
  background: var(--surface-soft);
}

.ops-table-card .ant-table-tbody > tr > td {
  background: var(--surface);
}

/* Strategy list within tab */
.strategy-tab-list {
  display: grid;
  gap: 4px;
  max-height: 320px;
  overflow-y: auto;
}

.strategy-tab-item {
  padding: 6px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.strategy-tab-item:hover {
  border-color: var(--accent);
}

.strategy-tab-item-active {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.strategy-tab-item-triggered {
  border-left: 3px solid var(--accent);
}

.strategy-tab-item-triggered.strategy-tab-item-active {
  border-left-color: var(--accent);
}

.strategy-tab-item-buy.strategy-tab-item-triggered {
  border-left-color: #ef4444;
  border-color: rgba(248, 113, 113, 0.28);
  background: rgba(248, 113, 113, 0.06);
}

.strategy-tab-item-sell.strategy-tab-item-triggered {
  border-left-color: #16a34a;
  border-color: rgba(74, 222, 128, 0.28);
  background: rgba(74, 222, 128, 0.06);
}

.theme-light .strategy-tab-composite-buy,
body.theme-light .strategy-tab-composite-buy,
.theme-light .strategy-tab-item-buy.strategy-tab-item-triggered,
body.theme-light .strategy-tab-item-buy.strategy-tab-item-triggered {
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(220, 38, 38, 0.12);
}

.theme-light .strategy-tab-composite-sell,
body.theme-light .strategy-tab-composite-sell,
.theme-light .strategy-tab-item-sell.strategy-tab-item-triggered,
body.theme-light .strategy-tab-item-sell.strategy-tab-item-triggered {
  border-color: rgba(22, 163, 74, 0.34);
  background: rgba(22, 163, 74, 0.12);
}

.theme-light .strategy-tab-item-buy.strategy-tab-item-active,
body.theme-light .strategy-tab-item-buy.strategy-tab-item-active {
  border-color: rgba(220, 38, 38, 0.42);
}

.theme-light .strategy-tab-item-sell.strategy-tab-item-active,
body.theme-light .strategy-tab-item-sell.strategy-tab-item-active {
  border-color: rgba(22, 163, 74, 0.44);
}

.strategy-tab-item-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 24px;
}

.strategy-tab-item-tag {
  margin-inline-end: 0;
}

.strategy-tab-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-tab-item-delta {
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.strategy-tab-item-delta.score-positive {
  color: var(--positive);
}

.strategy-tab-item-delta.score-negative {
  color: var(--negative);
}

.strategy-tab-item-detail {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 4px;
}

.strategy-tab-item-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.strategy-tab-item-rule {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.4;
  font-size: 12px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.strategy-tab-item-reasons {
  display: flex;
  gap: 4px;
  overflow: hidden;
}

.strategy-tab-item-reasons span {
  flex: 0 1 auto;
  min-width: 0;
  padding: 1px 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-lift, var(--surface));
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.strategy-tab-empty {
  padding: 16px;
  text-align: center;
}

.signal-note {
  min-height: 34px;
  margin-top: 8px;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  white-space: nowrap;
}

.theme-light .signal-note,
body.theme-light .signal-note {
  color: #111111;
}

.signal-note-label,
.signal-note-meta,
.signal-note-action {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 1px 7px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.signal-note-label {
  color: var(--text);
}

.signal-note-name,
.signal-note-reason {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.signal-note-name {
  flex: 0 1 auto;
  max-width: 220px;
  font-weight: 700;
  color: var(--text);
}

.signal-note-reason {
  flex: 1 1 auto;
  color: var(--muted);
}

.signal-note-sell {
  border-color: rgba(74, 222, 128, 0.35);
  background: rgba(74, 222, 128, 0.07);
}

.theme-light .signal-note-sell,
body.theme-light .signal-note-sell {
  border-color: rgba(22, 163, 74, 0.36);
  background: rgba(22, 163, 74, 0.12);
  color: #111111;
}

.signal-note-buy {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.07);
}

.theme-light .signal-note-buy,
body.theme-light .signal-note-buy {
  border-color: rgba(220, 38, 38, 0.34);
  background: rgba(220, 38, 38, 0.12);
  color: #111111;
}

.signal-note-buy .signal-note-action {
  border-color: rgba(248, 113, 113, 0.42);
  color: #fecaca;
}

.signal-note-sell .signal-note-action {
  border-color: rgba(74, 222, 128, 0.42);
  color: #bbf7d0;
}

.theme-light .signal-note-buy .signal-note-action,
body.theme-light .signal-note-buy .signal-note-action {
  border-color: rgba(220, 38, 38, 0.32);
  background: rgba(220, 38, 38, 0.08);
  color: #991b1b;
}

.theme-light .signal-note-sell .signal-note-action,
body.theme-light .signal-note-sell .signal-note-action {
  border-color: rgba(22, 163, 74, 0.32);
  background: rgba(22, 163, 74, 0.08);
  color: #166534;
}

.positive-text {
  color: var(--positive);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.negative-text {
  color: var(--negative);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.theme-light .positive-text,
body.theme-light .positive-text {
  color: var(--positive);
}

.theme-light .negative-text,
body.theme-light .negative-text {
  color: var(--negative);
}

.task-index {
  display: inline-grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  color: var(--accent);
  font-weight: 700;
}

.knowledge-overview {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.knowledge-overview .ant-typography {
  margin-top: 0;
}

.knowledge-category-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.knowledge-category-list {
  display: grid;
  align-content: start;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
  overflow: hidden;
}

.knowledge-category-item {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  border: 0;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.knowledge-category-item:hover {
  background: var(--surface-lift);
}

.knowledge-category-item.active {
  background: var(--accent);
  color: #ffffff;
}

.knowledge-category-detail {
  min-width: 0;
}

.knowledge-category-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 14px;
  margin-bottom: 12px;
}

.knowledge-category-head .ant-typography {
  margin-top: 0;
}

.knowledge-template-box {
  min-height: 82px;
  display: grid;
  align-content: center;
  gap: 5px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.knowledge-root-excerpt {
  max-width: 520px;
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.knowledge-file-link {
  height: auto;
  padding: 0;
  white-space: normal;
  text-align: left;
  line-height: 1.35;
}

.knowledge-file-link.root {
  font-weight: 700;
}

.markdown-preview-modal .ant-modal-body {
  max-height: min(72vh, 760px);
  padding: 0;
  overflow: auto;
  background: var(--surface-soft);
}

.markdown-preview-title {
  display: grid;
  gap: 4px;
}

.markdown-preview-body {
  padding: 22px 24px 28px;
  color: var(--text);
  line-height: 1.72;
  font-size: 14px;
}

.markdown-preview-body h3,
.markdown-preview-body h4,
.markdown-preview-body h5 {
  margin: 22px 0 10px;
  color: var(--text);
  font-weight: 800;
}

.markdown-preview-body h3:first-child,
.markdown-preview-body h4:first-child,
.markdown-preview-body h5:first-child {
  margin-top: 0;
}

.markdown-preview-body p {
  margin: 0 0 12px;
}

.markdown-preview-body ul {
  margin: 0 0 14px 18px;
  padding: 0;
}

.markdown-preview-body li {
  margin: 4px 0;
}

.markdown-preview-body code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.markdown-preview-body pre {
  margin: 0 0 14px;
  padding: 12px 14px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

.markdown-preview-body pre code {
  padding: 0;
  border: 0;
  background: transparent;
}

.markdown-table-wrap {
  margin: 12px 0 16px;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--surface);
}

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

.markdown-table th,
.markdown-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
}

.markdown-table th {
  background: var(--surface-soft);
  font-weight: 800;
}

.markdown-image {
  margin: 14px 0;
}

.markdown-image img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--line);
}

.markdown-image figcaption {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.backtest-chart > div {
  min-height: 100%;
}

.output-panel {
  min-height: 360px;
  max-height: 64vh;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  overflow: auto;
  font-family: var(--font-mono);
  line-height: 1.5;
  font-size: 15px;
}

.output-panel-modal {
  min-height: 320px;
}

.task-output-modal .ant-modal-body {
  padding-top: 10px;
}

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

  .app-sidebar {
    display: none;
  }

  .sider-status {
    position: static;
  }

  .app-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    min-height: auto;
    padding: 8px 12px;
  }

  .mobile-brand {
    display: block;
  }

  .app-content {
    width: min(100% - 24px, 1760px);
    padding: 12px 0 36px;
  }

  .brand-block {
    min-width: 0;
    width: 42px;
    grid-template-columns: 42px;
  }

  .brand-mark {
    width: 42px;
    height: 34px;
    font-size: 13px;
  }

  .top-nav-menu {
    grid-column: 1 / -1;
    width: 100%;
    order: 3;
    padding-bottom: 2px;
    justify-content: flex-start;
  }

  .top-nav-item,
  .top-nav-more {
    height: 34px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .header-actions {
    width: auto;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    flex-wrap: nowrap;
  }

  .header-status-tag {
    display: none;
  }

  .header-actions .ant-btn {
    height: 34px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .header-actions > .ant-btn:not(.account-trigger) {
    padding-inline: 9px;
  }

  .theme-switch-box .ant-segmented-item-label {
    padding-inline: 7px;
  }

  .refresh-field,
  .refresh-field .ant-input-number {
    width: 64px;
    min-width: 64px;
  }

  .account-name,
  .account-caret {
    display: none;
  }

  .account-trigger {
    padding-inline: 6px;
    max-width: 38px;
  }

  .app-page-head {
    min-height: 48px;
    margin-bottom: 12px;
    padding: 10px 12px;
    gap: 8px;
    box-shadow: none;
  }

  .app-page-head .eyebrow,
  .app-page-head .sider-status {
    display: none;
  }

  .page-head-subtitle {
    display: none;
  }

  .page-head-side {
    flex: 0 0 auto;
    gap: 6px;
  }

  .page-head-actions .ant-btn {
    height: 30px;
    padding-inline: 10px;
    font-size: 13px;
  }

  .app-page-head h2.ant-typography {
    font-size: 20px;
    line-height: 1.15;
  }

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

  .detail-side {
    grid-template-columns: 1fr;
  }

  .knowledge-category-layout,
  .knowledge-category-head {
    grid-template-columns: 1fr;
  }

  .review-allocation-grid {
    grid-template-columns: 1fr;
  }

  .review-ai-actions {
    align-items: flex-start;
    flex-direction: column;
  }

  .review-overview-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .review-overview-bar > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 2px;
  }

  .review-overview-note {
    white-space: normal;
  }

  .review-detail-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .market-index-strip {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .tick-dashboard-body {
    grid-template-columns: 1fr;
  }

  .tick-dashboard-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 640px) {
  body {
    min-width: 0;
    overflow-x: clip;
  }

  .ant-app-shell {
    display: block;
  }

  .brand-block {
    min-height: 36px;
    width: 42px;
    min-width: 42px;
    grid-template-columns: 42px;
    gap: 0;
  }

  .brand-mark {
    width: 42px;
    height: 34px;
    font-size: 13px;
  }

  .app-header {
    position: sticky;
    top: 0;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px;
    min-height: 56px;
    padding: 8px 12px;
  }

  .mobile-brand {
    display: block;
  }

  .top-nav-menu {
    display: none;
  }

  .header-actions {
    gap: 5px;
    min-width: 0;
  }

  .theme-switch-box .ant-segmented {
    width: 92px;
    min-width: 92px;
    padding: 2px;
    border-radius: 12px;
  }

  .theme-switch-box .ant-segmented-item-label {
    min-width: 28px;
    min-height: 28px;
    padding-inline: 0;
    line-height: 28px;
    font-size: 14px;
    text-align: center;
  }

  .refresh-field {
    display: flex;
    width: 58px;
    min-width: 58px;
  }

  .refresh-field .ant-input-number {
    width: 58px;
    min-width: 58px;
  }

  .refresh-field .ant-input-number-input {
    padding-inline: 6px;
    font-size: 12px;
  }

  .header-actions > .header-icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding-inline: 0;
    overflow: hidden;
    font-size: 0;
  }

  .header-actions > .header-icon-button::before {
    content: "↻";
    font-size: 16px;
    line-height: 1;
  }

  .account-trigger.ant-btn {
    width: 34px;
    min-width: 34px;
    height: 34px;
    padding: 0;
    border-radius: 12px;
  }

  .account-avatar {
    width: 24px;
    height: 24px;
    margin: 0 auto;
    font-size: 12px;
  }

  .top-nav-item,
  .top-nav-more {
    height: 32px;
    padding-inline: 9px;
  }

  .app-content {
    width: min(100% - 20px, 1760px);
    padding: 10px 0 calc(88px + env(safe-area-inset-bottom));
  }

  .mobile-bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    min-height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: color-mix(in srgb, var(--surface-panel) 94%, transparent);
    box-shadow: 0 -10px 28px rgba(0, 0, 0, 0.18);
    backdrop-filter: blur(16px);
  }

  .mobile-nav-item.ant-btn {
    height: 52px;
    min-width: 0;
    padding: 0 4px;
    border-radius: 14px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
  }

  .mobile-nav-item .nav-label {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
  }

  .mobile-nav-item .nav-icon {
    font-size: 18px;
  }

  .mobile-nav-item .nav-text {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-nav-item.is-active,
  .mobile-nav-item.is-active:hover,
  .mobile-nav-item.is-active:focus-visible {
    color: var(--accent) !important;
    background: var(--accent-soft) !important;
  }

  .app-page-head {
    min-height: 42px;
    padding: 8px 10px;
  }

  .app-page-head h2.ant-typography {
    font-size: 18px;
  }

  .page-head-actions .ant-btn:not(.ant-btn-primary) {
    display: none;
  }

  .dashboard-page-header {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .dashboard-page-header h2.ant-typography {
    font-size: 20px;
  }

  .portfolio-summary-cards {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .portfolio-summary-card {
    min-height: 92px;
  }

  .portfolio-summary-card .ant-card-body {
    gap: 10px;
    padding: 12px;
  }

  .summary-icon {
    font-size: 20px;
  }

  .summary-value {
    font-size: 17px;
  }

  .dashboard-signal-grid {
    grid-template-columns: 1fr;
  }

  .sector-rank-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .sector-rank-row {
    grid-template-columns: 24px minmax(82px, 1fr) 58px 64px minmax(62px, 0.8fr);
    gap: 6px;
    padding: 5px 7px;
  }

  .sector-rank-row span:nth-child(5),
  .sector-rank-row span:nth-child(6) {
    display: none;
  }

  .money-flow-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .money-flow-state {
    grid-column: span 2;
  }

  .money-flow-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .money-flow-rank-row {
    grid-template-columns: 24px minmax(86px, 1fr) 70px 54px;
    gap: 6px;
    padding: 5px 7px;
  }

  .money-flow-rank-row-fallback {
    grid-template-columns: 24px minmax(86px, 1fr) 66px minmax(76px, 1fr);
  }

  .money-flow-rank-row span:nth-child(5) {
    display: none;
  }

  .money-flow-watch-row {
    grid-template-columns: minmax(88px, 1fr) 76px 88px auto;
    gap: 6px;
    padding: 5px 7px;
  }

  .money-flow-stock-row {
    min-width: 840px;
    grid-template-columns: minmax(118px, 1.2fr) 54px repeat(7, minmax(76px, 0.8fr)) 54px;
    gap: 6px;
    padding: 5px 7px;
  }

  .position-bar-header {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .position-bar-val {
    display: none;
  }

  .dashboard-mini-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .watch-preview-row {
    grid-template-columns: minmax(0, 1fr) minmax(118px, auto);
  }

  .watch-preview-side {
    max-width: 132px;
    gap: 6px;
  }

  .watch-preview-side .ant-tag {
    max-width: 72px;
  }

  .ant-card-body {
    padding: 12px;
  }

  .ant-card-head {
    min-height: 44px;
    padding: 0 12px;
  }

  .app-content .ant-table-wrapper {
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .app-content .ant-table-wrapper .ant-table {
    min-width: 680px;
  }

  .editor-card .ant-row {
    row-gap: 8px !important;
  }

  .holding-card .ant-card-head {
    padding: 0 10px;
  }

  .holding-card .ant-card-body {
    padding: 10px;
  }

  .holding-card,
  .holding-card .ant-card-body,
  .holding-metrics {
    overflow: visible;
  }

  .chip-distribution-popover,
  .chip-distribution-detail .chip-distribution-popover {
    position: relative;
    top: 0;
    left: 0;
    width: 100%;
    margin-top: 6px;
    padding: 10px 10px 8px;
    transform: none;
  }

  .chip-distribution-popover-head strong,
  .chip-distribution-popover-head > strong {
    font-size: 13px;
  }

  .chip-distribution-popover-head {
    gap: 5px;
  }

  .chip-distribution-popover-head > div {
    gap: 5px;
  }

  .chip-distribution-date {
    margin-top: 5px;
    font-size: 10px;
  }

  .chip-distribution-legend {
    gap: 9px;
    padding-top: 5px;
    font-size: 10px;
  }

  .chip-distribution-hover .chip-distribution-popover,
  .chip-distribution-detail .chip-distribution-popover {
    visibility: visible;
    opacity: 1;
    transform: none !important;
  }

  .holding-card-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
  }

  .holding-card-side {
    width: 100%;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    justify-items: stretch;
    gap: 8px;
  }

  .holding-card-actions {
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-end;
  }

  .holding-card-actions .ant-btn {
    flex: 0 0 auto;
    min-width: 56px;
  }

  .watchlist-table .ant-table-thead > tr > th,
  .watchlist-table .ant-table-tbody > tr > td {
    padding: 9px 8px;
  }

  .watchlist-table .ant-btn {
    padding-inline: 7px;
  }

  .mini-metric {
    min-height: 54px;
    padding: 7px;
  }

  .metric-card {
    height: 78px;
  }

  .metric-card .ant-card-body {
    padding: 10px 12px;
  }

  .metric-card-label {
    font-size: 12px;
  }

  .metric-card-value {
    font-size: 18px;
  }

  .rule-card {
    height: 82px;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 10px;
  }

  .strategy-sync-note,
  .signal-note {
    align-items: flex-start;
    flex-wrap: wrap;
    white-space: normal;
  }

  .signal-note-name {
    max-width: calc(100vw - 144px);
  }

  .signal-note-reason {
    flex-basis: 100%;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .strategy-body-compact {
    min-height: auto;
  }

  .strategy-main-line,
  .strategy-meta-line,
  .strategy-stat-line,
  .strategy-reasons {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .strategy-main-line::-webkit-scrollbar,
  .strategy-meta-line::-webkit-scrollbar,
  .strategy-stat-line::-webkit-scrollbar,
  .strategy-reasons::-webkit-scrollbar {
    display: none;
  }

  .strategy-name-button {
    max-width: 180px;
  }

  .backtest-chart {
    height: 360px;
  }

  .kline-svg {
    min-height: 220px;
  }

  .detail-title {
    align-items: flex-start;
    flex-direction: column;
    padding-right: 0;
  }

  .detail-metric-grid,
  .detail-backtest-result {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .holding-detail-modal.ant-modal,
  .holding-detail-modal .ant-modal,
  .news-overview-modal.ant-modal,
  .news-overview-modal .ant-modal,
  .markdown-preview-modal.ant-modal,
  .markdown-preview-modal .ant-modal,
  .strategy-explain-modal.ant-modal,
  .strategy-explain-modal .ant-modal {
    top: 0;
    max-width: 100vw;
    margin: 0;
    padding: 0;
  }

  .holding-detail-modal.ant-modal .ant-modal-content,
  .holding-detail-modal .ant-modal-content,
  .news-overview-modal.ant-modal .ant-modal-content,
  .news-overview-modal .ant-modal-content,
  .markdown-preview-modal.ant-modal .ant-modal-content,
  .markdown-preview-modal .ant-modal-content,
  .strategy-explain-modal.ant-modal .ant-modal-content,
  .strategy-explain-modal .ant-modal-content {
    min-height: 100vh;
    border-radius: 0;
  }

  .holding-detail-modal.ant-modal .ant-modal-body,
  .holding-detail-modal .ant-modal-body,
  .news-overview-modal.ant-modal .ant-modal-body,
  .news-overview-modal .ant-modal-body,
  .markdown-preview-modal.ant-modal .ant-modal-body,
  .markdown-preview-modal .ant-modal-body,
  .strategy-explain-modal.ant-modal .ant-modal-body,
  .strategy-explain-modal .ant-modal-body {
    max-height: calc(100vh - 56px);
    overflow: auto;
  }

  .detail-backtest-tools {
    display: grid;
    grid-template-columns: 1fr;
  }

  .detail-backtest-select {
    min-width: 0;
    width: 100%;
  }

  .news-score-grid {
    grid-template-columns: 1fr;
  }

  .markdown-preview-body {
    padding: 14px;
  }

  .knowledge-overview {
    display: grid;
  }

  .knowledge-category-list {
    display: flex;
    overflow-x: auto;
    gap: 0;
    scrollbar-width: none;
  }

  .knowledge-category-list::-webkit-scrollbar {
    display: none;
  }

  .knowledge-category-item {
    flex: 0 0 142px;
  }

  .knowledge-template-box {
    min-height: auto;
  }

  .markdown-table {
    min-width: 460px;
  }

  .ai-floating-panel {
    inset: 0;
    width: 100vw;
    height: 100vh;
    border: 0;
    box-shadow: none;
  }

  .ai-floating-button {
    right: 14px;
    bottom: calc(92px + env(safe-area-inset-bottom));
    width: 48px;
    height: 48px;
    border-radius: 999px;
  }

  .ai-floating-button .ai-bot-mark {
    width: 100%;
    height: 100%;
    font-size: 14px;
  }

  .ai-floating-head {
    min-height: 54px;
    padding: 10px;
  }

  .ai-panel-status {
    padding: 10px 10px 0;
  }

  .ai-chat-shell {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .ai-knowledge-side {
    display: none;
  }

  .ai-chat-toolbar,
  .ai-composer {
    grid-template-columns: 1fr;
  }

  .ai-message {
    max-width: 96%;
  }

  .ai-command-row {
    padding-bottom: 2px;
  }

  .output-panel {
    min-height: 280px;
    max-height: 62vh;
    padding: 12px;
    font-size: 13px;
  }

  .market-terminal-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 9px;
  }

  .market-terminal-title {
    flex-wrap: wrap;
    gap: 4px 8px;
  }

  .market-terminal-head .ant-space {
    width: 100%;
  }

  .market-terminal-head .page-head-actions {
    margin-left: auto;
  }

  .market-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  }

  .market-index-item {
    padding: 9px 10px;
  }

  .market-index-item strong {
    font-size: 14px;
  }

  .tick-dashboard .market-terminal-head {
    padding: 8px;
  }

  .tick-dashboard .market-index-strip,
  .tick-dashboard .market-kpi-grid,
  .tick-core-grid,
  .tick-heat-grid,
  .tick-stock-grid,
  .tick-dashboard-side {
    grid-template-columns: 1fr;
  }

  .tick-dashboard .market-kpi {
    min-height: 78px;
  }

  .tick-dashboard .market-kpi strong {
    font-size: 19px;
  }

  .tick-dashboard .market-index-item {
    min-height: 62px;
  }

  .tick-distribution-bars {
    height: 112px;
  }

  .tick-radar-wrap {
    min-height: 205px;
  }

  .limit-ladder-grid {
    grid-template-columns: 1fr;
  }

  .terminal-position-panel .ant-table-wrapper {
    overflow-x: auto;
    max-width: 100%;
  }

  .terminal-position-panel .ant-table {
    min-width: 760px;
  }
}

@media (max-width: 420px) {
  .app-header {
    padding-inline: 8px;
  }

  .theme-switch-box .ant-segmented {
    width: 86px;
    min-width: 86px;
  }

  .theme-switch-box .ant-segmented-item-label {
    min-width: 26px;
  }

  .header-actions {
    gap: 4px;
  }

  .holding-metrics .ant-col {
    flex: 0 0 50%;
    max-width: 50%;
  }

  .metric-card-value,
  .metric-card .ant-typography.metric-card-value {
    font-size: 16px;
  }

  .detail-metric-grid,
  .detail-backtest-result {
    grid-template-columns: 1fr;
  }

  .backtest-chart {
    height: 320px;
  }
}
