/* ==========================================================================
   研策 · A股研判工作台 — 界面样式（v20260910-3 重构版）
   --------------------------------------------------------------------------
   设计原则：
   1. 设计令牌驱动：颜色/字号/间距/圆角/阴影全部收敛为 CSS 变量，便于主题化与持续迭代。
   2. 语义一致：品牌青绿=主操作；A股红涨绿跌仅用于行情数字；琥珀金=强调/品牌标记；
      蓝=信息/模型；红=风控警示。
   3. 信息层级：卡片化面板 + 明确的 eyebrow/标题/正文/辅助字号梯度。
   4. 数字等宽：所有数值使用 tabular-nums，避免刷新跳动。
   5. 可维护性：按 基础/布局/组件/面板/响应式 分区组织，禁止选择器相互覆盖堆补丁。
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
[hidden] { display: none !important; }

:root {
  /* 色彩 */
  --bg: #f3f5f4;
  --surface: #ffffff;
  --surface-2: #eef2f0;
  --surface-3: #f7f9f8;
  --surface-header: linear-gradient(180deg, #fbfcfb, #f6f8f7);
  --ink: #16211d;
  --ink-2: #42524c;
  --muted: #6d7c76;
  --faint: #93a19b;
  --line: #e3e9e6;
  --line-strong: #c9d4cf;

  --brand: #0e7c6b;            /* 主操作/品牌青 */
  --brand-strong: #0b6356;
  --brand-deep: #102f29;       /* 顶栏深墨绿 */
  --brand-deep-2: #0d241f;
  --brand-soft: #e6f2ef;
  --brand-line: #b9dcd2;

  --accent: #b8862f;           /* 琥珀金：品牌标记/重点 */
  --accent-soft: #faf3e3;
  --accent-line: #e7d3a8;

  --up: #d4403a;               /* A股涨/红 */
  --up-soft: #fdeeee;
  --down: #0f8a54;             /* A股跌/绿 */
  --down-soft: #e9f6ef;
  --info: #3b6c8f;             /* 信息/模型/蓝 */
  --info-soft: #eef4f8;
  --warn: #b97b1d;
  --warn-soft: #fbf4e6;
  --danger: #c0392b;
  --danger-soft: #fdf0ee;
  --success: #1f7a5c;          /* 成功反馈（toast 等） */

  /* 皮肤扩展语义变量：弹层背景/文字、彩色标签深色文字、toast 文字，随皮肤主题切换 */
  --pop-bg: #ffffff;            /* 下拉/弹层背景 */
  --pop-ink: #1a1b1c;           /* 下拉/弹层文字 */
  --accent-ink: #96690f;        /* 琥珀金深色文字（浅金底上可读） */
  --info-ink: #2f6bb0;          /* 信息蓝深色文字 */
  --warn-ink: #96641a;          /* 警示棕深色文字 */
  --system-ink: #4a6478;        /* 系统消息灰蓝文字 */
  --announce-ink: #a84716;      /* 公告橙深色文字 */
  --toast-ink: #ffffff;         /* toast 文字色（深色皮肤反转为深墨） */

  /* 字体 */
  --font: "Microsoft YaHei UI", "PingFang SC", "Segoe UI", Arial, sans-serif;
  --fs-hero: 30px;
  --fs-h2: 17px;
  --fs-h3: 15px;
  --fs-body: 13px;
  --fs-sm: 12px;
  --fs-xs: 11px;
  --fs-tiny: 10px;

  /* 间距 */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px; --sp-5: 20px; --sp-6: 28px; --sp-7: 36px;

  /* 圆角/阴影 */
  --radius: 10px;
  --radius-sm: 6px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(16, 47, 41, .05), 0 6px 20px rgba(16, 47, 41, .06);
  --shadow-pop: 0 12px 40px rgba(10, 30, 26, .22);

  /* 布局 */
  --topbar-h: 58px;
  --main-max: 1500px;
  --rail-w: 288px;
  --history-rail-w: min(322px, 88vw);
}


/* ---------- 1b. 主题皮肤 ---------- */
/* 全站默哀模式（skin.forced_mode）的灰度不能写在这里：① guide/legal 等页自带样式不引 app.css，
   写在 CSS 里盖不住全站；② 更致命的是 html{filter} 会给所有 position:fixed 后代创建包含块，
   抽屉/客服面板/土司/回到顶部会脱离视口跟着页面滚。灰度统一由服务端首帧（skins.py
   MOURNING_OVERLAY_CSS）与 theme.js / skin-vars.js 的素衣注入下发，拿到的页面自动生效。 */
