/* ============================================================
   Sorftime AI 工作台 · 设计系统 v1
   风格：专业数据产品的克制美学（Linear/Stripe 方向），浅色为主
   层级靠字重与留白，不靠边框堆砌；移动优先
   ============================================================ */

:root {
  /* 色彩 —— 品牌与语义（对齐 Sorftime Logo：亮蓝/深蓝/绿色点缀） */
  --blue: #2E5A8C;            /* 品牌深蓝 */
  --accent: #3E97D4;          /* 品牌亮蓝（主行动色，较 Logo 亮蓝略深以保对比度） */
  --accent-soft: #eaf4fb;
  --teal: #0d9488;
  --green: #16a34a;
  --green-soft: #dcfce7;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --amber: #d97706;
  --amber-soft: #fef3c7;

  /* 中性色 */
  --bg: #f5f7fa;
  --card: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --faint: #94a3b8;
  --line: #e6eaf0;
  --line-soft: #eef2f7;

  /* 字体 */
  --font: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", -apple-system, "Segoe UI", sans-serif;
  --fs-xs: 11px; --fs-sm: 12.5px; --fs-md: 14px; --fs-lg: 16px;
  --fs-xl: 20px; --fs-2xl: 26px; --fs-3xl: 34px;

  /* 间距（4px 基准） */
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --sp-5: 20px; --sp-6: 24px; --sp-8: 32px; --sp-10: 40px;

  /* 圆角 */
  --r-sm: 8px; --r-md: 12px; --r-lg: 16px; --r-full: 999px;

  /* 阴影（克制：近无阴影，靠层级） */
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 16px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 40px rgba(15, 23, 42, .14);

  /* 动效 */
  --ease: cubic-bezier(.22, .68, .36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg text { font-family: inherit; }

/* ---------- 布局 ---------- */
.container { max-width: 1080px; margin: 0 auto; padding: var(--sp-5) var(--sp-4) 80px; }
.container-wide { max-width: 1560px; margin: 0 auto; padding: var(--sp-5) var(--sp-6) 80px; }
.page { min-height: calc(100vh - 56px); }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255, 255, 255, .88);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: 1560px; margin: 0 auto;
  display: flex; align-items: center; gap: var(--sp-5);
  padding: 0 var(--sp-5); height: 56px;
}
.brand { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.brand-mark {
  width: 28px; height: 28px; border-radius: var(--r-sm);
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff; font-weight: 800; font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
}
.brand-mark.lg { width: 44px; height: 44px; font-size: 24px; border-radius: var(--r-md); }
.brand-text { font-weight: 700; font-size: 15px; color: var(--ink); white-space: nowrap; }
.mainnav { display: flex; gap: var(--sp-1); flex: 1; }
.mainnav a {
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: var(--fs-md); font-weight: 600; color: var(--muted);
  transition: color .15s var(--ease), background .15s var(--ease);
  white-space: nowrap;
}
.mainnav a:hover { color: var(--ink); background: var(--line-soft); }
.mainnav a.on { color: var(--accent); background: var(--accent-soft); }

/* v2.61 navgroup */
.mainnav details.navgroup { position: relative; }
.mainnav details.navgroup summary {
  list-style: none; cursor: pointer; user-select: none;
  padding: 6px 14px; border-radius: var(--r-full);
  font-size: var(--fs-md); font-weight: 600; color: var(--muted);
  transition: color .15s var(--ease), background .15s var(--ease);
  display: flex; align-items: center; white-space: nowrap;
}
.mainnav details.navgroup summary::-webkit-details-marker { display: none; }
.mainnav details.navgroup summary::after { content: "▾"; font-size: 10px; opacity: .6; }
.mainnav details.navgroup summary:hover { color: var(--ink); background: var(--line-soft); }
.mainnav details.navgroup summary.on { color: var(--accent); background: var(--accent-soft); }
.navgroup-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 70;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12); padding: 4px 0; min-width: 150px;
}
.mainnav details.navgroup:hover .navgroup-menu,
.mainnav details.navgroup[open] .navgroup-menu { display: block; }
.navgroup-menu a { display: block; padding: 7px 16px; font-size: var(--fs-md); font-weight: 600; color: var(--muted); white-space: nowrap; border-radius: 0; }
.navgroup-menu a:hover { color: var(--ink); background: var(--line-soft); }
.navgroup-menu a.on { color: var(--accent); background: var(--accent-soft); }
.userchip { display: flex; align-items: center; gap: var(--sp-2); flex-shrink: 0; }
.userchip .uname { font-size: var(--fs-sm); color: var(--ink-2); font-weight: 600; }
.userchip .logout { font-size: var(--fs-xs); color: var(--faint); }
.userchip .logout:hover { color: var(--red); }
.role-badge {
  font-size: var(--fs-xs); font-weight: 700; padding: 2px 10px; border-radius: var(--r-full);
}
.role-admin { background: var(--amber-soft); color: #92400e; }
.role-boss { background: var(--accent-soft); color: var(--blue); }
.role-staff { background: var(--green-soft); color: #15803d; }

/* ---------- 数据诚信横幅 ---------- */
.demo-banner {
  background: var(--amber-soft); color: #92400e;
  border: 1px solid #fcd34d; border-radius: var(--r-sm);
  padding: 8px 14px; font-size: var(--fs-sm);
  margin-bottom: var(--sp-4); line-height: 1.6;
}

/* ---------- 首页 hero ---------- */
.hero {
  display: flex; gap: var(--sp-6); align-items: center;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff; border-radius: var(--r-lg);
  padding: var(--sp-6) var(--sp-8); margin-bottom: var(--sp-6);
  box-shadow: var(--shadow-md);
}
.hero-main { flex: 1; min-width: 0; }
.hero-label { font-size: var(--fs-sm); opacity: .85; }
.hero-big { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.5px; line-height: 1.2; }
.hero-status { font-size: var(--fs-sm); opacity: .9; margin-top: var(--sp-1); }
.hero-side { display: flex; gap: var(--sp-4); }
.hero-mini { text-align: center; padding: 0 var(--sp-4); border-left: 1px solid rgba(255,255,255,.22); }
.hero-mini span { display: block; font-size: var(--fs-xs); opacity: .8; }
.hero-mini b { display: block; font-size: var(--fs-xl); font-weight: 800; }
.hero-mini em { display: block; font-style: normal; font-size: var(--fs-xs); opacity: .65; }

/* ---------- 区块标题 ---------- */
.sec-head { display: flex; align-items: baseline; gap: var(--sp-3); margin: var(--sp-6) 0 var(--sp-3); flex-wrap: wrap; }
.sec-head h2 { font-size: var(--fs-lg); font-weight: 700; color: var(--ink); }
.sec-note { font-size: var(--fs-xs); color: var(--faint); }

/* ---------- 首页 KPI 卡 ---------- */
.kpi-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.kcard {
  display: block; background: var(--card); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-4) var(--sp-3);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.kcard:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.kcard-top { display: flex; align-items: center; gap: var(--sp-2); }
.kcard-id { font-size: var(--fs-xs); font-weight: 800; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: var(--r-sm); }
.kcard-name { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.kcard-val { font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); margin-top: var(--sp-2); letter-spacing: -.5px; }
.kcard-unit { font-size: var(--fs-md); font-weight: 600; color: var(--muted); margin-left: 2px; }
.kcard-na { font-size: var(--fs-lg); color: var(--faint); font-weight: 600; }
.kcard-meta { display: flex; justify-content: space-between; align-items: center; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-1); }
.delta { font-weight: 700; }
.delta.up { color: var(--green); }
.delta.down { color: var(--red); }
.kcard-target { font-size: var(--fs-xs); color: var(--faint); border-top: 1px dashed var(--line); margin-top: var(--sp-2); padding-top: var(--sp-2); }
/* 指标卡三色（变化方向整卡着色，与话题卡/平台卡同一套语言，DESIGN.md §4） */
.kcard.k-up { border-left: 4px solid var(--green); background: var(--green-soft); }
.kcard.k-down { border-left: 4px solid var(--red); background: var(--red-soft); }
.kcard.k-flat { border-left: 4px solid var(--amber); background: var(--amber-soft); }
.kcard.k-zero { border-left: 4px solid var(--faint); background: #f1f5f9; }
/* 变化方向符号/文字（色弱友好：不只靠颜色） */
.k-dir-up { color: var(--green); }
.k-dir-down { color: var(--red); }
.k-dir-flat { color: var(--amber); }

/* ---------- 首页双栏 ---------- */
.home-cols { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); margin-top: var(--sp-6); }
.panel-card {
  background: var(--card); border-radius: var(--r-md);
  border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm);
  padding: var(--sp-5);
}
.panel-card h3 { font-size: var(--fs-md); font-weight: 700; margin-bottom: var(--sp-4); display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px var(--sp-2); }
.panel-card .more { font-size: var(--fs-xs); font-weight: 500; }
.asset-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.asset { text-align: center; padding: var(--sp-3) var(--sp-2); background: var(--bg); border-radius: var(--r-sm); }
.asset b { display: block; font-size: var(--fs-xl); font-weight: 800; color: var(--blue); }
.asset span { font-size: var(--fs-xs); color: var(--muted); }

