:root {
  --bg: #080d14;
  --bg-2: #10151d;
  --panel: rgba(19, 26, 36, 0.92);
  --panel-strong: rgba(23, 31, 44, 0.96);
  --surface: rgba(27, 37, 50, 0.94);
  --surface-2: rgba(24, 49, 48, 0.9);
  --line: rgba(156, 176, 196, 0.18);
  --line-strong: rgba(156, 176, 196, 0.34);
  --text: #f3f7fb;
  --muted: #a7b4c3;
  --muted-2: #788696;
  --cyan: #58b8ff;
  --teal: #35d5a8;
  --amber: #f7bd55;
  --red: #ff6f91;
  --green: #28d17c;
  --violet: #9b8cff;
  --blue: #2f7dff;
  --coral: #ff8a65;
  --white: #ffffff;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
  --shadow-soft: 0 18px 46px rgba(0, 0, 0, 0.22);
}

/* Product Design refinement: clearer executive header, calmer cards, forum insight module. */
.app-header {
  grid-template-columns: minmax(230px, 0.86fr) minmax(320px, 0.92fr) minmax(520px, 1.35fr);
  grid-template-areas: "brand nav side";
  gap: 16px;
  padding: 12px 22px;
  background:
    linear-gradient(180deg, rgba(9, 15, 24, 0.98), rgba(8, 13, 21, 0.94)),
    linear-gradient(90deg, rgba(47, 125, 255, 0.14), rgba(53, 213, 168, 0.08), rgba(247, 189, 85, 0.04));
}

.brand {
  grid-area: brand;
}

.view-switch {
  grid-area: nav;
  justify-self: stretch;
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 42px;
  padding: 4px;
}

.switch-btn {
  min-width: 0;
  height: 32px;
  font-weight: 700;
}

.header-side {
  grid-area: side;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  grid-template-areas:
    "search user"
    "actions actions";
  gap: 8px 12px;
  align-items: center;
}

.global-search {
  grid-area: search;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
}

.global-search input {
  height: 40px;
  border-radius: 8px;
}

.global-search span {
  color: #8092a5;
}

.user-bar {
  grid-area: user;
  justify-content: flex-end;
}

.header-actions {
  grid-area: actions;
  justify-content: flex-end;
  gap: 7px;
}

.header-actions .btn {
  min-width: 72px;
  height: 34px;
  padding: 0 11px;
}

.user-chip {
  min-width: 126px;
  padding: 7px 10px;
}

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

.review-toolbar {
  top: 171px;
}

.review-card {
  border-radius: 8px;
}

.review-card-head {
  min-height: 86px;
}

.review-title strong {
  letter-spacing: 0;
}

.baima-panel,
.forum-panel {
  margin-top: 12px;
  border: 1px solid rgba(156, 176, 196, 0.16);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(14, 22, 34, 0.92), rgba(8, 14, 23, 0.9));
  padding: 12px;
}

.forum-panel {
  border-color: rgba(247, 189, 85, 0.22);
  background:
    linear-gradient(135deg, rgba(247, 189, 85, 0.09), rgba(88, 184, 255, 0.045)),
    rgba(8, 14, 23, 0.88);
}

.forum-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0 2px;
}

.forum-loading span {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(247, 189, 85, 0.24);
  border-top-color: var(--amber);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.forum-summary {
  margin-top: 8px;
  color: #d6e2ec;
  font-size: 13px;
  line-height: 1.65;
}

.forum-sentiment-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.forum-sentiment-row span {
  border: 1px solid rgba(156, 176, 196, 0.14);
  border-radius: 6px;
  background: rgba(8, 14, 23, 0.72);
  color: var(--muted);
  padding: 8px 9px;
  font-size: 12px;
}

.forum-sentiment-row b {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
}

.forum-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.forum-row {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(156, 176, 196, 0.12);
  border-radius: 6px;
  background: rgba(7, 13, 21, 0.74);
  padding: 9px 10px;
}

.forum-row:hover {
  border-color: rgba(247, 189, 85, 0.3);
  background: rgba(14, 22, 34, 0.9);
  text-decoration: none;
}

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

.forum-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1360px) {
  .app-header {
    grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 0.85fr) minmax(0, 1.2fr);
  }

  .header-side {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "search"
      "actions";
  }

  .user-bar {
    display: none;
  }

  .status-strip {
    top: 112px;
  }
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "actions";
    gap: 10px;
  }

  .view-switch {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    z-index: 55;
    width: auto;
    height: auto;
  }

  .header-side {
    display: contents;
  }

  .global-search {
    grid-area: search;
  }

  .header-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .header-actions .btn {
    min-width: 0;
    padding: 0 7px;
    font-size: 12px;
  }

  .status-strip,
  .review-toolbar {
    position: static;
  }

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

@media (max-width: 560px) {
  .brand p,
  .global-search span {
    display: none;
  }

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

  .header-actions .btn:nth-child(n + 4) {
    display: none;
  }

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

  .review-price-row,
  .review-score-grid,
  .baima-score-grid,
  .forum-sentiment-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forum-row strong {
    font-size: 12px;
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(88, 184, 255, 0.09) 0 1px, transparent 1px 34px),
    linear-gradient(45deg, rgba(53, 213, 168, 0.055) 0 1px, transparent 1px 46px),
    linear-gradient(180deg, #111827 0, #0b111a 360px, var(--bg) 100%);
  color: var(--text);
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", Arial, sans-serif;
  letter-spacing: 0;
}

.honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.58;
}

a {
  color: var(--cyan);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 18px;
  padding: 16px 22px;
  background: rgba(6, 17, 23, 0.88);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.brand,
.auth-brand {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(69, 214, 255, 0.48);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(69, 214, 255, 0.1), rgba(66, 215, 181, 0.12));
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
}

.brand h1,
.auth-brand h1 {
  font-size: 20px;
  line-height: 1.15;
}

.brand p,
.auth-brand p,
.section-head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.header-side {
  display: flex;
  align-items: center;
  gap: 14px;
}

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

.view-switch {
  display: inline-grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 26, 34, 0.92);
}

.switch-btn,
.mini-tab {
  min-width: 92px;
  height: 34px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  padding: 0 14px;
}

.switch-btn.active,
.mini-tab.active {
  background: linear-gradient(135deg, rgba(69, 214, 255, 0.18), rgba(66, 215, 181, 0.16));
  color: var(--text);
}

.global-search {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.global-search input {
  width: 100%;
  height: 38px;
  border: 1px solid rgba(88, 184, 255, 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(88, 184, 255, 0.08), rgba(53, 213, 168, 0.05)),
    rgba(5, 14, 21, 0.92);
  color: var(--text);
  outline: none;
  padding: 0 12px;
}

.global-search input:focus {
  border-color: rgba(88, 184, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(88, 184, 255, 0.1);
}

.global-search span {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 12px;
  min-height: 16px;
}

.global-search .btn {
  min-width: 58px;
  height: 38px;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.user-chip {
  min-width: 148px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 25, 33, 0.86);
  padding: 8px 10px;
}

.user-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.btn {
  min-width: 74px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(18, 32, 41, 0.92);
  color: var(--text);
  padding: 0 12px;
}

.btn:hover {
  border-color: rgba(115, 154, 170, 0.46);
  background: rgba(22, 40, 50, 0.96);
}

.btn.primary {
  border-color: rgba(69, 214, 255, 0.4);
  background: linear-gradient(135deg, rgba(9, 117, 153, 0.96), rgba(15, 101, 92, 0.96));
}

.btn.primary:hover {
  background: linear-gradient(135deg, rgba(12, 139, 181, 0.96), rgba(19, 122, 110, 0.96));
}

.btn.ghost {
  background: transparent;
}

.layout {
  width: min(1680px, 100%);
  margin: 0 auto;
  padding: 16px 20px 42px;
}

.app-shell.locked {
  filter: blur(8px);
  pointer-events: none;
  user-select: none;
}

.workspace-view.hidden,
.hidden {
  display: none !important;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
}

.auth-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(10, 28, 38, 0.96), rgba(3, 8, 12, 0.92)),
    repeating-linear-gradient(90deg, rgba(69, 214, 255, 0.05) 0 1px, transparent 1px 72px),
    repeating-linear-gradient(0deg, rgba(69, 214, 255, 0.04) 0 1px, transparent 1px 72px);
  backdrop-filter: blur(16px);
}

.auth-panel {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(360px, 0.9fr) minmax(420px, 1fr);
  gap: 0;
  width: min(1180px, 100%);
  min-height: 620px;
  overflow: hidden;
  border: 1px solid rgba(69, 214, 255, 0.24);
  border-radius: 8px;
  background: rgba(7, 16, 22, 0.98);
  box-shadow: 0 36px 80px rgba(0, 0, 0, 0.45);
}

.auth-copy,
.auth-box {
  min-width: 0;
  padding: 34px;
}

.auth-copy {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border-right: 1px solid rgba(115, 154, 170, 0.18);
  background:
    linear-gradient(180deg, rgba(12, 33, 45, 0.92), rgba(8, 19, 27, 0.96)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 24px);
}

.auth-box {
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: rgba(6, 16, 22, 0.94);
}

.auth-mark {
  width: 58px;
  height: 58px;
  font-size: 17px;
  border-color: rgba(69, 214, 255, 0.62);
  background: linear-gradient(135deg, rgba(69, 214, 255, 0.16), rgba(66, 215, 181, 0.13));
}

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

.auth-brand h1 {
  margin-top: 6px;
  font-size: 32px;
}

.auth-brand p {
  max-width: 430px;
  margin-top: 10px;
  font-size: 14px;
  line-height: 1.8;
}

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

.auth-metrics div,
.auth-feature-list div,
.auth-security-strip {
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(5, 16, 22, 0.72);
}

.auth-metrics div {
  padding: 14px;
}

.auth-metrics strong {
  display: block;
  color: var(--amber);
  font-size: 25px;
  line-height: 1;
}

.auth-metrics span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.auth-feature-list {
  display: grid;
  gap: 10px;
}

.auth-feature-list div {
  padding: 14px 15px;
}

.auth-feature-list span {
  display: inline-flex;
  min-width: 34px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.auth-feature-list strong {
  color: var(--text);
  font-size: 15px;
}

.auth-feature-list p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.auth-security-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
  padding: 12px;
}

.auth-security-strip span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(69, 214, 255, 0.2);
  border-radius: 999px;
  background: rgba(69, 214, 255, 0.08);
  color: #b9ecfa;
  padding: 0 10px;
  font-size: 12px;
}

.auth-box-head {
  margin-bottom: 16px;
}

.auth-box-head h2 {
  margin-top: 6px;
  font-size: 24px;
}

.auth-box-head p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.auth-card {
  margin-top: 12px;
  border: 1px solid rgba(115, 154, 170, 0.2);
  border-radius: 8px;
  background: rgba(8, 19, 26, 0.82);
  padding: 16px;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
  margin-top: 14px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(4, 13, 18, 0.88);
  padding: 4px;
}

.auth-tab {
  width: 100%;
  height: 40px;
  border-radius: 6px;
}

.auth-submit {
  min-width: 160px;
}

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

.challenge-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 6px;
}

.field-help {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(11, 22, 29, 0.88);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.status-cell {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line);
}

.status-cell:last-child {
  border-right: 0;
}

.status-cell span,
.metric-label,
.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.status-cell strong {
  display: block;
  margin-top: 5px;
  color: var(--white);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notice {
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(245, 184, 75, 0.45);
  border-radius: 8px;
  background: rgba(91, 62, 11, 0.24);
  color: #ffd98a;
  font-size: 13px;
}

.notice.error {
  border-color: rgba(255, 107, 125, 0.44);
  background: rgba(83, 24, 34, 0.28);
  color: #ffd0d8;
}

.settings,
.panel,
.left-rail {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
}

.settings {
  margin-top: 12px;
  padding: 14px;
}

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

.field {
  min-width: 0;
}

.field.wide {
  grid-column: span 2;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(6, 16, 22, 0.98);
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

.field input,
.field select {
  height: 36px;
}

.field textarea {
  min-height: 82px;
  padding: 10px;
  resize: vertical;
  font-family: Consolas, "Microsoft YaHei", monospace;
  font-size: 12px;
}

.settings-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.settings-actions.wrap {
  flex-wrap: wrap;
}

.hero-band,
.market-hero {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
}

.hero-copy,
.market-hero-main,
.overlap-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(69, 214, 255, 0.07), rgba(66, 215, 181, 0.05)),
    var(--panel-strong);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.hero-copy h2,
.market-hero-main h2 {
  margin-top: 8px;
  font-size: 24px;
  line-height: 1.3;
}

.hero-copy p,
.market-hero-main p {
  margin-top: 10px;
  color: #c5d9e4;
  line-height: 1.7;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border: 1px solid rgba(69, 214, 255, 0.26);
  border-radius: 999px;
  background: rgba(69, 214, 255, 0.08);
  color: var(--cyan);
  padding: 0 10px;
  font-size: 12px;
}

.market-overlap {
  display: grid;
}

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

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

.market-kpi-grid {
  margin-top: 12px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.kpi {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(9, 20, 27, 0.94);
}

.kpi strong {
  display: block;
  margin-top: 8px;
  font-size: 22px;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi small {
  display: block;
  margin-top: 6px;
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1.45;
}

.insight-grid,
.market-lower-grid {
  display: grid;
  grid-template-columns: minmax(320px, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-top: 12px;
}

.market-lower-grid {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr) minmax(280px, 0.85fr);
}

.workspace-grid {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 12px;
  margin-top: 12px;
  align-items: start;
}

.left-rail {
  position: sticky;
  top: 88px;
  padding: 12px;
  max-height: calc(100vh - 104px);
  overflow: auto;
}

.main-stack {
  display: grid;
  gap: 12px;
}

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

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

.section-head.compact {
  align-items: center;
}

.section-head h2,
.sub-head strong {
  font-size: 16px;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(8, 18, 24, 0.98);
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
  white-space: nowrap;
}

.tag.green,
.tag.hot {
  color: var(--text);
}

.tag.hot {
  border-color: rgba(255, 107, 125, 0.28);
  background: rgba(255, 107, 125, 0.16);
}

.tag.warm {
  border-color: rgba(245, 184, 75, 0.28);
  background: rgba(245, 184, 75, 0.16);
  color: #ffd98a;
}

.tag.signal {
  border-color: rgba(69, 214, 255, 0.28);
  background: rgba(69, 214, 255, 0.12);
  color: #a8edff;
}

.tab-row {
  display: inline-flex;
  gap: 8px;
}

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

.expert-card {
  width: 100%;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(10, 21, 28, 0.95);
  color: var(--text);
  padding: 10px;
  text-align: left;
}

.expert-card.active,
.expert-card:hover {
  border-color: rgba(69, 214, 255, 0.42);
  background: rgba(15, 33, 42, 0.96);
}

.expert-card strong {
  display: block;
  font-size: 14px;
}

.expert-meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 9px;
}

.expert-meta span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
}

.split-grid,
.detail-grid,
.market-grid {
  display: grid;
  gap: 12px;
}

.split-grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, 0.92fr);
}