[data-theme="dark"] {
  --bg: #0f1419;
  --surface: #1a2028;
  --surface-2: #232b36;
  --surface-3: #1e2530;
  --surface-header: linear-gradient(180deg, #232b36, #1a2028);
  --ink: #e4e9ee;
  --ink-2: #b0bac4;
  --muted: #8492a0;
  --faint: #5c6875;
  --line: #2a3340;
  --line-strong: #3a4553;
  --brand: #2dd4a8;
  --brand-strong: #20b890;
  --brand-deep: #152028;
  --brand-deep-2: #0d1419;
  --brand-soft: #16352f;
  --brand-line: #234e46;
  --accent: #d4a84a;
  --accent-soft: #332c1c;
  --accent-line: #57482a;
  --up: #ff6b63;
  --up-soft: #3a2020;
  --down: #2ec98a;
  --down-soft: #163028;
  --info: #5b9bd5;
  --info-soft: #1c2e3e;
  --warn: #e0a840;
  --warn-soft: #332a18;
  --danger: #ff6b5e;
  --danger-soft: #38201e;
  --success: #3ddc97;
  --pop-bg: #1f242e;
  --pop-ink: #e4e6eb;
  --accent-ink: #d4a84a;
  --info-ink: #78aef0;
  --warn-ink: #d39a44;
  --system-ink: #8aa2bc;
  --announce-ink: #e07a42;
  --toast-ink: #0f1419;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
  --shadow-pop: 0 12px 40px rgba(0, 0, 0, .55);
  color-scheme: dark;
}
[data-theme="indigo"] {
  --bg: #f2f4f8;
  --surface: #ffffff;
  --surface-2: #eceff5;
  --surface-3: #f7f9fc;
  --ink: #1a2233;
  --ink-2: #44506a;
  --muted: #6b7690;
  --faint: #94a0b5;
  --line: #e2e7f0;
  --line-strong: #c8d0de;
  --brand: #3b5bdb;
  --brand-strong: #2f49b8;
  --brand-deep: #1e2a5e;
  --brand-deep-2: #161e45;
  --brand-soft: #eaedfb;
  --brand-line: #bcc8f0;
  --accent: #c07828;
  --accent-soft: #faf2e4;
  --accent-line: #e8d2a8;
  --up: #d4403a; --up-soft: #fdeeee; --down: #0f8a54; --down-soft: #e9f6ef;
  --pop-bg: #f2f4f8;
  --pop-ink: #1a1b1c;
  --accent-ink: #96690f; --toast-ink: #ffffff;
  --shadow-card: 0 1px 2px rgba(30, 42, 94, .05), 0 6px 20px rgba(30, 42, 94, .07);
  --shadow-pop: 0 12px 40px rgba(20, 30, 70, .22);
  --surface-header: linear-gradient(180deg, #f7f9fc, #eceff5);
  --info: #3b6c8f; --info-soft: #eef4f8; --warn: #b97b1d; --warn-soft: #fbf4e6;
  --danger: #c0392b; --danger-soft: #fdf0ee; --success: #1f7a5c;
  --info-ink: #2f6bb0; --warn-ink: #96641a;
  --system-ink: #4a6478; --announce-ink: #a84716;
}
[data-theme="warm"] {
  --bg: #f6f3ee;
  --surface: #fffdf8;
  --surface-2: #f0ebe1;
  --surface-3: #faf7f0;
  --ink: #2a2318;
  --ink-2: #564a38;
  --muted: #83745f;
  --faint: #a89880;
  --line: #e8e0d2;
  --line-strong: #d2c6b0;
  --brand: #8a5a28;
  --brand-strong: #6e4720;
  --brand-deep: #3a2c1a;
  --brand-deep-2: #2a1f12;
  --brand-soft: #f2e8d8;
  --brand-line: #dcc8a8;
  --accent: #b8553a;
  --accent-soft: #faeae2;
  --accent-line: #e8c0b0;
  --up: #d4403a; --up-soft: #fdeeee; --down: #0f8a54; --down-soft: #e9f6ef;
  --pop-bg: #f6f3ee;
  --pop-ink: #2d2419;
  --accent-ink: #96690f; --toast-ink: #ffffff;
  --shadow-card: 0 1px 2px rgba(58, 44, 26, .05), 0 6px 20px rgba(58, 44, 26, .07);
  --shadow-pop: 0 12px 40px rgba(40, 30, 15, .22);
  --surface-header: linear-gradient(180deg, #faf7f0, #f0ebe1);
  --info: #3b6c8f; --info-soft: #eef4f8; --warn: #b97b1d; --warn-soft: #fbf4e6;
  --danger: #c0392b; --danger-soft: #fdf0ee; --success: #1f7a5c;
  --info-ink: #2f6bb0; --warn-ink: #96641a;
  --system-ink: #4a6478; --announce-ink: #a84716;
}


/* ============================================================
   皮肤商城主题（由 skins.py 目录种子管理价格/拥有权，视觉在此定义）
   语义约定：--pop-bg/--pop-ink 弹层、--*-ink 彩色标签深色文字、--toast-ink 提示文字
   ============================================================ */



/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  /* Safari（iOS/macOS）滚动到边界会触发弹性回弹，整页下移并露出背后内容（如右侧收起的抽屉/顶栏背后区域）：
     禁用文档级 overscroll 回弹（Safari 16+ / Chrome / Firefox）；html 同步页面背景，
     旧版 Safari 即便仍回弹，露出的也是与页面一致的背景，而非其它界面元素。 */
  background: var(--bg);
  overscroll-behavior-y: none;
  /* 主站按产品决策不设 viewport meta（手机=缩小的桌面版）：安卓 Chrome 会对"非移动适配"
     页面做字体膨胀（font boosting），窄栏模块（量化评分/市场环境等）文字被放大数倍、版面挤压。
     锁死 100% 关闭该行为，手机上呈现等比缩小的桌面布局，字号比例与设计一致。 */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body {
  margin: 0;
  overscroll-behavior-y: none; /* 兜底：与 html 保持一致，杜绝文档级弹性回弹 */
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--fs-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; cursor: pointer; background: none; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, a:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}
input, select, textarea { font-variant-numeric: tabular-nums; }
a { color: var(--brand); text-decoration: none; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.lead { font-size: 14px; line-height: 1.7; color: var(--ink-2); }
strong { font-weight: 700; }

/* 滚动条 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 5px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); background-clip: content-box; border: 2px solid transparent; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 3. 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 300;
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
  padding: 0 clamp(14px, 3vw, 34px);
  background: linear-gradient(180deg, var(--brand-deep) 0%, var(--brand-deep-2) 100%);
  color: #fff;
  box-shadow: 0 2px 10px rgba(8, 26, 22, .28);
}

/* 顶部栏响应式：宽度不够时按「低优先内容先收」的顺序隐藏——
   新手入门入口（首页 hero 区仍有同款链接）→ 数据源/模型/行情状态信息 → 账户按钮收缩为图标 → 间距/导航压缩。
   右侧皮肤/消息/设置图标与主导航 tab 尽量保留，不再被挤出视口。 */
/* admin-only elements hidden by default; body.is-admin shows them after auth resolves (no flash) */
#source-health, #open-observability { display: none; }
body.is-admin #source-health { display: inline-flex; }
body.is-admin #open-observability { display: grid; }
@media (max-width: 1280px) {
  /* ① 最先隐藏：新手入门顶栏入口（首页查询区仍有 guide-banner 入口）。
     必须在 source-health(1200px) 之前隐藏——管理员态多了数据源/观测/模型徽标，
     若 guide 未先隐，top-actions(flex:0 0 auto) 总宽会超出视口把设置图标挤出屏。 */
  #guide-nav-link { display: none; }
}
@media (max-width: 1200px) {
  body.is-admin #source-health { display: none; }
}
@media (max-width: 1080px) {
  .top-actions #llm-pill { display: none; }
}
@media (max-width: 960px) {
  .top-actions .market-state { display: none; }
}
@media (max-width: 840px) {
  body.is-admin #open-observability { display: none; }
}
@media (max-width: 760px) {
  /* ② 其次：登录/注册（及已登录的用户菜单）文字按钮收缩为同款人形图标，
     点击逻辑不变（登录弹窗/用户下拉照常），窄屏不会丢掉账户入口。
     用 #auth-area 提升特异性：基础 .auth-login-btn/.auth-user-btn 规则定义在样式表后部，
     同特异性会被源顺序覆盖（font-size/padding 无法收住）。 */
  #auth-area .auth-login-btn,
  #auth-area .auth-user-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    gap: 0;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .10);
    color: #fff;
    font-size: 0;
  }
  #auth-area .auth-login-btn:hover,
  #auth-area .auth-user-btn:hover { background: rgba(255, 255, 255, .18); border: 0; color: #fff; }
  #auth-area .auth-login-btn:focus-visible,
  #auth-area .auth-user-btn:focus-visible { outline: 2px solid #fff; outline-offset: 1px; }
  #auth-area .auth-login-btn::before,
  #auth-area .auth-user-btn::before {
    content: "";
    width: 18px;
    height: 18px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='12'%20cy='7'%20r='4'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2024%2024'%20fill='none'%20stroke='%23fff'%20stroke-width='2'%20stroke-linecap='round'%20stroke-linejoin='round'%3E%3Cpath%20d='M19%2021v-2a4%204%200%200%200-4-4H9a4%204%200%200%200-4%204v2'/%3E%3Ccircle%20cx='12'%20cy='7'%20r='4'/%3E%3C/svg%3E") center / contain no-repeat;
  }
}
@media (max-width: 600px) {
  /* ③ 再窄：压缩品牌区与操作区间距，副标题隐藏；主导航改为占据中间弹性空间并可横向滑动，
     保证右侧皮肤/消息/设置与账户图标永远完整贴右，不被挤出视口。
     注意：.brand/.top-nav/.tab-btn 等基础规则定义在本段之后，必须用 .topbar 前缀提特异性才不会被源顺序覆盖。 */
  .topbar { gap: 12px; }
  .topbar .brand { margin-right: 8px; gap: 8px; }
  .topbar .brand small { display: none; }
  .topbar .top-actions { gap: 8px; }
  .topbar .top-nav {
    flex: 0 1 auto;
    min-width: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .topbar .top-nav::-webkit-scrollbar { display: none; }
  .topbar .tab-btn { padding: 7px 12px; }
  /* 右侧操作区禁止整体压缩：基础规则的 min-width:0 允许容器被压扁，而内部图标
     min-width:auto 不可收缩 → 图标溢出容器右缘产生横向滚动（375px 实测设置图标
     right=417 vs 视口 375；480px 也超 13px）。改为不收缩后，压缩量全部由上方
     可横向滑动的 top-nav 吸收，兑现本断点"右侧图标永远完整贴右"的承诺。 */
  .topbar .top-actions { flex: 0 0 auto; }
  /* 大额积分余额同步钳制（省略号截断），避免极窄屏把它重新顶出视口 */
  #points-area { min-width: 0; }
  #points-area .points-badge { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (max-width: 420px) {
  /* ④ 极窄：进一步压缩内边距与 tab 尺寸（导航滑动兜底已在 600 断点启用） */
  .topbar { padding: 0 10px; gap: 8px; }
  .topbar .tab-btn { padding: 6px 10px; font-size: 11px; }
  .topbar .top-actions { gap: 5px; }
  .topbar .icon-button { width: 30px; height: 30px; }
  #auth-area .auth-login-btn, #auth-area .auth-user-btn { width: 30px; height: 30px; }
}

.brand { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; margin-right: 28px; }
.brand-logo {
  width: 32px; height: 32px;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
  display: block;
}
.brand strong { font-size: 16px; letter-spacing: .04em; }
.brand small { display: block; color: #9fb5ad; font-size: 10px; margin-top: 1px; letter-spacing: .06em; }

.top-nav { display: flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-right: auto; justify-content: flex-start; min-width: 0; }
.tab-btn {
  color: #b9cdc6;
  font-size: 12px;
  padding: 7px 16px;
  border-radius: 999px;
  white-space: nowrap;
  background: transparent;
  border: 0;
  cursor: pointer;
  transition: background .15s, color .15s;
  font-family: inherit;
}
.tab-btn:hover { color: #fff; background: rgba(255, 255, 255, .08); }
.tab-btn.active { color: #fff; background: rgba(255, 255, 255, .14); font-weight: 700; }
.guide-link {
  color: #ffd98a; font-size: 12px; padding: 7px 14px; border-radius: 999px;
  text-decoration: none; white-space: nowrap; border: 1px solid rgba(255, 217, 138, .45);
  transition: background .15s, color .15s;
}
.guide-link:hover { color: #fff; background: rgba(255, 217, 138, .18); }
.guide-banner {
  margin: 10px 0 0; display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--muted); background: rgba(14, 124, 107, .06);
  border: 1px dashed rgba(14, 124, 107, .35); border-radius: 999px; padding: 5px 14px;
}
.guide-banner a { color: var(--brand); font-weight: 600; text-decoration: none; }
.guide-banner a:hover { text-decoration: underline; }
/* 演示版专属声明横幅：仅 demo 态显示（data-access-demo-only）。多行长文本必须用块级流式排版——
   flex 会把 <span>/<strong>/裸文本拆成独立列压窄成竖排 */
.demo-declare {
  display: block; max-width: min(680px, 100%); border-radius: 10px;
  line-height: 1.7; text-align: left; white-space: normal; padding: 10px 16px;
}
.demo-declare > span { display: inline; font-weight: 700; color: var(--brand); margin-right: 6px; }
.demo-declare strong { color: var(--brand); }

.tab-pane { display: none; }
.tab-pane.active { display: block; min-height: calc(100vh - 280px); }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.top-actions { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 26px; padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .07);
  color: #cfe0da;
  font-size: 10.5px;
  white-space: nowrap;
}
.status-pill i { width: 6px; height: 6px; border-radius: 50%; background: #5ac99c; flex: 0 0 auto; }
.status-pill.is-warn i { background: #e0b45c; }
.status-pill.is-bad i { background: #e07b6e; }
.status-pill.is-off i { background: #7f918b; }
.status-pill i.is-warn { background: #e0b45c; }
.status-pill i.is-bad { background: #e07b6e; }
.status-pill i.is-off { background: #7f918b; }
.status-pill b { color: #fff; font-weight: 700; }
.market-state { display: flex; align-items: center; gap: 8px; color: #cfe0da; font-size: 11.5px; font-variant-numeric: tabular-nums; }
.market-state i { width: 7px; height: 7px; border-radius: 50%; background: #5ac99c; box-shadow: 0 0 0 4px rgba(90, 201, 156, .14); }
.icon-button {
  width: 32px; height: 32px;
  display: grid; place-items: center;
  border-radius: 8px;
  background: transparent;
  color: inherit;
  font-size: 18px;
  line-height: 1;
  transition: background .15s;
}
.icon-button:hover { background: rgba(255, 255, 255, .12); }
.icon-button:focus-visible { outline-color: #fff; }
.icon-button .btn-icon { width: 18px; height: 18px; display: block; }

/* ---------- 3b. 换肤 ---------- */
.theme-wrap { position: relative; flex: 0 0 auto; }
.theme-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 250px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 8px;
  display: none;
  z-index: 300;
}
.theme-panel.open { display: block; }
/* 皮肤多时列表自身滚动，「更多皮肤」入口固定在面板底部不随滚动消失 */
#theme-options {
  max-height: min(55vh, 400px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.theme-option {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink);
  font-size: var(--fs-body);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s;
}
.theme-option:hover { background: var(--surface-2); }
.theme-option.active { background: var(--brand-soft); }
.theme-swatches { display: flex; gap: 3px; flex: 0 0 auto; }
.theme-swatch {
  width: 13px; height: 13px;
  border-radius: 4px;
  border: 1px solid rgba(0, 0, 0, .08);
}
.theme-option-name { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.theme-option-check { color: var(--brand); font-size: 13px; visibility: hidden; }
.theme-option.active .theme-option-check { visibility: visible; }
.theme-option-expiry { flex: 0 0 auto; font-size: 10px; color: var(--muted); }
/* 全站默哀模式：换肤按钮锁定态——置灰 + 图标叠斜杠（禁用语义） */
#theme-toggle.mourning-locked {
  opacity: .45; cursor: not-allowed; position: relative;
}
#theme-toggle.mourning-locked .btn-icon { opacity: .9; }
#theme-toggle.mourning-locked::after {
  content: ""; position: absolute; left: 50%; top: 50%;
  width: 18px; height: 2px; border-radius: 1px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(-45deg);
}
/* 会员皮肤标识：淡金渐变底 + 名称尾随皇冠 + 右上 VIP 角标（替代文字胶囊，名称不再换行） */
.theme-option.is-member {
  background: linear-gradient(90deg, var(--accent-soft) 0%, transparent 55%);
}
.theme-option.is-member:hover { background: linear-gradient(90deg, var(--accent-line) 0%, var(--surface-2) 55%); }
.theme-option.is-member.active { background: linear-gradient(90deg, var(--accent-line) 0%, var(--brand-soft) 55%); }
.theme-trial-corner {
  flex: 0 0 auto;
  font-size: 9px; font-weight: 800; letter-spacing: .3px; line-height: 1;
  padding: 2px 5px;
  border-radius: 999px;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}
.theme-crown-icon {
  flex: 0 0 auto; width: 12px; height: 12px;
  color: var(--accent);
}
/* 全站默哀模式：商城进入"只读"态，换上/购买/续期/限免全部禁用并在头部说明原因 */
.skin-mall-mourning-tip {
  margin: 0 0 10px; padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: var(--surface-2); color: var(--ink-2);
  font-size: 12px; line-height: 1.6;
}
.skin-btn.is-mourning-locked {
  opacity: .5; cursor: not-allowed;
}
.theme-more-entry {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 8px 10px; margin-top: 4px;
  border: 0; border-top: 1px dashed var(--line);
  border-radius: var(--radius-sm); background: transparent;
  color: var(--brand); font-size: var(--fs-body); font-weight: 600;
  font-family: inherit; text-align: left; cursor: pointer; transition: background .15s;
}
.theme-more-entry:hover { background: var(--brand-soft); }
.theme-more-entry .more-arrow { font-size: 12px; }


/* ---------- 可观测性面板 ---------- */
.observability-dialog[open] {
  width: min(760px, calc(100vw - 40px));
  max-height: 82vh;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  color: var(--ink);
  padding: 0;
  box-shadow: var(--shadow-pop);
  /* 滚动容器就是 dialog 本体——比 flex column + overflow:hidden + 子项滚动更可靠。
     flex 方案在 max-height（非 height）约束下，子项滚动在某些时序/浏览器下不触发
     （2026-10-13 出现"时好时坏"）。改回 dialog 自身 overflow-y:auto，标题栏 sticky 钉顶。 */
  overflow-y: auto;
  overflow-x: hidden;
}
.observability-dialog .dialog-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
}
/* .obs-body 保留作为语义包裹层，不再承担滚动（滚动交给 dialog 本体） */
.observability-dialog .obs-body { display: block; }
.observability-dialog::backdrop { background: rgba(10, 20, 18, .45); }
.observability-dialog .dialog-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px 12px; border-bottom: 1px solid var(--line);
}
.observability-dialog .dialog-head h2 { margin: 0; font-size: 17px; }
.observability-dialog .icon-button { color: var(--muted); }
.obs-event .sym { font-weight: 600; }
.obs-event .dot { color: var(--faint); margin: 0 2px; }
.obs-event .name { color: var(--ink-2); }
.obs-toolbar { display: flex; align-items: center; gap: 10px; padding: 12px 20px 4px; }
.obs-updated { color: var(--faint); font-size: var(--fs-xs); margin-left: auto; }
.obs-stat-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 20px;
}
.obs-stat {
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: 10px 12px; background: var(--surface-3);
}
.obs-stat .num { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.1; }
.obs-stat .lbl { color: var(--muted); font-size: var(--fs-xs); margin-top: 2px; }
.obs-stat.is-critical .num { color: var(--danger); }
.obs-stat.is-warning .num { color: var(--warn); }
.obs-stat.is-info .num { color: var(--info); }
.obs-section { padding: 8px 20px 16px; }
.obs-section h3 { margin: 8px 0; font-size: 13px; color: var(--ink-2); }
.obs-event-list {
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.obs-event {
  display: grid; grid-template-columns: auto auto 1fr auto; gap: 10px; align-items: baseline;
  padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: var(--fs-sm);
}
.obs-event:last-child { border-bottom: 0; }
.obs-event time { color: var(--faint); font-size: var(--fs-xs); font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-badge {
  font-size: var(--fs-tiny); font-weight: 700; padding: 1px 7px; border-radius: 999px;
  white-space: nowrap; line-height: 1.6;
}
.obs-badge.error, .obs-badge.critical { background: var(--danger-soft); color: var(--danger); }
.obs-badge.warning { background: var(--warn-soft); color: var(--warn); }
.obs-badge.info { background: var(--info-soft); color: var(--info); }
.obs-event .msg { color: var(--ink-2); min-width: 0; word-break: break-word; }
.obs-event .sym { color: var(--brand); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-empty { padding: 18px; text-align: center; color: var(--faint); font-size: var(--fs-sm); }

/* 数据源健康列表 */
.obs-source-list { display: flex; flex-direction: column; gap: 6px; }
.obs-source {
  display: grid; grid-template-columns: minmax(120px, 1fr) auto auto; align-items: center; gap: 10px;
  padding: 7px 10px; border-radius: 10px; background: var(--card-2, rgba(127,127,127,0.06));
  border-left: 3px solid transparent;
}
.obs-source .src-name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.obs-source .src-meta { display: inline-flex; align-items: center; gap: 8px; color: var(--faint); font-size: var(--fs-tiny); font-variant-numeric: tabular-nums; white-space: nowrap; }
.obs-source .src-rate { color: var(--ink-2); }
.obs-source .src-flag { color: var(--danger); font-weight: 700; }
.obs-source.is-ok { border-left-color: var(--down); }
.obs-source.is-ok .obs-badge { background: var(--down-soft); color: var(--down); }
.obs-source.is-warn { border-left-color: var(--warn); }
.obs-source.is-warn .obs-badge { background: var(--warn-soft); color: var(--warn); }
.obs-source.is-down { border-left-color: var(--danger); }
.obs-source.is-down .obs-badge { background: var(--danger-soft); color: var(--danger); }
.obs-source.is-idle { opacity: 0.6; }
.obs-source.is-idle .obs-badge { background: var(--info-soft); color: var(--faint); }
@media (max-width: 640px) {
  .obs-source { grid-template-columns: 1fr auto; }
  .obs-source .src-meta { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
  .obs-stat-grid { grid-template-columns: repeat(2, 1fr); }
  .obs-event { grid-template-columns: auto 1fr; }
  .obs-event time { grid-column: 2; }
}

/* ---------- 4. 主布局 ---------- */
main { max-width: var(--main-max); margin: 0 auto; padding: 0 clamp(12px, 2.4vw, 30px) 56px; }
.page-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: start; }
.page-grid.with-rail { grid-template-columns: minmax(0, 1fr) var(--rail-w); gap: 22px; }
/* demo 态：历史侧栏被门控隐藏，主内容应撑满整行（否则 grid 仍保留 rail 列宽导致右侧留白） */
html.access-demo .page-grid.with-rail { grid-template-columns: minmax(0, 1fr); gap: 0; }
.page-main { min-width: 0; min-height: calc(100vh - 40px); }

/* ---------- 5. 查询区（Hero） ---------- */
.query-band {
  position: relative;
  margin: 22px 0 6px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(900px 320px at 12% -60%, color-mix(in srgb, var(--brand) 40%, transparent), transparent 60%),
    linear-gradient(120deg, var(--brand-deep) 0%, color-mix(in srgb, var(--brand) 21%, var(--brand-deep)) 52%, color-mix(in srgb, var(--brand) 14%, var(--brand-deep)) 100%);
  color: #fff;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(420px, 540px);
  align-items: center;
  gap: 44px;
  padding: 42px 44px 42px 48px;
  overflow: hidden;
  box-shadow: 0 10px 34px rgba(12, 40, 33, .18);
}
.query-band::after {
  content: "";
  position: absolute;
  right: -80px; bottom: -140px;
  width: 340px; height: 340px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .07);
  box-shadow: 0 0 0 48px rgba(255, 255, 255, .03), 0 0 0 96px rgba(255, 255, 255, .02);
  pointer-events: none;
}
.query-copy { position: relative; z-index: 1; min-width: 0; }
.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .18em;
  text-transform: uppercase;
}
.query-band .eyebrow { color: color-mix(in oklab, var(--accent) 74%, white); }
.query-copy h1 {
  margin: 0;
  font-size: var(--fs-hero);
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: .01em;
}
.query-copy .sub { margin: 12px 0 0; color: rgba(255, 255, 255, .72); font-size: 12.5px; line-height: 1.7; }
.query-copy .sub b { color: rgba(255, 255, 255, .94); }

.search-box {
  position: relative;
  z-index: 1;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  padding: 20px 22px 16px;
  box-shadow: 0 18px 46px rgba(6, 26, 21, .35);
}
.search-box > label { display: block; font-size: 12px; font-weight: 700; color: var(--ink-2); margin-bottom: 8px; }
.search-row { display: flex; }
.search-input-wrap { position: relative; flex: 1; min-width: 0; display: flex; }
.search-row input {
  flex: 1;
  min-width: 0;
  height: 48px;
  border: 1.5px solid var(--line-strong);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  background: var(--surface);
  padding: 0 34px 0 14px;
  font-size: 15px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.symbol-clear {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; border-radius: 50%;
  border: 0; background: transparent; color: var(--muted);
  font-size: 13px; line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .15s, background .15s, color .15s;
}
.search-input-wrap:focus-within input:not(:placeholder-shown) ~ .symbol-clear { opacity: .7; visibility: visible; }
.search-row .symbol-clear {
  flex: 0 0 auto; height: 18px; width: 18px;
  background: transparent; color: var(--muted);
  border-radius: 50%;
}
.search-row .symbol-clear:hover { opacity: 1 !important; background: var(--surface-2); color: var(--ink); }
.symbol-clear[hidden] { display: none; }
.search-row input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.search-row input:disabled { background: var(--surface-2); color: var(--muted); cursor: wait; }
.search-row button {
  flex: 0 0 118px;
  height: 48px;
  border-radius: 0 8px 8px 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  transition: background .15s;
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
}
.search-row button:hover { background: var(--brand-strong); }
.search-row button:disabled { opacity: .6; cursor: wait; }
.search-row button.loading { background: var(--brand-strong); }
.search-row button.loading::before {
  content: ""; width: 13px; height: 13px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}
.search-options { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; }
.search-options > p { margin: 0; color: var(--muted); font-size: 11px; }
.inline-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  margin: 0; white-space: nowrap;
  font-size: 11.5px; font-weight: 600; color: var(--ink-2);
  cursor: pointer;
  user-select: none;
}
.inline-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--brand); }

/* ---------- 6. 状态面板（空态/错误/加载） ---------- */
.status-panel {
  min-height: 230px;
  display: grid;
  place-items: center;
  align-content: center;
  text-align: center;
  padding: var(--sp-7) var(--sp-5);
}
.status-panel h2 { margin: 16px 0 6px; font-size: 18px; }
.status-panel p { margin: 0; color: var(--muted); font-size: 13px; }
.status-panel.error {
  min-height: 140px;
  margin: 22px 0 0;
  background: var(--danger-soft);
  border: 1px solid var(--line-strong);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
}
.status-panel.error h2 { color: var(--danger); font-size: 16px; }
.empty-graph {
  height: 62px;
  display: flex;
  align-items: flex-end;
  gap: 7px;
  opacity: .85;
}
.empty-graph span {
  display: block;
  width: 11px;
  background: #cbd8d2;
  border-radius: 3px 3px 0 0;
  animation: empty-bounce 1.6s ease-in-out infinite;
}
.empty-graph span:nth-child(1) { height: 18px; animation-delay: 0s; }
.empty-graph span:nth-child(2) { height: 40px; animation-delay: .12s; }
.empty-graph span:nth-child(3) { height: 28px; animation-delay: .24s; }
.empty-graph span:nth-child(4) { height: 54px; background: var(--accent); animation-delay: .36s; }
.empty-graph span:nth-child(5) { height: 44px; animation-delay: .48s; }
@keyframes empty-bounce { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.82); } }
@keyframes analysis-spin { to { transform: rotate(360deg); } }

/* ---------- 7. 股票管理 ---------- */
.section-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.stock-manager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 12px 0 4px; }
.stock-manager-bar {
  grid-column: 1 / -1;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-header);
  color: var(--ink);
  text-align: left;
  transition: background .15s, border-color .15s;
}
.stock-manager-bar:hover { background: var(--surface-2); border-color: var(--line-strong); }
.stock-manager-bar > span { display: flex; align-items: baseline; gap: 12px; }
.stock-manager-bar strong { font-size: 14px; letter-spacing: .02em; }
.stock-manager-bar small { color: var(--muted); font-size: 11px; }
.stock-manager-bar b {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface);
  color: var(--brand);
  font-size: 16px;
  box-shadow: 0 1px 3px rgba(16, 47, 41, .12);
}
.stock-manager.collapsed { padding-bottom: 10px; }
.stock-manager.collapsed .stock-manager-content { display: none; }
.stock-manager-content { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding-top: 14px; }
.managed-group {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: hidden;
  min-width: 0;
}
.managed-head {
  min-height: 60px;
  padding: 10px 14px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-header);
}
.managed-head > div:first-child { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.managed-head h2 { margin: 0; font-size: 14px; display: inline-flex; align-items: center; gap: 6px; }
.managed-head h2 .count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 11px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.managed-latest {
  display: block; margin-top: 2px;
  color: var(--muted); font-size: 10px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.title-row .managed-latest {
  display: inline;
  margin-top: 0;
  margin-left: 8px;
  font-size: 10px;
}
.managed-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  min-width: 0;
  flex: 0 0 auto;
  flex-wrap: wrap;
}
.managed-head-actions .stock-sort { width: auto; max-width: none; }


.managed-head-actions .batch-progress {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  max-width: 220px;
  padding: 0 8px;
  border: 1px solid #dfe7e2;
  border-radius: 6px;
  background: var(--surface-3);
  color: var(--muted);
  font-size: 10px; font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .03em;
  overflow: hidden;
  white-space: normal;
  line-height: 1.35;
}
.managed-head-actions .batch-progress:empty { display: none; }
.managed-head-actions .batch-progress-warn {
  display: inline-flex;
  align-items: center;
  border-color: #e8a838;
  background: linear-gradient(135deg, #fff8e6, #fff3d4);
  color: #9a6b00;
  font-weight: 700;
  animation: batch-warn-pulse 1.2s ease-in-out infinite;
}
@keyframes batch-warn-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(232,168,56,.4); }
  50% { box-shadow: 0 0 0 4px rgba(232,168,56,0); }
}
.managed-head-actions .batch-analyze { display: none;  grid-column: 3; grid-row: 2; align-self: center; }
.stock-sort, .sort-direction {
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 11px;
  cursor: pointer;
}
.stock-sort { padding: 0 6px; max-width: 86px; }
.stock-sort:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.sort-direction { min-width: 34px; padding: 0; font-size: 14px; line-height: 1; }
.sort-direction:hover { background: var(--surface-2); }
.sort-direction[aria-pressed="true"] { border-color: var(--brand); color: var(--brand); font-weight: 700; }
.batch-analyze, .add-stock {
  width: 34px; height: 34px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 15px; font-weight: 700; line-height: 1;
  transition: background .15s, color .15s;
}
.batch-analyze:hover, .add-stock:hover { background: var(--brand); color: #fff; }
.batch-analyze:disabled { opacity: .55; cursor: not-allowed; }
.batch-analyze.loading { background: var(--brand); color: transparent; position: relative; }
.batch-analyze.loading::before {
  content: "";
  position: absolute;
  width: 13px; height: 13px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}

.managed-list {
  min-height: 66px;
  max-height: 342px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  background: var(--surface);
}
/* 行悬浮变深时，滚动条预留槽位同步变色，避免右侧残留一条窄白带 */
.managed-list:has(.managed-row:hover) { background: var(--surface-3); }
.managed-list:focus-visible { outline: 2px solid var(--brand); outline-offset: -2px; }
.managed-list > .muted { margin: 0; padding: 24px 14px; text-align: center; font-size: 12px; }

.managed-row {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.45fr) 150px;
  grid-template-rows: auto;
  gap: 12px 14px;
  padding: 13px 15px;
  align-items: start;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  transition: background .12s;
}
.managed-row:last-child { border-bottom: 0; }
.managed-row:hover { background: var(--surface-3); }
.managed-row-clickable { cursor: pointer; }
.managed-identity {
  display: flex; flex-direction: column;
  min-width: 0; min-height: 80px;
  padding-top: 2px;
  cursor: help;
}
.managed-identity strong { font-size: 14px; line-height: 1.35; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.managed-identity > span { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.managed-identity small.managed-note {
  margin-top: 7px; padding-top: 6px; border-top: 1px solid var(--line);
  color: var(--muted); font-size: 10.5px; line-height: 1.4;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.managed-quote {
  display: grid; gap: 3px;
  margin-top: auto; padding-top: 9px;
  font-size: 11px; line-height: 1.35;
  white-space: nowrap;
}
.managed-quote .analysis-quote { font-weight: 700; }
.managed-quote .analysis-quote.up { color: var(--up); }
.managed-quote .analysis-quote.down { color: var(--down); }
.managed-quote .analysis-quote.flat { color: var(--muted); }
.managed-quote .analysis-score { display: none; }
.managed-analysis {
  display: grid; gap: 4px;
  min-width: 0; align-content: start;
  font-size: 11px; line-height: 1.45;
}
.managed-analysis > span, .managed-analysis > small {
  color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.managed-analysis > .analysis-score { display: block; color: var(--ink); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.managed-analysis > .analysis-quote { display: none; }
.managed-analysis > .analysis-quote.up { color: var(--up); }
.managed-analysis > .analysis-quote.down { color: var(--down); }
.managed-analysis .strategy-badge {
  display: inline-block;
  width: max-content; max-width: 100%;
  padding: 2px 8px;
  margin-top: 2px;
  border-left: 3px solid var(--muted);
  border-radius: 0 4px 4px 0;
  background: #f0f2f1;
  font-weight: 700;
  font-size: 11px;
}
.managed-analysis .strategy-risk    { border-color: var(--danger); background: var(--danger-soft); color: var(--danger); }
.managed-analysis .strategy-cautious{ border-color: var(--warn); background: var(--warn-soft); color: var(--warn); }
.managed-analysis .strategy-t       { border-color: var(--info); background: var(--info-soft); color: var(--info); }
.managed-analysis .strategy-add     { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); }
.managed-analysis .strategy-hold    { border-color: var(--line-strong); background: var(--surface-2); color: var(--ink-2); }
.managed-analysis .strategy-watch   { border-color: var(--line-strong); background: var(--surface-2); color: var(--muted); }
.managed-analysis .strategy-neutral { border-color: var(--muted); }
.managed-analysis .strategy-unanalysed { border-color: var(--line-strong); }

.managed-actions {
  grid-column: 3; grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  gap: 6px;
  padding-top: 1px;
  min-width: 140px;
}
.managed-secondary-actions, .managed-primary-actions { display: flex; width: 100%; justify-content: flex-end; align-items: center; gap: 7px; flex-wrap: nowrap; }
.managed-secondary-actions button, .managed-primary-actions button { width: 32px; min-width: 32px; flex: 0 0 32px; height: 32px; padding: 0; }
.managed-actions button {
  height: 32px;
  border: 1px solid transparent;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.managed-actions button:hover { background: var(--surface-2); }
.managed-actions button:disabled { cursor: not-allowed; opacity: .55; }
.managed-actions .snapshot-stock, .managed-actions .edit-stock, .managed-actions .delete-stock { font-size: 15px; }
.managed-actions .delete-stock:hover { background: var(--danger-soft); color: var(--danger); }
.managed-actions .move-stock { background: var(--surface-2); color: var(--brand); font-weight: 700; font-size: 15px; }
.managed-actions .move-stock:hover { background: var(--surface-3); }
/* 编辑/快照按钮 hover 恢复品牌色（.managed-actions button:hover 优先级更高，会压过 .icon-action:hover） */
.managed-actions .edit-stock:hover, .managed-actions .snapshot-stock:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.managed-actions .analyze-stock {
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
}
.managed-actions .analyze-stock:hover { background: var(--brand-strong); }
.managed-actions .analyze-stock.loading { position: relative; background: var(--brand); }
.managed-actions .analyze-stock.loading::before {
  content: "";
  width: 13px; height: 13px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}

/* ---------- 8. 市场筛选 ---------- */
.screener-panel {
  margin-top: 16px;
  padding: 18px 20px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}
.screener-toggle {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 0 0 14px;
  color: var(--ink);
  cursor: pointer;
}
.screener-toggle span strong { display: block; font-size: 15px; }
.screener-toggle span small { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.screener-toggle b {
  width: 28px; height: 28px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 12px;
}
.screener-toggle:hover b { background: var(--brand-soft); }
.screener-content[hidden] { display: none; }
.screener-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
  padding: 6px 0 0;
  border-top: none;
  border-bottom: none;
  flex-wrap: wrap;
}
.screener-title { padding: 2px 0 0; }
.screener-title h2 { margin: 0 0 6px; font-size: 17px; }
.screener-title small { color: var(--muted); font-size: 11px; }
.screener-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}
.screener-actions .inline-toggle { height: 34px; flex-shrink: 0; }




.filter-field { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.filter-field input {
  width: 58px; height: 32px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 5px;
  font-size: 11px;
}
.screener-actions label:has(#change-min) input { width: 46px; }
.filter-field em, .filter-field span { font-style: normal; color: var(--muted); font-size: 10px; }
.screener-run-actions {
  display: flex; align-items: center; justify-content: flex-end; gap: 8px;
  margin-left: auto;
  flex-shrink: 0;
}
.screener-actions select {
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: var(--surface);
  padding: 0 7px;
  font-size: 11px;
  cursor: pointer;
}
.screener-run-actions #screener-limit { flex: 0 0 92px; width: 92px; }
.screener-run-actions #run-screener {
  flex: 0 0 118px; width: 118px;
  height: 38px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.screener-run-actions #run-screener:hover { background: var(--brand-strong); }
.screener-run-actions #run-screener:disabled { opacity: .6; cursor: wait; }
.screener-status { display: none; }
.screener-list {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  max-height: 470px;
  overflow-y: auto;
}
.screener-list > .muted { margin: 0; padding: 30px 16px; text-align: center; font-size: 12px; background: var(--surface); }
.screener-row {
  display: grid;
  grid-template-columns: minmax(130px, .8fr) minmax(130px, .8fr) minmax(300px, 2fr) 138px;
  gap: 12px;
  align-items: center;
  padding: 11px 13px;
  background: var(--surface);
  transition: background .12s;
}
.screener-row:hover { background: var(--surface-3); }
.screener-identity strong, .screener-identity span { display: block; }
.screener-identity strong { font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screener-identity span { color: var(--muted); font-size: 10px; margin-top: 3px; font-variant-numeric: tabular-nums; }
.screener-quote { font-weight: 700; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.screener-quote.up { color: var(--up); }
.screener-quote.down { color: var(--down); }
.screener-insight { display: grid; gap: 2px; min-width: 0; font-size: 11px; }
.screener-insight span, .screener-insight small { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.screener-insight strong { font-size: 12.5px; color: var(--ink); font-variant-numeric: tabular-nums; }
.screener-insight small { font-size: 10px; }
.screener-row-actions {
  display: grid;
  grid-template-columns: 32px 32px 58px;
  gap: 6px;
  width: 138px;
  justify-content: end;
  align-items: center;
}
.screener-row-actions button {
  height: 32px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center;
}
.screener-row-actions .screener-snapshot { width: 32px; padding: 0; background: var(--surface-2); color: var(--ink-2); font-size: 15px; }
.screener-row-actions .screener-snapshot:hover { background: var(--surface-2); }
.screener-action-placeholder { display: block; width: 32px; height: 32px; visibility: hidden; }
.screener-analyze {
  position: relative;
  width: 32px; min-width: 32px; padding: 0;
  background: var(--brand); color: #fff; font-size: 14px;
}
.screener-analyze:hover { background: var(--brand-strong); }
.screener-analyze.loading { color: transparent; }
.screener-analyze.loading::after {
  content: "";
  position: absolute; inset: 0; margin: auto;
  width: 12px; height: 12px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}
.screener-add { min-width: 58px; background: var(--surface-2); color: var(--brand); }
.screener-add:hover { background: var(--surface-3); }
.screener-add:disabled { color: var(--muted); background: var(--surface-2); cursor: default; }
.screener-row-actions button:disabled { cursor: wait; opacity: .5; }
.screener-add:disabled { cursor: default; opacity: 1; }

/* ---------- 9. 工作区：摘要条 ---------- */
.workspace { padding-top: 22px; }

/* 公开快照只读提示条（方案 A：浅青底、与内容格对齐） */
/* A 方案：内容格对齐的浅青提示条 */
.readonly-snapshot-banner {
  display: flex; align-items: center; gap: 12px;
  margin: 0 0 14px; padding: 10px 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-left: 3px solid var(--brand);
  border-radius: 10px;
}
.readonly-snapshot-banner .rsb-lock {
  flex: none; width: 28px; height: 28px; border-radius: 8px;
  background: #fff; border: 1px solid var(--brand-line);
  display: flex; align-items: center; justify-content: center; font-size: 14px;
}
.readonly-snapshot-banner .rsb-txt { flex: 1; min-width: 0; }
.readonly-snapshot-banner .rsb-title { font-size: 13px; font-weight: 600; color: var(--brand-strong); }
.readonly-snapshot-banner .rsb-sub { font-size: 12px; color: var(--muted); margin-top: 1px; }
.readonly-snapshot-banner .primary { flex: none; white-space: nowrap; }
/* 公开快照只读态（2026-10-20 方案一）：只读条并入股票摘要卡做页脚——
   卡片承载边框/左侧品牌竖线/圆角/阴影，摘要条不再单独成卡，只读条只留浅青底与顶部发丝线。
   无公开快照时摘要卡内只有摘要条，外观与原独立摘要条完全一致。 */
.summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  overflow: hidden;
}
.summary-card > .summary-strip {
  margin: 0;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}
.summary-card > .readonly-snapshot-banner {
  margin: 0;
  padding: 10px 20px 10px 24px;
  border: 0;
  border-top: 1px solid var(--brand-line);
  border-radius: 0;
}
/* 摘要条（股票名/代码/价/涨跌/监控·分享·下载）。
   滚出视口后由左下角悬浮卡片 .fqc-card 承接（见 js/chrome.js initFloatQuoteCard）。 */
.summary-strip {
  display: flex;
  align-items: center;
  gap: 26px;
  padding: 14px 20px 14px 24px;
  margin-bottom: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  flex-wrap: wrap;
}
.identity { min-width: 298px; display: flex; align-items: baseline; gap: 2px; }
.identity h2 { display: inline; font-size: 21px; margin: 0; letter-spacing: .01em; }
.identity > span:first-child { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.badge {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-3);
}
.quote { margin-left: auto; text-align: right; }
.quote strong { font-size: 26px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.quote span { display: block; font-weight: 700; font-variant-numeric: tabular-nums; }
.quote span.up { color: var(--up); }
.quote span.down { color: var(--down); }
/* 质量列定版两行：①「数据完整度 100%」同一行 ②新鲜度芯片。
   改前四个元素走 inline 流，同一列会随文案长度折成 2 行或 3 行、徽章忽左忽右；grid 把行位钉死。
   双源校验原是并列的第二颗胶囊——两颗胶囊叠着互相抢重点，已收进芯片详情气泡（口径在 research.js::formatFreshnessParts）。 */
.quality {
  display: grid; grid-template-columns: auto 1fr; align-items: baseline; column-gap: 7px; row-gap: 4px;
  padding-left: 24px; border-left: 1px solid var(--line); width: 320px; min-width: 320px; max-width: 320px;
}
.quality > span { grid-column: 1; }
.quality > strong { grid-column: 2; }
.quality > #freshness { grid-column: 1 / -1; justify-self: start; }
.quality span { display: block; color: var(--muted); font-size: 10px; line-height: 1.5; }
.quality strong { font-size: 17px; color: var(--ink); font-variant-numeric: tabular-nums; }
.summary-action, .download {
  border: 0;
  padding: 10px 15px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.summary-action { background: var(--brand-soft); color: var(--brand); transition: background .15s, color .15s; }
.summary-action:hover { background: var(--brand); color: #fff; }
.summary-action.active { background: var(--brand); color: #fff; }
.summary-action:disabled { opacity: .6; cursor: wait; }

/* 摘要条操作区：监控 / 下载 / 分享 一排图标按钮，靠右 */
.summary-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.summary-actions-top {
  display: flex;
  gap: 8px;
}
.icon-action {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .15s, color .15s;
  padding: 0;
}
.icon-action:hover { background: var(--brand); color: #fff; }
.icon-action:disabled { opacity: .6; cursor: wait; }
#watch-btn.active { background: var(--brand); color: #fff; }
.follow-chip:disabled { opacity: .6; cursor: wait; }
/* 关注按钮：紧贴股票名称右侧的小星标，类似同花顺自选股星标 */
.follow-chip {
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--faint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  transition: color .15s, transform .15s;
  flex-shrink: 0;
}
.follow-chip:hover { color: var(--brand); transform: scale(1.15); }
.follow-chip.is-active { color: var(--brand); opacity: 1; cursor: pointer; }
.follow-chip.is-active svg { fill: var(--brand); }

.follow-chip.is-holding { color: #d97706; opacity: 1; cursor: pointer; }
.follow-chip.is-holding svg { fill: #d97706; }

.follow-chip:disabled { opacity: .6; cursor: wait; }
/* watch-btn 已改为图标按钮，无需文字按钮样式 */


/* ---------- 10. 工作区：面板网格 ---------- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
}
/* ---------- 左侧悬浮章节导航（数字圆点式） ---------- */
.section-nav {
  position: fixed;
  left: 8px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 50;
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 0;
  gap: 0;
}
body.has-result .section-nav { display: flex; }

/* 垂直轨道线 */
.section-nav::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 14px;
  bottom: 14px;
  width: 2px;
  transform: translateX(-50%);
  background: var(--line);
  border-radius: 2px;
  z-index: 0;
}

.section-nav-item {
  position: relative;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  z-index: 2;
  outline: none;
  border-radius: 50%;
}

/* 数字圆点 */
.section-nav-item .sn-dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9px;
  font-weight: 800;
  color: var(--muted);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
  transition: all .2s ease;
  box-sizing: border-box;
}
.section-nav-item:hover .sn-dot {
  border-color: var(--brand);
  color: var(--brand);
  transform: scale(1.1);
}
.section-nav-item.active .sn-dot {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 0 0 5px var(--brand-soft), 0 0 12px rgba(31,122,120,.35);
}

/* 自定义悬浮气泡（[data-tip]，见 utils.js initBubbleTips）—— 与 sn-tooltip 同一毛玻璃视觉 */
#bubble-tip {
  position: fixed;
  z-index: 10002;
  max-width: 300px;
  background: rgba(22, 28, 38, 0.88);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8ecf1;
  font-size: 11px;
  line-height: 1.7;
  padding: 8px 12px;
  border-radius: 9px;
  white-space: pre-line;
  text-align: left;
  letter-spacing: .02em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .16s ease, transform .16s ease;
  pointer-events: none;
}
#bubble-tip.show { opacity: 1; transform: translateY(0); }
#bubble-tip::after {
  content: "";
  position: absolute;
  left: var(--arrow-x, 50%);
  width: 9px;
  height: 9px;
  background: rgba(22, 28, 38, 0.88);
  transform: translateX(-50%) rotate(45deg);
}
/* 默认在上方：箭头朝下钩住目标 */
#bubble-tip:not(.below)::after { bottom: -5px; border-right: 1px solid rgba(255, 255, 255, 0.08); border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
/* 空间不足翻到下方：箭头朝上 */
#bubble-tip.below::after { top: -5px; border-left: 1px solid rgba(255, 255, 255, 0.08); border-top: 1px solid rgba(255, 255, 255, 0.08); }
/* 新鲜度详情此前只靠 cursor:help——指针不移上去就没人知道能看。升格为芯片 + 尾部图标，
   悬停即出、点按钉住、Tab+Enter 也能开。摘要条现在只留这一颗胶囊，它一个人要表达
   实时 / 休市 / 非实时 / 双源分歧四种态：文字色与底色走 --fc-* 变量交换，悬停加深由一条
   规则读变量——上一版给每种态各写 :hover，特异度打架反复返工。
   加深量用 color-mix 往 --ink 方向推，不写死色值：浅色主题往深走、暗色主题往亮走，
   两套路数同一条表达式；indigo 等其它主题块也不必再各自补一份 hover 色。 */
#freshness {
  --fc-fg: var(--muted); --fc-bg: var(--surface-3);
  --fc-bg-hover: color-mix(in srgb, var(--fc-bg) 88%, var(--ink));
  display: inline-flex; align-items: center; gap: 5px; width: max-content; max-width: 100%;
  padding: 3px 9px; border: 0; border-radius: 999px; text-align: left;
  font: inherit; font-size: var(--fs-tiny); line-height: 1.5;
  color: var(--fc-fg); background: var(--fc-bg);
}
/* `.quality span` 会把 muted/10px 打到文本层，状态色会被它吃掉——显式继承芯片 */
#freshness #freshness-text { color: inherit; font-size: inherit; font-weight: inherit; line-height: inherit; }
#freshness .fc-i {
  display: none; flex: none; width: 12px; height: 12px;
  fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; opacity: .72;
}
/* 只有真有详情可看时才亮图标、才给手型：没料就长得像普通文本，别装作能点 */
#freshness.has-tip { cursor: pointer; }
#freshness.has-tip .fc-i { display: block; }
#freshness.has-tip:hover, #freshness.has-tip[aria-expanded="true"] { background: var(--fc-bg-hover); }
#freshness:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
#bubble-tip.is-pinned { pointer-events: auto; }
/* 实时：品牌青软底，与警示两档色板分得开 */
#freshness.is-live { --fc-fg: var(--brand-strong); --fc-bg: var(--brand-soft); font-weight: 600; }
/* 双源分歧：报价两个源打架，是唯一把坏数据摆到明面的信号，只写进气泡等于看不见 */
#freshness.is-bad { --fc-fg: var(--danger); --fc-bg: var(--danger-soft); font-weight: 600; }
/* 休市 / 非实时：琥珀文案与色板不许变，它是用户唯一的「别把这个价当实时价」信号。
   排在 is-bad 之后：既休市又分歧时先保住"这价不是此刻的"，分歧那句话留在详情里读。 */
#freshness.is-market-closed { --fc-fg: var(--warn); --fc-bg: var(--warn-soft); font-weight: 600; }

/* 精致毛玻璃 tooltip */
.section-nav-item .sn-tooltip {  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(-6px);
  background: rgba(22, 28, 38, 0.82);
  backdrop-filter: blur(12px) saturate(1.4);
  -webkit-backdrop-filter: blur(12px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #e8ecf1;
  font-size: 11.5px;
  font-weight: 600;
  padding: 7px 13px;
  border-radius: 9px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
  letter-spacing: .03em;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.28), 0 1px 3px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-nav-item .sn-tooltip .tt-num {
  font-size: 10px;
  font-weight: 800;
  color: #5eead4;
  font-variant-numeric: tabular-nums;
  letter-spacing: .05em;
  text-shadow: 0 0 8px rgba(94, 234, 212, 0.4);
}
.section-nav-item .sn-tooltip .tt-sep {
  width: 1px;
  height: 10px;
  background: rgba(255, 255, 255, 0.15);
}
.section-nav-item:hover .sn-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}
.section-nav-item:hover .sn-tooltip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 16px 18px 18px;
  min-width: 0;
  box-shadow: var(--shadow-card);
}
.panel h3 { margin: 0; font-size: 15px; letter-spacing: .01em; }
.panel-head {
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  gap: 8px;
}
.panel-head > span { color: var(--muted); font-size: 11px; white-space: nowrap; }
.panel-head h3 { cursor: pointer; user-select: none; display: flex; align-items: center; gap: 6px; }
.panel-head h3::after { content: "⌃"; font-size: 10px; color: var(--muted); transition: transform .2s; opacity: .6; }
.panel.collapsed .panel-head h3::after { transform: rotate(180deg); }
.panel.collapsed > *:not(.panel-head) { display: none !important; }
.panel.collapsed { padding-bottom: 10px; }

/* 区域分隔标题 */
.section-divider {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 28px 4px 14px;
  border-bottom: 2px solid var(--line);
  margin-top: 8px;
}
.section-divider:first-child { margin-top: 0; padding-top: 0; }
.section-divider .section-num {
  font-size: 32px;
  font-weight: 800;
  color: var(--brand);
  opacity: .25;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.section-divider h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: .02em;
}
.section-divider p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.chart-panel { grid-column: span 8; }
.score-panel { grid-column: span 4; }
.intent-panel { grid-column: span 4; }
.points-panel { grid-column: span 4; }
.strategy-panel { grid-column: span 4; }
.risk-panel { grid-column: 1 / -1; scroll-margin-top: calc(var(--topbar-h) + 16px); }
.session-panel { grid-column: span 7; }
.personal-panel { grid-column: span 5; }
.data-quality-panel { grid-column: span 12; }
.market-context-panel { grid-column: span 12; }
.fundamentals-panel { grid-column: span 4; }
.news-panel { grid-column: span 8; }
.intelligence-panel { grid-column: span 12; }
.evolution-panel { grid-column: span 6; }
.ai-panel { grid-column: 1 / -1; }
.research-panel { grid-column: span 12; }

.chart-panel canvas { width: 100%; height: 310px; display: block; }
.indicator-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  padding-top: 10px;
  margin-top: 10px;
  border-top: 1px solid var(--line);
}
.indicator-row .ind { display: inline-flex; align-items: baseline; gap: 5px; }
.indicator-row .ind b { color: var(--ink); font-weight: 700; }
/* 指标行结论化：结论（如「偏高，短线过热」）与数值同排；原值收进整行折叠，不删信息只分层 */
.indicator-row .ind .ind-note { color: var(--muted); font-size: 10px; }
.indicator-row .ind-raw { flex-basis: 100%; }
.indicator-row .ind-raw summary { cursor: pointer; color: var(--muted); font-size: 10px; }
.indicator-row .ind-raw p { margin: 4px 0 0; color: var(--muted); font-size: 10px; }
.chart-head-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin: -6px 0 8px;
}
.chart-head-actions span {
  color: var(--muted); font-size: 10px;
  min-width: 0; text-align: right; line-height: 1.5;
}
/* 非交易时段 / 数据已定格：与顶部「休市快照」同款低饱和胶囊，提示"不是取数失败" */
#realtime-status.is-paused {
  padding: 2px 8px; border-radius: 999px;
  border: 1px solid var(--accent-line); background: var(--accent-soft);
  color: var(--accent); cursor: help;
}
.chart-head-actions button {
  position: relative;
  width: 30px; height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--brand);
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.chart-head-actions button:hover { background: var(--brand); color: #fff; }
.chart-head-actions button:disabled { opacity: .55; cursor: wait; }
/* 非交易时段：刷新取不到当日分时，按钮置灰。
   光靠 opacity 不够——用户看不出"为什么点不动"，所以再压一档饱和度并换成 help 光标
   （与右侧状态条胶囊的 cursor: help 同款，指同一个悬停解释）。
   与上面的 :disabled 分开写而不是覆盖：让"正在刷新中"仍是 wait 光标、
   "非交易时段"是 help，两者视觉上可区分。 */
.chart-head-actions button:disabled.is-idle {
  opacity: .38; cursor: help;
  background: var(--surface-3); color: var(--muted);
}
.chart-head-actions button:disabled.is-idle:hover {
  background: var(--surface-3); color: var(--muted);
}
.chart-head-actions button.loading { color: transparent; }
.chart-head-actions button.loading::before {
  content: "";
  position: absolute; left: 8px; top: 8px;
  width: 12px; height: 12px;
  border: 2px solid rgba(14, 124, 107, .25);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}
.chart-overlay-controls { display: flex; gap: 6px; margin: 0 0 13px; flex-wrap: wrap; }
.chart-overlay-controls button {
  height: 30px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  color: var(--ink-2);
  font-size: 11px;
  transition: background .12s, color .12s, opacity .12s;
}
.chart-overlay-controls button:hover { background: var(--surface-2); }
.chart-overlay-controls button[aria-pressed="false"] { background: var(--surface); color: var(--faint); opacity: .62; }
.marker-swatch { width: 13px; height: 3px; display: inline-block; border-radius: 2px; background: var(--info); }
.marker-swatch.stop-loss { background: var(--up); }
.marker-swatch.t-trade { background: var(--accent); }
.marker-swatch.take-profit { background: var(--info); }

/* 量化评分 */
.score-total { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 16px; }
.score-total strong { font-size: 40px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--ink); }
.score-total span { color: var(--muted); font-size: 12px; padding-bottom: 4px; }
.score-bars { display: grid; gap: 10px; }
.score-radar { display: flex; justify-content: center; align-items: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.score-radar svg { width: 170px; height: 170px; overflow: visible; }
.score-radar .radar-grid { fill: none; stroke: var(--line); stroke-width: 1; }
.score-radar .radar-axis { stroke: var(--line); stroke-width: 1; }
.score-radar .radar-area { fill: var(--brand); fill-opacity: 0.25; stroke: var(--brand); stroke-width: 2; }
.score-radar .radar-dot { fill: var(--brand); stroke: var(--surface); stroke-width: 2; }
.score-radar .radar-label { fill: var(--muted); font-size: 10px; text-anchor: middle; dominant-baseline: middle; }
.score-line { display: grid; grid-template-columns: 52px 1fr 48px; align-items: center; gap: 8px; font-size: 12px; }
.score-line .bar { height: 7px; background: var(--surface-2); border-radius: 4px; overflow: hidden; }
.score-line .bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), #2e9c88); border-radius: 4px; }
.score-line strong { text-align: right; font-variant-numeric: tabular-nums; }

/* 大盘环境修正块（评分区次级信息，与五维评分条视觉区分） */
.env-block { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 12px; padding: 8px 10px; background: var(--surface-3); border-radius: 8px; font-size: 12px; line-height: 1.5; }
.env-block .env-tag { color: var(--muted); white-space: nowrap; }
.env-block .env-adj { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.env-block .env-adj.up { color: var(--up); }
.env-block .env-adj.down { color: var(--down); }
.env-block .env-note { color: var(--muted); flex: 1; min-width: 220px; }
.env-block .cap-help { display: inline-flex; align-items: center; justify-content: center; width: 13px; height: 13px; border: 1px solid var(--muted); border-radius: 50%; color: var(--muted); font-size: 10px; font-style: normal; cursor: help; flex: none; white-space: nowrap; }
.env-block .cap-help:hover { color: var(--brand); border-color: var(--brand); }


/* 主力行为 */
.evidence { padding-left: 18px; color: var(--muted); line-height: 1.7; margin: 8px 0; font-size: 12px; }
.capital-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.capital-strip .cap-item { flex: 1 1 0; min-width: 84px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 7px 9px; }
.capital-strip .cap-item span { display: block; color: var(--muted); font-size: 10px; }
.capital-strip .cap-item b { display: block; margin-top: 3px; font-size: 12px; font-variant-numeric: tabular-nums; }
.capital-strip .cap-item b.pos { color: var(--up); }
.capital-strip .cap-item b.neg { color: var(--down); }
/* 模块不可用原因（仅管理员/运营可见）：灰字、不加粗，与正常数值明显区分 */
.capital-strip .cap-item b.muted { color: var(--muted); font-weight: 400; font-size: 11px; line-height: 1.4; }
.forecast { display: flex; gap: 8px; margin-top: 12px; }
.forecast span { flex: 1; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; color: var(--muted); font-size: 11px; }
.forecast b { display: block; color: var(--ink); margin-top: 3px; font-size: 13px; }

/* 价格地图 */
.price-ladder { display: grid; gap: 7px; }
.level { display: grid; grid-template-columns: 74px 1fr 78px; gap: 8px; align-items: center; font-size: 12px; }
.level-track { height: 5px; background: var(--surface-2); border-radius: 3px; position: relative; }
.level-track i {
  position: absolute;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--accent-line);
  top: -3px;
  transform: translateX(-50%);
}
.level strong { text-align: right; font-variant-numeric: tabular-nums; }

/* 手动交易参考 */
.position { border-left: 3px solid var(--accent); padding: 9px 11px; background: var(--accent-soft); font-weight: 700; border-radius: 0 8px 8px 0; font-size: 13px; }
.strategy-panel > p:not(.position) { color: var(--muted); font-size: 12px; line-height: 1.6; }
.conditions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.condition { padding: 10px 11px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; font-size: 12px; line-height: 1.5; }
.condition b { display: block; color: var(--brand); margin-bottom: 3px; font-size: 12px; }

/* 合规整改（v0.0.20）：统计口径徽章（结果区免责小字已移除，2026-10-19） */
.compliance-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 8px; font-size: 11px; font-weight: 400; color: var(--muted); background: var(--surface-3); border: 1px solid var(--line); vertical-align: middle; }

/* 风险与异动 */
.risk-item, .anomaly-item {
  border-left: 3px solid var(--danger);
  padding: 9px 11px;
  margin-bottom: 8px;
  background: var(--danger-soft);
  border-radius: 0 8px 8px 0;
  font-size: 12px;
  line-height: 1.5;
}
.risk-item.low { border-color: var(--brand); background: var(--down-soft); }
.anomaly-item { border-color: var(--accent); background: var(--accent-soft); }
/* 风险与异动的分层展示：抬头（等级+白话短名）→ 结论 → 时间/周期徽章 → 动作，专业口径折叠 */
.risk-head { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.risk-label { color: var(--brand); font-weight: 700; }
.risk-plain, .risk-action { margin: 0; }
.risk-action { margin-top: 4px; color: var(--muted); }
.risk-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.risk-badge { border: 1px solid var(--line); background: var(--surface-3); color: var(--muted); border-radius: 999px; padding: 2px 8px; font-size: 11px; line-height: 1.5; }
.risk-more, .risk-resolved { margin-top: 6px; font-size: 11.5px; }
.risk-more summary, .risk-resolved summary { cursor: pointer; color: var(--brand); }
.risk-more-body p, .risk-resolved-body p { margin: 4px 0 0; color: var(--muted); line-height: 1.6; }
/* 数据缺失导致「暂无法判定」的条目：与真正的「已解除」区分，用警示色提示可能仍在 */
.risk-resolved-body p.risk-undetermined { color: var(--warn-ink); }
.risk-resolved { border-top: 1px dashed var(--line); padding-top: 6px; }

/* 风险面板统计徽章（panel-head 右侧）：色点区分等级，0 值类别不渲染 */
.risk-stats { display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.risk-stat-chip {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap;
  border: 1px solid var(--line); background: var(--surface-3); border-radius: 999px;
  padding: 2px 9px; font-size: 11px; line-height: 1.6; color: var(--ink-2);
}
.risk-stat-chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.risk-stat-chip.hi .dot { background: var(--danger); }
.risk-stat-chip.mid .dot { background: var(--warn); }
.risk-stat-chip.low .dot { background: var(--brand); }
.risk-stat-chip.anom .dot { background: var(--accent); }

/* 风险面板限高折叠：限高常挂，实测溢出才出现遮罩与「查看全部」按钮（判定在 view.js）。
   类语义：is-collapsed=限高 400；has-overflow=限高后内容真溢出（才渲染遮罩/按钮）；
   is-expanded=展开态（解除限高、遮罩退场），点击「查看全部/收起」切换 */
.risk-body-wrap { position: relative; }
.risk-body-wrap.is-collapsed:not(.is-expanded) .risk-body { max-height: 400px; overflow: hidden; }
.risk-fade { display: none; }
.risk-body-wrap.has-overflow:not(.is-expanded) .risk-fade {
  display: block; position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface) 78%);
}
.risk-toggle, .mc-toggle-bottom {
  display: block; width: 100%; margin-top: 8px; padding: 7px 0;
  background: var(--surface-3); border: 1px dashed var(--line); border-radius: 8px;
  color: var(--brand); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .15s, border-color .15s;
}
.risk-toggle:hover, .mc-toggle-bottom:hover { background: var(--brand-soft); border-color: var(--brand-line); }
.risk-empty { margin: 0; padding: 10px 11px; font-size: 12px; color: var(--muted); background: var(--surface-3); border: 1px dashed var(--line); border-radius: 8px; line-height: 1.5; }

/* 基本面 */
.business { color: var(--muted); line-height: 1.6; min-height: 44px; font-size: 12.5px; margin: 0 0 10px; }
.fundamental-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.metric { background: var(--surface); padding: 9px 11px; }
.metric span { display: block; color: var(--muted); font-size: 10px; }
.metric strong { display: block; margin-top: 3px; font-size: 14px; font-variant-numeric: tabular-nums; }
.scenario-box {
  margin-top: 12px;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
.scenario-box > strong { display: block; font-size: 12.5px; margin-bottom: 5px; color: var(--ink); }
.scenario-box p { margin: 4px 0; color: var(--muted); line-height: 1.5; font-size: 12px; }
.scenario-box p b { color: var(--ink-2); }

/* 公告舆情 —— 整行即入口：标题为主、元信息为次、行尾一个低调图标，不再单挂「查看」按钮 */
.news-list { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px; }
.news-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 8px;
  min-width: 0;
  align-items: center;
  padding: 7px 9px;
  border: 1px solid transparent;
  border-radius: 9px;
  transition: background .15s, border-color .15s;
}
.news-item.is-clickable { cursor: pointer; }
.news-item.is-clickable:hover { background: var(--surface-3); border-color: var(--line); }
.news-item.is-clickable:focus-visible { background: var(--surface-3); outline: 2px solid var(--brand-line); outline-offset: 1px; }

.notice-main { display: grid; gap: 3px; min-width: 0; }
.notice-title {
  margin: 0; font-size: 12.5px; line-height: 1.45; font-weight: 600; color: var(--ink);
  /* 标题过长时截断到两行，全文在点开的阅读弹窗里读 */
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  transition: color .15s;
}
.is-clickable:hover .notice-title, .is-clickable:focus-visible .notice-title { color: var(--brand); }

.notice-meta-line { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 7px; font-size: 11px; color: var(--muted); }
.notice-tag {
  padding: 1px 6px; border-radius: 6px; font-weight: 700; line-height: 1.6;
  border: 1px solid var(--line); background: var(--surface-3); color: var(--muted);
  /* 标签是实底色块，与后续文字的间隙要比「文字 · 文字」的浮点更宽才显得匀称 */
  margin-right: 4px;
}
.notice-tag--up { color: var(--up); border-color: color-mix(in oklab, var(--up) 30%, transparent); background: color-mix(in oklab, var(--up) 9%, var(--surface)); }
.notice-tag--down { color: var(--down); border-color: color-mix(in oklab, var(--down) 30%, transparent); background: color-mix(in oklab, var(--down) 9%, var(--surface)); }
.notice-meta-cell { white-space: nowrap; }
.notice-meta-cell + .notice-meta-cell::before { content: "·"; margin-right: 7px; color: var(--line); }

/* 行尾图标：默认弱化，hover 才提亮并轻微右移，暗示"可继续" */
.notice-go {
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); opacity: .7;
  transition: color .15s, opacity .15s, transform .15s;
}
.is-clickable:hover .notice-go, .is-clickable:focus-visible .notice-go { color: var(--brand); opacity: 1; transform: translateX(2px); }
.notice-none { font-size: 11px; color: var(--muted); white-space: nowrap; }

.notice-footer {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
  margin-top: 4px; padding: 6px 9px 0; border-top: 1px solid var(--line); font-size: 11px;
}
.notice-pager { display: flex; align-items: center; gap: 10px; }
.notice-page-btn {
  background: none; border: 1px solid var(--line); color: var(--muted);
  font-size: 11px; font-weight: 600; padding: 3px 12px; border-radius: 999px;
  cursor: pointer; transition: color .15s, border-color .15s;
}
.notice-page-btn:hover:not(:disabled) { color: var(--ink); border-color: var(--muted); }
.notice-page-btn:disabled { opacity: .4; cursor: default; }

/* ---------- 11. 研究增强面板 ---------- */
.intelligence-panel h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); font-weight: 700; }
.intelligence-panel p { margin: 5px 0; line-height: 1.6; font-size: 12.5px; color: var(--ink-2); }
.intelligence-panel .muted { color: var(--muted); }
.research-output { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); line-height: 1.65; }
.research-output:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.research-output h4 { margin: 0 0 6px; font-size: 14px; color: var(--ink); font-weight: 700; }
.research-output p { margin: 5px 0; line-height: 1.6; font-size: 12.5px; color: var(--ink-2); }
.research-output .muted { color: var(--muted); }
.intelligence-grid.two-col { grid-template-columns: 1fr 1fr; gap: 8px 24px; }
.intelligence-grid.two-col > .research-output { border-top: 0; margin-top: 0; padding-top: 0; }
/* 折叠交互 */
.collapsible-section { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.collapse-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; padding: 6px 2px; cursor: pointer;
  font-size: 12px; font-weight: 600; color: var(--ink-2); text-align: left;
  border-radius: 6px; transition: background .15s;
}
.collapse-toggle:hover { background: var(--surface-2); }
.collapse-toggle .collapse-icon { font-size: 10px; color: var(--muted); transition: transform .2s; }
.collapse-toggle .collapse-hint { margin-left: 8px; font-weight: 500; font-size: 11px; color: var(--muted); }
.collapsible-body { padding-top: 8px; }
.collapsible-body.hidden { display: none; }
.collapsible-head { cursor: pointer; user-select: none; }
.collapsible-head .collapse-icon { transition: transform .2s; font-size: 10px; color: var(--muted); }
/* 数据质量紧凑面板 */
.data-quality-compact { display: flex; flex-wrap: wrap; gap: 8px 20px; font-size: 12px; }
.data-quality-compact p { margin: 3px 0; line-height: 1.5; }
.data-quality-compact h4 { display: none; }
/* 数据证据：默认只给「结论 + 源名」的键值徽标，降级/故障说明折进「数据详情」 */
.dq-chips { display: flex; flex-wrap: wrap; gap: 6px; width: 100%; }
.dq-chip { display: inline-flex; align-items: baseline; gap: 5px; border: 1px solid var(--line); background: var(--surface-3); border-radius: 999px; padding: 2px 9px; }
.dq-chip b { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.dq-chip i { font-style: normal; font-size: 12px; color: var(--ink); }
.dq-verify.is-ok { border-color: var(--brand-line); background: var(--brand-soft); }
.dq-verify.is-ok i { color: var(--brand); }
.dq-verify.is-warn { border-color: var(--warn-line, var(--line)); background: var(--warn-soft); }
.dq-verify.is-warn i { color: var(--warn); }
.dq-verify.is-bad { border-color: var(--danger-line, var(--line)); background: var(--danger-soft); }
.dq-verify.is-bad i { color: var(--danger); }
.dq-more { width: 100%; font-size: 11.5px; }
.dq-more summary { cursor: pointer; color: var(--brand); }
.dq-more-body p { margin: 4px 0 0; color: var(--muted); line-height: 1.6; }
/* 盘中摘要内联 */
.intraday-summary-inline { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 12px; color: var(--ink-2); line-height: 1.6; }
/* 无内容时不渲染分隔线：避免刷新首帧出现一条孤立的空分隔线（内容由快照/渲染填充后才展开） */
.intraday-summary-inline:empty { margin: 0; padding: 0; border: none; }
.intraday-summary-inline h4 { margin: 0 0 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.intraday-summary-inline p { margin: 2px 0; }
.intraday-summary-inline .muted { color: var(--muted); }
/* 时段预案面板 */
.session-panel .session-plan-grid { margin-top: 0; }
/* 个人预案面板 */
.personal-panel .personal-controls { margin-top: 0; padding: 0; border: none; background: none; }
.session-plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 12px; }
.session-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: var(--surface-3);
}
.session-block.is-current { border-color: var(--brand-line); background: var(--brand-soft); }
.session-block .sb-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.session-block .sb-tag {
  font-size: 10px; font-weight: 800;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  padding: 1px 8px;
  border-radius: 999px;
  letter-spacing: .05em;
}
.session-block.is-current .sb-tag { color: var(--brand); border-color: var(--brand-line); background: var(--surface); }
.session-block .sb-title { font-size: 12.5px; font-weight: 700; }
.session-block p { margin: 3px 0; font-size: 11.5px; line-height: 1.55; color: var(--ink-2); }
.session-block p b { color: var(--muted); font-weight: 600; }

.intelligence-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px 20px; }
.intelligence-grid > .research-output { margin-top: 0; }
.post-market-panel { grid-column: span 6; }
.post-market-panel .panel-head { flex-wrap: wrap; gap: 10px; }
.post-market-panel #live-post-review-btn { flex: 0 0 auto; }
.post-market-content { line-height: 1.7; }
.post-market-content h4 { margin: 0 0 8px; font-size: 14px; color: var(--ink); }
.post-market-content p { margin: 5px 0; font-size: 12.5px; }
.post-market-content p.muted { color: var(--muted); font-size: 12px; }
.relationship-form {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}
.relationship-form label { font-size: 11px; color: var(--muted); }
.relationship-form input {
  display: block; width: 100%; height: 32px;
  margin-top: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--surface);
}
.relationship-form button {
  height: 32px;
  grid-column: 1 / -1;
  justify-self: start;
  padding: 0 14px;
  border-radius: 6px;
}
.policy-insight-form {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
}
.policy-insight-form label { display: block; color: var(--muted); font-size: 11px; }
.policy-insight-form textarea {
  display: block; width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 9px;
  resize: vertical;
  background: var(--surface);
  line-height: 1.55;
}
.policy-insight-form > div { display: flex; gap: 8px; margin-top: 8px; }
.policy-insight-form input { flex: 1; height: 34px; border: 1px solid var(--line-strong); border-radius: 6px; padding: 0 9px; background: var(--surface); }
.policy-insight-form button { height: 34px; padding: 0 13px; border-radius: 6px; }
.personal-controls {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-3);
  flex-wrap: wrap;
}
.personal-controls label { font-size: 11px; color: var(--muted); }
.personal-controls select, .personal-controls input {
  display: block;
  height: 34px;
  margin-top: 4px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  padding: 0 8px;
  background: var(--surface);
}
.personal-controls button { height: 34px; padding: 0 13px; border-radius: 6px; }

/* ---------- 12. 进化复盘 ---------- */
.evolution-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 6px; }
.evolution-metrics div { padding: 10px 12px; background: var(--surface-3); border: 1px solid var(--line); border-radius: 8px; }
dl { display: grid; grid-template-columns: 90px 1fr; gap: 5px 14px; margin: 12px 0 0; }
dt { color: var(--muted); font-size: 11px; font-weight: 600; align-self: start; padding-top: 1px; }
dd { margin: 0; font-size: 12.5px; color: var(--ink-2); line-height: 1.55; }
.evolution-metrics span { display: block; color: var(--muted); font-size: 10px; }
.evolution-metrics strong { display: block; margin-top: 4px; font-size: 16px; font-variant-numeric: tabular-nums; }
.evolution-panel dl { margin-bottom: 0; }
.evolution-panel dt { color: var(--muted); font-size: 10px; margin-top: 10px; font-weight: 700; }
.evolution-panel dd { margin: 3px 0 0; line-height: 1.5; font-size: 12.5px; color: var(--ink-2); }

