:root {
  color-scheme: light;
  --background: #f6f7f9;
  --background-raised: #ffffff;
  --panel: #ffffff;
  --panel-strong: #f8f9fb;
  --panel-hover: #fff7f3;
  --foreground: #17191d;
  --muted: #737c88;
  --muted-strong: #48515d;
  --border: #e4e7ec;
  --border-soft: #eef0f3;
  --accent: #ff5a1f;
  --accent-soft: rgba(255, 90, 31, 0.09);
  --up: #f04438;
  --up-strong: #e9332b;
  --up-soft: rgba(240, 68, 56, 0.1);
  --down: #009a6a;
  --down-soft: rgba(0, 154, 106, 0.09);
  --blue: #1769d2;
  --purple: #7057d8;
  --radius: 12px;
  --font-ui: "Microsoft YaHei UI", "PingFang SC", "Noto Sans CJK SC", sans-serif;
  --font-number: "Bahnschrift", "DIN Alternate", "Roboto Condensed", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--background);
  scrollbar-color: #343d48 #14181d;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--foreground);
  background:
    linear-gradient(180deg, rgba(21, 26, 32, 0.72) 0, rgba(9, 11, 14, 0) 320px),
    var(--background);
  font-family: var(--font-ui);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

body.drawer-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

button:focus-visible,
input:focus-visible,
label:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

h1,
h2,
p {
  margin: 0;
}

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

.topbar,
.date-section,
main {
  width: min(100%, 1760px);
  margin-inline: auto;
  padding-inline: 28px;
}

.topbar {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-soft);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 230px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(240, 180, 90, 0.32);
  border-radius: 7px;
  color: var(--accent);
  background: var(--accent-soft);
}

.brand-mark svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.brand-copy {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.brand-copy h1 {
  font-size: 21px;
  line-height: 1;
  font-weight: 600;
}

.brand-copy span {
  color: #687280;
  font-family: var(--font-number);
  font-size: 10px;
  font-weight: 500;
}

.topbar-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.source-chip {
  height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(13, 16, 20, 0.72);
  font-size: 12px;
  white-space: nowrap;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(240, 180, 90, 0.08);
}

.source-chip.is-live .status-dot {
  background: var(--up);
  box-shadow: 0 0 0 4px rgba(255, 89, 107, 0.08);
}

.source-chip.is-error .status-dot {
  background: var(--muted);
  box-shadow: none;
}

.button,
.icon-button,
.filter-button,
.toggle-chip,
.timeline-day,
.stock-row,
.group-toggle {
  border: 0;
  cursor: pointer;
}

.button {
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-strong);
  background: var(--panel);
  font-size: 12px;
  white-space: nowrap;
  transition:
    color 140ms ease,
    border-color 140ms ease,
    background 140ms ease;
}

.button:hover {
  color: var(--foreground);
  border-color: #39424e;
  background: var(--panel-strong);
}

.button.is-spinning svg {
  animation: spin 800ms linear infinite;
}

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

.button svg,
.icon-button svg,
.search-box svg,
.date-display > svg,
.data-note svg,
.toggle-chip svg,
.header-icon {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}

.button-quiet {
  background: transparent;
}

.button-latest {
  width: 54px;
  padding: 0;
  color: var(--accent);
  border-color: rgba(240, 180, 90, 0.23);
  background: var(--accent-soft);
}

.icon-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted-strong);
  background: var(--panel);
}

.icon-button:hover {
  color: var(--foreground);
  background: var(--panel-hover);
}

.date-section {
  padding-top: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border-soft);
}

.date-row {
  display: flex;
  align-items: center;
  gap: 18px;
}

.date-navigator {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}

.date-display {
  position: relative;
  width: 228px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  cursor: pointer;
}

.date-display > svg {
  color: var(--accent);
}