.detail-grid {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}

.market-grid {
  margin-top: 12px;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.inline-gap {
  margin-top: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(8, 18, 24, 0.98);
  color: var(--muted);
  font-weight: 600;
}

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

tr.row-active,
tr:hover {
  background: rgba(69, 214, 255, 0.04);
}

.stock-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.stock-link.compact {
  gap: 6px;
}

.stock-code {
  color: var(--cyan);
}

.stock-name {
  color: var(--text);
  font-weight: 500;
}

.analysis-list,
.theme-list,
.alert-list,
.stack-items {
  display: grid;
  gap: 8px;
}

.analysis-list {
  max-height: 540px;
  overflow: auto;
  padding-right: 2px;
}

.analysis-item,
.theme-item,
.alert-item,
.stack-item {
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(9, 20, 27, 0.94);
  padding: 10px;
}

.analysis-top,
.alert-top,
.stack-main,
.summary-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.ma-grid,
.price-line {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.ma-box {
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 6px;
  background: rgba(6, 17, 23, 0.95);
  padding: 7px 8px;
}

.ma-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.ma-box strong {
  display: block;
  margin-top: 4px;
  font-size: 13px;
}

.opinion,
.alert-item p,
.stack-item p,
.summary-card p {
  margin-top: 9px;
  color: #c5d9e4;
  font-size: 12px;
  line-height: 1.7;
}

.stock-detail {
  min-height: 280px;
}

.detail-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.sparkline {
  width: 100%;
  height: 180px;
  margin-top: 12px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(6, 17, 23, 0.95);
}

.sample-list {
  display: grid;
  gap: 7px;
  margin-top: 12px;
}

.sample-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 96px 92px 80px;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 6px;
  background: rgba(9, 20, 27, 0.94);
  padding: 8px;
  font-size: 12px;
}

.market-briefing {
  min-height: 72px;
}

.overlap-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  border: 1px solid rgba(115, 154, 170, 0.2);
  border-radius: 999px;
  background: rgba(10, 22, 29, 0.95);
  color: var(--text);
  padding: 0 12px;
}

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

.leader-chip {
  height: 32px;
}

.board-cell {
  display: grid;
  gap: 4px;
}

.board-cell small {
  color: var(--muted);
  font-size: 11px;
}

.trend-cell {
  display: grid;
  gap: 4px;
  min-width: 94px;
}

.trend-cell small {
  color: var(--muted);
  font-size: 11px;
}

.tag.trend-up {
  border-color: rgba(255, 107, 125, 0.3);
  background: rgba(255, 107, 125, 0.14);
  color: #ffd8de;
}

.tag.trend-down {
  border-color: rgba(72, 205, 169, 0.3);
  background: rgba(72, 205, 169, 0.14);
  color: #a8f1d4;
}

.tag.trend-flat {
  border-color: rgba(115, 154, 170, 0.24);
  background: rgba(115, 154, 170, 0.12);
  color: #d6e2e8;
}

.tag.trend-new {
  border-color: rgba(69, 214, 255, 0.32);
  background: rgba(69, 214, 255, 0.14);
  color: #aeeeff;
}

.summary-card {
  margin-bottom: 12px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(9, 20, 27, 0.94);
  padding: 12px;
}

.summary-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
}

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

.critical {
  border-color: rgba(255, 107, 125, 0.3);
}

.market-news-panel,
.news-block {
  display: grid;
  gap: 12px;
}

.news-meta-strip,
.news-card-grid {
  display: grid;
  gap: 10px;
}

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

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

.news-meta-card,
.news-card {
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(9, 20, 27, 0.94);
  padding: 10px;
}

.news-meta-card strong {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.5;
}

.news-meta-card.wide {
  grid-column: span 1;
}

.chip-wrap.compact {
  margin-top: 8px;
  gap: 6px;
}

.chip-inline {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 999px;
  background: rgba(6, 17, 23, 0.95);
  padding: 0 10px;
  color: var(--text);
  font-size: 12px;
}

.chip-inline strong {
  font-size: 12px;
}

.chip-inline.muted {
  color: var(--muted);
}

.review-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 0.72fr);
  gap: 12px;
  align-items: stretch;
}

.review-hero-main,
.holding-form,
.review-toolbar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(12, 28, 38, 0.96), rgba(9, 20, 27, 0.96));
  box-shadow: var(--shadow-soft);
}

.review-hero-main {
  padding: 22px;
}

.review-hero-main h2 {
  margin-top: 8px;
  max-width: 880px;
  font-size: 30px;
  line-height: 1.24;
}

.review-hero-main p {
  margin-top: 12px;
  color: #c5d9e4;
  line-height: 1.75;
}

.holding-form {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
}

.holding-form .btn {
  grid-column: 1 / -1;
}

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

.review-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.review-group-explorer {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

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

.group-explorer-head h3 {
  margin: 0;
  font-size: 18px;
}

.group-explorer-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.holding-group-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.holding-group-card {
  min-width: 0;
  border: 1px solid rgba(156, 176, 196, 0.18);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(25, 34, 48, 0.94), rgba(12, 19, 30, 0.96));
  padding: 12px;
}

.holding-group-card.active {
  border-color: rgba(88, 184, 255, 0.48);
  box-shadow: 0 0 0 1px rgba(88, 184, 255, 0.12), 0 18px 42px rgba(0, 0, 0, 0.24);
}

.holding-group-card.pinned {
  border-color: rgba(247, 189, 85, 0.42);
}

.holding-group-card.pinned .holding-group-trigger strong::before {
  content: "置顶 ";
  color: var(--amber);
  font-size: 12px;
  font-weight: 700;
}

.holding-group-trigger {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0;
  text-align: left;
}

.holding-group-trigger span {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border: 1px solid rgba(88, 184, 255, 0.24);
  border-radius: 999px;
  color: var(--cyan);
  padding: 0 8px;
  font-size: 12px;
}

.holding-group-trigger strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
}

.holding-group-trigger em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.pin-btn {
  flex: 0 0 auto;
  min-width: 76px;
}

.pin-btn.active {
  border-color: rgba(247, 189, 85, 0.42);
  color: var(--amber);
}

.holding-group-preview,
.holding-group-stocks {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(156, 176, 196, 0.14);
}

.holding-group-preview strong {
  color: var(--text);
  font-size: 13px;
}

.holding-group-preview span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.holding-manager {
  margin-top: 12px;
}

.review-secondary-panel {
  background:
    linear-gradient(180deg, rgba(17, 24, 36, 0.9), rgba(11, 18, 28, 0.92));
}

.holding-panel-body {
  margin-top: 12px;
}

.holding-group-toolbar {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(7, 18, 24, 0.72);
}

.group-builder {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.group-builder input {
  width: 100%;
}

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

.group-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 999px;
  background: rgba(4, 13, 18, 0.78);
  color: var(--text);
  padding: 0 12px;
}

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

.group-chip.active {
  border-color: rgba(88, 184, 255, 0.42);
  background: linear-gradient(135deg, rgba(47, 125, 255, 0.2), rgba(53, 213, 168, 0.12));
}

.group-hint {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.bulk-import-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(7, 18, 24, 0.78);
}

.bulk-import-copy {
  display: grid;
  gap: 6px;
}

.bulk-import-copy strong {
  font-size: 14px;
}

.bulk-import-copy p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.bulk-import-panel textarea {
  width: 100%;
  min-height: 144px;
  resize: vertical;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: rgba(4, 13, 18, 0.9);
  color: var(--text);
  padding: 12px;
}

.bulk-import-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.holding-manager-body {
  margin-top: 12px;
}

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

.holding-group {
  display: grid;
  gap: 8px;
}

.holding-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.holding-group-head strong {
  font-size: 14px;
}

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

.holding-empty {
  display: grid;
  gap: 6px;
  min-height: 92px;
  place-content: center;
  border: 1px dashed rgba(115, 154, 170, 0.28);
  border-radius: 8px;
  background: rgba(6, 17, 23, 0.58);
  color: var(--muted);
  text-align: center;
}

.holding-empty strong {
  color: var(--text);
  font-size: 15px;
}

.holding-manager-list {
  display: grid;
  gap: 8px;
}

.holding-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(115, 154, 170, 0.18);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(9, 22, 30, 0.94), rgba(6, 17, 23, 0.92));
  padding: 10px;
}

.holding-stock-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  min-width: 0;
}

.holding-stock-title strong {
  font-size: 16px;
}

.holding-stock-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.holding-mini-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 8px;
}

.holding-mini-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid rgba(115, 154, 170, 0.15);
  border-radius: 999px;
  background: rgba(4, 13, 18, 0.78);
  color: var(--muted);
  padding: 0 9px;
  font-size: 12px;
}

.holding-mini-tags span.red {
  color: var(--red);
}

.holding-mini-tags span.green {
  color: var(--green);
}

.holding-row-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

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

.review-card {
  position: relative;
  overflow: hidden;
  min-width: 0;
  border: 1px solid rgba(115, 154, 170, 0.2);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(20, 34, 49, 0.96), rgba(9, 19, 28, 0.98));
  padding: 14px;
}

.review-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--cyan), var(--teal));
  opacity: 0.75;
}

.review-card.score-strong::before {
  background: linear-gradient(90deg, var(--red), var(--amber));
}

.review-card.score-weak::before {
  background: linear-gradient(90deg, var(--muted-2), var(--line-strong));
}

.review-card-deferred {
  min-height: 0;
  background:
    linear-gradient(135deg, rgba(20, 38, 50, 0.9), rgba(9, 19, 28, 0.94));
}

.review-card-deferred::after {
  content: "已缓存，滚回附近自动展开";
  position: absolute;
  right: 14px;
  bottom: 10px;
  color: var(--muted);
  font-size: 12px;
  pointer-events: none;
}

.review-price-row.compact {
  margin-bottom: 22px;
}

.market-stock-action-cell {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.market-stock-ai-trigger {
  border: 1px solid rgba(69, 214, 255, 0.28);
  border-radius: 6px;
  background: rgba(69, 214, 255, 0.08);
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
  padding: 7px 9px;
  cursor: pointer;
}

.market-stock-ai-trigger:hover {
  background: rgba(69, 214, 255, 0.16);
}

.market-stock-ai-trigger.compact {
  padding: 5px 7px;
  font-size: 11px;
}

.stock-monitor-btn {
  border: 1px solid rgba(255, 190, 92, 0.32);
  border-radius: 6px;
  background: rgba(255, 190, 92, 0.08);
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  padding: 8px 10px;
  cursor: pointer;
  white-space: nowrap;
}

.stock-monitor-btn:hover {
  background: rgba(255, 190, 92, 0.16);
}

.stock-monitor-btn.active {
  border-color: rgba(88, 216, 139, 0.45);
  background: rgba(88, 216, 139, 0.12);
  color: var(--green);
}

.stock-monitor-btn.compact {
  padding: 5px 7px;
  font-size: 11px;
}

.monitor-tag {
  border-color: rgba(88, 216, 139, 0.32);
  background: rgba(88, 216, 139, 0.1);
  color: var(--green);
}

.market-data-clock {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
}

.market-stock-ai-drawer {
  margin: 0 0 16px;
  padding: 16px;
  border: 1px solid rgba(69, 214, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(14, 28, 40, 0.96), rgba(9, 18, 27, 0.98));
  box-shadow: var(--shadow-soft);
}

.market-stock-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.market-stock-ai-head strong {
  display: block;
  margin-top: 4px;
  font-size: 22px;
}

.market-stock-ai-head p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.market-stock-ai-card .review-card {
  margin: 0;
}

.loading-state.slim.idle {
  background: rgba(255, 255, 255, 0.035);
}

.loading-state.slim.idle span {
  display: none;
}

.review-card-head,
.review-title,
.review-card-actions {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.review-card-head {
  justify-content: space-between;
}

.review-title {
  align-items: baseline;
  flex-wrap: wrap;
}

.review-title strong {
  font-size: 20px;
}

.review-title span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.review-score-ring {
  display: grid;
  place-items: center;
  flex: 0 0 92px;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(69, 214, 255, 0.28);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(69, 214, 255, 0.16), rgba(9, 20, 27, 0.9) 66%);
}

.review-score-ring strong {
  font-size: 28px;
  line-height: 1;
}

.review-score-ring span {
  color: var(--muted);
  font-size: 12px;
}

.review-price-row,
.review-score-grid {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.review-price-row {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.review-price-row div,
.review-score-box {
  min-width: 0;
  border: 1px solid rgba(115, 154, 170, 0.16);
  border-radius: 8px;
  background: rgba(6, 17, 23, 0.82);
  padding: 9px;
}

.review-price-row span,
.review-score-box span {
  display: block;
  color: var(--muted);
  font-size: 11px;
}

.review-price-row strong,
.review-score-box strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-reason {
  margin-top: 12px;
  border-left: 3px solid rgba(245, 184, 75, 0.7);
  background: rgba(245, 184, 75, 0.08);
  padding: 9px 10px;
  color: #e7d2a0;
  font-size: 13px;
  line-height: 1.65;
}

.review-ma-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.review-ma {
  min-width: 0;
  border: 1px solid rgba(115, 154, 170, 0.16);
  border-radius: 8px;
  background: rgba(10, 24, 32, 0.78);
  padding: 9px;
}

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

.review-ma strong {
  display: block;
  margin: 5px 0 3px;
  color: var(--text);
  font-size: 15px;
}

.review-ma.ok em {
  color: var(--red);
}

.review-ma.broken em {
  color: var(--green);
}

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

.review-context-grid article {
  min-width: 0;
  border: 1px solid rgba(69, 214, 255, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(8, 24, 34, 0.86), rgba(6, 17, 23, 0.86));
  padding: 10px;
}

.review-context-grid span {
  color: var(--muted);
  font-size: 12px;
}

.review-context-grid strong {
  display: inline-flex;
  margin-left: 8px;
  color: var(--amber);
  font-size: 18px;
}

.review-context-grid p {
  margin: 7px 0 0;
  color: #d2e1e8;
  font-size: 12px;
  line-height: 1.65;
}

.review-analysis-text {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.web-news-timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  border: 1px solid rgba(247, 189, 85, 0.2);
  border-radius: 8px;
  background: rgba(12, 20, 30, 0.72);
  padding: 10px;
}

.web-news-timeline.empty p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.web-news-row {
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(156, 176, 196, 0.12);
  border-radius: 7px;
  background: rgba(7, 14, 22, 0.68);
  color: var(--text);
}

.web-news-row:hover {
  border-color: rgba(88, 184, 255, 0.34);
  text-decoration: none;
}

.web-news-meta {
  color: var(--muted);
  font-size: 12px;
}

.web-news-meta b {
  margin-right: 6px;
}

.web-news-row strong {
  color: #e8f4ff;
  font-size: 13px;
  line-height: 1.45;
}

.web-news-row em {
  color: #9fb3c3;
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
}

.baima-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  border: 1px solid rgba(247, 189, 85, 0.28);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 189, 85, 0.1), rgba(88, 184, 255, 0.06)),
    rgba(8, 18, 27, 0.86);
  padding: 12px;
}

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