/* ---------- 迷你动态流 ---------- */
.mini-feed { list-style: none; }
.mini-feed li { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); }
.mini-feed li:last-child { border-bottom: none; }
.feed-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; flex-shrink: 0; }
.st-人 { background: var(--accent); }
.st-智能体 { background: var(--teal); }
.st-系统 { background: var(--faint); }
.feed-body { min-width: 0; }
.feed-line { font-size: var(--fs-sm); color: var(--ink-2); }
.feed-line b { color: var(--ink); }
.feed-obj { color: var(--faint); margin-left: 6px; font-size: var(--fs-xs); }
.feed-time { font-size: var(--fs-xs); color: var(--faint); }

/* ---------- 首页数据资产清单（v0.60） ---------- */
.asset-list { display: flex; flex-direction: column; margin-bottom: var(--sp-4); }
.asset-row { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2); border-bottom: 1px solid var(--line-soft); border-radius: var(--r-sm); }
.asset-row:last-child { border-bottom: none; }
a.asset-row:hover { background: var(--bg); }
.asset-num { min-width: 40px; text-align: right; font-size: var(--fs-lg); font-weight: 800; color: var(--blue); flex-shrink: 0; }
.asset-text { min-width: 0; }
.asset-name { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.asset-desc { font-size: var(--fs-xs); color: var(--faint); }
.asset-arrow { margin-left: auto; color: var(--faint); font-size: var(--fs-sm); flex-shrink: 0; }
a.asset-row:hover .asset-arrow { color: var(--accent); }

/* 关键动态：整行可点 + 内置智能体圆点（v0.60） */
a.feed-go { display: flex; gap: var(--sp-3); width: 100%; }
a.feed-go:hover .feed-line b { color: var(--accent); }
.st-内置智能体 { background: var(--blue); }

/* 首页看点直达卡（v0.60，kind 配色复用 kpi.css 的 .hl-kind/.hl-k-*） */
.hl-home .hl-card { display: block; color: var(--ink-2); }
.hl-home-note { font-size: var(--fs-xs); color: var(--faint); margin: calc(-1 * var(--sp-2)) 0 var(--sp-3); }

/* ---------- 动态页 ---------- */
.filter-tabs { display: flex; gap: var(--sp-2); margin-bottom: var(--sp-5); flex-wrap: wrap; }
.filter-tabs a {
  padding: 6px 16px; border-radius: var(--r-full); font-size: var(--fs-sm); font-weight: 600;
  color: var(--muted); background: var(--card); border: 1px solid var(--line);
  transition: all .15s var(--ease);
}
.filter-tabs a em { font-style: normal; font-size: var(--fs-xs); opacity: .7; margin-left: 2px; }
.filter-tabs a:hover { color: var(--ink); border-color: var(--faint); }
.filter-tabs a.on { background: var(--blue); border-color: var(--blue); color: #fff; }
.timeline { background: var(--card); border-radius: var(--r-md); border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); padding: var(--sp-3) var(--sp-5); }
.tl-item { display: flex; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-soft); }
.tl-item:last-child { border-bottom: none; }
.tl-body { min-width: 0; flex: 1; }
.tl-head { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; font-size: var(--fs-sm); }
.tl-head b { color: var(--ink); }
.tl-type { font-size: var(--fs-xs); color: var(--faint); }
.tl-action { font-weight: 600; color: var(--ink-2); }
.tl-fail { font-size: var(--fs-xs); font-weight: 700; color: var(--red); background: var(--red-soft); padding: 0 8px; border-radius: var(--r-full); }
.tl-detail { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; word-break: break-all; }
.tl-obj { color: var(--accent); margin-right: var(--sp-2); }
.tl-time { font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; }

/* ---------- 表单与按钮 ---------- */
.btn-primary {
  background: var(--accent); color: #fff; border: none;
  font-size: var(--fs-md); font-weight: 700; padding: 11px 20px;
  border-radius: var(--r-sm); transition: background .15s var(--ease), transform .1s var(--ease);
}
.btn-primary:hover { background: #3185c0; }
.btn-primary:active { transform: scale(.98); }
.btn-block { width: 100%; }
.btn-ghost {
  display: inline-block; padding: 8px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line); color: var(--ink-2); font-size: var(--fs-sm); font-weight: 600;
  background: var(--card);
}
.btn-ghost:hover { border-color: var(--faint); }

/* ---------- 状态：空 / 错误 ---------- */
.empty-state { text-align: center; padding: var(--sp-6) var(--sp-4); color: var(--muted); }
.empty-state.lg { background: var(--card); border-radius: var(--r-md); border: 1px dashed var(--line); padding: var(--sp-10); }
.empty-icon { font-size: 28px; margin-bottom: var(--sp-2); }
.empty-state p { font-size: var(--fs-sm); margin-bottom: var(--sp-3); }
.alert-error {
  background: var(--red-soft); color: var(--red);
  font-size: var(--fs-sm); font-weight: 600;
  border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: var(--sp-4);
}

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(1200px 600px at 20% 0%, #e8effc 0%, var(--bg) 55%);
  padding: var(--sp-4);
}
.login-card {
  width: 100%; max-width: 380px; background: var(--card);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg);
  padding: var(--sp-8);
}
.login-brand { text-align: center; margin-bottom: var(--sp-6); }
.login-brand h1 { font-size: var(--fs-lg); font-weight: 800; margin-top: var(--sp-3); }
.login-brand p { font-size: var(--fs-xs); color: var(--faint); margin-top: 2px; }
.login-form label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: var(--sp-4); }
.login-form input {
  width: 100%; margin-top: var(--sp-1);
  padding: 11px 14px; font-size: var(--fs-md); font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.login-form input:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(62, 151, 212, .14);
}
.login-hint { text-align: center; font-size: var(--fs-xs); color: var(--faint); margin-top: var(--sp-4); }

