:root {
  color-scheme: dark;
  --bg: #1c1c1e;
  --base: #242428;
  --panel: rgba(248, 113, 113, 0.18);
  --panel-strong: rgba(248, 113, 113, 0.28);
  --text: #e5e5e5;
  --muted: rgba(229, 229, 229, 0.62);
  --faint: rgba(229, 229, 229, 0.28);
  --primary: #f14d42;
  --red: #f87171;
  --green: #4ade80;
  --blue: #60a5fa;
  --orange: #fb923c;
  --violet: #a78bfa;
}

html:not(.dark) {
  color-scheme: light;
  --bg: #f6f7fb;
  --base: #ffffff;
  --panel: rgba(239, 68, 68, 0.10);
  --panel-strong: rgba(239, 68, 68, 0.16);
  --text: #20242c;
  --muted: rgba(56, 65, 80, 0.62);
  --faint: rgba(56, 65, 80, 0.20);
  --primary: #ef4444;
  --red: #dc2626;
  --green: #16851f;
  --blue: #2563eb;
  --orange: #ea580c;
  --violet: #7c3aed;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.30), transparent),
    var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

html:not(.dark) body {
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(239, 68, 68, 0.16), transparent),
    linear-gradient(180deg, #fff7f7 0%, var(--bg) 42%);
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  color: inherit;
}

.shell {
  min-height: 100vh;
  overflow-x: hidden;
  padding: 20px clamp(16px, 4vw, 72px) 28px;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 14px 0 18px;
  backdrop-filter: blur(14px);
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 50%;
  background: rgba(241, 77, 66, 0.24);
  color: var(--red);
  font-weight: 900;
}

.brand-title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 12px;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.auth-pill {
  display: grid;
  min-width: 88px;
  cursor: pointer;
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(163, 163, 163, 0.12);
  color: var(--muted);
  text-align: left;
}

.auth-pill.is-logged {
  background: rgba(248, 113, 113, 0.16);
  color: var(--text);
}

.auth-pill span {
  font-size: 11px;
}

.auth-pill strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.icon-button,
.search-button,
.tab-button,
.source-action {
  cursor: pointer;
  border-radius: 8px;
  background: rgba(163, 163, 163, 0.12);
  transition: background 0.16s ease, transform 0.16s ease;
}

.icon-button:hover,
.search-button:hover,
.tab-button:hover,
.source-action:hover {
  background: rgba(248, 113, 113, 0.18);
}

.icon-button:disabled,
.search-button:disabled,
.tab-button:disabled,
.source-action:disabled {
  cursor: wait;
  opacity: 0.62;
}

.icon-button {
  width: 40px;
  height: 40px;
}

.refresh-pill {
  display: inline-flex;
  min-width: 148px;
  height: 40px;
  cursor: pointer;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  padding: 6px 10px;
  background:
    linear-gradient(135deg, rgba(248, 113, 113, 0.16), rgba(251, 146, 60, 0.06)),
    rgba(163, 163, 163, 0.10);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.refresh-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.32);
  background:
    linear-gradient(135deg, rgba(248, 113, 113, 0.24), rgba(251, 146, 60, 0.09)),
    rgba(163, 163, 163, 0.14);
  box-shadow: 0 14px 30px rgba(248, 113, 113, 0.10);
}

.refresh-pill.is-off {
  border-color: rgba(229, 229, 229, 0.10);
  background: rgba(163, 163, 163, 0.10);
}

.refresh-dot {
  position: relative;
  width: 9px;
  height: 9px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(74, 222, 128, 0.10);
}

.refresh-pill.is-on .refresh-dot::after {
  content: "";
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 1px solid rgba(74, 222, 128, 0.28);
  animation: refresh-pulse 1.6s ease-out infinite;
}

.refresh-pill.is-off .refresh-dot {
  background: rgba(229, 229, 229, 0.38);
  box-shadow: 0 0 0 4px rgba(229, 229, 229, 0.06);
}

.refresh-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  text-align: left;
}

.refresh-line {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
}

.refresh-label {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.refresh-count {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.1;
}

.refresh-meta {
  overflow: hidden;
  max-width: 112px;
  color: rgba(229, 229, 229, 0.46);
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  line-height: 1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

html:not(.dark) .refresh-pill {
  border-color: rgba(239, 68, 68, 0.16);
  background:
    linear-gradient(135deg, rgba(239, 68, 68, 0.12), rgba(234, 88, 12, 0.05)),
    rgba(255, 255, 255, 0.72);
  box-shadow: 0 10px 24px rgba(239, 68, 68, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

html:not(.dark) .refresh-pill.is-off {
  background: rgba(255, 255, 255, 0.62);
}

html:not(.dark) .refresh-meta {
  color: rgba(56, 65, 80, 0.46);
}

.search-button {
  display: flex;
  min-width: min(460px, 42vw);
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 14px;
  color: var(--muted);
  text-align: left;
}

kbd {
  border-radius: 6px;
  padding: 2px 7px;
  background: rgba(255, 255, 255, 0.10);
  color: var(--muted);
  font-size: 12px;
}

.tabs {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 8px 2px 22px;
}

.tab-button {
  flex: 0 0 auto;
  padding: 10px 14px;
  color: var(--muted);
}

.tab-button.active {
  background: rgba(248, 113, 113, 0.28);
  color: var(--text);
  box-shadow: 0 14px 30px rgba(248, 113, 113, 0.10);
}

.hero-strip {
  position: relative;
  z-index: 40;
  display: grid;
  grid-template-columns: minmax(360px, 1.35fr) minmax(220px, 0.8fr) minmax(220px, 0.78fr) minmax(150px, 0.45fr);
  gap: 14px;
  margin-bottom: 22px;
}

.top-insight-shell {
  position: relative;
  z-index: 40;
  margin-bottom: 22px;
  padding: 12px;
  border: 1px solid rgba(248, 113, 113, 0.16);
  border-radius: 12px;
  background:
    radial-gradient(circle at 12% 0%, rgba(248, 113, 113, 0.16), transparent 32%),
    linear-gradient(135deg, rgba(80, 42, 45, 0.52), rgba(34, 28, 31, 0.48));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 18px 44px rgba(0, 0, 0, 0.20);
}

.top-insight-shell .hero-strip {
  margin-bottom: 0;
}

.top-insight-shell.is-collapsed {
  padding: 10px 58px 10px 10px;
}

.top-insight-toggle {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 55;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(55, 37, 40, 0.72);
  color: rgba(255, 255, 255, 0.86);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.15),
    0 10px 22px rgba(0, 0, 0, 0.22);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.top-insight-shell.is-collapsed .top-insight-toggle {
  top: 50%;
  transform: translateY(-50%);
  min-width: 36px;
  min-height: 36px;
  justify-content: center;
  padding: 0;
}

.top-insight-shell.is-collapsed .top-insight-toggle span {
  display: none;
}

.top-insight-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.34);
  background:
    linear-gradient(145deg, rgba(248, 113, 113, 0.22), rgba(255, 255, 255, 0.05)),
    rgba(70, 42, 45, 0.82);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 28px rgba(248, 113, 113, 0.13);
}

.top-insight-shell.is-collapsed .top-insight-toggle:hover {
  transform: translateY(-50%) scale(1.04);
}

.top-insight-toggle i {
  width: 8px;
  height: 8px;
  border-right: 1.7px solid currentColor;
  border-bottom: 1.7px solid currentColor;
  transform: translateY(1px) rotate(-135deg);
  transition: transform 0.18s ease;
}

.top-insight-shell.is-collapsed .top-insight-toggle i {
  transform: translateY(-1px) rotate(45deg);
}

.top-insight-compact {
  display: grid;
  grid-template-columns: minmax(180px, 1.08fr) minmax(160px, 0.86fr) minmax(220px, 1.1fr) minmax(120px, 0.55fr);
  gap: 10px;
  align-items: stretch;
}

.top-insight-mini {
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.035)),
    rgba(163, 163, 163, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.top-insight-mini:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.22);
  background:
    radial-gradient(circle at 18% 0%, rgba(248, 113, 113, 0.16), transparent 58%),
    rgba(163, 163, 163, 0.11);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    0 10px 20px rgba(248, 113, 113, 0.08);
}

.top-insight-mini span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.top-insight-mini strong {
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  font-weight: 900;
  line-height: 1.1;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-insight-index-mini {
  display: grid;
  grid-template-columns: minmax(70px, 1fr) auto;
  grid-template-areas:
    "label price"
    "label change";
  align-content: center;
  column-gap: 12px;
  row-gap: 3px;
}

.top-insight-index-mini span {
  grid-area: label;
  align-self: center;
}

.top-insight-index-mini strong {
  grid-area: price;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.top-insight-index-mini em {
  grid-area: change;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.top-insight-index-mini.is-loading em {
  color: var(--muted);
}

.top-insight-mini .change {
  font-size: 17px;
}

.top-insight-mini .sentiment-temp-red {
  color: var(--red);
}

.top-insight-mini .sentiment-temp-green {
  color: var(--green);
}

.top-insight-mini .sentiment-temp-neutral {
  color: var(--orange);
}

.top-insight-mini-mainline strong {
  color: #fecaca;
  font-size: 15px;
}

.metric {
  position: relative;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 16px;
  background: rgba(163, 163, 163, 0.10);
  cursor: default;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.metric:first-child {
  background: rgba(248, 113, 113, 0.18);
}

.metric:hover,
.metric:focus-within {
  transform: translateY(-2px);
  border-color: rgba(248, 113, 113, 0.20);
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(248, 113, 113, 0.20), transparent 62%),
    rgba(163, 163, 163, 0.13);
  box-shadow: 0 14px 30px rgba(248, 113, 113, 0.10);
}

.metric:first-child:hover,
.metric:first-child:focus-within {
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(248, 113, 113, 0.24), transparent 62%),
    rgba(248, 113, 113, 0.20);
}

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

.metric-value {
  margin-top: 8px;
  font-size: 24px;
  font-weight: 800;
}

.metric-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.metric-subnote {
  flex: 0 1 auto;
  overflow: hidden;
  margin-top: 0;
  color: rgba(252, 165, 165, 0.88);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-read-card {
  overflow: visible;
  position: relative;
}

.market-read-card.is-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 0%, rgba(255, 255, 255, 0.10) 42%, transparent 72%);
  transform: translateX(-100%);
  animation: card-scan 1.2s ease-in-out infinite;
  pointer-events: none;
}

.market-read-compact {
  margin-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.market-read-theme {
  display: flex;
  align-items: center;
  min-width: 0;
  white-space: nowrap;
}

.market-read-subthemes {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
  white-space: nowrap;
}

.theme-primary {
  overflow: hidden;
  max-width: 100%;
  font-size: clamp(16px, 1.65vw, 22px);
  font-weight: 900;
  color: var(--red);
  letter-spacing: 0;
  line-height: 1.12;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-secondary {
  overflow: hidden;
  max-width: 46%;
  flex: 0 1 auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--orange);
  padding: 1px 7px;
  border-radius: 4px;
  background: rgba(251, 146, 60, 0.12);
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.theme-secondary.muted {
  color: var(--muted);
  background: rgba(163, 163, 163, 0.10);
}

.market-read-leader {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  min-width: 0;
  font-size: 13px;
  white-space: nowrap;
}

.leader-label {
  color: var(--muted);
  font-weight: 500;
}

.leader-name {
  overflow: hidden;
  color: var(--text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-badge {
  flex: 0 0 auto;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 700;
  background: rgba(74, 222, 128, 0.16);
  color: var(--green);
}

.leader-badge.hot {
  background: rgba(248, 113, 113, 0.18);
  color: var(--red);
}

.market-read-bottom {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-top: 6px;
  min-width: 0;
}

.market-read-actions {
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  gap: 8px;
  min-width: 0;
}

.market-read-more {
  padding: 3px 9px;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  line-height: 18px;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.market-read-more:hover {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.36);
  transform: translateY(-1px);
}

.market-read-more svg {
  transition: transform 0.2s ease;
}

.market-read-refresh {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(248, 113, 113, 0.24);
  border-radius: 6px;
  background: rgba(248, 113, 113, 0.08);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.market-read-refresh:hover:not(:disabled) {
  background: rgba(248, 113, 113, 0.14);
  border-color: rgba(248, 113, 113, 0.36);
  transform: translateY(-1px);
}

.market-read-refresh:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

html:not(.dark) .market-read-more,
html:not(.dark) .market-read-refresh {
  border-color: rgba(196, 97, 47, 0.28);
  background: rgba(196, 97, 47, 0.10);
}

html:not(.dark) .market-read-more:hover,
html:not(.dark) .market-read-refresh:hover:not(:disabled) {
  background: rgba(196, 97, 47, 0.18);
  border-color: rgba(196, 97, 47, 0.42);
}

.market-read-popover {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 8px;
  z-index: 100;
  border-radius: 10px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  padding: 0;
  background: rgba(26, 26, 26, 0.88);
  backdrop-filter: blur(24px);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.35),
    0 0 0 1px rgba(248, 113, 113, 0.12) inset;
  animation: popover-fadein 0.2s ease;
}

html:not(.dark) .market-read-popover {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px);
  border-color: rgba(163, 163, 163, 0.20);
  box-shadow:
    0 20px 50px rgba(0, 0, 0, 0.12),
    0 0 0 1px rgba(163, 163, 163, 0.08) inset;
}

@keyframes popover-fadein {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.market-read-popover-content {
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.market-read-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.market-read-section-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.market-read-phase {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  opacity: 0.88;
  line-height: 1.5;
}

.market-read-watch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.watch-item {
  padding: 3px 8px;
  border-radius: 4px;
  background: rgba(96, 165, 250, 0.12);
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.market-read-risk {
  padding: 8px 10px;
  border-radius: 6px;
  background: rgba(251, 146, 60, 0.12);
  border-left: 3px solid var(--orange);
  color: var(--text);
  font-size: 12px;
  line-height: 1.5;
}

.market-read-risk strong {
  color: var(--orange);
  margin-right: 4px;
}


.inline-loader {
  display: inline-block;
  width: 9px;
  height: 9px;
  margin-left: 6px;
  border: 1.5px solid rgba(255, 255, 255, 0.25);
  border-top-color: var(--red);
  border-radius: 999px;
  vertical-align: -1px;
  animation: badge-spin 0.72s linear infinite;
}

@keyframes card-scan {
  to {
    transform: translateX(100%);
  }
}

@keyframes refresh-pulse {
  0% {
    opacity: 0.72;
    transform: scale(0.7);
  }

  100% {
    opacity: 0;
    transform: scale(1.55);
  }
}

.market-stage-card {
  padding: 12px 14px 10px;
  background:
    radial-gradient(ellipse 80% 80% at 20% 0%, rgba(255, 255, 255, 0.10), transparent 60%),
    rgba(255, 255, 255, 0.06);
}

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

.index-name {
  margin-right: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.index-value {
  margin-right: 6px;
  font-size: 14px;
  font-weight: 800;
}

.index-chart {
  display: block;
  width: 100%;
  height: 132px;
  border-radius: 8px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    rgba(255, 255, 255, 0.04);
  background-size: 25% 34px, 25% 100%;
}

.index-line {
  fill: none;
  stroke: #3b82f6;
  stroke-width: 1.8;
  vector-effect: non-scaling-stroke;
}

.index-grid {
  stroke: rgba(255, 255, 255, 0.10);
  vector-effect: non-scaling-stroke;
}

.index-zero {
  stroke: rgba(255, 255, 255, 0.34);
  stroke-dasharray: 4 4;
  vector-effect: non-scaling-stroke;
}

.index-axis {
  font-size: 9px;
  font-weight: 800;
  text-anchor: end;
}

.index-axis.red {
  fill: var(--red);
}

.index-axis.green {
  fill: var(--green);
}

.index-axis.zero {
  fill: var(--muted);
}

.index-tag-line {
  fill: none;
  stroke-width: 1;
  stroke-dasharray: 2 2;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.index-tag-dot {
  stroke: rgba(255, 255, 255, 0.80);
  stroke-width: 0.7;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.index-label-box {
  fill: rgba(255, 255, 255, 0.18);
  stroke-width: 0.85;
  vector-effect: non-scaling-stroke;
  pointer-events: none;
}

.index-label-text {
  font-size: 7px;
  line-height: 10px;
  font-weight: 800;
  text-anchor: middle;
  pointer-events: none;
}

.index-label-hit {
  cursor: help;
  fill: transparent;
  stroke: transparent;
  pointer-events: all;
}

.index-tag.red .index-tag-line,
.index-tag.red .index-label-box {
  stroke: var(--red);
}

.index-tag.red .index-label-box {
  fill: rgba(248, 113, 113, 0.10);
}

.index-tag.red .index-tag-dot,
.index-tag.red .index-label-text {
  fill: var(--red);
}

.index-tag.green .index-tag-line,
.index-tag.green .index-label-box {
  stroke: var(--green);
}

.index-tag.green .index-label-box {
  fill: rgba(34, 197, 94, 0.10);
}

.index-tag.green .index-tag-dot,
.index-tag.green .index-label-text {
  fill: var(--green);
}

.index-tag.orange .index-tag-line,
.index-tag.orange .index-label-box {
  stroke: var(--orange);
}

.index-tag.orange .index-label-box {
  fill: rgba(251, 146, 60, 0.10);
}

.index-tag.orange .index-tag-dot,
.index-tag.orange .index-label-text {
  fill: var(--orange);
}

.index-tag.neutral .index-tag-line,
.index-tag.neutral .index-label-box {
  stroke: rgba(212, 212, 216, 0.72);
}

.index-tag.neutral .index-label-box {
  fill: rgba(212, 212, 216, 0.08);
}

.index-tag.neutral .index-tag-dot,
.index-tag.neutral .index-label-text {
  fill: rgba(228, 228, 231, 0.86);
}

.index-time {
  fill: var(--muted);
  font-size: 10px;
}

.index-time.end {
  text-anchor: end;
}

html:not(.dark) .top-insight-shell {
  border-color: rgba(239, 68, 68, 0.14);
  background:
    radial-gradient(circle at 12% 0%, rgba(248, 113, 113, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.76), rgba(255, 241, 242, 0.66));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 16px 36px rgba(127, 29, 29, 0.08);
}

html:not(.dark) .top-insight-toggle {
  border-color: rgba(239, 68, 68, 0.16);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 241, 242, 0.70)),
    rgba(255, 255, 255, 0.72);
  color: #7f1d1d;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.86),
    0 10px 22px rgba(127, 29, 29, 0.08);
}

html:not(.dark) .top-insight-mini {
  border-color: rgba(15, 23, 42, 0.07);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.45)),
    rgba(255, 255, 255, 0.54);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

html:not(.dark) .top-insight-mini:hover {
  border-color: rgba(239, 68, 68, 0.20);
  background:
    radial-gradient(circle at 18% 0%, rgba(248, 113, 113, 0.13), transparent 58%),
    rgba(255, 255, 255, 0.68);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.84),
    0 10px 20px rgba(127, 29, 29, 0.07);
}

html:not(.dark) .top-insight-mini-mainline strong {
  color: var(--red);
}

.sentiment-metric {
  overflow: visible;
  z-index: 2;
  background:
    radial-gradient(ellipse 90% 90% at 80% 0%, rgba(248, 113, 113, 0.22), transparent),
    rgba(163, 163, 163, 0.10);
  backdrop-filter: blur(10px);
}

.sentiment-metric:hover,
.sentiment-metric:focus,
.sentiment-metric:focus-within {
  z-index: 2000;
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(248, 113, 113, 0.24), transparent 62%),
    radial-gradient(ellipse 90% 90% at 80% 0%, rgba(248, 113, 113, 0.22), transparent),
    rgba(163, 163, 163, 0.13);
}

.sentiment-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 12px;
}

.sentiment-gauge-wrap {
  flex: 1;
  min-width: 0;
}

.thermometer {
  position: relative;
  display: flex;
  align-items: center;
  width: min(210px, 100%);
  height: 34px;
  padding: 5px 7px 5px 31px;
  border-radius: 999px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.34), rgba(255, 255, 255, 0.08)),
    rgba(255, 255, 255, 0.08);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.18),
    0 8px 18px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(10px);
}

.thermometer-track {
  position: relative;
  flex: 1;
  height: 18px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.24);
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.20),
    inset 0 3px 8px rgba(0, 0, 0, 0.20);
}