.date-main {
  font-family: var(--font-number);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.date-weekday {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
}

.date-picker-native {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.timeline-wrap {
  min-width: 0;
  flex: 1;
  overflow: hidden;
}

.timeline {
  display: grid;
  grid-template-columns: repeat(9, minmax(46px, 1fr));
  gap: 4px;
}

.timeline-day {
  height: 38px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-family: var(--font-number);
  font-size: 11px;
}

.timeline-day:hover {
  color: var(--foreground);
  background: var(--panel);
}

.timeline-day.is-active {
  color: var(--foreground);
  border-color: rgba(240, 180, 90, 0.28);
  background: var(--accent-soft);
}

.timeline-day span:first-child {
  color: #626c79;
  font-family: var(--font-ui);
  font-size: 9px;
}

.timeline-day.is-active span:first-child {
  color: var(--accent);
}

.data-note {
  min-width: 112px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.data-note svg {
  color: #637080;
}

main {
  padding-bottom: 20px;
}

.market-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  border-bottom: 1px solid var(--border-soft);
}

.metric {
  min-width: 0;
  min-height: 98px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 12px 20px;
  border-right: 1px solid var(--border-soft);
}

.metric:first-child {
  padding-left: 0;
}

.metric:last-child {
  border-right: 0;
}

.metric-label {
  color: var(--muted);
  font-size: 11px;
}

.metric-value {
  overflow: hidden;
  color: var(--foreground);
  font-family: var(--font-number);
  font-size: 27px;
  line-height: 1.05;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-value.metric-accent {
  color: var(--accent);
}

.metric-foot {
  overflow: hidden;
  color: #65707d;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.toolbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.search-box {
  width: min(280px, 28vw);
  height: 36px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--muted);
  background: var(--panel);
}

.search-box:focus-within {
  border-color: rgba(240, 180, 90, 0.44);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: var(--foreground);
  background: transparent;
  font-size: 12px;
}

.search-box input::placeholder {
  color: #66717e;
}

.search-box kbd {
  min-width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-bottom-color: #3b4551;
  border-radius: 4px;
  color: #697483;
  background: #0d1115;
  font-family: var(--font-number);
  font-size: 10px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--border-soft);
  border-radius: 7px;
  background: #0c0f13;
}

.filter-button {
  height: 28px;
  padding: 0 10px;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  white-space: nowrap;
}

.filter-button:hover {
  color: var(--foreground);
  background: var(--panel);
}

.filter-button.is-active {
  color: var(--foreground);
  background: var(--panel-strong);
  box-shadow: inset 0 0 0 1px #2a323c;
}

.toolbar-result {
  margin-left: auto;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}

.ladder-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.94fr) minmax(430px, 1.16fr) 302px;
  gap: 12px;
  align-items: start;
}

.panel {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}

.previous-panel,
.current-panel {
  display: flex;
  flex-direction: column;
  height: clamp(570px, calc(100vh - 290px), 770px);
}

.panel-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 16px 10px;
}

.panel-header.compact {
  min-height: 58px;
  padding-bottom: 7px;
}

.panel-header h2 {
  margin-top: 2px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600;
}

.panel-eyebrow {
  color: #626d7a;
  font-family: var(--font-number);
  font-size: 9px;
  font-weight: 500;
}

.panel-count {
  height: 28px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted-strong);
  background: #0d1115;
  font-family: var(--font-number);
  font-size: 11px;
  white-space: nowrap;
}

.panel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toggle-chip {
  height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  font-size: 10px;
  white-space: nowrap;
}

.toggle-chip:hover {
  color: var(--foreground);
  background: var(--panel-hover);
}

.toggle-chip[aria-pressed="true"] {
  color: var(--accent);
  border-color: rgba(240, 180, 90, 0.3);
  background: var(--accent-soft);
}

.panel-caption {
  min-height: 27px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 16px 7px;
  color: #697482;
  font-size: 10px;
}

.panel-caption span:last-child {
  color: var(--muted-strong);
  text-align: right;
}

.stock-head,
.stock-row {
  display: grid;
  align-items: center;
  column-gap: 8px;
}

.stock-head {
  min-height: 32px;
  padding: 0 16px;
  border-top: 1px solid var(--border-soft);
  border-bottom: 1px solid var(--border-soft);
  color: #6c7683;
  background: #0e1216;
  font-size: 10px;
}

.previous-head,
.previous-row {
  grid-template-columns: minmax(150px, 1.6fr) 72px 72px 92px;
}

.current-head,
.current-row {
  grid-template-columns: minmax(160px, 1.5fr) 88px 58px 90px;
}

.stock-head span:nth-child(n + 2) {
  text-align: right;
}