/* ---------- 智能助手：悬浮按钮 + 面板 ---------- */
.asst-fab {
  position: fixed; right: var(--sp-5); bottom: var(--sp-5); z-index: 350;
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: linear-gradient(135deg, var(--blue), var(--accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md);
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.asst-fab:hover { transform: scale(1.06); box-shadow: var(--shadow-lg); }
.asst-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .4);
  opacity: 0; pointer-events: none; transition: opacity .2s var(--ease); z-index: 98;
}
.asst-overlay.open { opacity: 1; pointer-events: auto; }
.asst-panel {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99;
  width: 420px; max-width: 100vw;
  background: var(--bg); display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(105%); transition: transform .25s var(--ease);
}
.asst-panel.open { transform: translateX(0); }
.asst-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: var(--sp-4) var(--sp-5); background: var(--card);
  border-bottom: 1px solid var(--line-soft);
}
.asst-title { font-size: var(--fs-md); font-weight: 800; }
.asst-sub { font-size: var(--fs-xs); color: var(--faint); margin-top: 1px; }
/* 头部动作组：全图标按钮（设计标准 §1：图标与文字不混排，图标按钮必带 title） */
.asst-actions { display: flex; gap: var(--sp-1); margin-left: auto; flex-shrink: 0; }
.asst-iconbtn {
  width: 28px; height: 28px; display: inline-flex; align-items: center; justify-content: center;
  background: none; border: none; border-radius: var(--r-sm); color: var(--faint); cursor: pointer;
}
.asst-iconbtn:hover { color: var(--ink); background: var(--line-soft); }
.asst-msgs { flex: 1; overflow-y: auto; padding: var(--sp-4) var(--sp-4) var(--sp-2); }
.asst-msg { display: flex; margin-bottom: var(--sp-3); }
.asst-msg.user { justify-content: flex-end; }
.asst-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.7; white-space: pre-wrap; word-break: break-word;
}
.asst-msg.bot .asst-bubble { background: var(--card); border: 1px solid var(--line-soft); border-top-left-radius: var(--sp-1); box-shadow: var(--shadow-sm); }
.asst-msg.user .asst-bubble { background: var(--accent); color: #fff; border-top-right-radius: var(--sp-1); }
.asst-meta { font-size: var(--fs-xs); color: var(--faint); margin-top: 3px; }
.asst-typing { display: flex; gap: 5px; padding: 0 var(--sp-5) var(--sp-2); }
.asst-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--faint); animation: asst-blink 1.2s infinite; }
.asst-typing span:nth-child(2) { animation-delay: .2s; }
.asst-typing span:nth-child(3) { animation-delay: .4s; }
@keyframes asst-blink { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }
.asst-inputbar {
  display: flex; gap: var(--sp-2); padding: var(--sp-3) var(--sp-4);
  background: var(--card); border-top: 1px solid var(--line-soft);
}
.asst-inputbar input {
  flex: 1; min-width: 0; padding: 10px 14px; font-size: var(--fs-md); font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--r-full); background: var(--bg);
}
.asst-inputbar input:focus { outline: none; border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(62,151,212,.14); }
.asst-send {
  width: 42px; height: 42px; border-radius: 50%; border: none; flex-shrink: 0;
  background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
}
.asst-send:hover { background: #3185c0; }

/* 写操作确认卡片（阶段 C） */
.asst-action-card {
  background: var(--card); border: 1px solid var(--accent); border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4); box-shadow: var(--shadow-sm); max-width: 320px;
}
.asst-action-title { font-size: var(--fs-sm); font-weight: 700; color: var(--blue); }
.asst-action-summary {
  font-size: var(--fs-sm); color: var(--ink); margin-top: var(--sp-2);
  white-space: pre-wrap; word-break: break-all;
}
.asst-action-btns { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); }
.asst-action-btns button {
  flex: 1; padding: 8px 0; font-size: var(--fs-sm); font-family: inherit;
  border-radius: var(--r-sm); cursor: pointer; border: 1px solid var(--line);
}
.asst-action-ok { background: var(--accent); color: #fff; border-color: var(--accent) !important; }
.asst-action-ok:hover { background: #3185c0; }
.asst-action-cancel { background: var(--bg); color: var(--faint); }
.asst-action-cancel:hover { color: var(--ink); }
.asst-action-btns button:disabled { opacity: .5; cursor: default; }

/* ---------- 响应式（移动优先降级） ---------- */
@media (max-width: 900px) {
  .home-cols { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: var(--sp-4) var(--sp-3) 96px; }
  .container-wide { padding: var(--sp-4) var(--sp-3) 96px; }
  .topbar-inner { padding: 0 var(--sp-3); gap: var(--sp-3); }
  .brand-text { display: none; }
  .mainnav { flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { padding: 6px 10px; font-size: var(--fs-sm); }
  .userchip .uname { display: none; }
  .hero { flex-direction: column; align-items: flex-start; gap: var(--sp-4); padding: var(--sp-5); }
  .hero-side { width: 100%; }
  .hero-mini { flex: 1; }
  .kpi-grid { grid-template-columns: 1fr; }
  .asset-grid { grid-template-columns: repeat(2, 1fr); }
  /* 助手面板：手机全屏 */
  .asst-panel { width: auto; left: 0; right: 0; max-width: none; }
  .asst-fab { right: var(--sp-4); bottom: var(--sp-4); }
}

/* ---------- 助手配置管理（/admin/assistants） ---------- */
.adm-table { width: 100%; border-collapse: collapse; font-size: var(--fs-sm); }
.adm-table th {
  text-align: left; font-size: var(--fs-xs); color: var(--faint); font-weight: 600;
  padding: var(--sp-2) var(--sp-3); border-bottom: 1px solid var(--line);
}
.adm-table td { padding: var(--sp-3); border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.adm-table tr:last-child td { border-bottom: none; }
.adm-name { font-weight: 700; color: var(--ink); }
.adm-desc { font-size: var(--fs-xs); color: var(--muted); margin-top: 1px; }
.adm-mono { font-family: ui-monospace, Consolas, monospace; font-size: var(--fs-xs); color: var(--ink-2); }
.pill {
  display: inline-block; font-size: var(--fs-xs); font-weight: 700;
  padding: 2px 10px; border-radius: var(--r-full); white-space: nowrap;
}
.pill-role { background: var(--accent-soft); color: var(--blue); }
.pill-proto { background: var(--bg); color: var(--ink-2); border: 1px solid var(--line); }
.pill-on { background: var(--green-soft); color: #15803d; }
.pill-bad { background: var(--red-soft); color: var(--red); }
.pill-off { background: var(--line-soft); color: var(--muted); }
.adm-actions { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.link-btn {
  background: none; border: none; padding: 0; font-size: var(--fs-sm);
  color: var(--accent); font-weight: 600;
}
.link-btn:hover { text-decoration: underline; }
.link-btn.danger { color: var(--red); }

/* 表单 */
.adm-form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.fld { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.fld.full { grid-column: 1 / -1; }
.fld input, .fld select, .fld textarea {
  width: 100%; margin-top: var(--sp-1);
  padding: 10px 14px; font-size: var(--fs-md); font-family: inherit; font-weight: 400;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.fld textarea { min-height: 110px; resize: vertical; line-height: 1.6; }
.fld input:focus, .fld select:focus, .fld textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(62, 151, 212, .14);
}
.fld-hint { display: block; font-size: var(--fs-xs); color: var(--faint); font-weight: 400; margin-top: 3px; }
.fld-check { display: flex; align-items: center; gap: var(--sp-2); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); padding-top: 22px; }
.fld-check input { width: 16px; height: 16px; accent-color: var(--accent); }
/* 勾选项网格（数据权限/知识库范围等多选区）：两列等宽对齐，checkbox 固定尺寸纵向对齐首行 */
.adm-checklist { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2) var(--sp-4); margin-top: var(--sp-2); font-weight: 400; }
.adm-checklist label { display: flex; align-items: flex-start; gap: 6px; font-size: var(--fs-sm); font-weight: 400; line-height: 1.5; }
.adm-checklist input[type=checkbox] { width: 16px; height: 16px; flex: none; margin: 2px 0 0; accent-color: var(--accent); }
.adm-checklist .adm-mono { color: var(--faint); }
@media (max-width: 640px) { .adm-checklist { grid-template-columns: 1fr; } }
.adm-form-actions { grid-column: 1 / -1; display: flex; gap: var(--sp-3); align-items: center; flex-wrap: wrap; }
.adm-msg {
  background: var(--green-soft); color: #15803d; font-size: var(--fs-sm); font-weight: 600;
  border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: var(--sp-4);
}
.test-result { display: none; font-size: var(--fs-sm); font-weight: 600; border-radius: var(--r-sm); padding: 10px 14px; }
.test-result.ok { display: block; background: var(--green-soft); color: #15803d; }
.test-result.fail { display: block; background: var(--red-soft); color: var(--red); }
.test-result.busy { display: block; background: var(--accent-soft); color: var(--blue); }

@media (max-width: 640px) {
  /* 管理表格降级为卡片列表 */
  .adm-table, .adm-table thead, .adm-table tbody, .adm-table tr, .adm-table td { display: block; }
  .adm-table thead { display: none; }
  .adm-table tr { border: 1px solid var(--line-soft); border-radius: var(--r-md); margin-bottom: var(--sp-3); padding: var(--sp-2) var(--sp-1); }
  .adm-table td { border-bottom: none; padding: var(--sp-1) var(--sp-2); }
  .adm-form { grid-template-columns: 1fr; }
}

/* ---------- 品牌资产（Logo / Tanmo） ---------- */
.brand-logo { width: 28px; height: 28px; border-radius: 6px; object-fit: contain; }
.login-logo { width: 180px; height: auto; }
.asst-fab { background: linear-gradient(135deg, #ffffff, var(--accent-soft)); border: 1px solid var(--line); padding: 6px; }
.asst-fab img { width: 100%; height: 100%; object-fit: contain; display: block; }
.asst-avatar {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: #fff; border: 1px solid var(--line-soft); object-fit: contain; padding: 2px;
}
.asst-msg { gap: var(--sp-2); align-items: flex-start; }

/* ---------- Tanmo 图片附件 ---------- */
.asst-attach {
  width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.asst-attach:hover { color: var(--accent); border-color: var(--accent); }
.asst-attachbar {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-4); background: var(--card);
  border-top: 1px solid var(--line-soft); font-size: var(--fs-xs); color: var(--muted);
}
.asst-attachbar img { width: 34px; height: 34px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--line); }
.asst-attachbar span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asst-attach-x { background: none; border: none; color: var(--faint); font-size: 14px; padding: 2px 6px; }
.asst-attach-x:hover { color: var(--red); }
.asst-msg-img { max-width: 200px; max-height: 160px; border-radius: var(--r-sm); display: block; margin-bottom: 4px; border: 1px solid var(--line-soft); }
/* 助手配置标记 */
.pill-flag { background: var(--amber-soft); color: #92400e; }
.pill-vision { background: var(--green-soft); color: #15803d; }

/* ---------- 用户字母头像 ---------- */
.asst-avatar-user {
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--blue), var(--accent)); color: #fff;
  font-size: 14px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.asst-msg.user .asst-meta { text-align: right; }

/* ---------- 面板简化：技能占位 + 技术字段弱化 ---------- */
.skill-placeholder {
  margin-top: 8px; padding: 12px 14px; border: 1px dashed var(--line);
  border-radius: var(--r-sm); background: var(--bg);
  font-size: var(--fs-sm); color: var(--faint); font-weight: 400;
}
.adm-tech-title { font-size: var(--fs-xs); color: var(--faint); font-weight: 600; border-top: 1px solid var(--line-soft); padding-top: var(--sp-4); }
.fld-tech { font-size: var(--fs-xs); color: var(--muted); }
.fld-tech input, .fld-tech select { font-size: var(--fs-sm); }

/* ---------- 公告横幅 ---------- */
.ann-wrap { max-width: 1080px; margin: 0 auto; padding: var(--sp-4) var(--sp-4) 0; }
.ann-banner {
  border-radius: var(--r-sm); padding: 9px 14px; font-size: var(--fs-sm);
  margin-bottom: var(--sp-2); line-height: 1.6; border: 1px solid;
}
.ann-banner:last-child { margin-bottom: 0; }
.ann-info { background: var(--accent-soft); color: var(--blue); border-color: #bcd9f0; }
.ann-warning { background: var(--amber-soft); color: #92400e; border-color: #fcd34d; }
.ann-danger { background: var(--red-soft); color: var(--red); border-color: #fca5a5; }
/* 模型下拉（拉取成功后将输入框替换为 select） */
.model-select-wrap { display: flex; gap: 8px; flex: 1; min-width: 0; }
.model-select-wrap select { flex: 1; min-width: 0; }
.model-manual { background: none; border: none; color: var(--accent); font-size: var(--fs-xs); white-space: nowrap; padding: 0 4px; }
.model-manual:hover { text-decoration: underline; }
@media (max-width: 640px) { .ann-wrap { padding: var(--sp-3) var(--sp-3) 0; } }

/* ---------- 实测数据标注 ---------- */
.kcard-real { font-size: var(--fs-xs); color: #15803d; font-weight: 700; margin-top: var(--sp-1); }
.real-rounds-panel { border-left: 4px solid var(--green); }
.real-round-item { font-size: var(--fs-sm); padding: var(--sp-2) 0; border-bottom: 1px dashed var(--line-soft); }
.real-round-item:last-of-type { border-bottom: none; }

/* ---------- 管理页弹窗（编辑/新建） ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: none; align-items: center; justify-content: center; z-index: 200; padding: var(--sp-5);
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--card); border-radius: var(--r-lg); width: 100%; max-width: 760px;
  max-height: 88vh; overflow-y: auto; padding: var(--sp-5) var(--sp-6);
  box-shadow: var(--shadow-lg);
}
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
.modal-head b { font-size: var(--fs-lg); color: var(--ink); }
.modal-close { background: none; border: none; font-size: 20px; color: var(--faint); padding: 0 6px; line-height: 1; }
.modal-close:hover { color: var(--ink); }
.list-head-actions { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-4); }
@media (max-width: 640px) {
  .modal-overlay { padding: 0; align-items: stretch; }
  .modal { max-width: none; max-height: none; height: 100%; border-radius: 0; }
}

/* ---------- 智能体/技能广场 ---------- */
.agent-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.agent-card { margin: 0; }
.agent-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-2); flex-wrap: wrap; }
.agent-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 3px; }
.agent-meta b { color: var(--ink); }
.agent-light { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.agent-light.online { background: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.agent-light.busy { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.agent-light.offline { background: var(--faint); }
@media (max-width: 900px) { .agent-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .agent-grid { grid-template-columns: 1fr; } }

/* ---------- 数据源状态条 ---------- */
.src-status { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-bottom: var(--sp-4); }
.src-item {
  flex: 1; min-width: 260px; font-size: var(--fs-sm); font-weight: 600;
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-sm);
  padding: 10px 14px; color: var(--ink-2);
}
.src-item.stale { background: var(--amber-soft); border-color: #fcd34d; color: #92400e; }

/* 完成引导横幅（绿） */
.ann-success { background: var(--green-soft); color: #15803d; border-color: #86efac; }

/* ---------- 折叠区/内滚 ---------- */
.collapse-wrap .collapse-body { display: none; }
.collapse-wrap.open .collapse-body { display: block; }
.collapse-toggle { background: none; border: none; color: var(--accent); font-size: var(--fs-sm); font-weight: 600; padding: 4px 0; }
.collapse-toggle:hover { text-decoration: underline; }
.scroll-box { max-height: 300px; overflow-y: auto; }
#qbankBox { max-height: 480px; }

/* ---------- 四象限优先级（点击选择） ---------- */
.quad-cells {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  max-width: 420px; margin-top: 8px;
}
.quad-cell {
  min-height: 64px; padding: 12px; border: 2px solid var(--line); border-radius: var(--r-md);
  background: var(--bg); color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  transition: all .15s var(--ease); cursor: pointer;
}
.quad-cell:hover { border-color: var(--faint); }
.quad-cell.on { color: #fff; border-color: transparent; box-shadow: var(--shadow-md); }
.quad-cell[data-q="1"].on { background: var(--red); }
.quad-cell[data-q="2"].on { background: var(--accent); }
.quad-cell[data-q="3"].on { background: var(--amber); }
.quad-cell[data-q="4"].on { background: var(--faint); }
.quad-result { font-size: var(--fs-sm); color: var(--muted); margin-top: 6px; }
.pill.q1 { background: var(--red-soft); color: var(--red); }
.pill.q2 { background: var(--accent-soft); color: var(--blue); }
.pill.q3 { background: var(--amber-soft); color: #92400e; }
.pill.q4 { background: var(--line-soft); color: var(--muted); }

/* ---------- 通知铃铛 ---------- */
.bell { position: relative; display: flex; align-items: center; color: var(--muted); padding: 4px; }
.bell:hover { color: var(--ink); }
.bell-badge {
  position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff;
  font-size: 10px; font-weight: 700; min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 4px;
}
.bell-panel {
  position: absolute; right: 0; top: 30px; width: 320px; max-width: 90vw;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--shadow-lg); padding: var(--sp-3); display: none; z-index: 300;
}
.bell-panel.open { display: block; }
.bell-item { font-size: var(--fs-xs); padding: 8px 6px; border-bottom: 1px solid var(--line-soft); line-height: 1.6; }
.bell-item:last-child { border-bottom: none; }
.bell-item .t { color: var(--faint); }

/* ---------- 统一公告条（系统公告常驻 + 通知轮播） ---------- */
.ann-bar {
  background: var(--amber-soft); border-bottom: 1px solid #fcd34d;
  padding: 8px var(--sp-5);
}
.ann-bar-inner {
  max-width: 1080px; margin: 0 auto; display: flex; align-items: center; gap: var(--sp-2);
}
.ann-text {
  flex: 1; min-width: 0; color: #92400e; font-size: var(--fs-sm); line-height: 1.6;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; text-decoration: none; transition: opacity .18s var(--ease);
}
a.ann-text:hover { text-decoration: underline; }
.ann-live-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0;
}
.ann-pager { font-size: var(--fs-xs); color: #b45309; flex-shrink: 0; }
@media (max-width: 640px) { .ann-bar { padding: 8px var(--sp-3); } }

/* ---------- markdown 渲染体（表格横滑） ---------- */
.md-body { font-size: var(--fs-sm); line-height: 1.8; color: var(--ink-2); }
.md-body code { background: var(--line-soft); border-radius: 4px; padding: 1px 6px; font-size: 12px; }
.md-tbl { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 8px 0; }
.md-tbl table { border-collapse: collapse; min-width: 320px; width: 100%; }
.md-tbl th, .md-tbl td { border: 1px solid var(--line); padding: 6px 12px; font-size: var(--fs-xs); text-align: left; white-space: nowrap; }
.md-tbl th { background: var(--bg); font-weight: 700; color: var(--ink); }

/* ---------- Tanmo 线程（日期分隔线） ---------- */
.asst-daysep {
  text-align: center; font-size: var(--fs-xs); color: var(--faint); margin: var(--sp-3) 0 var(--sp-2);
}
.asst-daysep::before, .asst-daysep::after { content: '——'; opacity: .5; margin: 0 8px; }

/* ---------- Tanmo 引导泡泡 + AI 参与标记（阶段 E） ---------- */
.guide-bubble {
  position: fixed; right: 92px; bottom: 28px; z-index: 60;
  display: flex; align-items: flex-start; gap: var(--sp-2);
  max-width: 320px; background: var(--card); border: 1px solid var(--accent);
  border-radius: var(--r-md); padding: var(--sp-3); box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(8px); transition: opacity .25s, transform .25s;
}
.guide-bubble.show { opacity: 1; transform: translateY(0); }
.guide-avatar { width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0; background: #fff; box-shadow: 0 0 0 1.5px var(--accent); }
.guide-text { font-size: var(--fs-sm); color: var(--ink); line-height: 1.6; }
.guide-btns { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.guide-btns button { font-size: var(--fs-xs); font-family: inherit; border-radius: var(--r-sm); cursor: pointer; padding: 4px 12px; }
.guide-ok { background: var(--accent); color: #fff; border: 1px solid var(--accent); }
.guide-ok:hover { background: #3185c0; }
.guide-never { background: none; border: none; color: var(--faint); text-decoration: underline; }
.guide-never:hover { color: var(--ink); }
@media (max-width: 640px) {
  .guide-bubble { right: 84px; left: var(--sp-4); max-width: none; bottom: 20px; }
}

/* AI 参与标记：小海豚图标 + hover/tap 浮层 */
.tanmo-mark { display: inline-flex; align-items: center; position: relative; margin-left: 6px; vertical-align: -3px; cursor: help; }
.tanmo-mark img { width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 1.5px var(--accent); }
.tanmo-mark .tanmo-tip {
  position: absolute; bottom: 135%; left: 50%; transform: translateX(-50%);
  width: 190px; background: var(--blue); color: #fff; font-size: var(--fs-xs); font-weight: 400;
  line-height: 1.5; padding: 7px 10px; border-radius: var(--r-sm); box-shadow: var(--shadow-lg);
  opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 70; text-align: left;
}
.tanmo-mark .tanmo-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%; transform: translateX(-50%);
  border: 5px solid transparent; border-top-color: var(--blue);
}
.tanmo-mark:hover .tanmo-tip, .tanmo-mark.on .tanmo-tip { opacity: 1; pointer-events: auto; }
@media (max-width: 720px) {
  /* 移动端浮层右对齐收起，避免隐形态撑出横向滚动（v0.64 回归发现） */
  .tanmo-mark .tanmo-tip { left: auto; right: -4px; transform: none; }
  .tanmo-mark .tanmo-tip::after { left: auto; right: 12px; transform: none; }
}

/* ---------- Tanmo 历史会话列表 + 快捷指令 chips ---------- */
.asst-threads { flex: 1; overflow-y: auto; padding: var(--sp-3) var(--sp-4); background: var(--bg); }
.asst-threads-h { font-size: var(--fs-xs); font-weight: 700; color: var(--faint); margin: var(--sp-1) 0 var(--sp-2); }
.asst-threads-empty { font-size: var(--fs-sm); color: var(--faint); padding: var(--sp-4) 0; text-align: center; }
.asst-thread-item {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%;
  text-align: left; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); margin-bottom: var(--sp-2);
  font-family: inherit; cursor: pointer;
}
.asst-thread-item:hover { border-color: var(--accent); }
.asst-thread-item.current { border-color: var(--accent); background: rgba(62,151,212,.08); }
.asst-thread-title {
  font-size: var(--fs-sm); color: var(--ink); max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.asst-thread-meta { font-size: var(--fs-xs); color: var(--faint); }

.asst-chips {
  display: flex; gap: var(--sp-2); padding: var(--sp-2) var(--sp-4) 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
  background: var(--card);
}
.asst-chips::-webkit-scrollbar { display: none; }
.asst-chip {
  flex-shrink: 0; font-size: var(--fs-xs); font-family: inherit; color: var(--blue);
  background: var(--card); border: 1px solid var(--line); border-radius: var(--r-full);
  padding: 5px 12px; cursor: pointer; white-space: nowrap;
}
.asst-chip:hover { border-color: var(--accent); color: var(--accent); background: rgba(62,151,212,.08); }
.asst-chip.used { opacity: .45; cursor: default; }
.asst-chip.used:hover { border-color: var(--line); color: var(--blue); background: var(--card); }

/* ---------- 测量数据质检（v0.47） ---------- */
.q-details { margin-top: 4px; }
.q-details summary { list-style: none; display: inline-block; }
.q-details summary::-webkit-details-marker { display: none; }
.q-details[open] summary { margin-bottom: 4px; }
.q-list {
  margin: 0; padding: var(--sp-2) var(--sp-3) var(--sp-2) var(--sp-5);
  font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.7;
  background: var(--amber-soft); border-radius: var(--r-sm); max-width: 380px;
}

/* ---------- Tanmo 面板悬浮返回按钮（v0.51） ---------- */
.asst-backfab {
  position: absolute; top: 12px; left: 12px; z-index: 5;
  width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer;
  background: rgba(62, 151, 212, .92); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-md); transition: transform .15s var(--ease), background .15s;
}
.asst-backfab:hover { background: var(--accent); transform: scale(1.06); }
.asst-head { padding-left: 62px; }   /* 给悬浮返回按钮让位 */

/* ---------- Tanmo 消息行头像防裁切（v0.54） ----------
   气泡包装层限宽 = min(85%, 行宽 - 头像40px)，头像 flex-shrink:0 永不压缩 */
.asst-msg > div { min-width: 0; max-width: min(85%, calc(100% - 40px)); }
.asst-msg > div .asst-bubble { max-width: 100%; }

/* ---------- 铃铛通知面板移动端全宽浮层（v0.55） ----------
   窄屏：不再相对铃铛右对齐（会溢出左缘），改全宽浮层钉在导航下方；
   topbar 的 backdrop-filter 使 fixed 以 topbar 为包含块，top:58px = 导航下沿 */
@media (max-width: 640px) {
  .bell-panel {
    position: fixed; top: 58px; left: 12px; right: 12px;
    width: auto; max-width: none; max-height: 66vh; overflow-y: auto;
  }
}
.bell-item a { word-break: break-all; }

/* ---------- 登录页门面版（v0.63 门户化） ---------- */
.login-wrap {
  width: 100%; max-width: 920px;
  display: grid; grid-template-columns: 1.15fr 1fr;
  gap: var(--sp-10); align-items: center;
}
.login-hero h1 { font-size: var(--fs-2xl); font-weight: 800; color: var(--blue); margin-top: var(--sp-4); }
.login-dev {
  background: #f59e0b; color: #fff; font-size: 12px; font-weight: 700;
  padding: 2px 10px; border-radius: var(--r-full); vertical-align: middle;
}
.login-tagline { font-size: var(--fs-md); font-weight: 600; color: var(--ink-2); margin-top: var(--sp-1); }
.login-points { list-style: none; margin-top: var(--sp-6); display: flex; flex-direction: column; gap: var(--sp-3); }
.login-points li {
  display: flex; align-items: center; gap: var(--sp-3);
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); padding: 12px 14px; box-shadow: var(--shadow-sm);
}
.login-points svg { color: var(--accent); flex-shrink: 0; }
.login-points b { display: block; font-size: var(--fs-md); color: var(--ink); }
.login-points span { font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 860px) {
  .login-wrap { grid-template-columns: 1fr; gap: var(--sp-6); max-width: 420px; }
  .login-hero { text-align: center; }
  .login-points li { text-align: left; }
}

/* ---------- 顶栏工作区切换器（v0.64，由 v0.63 静态标识升级为下拉） ---------- */
.ws-switch { position: relative; flex-shrink: 0; margin-left: var(--sp-2); }
.ws-badge {
  font-size: var(--fs-xs); font-weight: 700; color: var(--blue);
  background: var(--accent-soft); border-radius: var(--r-full);
  padding: 2px 10px; white-space: nowrap;
}
.ws-switch-btn {
  border: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; gap: 4px;
}
.ws-switch-btn svg { transition: transform .15s var(--ease); }
.ws-switch.open .ws-switch-btn svg { transform: rotate(180deg); }
.ws-menu {
  display: none; position: absolute; top: calc(100% + 10px); left: 0; z-index: 60;
  min-width: 220px; max-height: 70vh; overflow-y: auto;
  background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--r-md); box-shadow: var(--shadow-md); padding: var(--sp-2);
  scrollbar-gutter: stable;  /* 预留滚动条槽位 */
  scrollbar-width: thin;     /* Firefox */
  scrollbar-color: var(--line) var(--line-soft);
}
/* 常驻可见滚动条（macOS/移动端覆盖式滚动条会自动隐藏，强制显式样式才"可发现"） */
.ws-menu::-webkit-scrollbar { width: 8px; }
.ws-menu::-webkit-scrollbar-track { background: var(--line-soft); border-radius: 4px; }
.ws-menu::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
.ws-menu::-webkit-scrollbar-thumb:hover { background: var(--muted); }
.ws-switch.open .ws-menu { display: block; }
.ws-item {
  display: flex; align-items: center; gap: var(--sp-2);
  padding: 8px 10px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--ink);
}
.ws-item:hover { background: var(--accent-soft); }
.ws-item.on { background: var(--accent-soft); font-weight: 700; color: var(--blue); }
.ws-item.wip { color: var(--muted); }
.ws-tag {
  font-size: var(--fs-xs); font-weight: 700; color: #15803d;
  background: var(--green-soft); border-radius: var(--r-full); padding: 0 8px;
}
.ws-cur { margin-left: auto; font-size: var(--fs-xs); font-weight: 700; color: var(--blue); }
.ws-sep { font-size: var(--fs-xs); color: var(--faint); padding: var(--sp-2) 10px 2px; }
@media (max-width: 720px) {
  .ws-menu { position: fixed; top: 60px; left: var(--sp-3); right: var(--sp-3); min-width: 0; max-height: calc(100vh - 80px); }
}

/* ---------- 公司门户 /portal（v0.63） ---------- */
.pt-hero {
  border-radius: var(--r-lg); padding: var(--sp-8) var(--sp-6);
  background: linear-gradient(135deg, var(--blue) 0%, var(--accent) 100%);
  color: #fff; margin-bottom: var(--sp-5); box-shadow: var(--shadow-md);
}
.pt-hero h2 { font-size: var(--fs-xl); font-weight: 800; }
.pt-hero .pt-who { font-size: var(--fs-sm); opacity: .92; margin-top: var(--sp-1); }
.pt-hero .pt-who b { font-weight: 700; }
.pt-rolechip {
  display: inline-block; font-size: var(--fs-xs); font-weight: 700;
  background: rgba(255, 255, 255, .18); border-radius: var(--r-full);
  padding: 2px 10px; margin-left: var(--sp-2); vertical-align: middle;
}
.pt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
.pt-stat {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--sp-4); box-shadow: var(--shadow-sm);
}
.pt-stat b { display: block; font-size: var(--fs-2xl); font-weight: 800; color: var(--blue); line-height: 1.2; }
.pt-stat span { font-size: var(--fs-xs); color: var(--muted); }
@media (max-width: 720px) { .pt-stats { grid-template-columns: repeat(2, 1fr); } }

.dept-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: var(--sp-3);
}
.dept-card {
  display: flex; flex-direction: column; gap: var(--sp-1);
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--sp-4); color: var(--ink);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.dept-card:hover { border-color: var(--line); box-shadow: var(--shadow-md); }
.dept-card .dept-name { font-weight: 700; font-size: var(--fs-md); }
.dept-card .dept-plan { font-size: var(--fs-xs); color: var(--muted); flex: 1; }
.dept-badge {
  align-self: flex-start; font-size: var(--fs-xs); font-weight: 700;
  border-radius: var(--r-full); padding: 1px 10px;
}
.dept-badge.wip { background: var(--line-soft); color: var(--muted); }
.dept-badge.live { background: var(--green-soft); color: #15803d; }
.dept-card.wip { background: #fafbfc; }
.dept-card.live {
  grid-column: span 2; border: 1px solid var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--card) 60%);
}
.dept-live-nums { display: flex; gap: var(--sp-4); margin: var(--sp-2) 0; flex-wrap: wrap; }
.dept-live-nums b { display: block; font-size: var(--fs-xl); font-weight: 800; color: var(--blue); white-space: nowrap; }
.dept-live-nums span { font-size: var(--fs-xs); color: var(--muted); }
.dept-enter { margin-top: var(--sp-2); }
.dept-req { font-size: var(--fs-xs); color: var(--accent); margin-top: var(--sp-2); }

/* 部门可见权限分级（v0.65）：锁定态视觉弱化但存在，保留申请接入入口 */
.dept-card.locked { background: #f5f6f8; opacity: .72; }
.dept-card.locked:hover { border-color: var(--line-soft); box-shadow: var(--shadow-sm); }
.dept-card.locked .dept-name { color: var(--muted); }
.dept-badge.locked { background: var(--line-soft); color: var(--muted); }
.dept-lock-note { font-size: var(--fs-xs); color: var(--faint); }
.ws-item.locked { color: var(--faint); cursor: not-allowed; }
.ws-item.locked:hover { background: none; }

/* 默认首页设置（v0.66）：有权限的部门卡右上角 📌，当前默认显「默认」；锁定卡无此入口 */
.dept-card { position: relative; }
.dept-pin {
  position: absolute; top: var(--sp-2); right: var(--sp-2); z-index: 1;
  border: 1px solid transparent; background: none; cursor: pointer;
  font-size: var(--fs-xs); line-height: 1; color: var(--faint);
  border-radius: var(--r-full); padding: 5px 8px; opacity: .55;
}
.dept-card:hover .dept-pin { opacity: 1; }
.dept-pin:hover { background: var(--accent-soft); color: var(--accent); opacity: 1; }
.dept-pin.on {
  opacity: 1; background: var(--accent-soft); color: var(--accent);
  border-color: var(--accent); font-weight: 700;
}
@media (hover: none) { .dept-pin { opacity: 1; } }  /* 触屏无 hover，常驻可见可点 */

.pt-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); }
.pt-metric {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--sp-4); box-shadow: var(--shadow-sm);
}
.pt-metric .m-name { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); }
.pt-metric .m-val { font-size: var(--fs-2xl); font-weight: 800; color: var(--blue); margin-top: var(--sp-1); }
.pt-metric .m-val small { font-size: var(--fs-sm); font-weight: 600; color: var(--muted); }
.pt-metric .m-note { font-size: var(--fs-xs); color: var(--faint); margin-top: var(--sp-1); }
@media (max-width: 720px) { .pt-metrics { grid-template-columns: 1fr; } }

/* ---------- 部门占位页 ---------- */
.dept-ph-head { display: flex; align-items: center; gap: var(--sp-3); flex-wrap: wrap; }
.req-form label { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: var(--sp-4); }
.req-form input, .req-form textarea {
  width: 100%; margin-top: var(--sp-1);
  padding: 10px 12px; font-size: var(--fs-md); font-family: inherit;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--bg); color: var(--ink); resize: vertical;
}
.req-form input:focus, .req-form textarea:focus {
  outline: none; border-color: var(--accent); background: #fff;
  box-shadow: 0 0 0 3px rgba(62, 151, 212, .14);
}

/* ---------- 门户知识库卡（v0.64，建设中） ---------- */
.kb-card {
  display: flex; align-items: center; gap: var(--sp-5);
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--r-md);
  padding: var(--sp-4) var(--sp-5); color: var(--ink); box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.kb-card:hover { border-color: var(--line); box-shadow: var(--shadow-md); }
.kb-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.kb-num { display: flex; align-items: baseline; gap: var(--sp-3); flex-wrap: wrap; }
.kb-num b { font-size: var(--fs-2xl); font-weight: 800; color: var(--blue); line-height: 1.2; }
.kb-num span { font-size: var(--fs-xs); color: var(--muted); }
.kb-plan { font-size: var(--fs-sm); color: var(--muted); margin: 0; }
.kb-go { font-size: var(--fs-sm); color: var(--accent); white-space: nowrap; flex-shrink: 0; }
@media (max-width: 720px) {
  .kb-card { flex-direction: column; align-items: flex-start; gap: var(--sp-3); }
}

/* ---------- 例行任务看板（v0.76） ---------- */
.rt-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-4); margin-bottom: var(--sp-5); }
.rt-stat { margin-bottom: 0; }
.rt-stat-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.rt-stat-value { font-size: var(--fs-2xl); font-weight: 800; color: var(--ink); margin: var(--sp-1) 0; }
.rt-stat-target { font-size: var(--fs-md); color: var(--faint); font-weight: 600; }
.rt-stat-sub { font-size: var(--fs-xs); color: var(--faint); }
.rt-stat-kpi { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; margin: var(--sp-1) 0; }
.rt-stat-kpi-name { font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }
.rt-todo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.rt-todo { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-2); }
.rt-todo-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-2); }
.rt-todo-meta { font-size: var(--fs-xs); color: var(--muted); display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.rt-todo-deadline { font-size: var(--fs-sm); color: var(--ink-2); }
.rt-todo-deadline.urgent { color: var(--red); font-weight: 600; }
.rt-countdown { margin-left: var(--sp-2); }
.rt-return-note { font-size: var(--fs-xs); color: var(--red); background: var(--red-soft); border-radius: var(--r-sm); padding: var(--sp-2) var(--sp-3); }
.rt-submit-info { font-size: var(--fs-xs); color: var(--muted); }
.rt-review-info { font-size: var(--fs-xs); color: var(--green); margin-top: 2px; }
.rt-review-info.bad { color: var(--red); }
.rt-dim { color: var(--faint); font-size: var(--fs-xs); font-weight: 400; }
.rt-runs { display: flex; flex-direction: column; }
.rt-run { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-3); padding: var(--sp-3) 0; border-bottom: 1px solid var(--line-soft); }
.rt-run:last-child { border-bottom: none; }
.rt-run-main { flex: 1; min-width: 0; }
.rt-run-title { display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap; }
.rt-run-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.rt-actions { display: flex; gap: var(--sp-2); align-items: center; flex-shrink: 0; flex-wrap: wrap; margin-top: var(--sp-1); }
.rt-todo .rt-actions { margin-top: auto; }
.rt-field { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); margin-bottom: var(--sp-3); }
.rt-field input, .rt-field select, .rt-field textarea {
  display: block; width: 100%; margin-top: var(--sp-1); padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: var(--fs-sm);
  font-weight: 400; color: var(--ink); background: var(--card); box-sizing: border-box;
}
.rt-field input:focus, .rt-field select:focus, .rt-field textarea:focus {
  outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62, 151, 212, .14);
}
.rt-2col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
.rt-modal-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-3); flex-wrap: wrap; }
.rt-review-submit { font-size: var(--fs-sm); color: var(--ink-2); background: var(--bg); border-radius: var(--r-sm); padding: var(--sp-3); margin-bottom: var(--sp-3); }
/* 提交规范 v1（v0.79）：结构化交付物清单 */
.rt-articles { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); font-size: var(--fs-xs); color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.rt-articles li { line-height: 1.6; }
.rt-articles a { margin-left: var(--sp-1); }
.rt-articles .rt-dim { margin-left: var(--sp-1); }
.rt-confirm-warn { color: var(--red); font-weight: 600; }
.rt-actions .btn-primary, .rt-actions .btn-ghost { padding: 6px var(--sp-3); font-size: var(--fs-xs); height: auto; }
.rt-actions form { margin: 0; }
@media (max-width: 720px) {
  .rt-stats { grid-template-columns: 1fr 1fr; }
  .rt-run { flex-direction: column; }
  .rt-2col { grid-template-columns: 1fr; }
}