.thermometer-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #b6f51f 0%, #f5d329 48%, #fb923c 78%, #ef4444 100%);
  box-shadow: 0 0 18px rgba(245, 158, 11, 0.42);
}

.thermometer-bulb {
  position: absolute;
  top: 50%;
  left: 0;
  z-index: 2;
  width: 42px;
  height: 42px;
  transform: translateY(-50%);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(255, 255, 255, 0.85), #c7f72c 36%, #a3e635 78%);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.46),
    0 0 0 2px rgba(148, 163, 184, 0.40),
    0 8px 18px rgba(0, 0, 0, 0.22);
}

.thermometer-scale {
  display: grid;
  grid-template-columns: repeat(11, 1fr);
  width: min(210px, 100%);
  margin-top: 7px;
  padding-left: 34px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1;
  opacity: 0.86;
}

.thermometer-scale span {
  text-align: center;
}

.sentiment-score {
  min-width: 58px;
  padding-left: 8px;
  text-align: right;
}

.sentiment-score .metric-value {
  margin-top: 0;
  color: var(--orange);
  font-size: 28px;
}

.sentiment-score .metric-value.sentiment-temp-red {
  color: var(--red);
}

.sentiment-score .metric-value.sentiment-temp-green {
  color: var(--green);
}

.sentiment-score .metric-value.sentiment-temp-neutral {
  color: var(--orange);
}

.sentiment-score-loading {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.sentiment-score-loading .inline-loader {
  margin-left: 0;
}

.sentiment-phase {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.sentiment-popover {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 9999;
  width: min(330px, 82vw);
  padding: 14px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 8px;
  background:
    radial-gradient(ellipse 90% 80% at 18% 0%, rgba(248, 113, 113, 0.28), transparent 62%),
    radial-gradient(ellipse 75% 70% at 100% 18%, rgba(249, 115, 22, 0.18), transparent 58%),
    rgba(45, 31, 34, 0.82);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.32), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 0.16s ease, transform 0.16s ease;
  backdrop-filter: blur(16px);
}

.sentiment-metric:hover .sentiment-popover,
.sentiment-metric:focus .sentiment-popover,
.sentiment-metric:focus-within .sentiment-popover {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.sentiment-popover-title {
  margin-bottom: 10px;
  font-weight: 800;
}

.sentiment-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.sentiment-stat-row strong {
  color: var(--text);
}

.sentiment-stat-row strong.stat-red,
.stat-red {
  color: var(--red);
}

.sentiment-stat-row strong.stat-green,
.stat-green {
  color: var(--green);
}

.sentiment-stat-row strong.stat-flat,
.stat-flat {
  color: var(--text);
}

.sentiment-model,
.sentiment-source {
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 22px;
}

.source-grid.is-reordering {
  user-select: none;
}

.source-card,
.panel {
  min-height: 520px;
  border-radius: 16px;
  padding: 16px;
  background: rgba(239, 68, 68, 0.22);
  backdrop-filter: blur(6px);
  transition: transform 0.16s ease, opacity 0.16s ease, outline-color 0.16s ease, background 0.16s ease;
}

.source-card[data-color="#22c55e"],
.source-card[data-color="#06b6d4"] {
  background: rgba(74, 222, 128, 0.16);
}

.source-card[data-color="#3b82f6"] {
  background: rgba(96, 165, 250, 0.18);
}

.source-card[data-color="#8b5cf6"] {
  background: rgba(167, 139, 250, 0.18);
}

html:not(.dark) .icon-button,
html:not(.dark) .search-button,
html:not(.dark) .tab-button,
html:not(.dark) .source-action,
html:not(.dark) .theme-button,
html:not(.dark) .ladder-view-button {
  background: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .icon-button:hover,
html:not(.dark) .search-button:hover,
html:not(.dark) .tab-button:hover,
html:not(.dark) .source-action:hover,
html:not(.dark) .theme-button:hover,
html:not(.dark) .ladder-view-button:hover {
  background: rgba(239, 68, 68, 0.12);
}

html:not(.dark) .tab-button.active,
html:not(.dark) .theme-button.active,
html:not(.dark) .ladder-view-button.active {
  background: rgba(239, 68, 68, 0.14);
  box-shadow: 0 14px 30px rgba(239, 68, 68, 0.10);
}

html:not(.dark) .metric,
html:not(.dark) .panel,
html:not(.dark) .source-card,
html:not(.dark) .theme-stat-grid,
html:not(.dark) .sky-tabs,
html:not(.dark) .board-breakdown {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 38, 38, 0.08);
  box-shadow: 0 16px 36px rgba(31, 41, 55, 0.06);
}

html:not(.dark) .metric:first-child,
html:not(.dark) .sentiment-metric,
html:not(.dark) .source-card[data-color="#ef4444"],
html:not(.dark) .source-card[data-color="#f97316"],
html:not(.dark) .source-card[data-color="#dc2626"],
html:not(.dark) .motion-header,
html:not(.dark) .dragon-panel {
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(239, 68, 68, 0.16), transparent),
    rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(220, 38, 38, 0.10);
  box-shadow: 0 16px 36px rgba(31, 41, 55, 0.06);
}

html:not(.dark) .sentiment-popover {
  border: 1px solid rgba(220, 38, 38, 0.12);
  background:
    radial-gradient(ellipse 90% 80% at 18% 0%, rgba(239, 68, 68, 0.16), transparent 62%),
    radial-gradient(ellipse 75% 70% at 100% 18%, rgba(249, 115, 22, 0.12), transparent 58%),
    rgba(255, 255, 255, 0.86);
  box-shadow: 0 18px 46px rgba(31, 41, 55, 0.16);
}

html:not(.dark) .sentiment-stat-row {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .metric:hover,
html:not(.dark) .metric:focus-within {
  transform: translateY(-2px);
  border-color: rgba(220, 38, 38, 0.14);
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(239, 68, 68, 0.14), transparent 62%),
    rgba(255, 255, 255, 0.84);
  box-shadow: 0 16px 36px rgba(220, 38, 38, 0.10);
}

html:not(.dark) .metric:first-child:hover,
html:not(.dark) .metric:first-child:focus-within,
html:not(.dark) .sentiment-metric:hover,
html:not(.dark) .sentiment-metric:focus,
html:not(.dark) .sentiment-metric:focus-within {
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(239, 68, 68, 0.18), transparent 62%),
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(239, 68, 68, 0.16), transparent),
    rgba(255, 255, 255, 0.86);
}

html:not(.dark) .market-stage-card {
  background: rgba(255, 255, 255, 0.90);
}

html:not(.dark) .index-chart {
  background:
    linear-gradient(rgba(15, 23, 42, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.04) 1px, transparent 1px),
    rgba(255, 255, 255, 0.72);
  background-size: 25% 34px, 25% 100%;
}

html:not(.dark) .index-zero {
  stroke: rgba(15, 23, 42, 0.28);
}

html:not(.dark) .index-grid {
  stroke: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .index-label-box {
  fill: rgba(255, 255, 255, 0.68);
}

html:not(.dark) .index-tag.red .index-label-box {
  fill: rgba(254, 226, 226, 0.72);
}

html:not(.dark) .index-tag.green .index-label-box {
  fill: rgba(220, 252, 231, 0.72);
}

html:not(.dark) .index-tag.orange .index-label-box {
  fill: rgba(255, 237, 213, 0.72);
}

html:not(.dark) .index-tag.neutral .index-tag-line,
html:not(.dark) .index-tag.neutral .index-label-box {
  stroke: rgba(100, 116, 139, 0.66);
}

html:not(.dark) .index-tag.neutral .index-tag-dot,
html:not(.dark) .index-tag.neutral .index-label-text {
  fill: rgba(71, 85, 105, 0.88);
}

html:not(.dark) .source-card[data-color="#22c55e"],
html:not(.dark) .source-card[data-color="#06b6d4"],
html:not(.dark) .source-card[data-color="#3b82f6"],
html:not(.dark) .source-card[data-color="#8b5cf6"] {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(37, 99, 235, 0.08);
}

.source-head,
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.source-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.source-logo {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.20);
  font-weight: 800;
}

html:not(.dark) .source-logo {
  background: rgba(220, 38, 38, 0.10);
}

.source-title strong,
.panel-title {
  font-size: 20px;
}

.badge {
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(28, 28, 30, 0.55);
  color: var(--muted);
  font-size: 12px;
}

.live-badge {
  background: rgba(74, 222, 128, 0.16);
  color: var(--green);
}

.fallback-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(251, 146, 60, 0.14);
  color: var(--orange);
}

.badge-spinner {
  width: 10px;
  height: 10px;
  border: 2px solid rgba(251, 146, 60, 0.26);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: badge-spin 0.8s linear infinite;
}

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

html:not(.dark) .badge {
  background: rgba(15, 23, 42, 0.06);
}

.source-meta,
.tiny {
  color: var(--muted);
  font-size: 12px;
}

.source-action {
  width: 32px;
  height: 32px;
}

.source-tools {
  display: flex;
  gap: 6px;
  align-items: center;
}

.source-drag-handle {
  cursor: grab;
  color: var(--muted);
}

.source-drag-handle:hover {
  color: var(--text);
  transform: translateY(-1px);
}

.source-drag-handle:active {
  cursor: grabbing;
}

.source-card.is-dragging {
  opacity: 0.48;
  transform: scale(0.965) rotate(0.4deg);
  box-shadow: 0 22px 52px rgba(0, 0, 0, 0.35);
}

.source-card.is-drop-target {
  outline: 1px dashed rgba(248, 113, 113, 0.76);
  outline-offset: 4px;
  background: rgba(248, 113, 113, 0.30);
  transform: translateY(-2px);
}

.list {
  max-height: 430px;
  overflow: auto;
  border-radius: 16px;
  padding: 8px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.24), transparent),
    rgba(28, 28, 30, 0.72);
}

html:not(.dark) .list,
html:not(.dark) .sky-table {
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(239, 68, 68, 0.12), transparent),
    rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 38, 38, 0.08);
}

.stock-row {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 8px 6px;
  cursor: pointer;
}

.stock-row:hover {
  background: rgba(163, 163, 163, 0.10);
}

html:not(.dark) .stock-row:hover,
html:not(.dark) .sky-cell:hover,
html:not(.dark) .board-card:hover,
html:not(.dark) .dragon-seat:hover,
html:not(.dark) .dragon-stock-row:hover,
html:not(.dark) .dragon-theme:hover,
html:not(.dark) .dragon-seat-rank:hover,
html:not(.dark) .dragon-institution-row:hover,
html:not(.dark) .dragon-market-row:hover {
  background: rgba(239, 68, 68, 0.10);
}

.rank {
  display: grid;
  height: 28px;
  place-items: center;
  border-radius: 6px;
  background: rgba(163, 163, 163, 0.12);
  color: var(--muted);
  font-size: 13px;
}

.stock-name {
  font-weight: 700;
}

.stock-code,
.stock-reason {
  color: var(--muted);
  font-size: 12px;
}

.stock-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.tag {
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

html:not(.dark) .tag {
  background: rgba(15, 23, 42, 0.06);
}

.tag.hot {
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
}

html:not(.dark) .tag.hot {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.change {
  color: var(--red);
  font-weight: 800;
  text-align: right;
}

.change.negative {
  color: var(--green);
}

.diff {
  margin-left: 6px;
  color: var(--red);
  font-size: 12px;
}

.diff.negative {
  color: var(--green);
}

.theme-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

.theme-menu {
  display: grid;
  gap: 10px;
  align-self: start;
}

.theme-button {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: rgba(163, 163, 163, 0.10);
  color: var(--text);
  text-align: left;
}

.theme-button.active {
  background: rgba(248, 113, 113, 0.22);
}

.theme-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.theme-summary {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

/* ---------- 题材库（本地事实库 Tab） ---------- */

.theme-lib {
  display: grid;
  gap: 16px;
}

.theme-lib-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border-radius: 12px;
  padding: 12px 14px;
  background: rgba(163, 163, 163, 0.10);
  backdrop-filter: blur(14px);
}

.theme-lib-search {
  min-width: 220px;
  flex: 0 1 300px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 8px;
  padding: 7px 10px;
  background: rgba(0, 0, 0, 0.20);
  color: var(--text);
}

html:not(.dark) .theme-lib-search {
  border-color: rgba(15, 23, 42, 0.12);
  background: rgba(255, 255, 255, 0.85);
}

.theme-lib-sorts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.theme-lib-sort-btn,
.theme-lib-view-btn {
  cursor: pointer;
  border-radius: 7px;
  padding: 5px 12px;
  background: rgba(163, 163, 163, 0.12);
  color: var(--muted);
  font-size: 13px;
}

.theme-lib-sort-btn.active,
.theme-lib-view-btn.active {
  background: rgba(248, 113, 113, 0.22);
  color: var(--text);
}

.theme-lib-source-badge {
  background: rgba(96, 165, 250, 0.16);
  color: var(--blue);
}

.theme-lib-metrics-grid {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(118px, 1fr);
  gap: 10px;
  margin: 14px 0;
  overflow-x: auto;
  padding-bottom: 2px;
}

.theme-lib-metric {
  border-radius: 10px;
  padding: 10px 11px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.theme-lib-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.theme-lib-metric strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 16px;
}

.theme-lib-metric.hot strong,
.theme-lib-metric.red strong {
  color: var(--red);
}

.theme-lib-metric.green strong {
  color: var(--green);
}

.theme-lib-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 7px;
}

.theme-lib-action-btn {
  cursor: pointer;
  border-radius: 7px;
  padding: 5px 9px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  font-size: 12px;
  line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-lib-action-btn:hover {
  border-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.16);
  transform: translateY(-1px);
}

.theme-lib-notice {
  background: rgba(52, 211, 153, 0.14);
  color: var(--green);
}

.theme-lib-layout {
  display: grid;
  grid-template-columns: minmax(360px, 430px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
  min-height: min(760px, calc(100vh - 148px));
}

.theme-lib-menu {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 0;
  align-self: start;
  overflow: hidden;
  min-height: min(760px, calc(100vh - 148px));
  max-height: calc(100vh - 118px);
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 12px;
  background: rgba(163, 163, 163, 0.10);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(18px);
}

.theme-lib-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: linear-gradient(135deg, rgba(248, 69, 65, 0.92), rgba(248, 83, 88, 0.76));
}

.theme-lib-side-head strong {
  color: #fff;
  font-size: 16px;
}

.theme-lib-refresh {
  cursor: pointer;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(248, 113, 113, 0.12);
  color: var(--text);
  font-size: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.theme-lib-side-search {
  padding: 12px 12px 10px;
  background: rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.theme-lib-side-search-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.theme-lib-side-search .theme-lib-search {
  width: 100%;
  min-width: 0;
  flex: none;
  border-radius: 999px;
  border-color: rgba(248, 113, 113, 0.52);
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.08);
}

.theme-lib-side-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.theme-lib-list-scroll {
  overflow: auto;
  min-height: 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.22) transparent;
}

.theme-lib-list-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.theme-lib-list-table thead {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(36, 28, 29, 0.96);
  backdrop-filter: blur(12px);
}

.theme-lib-list-table th,
.theme-lib-list-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  white-space: nowrap;
  text-align: right;
}

.theme-lib-list-table th {
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.theme-lib-list-table th.name,
.theme-lib-list-table td.name {
  position: sticky;
  left: 0;
  z-index: 1;
  width: 168px;
  max-width: 168px;
  text-align: left;
  background: rgba(45, 32, 33, 0.98);
}

.theme-lib-list-table thead th.name {
  z-index: 3;
}

.theme-lib-row {
  cursor: pointer;
}

.theme-lib-row:hover td,
.theme-lib-row.active td {
  background: rgba(248, 113, 113, 0.14);
}

.theme-lib-list-table td.name strong,
.theme-lib-list-table td.name span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.theme-lib-list-table td.name strong {
  color: var(--text);
  font-size: 13px;
}

.theme-lib-list-table td.name span {
  margin-top: 2px;
  color: var(--subtle);
  font-size: 10px;
}

.theme-lib-list-table .score,
.theme-lib-list-table .heat-delta,
.theme-lib-heat-value {
  color: #ff9f43;
  font-weight: 800;
}

.theme-lib-list-table .zt {
  color: var(--red);
  font-weight: 800;
}

.theme-lib-side-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.16);
}

.theme-lib-side-footer span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.theme-lib-side-footer > div:last-child {
  display: flex;
  gap: 8px;
}

