/* ============================================================
   v2 布局：左导航 / 顶栏 / 主区 / AI 副驾抽屉
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md);
  -webkit-font-smoothing: antialiased;
  display: flex; transition: background .25s, color .25s;
}
svg { display: block; }

/* 线稿图标 */
.ico { width: 18px; height: 18px; flex: 0 0 auto; display: grid; place-items: center; opacity: .92; }
.ico svg {
  width: 18px; height: 18px; fill: none; stroke: currentColor;
  stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}

/* ===== 左导航 ===== */
.nav {
  width: var(--nav-w); background: var(--nav-bg); border-right: 1px solid var(--border);
  height: 100vh; position: sticky; top: 0;
  display: flex; flex-direction: column; flex: 0 0 auto; transition: width .2s;
}
body.nav-collapsed .nav { width: var(--nav-w-collapsed); }
.brand {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: var(--sp-2);
  row-gap: 1px;
  align-content: center;
  height: var(--topbar-h);
  padding: 0 var(--sp-4);
  border-bottom: 1px solid var(--border); flex: 0 0 auto;
  color: inherit; text-decoration: none;
}
.brand .logo {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: center;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--nav-active); display: grid; place-items: center;
}
.brand .logo svg { width: 17px; height: 17px; stroke: #fff; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand .txt { display: contents; min-width: 0; }
.brand .name {
  grid-column: 2;
  grid-row: 1;
  align-self: end;
  font-weight: 700; font-size: 14px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.brand .sub {
  grid-column: 2;
  grid-row: 2;
  align-self: start;
  font-size: var(--fs-xs); line-height: 1.2; color: var(--text-3);
}
body.nav-collapsed .brand {
  display: flex; align-items: center; justify-content: center;
  padding: 0;
}
body.nav-collapsed .brand .logo { grid-column: auto; grid-row: auto; }
body.nav-collapsed .brand .name,
body.nav-collapsed .brand .sub,
body.nav-collapsed .brand .txt,
body.nav-collapsed .nav-group-label,
body.nav-collapsed .nav-item .label { display: none; }

.nav-scroll { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-2); }
.nav-scroll::-webkit-scrollbar { width: 6px; }
.nav-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
.nav-group-label {
  font-size: var(--fs-xs); color: var(--text-3); font-weight: 600; letter-spacing: .04em;
  padding: var(--sp-4) var(--sp-3) var(--sp-2);
}
.nav-item {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 9px var(--sp-3); margin: 1px 0; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; white-space: nowrap;
  font-size: var(--fs-md); position: relative; text-decoration: none;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--nav-hover); color: var(--text); }
.nav-item.active { background: var(--nav-active); color: var(--brand); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: -2px; top: 7px; bottom: 7px;
  width: 3px; border-radius: 3px; background: var(--brand);
}
.nav-item.soon { opacity: .55; }
.nav-item .badge {
  margin-left: auto; font-size: var(--fs-xs); background: var(--danger); color: #fff;
  border-radius: 999px; padding: 1px 7px; font-weight: 600;
}
.nav-item .soon-tag {
  margin-left: auto; font-size: 9px; color: var(--text-3); border: 1px solid var(--border);
  border-radius: 4px; padding: 0 4px;
}
.nav-item.ai { color: var(--ai); margin-bottom: var(--sp-2); }
.nav-item.ai:hover { background: var(--ai-weak); }
.nav-item.ai .tagnew {
  margin-left: auto; font-size: 9px; background: var(--brand); color: var(--on-brand);
  border-radius: 4px; padding: 1px 5px; font-weight: 700; letter-spacing: .03em;
}
body.nav-collapsed .nav-item { justify-content: center; padding: 9px 0; }
body.nav-collapsed .nav-item .badge,
body.nav-collapsed .nav-item .tagnew,
body.nav-collapsed .nav-item .soon-tag { display: none; }

.nav-foot {
  flex: 0 0 auto; border-top: 1px solid var(--border); padding: 10px var(--sp-4);
  display: flex; align-items: center; gap: 7px; color: var(--text-3); font-size: 10px;
}
.nav-foot .aw { width: 16px; height: 16px; flex: 0 0 auto; display: grid; place-items: center; color: var(--brand); }
.nav-foot .aw svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-foot .ftxt b { color: var(--text-2); font-weight: 700; letter-spacing: .03em; }
body.nav-collapsed .nav-foot .ftxt { display: none; }
body.nav-collapsed .nav-foot { justify-content: center; padding: 10px 0; }