.baima-head span {
  display: block;
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

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

.baima-head b {
  display: grid;
  place-items: center;
  flex: 0 0 58px;
  width: 58px;
  height: 58px;
  border: 1px solid rgba(247, 189, 85, 0.34);
  border-radius: 50%;
  background: rgba(7, 16, 22, 0.82);
  font-size: 22px;
}

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

.baima-score-grid article {
  min-width: 0;
  border: 1px solid rgba(156, 176, 196, 0.14);
  border-radius: 7px;
  background: rgba(6, 16, 24, 0.72);
  padding: 9px;
}

.baima-score-grid article.strong {
  border-color: rgba(255, 111, 145, 0.28);
}

.baima-score-grid article.watch {
  border-color: rgba(247, 189, 85, 0.26);
}

.baima-score-grid article.weak {
  border-color: rgba(40, 209, 124, 0.2);
}

.baima-score-grid span {
  color: var(--muted);
  font-size: 11px;
}

.baima-score-grid strong {
  display: block;
  margin-top: 5px;
  color: var(--amber);
  font-size: 18px;
}

.baima-score-grid p {
  margin-top: 5px;
  color: #aebdca;
  font-size: 11px;
  line-height: 1.45;
}

.baima-notes {
  display: grid;
  gap: 7px;
  border-top: 1px solid rgba(156, 176, 196, 0.14);
  padding-top: 10px;
}

.baima-notes p {
  margin: 0;
  color: #d2e1e8;
  font-size: 12px;
  line-height: 1.65;
}

.baima-notes b {
  display: inline-block;
  min-width: 72px;
  margin-right: 8px;
  color: var(--cyan);
}

.review-analysis-text p {
  margin: 0;
  color: #c5d9e4;
  font-size: 13px;
  line-height: 1.7;
}

.review-analysis-text b {
  display: inline-block;
  margin-right: 8px;
  color: var(--cyan);
}

.review-card-actions {
  flex-wrap: wrap;
  margin-top: 14px;
}

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

.score-watch {
  color: var(--amber);
}

.score-neutral {
  color: var(--cyan);
}

.score-weak {
  color: var(--muted);
}

.empty-state {
  display: grid;
  place-items: center;
  min-height: 160px;
  border: 1px dashed rgba(115, 154, 170, 0.28);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state.slim {
  min-height: 88px;
}

.loading-state {
  display: grid;
  place-items: center;
  gap: 8px;
  min-height: 180px;
  border: 1px dashed rgba(69, 214, 255, 0.28);
  border-radius: 8px;
  background: linear-gradient(135deg, rgba(7, 20, 28, 0.92), rgba(5, 15, 21, 0.92));
  color: var(--muted);
  text-align: center;
  padding: 18px;
}

.loading-state.slim {
  min-height: 96px;
}

.loading-state span {
  width: 30px;
  height: 30px;
  border: 2px solid rgba(69, 214, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.loading-state strong {
  color: var(--text);
  font-size: 15px;
}

.loading-state p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

.inline-loading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  min-height: 34px;
}

.inline-loading span {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(69, 214, 255, 0.18);
  border-top-color: var(--cyan);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

.review-stock-grid > .loading-state {
  grid-column: 1 / -1;
}

.competition-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 18px;
  padding: 22px;
  border: 1px solid rgba(88, 184, 255, 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(88, 184, 255, 0.14), rgba(53, 213, 168, 0.08)),
    rgba(14, 25, 35, 0.9);
  box-shadow: var(--shadow-soft);
}

.competition-hero-main h2 {
  margin-top: 8px;
  max-width: 920px;
  font-size: 28px;
  line-height: 1.22;
}

.competition-hero-main p {
  margin-top: 10px;
  max-width: 900px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.competition-actions,
.competition-card-head,
.competition-mini-metrics,
.competition-reasons,
.competition-position-list span,
.trade-tape-row {
  display: flex;
  align-items: center;
}

.competition-actions {
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.competition-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(420px, 0.85fr);
  gap: 18px;
  margin-top: 18px;
}

.competition-grid.lower {
  grid-template-columns: minmax(0, 1fr) minmax(420px, 0.9fr);
}

.competition-realtime-panel {
  grid-column: 1 / -1;
  border-color: rgba(53, 213, 168, 0.28);
  background:
    linear-gradient(135deg, rgba(53, 213, 168, 0.08), rgba(88, 184, 255, 0.06)),
    var(--panel);
}

.competition-candidates {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.competition-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(27, 44, 59, 0.94), rgba(16, 27, 38, 0.96));
  padding: 14px;
}

.competition-card-head {
  justify-content: space-between;
  gap: 12px;
}

.competition-card-head h3 {
  margin-top: 8px;
  font-size: 17px;
}

.competition-card-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}

.rank-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: 6px;
  background: rgba(247, 189, 85, 0.14);
  color: var(--amber);
  font-size: 12px;
  font-weight: 800;
}

.competition-return-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.competition-return-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(8, 17, 26, 0.56);
  padding: 9px;
}

.competition-return-grid span,
.competition-mini-metrics span,
.competition-position-list em,
.trade-tape-row span {
  color: var(--muted);
  font-size: 12px;
}

.competition-return-grid strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.competition-reasons {
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.competition-reasons b {
  border: 1px solid rgba(88, 184, 255, 0.22);
  border-radius: 6px;
  background: rgba(88, 184, 255, 0.08);
  color: #cfeeff;
  padding: 5px 7px;
  font-size: 12px;
}

.competition-mini-metrics {
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.competition-mini-metrics span {
  border-radius: 6px;
  background: rgba(53, 213, 168, 0.08);
  padding: 6px 8px;
}

.competition-position-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.competition-position-list span {
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

.competition-position-list em {
  font-style: normal;
  white-space: nowrap;
}

.competition-trade-tape {
  display: grid;
  gap: 8px;
  max-height: 620px;
  overflow: auto;
  padding-right: 3px;
}

.trade-tape-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.9fr) minmax(130px, 1fr) minmax(150px, 1fr) auto;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(10, 20, 30, 0.72);
}

.trade-tape-row.new-trade {
  border-color: rgba(53, 213, 168, 0.48);
  background: linear-gradient(135deg, rgba(53, 213, 168, 0.16), rgba(10, 20, 30, 0.76));
}

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

.realtime-summary div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 17, 26, 0.54);
  padding: 10px;
}

.realtime-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.realtime-summary strong {
  display: block;
  margin-top: 5px;
  font-size: 15px;
}

.trade-tape-row div {
  min-width: 0;
}

.trade-tape-row strong,
.trade-tape-row b,
.trade-tape-row span {
  display: block;
}

.trade-tape-row em {
  color: var(--amber);
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.competition-leaderboards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.leaderboard-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(12, 24, 34, 0.74);
  padding: 12px;
}

.leaderboard-card h3 {
  margin-bottom: 8px;
  font-size: 15px;
}

.leaderboard-card div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 0;
  border-top: 1px solid rgba(156, 176, 196, 0.12);
  color: var(--muted);
  font-size: 12px;
}

.leaderboard-card strong {
  color: var(--red);
  white-space: nowrap;
}

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

.red {
  color: var(--red);
}

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

.amber {
  color: var(--amber);
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  max-width: min(440px, calc(100vw - 36px));
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: rgba(6, 17, 23, 0.98);
  color: var(--text);
  box-shadow: var(--shadow);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.6;
}

.toast.error {
  border-color: rgba(255, 107, 125, 0.4);
}

/* Visual refresh: richer finance palette with clearer hierarchy. */
.app-header {
  background:
    linear-gradient(180deg, rgba(13, 19, 29, 0.95), rgba(9, 14, 22, 0.92)),
    linear-gradient(90deg, rgba(47, 125, 255, 0.1), rgba(53, 213, 168, 0.06), rgba(247, 189, 85, 0.05));
  border-bottom-color: rgba(88, 184, 255, 0.2);
}

.brand-mark {
  border-color: rgba(88, 184, 255, 0.58);
  background:
    linear-gradient(135deg, rgba(47, 125, 255, 0.22), rgba(53, 213, 168, 0.14)),
    rgba(10, 17, 27, 0.96);
  color: #dff3ff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04), 0 10px 24px rgba(47, 125, 255, 0.16);
}

.view-switch,
.auth-tabs {
  background: rgba(10, 16, 25, 0.84);
  border-color: rgba(156, 176, 196, 0.2);
}

.switch-btn.active,
.mini-tab.active,
.auth-tab.active {
  background: linear-gradient(135deg, rgba(47, 125, 255, 0.34), rgba(53, 213, 168, 0.2));
  color: #ffffff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.btn {
  border-color: rgba(156, 176, 196, 0.22);
  background: linear-gradient(180deg, rgba(31, 42, 56, 0.96), rgba(19, 27, 39, 0.96));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.btn:hover {
  border-color: rgba(88, 184, 255, 0.46);
  background: linear-gradient(180deg, rgba(39, 52, 68, 0.98), rgba(22, 32, 46, 0.98));
}

.btn.primary {
  border-color: rgba(88, 184, 255, 0.56);
  background: linear-gradient(135deg, #1f6fff, #179fbd 54%, #1aa781);
  box-shadow: 0 10px 28px rgba(47, 125, 255, 0.18);
}

.btn.primary:hover {
  background: linear-gradient(135deg, #347fff, #20aec8 54%, #26b98f);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.025);
}

.status-strip,
.settings,
.panel,
.left-rail,
.review-toolbar,
.holding-form {
  background:
    linear-gradient(180deg, rgba(25, 34, 48, 0.94), rgba(15, 22, 33, 0.94));
  border-color: rgba(156, 176, 196, 0.2);
}

.status-cell {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
}

.hero-copy,
.market-hero-main,
.review-hero-main,
.overlap-card {
  background:
    linear-gradient(135deg, rgba(47, 125, 255, 0.13), rgba(53, 213, 168, 0.07) 46%, rgba(247, 189, 85, 0.055)),
    linear-gradient(180deg, rgba(26, 36, 52, 0.98), rgba(14, 22, 34, 0.98));
  border-color: rgba(88, 184, 255, 0.22);
}

.eyebrow {
  border-color: rgba(88, 184, 255, 0.34);
  background: rgba(47, 125, 255, 0.13);
  color: #bfe6ff;
}

.kpi,
.analysis-item,
.theme-item,
.alert-item,
.stack-item,
.summary-card,
.news-meta-card,
.news-card,
.expert-card,
.holding-row {
  background:
    linear-gradient(180deg, rgba(30, 40, 54, 0.95), rgba(14, 21, 32, 0.96));
  border-color: rgba(156, 176, 196, 0.18);
}

.kpi:nth-child(4n + 1),
.news-meta-card:nth-child(4n + 1) {
  border-color: rgba(88, 184, 255, 0.26);
}

.kpi:nth-child(4n + 2),
.news-meta-card:nth-child(4n + 2) {
  border-color: rgba(53, 213, 168, 0.24);
}

.kpi:nth-child(4n + 3),
.news-meta-card:nth-child(4n + 3) {
  border-color: rgba(247, 189, 85, 0.24);
}

.kpi:nth-child(4n),
.news-meta-card:nth-child(4n) {
  border-color: rgba(155, 140, 255, 0.24);
}

.expert-card.active,
.expert-card:hover,
tr.row-active,
tr:hover {
  background: linear-gradient(90deg, rgba(47, 125, 255, 0.12), rgba(53, 213, 168, 0.045));
}

.field input,
.field select,
.field textarea,
th {
  background: rgba(8, 13, 21, 0.94);
  border-color: rgba(156, 176, 196, 0.22);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(88, 184, 255, 0.72);
  box-shadow: 0 0 0 3px rgba(88, 184, 255, 0.12);
}

.table-wrap,
.sparkline {
  border-color: rgba(156, 176, 196, 0.2);
  background: rgba(8, 13, 21, 0.7);
}

.pill,
.tag,
.chip-btn,
.chip-inline,
.holding-mini-tags span {
  background: rgba(18, 26, 38, 0.86);
  border-color: rgba(156, 176, 196, 0.2);
}

.tag.hot,
.tag.trend-up {
  border-color: rgba(255, 111, 145, 0.34);
  background: rgba(255, 111, 145, 0.14);
}

.tag.warm {
  border-color: rgba(247, 189, 85, 0.36);
  background: rgba(247, 189, 85, 0.15);
}

.tag.signal,
.tag.trend-new {
  border-color: rgba(88, 184, 255, 0.34);
  background: rgba(88, 184, 255, 0.14);
}

.tag.trend-down,
.tag.green {
  border-color: rgba(53, 213, 168, 0.34);
  background: rgba(53, 213, 168, 0.13);
}

.review-card {
  background:
    linear-gradient(180deg, rgba(32, 42, 58, 0.98), rgba(13, 20, 31, 0.99));
  border-color: rgba(156, 176, 196, 0.2);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.22);
}

.review-card::before {
  height: 4px;
  background: linear-gradient(90deg, var(--blue), var(--teal), var(--amber));
}

.review-card.score-strong::before {
  background: linear-gradient(90deg, var(--red), var(--coral), var(--amber));
}

.review-score-ring {
  border-color: rgba(88, 184, 255, 0.28);
  background:
    linear-gradient(180deg, rgba(47, 125, 255, 0.18), rgba(53, 213, 168, 0.08)),
    rgba(9, 15, 24, 0.92);
}

.review-price-row div,
.review-score-box,
.review-ma,
.ma-box,
.review-context-grid article {
  background: rgba(8, 14, 23, 0.78);
  border-color: rgba(156, 176, 196, 0.16);
}

.review-reason,
.notice {
  border-color: rgba(247, 189, 85, 0.38);
  background: rgba(247, 189, 85, 0.1);
}

.loading-state,
.empty-state,
.holding-empty {
  background:
    linear-gradient(135deg, rgba(47, 125, 255, 0.08), rgba(53, 213, 168, 0.045)),
    rgba(10, 16, 25, 0.72);
}

.auth-backdrop {
  background:
    linear-gradient(135deg, rgba(18, 28, 44, 0.97), rgba(6, 9, 15, 0.95)),
    repeating-linear-gradient(90deg, rgba(88, 184, 255, 0.045) 0 1px, transparent 1px 76px),
    repeating-linear-gradient(0deg, rgba(53, 213, 168, 0.034) 0 1px, transparent 1px 76px);
}

.auth-panel {
  border-color: rgba(88, 184, 255, 0.25);
  background: rgba(8, 13, 21, 0.98);
}

.auth-copy {
  background:
    linear-gradient(180deg, rgba(25, 38, 58, 0.94), rgba(11, 17, 28, 0.97)),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.032) 0 1px, transparent 1px 26px);
}

