:root {
  color-scheme: light;
  --page: #f4f7fb;
  --page-strong: #eaf0f8;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --surface-raised: #ffffff;
  --ink: #132238;
  --ink-soft: #34445a;
  --muted: #718096;
  --line: #dfe6ef;
  --line-strong: #c9d4e2;
  --primary: #164e9b;
  --primary-strong: #0f3c7c;
  --primary-soft: #eaf2ff;
  --up: #d92d20;
  --up-soft: #fff0ee;
  --down: #079455;
  --down-soft: #eafaf2;
  --warning: #b54708;
  --warning-soft: #fff7e8;
  --shadow: 0 12px 32px rgba(31, 51, 81, 0.09);
  --shadow-soft: 0 5px 16px rgba(31, 51, 81, 0.07);
  --radius-xl: 22px;
  --radius-lg: 17px;
  --radius-md: 13px;
  --radius-sm: 9px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 8% -10%, rgba(22, 78, 155, 0.14), transparent 34rem),
    linear-gradient(180deg, #f8fbff 0, var(--page) 36rem, var(--page) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(38, 99, 235, 0.28);
  outline-offset: 2px;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  transform: translateY(-140%);
}

.skip-link:focus {
  transform: translateY(0);
}

.app-shell {
  min-height: 100vh;
}

.app-header {
  position: sticky;
  z-index: 50;
  top: 0;
  padding: calc(10px + var(--safe-top)) max(14px, var(--safe-right)) 0 max(14px, var(--safe-left));
  border-bottom: 1px solid rgba(201, 212, 226, 0.8);
  background: rgba(248, 251, 255, 0.92);
  box-shadow: 0 6px 20px rgba(31, 51, 81, 0.06);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 1320px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 9px;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(145deg, #173f79, #2366ba);
  box-shadow: 0 7px 18px rgba(22, 78, 155, 0.22);
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 23px;
  font-weight: 800;
  line-height: 1;
}

.brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.18;
}

