/* ============================================================
   股票基础信息查询 — 浅色主题样式
   设计原则：信息密度适中、卡片分区清晰、窄屏不破版
   ============================================================ */

:root {
  --bg: #f6f8fb;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-sub: #475569;
  --text-mute: #94a3b8;
  --primary: #2563eb;
  --primary-weak: #eff6ff;
  --danger: #dc2626;
  --danger-weak: #fef2f2;
  --warning: #b45309;
  --warning-weak: #fffbeb;
  --success: #15803d;
  --success-weak: #f0fdf4;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, 0.08);
  --font: "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

/*
 * 全局兜底：带 hidden 属性的元素必须真的不显示。
 *
 * 为什么必须显式写这一条：UA 样式表里的 `[hidden] { display: none }` 属于
 * **浏览器默认样式**，任何作者样式（哪怕只是一条 `.chart-grid { display: grid }`）
 * 都会把它压过去。本项目此前为 `.result-area` / `.trend-body` / `.modal` 等
 * 逐个补了 `[hidden]` 规则，却漏了 `.chart-grid` —— 而 `#chart-skeleton` 与
 * `#chart-body` 恰好都用这个类，于是 JS 设 `hidden = true` 之后骨架屏仍以
 * grid 布局留在页面上：用户看到「下方 6 张图正常、上方还有 6 张载入中」。
 * 与其继续逐个类去补，这里统一兜底，新增容器不会再踩同一个坑。
 */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部 ---------- */

.app-header {
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 20px 14px;
}

/* R45：账号入口要固定到顶栏**最右侧**，因此 .brand 变成一行 flex：
       左 = h1（标题 + 两个胶囊入口 + 区块导航），右 = 账号入口（margin-left:auto）。
       入口默认 hidden（服务不可用时保持隐藏），此时 flex 行里只剩 h1，
       布局与改动前逐像素一致，不影响任何既有视觉。

       ⚠️ R45 修正：`.brand` 是 `.header-inner`（flex, wrap）的子项，此前没有自己的
       flex 规则，于是按默认的 `flex: 0 1 auto` **收缩到内容宽度**（实测 915px）。
       `margin-left: auto` 只能把入口推到这 915px 的右缘 —— 视口越宽、离内容容器
       右缘越远（1440/1920 下差 325px），看上去根本不在「页面的最右侧」。
       与 R24 查询栏那条修复是同一个坑（见 `.header-inner > .query-bar`）：让它
       独占一行并撑满容器后，入口右缘才与查询栏 / 内容卡片严格对齐。
       港美股页是同款问题、同款处理（见 css/hkus.css 的 .hk-header-top）。

       R167：按用户要求改成与港美股页同构的两栏 ——
       左栏 = 标题 + 其下方的区块导航（.brand），右栏 = 三个胶囊入口（.header-actions）。
       手机端两栏各占整行（胶囊那一行靠右），与港美股页的窄屏表现一致。 */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  flex: 1 0 100%;
  min-width: 0;
}

.brand {
  /* 不写 min-width:0：让 flex 项的默认 min-width:auto（= 导航 nowrap 的最小内容宽）
     生效。中等宽度（≈770–900px）放不下「导航 + 三个胶囊」时，胶囊会整行折到下一行，
     而不是让导航横向溢出把页面撑出滚动条。 */
  flex: 1 1 auto;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  margin-left: auto;
}

.brand > h1 {
  flex: 0 0 auto;
  min-width: 0;
}

.brand h1 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.brand-sub {
  display: block;
  margin: 6px 0 0;
  color: var(--text-mute);
  font-size: 12.5px;
}

.query-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 12px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.field label {
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
}

.field input,
.field select {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.field input {
  width: 230px;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.field input[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-error {
  margin: 0;
  color: var(--danger);
  font-size: 12px;
}

/* 只读字段的说明文字（R2 的「固定近 10 年」提示） */
.field-hint {
  margin: 0;
  color: var(--text-mute);
  font-size: 11.5px;
  line-height: 1.5;
}

/* disabled 的下拉框降低视觉权重，明确「不可改」而非「忘了做」 */
.field select:disabled {
  background: #f8fafc;
  color: var(--text-mute);
  cursor: not-allowed;
}

.btn {
  height: 38px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: #1d4ed8;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.btn-ghost {
  height: 30px;
  padding: 0 12px;
  background: #fff;
  border-color: var(--border-strong);
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 500;
}

.btn-ghost:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.preset-chip {
  padding: 4px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s;
}

.preset-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-weak);
}

.preset-chip.is-active {
  border-color: var(--primary);
  background: var(--primary-weak);
  color: var(--primary);
  font-weight: 600;
}

.notice-bar {
  max-width: 1280px;
  margin: 0 auto;
  padding: 8px 20px 12px;
  color: var(--warning);
  background: var(--warning-weak);
  border-top: 1px solid #fde68a;
  font-size: 12.5px;
}

.notice-bar:not([hidden]) {
  display: block;
}

/* ---------- 最近搜索 R1 ---------- */

/*
 * 布局决策：用 grid + repeat(auto-fill, minmax(120px, 1fr)) 而非 flex，
 * 因为 grid 的列宽由容器宽度自动分配（auto-fill + 1fr），
 * 天然满足「一排放多个、数量按网页宽度自动分配」，无需 JS 计算列数；
 * flex-wrap 虽然也能换行，但每项宽度由内容长度决定，视觉上参差不齐。
 */
.recent {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.recent-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.recent-title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
}

.recent-count {
  color: var(--text-mute);
  font-size: 12px;
}

.recent-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.recent-empty {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--text-mute);
  font-size: 12.5px;
}

.recent-item {
  display: flex;
  align-items: stretch;
  min-width: 0;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fff;
  overflow: hidden;
  transition: border-color 0.15s, background 0.15s;
}

.recent-item:hover {
  border-color: var(--primary);
  background: var(--primary-weak);
}

.recent-item.is-active {
  border-color: var(--primary);
  background: var(--primary-weak);
}

.recent-main {
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 4px 5px 9px;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.recent-name {
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recent-code {
  color: var(--text-mute);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.recent-del {
  flex: 0 0 auto;
  width: 22px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text-mute);
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.recent-del:hover {
  background: var(--danger-weak);
  color: var(--danger);
}

/* 窄屏下每项改为更紧凑的两列，避免出现 1 列超宽 */
@media (max-width: 768px) {
  .recent-list {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
    gap: 6px;
  }
}

/* ---------- 右侧锚点导航 R8 ---------- */

/*
 * 定位在视口右侧、垂直居中，宽度仅 34px（收起态），不遮挡内容：
 * .app-main 最大宽 1280px 且居中，两侧留白在 ≥1400px 视口下 ≥60px，足够容纳。
 * 用 fixed 而非 sticky，保证任意滚动位置都可点击。
 */
.anchor-nav {
  position: fixed;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 4px;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(4px);
}

.anchor-item {
  position: relative;
  min-width: 26px;
  height: 24px;
  padding: 0 7px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 11.5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: background 0.15s, color 0.15s;
}

.anchor-item:hover {
  background: var(--primary-weak);
  color: var(--primary);
}

.anchor-dot {
  width: 5px;
  height: 5px;
  flex: none;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.55;
  pointer-events: none;
}

.anchor-item.is-active .anchor-dot {
  opacity: 1;
}

.anchor-top {
  margin-bottom: 3px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  height: 24px;
}

.anchor-top .anchor-dot {
  display: none;
}

/*
 * R11：锚点文字常显（用户反馈「右侧节点写字要不然看不到具体节点」）。
 * 原实现是 26px 圆形按钮 + hover 才浮出标签，导致节点名称默认不可见；
 * 现在改为直接显示文字标签，与左侧内容一同可读。
 * hover 时加浅底色做反馈，不再依赖浮层。
 */
.anchor-label {
  position: static;
  margin-left: 0;
  padding: 0;
  white-space: nowrap;
  background: none;
  color: inherit;
  font-size: 11.5px;
  opacity: 1;
  pointer-events: none;
  transform: none;
  transition: none;
  z-index: auto;
}

/* 圆点为装饰性标识，文字为主体（已在 .anchor-dot 定义，此处不重复） */

.anchor-item:hover {
  background: var(--primary-weak);
  color: var(--primary);
}

.anchor-item:hover .anchor-label,
.anchor-item:focus-visible .anchor-label {
  opacity: 1;
  transform: none;
}

/* 选中态：实心药丸 + 白字，文字仍然清晰 */
.anchor-item.is-active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

/* 窄屏：隐藏锚点条，避免遮挡窄内容区 */
@media (max-width: 768px) {
  .anchor-nav {
    display: none;
  }
}

/* ---------- 主体 ---------- */

.app-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 20px;
}

.placeholder {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 56px 24px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.placeholder h2 {
  margin: 0 0 10px;
  font-size: 17px;
}

.placeholder p {
  margin: 4px 0;
  color: var(--text-sub);
}

.placeholder-tip {
  margin-top: 12px !important;
  color: var(--text-mute) !important;
  font-size: 12.5px;
}

.result-area {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.result-area[hidden] {
  display: none;
}

/* ---------- 卡片 ---------- */

.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.card-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  position: relative;
  padding-left: 10px;
}

.card-header h2::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 15px;
  background: var(--primary);
  border-radius: 2px;
}

.badge {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--warning-weak);
  border: 1px solid #fde68a;
  color: var(--warning);
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- 概览条 ---------- */

.overview-body {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 22px;
}

.overview-name {
  font-size: 20px;
  font-weight: 700;
}

.overview-code {
  color: var(--text-mute);
  font-size: 13px;
}

.overview-price {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.overview-change {
  font-size: 13.5px;
  font-weight: 600;
}

.overview-change.is-up {
  color: var(--danger);
}

.overview-change.is-down {
  color: var(--success);
}

.overview-meta {
  color: var(--text-mute);
  font-size: 12.5px;
}

/* R36：行情头右侧的「同花顺 F10 / AI F10」外链 */
.overview-links {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
}

.overview-link {
  display: inline-block;
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.5;
  padding: 2px 9px;
  border: 1px solid var(--primary);
  border-radius: 999px;
  text-decoration: none;
  white-space: nowrap;
}

.overview-link:hover {
  background: var(--primary-weak);
}

/* ---------- 指标网格 ---------- */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

.metric-item {
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fbfcfe;
}

.metric-item.is-unavailable {
  background: #fafafa;
  border-style: dashed;
}

.metric-label {
  display: block;
  color: var(--text-mute);
  font-size: 12px;
  margin-bottom: 3px;
}

.metric-value {
  display: block;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--text);
  word-break: break-all;
}

.metric-value.is-empty {
  color: var(--text-mute);
  font-weight: 500;
}

/* R214：ROE 为负时把这一格标红（整格浅红底 + 数值红字） */
.metric-item.is-negative {
  background: var(--danger-weak);
  border-color: #fecaca;
}

.metric-item.is-negative .metric-value {
  color: var(--danger);
}

.metric-note {
  display: block;
  margin-top: 2px;
  color: var(--text-mute);
  font-size: 11.5px;
}

/* R36 / R38：指标值内的可点击外链（所属行业 / 细分行业 / 行业人气排名）
   要求：**静态外观与普通指标文字完全一致** —— 变成链接后不能变色、不能常驻下划线，
   只在鼠标悬停时用下划线提示「这里可以点」。 */
.metric-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.metric-link:hover {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

/* ---------- 区块小标题 ---------- */

.section-sub {
  margin: 18px 0 10px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-sub);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.section-sub:first-child {
  margin-top: 0;
}

/* ---------- R199 财务风险排雷 ---------- */

.risk-scan {
  border: 1px solid #f3d0d0;
  background: #fff8f8;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

.risk-scan-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.risk-scan-title {
  font-size: 13.5px;
  font-weight: 700;
  color: #991b1b;
}

.risk-scan-count {
  flex: none;
  font-size: 11.5px;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 999px;
  padding: 2px 9px;
  white-space: nowrap;
}

.risk-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 8px 12px;
}

.risk-item {
  position: relative;
  border: 1px solid #e8edf3;
  background: #ffffff;
  border-radius: 6px;
  padding: 7px 28px 7px 10px;
  min-width: 0;
}

.risk-item.is-hit {
  border-color: #f5b5b5;
  background: #fff1f1;
}

.risk-item.is-nodata {
  background: #fafafa;
  border-style: dashed;
}

.risk-name {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
}

.risk-item.is-hit .risk-name {
  color: #991b1b;
}

.risk-mark {
  position: absolute;
  top: 6px;
  right: 9px;
  font-size: 15px;
  line-height: 1;
  font-weight: 800;
  color: #d1d5db;
}

.risk-item.is-hit .risk-mark {
  color: var(--danger);
}

.risk-detail {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-mute);
  overflow-wrap: anywhere;
}

.risk-scan-note {
  margin: 10px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--text-mute);
}

@media (max-width: 640px) {
  .risk-list {
    grid-template-columns: 1fr;
  }
}

/* ---------- 描述列表 ---------- */

.desc-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px 18px;
  margin: 0;
}