.ladder-scroll {
  min-height: 0;
  flex: 1;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.board-group {
  position: relative;
}

.group-header {
  position: sticky;
  top: 0;
  z-index: 3;
  min-height: 37px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(17, 21, 26, 0.97);
  backdrop-filter: blur(8px);
}

.board-number {
  min-width: 38px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border-radius: 4px;
  color: #16191d;
  background: var(--accent);
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 600;
}

.board-number.board-high {
  color: #fff;
  background: var(--up-strong);
}

.board-number.board-first {
  color: var(--muted-strong);
  border: 1px solid var(--border);
  background: #151a20;
}

.group-title {
  color: var(--muted-strong);
  font-size: 11px;
}

.group-count {
  color: #626d79;
  font-family: var(--font-number);
  font-size: 10px;
}

.group-rule {
  height: 1px;
  flex: 1;
  background: var(--border-soft);
}

.stock-row {
  width: 100%;
  min-height: 40px;
  padding: 4px 16px;
  border-bottom: 1px solid rgba(35, 42, 51, 0.58);
  text-align: left;
  background: transparent;
  transition: background 120ms ease;
}

.stock-row:hover {
  background: var(--panel-hover);
}

.stock-row.is-selected {
  background: rgba(240, 180, 90, 0.07);
  box-shadow: inset 2px 0 var(--accent);
}

.stock-row.has-promoted {
  box-shadow: inset 2px 0 rgba(255, 89, 107, 0.55);
}

.stock-row.has-promoted.is-selected {
  box-shadow:
    inset 2px 0 var(--accent),
    inset 0 0 0 1px rgba(240, 180, 90, 0.08);
}

.stock-identity {
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.stock-code {
  flex: 0 0 auto;
  color: #7d8997;
  font-family: var(--font-number);
  font-size: 11px;
}

.stock-name {
  overflow: hidden;
  color: #dfe4ea;
  font-size: 12px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-price,
.stock-change,
.stock-turnover {
  text-align: right;
  font-family: var(--font-number);
  font-size: 12px;
  white-space: nowrap;
}

.is-up {
  color: var(--up);
}

.is-down {
  color: var(--down);
}

.is-flat {
  color: var(--muted);
}

.price-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  font-family: var(--font-number);
  font-size: 11px;
  white-space: nowrap;
}

.price-stack strong {
  font-size: 12px;
  font-weight: 500;
}

.price-stack span {
  font-size: 9px;
}

.result-cell {
  display: flex;
  justify-content: flex-end;
}

.status-pill {
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px 6px;
  border-radius: 4px;
  color: var(--muted);
  background: #161b21;
  font-size: 9px;
  white-space: nowrap;
}

.status-pill.promoted {
  color: #ff8996;
  background: var(--up-soft);
}

.status-pill.failed {
  color: #788391;
}

.status-pill.open {
  color: var(--accent);
  background: var(--accent-soft);
}

.status-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.micro-label {
  color: #626d79;
  font-size: 8px;
}

.group-toggle {
  width: 100%;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--muted);
  background: #0e1216;
  font-size: 10px;
}

.group-toggle:hover {
  color: var(--foreground);
  background: var(--panel-hover);
}

.group-toggle svg {
  width: 12px;
  height: 12px;
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  padding: 30px;
  text-align: center;
}

.empty-inner {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 12px;
}

.empty-inner svg {
  width: 25px;
  height: 25px;
  color: #55616f;
  stroke-width: 1.5;
}

.empty-inner strong {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 500;
}

.empty-inner p {
  max-width: 260px;
  color: #707b89;
  font-size: 11px;
  line-height: 1.7;
}

.loading-block {
  display: grid;
  gap: 1px;
}

.loading-block span {
  height: 48px;
  background:
    linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.025) 20%,
      rgba(255, 255, 255, 0.055) 50%,
      rgba(255, 255, 255, 0.025) 80%
    ),
    #11151a;
  background-size: 220% 100%;
  animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -220% 0;
  }
}

.insight-column {
  display: grid;
  gap: 12px;
}

.stat-panel,
.structure-panel,
.industry-panel {
  padding-bottom: 13px;
}

.header-icon {
  color: #647080;
}

.promotion-hero {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 16px 8px;
}

.promotion-hero strong {
  color: var(--accent);
  font-family: var(--font-number);
  font-size: 32px;
  line-height: 1;
  font-weight: 600;
}

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

.promotion-meter {
  height: 5px;
  margin: 0 16px 15px;
  overflow: hidden;
  border-radius: 999px;
  background: #222934;
}

.promotion-meter span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d99142, #f1c16d);
  transition: width 420ms ease;
}

.funnel-numbers {
  display: grid;
  grid-template-columns: 1fr 20px 1fr;
  align-items: center;
  gap: 4px;
  padding: 0 16px 14px;
}

.funnel-numbers > div {
  display: grid;
  gap: 3px;
}

.funnel-numbers > div:last-child {
  text-align: right;
}

.funnel-numbers span {
  color: #677280;
  font-size: 9px;
}

.funnel-numbers strong {
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 500;
}

.funnel-numbers svg {
  width: 15px;
  height: 15px;
  color: #4c5662;
}

.rate-list {
  display: grid;
  gap: 11px;
  padding: 12px 16px 2px;
  border-top: 1px solid var(--border-soft);
}

.rate-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 6px;
}