/* ===== 自媒体创作专区（v0.81，cr-* 前缀） ===== */
.cr-scan { font-size: var(--fs-sm); color: var(--ink-2); }
.cr-newtopic { display: grid; grid-template-columns: 2fr 90px 1.2fr auto; gap: var(--sp-2); margin-bottom: var(--sp-4); }
.cr-newtopic input { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px var(--sp-3); font-size: var(--fs-sm); }
/* 创作流水线看板（泳道横排） */
.cr-board { display: flex; gap: var(--sp-3); overflow-x: auto; padding-bottom: var(--sp-2); }
.cr-lane { min-width: 260px; flex-shrink: 0; background: var(--bg); border-radius: var(--r-md); padding: var(--sp-3); max-height: 520px; overflow-y: auto; }
.cr-lane-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.cr-lane-head b { font-size: var(--fs-sm); font-weight: 700; }
.cr-lane-count { background: var(--card); border-radius: var(--r-full); padding: 1px 8px; font-size: var(--fs-xs); font-weight: 700; color: var(--blue); }
.cr-lane-list { display: flex; flex-direction: column; gap: var(--sp-2); max-height: 480px; overflow-y: auto; }
.cr-lane-empty { padding: var(--sp-4); text-align: center; font-size: var(--fs-xs); }
.cr-card { background: var(--card); border-radius: var(--r-sm); border: 1px solid var(--line-soft); padding: var(--sp-3); }
.cr-card-actions { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.cr-topic-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: var(--sp-3); }
.cr-topic { border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3); display: flex; flex-direction: column; gap: var(--sp-2); }
.cr-topic.cr-dim { opacity: .55; }
.cr-topic-head { display: flex; gap: var(--sp-2); align-items: flex-start; }
.cr-topic-title { font-size: var(--fs-sm); color: var(--ink); line-height: 1.5; }
.cr-score { flex: none; min-width: 34px; text-align: center; background: var(--accent); color: #fff; border-radius: var(--r-full); padding: 2px 8px; font-size: var(--fs-xs); font-weight: 700; }
.cr-score.s-hi { background: var(--green); }
.cr-score.s-mid { background: var(--amber); }
.cr-score.s-lo { background: #9ca3af; }
.cr-lane-legend { font-size: var(--fs-xs); color: var(--ink-3, #6b7280); line-height: 1.6; margin: 0 0 var(--sp-2); }
.cr-lane-legend .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin: 0 3px 0 6px; vertical-align: baseline; }
.cr-lane-legend .dot-hi { background: var(--green); }
.cr-lane-legend .dot-mid { background: var(--amber); }
.cr-lane-legend .dot-lo { background: #9ca3af; }
.cr-topic-meta { display: flex; gap: var(--sp-2); align-items: center; flex-wrap: wrap; }
.cr-topic-detail { font-size: var(--fs-xs); }
.cr-topic-note { font-size: var(--fs-xs); color: var(--ink-2); line-height: 1.6; }
.cr-art-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.cr-art { display: block; border: 1px solid var(--line); border-radius: var(--r-sm); padding: var(--sp-3); text-decoration: none; color: inherit; }
.cr-art:hover { border-color: var(--accent); }
.cr-art-head { display: flex; justify-content: space-between; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.cr-art-head b { font-size: var(--fs-sm); color: var(--ink); }
.cr-flow { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; margin-bottom: var(--sp-1); }
.cr-flow-lg { margin-bottom: var(--sp-4); }
.cr-flow-step { font-size: var(--fs-xs); color: var(--muted); border: 1px solid var(--line); border-radius: var(--r-full); padding: 2px 10px; }
.cr-flow-step.done { color: var(--green); border-color: var(--green); }
.cr-flow-step.cur { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.cr-flow-arrow { color: var(--muted); font-size: var(--fs-xs); }
.cr-return-form { display: flex; gap: var(--sp-2); margin-top: var(--sp-2); }
.cr-return-form input { flex: 1; border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px var(--sp-3); font-size: var(--fs-sm); }
@media (max-width: 720px) {
  .cr-newtopic { grid-template-columns: 1fr; }
  .cr-return-form { flex-direction: column; }
}

/* 报告中心版本合并（v0.81） */
.rep-versions { margin-top: var(--sp-2); font-size: var(--fs-xs); }
.rep-versions summary { cursor: pointer; color: var(--accent); }
.rep-versions ul { margin: var(--sp-1) 0 0; padding-left: var(--sp-5); display: flex; flex-direction: column; gap: 2px; }

/* ============================================================
   部门工作面板（v0.88，/dept/{部门名}，组件前缀 .dp-*）
   ============================================================ */
.dp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--sp-4); flex-wrap: wrap; }
.dp-title { font-size: var(--fs-xl); font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: var(--sp-3); }
.dp-sub { font-size: var(--fs-sm); color: var(--muted); margin-top: var(--sp-1); }
.dp-members { display: flex; flex-wrap: wrap; gap: var(--sp-2); margin-top: var(--sp-3); }
.dp-member { font-size: var(--fs-xs); color: var(--ink-2); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-full); padding: 3px 10px; }
.dp-member i { font-style: normal; color: var(--accent); margin-left: 4px; }
.dp-member.empty { color: var(--faint); }
.dp-head-actions { display: flex; gap: var(--sp-2); flex: none; flex-wrap: wrap; }

.dp-duties { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-3); }
.dp-duty { border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-3); background: var(--card); }
.dp-duty b { font-size: var(--fs-sm); color: var(--ink); }
.dp-duty p { font-size: var(--fs-xs); color: var(--ink-2); margin: var(--sp-1) 0; }
.dp-note { font-size: var(--fs-xs); color: var(--faint); }

.dp-tablewrap { overflow-x: auto; }
.dp-dim { font-size: var(--fs-xs); color: var(--faint); }
.dp-kpiline { font-size: var(--fs-xs); color: var(--amber); margin-top: 2px; }
.dp-row-off td { opacity: .6; }

.dp-pace { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
.dp-pace-head { font-size: var(--fs-sm); font-weight: 700; color: var(--ink-2); margin-bottom: var(--sp-2); }
.dp-pace-item { display: flex; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); align-items: baseline; }
.dp-pace-item:last-child { border-bottom: none; }
.dp-pace-time { font-weight: 700; color: var(--accent); min-width: 92px; flex: none; }

.dp-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--sp-3); }
.dp-kpi { display: block; border: 1px solid var(--line-soft); border-radius: var(--r-md); padding: var(--sp-3); background: var(--card); text-decoration: none; transition: border-color .15s var(--ease); }
.dp-kpi:hover { border-color: var(--accent); }
.dp-kpi-id { font-size: var(--fs-xs); font-weight: 800; color: var(--accent); background: var(--accent-soft); display: inline-block; padding: 1px 8px; border-radius: var(--r-sm); }
.dp-kpi-val { font-size: var(--fs-xl); font-weight: 700; color: var(--ink); margin-top: var(--sp-1); }
.dp-kpi-val small { font-size: var(--fs-xs); color: var(--faint); font-weight: 500; margin-left: 2px; }
.dp-kpi-name { font-size: var(--fs-xs); color: var(--ink-2); }
.dp-kpi-sub { font-size: var(--fs-xs); color: var(--faint); border-top: 1px dashed var(--line); margin-top: var(--sp-2); padding-top: var(--sp-2); }

