/* feicui.ai 共用元件层（clients/platform/DESIGN_LANGUAGE.md §5–§10）。
   只定义 fc- 前缀类、按需引用，不改任何全局元素选择器；只读 style.css 令牌，禁止散写色值、字号、圆角。
   每个元件的唯一样张在 /design（templates/design_system.html），改这里须同一 PR 同步规范与样张。 */

/* ── 版型容器与页头（v2.1 三档宽：阅读 960 / 报告 1280 / 看板 1680） ── */
.fc-container-reading { max-width: var(--w-reading); margin: 0 auto; padding: var(--sp-4) var(--sp-5) var(--sp-6); }
.fc-container-report { max-width: var(--w-report); margin: 0 auto; padding: var(--sp-4) var(--sp-5) var(--sp-6); }
.fc-container-workbench { max-width: var(--w-workbench); margin: 0 auto; padding: var(--sp-4) var(--sp-5) var(--sp-5); }
.fc-page-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-3); flex-wrap: wrap; margin: 0 0 var(--sp-3); }
.fc-page-head-main { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.fc-page-head h1 { position: relative; margin: 0; padding-left: var(--sp-3); font-size: var(--fs-page); font-weight: 600; line-height: 1.3; color: var(--color-text); }
.fc-page-head h1::before { content: ""; position: absolute; left: 0; top: var(--sp-1); bottom: var(--sp-1); width: 3px; background: var(--color-link); }
/* 吸顶毛玻璃表面（§9）：报告头部固定框架与页内吸顶条共用，正文滚过其下方时柔和透光；子栏保持 transparent 避免遮挡 */
.fc-sticky-chrome { background: var(--color-chrome-glass); backdrop-filter: var(--chrome-glass-blur); -webkit-backdrop-filter: var(--chrome-glass-blur); }
.fc-sticky-chrome-card { background: var(--color-chrome-glass-card); backdrop-filter: var(--chrome-glass-blur); -webkit-backdrop-filter: var(--chrome-glass-blur); }

/* ── 卡片与色带 ── */
.fc-card { background: var(--color-card-bg); border: 1px solid var(--color-card-border); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; }
.fc-card + .fc-card { margin-top: var(--sp-4); }
.fc-card-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); min-height: 40px; padding: var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--color-border-subtle); font-size: var(--fs-body); font-weight: 600; color: var(--color-text); }
.fc-card-meta { font-size: var(--fs-meta); font-weight: 400; color: var(--color-text-muted); white-space: nowrap; }
.fc-card-tools { display: inline-flex; align-items: center; gap: var(--sp-2); margin-left: auto; }
.fc-zoom-btn { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; padding: 0; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--color-text-muted); cursor: zoom-in; }
.fc-zoom-btn:hover { background: var(--color-bg-muted); color: var(--color-text); }
.fc-zoom-btn:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
.fc-band { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); padding: var(--sp-1) var(--sp-3); background: var(--color-table-head-bg); border-bottom: 1px solid var(--color-border); font-size: var(--fs-aux); font-weight: 600; color: var(--color-text-muted); }
.fc-band > span + span { font-weight: 400; font-size: var(--fs-meta); }
.fc-card-body { padding: var(--sp-3) var(--sp-4); }
.fc-section-title { margin: var(--sp-6) 0 var(--sp-3); padding-left: var(--sp-3); border-left: 3px solid var(--color-text-muted); font-size: var(--fs-section); font-weight: 600; line-height: 1.3; color: var(--color-text); }
.fc-th-sub { display: block; margin-top: 2px; font-size: var(--fs-meta); font-weight: 400; color: var(--color-text-muted); }