.auth-box {
  background: linear-gradient(180deg, rgba(13, 20, 31, 0.97), rgba(8, 13, 21, 0.96));
}

@media (max-width: 1280px) {
  .hero-band,
  .market-hero,
  .review-hero,
  .insight-grid,
  .market-grid,
  .market-lower-grid,
  .workspace-grid,
  .split-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .left-rail {
    position: static;
    max-height: none;
  }

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

  .news-meta-strip,
  .news-card-grid {
    grid-template-columns: 1fr;
  }

  .app-header {
    grid-template-columns: 1fr;
  }

  .header-side {
    justify-content: space-between;
  }

}

@media (max-width: 980px) {
  .auth-panel {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .auth-copy {
    border-right: 0;
    border-bottom: 1px solid rgba(115, 154, 170, 0.18);
  }

  .auth-security-strip {
    margin-top: 0;
  }
}

@media (max-width: 820px) {
  .layout {
    padding: 12px;
  }

  .app-header {
    gap: 12px;
    padding: 12px;
  }

  .header-side,
  .user-bar,
  .header-actions,
  .section-head,
  .sub-head,
  .detail-title,
  .summary-top,
  .review-toolbar,
  .review-card-head {
    flex-direction: column;
    align-items: stretch;
  }

  .header-actions {
    justify-content: start;
  }

  .status-strip,
  .settings-grid,
  .kpi-grid,
  .market-kpi-grid,
  .price-line,
  .auth-grid,
  .news-meta-strip,
  .news-card-grid,
  .review-hero,
  .review-summary-grid,
  .review-stock-grid,
  .holding-form,
  .group-builder {
    grid-template-columns: 1fr;
  }

  .field.wide {
    grid-column: span 1;
  }

  .sample-row {
    grid-template-columns: 1fr 1fr;
  }

  .auth-overlay {
    padding: 12px;
    align-items: start;
    overflow: auto;
  }

  .auth-panel {
    width: 100%;
    padding: 14px;
    min-height: 0;
  }

  .auth-copy,
  .auth-box {
    padding: 20px;
  }

  .auth-copy {
    border-right: 0;
    border-bottom: 1px solid rgba(115, 154, 170, 0.18);
  }

  .auth-security-strip {
    margin-top: 0;
  }
}

@media (max-width: 640px) {
  body {
    background: var(--bg);
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    font-size: 12px;
  }

  .brand h1,
  .auth-brand h1 {
    font-size: 18px;
  }

  .auth-brand {
    align-items: center;
  }

  .auth-brand p {
    font-size: 12px;
  }

  .auth-mark {
    width: 46px;
    height: 46px;
    font-size: 13px;
  }

  .auth-metrics {
    grid-template-columns: 1fr;
  }

  .auth-copy,
  .auth-box {
    padding: 14px;
  }

  .auth-card {
    padding: 12px;
  }

  .brand p {
    display: none;
  }

  .view-switch {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .switch-btn,
  .mini-tab,
  .btn {
    min-width: 0;
    font-size: 13px;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
  }

  .user-bar {
    width: 100%;
  }

  .hero-copy,
  .market-hero-main,
  .competition-hero-main,
  .overlap-card,
  .panel,
  .settings,
  .left-rail,
  .kpi {
    padding: 12px;
  }

  .hero-copy h2,
  .market-hero-main h2,
  .competition-hero-main h2,
  .review-hero-main h2 {
    font-size: 20px;
  }

  .competition-hero,
  .competition-grid,
  .competition-grid.lower,
  .competition-leaderboards {
    grid-template-columns: 1fr;
  }

  .competition-hero {
    padding: 12px;
    align-items: stretch;
  }

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

  .competition-actions .btn {
    flex: 1 1 130px;
  }

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

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

  .competition-position-list span,
  .trade-tape-row {
    align-items: stretch;
  }

  .competition-position-list span {
    flex-direction: column;
  }

  .competition-position-list em {
    white-space: normal;
  }

  .trade-tape-row {
    grid-template-columns: 1fr;
  }

  .kpi strong {
    font-size: 20px;
  }

  .expert-list {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
    scroll-snap-type: x proximity;
  }

  .expert-card {
    flex: 0 0 232px;
    scroll-snap-align: start;
  }

  .review-price-row,
  .review-score-grid,
  .review-ma-grid,
  .review-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .review-score-ring {
    width: 78px;
    height: 78px;
  }

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

  .holding-row {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .holding-row-actions {
    justify-content: stretch;
  }

  .holding-row-actions .btn {
    flex: 1 1 88px;
  }

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

  .analysis-list {
    max-height: none;
  }

  .table-wrap {
    overflow: visible;
    border: 0;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-bottom: 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(9, 20, 27, 0.94);
    overflow: hidden;
  }

  td {
    display: grid;
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    min-height: 38px;
    border-bottom: 1px solid var(--line);
    white-space: normal;
    word-break: break-word;
  }

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

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 12px;
  }

  td[colspan] {
    display: block;
    color: var(--muted);
  }

  td[colspan]::before {
    content: "";
    display: none;
  }

  .stock-link {
    align-items: start;
    flex-direction: column;
    gap: 2px;
  }

  .sample-row {
    grid-template-columns: 1fr;
  }

  .summary-metrics {
    justify-content: start;
  }

  .auth-tabs {
    width: 100%;
  }
}

/* Product-design pass: professional terminal layout + mobile-first ergonomics. */
body {
  background:
    linear-gradient(180deg, rgba(17, 25, 38, 0.96), rgba(8, 13, 20, 1) 420px),
    repeating-linear-gradient(90deg, rgba(88, 184, 255, 0.035) 0 1px, transparent 1px 64px);
}

.app-header {
  grid-template-columns: minmax(220px, 0.72fr) minmax(300px, 0.9fr) minmax(360px, 1fr);
  padding: 12px 20px;
}

.brand h1,
.auth-brand h1 {
  font-size: 18px;
}

.view-switch {
  width: 100%;
  max-width: 560px;
  justify-self: center;
}

.switch-btn,
.mini-tab,
.btn {
  min-height: 36px;
  white-space: nowrap;
}

.header-side {
  min-width: 0;
  justify-content: flex-end;
}

.header-actions {
  flex-wrap: nowrap;
}

.user-chip {
  min-width: 118px;
}

.layout {
  width: min(1760px, 100%);
  padding: 14px 20px 48px;
}

.status-strip {
  position: sticky;
  top: 67px;
  z-index: 20;
  backdrop-filter: blur(14px);
}

.status-cell {
  padding: 10px 14px;
}

.market-hero,
.review-hero {
  grid-template-columns: minmax(0, 1.25fr) minmax(360px, 0.75fr);
  gap: 14px;
}

.market-hero-main,
.review-hero-main,
.overlap-card {
  border-color: rgba(88, 184, 255, 0.28);
  background:
    linear-gradient(135deg, rgba(47, 125, 255, 0.15), rgba(53, 213, 168, 0.065) 52%, rgba(247, 189, 85, 0.05)),
    linear-gradient(180deg, rgba(25, 36, 52, 0.98), rgba(11, 18, 28, 0.98));
}

.market-hero-main h2,
.review-hero-main h2 {
  max-width: 1020px;
  font-size: 26px;
}

.market-grid {
  grid-template-columns: minmax(420px, 0.95fr) minmax(0, 1.05fr);
}

.market-lower-grid {
  grid-template-columns: minmax(360px, 1fr) minmax(300px, 0.82fr) minmax(300px, 0.82fr);
}

.panel,
.settings,
.kpi,
.review-card,
.holding-row,
.analysis-item,
.theme-item,
.stack-item,
.news-card,
.news-meta-card {
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.2);
}

.section-head {
  align-items: center;
}

.section-head h2,
.sub-head strong {
  font-size: 15px;
}

.section-head p {
  max-width: 760px;
}

.table-wrap {
  max-height: 620px;
  scrollbar-color: rgba(88, 184, 255, 0.32) rgba(8, 13, 21, 0.8);
}

th,
td {
  padding: 9px 10px;
}

tr[data-board-code],
tr[data-stock-row] {
  cursor: pointer;
}

.stock-link {
  max-width: 220px;
}

.stock-name,
.stock-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-toolbar {
  position: sticky;
  top: 126px;
  z-index: 18;
  backdrop-filter: blur(14px);
}

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

.review-card {
  padding: 16px;
  border-color: rgba(88, 184, 255, 0.22);
}

.review-card:hover {
  border-color: rgba(88, 184, 255, 0.42);
  transform: translateY(-1px);
  transition: border-color 160ms ease, transform 160ms ease;
}

.review-card-head {
  min-height: 96px;
}

.review-title strong {
  font-size: 22px;
}

.review-score-ring {
  flex-basis: 86px;
  width: 86px;
  height: 86px;
}

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

.review-price-row div {
  min-height: 64px;
}

.review-price-row strong,
.review-score-box strong,
.review-ma strong {
  font-variant-numeric: tabular-nums;
}

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

.review-analysis-text {
  border-top: 1px solid rgba(156, 176, 196, 0.14);
  padding-top: 12px;
}

.review-analysis-text p {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  gap: 8px;
}

.review-analysis-text b {
  margin-right: 0;
}

.review-card-actions {
  justify-content: flex-end;
}

.review-secondary-panel {
  border-style: dashed;
  opacity: 0.94;
}

.holding-form {
  align-content: start;
}

.holding-form .btn {
  height: 40px;
}

.toast {
  bottom: 22px;
}

@media (max-width: 1320px) {
  .app-header {
    grid-template-columns: 1fr;
  }

  .view-switch {
    justify-self: stretch;
    max-width: none;
  }

  .global-search {
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
  }

  .header-side {
    justify-content: space-between;
  }

  .header-actions {
    flex-wrap: wrap;
  }

  .status-strip {
    top: 155px;
  }

  .review-toolbar {
    top: 214px;
  }

  .market-grid,
  .market-lower-grid,
  .market-hero,
  .review-hero {
    grid-template-columns: 1fr;
  }

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

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

@media (max-width: 900px) {
  .app-header {
    position: sticky;
    gap: 10px;
    padding: 10px 12px;
  }

  .brand {
    min-height: 40px;
  }

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

  .brand h1 {
    font-size: 17px;
  }

  .view-switch {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 55;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 5px;
    border-color: rgba(88, 184, 255, 0.28);
    background: rgba(8, 13, 21, 0.94);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.38);
    backdrop-filter: blur(18px);
  }

  .switch-btn {
    height: 42px;
    font-size: 14px;
  }

  .header-side {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    justify-items: stretch;
    gap: 8px;
    width: 100%;
    justify-self: stretch;
  }

  .header-actions {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
    width: 100%;
    justify-self: stretch;
  }

  .header-actions .btn {
    height: 38px;
    padding: 0 8px;
    font-size: 12px;
  }

  .user-bar {
    display: none;
  }

  .layout {
    padding: 10px 10px 86px;
  }

  .status-strip,
  .review-toolbar {
    position: static;
  }

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

  .status-cell {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .status-cell:nth-child(odd) {
    border-right: 1px solid var(--line);
  }

  .status-cell:nth-last-child(-n + 2) {
    border-bottom: 0;
  }

  .market-hero,
  .review-hero {
    margin-top: 10px;
  }

  .market-hero-main,
  .review-hero-main,
  .overlap-card,
  .panel,
  .settings,
  .holding-form {
    padding: 12px;
  }

  .market-hero-main h2,
  .review-hero-main h2 {
    font-size: 20px;
    line-height: 1.35;
  }

  .market-hero-main p,
  .review-hero-main p {
    font-size: 13px;
    line-height: 1.65;
  }

  .market-kpi-grid,
  .review-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    min-height: 92px;
    padding: 12px;
  }

  .kpi strong {
    font-size: 20px;
  }

  .section-head,
  .group-explorer-head,
  .review-toolbar {
    align-items: stretch;
  }

  .group-explorer-head {
    flex-direction: column;
  }

  .holding-group-cards {
    grid-template-columns: 1fr;
  }

  .tab-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .tab-row .btn,
  .tab-row .mini-tab {
    width: 100%;
  }

  .review-card {
    padding: 13px;
  }

  .review-card-head {
    min-height: 0;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }

  .review-title strong {
    font-size: 19px;
  }

  .review-score-ring {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  .review-score-ring strong {
    font-size: 24px;
  }

  .review-price-row,
  .review-score-grid,
  .review-ma-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .review-analysis-text p {
    grid-template-columns: 58px minmax(0, 1fr);
    font-size: 12px;
  }

  .review-card-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  html {
    min-width: 0;
  }

  body {
    background: #080d14;
  }

  .app-header {
    padding: 9px 10px;
  }

  .brand p,
  #headerSubtitle {
    display: none;
  }

  .header-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-self: stretch;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    justify-content: stretch;
  }

  .header-actions .btn {
    min-width: 0;
    height: 36px;
    font-size: 12px;
  }

  .header-actions .btn:nth-child(n + 4) {
    grid-column: span 1;
  }

  .global-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .global-search input {
    height: 36px;
    font-size: 13px;
  }

  .global-search .btn {
    min-width: 54px;
    height: 36px;
    font-size: 12px;
  }

  .status-strip {
    grid-template-columns: 1fr 1fr;
    border-radius: 7px;
  }

  .status-cell {
    padding: 9px 10px;
  }

  .market-kpi-grid,
  .review-summary-grid {
    gap: 8px;
  }

  .kpi {
    min-height: 86px;
  }

  .kpi small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }

  .market-grid,
  .market-lower-grid,
  .review-stock-grid,
  .review-hero {
    gap: 10px;
  }

  .table-wrap {
    max-height: none;
  }

  tr {
    margin-bottom: 8px;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
  }

  td {
    grid-template-columns: 74px minmax(0, 1fr);
    min-height: 34px;
    padding: 9px;
    font-size: 13px;
  }

  .stock-link {
    max-width: 100%;
  }

  .review-tags {
    overflow-x: visible;
    flex-wrap: wrap;
    padding-bottom: 2px;
  }

  .review-tags .tag {
    flex: 0 1 auto;
    max-width: 100%;
  }

  .review-card-head {
    grid-template-columns: 1fr;
    overflow: hidden;
  }

  .review-card-head > div,
  .review-title,
  .review-tags {
    min-width: 0;
  }

  .review-score-ring {
    position: absolute;
    right: 12px;
    top: 12px;
    width: 64px;
    height: 64px;
  }

  .review-card-head > div:first-child {
    padding-right: 76px;
  }

  .review-price-row div,
  .review-score-box,
  .review-ma {
    padding: 8px;
  }

  .review-price-row strong,
  .review-score-box strong,
  .review-ma strong {
    font-size: 14px;
  }

  .review-reason {
    font-size: 12px;
  }

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

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

  .holding-form,
  .settings-grid,
  .group-builder,
  .holding-row,
  .holding-group-card-head,
  .news-meta-strip,
  .news-card-grid {
    grid-template-columns: 1fr;
  }

  .holding-group-card-head {
    display: grid;
  }

  .pin-btn {
    width: 100%;
  }

  .holding-row-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .toast {
    left: 10px;
    right: 10px;
    bottom: 68px;
    max-width: none;
  }
}