/* W3-5：侧栏底部「更多工具」折叠 */
.nav-more {
  margin-top: var(--sp-3); padding-top: var(--sp-2);
  border-top: 1px solid var(--border);
}
.nav-more-toggle {
  display: flex; align-items: center; gap: var(--sp-3);
  width: 100%; padding: 9px var(--sp-3); margin: 1px 0;
  border: none; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-3); cursor: pointer;
  font-size: var(--fs-md); white-space: nowrap; text-align: left;
  transition: background .12s, color .12s;
}
.nav-more-toggle:hover { background: var(--nav-hover); color: var(--text-2); }
.nav-more.open .nav-more-toggle { color: var(--text-2); font-weight: 600; }
.nav-more-chevron {
  margin-left: auto; width: 16px; height: 16px; flex: 0 0 auto;
  display: grid; place-items: center; opacity: .75;
  transition: transform .18s ease;
}
.nav-more-chevron svg {
  width: 14px; height: 14px; fill: none; stroke: currentColor;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.nav-more.open .nav-more-chevron { transform: rotate(180deg); }
.nav-more-panel { display: none; padding: 2px 0 4px; }
.nav-more.open .nav-more-panel { display: block; }
body.nav-collapsed .nav-more .label,
body.nav-collapsed .nav-more-chevron { display: none; }
body.nav-collapsed .nav-more-toggle { justify-content: center; padding: 9px 0; }

/* Toast（全站 layout 层，避免未引 components.css 的页把 toastHost 挤成右侧 flex 列） */
#toastHost {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  box-shadow: var(--shadow); padding: 9px 16px; border-radius: var(--radius-sm);
  font-size: var(--fs-sm); animation: toastIn .18s ease; max-width: 80vw;
  pointer-events: auto;
}
.toast.warn { border-color: rgba(245, 158, 11, .4); }
.toast.err, .toast.error { border-color: rgba(239, 68, 68, .4); }
@keyframes toastIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; } }

/* ===== 主区 ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; height: 100vh; overflow: hidden; transition: margin-right .22s ease; }
.topbar {
  height: var(--topbar-h); border-bottom: 1px solid var(--border); background: var(--bg-soft);
  display: flex; flex-direction: row; align-items: center; gap: var(--sp-3); padding: 0 var(--sp-6); flex: 0 0 auto;
}
/* 页内遗留 `header{}` 不得覆盖顶栏（sku_decision 等 v1 迁移残留） */
header.topbar {
  flex-direction: row; align-items: center; height: var(--topbar-h);
  padding: 0 var(--sp-6); gap: var(--sp-3);
}
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm); border: 1px solid transparent;
  background: transparent; color: var(--text-2); cursor: pointer; display: grid; place-items: center;
}
.icon-btn:hover { background: var(--surface-hover); color: var(--text); }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.crumb {
  display: flex; align-items: center; gap: var(--sp-2); color: var(--text-2);
  font-size: var(--fs-md); margin-left: var(--sp-1); line-height: 1; min-height: 32px;
}
.crumb b { color: var(--text); font-weight: 600; line-height: 1.2; }
.crumb .muted { line-height: 1.2; }
.crumb a.crumb-link { color: var(--text-2); text-decoration: none; line-height: 1.2; }
.crumb a.crumb-link:hover { color: var(--text); text-decoration: underline; }
.crumb .sep { color: var(--text-3); line-height: 1; }
.spacer { flex: 1; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { border: 0; background: transparent; color: var(--text-2); padding: 5px 11px; cursor: pointer; font-size: var(--fs-sm); }
.seg button.on { background: var(--brand-weak); color: var(--brand); font-weight: 600; }
.ai-btn {
  display: flex; align-items: center; gap: 6px; border: 1px solid var(--ai); color: var(--ai);
  background: var(--ai-weak); padding: 5px 11px; border-radius: var(--radius-sm);
  cursor: pointer; font-size: var(--fs-sm); font-weight: 600;
}
.ai-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.user { display: flex; align-items: center; gap: var(--sp-2); padding: 4px var(--sp-2); border-radius: var(--radius-sm); cursor: pointer; border: 0; background: transparent; color: inherit; font: inherit; }
.user:hover { background: var(--surface-hover); }
.user .av { width: 28px; height: 28px; border-radius: 50%; background: var(--nav-active); display: grid; place-items: center; color: var(--text); font-size: 12px; font-weight: 700; }
.account-menu { position: relative; }
.account-caret { font-size: 10px; color: var(--text-3); margin-left: 2px; }
.account-dropdown {
  position: absolute; top: calc(100% + 6px); right: 0; min-width: 140px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  box-shadow: var(--shadow); padding: 4px; z-index: 120;
}
.account-dropdown[hidden] { display: none; }
.account-item {
  display: block; width: 100%; text-align: left; border: 0; background: transparent;
  color: var(--text); font-size: var(--fs-sm); padding: 8px 10px; border-radius: 6px; cursor: pointer;
}
.account-item:hover { background: var(--surface-hover); }
.account-item-danger { color: var(--danger); }
.account-form-err { margin: 12px 0 0; font-size: 12px; color: var(--danger); }
#changePwdModal .cv-modal-bd label { display: block; font-size: 11px; color: var(--text-2); margin: 12px 0 4px; }
#changePwdModal .cv-modal-bd label:first-child { margin-top: 0; }
#changePwdModal .cv-modal-bd input {
  width: 100%; box-sizing: border-box; padding: 7px 10px; font-size: 12px; border-radius: 5px;
  background: var(--border-soft); border: 1px solid var(--border); color: var(--text);
}
.content { flex: 1; overflow-y: auto; padding: var(--sp-6); }
.page-head { display: flex; align-items: flex-end; gap: var(--sp-4); margin-bottom: var(--sp-5); }
.page-head h1 { margin: 0; font-size: var(--fs-2xl); font-weight: 700; letter-spacing: -.01em; }
.page-head .desc { color: var(--text-2); font-size: var(--fs-md); padding-bottom: 3px; }
.page-head .actions { margin-left: auto; display: flex; gap: var(--sp-2); }