/* ── 横版看板骨架、KPI 卡与分位标尺卡（v2.1 复合元件） ── */
.fc-workbench { display: grid; grid-template-columns: var(--fc-side-w, 300px) minmax(0, 1fr); gap: var(--sp-3); align-items: stretch; }
.fc-kpi { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; padding: var(--sp-2) var(--sp-3); border: 1px solid var(--color-border-subtle); border-radius: var(--r-ctl); background: var(--color-bg-muted); font-variant-numeric: tabular-nums; }
.fc-kpi-label { font-size: var(--fs-meta); color: var(--color-text-muted); }
.fc-kpi-value { font-size: var(--fs-section); font-weight: 700; line-height: 1.25; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-kpi-sub { font-size: var(--fs-meta); color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.fc-pctl { display: flex; flex-direction: column; justify-content: space-between; gap: var(--sp-3); flex: 1 1 auto; padding: var(--sp-2) 0 0; font-variant-numeric: tabular-nums; }
.fc-pctl-hero { display: flex; align-items: baseline; justify-content: space-between; gap: var(--sp-2); }
.fc-pctl-val { font-size: var(--fs-display); font-weight: 700; line-height: 1.15; color: var(--color-text); }
.fc-pctl-val.is-empty { color: var(--color-text-muted); }
.fc-pctl-tag { display: inline-flex; align-items: center; min-height: 20px; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: color-mix(in srgb, var(--color-link) 12%, var(--color-card-bg)); color: var(--color-text); font-size: var(--fs-meta); font-weight: 600; white-space: nowrap; }
.fc-pctl-track { position: relative; height: 10px; border-radius: var(--r-pill); border: 1px solid var(--color-border-subtle); background: linear-gradient(90deg, rgb(var(--color-heat-down-rgb) / .24) 0%, var(--color-bg-muted) 50%, rgb(var(--color-heat-up-rgb) / .24) 100%); }
.fc-pctl-fill { position: absolute; left: 0; top: 0; bottom: 0; width: var(--fc-pctl, 0%); border-radius: var(--r-pill); background: color-mix(in srgb, var(--chart-1) 35%, transparent); }
.fc-pctl-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--color-border); }
.fc-pctl-tick-25 { left: 25%; }
.fc-pctl-tick-50 { left: 50%; }
.fc-pctl-tick-75 { left: 75%; }
.fc-pctl-mean { position: absolute; top: -3px; bottom: -3px; left: var(--fc-mean, 50%); width: 2px; border-radius: var(--r-pill); background: var(--color-text-muted); }
.fc-pctl-pin { position: absolute; top: 50%; left: var(--fc-pctl, 0%); transform: translate(-50%, -50%); width: 14px; height: 14px; border-radius: 50%; background: var(--chart-1); border: 2px solid var(--color-card-bg); box-shadow: 0 0 0 1px var(--chart-1); }
.fc-pctl-scale { display: flex; justify-content: space-between; gap: var(--sp-2); margin-top: var(--sp-1); font-size: var(--fs-meta); color: var(--color-text-muted); }
.fc-pctl-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--sp-2); }
.fc-pctl-empty { margin: 0; padding: var(--sp-3); border-radius: var(--r-ctl); background: var(--color-bg-muted); font-size: var(--fs-aux); color: var(--color-text-muted); line-height: 1.5; text-align: center; }