.theme-lib-link-btn {
  cursor: pointer;
  border: 0;
  background: transparent;
  color: var(--blue);
  font-size: 12px;
  padding: 3px 0;
}

.theme-lib-item {
  cursor: pointer;
  border: 0;
  border-radius: 8px;
  padding: 12px;
  background: rgba(163, 163, 163, 0.10);
  color: var(--text);
  text-align: left;
}

.theme-lib-item:hover {
  background: rgba(248, 113, 113, 0.14);
}

.theme-lib-item.active {
  background: rgba(248, 113, 113, 0.22);
}

.theme-lib-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.theme-lib-item-metrics {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}

.theme-lib-item-metrics .change {
  font-size: 13px;
}

.theme-lib-hot {
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(248, 113, 113, 0.24);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.theme-lib-limit {
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(248, 113, 113, 0.20);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.theme-lib-detail {
  border-radius: 12px;
  padding: 16px;
  min-width: 0;
  max-height: calc(100vh - 118px);
  overflow: auto;
}

.theme-lib-views {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.theme-lib-detail-body {
  display: grid;
  gap: 10px;
}

.theme-lib-table-wrap {
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.12);
}

.theme-lib-data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.theme-lib-data-table th,
.theme-lib-data-table td {
  padding: 8px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  vertical-align: top;
  white-space: nowrap;
}

.theme-lib-data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: rgba(33, 29, 30, 0.96);
  color: var(--muted);
  text-align: left;
}

.theme-lib-data-table .reason-col,
.theme-lib-reason-cell {
  min-width: 260px;
  max-width: 420px;
  white-space: normal;
  line-height: 1.55;
}

.theme-lib-data-row {
  cursor: pointer;
}

.theme-lib-data-row:hover td {
  background: rgba(248, 113, 113, 0.10);
}

.theme-lib-branch-row td {
  background: rgba(248, 113, 113, 0.10);
  color: var(--text);
}

.theme-lib-branch-indent {
  display: inline-block;
  width: calc(var(--depth) * 16px);
}

.theme-lib-node {
  border-radius: 8px;
  background: rgba(163, 163, 163, 0.08);
}

.theme-lib-node .theme-lib-node {
  background: rgba(163, 163, 163, 0.06);
}

.theme-lib-node-head {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 12px;
  list-style: none;
}

.theme-lib-node-head::before {
  content: "▸";
  color: var(--muted);
  font-size: 12px;
  transition: transform 0.15s ease;
}

.theme-lib-node[open] > .theme-lib-node-head::before {
  transform: rotate(90deg);
}

.theme-lib-node-body {
  display: grid;
  gap: 6px;
  padding: 0 12px 10px 22px;
}

.theme-lib-stock {
  cursor: pointer;
  border-radius: 7px;
  padding: 8px 10px;
  background: rgba(163, 163, 163, 0.08);
}

.theme-lib-stock:hover {
  background: rgba(248, 113, 113, 0.14);
}

.theme-lib-stock-main {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.theme-lib-leader {
  border-radius: 5px;
  padding: 1px 6px;
  background: rgba(248, 113, 113, 0.24);
  color: var(--red);
  font-size: 12px;
  font-weight: 700;
}

.theme-lib-stock-reason {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.theme-lib-flat {
  display: grid;
  gap: 6px;
}

.theme-lib-panel {
  margin-top: 12px;
  border-radius: 8px;
  background: rgba(163, 163, 163, 0.08);
}

.theme-lib-panel > summary {
  cursor: pointer;
  padding: 10px 12px;
  font-weight: 700;
}

.theme-lib-panel-body {
  padding: 0 12px 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

.theme-lib-news-item {
  padding: 6px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.theme-lib-snapshot-list {
  display: grid;
  gap: 7px;
}

.theme-lib-snapshot-item {
  display: grid;
  grid-template-columns: 1.1fr repeat(4, auto);
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
}

.theme-lib-snapshot-item strong {
  color: var(--text);
}

.theme-lib-news-item a {
  color: var(--blue);
  text-decoration: none;
}

.theme-lib-news-item a:hover {
  text-decoration: underline;
}

html:not(.dark) .theme-lib-toolbar,
html:not(.dark) .theme-lib-item,
html:not(.dark) .theme-lib-node,
html:not(.dark) .theme-lib-stock,
html:not(.dark) .theme-lib-metric,
html:not(.dark) .theme-lib-panel {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 38, 38, 0.08);
}

html:not(.dark) .theme-lib-menu {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(220, 38, 38, 0.16);
}

html:not(.dark) .theme-lib-list-table thead,
html:not(.dark) .theme-lib-list-table th.name,
html:not(.dark) .theme-lib-list-table td.name,
html:not(.dark) .theme-lib-data-table th {
  background: rgba(255, 250, 250, 0.96);
}

html:not(.dark) .theme-lib-table-wrap {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(220, 38, 38, 0.08);
}

html:not(.dark) .theme-lib-branch-row td {
  background: rgba(239, 68, 68, 0.08);
}

html:not(.dark) .theme-lib-snapshot-item {
  background: rgba(15, 23, 42, 0.045);
}

html:not(.dark) .theme-lib-action-btn {
  border-color: rgba(15, 23, 42, 0.10);
  background: rgba(255, 255, 255, 0.72);
}

html:not(.dark) .theme-lib-item:hover,
html:not(.dark) .theme-lib-stock:hover {
  background: rgba(239, 68, 68, 0.10);
}

html:not(.dark) .theme-lib-item.active {
  background: rgba(239, 68, 68, 0.16);
}

html:not(.dark) .theme-lib-news-item {
  border-top-color: rgba(15, 23, 42, 0.08);
}

/* 题材库视觉增强：只调整玻璃质感、悬浮态和重点高亮，不改变布局与交互。 */
.theme-lib-menu,
.theme-lib-detail {
  position: relative;
  border-color: rgba(255, 198, 194, 0.14);
  background:
    radial-gradient(circle at 18% 0%, rgba(255, 112, 112, 0.16), transparent 34%),
    linear-gradient(145deg, rgba(94, 56, 58, 0.32), rgba(34, 27, 28, 0.68));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.09),
    inset 0 -1px 0 rgba(255, 255, 255, 0.035),
    0 18px 54px rgba(0, 0, 0, 0.24);
  backdrop-filter: blur(22px) saturate(132%);
}

.theme-lib-menu::before,
.theme-lib-detail::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.10), transparent 34%);
  opacity: 0.72;
}

.theme-lib-side-search {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.025));
}

.theme-lib-side-search .theme-lib-search {
  border-color: rgba(255, 198, 194, 0.20);
  background: rgba(8, 6, 7, 0.18);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    0 0 0 1px rgba(248, 113, 113, 0.05);
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.theme-lib-side-search .theme-lib-search:focus {
  outline: none;
  border-color: rgba(248, 113, 113, 0.48);
  background: rgba(15, 10, 11, 0.26);
  box-shadow:
    0 0 0 3px rgba(248, 113, 113, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.theme-lib-refresh,
.theme-lib-action-btn,
.theme-lib-view-btn {
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.theme-lib-refresh:hover,
.theme-lib-action-btn:hover,
.theme-lib-view-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.38);
  background: rgba(248, 113, 113, 0.16);
  box-shadow: 0 10px 24px rgba(248, 113, 113, 0.10), inset 0 1px 0 rgba(255, 255, 255, 0.10);
}

.theme-lib-view-btn.active {
  border-color: rgba(248, 113, 113, 0.28);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.28), rgba(248, 113, 113, 0.15));
  box-shadow: 0 8px 22px rgba(248, 113, 113, 0.10);
}

.theme-lib-list-table thead {
  background: rgba(42, 31, 32, 0.84);
  backdrop-filter: blur(16px) saturate(130%);
}

.theme-lib-list-table th {
  color: rgba(244, 230, 230, 0.68);
}

.theme-lib-list-table th:hover {
  color: var(--text);
}

.theme-lib-list-table th.name,
.theme-lib-list-table td.name {
  background: rgba(43, 31, 32, 0.88);
  box-shadow: 10px 0 18px rgba(13, 9, 10, 0.14);
}

.theme-lib-row td {
  transition: background 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.theme-lib-row:hover td {
  background: rgba(248, 113, 113, 0.09);
}

.theme-lib-row:hover td.name {
  background:
    linear-gradient(90deg, rgba(248, 113, 113, 0.20), rgba(50, 34, 35, 0.90));
}

.theme-lib-row.active td {
  background: rgba(248, 113, 113, 0.12);
  color: var(--text);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.055), inset 0 -1px 0 rgba(255, 255, 255, 0.035);
}

.theme-lib-row.active td.name {
  background:
    linear-gradient(90deg, rgba(248, 113, 113, 0.28), rgba(67, 39, 41, 0.90));
  border-left: 2px solid rgba(255, 116, 120, 0.90);
}

.theme-lib-list-table td.name strong {
  letter-spacing: 0.1px;
}

.theme-lib-list-table .score,
.theme-lib-list-table .heat-delta,
.theme-lib-heat-value {
  color: #ffad4d;
  text-shadow: 0 0 14px rgba(255, 173, 77, 0.18);
}

.theme-lib-list-table .zt,
.theme-lib-hot,
.theme-lib-limit {
  text-shadow: 0 0 12px rgba(248, 113, 113, 0.18);
}

.theme-lib-metric {
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.035));
  border-color: rgba(255, 255, 255, 0.075);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.theme-lib-metric:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.20);
  background:
    linear-gradient(145deg, rgba(248, 113, 113, 0.13), rgba(255, 255, 255, 0.045));
}

.theme-lib-node,
.theme-lib-panel,
.theme-lib-stock {
  border: 1px solid rgba(255, 255, 255, 0.065);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.theme-lib-node:hover,
.theme-lib-panel:hover,
.theme-lib-stock:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.20);
  background: rgba(248, 113, 113, 0.105);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.theme-lib-node[open] {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(248, 113, 113, 0.14);
}

.theme-lib-node-head strong,
.theme-lib-panel > summary {
  color: rgba(255, 244, 244, 0.94);
}

.theme-lib-node-head::before {
  color: rgba(255, 173, 77, 0.86);
}

.theme-lib-stock .stock-name,
.theme-lib-stock-main .stock-name {
  color: rgba(255, 244, 244, 0.94);
  font-weight: 800;
}

.theme-lib-stock .stock-code,
.theme-lib-stock-main .stock-code {
  color: rgba(255, 198, 194, 0.68);
}

.theme-lib-side-footer {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(0, 0, 0, 0.16));
}

html:not(.dark) .theme-lib-menu,
html:not(.dark) .theme-lib-detail {
  background:
    radial-gradient(circle at 18% 0%, rgba(239, 68, 68, 0.10), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(255, 246, 246, 0.76));
  border-color: rgba(220, 38, 38, 0.12);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.92),
    0 18px 44px rgba(113, 43, 43, 0.10);
}

html:not(.dark) .theme-lib-list-table thead,
html:not(.dark) .theme-lib-list-table th.name,
html:not(.dark) .theme-lib-list-table td.name {
  background: rgba(255, 250, 250, 0.92);
}

html:not(.dark) .theme-lib-row:hover td.name,
html:not(.dark) .theme-lib-row.active td.name {
  background: linear-gradient(90deg, rgba(254, 226, 226, 0.96), rgba(255, 250, 250, 0.94));
}

html:not(.dark) .theme-lib-node-head strong,
html:not(.dark) .theme-lib-panel > summary,
html:not(.dark) .theme-lib-stock .stock-name,
html:not(.dark) .theme-lib-stock-main .stock-name {
  color: #3f2b2d;
}

/* 题材库右侧详情强化：提升股票卡、概念介绍和指标之间的玻璃层级。 */
.theme-lib-detail {
  background:
    radial-gradient(circle at 92% 0%, rgba(255, 115, 117, 0.20), transparent 28%),
    radial-gradient(circle at 6% 36%, rgba(255, 173, 77, 0.08), transparent 30%),
    linear-gradient(145deg, rgba(83, 46, 49, 0.46), rgba(28, 24, 25, 0.80));
}

.theme-lib-detail .panel-head {
  position: relative;
  z-index: 1;
  border-radius: 10px;
  padding: 12px 12px;
  border: 1px solid rgba(255, 198, 194, 0.10);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.025));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.theme-lib-detail .panel-title {
  color: rgba(255, 244, 244, 0.98);
  text-shadow: 0 0 18px rgba(248, 113, 113, 0.14);
}

.theme-lib-detail .tiny {
  color: rgba(230, 205, 204, 0.70);
}

.theme-lib-metrics-grid {
  position: relative;
  z-index: 1;
  padding: 2px 2px 6px;
}

.theme-lib-metric {
  min-height: 62px;
  background:
    radial-gradient(circle at 85% 0%, rgba(248, 113, 113, 0.16), transparent 40%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.038));
  border-color: rgba(255, 198, 194, 0.11);
}

.theme-lib-metric strong {
  font-size: 17px;
  letter-spacing: 0.1px;
}

.theme-lib-metric.hot,
.theme-lib-metric.red {
  background:
    radial-gradient(circle at 78% 0%, rgba(248, 113, 113, 0.25), transparent 44%),
    linear-gradient(145deg, rgba(248, 113, 113, 0.11), rgba(255, 255, 255, 0.04));
}

.theme-lib-metric.green {
  background:
    radial-gradient(circle at 78% 0%, rgba(52, 211, 153, 0.18), transparent 44%),
    linear-gradient(145deg, rgba(52, 211, 153, 0.075), rgba(255, 255, 255, 0.035));
}

.theme-lib-detail-body {
  position: relative;
  z-index: 1;
  gap: 9px;
  padding: 2px;
}

.theme-lib-node {
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.085), rgba(255, 255, 255, 0.028));
  border-color: rgba(255, 198, 194, 0.09);
}

.theme-lib-node[open] {
  background:
    radial-gradient(circle at 100% 0%, rgba(255, 173, 77, 0.10), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.105), rgba(255, 255, 255, 0.038));
}

.theme-lib-node-head {
  min-height: 42px;
}

.theme-lib-node-head .badge {
  margin-left: auto;
  background: rgba(255, 173, 77, 0.13);
  color: #ffba66;
  border: 1px solid rgba(255, 173, 77, 0.14);
}

.theme-lib-node-body {
  gap: 8px;
  padding: 0 12px 12px 22px;
}

.theme-lib-stock {
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.072), rgba(255, 255, 255, 0.024));
  border-color: rgba(255, 255, 255, 0.065);
}

.theme-lib-stock:hover {
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 113, 113, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(248, 113, 113, 0.11), rgba(255, 255, 255, 0.035));
}

.theme-lib-stock-main .tag,
.theme-lib-stock .tag {
  background: rgba(255, 255, 255, 0.075);
  border: 1px solid rgba(255, 255, 255, 0.055);
  color: rgba(255, 230, 229, 0.78);
}

.theme-lib-stock-reason {
  color: rgba(230, 205, 204, 0.68);
  line-height: 1.55;
}

.theme-lib-panel {
  position: relative;
  z-index: 1;
  border-radius: 10px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.027));
  border-color: rgba(255, 198, 194, 0.085);
}

.theme-lib-panel[open] {
  background:
    radial-gradient(circle at 96% 0%, rgba(248, 113, 113, 0.13), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.095), rgba(255, 255, 255, 0.035));
}

.theme-lib-panel > summary {
  color: rgba(255, 244, 244, 0.96);
  letter-spacing: 0.1px;
}

.theme-lib-panel-body {
  color: rgba(230, 205, 204, 0.74);
}

.theme-lib-snapshot-item {
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.theme-lib-news-item strong {
  color: rgba(255, 244, 244, 0.92);
}

html:not(.dark) .theme-lib-detail {
  background:
    radial-gradient(circle at 92% 0%, rgba(239, 68, 68, 0.12), transparent 28%),
    radial-gradient(circle at 6% 36%, rgba(245, 158, 11, 0.08), transparent 30%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.88), rgba(255, 246, 246, 0.78));
}

html:not(.dark) .theme-lib-detail .panel-head,
html:not(.dark) .theme-lib-metric,
html:not(.dark) .theme-lib-node,
html:not(.dark) .theme-lib-stock,
html:not(.dark) .theme-lib-panel,
html:not(.dark) .theme-lib-snapshot-item {
  background: rgba(255, 255, 255, 0.72);
  border-color: rgba(220, 38, 38, 0.09);
}

html:not(.dark) .theme-lib-detail .panel-title,
html:not(.dark) .theme-lib-panel > summary,
html:not(.dark) .theme-lib-news-item strong {
  color: #3f2b2d;
  text-shadow: none;
}

html:not(.dark) .theme-lib-detail .tiny,
html:not(.dark) .theme-lib-panel-body,
html:not(.dark) .theme-lib-stock-reason {
  color: rgba(68, 50, 52, 0.66);
}

.content-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 22px;
}

.panel {
  min-height: auto;
  background: rgba(163, 163, 163, 0.10);
}

.temperature {
  display: grid;
  width: 132px;
  height: 132px;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--primary) 0 78%, rgba(255, 255, 255, 0.08) 78% 100%);
  font-size: 30px;
  font-weight: 900;
}