.brand-copy strong {
  overflow: hidden;
  font-size: 17px;
  letter-spacing: -0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-copy small {
  margin-top: 2px;
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.icon-button {
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 13px;
  font-weight: 750;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.icon-button:active {
  transform: scale(0.97);
}

.icon-button.is-loading {
  cursor: wait;
  opacity: 0.62;
}

.header-metrics {
  display: flex;
  gap: 7px;
  max-width: 1320px;
  margin: 9px auto 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.header-metrics::-webkit-scrollbar {
  display: none;
}

.status-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  max-width: 100%;
  min-height: 28px;
  padding: 4px 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill.is-ok {
  border-color: #b9dfcb;
  background: var(--down-soft);
  color: #087443;
}

.status-pill.is-warn {
  border-color: #f1d39b;
  background: var(--warning-soft);
  color: var(--warning);
}

.status-pill.is-error {
  border-color: #fac1bc;
  background: var(--up-soft);
  color: #a52018;
}

.top-tabs {
  display: flex;
  max-width: 1320px;
  margin: 7px auto 0;
  padding: 0 0 9px;
  overflow-x: auto;
  gap: 5px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.top-tabs::-webkit-scrollbar {
  display: none;
}

.tab-button {
  position: relative;
  flex: 0 0 auto;
  min-height: 39px;
  padding: 0 13px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.tab-button:active {
  transform: scale(0.97);
}

.tab-button.is-active {
  background: var(--primary);
  box-shadow: 0 8px 18px rgba(22, 78, 155, 0.19);
  color: #fff;
}

.main-content {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 20px max(14px, var(--safe-right)) 34px max(14px, var(--safe-left));
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--primary);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.page-heading h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 35px);
  letter-spacing: -0.045em;
  line-height: 1.14;
}

.page-subtitle {
  max-width: 760px;
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.updated-at {
  flex: 0 0 auto;
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 10px;
  text-align: right;
  white-space: nowrap;
}

.view {
  min-height: 280px;
}

.section-stack {
  display: grid;
  gap: 14px;
}

.panel,
.metric-card,
.status-card,
.strategy-card,
.watch-group,
.board-card,
.detail-shell,
.avoid-card {
  border: 1px solid rgba(218, 226, 237, 0.94);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  overflow: hidden;
  padding: 15px;
  border-radius: var(--radius-lg);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 13px;
}

.panel-title {
  margin: 0;
  font-size: 16px;
  letter-spacing: -0.02em;
}

.panel-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.segmented {
  display: inline-flex;
  max-width: 100%;
  padding: 3px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  scrollbar-width: none;
}

.segmented::-webkit-scrollbar {
  display: none;
}

.segment-button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 0 11px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.segment-button.is-active {
  background: #fff;
  box-shadow: 0 3px 10px rgba(31, 51, 81, 0.09);
  color: var(--primary);
}

.metric-grid,
.index-grid,
.status-grid,
.indicator-grid,
.avoid-grid,
.quote-grid {
  display: grid;
  gap: 10px;
}

.muted-list {
  margin: 12px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.hub-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
}

.hub-group {
  padding: 4px 0 14px;
}

.hub-group-heading {
  margin-bottom: 12px;
}

.hub-group-heading h2 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.hub-group-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.hub-card {
  display: flex;
  min-height: 156px;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.hub-card:hover,
.hub-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(31, 51, 81, 0.1);
  outline: none;
  transform: translateY(-1px);
}

.hub-card-kicker {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.hub-card strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.35;
}

.hub-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hub-card-action {
  margin-top: auto;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
}

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

.metric-card {
  position: relative;
  min-width: 0;
  padding: 13px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.metric-card::after {
  position: absolute;
  right: -24px;
  bottom: -30px;
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(22, 78, 155, 0.09), transparent 70%);
  content: "";
  pointer-events: none;
}

.metric-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.metric-value {
  margin: 7px 0 2px;
  overflow-wrap: anywhere;
  font-size: clamp(17px, 5.4vw, 24px);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.035em;
  line-height: 1.18;
}

.metric-change,
.metric-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.positive {
  color: var(--up) !important;
}

.negative {
  color: var(--down) !important;
}

.neutral,
.missing {
  color: var(--muted) !important;
}

.missing {
  font-style: normal;
}

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

.status-card {
  min-width: 0;
  padding: 13px;
  border-radius: var(--radius-md);
  background: linear-gradient(150deg, #fff, #f8fbff);
}

.status-card.wide {
  grid-column: 1 / -1;
}

.status-value {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 820;
}

.status-note {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.sentiment-meter {
  position: relative;
  height: 10px;
  margin: 14px 0 8px;
  overflow: hidden;
  border-radius: 999px;
  background: linear-gradient(90deg, #0b7a4b 0%, #82b34a 34%, #f3c74f 53%, #db7a58 72%, #cf2e2e 100%);
}


.meter-pos-0 { left: 0%; }
.meter-pos-1 { left: 10%; }
.meter-pos-2 { left: 20%; }
.meter-pos-3 { left: 30%; }
.meter-pos-4 { left: 40%; }
.meter-pos-5 { left: 50%; }
.meter-pos-6 { left: 60%; }
.meter-pos-7 { left: 70%; }
.meter-pos-8 { left: 80%; }
.meter-pos-9 { left: 90%; }
.meter-pos-10 { left: 100%; }

.sentiment-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: 0 2px 7px rgba(19, 34, 56, 0.28);
  transform: translate(-50%, -50%);
}

.hint-list {
  display: grid;
  gap: 9px;
}

.hint-card {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.hint-card.is-risk {
  border-color: #f0c6c0;
  background: var(--up-soft);
}

.hint-card.is-open {
  border-color: #b9dfcb;
  background: var(--down-soft);
}

.hint-card.is-warn {
  border-color: #eed8a9;
  background: var(--warning-soft);
}

.hint-title {
  margin: 0;
  font-size: 13px;
  font-weight: 800;
}

.hint-copy {
  margin: 5px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  white-space: pre-wrap;
}

.board-layout {
  display: grid;
  gap: 14px;
}

.board-list {
  display: grid;
  gap: 9px;
}

.board-card {
  display: grid;
  width: 100%;
  padding: 13px;
  border-radius: var(--radius-md);
  color: inherit;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.board-card:hover {
  border-color: var(--line-strong);
}

.board-card:active {
  transform: scale(0.995);
}

.board-card.is-selected {
  border-color: #9dbbe5;
  box-shadow: 0 0 0 3px rgba(22, 78, 155, 0.08), var(--shadow-soft);
}

.board-card-head,
.board-card-meta,
.board-stats,
.quote-main,
.strategy-head,
.watch-item-main,
.watch-actions,
.toolbar,
.chart-legend {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px;
}

.board-card-name {
  min-width: 0;
  font-size: 14px;
  font-weight: 800;
}

.board-code {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10px;
}

.board-card-meta {
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
}

.board-stats {
  justify-content: flex-start;
  margin-top: 10px;
  flex-wrap: wrap;
}

.board-stat,
.tag,
.rank-badge,
.settings-status {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-shell {
  min-width: 0;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: linear-gradient(155deg, #fff 0%, #f9fbfe 100%);
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.detail-header h3 {
  margin: 0;
  font-size: 17px;
  letter-spacing: -0.025em;
}

.detail-header p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.kline-wrap {
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdff;
}

.kline-svg,
.sparkline {
  display: block;
  width: 100%;
  height: auto;
}

.kline-svg text {
  fill: #7a8798;
  font-family: inherit;
  font-size: 10px;
}

.kline-svg .grid-line {
  stroke: #e7edf4;
  stroke-width: 1;
}

.kline-svg .axis-line {
  stroke: #cbd6e3;
  stroke-width: 1;
}

.kline-svg .candle-up {
  fill: var(--up);
  stroke: var(--up);
}

.kline-svg .candle-down {
  fill: var(--down);
  stroke: var(--down);
}

.kline-svg .volume-up {
  fill: rgba(217, 45, 32, 0.42);
}

.kline-svg .volume-down {
  fill: rgba(7, 148, 85, 0.42);
}

.kline-svg .trend-line {
  fill: none;
  stroke: #2b74c9;
  stroke-width: 1.8;
  stroke-linejoin: round;
}

.kline-svg .trend-area {
  fill: rgba(43, 116, 201, 0.12);
  stroke: none;
}

.kline-svg .ma5 {
  fill: none;
  stroke: #e49a20;
  stroke-width: 1.5;
}

.kline-svg .ma10 {
  fill: none;
  stroke: #2b74c9;
  stroke-width: 1.5;
}

.kline-svg .ma20 {
  fill: none;
  stroke: #8a4fb3;
  stroke-width: 1.5;
}

.kline-svg .ma60 {
  fill: none;
  stroke: #18a0a0;
  stroke-width: 1.5;
}

.chart-legend {
  justify-content: flex-start;
  margin-top: 7px;
  overflow-x: auto;
  color: var(--muted);
  font-size: 10px;
  scrollbar-width: none;
}

.chart-legend::-webkit-scrollbar {
  display: none;
}

.legend-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.legend-dot.ma5 { color: #e49a20; }
.legend-dot.ma10 { color: #2b74c9; }
.legend-dot.ma20 { color: #8a4fb3; }
.legend-dot.ma60 { color: #18a0a0; }

.field,
.stock-search,
.toolbar {
  display: grid;
  gap: 9px;
}

.field label,
.field-label {
  display: block;
  margin-bottom: 5px;
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink);
  font-size: 15px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.input::placeholder,
.textarea::placeholder {
  color: #9aa7b8;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: #83a9db;
  box-shadow: 0 0 0 3px rgba(22, 78, 155, 0.09);
  outline: none;
}

.textarea {
  min-height: 86px;
  resize: vertical;
}

.primary-button,
.secondary-button,
.danger-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  transition: background 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}

.primary-button {
  background: var(--primary);
  box-shadow: 0 7px 17px rgba(22, 78, 155, 0.18);
  color: #fff;
}

.primary-button:active,
.secondary-button:active,
.danger-button:active,
.small-button:active {
  transform: scale(0.98);
}

.secondary-button {
  border-color: var(--line);
  background: #fff;
  color: var(--ink-soft);
}

.danger-button {
  border-color: #f0c3be;
  background: var(--up-soft);
  color: #ad2118;
}

.small-button {
  min-height: 33px;
  padding: 0 10px;
  border-color: var(--line);
  background: #fff;
  color: var(--primary);
  font-size: 11px;
}

.primary-button:disabled,
.secondary-button:disabled,
.danger-button:disabled,
.small-button:disabled,
.input:disabled,
.select:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.form-error,
.inline-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.form-error {
  color: #ad2118;
  font-weight: 700;
}

.detail-section {
  margin-top: 14px;
}

.switch-row {
  margin-top: 11px;
}

.confirm-row {
  margin-top: 12px;
}

.source-line {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.quote-card {
  display: grid;
  gap: 14px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(145deg, #173f79, #1b5ca9);
  box-shadow: 0 14px 30px rgba(22, 78, 155, 0.19);
  color: #fff;
}

.quote-card .metric-label,
.quote-card .metric-note,
.quote-card .status-note,
.quote-card .missing {
  color: rgba(255, 255, 255, 0.72) !important;
}

.quote-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.quote-actions .secondary-button {
  padding: 7px 14px;
  font-size: 12px;
}

.quote-actions .secondary-button.is-busy {
  opacity: 0.7;
  cursor: progress;
}

.quote-title {
  min-width: 0;
}

.quote-title h2 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.035em;
}

.quote-title p {
  margin: 4px 0 0;
  color: rgba(255, 255, 255, 0.74);
  font-size: 11px;
}

.quote-price {
  flex: 0 0 auto;
  font-size: clamp(23px, 8vw, 36px);
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  letter-spacing: -0.045em;
  text-align: right;
}

.quote-price small {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  letter-spacing: 0;
}

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

.quote-item {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.08);
}

.quote-item span,
.quote-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.quote-item span {
  color: rgba(255, 255, 255, 0.66);
  font-size: 10px;
}

.quote-item strong {
  margin-top: 3px;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.valuation-level {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.limit-up-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
}

.limit-up-count {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.limit-up-count strong {
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.limit-up-ladder {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.limit-up-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  font-size: 12px;
}

.limit-up-height {
  flex: 0 0 48px;
  font-weight: 700;
  color: var(--primary);
  font-variant-numeric: tabular-nums;
}

.limit-up-names {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--text);
}

.limit-up-details summary {
  cursor: pointer;
  font-size: 12px;
  color: var(--primary);
}

.limit-up-names-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.index-technical-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
}

.index-technical-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.index-technical-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.index-technical-top strong {
  font-size: 19px;
  font-variant-numeric: tabular-nums;
}

.index-technical-top span {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

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

.indicator-card {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.indicator-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 7px;
}

.indicator-head h3 {
  margin: 0;
  font-size: 13px;
}

.indicator-chart-wrap {
  margin-top: 4px;
}

.indicator-kline {
  min-height: 150px;
  border-radius: 8px;
  background: #fbfdff;
}

.indicator-kline .indicator-overlay {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.indicator-kline .sub-bar-up {
  fill: rgba(217, 45, 32, 0.72);
}

.indicator-kline .sub-bar-down {
  fill: rgba(7, 148, 85, 0.72);
}

.indicator-legend {
  margin: 0 0 4px;
}

.indicator-values {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  margin-top: 8px;
}

.indicator-row {
  display: flex;
  min-width: 0;
  justify-content: space-between;
  gap: 8px;
  padding-top: 5px;
  border-top: 1px solid #eef2f7;
  font-size: 11px;
}

.indicator-row span {
  color: var(--muted);
}

.indicator-row strong {
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
  text-align: right;
}

.sparkline {
  min-height: 50px;
}

.sparkline path {
  fill: none;
  stroke: var(--primary);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.sparkline .area {
  fill: rgba(22, 78, 155, 0.08);
  stroke: none;
}

.data-grid {
  display: grid;
  gap: 10px;
}

.data-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.data-card h3 {
  margin: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
  font-size: 12px;
}

.data-list {
  display: grid;
}

.data-row {
  display: grid;
  grid-template-columns: minmax(86px, 0.38fr) 1fr;
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid #edf2f7;
  font-size: 11px;
}

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

.data-key {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.data-value {
  min-width: 0;
  color: var(--ink-soft);
  font-weight: 650;
  overflow-wrap: anywhere;
  text-align: right;
  white-space: pre-wrap;
}

.raw-block {
  margin: 0;
  padding: 12px;
  overflow: auto;
  color: var(--ink-soft);
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 10px;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 590px;
  border-collapse: collapse;
  font-size: 12px;
}

th,
td {
  padding: 10px 11px;
  border-bottom: 1px solid #edf2f7;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f8fafc;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

tr:last-child td {
  border-bottom: 0;
}

td.number,
th.number {
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.table-sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
}

.signal-buy,
.signal-sell {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
}

.signal-buy {
  background: var(--up-soft);
  color: #b42318;
}

.signal-sell {
  background: var(--down-soft);
  color: #067647;
}

.strategy-list,
.watch-groups {
  display: grid;
  gap: 11px;
}

.strategy-card {
  padding: 13px;
  border-radius: var(--radius-md);
}

.strategy-head {
  align-items: flex-start;
}

.strategy-title {
  min-width: 0;
}

.strategy-title h3 {
  margin: 0;
  font-size: 14px;
}

.strategy-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.strategy-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.switch {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  user-select: none;
}

.switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.18s ease;
}

.switch-track::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgba(31, 51, 81, 0.24);
  content: "";
  transition: transform 0.18s ease;
}

.switch input:checked + .switch-track {
  background: var(--primary);
}

.switch input:checked + .switch-track::after {
  transform: translateX(18px);
}

.switch input:focus-visible + .switch-track {
  outline: 3px solid rgba(38, 99, 235, 0.28);
  outline-offset: 2px;
}

.switch-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 750;
}

.watch-group {
  overflow: hidden;
  border-radius: var(--radius-md);
}

.watch-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.watch-group-header h3 {
  margin: 0;
  font-size: 13px;
}

.watch-count {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.watch-list {
  display: grid;
}

.watch-item {
  display: grid;
  gap: 9px;
  padding: 11px 12px;
  border-bottom: 1px solid #edf2f7;
}

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

.watch-item-main {
  align-items: flex-start;
}

.watch-code {
  font-variant-numeric: tabular-nums;
  font-weight: 850;
}

.watch-name {
  margin-left: 6px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.watch-note-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px;
}

.watch-note-input {
  min-width: 0;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  font-size: 12px;
}

.watch-actions {
  justify-content: flex-end;
}

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

.avoid-card {
  padding: 13px;
  border-radius: var(--radius-md);
}

.avoid-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.avoid-card-title {
  min-width: 0;
}

.avoid-card-title h3 {
  margin: 0;
  font-size: 13px;
}

.avoid-card-title p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
}

.threshold-wrap {
  position: relative;
  margin-top: 10px;
}

.threshold-input {
  padding-right: 42px;
}

.threshold-unit {
  position: absolute;
  top: 50%;
  right: 12px;
  color: var(--muted);
  font-size: 11px;
  transform: translateY(-50%);
  pointer-events: none;
}

.settings-status {
  min-height: 21px;
  border-color: #ead7ac;
  background: var(--warning-soft);
  color: var(--warning);
  font-size: 9px;
}

.loading-state {
  display: grid;
  gap: 12px;
}

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

.skeleton-card {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}

.skeleton-line {
  height: 11px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, #edf2f7 25%, #f8fafc 38%, #edf2f7 52%);
  background-size: 400% 100%;
  animation: skeleton 1.35s ease-in-out infinite;
}

.skeleton-line.short {
  width: 48%;
}

.skeleton-line.medium {
  width: 68%;
}

.skeleton-line.large {
  width: 88%;
  height: 23px;
}

@keyframes skeleton {
  0% { background-position: 100% 50%; }
  100% { background-position: 0 50%; }
}

.empty-state,
.error-state {
  display: grid;
  min-height: 190px;
  padding: 28px 18px;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.7);
  text-align: center;
}

.empty-state strong,
.error-state strong {
  display: block;
  margin-bottom: 5px;
  font-size: 14px;
}

.empty-state p,
.error-state p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.error-state {
  border-color: #f0c3be;
  background: var(--up-soft);
}

.error-actions {
  margin-top: 13px;
}

.toast-region {
  position: fixed;
  z-index: 120;
  right: max(12px, var(--safe-right));
  bottom: calc(14px + var(--safe-bottom));
  left: max(12px, var(--safe-left));
  display: grid;
  justify-items: center;
  gap: 7px;
  pointer-events: none;
}

.toast {
  width: min(100%, 520px);
  padding: 11px 14px;
  border: 1px solid rgba(19, 34, 56, 0.12);
  border-radius: 12px;
  background: rgba(19, 34, 56, 0.94);
  box-shadow: 0 12px 30px rgba(19, 34, 56, 0.22);
  color: #fff;
  font-size: 12px;
  text-align: center;
  animation: toast-in 0.2s ease-out;
}

.toast.is-error {
  background: rgba(164, 34, 25, 0.96);
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.app-footer {
  width: min(100%, 1360px);
  margin: 0 auto;
  padding: 0 max(14px, var(--safe-right)) calc(26px + var(--safe-bottom)) max(14px, var(--safe-left));
  color: var(--muted);
  font-size: 10px;
  text-align: center;
}

.app-footer p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.number-mono {
  font-variant-numeric: tabular-nums;
}

@media (min-width: 520px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

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

  .stock-search {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }
}

@media (min-width: 760px) {
  body {
    font-size: 15px;
  }

  .app-header {
    padding-right: max(24px, var(--safe-right));
    padding-left: max(24px, var(--safe-left));
  }

  .header-metrics {
    margin-top: 5px;
  }

  .top-tabs {
    margin-top: 5px;
  }

  .main-content {
    padding: 28px max(24px, var(--safe-right)) 46px max(24px, var(--safe-left));
  }

  .panel,
  .detail-shell {
    padding: 18px;
  }

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

  .metric-card {
    padding: 16px;
  }

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

  .status-card.wide {
    grid-column: span 2;
  }

  .board-layout {
    grid-template-columns: minmax(0, 0.92fr) minmax(360px, 1.08fr);
    align-items: start;
  }

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

  .board-list.is-wide {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

@media (min-width: 1100px) {
  .app-header {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
  }

  .brand-row,
  .header-metrics,
  .top-tabs {
    margin-right: 0;
    margin-left: 0;
  }

  .brand-row {
    display: block;
  }

  .icon-button {
    display: none;
  }

  .header-metrics {
    justify-content: center;
    margin-top: 0;
  }

  .top-tabs {
    grid-column: 1 / -1;
    margin-top: 0;
    justify-content: center;
  }

  .page-heading {
    margin-bottom: 20px;
  }

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

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

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

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

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

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


/* 专业版增量功能：信号标记、相对强度、自选批量导入与避雷日志 */
.signal-settings-card {
  display: grid;
  gap: 12px;
}

.signal-settings-card .inline-note {
  margin-top: 5px;
}

.history-toolbar {
  display: grid;
  gap: 9px;
}

.history-signal-grid {
  display: grid;
  gap: 12px;
}

.history-signal-section h4,
.detail-section h4 {
  margin: 0 0 9px;
  font-size: 13px;
}

.mark-cell {
  min-width: 130px;
}

.mark-actions {
  display: inline-flex;
  gap: 6px;
}

.mark-button {
  min-width: 50px;
}

.mark-valid.is-active {
  border-color: #9ed8bc;
  background: var(--down-soft);
  color: #067647;
}

.mark-invalid.is-active {
  border-color: #f0c3be;
  background: var(--up-soft);
  color: #ad2118;
}

.board-card {
  cursor: default;
}

.board-card-select {
  display: grid;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.board-card-select:focus-visible {
  border-radius: 8px;
  outline: 3px solid rgba(38, 99, 235, 0.28);
  outline-offset: 4px;
}

.board-tag-row {
  display: grid;
  gap: 7px;
  margin-top: 11px;
  padding-top: 10px;
  border-top: 1px solid #edf2f7;
}

.board-tag-current {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.board-tag-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px;
}

.board-tag-select {
  min-height: 34px;
  padding: 5px 9px;
  border-radius: 9px;
  font-size: 12px;
}

.board-tag-button {
  min-height: 34px;
}

.relative-chart-wrap {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdff;
}

.relative-legend {
  justify-content: flex-start;
  padding: 10px 11px 0;
  flex-wrap: wrap;
}

.relative-chart {
  display: block;
  width: 100%;
  height: auto;
}

.relative-chart text {
  fill: #7a8798;
  font-family: inherit;
  font-size: 10px;
}

.relative-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
}

.relative-board {
  color: #e49a20;
  stroke: #e49a20;
}

.relative-market {
  color: #2b74c9;
  stroke: #2b74c9;
}

.relative-value {
  color: #8a4fb3;
  stroke: #8a4fb3;
}

.relative-point {
  stroke: #fff;
  stroke-width: 1.2;
}

.relative-chart-wrap .inline-note {
  margin: 0;
  padding: 8px 11px 10px;
}

.summary-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 10px 12px 0;
}

.summary-count {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 800;
}

.summary-count.positive {
  border-color: #fac1bc;
  background: var(--up-soft);
  color: #b42318;
}

.summary-count.negative {
  border-color: #b9dfcb;
  background: var(--down-soft);
  color: #067647;
}

.summary-count.neutral {
  color: var(--muted);
}

.announcement-list {
  display: grid;
  padding: 10px 12px 4px;
}

.announcement-item {
  display: grid;
  gap: 3px;
  padding: 9px 0;
  border-top: 1px solid #edf2f7;
}

.announcement-item strong {
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.announcement-item span {
  color: var(--muted);
  font-size: 10px;
}

.announcement-summary .inline-note {
  margin: 10px 12px 12px;
}

.watch-item.is-signal-buy {
  border-left: 4px solid var(--up);
  background: linear-gradient(90deg, rgba(217, 45, 32, 0.07), transparent 42%);
}

.watch-item.is-signal-sell {
  border-left: 4px solid var(--down);
  background: linear-gradient(90deg, rgba(7, 148, 85, 0.08), transparent 42%);
}

.watch-signal {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 8px 9px;
  border-radius: 9px;
  font-size: 10px;
}

.watch-signal-buy {
  background: var(--up-soft);
  color: #9d1c14;
}

.watch-signal-sell {
  background: var(--down-soft);
  color: #067647;
}

.watch-signal-pill {
  flex: 0 0 auto;
  font-weight: 850;
}

.watch-signal-reason {
  min-width: 0;
  overflow-wrap: anywhere;
}

.avoidance-log-wrap table {
  min-width: 680px;
}

@media (min-width: 520px) {
  .history-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: end;
  }

  .board-tag-actions {
    grid-template-columns: minmax(120px, 1fr) auto;
  }

  .mark-cell {
    min-width: 140px;
  }
}

@media (min-width: 760px) {
  .history-signal-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .signal-settings-card {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}


/* 专业版增量字段：仓位建议、策略条件、信号质量、个股画像与复盘绩效 */
.position-advice-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(145deg, #ffffff, #f5f9ff);
}

.position-advice-card.is-error {
  border-color: #f0c3be;
  background: var(--up-soft);
}

.position-advice-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.position-advice-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.position-advice-percent {
  margin: 4px 0 2px;
  color: var(--primary);
  font-size: clamp(26px, 8vw, 40px);
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1;
}

.position-advice-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.position-advice-range {
  display: grid;
  gap: 3px;
  min-width: 116px;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  text-align: right;
}

.position-advice-range span {
  color: var(--muted);
  font-size: 10px;
}

.position-advice-range strong {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.position-advice-reasons {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 10px 11px 10px 28px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 11px;
}

.position-advice-reasons li {
  overflow-wrap: anywhere;
}

.strategy-policy-grid {
  display: grid;
  gap: 11px;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid #edf2f7;
}

.strategy-policy-field {
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}

.strategy-policy-field .field-label {
  margin-bottom: 6px;
}

.strategy-policy-field .inline-note {
  margin: 0 0 8px;
}

.strategy-policy-select {
  min-height: 38px;
  padding: 6px 9px;
  border-radius: 9px;
  font-size: 12px;
}

.strategy-policy-switch {
  min-height: 32px;
}

.signal-filter-bar {
  display: grid;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.signal-filter-bar strong {
  font-size: 13px;
}

.signal-filter-bar .inline-note {
  margin-top: 3px;
  overflow-wrap: anywhere;
}

.signal-table {
  min-width: 1320px;
}

.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 25px;
  padding: 2px 8px;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: #fff;
  font-size: 10px;
  font-weight: 850;
}

.quality-swatch {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.75);
}

.signal-table td.quality-text {
  min-width: 130px;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
}

.signal-table tr.is-weak-signal {
  background: rgba(113, 128, 150, 0.06);
}

.chart-line-dot {
  border: 1px solid rgba(19, 34, 56, 0.14);
}

.kline-svg .chart-line {
  pointer-events: none;
}

.kline-svg .chart-line-label {
  paint-order: stroke;
  stroke: #ffffff;
  stroke-width: 3px;
  stroke-linejoin: round;
}

.pattern-list,
.percentile-list {
  display: grid;
  gap: 0;
}

.pattern-item,
.percentile-row {
  padding: 10px 12px;
  border-bottom: 1px solid #edf2f7;
}

.pattern-item:last-child,
.percentile-row:last-child {
  border-bottom: 0;
}

.pattern-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.pattern-title strong {
  min-width: 0;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.pattern-reason {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.percentile-row {
  display: grid;
  grid-template-columns: minmax(76px, auto) minmax(80px, 1fr) auto;
  align-items: center;
  gap: 9px;
}

.percentile-label {
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 720;
}

.percentile-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7edf4;
}

.percentile-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #79a9e8, var(--primary));
}

.percentile-row strong {
  min-width: 48px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.daily-review-card {
  display: grid;
  gap: 10px;
}

.review-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.daily-review-text {
  max-height: 520px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fbfdff;
  color: var(--ink-soft);
  font-family: inherit;
  font-size: 12px;
  line-height: 1.7;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.performance-table {
  min-width: 980px;
}

@media (min-width: 760px) {
  .strategy-policy-grid {
    grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  }

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

@media (max-width: 519px) {
  .position-advice-main {
    grid-template-columns: minmax(0, 1fr);
  }

  .position-advice-range {
    min-width: 0;
    text-align: left;
  }

  /* 自选雷达「添加自选股」：手机上也用电脑版同样的两列排布
     第一行 股票代码 + 所属池，第二行 名称 + 备注，提交按钮占满整行 */
  .toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: end;
  }

  .toolbar > .primary-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  /* 面板头部的按钮在窄屏换行，避免像现在这样被挤出屏幕 */
  .panel-actions {
    width: 100%;
    justify-content: flex-start;
  }

  /* 手机上股票名再大一点，作为主要识别信息 */
  .watch-name {
    font-size: 17px;
  }
}

/* 三页精简版：主导航、今日答案与自选详情 */
#main-tabs {
  justify-content: center;
}

#main-tabs .tab-button {
  flex: 1 1 0;
  min-width: 104px;
  max-width: 240px;
  font-size: 14px;
}

.today-page .panel {
  padding: 18px;
}

.today-answer {
  display: grid;
  gap: 16px;
}

.today-answer-hero {
  position: relative;
  display: grid;
  gap: 10px;
  padding: clamp(20px, 5vw, 34px);
  overflow: hidden;
  border: 1px solid #c9d8ec;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, #eef5ff 0%, #ffffff 58%, #eef8f3 100%);
}

.today-answer-hero::after {
  position: absolute;
  top: -70px;
  right: -50px;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(22, 78, 155, 0.08);
  content: "";
  pointer-events: none;
}

.today-answer-hero.is-ready {
  border-color: #b8d5ca;
  background: linear-gradient(135deg, #edf8f2 0%, #ffffff 56%, #edf4ff 100%);
}

.today-answer-hero.is-wait {
  border-color: #efd6a4;
  background: linear-gradient(135deg, #fff8e8 0%, #ffffff 56%, #f1f6ff 100%);
}

.today-answer-kicker {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.14em;
}

.today-verdict {
  max-width: 900px;
  margin: 0;
  font-size: clamp(28px, 7vw, 52px);
  letter-spacing: -0.055em;
  line-height: 1.1;
}

.today-answer-lead {
  max-width: 820px;
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(15px, 2.2vw, 18px);
  line-height: 1.75;
}

.today-answer-stats {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 9px;
  margin-top: 8px;
}

.today-stat {
  display: grid;
  gap: 2px;
  padding: 11px 13px;
  border: 1px solid rgba(201, 216, 236, 0.9);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.82);
}

.today-stat span {
  color: var(--muted);
  font-size: 11px;
}

.today-stat strong {
  font-size: 15px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.today-why,
.today-risk-box,
.today-rules {
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.today-why h4,
.today-risk-box h4,
.today-rules h4 {
  margin: 0 0 7px;
  font-size: 15px;
}

.today-why p,
.today-risk-box p,
.today-rules li {
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.75;
}

.today-why p,
.today-risk-box p {
  margin: 0;
}

.today-risk-box {
  border-color: #f1c1bc;
  background: #fff7f6;
}

.today-risk-names {
  margin-top: 8px !important;
  color: #9d1c14 !important;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.today-rules ol {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 22px;
}

.today-action-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.today-action-card {
  display: grid;
  align-content: start;
  gap: 11px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.today-action-card.is-steady {
  border-top: 4px solid #2b74c9;
}

.today-action-card.is-active {
  border-top: 4px solid #b54708;
}

.today-action-card h4 {
  margin: 0;
  font-size: 18px;
}

.today-action-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.today-stock-list {
  display: grid;
  gap: 9px;
}

.today-stock {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid #e7edf5;
  border-radius: var(--radius-md);
  background: #fbfdff;
}

.today-stock-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 9px;
}

.today-stock-head strong {
  min-width: 0;
  font-size: 15px;
  overflow-wrap: anywhere;
}

.today-score {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 10px;
  font-weight: 850;
}

.today-stock-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.today-stock-reason {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.65;
}

.today-empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.today-scan-notice {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #c9d8ec;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  color: var(--primary-strong);
  font-size: 12px;
  font-weight: 750;
}

.today-scan-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(22, 78, 155, 0.12);
  animation: today-pulse 1.25s ease-in-out infinite;
}

@keyframes today-pulse {
  50% { opacity: 0.35; transform: scale(0.82); }
}

.watch-item-open {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 2px 0;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.watch-item-open:hover .watch-name,
.watch-item-open:focus-visible .watch-name {
  color: var(--primary);
  text-decoration: underline;
}

.watch-item-open:disabled {
  cursor: default;
}

.watch-detail-button {
  font-weight: 800;
}

.watch-detail-toolbar {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.watch-detail-title {
  margin: 1px 0 0;
  font-size: 21px;
  letter-spacing: -0.03em;
}

@media (min-width: 620px) {
  .today-answer-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 900px) {
  .today-action-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* 我的自选：专业分析卡片 */
.watch-item.is-signal-watch {
  border-left: 4px solid #d99a20;
  background: linear-gradient(90deg, rgba(217, 154, 32, 0.08), transparent 42%);
}

.watch-item.is-signal-none {
  border-left: 4px solid #94a3b8;
}

.watch-analysis {
  display: grid;
  align-items: stretch;
  gap: 9px;
}

.watch-analysis-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-analysis-watch {
  background: #fff8e8;
  color: #8a4b08;
}

.watch-analysis-none {
  background: #f8fafc;
  color: var(--muted);
}

.watch-analysis-action {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.7;
}

.watch-analysis-block {
  display: grid;
  gap: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(201, 216, 236, 0.75);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.78);
}

.watch-analysis-block.is-risk {
  border-color: #f2c4bf;
  background: #fff7f6;
}

.watch-analysis-block strong {
  font-size: 11px;
}

.watch-analysis-block ul {
  display: grid;
  gap: 3px;
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.watch-analysis-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-analysis-levels span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink-soft);
  font-size: 10px;
  font-variant-numeric: tabular-nums;
}

/* 自选雷达：板块状态条（数据来自全A快照的行业/概念强度） */
.watch-board {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 9px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-left: 3px solid #94a3b8;
  border-radius: 10px;
  background-image: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  font-size: 11px;
}

.watch-board.is-strong {
  border-color: rgba(22, 163, 74, 0.35);
  border-left-color: #16a34a;
  background-image: linear-gradient(180deg, #f2fdf5 0%, #eafaf0 100%);
}

.watch-board.is-weak {
  border-color: rgba(220, 38, 38, 0.3);
  border-left-color: #dc2626;
  background-image: linear-gradient(180deg, #fff7f7 0%, #fdf0ef 100%);
}

.watch-board.is-sync {
  border-left-color: #2563eb;
}

.watch-board-label {
  color: var(--muted);
  font-weight: 750;
}

.watch-board-name {
  color: var(--ink);
  font-weight: 800;
}

.watch-board-status {
  padding: 3px 8px;
  border-radius: 999px;
  background-image: linear-gradient(135deg, #64748b, #94a3b8);
  color: #fff;
  font-weight: 750;
}

.watch-board.is-strong .watch-board-status {
  background-image: linear-gradient(135deg, #15803d, #22c55e);
}

.watch-board.is-weak .watch-board-status {
  background-image: linear-gradient(135deg, #b91c1c, #ef4444);
}

.watch-board.is-sync .watch-board-status {
  background-image: linear-gradient(135deg, #1d4ed8, #3b82f6);
}

.today-scan-notice.is-error {
  border-color: #f1c1bc;
  background: #fff7f6;
  color: #9d1c14;
}

/* 手机版：底部导航、触控尺寸与横向图表 */
@media (max-width: 640px) {
  body {
    padding-bottom: calc(76px + var(--safe-bottom));
  }

  .app-header {
    position: sticky;
    top: 0;
    z-index: 60;
    padding-top: calc(10px + var(--safe-top));
    background: rgba(244, 247, 251, 0.96);
    backdrop-filter: blur(14px);
  }

  .top-tabs {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    max-width: none;
    margin: 0;
    padding: 7px 8px calc(7px + var(--safe-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: 0 -8px 24px rgba(31, 51, 81, 0.08);
    justify-content: space-between;
    gap: 6px;
    overflow: visible;
  }

  #main-tabs .tab-button {
    min-width: 0;
    max-width: none;
    min-height: 52px;
    flex: 1 1 0;
    padding: 6px 4px;
    border-radius: 13px;
    font-size: 13px;
  }

  .main-content {
    padding: 15px max(12px, var(--safe-right)) 24px max(12px, var(--safe-left));
  }

  .page-heading {
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .page-heading h1 {
    font-size: clamp(24px, 8vw, 31px);
  }

  .updated-at {
    max-width: 42%;
    white-space: normal;
  }

  .panel,
  .today-page .panel {
    padding: 13px;
    border-radius: 15px;
  }

  .today-verdict {
    font-size: clamp(27px, 9vw, 38px);
  }

  .today-answer-hero {
    padding: 19px 15px;
  }

  .today-answer-stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }

  .today-stat {
    min-width: 0;
    padding: 10px 8px;
  }

  .today-stat strong {
    font-size: 13px;
    overflow-wrap: anywhere;
  }

  .today-stock-head {
    display: grid;
  }

  .today-score {
    justify-self: start;
  }

  .primary-button,
  .secondary-button,
  .small-button,
  .danger-button,
  .icon-button,
  .watch-item-open,
  .watch-note-input {
    min-height: 44px;
  }

  .watch-item-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .watch-item-open {
    width: 100%;
  }

  .watch-note-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-actions {
    justify-content: stretch;
  }

  .watch-actions button {
    flex: 1 1 0;
  }

  .kline-wrap,
  .table-wrap,
  .indicator-grid,
  .data-grid {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .kline-wrap svg {
    min-width: 720px;
  }

  .detail-shell,
  .watch-group {
    border-radius: 15px;
  }
}

/* ===================== 视觉重设计 v3：量化终端 ===================== */
:root {
  --page: #eef1f4;
  --page-strong: #e6eaee;
  --surface: #ffffff;
  --surface-soft: #f7f9fa;
  --surface-raised: #ffffff;
  --ink: #101828;
  --ink-soft: #344054;
  --muted: #667085;
  --line: #dce2e7;
  --line-strong: #c8d1d8;
  --primary: #0f766e;
  --primary-strong: #0b5f59;
  --primary-soft: #e8f5f3;
  --up: #c53d36;
  --up-soft: #fdf0ef;
  --down: #0b8a61;
  --down-soft: #e9f8f2;
  --warning: #9a5b0b;
  --warning-soft: #fff6e8;
  --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 1px 2px rgba(16, 24, 40, 0.05), 0 12px 28px -22px rgba(16, 24, 40, 0.42);
  --radius-xl: 10px;
  --radius-lg: 8px;
  --radius-md: 8px;
  --radius-sm: 7px;
  --terminal-gold: #c6a15b;
  --terminal-navy: #0c151d;
  --terminal-navy-soft: #14222d;
}

html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

body {
  background-color: var(--page);
  background-image:
    linear-gradient(rgba(37, 52, 66, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 52, 66, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  color: var(--ink);
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-variant-numeric: tabular-nums;
}

.app-header {
  padding: calc(11px + var(--safe-top)) max(16px, var(--safe-right)) 0 max(16px, var(--safe-left));
  border-bottom: 1px solid #23313c;
  background: var(--terminal-navy);
  box-shadow: 0 10px 30px rgba(7, 13, 18, 0.22);
  color: #ffffff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.brand-row,
.header-metrics,
.top-tabs {
  width: min(100%, 1380px);
  max-width: 1380px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--terminal-gold);
  box-shadow: 0 7px 18px rgba(198, 161, 91, 0.22);
  color: #101820;
  font-family: inherit;
  font-size: 21px;
  font-weight: 850;
}

.brand-copy strong {
  color: #ffffff;
  font-size: 16px;
  letter-spacing: 0;
}

.brand-copy small {
  color: #91a2af;
  font-size: 10px;
  letter-spacing: 0.1em;
}

.icon-button {
  min-height: 36px;
  border-color: rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.05);
  color: #e5edf2;
  font-weight: 700;
}

.icon-button:hover {
  border-color: rgba(198, 161, 91, 0.62);
  background: rgba(198, 161, 91, 0.12);
}

.header-metrics {
  margin-top: 10px;
  padding-bottom: 2px;
}

.status-pill {
  min-height: 26px;
  border-color: rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.045);
  color: #b8c5ce;
}

.status-pill.is-ok {
  border-color: rgba(45, 212, 191, 0.35);
  background: rgba(15, 118, 110, 0.18);
  color: #9ce5dc;
}

.status-pill.is-warn {
  border-color: rgba(198, 161, 91, 0.45);
  background: rgba(198, 161, 91, 0.12);
  color: #e7c98a;
}

.status-pill.is-error {
  border-color: rgba(240, 113, 103, 0.45);
  background: rgba(197, 61, 54, 0.18);
  color: #ffb0aa;
}

.top-tabs {
  gap: 2px;
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.tab-button {
  position: relative;
  min-height: 43px;
  padding: 0 14px;
  border-radius: 0;
  background: transparent;
  color: #93a4b0;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
}

.tab-button::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: -1px;
  left: 13px;
  height: 2px;
  background: transparent;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.035);
  color: #ffffff;
}

.tab-button.is-active {
  background: transparent;
  box-shadow: none;
  color: #ffffff;
}

.tab-button.is-active::after {
  background: var(--terminal-gold);
}

.main-content {
  width: min(100%, 1440px);
  padding: 26px max(16px, var(--safe-right)) 44px max(16px, var(--safe-left));
}

.page-heading {
  align-items: flex-end;
  margin-bottom: 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.eyebrow {
  margin-bottom: 5px;
  color: var(--primary);
  font-size: 10px;
  letter-spacing: 0.16em;
}

.page-heading h1 {
  color: var(--ink);
  font-size: 34px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.12;
}

.page-subtitle {
  margin-top: 7px;
  color: var(--muted);
  line-height: 1.55;
}

.updated-at {
  color: #7b8794;
  font-variant-numeric: tabular-nums;
}

.section-stack {
  gap: 18px;
}

.panel,
.metric-card,
.status-card,
.strategy-card,
.watch-group,
.board-card,
.detail-shell,
.avoid-card {
  border-color: var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.panel {
  position: relative;
  padding: 18px;
  overflow: hidden;
}

.panel::before {
  top: 0;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--primary);
  opacity: 0.82;
}

.panel-header {
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #edf0f2;
}

.panel-title {
  gap: 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

.panel-title::before {
  width: 3px;
  height: 15px;
  border-radius: 0;
  background: var(--terminal-gold);
}

.panel-subtitle {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.metric-grid,
.quote-grid,
.index-grid,
.status-grid,
.indicator-grid,
.avoid-grid {
  gap: 10px;
}

.metric-card,
.status-card,
.quote-card {
  position: relative;
  min-width: 0;
  padding: 15px;
  background: var(--surface);
  background-image: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.metric-card::after,
.status-card::after {
  display: none;
}

.metric-card:hover,
.status-card:hover,
.quote-card:hover {
  border-color: #b8c4cc;
  box-shadow: 0 10px 24px -20px rgba(16, 24, 40, 0.5);
  transform: none;
}

.metric-label,
.metric-note,
.status-note {
  color: var(--muted);
}

.metric-label {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.metric-value {
  color: var(--ink);
  font-size: 25px;
  font-weight: 780;
  letter-spacing: 0;
  line-height: 1.15;
}

.metric-change.up {
  color: var(--up);
}

.metric-change.down {
  color: var(--down);
}

.metric-change.neutral {
  color: var(--muted);
}

.tag,
.signal-tier-badge,
.risk-flag {
  border-radius: 6px;
}

.tag {
  border-color: #d7dfe4;
  background: #f5f7f8;
  color: #475467;
}

.primary-button,
.secondary-button,
.small-button,
.text-button {
  border-radius: 8px;
  font-weight: 700;
}

.primary-button {
  border-color: var(--primary);
  background: var(--primary);
  box-shadow: 0 7px 16px -12px rgba(15, 118, 110, 0.85);
  color: #ffffff;
}

.primary-button:hover {
  border-color: var(--primary-strong);
  background: var(--primary-strong);
}

.secondary-button,
.small-button {
  border-color: var(--line-strong);
  background: #ffffff;
  color: #344054;
}

.secondary-button:hover,
.small-button:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.input,
.select,
.textarea {
  border-color: var(--line-strong);
  border-radius: 8px;
  background: #ffffff;
  color: var(--ink);
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
  outline: none;
}

.today-answer-hero {
  overflow: hidden;
  border: 1px solid #1d3037;
  border-radius: 8px;
  background: #13252c;
  background-image: none;
  box-shadow: 0 20px 40px -34px rgba(6, 20, 24, 0.9);
  color: #ffffff;
}

.today-answer-hero::after {
  display: none;
}

.today-answer-kicker {
  color: #c8a96b;
  font-weight: 780;
  letter-spacing: 0.08em;
}

.today-verdict {
  color: #ffffff;
  font-weight: 780;
  letter-spacing: 0;
}

.today-answer-lead {
  color: #bdc9ce;
}

.today-answer-stats {
  border-color: rgba(255, 255, 255, 0.1);
}

.today-stat {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
}

.today-stat span {
  color: #9fadb4;
}

.today-stat strong {
  color: #ffffff;
}

.today-why,
.today-rules,
.today-risk-box,
.today-portfolio-rules {
  border-radius: 8px;
}

.today-why,
.today-rules {
  border-color: #d8e3e2;
  background: #f5faf9;
}

.today-risk-box {
  border-color: #edd0cd;
  background: #fdf3f2;
}

.today-action-card {
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.today-stock {
  border-radius: 8px;
  background: #ffffff;
}

.today-list-tabs {
  border-color: var(--line);
  border-radius: 8px;
  background: #eef1f3;
}

.today-list-tab {
  border-radius: 6px;
}

.today-list-tab.is-active {
  background: var(--terminal-navy);
  color: #ffffff;
  box-shadow: none;
}

.today-list-tab.is-active strong {
  color: #ffffff;
}

.data-table-shell,
.data-table-host {
  border-radius: 8px;
}

.data-table {
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th {
  border-bottom-color: #ccd5db;
  background: #f3f6f7;
  color: #475467;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.045em;
}

.data-table td {
  border-bottom-color: #edf0f2;
}

.data-table tbody tr:hover {
  background: #f7faf9;
}

.data-table tbody tr:nth-child(even) {
  background: #fcfdfd;
}

.hub-group {
  padding-bottom: 22px;
}

.hub-group-heading {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.hub-group-heading h2 {
  color: var(--ink);
  font-size: 17px;
  font-weight: 800;
}

.hub-card {
  position: relative;
  min-height: 150px;
  border-color: var(--line);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.hub-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  background: var(--terminal-gold);
  opacity: 0.75;
}

.hub-card:hover,
.hub-card:focus-visible {
  border-color: #9fb0b9;
  box-shadow: 0 14px 28px -22px rgba(16, 24, 40, 0.55);
  transform: translateY(-1px);
}

.hub-card-kicker,
.hub-card-action {
  color: var(--primary);
}

.notice,
.callout,
.empty-state,
.error-state {
  border-radius: 8px;
}

@media (max-width: 900px) {
  .main-content {
    padding-top: 20px;
  }

  .page-heading h1 {
    font-size: 30px;
  }

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

@media (max-width: 640px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
  }

  body {
    padding-bottom: calc(86px + var(--safe-bottom));
    background-image: none;
  }

  .app-header {
    padding: calc(9px + var(--safe-top)) 12px 0;
    background: var(--terminal-navy) !important;
    box-shadow: 0 6px 18px rgba(7, 13, 18, 0.18);
  }

  .brand-row,
  .header-metrics {
    width: 100%;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
  }

  .header-metrics {
    gap: 6px;
    margin-top: 8px;
    padding-bottom: 0;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .status-pill {
    max-width: 290px;
    font-size: 10px;
  }

  .top-tabs {
    position: fixed !important;
    top: auto !important;
    right: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    width: 100%;
    max-width: none !important;
    margin: 0 !important;
    padding: 7px max(8px, var(--safe-right)) calc(12px + var(--safe-bottom)) max(8px, var(--safe-left));
    border: 0;
    border-top: 1px solid #d8dfe4;
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: 0 -8px 24px rgba(16, 24, 40, 0.1);
    gap: 2px;
    z-index: 200;
  }

  .tab-button {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 0 12px;
    border-radius: 7px;
    color: #52606d;
  }

  .tab-button::after {
    right: 10px;
    bottom: 2px;
    left: 10px;
  }

  .tab-button.is-active {
    background: #eef7f6;
    color: var(--primary);
  }

  .tab-button.is-active::after {
    background: var(--primary);
  }

  .main-content {
    width: 100%;
    padding: 18px 12px 30px;
  }

  .page-heading {
    display: block;
    margin-bottom: 14px;
    padding-bottom: 12px;
  }

  .page-heading h1 {
    font-size: 28px;
  }

  .page-subtitle {
    max-width: 100%;
    font-size: 12px;
  }

  .updated-at {
    display: block;
    margin-top: 8px;
    padding: 0;
    text-align: left;
  }

  .panel {
    padding: 14px;
  }

  .panel-header {
    align-items: flex-start;
    margin-bottom: 13px;
    padding-bottom: 10px;
  }

  .metric-grid,
  .quote-grid,
  .index-grid,
  .status-grid,
  .indicator-grid,
  .avoid-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .metric-card,
  .status-card,
  .quote-card {
    padding: 12px;
  }

  .metric-value {
    font-size: 21px;
    overflow-wrap: anywhere;
  }

  .metric-label,
  .metric-note {
    font-size: 10px;
  }

  .today-answer-hero {
    padding: 18px 16px;
  }

  .today-verdict {
    font-size: 26px;
    line-height: 1.22;
  }

  .today-answer-stats {
    grid-template-columns: 1fr;
  }

  .today-stat {
    min-width: 0;
  }

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

  .hub-card {
    min-height: 132px;
  }

  .data-table {
    min-width: 680px;
  }

  .table-wrap,
  .data-table-host {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

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

@media (max-width: 359px) {
  #main-tabs .tab-button {
    font-size: 12px;
    padding-right: 2px;
    padding-left: 2px;
  }

  .today-answer-stats {
    grid-template-columns: minmax(0, 1fr);
  }
}

.today-risk-details {
  display: grid;
  gap: 5px;
  margin: 9px 0 0;
  padding-left: 20px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.6;
}

.today-action-card.is-watch {
  border-top: 4px solid #d99a20;
}

.today-answer-hero.is-watch {
  border-color: #efd6a4;
  background: linear-gradient(135deg, #fff8e8 0%, #ffffff 58%, #edf4ff 100%);
}

.today-factor-list {
  display: grid;
  gap: 5px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #e3eaf3;
  border-radius: 9px;
  background: #fff;
}

.today-factor-row {
  display: grid;
  grid-template-columns: minmax(64px, auto) 32px minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  font-size: 11px;
  line-height: 1.5;
}

.today-factor-label {
  color: var(--ink-soft);
  font-weight: 800;
}

.today-factor-score {
  color: var(--primary);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.today-factor-reason {
  color: var(--muted);
  overflow-wrap: anywhere;
}

@media (max-width: 420px) {
  .today-factor-row {
    grid-template-columns: minmax(58px, auto) 30px minmax(0, 1fr);
    font-size: 10px;
  }
}

.today-professional-list {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 9px 10px;
  border: 1px solid #d9e4f1;
  border-radius: 9px;
  background: #f8fbff;
}

.today-professional-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 8px;
  font-size: 11px;
  line-height: 1.55;
}

.today-professional-row strong {
  color: var(--primary-strong);
}

.today-professional-row span {
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.watch-analysis .today-professional-list {
  margin-top: 0;
}

.today-list-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.today-list-tab {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
}

.today-list-tab strong {
  min-width: 28px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--ink-soft);
  font-size: 11px;
  text-align: center;
}

.today-list-tab.is-active {
  background: var(--primary);
  color: #fff;
}

.today-list-tab.is-active strong {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
}

@media (max-width: 420px) {
  .today-list-tab {
    min-height: 44px;
    font-size: 12px;
  }
}

.today-portfolio-rules {
  padding: 15px 16px;
  border: 1px solid #d9e4f1;
  border-radius: var(--radius-lg);
  background: #f8fbff;
}

.today-portfolio-rules h4 {
  margin: 0 0 9px;
  font-size: 15px;
}

.today-rule-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.today-rule-tags span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--ink-soft);
  font-size: 11px;
}

.today-watch-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
}

.today-watch-filters {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) 120px 150px auto;
  gap: 8px;
  align-items: center;
}

.today-watch-page-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 11px;
}

.today-watch-pages {
  display: flex;
  gap: 6px;
}

@media (max-width: 760px) {
  .today-watch-filters {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ===== 自定义选股 ===== */
.screener-table {
  min-width: 980px;
}
.screener-table td.screener-reason {
  min-width: 180px;
  max-width: 320px;
  white-space: normal;
  overflow-wrap: anywhere;
}
.screener-rules {
  margin-top: 10px;
}
.screener-rules .field-label {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}
.strategy-card .table-wrap {
  margin-top: 10px;
}

/* ===== 自定义选股：条件开关 ===== */
.screener-switch-list {
  display: grid;
  gap: 6px;
}
.screener-switch-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
}
.screener-switch-row:hover {
  border-color: #b9c8dc;
}
.screener-switch-row.is-off {
  opacity: 0.45;
  background: var(--surface-soft);
}
.screener-switch-row input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  margin: 0;
  cursor: pointer;
}
.screener-switch-tag {
  flex: 0 0 auto;
}
.screener-switch-tag.is-required {
  background: #fff1f0;
  border-color: #ffccc7;
  color: #cf1322;
}
.screener-switch-tag.is-bonus {
  background: #fffbe6;
  border-color: #ffe58f;
  color: #ad6800;
}
.screener-switch-text {
  flex: 1 1 auto;
  min-width: 0;
}

/* 自定义选股：精准表格 */
.screener-toolbar {
  display: flex;
  justify-content: flex-end;
}
.screener-grade {
  font-weight: 800;
}
.screener-grade.is-a {
  color: #cf1322;
}
.screener-grade.is-b {
  color: #d48806;
}

/* 自定义选股：结果卡片（手机不横滑） */
.screener-cards {
  display: grid;
  gap: 10px;
}
.screener-card-item {
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
}
.screener-card-head {
  display: flex;
  align-items: center;
  gap: 8px;
}
.screener-card-title {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.screener-card-score {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef6ff;
  color: #1f6feb;
  font-size: 11px;
  font-weight: 800;
}
.screener-card-sub {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 6px;
}
.screener-card-price {
  font-size: 17px;
  font-weight: 800;
}
.screener-card-change {
  font-size: 13px;
  font-weight: 700;
}
.screener-card-industry {
  color: var(--muted);
  font-size: 11px;
}
.screener-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}
.screener-metric {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 5px 7px;
  border-radius: 7px;
  background: var(--surface-soft);
}
.screener-metric-label {
  color: var(--muted);
  font-size: 10px;
}
.screener-metric-value {
  font-size: 12px;
  font-weight: 700;
}
.screener-card-tags {
  margin: 8px 0 0;
}
.screener-card-note {
  margin-top: 7px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 10px;
}

/* ===================== 视觉升级 v2：多层配色 ===================== */
:root {
  --brand-1: #2563eb;
  --brand-2: #6d28d9;
  --brand-3: #06b6d4;
  --accent-amber: #d97706;
  --accent-rose: #e11d48;
}
body {
  background-color: #eef2f9;
  background-image:
    radial-gradient(1100px 520px at 8% -10%, rgba(37, 99, 235, 0.13), transparent 62%),
    radial-gradient(900px 480px at 92% 2%, rgba(124, 58, 237, 0.11), transparent 64%),
    radial-gradient(700px 420px at 50% 108%, rgba(6, 182, 212, 0.09), transparent 60%),
    linear-gradient(180deg, #f3f7fd 0%, #edf1f8 100%);
  background-attachment: fixed;
}
.app-header {
  background: linear-gradient(135deg, rgba(255,255,255,0.97), rgba(243,247,255,0.9));
  border-bottom: 1px solid rgba(37, 99, 235, 0.16);
  box-shadow: 0 10px 30px rgba(30, 58, 138, 0.08);
  backdrop-filter: saturate(150%) blur(10px);
}
.brand-mark {
  background-image: linear-gradient(135deg, #2563eb 0%, #6d28d9 55%, #06b6d4 100%);
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.38);
  color: #fff;
}
.brand-copy strong { letter-spacing: 0.4px; }
.brand-copy small { color: #6b7a90; }
/* 桌面端：药丸式标签栏（手机端另有底部固定栏，见文件末尾） */
@media (min-width: 641px) {
  .top-tabs {
    gap: 6px;
    padding: 5px;
    margin: 12px auto 6px;
    border: 1px solid rgba(37, 99, 235, 0.14);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.9), 0 4px 14px rgba(30,58,138,0.06);
  }
}
.tab-button {
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: #526078;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.tab-button:hover { background: rgba(37, 99, 235, 0.08); color: #1d4ed8; }
.tab-button.is-active {
  background-image: linear-gradient(135deg, #2563eb, #6d28d9);
  color: #ffffff;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.34);
}
.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 18px;
  box-shadow: 0 12px 32px rgba(30, 58, 138, 0.07);
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.panel::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background-image: linear-gradient(90deg, #2563eb, #7c3aed 48%, #06b6d4);
  opacity: .9;
}
.panel-title { display: flex; align-items: center; gap: 8px; }
.panel-title::before {
  content: "";
  width: 4px; height: 15px; border-radius: 2px;
  background-image: linear-gradient(180deg, #2563eb, #7c3aed);
}
.metric-card {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background-image: linear-gradient(160deg, #ffffff 0%, #f5f9ff 100%);
  transition: transform .2s ease, box-shadow .2s ease;
}
.metric-card:hover { transform: translateY(-2px); box-shadow: 0 12px 26px rgba(37, 99, 235, 0.16); }
.strategy-card {
  border-left: 3px solid rgba(37, 99, 235, 0.55);
  background-image: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
}
.status-pill {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background-image: linear-gradient(135deg, rgba(37,99,235,.08), rgba(124,58,237,.08));
  color: #334155;
}
.screener-grade {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; padding: 1px 7px; border-radius: 7px;
  font-size: 11px; font-weight: 800;
}
.screener-grade.is-a {
  color: #fff !important;
  background-image: linear-gradient(135deg, #e11d48, #f97316);
  box-shadow: 0 4px 10px rgba(225, 29, 72, 0.3);
}
.screener-grade.is-b {
  color: #fff !important;
  background-image: linear-gradient(135deg, #d97706, #f59e0b);
  box-shadow: 0 4px 10px rgba(217, 119, 6, 0.28);
}
.screener-switch-row:hover { border-color: rgba(37, 99, 235, 0.45); background-image: linear-gradient(180deg,#fff,#f6faff); }
.screener-switch-row.is-off { background-image: none; }
.screener-card-item {
  position: relative;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background-image: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
  box-shadow: 0 6px 18px rgba(30, 58, 138, 0.05);
}
.screener-card-item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  border-radius: 18px 0 0 18px;
  background-image: linear-gradient(180deg, #2563eb, #7c3aed);
  opacity: .75;
}
.screener-card-score {
  background-image: linear-gradient(135deg, #eef4ff, #f3eaff);
  color: #4f46e5 !important;
  border: 1px solid rgba(99, 102, 241, 0.22);
}

/* ===== 手机端：底部导航栏加固（不遮挡内容）===== */
@media (max-width: 640px) {
  body {
    padding-bottom: calc(84px + var(--safe-bottom));
  }
  .top-tabs {
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: #ffffff;
    box-shadow: 0 -10px 26px rgba(31, 51, 81, 0.10);
    padding: 8px max(8px, var(--safe-right)) calc(14px + var(--safe-bottom)) max(8px, var(--safe-left));
    gap: 6px;
  }
  .tab-button {
    flex: 1 1 0;
    min-width: 0;
    border-radius: 12px;
    justify-content: center;
    text-align: center;
  }
  .tab-button.is-active {
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.28);
  }
  .app-footer {
    padding-bottom: calc(30px + var(--safe-bottom));
  }
}

/* ===== 最终修正：手机端标签栏必须固定在屏幕底部 =====
   原因：祖先元素上的 backdrop-filter 会创建新的包含块，
   导致 position:fixed 的底部栏改为相对顶部栏定位，从而叠在 LOGO 上。 */
@media (max-width: 640px) {
  /* 顶部栏去掉毛玻璃，保证 fixed 定位相对屏幕生效 */
  .app-header {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    background: #ffffff !important;
    border-bottom: 1px solid rgba(37, 99, 235, 0.14);
    box-shadow: 0 4px 16px rgba(30, 58, 138, 0.06);
  }
  /* 标签栏：真正固定在屏幕底部 */
  .top-tabs {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0 !important;
    background: #ffffff !important;
    box-shadow: 0 -10px 26px rgba(31, 51, 81, 0.10);
    padding: 8px max(8px, var(--safe-right)) calc(14px + var(--safe-bottom)) max(8px, var(--safe-left));
    gap: 6px;
    z-index: 200;
  }
  .tab-button { flex: 1 1 0; min-width: 0; justify-content: center; text-align: center; }
  body { padding-bottom: calc(88px + var(--safe-bottom)); }
}

/* 互斥（单选）条件标记 */
.screener-switch-tag.is-exclusive {
  background: #eef2ff;
  border-color: #c7d2fe;
  color: #4338ca;
}

/* 条件开关行：紧凑排版 */
.screener-switch-row {
  gap: 7px;
  padding: 7px 9px;
  align-items: center;
}
.screener-switch-text {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.screener-switch-badges {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
}
.screener-switch-tag {
  min-height: 17px;
  padding: 0 6px;
  font-size: 10px;
  line-height: 17px;
  white-space: nowrap;
}
@media (max-width: 420px) {
  .screener-switch-text { font-size: 11.5px; }
  .screener-switch-tag { padding: 0 5px; font-size: 9.5px; }
}


/* Collector integration: full navigation, signal tiers, risk flags, watch rules */
.top-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.top-tabs .tab-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

.quality-badge-wrap,
.risk-flag-list {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.signal-tier-badge,
.risk-flag {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid #d0d5dd;
  background: #f8fafc;
  color: #344054;
  font-size: 12px;
  font-weight: 700;
}

.risk-flag.is-high {
  border-color: #f04438;
  background: #fef3f2;
  color: #b42318;
}

.risk-flag.is-medium {
  border-color: #f79009;
  background: #fffaeb;
  color: #b54708;
}

.watch-note-row .input {
  min-width: 92px;
}

.watch-analysis-block summary {
  cursor: pointer;
  font-weight: 700;
}

.indicator-trace {
  margin: 0;
  max-height: 420px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
  background: #f8fafc;
  border: 1px solid #e4e7ec;
  border-radius: 8px;
  padding: 12px;
}

/* 数据表排序、筛选与显式数据状态 */
.data-table-shell,
.data-table-host,
.board-list-stack {
  min-width: 0;
}

.data-table-toolbar,
.board-list-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 9px;
}

.data-table-filter-form {
  display: grid;
  grid-template-columns: minmax(180px, 1.5fr) repeat(3, minmax(120px, 0.8fr)) auto auto;
  align-items: center;
  flex: 1 1 760px;
  gap: 7px;
  min-width: 0;
}

.board-filter-form {
  grid-template-columns: minmax(180px, 1.35fr) minmax(130px, 0.8fr) minmax(150px, 0.9fr) auto auto;
}

.data-table-filter-form .input,
.data-table-filter-form .select {
  width: 100%;
  min-width: 0;
}

.data-table-toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 7px;
}

.table-result-meta {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.table-sort-button {
  display: flex;
  width: calc(100% + 22px);
  min-height: 34px;
  align-items: center;
  gap: 4px;
  margin: -10px -11px;
  padding: 10px 11px;
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  text-align: left;
}

th.number .table-sort-button {
  justify-content: flex-end;
  text-align: right;
}

.table-sort-button:hover,
.table-sort-button:focus-visible,
.table-sort-button.is-active {
  background: #eef4fb;
  color: var(--primary);
}

.sort-indicator {
  flex: 0 0 auto;
  color: #8b98aa;
  font-size: 11px;
  line-height: 1;
}

.table-sort-button.is-active .sort-indicator {
  color: currentColor;
}

.data-quality-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 9px;
  margin: 0 0 9px;
  padding: 9px 10px;
  border: 1px solid #d8e3f0;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.data-quality-note.has-warning {
  border-color: #efd6a4;
  background: #fffaf0;
}

.data-quality-note strong {
  color: var(--ink-soft);
}

.data-quality-note > span:not(.tag) {
  min-width: 180px;
  flex: 1 1 320px;
  overflow-wrap: anywhere;
}

.data-status-cell {
  min-width: 150px;
  max-width: 260px;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.45;
}

.data-status-cell.is-complete {
  color: #067647;
}

.data-status-cell.is-warning {
  color: #9a6700;
}

.board-data-status.is-complete {
  border-color: #b9dfcb;
  background: var(--down-soft);
  color: #067647;
}

.board-data-status.is-warning {
  border-color: #efd6a4;
  background: #fff8e8;
  color: #8a4b08;
}

.board-direction-button {
  min-height: 36px;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .data-table-filter-form,
  .board-filter-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    flex-basis: 100%;
  }

  .data-table-filter-form .input[type="search"] {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .data-table-toolbar,
  .board-list-toolbar {
    display: grid;
  }

  .data-table-filter-form,
  .board-filter-form {
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .data-table-filter-form .input[type="search"] {
    grid-column: auto;
  }

  .data-table-toolbar-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .data-table-toolbar-actions .secondary-button,
  .data-table-toolbar-actions .small-button {
    flex: 1 1 120px;
  }

  .data-quality-note {
    align-items: flex-start;
  }
}

/* v3 final responsive lock: keep the terminal header and bottom navigation coherent */
@media (max-width: 640px) {
  .app-header {
    background: var(--terminal-navy) !important;
    border-bottom: 1px solid #23313c !important;
    box-shadow: 0 6px 18px rgba(7, 13, 18, 0.18) !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .brand-copy strong {
    color: #ffffff !important;
  }

  .brand-copy small {
    color: #91a2af !important;
  }

  .icon-button {
    border-color: rgba(255, 255, 255, 0.16) !important;
    background: rgba(255, 255, 255, 0.05) !important;
    color: #e5edf2 !important;
  }

  .top-tabs {
    border-top: 1px solid #d8dfe4 !important;
    background: #ffffff !important;
    justify-content: flex-start !important;
  }

  .tab-button {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    color: #52606d !important;
  }

  .tab-button.is-active {
    background: #eef7f6 !important;
    color: var(--primary) !important;
  }

  .tab-button.is-active::after {
    background: var(--primary) !important;
  }
}

/* ===================== 交易终端布局 v4 ===================== */
.market-tape {
  position: sticky;
  z-index: 35;
  top: 0;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 42px;
  margin: -26px -16px 22px;
  padding: 0 16px;
  overflow: hidden;
  border-bottom: 1px solid #26343e;
  background: #0c151d;
  color: #dce6eb;
}

.market-tape[hidden] {
  display: none;
}

.market-tape-label {
  flex: 0 0 auto;
  padding-right: 14px;
  border-right: 1px solid rgba(255, 255, 255, 0.14);
  color: var(--terminal-gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
}

.market-tape-track {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: center;
  gap: 26px;
  overflow: hidden;
}

.market-tape-item {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: baseline;
  gap: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font: inherit;
  white-space: nowrap;
}

.market-tape-item:hover .market-tape-name {
  color: #ffffff;
}

.market-tape-name {
  color: #93a4b0;
  font-size: 11px;
  font-weight: 700;
  transition: color 140ms ease;
}

.market-tape-item strong {
  color: #f2f5f6;
  font-size: 12px;
  font-weight: 750;
}

.market-tape-change {
  font-size: 11px;
  font-weight: 800;
}

.market-tape-item.is-up .market-tape-change,
.market-tape-item.is-up strong {
  color: #ff7268;
}

.market-tape-item.is-down .market-tape-change,
.market-tape-item.is-down strong {
  color: #55d49a;
}

.market-tape-item.is-flat .market-tape-change {
  color: #a8b6bf;
}

@media (min-width: 641px) {
  .app-shell {
    display: grid;
    grid-template-columns: 224px minmax(0, 1fr);
    min-height: 100vh;
  }

  .app-header {
    position: sticky;
    z-index: 100;
    top: 0;
    display: flex;
    grid-column: 1;
    grid-row: 1 / span 2;
    width: 224px;
    height: 100vh;
    flex-direction: column;
    align-items: stretch;
    padding: 18px 14px;
    overflow-y: auto;
    border-right: 1px solid #23313c;
    border-bottom: 0;
  }

  .brand-row,
  .header-metrics,
  .top-tabs {
    width: 100%;
    max-width: none;
    margin-right: 0;
    margin-left: 0;
  }

  .brand-row {
    align-items: flex-start;
  }

  .brand {
    min-width: 0;
  }

  .brand-copy strong {
    font-size: 15px;
  }

  .brand-copy small {
    font-size: 9px;
  }

  .header-metrics {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 7px;
    margin-top: 20px;
    padding: 0;
    overflow: visible;
  }

  .status-pill {
    width: 100%;
    max-width: none;
    min-height: 34px;
    justify-content: flex-start;
    overflow: visible;
    padding: 7px 9px;
    line-height: 1.35;
    text-overflow: clip;
    white-space: normal;
  }

  .top-tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    margin-top: 22px;
    padding: 0;
    overflow: visible;
  }

  .tab-button {
    display: flex;
    width: 100%;
    min-height: 42px;
    align-items: center;
    justify-content: flex-start;
    padding: 0 11px 0 15px;
    border-radius: 7px !important;
    background: transparent !important;
    color: #93a4b0 !important;
    font-size: 13px;
    text-align: left;
  }

  .tab-button::after {
    top: 8px;
    right: auto;
    bottom: 8px;
    left: 0;
    width: 3px;
    height: auto;
    background: transparent;
  }

  .tab-button:hover {
    background: rgba(255, 255, 255, 0.045) !important;
    color: #ffffff !important;
  }

  .tab-button.is-active {
    background: #10292f !important;
    color: #ffffff !important;
  }

  .tab-button.is-active::after {
    background: var(--terminal-gold) !important;
  }

  .main-content {
    grid-column: 2;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0 28px 48px;
  }

  .market-tape {
    margin: 0 -28px 22px;
    padding: 0 28px;
  }

  .page-heading {
    margin-top: 0;
  }

  .app-footer {
    grid-column: 2;
    padding-right: 28px;
    padding-left: 28px;
  }
}

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

  .app-header {
    position: sticky;
    width: auto;
    height: auto;
    padding: calc(9px + var(--safe-top)) 12px 0;
    overflow: visible;
    border-right: 0;
    border-bottom: 1px solid #23313c;
  }

  .market-tape {
    position: relative;
    top: auto;
    min-height: 40px;
    margin: 0 -12px 16px;
    padding: 0 12px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
  }

  .market-tape-track {
    overflow: visible;
    gap: 20px;
  }
}

/* Selected-state color: muted vermilion instead of the former teal */
:root {
  --active-red: #c63c32;
  --active-red-strong: #a92f27;
  --active-red-soft: #fff0ee;
  --active-red-dark: #341817;
}

.segment-button.is-active {
  border-color: #e9b8b2 !important;
  color: var(--active-red-strong) !important;
  box-shadow: 0 4px 12px rgba(198, 60, 50, 0.12) !important;
}

.today-list-tab.is-active {
  background: var(--active-red-strong) !important;
  color: #ffffff !important;
}

.today-list-tab.is-active strong {
  color: #ffffff !important;
}

@media (min-width: 641px) {
  .tab-button.is-active {
    background: var(--active-red-dark) !important;
    color: #fff7f5 !important;
  }

  .tab-button.is-active::after {
    background: #e36c60 !important;
  }
}

@media (max-width: 640px) {
  .tab-button.is-active {
    background: var(--active-red-soft) !important;
    color: var(--active-red) !important;
  }

  .tab-button.is-active::after {
    background: var(--active-red) !important;
  }
}

/* Final readability lock for the decision hero on desktop and mobile */
.today-answer-hero,
.today-answer-hero.is-ready,
.today-answer-hero.is-wait,
.today-answer-hero.is-watch {
  color: #ffffff !important;
}

.today-answer-hero.is-ready {
  border-color: #2e4c4a !important;
  background: #13252c !important;
  background-image: none !important;
}

.today-answer-hero.is-wait,
.today-answer-hero.is-watch {
  border-color: #6e5429 !important;
  background: #30271b !important;
  background-image: none !important;
}

.today-answer-kicker {
  color: #e0bd72 !important;
}

.today-verdict {
  color: #ffffff !important;
  text-wrap: balance;
}

.today-answer-lead {
  color: #d7dfe2 !important;
}

.today-answer-hero.is-wait .today-answer-lead,
.today-answer-hero.is-watch .today-answer-lead {
  color: #e5d5bb !important;
}

.today-stat span {
  color: #aebcc2 !important;
}

.today-stat strong {
  color: #ffffff !important;
}

@media (min-width: 641px) {
  .today-verdict {
    max-width: 100% !important;
    font-size: 44px !important;
    line-height: 1.2 !important;
  }
}

/* ===================== 交易终端配色 v5：石墨、铜金与松石绿 ===================== */
:root {
  --page: #eef1ee;
  --page-strong: #e4e9e5;
  --ink: #111918;
  --ink-soft: #33413e;
  --muted: #687672;
  --line: #d8dfda;
  --line-strong: #c2ccc6;
  --primary: #1b7f6b;
  --primary-strong: #126553;
  --primary-soft: #e6f4f0;
  --terminal-navy: #111518;
  --terminal-navy-soft: #1a2022;
  --terminal-gold: #d5a35f;
}

body {
  background-color: #eef1ee !important;
  background-image:
    linear-gradient(rgba(31, 67, 57, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31, 67, 57, 0.035) 1px, transparent 1px) !important;
  background-size: 36px 36px !important;
}

.app-header {
  border-right-color: #293035 !important;
  background: #111518 !important;
  box-shadow: 10px 0 28px rgba(8, 12, 14, 0.12) !important;
}

.brand-mark {
  background: #d5a35f !important;
  color: #15191b !important;
  box-shadow: 0 7px 18px rgba(213, 163, 95, 0.2) !important;
}

.brand-copy small {
  color: #9ca7ab !important;
}

.status-pill {
  border-color: rgba(255, 255, 255, 0.12) !important;
  background: rgba(255, 255, 255, 0.04) !important;
}

.panel {
  border-color: #d8dfda !important;
  box-shadow: 0 1px 2px rgba(20, 28, 26, 0.04), 0 14px 28px -24px rgba(20, 28, 26, 0.42) !important;
}

.panel::before {
  background: #1b7f6b !important;
}

.panel-title::before {
  background: #d5a35f !important;
}

.metric-label {
  color: #73807c !important;
}

.metric-value {
  color: #111918 !important;
}

.primary-button {
  border-color: #1b7f6b !important;
  background: #1b7f6b !important;
}

.primary-button:hover {
  border-color: #126553 !important;
  background: #126553 !important;
}

.today-answer-hero.is-ready {
  border-color: #31554e !important;
  background: #12231f !important;
}

.today-answer-hero.is-wait,
.today-answer-hero.is-watch {
  border-color: #6d5733 !important;
  background: #2c271e !important;
}

@media (min-width: 641px) {
  .app-shell {
    display: block !important;
    min-height: 100vh;
    padding-left: 236px;
  }

  .app-header {
    position: fixed !important;
    z-index: 500 !important;
    top: 0 !important;
    bottom: 0 !important;
    left: 0 !important;
    display: flex;
    width: 236px !important;
    height: 100dvh !important;
    flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    border-right: 1px solid #293035 !important;
    border-bottom: 0 !important;
  }

  .app-header::-webkit-scrollbar {
    width: 5px;
  }

  .app-header::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
  }

  .main-content {
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 0 30px 50px !important;
  }

  .market-tape {
    margin: 0 -30px 24px !important;
    padding: 0 30px !important;
  }

  .app-footer {
    padding-right: 30px;
    padding-left: 30px;
  }

  .tab-button.is-active {
    background: #2b1b19 !important;
    color: #fff8f6 !important;
  }

  .tab-button.is-active::after {
    background: #d36b5e !important;
  }
}

/* ===================== 禁止绿色文字：统一钢蓝灰状态色 ===================== */
:root {
  --primary: #3f718d;
  --primary-strong: #2f5d77;
  --primary-soft: #eaf1f5;
  --down: #4d7590;
  --down-soft: #edf3f7;
}

.status-pill.is-ok {
  border-color: rgba(104, 151, 178, 0.35) !important;
  background: rgba(63, 113, 141, 0.16) !important;
  color: #a9c8d9 !important;
}

.metric-change.down,
.value-down,
.is-down,
.quote-price.down,
.today-stat.is-down strong {
  color: #4d7590 !important;
}

.market-tape-item.is-down strong,
.market-tape-item.is-down .market-tape-change {
  color: #7eabc4 !important;
}

.signal-sell,
.mark-valid.is-active,
.summary-count.negative,
.watch-signal-sell {
  border-color: #c8d9e4 !important;
  background: #edf3f7 !important;
  color: #41677f !important;
}

.data-status-cell.is-complete,
.board-data-status.is-complete {
  border-color: #c8d9e4 !important;
  background: #edf3f7 !important;
  color: #41677f !important;
}

.watch-board.is-strong {
  border-color: #c8d9e4 !important;
  border-left-color: #4d7590 !important;
  background: #f3f7fa !important;
  background-image: none !important;
}

.panel::before {
  background: #3f718d !important;
}

.primary-button {
  border-color: #3f718d !important;
  background: #3f718d !important;
}

.primary-button:hover {
  border-color: #2f5d77 !important;
  background: #2f5d77 !important;
}

.today-rules {
  border-color: #d7e1e8 !important;
  background: #f4f7fa !important;
}

.today-answer-hero.is-ready {
  border-color: #46606f !important;
  background: #18252d !important;
}

.screener-card-score {
  border-color: #d3e0e7 !important;
  background: #eef4f8 !important;
  color: #3f718d !important;
}

/* 行情数值必须保留股票软件标准颜色：上涨红、下跌绿 */
:root {
  --down: #1f9d68;
  --down-soft: #eaf8f1;
}

.positive,
.metric-change.up,
.market-tape-item.is-up strong,
.market-tape-item.is-up .market-tape-change {
  color: #d34a40 !important;
}

.negative,
.metric-change.down,
.value-down,
.is-down,
.quote-price.down,
.today-stat.is-down strong {
  color: #1f9d68 !important;
}

.market-tape-item.is-down strong,
.market-tape-item.is-down .market-tape-change {
  color: #4fcf92 !important;
}

.audit-dashboard {
  display: grid;
  gap: 12px;
}

.audit-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.audit-state {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.audit-state.is-critical {
  color: #b42318;
  font-weight: 800;
}

.audit-note {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.audit-alert-box {
  padding: 12px 14px;
  border: 1px solid #f0c3be;
  border-radius: 8px;
  background: #fff4f2;
  color: #8f211a;
  font-size: 12px;
  line-height: 1.6;
}

.audit-alert-box ul {
  margin: 8px 0 0;
  padding-left: 18px;
}

.audit-critical-row {
  background: #fff1ef !important;
  color: #8f211a !important;
}

.audit-warning-row {
  background: #fff9ec !important;
}

/* v3 final lock: override the legacy gradient theme after all legacy rules */
:root {
  --brand-1: #0f766e;
  --brand-2: #0f766e;
  --brand-3: #c6a15b;
  --accent-amber: #c6a15b;
  --accent-rose: #c53d36;
}

body {
  background-color: #eef1f4 !important;
  background-image:
    linear-gradient(rgba(37, 52, 66, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(37, 52, 66, 0.035) 1px, transparent 1px) !important;
  background-size: 36px 36px !important;
  background-attachment: fixed !important;
}

.app-header {
  border-bottom: 1px solid #23313c !important;
  background: var(--terminal-navy) !important;
  box-shadow: 0 10px 30px rgba(7, 13, 18, 0.22) !important;
  color: #ffffff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

.brand-mark {
  background: var(--terminal-gold) !important;
  background-image: none !important;
  box-shadow: 0 7px 18px rgba(198, 161, 91, 0.22) !important;
  color: #101820 !important;
}

.brand-copy strong {
  color: #ffffff !important;
  letter-spacing: 0 !important;
}

.brand-copy small {
  color: #91a2af !important;
}

.icon-button {
  border-color: rgba(255, 255, 255, 0.16) !important;
  background: rgba(255, 255, 255, 0.05) !important;
  color: #e5edf2 !important;
}

.status-pill {
  border-color: rgba(255, 255, 255, 0.13) !important;
  background: rgba(255, 255, 255, 0.045) !important;
  background-image: none !important;
  color: #b8c5ce !important;
}

.status-pill.is-ok {
  border-color: rgba(45, 212, 191, 0.35) !important;
  background: rgba(15, 118, 110, 0.18) !important;
  color: #9ce5dc !important;
}

.status-pill.is-warn {
  border-color: rgba(198, 161, 91, 0.45) !important;
  background: rgba(198, 161, 91, 0.12) !important;
  color: #e7c98a !important;
}

.status-pill.is-error {
  border-color: rgba(240, 113, 103, 0.45) !important;
  background: rgba(197, 61, 54, 0.18) !important;
  color: #ffb0aa !important;
}

@media (min-width: 641px) {
  .top-tabs {
    gap: 2px !important;
    padding: 0 !important;
    margin: 10px auto 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }
}

.tab-button {
  border-radius: 0 !important;
  background: transparent !important;
  color: #93a4b0 !important;
  letter-spacing: 0 !important;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.035) !important;
  color: #ffffff !important;
}

.tab-button.is-active {
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

.tab-button.is-active::after {
  background: var(--terminal-gold) !important;
}

.panel {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: var(--shadow-soft) !important;
}

.panel::before {
  height: 2px !important;
  background: var(--primary) !important;
  background-image: none !important;
  opacity: 0.82 !important;
}

.panel-title::before {
  width: 3px !important;
  height: 15px !important;
  border-radius: 0 !important;
  background: var(--terminal-gold) !important;
  background-image: none !important;
}

.metric-card,
.status-card,
.quote-card {
  border: 1px solid var(--line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  background-image: none !important;
}

.metric-card:hover,
.status-card:hover,
.quote-card:hover {
  border-color: #b8c4cc !important;
  box-shadow: 0 10px 24px -20px rgba(16, 24, 40, 0.5) !important;
  transform: none !important;
}

.strategy-card {
  border-left: 1px solid var(--line) !important;
  background: #ffffff !important;
  background-image: none !important;
}

.screener-card-item {
  border-color: var(--line) !important;
  border-radius: 8px !important;
  background: #ffffff !important;
  background-image: none !important;
  box-shadow: var(--shadow-soft) !important;
}

.screener-card-item::before {
  width: 3px !important;
  border-radius: 0 !important;
  background: var(--terminal-gold) !important;
  background-image: none !important;
}

.screener-card-score {
  border-color: #d9e4e2 !important;
  background: #eef7f6 !important;
  background-image: none !important;
  color: var(--primary) !important;
}

.screener-grade.is-a,
.screener-grade.is-b {
  border-radius: 6px !important;
  background: #13252c !important;
  background-image: none !important;
  box-shadow: none !important;
  color: #ffffff !important;
}

/* mobile navigation must remain readable after the legacy theme overrides */
@media (max-width: 640px) {
  .top-tabs {
    justify-content: flex-start !important;
    border-top: 1px solid #d8dfe4 !important;
    background: #ffffff !important;
  }

  .tab-button {
    flex: 0 0 auto !important;
    min-width: max-content !important;
    border-radius: 7px !important;
    background: transparent !important;
    color: #52606d !important;
  }

  .tab-button.is-active {
    background: #eef7f6 !important;
    color: var(--primary) !important;
  }

  .tab-button.is-active::after {
    background: var(--primary) !important;
  }
}

/* final selected-state lock: vermilion must win over legacy teal */
@media (min-width: 641px) {
  .tab-button.is-active {
    background: var(--active-red-dark) !important;
    color: #fff7f5 !important;
  }

  .tab-button.is-active::after {
    background: #e36c60 !important;
  }
}

@media (max-width: 640px) {
  .tab-button.is-active {
    background: var(--active-red-soft) !important;
    color: var(--active-red) !important;
  }

  .tab-button.is-active::after {
    background: var(--active-red) !important;
  }
}