/* ===== AI 副驾抽屉（M5 接 Hermes，M0 仅占位） ===== */
body.copilot-open .main { margin-right: var(--drawer-w); }
.copilot {
  position: fixed; top: 0; right: 0; width: var(--drawer-w); height: 100vh; background: var(--nav-bg);
  border-left: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .22s ease; z-index: 50;
}
body.copilot-open .copilot { transform: translateX(0); }
.cp-hd { padding: 0 var(--sp-5); height: var(--topbar-h); border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: var(--sp-3); flex: 0 0 auto; }
.cp-hd .spark { width: 26px; height: 26px; border-radius: 7px; background: var(--nav-active); display: grid; place-items: center; }
.cp-hd .spark svg { width: 15px; height: 15px; stroke: #fff; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cp-hd .t { font-weight: 700; font-size: var(--fs-md); }
.cp-hd .conn { font-size: 10px; color: var(--text-3); display: flex; align-items: center; gap: 4px; }
.cp-body { flex: 1; overflow-y: auto; padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); }
/* 副驾启动页指引 */
.cp-welcome { margin: 0; flex: 0 0 auto; }
.cp-welcome-compact {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3); border-radius: 8px; background: var(--surface-hover);
  border: 1px solid var(--border); font-size: var(--fs-xs); color: var(--text-2);
}
.cp-welcome-expand {
  flex: 0 0 auto; border: none; background: transparent; color: var(--brand);
  font-size: var(--fs-xs); cursor: pointer; padding: 2px 4px; font-family: var(--font);
}
.cp-welcome-expand:hover { text-decoration: underline; }
.cp-welcome-full { display: flex; flex-direction: column; gap: var(--sp-3); }
.cp-rules {
  margin: 0; padding: var(--sp-3) var(--sp-4); list-style: none;
  background: var(--surface-hover); border: 1px solid var(--border); border-radius: 8px;
  font-size: var(--fs-xs); color: var(--text-2); line-height: 1.65;
}
.cp-rules li { position: relative; padding-left: 12px; }
.cp-rules li::before { content: "·"; position: absolute; left: 0; color: var(--brand); font-weight: 700; }
.cp-examples-label { font-size: var(--fs-xs); font-weight: 600; color: var(--text); margin-bottom: var(--sp-2); }
.cp-examples-hint { font-weight: 400; color: var(--text-3); }
.cp-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-chip {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: 999px; padding: 5px 10px; font-size: var(--fs-xs); line-height: 1.4;
  cursor: pointer; font-family: var(--font); text-align: left; max-width: 100%;
}
.cp-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--surface-hover); }
.cp-tips-more { font-size: var(--fs-xs); color: var(--text-2); }
.cp-tips-more summary { cursor: pointer; color: var(--text); font-weight: 500; user-select: none; }
.cp-tips-body { margin-top: var(--sp-2); line-height: 1.65; }
.cp-tips-body p { margin: 0 0 6px; }
.cp-guide-link {
  display: inline-flex; align-items: center; gap: 4px; font-size: var(--fs-xs);
  color: var(--brand); text-decoration: none;
}
.cp-guide-link:hover { text-decoration: underline; }
.cp-welcome-foot { margin: 0; font-size: 10px; color: var(--text-3); line-height: 1.5; }
/* 对话气泡 */
.cp-msg { display: flex; }
.cp-msg.me { justify-content: flex-end; }
.cp-msg .bubble { max-width: 86%; padding: 8px 11px; border-radius: 10px; font-size: var(--fs-sm); line-height: 1.6; word-break: break-word; }
.cp-msg.me .bubble { background: var(--brand); color: var(--on-brand); border-bottom-right-radius: 3px; }
.cp-msg.ai .bubble { background: var(--surface-hover); color: var(--text); border-bottom-left-radius: 3px; }
.cp-msg.ai .bubble.cp-md { line-height: 1.65; max-width: 94%; }
.cp-msg.ai .bubble.cp-md > :first-child { margin-top: 0; }
.cp-msg.ai .bubble.cp-md > :last-child { margin-bottom: 0; }
.cp-msg.ai .bubble.cp-md h3,
.cp-msg.ai .bubble.cp-md h4 { font-size: var(--fs-sm); font-weight: 700; margin: 0 0 6px; color: var(--text); }
.cp-msg.ai .bubble.cp-md p { margin: 0 0 6px; }
.cp-msg.ai .bubble.cp-md ul,
.cp-msg.ai .bubble.cp-md ol { margin: 4px 0 6px; padding-left: 1.2em; }
.cp-msg.ai .bubble.cp-md ol ol,
.cp-msg.ai .bubble.cp-md ul ul { margin-top: 2px; margin-bottom: 2px; }
.cp-msg.ai .bubble.cp-md li { margin: 3px 0; }
.cp-msg.ai .bubble.cp-md li > p { margin: 0 0 2px; }
.cp-msg.ai .bubble.cp-md strong { font-weight: 600; color: var(--text); }
.cp-msg.ai .bubble.cp-md hr { border: none; border-top: 1px solid var(--border); margin: 8px 0; }
.cp-msg.ai .bubble.cp-md blockquote {
  margin: 6px 0; padding: 6px 10px; border-left: 3px solid var(--brand);
  color: var(--text-2); background: color-mix(in srgb, var(--brand) 6%, transparent);
  border-radius: 0 6px 6px 0; font-size: var(--fs-xs);
}
.cp-msg.ai .bubble.cp-md code {
  font-family: ui-monospace, monospace; font-size: 0.92em;
  background: var(--surface); padding: 1px 4px; border-radius: 4px;
}
.cp-msg.ai .bubble.cp-md .cp-table-wrap {
  overflow-x: auto; margin: 6px 0; -webkit-overflow-scrolling: touch;
}
.cp-msg.ai .bubble.cp-md table {
  border-collapse: collapse; font-size: var(--fs-xs); width: max-content; max-width: 100%;
}
.cp-msg.ai .bubble.cp-md th,
.cp-msg.ai .bubble.cp-md td {
  border: 1px solid var(--border); padding: 4px 6px; text-align: left; vertical-align: top;
}
.cp-msg.ai .bubble.cp-md th { background: var(--surface); font-weight: 600; white-space: nowrap; }
.cp-msg.ai .bubble.cp-md td { word-break: break-word; }
.cp-msg.pending .bubble { color: var(--text-3); }
/* 输入区 */
.cp-input { flex: 0 0 auto; border-top: 1px solid var(--border); padding: var(--sp-3); display: flex; gap: var(--sp-2); align-items: flex-end; }
.cp-input textarea { flex: 1; resize: none; max-height: 120px; background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-family: var(--font); font-size: var(--fs-sm); line-height: 1.5; }
.cp-input textarea:focus { outline: none; border-color: var(--brand); }
.cp-send { flex: 0 0 auto; width: 34px; height: 34px; border: none; border-radius: 8px; background: var(--brand); color: #fff; cursor: pointer; display: grid; place-items: center; }
.cp-send:hover { filter: brightness(1.08); }
.cp-send:disabled { opacity: .5; cursor: default; }
.cp-send svg { width: 16px; height: 16px; fill: currentColor; }

/* 响应式：窄屏自动折叠导航 */
@media (max-width: 980px) {
  .nav { width: var(--nav-w-collapsed); }
  .nav .name, .nav .txt, .nav-group-label, .nav-item .label { display: none; }
  .nav-item { justify-content: center; padding: 9px 0; }
}



/* W3-4 口径条：仅数据分析页显示的一行弱化小字（口径/币种/更新时间）。CB.setMetaBar() 可按页覆盖 */
.meta-bar {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  padding: 3px var(--sp-5) 0; min-height: 0;
  background: transparent; border: 0;
  font-size: 10.5px; color: var(--text-3); opacity: .75; flex: 0 0 auto;
}
.meta-bar:hover { opacity: 1; }
.meta-bar .mi { display: inline-flex; align-items: center; gap: 4px; }
.meta-bar .mi b { color: var(--text-2); font-weight: 600; }
.meta-bar .sep { opacity: .45; }

/* 词典命中标签：虚线下划线提示可悬停 */
.gloss-term { cursor: help; border-bottom: 1px dotted currentColor; text-decoration: none; }

/* ── 全局 tooltip（L2 口径）：仅 #cbTooltip / #globalTooltip JS 浮层，禁止页内 ::after 叠加 ── */
[data-tooltip] { cursor: help; }
[data-tooltip]::after,
[data-tooltip]::before,
[data-tooltip]:hover::after,
[data-tooltip]:hover::before {
  content: none !important;
  display: none !important;
}
#cbTooltip,
#globalTooltip {
  position: fixed; display: none; max-width: min(320px, calc(100vw - 24px)); z-index: 12000;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm, 8px);
  box-shadow: var(--shadow); padding: 8px 12px; font-size: 12px; line-height: 1.55;
  color: var(--text-2); white-space: pre-line; word-break: break-word; pointer-events: none;
}
#cbTooltip.visible,
#globalTooltip.visible { display: block; }