/* ── 表格（§5）：固定布局、标签列定宽、数据列平分；列头与本列同向对齐；隔行底；不画全网格 ── */
.fc-table-wrap { position: relative; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.fc-table-wrap.is-overflow-right { mask-image: linear-gradient(to right, var(--color-text) calc(100% - 32px), transparent); -webkit-mask-image: linear-gradient(to right, var(--color-text) calc(100% - 32px), transparent); }
.fc-table { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-size: var(--fs-table); line-height: 1.45; font-variant-numeric: tabular-nums; color: var(--color-text); }
.fc-table-wrap.fc-tall { max-height: min(70vh, 640px); overflow: auto; }
.fc-table-wrap.fc-wide .fc-table { min-width: calc(var(--fc-label-col, 8em) + var(--fc-cols, 6) * var(--fc-col-min, 88px)); }
.fc-table :is(th, td) { padding: var(--sp-2) var(--sp-3); text-align: left; vertical-align: middle; border-bottom: 1px solid var(--color-border-subtle); overflow-wrap: anywhere; }
.fc-table :is(th, td) + :is(th, td) { border-left: 1px solid var(--color-border-subtle); }
.fc-table :is(th, td):first-child { width: var(--fc-label-col, 8em); }
.fc-table thead th { position: sticky; top: 0; z-index: 1; background: var(--color-table-head-bg); color: var(--color-text-muted); font-size: var(--fs-aux); font-weight: 600; text-transform: none; letter-spacing: 0; border-bottom-color: var(--color-border); }
/* 无外包裹、直接处在页面滚动流中的表（如 13F 排行）：表头吸在站点页头与一级 Tab 下方（main.js 实测高度），不被吸顶页头压住；
   包裹层 / 卡片本身是滚动容器，表头相对容器 top:0（下移会在静止时压住数据行） */
.fc-table:not(.fc-table-wrap .fc-table, .fc-card .fc-table) thead th { top: var(--site-chrome-height, 0px); }
.fc-table .fc-num, .fc-table.fc-num-cols :is(th, td):not(:first-child) { text-align: right; }
.fc-table .fc-text { text-align: left; }
.fc-table tbody tr:nth-child(even) > * { background: var(--color-table-zebra); }
.fc-table tbody tr:hover > * { background: var(--color-table-hover); }
.fc-table tbody tr.fc-row-latest > * { background: var(--color-table-latest); font-weight: 600; }
.fc-table tbody tr.fc-row-total > * { border-top: 1px solid var(--color-border); font-weight: 600; }
.fc-table .fc-cell-empty { color: var(--color-text-muted); }
.fc-card > .fc-table-wrap .fc-table tbody tr:last-child > * { border-bottom: 0; }
.fc-table-wrap.fc-freeze-first .fc-table :is(th, td):first-child { position: sticky; left: 0; z-index: 2; background: var(--color-card-bg); }
.fc-table-wrap.fc-freeze-first .fc-table tbody tr:nth-child(even) > :first-child { background: var(--color-table-zebra); }
.fc-table-wrap.fc-freeze-first .fc-table tbody tr:hover > :first-child { background: var(--color-table-hover); }
.fc-table-wrap.fc-freeze-first .fc-table thead th:first-child { z-index: 3; }

/* 涨跌与热力（§1、§5）：文字只取涨跌令牌并带正负号；热力格内文字一律正文色 */
.fc-up { color: var(--color-market-up); }
.fc-down { color: var(--color-market-down); }
.fc-flat { color: var(--color-market-flat); }
.fc-heat-up { background: rgb(var(--color-heat-up-rgb) / min(var(--fc-heat, .3), var(--color-heat-alpha-max))); }
.fc-heat-down { background: rgb(var(--color-heat-down-rgb) / min(var(--fc-heat, .3), var(--color-heat-alpha-max))); }
.fc-table tbody tr > .fc-heat-up { background: rgb(var(--color-heat-up-rgb) / min(var(--fc-heat, .3), var(--color-heat-alpha-max))); }
.fc-table tbody tr > .fc-heat-down { background: rgb(var(--color-heat-down-rgb) / min(var(--fc-heat, .3), var(--color-heat-alpha-max))); }
:is(.fc-heat-up, .fc-heat-down), :is(.fc-heat-up, .fc-heat-down) :is(.fc-up, .fc-down, .fc-flat) { color: var(--color-text); font-weight: 600; }

/* ── 图表外框与勾选式图例（§6） ── */
.fc-chart { position: relative; height: var(--fc-chart-h, 280px); }
.fc-legend { display: flex; flex-wrap: wrap; gap: var(--sp-1) var(--sp-3); margin-top: var(--sp-2); font-size: var(--fs-meta); color: var(--color-text-muted); }
.fc-legend label { display: inline-flex; align-items: center; gap: var(--sp-1); min-height: 24px; cursor: pointer; }
.fc-legend input { margin: 0; accent-color: var(--fc-series, var(--color-link)); }

/* ── 图片（§7）：统一图框、固定比例占位；深色下白底图加内衬，不反色 ── */
.fc-figure { margin: 0; background: var(--color-card-bg); border: 1px solid var(--color-card-border); border-radius: var(--r-card); overflow: hidden; }
.fc-figure-media { display: block; background: var(--color-bg-muted); }
.fc-figure-media img { display: block; width: 100%; height: auto; aspect-ratio: var(--fc-ratio, auto); object-fit: contain; }
[data-theme="dark"] .fc-figure-media, [data-theme="fund"] .fc-figure-media { padding: var(--sp-2); }
[data-theme="dark"] .fc-figure-media img, [data-theme="fund"] .fc-figure-media img { border-radius: var(--r-ctl); }
.fc-figure figcaption { padding: var(--sp-2) var(--sp-3); font-size: var(--fs-aux); color: var(--color-text-muted); }
.fc-figure [data-fc-lightbox] { cursor: zoom-in; }

/* ── 灯箱外壳（§8）：唯一实现在 static/js/fc_lightbox.js ── */
html.fc-lightbox-open { overflow: hidden; }
.fc-lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: var(--sp-6); background: var(--color-overlay); }
.fc-lightbox[hidden] { display: none; }
.fc-lightbox-dialog { display: flex; flex-direction: column; width: min(1200px, 100%); max-height: 100%; background: var(--color-card-bg); color: var(--color-text); border: 1px solid var(--color-card-border); border-radius: var(--r-dialog); box-shadow: var(--shadow-pop); overflow: hidden; }
.fc-lightbox-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); padding: var(--sp-2) var(--sp-2) var(--sp-2) var(--sp-4); border-bottom: 1px solid var(--color-border-subtle); }
.fc-lightbox-title { margin: 0; font-size: var(--fs-body); font-weight: 600; }
.fc-lightbox-close { width: 32px; height: 32px; border: 0; border-radius: var(--r-ctl); background: transparent; color: var(--color-text-muted); font-size: var(--fs-section); line-height: 1; cursor: pointer; }
.fc-lightbox-close:hover { background: var(--color-bg-muted); color: var(--color-text); }
.fc-lightbox-body { flex: 1; min-height: 0; overflow: auto; padding: var(--sp-4); outline: none; }
.fc-lightbox-body.is-chart { flex: none; height: min(70vh, 640px); }
.fc-lightbox-body.is-image { display: flex; align-items: center; justify-content: center; padding: var(--sp-3); }
.fc-lightbox-zoom { display: block; padding: 0; border: 0; background: none; cursor: zoom-in; }
.fc-lightbox-body.is-zoomed .fc-lightbox-zoom { cursor: zoom-out; }
.fc-lightbox-zoom:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
.fc-lightbox-body.is-image img { display: block; max-width: 100%; max-height: calc(100vh - 140px); cursor: zoom-in; }
.fc-lightbox-body.is-image.is-zoomed { display: block; }
.fc-lightbox-body.is-image.is-zoomed img { max-width: none; max-height: none; cursor: zoom-out; }