.desc-item {
  display: flex;
  gap: 8px;
  min-width: 0;
}

.desc-label {
  flex: 0 0 88px;
  color: var(--text-mute);
  font-size: 12.5px;
}

.desc-value {
  flex: 1;
  min-width: 0;
  color: var(--text);
  word-break: break-word;
}

.desc-value.is-empty {
  color: var(--text-mute);
}

/* ---------- 段落文本 ---------- */

.para {
  margin: 0 0 8px;
  color: var(--text-sub);
  line-height: 1.75;
  word-break: break-word;
}

.para:last-child {
  margin-bottom: 0;
}

/* ---------- 表格 ---------- */

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 640px;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th {
  background: #f8fafc;
  color: var(--text-sub);
  font-weight: 600;
  font-size: 12.5px;
  position: sticky;
  top: 0;
}

.data-table tbody tr:hover {
  background: #fafbff;
}

.data-table td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.data-table .cell-wrap {
  white-space: normal;
  min-width: 180px;
  max-width: 320px;
}

/* ---------- R2 分红表：全部单元格居中 ---------- */

/*
 * 分红表按「年份 → 一行」阅读，横向扫视时年份列是主要锚点，
 * 居中对齐能让「有分红 / 未分红」两种行的年份落在同一条视觉轴上，比左对齐更容易对齐比较。
 * 只作用于 .table-center，绝不影响股东表（R5 要求左对齐）。
 */
.data-table.table-center th,
.data-table.table-center td {
  text-align: center;
}

.data-table.table-center td.cell-wrap {
  text-align: center;
}

/* 未分红年份行：整行淡化，一眼与有数据的行区分开 */
.data-table tr.is-no-dividend td {
  color: var(--text-mute);
  background: #fcfcfd;
}

.tag-none {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  background: #f1f5f9;
  border: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 11.5px;
  font-weight: 600;
}

/* 同一年多条分红时的次序标记（中期分红 / 第二次派息） */
.tag-sub {
  display: inline-block;
  margin-left: 4px;
  padding: 0 5px;
  border-radius: 3px;
  background: var(--primary-weak);
  border: 1px solid #bfdbfe;
  color: var(--primary);
  font-size: 11px;
  font-weight: 600;
  vertical-align: middle;
}

/* ---------- R5 股东表：全部数据单元格左对齐 ---------- */

/*
 * 股东表以「股东名称」为主键阅读，名称列必须左对齐；
 * 若数值列右对齐，整行的视觉起点忽左忽右，读行时容易串行。
 * 用 .table-left 局部覆盖，保留 tabular-nums 便于同列数字对齐比较。
 */
.data-table.table-left th,
.data-table.table-left td,
.data-table.table-left td.num {
  text-align: left;
}

.data-table.table-left td.num {
  font-variant-numeric: tabular-nums;
}

/* R4：合计行（tfoot）—— 与表体区分开，同时不覆盖 .table-left 的左对齐 */
.data-table tfoot td {
  background: #f8fafc;
  border-top: 2px solid var(--border-strong);
  border-bottom: 0;
  color: var(--text);
  font-weight: 700;
  font-size: 12.5px;
}

/* ---------- R3 控股股东：单行不换行 ---------- */

/*
 * 控股股东名称可能很长（如「中国贵州茅台酒厂(集团)有限责任公司」，18 字），
 * 默认 desc-list 是 260px 起步的双列网格，很容易折成 3 行、把卡片撑得很高。
 * 这里给「控股股东」这一项单独用 nowrap + ellipsis + title，
 * hover 时通过 title 属性查看完整名称，视觉上恒为一行。
 */
.desc-item.is-nowrap .desc-value {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: normal;
}

/* ---------- ETF 专属排版 R9 ---------- */

.badge-etf {
  background: var(--primary-weak);
  border-color: #bfdbfe;
  color: var(--primary);
  margin-right: 6px;
  vertical-align: middle;
}

/* ETF 卡片左侧用主色描边，与个股卡片形成视觉区分 */
.etf-card {
  border-left: 3px solid var(--primary);
}

.badge-warn {
  background: var(--warning-weak);
  border-color: #fde68a;
  color: var(--warning);
}

/* 概览条上的净值展示（ETF 无股价，改用单位净值 + 涨跌幅） */
.overview-nav {
  color: var(--primary);
}

/* ETF 重仓股「较上期变动」的涨跌语义色 */
.tag-change-up {
  color: var(--danger);
  font-weight: 600;
}

.tag-change-down {
  color: var(--success);
  font-weight: 600;
}

.tag-change-flat {
  color: var(--text-mute);
}

/* ETF 收益率网格 */
.etf-returns {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 10px;
}

/* 「ETF 无此数据」块内的补充说明文字 */
.state-detail-inline {
  margin: 0 !important;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.7;
}

/* desc-item 内的行内补充说明（规模日期等） */
.desc-note-inline {
  flex: 0 0 auto;
  align-self: baseline;
  color: var(--text-mute);
  font-size: 11.5px;
}

/* ---------- 爱问财嵌入卡片 R7 ---------- */

.app-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

/* R82：`.iwencai-hint` / `.iwencai-query` 两条规则随那行「当前标的预填语句：…」一并删除
   （样式只服务那个已删掉的元素）。 */

.iwencai-frame-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafbfd;
}

.iwencai-frame {
  display: block;
  width: 100%;
  height: 460px;
  border: 0;
  background: #fff;
}

/* 收起态：只保留卡片头与提示，iframe 不占位（配合 loading=lazy 进一步省流量） */
.iwencai-card.is-collapsed .iwencai-frame-wrap {
  display: none;
}

.card-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-link {
  display: inline-flex;
  align-items: center;
  height: 30px;
  text-decoration: none;
}

.tag-preplan {
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--warning-weak);
  border: 1px solid #fde68a;
  color: var(--warning);
  font-size: 11.5px;
  font-weight: 600;
}

.tag-done {
  padding: 1px 7px;
  border-radius: 4px;
  background: var(--success-weak);
  border: 1px solid #bbf7d0;
  color: var(--success);
  font-size: 11.5px;
  font-weight: 600;
}

.table-footnote {
  margin: 10px 0 0;
  color: var(--text-mute);
  font-size: 12px;
}

/* ---------- 图表 ---------- */

/*
  R33：六图看板固定「2 行 3 列」。
  用 repeat(3, minmax(0,1fr)) 而非 auto-fit：auto-fit 在宽屏会挤成 4~5 列，
  破坏用户要求的 2×3 整齐排版；minmax(0,1fr) 保证子项不会因内容撑破列宽。
  窄屏在下面两个断点降为 2 列 / 1 列。
*/
.chart-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.chart-panel {
  min-width: 0;
  /* R205：面板改纵向 flex —— 同一行内各面板高度由 grid stretch 拉平，
     结论框 flex:1 吃掉剩余高度，于是「同排的综合结论框大小一致」。 */
  display: flex;
  flex-direction: column;
  position: relative;
}

/* 同排结论框等高：容器被 grid 拉伸后，结论框占满图表以下的所有剩余空间 */
.chart-panel > .chart-verdict {
  flex: 1 1 auto;
}

.chart-panel-title {
  margin: 0 0 8px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text-sub);
}

.chart-container {
  width: 100%;
  height: 280px;
}

/* R204：图表面板内的口径切换 Tab（单季 / TTM） */
.chart-mode-tabs {
  display: flex;
  gap: 4px;
  margin: 4px 0 6px;
}
.chart-mode-tab {
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #fff;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.4;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.chart-mode-tab:hover { color: var(--text-body); }
.chart-mode-tab.active {
  border-color: #2f6fed;
  background: #eef4ff;
  color: #2f6fed;
  font-weight: 600;
}

/*
  R205（用户要求）：【使用说明】不再常驻在图表下方（既挤占空间，又把同排结论框撑得高低不齐），
  改成图表右上角的「说明」按钮 + 悬停弹窗，弹窗浮在**图表的左方**。
  弹窗用 position: fixed，坐标由 JS 按面板 rect 计算（左方空间不足时自动翻到右方）。
*/
.chart-note {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 60;
  display: none;
  width: 360px;
  max-height: 62vh;
  overflow-y: auto;
  margin: 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
  color: var(--text-sub);
  font-size: 12.5px;
  line-height: 1.7;
  text-align: left;
}

.chart-note.is-open {
  display: block;
}

/* 「说明」触发按钮：贴在面板右上角，悬停 / 聚焦即出弹窗 */
.chart-note-btn {
  position: absolute;
  top: -2px;
  right: 0;
  z-index: 5;
  padding: 0 8px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 11.5px;
  line-height: 18px;
  cursor: help;
  opacity: 0.75;
  transition: color 0.15s, border-color 0.15s, opacity 0.15s;
}

.chart-note-btn:hover,
.chart-note-btn:focus-visible {
  opacity: 1;
  color: var(--primary);
  border-color: var(--primary);
  outline: none;
}

@media (max-width: 768px) {
  .chart-note { width: min(320px, calc(100vw - 24px)); }
}

.chart-note-label {
  display: inline-block;
  margin-right: 6px;
  padding: 0 6px;
  border-radius: 4px;
  background: #eef4ff;
  color: #2f6fed;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 18px;
  vertical-align: 1px;
}

/* R59：图内不再画小字副标题，「数据来源」改排在【使用说明】的**最后面**。
   占一整行（display: block），字号略小于说明正文，颜色沿用弱灰。 */
.chart-note-source {
  display: block;
  margin-top: 2px;
  color: var(--text-mute);
  font-size: 12px;
}

/* ---------- R33 可折叠股价走势图 ---------- */

.trend-card .card-header {
  align-items: center;
}

/*
 * R53：走势图标题括号里的复权口径下拉（与港美股页 .hk-adjust-select 同款外观）。
 * 它嵌在 <h2> 里，外观必须与括号里的**普通标题文字完全一致**：
 * 去掉系统外观、边框、内边距与自绘箭头，颜色/字体/字重/行高全部继承标题。
 * 可点性只用 cursor: pointer 与 title 提示表达，不额外加图形（零视觉变化）。
 */
.trend-adjust-select {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: inherit;
  line-height: inherit;
  cursor: pointer;
}

.trend-adjust-select:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

/* R145：主图下拉的两个档位字数不同（「收盘价」3 字 /「均线」2 字），而 <select> 的宽度
   按**最宽的那个选项**撑开 —— 选中「均线」时它是贴着左边的，夹在括号里看着偏左。
   居中是纯显示层修正：`text-align-last` 是 Chrome/Edge 渲染选中项真正认的那条。 */
#trend-main-select {
  text-align: center;
  text-align-last: center;
}

/* 「展开 / 折叠」按钮：浅色描边，不抢主标题的注意力
   R59：本类也用在 <a>（「大盘云图」入口）上 —— 用户要求它与展开按钮「样式和字体一致」，
   因此两条规则**共用同一份声明**；对 <a> 只需额外去掉下划线并继承字体即可。 */
.trend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 600;
  /* R59：<button> 走 UA 默认 line-height: normal，而 <a> 会继承父级行高，
     两者算出来的行高不一致（实测 normal vs 20px）—— 显式钉死，保证这枚胶囊
     不管套在 <a> 还是 <button> 上，行高都逐项相同。 */
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.trend-toggle:hover {
  border-color: #b8cdf7;
  background: #f5f8ff;
  color: #2f6fed;
}

.trend-toggle .trend-caret {
  width: 0;
  height: 0;
  border-left: 4.5px solid transparent;
  border-right: 4.5px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform .18s ease;
}

.trend-toggle[aria-expanded="true"] .trend-caret {
  transform: rotate(180deg);
}

.trend-body {
  margin-top: 12px;
}

.trend-body[hidden] {
  display: none;
}

.trend-period {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  /* R51：周期按钮与提示文案整体靠右对齐（窄屏折行后仍贴容器右缘）。 */
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 8px;
}

.trend-period-btn {
  padding: 5px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text-sub);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .16s ease;
}

.trend-period-btn:hover {
  border-color: #b8cdf7;
  color: #2f6fed;
}

.trend-period-btn.is-active {
  border-color: #2f6fed;
  background: #eef4ff;
  color: #2f6fed;
  font-weight: 700;
}

.trend-period-hint {
  margin-left: 4px;
  color: var(--text-mute);
  font-size: 12px;
}

/*
 * R34：指标参数条（MACD / KDJ）。
 * 只在展开后出现，一行放得下就一行；窄屏自动换行，不挤压图表宽度。
 */
.trend-indicators {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  margin-bottom: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fafbfd;
}

.trend-ind-group {
  display: flex;
  align-items: center;
  gap: 6px;
}

.trend-ind-name {
  color: var(--text-sub);
  font-size: 12.5px;
  font-weight: 700;
}

.trend-ind-field {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-mute);
  font-size: 12px;
}