/* ── 旧页 .modal 结构全局适配 V4 token（与 cv-modal 视觉一致） ── */
.modal {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, .45); align-items: center; justify-content: center;
  padding: var(--sp-4, 16px); box-sizing: border-box;
}
.modal.show { display: flex; }
.modal-box {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius, 12px);
  box-shadow: var(--shadow); padding: 20px; max-width: 520px; max-height: 85vh;
  overflow: auto; width: min(520px, 100%); box-sizing: border-box;
}
.modal-box--wide { max-width: 720px; width: min(720px, 100%); }
.modal-box h3 { margin: 0 0 8px; font-size: 15px; font-weight: 600; color: var(--text); font-family: var(--font); }
.modal-sub { font-size: 11px; color: var(--text-3); margin: 0 0 14px; line-height: 1.5; }
.modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, .45); align-items: center; justify-content: center; padding: 16px;
}
.modal-overlay.open { display: flex; }

/* ── 提醒与公告抽屉（UI规范V4 注释三级制 L3 层；按页 opt-in，入口=状态筹码） ── */
.alert-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs);
  padding: 4px 12px; border-radius: 99px; cursor: pointer; border: 1px solid var(--border);
  background: transparent; color: var(--text-2); font-family: var(--font); }
.alert-chip:hover { background: var(--surface-hover); }
.alert-chip.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.alert-chip.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.alert-chip .n { font-family: var(--mono); }