.timeline {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.market-motion {
  display: grid;
  gap: 18px;
}

.motion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-radius: 16px;
  padding: 18px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.22), transparent),
    rgba(239, 68, 68, 0.22);
  color: var(--text);
  backdrop-filter: blur(6px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.motion-title {
  color: #fecaca;
  font-size: 24px;
  font-weight: 900;
}

.motion-subtitle {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.motion-counts {
  display: flex;
  align-items: center;
  gap: 18px;
  min-width: 230px;
  justify-content: flex-end;
}

.motion-counts span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.motion-counts strong {
  color: var(--red);
  font-size: 34px;
  line-height: 1;
}

.motion-counts em {
  color: var(--faint);
  font-style: normal;
  font-size: 28px;
}

.motion-counts .green-number {
  color: var(--green);
}

.theme-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  border-radius: 16px;
  padding: 16px;
  background: rgba(163, 163, 163, 0.10);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.theme-stat {
  border-radius: 8px;
  padding: 12px 14px;
  background: rgba(248, 113, 113, 0.12);
  color: var(--muted);
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: background 0.16s ease, transform 0.16s ease;
}

.theme-stat:hover {
  background: rgba(248, 113, 113, 0.18);
  transform: translateY(-1px);
}

.theme-stat strong,
.theme-stat span {
  display: block;
}

.theme-stat strong {
  color: var(--muted);
  font-size: 18px;
}

.theme-stat.red strong {
  color: var(--red);
}

.theme-stat.orange strong {
  color: var(--orange);
}

.theme-stat span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.sky-tabs {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 16px;
  padding: 10px;
  background: rgba(163, 163, 163, 0.10);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.ladder-view-button {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  border: 0;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(28, 28, 30, 0.44);
  color: var(--muted);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.ladder-view-button.active {
  background: rgba(248, 113, 113, 0.20);
  color: var(--text);
  box-shadow: 0 12px 28px rgba(248, 113, 113, 0.10);
}

.ladder-view-button:hover {
  background: rgba(248, 113, 113, 0.16);
  transform: translateY(-1px);
}

.sky-dot {
  width: 20px;
  height: 20px;
  border: 2px solid rgba(229, 229, 229, 0.22);
  border-radius: 50%;
  background: rgba(28, 28, 30, 0.70);
}

.sky-dot.active {
  border-color: rgba(229, 229, 229, 0.22);
  background: var(--red);
  box-shadow: inset 0 0 0 3px rgba(28, 28, 30, 0.88);
}

.sky-table {
  overflow-x: auto;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.20), transparent),
    rgba(28, 28, 30, 0.72);
  color: var(--text);
  padding: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sky-row {
  display: grid;
  grid-template-columns: 96px minmax(720px, 1fr);
  gap: 4px;
  border-bottom: 4px solid transparent;
}

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

.sky-level {
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.18);
  color: #fecaca;
  font-size: 24px;
  font-weight: 900;
}

.sky-cells {
  display: grid;
  grid-template-columns: repeat(4, minmax(170px, 1fr));
  gap: 4px;
  background: transparent;
}

.sky-cell {
  position: relative;
  min-height: 118px;
  padding: 18px 12px 12px;
  border-radius: 8px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.sky-cell:hover {
  background: rgba(248, 113, 113, 0.14);
  transform: translateY(-1px);
}

.sky-time {
  position: absolute;
  top: 5px;
  right: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.sky-name {
  color: var(--text);
  font-size: 18px;
  font-weight: 900;
}

.sky-theme {
  margin-top: 4px;
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.sky-reason {
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.sky-class {
  margin-top: 6px;
  color: var(--orange);
  font-size: 12px;
  font-weight: 800;
}

.dragon-panel {
  border-radius: 16px;
  padding: 16px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.20), transparent),
    rgba(239, 68, 68, 0.18);
  backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dragon-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.dragon-stat {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.dragon-stat span,
.dragon-stat em {
  display: block;
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.dragon-stat strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--red);
  font-size: 24px;
  line-height: 1;
}

.dragon-stat.orange strong {
  color: var(--orange);
}

.dragon-stat.green strong {
  color: var(--green);
}

.dragon-stat.gray strong {
  color: var(--muted);
}

.dragon-layout {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  gap: 16px;
}

.dragon-layout-enhanced {
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
}

.dragon-detail-panel {
  margin-bottom: 16px;
  border-radius: 12px;
  padding: 12px 14px;
  background:
    linear-gradient(135deg, rgba(248, 113, 113, 0.13), rgba(28, 28, 30, 0.42)),
    rgba(28, 28, 30, 0.50);
  border: 1px solid rgba(248, 113, 113, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.dragon-detail-prompt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 16px;
  border-radius: 10px;
  padding: 9px 12px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 12px;
}

.dragon-detail-prompt strong {
  color: #fecaca;
}

.dragon-detail-dialog {
  width: min(980px, calc(100vw - 36px));
  max-height: min(760px, calc(100vh - 44px));
  overflow: auto;
  position: relative;
  border-radius: 18px;
  padding: 18px;
  background:
    radial-gradient(ellipse 90% 70% at 50% -20%, rgba(248, 113, 113, 0.24), transparent),
    rgba(31, 22, 24, 0.94);
  border: 1px solid rgba(248, 113, 113, 0.18);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.56);
  backdrop-filter: blur(22px);
}

.dragon-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-right: 40px;
}

.dragon-modal-head span {
  color: #fca5a5;
  font-size: 12px;
  font-weight: 900;
}

.dragon-modal-head h2 {
  margin: 5px 0;
  color: var(--text);
  font-size: 28px;
}

.dragon-modal-head p {
  max-width: 720px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.dragon-modal-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 10px;
}

.dragon-modal-tags b {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-size: 11px;
  font-weight: 900;
}

.dragon-modal-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.dragon-modal-metric {
  border-radius: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.055);
}

.dragon-modal-metric span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.dragon-modal-metric strong {
  display: block;
  margin-top: 5px;
  color: var(--red);
  font-size: 18px;
}

.dragon-modal-metric.green strong {
  color: var(--green);
}

.dragon-modal-metric.gray strong {
  color: var(--muted);
}

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

.dragon-modal-section {
  margin-top: 12px;
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.055);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.dragon-modal-section h3 {
  margin: 0 0 10px;
  color: #fecaca;
  font-size: 14px;
}

.dragon-modal-section h3.green {
  color: #bbf7d0;
}

.dragon-modal-summary {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.dragon-modal-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 9px;
  border-radius: 9px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.055);
}

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

.dragon-modal-row strong,
.dragon-modal-row em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dragon-modal-row strong {
  color: var(--text);
  font-size: 13px;
}

.dragon-modal-row em,
.dragon-modal-row small {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.dragon-modal-empty {
  border-radius: 8px;
  padding: 12px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.dragon-modal-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dragon-modal-notes span {
  border-radius: 8px;
  padding: 7px 9px;
  background: rgba(248, 113, 113, 0.10);
  color: var(--muted);
  font-size: 12px;
}

.dragon-detail-panel.is-empty {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  color: var(--muted);
}

.dragon-detail-panel.is-empty strong {
  color: var(--text);
}

.dragon-detail-panel.is-empty p {
  margin: 0;
  font-size: 12px;
}

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

.dragon-detail-head span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dragon-detail-head strong {
  display: block;
  margin-top: 3px;
  color: var(--text);
  font-size: 16px;
}

.dragon-detail-close {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
}

.dragon-detail-lines {
  display: grid;
  gap: 7px;
}

.dragon-detail-lines p {
  margin: 0;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-size: 12px;
  line-height: 1.55;
}

.dragon-block {
  border-radius: 12px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.48);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.dragon-block-title {
  margin-bottom: 10px;
  color: #fecaca;
  font-size: 16px;
  font-weight: 900;
}

.dragon-mini-title {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 2px 0 8px;
  color: #fecaca;
  font-size: 13px;
  font-weight: 900;
}

.dragon-mini-title::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 0 10px rgba(248, 113, 113, 0.65);
}

.dragon-mini-title.green {
  color: #bbf7d0;
}

.dragon-mini-title.green::before {
  background: var(--green);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.55);
}

.institution-title {
  margin-top: 12px;
}

.dragon-seat-grid,
.dragon-stock-list,
.dragon-theme-grid,
.dragon-seat-rank-list,
.dragon-institution-list,
.dragon-market-list {
  display: grid;
  gap: 10px;
}

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

.dragon-seat {
  border-radius: 8px;
  padding: 12px;
  background: rgba(163, 163, 163, 0.10);
  transition: background 0.16s ease, transform 0.16s ease;
}

.dragon-seat:hover,
.dragon-stock-row:hover,
.dragon-theme:hover,
.dragon-seat-rank:hover,
.dragon-institution-row:hover,
.dragon-market-row:hover {
  background: rgba(248, 113, 113, 0.13);
  transform: translateY(-1px);
}

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

.dragon-seat-head strong,
.dragon-seat-head span {
  display: block;
}

.dragon-seat-head span,
.dragon-seat p,
.dragon-stock-row p {
  color: var(--muted);
  font-size: 12px;
}

.dragon-seat-head b {
  color: var(--red);
  white-space: nowrap;
}

.dragon-seat-stock {
  margin: 8px 0 4px;
  color: var(--orange);
  font-size: 13px;
  font-weight: 800;
}

.dragon-stock-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(163, 163, 163, 0.10);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.dragon-seat-rank,
.dragon-institution-row,
.dragon-market-row {
  display: grid;
  align-items: center;
  gap: 10px;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.035);
  transition: background 0.16s ease, transform 0.16s ease;
}

button.dragon-seat-rank {
  width: 100%;
  border-color: rgba(255, 255, 255, 0.035);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.dragon-seat-rank {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.dragon-seat-rank.sell .dragon-rank-no {
  color: var(--green);
  background: rgba(34, 197, 94, 0.12);
}

.dragon-rank-no {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  background: rgba(248, 113, 113, 0.13);
}

.dragon-seat-rank strong,
.dragon-institution-row strong,
.dragon-market-row strong {
  display: inline-block;
  max-width: 240px;
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  white-space: nowrap;
}

.dragon-seat-rank em,
.dragon-institution-row em,
.dragon-market-row em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dragon-seat-rank b,
.dragon-institution-row b,
.dragon-market-money b {
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.dragon-institution-row {
  grid-template-columns: minmax(0, 1fr) auto auto;
  cursor: pointer;
}

.dragon-market-row {
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  cursor: pointer;
}

.dragon-quote-button {
  align-self: center;
  border: 1px solid rgba(248, 113, 113, 0.34);
  border-radius: 999px;
  min-width: 40px;
  height: 24px;
  padding: 0 9px;
  background: rgba(248, 113, 113, 0.12);
  color: #fecaca;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
  white-space: nowrap;
}

.dragon-quote-button.compact {
  min-width: 66px;
}

.dragon-quote-button:hover {
  background: rgba(248, 113, 113, 0.22);
}

.dragon-market-money {
  display: grid;
  justify-items: end;
  gap: 3px;
}

.dragon-market-money span {
  font-size: 11px;
}

.dragon-core-block {
  margin-top: 16px;
}

.mini-empty {
  min-height: auto;
  padding: 12px;
  font-size: 12px;
}

.dragon-stock-row p {
  grid-column: 1 / -1;
  margin: 0;
}

.dragon-theme-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 16px;
}

.dragon-theme {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.48);
  transition: background 0.16s ease, transform 0.16s ease;
}

.dragon-risks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.dragon-risks span {
  border-radius: 6px;
  padding: 6px 8px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted);
  font-size: 12px;
}

.ladder-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 22px;
}

.ladder-summary {
  align-self: start;
  min-height: auto;
  position: sticky;
  top: 132px;
}

.board-taxonomy {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.compact-taxonomy {
  margin-top: 0;
}

.ladder-stack {
  display: grid;
  gap: 16px;
}

.board-breakdown {
  border-radius: 16px;
  padding: 16px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.16), transparent),
    rgba(163, 163, 163, 0.10);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.ladder-level {
  border-radius: 16px;
  padding: 16px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.ladder-level-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.ladder-level-mark {
  display: grid;
  height: 54px;
  place-items: center;
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.24);
  color: #fecaca;
  font-size: 20px;
  font-weight: 900;
}

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

.board-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.board-card {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.64);
  border: 1px solid rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.board-card:hover {
  background: rgba(248, 113, 113, 0.12);
  transform: translateY(-1px);
}

.board-reason {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.week-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 22px;
}

.week-card {
  min-height: auto;
}

.week-themes {
  margin-bottom: 12px;
}

.weekly-evolution {
  display: grid;
  gap: 18px;
}

.weekly-hero .motion-counts {
  min-width: 280px;
}

.weekly-source {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  min-width: 120px;
}

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

.weekly-metric {
  border-radius: 8px;
  padding: 14px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.weekly-metric span,
.weekly-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.weekly-metric strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--red);
  font-size: 26px;
  line-height: 1.05;
}

.weekly-briefing {
  display: grid;
  grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
  gap: 12px;
}

.weekly-brief-card {
  border-radius: 8px;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(248, 113, 113, 0.16), rgba(248, 113, 113, 0.04)),
    rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(248, 113, 113, 0.12);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.16);
}

.weekly-brief-card span,
.weekly-brief-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.weekly-brief-card strong {
  display: block;
  margin: 6px 0;
  color: var(--text);
  font-size: 17px;
}

.weekly-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.7fr) minmax(360px, 1.15fr) minmax(300px, 0.9fr);
  gap: 18px;
  align-items: start;
}

.weekly-theme-panel,
.weekly-timeline-panel,
.weekly-stock-panel {
  min-height: 0;
}

.weekly-theme-list {
  display: grid;
  gap: 8px;
}

.weekly-theme-button {
  cursor: pointer;
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.42);
  color: var(--text);
  text-align: left;
  transition: background 0.16s ease, transform 0.16s ease;
}

.weekly-theme-button:hover,
.weekly-theme-button.active {
  background: rgba(248, 113, 113, 0.18);
  transform: translateY(-1px);
}

.weekly-theme-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.weekly-timeline {
  display: grid;
  gap: 10px;
}

.weekly-day {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.weekly-day.highlight {
  border-color: rgba(248, 113, 113, 0.28);
  background:
    radial-gradient(ellipse 80% 80% at 20% 0%, rgba(248, 113, 113, 0.16), transparent 64%),
    rgba(28, 28, 30, 0.52);
}

.weekly-day-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
}

.weekly-day-head span {
  color: var(--muted);
  font-size: 12px;
}

.weekly-day-head b {
  color: var(--red);
}

.weekly-bar {
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.weekly-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

html:not(.dark) .weekly-metric,
html:not(.dark) .weekly-brief-card,
html:not(.dark) .weekly-theme-button,
html:not(.dark) .weekly-day {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .weekly-theme-button:hover,
html:not(.dark) .weekly-theme-button.active,
html:not(.dark) .weekly-day.highlight {
  background:
    radial-gradient(ellipse 80% 80% at 20% 0%, rgba(239, 68, 68, 0.14), transparent 64%),
    rgba(255, 255, 255, 0.72);
}

.smart-radar {
  display: grid;
  gap: 18px;
}

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

.smart-metric {
  border-radius: 8px;
  padding: 14px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.smart-metric span,
.smart-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.smart-metric strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--red);
  font-size: 26px;
  line-height: 1.05;
}

.smart-layout {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1.1fr);
  gap: 18px;
  align-items: start;
}

.smart-temperature-panel,
.smart-mind-panel,
.smart-dragon-panel,
.smart-stock-panel,
.smart-risk-panel {
  min-height: 0;
}

