:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #64748b;
  --line: #dbe3ef;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #d97706;
  --teal: #0f766e;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, "SF Pro Display", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 28px 32px 18px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.2;
}

.meta {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 13px;
  text-align: right;
}

.meta strong {
  color: var(--text);
}

.layout {
  width: min(1760px, 100%);
  margin: 0 auto;
  padding: 20px 24px 36px;
}

.warnings {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 119, 6, 0.3);
  border-radius: 8px;
  background: rgba(217, 119, 6, 0.08);
  color: #92400e;
  font-size: 12px;
}

.warnings[hidden] {
  display: none;
}

.warnings strong {
  color: #78350f;
  font-size: 13px;
}

.overview {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.metric,
.stock-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.metric {
  width: 224px;
  min-height: 96px;
  padding: 8px 10px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.overview-tier {
  display: grid;
  gap: 8px;
}

.tier-title {
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.metric-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 5px;
  min-width: 0;
  white-space: nowrap;
}

.metric-head strong {
  flex: 0 0 auto;
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.metric-head span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.25;
}

.selection-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: -2px 0 4px;
}

.selection-tags span {
  padding: 1px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  color: #475569;
  background: #f8fafc;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.5;
}

.signal-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  min-height: 16px;
  color: var(--text);
  font-size: 11px;
  line-height: 1.35;
}

.signal-row strong {
  color: var(--text);
  font-size: 11px;
  font-weight: 900;
  text-align: right;
  white-space: nowrap;
}

.signal-macd-strong {
  color: var(--red) !important;
}

.signal-macd-strong-bull {
  color: var(--red) !important;
}

.signal-macd-strong-bear {
  color: #eab308 !important;
}

.signal-macd-weak-bear {
  color: var(--green) !important;
}

.signal-macd-weak-bull {
  color: var(--blue) !important;
}

.signal-macd-weak {
  color: var(--blue) !important;
}

.signal-macd-weak-dead {
  color: #111827 !important;
}

.signal-boll-daily-up {
  color: var(--green) !important;
}

.signal-boll-down,
.signal-boll-intraday-break {
  color: var(--blue) !important;
}

.signal-wgc-none {
  color: #94a3b8 !important;
}

.signal-wgc-watch {
  color: var(--blue) !important;
}

.signal-wgc-buy {
  color: var(--red) !important;
}

.signal-wgc-unfilled {
  color: #64748b !important;
}

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

.empty-lane {
  min-height: 96px;
  width: 224px;
  display: grid;
  place-items: center;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.5);
}

.stock-grid {
  display: grid;
  gap: 18px;
}

.stock-panel {
  overflow: hidden;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 18px 8px;
}

.panel-header h2 {
  font-size: 19px;
  line-height: 1.25;
}

.panel-header h2 span {
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

.panel-header p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 74px;
  height: 26px;
  padding: 0 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status.danger {
  border-color: rgba(220, 38, 38, 0.25);
  background: rgba(220, 38, 38, 0.08);
  color: var(--red);
}

.status.watch {
  border-color: rgba(217, 119, 6, 0.28);
  background: rgba(217, 119, 6, 0.09);
  color: var(--amber);
}

.status.strong {
  border-color: rgba(22, 163, 74, 0.25);
  background: rgba(22, 163, 74, 0.08);
  color: var(--green);
}

.status.neutral {
  border-color: rgba(37, 99, 235, 0.24);
  background: rgba(37, 99, 235, 0.08);
  color: var(--blue);
}

.chart-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 0 14px 16px;
}

.chart-block {
  min-width: 0;
}

.chart-block h3 {
  margin: 0;
  padding: 8px 6px 4px;
  color: #334155;
  font-size: 14px;
  line-height: 1.3;
  font-weight: 800;
}

.chart {
  position: relative;
  width: 100%;
  height: 640px;
}

.chart-30m {
  height: 640px;
}

.linked-axis-pointer {
  position: absolute;
  display: none;
  width: 0;
  border-left: 1.2px dashed #94a3b8;
  pointer-events: none;
  z-index: 20;
}

.error {
  margin: 32px;
  padding: 16px;
  border: 1px solid var(--red);
  border-radius: 8px;
  background: #fff;
  color: var(--red);
  white-space: pre-wrap;
}

@media (max-width: 720px) {
  .topbar {
    display: grid;
    padding: 22px 18px 14px;
  }

  .meta {
    text-align: left;
  }

  .layout {
    padding: 16px 12px 28px;
  }

  .metric,
  .empty-lane {
    width: 100%;
  }

  .panel-header {
    display: grid;
  }

  .chart-pair {
    grid-template-columns: 1fr;
    padding: 0 10px 14px;
  }

  .chart {
    height: 600px;
  }

  .chart-30m {
    height: 600px;
  }
}
