:root {
  --canvas: #efe9df;
  --canvas-2: #fbf7f1;
  --sidebar: #fffdf8;
  --surface: #fffdf8;
  --surface-2: #f7f1ea;
  --surface-3: #eee4da;
  --ink: #201817;
  --ink-soft: #473936;
  --muted: #867872;
  --line: rgba(111, 17, 28, 0.14);
  --line-strong: rgba(111, 17, 28, 0.24);
  --blue: #9f1d2b;
  --blue-soft: #f8e7e9;
  --green: #16854d;
  --green-soft: #e3f5eb;
  --red: #d73535;
  --red-soft: #fae4e0;
  --amber: #b87a19;
  --amber-soft: #f7eadc;
  --shadow: 0 22px 60px rgba(38, 22, 20, 0.14);
  --shadow-sm: 0 1px 2px rgba(38, 22, 20, 0.07), 0 16px 36px rgba(38, 22, 20, 0.07);
  --radius-lg: 14px;
  --radius-md: 10px;
  --radius-sm: 6px;
  --nav-width: 224px;
  --font-sans: "Outfit", "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --font-mono: "Space Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 0%, rgba(159, 29, 43, 0.055), transparent 34%),
    linear-gradient(180deg, var(--canvas-2) 0%, var(--canvas) 100%);
  color: var(--ink);
  font-family: var(--font-sans);
  line-height: 1.55;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.32;
  background-image:
    linear-gradient(rgba(83, 74, 58, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 74, 58, 0.035) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(180deg, #000 0%, transparent 82%);
}

button,
a {
  font: inherit;
  touch-action: manipulation;
}

a { color: inherit; text-decoration: none; }

button {
  color: inherit;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(159, 29, 43, 0.28);
  outline-offset: 2px;
}

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

h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.15;
  letter-spacing: 0;
}

h3 {
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.2;
}

.app-shell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: grid;
  grid-template-rows: auto auto auto auto 1fr;
  gap: 12px;
  padding: 18px 12px;
  background:
    radial-gradient(circle at 0% 0%, rgba(159, 29, 43, 0.055), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 253, 248, 0.98)),
    var(--sidebar);
  border-right: 1px solid rgba(111, 17, 28, 0.12);
  box-shadow: 10px 0 34px rgba(38, 22, 20, 0.045);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  border-radius: var(--radius-md);
  padding: 4px;
}

.brand__mark {
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: #7f1620;
  color: #fff7f0;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 10px 24px rgba(80, 13, 21, 0.14), inset 0 1px rgba(255, 255, 255, 0.25);
}

.brand strong {
  display: block;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0;
}

.sidebar__divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(111, 17, 28, 0.16), transparent);
}

.side-nav {
  display: grid;
  align-content: start;
  gap: 6px;
}

.side-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  width: 100%;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.side-link__icon {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: rgba(159, 29, 43, 0.06);
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.side-link:hover {
  background: rgba(159, 29, 43, 0.055);
  color: var(--blue);
}

.side-link.is-active,
.side-link[aria-current="page"] {
  background: linear-gradient(90deg, rgba(159, 29, 43, 0.11), rgba(159, 29, 43, 0.035));
  color: var(--blue);
  box-shadow: inset 0 0 0 1px rgba(159, 29, 43, 0.14);
}

.side-link.is-active .side-link__icon,
.side-link[aria-current="page"] .side-link__icon {
  background: var(--blue-soft);
  color: var(--blue);
}

.side-link:active,
.ghost-button:active,
.primary-button:active,
.reset-link:active,
.timeline-toggle:active {
  transform: scale(0.96);
}

.sidebar-watch {
  min-width: 0;
}

.account-panel {
  min-width: 0;
  align-self: end; /* 账户区固定在侧栏底部 */
}

.account-mini__profile {
  margin-top: 8px;
  width: 100%;
}

.account-mini {
  display: grid;
  gap: 6px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(111, 17, 28, 0.12);
}

.account-mini span,
.account-mini small {
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-mini strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 桌面端未登录卡片：理顺层级 + 实心 CTA */
@media (min-width: 981px) {
  .account-mini--guest {
    gap: 4px;
    padding: 16px 14px;
  }

  .account-mini--guest span {
    color: var(--blue);
    letter-spacing: 0.08em;
  }

  .account-mini--guest strong {
    font-size: 16px;
  }

  .account-mini--guest small {
    white-space: normal;
    line-height: 1.5;
    font-weight: 600;
  }

  .account-mini--guest .reset-link {
    margin-top: 10px;
    min-height: 42px;
    border-color: rgba(159, 29, 43, 0.24);
    background: linear-gradient(180deg, #b72a39 0%, #7f1620 100%);
    color: #fff;
    box-shadow: 0 10px 22px rgba(80, 13, 21, 0.26);
  }

  .account-mini--guest .reset-link:hover {
    filter: brightness(1.06);
  }
}

.reset-link {
  min-height: 38px;
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-sm);
  background: rgba(159, 29, 43, 0.05);
  color: var(--blue);
  font-weight: 800;
  cursor: pointer;
}

.main-surface {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

/* 桌面双列：左=我的自选+盘面+成绩单，右=信息流。核心「股票」与「消息」并排。 */
.surface-cols {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 14px;
  align-items: start;
}

.col-watch,
.col-feed {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

/* 列内已用 gap 控制间距，去掉面板自带的 margin-top 以免叠加。 */
.surface-cols .watch-panel,
.surface-cols .timeline-panel,
.surface-cols .scorecard-panel,
.surface-cols .market-clock-panel,
.surface-cols .overview-panel {
  margin-top: 0;
}

/* 未登录/空自选：退化单列，引导+推荐铺满，隐藏空的信息流列。 */
.surface-cols.is-single {
  grid-template-columns: 1fr;
}

.surface-cols.is-single .col-feed {
  display: none;
}

.surface-cols.is-feed-only {
  grid-template-columns: 1fr;
}

.surface-cols.is-feed-only .col-watch {
  display: none;
}

.surface-cols.is-feed-only .col-feed {
  display: grid;
}

/* 中等屏及以下回退单列：信息流排到自选下方。 */
@media (max-width: 1100px) {
  .surface-cols {
    grid-template-columns: 1fr;
  }
}

.topbar {
  display: none;
}

.topbar > div:first-child {
  min-width: 260px;
}

.ghost-button,
.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  padding: 0 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease, border-color 160ms ease, transform 120ms ease;
  white-space: nowrap;
}

.primary-button {
  color: #fff;
  background: linear-gradient(180deg, #b72a39 0%, #7f1620 100%);
  border-color: rgba(127, 22, 32, 0.7);
  box-shadow: 0 10px 22px rgba(80, 13, 21, 0.22);
}

.primary-button:disabled,
.ghost-button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.watch-panel,
.timeline-panel,
.scorecard-panel,
.market-clock-panel,
.overview-panel {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 253, 248, 0.96)),
    var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.account-workspace {
  display: grid;
  gap: 12px;
}

.account-workspace:empty {
  display: none;
}

.auth-page {
  position: fixed;
  inset: 0;
  /* 高于顶部导航(100)，低于 toast(200)：弹层打开时导航不可点、不穿透 */
  z-index: 120;
  display: grid;
  overflow-y: auto;
  padding: 24px;
  background: rgba(25, 24, 19, 0.58);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.auth-page[hidden] {
  display: none;
}

.auth-page__inner {
  position: relative;
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  /* margin auto 代替 place-items center：弹层超出视口高度时可滚动到顶部 */
  margin: auto;
  padding: 28px 26px;
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, #fffdf8, var(--surface));
  border: 1px solid rgba(111, 17, 28, 0.18);
  box-shadow: 0 24px 60px rgba(35, 28, 18, 0.35);
}

.auth-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--ink);
}

.auth-brand .brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(180deg, #b72a39 0%, #7f1620 100%);
}

.auth-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.auth-close:hover {
  color: var(--ink);
}

.auth-box {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdf8, var(--surface));
  border: 1px solid rgba(111, 17, 28, 0.14);
}

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

.auth-box__head p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-box__sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.auth-switch {
  justify-self: center;
  border: none;
  background: none;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.auth-switch:hover {
  text-decoration: underline;
}

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

.ghost-button.is-active {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
}

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

.auth-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

/* 登录/注册提交钮：无底色+线框，与导航同一套语言；红字红框保留主操作强调 */
.auth-form .primary-button {
  margin-top: 4px;
  min-height: 46px;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--blue);
  border-color: rgba(159, 29, 43, 0.5);
  box-shadow: none;
}

.auth-form .primary-button:hover {
  border-color: var(--blue);
  background: rgba(159, 29, 43, 0.04);
}

.auth-form input,
.watch-add input {
  min-width: 0;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.auth-form input {
  min-height: 46px;
  border-radius: var(--radius-md);
}

.auth-form input::placeholder {
  color: var(--muted);
  font-weight: 500;
  opacity: 1;
}

.auth-form input:focus {
  outline: 3px solid rgba(159, 29, 43, 0.2);
  border-color: rgba(159, 29, 43, 0.48);
}

/* 自选添加框：聚焦只换描边色，与首页搜索框同款，不出粉色光晕 */
.watch-add input:focus {
  outline: none;
  border-color: var(--blue);
}

.watch-add {
  grid-template-columns: minmax(180px, 1fr) auto;
}

.watch-add--side {
  grid-template-columns: 1fr;
  gap: 8px;
}

.watch-add__field {
  position: relative;
  min-width: 0;
}

.watch-add__field input {
  width: 100%;
}

/* 加入自选输入框：与个人中心胶囊、首页搜索框同一形状语言（登录表单不跟随） */
.watch-add input {
  border-radius: 999px;
}

.stock-suggest {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 60;
  margin: 0;
  padding: 4px;
  list-style: none;
  max-height: 264px;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 14px 32px rgba(35, 28, 18, 0.22);
}

.stock-suggest li {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
}

.stock-suggest li.is-active,
.stock-suggest li:hover {
  background: rgba(159, 29, 43, 0.08);
}

.stock-suggest .code {
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--blue);
}

.stock-suggest .name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink);
}