/* ── 控件（§9） ── */
.fc-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-1); min-height: 32px; padding: 0 var(--sp-4); border: 1px solid var(--color-border); border-radius: var(--r-ctl); background: var(--color-card-bg); color: var(--color-text); font: inherit; font-size: var(--fs-body); cursor: pointer; }
.fc-btn:hover { background: var(--color-bg-muted); }
.fc-btn-primary { background: var(--color-link); border-color: var(--color-link); color: var(--color-on-accent); }
.fc-btn-primary:hover { background: var(--color-link); filter: brightness(1.08); }
.fc-seg { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--r-ctl); overflow: hidden; background: var(--color-card-bg); }
.fc-seg > button { min-height: 28px; padding: 0 var(--sp-3); border: 0; background: transparent; color: var(--color-text-muted); font: inherit; font-size: var(--fs-aux); cursor: pointer; }
.fc-seg > button + button { border-left: 1px solid var(--color-border); }
.fc-seg > button[aria-pressed="true"] { background: var(--color-bg-highlight); color: var(--color-text); font-weight: 600; }
.fc-pill { display: inline-flex; align-items: center; min-height: 20px; padding: 0 var(--sp-2); border-radius: var(--r-pill); background: color-mix(in srgb, var(--color-link) 12%, var(--color-card-bg)); color: var(--color-text); font-size: var(--fs-meta); white-space: nowrap; }
.fc-input { height: 32px; padding: 0 var(--sp-3); border: 1px solid var(--color-border); border-radius: var(--r-ctl); background: var(--color-bg); color: var(--color-text); font: inherit; font-size: var(--fs-body); }
.fc-input:focus { border-color: var(--color-link); outline: none; }
:is(.fc-btn, .fc-seg > button, .fc-input, .fc-lightbox-close, .fc-legend input):focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
:is(.fc-btn, .fc-seg > button, .fc-input):disabled { opacity: .45; cursor: not-allowed; }
.fc-scroll-x { display: flex; gap: var(--sp-2); overflow-x: auto; scrollbar-width: none; }
.fc-scroll-x::-webkit-scrollbar { display: none; }
.fc-scroll-x.fade-right { mask-image: linear-gradient(to right, var(--color-text) calc(100% - 34px), transparent); -webkit-mask-image: linear-gradient(to right, var(--color-text) calc(100% - 34px), transparent); }
.fc-scroll-x.fade-left { mask-image: linear-gradient(to right, transparent, var(--color-text) 34px); -webkit-mask-image: linear-gradient(to right, transparent, var(--color-text) 34px); }
.fc-scroll-x.fade-left.fade-right { mask-image: linear-gradient(to right, transparent, var(--color-text) 34px, var(--color-text) calc(100% - 34px), transparent); -webkit-mask-image: linear-gradient(to right, transparent, var(--color-text) 34px, var(--color-text) calc(100% - 34px), transparent); }