.trend-ind-field input {
  width: 46px;
  padding: 3px 4px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font-family: var(--font);
  font-size: 12.5px;
  text-align: center;
}

.trend-ind-field input:focus {
  outline: none;
  border-color: #2f6fed;
  box-shadow: 0 0 0 2px rgba(47, 111, 237, 0.12);
}

.trend-ind-reset {
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text-sub);
  font-family: var(--font);
  font-size: 12px;
  cursor: pointer;
}

.trend-ind-reset:hover {
  border-color: #b8cdf7;
  color: #2f6fed;
}

.trend-ind-hint {
  margin-left: auto;
  color: var(--text-mute);
  font-size: 12px;
}

/*
  R34：走势图容器高一点，才装得下「主图 + MACD + KDJ」三块子图。
  R230：新增成交量副图后子图变四块，容器由 520px 提到 560px。
  ⚠️ 必须写成 `.chart-container.trend-container`（两个类）提高优先级：
  文件下方 `@media (max-width:768px){ .chart-container{height:240px} }` 是给六张
  基本面图用的，它出现得更晚，单靠 `.trend-container` 会被它按「后写覆盖」压成 240px
  —— 那样四块子图会挤成一条缝，几乎读不出指标。
*/
.chart-container.trend-container {
  height: 560px;
}

/* 手机端：四块子图挤在 520px 里读不清，整体放低一点高度并允许横向占满 */
@media (max-width: 768px) {
  .chart-container.trend-container {
    height: 520px;
  }

  .trend-ind-hint {
    margin-left: 0;
    width: 100%;
  }
}

/* ---------- R33 恢复弹窗 ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 9998;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal[hidden] {
  display: none;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, .38);
}

/* R115：未登录门禁 —— 遮罩加深并轻微模糊，未登录时看不到也点不到站内界面。
   门禁由 js/api/account.js 的 openGate() 给 .modal 挂上 is-gate 类触发。 */
.modal.is-gate .modal-backdrop {
  background: rgba(15, 23, 42, .72);
  backdrop-filter: blur(3px);
}

/* R118：首帧模糊层 —— 未登录门禁的「打开即模糊」。
   ------------------------------------------------------------
   用户反馈：「登录窗口弹出有点慢，整个页面已经看清楚完了」。根因是时序：
   账号弹窗要等一次服务健康检查（网络往返）回来才知道该不该弹，
   那段空窗期里站内内容是清晰可读的。
   这一层是**静态 HTML**（不是脚本生成），所以从第一帧起就盖住内容；
   z-index 低于 .modal(9998) 而高于页面内容 —— 登录弹窗正好浮在模糊层之上。
   判定完成由 js/api/account.js 调用 setPreGate()：需要门禁则保留，
   已登录 / 服务不可用（离线）则淡出移除。 */
.pre-gate {
  position: fixed;
  inset: 0;
  z-index: 9997;
  background: rgba(15, 23, 42, .30);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* R122：淡出时长减半 0.22s → 0.11s（用户要求「跳转时模糊的时间缩短一半」） */
  transition: opacity .11s ease;
}

/* 淡出态：account.js 加上它，120ms 后把节点整个移除 */
.pre-gate.is-off {
  opacity: 0;
}

.modal-box {
  position: relative;
  width: min(560px, 100%);
  max-height: 80vh;
  overflow: auto;
  padding: 20px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 23, 42, .22);
}

/* R91：弹窗滚动条美化（用户反馈系统默认滚动条又大又粗很难看）。
   Chrome/Edge 走 ::-webkit-scrollbar；Firefox 走标准两属性。
   thumb 用「透明边框 + background-clip: padding-box」做细芯，
   滑动条槽与转角一律透明，视觉上只有一根细圆条，不再是灰块。 */
.modal-box {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, .22) transparent;
}

.modal-box::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.modal-box::-webkit-scrollbar-track,
.modal-box::-webkit-scrollbar-corner {
  background: transparent;
}

.modal-box::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, .18);
  border: 3px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.modal-box::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, .34);
  border: 3px solid transparent;
  background-clip: padding-box;
}

/* R102：全站滚动条统一收细。
   用户反馈「有滚动条的又大又粗」，而 R91 只美化了弹窗本身那一个；
   弹窗内还有别的滚动容器（备份列表、候选下拉等）此前仍是系统默认样式。
   选择器权重比 `.modal-box::-webkit-scrollbar` 低，弹窗保持 R91 的 10px，其余一律 8px 细条。 */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, .22) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

*::-webkit-scrollbar-track,
*::-webkit-scrollbar-corner {
  background: transparent;
}

*::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, .18);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
  background: rgba(15, 23, 42, .34);
  border: 2px solid transparent;
  background-clip: padding-box;
}

/* R60：弹窗右上角的叉号关闭按钮（账号弹窗用；用户要求把底部「关闭」按钮挪到这里）。
   id 仍是 #account-cancel，因此 account.js 里已有的关闭逻辑不用改。 */
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--text-mute);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}

.modal-close:hover {
  border-color: var(--border);
  background: var(--primary-weak);
  color: var(--text);
}

/* R60：账号弹窗加宽加高（用户要求）—— 注册态字段多、已登录态还有预留问题与备份列表，
   原来 560px / 80vh 会挤出滚动条。这里只放宽账号弹窗，恢复弹窗与收藏弹窗不受影响。
   R91：用户要求「继续加宽」（已登录态内容更长），680px → 900px。 */
#account-modal .modal-box {
  width: min(900px, 100%);
  max-height: 92vh;
}

/* R60：「忘记密码？」挪到最右侧，右边缘与用户名输入框尾部对齐（用户要求）。 */
#account-recover-link {
  display: block;
  width: 100%;
  text-align: right;
}

.modal-title {
  margin: 0 0 10px;
  font-size: 16px;
  color: var(--text-strong, #0f172a);
}

.modal-hint {
  margin: 0 0 12px;
  color: var(--text-mute);
  font-size: 12.5px;
  line-height: 1.7;
  word-break: break-all;
}

/* ============================================================
   R45：备份列表（恢复弹窗与账号备份面板共用同一套类名）
   ------------------------------------------------------------
   用户要求「鼠标放到某个备份上时，在它后面显示一个删除按钮」。
   原来的 `<select>` 里放不了按钮，所以列表改成逐行 div：
     .backup-rows              可滚动容器（取代原来的两个下拉框类名）
     .backup-row               一行：文件名/时间 + 右侧删除按钮
     .backup-row.is-selected   当前选中行（原来由 <select> 自动维护的选中态）
   ============================================================ */
.backup-rows {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.backup-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sub);
  font-size: 13px;
  cursor: pointer;
}

.backup-row:last-child {
  border-bottom: none;
}

.backup-row:hover {
  background: var(--primary-weak);
}

.backup-row.is-selected {
  background: var(--primary-weak);
  color: var(--text);
  font-weight: 600;
}

.backup-row:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.backup-row-label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 删除按钮：默认透明，鼠标移到这一行（或按钮被键盘聚焦）时才出现 */
.backup-row-del {
  flex: 0 0 auto;
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: transparent;
  color: var(--danger);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.12s, background 0.12s, color 0.12s;
}

.backup-row:hover .backup-row-del,
.backup-row-del:focus-visible {
  opacity: 1;
}

.backup-row-del:hover {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}

/* 触屏设备没有 hover：「鼠标移上去才出现」会变成永远不出现，
   因此这里常显删除按钮（手机上也要能手动清理）。 */
@media (hover: none) {
  .backup-row-del {
    opacity: 1;
  }
}

.modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

/* 中等宽度（平板 / 窄窗口）：2×3 降为 3 行 2 列，避免每格过窄看不清坐标轴 */
@media (max-width: 1100px) {
  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.chart-container.chart-fallback {
  height: auto;
  min-height: 140px;
}

.fallback-box {
  padding: 16px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  background: #fafbfd;
}

.fallback-tip {
  margin: 0 0 10px;
  color: var(--text-sub);
  font-size: 12.5px;
}

.fallback-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
  max-height: 200px;
}

.fallback-table th,
.fallback-table td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.fallback-table td:last-child {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* ---------- 骨架屏 ---------- */

.skeleton-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-list[hidden] {
  display: none;
}

.skeleton-line,
.skeleton-box {
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%;
  animation: skeleton-loading 1.3s ease-in-out infinite;
  border-radius: 6px;
}

.skeleton-line {
  height: 16px;
}

.skeleton-box {
  height: 76px;
}

.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 12px;
}

@keyframes skeleton-loading {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

/* ---------- 状态提示 ---------- */

.module-body[hidden] {
  display: none;
}

.state-box {
  padding: 20px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  border: 1px solid transparent;
}

.state-box p {
  margin: 0 0 10px;
  font-size: 13.5px;
}

.state-box.is-empty {
  background: #fafbfd;
  border-color: var(--border);
  color: var(--text-mute);
}

.state-box.is-error {
  background: var(--danger-weak);
  border-color: #fecaca;
  color: var(--danger);
  text-align: left;
}

.state-box.is-error .state-title {
  display: block;
  font-weight: 700;
  margin-bottom: 4px;
}

.state-box.is-error .state-detail {
  display: block;
  color: #991b1b;
  font-size: 12.5px;
  margin-bottom: 12px;
  word-break: break-word;
}

.state-box.is-error .btn {
  background: #fff;
  border-color: #fca5a5;
  color: var(--danger);
}

.state-box.is-error .btn:hover {
  border-color: var(--danger);
}

/* ---------- P0：浏览器环境受限（UA 被数据源封禁） ---------- */

/*
 * ⚠️ 必须与 is-empty（灰）明显区分：
 * 「暂无数据」= 数据源确实没有这项数据；
 * 「环境受限」= 数据源有，但拒绝了当前浏览器（User-Agent 被封禁），重试无用。
 * 两者处置完全不同（换浏览器 vs 无需处理），混用会让用户误判。
 * 用琥珀色 + 虚线边框表达「可行动但受限」，而非红色的「出错」。
 */
.state-box.is-blocked {
  background: var(--warning-weak);
  border-color: #fde68a;
  color: var(--warning);
  text-align: left;
}

.state-box.is-blocked p {
  margin: 0 0 6px;
  color: var(--warning);
  font-size: 13.5px;
}

.state-box.is-blocked p:last-child {
  margin-bottom: 0;
}

/* ---------- 页脚 ---------- */

.app-footer {
  max-width: 1280px;
  margin: 0 auto;
  padding: 16px 20px 28px;
}

.app-footer p {
  margin: 0;
  color: var(--text-mute);
  font-size: 12px;
  text-align: center;
}

/* ---------- 窄屏适配 ---------- */

@media (max-width: 768px) {
  .header-inner,
  .app-main,
  .app-footer,
  .notice-bar {
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand h1 {
    font-size: 18px;
  }

  .query-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .field input,
  .field select {
    width: 100%;
  }

  .btn {
    width: 100%;
  }

  .card {
    padding: 15px 14px;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-container {
    height: 240px;
  }

  .desc-list {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
  }

  .overview-price {
    font-size: 19px;
  }
}

@media (max-width: 420px) {
  .metric-grid {
    grid-template-columns: 1fr 1fr;
  }

  .card-header {
    flex-wrap: wrap;
  }
}
/* ============================================================
   R11-1 可比公司
   ============================================================ */
.peers-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px dashed var(--border);
}

.peers-header {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.peers-hint {
  font-size: 12px;
  color: var(--text-mute);
}

.peers-group {
  margin-top: 12px;
}

.peers-group-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.peers-count {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mute);
}

/* 公司名链接：橙色下划线，区别于普通文本 */
.peer-link {
  display: inline-block;
  margin: 0 8px 6px 0;
  padding: 2px 4px;
  color: var(--primary);
  text-decoration: underline;
  text-decoration-color: var(--primary);
  text-underline-offset: 3px;
  border-radius: 3px;
  cursor: pointer;
  transition: background 0.15s;
}

.peer-link:hover {
  background: var(--primary-weak);
}

/* 非 A 股主体：不可点击，灰显并给出原因 */
.peer-link.is-disabled {
  color: var(--text-mute);
  text-decoration: none;
  cursor: not-allowed;
  border-bottom: 1px dotted var(--text-mute);
}

.peer-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

.peers-more {
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-mute);
}

/* ============================================================
   R11-2 爱问财账号信息区
   ============================================================ */
.iwencai-login {
  margin: 12px 0;
  padding: 12px 14px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.iwencai-login-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.iwencai-login-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.iwencai-login-note {
  font-size: 12px;
  color: var(--text-mute);
}

.iwencai-login-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
}

.iwencai-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 200px;
  flex: 1 1 200px;
}

.iwencai-field-label {
  font-size: 12px;
  color: var(--text-mute);
}