/* ---------- 13. 大模型复核 ---------- */
.ai-status-row { display: flex; align-items: flex-start; gap: 8px; }
.ai-status-row .ai-status { flex: 1; min-width: 0; }
.ai-status {
  padding: 12px 14px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.55;
}
.ai-status.completed { border-left: 3px solid var(--brand); }
.ai-status.degraded { border-left: 3px solid var(--danger); }
.ai-status.skipped { border-left: 3px solid var(--accent); }
.ai-status.pending { border-left: 3px solid var(--info); }
.ai-status-row > .primary {
  flex: 0 0 auto;
  min-width: 110px;
  height: 40px;
  padding: 0 16px;
  border-radius: 8px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
  align-self: flex-start;
}
.ai-status-row > .primary:hover { background: var(--brand-strong); }
.ai-status-row > .primary:disabled { opacity: .6; cursor: not-allowed; }
/* 「停止等待」内联按钮（复核/研究轮询的退出入口：仅退出本页等待，不影响后台任务落库） */
.stop-waiting-btn {
  display: inline;
  margin: 0 0 0 6px;
  padding: 0;
  border: none;
  background: none;
  color: var(--brand);
  font: inherit;
  font-size: 12px;
  line-height: inherit;
  cursor: pointer;
  text-decoration: underline;
}
.stop-waiting-btn:hover { color: var(--brand-strong); }
.stop-waiting-btn:disabled { color: var(--muted); cursor: default; text-decoration: none; }
.ai-consensus {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.ai-consensus span { color: var(--brand); font-weight: 700; font-size: 13px; }
.ai-consensus strong { font-size: 13.5px; }
.ai-consensus small { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.ai-panel dl { margin: 4px 0 0; }
.ai-panel dl dt { color: var(--muted); font-size: 10px; margin-top: 10px; font-weight: 700; }
.ai-panel dl dd { margin: 3px 0 0; line-height: 1.55; font-size: 12.5px; color: var(--ink-2); }
.chat-form { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.chat-form label { display: block; font-size: 11px; font-weight: 700; margin-bottom: 6px; color: var(--ink-2); }
.chat-form > div { display: flex; }
.chat-form input {
  flex: 1; min-width: 0;
  height: 40px;
  border: 1px solid var(--line-strong);
  border-radius: 8px 0 0 8px;
  padding: 0 11px;
  outline: none;
}
.chat-form input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.chat-form button {
  width: 44px;
  border-radius: 0 8px 8px 0;
  background: var(--brand);
  color: #fff;
  font-size: 18px;
  position: relative;
}
.chat-form button:hover { background: var(--brand-strong); }
.chat-form button:disabled { opacity: .55; cursor: wait; }
.chat-form button.loading { color: transparent; }
.chat-form button.loading::after {
  content: "";
  position: absolute; left: 16px; top: 13px;
  width: 11px; height: 11px;
  border: 2px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}
.chat-answer {
  margin-top: 10px;
  padding: 13px 15px;
  border-left: 3px solid var(--info);
  background: var(--info-soft);
  border-radius: 0 8px 8px 0;
  line-height: 1.65;
  font-size: 12.5px;
}
.chat-answer small { display: block; margin-top: 8px; color: var(--muted); }

/* ---------- 14. 深度研究与回测门禁 ---------- */
.research-question-field { display: block; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.research-question-field em { font-style: normal; opacity: .75; }
.research-question-field input {
  display: block; width: 100%; margin-top: 4px; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font-size: 13px;
}
.research-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.research-actions button {
  border-radius: 8px;
  width: 118px;
  height: 38px;
  padding: 0 10px;
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.research-actions .primary { background: var(--brand); color: #fff; }
.research-actions .primary:hover { background: var(--brand-strong); }
.research-actions .secondary { background: var(--surface-2); color: var(--ink-2); }
.research-actions .secondary:hover { background: var(--surface-2); }
.research-actions button:disabled { opacity: .55; cursor: not-allowed; }
.research-metrics { display: flex; gap: 8px 22px; flex-wrap: wrap; }
.research-metrics strong { font-size: 18px; margin-right: 4px; font-variant-numeric: tabular-nums; }
.research-metrics span { color: var(--muted); font-size: 11px; }
.gate-applied { color: var(--brand); font-weight: 700; }
.gate-rejected { color: var(--danger); font-weight: 700; }
/* 深度研究的复核复用溯源标注：弱化展示，仅作事实说明 */
.review-reuse-note { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.research-output ul { margin: 4px 0; padding-left: 18px; }
.research-output li { margin: 3px 0; }
.model-usage {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.5;
}

/* ---------- 15. 历史记录侧栏 ---------- */
/* overflow 可见：宽屏「收起/固定」把手需横跨面板左缘（半嵌半出），内部裁切交给列表自身滚动 */
.history-drawer {
  position: sticky;
  top: calc(var(--topbar-h) + 22px);
  height: calc(100vh - var(--topbar-h) - 78px);
  max-height: calc(100vh - var(--topbar-h) - 78px);
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
  overflow: visible;
}
.history-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 16px 11px;
  border-bottom: 1px solid var(--line);
  border-radius: calc(var(--radius-lg) - 1px) calc(var(--radius-lg) - 1px) 0 0;
  background: var(--surface-header);
}
.history-title h2 { margin: 0; font-size: 14.5px; }
.history-tabs {
  position: relative;
  display: flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: 10px;
}
.history-tab-slider {
  position: absolute;
  top: 3px;
  left: 3px;
  height: calc(100% - 6px);
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  border-radius: 8px;
  box-shadow: 0 2px 10px rgba(14, 124, 107, .25);
  transition: left .28s cubic-bezier(.4, 0, .2, 1), width .28s cubic-bezier(.4, 0, .2, 1);
  z-index: 0;
}
.history-title .history-tab {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: auto !important;
  min-width: 64px;
  height: 30px !important;
  padding: 0 12px !important;
  border: none;
  background: transparent;
  border-radius: 7px;
  font-size: 13px;
  color: var(--muted);
  cursor: pointer;
  white-space: nowrap;
  transition: color .22s ease, transform .22s ease;
}
.history-title .history-tab:not(.active):hover {
  color: var(--brand);
  background: var(--brand-soft);
}
.history-title .history-tab.active,
.history-title .history-tab.active:hover {
  background: transparent;
  color: #fff;
  font-weight: 600;
}
.tab-icon { width: 14px; height: 14px; flex-shrink: 0; }
.history-title-actions { display: flex; align-items: center; gap: 4px; }
.history-title button { font-size: 15px; color: var(--muted); width: 28px; height: 28px; border-radius: 6px; transition: transform .3s ease, color .15s, background .15s; display: inline-flex; align-items: center; justify-content: center; }
.history-title button:hover { background: var(--surface-2); color: var(--ink); }
.history-title #clear-history:hover { background: var(--danger-soft); color: var(--danger); }
.history-title button.loading,
.history-title button.loading:hover {
  animation: spin 0.8s linear infinite;
  color: var(--brand);
  cursor: wait;
  background: transparent !important;
}
@keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
#history-list { overflow-y: auto; padding: 4px 8px 10px; flex: 1 1 auto; min-height: 0; }
#history-list:not(:empty) { min-height: 180px; }
#history-list > .muted { margin: 0; padding: 26px 12px; text-align: center; font-size: 12px; }

/* 最近/热门 悬浮唤出开关：默认隐藏，≤1280px 媒体查询或宽屏收起态(.rail-collapsed ~)激活为悬浮椭圆钮。
   收起态为竖直长条胶囊（最近时钟在上、热门火焰在下，中点分隔）；展开后随面板左移、收成圆形右箭头 */
.history-rail-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 50%;
  right: 8px;
  width: 40px;
  height: 78px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(160deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 8px 22px rgba(14, 124, 107, .38), 0 2px 6px rgba(0, 0, 0, .16);
  cursor: pointer;
  z-index: 206;
  transform: translateY(-50%);
  transition: transform .34s cubic-bezier(.4, 0, .2, 1),
              height .34s cubic-bezier(.4, 0, .2, 1),
              box-shadow .2s ease, filter .2s ease;
}
.history-rail-toggle:hover { filter: brightness(1.06); box-shadow: 0 10px 26px rgba(14, 124, 107, .46), 0 2px 6px rgba(0, 0, 0, .16); }
.history-rail-toggle:active { filter: brightness(.96); }
.history-rail-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; }
.history-drawer.rail-open ~ .history-rail-toggle {
  height: 40px;
  transform: translateY(-50%) translateX(calc(-1 * var(--history-rail-w) - 6px));
}
.hrt-layer {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: opacity .18s ease;
}
.hrt-layer--arrow { flex-direction: row; opacity: 0; }
.hrt-icon { width: 17px; height: 17px; flex-shrink: 0; }
.hrt-layer--arrow .hrt-icon { width: 18px; height: 18px; }
.hrt-dot { width: 3px; height: 3px; border-radius: 50%; background: rgba(255, 255, 255, .65); flex-shrink: 0; }
.history-drawer.rail-open ~ .history-rail-toggle .hrt-layer--tab { opacity: 0; }
.history-drawer.rail-open ~ .history-rail-toggle .hrt-layer--arrow { opacity: 1; }
/* 收起态轻微呼吸提示，展开后停止，吸引用户注意右侧入口 */
.history-rail-toggle:not(.is-open) .hrt-layer--tab { animation: hrt-breathe 2.8s ease-in-out infinite; }
@keyframes hrt-breathe { 0%, 100% { opacity: 1; } 50% { opacity: .7; } }

/* 宽屏「收起/固定」切换钮：置于标题栏工具区（清空/刷新右侧），完全复用 .history-title button
   同款样式；固定态=»收起，收起后随面板整体离屏不可见，仅抽屉唤出时呈图钉形态（点击直接恢复常驻）。
   双图标层叠放切换，opacity 过渡供滚动虚化复用 */
.history-title .history-pin-toggle {
  position: relative;
  transition: transform .3s ease, color .15s, background .15s, opacity .25s ease;
}
.history-title .history-pin-toggle:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.hpt-layer {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity .18s ease;
}
.hpt-layer .hrt-icon { width: 15px; height: 15px; }
.hpt-layer--pin { opacity: 0; }
.rail-collapsed .hpt-layer--collapse { opacity: 0; }
.rail-collapsed .hpt-layer--pin { opacity: 1; }
/* 临时抽屉态下图钉淡高亮：提示"当前为临时抽屉，可点此固定为常驻"；固定后即熄灭。
   高亮底色优先级压过工具钮 hover，悬停时以加深图标色作反馈 */
.rail-collapsed .history-drawer.rail-open .history-pin-toggle {
  background: var(--brand-soft);
  color: var(--brand);
}
.rail-collapsed .history-drawer.rail-open .history-pin-toggle:hover {
  color: var(--brand-strong);
}
/* 收起停靠态滚动进行中把把手尽量虚化（is-scroll-dim 由 JS 挂载），悬停/聚焦立即实化 */
.rail-collapsed .history-pin-toggle.is-scroll-dim { opacity: .2; }
.rail-collapsed .history-pin-toggle.is-scroll-dim:hover,
.rail-collapsed .history-pin-toggle.is-scroll-dim:focus-visible { opacity: 1; }
/* 最近分析行：左列两行「标的 / 状态」，右列评分跨两行垂直居中。
   侧栏窄（移动端抽屉约 250px），旧版单行四列会把名称挤没；而单纯拆两行又会让"有没有状态角标"
   改变行高、列表高低不齐 —— 故第二行定 min-height，右列评分独立成数值栏始终保持垂直居中。 */
.history-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-rows: 18px 16px;
  column-gap: 10px; row-gap: 2px;
  align-items: center;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
  transition: background .12s;
}
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: var(--brand-soft); }
/* 「当前查看」选中态：左侧结果正在展示的这只股票，行底给一层极淡中性色（--surface-2）。
   刻意用中性而非品牌色，避免与 hover 的 --brand-soft、"我的"的青色左轨撞色，三者可叠加共存；
   含义由行 tooltip「当前正在查看」说明。选中+悬停时呈青灰混合，仍能感知 hover。
   2026-10-05 精简：不再叠左色条与「当前」角标——底色高亮已足够，信号多反而杂。 */
.history-row--active { background: var(--surface-2); }
.history-row--active:hover { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface-2)); }
/* 第一行：代码（次要/等宽） + 名称（主识别信息），名称超长截断 */
.history-row .history-main { grid-column: 1; grid-row: 1; display: flex; align-items: baseline; gap: 6px; min-width: 0; line-height: 18px; }
.history-row .history-code { flex: none; font-size: 11.5px; font-variant-numeric: tabular-nums; letter-spacing: .01em; color: var(--muted); }
.history-row .history-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-weight: 600; color: var(--ink); }
/* 评分：定宽右对齐并跨两行居中，形成稳定的右侧数值栏（各行是独立 grid，不定宽会随 --/74.6 浮动错位） */
.history-row .history-score { grid-column: 2; grid-row: 1 / span 2; align-self: center; min-width: 34px; text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; font-size: 13px; color: var(--ink-2); }
/* 第二行：状态区。min-height 与 grid 行高一致，保证无角标的行与有角标的行等高 */
.history-row .history-sub { grid-column: 1; grid-row: 2; display: flex; align-items: center; gap: 5px; min-width: 0; min-height: 16px; line-height: 16px; font-size: 10.5px; color: var(--muted); }
.history-row .history-time { flex: none; font-variant-numeric: tabular-nums; }
/* 完成状态：✓前缀纯文字紧跟时间（2026-10-05 由胶囊盒改为纯文字，列表更轻），只用色相区分：品牌青=复核，琥珀金=研究 */
.history-row .history-chip { flex: none; font-size: 10.5px; font-weight: 600; line-height: 16px; }
.history-row .history-chip--review { color: var(--brand); }
.history-row .history-chip--research { color: var(--accent); }

/* 热门分析行：序号 | 代码·名称 | 评分/市场标签 单行三列（沿用旧单行布局） */
.history-row--hot {
  grid-template-columns: 36px minmax(0, 1fr) 60px;
  /* 热门行是「序号 | 代码·名称 | 评分」单行三列，必须退掉两行式的第二条轨道，
     否则底部会多出一条空轨道把行撑高一截（继承了 .history-row 的 grid-template-rows） */
  grid-template-rows: auto;
  row-gap: 0;
  column-gap: 8px;
}
.history-row--hot > * { grid-row: 1; }
.history-row--hot > span:first-child:not(.hot-rank) {
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--brand);
  font-weight: 700;
  font-size: 11px;
}
.history-row--hot .hot-title {
  display: flex;
  align-items: baseline;
  gap: 0;
  min-width: 0;
}
.history-row--hot .hot-title .hot-sep { margin: 0 2px; }
.history-row--hot .hot-title strong {
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--ink);
  flex-shrink: 0;
}
.history-row--hot .hot-title .hot-name {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 0 0 auto;
  min-width: 0;
  text-align: left;
}
.history-row--hot .hot-score {
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
  color: var(--ink-2);
  font-size: 11.5px;
  padding-right: 6px;
}
.history-row--hot .hot-sep {
  color: var(--faint);
  font-weight: 400;
  flex-shrink: 0;
}
/* 市场标签占位评分列：市场种子暂无本平台评分时显示，有评分后自动让位给分数 */
.history-row--hot > .hot-badge {
  justify-self: end;
  align-self: center;
  font-size: 9px;
  line-height: 1.4;
  padding: 1px 6px;
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-right: 6px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid var(--accent-line);
}
.history-row--market > span:first-child { color: var(--accent); }
/* 「我的」归属轨：本人最近分析过的标的，仅在行左缘点一条极细的品牌色竖轨（rail）。
   刻意不用文字徽章/背景色——文字太喧宾，背景又与 hover 的 --brand-soft 撞色；
   一条短竖轨既让当事人一眼认出自己那条，又对旁人几乎无感，含义交给悬停 tooltip。 */
.history-row--hot.history-row--mine { position: relative; }
.history-row--hot.history-row--mine::before {
  content: "";
  position: absolute;
  left: 1px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 55%;
  border-radius: 3px;
  background: var(--brand);
  opacity: .8;
}
/* 热门榜前三名热度徽章：冠军红、亚军橙、季军黄，渐变背景突出热度 */
.history-row--hot .hot-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  margin: auto;
  border-radius: 6px;
  font-weight: 700;
  font-size: 11px;
  color: #fff !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.history-row--hot .hot-rank--1 { background: linear-gradient(135deg, #ef5350, #c62828); }
.history-row--hot .hot-rank--2 { background: linear-gradient(135deg, #ffa726, #e65100); }
.history-row--hot .hot-rank--3 {
  background: linear-gradient(135deg, #fdd835, #f9a825);
  color: #4a3500 !important;
  text-shadow: none;
}



/* ---------- 16. 页脚声明 ---------- */
.disclaimer {
  margin-top: 18px;
  padding: 14px 18px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  display: flex;
  gap: 24px;
  font-size: 11px;
  line-height: 1.65;
}
.disclaimer > div { flex: 1; min-width: 0; }
.disclaimer strong { color: var(--ink-2); white-space: nowrap; display: block; margin-bottom: 4px; }
.disclaimer p { margin: 0; }
.disclaimer .legal-links p { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.disclaimer .legal-links a { color: var(--brand); text-decoration: none; white-space: nowrap; }
.disclaimer .legal-links a:hover { text-decoration: underline; }

/* ---------- 17. 对话框 ---------- */
dialog {
  width: min(540px, calc(100% - 28px));
  max-height: 90vh;
  border: 0;
  padding: 0;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-pop);
  /* 全站弹窗默认保护：超高内容纵向滚动、横向不溢出，长连续字符自动换行，新弹窗无需单独处理 */
  overflow-y: auto;
  overflow-x: hidden;
  overflow-wrap: break-word;
}
/* 关闭态强制隐藏：作者样式表优先级高于 UA，类的 display:flex 会覆盖 UA 的 display:none 导致弹窗泄漏到主页底部。
   此规则 specificity(0,1,1) 高于类选择器(0,1,0)，关闭态(no [open])一律 display:none；打开态不匹配，类布局正常生效。
   新增任何带 display 的 dialog 类无需再单独处理关闭态。 */
/* !important 压过任何 #id { display:flex } 规则，关闭的 dialog 一律隐藏，杜绝泄漏到页面底部 */
dialog:not([open]) { display: none !important; }
dialog::backdrop { background: rgba(8, 24, 20, .55); backdrop-filter: blur(2px); }
dialog[open] { animation: dialog-in .18s ease-out; }
@keyframes dialog-in { from { opacity: 0; transform: translateY(8px) scale(.98); } to { opacity: 1; transform: none; } }

/* ---------- 自定义 alert 弹窗 ---------- */
.app-alert-dialog {
  width: min(400px, calc(100vw - 40px));
  padding: 28px 24px 22px;
  text-align: center;
  border: 0;
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-pop);
}

/* 反馈/联系表单弹窗：标签左对齐 */
.feedback-dialog {
  width: min(460px, calc(100vw - 40px));
  text-align: left;
  padding: 28px 28px 24px;
}
.feedback-dialog h3 {
  text-align: center;
  margin-bottom: 20px;
}
.feedback-dialog form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.form-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
}
.form-label input,
.form-label textarea {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 13.5px;
  line-height: 1.5;
  transition: border-color .15s, background .15s;
}
.form-label input:focus,
.form-label textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
}
.form-label textarea {
  resize: vertical;
  min-height: 90px;
}
.feedback-actions {
  justify-content: flex-end !important;
  gap: 10px;
  margin-top: 4px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.feedback-actions .ghost {
  padding: 9px 20px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
}
.feedback-actions .ghost:hover {
  background: var(--surface-2);
}
.feedback-actions .primary {
  min-width: 0 !important;
  padding: 9px 22px !important;
}
.app-alert-dialog::backdrop { background: rgba(8, 24, 20, .55); backdrop-filter: blur(3px); }
.app-alert-icon {
  width: 52px; height: 52px;
  margin: 0 auto 14px;
  display: grid; place-items: center;
  border-radius: 50%;
  font-size: 24px; font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), #0a6b5c);
  box-shadow: 0 6px 18px rgba(14,124,107,.35);
}