/* ── 状态、空状态、提示、脚注（§10） ── */
.fc-status { display: inline-flex; align-items: center; gap: var(--sp-1); font-size: var(--fs-aux); font-weight: 600; }
.fc-status-success { color: var(--color-success); }
.fc-status-danger { color: var(--color-danger); }
.fc-status-warning { color: var(--color-warning); }
.fc-status-info { color: var(--color-info); }
.fc-empty { padding: var(--sp-5) var(--sp-4); border-radius: var(--r-card); background: var(--color-bg-muted); color: var(--color-text-muted); font-size: var(--fs-aux); text-align: center; }
.fc-note { padding: var(--sp-2) var(--sp-3); border-left: 3px solid var(--color-link); border-radius: 0 var(--r-ctl) var(--r-ctl) 0; background: var(--color-bg-muted); color: var(--color-text); font-size: var(--fs-aux); }
.fc-footnote { margin: var(--sp-2) 0 0; font-size: var(--fs-meta); line-height: 1.5; color: var(--color-text-muted); }
.fc-back-top { position: fixed; right: var(--sp-4); bottom: calc(var(--sp-6) + env(safe-area-inset-bottom)); z-index: 30; width: 40px; height: 40px; border: 1px solid var(--color-border); border-radius: var(--r-pill); background: var(--color-card-bg); color: var(--color-text-muted); box-shadow: var(--shadow-pop); cursor: pointer; }

/* ── 统一三档断点（1280 / 900 / 640）：看板左栏与三档容器 ── */
@media (max-width: 1280px) {
  .fc-workbench { grid-template-columns: 270px minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .fc-container-reading, .fc-container-report, .fc-container-workbench { padding: var(--sp-3) var(--sp-3) var(--sp-4); }
  .fc-workbench { grid-template-columns: minmax(0, 1fr); }
}

/* ── 手机（≤640px）：表头与数据 11px（CHART_RULES §1.2），可点区域 ≥32px ── */
@media (max-width: 640px) {
  .fc-table, .fc-table thead th { font-size: var(--fs-meta); }
  .fc-table :is(th, td) { padding: var(--sp-2); }
  .fc-seg > button { min-height: 32px; }
  .fc-chart { height: var(--fc-chart-h-mobile, 240px); }
  .fc-lightbox { padding: 0; }
  .fc-lightbox-dialog { width: 100%; height: 100%; border-radius: 0; }
  .fc-lightbox-head { padding-top: calc(var(--sp-2) + env(safe-area-inset-top, 0px)); }
  .fc-lightbox-body.is-chart { height: auto; flex: 1 1 auto; }
}

@media (prefers-reduced-motion: reduce) {
  .fc-lightbox, .fc-lightbox * { transition: none; }
}

/* ── 设置页与全站新增原子元件（v2.2：Switch / 状态徽章 / 页内二级 Tab / Toast） ── */
.fc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  width: 40px;
  height: 22px;
  padding: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  background: var(--color-bg-muted);
  cursor: pointer;
  flex: none;
  transition: background var(--motion-dur-fade) var(--motion-ease), border-color var(--motion-dur-fade) var(--motion-ease);
}
.fc-switch::after {
  content: "";
  position: absolute;
  left: 2px;
  top: 2px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-card-bg);
  box-shadow: var(--shadow-card);
  transition: transform var(--motion-dur-fade) var(--motion-ease), background var(--motion-dur-fade) var(--motion-ease);
}
.fc-switch[aria-checked="true"] { background: var(--color-link); border-color: var(--color-link); }
.fc-switch[aria-checked="true"]::after { transform: translateX(18px); background: var(--color-on-accent); }
.fc-switch:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
.fc-switch:disabled, .fc-switch[aria-busy="true"] { opacity: .45; cursor: not-allowed; }