.cb-adrawer-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 80; display: none; }
.cb-adrawer { position: fixed; top: 0; right: 0; bottom: 0; width: 400px; max-width: 92vw;
  background: var(--surface); border-left: 1px solid var(--border); z-index: 90;
  transform: translateX(100%); transition: transform .22s ease; display: flex; flex-direction: column;
  box-shadow: -12px 0 40px rgba(0,0,0,.18); }
body.adrawer-open .cb-adrawer { transform: none; }
body.adrawer-open .cb-adrawer-mask { display: block; }
.cb-adrawer .adh { padding: 16px 22px 12px; border-bottom: 1px solid var(--border); display: flex; align-items: center; flex: 0 0 auto; }
.cb-adrawer .adh b { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; color: var(--text); }
.cb-adrawer .adh button { margin-left: auto; background: none; border: 0; color: var(--text-3); font-size: 18px; cursor: pointer; }
.cb-adrawer .adb { flex: 1; overflow-y: auto; padding: 14px 22px 30px; }
.cb-adrawer .asec { font-size: 10px; color: var(--text-3); letter-spacing: .2em; padding: 16px 0 4px; }
.cb-adrawer .aitem { display: flex; gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--border-soft); font-size: var(--fs-sm); }
.cb-adrawer .aitem .sev { flex: 0 0 auto; width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; background: var(--text-3); }
.cb-adrawer .aitem .sev.danger { background: var(--danger); }
.cb-adrawer .aitem .sev.warn { background: var(--warn); }
.cb-adrawer .aitem p { color: var(--text-2); line-height: 1.6; margin: 0; }
.cb-adrawer .aitem p b, .cb-adrawer .aitem p strong { color: var(--text); font-weight: 600; }
.cb-adrawer .aitem a.ago { color: var(--text); text-decoration: underline; text-underline-offset: 3px;
  text-decoration-color: var(--text-3); cursor: pointer; }