/* 图标已统一为 SVG（js/alert-icons.js）：inline svg 带基线间隙会让 grid 居中出现偏差 */
.app-alert-icon svg { display: block; }
.app-alert-dialog.alert-error .app-alert-icon { background: linear-gradient(135deg, #e05555, #c43d3d); box-shadow: 0 6px 18px rgba(224,85,85,.35); }
.app-alert-dialog.alert-warning .app-alert-icon { background: linear-gradient(135deg, #e8a838, #c98a1e); box-shadow: 0 6px 18px rgba(232,168,56,.35); }
.app-alert-dialog.alert-info .app-alert-icon { background: linear-gradient(135deg, var(--brand), #0a6b5c); box-shadow: 0 6px 18px rgba(14,124,107,.35); }
.app-alert-dialog h3 { margin: 0 0 8px; font-size: 17px; font-weight: 700; }
.app-alert-dialog p { margin: 0 0 20px; font-size: 13.5px; line-height: 1.65; color: var(--ink-2); word-break: break-word; }
.app-alert-actions { display: flex; justify-content: center; }
.app-confirm-dialog .app-alert-actions { gap: 12px; }
.app-confirm-dialog .app-alert-actions .primary,
.app-confirm-dialog .app-alert-actions .secondary {
  min-width: 108px;
  padding: 9px 24px;
}

/* "直接分析"次级操作按钮：与主按钮同字号加粗，品牌色描边突出（取消按钮保持轻量） */
.app-confirm-dialog .app-alert-actions #app-confirm-secondary {
  font-size: 13.5px; font-weight: 700;
  color: var(--brand); border: 1px solid var(--brand); background: transparent;
}
.app-confirm-dialog .app-alert-actions #app-confirm-secondary:hover { background: color-mix(in srgb, var(--brand) 8%, transparent); }
.app-alert-actions .primary {
  min-width: 120px; padding: 10px 28px;
  border-radius: 10px; font-size: 13.5px; font-weight: 700;
  background: var(--brand); color: #fff; border: 0; cursor: pointer;
  transition: background .2s, transform .1s;
}
.app-alert-actions .primary:hover { background: var(--brand-strong); }
.app-alert-actions .primary:active { transform: scale(.97); }
.app-alert-dialog.alert-error .app-alert-actions .primary { background: linear-gradient(135deg, #e05555, #c43d3d); }
.app-alert-dialog.alert-error .app-alert-actions .primary:hover { background: linear-gradient(135deg, #c43d3d, #a82e2e); }
.app-tip-dialog p {
  margin-bottom: 18px;
  line-height: 1.7;
}
.app-tip-dialog .app-alert-icon {
  width: 48px;
  height: 48px;
  font-size: 22px;
  margin-bottom: 16px;
}
.app-tip-dont-show {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 11px 14px;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 12.5px;
  color: var(--ink-2);
  cursor: pointer;
  user-select: none;
  transition: background .15s;
  justify-content: center;
}
.app-tip-dont-show[hidden] { display: none; }
.app-tip-dont-show:hover { background: var(--surface-3); }
.app-tip-dont-show input[type="checkbox"] {
  width: 15px;
  height: 15px;
  accent-color: var(--brand);
  cursor: pointer;
  margin: 0;
}

/* 清理缓存弹窗：复选框列表 */
.clear-cache-dialog {
  width: min(420px, calc(100vw - 40px));
  text-align: left;
}
.clear-cache-dialog .app-alert-icon {
  background: linear-gradient(135deg, #e8a838, #c98a1e);
  box-shadow: 0 6px 18px rgba(232,168,56,.35);
}
.clear-cache-dialog h3 { text-align: center; }
.clear-cache-dialog p {
  text-align: center;
  margin-bottom: 16px;
  font-size: 12.5px;
  color: var(--muted);
}
.clear-cache-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 20px;
}
.clear-cache-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  user-select: none;
  transition: background .15s, border-color .15s;
  border: 1px solid transparent;
}
.clear-cache-item:hover { background: var(--surface-3); }
.clear-cache-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--brand);
  cursor: pointer;
  margin: 2px 0 0;
  flex-shrink: 0;
}
.cci-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}
.cci-text strong { font-weight: 600; color: var(--ink); }
.cci-text small { font-size: 11.5px; color: var(--muted); line-height: 1.4; }
/* 每项实时占用（条数 + 体积），由 messages.js 打开弹窗时填充 */
.cci-size { display: block; margin-top: 3px; font-style: normal; font-size: 11px; color: var(--brand); }
.clear-cache-note { margin: -6px 0 16px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
/* 清理项较多时列表内部滚动，弹窗不超出视口 */
.clear-cache-list { max-height: min(46vh, 380px); overflow-y: auto; padding-right: 2px; scrollbar-width: thin; }
.clear-cache-dialog .app-alert-actions { gap: 12px; }
.clear-cache-dialog .app-alert-actions .primary,
.clear-cache-dialog .app-alert-actions .secondary {
  min-width: 108px;
  padding: 9px 24px;
}

/* 修复 settings-dialog 和 stock-dialog 内容溢出 */
#settings-dialog, #stock-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: 85vh;
  overflow-x: hidden;
  padding: 0;
}
#settings-dialog { overflow-y: auto; }
/* 添加股票弹窗：弹窗自身不滚动，滚动下沉到表单内。
   这样右侧滑出的侧滑页（inset:0 定位）覆盖的永远是"看得见的那块"，
   不必在打开瞬间把弹窗滚回顶部——那次滚动复位正是主表单"跳一下"的来源。 */
#stock-dialog { display: flex; flex-direction: column; overflow: hidden; }
#settings-dialog form, #stock-dialog form {
  padding: 0 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
#stock-dialog form { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; }
#settings-dialog .dialog-head, #stock-dialog .dialog-head {
  margin: 0 -22px 14px;
  padding: 16px 22px 14px;
  flex-shrink: 0;
}
#settings-dialog .dialog-actions, #stock-dialog .dialog-actions {
  margin-top: 18px;
  flex-shrink: 0;
}
/* 大模型配置弹窗：思考参数收进"高级配置"折叠区，折叠区内不再重复外边距 */
#settings-dialog .llm-advanced { margin-top: 18px; }
#settings-dialog .llm-advanced .collapsible-body { padding-top: 10px; }
#settings-dialog .llm-advanced .llm-control-grid { margin-top: 0; }
#settings-dialog .llm-advanced .privacy-note { margin: 10px 0 0; }

/* ---------- 大模型配置指引：设置弹窗内的引导条 + 全屏指引模态 ----------
   「API 地址/模型名/Key 三项到底去哪拿」是配置流程最大的流失点，所以入口放在表单最上方
   （用户还没开始犯难时就看到），模态用 --brand-deep 渐变头部与站点顶栏同一血统，
   而不是 demo 里写死的墨绿——换主题时头部会跟着走。 */
.llm-help-entry {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; margin: 0 0 14px; padding: 10px 12px;
  font: inherit; font-size: 13px; font-weight: 600; text-align: left;
  color: var(--brand-strong); background: var(--brand-soft);
  border: 1px dashed var(--brand-line); border-radius: 10px; cursor: pointer;
}
.llm-help-entry:hover { background: color-mix(in srgb, var(--brand-soft) 88%, var(--ink)); }
.llm-help-entry:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.llm-help-arrow { flex: none; color: var(--brand); font-weight: 700; }

#llm-guide-dialog[open] {
  width: min(720px, calc(100vw - 32px));
  max-height: min(86vh, 780px);
  padding: 0; overflow: hidden;
  display: flex; flex-direction: column;
}
.llm-guide-head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 20px; color: #fff;
  background: linear-gradient(135deg, var(--brand-deep), color-mix(in srgb, var(--brand) 22%, var(--brand-deep-2)));
}
.llm-guide-head h2 { margin: 0; font-size: 16px; }
/* 深色头部里的关闭按钮要跟着反色（.icon-button 默认吃 --ink-2，浅底才看得见） */
.llm-guide-head .icon-button { color: rgba(255, 255, 255, .82); }
.llm-guide-head .icon-button:hover { color: #fff; background: rgba(255, 255, 255, .14); }
/* 头部固定、内容滚动：与 #points-dialog 同一套 flex + min-height:0，否则整窗滚动会把标题顶走 */
.llm-guide-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 18px 20px 22px; }
.llm-guide-step { display: flex; gap: 12px; margin-bottom: 16px; }
.llm-guide-num {
  flex: none; display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 700;
}
.llm-guide-step b { font-size: 13.5px; color: var(--ink); }
.llm-guide-step p { margin: 3px 0 0; font-size: 12.5px; line-height: 1.65; color: var(--muted); }
.llm-guide-code {
  display: inline-block; margin: 0 2px; padding: 2px 8px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--brand-strong);
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px;
}
.llm-guide-recommended h3 { margin: 18px 0 8px; font-size: 14px; color: var(--ink); }
.llm-guide-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.llm-guide-table th, .llm-guide-table td { padding: 9px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.llm-guide-table th { background: var(--surface-3); font-size: 12px; font-weight: 600; color: var(--muted); }
.llm-guide-plat { font-weight: 600; color: var(--ink); }
.llm-guide-plat small { display: block; margin-top: 2px; font-weight: 400; font-size: 11.5px; color: var(--muted); }
.llm-guide-url {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 11.5px; color: var(--muted);
  word-break: break-all;
}
.llm-guide-fill {
  border: 0; border-radius: var(--radius-sm); padding: 5px 10px;
  background: var(--brand); color: #fff; font: inherit; font-size: 12px; cursor: pointer; white-space: nowrap;
}
.llm-guide-fill:hover { background: var(--brand-strong); }
.llm-guide-tip { margin: 10px 0 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
/* 窄屏（含移动端）：地址列换行已经占掉一半宽度，备注与表头先让位，保住「填入」可点 */
@media (max-width: 640px) {
  .llm-guide-table { font-size: 12px; }
  .llm-guide-table th, .llm-guide-table td { padding: 8px 6px; }
  .llm-guide-table th:nth-child(2), .llm-guide-table td:nth-child(2) { display: none; }
  .llm-guide-plat small { display: none; }
}

/* 积分中心弹窗：顶部栏固定，内容区域滚动；加宽到 640px 容纳通栏余额横幅与两列副卡 */
#points-dialog[open] {
  width: min(640px, calc(100vw - 32px));
  min-width: 0;
  max-width: 94vw;
  height: min(700px, 85vh);
  overflow: hidden;
  padding: 0;
  display: flex;
  flex-direction: column;
}
#points-dialog .dialog-head {
  margin: 0;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
#points-dialog .points-body {
  overflow-y: auto;
  overflow-x: hidden;
  padding: 14px 22px 22px;
  flex: 1;
  min-height: 0;
}
#points-dialog .auth-disclaimer {
  margin: 18px 0 0;  /* 与上方流水区拉开间距（基础规则 margin:0 会贴死） */
}
dialog form { padding: 0; margin: 0; }

/* 全局按钮样式 */
button.primary, .primary {
  background: var(--brand);
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
button.primary:hover, .primary:hover { background: var(--brand-strong); }
button.primary:active, .primary:active { transform: scale(0.98); }
button.primary:disabled, .primary:disabled { opacity: 0.55; cursor: wait; transform: none; }
button.secondary, .secondary {
  background: var(--surface-2, #f0f2f1);
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease;
}
button.secondary:hover, .secondary:hover { background: var(--brand-soft); }
/* 通用 danger 按钮(此前只在 admin-table/admin-content-actions 限定容器里有,dialog-actions 里漏了导致透明无边框) */
button.danger, .danger {
  background: #c0392b;
  color: #fff;
  border: 0;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
button.danger:hover, .danger:hover { background: #a93226; }
button.danger:active, .danger:active { transform: scale(0.98); }
.dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-head .icon-button { color: var(--ink-2); }
dialog form > label:not(.toggle-row):not(.holding-fields label):not(.category-switch label):not(.auth-agree):not(.rc-agree) {
  display: block;
  font-weight: 700;
  font-size: 12.5px;
  margin-top: 13px;
  color: var(--ink-2);
}
dialog form > label input {
  display: block; width: 100%;
  height: 42px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface);
  outline: none;
}
dialog form > label input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
dialog form > label input:focus-visible { outline: none; }
dialog form > label select:focus-visible { outline: none; }
.toggle-row { display: flex; justify-content: space-between; align-items: center; }
.toggle-row small { display: block; color: var(--muted); margin-top: 3px; font-size: 11px; font-weight: 400; }
.toggle-row input { width: 18px; height: 18px; accent-color: var(--brand); }
.llm-control-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 15px; }
.llm-control-grid label { min-width: 0; }
.llm-control-grid select {
  display: block; width: 100%;
  height: 42px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  padding: 0 10px;
}
.llm-format-status { margin: 10px 0 0; color: var(--muted); font-size: 11.5px; line-height: 1.6; }
.privacy-note { color: var(--muted); font-size: 11px; line-height: 1.6; }
.settings-message { min-height: 18px; font-size: 12px; color: var(--brand); margin-top: 8px; line-height: 1.5; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.dialog-actions button { padding: 10px 17px; border-radius: 8px; font-weight: 700; font-size: 12.5px; }
.dialog-actions .primary { background: var(--brand); color: #fff; }
.dialog-actions .primary:hover { background: var(--brand-strong); }
.dialog-actions .secondary { background: var(--surface-2); color: var(--ink-2); }
.dialog-actions .secondary:hover { background: var(--surface-2); }
/* 清除配置按钮：服务端未保存个人配置时禁用置灰，悬浮说明由外层承载 */
.llm-clear-wrap { display: inline-flex; }
.llm-clear-wrap:has(#clear-llm:disabled) { cursor: not-allowed; }
#clear-llm:disabled { opacity: .55; }
#clear-llm:disabled:hover { background: var(--surface-2); }
/* 测试连接：API Key 说明下方的紧凑描边按钮、右缘对齐输入框——此前通栏铺满灰底会被读成又
   一个输入框，还和底部主操作「保存配置」抢视觉；白底 + 品牌浅描边（与标签 chip 同语言），
   悬停染浅品牌色，加载态文字左侧嵌旋转指示器 */
#settings-dialog .llm-test-row { display: flex; justify-content: flex-end; margin-top: 12px; }
/* 三项配置不齐时禁用：置灰 + not-allowed，缺项说明由 llm-test-row 的 title 承载 */
#settings-dialog .llm-test-row:has(#test-llm:disabled:not(.loading)) { cursor: not-allowed; }
#settings-dialog .llm-test-row #test-llm {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 96px; height: 32px; padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--brand-line);
  background: var(--surface);
  color: var(--brand);
  font-size: 12px; font-weight: 600;
  transition: background .18s ease, border-color .18s ease, transform .1s ease;
}
#settings-dialog .llm-test-row #test-llm:hover:not(:disabled) { background: var(--brand-soft); border-color: var(--brand); }
#settings-dialog .llm-test-row #test-llm:active:not(:disabled) { transform: scale(.98); }
#settings-dialog .llm-test-row #test-llm:disabled:not(.loading) { opacity: .55; cursor: not-allowed; }
#settings-dialog .llm-test-row #test-llm.loading { cursor: wait; opacity: 1; }
#settings-dialog .llm-test-row #test-llm.loading::before {
  content: "";
  flex-shrink: 0;
  width: 12px; height: 12px; margin-right: 6px;
  border: 2px solid var(--brand-line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: analysis-spin .75s linear infinite;
}
/* 保存门控：Key 留空被拒时输入框红描边（聚焦由 JS 完成），开始输入即清除 */
#settings-dialog form > label input.field-error {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px var(--danger-soft);
}
/* 保存被拒引导去点「测试连接」：脉冲两下把视线引到下一步操作 */
#settings-dialog .llm-test-row #test-llm.attention { animation: llm-test-attention 1.2s ease-in-out 2; }
@keyframes llm-test-attention {
  50% { border-color: var(--danger); color: var(--danger); background: var(--danger-soft); }
}
/* Key 说明是输入框的 caption，收进字段下方；默认 p 外边距会把说明和按钮推得太散 */
#settings-dialog form > .privacy-note { margin: 8px 0 0; }
.category-switch { border: 0; padding: 0; margin: 0 0 12px; }
.category-switch legend { font-weight: 700; margin-bottom: 7px; font-size: 12.5px; color: var(--ink-2); }
.category-switch label { display: inline-flex; margin-right: 6px; }
.category-switch input { position: absolute; opacity: 0; pointer-events: none; }
.category-switch span {
  display: block;
  padding: 8px 14px;
  background: var(--surface-2);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
  font-size: 12px;
  transition: background .12s, border-color .12s, color .12s;
}
.category-switch input:checked + span {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand);
  font-weight: 700;
}
.holding-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.holding-fields label { font-weight: 700; font-size: 12.5px; margin-top: 13px; color: var(--ink-2); }
.holding-fields input {
  display: block; width: 100%;
  height: 42px;
  margin-top: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 0 11px;
  background: var(--surface);
}
#stock-query:disabled { background: var(--surface-2); color: var(--muted); }

/* ---------- 18. 响应式 ---------- */
@media (max-width: 1280px) {
  .page-grid.with-rail { grid-template-columns: minmax(0, 1fr); }
  /* 最近/热门：窄屏不再沉到页底，收成右侧抽屉，由悬浮椭圆钮唤出 */
  .history-drawer {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 10px;
    bottom: 16px;
    width: var(--history-rail-w);
    height: auto;
    max-height: none;
    margin: 0;
    transform: translateX(calc(100% + 20px));
    transition: transform .34s cubic-bezier(.4, 0, .2, 1);
    z-index: 205;
    box-shadow: 0 18px 48px rgba(10, 36, 30, .22);
  }
  .history-drawer.rail-open { transform: translateX(0); }
  #history-list { max-height: none; }
  /* 悬浮椭圆开关：视觉样式已上提至基础规则，此处仅启用；窄屏由胶囊全权负责，宽屏拉手隐藏 */
  .history-rail-toggle { display: flex; }
  /* 特异性须压过基础规则 .history-title button 的 display:inline-flex */
  .history-title .history-pin-toggle { display: none; }
  .query-band { grid-template-columns: 1fr 460px; padding: 36px 34px 36px 38px; }
  .query-copy h1 { font-size: 27px; }
}
/* ---------- 18b. 宽屏收起态（>1280px，由贴边拉手切换） ---------- */
/* 与窄屏抽屉机制完全合流：主栏占满、面板整体平移出屏（拉手随之离屏，不再单独停靠），
   唤出胶囊照常出现（与窄屏同一套交互）；仅抽屉唤出时拉手以图钉形态出现在抽屉左缘供固定 */
@media (min-width: 1281px) {
  .page-grid.with-rail.rail-collapsed { grid-template-columns: minmax(0, 1fr); }
  .rail-collapsed .history-drawer {
    position: fixed;
    top: calc(var(--topbar-h) + 12px);
    right: 10px;
    bottom: 16px;
    width: var(--history-rail-w);
    height: auto;
    max-height: none;
    margin: 0;
    transform: translateX(calc(100% + 20px));
    transition: transform .34s cubic-bezier(.4, 0, .2, 1);
    z-index: 205;
    box-shadow: 0 18px 48px rgba(10, 36, 30, .22);
  }
  /* 唤出胶囊点开 = 窄屏同款抽屉：滑入盖在主栏上，拉手以图钉形态横跨抽屉左缘（点击直接固定） */
  .rail-collapsed .history-drawer.rail-open { transform: translateX(0); }
  /* 宽屏收起态启用唤出胶囊（视觉规则在基础规则，此处只开显示；胶囊是栅格容器的子元素，用后代选择器） */
  .rail-collapsed .history-rail-toggle { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  .history-drawer, .history-rail-toggle, .hrt-layer,
  .history-pin-toggle, .hpt-layer { transition: none !important; }
  .history-rail-toggle .hrt-layer--tab { animation: none !important; }
}
@media (max-width: 1050px) {
  .query-band { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .search-box { max-width: 560px; }
  .dashboard-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .chart-panel { grid-column: span 6; }
  /* 评分面板独占整行：条形评分居左、五维雷达居右，消除半行空白 */
  .score-panel {
    grid-column: span 6;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 180px;
    grid-template-rows: auto auto 1fr auto;
    column-gap: 16px;
    align-items: start;
  }
  .score-panel .panel-head { grid-column: 1 / -1; grid-row: 1; }
  .score-panel .score-total { grid-column: 1; grid-row: 2; }
  .score-panel .score-bars { grid-column: 1; grid-row: 3; }
  .score-panel .env-block { grid-column: 1 / -1; grid-row: 4; }
  .score-panel .score-radar {
    grid-column: 2;
    grid-row: 2 / 4;
    align-self: center;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
    border-left: 1px solid var(--line);
    padding-left: 14px;
  }
  .intent-panel { grid-column: span 3; }
  .points-panel { grid-column: span 3; }
  .strategy-panel { grid-column: span 3; }
  .risk-panel { grid-column: span 3; }
  /* 公开财报独占整行：指标一行四列，消除半行空白 */
  .fundamentals-panel { grid-column: span 6; }
  .fundamental-metrics { grid-template-columns: repeat(4, 1fr); }
  .news-panel { grid-column: span 6; }
  .intelligence-panel, .research-panel, .data-quality-panel, .market-context-panel { grid-column: span 6; }
  .session-panel, .personal-panel { grid-column: span 3; }
  .post-market-panel, .evolution-panel { grid-column: span 3; }
  .ai-panel { grid-column: 1 / -1; }
  .stock-manager, .stock-manager-content { grid-template-columns: 1fr; }
  .managed-row { grid-template-columns: minmax(135px, .8fr) minmax(0, 1.2fr); grid-template-rows: auto auto; }
  .managed-actions { grid-column: 1 / -1; grid-row: 2; justify-content: flex-start; flex-direction: row; padding-top: 9px; border-top: 1px solid var(--line); }
  .managed-secondary-actions, .managed-primary-actions { width: auto; justify-content: flex-start; }
  .screener-head { flex-direction: column; align-items: flex-start; }
  .screener-actions { width: 100%; grid-template-columns: 1fr 1fr; grid-template-rows: auto auto auto; justify-content: stretch; }
  .screener-actions label:has(#include-bj), .screener-actions label:has(#include-star), .screener-actions label:has(#include-chinext), .screener-actions label:has(#exclude-risk), .screener-actions label:has(#min-amount), .screener-actions label:has(#change-min) { grid-column: auto; grid-row: auto; }
  .screener-actions select { grid-column: 1; grid-row: 3; }
  .screener-actions #run-screener { grid-column: 2; grid-row: 3; }
  .screener-run-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-end; width: 100%; }
  .screener-row { grid-template-columns: minmax(120px, .8fr) minmax(120px, .8fr) minmax(200px, 1.6fr) 138px; }
  .session-plan-grid { grid-template-columns: 1fr; }
  .intelligence-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .section-nav { display: none !important; }
  .topbar { padding: 0 12px; }
  .status-pill { display: none; }
  .market-state { font-size: 10.5px; }
  main { padding: 0 10px 40px; }
  .query-band { padding: 26px 18px 22px; border-radius: var(--radius); }
  .query-copy h1 { font-size: 23px; }
  .search-box { padding: 16px 14px 14px; }
  .search-row button { flex-basis: 100px; }
  .summary-strip { gap: 12px; padding: 12px 14px; }
  .summary-card > .readonly-snapshot-banner { padding: 10px 14px; flex-wrap: wrap; }
  .identity { min-width: calc(100% - 120px); }
  .quote { margin-left: 0; }
  .quality { padding-left: 12px; border-left: 0; width: auto; max-width: none; min-width: 0; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .chart-panel, .score-panel, .intent-panel, .points-panel, .strategy-panel, .risk-panel, .session-panel, .personal-panel, .data-quality-panel, .market-context-panel, .fundamentals-panel, .news-panel, .intelligence-panel, .post-market-panel, .evolution-panel, .ai-panel, .research-panel { grid-column: span 1; }
  /* 手机竖屏：评分面板保持"评分居左、雷达居右"，压缩雷达列宽给评分条留空间 */
  .score-panel { grid-template-columns: minmax(0, 1fr) 138px; column-gap: 10px; }
  .score-panel .score-radar { padding-left: 10px; }
  .score-panel .score-radar svg { width: 126px; height: 126px; }
  .score-line { grid-template-columns: 44px 1fr 44px; font-size: 11px; }
  .fundamental-metrics { grid-template-columns: 1fr 1fr; }
  .chart-panel canvas { height: 240px; }
  .news-list { grid-template-columns: 1fr; }
  .conditions { grid-template-columns: 1fr; }
  .panel { padding: 13px 14px 15px; }
  .relationship-form { grid-template-columns: 1fr; }
  .relationship-form button { grid-column: auto; }
  .personal-controls label { flex: 1; min-width: 100px; }
  /* 数字输入框默认宽度(~150px)在窄屏溢出面板，交给 flex 收缩 */
  .personal-controls select, .personal-controls input { width: 100%; min-width: 0; }
  .personal-controls button { width: 100%; }
  .ai-consensus { align-items: flex-start; flex-direction: column; }
  .ai-consensus small { margin-left: 0; }
  .disclaimer { display: block; }
  .disclaimer strong { display: block; margin-bottom: 5px; }
  .managed-row { grid-template-columns: 1fr; grid-template-rows: auto auto auto; gap: 8px 0; padding: 12px; }
  .managed-analysis { padding-top: 8px; border-top: 1px solid var(--line); }
  .managed-actions { grid-column: 1; grid-row: 3; grid-template-rows: none; }
  .managed-secondary-actions, .managed-primary-actions { justify-content: flex-end; }
  .managed-secondary-actions button, .managed-primary-actions button { flex: 0 0 32px; width: 32px; }
  .managed-list { max-height: 260px; }
  .screener-panel { padding: 13px 13px 15px; }
  .screener-actions { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .screener-run-actions { grid-row: auto; justify-content: stretch; }
  .screener-run-actions #run-screener { flex: 1; width: auto; }
  .screener-run-actions #screener-limit { flex: 0 0 88px; }
  .screener-row { grid-template-columns: 1fr 58px; }
  .screener-row-actions { display: flex; width: 58px; flex-direction: column; align-items: stretch; grid-row: 1 / span 3; grid-column: 2; }
  .screener-action-placeholder { display: none; }
  .screener-actions select { width: 100%; }
  /* 小屏展开时圆钮贴合抽屉左缘，避免按钮左缘探出屏幕 */
  .history-rail-toggle { top: 66%; }
  .history-drawer.rail-open ~ .history-rail-toggle {
    transform: translateY(-50%) translateX(calc(-1 * var(--history-rail-w) - 2px));
  }
  /* 最近分析行已是两行式布局（时间在第二行），窄屏无需再隐藏时间列 */
  .llm-control-grid { grid-template-columns: 1fr; gap: 8px; }
  .holding-fields { grid-template-columns: 1fr; }
  .search-options { flex-direction: column; align-items: flex-start; gap: 8px; }
  .ai-status-row { flex-direction: column; }
  .ai-status-row > .primary { height: 40px; }
  .session-plan-grid { grid-template-columns: 1fr; }
}

/* ---------- 19. 通用组件补全 ---------- */
[id^="anchor-"] { scroll-margin-top: 74px; }
button.secondary {
  background: var(--surface-2);
  color: var(--ink-2);
  border-radius: 6px;
  font-weight: 700;
  font-size: 12px;
}
button.secondary:hover { background: var(--surface-2); }
button.secondary:disabled { opacity: .55; cursor: wait; }
.indicator-row .ind .up { color: var(--up); font-weight: 700; }
.indicator-row .ind .down { color: var(--down); font-weight: 700; }
.indicator-row .ind .flat { color: var(--muted); }

/* ---------- 20. 回到顶部按钮 ---------- */
#back-to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .18);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .25s, transform .25s, background .15s;
  z-index: 100;
  pointer-events: none;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#back-to-top:hover { background: var(--brand-dark); }

/* ---------- 21. 顶部下拉抽屉 ---------- */
.drawer-overlay {
  display: none;
}
.drawer {
  position: fixed;
  top: 56px;
  left: 50%;
  width: calc(100% - 48px);
  max-width: 1400px;
  max-height: 68vh;
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  border: 1px solid var(--line);
  border-top: 0;
  border-radius: 0 0 16px 16px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, .18);
  transform: translateX(-50%) translateY(-120%);
  transition: transform .35s cubic-bezier(.4, 0, .2, 1), background .3s ease, box-shadow .3s ease;
  z-index: 201;
  display: flex;
  flex-direction: column-reverse;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.drawer.open {
  transform: translateX(-50%) translateY(0);
}
.drawer.minimized {
  transform: translateX(-50%) translateY(calc(-100% + var(--drawer-header-h, 44px)));
}
.drawer.dragging {
  transition: transform 60ms ease-out, background .2s ease, box-shadow .2s ease;
  opacity: .9;
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  backdrop-filter: blur(12px) saturate(1.15);
  -webkit-backdrop-filter: blur(12px) saturate(1.15);
  box-shadow: 0 24px 64px rgba(0, 0, 0, .28);
}
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 7px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 16px 16px;
  background: color-mix(in srgb, var(--surface) 91%, transparent);
  flex-shrink: 0;
  gap: 12px;
  cursor: pointer;
  user-select: none;
  min-width: 0;
}


.drawer-header-left {
  display: flex;
  align-items: baseline;
  gap: 12px;
  min-width: 0;
  flex: 1;
}
.drawer-header-left .eyebrow { margin: 0; }
.drawer-header-left h3 { margin: 0; font-size: 14px; white-space: nowrap; }

.drawer-header-left p.eyebrow.drawer-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: .02em;
  margin: 0;
}
.drawer-auto-expand-toggle {
  position: relative;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: none; border-radius: 5px;
  color: var(--brand); cursor: pointer;
  padding: 0; margin-left: 18px; margin-right: 0; line-height: 1;
  transition: color .15s, background .15s, opacity .15s;
  opacity: .8;
  flex-shrink: 0;
}
.drawer-auto-expand-toggle svg { display: block; }
.drawer-auto-expand-toggle:hover { background: var(--surface-2); opacity: 1; }
.drawer-auto-expand-toggle.off { color: var(--muted); opacity: .45; }
.drawer-auto-expand-toggle.off::after {
  content: ''; position: absolute; width: 20px; height: 1.5px;
  background: var(--muted); transform: rotate(-45deg); border-radius: 1px;
}


.screener-header-status {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
  flex: 1;
}

.drawer-header > div:first-child {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-width: 0;
}
.drawer-header h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
}
.drawer-header .eyebrow {
  margin: 0;
  font-size: 11px;
  white-space: nowrap;
}
.drawer-close {
  width: 26px;
  height: 26px;
  font-size: 16px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  margin-left: -4px;
}
.drawer-close:hover {
  background: var(--surface-2);
  color: var(--ink);
}

/* 抽屉最小化状态下的展开提示图标 */
.drawer-expand-hint {
  display: none;
  position: absolute;
  bottom: 2px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 14px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  opacity: .6;
  cursor: pointer;
  animation: drawer-hint-bounce 2s ease-in-out infinite;
}
.drawer-expand-hint svg { display: block; }
.drawer.minimized .drawer-expand-hint {
  display: flex;
}
.drawer-header:hover .drawer-expand-hint {
  opacity: 1;
  color: var(--brand);
}
@keyframes drawer-hint-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(-3px); }
}

.drawer-body {
  /* 抽屉不定高（仅 max-height 兜底）：flex-basis 须为 auto，0% 在 Safari 会把内容区塌成 0 */
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 10px 14px 14px;
}
.drawer-subtitle {
  display: block;
  color: var(--muted);
  font-size: 11.5px;
  margin-bottom: 14px;
}
.screener-head .drawer-subtitle {
  margin-bottom: 0;
  margin-right: auto;
  flex-shrink: 0;
  white-space: nowrap;
  color: var(--muted);
  font-size: 11px;
}

.portfolio-header-summary {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 0;
}
.portfolio-guest-hint {
  margin: 0 0 10px;
  padding: 8px 12px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
  background: color-mix(in srgb, var(--brand) 7%, var(--surface));
  border: 1px solid var(--line);
  border-radius: 8px;
}
.stock-guest-note {
  margin: 6px 0 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.portfolio-header-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.header-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
}
.header-checkbox input {
  cursor: pointer;
  accent-color: var(--brand);
}
.header-checkbox:has(input:disabled) {
  opacity: .5;
  cursor: not-allowed;
}
.header-checkbox input:disabled {
  cursor: not-allowed;
}
.header-analyze-btn {
  height: 28px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding: 0 8px;
  border-radius: 6px;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 11.5px;
  border: 0;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
  transition: background .15s;
}
.header-analyze-btn:hover { background: var(--brand-strong); }
.header-analyze-btn:disabled { opacity: .6; cursor: wait; }
.header-analyze-btn.loading { background: var(--brand-strong); }

.screener-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.screener-header-actions select {
  height: 28px;
  padding: 0 6px;
  font-size: 11px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--ink-2);
  cursor: pointer;
}
.screener-header-actions select:focus {
  outline: none;
  border-color: var(--brand);
}
.screener-header-actions .header-analyze-btn {
  height: 28px;
  width: 100px;
  min-width: 100px;
  max-width: 100px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  border: none;
  background: var(--brand);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}
.screener-header-actions .header-analyze-btn:hover {
  filter: brightness(1.1);
}
.screener-header-actions .header-analyze-btn:disabled {
  opacity: .6;
  cursor: wait;
}
.header-batch-progress {
  font-size: 10.5px;
  color: var(--muted);
  white-space: normal;
  min-width: 0;
  max-width: 320px;
  overflow: hidden;
  flex: 0 1 auto;
  line-height: 1.4;
}
.header-batch-progress:empty { display: none; }
.header-batch-progress.batch-progress-warn {
  color: #9a6b00;
  font-weight: 700;
  animation: batch-warn-pulse 1.2s ease-in-out infinite;
}

.drawer-body .stock-manager,
.drawer-body .screener-panel {
  border: 0;
  box-shadow: none;
  padding: 0;
  background: transparent;
}
.drawer-body .managed-head {
  flex-wrap: wrap;
  gap: 8px;
}
.drawer-body .managed-head-actions {
  flex-wrap: wrap;
  gap: 6px;
}


/* ===== 认证与账户 ===== */
.auth-area { display: flex; align-items: center; gap: 8px; }
.auth-login-btn {
  height: 32px; padding: 0 16px; border-radius: 6px; border: 0;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease;
}
.auth-login-btn:hover { background: var(--brand-strong); }
.auth-login-btn:active { transform: scale(0.97); }
.auth-menu-wrap { position: relative; }
.auth-user-btn {
  height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer;
  display: flex; align-items: center; gap: 6px;
}
.auth-user-btn:hover { border-color: var(--brand); color: var(--brand); }
.auth-menu {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 60;
  min-width: 170px; padding: 6px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-pop);
  display: flex; flex-direction: column;
}
.auth-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border: none; background: transparent;
  color: var(--ink); font-size: 13px; border-radius: 8px; cursor: pointer;
  text-align: left; transition: background .15s;
}
.auth-menu-item:hover { background: var(--surface-3); }
.auth-menu-item .sm-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; flex-shrink: 0;
}
.auth-menu-item .sm-icon svg { width: 15px; height: 15px; display: block; }
.auth-menu-divider {
  height: 1px; background: var(--line); margin: 4px 8px;
}
.auth-menu-item:hover { background: var(--brand-soft); color: var(--brand); }