.smart-temp-body {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.smart-behavior-tags {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.smart-behavior {
  border-radius: 8px;
  padding: 10px;
  background: rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.smart-behavior.active {
  border-color: rgba(248, 113, 113, 0.24);
  background: rgba(248, 113, 113, 0.14);
}

.smart-behavior strong,
.smart-behavior span {
  display: block;
}

.smart-behavior span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.smart-mind-map {
  display: grid;
  gap: 10px;
}

.smart-link {
  display: grid;
  grid-template-columns: minmax(112px, 0.8fr) 28px minmax(120px, 1fr) 28px minmax(112px, 0.85fr);
  gap: 8px;
  align-items: center;
}

.smart-node {
  min-height: 58px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(28, 28, 30, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.04);
  font-weight: 800;
}

.smart-node span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.35;
}

.seat-node {
  border-color: rgba(248, 113, 113, 0.22);
}

.stock-node {
  border-color: rgba(251, 146, 60, 0.22);
}

.theme-node {
  border-color: rgba(96, 165, 250, 0.24);
}

.smart-connector {
  height: 2px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(248, 113, 113, 0.20), rgba(248, 113, 113, 0.72));
}

.smart-risk-panel {
  grid-column: 1 / -1;
}

html:not(.dark) .smart-metric,
html:not(.dark) .smart-behavior,
html:not(.dark) .smart-node {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .smart-behavior.active {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(220, 38, 38, 0.12);
}

.flow-radar {
  display: grid;
  gap: 18px;
}

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

.flow-metric {
  border-radius: 8px;
  padding: 14px;
  background: rgba(163, 163, 163, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.flow-metric span,
.flow-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.flow-metric strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--red);
  font-size: 26px;
  line-height: 1.05;
}

.flow-layout {
  display: grid;
  grid-template-columns: minmax(340px, 1fr) minmax(360px, 1fr);
  gap: 18px;
  align-items: start;
}

.flow-rank-panel,
.flow-map-panel,
.flow-type-panel,
.flow-stock-panel {
  min-height: 0;
}

.flow-rank-list,
.flow-type-grid {
  display: grid;
  gap: 10px;
}

.flow-rank-item {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.flow-rank-head {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.flow-rank-head b {
  color: var(--red);
}

.flow-bar {
  height: 8px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.flow-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

.flow-factor-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.flow-bubble-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  gap: 10px;
}

.flow-bubble {
  min-height: 118px;
  border-radius: 8px;
  padding: 14px;
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(248, 113, 113, 0.22), transparent 70%),
    rgba(28, 28, 30, 0.48);
  border: 1px solid rgba(248, 113, 113, 0.12);
}

.flow-bubble.live {
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(96, 165, 250, 0.20), transparent 70%),
    rgba(28, 28, 30, 0.48);
  border-color: rgba(96, 165, 250, 0.18);
}

.flow-bubble.hot {
  background:
    radial-gradient(ellipse 80% 80% at 50% 0%, rgba(251, 146, 60, 0.22), transparent 70%),
    rgba(28, 28, 30, 0.48);
  border-color: rgba(251, 146, 60, 0.18);
}

.flow-bubble strong,
.flow-bubble span,
.flow-bubble em {
  display: block;
}

.flow-bubble span {
  margin: 8px 0;
  color: var(--red);
  font-size: 24px;
  font-weight: 900;
}

.flow-bubble em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.flow-type-card {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.flow-type-card.live {
  border-color: rgba(96, 165, 250, 0.18);
}

.flow-type-card.hot {
  border-color: rgba(251, 146, 60, 0.18);
}

.flow-type-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.flow-stock-panel {
  grid-column: 1 / -1;
}

html:not(.dark) .flow-metric,
html:not(.dark) .flow-rank-item,
html:not(.dark) .flow-bubble,
html:not(.dark) .flow-type-card {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

.pick-page {
  display: grid;
  gap: 18px;
}

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

.pick-metric {
  border-radius: 8px;
  padding: 14px;
  background: rgba(28, 28, 30, 0.54);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

.pick-metric span,
.pick-metric em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pick-metric strong {
  display: block;
  margin: 6px 0 4px;
  color: var(--red);
  font-size: 28px;
}

.pick-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 18px;
  align-items: start;
}

.pick-list {
  display: grid;
  gap: 12px;
}

.pick-card {
  border-radius: 8px;
  padding: 14px;
  background: rgba(28, 28, 30, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.04);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease;
}

.pick-card:hover {
  transform: translateY(-1px);
  border-color: rgba(248, 113, 113, 0.28);
}

.pick-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.pick-rank {
  margin-right: 8px;
  color: var(--muted);
  font-size: 12px;
}

.pick-score {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 50%;
  background: rgba(248, 113, 113, 0.16);
  color: var(--red);
  font-size: 18px;
  font-weight: 900;
}

.pick-factor-bars {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin: 12px 0;
}

.pick-factor {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 28px;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.pick-factor div {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.pick-factor i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--red), var(--orange));
}

.pick-factor b {
  color: var(--text);
  text-align: right;
}

.pick-reason-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 8px 0 12px;
}

.pick-reason-list span {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(248, 113, 113, 0.10);
  color: var(--muted);
  font-size: 12px;
}

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

.pick-columns strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}

.pick-columns p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pick-side {
  position: sticky;
  top: 12px;
}

.pick-factor-note {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.pick-factor-note span,
.pick-type-list div {
  border-radius: 8px;
  padding: 10px;
  background: rgba(28, 28, 30, 0.42);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.pick-type-list {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.pick-type-list div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.pick-type-list strong {
  color: var(--red);
}

html:not(.dark) .pick-metric,
html:not(.dark) .pick-card,
html:not(.dark) .pick-factor-note span,
html:not(.dark) .pick-type-list div {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

.research-page {
  display: grid;
  gap: 18px;
}

.research-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: start;
}

.research-outline,
.research-sources {
  position: sticky;
  top: 12px;
}

.research-outline nav,
.research-source-list {
  display: grid;
  gap: 8px;
}

.research-outline nav span,
.research-source-list span,
.research-watch p {
  border-radius: 8px;
  padding: 10px;
  background: rgba(28, 28, 30, 0.42);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.research-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.research-actions button {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(248, 113, 113, 0.16);
  color: var(--text);
}

.research-editor {
  width: 100%;
  min-height: 320px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 12px;
  outline: none;
  background: rgba(28, 28, 30, 0.58);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  line-height: 1.55;
}

.research-editor:focus {
  border-color: rgba(248, 113, 113, 0.32);
}

.research-preview {
  margin-top: 14px;
  border-radius: 8px;
  padding: 16px;
  background: rgba(28, 28, 30, 0.42);
}

.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol {
  margin: 0 0 10px;
}

.markdown-body h2 {
  font-size: 22px;
}

.markdown-body h3 {
  margin-top: 16px;
  color: var(--red);
  font-size: 16px;
}

.markdown-body h4,
.markdown-body h5 {
  margin-top: 14px;
  color: var(--text);
  font-size: 14px;
}

.markdown-body p {
  color: var(--muted);
  line-height: 1.68;
}

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

.markdown-keyword {
  display: inline-block;
  border-radius: 5px;
  padding: 0 4px;
  font-weight: 800;
  line-height: 1.35;
}

.keyword-up {
  background: rgba(255, 107, 107, .12);
  color: #ff7a7a;
}

.keyword-down {
  background: rgba(46, 224, 131, .11);
  color: #55e69a;
}

.keyword-watch {
  background: rgba(255, 209, 102, .13);
  color: #ffd166;
}

.markdown-body em {
  color: rgba(255, 209, 102, .88);
  font-style: normal;
}

.markdown-body code {
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 6px;
  background: rgba(0, 0, 0, .20);
  color: #ffd166;
  padding: 1px 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

.markdown-body blockquote {
  border-left: 3px solid var(--red);
  padding-left: 10px;
  color: var(--muted);
}

.markdown-body li {
  margin: 6px 0 6px 18px;
  color: var(--muted);
  line-height: 1.55;
}

.markdown-body hr {
  height: 1px;
  border: 0;
  margin: 14px 0;
  background: linear-gradient(90deg, rgba(255, 112, 112, .32), rgba(255, 255, 255, .06));
}

.markdown-table-wrap {
  width: 100%;
  overflow: auto;
  margin: 10px 0 14px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: rgba(0, 0, 0, .14);
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  min-width: 420px;
  font-size: 12px;
}

.markdown-body th,
.markdown-body td {
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  padding: 8px 9px;
  color: var(--muted);
  text-align: left;
  vertical-align: top;
}

.markdown-body th {
  background: rgba(255, 255, 255, .06);
  color: var(--text);
  font-weight: 800;
}

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

.research-watch {
  margin-top: 14px;
}

.research-watch strong {
  display: block;
  margin-bottom: 8px;
}

html:not(.dark) .research-outline nav span,
html:not(.dark) .research-source-list span,
html:not(.dark) .research-watch p,
html:not(.dark) .research-editor,
html:not(.dark) .research-preview {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

.login-card {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  border-radius: 16px;
  padding: 20px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.30), transparent),
    rgba(28, 28, 30, 0.98);
  color: var(--text);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
}

.login-head span {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.login-head h2 {
  margin: 6px 0;
  font-size: 28px;
}

.login-head p,
.login-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.login-error {
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(248, 113, 113, 0.14);
  border: 1px solid rgba(248, 113, 113, 0.24);
  color: #fecaca;
  font-size: 12px;
}

.login-modes,
.login-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 12px;
}

.login-modes button,
.login-actions button {
  cursor: pointer;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(163, 163, 163, 0.12);
  color: var(--muted);
}

.login-modes button.active,
.login-actions button:first-child {
  background: rgba(248, 113, 113, 0.20);
  color: var(--text);
}

.login-actions button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.login-actions {
  grid-template-columns: 1fr 1fr;
}

.login-field {
  display: grid;
  gap: 6px;
  margin: 10px 0;
}

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

.login-field input {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
  background: rgba(28, 28, 30, 0.58);
  color: var(--text);
}

.admin-page {
  display: grid;
  gap: 18px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.admin-source-panel {
  grid-column: 1 / -1;
}

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

.admin-user-card div,
.admin-module-list article,
.admin-source-grid article {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.42);
}

.admin-user-card span,
.admin-module-list span,
.admin-source-grid span,
.admin-source-grid em {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.admin-user-card strong {
  display: block;
  overflow: hidden;
  margin-top: 5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

.admin-module-list,
.admin-source-grid {
  display: grid;
  gap: 10px;
}

.admin-module-list article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-module-list b.on {
  color: var(--green);
}

.admin-module-list b.off {
  color: var(--muted);
}

.admin-source-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

html:not(.dark) .login-card,
html:not(.dark) .login-field input,
html:not(.dark) .admin-user-card div,
html:not(.dark) .admin-module-list article,
html:not(.dark) .admin-source-grid article {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

.heatmap-page {
  display: grid;
  gap: 18px;
}

.heatmap-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(163, 163, 163, 0.10);
}

.heatmap-segments {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.heatmap-segment {
  cursor: pointer;
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(28, 28, 30, 0.42);
  color: var(--muted);
}

.heatmap-segment.active,
.heatmap-segment:hover {
  background: rgba(248, 113, 113, 0.18);
  color: var(--text);
}

.heatmap-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.heatmap-main-panel,
.heatmap-legend-panel {
  min-height: 0;
}

.cloud-replay {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.cloud-replay span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  padding: 6px 9px;
  background: rgba(28, 28, 30, 0.36);
  color: var(--muted);
  font-size: 12px;
}

.cloud-replay span.active {
  background: rgba(248, 113, 113, 0.18);
  color: var(--text);
}

.cloud-replay b {
  color: var(--red);
}

.cloud-map-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.cloud-map-head strong,
.cloud-map-head span {
  display: block;
}

.cloud-map-head strong {
  font-size: 18px;
}

.cloud-map-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.cloud-map {
  display: grid;
  grid-template-columns: repeat(12, minmax(46px, 1fr));
  grid-auto-flow: dense;
  gap: 10px;
  min-height: 620px;
}

.cloud-empty {
  grid-column: 1 / -1;
}

.cloud-sector {
  min-width: 0;
  border-radius: 8px;
  padding: 10px;
  background:
    radial-gradient(ellipse 120% 90% at 18% 0%, rgba(248, 113, 113, calc(0.08 + var(--sector-level) * 0.10)), transparent 62%),
    rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.045);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.cloud-sector.down {
  background:
    radial-gradient(ellipse 120% 90% at 18% 0%, rgba(74, 222, 128, calc(0.07 + var(--sector-level) * 0.09)), transparent 62%),
    rgba(28, 28, 30, 0.42);
}

.cloud-sector.flat {
  background:
    radial-gradient(ellipse 120% 90% at 18% 0%, rgba(163, 163, 163, 0.10), transparent 62%),
    rgba(28, 28, 30, 0.42);
}

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

.cloud-sector header strong,
.cloud-sector header span {
  display: block;
}

.cloud-sector header strong {
  font-size: 14px;
}

.cloud-sector header span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.cloud-sector header em {
  font-style: normal;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.cloud-stock-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  grid-auto-rows: 58px;
  grid-auto-flow: dense;
  gap: 6px;
}

.cloud-stock {
  display: grid;
  align-content: space-between;
  min-width: 0;
  min-height: 58px;
  border-radius: 8px;
  padding: 7px;
  background:
    radial-gradient(ellipse 120% 100% at 20% 0%, rgba(255, 255, 255, 0.10), transparent 56%),
    rgba(248, 113, 113, var(--heat-alpha));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.04);
  transition: transform 0.16s ease, filter 0.16s ease;
}

.cloud-stock:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
}

.cloud-stock.down {
  background:
    radial-gradient(ellipse 120% 100% at 20% 0%, rgba(255, 255, 255, 0.08), transparent 56%),
    rgba(74, 222, 128, var(--heat-alpha));
}

.cloud-stock.flat {
  background: rgba(163, 163, 163, 0.18);
}

.cloud-stock.xl {
  grid-column: span 3;
  grid-row: span 2;
}

.cloud-stock.lg {
  grid-column: span 2;
  grid-row: span 2;
}

.cloud-stock.md {
  grid-column: span 2;
}

.cloud-stock strong,
.cloud-stock span,
.cloud-stock em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cloud-stock strong {
  font-size: 13px;
}

.cloud-stock span,
.cloud-stock em {
  color: rgba(255, 255, 255, 0.72);
  font-size: 11px;
  font-style: normal;
}

.cloud-stock.xl strong,
.cloud-stock.lg strong {
  font-size: 15px;
}

.cloud-stock.xl em,
.cloud-stock.lg em {
  font-size: 13px;
  font-weight: 900;
}

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

.cloud-stat-grid article {
  border-radius: 8px;
  padding: 10px;
  background: rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.cloud-stat-grid span,
.cloud-stat-grid em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.cloud-stat-grid strong {
  display: block;
  margin-top: 5px;
  overflow: hidden;
  font-size: 16px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.heatmap-legend-list {
  display: grid;
  gap: 10px;
}

.heatmap-legend-item {
  border-radius: 8px;
  padding: 12px;
  background: rgba(28, 28, 30, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.035);
}

.heatmap-mini-bar {
  display: flex;
  height: 8px;
  margin: 9px 0;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.heatmap-mini-bar .up {
  background: var(--red);
}

.heatmap-mini-bar .down {
  background: var(--green);
}

html:not(.dark) .heatmap-toolbar,
html:not(.dark) .heatmap-segment,
html:not(.dark) .heatmap-legend-item,
html:not(.dark) .cloud-sector,
html:not(.dark) .cloud-stat-grid article {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .cloud-replay span {
  background: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .cloud-replay span.active {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

html:not(.dark) .heatmap-segment.active,
html:not(.dark) .heatmap-segment:hover {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

.market-cloud-page {
  padding-bottom: 0;
}

.radar-cloud-host {
  overflow: hidden;
  min-height: calc(100vh - 190px);
  padding: 0 !important;
  /* 覆盖 .panel 的 padding，云图需要占满容器 */
}

.radar-cloud-shell {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: calc(100vh - 190px);
  background:
    radial-gradient(circle at 12% 10%, rgba(248, 113, 113, 0.12), transparent 28%),
    rgba(20, 20, 22, 0.56);
}

.radar-cloud-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018)), rgba(20, 20, 22, 0.48);
  border-right: 1px solid rgba(255, 255, 255, 0.055);
}

.radar-cloud-market-list {
  display: grid;
  gap: 1px;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.055);
  background: rgba(0, 0, 0, 0.18);
}

.radar-cloud-market-list button,
.radar-cloud-actions button,
.radar-cloud-replay button,
.radar-cloud-shot {
  border: 0;
  color: var(--text);
  cursor: pointer;
  font: inherit;
}

.radar-cloud-market-list button {
  height: 30px;
  padding: 0 10px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  text-align: left;
}

.radar-cloud-market-list button.active,
.radar-cloud-market-list button:hover {
  background: rgba(248, 113, 113, 0.18);
  color: var(--text);
}

.radar-cloud-select select {
  width: 100%;
  height: 32px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  padding: 0 9px;
  outline: none;
}

.radar-cloud-summary {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 上涨/平盘/下跌三元素网格 */
.radar-cloud-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.radar-cloud-summary-grid div {
  min-width: 0;
  border-radius: 8px;
  padding: 8px 6px;
  background: rgba(255, 255, 255, 0.045);
  text-align: center;
}

.radar-cloud-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.radar-cloud-summary-grid strong {
  display: block;
  margin-top: 3px;
  overflow: visible;
  /* font-size: clamp(9px, 0.9vw + 6px, 12px); */
  font-size: 11px;
  /* 支持4位数显示 */
  word-break: break-all;
  line-height: 1.3;
}

/* 成交额/加权涨跌/样本纵向堆叠 */
.radar-cloud-summary-stack {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.radar-cloud-summary-stack div {
  display: flex;
  align-items: baseline;
  border-radius: 8px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.045);
}

.radar-cloud-summary-stack span {
  color: var(--muted);
  font-size: 11px;
  margin-right: 4px;
  flex-shrink: 0;
}

.radar-cloud-summary-stack strong {
  font-size: 13px;
  line-height: 1.4;
}

.radar-cloud-summary-grid .red,
.radar-cloud-summary-stack .red {
  color: var(--red);
}

.radar-cloud-summary-grid .green,
.radar-cloud-summary-stack .green {
  color: var(--green);
}

.radar-cloud-tip {
  display: grid;
  gap: 4px;
  margin-top: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.035);
  font-size: 10px;
}

.radar-cloud-tip strong {
  font-size: 13px;
}

.radar-cloud-shot,
.radar-cloud-actions button,
.radar-cloud-replay button {
  border-radius: 8px;
  background: rgba(248, 113, 113, 0.16);
  padding: 7px 10px;
  transition: transform 0.16s ease, background 0.16s ease;
}

.radar-cloud-shot:hover,
.radar-cloud-actions button:hover,
.radar-cloud-replay button:hover,
.radar-cloud-replay button.active {
  background: rgba(248, 113, 113, 0.28);
  transform: translateY(-1px);
}

.radar-cloud-main {
  display: grid;
  grid-template-rows: 48px minmax(420px, 1fr) 42px;
  min-width: 0;
}

.radar-cloud-topbar,
.radar-cloud-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 14px;
  background: rgba(255, 255, 255, 0.035);
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
}

.radar-cloud-topbar strong,
.radar-cloud-topbar span {
  display: block;
}

.radar-cloud-topbar strong {
  font-size: 17px;
}

.radar-cloud-topbar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.radar-cloud-actions,
.radar-cloud-replay,
.radar-cloud-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.radar-cloud-actions button,
.radar-cloud-replay button {
  padding: 5px 9px;
  font-size: 12px;
}

.radar-cloud-canvas-wrap {
  position: relative;
  overflow: hidden;
  min-height: 420px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px),
    rgba(22, 22, 24, 0.84);
  background-size: 42px 42px;
}

.radar-cloud-canvas-wrap canvas {
  position: absolute;
  inset: 0;
  display: block;
}

.radar-cloud-canvas-wrap canvas[data-cloud-hover] {
  cursor: grab;
  z-index: 2;
}

.radar-cloud-loading {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: rgba(20, 20, 22, 0.58);
  backdrop-filter: blur(14px);
}

.radar-cloud-tooltip {
  position: absolute;
  z-index: 4;
  top: 12px;
  left: 12px;
  display: none;
  width: 286px;
  gap: 6px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 8px;
  padding: 10px;
  background: rgba(30, 25, 27, 0.78);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  pointer-events: none;
}

.radar-cloud-tooltip strong {
  display: block;
  font-size: 14px;
}

.radar-cloud-tooltip span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

.radar-cloud-tooltip em {
  font-style: normal;
}

.radar-cloud-tooltip b {
  color: var(--text);
  font-weight: 800;
}

.radar-cloud-footer {
  overflow: hidden;
  border-top: 1px solid rgba(255, 255, 255, 0.045);
  border-bottom: 0;
}

.radar-cloud-replay span {
  color: var(--muted);
  font-size: 12px;
}

.radar-cloud-legend i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 24px;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.radar-cloud-shell:fullscreen {
  grid-template-columns: 168px minmax(0, 1fr);
  min-height: 100vh;
}

.radar-cloud-shell:fullscreen .radar-cloud-main {
  grid-template-rows: 48px minmax(0, 1fr) 42px;
}

html:not(.dark) .radar-cloud-shell,
html:not(.dark) .radar-cloud-canvas-wrap {
  background-color: rgba(255, 255, 255, 0.72);
}

html:not(.dark) .radar-cloud-side,
html:not(.dark) .radar-cloud-topbar,
html:not(.dark) .radar-cloud-footer {
  background: rgba(255, 255, 255, 0.54);
  border-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .radar-cloud-tooltip {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.10);
}

.news-item {
  border-left: 1px solid var(--faint);
  padding-left: 12px;
}

.news-title {
  margin-top: 3px;
}

.empty {
  padding: 60px 20px;
  color: var(--muted);
  text-align: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 20000;
  display: none;
  place-items: center;
  background: rgba(0, 0, 0, 0.52);
}

.modal.open {
  display: grid;
}

.command {
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.30), transparent),
    rgba(28, 28, 30, 0.98);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
}

.command input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(163, 163, 163, 0.18);
  padding: 16px;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.command-status {
  border-bottom: 1px solid rgba(163, 163, 163, 0.12);
  padding: 8px 16px;
  color: var(--muted);
  font-size: 12px;
}

.command-list {
  max-height: 560px;
  overflow: auto;
  padding: 12px;
}

.command-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
}

.command-item:hover {
  background: rgba(163, 163, 163, 0.10);
}

.command-empty {
  padding: 32px 12px;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.stock-detail-modal {
  overflow-x: hidden;
  padding: 16px;
}

.stock-detail {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(1040px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border-radius: 16px;
  padding: 18px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.28), transparent),
    rgba(28, 28, 30, 0.98);
  color: var(--text);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.48);
}

.detail-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(163, 163, 163, 0.14);
  color: var(--muted);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}

.detail-close:hover {
  background: rgba(248, 113, 113, 0.20);
  color: var(--text);
}

.detail-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: start;
  padding-right: 34px;
}

.detail-eyebrow {
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.detail-head h2 {
  margin: 4px 0 0;
  font-size: 30px;
  line-height: 1.15;
}

.detail-head h2 span {
  margin-left: 10px;
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.detail-price {
  display: grid;
  justify-items: end;
  gap: 4px;
}

.detail-price strong {
  color: var(--text);
  font-size: 34px;
  line-height: 1;
}

.detail-loading,
.detail-error,
.detail-empty {
  margin-top: 16px;
  border-radius: 8px;
  padding: 18px;
  background: rgba(163, 163, 163, 0.10);
  color: var(--muted);
  text-align: center;
}

.detail-error {
  color: var(--orange);
}

.detail-metrics,
.detail-ma-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  margin-top: 18px;
}

.detail-metrics div,
.detail-ma-grid div {
  border-radius: 8px;
  padding: 12px;
  background: rgba(163, 163, 163, 0.10);
}

.detail-metrics span,
.detail-ma-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.detail-metrics strong,
.detail-ma-grid strong {
  display: block;
  margin-top: 6px;
  font-size: 18px;
}

.detail-chart,
.detail-context {
  margin-top: 14px;
  border-radius: 12px;
  padding: 14px;
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(248, 113, 113, 0.18), transparent),
    rgba(163, 163, 163, 0.10);
}

.detail-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.detail-section-head strong {
  color: #fecaca;
  font-size: 16px;
}

.detail-section-head span {
  color: var(--muted);
  font-size: 12px;
}

.chart-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.chart-period,
.chart-tool {
  min-height: 30px;
  border-radius: 8px;
  padding: 5px 10px;
  background: rgba(28, 28, 30, 0.48);
  color: var(--muted);
  cursor: pointer;
}

.chart-period:hover,
.chart-tool:hover,
.chart-period.active,
.chart-tool.active {
  background: rgba(248, 113, 113, 0.20);
  color: var(--text);
}

.interactive-chart {
  position: relative;
  overflow: hidden;
  height: 360px;
  border-radius: 8px;
  background: rgba(28, 28, 30, 0.58);
  border: 1px solid rgba(255, 255, 255, 0.04);
}

#detail-chart-canvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  user-select: none;
  touch-action: none;
}