/* 状态徽章：8% 语义色混卡面底 + 24% 描边 + 同色字（四态对比度 ≥4.5:1，同 .flash-* 口径） */
.fc-badge {
  --fc-badge-fg: var(--color-text-muted);
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 22px;
  padding: 0 var(--sp-2);
  border: 1px solid color-mix(in srgb, var(--fc-badge-fg) 24%, var(--color-card-bg));
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--fc-badge-fg) 8%, var(--color-card-bg));
  color: var(--fc-badge-fg);
  font-size: var(--fs-meta);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}
.fc-badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.fc-badge-plain::before { display: none; }
.fc-badge-success { --fc-badge-fg: var(--color-success); }
.fc-badge-warning { --fc-badge-fg: var(--color-warning); }
.fc-badge-danger { --fc-badge-fg: var(--color-danger); }
.fc-badge-accent { --fc-badge-fg: var(--color-link); }
.fc-badge-neutral { --fc-badge-fg: var(--color-text-muted); }

/* 页内二级视图 Tab（服务端 <a href="?tab=..."> 或抽屉内按钮） */
.fc-subtabs {
  display: flex;
  align-items: center;
  gap: var(--sp-1);
  margin: 0 0 var(--sp-4);
  border-bottom: 1px solid var(--color-border-subtle);
  overflow-x: auto;
  scrollbar-width: none;
}
.fc-subtabs::-webkit-scrollbar { display: none; }
.fc-subtabs > :is(a, button) {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  min-height: 36px;
  padding: 0 var(--sp-3);
  border: 0;
  background: transparent;
  color: var(--color-text-muted);
  font: inherit;
  font-size: var(--fs-table);
  font-weight: 500;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.fc-subtabs > :is(a, button):hover { color: var(--color-text); text-decoration: none; }
.fc-subtabs > :is(a, button)[aria-current="page"],
.fc-subtabs > :is(a, button)[aria-selected="true"] { color: var(--color-text); font-weight: 600; }
.fc-subtabs > :is(a, button)[aria-current="page"]::after,
.fc-subtabs > :is(a, button)[aria-selected="true"]::after {
  content: "";
  position: absolute;
  left: var(--sp-2);
  right: var(--sp-2);
  bottom: -1px;
  height: 2px;
  border-radius: var(--r-pill);
  background: var(--color-link);
}
.fc-subtabs > :is(a, button):focus-visible { outline: 2px solid var(--color-link); outline-offset: -2px; }

/* 轻量反馈 Toast（右上角自动淡出，role="status" aria-live="polite"） */
.fc-toast-stack {
  position: fixed;
  top: calc(var(--site-chrome-height, 0px) + var(--sp-3));
  right: var(--sp-4);
  z-index: 950;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: min(360px, calc(100vw - 32px));
  pointer-events: none;
}
.fc-toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--color-border);
  border-left: 3px solid var(--color-link);
  border-radius: var(--r-card);
  background: var(--color-card-bg);
  color: var(--color-text);
  box-shadow: var(--shadow-pop);
  font-size: var(--fs-aux);
  line-height: 1.5;
}
.fc-toast-success { border-left-color: var(--color-success); }
.fc-toast-danger { border-left-color: var(--color-danger); }
.fc-toast-warning { border-left-color: var(--color-warning); }