.rate-item > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.rate-item span {
  font-size: 11px;
}

.rate-item small {
  color: #65707d;
  font-family: var(--font-number);
  font-size: 9px;
}

.rate-item > strong {
  color: var(--muted-strong);
  font-family: var(--font-number);
  font-size: 11px;
  font-weight: 500;
}

.rate-track {
  grid-column: 1 / -1;
  height: 3px;
  overflow: hidden;
  border-radius: 999px;
  background: #222934;
}

.rate-track span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--up);
  transition: width 420ms ease;
}

.structure-list,
.industry-list {
  display: grid;
  gap: 8px;
  padding: 8px 16px 0;
}

.structure-item {
  display: grid;
  grid-template-columns: 50px 1fr 28px;
  align-items: center;
  gap: 8px;
}

.structure-label,
.structure-count,
.industry-count {
  font-family: var(--font-number);
  font-size: 10px;
}

.structure-label {
  color: var(--muted-strong);
}

.structure-count {
  color: var(--muted);
  text-align: right;
}

.structure-bar,
.industry-bar {
  height: 4px;
  overflow: hidden;
  border-radius: 999px;
  background: #212831;
}

.structure-bar span,
.industry-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 420ms ease;
}

.industry-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 26px;
  gap: 7px 10px;
  align-items: center;
}

.industry-name {
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.industry-count {
  color: var(--muted);
  text-align: right;
}

.industry-bar {
  grid-column: 1 / -1;
  height: 3px;
}

.industry-bar span {
  background: var(--blue);
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding-top: 14px;
  color: #586370;
  font-size: 9px;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 80;
  max-width: min(360px, calc(100vw - 40px));
  padding: 10px 13px;
  border: 1px solid #39434f;
  border-radius: 6px;
  color: var(--foreground);
  background: #171c22;
  font-size: 11px;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, 0.54);
  backdrop-filter: blur(2px);
}

.stock-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  width: min(460px, 100vw);
  border-left: 1px solid #333c47;
  background: #101419;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.28);
  transform: translateX(102%);
  transition: transform 220ms ease;
}

.stock-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  height: 82px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
}

.drawer-code {
  color: var(--accent);
  font-family: var(--font-number);
  font-size: 10px;
}

.drawer-header h2 {
  margin-top: 4px;
  font-size: 18px;
  font-weight: 600;
}

.drawer-body {
  height: calc(100% - 82px);
  overflow-y: auto;
  padding: 20px;
}

.drawer-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 17px;
  border-bottom: 1px solid var(--border-soft);
}

.drawer-price {
  display: grid;
  gap: 4px;
}

.drawer-price strong {
  font-family: var(--font-number);
  font-size: 30px;
  line-height: 1;
  font-weight: 600;
}

.drawer-price span {
  font-family: var(--font-number);
  font-size: 11px;
}

.drawer-board {
  display: grid;
  justify-items: end;
  gap: 5px;
}

.drawer-board strong {
  color: var(--accent);
  font-family: var(--font-number);
  font-size: 24px;
  font-weight: 600;
}

.drawer-board span {
  color: var(--muted);
  font-size: 9px;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border-soft);
}

.drawer-tag {
  padding: 4px 7px;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted-strong);
  font-size: 9px;
}

.drawer-section {
  padding-top: 17px;
}

.drawer-section h3 {
  margin: 0 0 11px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 500;
}

.kline-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.kline-heading h3 {
  margin: 0;
}

.kline-ranges {
  display: inline-flex;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--border-soft);
  border-radius: 5px;
  background: #0c0f13;
}

.kline-range {
  height: 23px;
  padding: 0 7px;
  border: 0;
  border-radius: 3px;
  color: #707b89;
  background: transparent;
  font-family: var(--font-number);
  font-size: 9px;
  cursor: pointer;
}

.kline-range:hover {
  color: var(--foreground);
}

.kline-range.is-active {
  color: var(--foreground);
  background: #20262e;
}

.kline-legend {
  min-height: 25px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
  color: #727d8a;
  font-family: var(--font-number);
  font-size: 9px;
  white-space: nowrap;
  overflow: hidden;
}

.kline-legend strong {
  color: var(--muted-strong);
  font-weight: 500;
}

.kline-legend .legend-up {
  color: var(--up);
}

.kline-legend .legend-down {
  color: var(--down);
}

.kline-chart-shell {
  position: relative;
  height: 242px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: #0d1014;
}

.kline-chart {
  width: 100%;
  height: 100%;
}

.kline-loading,
.kline-error {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 20px;
  color: #74808e;
  background: #0d1014;
  font-size: 10px;
  text-align: center;
}