.chart-indicator-select {
  position: absolute;
  left: 5px;
  bottom: 31px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px;
  background: rgba(28, 28, 30, 0.50);
  color: var(--muted);
  line-height: 1;
}

.chart-indicator-select select {
  width: 50px;
  border: 0;
  border-radius: 5px;
  padding: 2px 12px 2px 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  font-size: 10px;
  line-height: 1.2;
  outline: none;
}

.chart-ma-toggles {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding-left: 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.chart-ma-toggle {
  height: 26px;
  padding: 0 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  transition: all 0.16s ease;
}

.chart-ma-toggle:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.10);
}

.chart-ma-toggle.active.ma5 {
  border-color: color-mix(in srgb, var(--blue) 65%, transparent);
  background: color-mix(in srgb, var(--blue) 18%, transparent);
  color: var(--blue);
}

.chart-ma-toggle.active.ma10 {
  border-color: rgba(251, 191, 36, 0.62);
  background: rgba(251, 191, 36, 0.14);
  color: #fbbf24;
}

.chart-ma-toggle.active.ma20 {
  border-color: rgba(167, 139, 250, 0.62);
  background: rgba(167, 139, 250, 0.14);
  color: #a78bfa;
}

.chart-tooltip {
  position: absolute;
  z-index: 2;
  display: none;
  min-width: 220px;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid rgba(248, 113, 113, 0.12);
  background: rgba(28, 28, 30, 0.56);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  pointer-events: none;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

.chart-tooltip-title,
.chart-tooltip-change,
.chart-tooltip-meta,
.chart-tooltip-indicator,
.chart-tooltip-ma {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.chart-tooltip-title {
  margin-bottom: 6px;
}

.chart-tooltip-title strong {
  font-size: 12px;
}

.chart-tooltip-title span {
  font-size: 15px;
  font-weight: 900;
}

.chart-tooltip-change {
  margin-bottom: 7px;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 800;
}

.chart-tooltip-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px 10px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.chart-tooltip-grid span,
.chart-tooltip-meta {
  color: var(--muted);
}

.chart-tooltip-grid strong {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.chart-tooltip-meta,
.chart-tooltip-indicator,
.chart-tooltip-ma {
  margin-top: 7px;
  padding-top: 7px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 11px;
  white-space: nowrap;
}

.chart-tooltip-indicator {
  color: var(--muted);
}

.chart-tooltip-ma {
  font-weight: 800;
  gap: 8px;
}

.chart-tooltip-ma .ma5 {
  color: var(--blue);
}

.chart-tooltip-ma .ma10 {
  color: #fbbf24;
}

.chart-tooltip-ma .ma20 {
  color: #a78bfa;
}

.price-up {
  color: var(--red);
}

.price-down {
  color: var(--green);
}

.price-flat {
  color: var(--text);
}

.detail-context p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

@media (max-width: 860px) {
  .topbar {
    grid-template-columns: 1fr auto;
  }

  .actions {
    gap: 8px;
  }

  .refresh-pill {
    min-width: 84px;
    justify-content: center;
  }

  .auth-pill {
    min-width: 64px;
    padding: 7px 8px;
  }

  .refresh-label {
    display: none;
  }

  .refresh-meta {
    display: none;
  }

  .search-button {
    grid-column: 1 / -1;
    order: 3;
    width: 100%;
  }

  .hero-strip,
  .theme-layout,
  .theme-lib-layout,
  .blogger-layout,
  .ladder-layout {
    grid-template-columns: 1fr;
  }

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

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

  .theme-lib-layout,
  .theme-lib-menu,
  .theme-lib-detail {
    max-height: none;
  }

  .theme-lib-menu {
    min-height: 520px;
  }

  .theme-lib-snapshot-item {
    grid-template-columns: 1fr 1fr;
  }

  .ladder-summary {
    position: static;
  }

  .motion-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .motion-counts {
    justify-content: flex-start;
    min-width: 0;
  }

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

  .weekly-metrics,
  .weekly-briefing,
  .weekly-layout,
  .smart-metric-grid,
  .smart-layout,
  .smart-temp-body,
  .smart-behavior-tags,
  .flow-metrics,
  .flow-layout,
  .heatmap-layout,
  .pick-overview,
  .pick-layout,
  .pick-factor-bars,
  .pick-columns,
  .research-layout,
  .admin-layout,
  .admin-user-card {
    grid-template-columns: 1fr;
  }

  .pick-side,
  .research-outline,
  .research-sources {
    position: static;
  }

  .heatmap-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .cloud-map {
    grid-template-columns: repeat(6, minmax(38px, 1fr));
    min-height: auto;
  }

  .cloud-sector {
    grid-column: span 3 !important;
  }

  .cloud-sector[style*="span 6"],
  .cloud-sector[style*="span 4"] {
    grid-column: span 6 !important;
  }

  .cloud-stock-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 52px;
  }

  .smart-link {
    grid-template-columns: 1fr;
  }

  .smart-connector {
    width: 2px;
    height: 16px;
    justify-self: center;
    background: linear-gradient(180deg, rgba(248, 113, 113, 0.20), rgba(248, 113, 113, 0.72));
  }

  .dragon-stat-grid,
  .dragon-layout,
  .dragon-layout-enhanced,
  .dragon-seat-columns,
  .dragon-theme-grid {
    grid-template-columns: 1fr;
  }

  .dragon-detail-panel.is-empty,
  .dragon-modal-metrics,
  .dragon-modal-grid,
  .dragon-market-row,
  .dragon-institution-row {
    grid-template-columns: 1fr;
  }

  .dragon-detail-dialog {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 14px;
  }

  .dragon-modal-head {
    display: grid;
    padding-right: 34px;
  }

  .dragon-modal-head h2 {
    font-size: 22px;
  }

  .dragon-modal-row {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .dragon-modal-row b,
  .dragon-modal-row small {
    justify-self: start;
    grid-column: 2;
  }

  .dragon-quote-button {
    justify-self: flex-start;
  }

  .detail-head,
  .detail-metrics,
  .detail-ma-grid {
    grid-template-columns: 1fr;
  }

  .interactive-chart {
    height: 300px;
  }

  .detail-price {
    justify-items: start;
  }

  .detail-head {
    padding-right: 0;
  }

  .sky-row {
    grid-template-columns: 72px minmax(620px, 1fr);
  }

  .sky-level {
    font-size: 20px;
  }

  .source-grid {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding-bottom: 12px;
  }

  .source-card {
    flex: 0 0 min(350px, calc(100vw - 34px));
  }
}

.blogger-layout {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.blogger-side {
  min-height: 0;
}

.blogger-feed {
  min-height: 620px;
}

.blogger-groups {
  display: grid;
  gap: 10px;
}

.blogger-group {
  border-radius: 8px;
  background: rgba(28, 28, 30, 0.24);
}

.blogger-group-head {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.blogger-group-head span {
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blogger-group-head em {
  color: var(--muted);
  font-style: normal;
  font-size: 12px;
}

.blogger-group-head strong {
  position: relative;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background:
    radial-gradient(circle at 36% 22%, rgba(255, 255, 255, 0.24), transparent 35%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.10), rgba(255, 255, 255, 0.02)),
    rgba(42, 36, 40, 0.58);
  backdrop-filter: blur(16px) saturate(1.2);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.16),
    inset 0 -12px 22px rgba(0, 0, 0, 0.13),
    0 12px 22px rgba(0, 0, 0, 0.18);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.blogger-group-head strong::before {
  content: "";
  position: relative;
  z-index: 1;
  width: 9px;
  height: 9px;
  border-right: 1.6px solid rgba(229, 229, 229, 0.72);
  border-bottom: 1.6px solid rgba(229, 229, 229, 0.72);
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.32));
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.blogger-group-head strong::after {
  content: none;
}

.blogger-group.open .blogger-group-head strong::before {
  transform: translateY(2px) rotate(225deg);
}

.blogger-group-head:hover strong {
  border-color: rgba(255, 255, 255, 0.18);
  background:
    radial-gradient(circle at 36% 22%, rgba(255, 255, 255, 0.28), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.04)),
    rgba(54, 45, 50, 0.68);
  transform: translateY(-1px);
}

.blogger-form {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin: 10px 0 10px;
}

.blogger-input {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(28, 28, 30, 0.54);
  color: var(--text);
  outline: none;
}

.blogger-input:focus {
  border-color: rgba(248, 113, 113, 0.38);
  box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.10);
}

.blogger-add {
  min-width: 68px;
  border-radius: 8px;
  padding: 0 14px;
  background: rgba(248, 113, 113, 0.24);
  color: var(--text);
  cursor: pointer;
}

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

.blogger-list.scrollable {
  max-height: 548px;
  overflow-y: auto;
  padding-right: 4px;
}

.blogger-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 8px;
  padding: 10px;
  border: 1px solid transparent;
  background: rgba(28, 28, 30, 0.42);
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.blogger-chip:hover,
.blogger-chip:focus-visible,
.blogger-chip.active {
  border-color: rgba(248, 113, 113, 0.24);
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(248, 113, 113, 0.18), transparent 62%),
    rgba(248, 113, 113, 0.14);
  box-shadow: 0 12px 24px rgba(248, 113, 113, 0.10);
  transform: translateY(-1px);
  outline: none;
}

.blogger-chip.active {
  border-color: rgba(248, 113, 113, 0.36);
}

.blogger-chip strong,
.blogger-block-head strong {
  display: block;
}

.blogger-chip span,
.blogger-block-head span {
  color: var(--muted);
  font-size: 12px;
}

.blogger-error {
  margin-bottom: 10px;
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(251, 146, 60, 0.14);
  color: var(--orange);
  font-size: 13px;
}

.blogger-placeholder {
  margin: 10px;
  border-radius: 8px;
  padding: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.blogger-suggestions {
  position: absolute;
  z-index: 80;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(248, 113, 113, 0.18);
  border-radius: 8px;
  padding: 8px;
  background: rgba(38, 26, 28, 0.94);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.24);
}

.blogger-suggestion {
  border-radius: 8px;
  padding: 9px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.blogger-suggestion:hover {
  background: rgba(248, 113, 113, 0.16);
}

.blogger-suggestion strong {
  display: block;
}

.blogger-suggestion span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.blogger-block {
  margin-top: 14px;
}

.blogger-block:first-of-type {
  margin-top: 0;
}

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

.blogger-profile {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin: 8px 0 12px;
  border-radius: 8px;
  padding: 12px;
  background:
    radial-gradient(ellipse 90% 90% at 14% 0%, rgba(248, 113, 113, 0.16), transparent 64%),
    rgba(28, 28, 30, 0.34);
}

.blogger-profile strong {
  display: block;
  margin-bottom: 4px;
}

.blogger-profile span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.blogger-article {
  display: block;
  color: inherit;
  text-decoration: none;
}

.blogger-summary {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.blogger-empty {
  min-height: 96px;
}

html:not(.dark) .blogger-input,
html:not(.dark) .blogger-chip,
html:not(.dark) .blogger-group {
  background: rgba(15, 23, 42, 0.06);
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .blogger-group-head,
html:not(.dark) .blogger-placeholder,
html:not(.dark) .blogger-suggestion {
  background: rgba(255, 255, 255, 0.64);
}

html:not(.dark) .blogger-group-head strong {
  border-color: rgba(239, 68, 68, 0.12);
  background:
    radial-gradient(circle at 36% 22%, rgba(255, 255, 255, 0.86), transparent 34%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.78), rgba(239, 68, 68, 0.08)),
    rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72), 0 10px 20px rgba(239, 68, 68, 0.08);
}

html:not(.dark) .blogger-group-head strong::before {
  border-color: rgba(32, 36, 44, 0.58);
}

html:not(.dark) .blogger-chip:hover,
html:not(.dark) .blogger-chip:focus-visible,
html:not(.dark) .blogger-chip.active {
  border-color: rgba(239, 68, 68, 0.20);
  background:
    radial-gradient(ellipse 90% 90% at 18% 0%, rgba(239, 68, 68, 0.12), transparent 62%),
    rgba(255, 255, 255, 0.76);
}

html:not(.dark) .blogger-profile {
  background:
    radial-gradient(ellipse 90% 90% at 14% 0%, rgba(239, 68, 68, 0.10), transparent 64%),
    rgba(255, 255, 255, 0.72);
}

html:not(.dark) .blogger-suggestions {
  border-color: rgba(239, 68, 68, 0.16);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 38px rgba(31, 41, 55, 0.12);
}

html:not(.dark) .blogger-add {
  background: rgba(239, 68, 68, 0.14);
  color: var(--red);
}

html:not(.dark) .motion-title,
html:not(.dark) .dragon-block-title {
  color: var(--red);
}

html:not(.dark) .theme-stat {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(220, 38, 38, 0.08);
}

html:not(.dark) .sky-dot {
  background: rgba(255, 255, 255, 0.82);
  border-color: rgba(15, 23, 42, 0.12);
}

html:not(.dark) .sky-dot.active {
  background: var(--red);
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.92);
}

html:not(.dark) .sky-level,
html:not(.dark) .ladder-level-mark {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

html:not(.dark) .sky-cell,
html:not(.dark) .dragon-stat,
html:not(.dark) .dragon-block,
html:not(.dark) .dragon-seat,
html:not(.dark) .dragon-stock-row,
html:not(.dark) .dragon-theme,
html:not(.dark) .dragon-detail-panel,
html:not(.dark) .dragon-seat-rank,
html:not(.dark) .dragon-institution-row,
html:not(.dark) .dragon-market-row,
html:not(.dark) .ladder-level,
html:not(.dark) .board-card {
  background: rgba(255, 255, 255, 0.64);
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .dragon-detail-lines p {
  background: rgba(239, 68, 68, 0.07);
}

html:not(.dark) .dragon-detail-dialog {
  background:
    radial-gradient(ellipse 90% 70% at 50% -20%, rgba(239, 68, 68, 0.15), transparent),
    rgba(255, 255, 255, 0.94);
  box-shadow: 0 28px 80px rgba(15, 23, 42, 0.20);
}

html:not(.dark) .dragon-detail-prompt,
html:not(.dark) .dragon-modal-metric,
html:not(.dark) .dragon-modal-section,
html:not(.dark) .dragon-modal-empty {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .dragon-quote-button {
  background: rgba(239, 68, 68, 0.10);
  color: var(--red);
}

html:not(.dark) .dragon-modal-tags b {
  background: rgba(239, 68, 68, 0.10);
  color: var(--red);
}

html:not(.dark) .dragon-risks span {
  background: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .command {
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(239, 68, 68, 0.16), transparent),
    rgba(255, 255, 255, 0.98);
}

html:not(.dark) .command input {
  border-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .command-status {
  border-color: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .command-item:hover {
  background: rgba(239, 68, 68, 0.10);
}

html:not(.dark) .stock-detail {
  background:
    radial-gradient(ellipse 80% 80% at 50% -30%, rgba(239, 68, 68, 0.16), transparent),
    rgba(255, 255, 255, 0.98);
  box-shadow: 0 26px 70px rgba(31, 41, 55, 0.18);
}

html:not(.dark) .detail-close,
html:not(.dark) .detail-loading,
html:not(.dark) .detail-error,
html:not(.dark) .detail-empty,
html:not(.dark) .detail-metrics div,
html:not(.dark) .detail-ma-grid div,
html:not(.dark) .detail-chart,
html:not(.dark) .detail-context {
  background: rgba(15, 23, 42, 0.06);
}

html:not(.dark) .detail-section-head strong {
  color: var(--red);
}

html:not(.dark) .interactive-chart {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(220, 38, 38, 0.08);
}

html:not(.dark) .chart-period,
html:not(.dark) .chart-tool,
html:not(.dark) .chart-tooltip {
  background:
    radial-gradient(ellipse 90% 80% at 18% 0%, rgba(239, 68, 68, 0.10), transparent 62%),
    rgba(255, 255, 255, 0.68);
}

html:not(.dark) .chart-tooltip {
  border-color: rgba(220, 38, 38, 0.12);
  box-shadow: 0 12px 28px rgba(31, 41, 55, 0.14);
}

html:not(.dark) .chart-tooltip-grid,
html:not(.dark) .chart-tooltip-meta,
html:not(.dark) .chart-tooltip-indicator,
html:not(.dark) .chart-tooltip-ma {
  border-top-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .chart-indicator-select {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.56);
}

html:not(.dark) .chart-indicator-select select {
  background: rgba(15, 23, 42, 0.06);
  color: var(--text);
}

html:not(.dark) .chart-ma-toggles {
  border-left-color: rgba(15, 23, 42, 0.08);
}

html:not(.dark) .chart-ma-toggle {
  border-color: rgba(15, 23, 42, 0.08);
  background: rgba(255, 255, 255, 0.58);
}

html:not(.dark) .chart-period:hover,
html:not(.dark) .chart-tool:hover,
html:not(.dark) .chart-period.active,
html:not(.dark) .chart-tool.active {
  background: rgba(239, 68, 68, 0.12);
  color: var(--red);
}

@media print {
  body {
    background: #ffffff;
    color: #111827;
  }

  .topbar,
  .tabs,
  .top-insight-shell,
  .hero-strip,
  .research-outline,
  .research-actions,
  .research-editor,
  .modal {
    display: none !important;
  }

  .shell,
  .panel,
  .research-preview,
  .research-source-list span,
  .research-watch p {
    box-shadow: none !important;
    background: #ffffff !important;
    color: #111827 !important;
  }

  .shell {
    padding: 0;
  }

  .research-layout {
    display: block;
  }

  .research-sources {
    position: static;
    margin-top: 16px;
  }
}

@media (max-width: 860px) {
  .blogger-layout {
    grid-template-columns: 1fr;
  }

  .blogger-feed {
    min-height: 0;
  }
}

@media (max-width: 640px) {
  .shell {
    padding: 12px 10px 20px;
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px 0 12px;
  }

  .brand {
    min-width: 0;
  }

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

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    overflow: hidden;
    max-width: calc(100vw - 70px);
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .actions {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 8px;
  }

  .search-button {
    min-width: 0;
    width: 100%;
    padding: 9px 11px;
  }

  .refresh-pill,
  .auth-pill,
  .icon-button {
    min-height: 36px;
  }

  .tabs {
    gap: 8px;
    margin: 0 -10px;
    padding: 6px 10px 16px;
    scroll-padding-left: 10px;
  }

  .tab-button {
    padding: 8px 11px;
    font-size: 13px;
  }

  .hero-strip {
    gap: 10px;
    margin-bottom: 14px;
  }

  .top-insight-shell {
    margin-bottom: 14px;
    padding: 10px;
  }

  .top-insight-shell.is-expanded {
    padding-top: 44px;
  }

  .top-insight-shell.is-collapsed {
    padding: 10px 52px 10px 10px;
  }

  .top-insight-compact {
    gap: 8px;
  }

  .top-insight-mini {
    min-height: 40px;
    padding: 9px 10px;
  }

  .top-insight-mini span {
    font-size: 11px;
  }

  .top-insight-mini strong,
  .top-insight-mini em,
  .top-insight-mini .change {
    font-size: 14px;
  }

  .metric {
    padding: 12px;
  }

  .index-head {
    align-items: center;
  }

  .index-chart {
    height: 150px;
  }

  .content-grid,
  .source-grid,
  .theme-stat-grid,
  .weekly-metrics,
  .weekly-briefing,
  .flow-metrics,
  .cloud-map,
  .pick-stats,
  .detail-metrics {
    grid-template-columns: 1fr;
  }

  .cloud-map {
    gap: 8px;
  }

  .cloud-map-head,
  .cloud-replay {
    justify-content: flex-start;
  }

  .cloud-sector {
    grid-column: 1 / -1 !important;
    padding: 8px;
  }

  .cloud-stock-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-auto-rows: 48px;
  }

  .cloud-stock {
    padding: 6px;
  }

  .cloud-stock.xl,
  .cloud-stock.lg,
  .cloud-stock.md {
    grid-column: span 1;
    grid-row: span 1;
  }

  .cloud-stock strong,
  .cloud-stock.xl strong,
  .cloud-stock.lg strong {
    font-size: 12px;
  }

  .cloud-stock span,
  .cloud-stock em,
  .cloud-stock.xl em,
  .cloud-stock.lg em {
    font-size: 10px;
  }

  .cloud-stat-grid {
    grid-template-columns: 1fr;
  }

  .source-grid {
    display: grid;
  }

  .source-card {
    width: 100%;
    min-width: 0;
  }

  .panel {
    padding: 14px;
  }

  .blogger-side {
    overflow: hidden;
  }

  .blogger-list {
    display: grid;
    gap: 8px;
    margin: 0;
    padding: 0;
  }

  .blogger-chip {
    min-width: 0;
  }

  .blogger-profile {
    flex-direction: column;
    gap: 10px;
  }

  .blogger-form {
    grid-template-columns: 1fr;
  }

  .blogger-add {
    min-height: 38px;
  }

  .stock-detail {
    width: calc(100vw - 20px);
    max-height: calc(100vh - 20px);
    padding: 12px;
  }

  .detail-close {
    top: 10px;
    right: 10px;
  }

  .chart-toolbar {
    gap: 7px;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .chart-period,
  .chart-tool {
    flex: 0 0 auto;
    padding: 6px 9px;
    font-size: 13px;
  }

  .interactive-chart {
    height: 280px;
  }

  .chart-tooltip {
    max-width: min(230px, calc(100vw - 44px));
  }
}

@media (max-width: 900px) {

  .radar-cloud-shell,
  .radar-cloud-shell:fullscreen {
    grid-template-columns: 1fr;
    min-height: calc(100vh - 150px);
  }

  .radar-cloud-side {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(120px, 0.8fr);
    gap: 10px;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.055);
  }

  .radar-cloud-market-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .radar-cloud-market-list button {
    height: 32px;
    text-align: center;
    padding: 0 4px;
    font-size: 12px;
  }

  .radar-cloud-summary {
    grid-column: 1 / -1;
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .radar-cloud-tip,
  .radar-cloud-shot {
    display: none;
  }

  .radar-cloud-main {
    grid-template-rows: 48px minmax(520px, 62vh) auto;
  }
}

@media (max-width: 640px) {
  .radar-cloud-host {
    min-height: calc(100vh - 130px);
  }

  .radar-cloud-side {
    grid-template-columns: 1fr;
    padding: 10px;
  }

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

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

  .radar-cloud-topbar,
  .radar-cloud-footer {
    align-items: flex-start;
    flex-direction: column;
    height: auto;
    padding: 10px;
  }

  .radar-cloud-main {
    grid-template-rows: auto minmax(460px, 58vh) auto;
  }

  .radar-cloud-legend i {
    width: 38px;
    height: 22px;
    font-size: 10px;
  }

  .radar-cloud-tooltip {
    width: min(286px, calc(100vw - 34px));
  }
}

.market-panel-page {
  display: grid;
  gap: 14px;
}

.market-panel-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
}

.market-panel-title {
  display: flex;
  align-items: center;
  gap: 10px;
}

.market-panel-title span {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #4d8dff;
  box-shadow: 0 0 18px rgba(77, 141, 255, .82);
}

.market-panel-title strong {
  font-size: 18px;
}

.market-panel-title em {
  border: 1px solid;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.market-panel-hero p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.market-panel-hero button,
.market-panel-loading button {
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, .07);
  padding: 8px 12px;
  cursor: pointer;
}

.market-panel-index-grid,
.market-panel-kpis,
.market-panel-core,
.market-panel-hot-grid,
.market-panel-stock-grid {
  display: grid;
  gap: 10px;
}

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

.market-panel-index,
.market-panel-kpi,
.market-panel-card {
  border: 1px solid rgba(255, 255, 255, .09);
  background: linear-gradient(145deg, rgba(104, 55, 58, .38), rgba(27, 25, 27, .72));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .05), 0 16px 40px rgba(0, 0, 0, .22);
}

.market-panel-index {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  border-radius: 8px;
  padding: 12px;
}

.market-panel-index strong,
.market-panel-card-head strong,
.market-panel-stock-row strong,
.market-panel-rank-row strong {
  color: var(--text);
}

.market-panel-index span,
.market-panel-card-head span,
.market-panel-stock-row em,
.market-panel-rank-row em,
.market-panel-mini span {
  color: var(--muted);
  font-size: 11px;
}

.market-panel-index-value {
  display: grid;
  justify-items: end;
  gap: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.market-panel-kpis {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.market-panel-kpi {
  border-radius: 8px;
  padding: 12px;
}

.market-panel-kpi span,
.market-panel-kpi em {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.market-panel-kpi strong {
  display: block;
  margin: 8px 0 6px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 21px;
}

.market-panel-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
}

.market-panel-main {
  display: grid;
  gap: 14px;
}

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

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

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

.market-panel-card {
  border-radius: 8px;
  padding: 12px;
}

.market-panel-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.market-panel-bars {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  align-items: end;
  gap: 6px;
  height: 112px;
}

.market-panel-bar {
  display: grid;
  grid-template-rows: 18px 1fr 16px;
  justify-items: center;
  height: 100%;
  color: var(--muted);
  font-size: 10px;
}

.market-panel-bar i {
  align-self: end;
  display: block;
  width: 11px;
  border-radius: 999px 999px 2px 2px;
}

.market-panel-bar i.up {
  background: linear-gradient(180deg, #21d982, #127a4b);
}

.market-panel-bar i.down {
  background: linear-gradient(180deg, #ff6666, #9e2929);
}

.market-panel-breadth-track {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .08);
}

.market-panel-breadth-track i.up {
  background: #d64242;
}

.market-panel-breadth-track i.flat {
  background: rgba(255, 255, 255, .25);
}

.market-panel-breadth-track i.down {
  background: #22aa68;
}

.market-panel-breadth-counts,
.market-panel-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.market-panel-mini-grid:not(.three) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.market-panel-breadth-counts span,
.market-panel-mini,
.market-panel-seal {
  border-radius: 7px;
  background: rgba(255, 255, 255, .055);
  padding: 8px;
}

.market-panel-mini strong {
  display: block;
  margin-top: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.market-panel-monitor-block {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.market-panel-monitor-block .market-panel-card-head {
  margin-bottom: 8px;
}

.market-panel-radar-card {
  display: grid;
}

.market-panel-radar {
  width: 100%;
  min-height: 232px;
}

.market-panel-radar-score {
  fill: var(--text);
  font-size: 25px;
  font-weight: 900;
}

.market-panel-radar-label {
  fill: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

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

.market-panel-rank-title {
  margin-bottom: 6px;
  font-size: 12px;
  font-weight: 800;
}

.market-panel-rank-row,
.market-panel-stock-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 0;
  border-radius: 7px;
  background: rgba(255, 255, 255, .045);
  padding: 8px;
  text-align: left;
}

.market-panel-stock-row {
  cursor: pointer;
}

.market-panel-stock-row:hover,
.market-panel-rank-row:hover,
.market-panel-alert:hover {
  background: rgba(255, 255, 255, .08);
}

.market-panel-stock-rows,
.market-panel-alerts,
.market-panel-side {
  display: grid;
  gap: 8px;
}

.market-panel-seal {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.market-panel-ladder-row {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 28px;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
}

.market-panel-ladder-row i {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(0, 0, 0, .28);
}

.market-panel-ladder-row em {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c83e3e, #ff675f);
}

.market-panel-alert {
  position: relative;
  display: block;
  width: 100%;
  border: 0;
  color: inherit;
  font: inherit;
  text-align: left;
  border-radius: 8px;
  background: rgba(255, 255, 255, .045);
  padding: 9px 10px 9px 12px;
  overflow: hidden;
}

button.market-panel-alert {
  cursor: pointer;
}

.market-panel-alert::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 3px;
  height: 100%;
  background: #4d8dff;
}

.market-panel-alert.critical::before {
  background: #ff6464;
}

.market-panel-alert.warn::before {
  background: #e0a33a;
}

.market-panel-alert div {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.market-panel-alert p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.market-panel-alert em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
}

.panel-up {
  color: #ff6b6b !important;
}

.panel-down {
  color: #28d17c !important;
}

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

.panel-accent {
  color: #4d8dff !important;
}

.panel-warn {
  color: #e0a33a !important;
}

.market-panel-loading {
  display: grid;
  place-items: center;
  min-height: 320px;
  color: var(--muted);
}

html:not(.dark) .market-panel-index,
html:not(.dark) .market-panel-kpi,
html:not(.dark) .market-panel-card {
  background: linear-gradient(145deg, rgba(255, 255, 255, .82), rgba(255, 242, 242, .68));
  border-color: rgba(126, 55, 55, .12);
}

@media (max-width: 1180px) {

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

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

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

@media (max-width: 720px) {
  .market-panel-hero {
    align-items: flex-start;
    flex-direction: column;
  }

  .market-panel-index-grid,
  .market-panel-kpis,
  .market-panel-core,
  .market-panel-hot-grid,
  .market-panel-stock-grid,
  .market-panel-rank-grid {
    grid-template-columns: 1fr;
  }
}

.llm-config-button,
.mini-glass {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(248, 113, 113, .15), rgba(255, 255, 255, .05)),
    rgba(163, 163, 163, .10);
  color: var(--text);
  padding: 0 12px;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease;
}

.llm-config-button:hover,
.mini-glass:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 112, 112, .38);
  background: rgba(255, 112, 112, .15);
  box-shadow: 0 14px 30px rgba(248, 113, 113, .10), inset 0 1px 0 rgba(255, 255, 255, .10);
}

.agent-page {
  display: grid;
  gap: 16px;
}

.agent-hero {
  background: linear-gradient(135deg, rgba(122, 54, 58, .78), rgba(42, 35, 38, .82));
}

.agent-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.agent-sidebar,
.agent-main,
.agent-config-panel {
  background: linear-gradient(145deg, rgba(71, 45, 48, .84), rgba(33, 31, 34, .88));
  border: 1px solid rgba(255, 115, 115, .14);
  box-shadow: 0 18px 48px rgba(0, 0, 0, .22), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(18px);
}

.agent-provider-list,
.agent-history,
.agent-config-form,
.agent-provider-grid {
  display: grid;
  gap: 8px;
}

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

.agent-model-head {
  align-items: flex-start;
  gap: 10px;
}

.agent-model-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.agent-model-copy .tiny {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-model-head .mini-glass {
  flex: 0 0 auto;
  min-width: 58px;
  height: 36px;
  padding: 0 10px;
  white-space: nowrap;
}

.agent-provider-list button,
.agent-history-item,
.agent-provider-card {
  display: grid;
  gap: 7px;
  align-content: space-between;
  width: 100%;
  min-height: 72px;
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035)),
    rgba(0, 0, 0, .08);
  color: var(--text);
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.agent-provider-list button {
  min-height: 58px;
  padding: 9px;
}

.agent-history-item {
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: stretch;
  padding: 0;
  overflow: hidden;
}

.agent-history-item > button:first-child {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 0;
  background: transparent;
  color: inherit;
  padding: 10px;
  text-align: left;
  cursor: pointer;
}

.agent-history-delete {
  display: grid;
  place-items: center;
  width: 30px;
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, .08);
  background: rgba(255, 255, 255, .045);
  color: rgba(255, 255, 255, .62);
  cursor: pointer;
}

.agent-history-delete:hover {
  background: rgba(255, 98, 98, .16);
  color: #ff9d9d;
}

.agent-provider-list button.active,
.agent-history-item.active,
.agent-provider-card.active {
  border-color: rgba(255, 104, 104, .55);
  background:
    linear-gradient(135deg, rgba(255, 96, 96, .26), rgba(255, 255, 255, .08)),
    rgba(255, 255, 255, .04);
}

.agent-provider-list span,
.agent-history span,
.agent-provider-card span,
.agent-config-note {
  color: var(--muted);
  font-size: 11px;
}

.agent-provider-card strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
}

.agent-provider-card .agent-provider-status {
  justify-self: end;
  max-width: 100%;
  border-radius: 999px;
  padding: 3px 7px;
  background: rgba(255, 255, 255, .08);
  color: rgba(229, 229, 229, .72);
  line-height: 1;
  white-space: nowrap;
}

.agent-run-form,
.agent-config-form {
  margin-top: 12px;
}

.agent-run-form label,
.agent-config-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.agent-run-form input,
.agent-config-form input,
.agent-config-form select {
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(0, 0, 0, .22);
  color: var(--text);
  padding: 10px 11px;
}

.primary-action {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, #ff6a6a, #b93e42);
  color: #fff;
  padding: 11px 14px;
  font-weight: 800;
  cursor: pointer;
}

.primary-action:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.agent-section-title {
  margin: 18px 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.agent-export-actions {
  display: flex;
  gap: 8px;
}

.agent-export-actions button {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
  color: var(--text);
  padding: 8px 10px;
  cursor: pointer;
}

.agent-signal-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 8px;
  padding: 16px;
  background: rgba(255, 255, 255, .07);
  border: 1px solid rgba(255, 255, 255, .12);
}

.agent-signal-card strong {
  font-size: 30px;
  letter-spacing: 0;
}

.agent-signal-card.buy strong {
  color: #ff6b6b;
}

.agent-signal-card.sell strong {
  color: #2ee083;
}

.agent-progress {
  grid-column: 1 / -1;
  height: 7px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, .12);
}

.agent-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #ff6b6b, #ffd166);
}

.agent-report {
  margin-top: 12px;
  padding: 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .16);
  border: 1px solid rgba(255, 255, 255, .10);
}

.agent-report-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.agent-report h3 {
  margin: 0 0 8px;
}

.agent-report-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.agent-report-head p strong {
  color: var(--text);
}

.agent-report-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.agent-report-badges span {
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(255, 255, 255, .08);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.agent-report-badges .buy {
  background: rgba(255, 107, 107, .14);
  color: #ff7a7a;
}

.agent-report-badges .sell {
  background: rgba(46, 224, 131, .12);
  color: #55e69a;
}

.agent-report-badges .hold {
  background: rgba(255, 209, 102, .13);
  color: #ffd166;
}

.agent-report-columns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.agent-report-columns div {
  display: grid;
  gap: 7px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .06);
  padding: 10px;
}

.agent-report-columns span,
.agent-running,
.agent-empty,
.agent-error,
.agent-success {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.agent-error {
  color: #ff8b8b;
}

.agent-success {
  border: 1px solid rgba(46, 224, 131, .26);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(46, 224, 131, .12), rgba(255, 255, 255, .04));
  color: #7df2ae;
  padding: 9px 10px;
}

.agent-stage-grid {
  position: relative;
  margin-top: 12px;
  min-height: 80px;
  transition: height .18s ease;
}

.agent-stage-grid:not(.is-laid-out) .agent-stage {
  visibility: hidden;
}

.agent-stage {
  position: absolute;
  top: 0;
  left: 0;
  width: calc(50% - 5px);
  border: 1px solid rgba(255, 255, 255, .10);
  border-radius: 8px;
  background: rgba(255, 255, 255, .055);
  padding: 0;
  overflow: hidden;
  align-self: start;
  will-change: transform;
  transition:
    transform .34s cubic-bezier(.22, 1, .36, 1),
    border-color .16s ease,
    background .16s ease,
    box-shadow .16s ease;
}

.agent-stage.is-collapsed {
  background: rgba(255, 255, 255, .04);
}

.agent-stage.is-open {
  box-shadow: 0 14px 32px rgba(0, 0, 0, .10);
}

.agent-stage-summary {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px;
  cursor: pointer;
  text-align: left;
}

.agent-stage-summary b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.agent-stage-summary span {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .10);
  font-size: 11px;
}

.agent-stage.done .agent-stage-summary span {
  background: rgba(255, 98, 98, .25);
  color: #ff9d9d;
}

.agent-stage.running .agent-stage-summary span {
  background: rgba(255, 209, 102, .22);
  color: #ffd166;
}

.agent-stage-summary i {
  position: relative;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 50%;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .035)),
    rgba(255, 255, 255, .055);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .12);
}