.iwencai-field input {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.iwencai-field input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.iwencai-field-actions {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 0;
}

.iwencai-login-tip {
  margin: 10px 0 0;
  padding: 8px 10px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 6px;
  font-size: 12px;
  line-height: 1.6;
  color: #78350f;
}

.iwencai-login-tip strong {
  color: #92400e;
}

/* ============================================================
   R12 选股条件记录
   ============================================================ */
.pick-conditions {
  margin-top: 12px;
  padding: 14px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.pick-conditions-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}

.pick-label,
.pick-history-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.pick-count {
  font-size: 12px;
  color: var(--text-mute);
}

.pick-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pick-row input {
  flex: 1 1 260px;
  min-width: 200px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
}

.pick-row input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -1px;
  border-color: var(--primary);
}

.pick-history {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}

.pick-select {
  flex: 1 1 240px;
  min-width: 180px;
  max-width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  /* 下拉项过长时横向滚动，避免撑破卡片 */
  max-width: 100%;
}

.pick-tip {
  margin: 10px 0 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-mute);
}

/* ============================================================
   R14 布局：左侧人气榜 + 紧凑顶部 + 锚点两字一行
   ============================================================ */

/* 顶部：标题与副标题合并为一行，减少纵向占用 */
.brand h1 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.brand-sub {
  /* R170：字号与港美股页的区块导航（hkus.html 的 .hk-brand-sub）一致 —— 12px */
  font-size: 12px;
  font-weight: 400;
  color: var(--text-mute);
  white-space: nowrap;
}

/*
  R37：港股 / 美股查询入口。
  港美股的分红数据东财没有开放接口（报表配置不存在），无法并进本页，
  因此做成独立页面 hkus.html，从这里跳转。

  R169（用户要求）：三个入口（港股/美股查询、网页收藏、账号）统一改成港美股页
  顶栏按钮（hkus.html 的 .hk-back）的描边胶囊风格 —— 白底、1px 描边、
  13px 常规字重，hover 变成主题色描边 + 浅色底。原来这里是「浅蓝底 + 主题色文字」
  的小 chip，与港美股页不一致。
*/
.hkus-entry {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 400;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.hkus-entry:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-weak);
}

/* ============================================================
   R40：账号入口与账号弹窗
   ------------------------------------------------------------
   入口在 A 股页沿用 .hkus-entry 的胶囊外观（与「港股/美股」「浏览器扩展」并排），
   但它是 <button>：浏览器会带默认背景、边框与字体，这里补齐重置，
   保证三种入口在视觉上完全一致。
   ============================================================ */
.account-entry {
  font-family: inherit;
  cursor: pointer;
  line-height: 1.4;
}

.account-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

/* R105：站点关闭注册时，页签整条收起，改由这行文案说明（占掉页签原本的位置） */
.account-register-closed {
  margin: 0 0 14px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-soft, rgba(127, 127, 127, 0.08));
  color: var(--text-dim);
  font-size: 12.5px;
  line-height: 1.6;
}

.account-tab {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.account-tab.is-active {
  color: var(--primary);
  border-color: var(--border);
  border-bottom-color: var(--primary);
  background: var(--card-bg);
  font-weight: 600;
}

.account-field {
  display: block;
  margin-bottom: 12px;
}

.account-label {
  display: block;
  margin-bottom: 5px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.account-input {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
}

.account-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-weak);
}

/* R131：密码明文开关 */
.account-show-pwd {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: -2px 0 10px;
  color: var(--text-mute);
  font-size: 12.5px;
  cursor: pointer;
  user-select: none;
}

.account-show-pwd input {
  margin: 0;
  cursor: pointer;
}

.account-error {
  margin: 4px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: var(--danger-weak);
  color: var(--danger);
  font-size: 12.5px;
  line-height: 1.6;
}

/*
 * R57：错误槽「常驻占位」，修「点登录报错时登录按钮往下跳」。
 * 现象：提示「密码不正确 / 该用户名还未注册」时这个 <p> 从 display:none 变成块级，
 *   弹窗长高 40px（8+20+8 的一行文案 + 4px 上边距），而 .modal 是垂直居中，
 *   于是按钮行被顶下 20px —— 用户看到的就是「登录按钮错位」。
 * 修法：空态也占住**一行文案的高度**（40px = 4px 上边距 + 36px 盒子，与有文案时同高），
 *   显隐改用 visibility（空态看不见但仍然占位），因此报错前后布局零位移。
 * 注意：这里用 id 选择器 + !important 是为了压过上面那条兜底的
 *   `[hidden] { display: none !important }`（id 特异性 1-0-0 > 属性选择器 0-1-0），
 *   也就是说这两个提示节点的显隐从此由「文案是否为空」决定，不再用 hidden 属性。
 */
#account-error,
#account-recover-error {
  display: block !important;
  min-height: 36px;
  visibility: hidden;
}

#account-error:not(:empty),
#account-recover-error:not(:empty) {
  visibility: visible;
}

.account-current {
  margin: 4px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-weak);
  color: var(--text-sub);
  font-size: 13px;
}

.account-tip {
  margin: 14px 0 0;
  color: var(--text-mute);
  font-size: 12px;
  line-height: 1.7;
}

.account-tip code,
.account-current code {
  padding: 1px 4px;
  border-radius: 4px;
  background: #eef2ff;
  font-size: 11.5px;
}

/* ============================================================
   R104：管理员「用户管理」第二页面（仅内置管理员账号可见）
   ------------------------------------------------------------
   · .account-admin-nav   账号 / 用户管理 的页面切换条
   · .admin-table-wrap    横向滚动容器（列多，窄屏靠它横滑）
   · .admin-head/.admin-row 共用同一套 grid 列宽，表头与数据行严格对齐
   · .admin-op-btn        行内小操作按钮（自带样式，不依赖各页的按钮类名）
   ============================================================ */
.account-admin-nav {
  display: flex;
  gap: 4px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.account-admin-tab {
  padding: 7px 14px;
  border: 1px solid transparent;
  border-bottom: 2px solid transparent;
  border-radius: 8px 8px 0 0;
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.account-admin-tab:hover {
  color: var(--primary);
}

.account-admin-tab.is-active {
  color: var(--primary);
  border-color: var(--border);
  border-bottom-color: var(--primary);
  background: var(--card-bg);
  font-weight: 600;
}

/* R225：真·零位移吸附 —— R224 用 top:-20px 抵消弹窗 20px 顶部内边距，但滚动最初
   20px 里表头仍会跟着内容上移（用户实测「往上移动一点点」）。改法：把 .modal-box
   的顶部内边距挪进表头自身（表头 padding-top:20px，弹窗 padding-top 归零），
   吸附点由此变成弹窗可视顶边，top:0 吸住后从第一像素起就一动不动。 */
#account-modal .modal-box {
  padding: 0 20px 20px;
}
#account-modal .account-modal-head {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flow-root;
  background: #fff;
  margin: 0 -20px;
  padding: 20px 20px 0;
}

/* ============================================================
   R227：今日人气榜弹窗（仅 A 股页）
   · 每天上午 9:30 后打开页面延时 2 分钟弹一次，当天只弹一次；
   · 关闭按钮左侧「以后不再提示」复选框，勾选后永久停用（账号弹窗里可恢复）；
   · 表格：代码 / 名称 / 今日涨跌幅 / 行业 / 细分行业；表头可点击排序；
   · 默认按「行业内条目数」聚类降序（行业越多的越靠上），条目数最多的
     行业成员整行淡红底 + 名称标红；涨跌幅沿用红涨绿跌。
   ============================================================ */