/* Final product-design override: keep this at the end so legacy CSS cannot override it. */
.app-header {
  grid-template-columns: minmax(230px, 0.86fr) minmax(320px, 0.92fr) minmax(520px, 1.35fr);
  grid-template-areas: "brand nav side";
  gap: 16px;
  padding: 12px 22px;
  background:
    linear-gradient(180deg, rgba(9, 15, 24, 0.98), rgba(8, 13, 21, 0.94)),
    linear-gradient(90deg, rgba(47, 125, 255, 0.14), rgba(53, 213, 168, 0.08), rgba(247, 189, 85, 0.04));
}

.brand { grid-area: brand; }
.view-switch {
  grid-area: nav;
  justify-self: stretch;
  max-width: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  height: 42px;
  padding: 4px;
}

.switch-btn {
  min-width: 0;
  height: 32px;
  font-weight: 700;
}

.header-side {
  grid-area: side;
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  grid-template-areas:
    "search user"
    "actions actions";
  gap: 8px 12px;
  align-items: center;
}

.global-search {
  grid-area: search;
  grid-template-columns: minmax(0, 1fr) auto;
  width: 100%;
}

.global-search input {
  height: 40px;
  border-radius: 8px;
}

.global-search span { color: #8092a5; }
.user-bar {
  grid-area: user;
  justify-content: flex-end;
}

.header-actions {
  grid-area: actions;
  justify-content: flex-end;
  gap: 7px;
}

.header-actions .btn {
  min-width: 72px;
  height: 34px;
  padding: 0 11px;
}

.user-chip {
  min-width: 126px;
  padding: 7px 10px;
}

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

.review-toolbar { top: 171px; }
.review-card { border-radius: 8px; }
.review-card-head { min-height: 86px; }
.review-title strong { letter-spacing: 0; }

.baima-panel,
.forum-panel {
  margin-top: 12px;
  border: 1px solid rgba(156, 176, 196, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(14, 22, 34, 0.92), rgba(8, 14, 23, 0.9));
  padding: 12px;
}

.forum-panel {
  border-color: rgba(247, 189, 85, 0.22);
  background:
    linear-gradient(135deg, rgba(247, 189, 85, 0.09), rgba(88, 184, 255, 0.045)),
    rgba(8, 14, 23, 0.88);
}

.forum-loading {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  padding: 8px 0 2px;
}

.forum-loading span {
  width: 13px;
  height: 13px;
  border: 2px solid rgba(247, 189, 85, 0.24);
  border-top-color: var(--amber);
  border-radius: 999px;
  animation: spin 800ms linear infinite;
}

.forum-summary {
  margin-top: 8px;
  color: #d6e2ec;
  font-size: 13px;
  line-height: 1.65;
}

.forum-sentiment-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.forum-sentiment-row span {
  border: 1px solid rgba(156, 176, 196, 0.14);
  border-radius: 6px;
  background: rgba(8, 14, 23, 0.72);
  color: var(--muted);
  padding: 8px 9px;
  font-size: 12px;
}

.forum-sentiment-row b {
  display: block;
  margin-bottom: 2px;
  font-size: 18px;
}

.forum-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.forum-row {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(156, 176, 196, 0.12);
  border-radius: 6px;
  background: rgba(7, 13, 21, 0.74);
  padding: 9px 10px;
}

.forum-row:hover {
  border-color: rgba(247, 189, 85, 0.3);
  background: rgba(14, 22, 34, 0.9);
  text-decoration: none;
}

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

.forum-row strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

@media (max-width: 1360px) {
  .app-header {
    grid-template-columns: minmax(220px, 0.7fr) minmax(300px, 0.85fr) minmax(0, 1.2fr);
  }

  .header-side {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "search"
      "actions";
  }

  .user-bar { display: none; }
  .status-strip { top: 112px; }
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "actions";
    gap: 10px;
  }

  .view-switch {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    z-index: 55;
    width: auto;
    height: auto;
  }

  .header-side { display: contents; }
  .global-search { grid-area: search; }

  .header-actions {
    grid-area: actions;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 7px;
  }

  .header-actions .btn {
    min-width: 0;
    padding: 0 7px;
    font-size: 12px;
  }

  .status-strip,
  .review-toolbar {
    position: static;
  }
}

@media (max-width: 560px) {
  .brand p,
  .global-search span {
    display: none;
  }

  .header-actions { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .header-actions .btn:nth-child(n + 4) { display: none; }
  .status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .review-price-row,
  .review-score-grid,
  .baima-score-grid,
  .forum-sentiment-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .forum-row strong { font-size: 12px; }
}

/* Header correction: search is a direct header child, so place real DOM siblings explicitly. */
.app-header {
  grid-template-columns: minmax(220px, 0.78fr) minmax(310px, 0.88fr) minmax(360px, 1.34fr);
  grid-template-areas:
    "brand nav search"
    "actions actions user";
  align-items: center;
}

.global-search {
  grid-area: search;
}

.header-side {
  display: contents;
}

.header-actions {
  grid-area: actions;
  justify-content: flex-start;
}

.user-bar {
  grid-area: user;
  justify-content: flex-end;
}

@media (max-width: 1360px) {
  .app-header {
    grid-template-columns: minmax(210px, 0.78fr) minmax(290px, 0.9fr) minmax(300px, 1.2fr);
    grid-template-areas:
      "brand nav search"
      "actions actions actions";
  }

  .header-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "actions";
  }

  .header-side {
    display: contents;
  }
}

@media (max-width: 980px) {
  .view-switch {
    top: auto !important;
    bottom: 10px !important;
  }
}

/* 2026 professional UI system: quieter, clearer, data-first. */
:root {
  --bg: #070b11;
  --bg-2: #0b111a;
  --panel: rgba(15, 22, 32, 0.94);
  --panel-strong: rgba(18, 27, 39, 0.98);
  --surface: rgba(21, 31, 44, 0.96);
  --surface-2: rgba(16, 38, 42, 0.9);
  --line: rgba(148, 163, 184, 0.16);
  --line-strong: rgba(148, 163, 184, 0.28);
  --text: #eef4fb;
  --muted: #9aa8ba;
  --muted-2: #6f7f91;
  --cyan: #4fb3ff;
  --teal: #24c7a0;
  --amber: #f2b84b;
  --red: #ff5f83;
  --green: #23c978;
  --violet: #8d8cff;
  --blue: #2f7dff;
  --coral: #ff896b;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.26);
  --shadow-soft: 0 10px 24px rgba(0, 0, 0, 0.18);
}

body {
  background:
    radial-gradient(circle at 24% -12%, rgba(47, 125, 255, 0.1), transparent 30%),
    linear-gradient(180deg, #0d1420 0, #080d14 360px, #070b11 100%);
  color: var(--text);
}

.app-header {
  grid-template-columns: minmax(250px, 0.8fr) minmax(300px, 0.72fr) minmax(520px, 1.35fr);
  grid-template-areas:
    "brand nav search"
    "actions actions user";
  gap: 10px 18px;
  padding: 12px 24px;
  background: rgba(8, 13, 21, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border-color: rgba(79, 179, 255, 0.42);
  background: rgba(79, 179, 255, 0.08);
  box-shadow: none;
}

.brand h1,
.auth-brand h1 {
  font-size: 18px;
  font-weight: 800;
}

.brand p {
  color: #8796aa;
}

.view-switch {
  height: 38px;
  padding: 3px;
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.16);
  background: rgba(15, 23, 42, 0.76);
}

.switch-btn {
  height: 30px;
  border-radius: 6px;
  color: #9aa8ba;
}

.switch-btn.active,
.mini-tab.active {
  background: linear-gradient(135deg, rgba(47, 125, 255, 0.72), rgba(36, 199, 160, 0.62));
  color: #fff;
  box-shadow: none;
}

.global-search {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: start;
}

.global-search input {
  height: 38px;
  border-radius: 8px;
  border-color: rgba(79, 179, 255, 0.26);
  background: rgba(4, 9, 16, 0.78);
  box-shadow: none;
}

.global-search input:focus {
  border-color: rgba(79, 179, 255, 0.68);
  box-shadow: 0 0 0 3px rgba(79, 179, 255, 0.1);
}

.global-search .search-submit,
.global-search .btn {
  height: 38px;
  min-width: 64px;
}

.global-search span {
  grid-column: 1 / -1;
  color: #718096;
}

.header-actions {
  gap: 8px;
}

.btn {
  border-radius: 7px;
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(19, 29, 43, 0.88);
  box-shadow: none;
}

.btn:hover {
  border-color: rgba(79, 179, 255, 0.42);
  background: rgba(25, 38, 55, 0.94);
}

.btn.primary {
  border-color: rgba(79, 179, 255, 0.48);
  background: linear-gradient(135deg, #236df2, #18a98c);
  box-shadow: 0 10px 22px rgba(35, 109, 242, 0.18);
}

.btn.ghost {
  background: rgba(8, 13, 21, 0.4);
}

.user-chip {
  min-width: 136px;
  border-radius: 8px;
  background: rgba(11, 18, 28, 0.78);
}

.layout {
  width: min(1680px, 100%);
  padding: 16px 24px 48px;
}

.status-strip {
  top: 112px;
  border-radius: 8px;
  background: rgba(12, 19, 30, 0.84);
  border-color: rgba(148, 163, 184, 0.14);
  box-shadow: var(--shadow-soft);
}

.status-cell {
  background: transparent;
  padding: 11px 14px;
}

.panel,
.settings,
.review-toolbar,
.holding-form,
.market-hero-main,
.review-hero-main,
.overlap-card,
.news-card,
.news-meta-card,
.kpi,
.summary-card,
.stack-item,
.theme-item,
.holding-row,
.review-card {
  border-radius: 8px;
  border-color: rgba(148, 163, 184, 0.14);
  background: rgba(14, 22, 34, 0.88);
  box-shadow: var(--shadow-soft);
}

.market-hero-main,
.review-hero-main {
  min-height: 132px;
  background:
    linear-gradient(135deg, rgba(47, 125, 255, 0.12), rgba(36, 199, 160, 0.06)),
    rgba(14, 22, 34, 0.9);
}

.market-hero-main h2,
.review-hero-main h2 {
  font-size: 23px;
  line-height: 1.35;
}

.review-toolbar {
  top: 172px;
  padding: 14px 16px;
}

.review-summary-grid {
  gap: 10px;
}

.review-stock-grid {
  gap: 14px;
}

.review-card {
  padding: 15px;
  background: rgba(15, 23, 35, 0.94);
}

.review-card::before {
  height: 3px;
  background: linear-gradient(90deg, #2f7dff, #24c7a0);
}

.review-card:hover {
  transform: translateY(-1px);
  border-color: rgba(79, 179, 255, 0.34);
}

.review-title strong {
  font-size: 20px;
}

.review-score-ring {
  width: 78px;
  height: 78px;
  flex-basis: 78px;
  border-color: rgba(79, 179, 255, 0.22);
  background: rgba(7, 12, 20, 0.72);
}

.review-price-row div,
.review-score-box,
.review-ma,
.review-context-grid article,
.baima-score-grid article,
.forum-sentiment-row span,
.forum-row {
  border-radius: 7px;
  background: rgba(7, 12, 20, 0.7);
  border-color: rgba(148, 163, 184, 0.12);
}

.review-reason {
  border-left-color: rgba(242, 184, 75, 0.72);
  background: rgba(242, 184, 75, 0.09);
}

.baima-panel,
.forum-panel,
.web-news-timeline {
  border-radius: 8px;
  background: rgba(10, 17, 27, 0.72);
  border-color: rgba(148, 163, 184, 0.13);
}

.forum-panel {
  border-color: rgba(242, 184, 75, 0.2);
}

.tag,
.pill,
.chip-inline,
.holding-mini-tags span {
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.15);
}

.table-wrap {
  border-radius: 8px;
  background: rgba(6, 11, 18, 0.54);
}

th {
  background: rgba(8, 13, 21, 0.92);
}

tr.row-active,
tr:hover {
  background: rgba(79, 179, 255, 0.07);
}

@media (max-width: 1360px) {
  .app-header {
    grid-template-columns: minmax(230px, 0.8fr) minmax(280px, 0.82fr) minmax(320px, 1fr);
    grid-template-areas:
      "brand nav search"
      "actions actions actions";
  }

  .status-strip {
    top: 112px;
  }
}

@media (max-width: 980px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "search"
      "actions";
    padding: 10px 12px;
  }

  .global-search {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

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

  .view-switch {
    position: fixed;
    left: 10px;
    right: 10px;
    top: auto !important;
    bottom: 10px !important;
    z-index: 55;
    height: 46px;
    background: rgba(8, 13, 21, 0.94);
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.34);
  }

  .switch-btn {
    height: 38px;
  }

  .layout {
    padding: 10px 10px 84px;
  }

  .status-strip,
  .review-toolbar {
    position: static;
  }
}

@media (max-width: 560px) {
  .global-search {
    grid-template-columns: minmax(0, 1fr) 58px 46px;
  }

  .global-search .search-submit,
  .global-search .btn {
    min-width: 0;
    padding: 0 8px;
  }

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

  .header-actions .btn:nth-child(n + 4) {
    display: none;
  }

  .market-hero-main h2,
  .review-hero-main h2 {
    font-size: 19px;
  }

  .review-title strong {
    font-size: 18px;
  }
}

/* 2026 mainline command center: decision-first market dashboard. */
#marketView {
  display: grid;
  gap: 12px;
}