.agent-stage-summary i::before {
  content: "";
  width: 7px;
  height: 7px;
  border-top: 1.5px solid rgba(255, 255, 255, .72);
  border-left: 1.5px solid rgba(255, 255, 255, .72);
  transform: translateY(2px) rotate(45deg);
  transition: transform .16s ease;
}

.agent-stage.is-collapsed .agent-stage-summary i::before {
  transform: translateY(-2px) rotate(225deg);
}

.agent-stage-summary:hover i {
  border-color: rgba(255, 112, 112, .34);
  background: rgba(255, 112, 112, .14);
}

.agent-stage-body {
  display: block;
}

.agent-stage.is-collapsed .agent-stage-body {
  display: none;
}

.agent-stage p,
.agent-stage-report {
  margin: 0;
  padding: 0 10px 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  font-family: inherit;
}

.agent-stage-report.markdown-body h2,
.agent-stage-report.markdown-body h3,
.agent-stage-report.markdown-body h4,
.agent-stage-report.markdown-body h5 {
  margin-top: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.agent-stage-report.markdown-body p,
.agent-stage-report.markdown-body li,
.agent-stage-report.markdown-body blockquote {
  font-size: 12px;
}

.agent-config-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
}

.agent-config-drawer.open {
  pointer-events: auto;
}