.cb-adrawer .aempty { color: var(--text-3); font-size: var(--fs-sm); padding: 14px 0; }

/* ── 全局数字格式：任何 .num 元素等宽对齐 ── */
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
td.num, th.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

/* ── 趋势方向通用类（颜色只表达异常；正增长绿、负增长红、持平灰） ── */
.up   { color: var(--success); }
.dn   { color: var(--danger); }
.flat { color: var(--text-3); }
.neg  { color: var(--danger); }

/* ── 全局 loading 动画：已有 .loading 类的页面自动获得脉动效果 ── */
.loading {
  color: var(--text-3); font-size: var(--fs-sm);
  padding: 22px 16px; text-align: center;
  animation: cb-pulse 1.5s ease-in-out infinite;
}
@keyframes cb-pulse { 0%, 100% { opacity: .4; } 55% { opacity: 1; } }

/* ── 全局空态：.empty 类基础样式 ── */
.empty {
  color: var(--text-3); font-size: var(--fs-sm);
  padding: 28px 16px; text-align: center; line-height: 1.7;
}

/* ── 登录页（/login，与 v2 壳层同 token） ── */
body.login-page {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: var(--sp-6);
  background: var(--bg); color: var(--text);
  font-family: var(--font); font-size: var(--fs-md);
  -webkit-font-smoothing: antialiased;
}
.login-shell { width: 100%; max-width: 400px; }
.login-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: var(--sp-8) var(--sp-6) var(--sp-6);
}
.login-brand {
  display: flex; align-items: center; gap: var(--sp-3);
  margin-bottom: var(--sp-6);
}
.login-brand .logo {
  width: 36px; height: 36px; border-radius: 10px; flex: 0 0 auto;
  background: var(--nav-active); display: grid; place-items: center;
}
.login-brand .logo svg {
  width: 20px; height: 20px; stroke: var(--text); fill: none;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.login-brand .name { font-size: var(--fs-lg); font-weight: 700; letter-spacing: -.01em; }
.login-brand .sub { font-size: var(--fs-xs); color: var(--text-3); margin-top: 2px; }
.login-card h1 {
  margin: 0 0 var(--sp-1); font-size: var(--fs-xl); font-weight: 700;
}
.login-card .lead {
  margin: 0 0 var(--sp-6); color: var(--text-2); font-size: var(--fs-sm);
}
.login-field { margin-bottom: var(--sp-4); }
.login-field label {
  display: block; font-size: var(--fs-sm); color: var(--text-2);
  margin-bottom: var(--sp-2); font-weight: 500;
}
.login-field .cv-input { width: 100%; padding: 10px 12px; font-size: var(--fs-md); }
.login-submit {
  width: 100%; margin-top: var(--sp-2); padding: 11px 16px;
  font-size: var(--fs-md); border-radius: var(--radius-sm); cursor: pointer;
}
.login-submit:disabled { opacity: .55; cursor: not-allowed; }
.login-error {
  min-height: 18px; margin-top: var(--sp-3); font-size: var(--fs-sm);
  color: var(--danger); line-height: 1.5;
}
.login-foot {
  margin-top: var(--sp-5); text-align: center; font-size: var(--fs-xs);
  color: var(--text-3);
}