.dp-gaps { list-style: none; }
.dp-gaps li { display: flex; gap: var(--sp-2); align-items: flex-start; padding: var(--sp-2) 0; border-bottom: 1px solid var(--line-soft); font-size: var(--fs-sm); color: var(--ink-2); }
.dp-gaps li:last-child { border-bottom: none; }
.dp-gaps li input[type=checkbox] { width: 16px; height: 16px; flex: none; margin-top: 3px; accent-color: var(--accent); }
.dp-gaps li.done span { text-decoration: line-through; color: var(--faint); }
.dp-gap-mark { color: var(--faint); flex: none; }

/* 面板编辑弹窗的可增删行（职责块 / 欠缺项） */
.dp-editrow { display: grid; grid-template-columns: 140px 1fr 130px auto; gap: var(--sp-2); align-items: center; margin-bottom: var(--sp-2); }
.dp-editrow.gap { grid-template-columns: 1fr auto auto; }
.dp-editrow input[type=text], .dp-editrow input:not([type]) { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px var(--sp-3); font-size: var(--fs-sm); width: 100%; }
.dp-editrow input:focus { outline: none; border-color: var(--accent); }
.dp-editrow .dp-done { font-size: var(--fs-xs); color: var(--muted); display: flex; align-items: center; gap: 4px; white-space: nowrap; }