/* 平台默认大模型不可用时的复核/研究友情提示条 */
.llm-platform-tip {
  margin: 0 0 12px; padding: 8px 12px; border-radius: 8px;
  background: rgba(184,134,47,.1); border: 1px solid rgba(184,134,47,.35);
  color: var(--ink-2); font-size: 12px; line-height: 1.6;
}
.llm-platform-tip.hidden { display: none; }

/* 认证弹窗 */
.auth-dialog {
  width: min(480px, calc(100vw - 32px));
  min-width: 0;
  max-width: 92vw;
  padding: 0;
}
.auth-dialog[open] {
  display: flex;
  flex-direction: column;
}
.auth-dialog-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.auth-dialog-brand { display: flex; align-items: center; gap: 12px; }
.auth-dialog-logo { width: 36px; height: 36px; border-radius: 8px; }
.auth-dialog-eyebrow {
  margin: 0; font-size: 11px; color: var(--accent);
  font-weight: 600; letter-spacing: 0.5px; text-transform: uppercase;
}
.auth-dialog-title { margin: 2px 0 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.auth-dialog-close {
  width: 32px; height: 32px; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); font-size: 20px;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1; flex-shrink: 0;
}
.auth-dialog-close:hover { background: var(--surface-2, #f0f2f1); color: var(--ink); }
.auth-dialog-body {
  padding: 20px 24px;
  overflow-y: auto;
  /* 弹窗不定高（仅 max-height 兜底）：flex-basis 必须为 auto——Safari 对 0% 基准按字面取 0，
     内容区会塌成一条缝；Chrome 按内容解析，写 1 1 auto 两边行为一致 */
  flex: 1 1 auto;
  min-height: 0;
}
.auth-dialog-foot {
  padding: 14px 24px 18px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
}

.auth-feature-copy {
  margin: 0 0 16px; padding: 10px 14px; border-radius: 8px;
  background: var(--brand-soft); color: var(--brand); font-size: 12.5px;
  line-height: 1.6; border-left: 3px solid var(--brand);
}

.auth-tabs {
  display: flex; gap: 0; margin-bottom: 20px;
  background: var(--surface-2, #f0f2f1);
  border-radius: 8px; padding: 3px;
}
.auth-tab {
  flex: 1; border: 0; background: transparent; padding: 8px 0;
  font-size: 13.5px; color: var(--muted); cursor: pointer;
  border-radius: 6px; font-weight: 500; transition: all 0.2s ease;
}
.auth-tab.active {
  background: var(--surface); color: var(--brand);
  font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.auth-message {
  height: 18px; overflow: hidden;
  font-size: 12.5px; color: var(--danger);
  text-align: center; line-height: 18px; margin: 0;
}
.auth-message:empty { display: none; }

/* 验证码控件可见时拉近与提示的间距；隐藏/空时保持正常 gap */
.auth-captcha-field:not([hidden]):not(.is-empty) + .auth-message { margin-top: -8px; }
.auth-message:not(:empty) + .auth-submit { margin-top: -8px; }

/* 找回密码表单：错误提示空间常驻（空时占位不隐藏），出现提示时按钮不跳动。
   提示固定 18px 高 + 不做 -8px 拉近，按钮位置恒定 */
#auth-forgot-message:empty { display: block; }
#auth-forgot-message:not(:empty) + .auth-submit { margin-top: 0; }

/* 终态错误（如注册上限）重复点击时的晃动反馈，animationend 移除类以支持反复触发 */
@keyframes auth-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); }
  80% { transform: translateX(3px); }
}
.auth-message.shake { animation: auth-shake 0.4s ease-in-out; }

.auth-view { display: flex; flex-direction: column; gap: 20px; position: relative; }
.auth-view.hidden { display: none; }

.auth-field { display: flex; flex-direction: column; gap: 6px; }
.auth-label {
  font-size: 12.5px; color: var(--ink-2, #444);
  font-weight: 500; display: flex; align-items: center; gap: 4px;
}
.auth-optional { font-size: 11px; color: var(--muted); font-weight: 400; }
.auth-input {
  height: 40px; border: 1px solid var(--line); border-radius: 8px;
  padding: 0 12px; font-size: 13.5px; background: var(--surface); color: var(--ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  width: 100%; box-sizing: border-box;
}
.auth-input::placeholder { color: var(--muted); opacity: 0.7; }
.auth-input:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(14, 124, 107, 0.12);
}
.auth-input-wrap { position: relative; }
.auth-input-wrap .auth-input { padding-right: 42px; }
.auth-password-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; border: 0; background: transparent;
  cursor: pointer; border-radius: 6px; font-size: 15px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.5; transition: opacity 0.15s ease;
}
.auth-password-toggle:hover { opacity: 1; }

.auth-password-strength {
  display: flex; align-items: center; gap: 8px; margin-top: 4px;
}
.auth-strength-bar {
  flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden;
}
.auth-strength-fill {
  height: 100%; width: 0; border-radius: 2px;
  transition: width 0.3s ease, background 0.3s ease;
  background: var(--danger);
}
.auth-strength-fill.weak { background: var(--danger); width: 33%; }
.auth-strength-fill.medium { background: var(--warn); width: 66%; }
.auth-strength-fill.strong { background: var(--down, #0f8a54); width: 100%; }
.auth-strength-text { font-size: 11px; color: var(--muted); white-space: nowrap; min-width: 48px; }

.auth-field-hint {
  margin: 4px 0 0; font-size: 11.5px; color: var(--muted); line-height: 1.5;
}
.auth-field-hint strong { color: var(--accent); font-weight: 600; }

.auth-submit {
  height: 42px; font-size: 14px; width: 100%;
}

.auth-captcha-field { min-height: 0; }
.auth-captcha-field[hidden] { display: none; }
/* Turnstile interaction-only 无感期间：wrap 保持可渲染（挑战需要在其中出现）但移出文档流。
   不能用 display:none（否则交互挑战画在隐藏容器里用户看不到）；
   position:absolute 移出 flex 流，密码框与按钮间保持正常 16px gap；
   visibility:hidden 保持不可见但 Turnstile iframe 仍可渲染、getBoundingClientRect 仍可检测尺寸；
   watcher 检测到大尺寸挑战组件/错误提示时摘除 is-empty，元素回归正常文档流。 */
.auth-captcha-field.is-empty { position: absolute; left: 0; right: 0; visibility: hidden; }
.auth-captcha-container { display: flex; min-height: 0; }

/* 腾讯验证码探测模式：探测开始前给页面已有 body 直属节点打 captcha-baseline 标记，
   探测期间只隐藏"无标记的新增节点"（腾讯 SDK 注入的遮罩/弹窗），页面自身内容保持可见，
   避免把整页隐藏导致模态遮罩后面泛白；深层注入按验证码命名特征兜底隐藏 */
body.tcaptcha-probe > *:not(.captcha-baseline):not(dialog) { display: none !important; }
body.tcaptcha-probe > *:not(dialog) [id*="tcaptcha"],
body.tcaptcha-probe > *:not(dialog) [class*="tcaptcha"],
body.tcaptcha-probe > *:not(dialog) [id*="captcha"],
body.tcaptcha-probe > *:not(dialog) [class*="captcha"],
body.tcaptcha-probe > *:not(dialog) iframe[src*="captcha"],
body.tcaptcha-probe > *:not(dialog) iframe[src*="turing"] { visibility: hidden !important; }

/* Turnstile 加载占位 */
.auth-captcha-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 60px;
  color: var(--muted); font-size: 13px;
  border: 1px dashed var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-3);
}

/* CSS 旋转加载图标 */
.auth-captcha-spinner {
  display: inline-block; width: 16px; height: 16px;
  border: 2px solid var(--line-strong); border-top-color: var(--accent);
  border-radius: 50%; animation: auth-captcha-spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes auth-captcha-spin { to { transform: rotate(360deg); } }

/* 腾讯"点击验证"按钮 */
.auth-captcha-trigger {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 42px;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: var(--surface-3); color: var(--muted);
  font-size: 14px; cursor: pointer; transition: all 0.2s;
}
.auth-captcha-trigger:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.auth-captcha-trigger:disabled { opacity: 0.65; cursor: default; }
.auth-captcha-trigger.auth-captcha-verified {
  border-color: #22c55e; color: #22c55e; background: rgba(34,197,94,0.08);
  cursor: default;
}
.auth-captcha-icon { font-size: 14px; font-weight: 700; }

/* 验证通过后提交按钮上的安全盾牌图标 */
.auth-submit.auth-secured { display: flex; align-items: center; justify-content: center; gap: 6px; }
.auth-seal-icon { display: inline-flex; color: rgba(255,255,255,0.65); }

/* Turnstile 无感验证通过后的内联提示（interaction-only 模式下 widget 不渲染到 DOM） */
.auth-captcha-verified-inline {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  width: 100%; min-height: 52px;
  color: #22c55e; font-size: 13px; font-weight: 500;
  border: 1px solid rgba(34,197,94,0.3); border-radius: var(--radius-sm);
  background: rgba(34,197,94,0.06);
}

/* 腾讯无感模式占位提示 */
.auth-captcha-hint {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 40px;
  color: var(--muted); font-size: 12.5px;
  border: 1px dashed var(--border); border-radius: var(--radius-sm);
  background: transparent;
}

/* 验证码加载失败提示 */
.auth-captcha-error {
  display: flex; align-items: center; justify-content: center;
  width: 100%; min-height: 60px;
  color: var(--danger); font-size: 13px;
  border: 1px solid rgba(192,57,43,0.3); border-radius: var(--radius-sm);
  background: rgba(192,57,43,0.05);
}

/* Turnstile iframe 自适应 */
.auth-captcha-container > div { width: 100% !important; }

.auth-switch-hint {
  margin: 0; text-align: center; font-size: 12.5px; color: var(--muted);
}
.auth-link {
  border: 0; background: transparent; color: var(--brand);
  font-size: 12.5px; font-weight: 500; cursor: pointer; padding: 0;
  text-decoration: none;
}
.auth-link:hover { text-decoration: underline; }
.auth-forgot-fallback {
  margin-top: 12px; padding: 10px 12px; border-radius: 8px;
  background: var(--bg-elev); border: 1px dashed var(--border);
}
.auth-forgot-fallback p { margin: 0 0 4px; font-size: 12.5px; color: var(--muted); line-height: 1.5; }
.auth-forgot-fallback-note { color: var(--text-dim, var(--muted)); }
.auth-forgot-fallback .auth-link { font-size: 12.5px; }

.auth-forgot-link { margin: -6px 0 0; text-align: right; }  /* 底边距归零，与协议行保持表单统一 20px 间距 */
/* 登录表单：错误提示已固定移至提交按钮正上方，忘记密码链接与协议行收紧一档（与验证码/提示的 -8px 收紧口径一致） */
#auth-login-form .auth-forgot-link + .auth-agree { margin-top: -8px; }
.auth-link-btn {
  border: 0; background: transparent; color: var(--brand); font-size: 12.5px;
  font-weight: 600; cursor: pointer; padding: 0 6px; white-space: nowrap;
}
.auth-link-btn:disabled { color: var(--muted); cursor: not-allowed; }

/* 忘记密码：验证码输入框 + 发送按钮同行（按钮为描边样式，冷却倒计时显示在按钮内） */
.auth-code-row { display: flex; gap: 8px; align-items: stretch; }
.auth-code-row .auth-input { flex: 1; min-width: 0; }
.auth-code-send {
  flex: none; height: 40px; padding: 0 14px; border-radius: 8px;
  border: 1px solid var(--brand, #0e7c6b); background: transparent;
  color: var(--brand, #0e7c6b); font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap; transition: background 0.15s ease, color 0.15s ease;
  display: inline-flex; align-items: center; justify-content: center;
}
.auth-code-send:hover:not(:disabled) { background: var(--brand, #0e7c6b); color: #fff; }
.auth-code-send:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-disclaimer {
  margin: 0; font-size: 11px; color: var(--muted); line-height: 1.6; text-align: center;
}
.auth-legal-link { color: var(--brand); text-decoration: none; }
.auth-legal-link:hover { text-decoration: underline; }
.auth-agree {
  display: flex; align-items: center; gap: 6px; margin: 0;
  font-size: 12px; color: var(--muted); line-height: 1.6; cursor: pointer;
  user-select: none; min-width: 0;
}
.auth-agree-check {
  flex-shrink: 0; width: 14px; height: 14px; transform: translateY(-1.5px);
  accent-color: var(--brand); cursor: pointer;
}
.auth-agree span { flex: 1; min-width: 0; }
.auth-agree .auth-legal-link { font-weight: 500; }

/* 游客置灰：仍可点击，用于弹出登录引导 */
.guest-locked { opacity: 0.45; }

/* 弹窗打开时锁定背景滚动 */
body.dialog-open { overflow: hidden; }

/* ===== 积分中心 ===== */
.points-badge {
  height: 32px; padding: 0 12px; border-radius: 16px; border: 0;
  background: linear-gradient(135deg, #b8862f, #d4a84a); color: #fff;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  cursor: pointer; box-shadow: 0 1px 4px rgba(184, 134, 47, 0.4);
  transition: transform 0.2s ease;
}
.points-badge:hover { transform: translateY(-1px); }
.points-dialog { max-width: 94vw; }
/* 概览区去卡片化：只留「通栏余额横幅 + 一行内联统计」（纵向流式）。
   会员状态收进横幅数字旁的小徽章，不再单独占一行卡；到期提示仍独占一行。 */
.points-overview {
  display: flex; flex-direction: column; gap: 10px;
  margin-bottom: 12px;
}
/* 成长等级卡（让原本后台静默的积分等级显性化）：标题+等级徽章+当前权益，
   四档里程碑进度条（节点按门槛比例定位：已达成实心/当前高亮/未达成空心），底部升级提示与规则说明 */
.growth-level-card {
  padding: 12px 14px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 10px;
}
.glc-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.glc-title { font-size: 13px; font-weight: 700; cursor: help; }
.glc-badge {
  display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 12px;
  font-size: 12px; font-weight: 700; color: #fff; letter-spacing: 0.5px;
}
.glc-perk { font-size: 12px; color: var(--muted); margin-left: auto; }
.glc-normal .glc-badge { background: #94a3b8; }
.glc-silver .glc-badge { background: linear-gradient(135deg, #b6c0cc, #8a97a6); }
.glc-gold .glc-badge { background: linear-gradient(135deg, #d4a017, #b8862f); }
.glc-diamond .glc-badge { background: linear-gradient(135deg, #2f7fd0, #1d5fa8); }
/* 46px（原 42px 装不下「等级名 + 分数」两行标签）：溢出后标签下沿挤住升级提示，
   视觉上"升级提示贴着分数"，把高度改成真正包住标签，再配合 .glc-hint 的上下边距配平。 */
.glc-trackbox { position: relative; height: 46px; margin: 2px 8px 0; }
.glc-rail {
  position: absolute; left: 0; right: 0; top: 8px; height: 6px;
  border-radius: 3px; background: var(--line); overflow: hidden;
}
.glc-rail i {
  display: block; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), #d4a017);
  transition: width 0.4s ease;
}
.glc-node {
  position: absolute; top: 11px; transform: translate(-50%, -50%);
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--muted); box-sizing: border-box;
  cursor: default; z-index: 1;
}
.glc-node.passed { border-color: var(--brand); background: var(--brand); }
.glc-node.current {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent);
  background: var(--bg);
}
.glc-node-label {
  position: absolute; top: 12px;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  white-space: nowrap; pointer-events: none;
}
.glc-node.first .glc-node-label { left: 0; transform: none; align-items: flex-start; }
.glc-node.last .glc-node-label { right: 0; left: auto; transform: none; align-items: flex-end; }
.glc-node:not(.first):not(.last) .glc-node-label { left: 50%; transform: translateX(-50%); }
/* 两行标签显式给 line-height：默认 normal 随中文字体浮动（实测可到 1.5），
   标签总高会超出轨道盒并压到升级提示上，这里锁成可预期的整数行高。 */
.glc-node-label b { font-size: 11px; line-height: 1.25; font-weight: 600; color: var(--muted); }
.glc-node-label small { font-size: 10px; line-height: 1.25; color: var(--muted); opacity: 0.8; font-variant-numeric: tabular-nums; }
.glc-node.current .glc-node-label b { color: var(--brand); }
/* 升级提示：与上方里程碑标签拉开、与下方规则说明收紧（原先上挤下松，整块看着偏下坠） */
.glc-hint { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 3px 0 -2px; }
.glc-note { font-size: 11px; color: var(--muted); opacity: 0.85; line-height: 1.5; }
.glc-note a { color: var(--brand); }
/* 成长等级卡底部行：规则说明（左）+「获取更多」官方店铺引导（右，纯文本链接不抢视觉） */
.glc-footer { display: flex; align-items: center; gap: 12px; }
.glc-footer .glc-note { flex: 1; }
.glc-shop-link {
  font-size: 11px; color: var(--brand); text-decoration: none;
  white-space: nowrap; border-bottom: 1px dashed color-mix(in srgb, var(--brand) 45%, transparent);
  padding-bottom: 1px;
}
.glc-shop-link:hover { border-bottom-color: var(--brand); }
.points-stat {
  min-width: 0; padding: 13px 14px; border-radius: var(--radius);
  background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 5px; align-items: flex-start;
  justify-content: center; text-align: left;
}
.points-stat.accent {
  flex-direction: row; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; padding: 15px 16px;
  /* 跟随皮肤：深端渐变（brand-strong→brand-deep）保证白字在全部皮肤可读；
     fallback 兜底自建皮肤缺变量时回落默认深绿 */
  background: linear-gradient(135deg, var(--brand-strong, #0b6356), var(--brand-deep, #102f29)); border: 0;
}
.points-stat-info { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.points-stat.accent .points-stat-info { flex: 1 1 auto; }
.points-value-row { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
/* 会员小徽章：金色半透明胶囊，贴在积分数字旁；完整权益/到期信息走悬浮提示。
   整体是可点链接（跳个人中心「会员中心」）；未开通会员时为中性灰 Free 胶囊（见 .pm-chip-free）。 */
.pm-chip {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 9px; border-radius: 999px; line-height: 1.4;
  background: rgba(212, 168, 74, .16); border: 1px solid rgba(212, 168, 74, .42);
  color: #f0d9a0; font-size: 11px; font-weight: 600; letter-spacing: .3px;
  white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.pm-chip:hover { background: rgba(212, 168, 74, .28); border-color: rgba(212, 168, 74, .68); color: #fff2cf; }
.pm-chip:focus-visible { outline: 2px solid rgba(212, 168, 74, .8); outline-offset: 2px; }
/* 图标槽固定 12×12：cap 高度由文字盒（line-height 1.4）决定，SVG 靠 flex 居中贴齐文字中心；
   用 emoji 时字形基线随平台变，拆 span 也治不住"皇冠与 Pro/Max 底部不齐"。 */
.pm-chip-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 12px; height: 12px; }
.pm-chip-icon svg { display: block; width: 12px; height: 12px; }
/* 未开通会员：中性灰胶囊（与「普通用户」等级徽章同色系），整体灰调不抢金色积分数字 */
.pm-chip-free {
  background: rgba(148, 163, 184, .18); border-color: rgba(148, 163, 184, .45);
  color: #cbd5e1; letter-spacing: .4px;
}
.pm-chip-free:hover { background: rgba(148, 163, 184, .3); border-color: rgba(148, 163, 184, .7); color: #e6edf5; }
.pm-chip-free:focus-visible { outline-color: rgba(148, 163, 184, .9); }
/* 内联统计行：无卡片盒子，仅「标签 值」对 + 分隔点（横幅内暗底用白色系弱化） */
.points-meta-row {
  display: flex; align-items: baseline; flex-wrap: wrap;
  gap: 6px 22px; padding: 0 4px;
}
.pm-item { display: inline-flex; align-items: baseline; gap: 7px; }
.pm-label { font-size: 12px; color: var(--muted); }
.pm-value { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); }
.pm-item + .pm-item::before {
  content: "·"; margin-right: 18px; color: var(--muted); font-weight: 700;
}
.points-stat.accent .pm-label { color: rgba(255, 255, 255, .62); }
.points-stat.accent .pm-value { color: #fff; }
.points-stat.accent .pm-item + .pm-item::before { color: rgba(255, 255, 255, .45); }
.points-stat.accent .points-stat-value { color: #d4a84a; font-size: 24px; }
/* 横幅右侧动作区：签到按钮 +（弹窗内）兑换更多，竖直居中随横幅换行 */
.points-stat-actions {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  flex: 0 0 auto; align-self: center;
}
/* 横幅内的签到按钮：金色实心胶囊（深绿底上的主行动点），与积分数字同色系 */
.points-stat.accent .checkin-tip-wrap .primary {
  padding: 8px 18px; border-radius: 999px; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #f0d9a0, #d4a84a); color: #102f29;
  font-family: inherit; font-weight: 700; font-size: 13px; white-space: nowrap;
  transition: filter .15s ease, transform .1s ease;
}
.points-stat.accent .checkin-tip-wrap .primary:hover:not(:disabled) { filter: brightness(1.07); }
.points-stat.accent .checkin-tip-wrap .primary:active:not(:disabled) { transform: scale(.97); }
.points-stat.accent .checkin-tip-wrap .primary:disabled { opacity: .55; cursor: not-allowed; }
.points-stat-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.points-stat.accent .points-stat-label { color: rgba(255, 255, 255, 0.75); }
.points-stat-value {
  font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums;
  max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* 会员状态 / 积分到期提示：不再参与网格列分配（概览区已改纵向流式） */
.points-expiry-hint {
  padding: 8px 12px; border-radius: 8px; font-size: 11.5px; line-height: 1.5;
  background: rgba(212, 168, 74, .12); border: 1px solid rgba(212, 168, 74, .32);
  color: var(--ink-2);
}
@media (max-width: 480px) {
  .points-stat { padding: 11px 10px; }
  .points-stat.accent { padding: 13px 12px; }
  .points-stat-value { font-size: 17px; }
  .points-stat.accent .points-stat-value { font-size: 19px; }
}
/* 设备互斥：禁用态签到按钮的悬浮提示（disabled 按钮本身不接收事件，由外层 wrapper 承载 hover） */
.checkin-tip-wrap { position: relative; display: inline-block; }
.checkin-tip-wrap.blocked .primary[disabled] { cursor: not-allowed; opacity: .55; }
.checkin-tip-wrap.blocked::after {
  content: attr(data-tip);
  position: absolute; left: 50%; bottom: calc(100% + 8px); transform: translateX(-50%);
  width: max-content; max-width: 240px; padding: 7px 10px; border-radius: 8px;
  background: rgba(20, 24, 28, .94); color: #fff; font-size: 12px; line-height: 1.5;
  white-space: normal; text-align: center; pointer-events: none; opacity: 0; transition: opacity .15s;
  z-index: 20; box-shadow: 0 4px 16px rgba(0, 0, 0, .18);
}
.checkin-tip-wrap.blocked::before {
  content: ""; position: absolute; left: 50%; bottom: calc(100% + 2px); transform: translateX(-50%);
  border: 6px solid transparent; border-top-color: rgba(20, 24, 28, .94);
  pointer-events: none; opacity: 0; transition: opacity .15s; z-index: 20;
}
.checkin-tip-wrap.blocked:hover::after, .checkin-tip-wrap.blocked:hover::before,
.checkin-tip-wrap.blocked:focus-within::after, .checkin-tip-wrap.blocked:focus-within::before { opacity: 1; }
.points-reset-hint { display: block; color: var(--warn); font-size: 12px; margin: 0 0 6px; }
.points-usage-pending { color: var(--warn); font-weight: 600; font-size: 12px; }
.points-tasks.pending { opacity: .68; }
.points-tasks.pending .points-task-claim { pointer-events: none; }
.points-section { margin-top: 14px; }
.points-section h3 { font-size: 14px; margin: 0 0 8px; }
/* 邀请好友赚积分：独立强调卡（淡品牌渐变底），与上方流水区拉开视觉层次；
   配色与个人中心「我的邀请」页的 invite-code-card 同款设计语言 */
.points-section-invite {
  margin-top: 20px; padding: 14px 14px 12px;
  border: 1px solid var(--brand-line, rgba(14, 124, 107, .28));
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(14, 124, 107, .07), rgba(14, 124, 107, .015));
}
.points-section-invite h3 { margin: 0 0 10px; }
.points-free-usage { display: flex; flex-direction: column; gap: 6px; }
.points-usage-row { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 8px; border-radius: 6px; background: var(--bg); }
.points-transactions { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.points-tx-row {
  display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center;
  padding: 6px 8px; border-radius: 6px; font-size: 13px;
}
.points-tx-row:nth-child(odd) { background: var(--bg); }
.points-tx-type { font-weight: 600; }
.points-tx-amount.gain { color: #0f8a54; }
.points-tx-amount.spend { color: #d4403a; }

.points-invite-code {
  font-size: 18px; letter-spacing: 2px; color: var(--accent); cursor: pointer;
  font-variant-numeric: tabular-nums;
}

/* ===== 余额/会员/卡券（嵌入积分中心 + 独立弹窗） ===== */
/* 签到操作行：主站弹窗保留原形态（个人中心已把按钮收进横幅动作区） */
.points-action-row {
  display: flex; align-items: center; justify-content: center; gap: 14px;
  flex-wrap: wrap; margin-bottom: 10px;
}
/* 签到结果提示与上方居中的签到按钮同轴：基础规则 text-align:left 会让单行提示偏在左侧，看着不协调。
   只作用于弹窗（个人中心版式把签到按钮收在横幅右侧、页面整体左对齐）。 */
#points-dialog #points-message { text-align: center; }
.points-more-link {
  flex: none; font-size: 12.5px; font-weight: 600; color: var(--brand);
  text-decoration: none; padding: 4px 2px; border-radius: 6px;
  transition: color .15s ease, background .15s ease;
}
.points-more-link:hover { color: var(--brand-strong); background: var(--brand-soft); text-decoration: underline; }
.points-more-link:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
/* 余额横幅（深绿渐变底）内的「兑换更多」：金色系胶囊按钮，与金色积分数字同语言 */
.points-stat.accent .points-more-link {
  flex: none; color: #e9cd8a; font-size: 12px;
  padding: 5px 13px; border: 1px solid rgba(233, 205, 138, .42); border-radius: 999px;
}
.points-stat.accent .points-more-link:hover {
  color: #f4e0a8; background: rgba(255, 255, 255, .08); text-decoration: none;
}

/* 积分兑换券（兑换码）入口与兑换记录 */
.points-voucher-area { margin-bottom: 12px; }
.points-voucher-box {
  display: flex; flex-direction: column; gap: 8px;
  border: 1px dashed var(--border); border-radius: var(--radius);
  padding: 10px 12px; background: var(--bg);
}
.points-voucher-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.points-voucher-records { font-size: 12px; padding: 3px 10px; }
.points-voucher-row { display: flex; gap: 8px; }
.points-voucher-input {
  flex: 1; min-width: 0; padding: 8px 10px; border: 1px solid var(--line);
  border-radius: var(--radius-sm, 8px); font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; letter-spacing: 0.5px; text-transform: uppercase;
}
.points-voucher-message { margin: 0; font-size: 12px; min-height: 1em; }
.points-voucher-message.error { color: var(--danger, #e74c3c); font-weight: 600; font-size: 13px; }
.voucher-record-card {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-radius: var(--radius); padding: 12px; margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--line);
}
.voucher-record-code {
  font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; letter-spacing: 0.5px;
}
.voucher-record-info { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.voucher-record-points { color: var(--up, #d63a3a); font-weight: 700; }
@media (max-width: 480px) {
  .points-voucher-row { flex-direction: column; }
  .points-voucher-row .primary { width: 100%; }
}

/* 会员中心弹窗 */
.membership-dialog, .coupons-dialog, .recharge-dialog {
  width: min(560px, calc(100vw - 32px)); min-width: 0;
  max-width: calc(100vw - 32px); max-height: 90vh;
  padding: 0; border: 0; border-radius: 12px;
  box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column;
}
.membership-dialog .dialog-head,
.coupons-dialog .dialog-head,
.recharge-dialog .dialog-head,
.my-contributions-dialog .dialog-head,
.insights-dialog .dialog-head {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: 18px 22px 14px; margin: 0;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.membership-body, .coupons-body, .recharge-body {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: 14px 22px 22px; flex: 1 1 auto; min-height: 0;
  overflow-y: auto; overflow-x: hidden;
}
/* 余额充值弹窗（在线支付 / 人工转账 / 充值记录） */
.recharge-dialog { width: min(600px, calc(100vw - 32px)); }
.recharge-body { display: flex; flex-direction: column; gap: 14px; }

/* 顶部余额 hero（深墨绿渐变 + 金字点缀） */
.rc-hero {
  position: relative; overflow: hidden;
  border-radius: 14px; padding: 18px 20px;
  background: linear-gradient(135deg, var(--brand-strong, #0b6356) 0%, var(--brand-deep, #102f29) 100%);
  color: #fff;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: 0 10px 26px rgba(16,47,41,.22);
}
.rc-hero::after {
  content: ""; position: absolute; right: -34px; top: -34px;
  width: 120px; height: 120px; border-radius: 50%;
  background: radial-gradient(circle, rgba(184,134,47,.35), rgba(184,134,47,0) 70%);
}
.rc-hero-label { font-size: 12px; color: rgba(255,255,255,.72); letter-spacing: .04em; }
.rc-hero-balance { font-size: 30px; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.rc-hero-sub { font-size: 11.5px; color: rgba(255,255,255,.66); }

/* 充值 / 记录 分段标签 */
.rc-tabs {
  display: inline-flex; gap: 2px; align-self: center;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 3px; width: fit-content;
}
.rc-tab {
  border: 0; background: transparent; cursor: pointer;
  padding: 7px 22px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--muted);
  transition: background .18s, color .18s, box-shadow .18s;
}
.rc-tab:hover { color: var(--ink); }
.rc-tab.active { background: var(--surface); color: var(--brand); box-shadow: 0 1px 4px rgba(16,47,41,.12); }

.rc-form { display: flex; flex-direction: column; gap: 10px; }
.rc-section-label { margin: 6px 0 0; font-size: 12px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.rc-field-hint { margin: 0; font-size: 11.5px; }
.rc-off { text-align: center; padding: 28px 0; }

/* 金额档位 */
.rc-amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rc-amount-chip {
  padding: 13px 0; border-radius: 10px; cursor: pointer;
  border: 1.5px solid var(--line); background: var(--surface);
  font-size: 16px; font-weight: 700; color: var(--ink);
  transition: border-color .15s, background .15s, transform .1s, box-shadow .15s;
}
.rc-amount-chip:hover { border-color: var(--brand-line); background: var(--brand-soft); }
.rc-amount-chip.active {
  border-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong);
  box-shadow: 0 2px 10px rgba(14,124,107,.14);
}
.rc-amount-chip:active { transform: scale(.97); }
.rc-amount-custom-wrap {
  display: flex; align-items: center; gap: 8px;
  border: 1.5px solid var(--line); border-radius: 10px;
  padding: 0 14px; background: var(--surface);
  transition: border-color .15s, box-shadow .15s;
}
.rc-amount-custom-wrap:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(14,124,107,.12); }
.rc-amount-prefix { font-size: 16px; font-weight: 700; color: var(--muted); }
.rc-amount-custom {
  flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
  padding: 12px 0; font-size: 16px; font-weight: 700; color: var(--ink);
  -moz-appearance: textfield; appearance: textfield;
}
.rc-amount-custom::-webkit-outer-spin-button,
.rc-amount-custom::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 渠道卡片单选 */
.rc-method-list { display: flex; flex-direction: column; gap: 10px; }
.rc-method {
  display: flex; align-items: center; gap: 12px;
  border: 1.5px solid var(--line); border-radius: 12px;
  padding: 13px 14px; cursor: pointer; background: var(--surface);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.rc-method:hover { border-color: var(--brand-line); }
.rc-method.active { border-color: var(--brand); background: var(--brand-soft); box-shadow: 0 2px 10px rgba(14,124,107,.1); }
.rc-method input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.rc-method input:focus-visible + .rc-method-icon { outline: 2px solid var(--brand); outline-offset: 2px; }
.rc-method-icon {
  flex-shrink: 0; width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  color: #fff; font-size: 17px; font-weight: 800;
}
.rc-method-wechat .rc-method-icon { background: linear-gradient(135deg, #14c06b, #07a050); }
.rc-method-alipay .rc-method-icon { background: linear-gradient(135deg, #2f8fff, #1677d2); }
.rc-method-manual .rc-method-icon { background: linear-gradient(135deg, #d3a049, var(--accent)); }
.rc-method-mock .rc-method-icon,
.rc-method-online .rc-method-icon { background: linear-gradient(135deg, #5f756e, #3f544d); }
.rc-method-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rc-method-text strong { font-size: 14px; color: var(--ink); }
.rc-method-text small { font-size: 12px; line-height: 1.5; }
.rc-method.active .rc-method-text strong { color: var(--brand-strong); }
.rc-method-manual.active { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 2px 10px rgba(184,134,47,.14); }
.rc-method-manual.active .rc-method-text strong { color: var(--accent); }

/* 充值协议确认 */
.rc-agree {
  display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 4px;
  font-size: 12px; color: var(--muted); line-height: 1.6; cursor: pointer;
  user-select: none;
}
.rc-agree-check {
  margin-top: 2px; flex-shrink: 0; width: 14px; height: 14px;
  accent-color: var(--brand); cursor: pointer;
}
.rc-agree span { flex: 1; }
.rc-agree .auth-legal-link { font-weight: 500; }

/* 提交按钮 */
.rc-submit {
  margin-top: 4px; width: 100%;
  padding: 14px 0; border: 0; border-radius: 12px; cursor: pointer;
  font-size: 15px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 8px 20px rgba(14,124,107,.25);
  transition: transform .1s, box-shadow .15s, filter .15s;
}
.rc-submit:hover { filter: brightness(1.05); box-shadow: 0 10px 24px rgba(14,124,107,.3); }
.rc-submit:active { transform: scale(.985); }
.rc-submit:disabled { opacity: .55; cursor: not-allowed; }
.rc-submit-manual {
  background: linear-gradient(135deg, #d3a049, var(--accent));
  box-shadow: 0 8px 20px rgba(184,134,47,.28);
}
.rc-submit-manual:hover { box-shadow: 0 10px 24px rgba(184,134,47,.32); }

/* 结果视图 */
.rc-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 8px 2px 4px; }
.rc-result h3 { margin: 4px 0 0; font-size: 18px; color: var(--ink); }
.rc-result > .muted { margin: 0; max-width: 440px; line-height: 1.7; }
.rc-result-icon {
  width: 62px; height: 62px; border-radius: 50%;
  display: grid; place-items: center;
  font-size: 28px; font-weight: 800; color: #fff;
}
.rc-result-icon-manual { background: linear-gradient(135deg, #d3a049, var(--accent)); box-shadow: 0 8px 22px rgba(184,134,47,.32); }
.rc-result-icon-ok { background: linear-gradient(135deg, #14c06b, #07a050); box-shadow: 0 8px 22px rgba(7,160,80,.3); }
.rc-result-icon-bad { background: linear-gradient(135deg, #e05555, #c43d3d); box-shadow: 0 8px 22px rgba(196,57,61,.3); }

.rc-trade-card {
  width: 100%; box-sizing: border-box;
  background: var(--bg); border: 1px dashed var(--line-strong); border-radius: 12px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 10px;
}
.rc-trade-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.rc-trade-row { display: flex; align-items: center; gap: 10px; justify-content: space-between; flex-wrap: wrap; }
.rc-trade-no {
  font-size: 18px; font-weight: 700; letter-spacing: .06em;
  color: var(--brand-strong); font-variant-numeric: tabular-nums;
  user-select: all; overflow-wrap: anywhere;
}
.rc-copy-btn { padding: 8px 16px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.rc-copy-btn.rc-copy-failed { color: var(--danger); border-color: rgba(192,57,43,.4); }

.rc-result-amount { display: flex; gap: 10px; align-items: baseline; font-size: 14px; }
.rc-result-amount strong { font-size: 20px; color: var(--ink); }
.rc-contact, .rc-instructions {
  width: 100%; box-sizing: border-box; text-align: left;
  background: var(--accent-soft); border: 1px solid var(--accent-line);
  border-radius: 10px; padding: 11px 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.rc-contact { flex-direction: row; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.rc-contact-label { font-size: 12px; font-weight: 700; color: var(--accent); flex-shrink: 0; }
.rc-contact-value { font-size: 13.5px; font-weight: 600; color: var(--ink); text-align: right; overflow-wrap: anywhere; }
.rc-instructions p { margin: 0; font-size: 13px; line-height: 1.75; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.rc-contact-empty, .rc-pending-hint { font-size: 12.5px !important; }
.rc-result-actions { display: flex; gap: 10px; margin-top: 6px; flex-wrap: wrap; justify-content: center; }
.rc-result-actions button { padding: 10px 24px; border-radius: 10px; font-size: 13.5px; font-weight: 700; cursor: pointer; }

/* 在线支付等待 */
.rc-pay { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; padding: 6px 0 2px; }
.rc-pay-title { margin: 0; font-size: 22px; font-weight: 800; color: var(--ink); }
.rc-pay .muted { margin: 0; line-height: 1.6; }
.rc-qr { width: 216px; height: 216px; border-radius: 10px; border: 1px solid var(--line); image-rendering: pixelated; }
.rc-qr-link { font-size: 12px; overflow-wrap: anywhere; max-width: 100%; }
.rc-pay-link-btn {
  display: inline-block; padding: 12px 30px; border-radius: 10px;
  text-decoration: none; color: #fff; font-size: 14px; font-weight: 700;
  background: linear-gradient(135deg, var(--brand), var(--brand-strong));
  box-shadow: 0 8px 20px rgba(14,124,107,.25);
}
.rc-pay-link-btn:hover { filter: brightness(1.05); }
.rc-status-line { min-height: 20px; }
.rc-pay-back { padding: 8px 22px; border-radius: 8px; font-size: 13px; cursor: pointer; }

/* 充值记录 */
.rc-records { display: flex; flex-direction: column; gap: 10px; }
.rc-empty {
  text-align: center; color: var(--muted); font-size: 13px;
  border: 1px dashed var(--line-strong); border-radius: 12px; padding: 34px 0;
}
.rc-record {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 13px 15px; background: var(--surface);
  display: flex; flex-direction: column; gap: 7px;
  transition: box-shadow .15s;
}
.rc-record:hover { box-shadow: var(--shadow-card); }
.rc-record-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rc-record-titles { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.rc-record-amount { font-size: 17px; font-weight: 800; color: var(--ink); font-variant-numeric: tabular-nums; }
.rc-record-no { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rc-record-time { font-size: 11.5px; }
.rc-record-tip {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border-radius: 8px; padding: 8px 11px; font-size: 12px; line-height: 1.5; flex-wrap: wrap;
}
.rc-record-tip-manual { background: var(--accent-soft); color: #7a5a1f; border: 1px solid var(--accent-line); }
.rc-record-tip-reject { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(192,57,43,.2); }
.rc-mini-copy { padding: 5px 12px; border-radius: 7px; font-size: 12px; font-weight: 600; cursor: pointer; flex-shrink: 0; }
.rc-mini-copy.rc-copy-failed { color: var(--danger); }
.rc-record-foot { display: flex; justify-content: flex-end; }
.rc-mini-pay { padding: 7px 18px; border-radius: 8px; font-size: 12.5px; font-weight: 700; cursor: pointer; }

/* 徽章（与运营后台风格一致） */
.rc-badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 700; background: #eef1f4; color: #46505c;
}
.rc-badge-wechat { background: rgba(7,193,96,.12); color: #07a055; }
.rc-badge-alipay { background: rgba(22,119,255,.12); color: #1677d2; }
.rc-badge-manual { background: rgba(184,134,47,.16); color: var(--accent); }
.rc-badge-mock, .rc-badge-online { background: rgba(14,124,107,.12); color: var(--brand); }
.rc-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; flex-shrink: 0; }
.rc-st-pending { background: #fff5e0; color: #ad6800; border: 1px solid #ffe1a8; }
.rc-st-paid { background: rgba(7,193,96,.12); color: #07a055; }
.rc-st-cancel { background: rgba(192,57,43,.1); color: var(--danger); }

@media (max-width: 640px) {
  .recharge-body { padding: 12px 14px 18px; }
  .rc-hero-balance { font-size: 26px; }
  .rc-amount-grid { gap: 8px; }
  .rc-amount-chip { padding: 11px 0; font-size: 15px; }
  .rc-method { padding: 11px 12px; }
  .rc-method-text small { font-size: 11.5px; }
  .rc-result-actions { width: 100%; }
  .rc-result-actions button { flex: 1; }
  .rc-trade-row { justify-content: center; text-align: center; }
}
.membership-plans, .membership-plan-card, .coupon-card, .coupon-info { min-width: 0; }
.membership-plan-name, .coupon-info strong, .coupon-info small { overflow-wrap: anywhere; }
/* 当前状态横幅：渐变底 + 左对齐主信息（套餐/到期/权益摘要一行说清） */
.membership-status-card {
  padding: 18px 20px; border-radius: 14px; margin-bottom: 14px;
  background: linear-gradient(135deg, var(--brand-strong, #0b6356), var(--brand-deep, #102f29)); color: #fff;
  box-shadow: 0 10px 26px rgba(16,47,41,.22);
}
.membership-status-main { display: flex; flex-direction: column; gap: 6px; }
.membership-status-title { display: flex; align-items: center; gap: 10px; }
.membership-status-title strong { font-size: 19px; letter-spacing: .02em; }
.membership-status-sub { color: rgba(255, 255, 255, 0.78) !important; font-size: 12.5px; }
.membership-badge {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: rgba(212, 168, 74, 0.25); color: #d4a84a;
  font-size: 12px; font-weight: 600;
}
/* 套餐卡片：宽屏双列，卡内上下分区（头部/周期选择/购买按钮/权益），间距放开 */
.membership-plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 14px; }
.membership-plan-card {
  padding: 18px 18px 16px; border-radius: 14px;
  background: var(--bg); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 14px; position: relative;
  transition: border-color .15s, box-shadow .15s;
}
.membership-plan-card:hover { border-color: var(--brand-line); box-shadow: 0 6px 18px rgba(16,47,41,.08); }
.membership-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.membership-plan-namecol { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.membership-plan-name { font-weight: 700; font-size: 17px; padding-right: 0; }
.membership-plan-tagline { font-size: 12px; }
.membership-plan-badge {
  flex: 0 0 auto; padding: 3px 10px; border-radius: 999px; font-size: 11px;
  background: var(--accent); color: #fff; font-weight: 600;
}
/* 周期分段选择器：月/季/年三档，选中高亮 */
.membership-plan-seg {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 12px; padding: 4px;
}
.membership-seg-btn {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 4px; border: 1.5px solid transparent; border-radius: 9px;
  background: transparent; cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.membership-seg-btn:hover { background: var(--brand-soft); }
.membership-seg-btn.active {
  background: var(--surface); border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(14,124,107,.14);
}
.membership-seg-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.membership-seg-btn.active .membership-seg-label { color: var(--brand-strong); }
.membership-seg-price { font-size: 15px; color: var(--ink); font-variant-numeric: tabular-nums; }
.membership-plan-buy { width: 100%; box-sizing: border-box; padding: 11px 0; font-size: 14px; }
.membership-plan-benefits {
  margin: 0; padding: 12px 14px 2px 14px; list-style: none;
  border-top: 1px dashed var(--line);
  display: flex; flex-direction: column; gap: 8px;
  font-size: 12.5px; color: var(--muted);
}
.membership-plan-benefits li { padding-left: 16px; position: relative; line-height: 1.55; }
.membership-plan-benefits li::before { content: "·"; position: absolute; left: 4px; color: var(--brand); font-weight: 700; }
.membership-hint { margin-top: 14px; text-align: center; font-size: 12px; }

/* 卡券列表 */
.coupon-card {
  display: flex; align-items: center; gap: 12px;
  padding: 12px; border-radius: var(--radius); margin-bottom: 8px;
  background: var(--bg); border: 1px solid var(--line);
}
.coupon-card.coupon-used, .coupon-card.coupon-expired { opacity: 0.55; }
.coupon-face {
  min-width: 64px; height: 64px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #b8862f, #96681e); color: #fff;
  font-size: 18px; font-weight: 700;
}
.coupon-info { flex: 1; display: flex; flex-direction: column; gap: 4px; }
.coupon-status { align-self: flex-start; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.coupon-status-unused { background: rgba(15, 138, 84, 0.15); color: #0f8a54; }
.coupon-status-used { background: var(--surface-2); color: var(--muted); }
.coupon-status-expired { background: rgba(212, 64, 58, 0.15); color: #d4403a; }


/* ===== 设置菜单 ===== */
.settings-menu-wrap { position: relative; }
.settings-menu {
  position: absolute; top: calc(100% + 8px); right: 0;
  min-width: 180px; padding: 6px;
  background: var(--pop-bg); border: 1px solid var(--line);
  border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,.15);
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all .18s ease; z-index: 1000;
  color: var(--pop-ink);
}
.settings-menu.open { opacity: 1; visibility: visible; transform: translateY(0); }
.settings-menu-item {
  display: flex; align-items: center; gap: 10px;
  width: 100%; padding: 9px 12px; border: none; background: transparent;
  color: var(--ink); font-size: 13px; border-radius: 8px; cursor: pointer;
  text-align: left; transition: background .15s;
}
.settings-menu-item:hover { background: var(--surface-3); }
.sm-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; flex-shrink: 0; }
.sm-icon svg { width: 15px; height: 15px; display: block; }
.settings-menu-divider { height: 1px; background: var(--line); margin: 4px 8px; }

/* ===== 消息通知 ===== */
.message-btn { position: relative; }
.message-badge {
  position: absolute; top: 2px; right: 2px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--danger, #d4403a); color: #fff;
  font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
  border-radius: 8px; pointer-events: none;
}
.message-badge.hidden { display: none; }

.messages-dialog {
  width: min(720px, 92vw); max-width: 720px;
  padding: 0; border: none; border-radius: 16px;
  background: var(--pop-bg); color: var(--pop-ink);
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
}
.messages-list { background: transparent; }
.messages-detail { background: transparent; }
.message-item:hover { background: var(--surface-3); }
.messages-dialog::backdrop { background: rgba(0,0,0,.45); backdrop-filter: blur(4px); }

/* 消息空状态美化 */
.messages-list-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 280px;
}
.messages-list-empty-state {
  text-align: center;
  padding: 20px;
}
.messages-list-empty-icon {
  font-size: 32px;
  margin-bottom: 10px;
  opacity: 0.5;
}
.messages-list-empty-text {
  font-size: 13px;
  color: var(--muted);
}
.messages-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 280px;
  padding: 40px 20px;
  text-align: center;
}
.messages-empty-icon {
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--surface-3);
  font-size: 26px;
  margin-bottom: 16px;
  opacity: 0.7;
}
.messages-empty-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.messages-empty-desc {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.5;
}
.messages-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.messages-head h3 { margin: 0; font-size: 16px; font-weight: 600; }
.messages-head-actions { display: flex; align-items: center; gap: 8px; }
.messages-body { display: flex; height: 420px; }
.messages-list {
  width: 260px; border-right: 1px solid var(--line);
  overflow-y: auto; padding: 8px;
}
.message-item {
  padding: 10px 12px; border-radius: 8px; cursor: pointer;
  margin-bottom: 4px; transition: background .15s;
  display: flex; align-items: flex-start; gap: 8px;
}
.message-item:hover { background: var(--surface-3); }
.message-item.unread { background: rgba(14,124,107,.08); border-left: 3px solid var(--brand); }
.msg-content-wrap { flex: 1; min-width: 0; }
.msg-title-line { display: flex; align-items: center; gap: 6px; margin-bottom: 3px; }
.msg-title {
  font-size: 13px; font-weight: 600; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0;
}
.message-item.unread .msg-title { color: var(--ink); font-weight: 700; }
.msg-preview { font-size: 11.5px; color: var(--muted); margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.msg-time-line { display: flex; align-items: center; gap: 8px; }
.msg-time { font-size: 10.5px; color: var(--muted); opacity: .7; }
/* 类型图标（列表项左侧） */
.msg-type-icon {
  flex-shrink: 0; width: 30px; height: 30px; margin-top: 1px;
  border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
/* 类型彩色小标签 */
.msg-type-chip {
  flex-shrink: 0; font-size: 10px; font-weight: 600; line-height: 1;
  padding: 3px 6px; border-radius: 4px; white-space: nowrap;
}
/* "可回复 ›"提示 */
.msg-reply-hint { font-size: 10.5px; font-weight: 600; white-space: nowrap; }
/* 四种消息类型配色（图标底 / 标签底+字 / 提示字） */
.mtype-system   { color: #5b7290; }
.msg-type-icon.mtype-system   { background: rgba(91,114,144,.14); }
.msg-type-chip.mtype-system   { background: rgba(91,114,144,.14); color: var(--system-ink); }
.mtype-feedback { color: var(--brand); }
.msg-type-icon.mtype-feedback { background: rgba(14,124,107,.12); }
.msg-type-chip.mtype-feedback { background: rgba(14,124,107,.12); color: var(--brand-strong); }
.mtype-contact  { color: #b97b1d; }
.msg-type-icon.mtype-contact  { background: rgba(185,123,29,.14); }
.msg-type-chip.mtype-contact  { background: rgba(185,123,29,.14); color: var(--warn-ink); }
.mtype-announce { color: #c2541a; }
.msg-type-icon.mtype-announce { background: rgba(194,84,26,.13); }
.msg-type-chip.mtype-announce { background: rgba(194,84,26,.13); color: var(--announce-ink); }

.msg-delete-btn {
  flex-shrink: 0; width: 24px; height: 24px; border: none; border-radius: 4px;
  background: transparent; color: var(--muted); font-size: 16px; line-height: 1;
  cursor: pointer; opacity: 0; transition: all .15s;
  display: flex; align-items: center; justify-content: center;
}
.message-item:hover .msg-delete-btn { opacity: .6; }
.msg-delete-btn:hover { opacity: 1 !important; background: var(--danger); color: white; }
.ghost.small.danger { color: var(--danger); background: transparent; border: 1px solid transparent; }
.ghost.small.danger:hover { background: rgba(212,64,58,.1); }
.ghost.small.danger:active { transform: scale(0.98); }
.messages-detail {
  flex: 1; min-width: 0; padding: 20px; overflow-y: auto;
}
.messages-detail h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.msg-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 14px; }
.msg-content { font-size: 13.5px; line-height: 1.7; color: var(--ink-2); white-space: pre-wrap; }

/* ===== 反馈对话线程（我的反馈 / 消息通知共用） ===== */
.fb-status-pending { color: var(--warn); }
.fb-status-replied { color: var(--brand); }
.fb-status-resolved { color: var(--down); }
.fb-loading { font-size: 13px; color: var(--muted); }
.fb-detail-head h4 { margin: 0 0 8px; font-size: 15px; font-weight: 600; }
.fb-reward-note {
  margin-bottom: 10px; padding: 8px 12px; border-radius: 8px;
  font-size: 12.5px; color: #a9761f;
  background: rgba(232,168,56,.14); border: 1px solid rgba(232,168,56,.3);
}
.fb-thread {
  display: flex; flex-direction: column; gap: 10px;
  margin-top: 14px; max-height: 220px; overflow-y: auto; padding-right: 4px;
}
.fb-bubble {
  min-width: 0; max-width: 86%; padding: 9px 12px; border-radius: 10px;
  font-size: 13px; overflow-wrap: anywhere;
}
.fb-bubble-user { align-self: flex-start; background: var(--surface-2); }
.fb-bubble-admin {
  align-self: flex-end;
  background: rgba(14,124,107,.10); border: 1px solid rgba(14,124,107,.22);
}
.fb-bubble-head { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.fb-bubble-body { white-space: pre-wrap; word-break: break-word; line-height: 1.6; color: var(--ink-2); }
.fb-reply-box {
  display: flex; flex-direction: column; gap: 8px; width: 100%; max-width: 100%;
  min-width: 0; margin-top: 14px; box-sizing: border-box;
}
.fb-reply-input {
  display: block; width: 100%; min-width: 0; max-width: 100%; box-sizing: border-box;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font-size: 13px;
  font-family: inherit; resize: vertical; overflow-wrap: anywhere;
}
.fb-reply-input:focus { outline: none; border-color: var(--brand); }
.fb-reply-send { align-self: flex-end; flex: 0 0 auto; max-width: 100%; box-sizing: border-box; }
.message-item.active { background: var(--surface-3); }
/* 消息通知选中态：品牌底色 + 左侧指示条（未读项已有 border 指示条，避免叠加），强于 hover 态 */
.message-item.selected {
  background: var(--brand-soft, rgba(14, 124, 107, .1));
  box-shadow: inset 3px 0 0 var(--brand);
}
.message-item.selected.unread { box-shadow: none; }
.message-item.selected .msg-title { color: var(--brand); }
.my-feedback-dialog .messages-list { width: 240px; }

/* ===== 反馈弹窗表单 ===== */
#feedback-dialog form { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
#feedback-dialog label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
#feedback-dialog input, #feedback-dialog textarea {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface-2); color: var(--ink); font-size: 13px;
  font-family: inherit; resize: vertical;
}
#feedback-dialog input:focus, #feedback-dialog textarea:focus {
  outline: none; border-color: var(--brand);
}

/* ===== 批量警告动画 ===== */
@keyframes batch-warn-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .6; }
}

/* ===== 会员权益（积分中心 / 会员套餐） ===== */
/* 会员中心/套餐卡等处的金色小标签 */
.vip-tag {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  background: linear-gradient(135deg, #d4a84a, #b8862f); color: #fff;
  font-size: 11px; font-weight: 700; letter-spacing: .5px; line-height: 1.5;
}
.vip-tag-sm { padding: 1px 6px; font-size: 10px; border-radius: 8px; margin-left: 6px; vertical-align: middle; }

/* 免费次数行内会员标记 */
/* 免费次数行内会员标记。行结构是「功能名 | 右侧文案组」两栏：
   右侧所有文案（剩余次数 / 会员标记）必须装在 .points-usage-value 里，
   否则 row 的 space-between 会把它们当成独立子元素均分空间，中间那截被推到居中。 */
.points-usage-name { display: inline-flex; align-items: center; font-weight: 500; }
.points-usage-value { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; white-space: nowrap; }
.vip-unlimited-text { color: var(--accent-ink); font-weight: 600; font-size: 12px; }
.vip-extra-text {
  font-size: 11px; font-weight: 600; color: var(--brand-strong, #0c6b5d);
  background: var(--brand-soft, rgba(14,124,107,.12)); padding: 1px 6px; border-radius: 8px;
}


/* 会员套餐权益条目 */
/* VIP 行不另设图标，沿用基础行的品牌色圆点（绝对定位 left:4px + padding-left:16px，
   保证图标与文字基线对齐且留 12px 间距）；emoji 图标宽度随字体变化会顶不出稳定间距，故弃用 */
.membership-plan-benefits li.vip-benefit { color: var(--ink-2); font-weight: 600; }

/* 运营端套餐弹窗权益说明 */
.plan-benefit-hint { font-size: 12px; margin: 8px 0 4px; line-height: 1.6; }



/* ---------- 股票维度历史复核/研究（社区洞察） ---------- */
.panel-head-actions { display: flex; align-items: center; gap: 10px; }
.insights-history-btn {
  border: 1px solid var(--line-strong, var(--line)); background: var(--surface-3);
  color: var(--ink-2, var(--ink)); border-radius: 999px; padding: 4px 12px;
  font-size: 12px; line-height: 1.6; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.insights-history-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.insights-history-btn:disabled { opacity: .6; cursor: default; }
.insights-count-badge {
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px;
  background: var(--brand); color: #fff; font-size: 11px; font-style: normal;
  display: inline-flex; align-items: center; justify-content: center; font-weight: 700;
}

.insights-dialog { width: min(680px, calc(100% - 28px)); }
.insights-window-hint { padding: 12px 22px 0; font-size: 12px; margin: 0; }
.insights-list { padding: 8px 22px 12px; display: flex; flex-direction: column; gap: 10px; max-height: 56vh; overflow-y: auto; }
.insights-item {
  text-align: left; width: 100%; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-3); padding: 10px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 6px;
}
.insights-item:hover { border-color: var(--brand); box-shadow: 0 1px 6px rgba(14,124,107,.12); }
.insights-item-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.insights-item-title { font-size: 14px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.insights-item-summary {
  margin: 0; font-size: 13px; color: var(--ink-2, var(--ink)); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.insights-item-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); }
.insights-source-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; background: var(--surface-2); color: var(--ink-2, var(--ink)); }
.insights-source-tag.source-platform { background: var(--brand-soft); color: var(--brand); }
/* G 贡献者信誉徽章：匿名等级标识 */
.insights-tier-tag { font-size: 11px; padding: 1px 8px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); }
.insights-tier-tag.tier-contributor { background: var(--surface-2); color: var(--ink-2, var(--ink)); }
.insights-tier-tag.tier-active { background: rgba(212,168,74,.14); color: var(--accent-ink); border-color: rgba(212,168,74,.4); }
.insights-tier-tag.tier-senior { background: linear-gradient(120deg, rgba(212,168,74,.2), rgba(14,124,107,.16)); color: var(--brand-strong, #0e7c6b); border-color: rgba(212,168,74,.5); font-weight: 600; }
/* G 免责声明 */
.insights-disclaimer { margin: 6px 22px 14px; padding: 8px 10px; font-size: 11.5px; line-height: 1.6; color: var(--muted); border-top: 1px dashed var(--line); }
.insights-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 4px 22px 16px; }
.insights-pagination button { min-width: 76px; }

.insights-upsell {
  margin: 12px 22px 0; padding: 10px 12px; border-radius: var(--radius);
  background: linear-gradient(120deg, rgba(212,168,74,.14), rgba(14,124,107,.10));
  border: 1px solid rgba(212,168,74,.45); display: flex; align-items: center; gap: 10px;
}
.insights-upsell-text { flex: 1; min-width: 0; font-size: 12.5px; line-height: 1.6; color: var(--ink-2, var(--ink)); }
.insights-upsell-btn { white-space: nowrap; padding: 6px 14px; font-size: 12.5px; }

.insights-detail-head { padding: 12px 22px 0; }
.insights-detail { padding: 10px 22px 20px; max-height: 62vh; overflow-y: auto; }
.insights-detail-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--muted); margin-bottom: 10px; }
.insights-hidden-tag { color: var(--danger); font-weight: 700; }
.insights-field-grid { margin: 10px 0; display: flex; flex-direction: column; gap: 8px; }
.insights-field { display: flex; gap: 10px; font-size: 13px; line-height: 1.7; }
.insights-field dt { flex: 0 0 84px; color: var(--muted); margin: 0; }
.insights-field dd { margin: 0; flex: 1; min-width: 0; color: var(--ink); }
.insights-usage { margin-top: 8px; }
.insights-detail-actions { display: flex; gap: 10px; margin-top: 14px; }
.insights-expired { padding: 24px 8px; text-align: center; }
.insights-expired .insights-detail-actions { justify-content: center; }

@media (max-width: 640px) {
  .insights-list { max-height: 52vh; }
  .insights-item-meta { gap: 2px 10px; }
  .insights-field { flex-direction: column; gap: 2px; }
  .insights-field dt { flex: none; }
}

/* 历史内容：与当前/最新分析的关系提示（克制样式，不抢占主视觉） */
.insights-rel-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 999px; white-space: nowrap;
  background: var(--surface-2); color: var(--muted);
}
.insights-rel-tag.is-current { background: var(--brand-soft); color: var(--brand); }

/* ===== 添加股票弹窗：批量添加（右侧滑出侧滑页） ===== */
/* 入口卡片：点击后侧滑页从弹窗右侧滑入，替代原 <details> 原地展开 */
.stock-io-trigger {
  display: flex; align-items: center; gap: 11px; width: 100%; box-sizing: border-box;
  margin-top: 16px; padding: 11px 13px; text-align: left; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--surface-3); color: var(--ink-2); font: inherit;
  transition: border-color .18s, background .18s, transform .12s, box-shadow .18s;
}
.stock-io-trigger:hover {
  border-color: var(--brand-line); background: var(--brand-soft);
  box-shadow: 0 2px 12px rgba(16, 47, 41, .08);
}
.stock-io-trigger:active { transform: scale(.994); }
.stock-io-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stock-io-trigger-icon {
  flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand); transition: background .18s, color .18s;
}
.stock-io-trigger:hover .stock-io-trigger-icon { background: var(--brand); color: #fff; }
.stock-io-trigger-copy { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.stock-io-trigger-copy strong { font-size: 13px; font-weight: 700; color: var(--ink); transition: color .18s; }
.stock-io-trigger:hover .stock-io-trigger-copy strong { color: var(--brand-strong); }
.stock-io-trigger-copy span { font-size: 11.5px; line-height: 1.45; color: var(--muted); }
.stock-io-trigger-arrow { flex: none; display: grid; color: var(--faint); transition: transform .18s, color .18s; }
.stock-io-trigger:hover .stock-io-trigger-arrow { color: var(--brand); transform: translateX(2px); }

/* 侧滑页：默认停在弹窗右侧边界外（被弹窗 overflow 裁掉），加 .is-open 后滑入。
   定位基准＝弹窗自身（modal dialog 为 fixed/absolute，天然是绝对定位包含块）；
   弹窗自身不滚动（滚动在表单内），所以 inset:0 始终等于可视区。 */
.stock-io-panel {
  position: absolute; inset: 0; z-index: 6;
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface); border-radius: var(--radius-lg);
  box-shadow: -18px 0 44px rgba(16, 47, 41, .18);
  /* translate3d 走合成层，避免逐帧重排造成的"发涩/跳动" */
  transform: translate3d(100%, 0, 0); opacity: 0;
  will-change: transform, opacity;
  backface-visibility: hidden;
  /* 收起：300ms——起步即动、尾段平滑收住，退回比展开略快才符合直觉 */
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .24s ease, box-shadow .3s ease;
}
.stock-io-panel.is-open {
  transform: translate3d(0, 0, 0); opacity: 1;
  box-shadow: -24px 0 56px rgba(16, 47, 41, .24);
  /* 展开：380ms iOS 表单曲线——前段快（点了立刻有反馈）、后段长减速（不生硬撞停） */
  transition: transform .38s cubic-bezier(.32, .72, 0, 1), opacity .2s ease-out, box-shadow .38s ease;
}
/* 主表单：稍慢半拍地左移淡出，形成"被推到后面"的层级纵深（只动 transform/opacity，不触发重排） */
#stock-dialog form {
  transition: transform .3s cubic-bezier(.4, 0, .2, 1), opacity .24s ease;
}
#stock-dialog.io-open form {
  transform: translate3d(-40px, 0, 0); opacity: .3; pointer-events: none;
  transition: transform .38s cubic-bezier(.32, .72, 0, 1), opacity .3s ease;
  transition-delay: .04s;
}

/* 主表单与侧滑页的头部栏共用一套尺寸：标题块（eyebrow + 标题）字号、间距、上下留白全部对齐，
   切到「批量添加」时头部不会"跳高"，两个标题的视觉基线一致 */
#stock-dialog .dialog-head {
  /* 横向 22px 与表单字段/其它弹窗同轴；此处只收窄上下留白，不能把横向内缩归零（负边距会让标题贴弹窗边） */
  padding: 12px 22px;
  margin-bottom: 12px;              /* 与 .stock-io-scroll 的顶部留白一致 */
}
#stock-dialog .dialog-head .eyebrow { margin: 0 0 8px; }
#stock-dialog .dialog-head h2 { font-size: 19px; line-height: 1.35; }
.stock-io-head {
  flex: none; display: flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-bottom: 1px solid var(--line); background: var(--surface-header);
}
.stock-io-back {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 6px 12px 6px 8px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: 12.5px; font-weight: 700;
  transition: border-color .18s, color .18s, background .18s, transform .12s;
}
.stock-io-back:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.stock-io-back:active { transform: scale(.96); }
.stock-io-back:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stock-io-head-copy { min-width: 0; }
/* 与主表单标题块同字号同间距：eyebrow 下 8px、标题 19px/1.35 */
.stock-io-head-copy .eyebrow { margin: 0 0 8px; }
.stock-io-head-copy h3 { margin: 0; font-size: 19px; line-height: 1.35; }
.stock-io-close {
  margin-left: auto; flex: none; width: 28px; height: 28px; border-radius: 8px;
  display: grid; place-items: center; cursor: pointer;
  border: 1px solid transparent; background: none; color: var(--muted);
  font-size: 19px; line-height: 1; padding: 0;
  transition: background .18s, color .18s, border-color .18s;
}
.stock-io-close:hover { background: var(--surface-2); color: var(--ink); border-color: var(--line); }
.stock-io-close:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

.stock-io-scroll {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: 12px 16px 14px; display: flex; flex-direction: column; gap: 10px;
}
.stock-io-lead { margin: 0; font-size: 12.5px; line-height: 1.6; color: var(--muted); }
.stock-io-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 9px 12px 11px; background: var(--surface-3); }
.stock-io-card-head { display: flex; align-items: center; gap: 8px; }
.stock-io-step {
  flex: none; width: 19px; height: 19px; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand); color: #fff; font-size: 11px; font-weight: 800;
}
.stock-io-card-head h4 { margin: 0; font-size: 13px; font-weight: 700; color: var(--ink); }
.stock-io-note { margin: 6px 0 0; font-size: 12px; line-height: 1.5; color: var(--muted); }
.stock-io-foot {
  position: relative; flex: none; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 16px 15px; border-top: 1px solid var(--line); background: var(--surface);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}
/* 底部渐隐：内容未滚到底时柔和提示"下面还有"，避免卡片被硬切断 */
.stock-io-foot::before {
  content: ""; position: absolute; inset: -22px 0 auto 0; height: 22px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--surface));
}
/* 底部按钮是全宽块，提示/报错与它同一中心轴才工整（多行时逐行居中） */
.stock-io-foot .settings-message {
  margin-top: 0; text-align: center;
  /* 换行时两侧留点余量，避免长句顶到卡片边 */
  padding-inline: 4px;
}
.stock-io-foot #stock-import-btn { width: 100%; padding: 10px 16px; font-size: 13px; }
/* 三种来源（JSON文件/文本/截图识别）都不满足时禁用：明确"还没东西可导"，别让用户点了才报错 */
.stock-io-foot #stock-import-btn:disabled { opacity: .5; cursor: not-allowed; }
/* 已选截图但尚未识别：识别按钮升级为主按钮并呼吸提示，把注意力引到"先识别"这一步 */
.stock-io-row #stock-recognize-btn.is-attention { animation: stock-io-attention 1.8s ease-in-out infinite; }
@keyframes stock-io-attention {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  50% { box-shadow: 0 0 0 4px var(--brand-soft); }
}
@media (prefers-reduced-motion: reduce) {
  .stock-io-row #stock-recognize-btn.is-attention { animation: none; box-shadow: 0 0 0 3px var(--brand-soft); }
}

.stock-io-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 9px 0 0; }
.stock-io-row .muted { font-size: 12px; line-height: 1.5; }
.stock-io-file {
  display: inline-flex; align-items: center; padding: 7px 14px;
  border: 1px solid var(--line); border-radius: 8px; cursor: pointer;
  font-size: 13px; background: var(--surface); transition: border-color .15s, color .15s;
}
.stock-io-file:hover { border-color: var(--brand); color: var(--brand); }
.stock-io-text { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; color: var(--muted); margin: 9px 0 0; }
.stock-io-text textarea {
  width: 100%; box-sizing: border-box; resize: vertical; min-height: 56px;
  font: inherit; font-size: 13px; padding: 8px 10px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink);
}
.stock-io-hint { margin: 7px 0 0; }
/* 尊重系统"减弱动态效果"设置：关闭侧滑动画，直接切换 */
@media (prefers-reduced-motion: reduce) {
  .stock-io-panel, #stock-dialog form { transition: none; }
  .stock-io-panel { opacity: 1; }
}
.recognize-title { margin: 6px 0 4px; font-size: 13px; font-weight: 600; }
.recognize-list {
  display: flex; flex-direction: column; gap: 2px; max-height: 180px; overflow-y: auto;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; background: var(--bg);
}
.recognize-item {
  display: flex; align-items: center; gap: 8px; font-size: 13px;
  cursor: pointer; padding: 3px 2px; border-radius: 6px;
}
.recognize-item:hover { background: var(--brand-soft); }
.recognize-item input[type="checkbox"] { accent-color: var(--brand); }
.recognize-invalid { margin: 3px 0 0; font-size: 12px; color: var(--warn); }
#stock-recognize-result .primary { margin-top: 8px; }
.insights-rel-tag.is-outdated { background: rgba(212,168,74,.16); color: var(--accent-ink); }
.insights-item.is-outdated { border-left: 2px solid rgba(212,168,74,.5); }

.insights-freshness {
  margin: 2px 0 10px; padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 12.5px; line-height: 1.7; border-left: 3px solid var(--line);
  background: var(--surface-3); color: var(--ink-2, var(--ink));
}
.insights-freshness p { margin: 0; }
.insights-freshness p + p { margin-top: 4px; }
.insights-freshness-title { font-weight: 700; }
.insights-freshness-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.insights-freshness-actions button { padding: 5px 12px; font-size: 12.5px; }
.insights-freshness.is-current { border-left-color: var(--brand); background: var(--brand-soft); color: var(--brand-strong, var(--brand)); }
.insights-freshness.is-latest { border-left-color: var(--brand-line, var(--line)); }
.insights-freshness.is-outdated { border-left-color: rgba(212,168,74,.8); background: rgba(212,168,74,.10); }
.insights-freshness.is-outdated .insights-freshness-title { color: var(--accent-ink); }
/* 用户选择继续阅读后收起按钮区，只保留提示正文，减少干扰 */
.insights-freshness.is-collapsed .insights-freshness-actions { display: none; }

/* 面板时效角标：当前分析非最新时的轻量提示（可点击跳最新分析） */
.insights-stale-chip {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px; cursor: pointer; white-space: nowrap;
  background: rgba(212,168,74,.14); color: var(--accent-ink); border: 1px solid rgba(212,168,74,.45);
}
.insights-stale-chip:hover { background: rgba(212,168,74,.24); }


/* 我的贡献 */
.my-contributions-dialog {
  width: min(660px, calc(100vw - 32px)); min-width: 0;
  max-width: calc(100vw - 32px); max-height: 90vh;
  box-sizing: border-box; overflow: hidden;
  display: flex; flex-direction: column;
}
.my-contributions-dialog #my-contributions-list-view,
.my-contributions-dialog #my-contributions-detail-view,
.my-contributions-dialog .my-contributions-hint,
.my-contributions-dialog .my-contributions-filter,
.my-contributions-dialog .my-contributions-list,
.my-contributions-dialog .insights-detail-head,
.my-contributions-dialog .insights-detail,
.my-contributions-dialog .insights-pagination {
  width: 100%; min-width: 0; box-sizing: border-box;
}
.my-contributions-dialog #my-contributions-list-view,
.my-contributions-dialog #my-contributions-detail-view {
  /* 同 .auth-dialog-body：不定高弹窗内 flex-basis 须为 auto，0% 会被 Safari 塌成 0 */
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: hidden;
}
.my-contributions-dialog .my-contributions-list { max-height: none; overflow: visible; }
.my-contributions-dialog .insights-detail { overflow-x: hidden; }
.my-contributions-hint { padding: 12px 20px 0; font-size: 12px; margin: 0; line-height: 1.6; }
.my-contributions-filter { display: flex; gap: 8px; padding: 10px 16px 4px; }
.my-contributions-filter select {
  padding: 6px 10px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--ink); font-size: 12.5px;
}
.my-contributions-list {
  padding: 8px 16px 12px; display: flex; flex-direction: column; gap: 10px;
  max-height: 56vh; overflow-y: auto;
}
.my-contrib-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.insights-rel-tag.is-approved { background: var(--brand-soft); color: var(--brand); }
.insights-rel-tag.is-pending { background: rgba(70,140,220,.14); color: var(--info-ink); }
.insights-rel-tag.is-rejected { background: var(--danger-soft); color: var(--danger); }
.insights-rel-tag.is-hidden { background: var(--surface-2); color: var(--muted); }
@media (max-width: 640px) {
  .my-contributions-list { max-height: 52vh; }
}

/* ---- 全网分享弹窗 ---- */
.share-dialog { width: min(920px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,.24); max-height: calc(100vh - 48px); overflow-y: auto; }
.share-dialog::backdrop { background: rgba(10,14,22,.55); backdrop-filter: blur(3px); }
/* 头部冻结：弹窗内容滚动时标题栏吸顶不动 */
.share-dialog .dialog-head { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; padding: 14px 22px; border-bottom: 1px solid var(--border); background: var(--surface); }
.share-dialog .dialog-head .eyebrow { color: var(--muted); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.share-dialog .dialog-head h2 { margin: 2px 0 0; font-size: 17px; }
/* 弹窗整体布局：左列=链接+文案，右列=海报；宽屏（>=760px）并排，窄屏纵向堆叠 */
.share-layout { padding: 14px 22px 20px; display: grid; gap: 14px; }
.share-left { min-width: 0; display: flex; flex-direction: column; gap: 14px; }
.share-block { position: relative; border: 1px solid var(--border); border-radius: 14px; padding: 14px 16px; background: var(--surface); }
.share-block-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.share-block-title { margin: 0; font-size: 13px; font-weight: 700; color: var(--text); letter-spacing: .02em; }
.share-block-note { margin: 0; font-size: 11px; color: var(--muted); }
/* 宽屏（>=760px）：左列=链接+文案，右列=海报，横向并排 */
@media (min-width: 760px) {
  .share-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
}
/* 链接块：输入与操作在左，二维码在右 */
.share-link-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 18px; align-items: start; }
.share-link-fields { min-width: 0; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row input { flex: 1; min-width: 0; font-size: 12px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface-2); color: var(--text); }
.share-link-row button { flex: none; white-space: nowrap; }
.share-link-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.share-link-actions button { padding: 6px 12px; font-size: 12px; }
.share-expire { margin: 10px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.share-qr-wrap { text-align: center; }
.share-qr-img { width: 104px; height: 104px; border: 1px solid var(--border); border-radius: 12px; background: #fff; padding: 6px; box-sizing: border-box; }
.share-qr-hint { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
/* 文案风格块 */
.share-style-options { display: flex; flex-wrap: wrap; gap: 8px; }
.share-style-option { padding: 6px 12px; font-size: 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface-2); color: var(--text); cursor: pointer; }
.share-style-option.active { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.share-style-preview { margin: 10px 0 0; padding: 10px 12px; border: 1px dashed var(--border); border-radius: 10px; background: var(--surface-2); font-size: 12px; line-height: 1.7; color: var(--text); word-break: break-word; }
.share-privacy { margin: 0; padding: 0 2px; font-size: 11px; color: var(--muted); line-height: 1.6; }
/* 海报块 */
.share-poster { padding: 14px 16px 16px; }
.share-poster-preview { position: relative; padding: 12px; background: var(--surface-2); border-radius: 12px; display: flex; justify-content: center; }
#share-poster-canvas, #invite-poster-canvas { width: 100%; max-width: 300px; height: auto; display: block; border-radius: 10px; background: #fff; box-shadow: 0 8px 24px rgba(20, 32, 50, .12); }
.share-poster-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 12px; color: var(--muted); background: rgba(255, 255, 255, .6); border-radius: 12px; }
.share-poster-loading.hidden { display: none; }
.share-poster-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; margin-top: 12px; }
.share-poster-actions button { padding: 7px 14px; font-size: 12px; }
.share-poster-hint { font-size: 11px; color: var(--muted); }
/* 风格切换：非阻塞轻量提示（淡入淡出）+ 选中按钮短暂缩放高亮 */
.share-style-toast {
  position: absolute; top: -3px; right: 0;
  font-size: 11px; font-weight: 500; color: var(--brand);
  background: var(--brand-soft); border: 1px solid var(--brand-soft);
  padding: 3px 10px; border-radius: 999px; white-space: nowrap;
  opacity: 0; transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.share-style-toast.show { opacity: 1; transform: translateY(0); }
.share-style-option.just-switched { animation: shareOptionPop .6s ease; }
@keyframes shareOptionPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); box-shadow: 0 0 0 3px var(--brand-soft); }
  100% { transform: scale(1); }
}
.share-manage-dialog { width: min(620px, calc(100vw - 32px)); border: 0; border-radius: 16px; padding: 0; background: var(--surface); color: var(--text); box-shadow: 0 24px 64px rgba(0,0,0,.24); max-height: calc(100vh - 48px); overflow-y: auto; }
.share-manage-body { padding: 4px 24px 20px; }
.share-manage-list { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; min-height: 60px; }
.share-manage-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface-2); }
.share-manage-main { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.share-manage-title { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.share-manage-symbol { font-family: ui-monospace, Consolas, monospace; font-weight: 700; font-size: 15px; color: var(--text); }
.share-manage-name { font-size: 13px; color: var(--ink-2); }
.share-manage-meta { font-size: 11px; color: var(--muted); }
.share-manage-right { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.share-manage-status { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.share-manage-status.active { color: #0f7a5f; background: rgba(15,122,95,.12); }
.share-manage-status.expired { color: #7c8ba0; background: rgba(124,139,160,.14); }
.share-manage-status.revoked { color: #c0392b; background: rgba(192,57,43,.12); }
.share-manage-views { font-size: 11px; color: var(--muted); }
.share-manage-actions { display: flex; gap: 8px; }
.share-manage-actions button.secondary { padding: 6px 12px; font-size: 12px; }
.share-manage-actions button.danger { background: #c0392b; color: #fff; }
.share-manage-actions button.danger:hover { background: #a93226; }
.share-manage-pagination { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 16px; }
.share-manage-pageinfo { font-size: 12px; color: var(--muted); }
.share-manage-hint { margin: 16px 0 0; font-size: 11px; color: var(--muted); line-height: 1.6; }
.share-manage-empty { padding: 28px 0 8px; text-align: center; font-size: 13px; color: var(--ink-2); }
.danger-text { color: var(--danger) !important; border-color: var(--danger) !important; }
/* 窄屏：海报纵向堆到文案下方，二维码横排更省高度 */
@media (max-width: 759px) {
  .share-link-grid { grid-template-columns: 1fr; }
  .share-qr-wrap { display: flex; align-items: center; justify-content: center; gap: 14px; text-align: left; }
  .share-qr-img { width: 110px; height: 110px; }
  .share-qr-hint { margin: 0; }
  .share-poster-preview { max-width: 340px; margin: 0 auto; }
}

/* 每日任务 + 邀请裂变 */
.points-tasks { display: flex; flex-direction: column; gap: 8px; }
.points-task-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.points-task-row.done { border-color: var(--brand); }
.points-task-row.claimed { opacity: .65; }
.points-task-label { flex: 1; font-size: 13px; }
.points-task-reward { font-weight: 700; color: var(--brand); font-size: 13px; }
.points-task-state { font-size: 12px; color: var(--muted); }
.points-task-state.claimed { color: var(--brand); }
.points-task-claim { padding: 5px 14px; border: none; border-radius: 8px; background: var(--brand); color: #fff; font-size: 12px; cursor: pointer; }
.points-task-claim:disabled { opacity: .5; cursor: default; }
.points-invite-row { display: flex; gap: 14px; align-items: flex-start; }
.points-invite-qr { flex: none; padding: 8px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.points-invite-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.points-invite-info p { margin: 0; font-size: 12px; line-height: 1.5; }
.points-invite-code { cursor: pointer; font-size: 18px; letter-spacing: 2px; color: var(--brand); }
.points-milestones { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-direction: column; gap: 8px; }
.points-milestone-list { display: flex; flex-direction: column; gap: 6px; }
.points-milestone-item { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 7px 10px; border-radius: 8px; background: var(--surface-2); }
.points-milestone-item.reached { border: 1px solid var(--brand); }
.points-milestone-item.claimed { opacity: .65; }
.points-milestone-state { margin-left: auto; color: var(--muted); }
.points-milestone-item.reached .points-milestone-state { color: var(--brand); }
@media (max-width: 480px) {
  .points-invite-row { flex-direction: column; align-items: center; text-align: center; }
  .points-invite-info { align-items: center; }
}

/* 积分中心内嵌邀请模块：复制按钮与明细直达 */
.points-invite-code-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.points-invite-btn { padding: 4px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--ink-2); font-size: 12px; cursor: pointer; transition: all .18s; }
.points-invite-btn:hover { border-color: var(--brand); color: var(--brand); }
.points-invite-more { align-self: flex-start; padding: 0; border: none; background: none; color: var(--brand); font-size: 12px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* 个人中心「我的邀请」独立页 */
.my-invites { display: flex; flex-direction: column; gap: 18px; }
.invite-section-title { margin: 0 0 10px; font-size: 14px; }
.invite-code-card { display: flex; gap: 18px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: linear-gradient(135deg, rgba(14,124,107,.06), rgba(14,124,107,.01)); }
.invite-qr { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.invite-qr img { display: block; }
.invite-qr small { font-size: 11px; color: var(--muted); }
.invite-code-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; flex: 1; }
.invite-code-label { font-size: 12px; color: var(--muted); }
.invite-code-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.invite-code-value { font-size: 26px; letter-spacing: 5px; color: var(--brand); font-weight: 800; }
.invite-btn { padding: 7px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--ink-2); font-size: 13px; cursor: pointer; transition: all .18s; }
.invite-btn:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.invite-btn:disabled { opacity: .45; cursor: default; }
.invite-btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.invite-btn.primary:hover:not(:disabled) { filter: brightness(1.06); color: #fff; }
.invite-btn.secondary { padding: 4px 10px; font-size: 12px; }
.invite-link-row { display: flex; align-items: center; gap: 8px; }
.invite-link-text { font-size: 12px; color: var(--ink-2); background: var(--surface-2); border-radius: 8px; padding: 6px 10px; overflow-wrap: anywhere; }
/* 邀请海报入口（我的邀请 → 邀请码卡片内的醒目主按钮） */
.invite-poster-entry { display: flex; }
.invite-btn.poster-cta { flex: 1; padding: 9px 14px; border: 0; border-radius: 10px; background: linear-gradient(135deg, var(--brand), var(--brand-strong)); color: #fff; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.invite-btn.poster-cta:hover:not(:disabled) { filter: brightness(1.08); color: #fff; box-shadow: 0 4px 14px rgba(14, 124, 107, .32); }
/* 邀请海报弹窗（_invite_poster_dialog.html）：骨架复用分享弹窗类，仅补邀请信息区块专属样式 */
.invite-poster-info-row { display: flex; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.invite-poster-info-label { font-size: 12px; color: var(--muted); }
.invite-poster-code { font-size: 22px; letter-spacing: 4px; color: var(--brand); font-weight: 800; }
.invite-reward-tip { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.6; }
.invite-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.invite-stat { display: flex; flex-direction: column; gap: 4px; padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); text-align: center; }
.invite-stat strong { font-size: 22px; color: var(--brand); }
.invite-stat-label { font-size: 12px; color: var(--muted); }
.invite-milestones { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.invite-records-section { border: 1px solid var(--line); border-radius: 12px; padding: 14px; }
.invite-record-list { display: flex; flex-direction: column; }
.invite-record-row { display: flex; align-items: center; gap: 12px; padding: 10px 4px; border-bottom: 1px dashed var(--line); }
.invite-record-row:last-child { border-bottom: none; }
.invite-record-name { font-size: 13px; min-width: 90px; }
.invite-record-row small { flex: 1; }
.invite-status { font-size: 11px; padding: 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.invite-status.activated { background: rgba(14,124,107,.12); color: var(--brand); font-weight: 600; }
.invite-pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 10px; font-size: 12px; }
@media (max-width: 640px) {
  .invite-code-card { flex-direction: column; align-items: center; text-align: center; }
  .invite-code-row, .invite-link-row { justify-content: center; }
  .invite-stats { grid-template-columns: 1fr; }
}


/* 首次欢迎引导弹层 */
.guide-welcome-dialog {
  width: min(430px, calc(100vw - 40px));
  padding: 26px 26px 20px; border: 0; border-radius: 16px;
  background: var(--surface); color: var(--ink);
  box-shadow: 0 24px 70px rgba(8, 24, 20, .28); text-align: center;
}
.guide-welcome-dialog::backdrop { background: rgba(8, 24, 20, .5); backdrop-filter: blur(3px); }
.gw-head { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 6px; }
.gw-logo { width: 44px; height: 44px; border-radius: 12px; background: rgba(14, 124, 107, .1); display: grid; place-items: center; font-size: 22px; }
.gw-head .eyebrow { margin: 0; font-size: 11px; letter-spacing: 1.5px; color: var(--brand); font-weight: 700; }
.gw-head h2 { margin: 0; font-size: 18px; }
.gw-sub { margin: 0 0 18px; font-size: 13px; color: var(--ink-2); line-height: 1.7; }
.gw-actions { display: grid; gap: 10px; }
.gw-actions button { padding: 11px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; border: 0; }
.gw-primary { background: var(--brand); color: #fff; }
.gw-primary:hover { background: var(--brand-strong); }
.gw-secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line) !important; }
.gw-secondary:hover { border-color: var(--brand); color: var(--brand); }

/* ===== 增长飞轮：游客成长预告 + 登录态今日成长条 ===== */
#growth-area { margin: 14px 0 4px; }
.growth-teaser {
  position: relative; overflow: hidden; border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 9%, var(--surface)), var(--surface) 55%);
  padding: 18px 20px 16px;
  transition: padding .6s cubic-bezier(.4,0,.2,1);
}
.growth-teaser-head h2 { margin: 0 0 4px; font-size: 17px; }
.growth-teaser-head { margin-top: 10px; }
.growth-teaser-sub { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.6; }
.growth-rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 14px 0; }
.growth-ring {
  display: flex; flex-direction: column; gap: 5px; padding: 12px 12px 10px;
  border: 1px solid var(--line); border-radius: 12px; background: var(--surface);
}
.growth-ring-icon { font-size: 20px; }
.growth-ring strong { font-size: 13px; }
.growth-ring-badge {
  align-self: flex-start; font-size: 11px; font-weight: 700; color: var(--brand);
  background: color-mix(in srgb, var(--brand) 12%, transparent); border-radius: 999px; padding: 2px 8px;
}
.growth-ring-desc { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.55; }
.growth-teaser-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.growth-teaser-actions button { padding: 9px 22px; border-radius: 10px; font-size: 14px; font-weight: 600; cursor: pointer; }
.growth-teaser-actions .primary { background: var(--brand); color: #fff; border: 0; }
.growth-teaser-actions .primary:hover { background: var(--brand-strong); }
.growth-teaser-actions .secondary { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.growth-teaser-actions .secondary:hover { border-color: var(--brand); color: var(--brand); }
/* 游客预告折叠：胶囊条 + grid rows 0fr/1fr 纯 CSS 过渡（无定时器） */
.growth-pill {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 2px 0;
  background: transparent; border: 0; cursor: pointer; color: var(--muted); font: inherit;
}
.growth-pill-line { flex: 1; height: 1px; min-width: 24px; background: linear-gradient(90deg, transparent, var(--line-strong)); }
.growth-pill-line:last-child { background: linear-gradient(90deg, var(--line-strong), transparent); }
.growth-pill-text { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .5px; }
.growth-pill-emoji { font-size: 14px; }
.growth-pill-hint { font-size: 11px; font-weight: 400; color: var(--faint); white-space: nowrap; }
.growth-pill:hover .growth-pill-text, .growth-pill:hover .growth-pill-hint { color: var(--brand); }
.growth-teaser-anim { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .65s cubic-bezier(.4,0,.2,1); }
.growth-teaser-body { overflow: hidden; min-height: 0; transition: opacity .45s ease, transform .65s cubic-bezier(.4,0,.2,1); }
.growth-teaser.is-collapsed { padding-top: 6px; padding-bottom: 6px; }
.growth-teaser.is-collapsed .growth-teaser-anim { grid-template-rows: 0fr; transition-delay: .3s; }
.growth-teaser.is-collapsed .growth-teaser-body { opacity: 0; transform: translateY(-8px); transition-delay: .3s, .3s; }
@media (max-width: 760px) {
  .growth-rings { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 420px) {
  .growth-rings { grid-template-columns: 1fr; }
}

.growth-bar {
  display: flex; flex-wrap: wrap; align-items: stretch; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 7%, var(--surface)), var(--surface));
  padding: 8px 10px;
}
.growth-item {
  flex: 1 1 auto; min-width: 150px; display: flex; align-items: center; gap: 6px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); color: var(--ink); font-size: 13px; cursor: pointer;
}
.growth-item:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); }
.growth-item:disabled { cursor: default; opacity: .8; }
.growth-item.growth-checkin:not(:disabled) { border-color: var(--brand); color: var(--brand); font-weight: 600; }
.growth-item.growth-tasks.has-claim { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.growth-item.growth-points { color: var(--muted); }

/* ===== 市场环境面板：默认收起（保留摘要）+ 展开按钮 + 数据项白话提示 ===== */
.market-context-panel.collapsed > *:not(.panel-head):not(#mc-summary):not(#mc-toggle) { display: none !important; }
/* 收起态必须保留底部展开按钮：上面的通用 .panel.collapsed 规则会隐藏所有非 panel-head 子元素。
   #mc-toggle 用 ID 提升优先级，压过 .panel.collapsed 的通配隐藏（两者都带 !important）。 */
.market-context-panel.collapsed > #mc-toggle { display: block !important; }
.market-context-panel .mc-toggle-bottom b { font-size: 9px; transition: transform .2s; }
.market-context-panel:not(.collapsed) .mc-toggle-bottom b { transform: rotate(180deg); }
.market-context-panel.collapsed #mc-summary { margin-bottom: 0; }
.market-context-panel #mc-summary { transition: margin .2s; }
/* 收起态唯一可见的一行＝白话四段式；专业口径就地折叠，展开后仍能逐字核对 */
.mc-headline { margin: 0; color: var(--ink-2); }
.mc-technical { margin-top: 6px; font-size: 11.5px; }
.mc-technical summary { cursor: pointer; color: var(--brand); }
.mc-technical-body { margin: 4px 0 0; color: var(--muted); line-height: 1.6; }

/* 市场环境专题卡片：结论行 + 键值胶囊 + 迷你表格（替代长句堆叠，普通用户先读结论再看数字） */
.mc-readhint {
  margin: 10px 0 2px; font-size: 12px; color: var(--muted); line-height: 1.6;
  background: var(--surface-3); border-radius: 8px; padding: 7px 11px;
}
.market-context-panel .research-output h4 { display: flex; align-items: center; gap: 7px; }
.market-context-panel .research-output h4::before {
  content: ""; flex-shrink: 0; width: 3px; height: 12px; border-radius: 2px; background: var(--brand);
}
.mc-concl { margin: 7px 0 2px; font-size: 13px; color: var(--ink-2); }
.mc-concl b { color: var(--ink); font-weight: 700; }
.mc-kv-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 7px 0; }
.mc-chip {
  display: inline-flex; align-items: baseline; gap: 6px;
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 7px; padding: 4px 9px;
  max-width: 100%;
}
.mc-chip span { font-size: 11px; color: var(--muted); white-space: nowrap; }
.mc-chip b { font-size: 12.5px; font-variant-numeric: tabular-nums; color: var(--ink); line-height: 1.4; }
.mc-chip-wide { width: 100%; }
.mc-chip-wide b { white-space: normal; }
.mc-kv-row .pos { color: var(--up); }
.mc-kv-row .neg { color: var(--down); }
.mc-group { display: flex; gap: 8px; margin: 8px 0; align-items: flex-start; }
.mc-tag {
  flex-shrink: 0; margin-top: 2px; font-size: 10.5px; color: var(--muted);
  background: var(--surface-3); border-radius: 5px; padding: 2px 7px; white-space: nowrap;
}
.mc-list { margin: 0; padding: 0; list-style: none; }
.mc-list li { font-size: 12.5px; color: var(--ink-2); line-height: 1.65; }
.mc-scroll { overflow-x: auto; }
.mc-table { width: 100%; border-collapse: collapse; margin: 8px 0; font-size: 12px; }
.mc-table th {
  text-align: left; font-weight: 600; color: var(--muted); font-size: 11px;
  padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.mc-table td {
  padding: 6px 8px; border-bottom: 1px solid var(--line); color: var(--ink-2);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.mc-table td.mc-state { color: var(--ink); font-weight: 600; white-space: normal; }
.mc-table td.pos { color: var(--up); }
.mc-table td.neg { color: var(--down); }
.mc-table tr td.mc-sub {
  white-space: normal; font-size: 11.5px; color: var(--muted); border-bottom: 1px solid var(--line);
  padding-top: 2px;
}

/* 数据项帮助图标：小问号 + 悬浮白话提示 */
.cap-item .cap-help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 13px; height: 13px; margin-left: 4px; border-radius: 50%;
  font-size: 9px; line-height: 1; font-style: normal;
  color: var(--muted); background: var(--surface-2); border: 1px solid var(--line);
  cursor: help; vertical-align: 1px;
}
.cap-item .cap-help:hover { color: var(--brand); border-color: var(--brand); }
.research-output h4 .cap-help { margin-left: 4px; }
/* 智能折叠：市场环境面板收起时仍保留一句话摘要（覆盖通用面板折叠规则） */
.market-context-panel.collapsed #mc-summary { display: block !important; }

/* 轻量土司提示：底部居中短暂展示后自动消失，不打断用户操作 */
#toast-container {
  position: fixed;
  left: 50%;
  bottom: 48px;
  transform: translateX(-50%);
  z-index: 10001;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  max-width: min(560px, calc(100vw - 32px));
}
.toast {
  max-width: 100%;
  padding: 10px 18px;
  border-radius: 10px;
  background: var(--ink);
  color: var(--toast-ink);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .22s ease, transform .22s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.toast.show { opacity: 1; transform: none; }
.toast.hide { opacity: 0; transform: translateY(-4px); }
/* 窄屏长文案换行：桌面端保持单行紧凑，手机端不再出现半截省略号 */
@media (max-width: 560px) { .toast { white-space: normal; } }
/* 类型色收敛到语义变量：随主题皮肤切换，与全站提示色彩语义一致 */
.toast-success { background: var(--success); }
.toast-error { background: var(--danger); }
.toast-warning { background: var(--warn); }
.toast-info { background: var(--info); }
/* 暗色皮肤下语义色偏亮，改用深墨文字保证对比度 */


/* 筛选结果关注按钮三态：未关注（描边）/ 已关注（品牌色实心）/ 已持仓（金色实心，同属已关注范畴） */
.screener-add.is-active { background: var(--brand); color: #fff; }
.screener-add.is-active:hover { background: var(--brand); color: #fff; }
.screener-add.is-holding { background: #d97706; color: #fff; }
.screener-add.is-holding:hover { background: #d97706; color: #fff; }


/* ============================================================
   皮肤商城（theme.js 动态渲染）
   ============================================================ */
.skin-mall-dialog {
  width: min(920px, 94vw);
  max-width: 920px;
  padding: 0;
  border: none;
  border-radius: 18px;
  background: var(--pop-bg);
  color: var(--pop-ink);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
}
.skin-mall-dialog::backdrop { background: rgba(0,0,0,.5); backdrop-filter: blur(4px); }
.skin-mall-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--line);
}
.skin-mall-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.skin-mall-title .emoji { font-size: 18px; }
.skin-mall-wallet { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.skin-wallet-item { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); }
.skin-wallet-item b { color: var(--ink); }
.skin-mall-close {
  width: 28px; height: 28px; border: none; border-radius: 8px;
  background: transparent; color: var(--muted); font-size: 18px; line-height: 1;
  cursor: pointer; transition: background .15s;
}
.skin-mall-close:hover { background: var(--surface-3); }
.skin-mall-tabs { display: flex; gap: 6px; padding: 10px 20px 8px; flex-wrap: wrap; }
.skin-mall-tab {
  padding: 6px 14px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font-size: 12.5px; font-weight: 600;
  cursor: pointer; transition: all .15s; font-family: inherit;
}
.skin-mall-tab:hover { color: var(--ink); border-color: var(--line-strong); }
.skin-mall-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.skin-mall-tab .count { opacity: .8; font-weight: 400; margin-left: 2px; }
.skin-mall-body { padding: 14px 20px 20px; max-height: 62vh; overflow-y: auto; }
.skin-mall-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(258px, 1fr));
  gap: 14px;
}
.skin-card {
  position: relative;
  display: flex; flex-direction: column; gap: 10px;
  padding: 14px; border-radius: 14px;
  background: var(--surface); border: 1px solid var(--line);
  transition: box-shadow .18s, transform .18s, border-color .18s;
}
.skin-card:hover { box-shadow: var(--shadow-card); transform: translateY(-2px); border-color: var(--line-strong); }
.skin-card.owned { border-color: var(--brand-line); }
/* 正在使用的皮肤：品牌描边 + 右上角「使用中」角标 */
.skin-card.current { border-color: var(--brand); }
.skin-card.current::after {
  content: "使用中"; position: absolute; top: 10px; right: 10px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--brand-soft); color: var(--brand-strong);
  font-size: 11px; font-weight: 600;
}
.skin-card.off-shelf { opacity: .65; }

/* 皮肤到期提醒消息（category=skin_expiry）：琥珀金体系 */
.mtype-skin { color: var(--accent-ink); }
.msg-type-icon.mtype-skin   { background: rgba(176, 141, 47, .16); }
.msg-type-chip.mtype-skin   { background: rgba(176, 141, 47, .14); color: var(--accent-ink); }
.msg-skin-renew-row { display: flex; gap: 8px; margin-top: 14px; }
.msg-skin-renew-note { margin-top: 10px; font-size: 11.5px; color: var(--muted); }

/* 兑换券到账消息（category=voucher，运营站内信发放）：墨绿体系，与主品牌色一致 */
.mtype-voucher { color: var(--brand, #0e7c6b); }
.msg-type-icon.mtype-voucher { background: rgba(14, 124, 107, .14); }
.msg-type-chip.mtype-voucher { background: rgba(14, 124, 107, .12); color: var(--brand, #0e7c6b); }

/* 商城定位高亮（消息"去续期"跳转后） */
.skin-card.focused { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.skin-card-preview {
  display: flex; flex-direction: column; gap: 9px; padding: 10px;
  border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line);
}
.skin-preview-row { display: flex; align-items: center; gap: 8px; padding: 0 2px; min-width: 0; }
.skin-preview-swatches { display: inline-flex; gap: 4px; flex: none; }
.skin-preview-swatch {
  width: 15px; height: 15px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.25);
}
.skin-preview-name { font-size: 14px; font-weight: 700; }
/* 描述统一由卡片下方 .skin-card-desc（两行）承载，预览区不再重复显示（曾因单行省略永远看不全） */

/* 商城卡片迷你 mockup：在 [data-theme] 作用域内用该皮肤真实变量渲染，
   种子/自建皮肤（css_vars 注入）均适用，让用户所见即所得 */
.skin-mini {
  border-radius: 9px; overflow: hidden;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .07);
}
.skin-mini-chrome {
  display: flex; align-items: center; gap: 4px; padding: 6px 9px;
  background: var(--surface-header); border-bottom: 1px solid var(--line);
}
.skin-mini-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--line-strong); }
.skin-mini-ticker {
  margin-left: 4px; font-size: 9px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.skin-mini-body { display: flex; align-items: flex-end; gap: 10px; padding: 8px 9px 9px; }
.skin-mini-quote { display: flex; flex-direction: column; gap: 4px; flex: none; }
.skin-mini-price { font-size: 14px; font-weight: 800; font-variant-numeric: tabular-nums; }
.skin-mini-kpi {
  align-self: flex-start; padding: 1px 6px; border-radius: 999px;
  font-size: 9px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.skin-mini-kpi.up { color: var(--up); background: var(--up-soft, rgba(212, 64, 58, .1)); }
.skin-mini-kpi.down { color: var(--down); background: var(--down-soft, rgba(15, 138, 84, .1)); }
.skin-mini-chart { display: flex; align-items: flex-end; gap: 3px; flex: 1; height: 34px; min-width: 0; }
.skin-mini-chart i {
  flex: 1; height: var(--h, 50%); border-radius: 2px 2px 0 0; opacity: .82;
}
.skin-mini-chart i.up { background: var(--up); }
.skin-mini-chart i.down { background: var(--down); }
.skin-card-title { display: flex; align-items: center; gap: 6px; }
.skin-card-name { font-size: 14px; font-weight: 700; }
.skin-tag {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 1px 7px; border-radius: 999px; font-size: 10px; font-weight: 700;
}
.skin-tag.type-member { background: rgba(212,168,74,.16); color: var(--accent-ink); }
.skin-tag.type-points { background: var(--brand-soft); color: var(--brand-strong); }
.skin-tag.type-balance { background: var(--info-soft); color: var(--info-ink); }
.skin-tag.type-trial { background: rgba(15,138,84,.12); color: var(--down); }
.skin-tag.type-permanent { background: rgba(91,114,144,.12); color: var(--system-ink); }
.skin-tag.type-timed { background: rgba(185,123,29,.12); color: var(--warn-ink); }
.skin-card-desc {
  font-size: 12px; line-height: 1.6; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  /* 恒定占满两行高度：一行文案的卡片与两行的对齐，网格高度不跳动 */
  min-height: calc(1.6em * 2);
}
.skin-card-price { font-size: 13px; font-weight: 700; color: var(--ink); }
.skin-card-price .unit { font-size: 11px; font-weight: 500; color: var(--muted); }
.skin-card-expiry { font-size: 11px; color: var(--muted); }
.skin-card-expiry b { color: var(--warn-ink); }
.skin-card-actions { display: flex; gap: 8px; margin-top: auto; }
.skin-btn {
  flex: 1; padding: 8px 12px; border: none; border-radius: 9px;
  font-size: 12.5px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all .15s;
}
.skin-btn:disabled { opacity: .5; cursor: not-allowed; }
.skin-btn.buy { background: var(--brand); color: #fff; }
.skin-btn.buy:hover:not(:disabled) { background: var(--brand-strong); }
.skin-btn.trial { background: var(--brand-soft); color: var(--brand-strong); border: 1px solid var(--brand-line); }
.skin-btn.trial:hover:not(:disabled) { background: var(--brand-line); }
.skin-btn.owned-btn { background: var(--surface-2); color: var(--muted); cursor: default; }
.skin-btn.member-btn { background: var(--accent-soft); color: var(--accent-ink); }
.skin-btn.off-btn { background: var(--surface-2); color: var(--muted); cursor: default; }
.skin-mall-empty {
  padding: 48px 0; text-align: center; color: var(--muted); font-size: 13px;
}
.skin-mall-hint { margin-top: 10px; font-size: 11.5px; color: var(--muted); text-align: center; }

/* 皮肤到期回退提示条（顶部） */
.skin-expired-banner {
  display: flex; align-items: center; gap: 8px;
  margin: 8px 14px 0; padding: 8px 14px;
  border-radius: 10px; font-size: 12.5px;
  background: var(--warn-soft); color: var(--warn-ink);
  border: 1px solid var(--accent-line);
}
.skin-expired-banner button {
  margin-left: auto; padding: 3px 12px; border: none; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}

/* ===== 左下角行情悬浮卡片（summary-strip 滚出视口后滑出）===== */
/* 卡片主体：从左滑入，底部悬浮，z-index 低于抽屉(201)与顶栏(300) */
.fqc-card {
  position: fixed;
  left: 14px;
  bottom: 18px;
  z-index: 150;
  width: 356px;
  max-width: calc(100vw - 28px);
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(16px) saturate(1.25);
  -webkit-backdrop-filter: blur(16px) saturate(1.25);
  box-shadow: 0 16px 44px rgba(8, 26, 22, .22);
  padding: 11px 14px 10px;
  transform: translateX(calc(-100% - 24px));
  opacity: 0;
  /* visibility 必须显式关：只写 opacity:0 的话元素仍在 tab 序列与无障碍树里，
     键盘用户能 Tab 到看不见的「关注/监控/下载/分享」并回车触发（pointer-events
     只挡鼠标）。visibility 的延迟 = 等滑出动画走完再真正隐藏。 */
  visibility: hidden;
  transition: transform .42s cubic-bezier(.22, .61, .36, 1), opacity .3s ease, visibility 0s linear .42s;
  pointer-events: none;
}
.fqc-card.is-visible {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* 展开时等把手先滑出，卡片再滑入，避免重叠；第三个值给 visibility，必须 0 延迟
     （否则滑入过程中元素还不可见，动画看不到） */
  transition-delay: .14s, .14s, 0s;
}
.fqc-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.fqc-id {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 0 1 auto;
}
.fqc-code {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
.fqc-name {
  font-size: 15px;
  font-weight: 700;
  margin: 0;
  max-width: 110px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fqc-follow {
  width: 20px; height: 20px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0; flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.fqc-follow:hover { color: var(--brand); transform: scale(1.15); }
.fqc-follow.is-active { color: var(--brand); }
.fqc-follow.is-active svg { fill: var(--brand); }
.fqc-follow.is-holding { color: #d97706; }
.fqc-follow.is-holding svg { fill: #d97706; }
.fqc-follow:disabled { opacity: .6; cursor: wait; }
.fqc-badge {
  display: inline-block;
  padding: 2px 8px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  color: var(--ink-2);
  background: var(--surface-3);
  white-space: nowrap;
  flex-shrink: 0;
}
.fqc-quote {
  text-align: right;
  flex-shrink: 0;
  margin-left: auto;
  line-height: 1.25;
}
.fqc-price {
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.01em;
}
.fqc-change {
  display: block;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.fqc-change.up { color: var(--up); }
.fqc-change.down { color: var(--down); }
.fqc-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
}
.fqc-btn {
  width: 30px; height: 30px;
  border: 0; border-radius: 8px;
  background: var(--brand-soft);
  color: var(--brand);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: background .15s, color .15s;
}
.fqc-btn:hover { background: var(--brand); color: #fff; }
.fqc-btn.active { background: var(--brand); color: #fff; }
.fqc-btn:disabled { opacity: .6; cursor: wait; }
.fqc-btn.is-link { text-decoration: none; }
.fqc-collapse {
  margin-left: auto;
  width: 30px; height: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; padding: 0;
  transition: border-color .15s, color .15s;
}
.fqc-collapse:hover { border-color: var(--brand); color: var(--brand); }
/* 收起后的贴边把手：横排显示股票名称，贴左边缘 */
.fqc-handle {
  position: fixed;
  left: 0;
  bottom: 40px;
  z-index: 150;
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: 150px;
  padding: 8px 10px 8px 12px;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 10px 10px 0;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  box-shadow: 6px 6px 20px rgba(8, 26, 22, .16);
  color: var(--brand);
  cursor: pointer;
  transform: translateX(calc(-100% - 10px));
  opacity: 0;
  /* 同 .fqc-card：不写 visibility 时，展开状态下这块看不见的把手仍可点击
     （它连 pointer-events:none 都没有），左下角会留一块吞点击的幽灵区域 */
  visibility: hidden;
  pointer-events: none;
  transition: transform .4s cubic-bezier(.22, .61, .36, 1), opacity .28s ease, visibility 0s linear .4s;
}
.fqc-handle.is-visible {
  transform: translateX(0);
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  /* 收起时等卡片先滑出，把手再滑入 */
  transition-delay: .14s, .14s, 0s;
}
.fqc-handle svg { display: block; flex-shrink: 0; }
.fqc-handle-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}
.fqc-handle:hover { background: var(--brand-soft); }
.fqc-handle:hover .fqc-handle-label { color: var(--brand); }
@media (prefers-reduced-motion: reduce) {
  /* visibility 的过渡不能省：省掉会退化成「立即隐藏」，把 opacity 淡出也一起吞掉 */
  .fqc-card, .fqc-handle { transition: opacity .15s ease, visibility 0s linear .15s; }
  .fqc-card.is-visible, .fqc-handle.is-visible { transition-delay: 0s, 0s; }
}



/* ===== 智能客服面板 ===== */
.support-panel {
  position: fixed; right: 22px; bottom: 76px; z-index: 120;
  width: clamp(360px, 30vw, 460px); max-width: calc(100vw - 28px);
  height: clamp(440px, 62vh, 640px); max-height: calc(100vh - 120px);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 14px 40px rgba(8,24,20,.28);
  display: flex; flex-direction: column;
  opacity: 0; visibility: hidden; transform: translateY(14px);
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  overflow: hidden;
}
.support-panel.open { opacity: 1; visibility: visible; transform: translateY(0); }
.support-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: linear-gradient(120deg, var(--brand-deep, #0a3f36), var(--brand-strong, #0e7c6b)); color: #fff;
  cursor: grab; user-select: none; touch-action: none;
}
.support-panel.dragging { transition: none; }
.support-panel.dragging .support-head { cursor: grabbing; }
.support-head-title { font-size: 14px; font-weight: 600; }
.support-close {
  border: 0; background: transparent; color: rgba(255,255,255,.85); font-size: 18px;
  line-height: 1; cursor: pointer; padding: 2px 6px; border-radius: 6px;
}
.support-close:hover { background: rgba(255,255,255,.14); color: #fff; }
.support-messages {
  flex: 1; overflow-y: auto; padding: 12px 12px 6px;
  display: flex; flex-direction: column; gap: 8px;
  scrollbar-width: thin;
}
.support-msg { display: flex; }
.support-msg-bot { justify-content: flex-start; }
.support-msg-user { justify-content: flex-end; }
.support-msg-inner {
  max-width: 84%; padding: 8px 11px; border-radius: 12px;
  font-size: 13px; line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}
.support-msg-bot .support-msg-inner {
  background: var(--surface-3); color: var(--ink); border-top-left-radius: 4px;
}
.support-msg-user .support-msg-inner {
  background: linear-gradient(120deg, var(--brand-strong, #0e7c6b), var(--brand-deep, #0a6b5c)); color: #fff; border-top-right-radius: 4px;
}
.support-msg-p { margin: 0; }
.support-msg-p + .support-msg-p { margin-top: 4px; }
.support-typing .support-msg-inner { color: var(--muted); }
.support-chips {
  display: flex; flex-wrap: wrap; gap: 6px; padding: 8px 12px 2px;
  border-top: 1px solid var(--line);
}
.support-chip {
  border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2);
  font-size: 11px; padding: 4px 10px; border-radius: 999px; cursor: pointer;
  transition: all .15s ease;
}
.support-chip:hover { border-color: var(--brand); color: var(--brand); }
.support-input-row {
  display: flex; gap: 8px; padding: 8px 12px 12px; align-items: flex-end;
}
.support-input {
  flex: 1; resize: none; min-height: 36px; max-height: 110px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2);
  color: var(--ink); font-size: 13px; padding: 7px 10px;
}
/* 全局 textarea:focus-visible 会叠加 2px outline，与自身 border 变色形成双边框，这里关闭 */
.support-input:focus { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.support-input:focus-visible { outline: none; }
.support-send { min-height: 36px; padding: 0 18px; font-size: 13px; }
@media (max-width: 480px) {
  .support-panel { right: 10px; bottom: 66px; width: calc(100vw - 20px); height: 70vh; }
}

/* ---------- 个人中心「积分兑换」页（内联表单，无弹窗） ---------- */
.exchange-grid { margin-bottom: 14px; }
.ex-overview {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 14px;
}
.ex-overview-main { display: flex; flex-direction: column; gap: 3px; }
.ex-overview-label { font-size: 12px; color: var(--muted); }
.ex-overview-amount { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ex-rate-chip {
  display: flex; flex-direction: column; align-items: flex-end; gap: 2px;
  padding: 8px 14px; border-radius: 10px;
  background: var(--brand-soft); border: 1px solid var(--brand-line, rgba(14,124,107,.28));
}
.ex-rate-chip b { color: var(--brand-strong); font-size: 13.5px; }
.ex-rate-chip small { font-size: 11px; }
.ex-form { display: flex; flex-direction: column; gap: 10px; }
.ex-amount-label { display: flex; align-items: center; justify-content: space-between; }
.ex-amount-label .rc-section-label { margin: 0; }
.ex-all-btn { padding: 3px 12px; font-size: 12px; }
.ex-form .rc-amount-custom-wrap { width: 100%; box-sizing: border-box; }
.ex-preview {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--line);
  font-size: 13px; color: var(--muted);
}
.ex-preview-points { color: var(--brand-strong); font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ex-preview-note { font-size: 11px; }
.ex-submit { width: 100%; box-sizing: border-box; padding: 11px 0; font-size: 14px; }
.ex-message { margin: 0; font-size: 12px; min-height: 16px; }
.ex-link { color: var(--brand); font-weight: 600; }
/* 会员中心「使用会员兑换码」卡片：复用积分券输入行样式，仅追加记录小字区 */
/* 兑换记录内联区块（原弹窗改页内） */
.exchange-records-card { margin-top: 0; }
.voucher-record-list { display: flex; flex-direction: column; gap: 8px; }
/* 兑换记录条目：左侧类型徽章（兑换码/余额兑换）区分来源 */
.voucher-record-card { display: flex; align-items: center; gap: 10px; }
.voucher-record-badge {
  flex: none; padding: 2px 9px; border-radius: 999px; font-size: 11px; font-weight: 600;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--line);
}
.voucher-record-badge.voucher { background: var(--brand-soft); color: var(--brand-strong); border-color: var(--brand-line, rgba(14,124,107,.28)); }
/* 兑换记录「会员券」徽章：金色系与会员身份呼应 */
.voucher-record-badge.vip { background: color-mix(in srgb, #d4a017 14%, transparent); color: #a4760e; border-color: rgba(212,160,23,.35); }
/* 兑换页纵向堆叠（2026-10-02 运营反馈：左右并排两卡高度悬殊、右侧大片留白显丑）。
   单列网格：余额兑换 → 使用积分兑换码 →（网格外）兑换记录；等高规则随之无效果但无害 */
.pf-grid.exchange-grid { grid-template-columns: 1fr; align-items: stretch; }
.exchange-grid > .pf-card + .pf-card { margin-top: 0; }
.exchange-grid .pf-card { display: flex; flex-direction: column; }
.exchange-grid .pf-card > :last-child { margin-top: auto; }
/* 兑换码输入行：全宽卡下输入框不再无限拉伸（否则与右侧按钮隔出大空隙），保持紧凑表单形态 */
.points-voucher-row .points-voucher-input { max-width: 460px; }
/* 兑换金额输入框：包装盒已有 focus-within 描边，关闭全局 :focus-visible 的外圈，避免双高亮 */
.ex-form .rc-amount-custom:focus-visible { outline: none; }
/* 充值下单金额输入框同款修复 */
.rc-amount-custom-wrap .rc-amount-custom:focus-visible { outline: none; }

/* 充值下单：充值抵扣券选择列表 */
.rc-coupon-list { display: flex; flex-direction: column; gap: 6px; }
.rc-coupon-item {
  display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; cursor: pointer;
  background: var(--surface); transition: border-color .15s, background .15s;
}
.rc-coupon-item:hover { border-color: var(--brand-line); }
.rc-coupon-item.selected { border-color: var(--brand); background: var(--brand-soft); }
.rc-coupon-label { font-size: 13px; font-weight: 600; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rc-coupon-item small { font-size: 11px; flex-shrink: 0; }
/* 余额页：充值渠道未关闭时的常驻说明 */
.bal-hero-off-hint { margin: 4px 0 0; font-size: 11.5px; color: var(--warn); }
/* 充值记录中的用券口径行 */
.rc-record-coupon {
  font-size: 12px; color: var(--brand-strong); font-weight: 600;
  background: var(--brand-soft); border-radius: 8px; padding: 5px 10px; margin-top: 6px;
}
/* 我的卡券页：用途说明（与积分兑换码区分） */
.coupons-usage-tip {
  margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 12px; line-height: 1.6;
  background: var(--brand-soft); border: 1px solid var(--brand-line, rgba(14,124,107,.28));
}

/* ===========================================================================
   演示试用模式（Access Gate）—— 未授权访客的经营性入口屏蔽
   class 由 index.html 首帧内联脚本同步打到 <html> 上，早于 CSSOM 完成，
   因此不存在"先显示再消失"的闪动。给 DOM 打标记而不是在 JS 里 remove()，
   是为了让出口 DOM 保持存在、授权后由 CSS 一键恢复，不做二次渲染。
   =========================================================================== */
html.access-demo [data-access-restricted] { display: none !important; }
html.access-granted [data-access-demo-only] { display: none !important; }

/* 演示版「申请授权」引导按钮（替代顶栏登录/注册按钮，点击弹友情提示） */
.auth-demo-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line, #d8dee9); background: transparent;
  color: var(--muted, #6b7280); font-size: 13px; line-height: 1.4;
  transition: color .16s, border-color .16s;
}
.auth-demo-btn:hover { color: var(--brand-strong, #2563eb); border-color: var(--brand-strong, #2563eb); }

.demo-access-dialog #demo-access-message {
  white-space: pre-line; line-height: 1.7; color: var(--ink, #1f2937);
}
.demo-access-dialog .app-alert-actions {
  flex-wrap: wrap; gap: 12px; margin-top: 4px;
  justify-content: center;
}
.demo-access-dialog .app-alert-actions .primary,
.demo-access-dialog .app-alert-actions .secondary {
  flex: 1 1 140px; max-width: 240px; min-width: 132px;
  padding: 10px 20px; font-size: 13.5px; font-weight: 700; line-height: 1.4;
  box-sizing: border-box;
}

/* 公告阅读弹窗：整行点击进入后的详情（标题/按钮等入口已在列表行收口） */
.notice-dialog { width: min(720px, calc(100% - 28px)); }
.notice-dialog-head {
  width: 100%; min-width: 0; box-sizing: border-box;
  padding: 18px 22px 14px; margin: 0; flex-shrink: 0;
}
.notice-dialog-head h2 { font-size: 17px; line-height: 1.5; }
.notice-dialog-body { padding: 14px 22px 22px; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.notice-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.notice-chip {
  display: inline-flex; align-items: center;
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 5px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface-3); color: var(--ink-2);
}
.notice-chip--plain { color: var(--muted); }
.notice-chip--accent { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.notice-chip--up { color: var(--up); border-color: color-mix(in oklab, var(--up) 32%, transparent); background: color-mix(in oklab, var(--up) 9%, var(--surface)); }
.notice-chip--down { color: var(--down); border-color: color-mix(in oklab, var(--down) 32%, transparent); background: color-mix(in oklab, var(--down) 9%, var(--surface)); }
/* 正文区：公告原文通常很长，独立滚动而不是把整个弹窗撑高 */
.notice-reader {
  max-height: 52vh; overflow-y: auto;
  font-size: 13px; line-height: 1.85; color: var(--ink-2);
  background: var(--surface-3); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px 16px; white-space: pre-wrap; word-break: break-word;
}
.notice-disclaimer { margin: 0; font-size: 11.5px; line-height: 1.6; }
.notice-hint { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
.notice-hint.hidden { display: none; }
.notice-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.notice-open-original {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0 18px; text-decoration: none; /* 只留左右留白：字号/高度沿用 .primary 原貌 */
}
.notice-open-original.hidden { display: none; }

/* ================= 监控警钟控件（static/js/monitor-bell.js） ================= */
/* 形态A收起态（大钟/风铃/迷你铃铛/圆点四种外形，运营台 monitor_bell.form 切换）/
   形态B告警卡片 / 形态C监控管理弹窗。节奏参数由 /api/monitor/bell-config 下发。 */

/* ---- 四种外形：宽度 --mb-w、高度 --mb-h、绳长 --mb-rope-len、贴边位置 ---- */
.mb-pivot[data-form="bell"] { --mb-w: 120px; --mb-h: 150px; --mb-rope-len: 56px; left: 34px; }
.mb-pivot[data-form="chime"]{ --mb-w: 60px;  --mb-h: 88px;  --mb-rope-len: 38px; left: 10px; }
.mb-pivot[data-form="mini"]  { --mb-w: 36px;  --mb-h: 52px;  --mb-rope-len: 26px; left: 6px; }
.mb-pivot[data-form="dot"]   { --mb-w: 22px;  --mb-h: 22px;  --mb-rope-len: 16px; left: 6px; }

.mb-pivot {
  position: fixed; left: 10px; top: var(--topbar-h); z-index: 190; /* 在抽屉(z201)之下：不盖住抽屉 */
  --mb-w: 60px; --mb-h: 88px; --mb-rope-len: 38px;
  width: var(--mb-w); height: calc(var(--mb-rope-len) + var(--mb-h)); transform-origin: 50% 0;
  transition: transform .28s ease, filter .3s ease;
}
.mb-pivot.hide { opacity: 0 !important; transform: translateY(-16px) scale(.9); pointer-events: none; }
/* 无监控 / 无告警 / 已剪绳消失：彻底不占位、不可点（内联 opacity 由虚化帧驱动，故加 !important） */
.mb-pivot.feature-off { opacity: 0 !important; pointer-events: none; }
.mb-rope {
  position: absolute; left: 50%; width: 4px;
  transform: translateX(-50%); border-radius: 3px;
  background: repeating-linear-gradient(135deg, #b08d5b 0 3px, #9a7845 3px 6px);
  /* 浅底上立住：棕芯外加深色细描边；深面板上描边融入、棕芯仍清晰 */
  box-shadow: 0 0 0 1.4px rgba(66, 46, 18, .5), 0 1px 2px rgba(0, 0, 0, .25);
}
/* 上段绳（顶栏 → 剪断点） */
.mb-rope-top { top: 0; height: calc(var(--mb-rope-len) * .42); }
.mb-rope-top::before { content: ""; position: absolute; top: -3px; left: 50%; transform: translateX(-50%); width: 8px; height: 6px; border-radius: 4px; background: #8a6a3a; }
/* 剪绳后上段向上抽回 */
.mb-rope-top.retract { animation: mbRopeRetract .35s cubic-bezier(.5, 0, .8, .4) forwards; }
@keyframes mbRopeRetract { to { transform: translateX(-50%) translateY(-22px) rotate(9deg); opacity: 0; } }
/* 下落组（剪断点以下：下段绳 + 铃铛） */
.mb-drop { position: absolute; left: 0; top: calc(var(--mb-rope-len) * .42); width: var(--mb-w); }
.mb-drop .mb-rope-bottom { top: 0; height: calc(var(--mb-rope-len) * .58); }
.mb-drop .mb-rope-bottom::after { content: ""; position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); width: 9px; height: 6px; border-radius: 4px; background: #8a6a3a; }
.mb-drop .mb-bell { top: calc(var(--mb-rope-len) * .58 - 14px); }
/* 剪断点：悬停整根绳时浮现剪刀 */
.mb-rope-cut {
  position: absolute; top: calc(var(--mb-rope-len) * .42); left: 50%;
  width: 26px; height: 26px; transform: translate(2px, -50%);
  border: 0; background: transparent; cursor: pointer; padding: 0;
  opacity: 0; transition: opacity .18s ease;
}
.mb-rope-cut svg { width: 24px; height: 24px; fill: none; stroke: var(--accent); stroke-width: 1.7; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .35)); }
.mb-pivot:hover .mb-rope-cut { opacity: 1; }
.mb-rope-cut:hover svg { stroke: var(--warn-ink); animation: mbScissorsSnip .5s ease-in-out infinite; }
@keyframes mbScissorsSnip { 0%, 100% { transform: rotate(-7deg); } 50% { transform: rotate(9deg); } }
/* 迷你/圆点形态完全贴在左侧空隙、不遮内容，不展示剪绳彩蛋 */
.mb-pivot[data-form="mini"] .mb-rope-cut,
.mb-pivot[data-form="dot"] .mb-rope-cut { display: none; }
.mb-bell {
  display: block; position: absolute; left: 0;
  width: var(--mb-w); height: var(--mb-h); padding: 0; border: 0; background: transparent;
  cursor: pointer; border-radius: 12px;
}
/* 落地撞击：钟挤压回弹后淡出 */
.mb-bell.splat { animation: mbBellSplat .95s cubic-bezier(.3, .7, .3, 1) forwards; transform-origin: 50% 100%; }
@keyframes mbBellSplat {
  0% { transform: scaleY(.35) scaleX(1.28); }
  16% { transform: scaleY(1.12) scaleX(.92); }
  32% { transform: scaleY(.92) scaleX(1.06); }
  48% { transform: scaleY(1.03) scaleX(.99); }
  64% { transform: scaleY(1) scaleX(1); opacity: 1; }
  100% { transform: scaleY(1) scaleX(1); opacity: 0; }
}
/* 落地尘土 */
.mb-dust { position: absolute; left: 50%; bottom: -4px; width: 44px; height: 14px; transform: translateX(-50%); pointer-events: none; }
.mb-dust::before, .mb-dust::after { content: ""; position: absolute; bottom: 0; border-radius: 50%; background: radial-gradient(circle, rgba(120, 108, 80, .55), rgba(120, 108, 80, 0)); }
.mb-dust::before { width: 16px; height: 9px; left: 4px; animation: mbDustPuff .8s ease-out forwards; }
.mb-dust::after { width: 22px; height: 12px; right: 3px; animation: mbDustPuff .95s ease-out .05s forwards; }
@keyframes mbDustPuff { 0% { transform: translateY(4px) scale(.5); opacity: .9; } 100% { transform: translateY(-14px) scale(1.3); opacity: 0; } }
/* 新告警重挂：钟从顶部落入 */
.mb-drop.resummon { animation: mbDropIn .7s cubic-bezier(.3, 1.45, .4, 1) both; }
@keyframes mbDropIn { 0% { transform: translateY(-96px); opacity: 0; } 60% { opacity: 1; } 100% { transform: translateY(0); opacity: 1; } }
.mb-bell:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mb-bell-svg { width: var(--mb-w); height: var(--mb-h); display: block; overflow: visible; }
.mb-count {
  position: absolute; right: -2px; bottom: 0; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700;
  display: grid; place-items: center; box-shadow: 0 2px 6px rgba(192, 57, 43, .5);
  border: 1.5px solid #fff;
}
.mb-count.soft { background: var(--warn); box-shadow: 0 3px 8px rgba(185, 123, 29, .5); }
/* 静默：去饱和、轻微呼吸摆动 */
.mb-pivot.idle .mb-bell-svg { filter: grayscale(.6) brightness(.94); opacity: .9; }
.mb-pivot.idle { animation: mbIdleSway 6s ease-in-out infinite; }
@keyframes mbIdleSway { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(1.2deg); } }
/* 有未读：金色光晕 */
.mb-pivot.unviewed { filter: drop-shadow(0 8px 16px rgba(184, 134, 47, .5)); }
.mb-pivot.exhausted { filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .12)); }
.mb-pivot.exhausted .mb-bell-svg { filter: grayscale(.4) brightness(.92); }
.mb-pivot.muted .mb-bell-svg { filter: grayscale(.75) brightness(.9); }
/* 敲击晃动（衰减振荡） */
.mb-pivot.ringing { animation: mbSwing 1.35s ease-in-out 3; }
.mb-pivot.ringing.critical { animation: mbSwingCrit 1.25s ease-in-out 3; filter: drop-shadow(0 0 18px rgba(192, 57, 43, .6)); }
@keyframes mbSwing {
  0% { transform: rotate(0); } 9% { transform: rotate(-10deg); } 21% { transform: rotate(8deg); }
  33% { transform: rotate(-6deg); } 45% { transform: rotate(4deg); } 57% { transform: rotate(-2.5deg); }
  70% { transform: rotate(1.5deg); } 84% { transform: rotate(-.6deg); } 100% { transform: rotate(0); }
}
@keyframes mbSwingCrit {
  0% { transform: rotate(0); } 9% { transform: rotate(-14deg); } 21% { transform: rotate(11deg); }
  33% { transform: rotate(-8deg); } 45% { transform: rotate(5.5deg); } 57% { transform: rotate(-3deg); }
  70% { transform: rotate(1.8deg); } 84% { transform: rotate(-.8deg); } 100% { transform: rotate(0); }
}

/* ---- 形态B：告警卡片（展开态，自左滑入） ---- */
.mb-card {
  position: fixed;
  top: calc(var(--topbar-h) + 50px); left: 14px; z-index: 190; /* 顶栏+50：为收起抽屉的 44px header 留出固定空隙；且在抽屉之下 */
  width: 326px; max-width: calc(100vw - 28px);
  /* 固定高度，不随条数变高；矮视口也要容得下 head+actions+footer，
     列表自身收缩滚动（v0.0.25 修复：list 曾强制 min-height:150px 把 footer 顶出卡片） */
  height: calc(50vh - 188px);
  min-height: min(240px, calc(100vh - var(--topbar-h) - 70px));
  max-height: calc(100vh - var(--topbar-h) - 70px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--radius-lg); box-shadow: 0 18px 48px rgba(8, 26, 22, .24);
  transform: translateX(calc(-100% - 30px)); opacity: 0; visibility: hidden;
  transition: transform .42s cubic-bezier(.22, .61, .36, 1), visibility 0s linear .42s;
}
.mb-card.open { transform: translateX(0); visibility: visible; transition-delay: 0s; }
.mb-card-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px 8px; }
.mb-card-title { font-size: 15px; font-weight: 700; margin: 0; }
.mb-card-count { font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 99px; background: var(--brand-soft); color: var(--brand); }
.mb-card-count.has { background: var(--danger-soft); color: var(--danger); }
.mb-card-spacer { flex: 1; }
.mb-card-status { font-size: 10.5px; color: var(--muted); display: flex; align-items: center; gap: 5px; }
.mb-card-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--down); }
.mb-card-status.busy i { background: var(--warn); animation: mbBlink 1s infinite; }
@keyframes mbBlink { 50% { opacity: .3; } }
.mb-card-close { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 17px; }
.mb-card-close:hover { background: var(--surface-3); color: var(--ink); }
.mb-card-actions { display: flex; gap: 8px; padding: 0 14px 10px; }
.mb-btn { flex: 1; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); border-radius: 10px; padding: 8px 6px; font-size: 12.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 5px; transition: .15s; }
.mb-btn:hover { border-color: var(--brand); color: var(--brand); }
.mb-btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.mb-btn-primary:hover { background: color-mix(in srgb, var(--brand) 85%, #000); color: #fff; }
.mb-btn:disabled { opacity: .6; cursor: wait; }
.mb-card-list { flex: 1 1 auto; overflow-y: auto; padding: 2px 12px 10px; min-height: 0; display: flex; flex-direction: column; gap: 8px; scrollbar-width: thin; }
.mb-item { border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: 11px; padding: 8px 10px; background: var(--surface-2); cursor: pointer; }
.mb-item.critical { border-left-color: var(--danger); }
.mb-item.warning { border-left-color: var(--warn); }
.mb-item.unviewed { background: var(--accent-soft); }
.mb-item.unviewed.critical { background: var(--danger-soft); }
.mb-item-top { display: flex; align-items: center; gap: 6px; font-size: 10.5px; }
.mb-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.mb-type { font-weight: 700; padding: 1px 7px; border-radius: 99px; background: var(--surface-3); color: var(--ink-2); }
.mb-item.critical .mb-type { background: var(--danger-soft); color: var(--danger); }
.mb-item.warning .mb-type { background: var(--warn-soft); color: var(--warn-ink); }
.mb-dot { margin-left: auto; width: 7px; height: 7px; border-radius: 50%; background: var(--warn); }
.mb-item.critical .mb-dot { background: var(--danger); }
.mb-stock { font-weight: 700; font-size: 13px; margin: 4px 0 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-msg { font-size: 12px; color: var(--ink-2); line-height: 1.4; }
.mb-detail { font-size: 11.5px; color: var(--muted); margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line-strong); display: none; line-height: 1.6; }
.mb-item.expanded .mb-detail { display: block; }
.mb-empty { padding: 36px 18px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.8; }
.mb-empty .em { font-size: 30px; display: block; margin-bottom: 8px; }
.mb-card-foot { padding: 8px 14px; font-size: 10.5px; color: var(--faint); border-top: 1px solid var(--line); display: flex; gap: 6px; align-items: center; justify-content: space-between; }
.mb-card-link { background: transparent; border: 0; color: var(--brand); cursor: pointer; font-size: 10.5px; padding: 0; }

/* ---- 形态C：监控管理弹窗（原生 dialog） ---- */
.mb-manage { border: 0; border-radius: 18px; padding: 0; width: 540px; max-width: calc(100vw - 28px); max-height: 82vh; overflow: hidden; color: var(--ink); background: var(--surface); }
.mb-manage::backdrop { background: rgba(8, 28, 23, .5); backdrop-filter: blur(3px); }
.mb-md-head { display: flex; align-items: center; gap: 10px; padding: 15px 18px 12px; }
.mb-md-title { font-size: 16px; font-weight: 700; margin: 0; }
.mb-md-limit { font-size: 11px; color: var(--muted); }
.mb-md-spacer { flex: 1; }
.mb-md-close { width: 30px; height: 30px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: 18px; }
.mb-md-close:hover { background: var(--surface-3); }
.mb-md-list { overflow-y: auto; padding: 0 18px 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; }
.mb-md-row { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-2); }
.mb-md-ava { width: 34px; height: 34px; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 12px; flex-shrink: 0; }
.mb-md-info { min-width: 0; }
.mb-md-name { font-weight: 700; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-md-meta { font-size: 11px; color: var(--muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mb-md-grow { flex: 1; }
.mb-md-interval { border: 1px solid var(--line-strong); border-radius: 9px; padding: 6px; font-size: 12px; background: var(--surface); color: var(--ink-2); cursor: pointer; }
.mb-md-remove { border: 1px solid color-mix(in srgb, var(--danger) 35%, transparent); background: var(--surface); color: var(--danger); border-radius: 9px; padding: 7px 11px; font-size: 12px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.mb-md-remove:hover { background: var(--danger); color: #fff; border-color: var(--danger); }
.mb-md-empty { padding: 34px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.mb-md-foot { padding: 10px 18px 15px; font-size: 11px; color: var(--muted); border-top: 1px solid var(--line); background: var(--surface-2); }

@media (prefers-reduced-motion: reduce) {
  .mb-pivot.ringing, .mb-pivot.idle { animation: none !important; }
  .mb-card, .mb-pivot { transition-duration: .15s; }
}


/* ===== 开发者视图水印（合规双轨 v0.0.21，PLAN 九·9.5） =====
   仅在 compliance.mode=permissive 且查看者为 admin 时由 features.js 摘掉 hidden；
   strict / 游客 / 普通用户恒隐藏。fixed 左下角、极小字号、不可交互，截图可见即本意。 */
.dev-watermark {
  position: fixed; left: 10px; bottom: 8px; z-index: 4000;
  font-size: 11px; line-height: 1; letter-spacing: .5px;
  color: var(--muted); opacity: .75; pointer-events: none; user-select: none;
  background: color-mix(in srgb, var(--surface) 72%, transparent);
  border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px;
}
.dev-watermark.hidden { display: none; }

/* ===== 分享页旧口径历史标注横幅（PLAN 七·风险2 缓解） ===== */
.share-legacy-banner {
  margin: 0 0 12px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--surface-2, var(--surface));
  color: var(--muted); font-size: 12.5px; line-height: 1.5;
}