/* 全站左侧竖向圆点滚动进度轨（紧贴左侧栏右缘 / 视口左缘垂直居中，复用到所有 base.html 长页面） */
.fc-scroll-rail {
  position: fixed;
  top: calc(var(--site-chrome-height, 0px) + (100vh - var(--site-chrome-height, 0px)) / 2);
  left: var(--fc-rail-left, 4px);
  transform: translateY(-50%);
  z-index: 45;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  width: 12px;
  padding: var(--sp-1) 0;
  border-radius: var(--r-pill);
  cursor: pointer;
  user-select: none;
  touch-action: none;
}
.fc-scroll-rail[hidden] { display: none; }
.fc-scroll-rail:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }
.fc-scroll-rail-dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--color-text-muted) 38%, transparent);
  transition: transform var(--motion-dur-fade) var(--motion-ease), background var(--motion-dur-fade) var(--motion-ease), box-shadow var(--motion-dur-fade) var(--motion-ease);
  pointer-events: none;
}
.fc-scroll-rail:hover .fc-scroll-rail-dot {
  background: color-mix(in srgb, var(--color-text-muted) 56%, transparent);
}
.fc-scroll-rail-dot.is-hover {
  background: var(--color-text-muted);
  transform: scale(1.25);
}
.fc-scroll-rail-dot.is-active {
  background: var(--color-text);
  transform: scale(1.35);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--color-bg) 75%, transparent);
}
.fc-scroll-rail--sample {
  position: static;
  transform: none;
  display: inline-flex;
  cursor: default;
}
body.page-chat .fc-scroll-rail { display: none; }
@media (max-width: 900px) {
  .fc-scroll-rail:not(.fc-scroll-rail--sample) { display: none; }
}
@media print {
  .fc-scroll-rail { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .fc-switch, .fc-switch::after, .fc-scroll-rail-dot { transition: none; }
}
html[data-motion="reduce"] .fc-switch,
html[data-motion="reduce"] .fc-switch::after,
html[data-motion="reduce"] .fc-scroll-rail-dot { transition: none; }

/* 小玉交互式图表卡片与沙箱隔离 HTML 交互卡片（DESIGN_LANGUAGE.md §6 / §8 / §10） */
.fc-chat-icard {
  width: 100%;
  flex: 1 1 100%;
  min-width: 0;
  margin-top: var(--sp-2);
  padding: var(--sp-3);
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--r-card);
  box-sizing: border-box;
}
.fc-chat-icard.is-compact {
  padding: var(--sp-2);
}
.fc-chat-icard-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-2);
  margin-bottom: var(--sp-2);
  padding-bottom: var(--sp-2);
  border-bottom: 1px solid var(--color-border);
}
.fc-chat-icard-title-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--sp-1) var(--sp-2);
  min-width: 0;
  flex: 1;
}
.fc-chat-icard-title {
  font-size: var(--fs-body);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.35;
}
.fc-chat-icard.is-compact .fc-chat-icard-title {
  font-size: var(--fs-table);
}
.fc-chat-icard-meta {
  font-size: var(--fs-meta);
  color: var(--color-text-muted);
}
.fc-chat-icard-tools {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  flex-shrink: 0;
}
.fc-chat-icard-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  height: 26px;
  padding: 0 var(--sp-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-ctl);
  background: var(--color-card-bg);
  color: var(--color-text-muted);
  font-size: var(--fs-meta);
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}
.fc-chat-icard-btn:hover:not(:disabled) {
  color: var(--color-link);
  border-color: var(--color-link);
}
.fc-chat-icard-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.fc-chat-icard-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-2);
  margin-bottom: var(--sp-2);
}
.fc-chat-icard-leg-item {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 2px var(--sp-2);
  border: 1px solid var(--color-border);
  border-radius: var(--r-pill);
  background: var(--color-card-bg);
  color: var(--color-text);
  font-size: var(--fs-meta);
  cursor: pointer;
}
.fc-chat-icard-leg-item.is-off {
  opacity: 0.42;
  text-decoration: line-through;
}
.fc-chat-icard-leg-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
}
.fc-chat-icard-canvas {
  width: 100%;
  height: 300px;
}
.fc-chat-icard.is-compact .fc-chat-icard-canvas {
  height: 220px;
}
.fc-chat-icard-canvas.is-error {
  height: auto;
  padding: var(--sp-3);
  font-size: var(--fs-aux);
  color: var(--color-text-muted);
  text-align: center;
}
.fc-chat-icard-foot {
  margin-top: var(--sp-2);
  font-size: var(--fs-meta);
  color: var(--color-text-faint);
}
.fc-chat-icard-frame {
  display: block;
  width: 100%;
  min-height: 200px;
  border: 0;
  border-radius: var(--r-ctl);
  background: var(--color-card-bg);
}