#hot-popup-modal .modal-box {
  width: min(720px, 100%);
  max-height: 88vh;
}
.hot-popup-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.hot-popup-head .modal-title {
  margin: 0;
  font-size: 16px;
}
.hot-popup-head-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.hot-popup-forever {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  color: var(--text-mute);
  cursor: pointer;
  white-space: nowrap;
}
.hot-popup-close {
  position: static; /* 覆盖 .modal-close 的 absolute —— 这里要跟复选框排在一行 */
}
.hot-popup-meta {
  margin: 6px 0 10px;
  font-size: 12px;
  color: var(--text-mute);
}
.hot-popup-table-wrap {
  overflow: auto;
}
.hot-popup-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.hot-popup-table th,
.hot-popup-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}
.hot-popup-table th {
  font-weight: 600;
  color: var(--text-mute);
  background: var(--card-bg, #f8fafc);
  user-select: none;
}
.hot-th-sort {
  cursor: pointer;
}
.hot-th-sort:hover {
  color: var(--primary);
}
.hot-th-sort.is-sorted {
  color: var(--primary);
}
.hot-popup-table tbody tr {
  cursor: pointer;
}
.hot-popup-table tbody tr:hover {
  background: var(--primary-weak, #f1f5f9);
}
/* 行业上榜数最多的条目：整行淡红底 + 左侧红条 + 名称红字加粗 */
.hot-popup-tbody-tr.is-top-industry {
  background: rgba(220, 38, 38, .07);
}
.hot-popup-tbody-tr.is-top-industry td:first-child {
  border-left: 3px solid #dc2626;
}
.hot-pop-name.is-top-industry-mark {
  color: #dc2626;
  font-weight: 600;
}
/* 涨跌幅红涨绿跌 */
.hot-chg-up { color: #dc2626; }
.hot-chg-down { color: #16a34a; }
.hot-chg-flat { color: var(--text-mute); }
.hot-popup-foot {
  margin: 10px 0 0;
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.6;
}
/* 账号弹窗里的人气榜弹窗恢复入口（R227）
   R237：整行压缩（更小字号/内边距/胶囊按钮），右侧再放两个随账号的跳转入口 */
.account-hot-popup-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0 0;
  padding: 6px 10px;
  border: 1px dashed var(--border);
  border-radius: 999px;
  font-size: 11.5px;
  color: var(--text-mute);
}
.account-hot-popup-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.account-hot-popup-row .account-hot-popup-toggle {
  flex: 0 0 auto;
  height: 22px;
  padding: 0 9px;
  border-radius: 999px;
  border-color: var(--border);
  font-size: 11px;
  font-weight: 500;
  line-height: 1;
}
.account-quick-links {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.account-quick-link {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  color: var(--text-sub);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}
.account-quick-link:hover {
  color: var(--primary);
  border-color: var(--primary);
  background: var(--primary-weak);
  text-decoration: none;
}

.account-admin-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* 「刷新」按钮（两个页面用的按钮类名不同）统一推到最右：取未位元素即可 */
.account-admin-bar > :last-child {
  margin-left: auto;
}

.account-admin-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-sub);
  cursor: pointer;
}

.account-admin-hint {
  margin: 0 0 10px;
  color: var(--text-mute);
  font-size: 12.5px;
  line-height: 1.7;
}

.account-admin-msg {
  margin: 0 0 10px;
  color: var(--primary);
  font-size: 12.5px;
}

.account-admin-msg.is-error {
  color: var(--danger, #dc2626);
}

/* R134：把「刷新」按钮放到消息这一排的最右，消息占左、按钮贴右 */
.account-sync-msg-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.account-sync-msg-row .account-admin-msg {
  flex: 1 1 auto;
  margin: 0;
}

.account-sync-msg-row > button {
  flex: 0 0 auto;
  margin-left: auto;
}

.account-admin-empty {
  margin: 12px 0 0;
  color: var(--text-mute);
  font-size: 13px;
  text-align: center;
}

/* ---------- R130：账号弹窗「同步」页（Raindrop → 本站收藏） ----------
   表格与 .admin-table 同款，但列不同（时间 / 触发 / 结果 / 计数 / 说明），
   所以单独起一套 .sync-* 类：不改 .admin-head 那份八列的 grid，
   免得「改一处、两个页面一起错位」。 */

.sync-head,
.sync-row {
  display: grid;
  /* 时间 / 触发 / 结果 / 新增·更新·删除·分叉·跳过 / 说明 */
  grid-template-columns: 150px 78px 74px 200px minmax(200px, 1fr);
  align-items: stretch;
}

.sync-head .sync-cell {
  background: #f7f9fc;
  color: var(--text);
  font-weight: 600;
}

.sync-cell {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-sub);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sync-row:last-child .sync-cell {
  border-bottom: none;
}

.sync-row:hover .sync-cell {
  background: var(--primary-weak);
}

/* R138：同步报告文件地址的可点链接（新标签打开 /api/sync/report，带登录 + 权限校验） */
.sync-report-link {
  color: var(--primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.sync-report-link:hover {
  opacity: 0.8;
}

.sync-row.is-ok .sync-cell-result {
  color: var(--primary);
}

.sync-row.is-fail .sync-cell-result {
  color: var(--danger, #dc2626);
}

/* R136：同步记录只留 5 行高度，多的用细滚动条藏住（表头不跟着滚） */
.sync-body {
  max-height: 200px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, #cbd5e1) transparent;
}

.sync-body::-webkit-scrollbar {
  width: 8px;
}

.sync-body::-webkit-scrollbar-thumb {
  background: var(--border-strong, #cbd5e1);
  border-radius: 6px;
}

/* R133：墓碑清单 —— 记过的也要能查、能移出 */
.sync-tomb {
  margin: 12px 0 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
  overflow: hidden;
}

.sync-tomb-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  color: var(--text-sub);
}

.sync-tomb-head b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sync-tomb-head .spacer {
  flex: 1 1 auto;
}

.sync-tomb-head button {
  padding: 3px 9px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
}

.sync-tomb-head button:hover {
  background: var(--primary-weak, #eef4ff);
}

/* 两段式确认的「待确认」态：橙色，提示再点一次就执行 */
.sync-tomb-head button.is-armed {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.sync-tomb-search {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
}

.sync-tomb-search input {
  width: 100%;
  box-sizing: border-box;
  padding: 5px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
}

.sync-tomb-list {
  /* R136：按用户要求只留 5 行的高度，多的用细滚动条藏起来（看得见、能滚） */
  max-height: 220px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong, #cbd5e1) transparent;
}

.sync-tomb-list::-webkit-scrollbar {
  width: 10px;
}

.sync-tomb-list::-webkit-scrollbar-thumb {
  background: var(--border-strong, #cbd5e1);
  border-radius: 6px;
}

.sync-tomb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
}

.sync-tomb-row:last-child {
  border-bottom: 0;
}

.sync-tomb-main {
  flex: 1 1 auto;
  min-width: 0;
}

.sync-tomb-title,
.sync-tomb-url {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sync-tomb-title {
  color: var(--text);
}

.sync-tomb-url {
  color: var(--text-mute);
  font-size: 11.5px;
}

.sync-tomb-time {
  flex: 0 0 auto;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.sync-tomb-row button {
  flex: 0 0 auto;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: var(--primary);
  cursor: pointer;
}

.sync-tomb-row button:hover {
  background: var(--primary-weak, #eef4ff);
}

.sync-tomb-warn {
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #fff8ed;
  color: #b45309;
  font-size: 12.5px;
  line-height: 1.6;
}

/* R134：页面内确认条（替代会被沙箱拦截的 window.confirm） */
.sync-tomb-confirm {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  background: #fff4e5;
  color: #9a3412;
  font-size: 12.5px;
  line-height: 1.6;
}

.sync-tomb-confirm button {
  padding: 3px 10px;
  border: 1px solid #d97706;
  border-radius: 6px;
  background: #fff;
  font-family: inherit;
  font-size: 12px;
  color: #9a3412;
  cursor: pointer;
}

.sync-tomb-confirm button:first-of-type {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
}

.sync-tomb-empty {
  margin: 0;
  padding: 12px 10px;
  color: var(--text-mute);
  font-size: 12.5px;
  text-align: center;
}

/* 令牌 / 间隔那一块配置区 */
.account-sync-config {
  margin: 10px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fbfcfe;
}

.account-sync-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
  color: var(--text-sub);
}

.account-sync-field > span {
  flex: 0 0 104px;
  color: var(--text-mute);
}

.account-sync-field input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12.5px;
  color: var(--text);
  background: #fff;
}

.account-sync-field input:focus {
  outline: none;
  border-color: var(--primary);
}

/* 明细（一次同步里每条收藏各做了什么；默认收起，不占地方） */
.account-sync-details {
  margin-top: 10px;
  max-height: 260px;
  overflow-y: auto;
}

.account-sync-details summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--primary);
}

.account-sync-detail-row {
  display: grid;
  grid-template-columns: 130px minmax(140px, 1fr) minmax(160px, 1.2fr) auto;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-sub);
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* R139：明细行尾的「编辑 / 删除」—— 与收藏区豆腐块右上角那两个按钮同一套动作。
   平时不占视觉重量，鼠标悬浮到这一行（或键盘聚焦进来）才浮出来。 */
.account-sync-detail-acts {
  display: flex;
  gap: 6px;
  justify-content: flex-end;
  align-items: center;
  opacity: 0;
  transition: opacity 0.12s;
}

.account-sync-detail-row:hover .account-sync-detail-acts,
.account-sync-detail-row:focus-within .account-sync-detail-acts {
  opacity: 1;
}

.sync-detail-act {
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  padding: 2px 7px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-sub);
  white-space: nowrap;
}

.sync-detail-act:hover {
  color: var(--primary);
  border-color: var(--primary);
}

.sync-detail-act[data-act="del"]:hover {
  color: #d9534f;
  border-color: #d9534f;
}

.account-sync-detail-row:last-child {
  border-bottom: none;
}

/* 横向滚动容器。滚动条细条化由 R102 的全局 *::-webkit-scrollbar{height:8px} 兜底，
   这里再显式声明一次，避免将来有人改全局规则时把这处带粗。 */
.admin-table-wrap {
  margin-top: 10px;
  overflow-x: auto;
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: #fff;
}

.admin-table-wrap::-webkit-scrollbar {
  height: 8px;
}

/* R147：密码 / 预留答案两列已下线（外部审计 H-01），
   现在是 用户名 / 预留问题 / 手机号 / AI 分析条件 / 状态 / 操作 */
.admin-head,
.admin-row {
  display: grid;
  grid-template-columns: 140px 240px 150px minmax(240px, 1fr) 80px 210px;
  align-items: stretch;
}

.admin-head .admin-cell {
  background: #f7f9fc;
  color: var(--text);
  font-weight: 600;
}

.admin-cell {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-sub);
  overflow-wrap: anywhere;
  word-break: break-word;
}

.admin-row:last-child .admin-cell {
  border-bottom: none;
}

.admin-row:hover .admin-cell {
  background: var(--primary-weak);
}

.admin-row.is-admin .admin-cell-user {
  color: var(--primary);
  font-weight: 600;
}

.admin-row.is-disabled {
  opacity: .6;
}

.admin-row.is-disabled .admin-cell-state {
  color: var(--danger, #dc2626);
}

.admin-cell-ops {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.admin-op-btn {
  padding: 4px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text-sub);
  font-family: inherit;
  font-size: 12px;
  white-space: nowrap;
  cursor: pointer;
}

.admin-op-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-weak);
}

.admin-op-btn.admin-op-danger {
  border-color: #fecaca;
  color: #dc2626;
}

.admin-op-btn.admin-op-danger:hover {
  border-color: #dc2626;
  background: #fef2f2;
  color: #dc2626;
}

/* R42：账号「全量数据备份」面板 */
.account-backup {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--border);
}

.account-backup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-backup-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.account-backup-hint {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.7;
  color: var(--text-mute);
}

.account-backup-msg {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-sub);
}

.account-backup-msg.is-error {
  color: var(--danger, #dc2626);
}

.account-backup-list {
  margin: 10px 0 0;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* R45：快照列表占满整行（面板本身是 flex 行，按钮落在列表下方） */
.account-backup-list .backup-rows {
  flex: 1 1 100%;
  min-width: 0;
}

/* R102：快照按类型分成「网站自动备份」（上）/「手动备份」（下）两组，每组整体占满一行 */
.account-backup-list .backup-group {
  flex: 1 1 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.backup-group-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  color: var(--text);
  font-size: 12.5px;
  font-weight: 600;
}

.backup-group-note {
  color: var(--text-sub);
  font-size: 11.5px;
  font-weight: 400;
}

/* R102：每组列表各自限高 —— 两组都摊开时长列表会把弹窗撑得很高 */
/* R141：收到约 3 行高（36px/行 × 3），超出的靠全局细滚动条翻（见文件顶部的
   `*{scrollbar-width:thin}` / `*::-webkit-scrollbar{width:8px}`，早已存在） */
.backup-group .backup-rows {
  max-height: 108px;
}

/* R44：账号「预留问题 / 找回密码」 */
.account-link {
  display: inline-block;
  margin: 2px 0 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--primary);
  font-family: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.account-link:hover {
  text-decoration: underline;
}

.account-recover {
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--border);
}

.account-recover-hint {
  margin: 0 0 10px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-mute);
}

.account-recover-question {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--primary-weak);
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.6;
  word-break: break-word;
}

.account-security {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--border);
}

/*
 * R56：注册表单里的「预留问题 + 答案」分组。
 * 只是给两个 .account-field 套一层浅底容器，视觉上相当于缩进一小块；
 * 里面每个字段的样式仍由 .account-field / .account-input 提供，不新开一套。
 */
.account-register-security {
  margin: 0 0 12px;
  padding: 10px 12px 2px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #f7f9fc;
}

.account-register-hint {
  margin: 0 0 10px;
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text-mute);
}

.account-security-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.account-security-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.account-security-status {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-sub);
  word-break: break-word;
}

.account-security-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.account-security-msg {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-sub);
}

.account-security-msg.is-error {
  color: var(--danger, #dc2626);
}

/*
 * R90：账号弹窗里的「AI 分析条件」面板。
 * 外观沿用 .account-security（同款浅底圆角块），只多一条说明文字与多行输入框样式。
 */
.account-ai {
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 10px;
  background: #f7f9fc;
  border: 1px solid var(--border);
}

.account-ai-hint {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-sub);
}

/* 多行条件输入：与单行 .account-input 同款边框，补上纵向拉伸与字体继承。
   R92：用户要求「只用两行就够了，不用太多」——min-height 由 72px 降到 44px，
   配合模板里的 rows="2"，默认就是两行高；仍保留 resize: vertical 供临时拉大。 */
.account-textarea {
  resize: vertical;
  min-height: 44px;
  line-height: 1.6;
}

/* 头部内容区改为「左：查询栏 / 右：人气榜」的横向布局 */
.header-inner {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  flex-wrap: wrap;
}

.header-main {
  flex: 1 1 420px;
  min-width: 0;
}

/* 查询栏：允许换行，最近搜索占剩余空间 */
.query-bar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.query-bar .field {
  flex: 0 0 auto;
}

/*
 * R49：查询栏的错误提示独占一行，排在**查询行下方**。
 *
 * 它原本是 .field-code 里的流内元素（label → input → 错误），出错时把那个 field
 * 撑高一个提示行；而本查询栏是 `align-items: flex-end` 的 flex 行，行底由最高的
 * 兄弟项决定，于是输入框被整体顶高（实测约 21px），与「分红年数」下拉、查询按钮
 * 上下错开 —— 用户反馈的「输入框会上移错位」。
 *
 * 现在它在 DOM 里是 .query-bar 的最后一个子元素（见 index-modular.html 的 R49 注释），
 * `flex-basis: 100%` 保证它一定换到新的一行；第一行的控件几何位置因此与提示是否
 * 出现完全无关（零位移），提示只向下长。
 * ⚠️ 别再把它挪回某个 .field 内部 —— 那正是这个 bug 的成因。
 */
.query-bar > .field-error {
  flex: 1 0 100%;
  margin: 0;
}

/* 年数下拉不需要长提示，压缩宽度 */
.field-years {
  min-width: 0;
}

.field-years .field-hint {
  font-size: 11px;
}

/* 最近搜索移到查询按钮后：横向紧凑 chip 排列 */
.recent-inline {
  flex: 1 1 320px;
  min-width: 240px;
  margin: 0;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle, #f8fafc);
}

.recent-inline .recent-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.recent-inline .recent-title {
  font-size: 12px;
  color: var(--text-mute);
  font-weight: 500;
}

.recent-inline .recent-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 6px;
  max-height: 56px;
  overflow-y: auto;
}

.recent-inline .recent-empty {
  margin: 0;
  font-size: 12px;
}

/* 左侧人气榜：竖排 */
/* R18：移除 position:sticky —— 本元素位于 .app-header（本身已 sticky）内部，
   嵌套 sticky 会让 header 高度被撑到内容全高（实测 4826px），
   在页面上表现为查询栏与结果区之间出现巨大空隙。 */
.hot-rail {
  flex: 0 0 168px;
  width: 168px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle, #f8fafc);
}

.hot-rail-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px dashed var(--border);
}

.hot-rail-title {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
}

.hot-rail-meta {
  font-size: 11px;
  color: var(--text-mute);
}

.hot-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.hot-empty {
  font-size: 11.5px;
  color: var(--text-mute);
  line-height: 1.5;
  padding: 4px 2px;
}

.hot-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 4px 5px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}

.hot-btn:hover {
  background: var(--primary-weak);
}

.hot-rank {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 3px;
  font-size: 10.5px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #e2e8f0;
  color: #475569;
}