#marketView.hidden {
  display: none;
}

#marketView .market-hero {
  grid-template-columns: minmax(360px, 1.05fr) minmax(340px, 0.95fr);
  gap: 14px;
  margin-top: 12px;
  align-items: stretch;
}

#marketView .market-hero-main,
#marketView .overlap-card,
#marketView .panel {
  border: 1px solid rgba(125, 154, 185, 0.16);
  background:
    linear-gradient(180deg, rgba(22, 33, 48, 0.94), rgba(10, 16, 25, 0.94)),
    #0c121d;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
}

#marketView .market-hero-main {
  min-height: 164px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

#marketView .market-hero-main::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -90px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(36, 199, 160, 0.16), transparent 68%);
  pointer-events: none;
}

#marketView .market-hero-main h2 {
  max-width: 980px;
  color: #eef5ff;
  font-size: 22px;
  line-height: 1.35;
}

#marketView .market-briefing {
  display: grid;
  gap: 8px;
  position: relative;
  z-index: 1;
}

.decision-label {
  width: max-content;
  padding: 3px 9px;
  border: 1px solid rgba(36, 199, 160, 0.26);
  border-radius: 999px;
  color: #3fe0bd;
  background: rgba(36, 199, 160, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.market-briefing strong {
  color: #dcecff;
  font-size: 14px;
  line-height: 1.7;
  font-weight: 700;
}

.decision-meta {
  color: #8394aa;
  font-size: 12px;
}

.mainline-decision-card {
  display: grid;
  gap: 12px;
}

.mainline-decision-card p {
  margin: 0;
  color: #8fa0b6;
  font-size: 12px;
  line-height: 1.6;
}

.mainline-chip-list {
  display: grid;
  gap: 8px;
}

.mainline-chip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  padding: 9px 10px;
  border: 1px solid rgba(125, 154, 185, 0.14);
  border-radius: 8px;
  background: rgba(7, 13, 22, 0.74);
  color: #dce7f5;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.mainline-chip:hover,
.mainline-chip.active {
  border-color: rgba(79, 179, 255, 0.46);
  background: rgba(18, 34, 52, 0.92);
  transform: translateY(-1px);
}

.mainline-chip span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.mainline-chip strong {
  color: #f2c24d;
  font-size: 13px;
}

.mainline-chip em {
  min-width: 40px;
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.12);
  color: #aebcd0;
  font-size: 12px;
  font-style: normal;
  text-align: center;
}

.mainline-chip em.hot,
.tag.hot {
  color: #ffcf7a;
  background: rgba(242, 184, 75, 0.13);
  border-color: rgba(242, 184, 75, 0.25);
}

#marketView .market-kpi-grid {
  grid-template-columns: repeat(8, minmax(128px, 1fr));
  gap: 10px;
  margin-top: 0;
}

#marketView .market-kpi {
  min-height: 108px;
  padding: 13px 14px;
  background:
    linear-gradient(180deg, rgba(18, 29, 43, 0.94), rgba(9, 15, 24, 0.94));
}

#marketView .market-kpi strong {
  color: #eff6ff;
  font-size: 20px;
}

#marketView .market-grid {
  grid-template-columns: minmax(360px, 0.86fr) minmax(0, 1.14fr);
  gap: 12px;
  margin-top: 0;
  align-items: start;
}

#marketView .market-lower-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(300px, 0.75fr) minmax(300px, 0.82fr);
  gap: 12px;
  margin-top: 0;
  align-items: start;
}

#marketView .section-head {
  gap: 12px;
  padding-bottom: 4px;
}

#marketView .section-head h2 {
  font-size: 17px;
  color: #eef5ff;
}

#marketView .section-head p {
  max-width: 720px;
  color: #8293a8;
  font-size: 12px;
  line-height: 1.55;
}

#marketView .table-wrap {
  max-height: 560px;
  border-color: rgba(125, 154, 185, 0.12);
}

#marketView th {
  background: rgba(7, 12, 20, 0.98);
  color: #7f90a7;
}

#marketView td {
  padding: 11px 10px;
  border-color: rgba(125, 154, 185, 0.09);
}

.board-cell strong {
  display: flex;
  align-items: center;
  gap: 6px;
}

.board-cell strong em {
  padding: 2px 6px;
  border-radius: 999px;
  background: rgba(242, 184, 75, 0.12);
  color: #f2c24d;
  font-size: 11px;
  font-style: normal;
}

.leader-cell,
.stock-role-cell {
  display: grid;
  gap: 4px;
}

.leader-cell small {
  color: #8394aa;
}

.attention-list {
  display: grid;
  gap: 7px;
  margin: 12px 0;
}

.attention-list span {
  padding: 8px 10px;
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 7px;
  background: rgba(7, 13, 22, 0.58);
  color: #c5d3e5;
  font-size: 12px;
  line-height: 1.55;
}

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

.catalyst-brief article,
.risk-radar-head {
  padding: 12px;
  border: 1px solid rgba(125, 154, 185, 0.13);
  border-radius: 8px;
  background: rgba(7, 13, 22, 0.64);
}

.catalyst-brief strong,
.risk-radar-head strong {
  display: block;
  margin-top: 6px;
  color: #eef5ff;
  font-size: 20px;
}

.catalyst-brief p,
.risk-radar-head p {
  margin: 7px 0 0;
  color: #8798ad;
  font-size: 12px;
  line-height: 1.55;
}

.catalyst-map {
  margin-bottom: 12px;
}

.catalyst-grid {
  display: grid;
  gap: 8px;
}

.catalyst-row {
  display: grid;
  grid-template-columns: minmax(150px, 0.34fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 8px;
  background: rgba(8, 15, 25, 0.7);
  cursor: pointer;
}

.catalyst-row:hover {
  border-color: rgba(79, 179, 255, 0.36);
  background: rgba(18, 34, 52, 0.82);
}

.catalyst-row div {
  display: flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.catalyst-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalyst-row p {
  margin: 0;
  color: #9aa9bb;
  font-size: 12px;
  line-height: 1.45;
}

.catalyst-row em {
  color: #f2c24d;
  font-style: normal;
  font-weight: 800;
}

.risk-radar-head {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.risk-radar-head > div:first-child {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
}

.risk-radar-head strong.danger,
.pill.danger {
  color: #ff8b8b;
}

.risk-radar-head strong.warm,
.pill.warm {
  color: #f2c24d;
}

.risk-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(125, 154, 185, 0.12);
}

.risk-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #24c7a0, #f2c24d, #ff6b6b);
}

.risk-factors {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.risk-factors span {
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(125, 154, 185, 0.1);
  color: #9aa9bb;
  font-size: 12px;
}

.ladder-theme-item p {
  margin: 7px 0 9px;
  color: #8798ad;
  font-size: 12px;
  line-height: 1.45;
}

@media (max-width: 1360px) {
  #marketView .market-kpi-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  #marketView .market-grid,
  #marketView .market-lower-grid {
    grid-template-columns: 1fr;
  }

  #marketView .table-wrap {
    max-height: none;
  }
}

@media (max-width: 820px) {
  #marketView .market-hero {
    grid-template-columns: 1fr;
  }

  #marketView .market-hero-main {
    min-height: auto;
  }

  #marketView .market-kpi-grid {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 2px;
    scroll-snap-type: x mandatory;
  }

  #marketView .market-kpi {
    min-width: 168px;
    scroll-snap-align: start;
  }

  .catalyst-brief,
  .catalyst-row {
    grid-template-columns: 1fr;
  }

  .mainline-chip {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mainline-chip em {
    grid-column: 1 / -1;
    width: max-content;
  }
}

@media (max-width: 620px) {
  #marketView .market-hero-main,
  #marketView .overlap-card,
  #marketView .panel {
    padding: 12px;
  }

  #marketView .market-hero-main h2 {
    font-size: 18px;
  }

  .market-briefing strong {
    font-size: 13px;
  }

  #marketView .section-head {
    align-items: stretch;
  }

  #marketView .tab-row {
    width: 100%;
  }

  #marketView .mini-tab {
    flex: 1;
  }

  .attention-list span,
  .catalyst-row,
  .risk-radar-head {
    font-size: 12px;
  }
}

/* Professional research command center: portfolio-aware decision layer. */
.research-command-center {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.72fr) minmax(300px, 0.86fr);
  gap: 12px;
  margin-top: 12px;
  align-items: stretch;
}

.research-brief-card,
.research-card,
.pro-decision-panel {
  min-width: 0;
  border: 1px solid rgba(125, 154, 185, 0.15);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(18, 29, 43, 0.94), rgba(9, 15, 24, 0.94));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.2);
}

.research-brief-card {
  grid-row: span 2;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(47, 125, 255, 0.12), rgba(36, 199, 160, 0.06)),
    rgba(13, 21, 33, 0.96);
}

.research-card {
  padding: 12px;
}

.research-card-head,
.pro-decision-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.research-card-head strong,
.pro-decision-head strong {
  display: block;
  margin-top: 5px;
  color: #eff6ff;
  font-size: 16px;
}

.research-card-head > span,
.pro-decision-head > b {
  color: #8496ac;
  font-size: 12px;
  font-weight: 700;
  text-align: right;
}

.research-badge {
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(125, 154, 185, 0.12);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.research-brief-lines {
  display: grid;
  gap: 9px;
  margin-top: 13px;
}

.research-brief-lines p {
  margin: 0;
  padding: 10px 11px;
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 7px;
  background: rgba(6, 12, 20, 0.5);
  color: #d4e2f1;
  font-size: 13px;
  line-height: 1.68;
}

.research-brief-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.research-report-preview {
  margin: 14px 0 18px;
  padding: 18px;
  border: 1px solid rgba(85, 121, 155, 0.22);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(18, 29, 44, 0.98), rgba(12, 19, 31, 0.98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.22);
}

.research-preview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.research-preview-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(112, 145, 177, 0.18);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.035);
  color: #a7b8c9;
  font-size: 12px;
}

.research-report-preview pre {
  max-height: 430px;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  padding: 14px;
  border: 1px solid rgba(100, 133, 168, 0.18);
  border-radius: 7px;
  background: rgba(3, 8, 16, 0.55);
  color: #dce8f4;
  font: 13px/1.75 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}

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

.quality-grid span,
.portfolio-link-row,
.research-alert,
.mainline-history-row {
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 7px;
  background: rgba(7, 13, 22, 0.58);
}

.quality-grid span {
  padding: 7px 8px;
  color: #b9c7d9;
  font-size: 12px;
}

.data-quality-card p {
  margin: 10px 0 0;
  color: #8798ad;
  font-size: 12px;
  line-height: 1.55;
}

.mainline-history-list,
.portfolio-link-list,
.research-alert-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.action-card {
  grid-column: span 2;
}

.action-queue-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.action-queue-row {
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 7px;
  background: rgba(7, 13, 22, 0.58);
  cursor: pointer;
}

.action-queue-row.hot {
  border-color: rgba(242, 184, 75, 0.26);
}

.action-queue-row.watch {
  border-color: rgba(79, 179, 255, 0.22);
}

.action-queue-row.risk {
  border-color: rgba(255, 107, 107, 0.26);
}

.action-queue-row span {
  color: #8496ac;
  font-size: 11px;
}

.action-queue-row strong {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: #eef5ff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.action-queue-row p {
  margin: 5px 0 0;
  color: #aebcd0;
  font-size: 12px;
  line-height: 1.45;
}

.mainline-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
  color: #dce7f5;
  cursor: pointer;
  text-align: left;
}

.mainline-history-row:hover {
  border-color: rgba(79, 179, 255, 0.36);
  background: rgba(18, 34, 52, 0.82);
}