.kline-loading::before {
  content: "";
  width: 16px;
  height: 16px;
  margin-right: 8px;
  border: 1px solid #39424d;
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.kline-loading {
  grid-auto-flow: column;
}

.kline-loading[hidden],
.kline-error[hidden] {
  display: none;
}

.kline-error {
  color: #8b96a4;
}

.kline-foot {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 7px;
  color: #5f6a77;
  font-size: 8px;
}

.kline-ma-legend {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.kline-ma-legend > span {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.ma-dot {
  width: 5px;
  height: 2px;
  display: inline-block;
  border-radius: 999px;
}

.ma-dot.ma5 {
  background: var(--accent);
}

.ma-dot.ma10 {
  background: var(--blue);
}

.drawer-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 6px;
  background: var(--border-soft);
}

.drawer-metric {
  display: grid;
  gap: 5px;
  padding: 11px;
  background: #12171c;
}

.drawer-metric span {
  color: #66717e;
  font-size: 9px;
}

.drawer-metric strong {
  color: var(--muted-strong);
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 500;
}

.board-trail {
  display: flex;
  align-items: center;
  gap: 5px;
}

.trail-step {
  height: 26px;
  flex: 1;
  display: grid;
  place-items: center;
  border-radius: 4px;
  color: #171a1d;
  background: var(--accent);
  font-family: var(--font-number);
  font-size: 9px;
  font-weight: 600;
}

.trail-gap {
  width: 5px;
  height: 1px;
  background: #3a444f;
}

.drawer-result {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #12171c;
}

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

.drawer-result strong {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 500;
}

@media (max-width: 1320px) {
  .ladder-layout {
    grid-template-columns: minmax(330px, 1fr) minmax(400px, 1.2fr) 280px;
  }

  .metric {
    padding-inline: 14px;
  }

  .metric-value {
    font-size: 24px;
  }

  .timeline {
    grid-template-columns: repeat(7, minmax(40px, 1fr));
  }

  .timeline-day:nth-child(n + 8) {
    display: none;
  }
}

@media (max-width: 1280px) {
  .ladder-layout {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  }

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

  .stat-panel,
  .structure-panel,
  .industry-panel {
    min-height: 245px;
  }

  .timeline-wrap {
    display: none;
  }
}

@media (max-width: 860px) {
  .topbar,
  .date-section,
  main {
    padding-inline: 18px;
  }

  .topbar {
    height: auto;
    min-height: 66px;
    flex-wrap: wrap;
    padding-block: 12px;
  }

  .brand {
    min-width: 0;
  }

  .topbar-meta {
    margin-left: auto;
  }

  .source-chip {
    display: none;
  }

  .date-row {
    flex-wrap: wrap;
    gap: 10px;
  }

  .date-navigator {
    flex: 1;
  }

  .date-display {
    flex: 1;
    width: auto;
    min-width: 190px;
  }

  .data-note {
    min-width: 0;
    margin-left: auto;
  }

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

  .metric {
    min-height: 82px;
    border-bottom: 1px solid var(--border-soft);
  }

  .metric:nth-child(3n) {
    border-right: 0;
  }

  .metric:nth-child(n + 4) {
    border-bottom: 0;
  }

  .metric:first-child {
    padding-left: 14px;
  }

  .toolbar {
    flex-wrap: wrap;
    padding-block: 13px;
  }

  .search-box {
    width: 240px;
    flex: 1;
  }

  .toolbar-result {
    width: 100%;
    margin-left: 0;
    text-align: right;
  }

  .ladder-layout {
    grid-template-columns: 1fr;
  }

  .previous-panel,
  .current-panel {
    height: 620px;
  }

  .insight-column {
    grid-column: auto;
    grid-template-columns: 1fr 1fr;
  }

  .industry-panel {
    grid-column: 1 / -1;
    min-height: 0;
  }

  .industry-list {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 620px) {
  .topbar,
  .date-section,
  main {
    padding-inline: 12px;
  }

  .brand-copy span {
    display: none;
  }

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

  .brand-copy h1 {
    font-size: 19px;
  }

  .button-quiet span {
    display: none;
  }

  .button-quiet {
    width: 34px;
    padding: 0;
  }

  .date-navigator {
    width: 100%;
    gap: 4px;
  }

  .date-display {
    min-width: 0;
  }

  .date-weekday {
    display: none;
  }

  .data-note {
    display: none;
  }

  .metric {
    min-height: 76px;
    padding: 10px 12px;
  }

  .metric:first-child {
    padding-left: 12px;
  }

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

  .metric-foot {
    font-size: 9px;
  }

  .toolbar {
    gap: 9px;
  }

  .search-box {
    width: 100%;
    flex-basis: 100%;
  }

  .filter-group {
    width: 100%;
    overflow-x: auto;
  }

  .filter-button {
    flex: 1;
    min-width: max-content;
  }

  .toolbar-result {
    display: none;
  }

  .previous-panel,
  .current-panel {
    height: auto;
  }

  .ladder-scroll {
    max-height: 560px;
  }

  .panel-header {
    min-height: 61px;
    padding: 11px 12px 8px;
  }

  .panel-caption {
    padding-inline: 12px;
  }

  .stock-head,
  .stock-row {
    padding-inline: 12px;
    column-gap: 5px;
  }

  .previous-head,
  .previous-row {
    grid-template-columns: minmax(132px, 1fr) 64px 62px 78px;
  }

  .current-head,
  .current-row {
    grid-template-columns: minmax(132px, 1fr) 76px 76px;
  }

  .current-head span:nth-child(3),
  .current-row .turnover-cell {
    display: none;
  }

  .stock-identity {
    gap: 6px;
  }

  .stock-name {
    font-size: 11px;
  }

  .stock-code,
  .stock-price,
  .stock-change {
    font-size: 10px;
  }

  .status-pill {
    font-size: 8px;
  }

  .group-header {
    padding-inline: 12px;
  }

  .insight-column {
    grid-template-columns: 1fr;
  }

  .industry-panel {
    grid-column: auto;
  }

  .industry-list {
    grid-template-columns: 1fr;
  }

  .stat-panel,
  .structure-panel,
  .industry-panel {
    min-height: 0;
  }

  .app-footer {
    flex-direction: column;
    gap: 4px;
  }

  .stock-drawer {
    top: auto;
    left: 0;
    width: 100%;
    height: min(82vh, 700px);
    border-top: 1px solid #333c47;
    border-left: 0;
    border-radius: 10px 10px 0 0;
    transform: translateY(103%);
  }

  .stock-drawer.is-open {
    transform: translateY(0);
  }
}

@media (max-width: 410px) {
  .brand-copy h1 {
    font-size: 17px;
  }

  .topbar-meta {
    gap: 5px;
  }

  .date-display {
    padding-inline: 8px;
  }

  .date-main {
    font-size: 12px;
  }

  .previous-head,
  .previous-row {
    grid-template-columns: minmax(116px, 1fr) 58px 54px 72px;
  }

  .current-head,
  .current-row {
    grid-template-columns: minmax(116px, 1fr) 70px 70px;
  }

  .price-stack {
    font-size: 10px;
  }

  .price-stack strong {
    font-size: 11px;
  }
}

@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;
  }
}

/* Bright data-dashboard theme */
html {
  background: var(--background);
  scrollbar-color: #cbd1da #f1f3f6;
}

body {
  color: var(--foreground);
  background:
    linear-gradient(180deg, #ffffff 0, #ffffff 260px, #f6f7f9 520px),
    var(--background);
}

.topbar {
  min-height: 78px;
  border-bottom-color: #eceef2;
  background: rgba(255, 255, 255, 0.94);
}

.date-section {
  border-bottom-color: #eceef2;
  background: #ffffff;
}

.brand {
  min-width: 270px;
  gap: 13px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-color: #ffd8c9;
  border-radius: 12px;
  color: var(--accent);
  background: #fff3ed;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.brand-mark svg {
  width: 23px;
  height: 23px;
}

.brand-copy {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.brand-copy h1 {
  color: var(--accent);
  background: linear-gradient(135deg, #ff4713 0%, #e82e5c 56%, #125ec4 100%);
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 800;
}

.brand-copy span {
  color: #737b87;
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 400;
}

.source-chip {
  border-color: #e2e6eb;
  color: #59616d;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.source-chip.is-live {
  border-color: rgba(23, 105, 210, 0.22);
  color: var(--blue);
  background: #f7faff;
}

.status-dot {
  background: #a7afb9;
  box-shadow: none;
}

.source-chip.is-live .status-dot {
  background: var(--blue);
  box-shadow: 0 0 0 3px rgba(23, 105, 210, 0.11);
}

.button,
.icon-button {
  border-color: #e2e6eb;
  color: #59616d;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.035);
}

.button:hover,
.icon-button:hover {
  border-color: #cfd5dd;
  color: #20242a;
  background: #f8f9fb;
}

.button-latest,
.button-latest:hover {
  color: var(--accent);
  border-color: #ffd4c5;
  background: #fff4ef;
}

.date-display {
  border-color: #e2e6eb;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.04);
}

.date-display > svg {
  color: var(--accent);
}

.date-main {
  color: #272b31;
}

.date-weekday,
.data-note {
  color: #7d8692;
}

.timeline-day {
  color: #77808c;
}

.timeline-day:hover {
  color: #22262c;
  background: #f5f7f9;
}

.timeline-day.is-active {
  color: #bc3b13;
  border-color: #ffd5c6;
  background: #fff3ed;
}

.timeline-day span:first-child {
  color: #9aa2ad;
}

.timeline-day.is-active span:first-child {
  color: var(--accent);
}

.data-note svg {
  color: #8d96a1;
}

.market-strip {
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.045);
}

.metric {
  min-height: 106px;
  padding: 16px 22px;
  border-color: var(--border-soft);
}

.metric-label {
  color: #66707c;
  font-size: 12px;
}

.metric-value {
  color: #181b20;
  font-size: 29px;
  font-weight: 700;
}

.metric-value.metric-accent {
  color: var(--accent);
}

.metric-foot {
  color: #9299a3;
  font-size: 11px;
}

.toolbar {
  min-height: 74px;
}

.search-box {
  border-color: #e1e5ea;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.04);
}

.search-box:focus-within {
  border-color: rgba(255, 90, 31, 0.48);
  box-shadow: 0 0 0 3px rgba(255, 90, 31, 0.08);
}

.search-box input {
  color: #20242a;
  font-size: 13px;
}

.search-box input::placeholder {
  color: #9ba2ac;
}

.search-box kbd {
  border-color: #e4e7ec;
  border-bottom-color: #d5dae1;
  color: #9199a4;
  background: #f7f8fa;
}

.filter-group {
  border-color: #e8eaee;
  background: #f2f4f6;
}

.filter-button {
  color: #68717d;
  font-size: 12px;
}

.filter-button:hover {
  color: #272b31;
  background: rgba(255, 255, 255, 0.7);
}

.filter-button.is-active {
  color: #25292f;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(17, 24, 39, 0.11);
}

.toolbar-result {
  color: #7b8490;
  font-size: 12px;
}

.ladder-layout {
  gap: 16px;
}

.panel {
  border-color: var(--border);
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(17, 24, 39, 0.045);
}

.panel-header h2 {
  color: #171a1f;
  font-size: 18px;
}

.panel-eyebrow {
  color: #99a0aa;
  font-size: 10px;
}

.panel-count {
  border-color: #e5e8ed;
  color: #5f6874;
  background: #f7f8fa;
  font-size: 11px;
}

.toggle-chip {
  border-color: #e2e6eb;
  color: #69727e;
}

.toggle-chip:hover {
  color: #24282e;
  background: #f7f8fa;
}

.toggle-chip[aria-pressed="true"] {
  color: #cf4218;
  border-color: #ffd3c3;
  background: #fff3ed;
}

.panel-caption {
  color: #8a929d;
  font-size: 11px;
}

.panel-caption span:last-child {
  color: #59626e;
}

.stock-head {
  border-color: var(--border-soft);
  color: #89919c;
  background: #fafbfc;
  font-size: 11px;
}

.ladder-scroll {
  background: #ffffff;
}

.ladder-scroll::-webkit-scrollbar {
  width: 8px;
}

.ladder-scroll::-webkit-scrollbar-thumb {
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #cfd5dd;
}

.group-header {
  border-bottom-color: var(--border-soft);
  background: rgba(255, 255, 255, 0.97);
}

.board-number {
  color: #ffffff;
  background: var(--accent);
  font-weight: 700;
}

.board-number.board-high {
  background: #ed4330;
}

.board-number.board-first {
  color: #68717d;
  border-color: #e3e6eb;
  background: #f5f6f8;
}

.group-title {
  color: #4b535e;
  font-size: 12px;
}

.group-count {
  color: #929aa5;
  font-size: 11px;
}

.group-rule {
  background: #eef0f3;
}

.stock-row {
  border-bottom-color: #f0f2f4;
}

.stock-row:hover {
  background: #fff8f5;
}

.stock-row.is-selected {
  background: #fff4ef;
  box-shadow: inset 3px 0 var(--accent);
}

.stock-row.has-promoted {
  box-shadow: inset 3px 0 rgba(240, 68, 56, 0.48);
}

.stock-row.has-promoted.is-selected {
  box-shadow: inset 3px 0 var(--accent);
}

.stock-code {
  color: #858e99;
  font-size: 11px;
}

.stock-name {
  color: #252a31;
  font-size: 13px;
}

.stock-price,
.stock-change,
.stock-turnover {
  font-size: 12px;
}

.price-stack {
  color: #31363d;
}

.status-pill {
  color: #747d89;
  background: #f2f4f6;
}

.status-pill.promoted {
  color: #cf4218;
  background: #fff0e9;
}

.status-pill.failed {
  color: #8a929d;
  background: #f4f5f7;
}

.status-pill.open {
  color: #a86600;
  background: #fff7e5;
}

.group-toggle {
  border-bottom-color: var(--border-soft);
  color: #7b8490;
  background: #fafbfc;
}

.empty-inner {
  color: #7a8390;
}

.empty-inner svg {
  color: #aab1bb;
}

.empty-inner strong {
  color: #4f5864;
}

.empty-inner p {
  color: #8b939e;
}

.loading-block span {
  background:
    linear-gradient(
      90deg,
      rgba(15, 23, 42, 0.025) 20%,
      rgba(15, 23, 42, 0.05) 50%,
      rgba(15, 23, 42, 0.025) 80%
    ),
    #f7f8fa;
}

.header-icon {
  color: #9ba3ad;
}

.promotion-hero strong {
  color: var(--accent);
  font-weight: 700;
}

.promotion-hero span {
  color: #7b8490;
  font-size: 11px;
}

.promotion-meter,
.rate-track,
.structure-bar,
.industry-bar {
  background: #eef0f3;
}

.promotion-meter span {
  background: linear-gradient(90deg, #ff4713, #ff7b45);
}

.rate-item span {
  color: #434b56;
}

.rate-item small {
  color: #929aa5;
}

.rate-item > strong {
  color: #56606c;
}

.rate-track span {
  background: #f04a39;
}

.structure-label {
  color: #505965;
}

.structure-count,
.industry-count {
  color: #818a96;
}

.structure-bar span {
  background: var(--accent);
}

.industry-name {
  color: #4e5762;
  font-size: 11px;
}

.industry-bar span {
  background: var(--blue);
}

.app-footer {
  color: #9199a3;
  font-size: 10px;
}

.toast {
  border-color: #e0e4e9;
  color: #252a31;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
}

.drawer-backdrop {
  background: rgba(17, 24, 39, 0.36);
}

.stock-drawer {
  border-left-color: #e0e4e9;
  background: #ffffff;
  box-shadow: -20px 0 60px rgba(15, 23, 42, 0.16);
}

.drawer-header {
  border-bottom-color: var(--border-soft);
  background: #ffffff;
}

.drawer-code {
  color: var(--accent);
}

.drawer-header h2 {
  color: #171a1f;
}

.drawer-price strong {
  font-weight: 700;
}

.drawer-tags {
  border-bottom-color: var(--border-soft);
}

.drawer-tag {
  border-color: #e5e8ed;
  color: #59626e;
  background: #f8f9fb;
}

.drawer-section h3 {
  color: #7b8490;
  font-size: 11px;
}

.kline-ranges {
  border-color: #e7e9ed;
  background: #f3f5f7;
}

.kline-range {
  color: #7b8490;
}

.kline-range:hover {
  color: #252a31;
}

.kline-range.is-active {
  color: #252a31;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.1);
}

.kline-legend {
  color: #8b939e;
}

.kline-legend strong {
  color: #4b545f;
}

.kline-chart-shell {
  border-color: #eceef2;
  background: #ffffff;
}

.kline-loading,
.kline-error {
  color: #7d8692;
  background: #ffffff;
}

.kline-loading::before {
  border-color: #e2e5ea;
  border-top-color: var(--accent);
}

.kline-foot {
  color: #939ba6;
}

.drawer-metrics {
  border-color: #eceef2;
  background: #eceef2;
}

.drawer-metric {
  background: #ffffff;
}

.drawer-metric span {
  color: #8b939e;
}

.drawer-metric strong {
  color: #3f4752;
}

.trail-gap {
  background: #dfe3e8;
}

.drawer-result {
  border-color: #e7e9ed;
  background: #fafbfc;
}

.drawer-result span {
  color: #7d8692;
}

.drawer-result strong {
  color: #414a55;
}

@media (max-width: 860px) {
  .topbar {
    background: #ffffff;
  }

  .market-strip {
    margin-top: 14px;
  }

  .metric:nth-child(n + 4) {
    border-bottom: 0;
  }
}

@media (max-width: 620px) {
  .brand-copy h1 {
    font-size: 18px;
  }

  .brand-copy span {
    font-size: 10px;
  }

  .market-strip {
    border-radius: 12px;
  }

  .metric {
    min-height: 84px;
    padding: 11px 12px;
  }

  .metric-value {
    font-size: 22px;
  }

  .stock-name {
    font-size: 12px;
  }
}