.agent-config-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .18);
  opacity: 0;
  transition: opacity .18s ease;
}

.agent-config-drawer.open .agent-config-backdrop {
  opacity: 1;
}

.agent-config-panel {
  position: absolute;
  top: 18px;
  right: 18px;
  bottom: 18px;
  width: min(440px, calc(100vw - 36px));
  border-radius: 8px;
  padding: 18px;
  transform: translateX(calc(100% + 24px));
  transition: transform .2s ease;
  overflow: auto;
}

.agent-config-drawer.open .agent-config-panel {
  transform: translateX(0);
}

.agent-config-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.agent-config-head span {
  color: #ff8b8b;
  font-size: 11px;
  font-weight: 900;
}

.agent-config-head h2 {
  margin: 4px 0;
}

.agent-provider-grid.compact {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

html:not(.dark) .agent-sidebar,
html:not(.dark) .agent-main,
html:not(.dark) .agent-config-panel {
  background: linear-gradient(145deg, rgba(255, 255, 255, .88), rgba(255, 242, 242, .74));
  border-color: rgba(126, 55, 55, .14);
}

@media (max-width: 1080px) {
  .agent-layout {
    grid-template-columns: 1fr;
  }

  .agent-report-columns,
  .agent-stage-grid {
    grid-template-columns: 1fr;
  }

  .agent-stage {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .agent-provider-list,
  .agent-report-head {
    grid-template-columns: 1fr;
  }

  .agent-report-badges {
    justify-content: flex-start;
  }
}

/* ---------------------------------------------------------------------------
   个股详情弹窗扩展：双栏布局（左图表主区 + 右信息栏），估值/题材/新闻卡片。
   --------------------------------------------------------------------------- */
.stock-detail.stock-detail-wide {
  width: min(1440px, calc(100vw - 32px));
  max-height: min(880px, calc(100vh - 40px));
}
.detail-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}
.detail-main { min-width: 0; }
.detail-side {
  display: grid;
  gap: 12px;
  position: sticky;
  top: 0;
}
.detail-side-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 14px;
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.012));
}
.detail-side-empty {
  padding: 14px 0 6px;
  color: var(--muted);
  font-size: 12px;
}
/* 12 宫格指标：两行六列 */
.detail-metrics.detail-metrics-wide { grid-template-columns: repeat(6, 1fr); }
/* 估值信息栅格 */
.detail-fund-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
  margin-top: 10px;
}
.detail-fund-grid > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.detail-fund-grid span { color: var(--muted); font-size: 11px; }
.detail-fund-grid strong { font-size: 12px; font-variant-numeric: tabular-nums; }
/* 关联题材列表 */
.detail-theme-list { display: grid; gap: 8px; margin-top: 10px; }
.detail-theme-item {
  display: block;
  width: 100%;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 11px;
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}
.detail-theme-item:hover {
  border-color: rgba(248, 113, 113, 0.45);
  background: rgba(248, 113, 113, 0.08);
  transform: translateY(-1px);
}
.detail-theme-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.detail-theme-top strong { font-size: 13px; }
.detail-theme-reason {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* 相关新闻列表 */
.detail-news-list { display: grid; gap: 8px; margin-top: 10px; }
.detail-news-item {
  padding: 7px 0;
  border-bottom: 1px dashed rgba(255, 255, 255, 0.06);
}
.detail-news-item:last-child { border-bottom: 0; }
.detail-news-item a,
.detail-news-item strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  text-decoration: none;
}
.detail-news-item a:hover { color: #f87171; }
.detail-news-item .tiny { display: block; margin-top: 3px; }
/* 亮色主题适配 */
html:not(.dark) .detail-side-card { background: rgba(255, 255, 255, 0.66); }
html:not(.dark) .detail-fund-grid > div,
html:not(.dark) .detail-news-item { border-bottom-color: rgba(0, 0, 0, 0.07); }
html:not(.dark) .detail-theme-item { background: rgba(0, 0, 0, 0.025); }
/* 响应式：窄屏右栏折叠到主区下方 */
@media (max-width: 1100px) {
  .detail-columns { grid-template-columns: 1fr; }
  .detail-side { position: static; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
}
@media (max-width: 640px) {
  .detail-side { grid-template-columns: 1fr; }
  .detail-metrics.detail-metrics-wide { grid-template-columns: repeat(3, 1fr); }
}

/* ---------------------------------------------------------------------------
   个股弹窗体验优化：关闭按钮提层、题材/新闻限高滚动、色值标签、财报栅格。
   --------------------------------------------------------------------------- */
/* 右栏 sticky 会盖住绝对定位的关闭按钮，必须显式提层。 */
.stock-detail .detail-close { z-index: 30; }
/* 列表限高：约 5 项完整可见，超出内部滚动，不向下撑高弹窗。 */
.detail-theme-list.detail-list-scroll {
  max-height: 330px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.detail-news-list.detail-list-scroll {
  max-height: 290px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}
.detail-list-scroll::-webkit-scrollbar { width: 5px; }
.detail-list-scroll::-webkit-scrollbar-thumb { background: rgba(248, 113, 113, 0.35); border-radius: 4px; }
/* 卡片色值标识：左侧彩条 + 标题圆点，让三张卡片一眼可辨。 */
.detail-side-card { position: relative; overflow: hidden; }
.detail-side-card::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: rgba(255, 255, 255, 0.12);
}
.detail-side-card:first-child::before { background: linear-gradient(180deg, #60a5fa, rgba(96, 165, 250, 0.15)); }
.detail-card-theme::before { background: linear-gradient(180deg, #f87171, rgba(248, 113, 113, 0.15)) !important; }
.detail-card-news::before { background: linear-gradient(180deg, #fbbf24, rgba(251, 191, 36, 0.15)) !important; }
.detail-card-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}
.dot-theme { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.7); }
.dot-news { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
/* 题材热度徽章与前三名排名标 */
.detail-heat-badge {
  flex-shrink: 0;
  padding: 3px 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.22), rgba(248, 113, 113, 0.08));
  border: 1px solid rgba(248, 113, 113, 0.3);
  color: #fca5a5;
  font-size: 10px;
  font-weight: 600;
}
.detail-rank {
  display: inline-grid;
  place-items: center;
  width: 16px; height: 16px;
  margin-right: 6px;
  border-radius: 4px;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  vertical-align: 1px;
}
.detail-rank.r1 { background: linear-gradient(135deg, #f87171, #dc2626); color: #fff; }
.detail-rank.r2 { background: linear-gradient(135deg, #fb923c, #ea580c); color: #fff; }
.detail-rank.r3 { background: linear-gradient(135deg, #fbbf24, #d97706); color: #fff; }
/* 最新财报数据栅格（替代原榜单线索） */
.detail-finance-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 14px;
  margin-top: 10px;
}
.detail-finance-grid > div {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}
.detail-finance-grid span { color: var(--muted); font-size: 11px; }
.detail-finance-grid strong { font-size: 12px; font-variant-numeric: tabular-nums; }
html:not(.dark) .detail-finance-grid > div { background: rgba(0, 0, 0, 0.03); border-color: rgba(0, 0, 0, 0.06); }
@media (max-width: 640px) { .detail-finance-grid { grid-template-columns: 1fr 1fr; } }

/* ---------------------------------------------------------------------------
   题材库左侧排序表头选中标记 + 右侧折叠层级色值边线（纯视觉，不改逻辑）。
   色值体系与个股弹窗右栏一致：蓝=信息 / 红=题材·分支 / 黄=新闻。
   --------------------------------------------------------------------------- */
/* 表头可点击暗示与选中态 */
.theme-lib-list-table th[data-theme-lib-sort] {
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  transition: color 0.15s, background 0.15s;
}
.theme-lib-list-table th[data-theme-lib-sort]:hover { color: var(--text); }
.theme-lib-list-table th.sort-active {
  color: #fca5a5;
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.14), rgba(248, 113, 113, 0.04));
  box-shadow: inset 0 -2px 0 rgba(248, 113, 113, 0.65);
}
html:not(.dark) .theme-lib-list-table th.sort-active {
  color: #b91c1c;
  background: linear-gradient(180deg, rgba(220, 38, 38, 0.10), rgba(220, 38, 38, 0.02));
  box-shadow: inset 0 -2px 0 rgba(220, 38, 38, 0.55);
}
/* 折叠分支：红色系左边线（与弹窗"关联题材"卡同源） */
.theme-lib-node {
  position: relative;
  overflow: hidden;
}
.theme-lib-node::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #f87171, rgba(248, 113, 113, 0.12));
  border-radius: 2px;
  pointer-events: none;
}
/* 嵌套子分支逐级降低边线强度，保持层次识别 */
.theme-lib-node .theme-lib-node::before {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.6), rgba(248, 113, 113, 0.08));
}
.theme-lib-node .theme-lib-node .theme-lib-node::before {
  background: linear-gradient(180deg, rgba(248, 113, 113, 0.35), rgba(248, 113, 113, 0.05));
}
/* 底部三个折叠面板：蓝=介绍 / 红=快照 / 黄=新闻 */
.theme-lib-panel {
  position: relative;
  overflow: hidden;
}
.theme-lib-panel::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.12);
  pointer-events: none;
}
.theme-lib-panel[data-theme-lib-panel="intro"]::before {
  background: linear-gradient(180deg, #60a5fa, rgba(96, 165, 250, 0.12));
}
.theme-lib-panel[data-theme-lib-panel="snapshot"]::before {
  background: linear-gradient(180deg, #f87171, rgba(248, 113, 113, 0.12));
}
.theme-lib-panel[data-theme-lib-panel="news"]::before {
  background: linear-gradient(180deg, #fbbf24, rgba(251, 191, 36, 0.12));
}
/* summary 标题前色点，与弹窗卡片标题圆点一致 */
.theme-lib-panel > summary::before {
  content: "";
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 7px;
  vertical-align: 1px;
}
.theme-lib-panel[data-theme-lib-panel="intro"] > summary::before { background: #60a5fa; box-shadow: 0 0 8px rgba(96, 165, 250, 0.7); }
.theme-lib-panel[data-theme-lib-panel="snapshot"] > summary::before { background: #f87171; box-shadow: 0 0 8px rgba(248, 113, 113, 0.7); }
.theme-lib-panel[data-theme-lib-panel="news"] > summary::before { background: #fbbf24; box-shadow: 0 0 8px rgba(251, 191, 36, 0.7); }
/* 亮色主题下边线颜色保持但弱化光晕 */
html:not(.dark) .theme-lib-panel > summary::before { box-shadow: none; }

/* ---------------------------------------------------------------------------
   题材库嵌套层级换色 + 个股标签质感色系（纯视觉）。
   层级边线：一级红 → 二级黄 → 三级灰，与全站红棕主色同源；个股行不带边线。
   --------------------------------------------------------------------------- */
.theme-lib-node .theme-lib-node::before {
  background: linear-gradient(180deg, #fbbf24, rgba(251, 191, 36, 0.1));
}
.theme-lib-node .theme-lib-node .theme-lib-node::before {
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.55), rgba(251, 191, 36, 0.06));
}
.theme-lib-node .theme-lib-node .theme-lib-node .theme-lib-node::before {
  background: linear-gradient(180deg, rgba(163, 163, 163, 0.6), rgba(163, 163, 163, 0.08));
}
/* 个股卡片不参与边线体系，避免与层级线混淆 */
.theme-lib-stock { position: relative; }
.theme-lib-stock::before { display: none !important; }

/* 个股卡片玻璃质感：压暗发白的白色渐变底，改用深色红棕玻璃 + 内高光 + 毛玻璃 */
.theme-lib-node-body .theme-lib-stock,
.theme-lib-flat .theme-lib-stock {
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 113, 113, 0.06), transparent 42%),
    linear-gradient(150deg, rgba(46, 30, 32, 0.72), rgba(24, 17, 18, 0.55));
  border: 1px solid rgba(255, 190, 184, 0.10);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    0 6px 18px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(10px);
}
.theme-lib-node-body .theme-lib-stock:hover,
.theme-lib-flat .theme-lib-stock:hover {
  background:
    radial-gradient(circle at 100% 0%, rgba(248, 113, 113, 0.18), transparent 40%),
    linear-gradient(150deg, rgba(58, 34, 36, 0.82), rgba(28, 19, 20, 0.62));
  border-color: rgba(248, 113, 113, 0.32);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 10px 24px rgba(0, 0, 0, 0.30),
    0 0 14px rgba(248, 113, 113, 0.10);
}

/* 个股标签色系：统一小圆角、细边框、低饱和渐变底，保证质感且不花哨。
   红=涨停/连板/热度 黄=正宗/核心 绿=首板/次新 灰=其他 */
.theme-lib-tag {
  display: inline-block;
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  border: 1px solid transparent;
}
.theme-lib-tag.tag-limit {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.35);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.20), rgba(248, 113, 113, 0.06));
}
.theme-lib-tag.tag-pure {
  color: #fcd34d;
  border-color: rgba(251, 191, 36, 0.35);
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(251, 191, 36, 0.05));
}
.theme-lib-tag.tag-heat {
  color: #fca5a5;
  border-color: rgba(248, 113, 113, 0.38);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.22), rgba(220, 38, 38, 0.07));
}
/* 热度标签火焰标：不改 DOM，用伪元素前置 */
.theme-lib-tag.tag-heat::before {
  content: "🔥";
  font-size: 10px;
  margin-right: 3px;
}
.theme-lib-tag.tag-new {
  color: #86efac;
  border-color: rgba(67, 213, 138, 0.35);
  background: linear-gradient(135deg, rgba(67, 213, 138, 0.16), rgba(67, 213, 138, 0.05));
}
.theme-lib-tag.tag-plain {
  color: var(--muted);
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}
/* 龙头标签升级为同体系红金质感（保持既有类名与逻辑不变） */
.theme-lib-leader {
  border: 1px solid rgba(248, 113, 113, 0.45);
  background: linear-gradient(135deg, rgba(248, 113, 113, 0.30), rgba(220, 38, 38, 0.12));
  box-shadow: 0 0 8px rgba(248, 113, 113, 0.25);
}
/* 亮色主题：加深文字色、去光晕；个股卡片改浅色玻璃 */
html:not(.dark) .theme-lib-tag.tag-limit { color: #b91c1c; }
html:not(.dark) .theme-lib-tag.tag-pure { color: #b45309; }
html:not(.dark) .theme-lib-tag.tag-heat { color: #b91c1c; }
html:not(.dark) .theme-lib-tag.tag-new { color: #15803d; }
html:not(.dark) .theme-lib-tag.tag-plain { border-color: rgba(0, 0, 0, 0.12); background: rgba(0, 0, 0, 0.04); }
html:not(.dark) .theme-lib-leader { box-shadow: none; }
html:not(.dark) .theme-lib-node-body .theme-lib-stock,
html:not(.dark) .theme-lib-flat .theme-lib-stock {
  background: linear-gradient(150deg, rgba(255, 255, 255, 0.82), rgba(250, 245, 244, 0.66));
  border-color: rgba(0, 0, 0, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7), 0 4px 12px rgba(0, 0, 0, 0.06);
}