.mainline-history-row span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.mainline-history-row strong,
.portfolio-link-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #eef5ff;
  font-size: 13px;
}

.mainline-history-row em,
.portfolio-link-row span {
  color: #8496ac;
  font-size: 12px;
  font-style: normal;
}

.mainline-history-row b,
.portfolio-link-row b {
  color: #f2c24d;
  font-size: 15px;
}

.mainline-history-row i {
  padding: 3px 7px;
  border-radius: 999px;
  background: rgba(125, 154, 185, 0.1);
  color: #aebcd0;
  font-size: 12px;
  font-style: normal;
}

.portfolio-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 9px;
}

.portfolio-link-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.research-alert {
  padding: 9px;
  border-left: 3px solid rgba(125, 154, 185, 0.4);
}

.research-alert.hot {
  border-left-color: rgba(242, 184, 75, 0.86);
  background: rgba(242, 184, 75, 0.08);
}

.research-alert.risk {
  border-left-color: rgba(255, 107, 107, 0.82);
  background: rgba(255, 107, 107, 0.07);
}

.research-alert strong {
  color: #eef5ff;
  font-size: 13px;
}

.research-alert p {
  margin: 5px 0 0;
  color: #aebcd0;
  font-size: 12px;
  line-height: 1.52;
}

.pro-decision-panel {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px;
  border-color: rgba(79, 179, 255, 0.2);
  background:
    linear-gradient(135deg, rgba(79, 179, 255, 0.08), rgba(36, 199, 160, 0.05)),
    rgba(8, 17, 27, 0.9);
}

.pro-decision-head span,
.fundamental-checklist span {
  display: block;
  color: #4fb3ff;
  font-size: 12px;
  font-weight: 800;
}

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

.pro-decision-grid article,
.fundamental-checklist {
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 7px;
  background: rgba(6, 12, 20, 0.56);
  padding: 9px;
}

.pro-decision-grid span {
  color: #8496ac;
  font-size: 11px;
}

.pro-decision-grid p,
.fundamental-checklist p {
  margin: 5px 0 0;
  color: #c9d7e8;
  font-size: 12px;
  line-height: 1.55;
}

.fundamental-checklist {
  display: grid;
  gap: 8px;
}

.fundamental-checklist > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.fundamental-checklist strong {
  color: #f2c24d;
  font-size: 12px;
}

.fundamental-checklist ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin: 0;
  padding-left: 18px;
  color: #aebcd0;
  font-size: 12px;
  line-height: 1.45;
}

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

.financial-metric-grid article {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(125, 154, 185, 0.12);
  border-radius: 7px;
  background: rgba(5, 11, 18, 0.54);
}

.financial-metric-grid article.strong {
  border-color: rgba(36, 199, 160, 0.26);
}

.financial-metric-grid article.watch {
  border-color: rgba(242, 184, 75, 0.22);
}

.financial-metric-grid article.weak {
  border-color: rgba(255, 107, 107, 0.28);
}

.financial-metric-grid span,
.financial-metric-grid em {
  display: block;
  color: #8496ac;
  font-size: 11px;
  font-style: normal;
}

.financial-metric-grid strong {
  display: block;
  margin: 4px 0 3px;
  overflow: hidden;
  color: #eef5ff;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.financial-red-flags {
  color: #ffb3b3 !important;
}