@media (max-width: 720px) {
  .dp-pace { grid-template-columns: 1fr; }
  .dp-head { flex-direction: column; }
  .dp-editrow { grid-template-columns: 1fr; }
  .dp-editrow.gap { grid-template-columns: 1fr; }
}


/* v1.28：Tanmo 对话框完整 markdown 渲染（marked + DOMPurify 本地 vendor） */
.asst-bubble.md { white-space: normal; }
.asst-bubble.md table { border-collapse: collapse; margin: 8px 0; width: 100%; font-size: var(--fs-xs); }
.asst-bubble.md th, .asst-bubble.md td { border: 1px solid var(--line); padding: 5px 8px; text-align: left; }
.asst-bubble.md th { background: var(--bg); font-weight: 600; }
.asst-bubble.md pre { background: #0f172a; color: #e2e8f0; padding: 10px 12px; border-radius: var(--r-sm); overflow-x: auto; font-size: var(--fs-xs); }
.asst-bubble.md code { background: var(--line-soft); padding: 1px 5px; border-radius: 4px; font-size: var(--fs-xs); }
.asst-bubble.md pre code { background: none; padding: 0; }
.asst-bubble.md h1, .asst-bubble.md h2, .asst-bubble.md h3, .asst-bubble.md h4 { font-size: var(--fs-md); margin: 10px 0 6px; }
.asst-bubble.md ul, .asst-bubble.md ol { padding-left: 20px; margin: 6px 0; }
.asst-bubble.md p { margin: 6px 0; }
.asst-bubble.md blockquote { border-left: 3px solid var(--accent); padding-left: 10px; color: var(--muted); margin: 8px 0; }
.asst-fig { max-width: 100%; border-radius: var(--r-sm); cursor: zoom-in; margin: 6px 0; border: 1px solid var(--line); display: block; }


/* v1.29：Tanmo 面板宽度拖拽手柄（PC 左缘） */
.asst-resizer { position: absolute; left: -4px; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 5; }
.asst-resizer::after { content: ''; position: absolute; left: 4px; top: 50%; transform: translateY(-50%); width: 3px; height: 44px; border-radius: 2px; background: var(--line); opacity: 0; transition: opacity .15s; }
.asst-resizer:hover::after, .asst-resizer:active::after { opacity: 1; background: var(--accent); }


/* v1.30：屏幕截图框选（PC） */
.sc-overlay { position: fixed; inset: 0; z-index: 4000; background: rgba(8,12,20,.72); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; }
.sc-stage { position: relative; max-width: 92vw; max-height: 84vh; box-shadow: 0 12px 40px rgba(0,0,0,.4); }
.sc-img { display: block; max-width: 92vw; max-height: 84vh; cursor: crosshair; user-select: none; }
.sc-rect { position: absolute; border: 2px solid #3E97D4; background: rgba(62,151,212,.18); box-shadow: 0 0 0 9999px rgba(8,12,20,.35); pointer-events: none; }
.sc-bar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 10px; padding: 8px 14px; }
.sc-hint { font-size: var(--fs-xs); color: var(--muted); margin-right: 8px; }
.asst-shot { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.asst-shot:hover { color: var(--accent); border-color: var(--accent); }
.kb-attachbar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 6px; background: var(--card); font-size: var(--fs-xs); }
.kb-attachbar img { height: 40px; border-radius: 6px; }
.kb-attachbar .x { cursor: pointer; color: var(--muted); margin-left: auto; }
.kb-msg-img { max-width: 220px; border-radius: 8px; display: block; margin-bottom: 6px; }


/* v1.34：任务看板（按状态分列，卡片可拖拽） */
.kanban { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-4); align-items: start; }
.kb-col { background: var(--bg); border: 1px solid var(--line-soft); border-radius: var(--r-md); min-height: 200px; transition: border-color .15s, box-shadow .15s; }
.kb-col.kb-over { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(62,151,212,.15); }
.kb-col-head { padding: 10px 12px; font-weight: 700; font-size: var(--fs-sm); border-bottom: 1px solid var(--line-soft); display: flex; align-items: center; gap: 8px; }
.kb-col-hint { font-weight: 400; font-size: var(--fs-xs); color: var(--faint); }
.kb-count { background: var(--line-soft); border-radius: var(--r-full); padding: 1px 8px; font-size: var(--fs-xs); color: var(--muted); }
.kb-cards { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.kb-card { background: var(--card); border: 1px solid var(--line-soft); border-left: 3px solid var(--line); border-radius: var(--r-sm); padding: 9px 10px; cursor: grab; box-shadow: var(--shadow-sm); }
.kb-card.q1 { border-left-color: #dc2626; }
.kb-card.q2 { border-left-color: #3E97D4; }
.kb-card.q3 { border-left-color: #d97706; }
.kb-card.q4 { border-left-color: #94a3b8; }
.kb-card.kb-bundle { cursor: default; background: var(--bg); }
.kb-card.kb-dragging { opacity: .4; }
.kb-card-title { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); text-decoration: none; display: block; margin-bottom: 5px; }
.kb-card-title:hover { color: var(--accent); }
.kb-card-meta { display: flex; justify-content: space-between; font-size: var(--fs-xs); color: var(--muted); gap: 6px; }
.kb-card-meta span { white-space: nowrap; }
.kb-overdue { color: #dc2626; font-weight: 600; }
.kb-card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.kb-quad { font-size: 10px; color: var(--faint); }
.kb-empty { text-align: center; color: var(--faint); font-size: var(--fs-xs); padding: 18px 0; }
.kb-move { margin-top: 6px; font-size: var(--fs-xs); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--bg); color: var(--muted); padding: 2px 4px; }
@media (min-width: 641px) { .kb-move { display: none; } }   /* PC 用拖拽，下拉只给触屏 */
@media (max-width: 900px) { .kanban { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .kanban { grid-template-columns: 1fr; } }

/* ---------- 热点热榜卡片（v1.50b） ---------- */
.hs-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: var(--sp-4); }
.hs-tab { padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--r-full);
  background: var(--card); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: all .15s var(--ease); }
.hs-tab:hover { border-color: var(--accent); color: var(--accent); }
.hs-tab.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.hs-tab-n { margin-left: 4px; font-size: 10px; opacity: .7; }
.hs-list { display: flex; flex-direction: column; gap: 2px; }
.hs-item { display: flex; justify-content: space-between; align-items: center;
  padding: var(--sp-3) var(--sp-2); border-radius: var(--r-sm);
  border-bottom: 1px solid var(--line-soft); transition: background .15s var(--ease); }
.hs-item:hover { background: var(--bg); }
.hs-item-topic { font-size: var(--fs-sm); font-weight: 600; color: var(--ink); line-height: 1.4; }
.hs-item-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; }
.hs-item-acts { display: flex; gap: 6px; flex-shrink: 0; margin-left: var(--sp-3); }
.hs-btn { padding: 4px 12px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--card); font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2);
  cursor: pointer; white-space: nowrap; transition: all .15s var(--ease); }
.hs-btn:hover { border-color: var(--accent); color: var(--accent); }
.hs-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.hs-btn-primary:hover { opacity: .85; }
.hs-empty { padding: var(--sp-4); text-align: center; color: var(--faint); font-size: var(--fs-sm); }
@media (max-width: 640px) {
  .hs-item { flex-direction: column; align-items: flex-start; gap: 6px; }
  .hs-item-acts { margin-left: 0; }
}