/* 前三名用不同底色突出（红/橙/蓝，符合热度语义） */
.hot-rank-top.hot-rank { background: #fee2e2; color: #b91c1c; }
.hot-rank-rest { }

.hot-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* R15：人气榜已按用户要求去掉 6 位代码显示（hot-code 样式随之移除） */
.hot-rail-foot {
  margin: 8px 0 0;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 11px;
  color: var(--text-mute);
  text-align: center;
}

/* 窄屏：人气榜移回顶部横向 */
@media (max-width: 900px) {
  .hot-rail {
    flex: 1 1 100%;
    width: 100%;
  }
  .hot-list {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .hot-btn {
    width: auto;
  }
}

/* ============================================================
   R14 锚点：两字一行 + 回顶标红
   ============================================================ */

/* 限制宽度并允许换行 → 「公司概况」这类四字标签折成两行 */
.anchor-item {
  width: 34px;
  min-width: 34px;
  height: auto;
  min-height: 22px;
  padding: 2px 4px;
  border-radius: 6px;
  align-items: flex-start;
  justify-content: center;
  line-height: 1.25;
}

.anchor-label {
  white-space: normal;      /* 允许换行：两字一行 */
  word-break: break-all;
  text-align: center;
  font-size: 11px;
}

/* 回顶：红底白字，醒目 */
.anchor-top {
  margin-bottom: 4px;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  width: 34px;
  background: #dc2626;
  color: #fff;
  font-weight: 600;
}

.anchor-top:hover {
  background: #b91c1c;
  color: #fff;
}

.anchor-top .anchor-label {
  color: #fff;
  font-weight: 600;
}

/* ============================================================
   R15：锚点滚动定位修正
   app-header 是 position:sticky(top:0)，会遮住被滚动到顶部的区块标题。
   统一用 scroll-margin-top 预留高度，JS 侧 scrollIntoView 不再手算偏移。
   ============================================================ */
/* R20：--anchor-offset 由 JS(syncAnchorOffset) 按 header 实测高度写入，
   未写入时回退 96px，保证纯 CSS 环境下也不会退化。 */
.app-main {
  /* 预留 sticky header 高度 + 一点呼吸间距 */
  scroll-margin-top: var(--anchor-offset, 96px);
}

.app-main section[data-anchor],
.app-main .card {
  scroll-margin-top: var(--anchor-offset, 96px);
}

/* 条件选股原在 <main> 之外，现已并入主内容流，统一同样处理 */
#iwencai-section {
  scroll-margin-top: var(--anchor-offset, 96px);
}

/* ============================================================
   R16：人气榜刷新按钮 + 热度值
   ============================================================ */
.hot-rail-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.hot-refresh {
  flex: none;
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 11px;
  line-height: 1.4;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.hot-refresh:hover:not(:disabled) {
  background: var(--primary-weak);
  color: var(--primary);
  border-color: var(--primary);
}

.hot-refresh:disabled {
  opacity: 0.6;
  cursor: progress;
}

/* 热度值：弱化显示，不与股票名抢焦点 */
.hot-heat {
  flex: none;
  font-size: 10.5px;
  color: var(--text-mute);
  font-variant-numeric: tabular-nums;
}

.hot-rail-foot {
  line-height: 1.5;
}

/* ============================================================
   R17：顶部锚点链接（样式沿用 .brand-sub，仅加可交互反馈）
   ============================================================ */
.brand-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.brand-link:hover {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.brand-link:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 2px;
}

.brand-sep {
  margin: 0 3px;
  opacity: 0.6;
}

/* 股票代码输入框收窄（原 flex:0 0 auto 会撑满） */
.query-bar .field:not(.field-years) {
  flex: 0 0 auto;
}

.query-bar .field input#code-input {
  width: 168px;
  max-width: 168px;
}

/* 人气榜：标题与条目文字居中（R17 用户要求） */
.hot-rail-title {
  text-align: center;
}

/* 条目：排名+名称+热度 整体居中 */
.hot-btn {
  justify-content: center;
  text-align: center;
}

.hot-name {
  text-align: center;
  /* 名称居中后仍需保留省略号能力 */
  flex: 0 1 auto;
}

.hot-rank,
.hot-heat {
  text-align: center;
}

/* ============================================================
   R18：查询区与最近搜索视觉对齐（同款底色 + 等高）
   ============================================================ */

/* 给「股票代码 / 分红年数 / 查询」这一段包上与最近搜索一致的底色，
   消除用户截图里「前面没背景、后面有背景」的不一致 */
.query-bar {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-subtle, #f8fafc);
  /* 与下方 .recent-inline 保持相同内边距，使两组视觉等高 */
}

/* 标签与控件垂直居中，避免上沿不齐 */
.query-bar .field {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.query-bar .field > label {
  font-size: 12px;
  line-height: 1.4;
  margin-bottom: 3px;
}

/* 查询按钮与下拉框、输入框同高 */
.query-bar .btn-primary {
  align-self: flex-end;
}

/* 两组容器高度对齐：recent-inline 与 query-bar 均为两行结构（标签+控件） */
.recent-inline {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   R18：人气榜第二排显示今日涨跌幅（红涨绿跌）
   ============================================================ */
.hot-main {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;   /* 与上方标题「居中」要求保持一致 */
  gap: 1px;
}

.hot-name {
  text-align: center;
}

.hot-chg {
  font-size: 10.5px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* A 股口径：红涨绿跌 */
.hot-chg.is-up { color: #dc2626; }    /* 红 */
.hot-chg.is-down { color: #15803d; }  /* 绿 */
.hot-chg.is-flat { color: var(--text-mute); }

/* ============================================================
   R18：人气榜底部说明（用户要求从逗号处换行成两行）
   ============================================================ */
.hot-rail-foot {
  /* 从「，」处断行：第一行「数据来自同花顺」，第二行「每30分钟自动更新」 */
  max-width: 132px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
  word-break: normal;
  overflow-wrap: break-word;
  line-height: 1.6;
}

/* ============================================================
   R18：右侧锚点 —— 两字一行（不要一字一行）
   ============================================================ */

/* 关键：不能用 word-break: break-all（会逐字断行），
   改用 overflow-wrap: anywhere 只在必要时断词，
   并把标签宽度固定为 2 个汉字宽 → 「公司概况」折成 2+2 两行，
   而非4 个字各占一行 */
.anchor-item {
  width: 32px;
  min-width: 32px;
}

.anchor-label {
  white-space: normal;
  /* 两个 11px 汉字 ≈ 22px；用固定 px 而非 2em，
     因为 2em 会随各自字体大小算出不同值，实测只有 15px 导致一字一行 */
  width: 22px;
  /* break-all 会逐字断行（4 个字各占一行），必须用 normal */
  word-break: normal;
  overflow-wrap: anywhere;
  line-height: 1.3;
  letter-spacing: 0;
}

/* 圆点与文字两行并存时仍保持顶部对齐 */
.anchor-item {
  align-items: flex-start;
}

.anchor-dot {
  margin-top: 3px;
}

/* ============================================================
   R18 补充：两组容器真正等高
   实测：输入框/下拉/按钮均38px（已一致），
   但 .query-bar 高 178px、.recent-inline 仅 92px。
   原因是 query-bar 内多了一组「标签+控件」且 align-items:flex-end 产生额外行距。
   ============================================================ */

/* 让两组的总高度都由「标签行 + 控件行」决定，多余间距由内边距统一 */
.query-bar {
  align-items: stretch;
  min-height: 56px;
}

.query-bar .field {
  justify-content: flex-start;
}

.query-bar .field > label {
  margin-bottom: 4px;
}

/* 查询按钮与控件底边对齐（不再 align-self:flex-end，避免拉高容器） */
.query-bar .btn-primary {
  align-self: flex-end;
  height: 38px;
}

.recent-inline {
  min-height: 56px;
}

/* ============================================================
   R18 修正（放在文件末尾以覆盖前面重复定义）
   实测问题：标签宽仅 15px（2em 在 11px 字号下偏小）→「公司概况」仍一字一行
   ============================================================ */

/* 固定 22px = 两个 11px 汉字实宽，保证 4 字标签折成 2+2 两行 */
.anchor-label {
  width: 22px;
  word-break: normal;        /* 禁用逐字断行 */
  overflow-wrap: anywhere;
  white-space: normal;
}

/* 查询区与最近搜索等高：统一内边距与最小高度 */
.query-bar {
  align-items: center;
  min-height: 62px;
  padding: 8px 12px;
}

.query-bar .field {
  justify-content: center;
  gap: 0;
}

.query-bar .field > label {
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.3;
}

.recent-inline {
  min-height: 62px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   R18 修正（放在文件末尾以覆盖前面重复定义）
   实测问题：标签宽仅 15px（2em 在 11px 字号下偏小）→「公司概况」仍一字一行
   ============================================================ */

/* 固定 22px = 两个 11px 汉字实宽，保证 4 字标签折成 2+2 两行 */
.anchor-label {
  width: 22px;
  word-break: normal;        /* 禁用逐字断行 */
  overflow-wrap: anywhere;
  white-space: normal;
}

/* 查询区与最近搜索等高：统一内边距与最小高度 */
.query-bar {
  align-items: center;
  min-height: 62px;
  padding: 8px 12px;
}

.query-bar .field {
  justify-content: center;
  gap: 0;
}

.query-bar .field > label {
  margin-bottom: 3px;
  font-size: 12px;
  line-height: 1.3;
}

.recent-inline {
  min-height: 62px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   R18 修正②：.anchor-item 是 flex 容器，label 会被 flex-shrink 压缩
   （实测设width:22px 实际只有 15px）。禁用收缩 + 提高优先级。
   ============================================================ */
.anchor-item {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
}

.anchor-label {
  flex: none !important;      /* 关键：不被 flex 压缩 */
  width: 22px !important;
  min-width: 22px !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* ============================================================
   R18 修正②：.anchor-item 是 flex 容器，label 会被 flex-shrink 压缩
   （实测设width:22px 实际只有 15px）。禁用收缩 + 提高优先级。
   ============================================================ */
.anchor-item {
  width: 34px;
  min-width: 34px;
  max-width: 34px;
}

.anchor-label {
  flex: none !important;      /* 关键：不被 flex 压缩 */
  width: 22px !important;
  min-width: 22px !important;
  word-break: normal !important;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* ============================================================
   R18 修正③：顶部两组真正等高
   .query-bar（表单，横向）与 .recent-inline（纵向两行）结构不同，
   让它们作为 flex 子项stretch 到同一行高度，而不是各自按内容收缩。
   ============================================================ */

/* .query-bar 本身是 form，需让其内部（.header-main 的 flex 行）等高 */
.header-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 查询栏与最近搜索并排成一行，且等高 */
.query-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;   /* 关键：子项拉伸等高 */
}

/* 最近搜索作为 query-bar 的同级块级元素参与同一 flex 行 */
.query-bar > .recent-inline {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: auto;
}

/* 查询区内部：标签在上、控件在下，两块整体垂直居中 */
.query-bar > .field {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   R18 修正③：顶部两组真正等高
   .query-bar（表单，横向）与 .recent-inline（纵向两行）结构不同，
   让它们作为 flex 子项stretch 到同一行高度，而不是各自按内容收缩。
   ============================================================ */

/* .query-bar 本身是 form，需让其内部（.header-main 的 flex 行）等高 */
.header-main {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 查询栏与最近搜索并排成一行，且等高 */
.query-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;   /* 关键：子项拉伸等高 */
}

/* 最近搜索作为 query-bar 的同级块级元素参与同一 flex 行 */
.query-bar > .recent-inline {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: auto;
}

/* 查询区内部：标签在上、控件在下，两块整体垂直居中 */
.query-bar > .field {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ============================================================
   R19：最近搜索只保留一行
   用户反馈出现纵向滚动条（超出部分需滚动才能看到）。
   改为单行不换行 + 超出隐藏，横向可滚动查看其余记录。
   ============================================================ */
.recent-inline .recent-list {
  flex-wrap: nowrap;              /* 不换行 → 恒定一行 */
  overflow-x: auto;              /* 横向滚动查看其余 */
  overflow-y: hidden;            /* 关键：去掉纵向滚动条 */
  max-height: none;              /* 取消原 max-height 限制 */
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.recent-inline .recent-list::-webkit-scrollbar {
  height: 4px;
}

.recent-inline .recent-list::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: 2px;
}

.recent-inline .recent-item {
  flex: none;                    /* 防止被压缩 */
}

/* 空态提示在单行下不应撑高 */
.recent-inline .recent-empty {
  flex: none;
  margin: 0;
  line-height: 1.6;
}

/* ============================================================
   R19：人气榜条目三列布局（序号 / 名称+涨跌幅 / 热度）
   用户反馈：涨跌幅挤在中间，应紧跟名称；
            且整个列表左侧对齐，与右侧锚点风格不一致。
   ============================================================ */

/* 名称与涨跌幅在同一行紧邻，不再是「名称在上、涨跌幅在下」 */
.hot-main {
  display: flex;
  flex-direction: row;        /* 改为横向：名称紧跟涨跌幅 */
  align-items: baseline;
  gap: 4px;
  justify-content: center;
  flex: 0 1 auto;
  min-width: 0;
}

.hot-name {
  flex: none;
}

.hot-chg {
  flex: none;
}

/* 三列整体居中，但整体仍占满按钮宽度（与右侧锚点视觉对齐） */
.hot-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 4px 6px;
}

/* 热度值固定在右侧，避免随名称长度跳动 */
.hot-heat {
  flex: none;
  margin-left: auto;
  min-width: 34px;
  text-align: right;
}

/* 名称过长时省略，避免挤压热度列 */
.hot-name {
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ============================================================
   R21：查询按钮与输入框对齐
   ------------------------------------------------------------
   实测（1440px 视口）：代码输入框 / 年数下拉 均在 y=110..148，
   而按钮仅 align-self:flex-end → 落在 y=112..150，比控件低 2px，
   视觉上「按钮掉下去了」。这里让按钮与控件底边齐平（差 0.5px 内）。
   ============================================================ */
.query-bar .btn-primary {
  align-self: flex-end;
  height: 38px;
  /* 控件行在字段内垂直居中，底部留约 2px 余量；按钮贴底会低 2px，补偿回来 */
  margin-bottom: 2px;
}

/* 窄屏换行后按钮自成一行时，不再需要这个补偿 */
@media (max-width: 560px) {
  .query-bar .btn-primary {
    margin-bottom: 0;
  }
}

/* ============================================================
   R22：卡片底框对齐 / 股东合计占比标红 / 分红率列
   ============================================================ */

/*
 * 1) 爱问财条件选股卡片的底框与其它卡片对齐。
 *    实测（1440px 视口）：
 *      .result-area 内卡片      x=93  w=1240
 *      #iwencai-section 内卡片  x=113 w=1200   ← 左右各窄 20px
 *    原因：R15 把 #iwencai-section 移进 <main class="app-main"> 后，
 *          .app-main 的 padding:20px 与 .app-section 的 padding:0 20px 叠加了两次；
 *          且它作为 .app-main 的直接子元素不参与 .result-area 的 gap:16px，
 *          与上方卡片间距实测为 0。
 *    处理：去掉重复内边距 + 补 16px 上间距，与卡片间距一致。
 */
.app-section {
  max-width: 1280px;
  margin: 16px auto 0;
  padding: 0;
}

/* 2) 前十大股东合计占比 < 50%：整行标红（提示股权相对分散） */
.data-table tfoot tr.is-low-total td {
  color: var(--danger);
}

.footnote-alert {
  color: var(--danger);
}

/* 3) 分红表「分红率」列：数字对齐 + 空值淡化（与其它列的空值表现一致） */
.data-table td.payout-cell {
  font-variant-numeric: tabular-nums;
}

.data-table td.payout-cell.is-empty {
  color: var(--text-mute);
}

/* ============================================================
   R23：查询按钮与输入框严格平齐 / 右下角常驻回顶按钮 / 合计占比只标红数值
   ============================================================ */

/*
 * 1) 查询按钮与输入框平齐。
 *    实测（1440×900，最近搜索 7 条）：
 *      .query-bar        高 103.2px（行高被右侧「最近搜索」面板撑到 85.2px）
 *      #code-input       top=122.7 bottom=160.7
 *      #submit-btn       top=135.0 bottom=173.0   ← 比输入框低 12.3px
 *    原因：查询栏是 flex 行（align-items 生效值 stretch），各 .field 内容
 *          在拉高的行内居中，而按钮 align-self:flex-end 直接贴到行底。
 *    处理：按钮改用与输入框同构的 .field 容器（含一个不可见占位标签，
 *          字号/行高/下边距与真实标签完全一致），于是按钮与输入框同处
 *          「标签行 + 控件行」结构中，无论行高如何变化都严格对齐。
 *    下面同时把旧的 align-self:flex-end 与 margin-bottom:2px 归零。
 */
.query-bar .field-action {
  display: flex;
  flex-direction: column;
  justify-content: center;
  flex: 0 0 auto;
}

.query-bar .field-ghost {
  /* 与 .query-bar .field > label 完全同参，仅不可见 */
  visibility: hidden;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: 3px;
}

.query-bar .field-action .btn-primary {
  align-self: flex-start;
  flex: 0 0 auto;
  height: 38px;
  margin: 0;
}

/*
 * 窄屏（≤768px，与站内其它窄屏断点一致）查询栏会换行、按钮自成一行，
 * 此时占位标签只会带来一段无意义的空白，直接隐藏。
 * 断点取 768 是实测结果：769~800px 仍未换行（占位标签继续保证平齐），
 * ≤768px 换行（隐藏占位标签，按钮在自己的行内正常居中）。
 */
@media (max-width: 768px) {
  .query-bar .field-ghost {
    display: none;
  }
}

/* 2) 右下角常驻回顶按钮（fixed，任何滚动位置都可点） */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  width: 46px;
  height: 52px;
  padding: 0;
  border: none;
  border-radius: 12px;
  background: #dc2626;
  color: #fff;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.1;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.32);
  transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.to-top:hover {
  background: #b91c1c;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.38);
}

.to-top:active {
  transform: translateY(0);
}

.to-top:focus-visible {
  outline: 3px solid rgba(220, 38, 38, 0.35);
  outline-offset: 2px;
}

.to-top-arrow {
  font-size: 17px;
  line-height: 1;
}

/* 小屏收成圆形，避免遮挡内容 */
@media (max-width: 560px) {
  .to-top {
    right: 14px;
    bottom: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
  }
  .to-top-text {
    display: none;
  }
  .to-top-arrow {
    font-size: 18px;
  }
}

/* 3) R23 修订：前十大股东合计占比 < 50% 时「只标红数值」，前面的说明文字保持常规颜色 */
.data-table tfoot tr.is-low-total td {
  color: var(--text);
}

.data-table tfoot td.is-low-value,
.data-table tfoot .low-value {
  color: var(--danger);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 数值后的补充说明（如「部分股东占比缺失」）保持常规颜色，避免整行发红 */
.data-table tfoot .low-note {
  color: var(--text-sub);
  font-weight: 400;
}

/* 表尾补充说明不再整段标红（用户要求「只需要数值标红」） */
.footnote-alert {
  color: inherit;
  font-weight: 600;
}

/* ============================================================
   R195：股东增减持记录表配色
   ------------------------------------------------------------
   A 股口径：增持红、减持绿；控股股东/实际控制人名称红字加粗；
   变动后占流通股比例 > 2% 红字加粗（提示持股已具一定流通盘影响力）。
   ============================================================ */
.holder-chg-up {
  color: #dc2626;
  font-weight: 600;
}

.holder-chg-down {
  color: #15803d;
  font-weight: 600;
}

.holder-name-critical {
  color: #dc2626;
  font-weight: 700;
}

.holder-free-ratio-hot {
  color: #dc2626;
  font-weight: 700;
}

/* ============================================================
   R196：股东增减持记录表 —— 标题行折叠按钮 + 10 行滚动区
   ------------------------------------------------------------
   折叠按钮默认收起；展开后容器固定约 10 行高度，超出部分用
   侧边细滚动条（6px）查看，避免 40 条记录把整页拉得过长。
   手机端同样生效：滚动限制在表格内部（overscroll-behavior: contain），
   不会带动页面上下滚动；横向仍可左右拖动看完整列。
   ============================================================ */
.holder-chg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 10px;
}

.holder-chg-head .section-sub {
  flex: 1;
  min-width: 0;
  margin: 0;
}

.holder-chg-scroll {
  max-height: 424px; /* 表头 1 行 + 数据 10 行（13px × 1.5 + 18px padding + 1px 边框） */
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.holder-chg-scroll[hidden] {
  display: none;
}

.holder-chg-scroll::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

.holder-chg-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.holder-chg-scroll::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}

.holder-chg-scroll::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* R196：结论标注区（R197 起由 EPS 图推广到趋势图表全部 10 张图） */
.eps-verdict, .chart-verdict {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  font-size: 12px;
  line-height: 1.8;
  color: #475569;
}

.eps-verdict-title, .chart-verdict-title {
  font-weight: 700;
  color: #0f172a;
  margin-right: 6px;
}

.eps-verdict-badge, .chart-verdict-badge {
  display: inline-block;
  margin-right: 8px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.eps-verdict-badge.ok, .chart-verdict-badge.ok {
  background: #dcfce7;
  color: #15803d;
}

.eps-verdict-badge.warn, .chart-verdict-badge.warn {
  background: #fef3c7;
  color: #b45309;
}

.eps-verdict-badge.bad, .chart-verdict-badge.bad {
  background: #fee2e2;
  color: #dc2626;
}

.eps-verdict-badge.na, .chart-verdict-badge.na {
  background: #e2e8f0;
  color: #64748b;
}

.eps-verdict-conclusion, .chart-verdict-text {
  margin-top: 4px;
  font-weight: 700;
}

.eps-verdict-conclusion.good, .chart-verdict-text.good { color: #15803d; }
.eps-verdict-conclusion.warn, .chart-verdict-text.warn { color: #b45309; }
.eps-verdict-conclusion.bad, .chart-verdict-text.bad { color: #dc2626; }
.eps-verdict-conclusion.na, .chart-verdict-text.na { color: #64748b; }

.chart-verdict-extra {
  margin-top: 4px;
  color: #94a3b8;
}

/* R201：EPS 图不再跨两列。之前 span 2 让 eps-panel 从行3列3往右挤到第4列
   （grid 只有 3 列 → 行3列3空，eps 溢出到行4开头），导致用户看到「第三排第三
   个空位」。EPS 图 280px 高 + 多系列在 280px 宽的单格里已经足够可读，
   退一步换成单格，4 行 × 3 列严格填满。 */
#eps-panel {
  grid-column: auto;
}

/* ============================================================
   R24：顶部底框宽度 / 中文联想 / 剪贴板监控 / 轻提示 / 规模排版 / 移动端
   ============================================================ */

/*
 * 1) 顶部「背景底框」与下方内容底框宽度不一致（用户截图：右上角指向查询区，
 *    右下角指向内容区，两条边不齐；放大缩小时时好时坏）。
 *
 *    实测（查询 600519 后，最近搜索 7 条）：
 *      视口 1800/1600/1440  → 查询栏宽 1055.7px，内容卡片宽 1240px   ← 差 184.3px
 *      视口 1024/960/900    → 查询栏与卡片同宽（都是 945/905/845）
 *    根因：`.query-bar` 是 `.header-inner`（flex, wrap）的子项，而
 *          `.header-inner` 默认给子项 `flex: 0 1 auto` —— 查询栏宽度是
 *          **由内容撑出的 max-content（1055.7px）**，行内还有空余也不会拉伸；
 *          只有当可用宽度小于 max-content 时才会被压到「刚好等于容器宽」。
 *          于是「宽屏窄一截、窄屏又刚好齐」，缩放一下就会跳。
 *    处理：让它独占一行并撑满容器（标题在第 1 行、查询区在第 2 行，本就如此），
 *          宽度即等于 `.header-inner` 内容宽 = `.app-main` 内容宽 = 卡片宽。
 */
.header-inner > .query-bar {
  flex: 1 0 100%;
  min-width: 0;
}

/* 2) 中文名/代码联想下拉（R24） */
.field-code {
  position: relative;
}

.suggest-panel {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 45;
  width: max(280px, 100%);
  max-height: 292px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--card-bg);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.suggest-panel[hidden] {
  display: none;
}

.suggest-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: none;
  border-radius: 7px;
  background: transparent;
  font-family: inherit;
  font-size: 13px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.suggest-item:hover,
.suggest-item.is-active {
  background: var(--primary-weak, #eff6ff);
}

.suggest-code {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  color: var(--primary);
}

.suggest-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.suggest-type {
  flex: 0 0 auto;
  color: var(--text-mute);
  font-size: 11.5px;
}

/* R28：在线联想不可达、改由本机内置名录匹配时的顶部说明 */
.suggest-note {
  margin: 0;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
  color: var(--text-mute);
  font-size: 11.5px;
  line-height: 1.5;
}

/* 3) 剪贴板提示条（R72 取代原来的「监控剪贴板」开关） */
/* 与 .query-bar > .field-error 同款定位策略：`flex: 1 0 100%` 独占一行排在查询行末尾，
   出现与否都不改变第一行各控件的几何位置（按钮不会因为多一行提示而位移）。 */
.clip-hint {
  display: flex;
  flex: 1 0 100%;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary-weak);
  color: var(--text);
  font-size: 12.5px;
  line-height: 1.5;
}

.clip-hint-text {
  flex: 1 1 auto;
  min-width: 0;
}

.clip-hint-btn {
  flex: 0 0 auto;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-family: inherit;
  font-size: 12.5px;
  white-space: nowrap;
  cursor: pointer;
}

.clip-hint-btn:hover {
  filter: brightness(1.06);
}

.clip-hint-close {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-mute);
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.clip-hint-close:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text);
}

/* 4) 全局轻提示（fixed，不参与文档流，绝不引起布局跳动） */
.toast {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 120;
  max-width: min(560px, calc(100vw - 32px));
  padding: 10px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 10px;
  background: var(--card-bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

.toast[hidden] {
  display: none;
}

.toast.is-error {
  border-color: #fecaca;
  background: #fef2f2;
  color: #b91c1c;
}

/* 5) 基金规模：金额独立不折行，规模日期另起一行小字（R24） */
.desc-item.is-stack {
  flex-wrap: wrap;
}

.desc-item.is-stack .desc-value {
  flex: 1 0 auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.desc-item.is-stack .desc-note-inline {
  flex: 0 0 100%;
  margin-top: 2px;
  font-size: 11px;
  line-height: 1.4;
}

/* ============================================================
   R24：移动端适配（为打包成 App 做准备）
   ------------------------------------------------------------
   目标机型：iPhone SE(375) ~ 主流安卓(360-430) 的 WebView。
   要点：防止 iOS 聚焦缩放、点击热区 ≥ 40px、表格横向滚动、
        刘海/小白条安全区、标题栏换行不溢出。
   ============================================================ */
@media (max-width: 768px) {
  /* ① 顶部副标题（6 个跳转项）允许换行，不再 nowrap 溢出 */
  .brand-sub {
    white-space: normal;
    line-height: 1.9;
  }

  /* ② iOS 在 font-size < 16px 的输入控件聚焦时会强制放大页面，这里统一提到 16px */
  .field input,
  .field select,
  .recent-inline .recent-name,
  .recent-inline .recent-code {
    font-size: 16px;
  }

  .recent-inline .recent-name {
    font-size: 13px;
  }
  .recent-inline .recent-code {
    font-size: 12px;
  }

  /* ③ 点击热区：所有按钮至少 40px 高 */
  .btn,
  .clip-hint-btn,
  .hot-refresh {
    min-height: 40px;
  }

  /* ④ 卡片与页脚留白收紧，信息密度更高 */
  .card {
    padding: 14px 13px;
    border-radius: 10px;
  }

  .result-area {
    gap: 12px;
  }

  .app-main {
    padding-top: 14px;
  }

  /* ⑤ 表格：保持横向滚动（.data-table 已有 min-width:640px），
        并让滚动条更贴近手指习惯 */
  .table-wrap {
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }

  /* ⑥ 联想下拉在手机上占满输入框宽度 */
  .suggest-panel {
    width: 100%;
    max-height: 46vh;
  }
}

/* ⑦ 安全区：底部小白条 / 刘海屏（打包成 App 后必需，浏览器里 env() 为 0 不影响） */
.app-footer {
  padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 560px) {
  .to-top {
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  }

  /* 手机上超长的「区间累计/分红次数」等数字列改为两列更省空间 */
  .metric-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  }

  .metric-value {
    font-size: 17px;
  }

  .card-header h2 {
    font-size: 15px;
  }

  .brand h1 {
    font-size: 17px;
  }
}

/* ============================================================
   R25：季度营业额 / 资产负债率 趋势图 + 股权分散提示整句标红
        + 分红表倒序（最新在最上）
   ============================================================ */

/* ① 合计占比低于 50% 时，那句结论整句标红。
    为什么是独立类而非直接改 .footnote-alert：
      R23 曾应要求把 .footnote-alert 调成 inherit（只让数值标红）；
      但「股权相对分散」这句是**结论性警示**，用户要求它出现时必须醒目标红。
      用 .footnote-alert.is-critical 精确命中这一句，其余附注维持 R23 的配色。 */
.footnote-alert.is-critical {
  color: var(--danger);
  font-weight: 600;
}

/* ============================================================
   R29：手机端兼容性修复
   ------------------------------------------------------------
   用 headless Chrome 在 320/375/390/412 四种宽度下实测（含点完查询后的
   满内容态），发现以下问题，逐条修复。前两条是**功能性缺陷**，不是外观问题。
   ============================================================ */
@media (max-width: 768px) {
  /* ① 【致命】取消顶栏吸顶。
     手机上查询表单纵向堆叠后，.app-header 实测高达 725px（iPhone 14 视口 844px 的 86%）。
     它同时是 position:sticky(top:0)，于是滚动时整块钉在顶部，
     内容区只剩底部一条缝 —— 表现就是「页面几乎滚不动、往下看不到内容」。
     桌面端 header 只有 ~150px，吸顶是合理的，因此只在窄屏取消。 */
  .app-header {
    position: static;
  }

  /* ② 【致命】「最近搜索」不再被当成 320px 高。
     .recent-inline 的 `flex: 1 1 320px` 在桌面是横向排布的**宽度**，
     但窄屏 .query-bar 改成 flex-direction:column 后，320px 变成了**高度**，
     min-width:240px 同样变 min-height —— 实测把查询栏从 ~250px 撑到 571px，
     中间一大片空白（截图里最显眼的问题）。 */
  .recent-inline {
    /* 必须是 1 1 100%（而不是 0 0 auto）：
       ⑥ 把 .query-bar 改回 row 后，flex-basis:auto 会让它以**内容宽度**展开，
       实测被撑到 493px > 390px 视口，整页出现横向滚动。 */
    flex: 1 1 100%;
    min-width: 0;
  }

  /* ③ 顶部区域（R167 两栏同港美股页；R170 导航手机端缩成一行）
     两栏各占整行：第一行是标题 + 标题下方的区块导航，第二行是三个胶囊（靠右）。
     · 胶囊收紧字号/内边距并禁止折行 —— 390px 下三个胶囊按原尺寸合计约 357px，
       勉强放得下，但 360px 机型会折行；收紧后约 300px，任何常见机型都是一行。
     · 导航（R170 用户要求「手机版也缩成一行」）：7 项不再用 4 列网格，
       改成单行 flex + 逐项 nowrap；字号 11px（港美股是 12px，390px 下 12px 的
       7 个词合计约 360px、加间距必然折行，只能略收一点），去掉分隔点，
       横向内边距收到 0，390/375px 机型刚好能排进一行。
       逐项 nowrap 保留：否则中文会在任意字符间断行，实测「条件选股」被拆成
       上一行结尾的「条」+ 下一行的「件选股」。 */
  .header-top {
    align-items: flex-start;
  }

  .brand {
    flex: 1 0 100%;
  }

  .header-actions {
    flex: 1 0 100%;
    flex-wrap: nowrap;
    gap: 6px;
  }

  .header-actions .hkus-entry {
    padding: 5px 8px;
    font-size: 11px;
    gap: 4px;
  }

  .brand-sub {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0;
    /* R170b：7 项共 30 个汉字，要死守「一行」，字号必须随装置宽度微调 ——
       固定 11px 在 390/393/414 够，但 375（iPhone SE/8/mini）差 5px、
       360（常见安卓）差 20px，第 7 项会被挤到第二行变成孤零零的「条件选股」。
       实测：390 用 11px、375 需要 ≈10.5px、360 需要 ≈10px，因此按 2.8vw 线性缩放，
       上限仍锁在 11px（不比原来的 11px 更大），下限 9.5px 保 320px 机型不溢出。 */
    font-size: clamp(9.5px, 2.8vw, 11px);
    margin: 6px 0 0;
  }

  .brand-link {
    display: inline-block;
    white-space: nowrap;
    /* 竖向留 8px 触控热区，横向不留内边距（否则单行放不下） */
    padding: 8px 0;
    line-height: 1.2;
  }

  /* R173：手机端导航也显示 `·` 分隔点 —— 与港美股页 `.hk-brand-sep` 一致。
     R170b 为了塞进 7 项导航曾把它 display:none，但现在「关键财务指标」已删，
     只剩 6 项，宽度反松，分隔点加回去仍能单行放下。 */

  /* ④ 触控热区补足：删除按钮宽度只有 22px，手指几乎点不到 */
  .recent-del {
    min-width: 36px;
    min-height: 44px;
  }

  /* ⑤ 爱问财的两个控件只有 33px 高，低于可点阈值。
       注意 #pick-input 没有类名（样式挂在 .pick-row input 上），
       因此这里按结构选，否则规则会静默不命中。 */
  .pick-row input,
  .pick-select {
    min-height: 40px;
  }

  /* ⑥ 查询栏（R167 用户要求：输入框与「查询」按钮对齐在一行里）
     · 代码框可收缩（撑满剩余宽度），分红年数与按钮按内容宽度；
     · 必须用 `.query-bar .field-code:not(.field-years)` 这种写法：
       前面的 `.query-bar .field:not(.field-years){flex:0 0 auto}` 特异性更高，
       只写 `.field-code` 会被它盖掉（实测字段仍是固定宽度、按钮被挤到第二行）。
     · 代码框原来的宽度写死在 `.query-bar .field input#code-input{width:168px}`，
       这里改成随字段宽度伸缩。
     · .field-error / .clip-hint 仍是 `flex: 1 0 100%`，会自然换到下一行，
       不影响第一行的控件位置。 */
  .query-bar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 8px;
  }

  .query-bar .field-code:not(.field-years) {
    flex: 1 1 120px;
    min-width: 0;
  }

  .query-bar .field input#code-input {
    width: 100%;
    max-width: none;
  }

  .query-bar .field-years:not(.field-action) {
    flex: 0 0 auto;
    min-width: 0;
  }

  .query-bar .field-action:not(.field-years) {
    flex: 0 0 auto;
    min-width: 0;
  }

  /* ⑦ 表格横向滚动时给一个可见提示：右侧渐隐，暗示「还能往右拖」 */
  .table-wrap {
    position: relative;
  }

  .table-wrap::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 22px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.9));
  }
}

/* ============================================================
   R30：ETF「趋势图表」卡内的状态占位
   ------------------------------------------------------------
   ETF 查询时净值数据要等分红接口返回才有，中间是加载态；
   净值取不到时是空态。两者都需要在图表容器里居中显示，
   否则卡片在数据到位前就是一片空白。
   ============================================================ */
.chart-container .state-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  height: 100%;
}

.state-box.is-loading {
  background: #fafbfd;
  border-color: var(--border);
  color: var(--text-mute);
}

/* 空态的第二行说明：字号更小、颜色更淡，与主提示拉开层级 */
.state-box .state-hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-mute);
  max-width: 560px;
}

/* R194：拖动后「是否锁定位置」弹窗 —— 居中显示，按钮居中 */
.fav-lock-modal { display: block; }
.fav-lock-modal .modal-box { position: fixed; margin: 0; }
.fav-lock-modal .modal-title,
.fav-lock-modal .modal-hint { text-align: center; }
.fav-lock-modal .modal-actions { justify-content: center; }

/* ============================================================
   R235：局部放大镜
   ------------------------------------------------------------
   结构：页头标题右侧一个胶囊（放大镜图标 + 倍数输入框），
         悬停 2 秒从下方展开「放大区域」横向拖动条；
         点击图标开启后，一个跟随鼠标的圆形放大镜把光标附近内容放大 N 倍。
   约定：新增节点一律带 data-mag-ignore（克隆页面时会被剔除），
         类名统一 mag- 前缀，不改动任何既有选择器与布局规则。
   ============================================================ */
.brand-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  min-width: 0;
}
.brand-title-row > h1 { margin: 0; }

.mag-ctl {
  position: relative;
  display: inline-flex;
  align-items: center;
  height: 26px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #fff;
  box-shadow: var(--shadow-sm);
}
.mag-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 24px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 999px 0 0 999px;
  background: transparent;
  color: var(--text-mute);
  cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.mag-btn:hover { color: var(--primary); }
.mag-ctl.is-active .mag-btn { background: var(--primary); color: #fff; }
.mag-btn svg { width: 14px; height: 14px; display: block; }
.mag-factor {
  width: 40px;
  height: 22px;
  padding: 0 4px;
  border: 0;
  border-left: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  text-align: center;
  outline: none;
}
.mag-factor:focus { background: var(--primary-weak); border-radius: 0 999px 999px 0; }

.mag-slider-wrap {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 80;
  display: none;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  font-size: 12px;
  color: var(--text-mute);
}
.mag-slider-wrap.is-open { display: flex; flex-wrap: wrap; }
.mag-slider-wrap input[type="range"] {
  width: 150px;
  margin: 0;
  accent-color: var(--primary);
}
/* R236b：说明文字占整行第二行（替代被去掉的原生 title 气泡，避免盖住拖动条） */
.mag-slider-hint {
  flex-basis: 100%;
  font-size: 11px;
  color: var(--text-mute);
  opacity: .85;
}
#mag-size-val {
  min-width: 42px;
  text-align: right;
  color: var(--text-sub);
  font-variant-numeric: tabular-nums;
}

.mag-lens {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 12000;
  display: none;
  /* R236c：镜片由圆形改为方形（保留小圆角，视觉更收敛；要直角把 10px 改成 0） */
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--primary);
  box-shadow: 0 12px 32px rgba(15, 23, 42, .28), inset 0 0 0 1px rgba(255, 255, 255, .65);
  background: #fff;
  pointer-events: none;
}
.mag-lens.is-on { display: block; }
.mag-lens.is-muted { display: none; }
.mag-stage {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
}
/* 克隆出来的 body 仍是 body 元素：重置默认外边距，避免放大图整体偏移 */
.mag-stage > body { margin: 0; }
/* R291:touch-app-core */
@media (max-width:760px){
  .mag-ctl { height:40px; }
  .mag-btn { width:40px; height:40px; }
  .mag-btn svg { width:16px; height:16px; }
  .mag-factor { height:40px; width:46px; }
  .account-pill, .sh-account, .account-entry { min-height:40px; }
}