@media (max-width: 1380px) {
  .research-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .research-brief-card {
    grid-row: auto;
    grid-column: 1 / -1;
  }

  .action-card {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .research-command-center {
    grid-template-columns: 1fr;
  }

  .pro-decision-grid,
  .fundamental-checklist ul,
  .financial-metric-grid,
  .action-queue-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .research-command-center {
    gap: 10px;
  }

  .research-brief-card,
  .research-card,
  .pro-decision-panel {
    padding: 11px;
  }

  .mainline-history-row {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mainline-history-row i {
    grid-column: 1 / -1;
    width: max-content;
  }
}

/* Final Product Design polish: calmer hierarchy, fewer chrome-heavy surfaces, mobile-first recovery. */
:root {
  --pd-bg: #07111f;
  --pd-bg-soft: #0b1726;
  --pd-panel: rgba(13, 24, 38, 0.9);
  --pd-panel-soft: rgba(16, 31, 48, 0.76);
  --pd-border: rgba(152, 176, 203, 0.16);
  --pd-border-strong: rgba(152, 176, 203, 0.28);
  --pd-text: #eef5ff;
  --pd-muted: #9caec3;
  --pd-blue: #58a6ff;
  --pd-mint: #2fd0a4;
  --pd-gold: #f0b84f;
  --pd-red: #ff6b7a;
}

html {
  background: var(--pd-bg);
}

body {
  min-width: 0;
  background:
    radial-gradient(circle at 18% -18%, rgba(88, 166, 255, 0.16), transparent 32rem),
    radial-gradient(circle at 90% 8%, rgba(47, 208, 164, 0.1), transparent 28rem),
    linear-gradient(180deg, #07111f 0%, #08111d 42%, #060b13 100%);
  color: var(--pd-text);
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(190px, 0.9fr) minmax(230px, 0.7fr) minmax(340px, 1.45fr) minmax(260px, 0.9fr);
  grid-template-areas: "brand nav search side";
  gap: 12px;
  align-items: center;
  padding: 10px clamp(14px, 2.2vw, 28px);
  border-bottom: 1px solid rgba(152, 176, 203, 0.14);
  background: rgba(7, 17, 31, 0.92);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.22);
}

.brand {
  grid-area: brand;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  color: var(--pd-text);
  font-size: 18px;
  letter-spacing: 0;
}

.brand p {
  margin: 3px 0 0;
  overflow: hidden;
  color: var(--pd-muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-mark {
  flex: 0 0 auto;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--pd-blue), var(--pd-mint));
  box-shadow: 0 10px 24px rgba(47, 208, 164, 0.18);
  letter-spacing: 0;
}

.view-switch {
  grid-area: nav;
  width: 100%;
  height: 40px;
  padding: 4px;
  border: 1px solid var(--pd-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.switch-btn {
  height: 30px;
  border-radius: 7px;
  color: var(--pd-muted);
}

.switch-btn.active {
  background: rgba(88, 166, 255, 0.16);
  color: var(--pd-text);
  box-shadow: inset 0 0 0 1px rgba(88, 166, 255, 0.24);
}

.global-search {
  grid-area: search;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.global-search input,
.field input,
.field select,
.bulk-import-panel textarea,
.group-builder input {
  border-radius: 8px;
  border-color: var(--pd-border);
  background: rgba(255, 255, 255, 0.055);
  color: var(--pd-text);
}

.global-search span {
  grid-column: 1 / -1;
  min-height: 14px;
  color: #7f92aa;
  font-size: 11px;
}

.header-side {
  grid-area: side;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
  min-width: 0;
}

.header-actions #copyCollectorBtn {
  display: none;
}

.user-bar {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.user-chip {
  min-width: 0;
  max-width: 130px;
  border-radius: 8px;
  border-color: var(--pd-border);
  background: rgba(255, 255, 255, 0.045);
}

.btn,
.mini-tab,
.search-submit {
  border-radius: 8px;
  letter-spacing: 0;
  white-space: nowrap;
}

.btn.primary,
.search-submit {
  border-color: rgba(88, 166, 255, 0.3);
  background: linear-gradient(135deg, rgba(88, 166, 255, 0.95), rgba(47, 208, 164, 0.88));
  color: #06111e;
  font-weight: 800;
}

.layout {
  width: min(100% - 32px, 1680px);
  margin: 16px auto 34px;
}

.status-strip {
  position: sticky;
  top: 72px;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--pd-border);
  border-radius: 10px;
  background: rgba(7, 17, 31, 0.86);
  backdrop-filter: blur(16px);
}

.status-cell {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.status-cell span,
.metric-label {
  color: #87a0bc;
  letter-spacing: 0;
}

.status-cell strong {
  overflow: hidden;
  color: var(--pd-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel,
.market-hero-main,
.review-hero-main,
.holding-form,
.settings,
.auth-box,
.auth-copy,
.review-card,
.overlap-card,
.summary-card,
.research-card,
.research-brief-card {
  border: 1px solid var(--pd-border);
  border-radius: 10px;
  background: var(--pd-panel);
  box-shadow: 0 18px 52px rgba(0, 0, 0, 0.18);
}

.market-hero,
.review-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.75fr);
  gap: 14px;
  margin-top: 14px;
}

.market-hero-main,
.review-hero-main {
  padding: clamp(18px, 2.2vw, 26px);
  background:
    linear-gradient(135deg, rgba(88, 166, 255, 0.11), transparent 42%),
    linear-gradient(180deg, rgba(17, 32, 50, 0.94), rgba(10, 20, 34, 0.92));
}

.market-hero-main h2,
.review-hero-main h2 {
  max-width: 980px;
  margin: 8px 0 12px;
  color: var(--pd-text);
  font-size: clamp(24px, 2.5vw, 38px);
  line-height: 1.18;
  letter-spacing: 0;
}

.market-briefing {
  max-width: 980px;
  color: #bfd0e4;
}

.market-kpi-grid,
.review-summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.market-kpi,
.review-kpi,
.kpi {
  min-width: 0;
  border-radius: 9px;
  border-color: var(--pd-border);
  background: var(--pd-panel-soft);
}

.market-grid,
.market-lower-grid {
  display: grid;
  gap: 14px;
}

.market-grid {
  grid-template-columns: minmax(420px, 0.9fr) minmax(0, 1.1fr);
}

.market-lower-grid {
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.72fr) minmax(310px, 0.72fr);
  align-items: start;
}

.section-head {
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(152, 176, 203, 0.1);
}

.section-head h2 {
  margin: 0;
  color: var(--pd-text);
  font-size: 17px;
  letter-spacing: 0;
}

.section-head p {
  max-width: 760px;
  color: var(--pd-muted);
  font-size: 12px;
  line-height: 1.55;
}

.table-wrap {
  border-radius: 8px;
  border-color: rgba(152, 176, 203, 0.12);
}

table {
  table-layout: fixed;
}

th {
  color: #8ea3bb;
  letter-spacing: 0;
}

td,
th {
  border-color: rgba(152, 176, 203, 0.08);
}

tr:hover td {
  background: rgba(88, 166, 255, 0.055);
}

.review-toolbar {
  position: sticky;
  top: 146px;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  background: rgba(10, 20, 34, 0.9);
  backdrop-filter: blur(14px);
}

.holding-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  align-self: stretch;
}

.holding-form .btn {
  grid-column: 1 / -1;
}

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

.review-card {
  overflow: hidden;
  padding: 15px;
}

.review-card::before {
  height: 3px;
}

.review-card-head {
  min-height: 0;
  gap: 12px;
}

.review-title strong {
  font-size: 18px;
}

.review-price-row,
.review-score-grid,
.review-ma-grid,
.review-context-grid,
.financial-metric-grid {
  gap: 8px;
}

.review-price-row div,
.review-score-box,
.review-ma,
.review-context-grid article,
.financial-metric-grid article {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.review-analysis-text {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.review-analysis-text p {
  margin: 0;
}

.research-command-center {
  grid-template-columns: minmax(0, 1.2fr) repeat(2, minmax(260px, 0.8fr));
  gap: 12px;
}

.research-brief-card {
  grid-row: span 2;
}

.auth-overlay {
  z-index: 100;
}

.auth-panel {
  width: min(1120px, calc(100vw - 28px));
  max-height: min(860px, calc(100vh - 28px));
  overflow: auto;
}

.auth-copy {
  background:
    linear-gradient(135deg, rgba(88, 166, 255, 0.15), rgba(47, 208, 164, 0.08)),
    rgba(8, 18, 31, 0.96);
}

.auth-feature-list > div,
.auth-metrics > div {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
}

.loading-state,
.empty-state,
.notice {
  border-radius: 10px;
  border-color: var(--pd-border);
}

@media (max-width: 1380px) {
  .app-header {
    grid-template-columns: minmax(180px, 0.8fr) minmax(220px, 0.8fr) minmax(330px, 1.1fr);
    grid-template-areas:
      "brand nav side"
      "search search search";
  }

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

  .status-strip {
    top: 118px;
  }

  .review-toolbar {
    top: 192px;
  }

  .market-lower-grid,
  .research-command-center {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1020px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas: "brand" "nav" "search" "side";
    gap: 9px;
  }

  .header-side,
  .header-actions,
  .user-bar {
    justify-content: stretch;
  }

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

  .header-actions .btn {
    flex: 1 1 96px;
  }

  .user-chip {
    max-width: none;
    flex: 1 1 auto;
  }

  .layout {
    width: min(100% - 22px, 1680px);
  }

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

  .market-hero,
  .review-hero,
  .market-grid,
  .market-lower-grid,
  .review-stock-grid,
  .research-command-center {
    grid-template-columns: 1fr;
  }

  .review-toolbar {
    position: static;
    flex-direction: column;
    align-items: stretch;
  }

  .market-kpi-grid,
  .review-summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    background: linear-gradient(180deg, #07111f 0%, #060b13 100%);
  }

  .app-header {
    padding: 10px;
  }

  .brand {
    gap: 9px;
  }

  .brand h1 {
    font-size: 16px;
  }

  .brand p {
    font-size: 11px;
  }

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

  .view-switch {
    height: 38px;
  }

  .global-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .global-search #clearGlobalSearchBtn {
    grid-column: 2;
  }

  .global-search span {
    font-size: 10px;
  }

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

  .header-actions .btn {
    min-width: 0;
    width: 100%;
  }

  .layout {
    width: min(100% - 16px, 1680px);
    margin-top: 10px;
  }

  .status-strip,
  .market-kpi-grid,
  .review-summary-grid,
  .holding-form,
  .review-price-row,
  .review-score-grid,
  .review-ma-grid,
  .review-context-grid,
  .financial-metric-grid,
  .pro-decision-grid {
    grid-template-columns: 1fr;
  }

  .market-hero-main,
  .review-hero-main,
  .panel,
  .holding-form,
  .review-card {
    padding: 12px;
    border-radius: 9px;
  }

  .market-hero-main h2,
  .review-hero-main h2 {
    font-size: 22px;
    line-height: 1.24;
  }

  .tab-row,
  .section-head,
  .review-card-actions,
  .bulk-import-actions,
  .settings-actions {
    flex-wrap: wrap;
  }

  .tab-row .btn,
  .tab-row .mini-tab,
  .review-card-actions .btn,
  .bulk-import-actions .btn,
  .settings-actions .btn {
    flex: 1 1 120px;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    min-width: 640px;
  }

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

  .review-score-ring {
    width: 70px;
    height: 70px;
  }

  .auth-panel {
    grid-template-columns: 1fr;
  }

  .auth-copy {
    display: none;
  }

  .auth-box {
    padding: 16px;
  }
}

/* Final market-mainline board redesign. */
#marketView .mainline-workbench {
  grid-template-columns: minmax(430px, 0.82fr) minmax(0, 1.18fr);
  gap: 16px;
  align-items: start;
}

#marketView .mainline-workbench > .panel {
  min-width: 0;
  padding: 16px;
}

.mainline-board-list,
.sector-stock-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 3px;
  scrollbar-width: thin;
}

.mainline-board-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  grid-template-areas:
    "rank main"
    "rank metrics"
    "rank leader";
  gap: 10px 12px;
  min-height: 154px;
  padding: 13px;
  border: 1px solid rgba(126, 160, 194, 0.14);
  border-radius: 9px;
  background:
    linear-gradient(135deg, rgba(88, 166, 255, 0.06), transparent 42%),
    rgba(7, 13, 22, 0.68);
  color: var(--pd-text);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.mainline-board-card:hover,
.mainline-board-card.active {
  border-color: rgba(88, 166, 255, 0.42);
  background:
    linear-gradient(135deg, rgba(88, 166, 255, 0.14), rgba(47, 208, 164, 0.05)),
    rgba(11, 21, 35, 0.94);
  transform: translateY(-1px);
}

.mainline-board-card.active {
  box-shadow: inset 3px 0 0 rgba(88, 166, 255, 0.9), 0 12px 30px rgba(0, 0, 0, 0.18);
}

.mainline-rank-badge {
  grid-area: rank;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 8px;
  padding-top: 2px;
}

.mainline-rank-badge span {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(88, 166, 255, 0.28);
  border-radius: 8px;
  background: rgba(88, 166, 255, 0.1);
  color: #dcecff;
  font-size: 15px;
  font-weight: 900;
}

.mainline-rank-badge b {
  display: inline-grid;
  place-items: center;
  width: 40px;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(242, 194, 77, 0.13);
  color: #ffd36f;
  font-size: 13px;
}

.mainline-board-main {
  grid-area: main;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.mainline-board-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}

.mainline-board-title strong {
  min-width: 0;
  overflow: hidden;
  color: #eef6ff;
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mainline-board-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 12px;
  color: #8da0b8;
  font-size: 12px;
}

.mainline-catalysts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mainline-catalysts em {
  max-width: 132px;
  overflow: hidden;
  padding: 4px 8px;
  border: 1px solid rgba(126, 160, 194, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #aebed1;
  font-size: 11px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mainline-board-metrics {
  grid-area: metrics;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.mainline-board-metrics div,
.mainline-leader,
.sector-stock-metrics div {
  min-width: 0;
  border: 1px solid rgba(126, 160, 194, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.mainline-board-metrics div {
  display: grid;
  gap: 3px;
  padding: 8px;
}

.mainline-board-metrics span,
.mainline-leader > span,
.sector-stock-metrics span {
  color: #7f93ac;
  font-size: 11px;
}

.mainline-board-metrics strong,
.mainline-leader strong,
.sector-stock-metrics strong {
  color: #e7f0fb;
  font-size: 13px;
}

.mainline-board-metrics small {
  overflow: hidden;
  color: #899bb0;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mainline-leader {
  grid-area: leader;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
}

.mainline-leader .market-stock-action-cell,
.mainline-leader .stock-link {
  min-width: 0;
}

.mainline-leader small {
  color: #8fa2b7;
  font-size: 12px;
  white-space: nowrap;
}

#sectorDetailSummary.summary-card {
  margin-bottom: 12px;
  background:
    linear-gradient(135deg, rgba(47, 208, 164, 0.08), rgba(88, 166, 255, 0.06)),
    rgba(8, 15, 25, 0.82);
}

#sectorDetailSummary .summary-top {
  align-items: flex-start;
}

#sectorDetailSummary .summary-top strong {
  color: #f1f7ff;
  font-size: 18px;
}

#sectorDetailSummary .summary-metrics {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

#sectorDetailSummary .summary-metrics span {
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(126, 160, 194, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: #b9c9dc;
  font-size: 12px;
}

.sector-stock-list {
  max-height: 640px;
}

.sector-stock-card {
  display: grid;
  grid-template-columns: 52px minmax(180px, 1.15fr) minmax(420px, 1.75fr);
  gap: 12px;
  align-items: center;
  min-height: 88px;
  padding: 12px;
  border: 1px solid rgba(126, 160, 194, 0.12);
  border-radius: 9px;
  background: rgba(7, 13, 22, 0.64);
}

.sector-stock-card:hover {
  border-color: rgba(88, 166, 255, 0.34);
  background: rgba(12, 22, 36, 0.88);
}

.sector-stock-rank {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: rgba(88, 166, 255, 0.1);
  color: #dcecff;
  font-weight: 900;
}

.sector-stock-main {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.sector-stock-title {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.sector-stock-title .market-stock-action-cell {
  gap: 7px;
}

.sector-stock-sub {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: #8ea0b6;
  font-size: 12px;
}

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

.sector-stock-metrics div {
  display: grid;
  gap: 3px;
  padding: 8px 9px;
}

.market-stock-action-cell {
  min-width: 0;
}

.market-stock-action-cell .stock-link {
  min-width: 0;
  max-width: 168px;
}

.market-stock-action-cell .stock-name,
.market-stock-action-cell .stock-code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-stock-ai-trigger.compact,
.stock-monitor-btn.compact {
  min-height: 26px;
  padding: 5px 8px;
}

.trend-up {
  color: #ff7c98;
}

.trend-down {
  color: #5be0b6;
}

.trend-new {
  color: #59c7ff;
}

.trend-flat {
  color: #b8c4d2;
}

.mobile-title,
.mainline-mobile-change,
.mainline-mobile-rank {
  display: none;
}

@media (max-width: 1020px) {
  #marketView .mainline-workbench {
    grid-template-columns: 1fr;
  }

  .mainline-board-list,
  .sector-stock-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .sector-stock-card {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .sector-stock-metrics {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .mainline-board-card {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "rank main"
      "metrics metrics"
      "leader leader";
    min-height: 0;
    padding: 11px;
  }

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

  .mainline-leader {
    grid-template-columns: 1fr;
  }

  .sector-stock-card {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 9px;
    padding: 10px;
    min-height: 0;
  }

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

  .sector-stock-metrics div {
    padding: 6px 7px;
  }

  .sector-stock-title .market-stock-action-cell {
    gap: 6px;
  }

  .sector-stock-title .market-stock-action-cell .stock-link {
    max-width: 138px;
  }
}

/* Density pass for the market-mainline ranking list. */
.mainline-board-card {
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 8px 10px;
  min-height: 132px;
  padding: 11px;
}

.mainline-rank-badge span {
  width: 32px;
  height: 32px;
}

.mainline-rank-badge b {
  width: 36px;
  min-height: 26px;
}

.mainline-board-title strong {
  font-size: 16px;
}

.mainline-board-sub {
  max-height: 18px;
  overflow: hidden;
}

.mainline-catalysts {
  max-height: 24px;
  overflow: hidden;
}

.mainline-board-metrics {
  gap: 6px;
}

.mainline-board-metrics div {
  padding: 6px 7px;
}

.mainline-leader {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 7px;
  min-height: 38px;
  padding: 6px 7px;
}

.mainline-leader .market-stock-action-cell {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
}

.mainline-leader .market-stock-action-cell .stock-link {
  max-width: 124px;
}

.mainline-leader .market-stock-ai-trigger.compact,
.mainline-leader .stock-monitor-btn.compact {
  min-height: 24px;
  padding: 4px 7px;
}

/* Final density override: desktop uses a compact three-column ranking row. */
.mainline-board-card {
  grid-template-columns: 42px minmax(0, 1fr) 112px;
  grid-template-areas:
    "rank main metrics"
    "rank leader metrics";
  min-height: 122px;
}

.mainline-board-metrics {
  grid-template-columns: 1fr;
  align-content: stretch;
}

.mainline-board-metrics div {
  padding: 5px 7px;
}

.mainline-board-metrics small {
  display: none;
}

@media (max-width: 1020px) {
  .mainline-board-card {
    grid-template-columns: 42px minmax(0, 1fr);
    grid-template-areas:
      "rank main"
      "metrics metrics"
      "leader leader";
  }

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

  .mainline-board-metrics small {
    display: block;
  }
}

@media (max-width: 680px) {
  #marketView {
    margin-right: -12px;
    margin-left: -12px;
    padding: 8px 8px 86px;
  }

  #marketView .market-hero,
  #marketView .market-kpi-grid,
  #marketView .market-lower-grid,
  #marketStockAiDrawer.hidden {
    display: none;
  }

  #marketView .mainline-workbench {
    gap: 10px;
  }

  #marketView .mainline-workbench > .panel:first-child {
    overflow: hidden;
    padding: 18px 10px 16px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 20px;
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(243, 247, 251, 0.96));
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
  }

  #marketView .mainline-workbench > .panel:first-child .section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
  }

  #marketView .mainline-workbench > .panel:first-child .section-head > div {
    flex: 1 1 auto;
    min-width: 0;
  }

  #marketView .mainline-workbench > .panel:first-child .section-head h2 {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #111827;
    font-size: 20px;
    font-weight: 950;
    text-align: left;
  }

  #marketView .mainline-workbench > .panel:first-child .section-head h2::before {
    content: "";
    width: 5px;
    height: 24px;
    border-radius: 999px;
    background: linear-gradient(180deg, #ff4468, #ffb43a);
    box-shadow: 0 4px 12px rgba(255, 104, 72, 0.28);
  }

  #marketView .mainline-workbench > .panel:first-child .section-head p {
    display: none;
  }

  #marketView .mainline-workbench > .panel:first-child .tab-row {
    width: auto;
    min-width: 112px;
    padding: 3px;
    border-color: rgba(15, 23, 42, 0.08);
    background: #eef3f7;
  }

  #marketView .mainline-workbench > .panel:first-child .mini-tab {
    min-height: 28px;
    padding: 4px 8px;
    color: #52606f;
    font-size: 12px;
  }

  #marketView .mainline-workbench > .panel:first-child .mini-tab.active {
    color: #111827;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
  }

  .desktop-title {
    display: none;
  }

  .mobile-title {
    display: inline;
  }

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

  .mainline-board-card {
    display: flex;
    align-items: center;
    min-height: 74px;
    padding: 10px 8px;
    border: 1px solid rgba(15, 23, 42, 0.08);
    border-radius: 12px;
    background:
      linear-gradient(180deg, #ffffff, #f7fafc);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.95),
      0 7px 18px rgba(15, 23, 42, 0.08);
    color: #172033;
    transform: none;
  }

  .mainline-board-card.active {
    border-color: rgba(255, 77, 109, 0.28);
    background:
      linear-gradient(180deg, #ffffff, #f9fbfe);
    box-shadow:
      inset 0 0 0 1px rgba(255, 77, 109, 0.12),
      0 8px 20px rgba(15, 23, 42, 0.12);
  }

  .mainline-board-card:hover {
    transform: none;
  }

  .mainline-rank-badge,
  .mainline-board-sub,
  .mainline-catalysts,
  .mainline-board-metrics,
  .mainline-leader,
  .mainline-board-title .tag {
    display: none;
  }

  .mainline-board-main {
    width: 100%;
  }

  .mainline-board-title {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 4px 7px;
    align-items: center;
    width: 100%;
  }

  .mainline-board-title strong {
    grid-column: 1;
    grid-row: 1;
    color: #253044;
    font-size: clamp(14px, 3.8vw, 17px);
    font-weight: 950;
    letter-spacing: 0;
  }

  .mainline-mobile-change {
    display: inline-flex;
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    justify-content: flex-end;
    min-width: 52px;
    color: #dc3f56;
    font-size: clamp(13px, 3.55vw, 16px);
    font-weight: 950;
    white-space: nowrap;
  }

  .mainline-mobile-change.green,
  .mainline-mobile-change.trend-down {
    color: #15936b;
  }

  .mainline-mobile-rank {
    display: inline-flex;
    grid-column: 1 / -1;
    grid-row: 2;
    align-items: center;
    width: max-content;
    max-width: 100%;
    min-height: 20px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.055);
    color: #69778a;
    font-size: 11px;
    font-weight: 850;
    line-height: 1.2;
    white-space: nowrap;
  }

  .mainline-mobile-rank.trend-up {
    background: rgba(220, 63, 86, 0.09);
    color: #d83d55;
  }

  .mainline-mobile-rank.trend-down {
    background: rgba(21, 147, 107, 0.09);
    color: #15936b;
  }

  .mainline-mobile-rank.trend-new {
    background: rgba(34, 143, 255, 0.09);
    color: #2477ce;
  }

  #marketView .mainline-workbench > .panel:nth-child(2) {
    padding: 12px;
    border-radius: 16px;
  }

  #marketView .mainline-workbench > .panel:nth-child(2) .section-head {
    margin-bottom: 10px;
  }
}

/* Mobile header simplification: keep review content close to the top. */
@media (max-width: 680px) {
  .app-header {
    grid-template-columns: 1fr;
    grid-template-areas: "brand";
    min-height: 58px;
    padding: 7px 10px;
    gap: 0;
  }

  .brand {
    min-width: 0;
  }

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

  .brand h1 {
    font-size: 17px;
    line-height: 1.1;
  }

  #headerSubtitle {
    display: none;
  }

  .global-search,
  .header-actions,
  .header-side,
  .user-bar,
  .status-strip,
  #refreshBtn,
  #enrichBtn,
  #pushBtn {
    display: none !important;
  }

  .layout {
    padding-top: 8px;
  }

  .market-hero-main,
  .review-hero-main {
    padding-top: 14px;
  }
}