.stock-suggest .mkt {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
}

.stock-suggest .more {
  cursor: default;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
}

.stock-suggest .more:hover {
  background: none;
}

.toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 200;
  display: grid;
  gap: 8px;
  pointer-events: none;
}

.toast {
  justify-self: center;
  max-width: 80vw;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(38, 22, 20, 0.92);
  color: #fff7f0;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: 0 12px 30px rgba(35, 28, 18, 0.3);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.toast--error {
  background: rgba(159, 29, 43, 0.95);
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    transition: opacity 0.2s ease;
    transform: none;
  }
}

.watch-add--side .primary-button {
  min-height: 40px;
}

.account-message {
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  margin-top: 8px;
}

.auth-error {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #dc2626;
  font-size: 13px;
  font-weight: 800;
}

.auth-ok {
  margin: 0;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.32);
  color: #16a34a;
  font-size: 13px;
  font-weight: 800;
}

.profile-title {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.profile-id {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(159, 29, 43, 0.06);
  border: 1px solid rgba(159, 29, 43, 0.14);
}

.profile-id strong {
  font-size: 15px;
  color: var(--ink);
}

.profile-id small {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.profile-form {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.profile-label {
  margin: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-soft);
}

.profile-logout {
  margin-top: 4px;
  min-height: 44px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.32);
  color: #dc2626;
}

.profile-logout:hover {
  background: rgba(239, 68, 68, 0.14);
}

/* 个人中心弹层：统一圆角——按钮与输入框/身份卡一致（10px），不再有胶囊与方角混搭。 */
.profile-form .ghost-button,
.profile-logout {
  border-radius: var(--radius-md);
}

.account-details {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.account-details summary {
  cursor: pointer;
  color: var(--ink-soft);
  font-weight: 800;
}

.admin-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  font-size: 13px;
}

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

.admin-table th {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-table button,
.stock-remove {
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.admin-table button {
  margin-right: 6px;
  padding: 0 9px;
}

.stock-remove {
  padding: 0 8px;
}

.scorecard-panel {
  background: linear-gradient(180deg, #fff7f0, var(--surface));
  border-color: rgba(159, 29, 43, 0.16);
}

.market-clock-panel {
  display: none;
}

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

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

.stock-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

@keyframes stockCardIn {
  from { opacity: 0; transform: translateX(18px); }
  to { opacity: 1; transform: none; }
}

.stock-group__grid > .stock-card {
  animation: stockCardIn 320ms cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

.stock-group__grid > .stock-card:nth-child(1) { animation-delay: 0ms; }
.stock-group__grid > .stock-card:nth-child(2) { animation-delay: 45ms; }
.stock-group__grid > .stock-card:nth-child(3) { animation-delay: 90ms; }
.stock-group__grid > .stock-card:nth-child(4) { animation-delay: 135ms; }
.stock-group__grid > .stock-card:nth-child(n+5) { animation-delay: 180ms; }

@media (prefers-reduced-motion: reduce) {
  .stock-group__grid > .stock-card { animation: none; }
}

.watch-empty {
  display: grid;
  gap: 6px;
  min-height: 180px;
  align-content: center;
  justify-items: center;
  padding: 24px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px dashed rgba(100, 116, 139, 0.32);
  text-align: center;
}

.watch-empty h3 {
  font-size: 18px;
  font-weight: 800;
}

.watch-empty p {
  max-width: 520px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.market-home,
.market-card,
.quick-tools {
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 42px rgba(38, 22, 20, 0.07);
}

.market-home {
  display: grid;
  gap: 0;
  overflow: hidden;
  background: var(--surface);
  border-top: 2px solid var(--blue);
}

.market-home__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 24px 24px 14px;
  background:
    radial-gradient(circle at 88% 8%, rgba(159, 29, 43, 0.075), transparent 28%),
    linear-gradient(180deg, #fffdf8 0%, #fff8f3 100%);
  color: var(--ink);
}

.market-home__top .home-kicker {
  color: var(--blue);
}

.market-home__top h2 {
  color: var(--ink);
}

.market-home__top h2 {
  margin-top: 4px;
  font-size: clamp(26px, 3.4vw, 40px);
  font-family: var(--font-serif);
  font-weight: 900;
  letter-spacing: 0;
}

.market-home__top .primary-button {
  background: linear-gradient(180deg, #a51f2d 0%, #7f1620 100%);
  border-color: rgba(127, 22, 32, 0.5);
  box-shadow: 0 10px 22px rgba(80, 13, 21, 0.16);
}

.market-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  min-height: 48px;
  padding: 0 18px 10px;
  background: #fff8f3;
  scrollbar-width: none;
}

.market-tabs::-webkit-scrollbar,
.market-subtabs::-webkit-scrollbar {
  display: none;
}

.market-tab,
.market-subtab {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  cursor: pointer;
  white-space: nowrap;
}

.market-tab {
  min-height: 42px;
  padding: 0 16px;
  color: var(--muted);
  font-size: 17px;
  font-weight: 800;
}

.market-tab.is-active {
  color: var(--blue);
}

.market-subtabs {
  display: flex;
  justify-content: center;
  gap: clamp(42px, 12vw, 150px);
  overflow-x: auto;
  padding: 16px 18px 14px;
  background: var(--surface);
}

.market-subtab {
  position: relative;
  min-height: 42px;
  padding: 0 8px;
  color: #625b50;
  font-size: 18px;
  font-weight: 800;
}

.market-subtab.is-active {
  color: var(--ink);
}

.market-subtab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 34px;
  height: 4px;
  border-radius: 999px;
  background: #a51f2d;
  transform: translateX(-50%);
}

.market-card {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.market-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.market-section-head h3 {
  color: var(--ink);
  font-size: 24px;
  font-family: var(--font-serif);
  font-weight: 900;
  letter-spacing: 0;
}

.market-section-head span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.market-section-head button {
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.market-status {
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
}

.index-strip,
.market-overview__meta,
.market-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.index-tile,
.market-overview__meta > div,
.market-kpi-row > div {
  display: grid;
  gap: 6px;
  min-height: 96px;
  align-content: center;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #f3fbf6, var(--surface));
  text-align: center;
}

.index-tile span,
.market-overview__meta span,
.market-kpi-row span {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 900;
}

.index-tile strong,
.market-overview__meta strong,
.market-kpi-row strong {
  color: var(--green);
  font-size: 22px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.index-tile small {
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.breadth-bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  font-size: 13px;
  font-weight: 900;
}

.breadth-bar > div {
  display: flex;
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-2);
}

.breadth-bar i,
.breadth-bar b {
  display: block;
  height: 100%;
}

.breadth-bar i { background: var(--green); }
.breadth-bar b { background: var(--red); }

.market-comment {
  display: grid;
  gap: 4px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: rgba(245, 239, 228, 0.72);
}

.market-comment strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
}

.market-comment p {
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.65;
}

.quick-tools {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 16px;
}

.quick-tool {
  display: grid;
  gap: 5px;
  justify-items: center;
  min-height: 96px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
}

.quick-tool span {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 900;
}

.quick-tool strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
}

.quick-tool small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

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

.market-ranking,
.market-anomaly {
  grid-row: span 2;
}

.market-pill-tabs {
  display: inline-flex;
  justify-self: start;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface-2);
}

.market-pill-tabs span {
  min-width: 76px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
  text-align: center;
}

.market-pill-tabs .is-active {
  background: #fffdf8;
  color: var(--ink);
  box-shadow: 0 3px 10px rgba(35, 28, 18, 0.08);
}

.ranking-table {
  display: grid;
}

.ranking-table > div {
  display: grid;
  grid-template-columns: minmax(110px, 1fr) 72px 72px minmax(82px, 0.8fr);
  gap: 10px;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
}

.ranking-table > div:last-child {
  border-bottom: 0;
}

.ranking-table .is-head {
  min-height: 34px;
  color: var(--muted);
  font-size: 12px;
}

.ranking-table span:nth-child(2),
.ranking-table span:nth-child(3) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.market-placeholder-chart {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background:
    linear-gradient(rgba(83, 74, 58, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 74, 58, 0.035) 1px, transparent 1px),
    #fffdf8;
  background-size: 100% 45px, 72px 100%, auto;
}

.market-placeholder-chart::before {
  content: "";
  position: absolute;
  inset: 26px 18px 24px;
  clip-path: polygon(0 60%, 12% 44%, 28% 50%, 42% 34%, 58% 46%, 72% 30%, 88% 48%, 100% 38%, 100% 100%, 0 100%);
  background: linear-gradient(180deg, rgba(86, 137, 214, 0.42), rgba(86, 137, 214, 0.03));
}

.market-placeholder-chart::after {
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(86, 137, 214, 0.75), transparent);
  transform: rotate(-4deg);
}

.market-placeholder-chart--bars::before {
  inset: auto 18px 24px;
  height: 120px;
  clip-path: polygon(0 72%, 5% 72%, 5% 42%, 10% 42%, 10% 88%, 15% 88%, 15% 28%, 20% 28%, 20% 70%, 25% 70%, 25% 52%, 30% 52%, 30% 84%, 35% 84%, 35% 30%, 40% 30%, 40% 76%, 45% 76%, 45% 55%, 50% 55%, 50% 86%, 55% 86%, 55% 36%, 60% 36%, 60% 58%, 65% 58%, 65% 18%, 70% 18%, 70% 64%, 75% 64%, 75% 38%, 80% 38%, 80% 80%, 85% 80%, 85% 26%, 90% 26%, 90% 62%, 95% 62%, 95% 42%, 100% 42%, 100% 100%, 0 100%);
  background: linear-gradient(90deg, rgba(215, 53, 53, 0.58), rgba(22, 133, 77, 0.58));
}

.market-placeholder-chart--area::before {
  clip-path: polygon(0 52%, 14% 50%, 28% 54%, 42% 48%, 56% 50%, 70% 64%, 84% 70%, 100% 66%, 100% 100%, 0 100%);
}

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

.anomaly-grid article {
  display: grid;
  gap: 4px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--surface-2);
}

.anomaly-grid span,
.anomaly-grid small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.anomaly-grid strong {
  color: var(--red);
  font-size: 16px;
  font-weight: 900;
}

.sentiment-heat,
.valuation-zone {
  position: relative;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  min-height: 190px;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.sentiment-heat span,
.valuation-zone span {
  display: grid;
  align-items: start;
  padding: 12px;
  color: rgba(25, 24, 19, 0.52);
  font-size: 12px;
  font-weight: 900;
}

.sentiment-heat span:nth-child(1),
.valuation-zone span:nth-child(1) { background: rgba(215, 53, 53, 0.22); }
.sentiment-heat span:nth-child(2),
.valuation-zone span:nth-child(2) { background: rgba(215, 53, 53, 0.13); }
.sentiment-heat span:nth-child(3),
.valuation-zone span:nth-child(3) { background: rgba(247, 236, 210, 0.92); }
.sentiment-heat span:nth-child(4),
.valuation-zone span:nth-child(4) { background: rgba(22, 133, 77, 0.11); }
.sentiment-heat span:nth-child(5),
.valuation-zone span:nth-child(5) { background: rgba(22, 133, 77, 0.2); }

.sentiment-heat i,
.valuation-zone i {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 52%;
  height: 2px;
  background: #2d2b26;
  transform: rotate(-6deg);
}

.home-board {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 16px;
  align-items: stretch;
}

.home-board__intro,
.home-board__stats,
.home-ai-sample {
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 14px 42px rgba(35, 28, 18, 0.08);
}

.home-board__intro {
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 230px;
  padding: 28px;
  background:
    radial-gradient(circle at 88% 12%, rgba(159, 29, 43, 0.18), transparent 28%),
    linear-gradient(135deg, rgba(159, 29, 43, 0.14), rgba(255, 247, 240, 0) 46%),
    var(--surface);
}

.home-kicker {
  color: var(--blue);
  font-size: 12px;
  font-weight: 900;
}

.home-board__intro h2 {
  max-width: 760px;
  color: var(--ink);
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.home-board__intro p {
  max-width: 680px;
  color: var(--ink-soft);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.7;
  text-wrap: pretty;
}

.home-board__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.home-board__stats {
  display: grid;
  gap: 10px;
  padding: 16px;
  background: linear-gradient(180deg, #fffdf8, var(--surface));
}

.home-board__stats > div,
.home-ai-sample__facts > div {
  display: grid;
  gap: 4px;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: rgba(245, 239, 228, 0.72);
  border: 1px solid rgba(83, 74, 58, 0.08);
}

.home-board__stats span,
.home-ai-sample__facts span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.home-board__stats strong,
.home-ai-sample__facts strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
}

.home-board__stats small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.home-board__stats .pos,
.home-ai-sample .pos {
  color: var(--red);
}

.home-board__stats .neg,
.home-ai-sample .neg {
  color: var(--green);
}

.home-section {
  display: grid;
  gap: 12px;
  padding-top: 4px;
}

.home-ai-sample {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(260px, 0.9fr);
  gap: 16px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(159, 29, 43, 0.12), transparent 38%),
    linear-gradient(180deg, #fffdf8, var(--surface));
}

.home-ai-sample h3 {
  margin-top: 6px;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.012em;
}

.home-ai-sample p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  text-wrap: pretty;
}

.home-ai-sample__facts {
  display: grid;
  gap: 10px;
}

/* 推荐关注：新用户/空自选时的入口，覆盖人工信息源的股票。 */
.recommend {
  margin-top: 16px;
  display: grid;
  gap: 12px;
}

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

.recommend__head h3 {
  font-size: 16px;
  font-weight: 800;
}

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

.recommend__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.recommend-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdf8, var(--surface));
  border: 1px solid var(--line);
  cursor: pointer;
  transition: border-color 160ms ease, transform 120ms ease, box-shadow 160ms ease;
}

.recommend-card:hover,
.recommend-card:focus-visible {
  border-color: rgba(159, 29, 43, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(35, 28, 18, 0.1);
  outline: none;
}

.recommend-card__top {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.recommend-card__code {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.recommend-card__name {
  font-size: 15px;
  font-weight: 800;
}

.recommend-card__hero {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.recommend-card__pct {
  font-size: 17px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.recommend-card__pct.pos { color: var(--red); }
.recommend-card__pct.neg { color: var(--green); }

.recommend-card__theme {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.recommend-card__cta {
  justify-self: start;
  font-size: 12px;
  font-weight: 800;
  color: var(--blue);
}

/* 自选股命中不到人工信息源时的占位（行情仍实时）。 */
.stock-card__pending {
  display: grid;
  place-items: center;
  min-height: 46px;
  margin-top: 4px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(100, 116, 139, 0.3);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

/* pending 卡片里的最新真实公告（点击外链东财，阻止冒泡到卡片钻取） */
.stock-card__ann {
  display: grid;
  gap: 6px;
  margin-top: 4px;
  padding: 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  text-decoration: none;
  transition: border-color 140ms ease, background-color 140ms ease;
}

.stock-card__ann:hover {
  border-color: rgba(159, 29, 43, 0.28);
  background: #fff7f0;
}

.stock-card__ann-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.stock-card__ann-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.stock-card__ann-title {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.stock-card--pending {
  opacity: 0.92;
}

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

.stock-card {
  position: relative;
  display: grid;
  gap: 10px;
  padding: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}

.stock-card,
.update-card,
.detail-card {
  min-width: 0;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, #fffdf8, var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.stock-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(159, 29, 43, 0.09), transparent 36%);
  opacity: 0;
  transition: opacity 160ms ease;
}

.stock-card:hover::before,
.stock-card:focus-visible::before {
  opacity: 1;
}

.stock-card.is-selected {
  border-color: var(--blue);
  box-shadow: 0 0 0 1px rgba(159, 29, 43, 0.7), var(--shadow-sm);
}

.stock-card__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
}

.stock-card__status-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  max-width: 42%;
}

.stock-card__status-wrap .stock-card__status {
  max-width: 100%;
}

.stock-card__asof {
  font-size: 10px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.stock-card__status {
  max-width: 42%;
  min-height: 24px;
  padding: 3px 8px;
  line-height: 18px; /* 24px 高度内垂直居中，且保留 ellipsis（flex 居中会破坏截断） */
  border-radius: 999px;
  background: rgba(245, 239, 228, 0.88);
  color: var(--ink-soft);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stock-card--positive {
  background: linear-gradient(180deg, #fffdf8, rgba(250, 228, 224, 0.7));
  border-color: rgba(215, 53, 53, 0.18);
}

.stock-card--negative {
  background: linear-gradient(180deg, #fffdf8, rgba(227, 245, 235, 0.7));
  border-color: rgba(22, 133, 77, 0.18);
}

.stock-card--caution {
  background: linear-gradient(180deg, #fffdf8, rgba(247, 236, 210, 0.78));
  border-color: rgba(184, 122, 25, 0.22);
}

.stock-card.is-alert {
  box-shadow: 0 0 0 1px rgba(159, 29, 43, 0.18), var(--shadow-sm);
}

.stock-card__name {
  font-size: 17px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

/* 首行三元素（代号/名称/标签）行高统一为标签胶囊高度 24px，中线对齐 */
.stock-card__top .stock-card__code,
.stock-card__top .stock-card__name {
  line-height: 24px;
}

.stock-card__price {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink-soft);
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.stock-card__price::before {
  content: "现价";
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 700;
}

.stock-card__hero {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 4px;
}

.stock-card__pct {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 31px;
  font-weight: 700;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.stock-card__pct.pos { color: var(--red); }
.stock-card__pct.neg { color: var(--green); }

.trend-delta.pos { color: var(--red); }
.trend-delta.neg { color: var(--green); }

.limit-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.limit-badge--up {
  background: var(--red-soft);
  color: var(--red);
}

.limit-badge--down {
  background: var(--green-soft);
  color: var(--green);
}

.stock-trend {
  display: grid;
  gap: 4px;
  min-height: 54px;
  padding: 4px 0 2px;
}

.stock-trend__chart {
  display: block;
  width: 100%;
  height: 38px;
  overflow: visible;
}

.stock-trend__chart polyline {
  fill: none;
  stroke: var(--muted);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.stock-trend--pos .stock-trend__chart polyline {
  stroke: var(--red);
}

.stock-trend--neg .stock-trend__chart polyline {
  stroke: var(--green);
}

.stock-trend span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.back-button {
  justify-self: start;
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-soft);
  font-weight: 700;
  cursor: pointer;
}

.stock-dossier {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 18px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 100% 0%, rgba(159, 29, 43, 0.055), transparent 28%),
    linear-gradient(180deg, #fffdf8, var(--surface));
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.stock-dossier--positive { border-color: rgba(239, 68, 68, 0.24); }
.stock-dossier--negative { border-color: rgba(34, 197, 94, 0.24); }
.stock-dossier--caution { border-color: rgba(245, 158, 11, 0.26); }

.stock-dossier__hero {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 20px;
  min-width: 0;
}

.stock-dossier__identity {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 0;
}

.stock-dossier__hero-chart {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* 详情页两栏布局：左侧自选侧栏（ChatGPT 会话栏式切换） + 右侧档案 */
.dossier-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

/* 详情页整页放开 860px 居中限制：侧栏与导航「查」标左对齐（同 28px 内边距），档案区横向铺满剩余宽度 */
.page-content:has(.dossier-layout) {
  max-width: none;
  padding-left: 28px;
  padding-right: 28px;
}

.dossier-main {
  min-width: 0;
}

.watch-sidebar {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.watch-sidebar__title {
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.watch-sidebar__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: calc(100vh - 170px);
  overflow-y: auto;
}

.watch-sidebar__item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 8px;
  border: 0;
  border-radius: 8px;
  background: none;
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.watch-sidebar__item:hover {
  background: var(--surface-2);
}

.watch-sidebar__item.is-active {
  background: var(--surface-2);
  font-weight: 700;
}

.watch-sidebar__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.watch-sidebar__pct {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.watch-sidebar__pct.pos { color: var(--red); }
.watch-sidebar__pct.neg { color: var(--green); }

.stock-dossier__snapshot {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  padding: 10px 14px;
  background: var(--surface-2);
  border-radius: 8px;
}

.stock-dossier__snapshot > div {
  display: flex;
  align-items: baseline;
  gap: 5px;
}

.stock-dossier__snapshot span {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.stock-dossier__snapshot strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
}

.stock-dossier__code {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
}

.stock-dossier__identity h2 {
  margin-top: 2px;
  font-size: 28px;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.stock-dossier__price {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}

.stock-dossier__price strong {
  font-size: 22px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
  color: var(--ink);
  line-height: 1.1;
  white-space: nowrap;
}

.stock-dossier__price span {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.stock-dossier__price span.positive { color: var(--pos); }
.stock-dossier__price span.negative { color: var(--neg); }
.stock-dossier__price span.neutral  { color: var(--muted); }

.stock-dossier__status {
  position: relative;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--blue);
  font: inherit;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.15;
  cursor: help;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 4px;
}

.stock-dossier__price span.stock-dossier__asof {
  font-size: 11px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.stock-dossier__status::after {
  content: attr(data-tip);
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 4;
  width: min(320px, calc(100vw - 56px));
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: #201817;
  color: #fffdf8;
  box-shadow: 0 14px 32px rgba(38, 22, 20, 0.18);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.55;
  text-align: left;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.stock-dossier__status:hover::after,
.stock-dossier__status:focus-visible::after,
.stock-dossier__status.is-open::after {
  opacity: 1;
  transform: translateY(0);
}

.stock-dossier__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(240px, 0.85fr);
  gap: 12px;
  min-width: 0;
}

.stock-dossier__chart,
.stock-dossier__facts > div,
.stock-dossier__score > div,
.stock-dossier__latest {
  min-width: 0;
  padding: 13px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.decision-block {
  min-width: 0;
  padding: 15px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
}

.decision-block--info {
  padding: 20px;
  border-color: rgba(159, 29, 43, 0.24);
  background:
    radial-gradient(circle at 100% 0%, rgba(159, 29, 43, 0.075), transparent 30%),
    linear-gradient(90deg, rgba(159, 29, 43, 0.055), transparent 42%),
    var(--surface);
  box-shadow: 0 18px 42px rgba(80, 13, 21, 0.08);
}

.decision-block__head {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
  margin-bottom: 12px;
}

.decision-block__head span {
  color: var(--blue);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
}

.decision-block__head h3 {
  color: var(--ink);
  font-size: 18px;
  font-weight: 900;
}

.decision-block--info .decision-block__head h3 {
  font-size: 24px;
}

.decision-block--info .decision-block__head span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
}

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

.decision-metrics > div,
.decision-fact-grid > article,
.concept-box,
.verdict-card {
  min-width: 0;
  padding: 13px;
  border-radius: var(--radius-sm);
  background: rgba(247, 241, 234, 0.62);
  border: 1px solid rgba(111, 17, 28, 0.08);
}

.decision-block--info .decision-fact-grid > article:first-child {
  background: rgba(255, 253, 248, 0.92);
  border-color: rgba(159, 29, 43, 0.16);
}

.decision-block--info .decision-fact-grid > article:last-child {
  background: rgba(247, 234, 220, 0.72);
  border-color: rgba(184, 122, 25, 0.16);
}

.decision-metrics span,
.decision-metrics small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.decision-metrics strong {
  display: block;
  margin: 3px 0 1px;
  color: var(--ink);
  font-size: 20px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.decision-metrics strong.pos { color: var(--red); }
.decision-metrics strong.neg { color: var(--green); }

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

.decision-fact-grid h4,
.concept-box strong,
.verdict-card strong {
  display: block;
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 900;
}

.decision-fact-grid ul {
  margin: 0;
  padding-left: 18px;
}

.decision-fact-grid li {
  margin: 6px 0;
  color: var(--ink-soft);
  font-weight: 750;
}

.decision-fact-grid p,
.concept-box p,
.verdict-card p {
  margin: 0;
  color: var(--ink-soft);
  font-weight: 650;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.concept-box {
  background: rgba(248, 231, 233, 0.55);
}

.verdict-card {
  background: rgba(248, 231, 233, 0.6);
}

.verdict-card--positive { background: var(--red-soft); border-color: rgba(215, 53, 53, 0.18); }
.verdict-card--negative { background: var(--green-soft); border-color: rgba(22, 133, 77, 0.18); }
.verdict-card--caution { background: var(--amber-soft); border-color: rgba(184, 122, 25, 0.18); }

.price-map {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

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

.price-card strong {
  display: block;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-family: var(--font-mono);
  margin-bottom: 5px;
}

.price-card span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.price-card--resistance strong { color: var(--amber); }
.price-card--support strong    { color: var(--green); }
.price-card--critical strong   { color: var(--red); }

.judgment-box {
  border-radius: var(--radius-md);
  padding: 16px;
  background: var(--surface-2);
  font-size: 14px;
  line-height: 1.75;
}

.judgment-box--empty {
  color: var(--muted);
  text-align: center;
  padding: 28px 16px;
  border: 1px dashed var(--line-strong);
  background: transparent;
}

.source-list {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

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

.stock-dossier__facts span,
.stock-dossier__score span,
.stock-dossier__latest > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stock-dossier__facts strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

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

.stock-dossier__score strong {
  display: block;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.stock-dossier__score small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.detail-forecast {
  display: grid;
  gap: 5px;
  margin-top: 4px;
}

.detail-forecast strong {
  margin-top: 0;
  font-family: var(--font-sans);
  font-size: 16px;
}

.detail-forecast small {
  margin-top: 0;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
}

.detail-empty {
  display: block;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.stock-dossier__latest h3 {
  margin-top: 6px;
  font-size: 17px;
  overflow-wrap: anywhere;
}

.stock-dossier__latest p {
  margin-top: 8px;
  color: var(--ink-soft);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.stock-dossier__latest ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.stock-dossier__latest li {
  margin: 5px 0;
  color: var(--ink-soft);
  overflow-wrap: anywhere;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 8px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  border: 1px solid transparent;
}

.pill--green { background: var(--green-soft); color: var(--green); border-color: rgba(34, 197, 94, 0.28); }
.pill--red { background: var(--red-soft); color: var(--red); border-color: rgba(239, 68, 68, 0.28); }
.pill--amber { background: var(--amber-soft); color: var(--amber); border-color: rgba(245, 158, 11, 0.28); }
.pill--blue { background: var(--blue-soft); color: var(--blue); border-color: rgba(159, 29, 43, 0.28); }
.pill--gray { background: rgba(148, 163, 184, 0.14); color: var(--muted); border-color: rgba(148, 163, 184, 0.22); }

.metric-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.metric-value {
  display: block;
  margin-top: 1px;
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.metric-value.pos { color: var(--red); }
.metric-value.neg { color: var(--green); }

.update-feed {
  position: relative;
  display: grid;
  gap: 10px;
}

.update-feed::before {
  content: "";
  position: absolute;
  top: 46px;
  bottom: 16px;
  left: 100px;
  width: 1px;
  background: linear-gradient(180deg, rgba(159, 29, 43, 0.5), rgba(159, 29, 43, 0.08));
}

.timeline-day-head {
  position: relative;
  display: grid;
  grid-template-columns: 86px 28px minmax(0, 1fr);
  align-items: center;
  min-height: 28px;
  color: var(--muted);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.timeline-day-head span {
  justify-self: start;
  font-size: 13px;
  white-space: nowrap;
}

.timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 86px 28px minmax(0, 1fr);
  gap: 0;
  align-items: start;
}

.timeline-dot {
  grid-column: 2;
  position: relative;
  z-index: 1;
  width: 8px;
  height: 8px;
  margin: 18px auto 0;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(159, 29, 43, 0.18);
}

.timeline-item--latest .timeline-dot {
  background: var(--blue);
  box-shadow: 0 0 0 4px rgba(159, 29, 43, 0.24);
}

.timeline-time {
  grid-column: 1;
  display: grid;
  justify-items: end;
  gap: 5px;
  padding-top: 13px;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

.timeline-time span {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1;
  text-align: right;
  white-space: nowrap;
  word-break: keep-all;
  overflow-wrap: normal;
}

.timeline-time strong {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
}

.update-card {
  grid-column: 3;
  padding: 14px;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.timeline-item--latest .update-card {
  background: linear-gradient(180deg, #fff7f0 0%, var(--surface) 100%);
  border-color: rgba(159, 29, 43, 0.22);
}

/* 公告条目：信息源层，视觉比人工解读更轻，与解读区分 */
.timeline-dot--ann {
  background: var(--muted);
  box-shadow: 0 0 0 4px rgba(134, 120, 114, 0.16);
}

.update-card--ann {
  display: grid;
  gap: 6px;
}

.ann-head {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.ann-stock {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.ann-title {
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.ann-title:hover {
  color: var(--blue);
  text-decoration: underline;
}

.ann-source {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.pill--ann {
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

.pill--news {
  background: var(--blue-soft);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.28);
}

.summary {
  color: var(--ink-soft);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.update-card > .summary:first-child {
  color: var(--ink);
  font-size: 15px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.timeline-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  margin-top: 12px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms ease;
}

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

.detail-grid.is-collapsed {
  display: none;
}

.detail-card {
  padding: 13px;
  background: var(--surface-2);
  box-shadow: none;
}

.detail-card h3 {
  margin-bottom: 7px;
}

.detail-card > p:not(.summary) {
  color: var(--ink);
  font-weight: 600;
  line-height: 1.55;
}

.detail-card ul {
  margin: 10px 0 0;
  padding-left: 18px;
}

.detail-card li {
  margin: 6px 0;
  color: var(--ink-soft);
}

.detail-card .summary {
  margin-top: 10px;
  padding: 10px;
  border-radius: var(--radius-sm);
  background: #f1f5f9;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
}

.forecast-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--line-strong);
}

.forecast-tag {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.forecast-dir {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
}

.forecast-conf {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.overview-grid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 22px;
}

.ov-tally,
.ov-extremes {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.ov-tally {
  font-family: var(--font-mono);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ov-up,
.ov-extreme .pos { color: var(--red); }
.ov-down,
.ov-extreme .neg { color: var(--green); }
.ov-flat { color: var(--muted); }

.ov-extreme {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
}

.ov-extreme i {
  color: var(--muted);
  font-style: normal;
}

.ov-time {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
}

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

.score-cell {
  display: grid;
  gap: 4px;
  align-content: start;
  padding: 13px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

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

.score-value {
  font-family: var(--font-mono);
  font-size: 24px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.score-value.pos { color: var(--red); }
.score-value.neg { color: var(--green); }

.score-cell small {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

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

.market-clock-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.market-clock-card__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.market-clock-card__label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.market-clock-card__top strong {
  display: block;
  margin-top: 2px;
  font-size: 18px;
  font-weight: 800;
}

.market-clock-card__time {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

.market-clock-card__meta {
  display: grid;
  gap: 5px;
}

.market-clock-card__meta span,
.market-clock-card__foot {
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 700;
}

.market-clock-card__meta b {
  display: inline-block;
  min-width: 64px;
  color: var(--muted);
  font-weight: 700;
}

.market-clock-card__foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-variant-numeric: tabular-nums;
  font-family: var(--font-mono);
}

.market-clock-card--trading .market-clock-card__top strong { color: var(--red); }
.market-clock-card--lunch .market-clock-card__top strong,
.market-clock-card--preopen .market-clock-card__top strong { color: var(--amber); }
.market-clock-card--holiday .market-clock-card__top strong,
.market-clock-card--weekend .market-clock-card__top strong,
.market-clock-card--closed .market-clock-card__top strong { color: var(--muted); }

.muted.is-warning {
  color: var(--amber);
  font-weight: 800;
}

@media (min-width: 1440px) {
  .stock-group__grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .stock-group__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .scorecard-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-clock-panel {
    display: block;
  }

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

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

  /* 移动端：侧栏改成顶部横条，保留品牌 / 导航 / 账户入口；时钟在主区已有面板故隐藏 */
  .sidebar {
    position: static;
    height: auto;
    grid-template-rows: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  }

  .brand {
    flex: 1 1 auto;
    min-height: 0;
  }

  .account-panel {
    flex: 0 0 auto;
    margin-left: auto;
    align-self: center; /* 复位桌面的 end 对齐 */
  }

  /* 移动端：加入自选表单独占一行，置于顶部横条最后 */
  .sidebar-watch {
    flex: 1 1 100%;
    order: 9;
  }

  .account-mini {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
  }

  .account-mini span,
  .account-mini small {
    display: none;
  }

  /* 未登录态：移动端只留"登录/注册"按钮，文字与卡片外壳都去掉 */
  .account-mini--guest {
    padding: 0;
    background: none;
    border: 0;
  }

  .account-mini--guest strong {
    display: none;
  }

  .account-mini .reset-link {
    min-height: 34px;
    padding: 0 12px;
    white-space: nowrap;
  }

  .side-nav {
    order: 3;
    flex: 1 1 100%;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    justify-content: start;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-link {
    width: auto;
    min-height: 38px;
    padding: 0 14px;
  }

  .main-surface {
    max-width: none;
    padding: 16px 14px 44px;
  }

  .topbar {
    display: block;
    min-height: 0;
    padding: 12px 0 14px;
    border-bottom: 1px solid var(--line);
  }

  .topbar h1 {
    font-size: 24px;
    line-height: 1.05;
  }

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

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

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

  .auth-form,
  .watch-add {
    grid-template-columns: 1fr;
  }

  .auth-box__head {
    display: grid;
  }
}

@media (max-width: 640px) {
  body {
    background: linear-gradient(180deg, var(--canvas-2) 0%, var(--canvas) 100%);
    color: var(--ink);
  }

  h1 {
    font-size: 32px;
  }

  .topbar h1 {
    font-size: 24px;
  }

  h2 {
    font-size: 19px;
  }

  .main-surface {
    padding: 12px 10px 38px;
  }

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

  .metric-row {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .stock-dossier {
    padding: 12px;
  }

  .stock-dossier__hero {
    flex-direction: column;
    gap: 12px;
  }

  .stock-dossier__price {
    align-items: flex-start;
    order: -1;
  }

  .stock-dossier__identity h2 {
    font-size: 24px;
  }

  .stock-dossier__facts,
  .stock-dossier__score {
    grid-template-columns: 1fr;
  }

  .decision-block {
    padding: 13px;
  }

  .decision-block--info {
    padding: 15px;
  }

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

  .decision-metrics,
  .decision-fact-grid {
    grid-template-columns: 1fr;
  }

  .metric-row > div {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 8px;
    align-items: baseline;
  }

  .timeline-panel {
    margin-top: 18px;
    padding: 14px 8px 14px 10px;
  }

  .update-feed::before {
    display: block;
    top: 44px;
    bottom: 16px;
    left: 73px;
  }

  .timeline-day-head {
    grid-template-columns: 62px 22px minmax(0, 1fr);
    min-height: 26px;
  }

  .timeline-item {
    grid-template-columns: 62px 22px minmax(0, 1fr);
  }

  .timeline-time span {
    max-width: 62px;
    white-space: nowrap;
    font-size: 15px;
    line-height: 1;
    text-align: right;
  }

  .timeline-time strong {
    min-height: 20px;
    padding: 0 6px;
    font-size: 10px;
    white-space: nowrap;
  }

  .timeline-dot {
    margin-top: 15px;
  }

  .update-card {
    padding: 12px;
    min-width: 0;
  }

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

  .price-map {
    grid-template-columns: 1fr;
  }

  .timeline-toggle {
    width: 100%;
    min-height: 38px;
  }

  .auth-box {
    padding: 12px;
  }

  .auth-actions {
    width: 100%;
  }

  .auth-actions .ghost-button {
    flex: 1 1 auto;
  }
}

@media (max-width: 380px) {
  .section__head {
    align-items: start;
  }

  .ghost-button {
    min-height: 36px;
    padding: 0 10px;
  }

  .timeline-panel {
    padding-left: 8px;
    padding-right: 8px;
  }

  .update-feed::before {
    left: 66px;
  }

  .timeline-day-head {
    grid-template-columns: 56px 20px minmax(0, 1fr);
  }

  .timeline-item {
    grid-template-columns: 56px 20px minmax(0, 1fr);
  }

  .timeline-time span {
    max-width: 56px;
    font-size: 14px;
  }
}

@media (max-width: 760px) {
  /* 窄屏：侧栏折叠成档案上方的横向滚动条 */
  .dossier-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .watch-sidebar {
    position: static;
    flex-direction: row;
    align-items: center;
    padding: 8px 10px;
  }

  .watch-sidebar__title {
    flex: 0 0 auto;
    padding: 0;
  }

  .watch-sidebar__list {
    flex-direction: row;
    gap: 4px;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .watch-sidebar__item {
    flex: 0 0 auto;
    padding: 6px 10px;
  }

  .market-home__top {
    display: grid;
    padding: 18px 16px 2px;
  }

  .market-home__top .primary-button {
    width: 100%;
  }

  .market-tab {
    min-height: 38px;
    padding: 0 12px;
    font-size: 15px;
  }

  .market-subtabs {
    justify-content: space-around;
    gap: 20px;
  }

  .market-card {
    padding: 16px;
  }

  .market-section-head h3 {
    font-size: 22px;
  }

  .index-strip,
  .market-overview__meta,
  .market-kpi-row,
  .market-module-grid {
    grid-template-columns: 1fr;
  }

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

  .ranking-table > div {
    grid-template-columns: minmax(92px, 1fr) 58px 58px minmax(68px, 0.8fr);
    gap: 8px;
    font-size: 13px;
  }

  .market-placeholder-chart,
  .sentiment-heat,
  .valuation-zone {
    min-height: 150px;
  }

  .home-board,
  .home-ai-sample {
    grid-template-columns: 1fr;
  }

  .home-board__intro {
    min-height: 0;
    padding: 18px;
  }

  .home-board__intro h2 {
    font-size: 30px;
  }

  .home-board__actions {
    display: grid;
  }

  .home-board__actions .primary-button,
  .home-board__actions .ghost-button {
    width: 100%;
  }

  .home-board__stats,
  .home-ai-sample {
    padding: 14px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .topbar,
  .watch-panel,
  .timeline-panel {
    animation: fade-in 180ms ease-out both;
  }

  .watch-panel { animation-delay: 40ms; }
  .timeline-panel { animation-delay: 80ms; }

  @keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
}

/* ============================================================
   TOP NAV
   ============================================================ */

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 0;
  height: 58px;
  padding: 0 28px;
  background: rgba(255, 253, 248, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: background 240ms, border-color 240ms, backdrop-filter 240ms;
}

/* 首页：导航栏透明，文字浮在背景上 */
body.is-hero .top-nav {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* 非首页：内容区顶部补偿固定导航高度 */
body:not(.is-hero) .main-surface {
  padding-top: 58px;
}

/* 首页：清除所有媒体查询对 main-surface 的 padding（旧侧边栏遗留规则），保证 home-A 从视口顶端开始 */
body.is-hero .main-surface {
  padding: 0 !important;
}

/* 首页：确保 app-shell 保持 flex 列布局（覆盖 ≤980px 的 display:block 旧规则） */
body.is-hero .app-shell {
  display: flex;
  flex-direction: column;
}

.top-nav__brand {
  display: flex;
  align-items: center;
  gap: 9px;
  text-decoration: none;
}

.top-nav__brand .brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  font-size: 14px;
}

.top-nav__brand strong {
  font-family: var(--font-serif);
  font-size: 16px;
  font-weight: 900;
  color: var(--ink);
}

.top-nav__links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: auto;
  margin-right: 16px;
}

.top-link {
  display: inline-flex;
  align-items: center;
  min-height: 40px; /* 与个人中心胶囊（26px 头像 + 上下 6px + 边框）等高 */
  border: 1px solid transparent; /* 占位边框，高亮切圈线时不跳动 */
  background: transparent;
  color: var(--ink-soft);
  font-size: 14px;
  font-weight: 600;
  padding: 0 16px;
  border-radius: 999px; /* 与个人中心胶囊、首页搜索框同一形状语言 */
  cursor: pointer;
  transition: background 140ms, color 140ms;
  white-space: nowrap;
}

.top-link:hover {
  border-color: var(--line); /* 悬停浮现线框，与高亮同一套语言 */
  color: var(--blue);
}

.top-link.is-active,
.top-link[aria-current="page"] {
  background: var(--surface);
  border-color: var(--line); /* 高亮 = 圈线，与个人中心圆钮同一套设计 */
  color: var(--blue);
}

/* 登录：与「自选」完全同款——平时黑字无框，悬停红字浮现线框 */
.top-link--cta {
  background: transparent;
  color: var(--ink-soft);
  padding: 0 18px;
}

/* ============================================================
   USER MENU (top-right dropdown)
   ============================================================ */

.user-menu {
  position: relative;
  display: flex;
  align-items: center;
}

.user-pill {
  display: flex;
  align-items: center;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px; /* 只留头像的 40px 圆钮，昵称收进下拉菜单 */
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  transition: border-color 140ms, box-shadow 140ms;
  user-select: none;
}

.user-pill:hover {
  border-color: var(--line-strong);
  box-shadow: 0 2px 8px rgba(38, 22, 20, 0.08);
}

.user-pill__avatar {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: transparent; /* 只留外圈线，去掉底色块，避免双层视觉 */
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
}

.user-pill__caret {
  font-size: 11px;
  color: var(--muted);
}

/* ============ 查查币（充值 UI） ============ */
.user-dropdown__item.user-dropdown__coins {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
}

.user-dropdown__coins-val {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 1em;
  font-family: var(--font-serif);
  font-size: 14px;
  line-height: 1;
  font-weight: 800;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  transform: translate(-1px, 1px);
}

.profile-coins {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.coin-num {
  margin: 2px 0 0;
  font-family: var(--font-serif);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--blue);
  font-variant-numeric: tabular-nums;
}

.coin-num small {
  margin-left: 6px;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
}

.auth-page__inner--recharge {
  max-width: 460px;
}

.coin-balance {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.coin-rate {
  font-size: 12px;
  color: var(--muted);
  padding-bottom: 6px;
}

.coin-pricelist {
  margin: 0;
  padding: 4px 0;
  list-style: none;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.coin-pricelist li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--ink-soft);
}

.coin-pricelist li span:last-child {
  flex: 0 0 auto;
  font-weight: 600;
  color: var(--ink);
}

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

.coin-tier {
  display: grid;
  gap: 4px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: none;
  font: inherit;
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  transition: border-color 140ms, background 140ms, color 140ms;
}

.coin-tier:hover {
  border-color: var(--line-strong);
}

.coin-tier.is-selected {
  border-color: rgba(159, 29, 43, 0.5);
  background: rgba(159, 29, 43, 0.04);
  color: var(--blue);
}

.coin-tier__price {
  font-family: var(--font-serif);
  font-size: 21px;
  font-weight: 700;
}

.coin-tier__label {
  font-size: 13px;
  font-weight: 600;
}

.coin-tier__anchor {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.coin-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--ink-soft);
}

.coin-custom input {
  width: 88px;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.coin-custom input:focus {
  outline: none;
  border-color: var(--blue);
}

.coin-custom__hint {
  font-size: 12px;
  color: var(--muted);
}

.coin-methods {
  display: flex;
  gap: 8px;
}

.coin-method {
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color 140ms, color 140ms, background 140ms;
}

.coin-method.is-selected {
  border-color: rgba(159, 29, 43, 0.5);
  background: rgba(159, 29, 43, 0.04);
  color: var(--blue);
}

.coin-pay {
  display: grid;
  gap: 6px;
}

.coin-pay .primary-button {
  min-height: 46px;
  background: transparent;
  color: var(--blue);
  border-color: rgba(159, 29, 43, 0.5);
  box-shadow: none;
}

.coin-pay .primary-button:hover:not(:disabled) {
  border-color: var(--blue);
  background: rgba(159, 29, 43, 0.04);
}

.coin-pay__note {
  margin: 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
}

.coin-rules {
  margin: 0;
  padding: 10px 0 0 18px;
  border-top: 1px solid var(--line);
  font-size: 12px;
  color: var(--muted);
  display: grid;
  gap: 4px;
}

.watch-fee-note {
  margin: -6px 0 0;
  padding: 0 18px;
  font-size: 12px;
  color: var(--muted);
}

.fee-link {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  color: var(--blue);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.user-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 200px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 32px rgba(38, 22, 20, 0.14);
  z-index: 200;
  overflow: hidden;
}

.user-dropdown__info {
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
}

.user-dropdown__info strong {
  display: block;
  font-size: 14px;
  color: var(--ink);
}

.user-dropdown__info small {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.user-dropdown__item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 16px;
  border: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms;
}

.user-dropdown__item:hover {
  background: var(--surface-2);
  color: var(--ink);
}

.user-dropdown__item--danger {
  color: var(--red);
}

.user-dropdown__item--danger:hover {
  background: var(--red-soft);
  color: var(--red);
}

/* ============================================================
   HOME HERO
   ============================================================ */

.home-hero {
  flex: 1;
  min-height: 100vh;
  overflow: hidden;
}

.home-hero[hidden] {
  display: none;
}

/* 单层 grid 居中，calc 与 demo 保持一致：内容中心在 50vh-21px（略高于正中） */
.home-A {
  position: relative;
  width: 100%;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 42px);
}

.home-topbrand {
  position: absolute;
  top: 24px;
  left: 32px;
  display: none; /* 顶部 nav 已有品牌，hero 内部不重复 */
}

.home-center {
  position: relative;
  width: min(680px, 90vw);
  text-align: center;
}

.home-slogan {
  font-family: var(--font-serif);
  font-weight: 400;
  font-style: italic;
  font-size: clamp(20px, 2.4vw, 32px);
  line-height: 1.45;
  letter-spacing: 0.03em;
  color: var(--ink);
  margin: 14px 0 28px;
  transform: translateY(-40px);
}

.home-attr {
  position: absolute;
  left: 0;
  top: 0;
  color: var(--muted);
  font-family: var(--font-serif); /* 与主标题同字体同斜体 */
  font-style: italic;
  font-size: 13px;
  letter-spacing: 0.12em;
  margin: 0;
  pointer-events: none;
  white-space: nowrap;
  transform-origin: left center;
}

.home-searchbox {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 22px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  box-shadow: 0 22px 60px rgba(38, 22, 20, 0.14);
  transition: border-color 200ms, box-shadow 200ms;
}

.home-searchbox:focus-within {
  border-color: var(--blue);
  box-shadow: 0 26px 70px rgba(159, 29, 43, 0.18);
}

.home-searchbox input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 17px;
  padding: 12px 0;
  color: var(--ink);
  font-family: var(--font-sans);
}

.home-searchbox input::placeholder {
  color: #b3a59d;
}

.home-go-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-go {
  border: 0;
  background: #7f1620;
  color: #fff7f0;
  font-weight: 600;
  font-size: 15px;
  padding: 13px 26px;
  border-radius: 999px;
  box-shadow: 0 10px 22px rgba(127, 22, 32, 0.24);
  transition: background 160ms;
  cursor: pointer;
}

.home-go:hover {
  background: #9f1d2b;
}

.home-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 16px;
  right: 16px;
  width: auto;
  z-index: 50;
}

/* ============================================================
   PAGE CONTENT (non-home views)
   ============================================================ */

.page-content {
  max-width: 860px;
  margin: 0 auto;
  padding: 28px 24px 76px;
  width: 100%;
  display: grid;
  gap: 14px;
  align-content: start;
}

.page-content[hidden] {
  display: none;
}

/* page-content 用 grid gap 控制间距，消除面板自带 margin-top 的叠加 */
.page-content > .overview-panel,
.page-content > .timeline-panel,
.page-content > .watch-panel {
  margin-top: 0;
}

/* 加入自选 / 切换精选 — inline 在内容区顶部 */
.watch-add--inline {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px 10px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px; /* 与导航自选高亮、个人中心胶囊、首页搜索框统一 */
  box-shadow: var(--shadow-sm);
}

.watch-add--inline .watch-add__field {
  flex: 1;
  position: relative;
}

.watch-add--inline input {
  width: 100%;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
  padding: 6px 0;
  color: var(--ink);
}

.watch-add--inline input::placeholder {
  color: var(--muted);
}

@media (max-width: 640px) {
  .top-nav { padding: 0 16px; height: 52px; }
  .top-nav__links { gap: 0; margin-right: 10px; }
  .top-link { padding: 0 12px; min-height: 34px; font-size: 13px; }
  .home-hero { min-height: 100vh; }
  .home-A { min-height: calc(100vh - 42px); }
  .home-slogan { font-size: 17px; }
  .home-searchbox { padding-left: 16px; }
  .home-searchbox input { font-size: 16px; }
  .home-go { padding: 11px 18px; font-size: 14px; }
  .page-content { padding: 18px 16px 60px; }
}