/* ── PWA 独立全屏壳层与安全区 ── */
@media (display-mode: standalone) {
  body {
    overscroll-behavior-y: contain;
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
}

.fc-pwa-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin-right: var(--sp-2);
  padding: 0;
  border: 0;
  border-radius: var(--r-ctl);
  background: transparent;
  color: var(--color-header-text);
  cursor: pointer;
  flex-shrink: 0;
}
.fc-pwa-back:hover { background: var(--color-border-subtle); }
.fc-pwa-back:focus-visible { outline: 2px solid var(--color-link); outline-offset: 2px; }

/* ── 站内 PDF 逐页预览（挂于全站灯箱 .fc-lightbox-body.is-pdf） ── */
.fc-lightbox-dialog.is-pdf {
  width: min(var(--w-reading), 100%);
  height: min(92dvh, 100%);
}
.fc-lightbox-body.is-pdf {
  display: flex;
  flex-direction: column;
  padding: 0;
  overflow: hidden;
  background: var(--color-bg-muted);
}
.fc-pdf-shell {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
.fc-pdf-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  border-bottom: 1px solid var(--color-border-subtle);
  background: var(--color-card-bg);
  flex: none;
}
.fc-pdf-group {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
}
.fc-pdf-btn {
  min-width: 32px;
  padding: 0 var(--sp-2);
  font-size: var(--fs-aux);
  font-variant-numeric: tabular-nums;
}
.fc-pdf-page-input {
  width: 44px;
  text-align: center;
  padding: 0 var(--sp-1);
  font-variant-numeric: tabular-nums;
}
.fc-pdf-total {
  font-size: var(--fs-aux);
  color: var(--color-text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fc-pdf-zoom-val { min-width: 52px; }
.fc-pdf-scroller {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: var(--sp-3) var(--sp-3) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px));
}
.fc-pdf-stream {
  --fc-pdf-zoom: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--sp-3);
  width: 100%;
}
.fc-pdf-page {
  position: relative;
  margin-inline: auto;
  width: calc(min(100%, var(--w-reading)) * var(--fc-pdf-zoom));
  max-width: none;
  flex: none;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--r-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
[data-theme="dark"] .fc-pdf-page,
[data-theme="fund"] .fc-pdf-page {
  padding: var(--sp-2);
  background: var(--color-bg-muted);
}
.fc-pdf-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.fc-pdf-page-num {
  position: absolute;
  right: var(--sp-2);
  bottom: var(--sp-2);
  padding: var(--sp-1) var(--sp-2);
  border-radius: var(--r-pill);
  background: var(--color-overlay);
  color: var(--color-on-accent);
  font-size: var(--fs-meta);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.fc-pdf-page-err,
.fc-pdf-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-3);
  padding: var(--sp-6) var(--sp-4);
  font-size: var(--fs-body);
  color: var(--color-text-muted);
  text-align: center;
}
.fc-pdf-status.is-error { color: var(--color-danger); }

@media (max-width: 640px) {
  .fc-lightbox-dialog.is-pdf {
    width: 100%;
    height: 100%;
  }
  .fc-pdf-bar { padding: var(--sp-2); }
  .fc-pdf-scroller { padding: var(--sp-2) var(--sp-2) calc(var(--sp-5) + env(safe-area-inset-bottom, 0px)); }
}
