:root {
  /* 莫海泛舟 · 墨海纸本主题：暖纸底 + 墨色正文 + 靛紫主色 + 铜金强调 */
  --bg: #f6f5f2;
  --bg-soft: #eeece7;
  --panel: #ffffff;
  --panel-2: #faf9f6;
  --line: rgba(26, 22, 52, 0.075);
  --line-strong: rgba(26, 22, 52, 0.15);
  --border: var(--line);
  --text: #17142c;
  --text-2: #423e58;
  --muted: #5f5b74;
  --muted-2: #6f6b80;
  --amber: #b07a2b;
  --amber-soft: rgba(176, 122, 43, 0.12);
  --green: #12836a;
  --green-soft: rgba(18, 131, 106, 0.12);
  --red: #bf4a3a;
  --red-soft: rgba(191, 74, 58, 0.12);
  --blue: #3b62c9;
  --blue-soft: rgba(59, 98, 201, 0.12);
  --purple: #5442c4;
  --purple-soft: rgba(84, 66, 196, 0.12);
  --ink: #1d1938;
  /* 侧栏：低饱和炭灰 #2C2C34，非纯黑不刺眼；选中用品牌紫提亮 */
  --sidebar-bg: #2c2c34;
  --sidebar-text: #f0f0f4;
  --sidebar-muted: #b3b3bf;
  --sidebar-dim: #9d9daa;
  --sidebar-line: rgba(255, 255, 255, 0.08);
  --sidebar-active: linear-gradient(135deg, rgba(124, 108, 240, 0.26), rgba(124, 108, 240, 0.12));
  --sidebar-active-border: rgba(156, 142, 255, 0.34);
  --sidebar-accent: #a394ff;
  --sidebar-active-shadow: 0 6px 18px rgba(0, 0, 0, 0.26);
  /* 辅助：浅底组件的 hover / 分割 / 遮罩 */
  --hover-bg: rgba(84, 66, 196, 0.05);
  --hover-bg-strong: rgba(84, 66, 196, 0.09);
  --row-divider: rgba(26, 22, 52, 0.055);
  --overlay: rgba(23, 20, 44, 0.46);
  --radius-xs: 6px;
  --radius-sm: 8px;
  --radius-md: 10px;
  --radius: 14px;
  --radius-lg: 16px;
  --dur-fast: .12s;
  --dur: .18s;
  --dur-slow: .3s;
  --shadow: 0 12px 34px rgba(23, 20, 44, 0.13);
  --shadow-sm: 0 4px 14px rgba(23, 20, 44, 0.08);
  --shadow-xs: 0 1px 2px rgba(23, 20, 44, 0.05), 0 2px 10px rgba(23, 20, 44, 0.035);
  --focus-ring: 0 0 0 3px rgba(84, 66, 196, 0.14);
  /* 控件统一高度：搜索框 / 下拉 / 按钮 / 筛选 chip 对齐到同一基线 */
  --control-h: 36px;
  /* 中文一律无衬线：Windows 上没有可用的中文衬线体，缺字体时 Chrome 会按脚本
     回退到系统中文标准字体（宋体），40px 标题就成了横细竖粗的"文档标题"。 */
  --font-sans: "HarmonyOS Sans SC", "MiSans", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", "Segoe UI", system-ui, -apple-system, sans-serif;
  /* 衬线栈只留给确实装了 Noto / 思源宋体的机器，兜底必须是无衬线栈 */
  --font-serif: "Noto Serif SC", "Source Han Serif SC", var(--font-sans);
  --font-mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, "Liberation Mono", monospace;
  --font-display: var(--font-sans);
  font-family: var(--font-sans);
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  min-height: 100vh;
  font-family: var(--font-sans);
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.01em;
  /* 暖纸底 + 极细网点颗粒，营造纸本质感而非纯色面板 */
  background:
    radial-gradient(900px 520px at 10% -12%, rgba(84, 66, 196, 0.06), transparent 62%),
    radial-gradient(720px 440px at 100% -4%, rgba(176, 122, 43, 0.05), transparent 62%),
    radial-gradient(rgba(26, 22, 52, 0.05) 0.7px, transparent 0.7px) 0 0 / 4px 4px,
    var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: tabular-nums;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.accent { color: var(--amber); }
.mono { font-variant-numeric: tabular-nums; }

/* ----------------------------- 启动 & 登录 ----------------------------- */
.boot-screen {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  color: var(--muted);
}
.boot-screen .logo-mark { width: 66px; height: 66px; border-radius: 20px; }

.logo-mark {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 13px;
  background: linear-gradient(150deg, #6b5ce0 0%, var(--purple) 100%);
  color: #fff;
  box-shadow: 0 6px 18px rgba(92, 72, 216, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.22);
  flex: none;
}
.logo-icon { width: 58%; height: 58%; display: block; }
.logo-mark.lg { width: 58px; height: 58px; border-radius: 18px; }
.logo-mark.lg .logo-icon { width: 60%; height: 60%; }

.auth {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}
.auth-visual {
  padding: 56px 64px;
  display: flex; flex-direction: column; justify-content: center;
  border-right: 1px solid var(--line);
  background:
    radial-gradient(720px 420px at 12% 12%, rgba(106, 92, 255, 0.10), transparent 62%),
    linear-gradient(180deg, rgba(84, 66, 196, 0.04), transparent 40%);
  position: relative; overflow: hidden;
}
/* 胶片齿孔装饰：贴合"片场"主题 */
.auth-visual::before {
  content: ""; position: absolute; top: -8%; bottom: -8%; right: 42px; width: 40px;
  background-image: repeating-linear-gradient(180deg, rgba(84, 66, 196, 0.10) 0 16px, transparent 16px 34px);
  border-left: 1px solid rgba(84, 66, 196, 0.14);
  border-right: 1px solid rgba(84, 66, 196, 0.14);
  transform: rotate(4deg);
  pointer-events: none;
}
.auth-visual::after {
  content: ""; position: absolute; inset: auto -10% -40% 40%;
  height: 420px; background: radial-gradient(closest-side, rgba(106,168,255,0.10), transparent);
  pointer-events: none;
}
/* 入场动画：错峰上浮 */
@keyframes authRise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
.auth-visual > *, .auth-panel > * { animation: authRise .6s cubic-bezier(.2,.7,.2,1) both; }
.auth-visual > *:nth-child(1) { animation-delay: .04s; }
.auth-visual > *:nth-child(2) { animation-delay: .12s; }
.auth-visual > *:nth-child(3) { animation-delay: .20s; }
.auth-visual > *:nth-child(4) { animation-delay: .28s; }
.auth-visual > *:nth-child(5) { animation-delay: .36s; }
.auth-panel > *:nth-child(1) { animation-delay: .10s; }
.auth-panel > *:nth-child(2) { animation-delay: .18s; }
.auth-brand { display: flex; align-items: center; gap: 14px; }
.auth-brand b { display: block; font-size: 20px; letter-spacing: 1.5px; font-weight: 700; color: var(--text); }
.auth-brand small { display: block; font-size: 9.5px; letter-spacing: 3px; color: var(--muted-2); margin-top: 5px; }
.auth-visual h1 {
  /* 明确用无衬线：Windows 上 "Noto Serif SC" 并不存在，Chrome 会按脚本回退到系统
     中文标准字体（宋体），40px 下横细竖粗，像 Word 文档标题。 */
  margin: 40px 0 18px; font-size: 38px; line-height: 1.3; font-weight: 700; letter-spacing: -0.5px;
  font-family: var(--font-sans);
}
.auth-visual h1 em { font-style: normal; color: var(--purple); }
.auth-sub { color: var(--muted); font-size: 15px; line-height: 1.8; max-width: 520px; }
.auth-points { list-style: none; padding: 0; margin: 38px 0 0; display: flex; flex-direction: column; gap: 18px; max-width: 520px; }
.auth-points li { display: flex; flex-direction: column; gap: 4px; padding-left: 18px; border-left: 2px solid rgba(84, 66, 196, 0.45); }
.auth-points b { font-size: 14px; color: var(--text); letter-spacing: 1px; }
.auth-points span { color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-foot { margin-top: 46px; color: var(--muted-2); font-size: 12px; letter-spacing: 1px; }

.auth-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 48px clamp(28px, 6vw, 72px);
}
.auth-tabs { display: flex; gap: 26px; margin-bottom: 30px; border-bottom: 1px solid var(--line); }
.auth-tabs button {
  background: none; border: 0; color: var(--muted); font-size: 16px; padding: 0 2px 13px;
  cursor: pointer; position: relative; font-weight: 500;
}
.auth-tabs button.active { color: var(--text); font-weight: 700; }
.auth-tabs button.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--purple);
}
.auth-form { display: flex; flex-direction: column; gap: 18px; max-width: 380px; }
.auth-form label { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.auth-form input {
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 13px 14px; color: var(--text); font-size: 14px; outline: none; transition: border-color .15s, box-shadow .15s;
}
.auth-form input:focus { border-color: rgba(84, 66, 196, 0.55); box-shadow: var(--focus-ring); }
.auth-tabs button { transition: color .15s; }
.auth-tabs button:hover { color: var(--text); }
.auth-hint { color: var(--muted-2); font-size: 12px; line-height: 1.7; margin: 4px 0 0; }

/* -------------------------------- 框架 -------------------------------- */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column;
  border-right: 1px solid rgba(0, 0, 0, 0.28);
  background:
    radial-gradient(520px 320px at 6% 0%, rgba(255, 255, 255, 0.045), transparent 62%),
    radial-gradient(420px 360px at 100% 100%, rgba(163, 148, 255, 0.06), transparent 60%),
    var(--sidebar-bg);
  padding: 22px 14px 18px;
  color: var(--sidebar-text);
  overflow: hidden;
  box-shadow: 6px 0 28px rgba(20, 20, 24, 0.16);
}
.side-brand { display: flex; align-items: center; gap: 13px; padding: 2px 8px 18px; }
.side-brand b { display: block; font-size: 17.5px; letter-spacing: 1.5px; color: #fff; font-weight: 700; }
.side-brand small { display: block; font-size: 9px; letter-spacing: 2.8px; color: var(--sidebar-muted); margin-top: 4px; }
.nav {
  display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0;
  overflow-y: auto; overflow-x: hidden; padding-right: 2px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.18) transparent;
}
.nav::-webkit-scrollbar { width: 6px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }
.nav::-webkit-scrollbar-track { background: transparent; }
.nav-group { display: flex; flex-direction: column; gap: 3px; }
.nav-group + .nav-group { margin-top: 8px; padding-top: 9px; border-top: 1px solid rgba(255, 255, 255, 0.07); }
.nav-group-title {
  font-size: 11px; letter-spacing: 1.6px; font-weight: 600; color: var(--sidebar-dim);
  padding: 2px 12px 3px; text-transform: uppercase; user-select: none;
}
.nav-group-title.link {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-decoration: none; cursor: pointer; transition: color .15s;
}
.nav-group-title.link:hover { color: var(--sidebar-text); }
.nav-group-title.link.active { color: var(--sidebar-accent); }
.nav-group-title .title-arrow { font-size: 12px; letter-spacing: 0; opacity: .55; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 10px;
  color: var(--sidebar-muted); font-size: 13.5px; font-weight: 500; cursor: pointer;
  border: 1px solid transparent; transition: .15s; position: relative;
}
.nav-item svg { width: 17px; height: 17px; flex: none; opacity: .9; }
.nav-item:hover { color: #fff; background: rgba(255, 255, 255, 0.06); }
.nav-item.active {
  color: #fff; background: var(--sidebar-active); border-color: var(--sidebar-active-border);
  box-shadow: var(--sidebar-active-shadow); font-weight: 600;
}
.nav-item.active::before {
  content: ""; position: absolute; left: -14px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--sidebar-accent);
}
.nav-item.active svg { color: var(--sidebar-accent); opacity: 1; }
.nav-item .nav-count {
  margin-left: auto; font-size: 11px; min-width: 20px; text-align: center; padding: 2px 6px;
  border-radius: 999px; background: rgba(163, 148, 255, 0.18); color: var(--sidebar-accent); font-weight: 600;
}
.side-user {
  border-top: 1px solid var(--sidebar-line); padding-top: 16px; display: flex; flex-direction: column; gap: 12px;
}
.side-user-main { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 10px; display: flex; align-items: center; justify-content: center;
  background: rgba(163, 148, 255, 0.20); color: #e7e2ff; font-weight: 700; font-size: 13px; flex: none;
  border: 1px solid rgba(163, 148, 255, 0.28);
}
.side-user-main b { font-size: 13px; display: block; color: #f4f4f8; }
.side-user-main small { color: var(--sidebar-dim); font-size: 11px; }
.side-user-actions { display: flex; gap: 8px; }
.side-user-actions button {
  flex: 1; background: rgba(255, 255, 255, 0.055); border: 1px solid var(--sidebar-line); color: var(--sidebar-muted);
  border-radius: 8px; padding: 7px 0; font-size: 12px; cursor: pointer; transition: .15s;
}
.side-user-actions button:hover { color: #fff; border-color: rgba(255, 255, 255, 0.26); background: rgba(255, 255, 255, 0.09); }

/* 全站统一加宽：左右留白随视口收缩、宽度上限放宽，避免宽表格总要拖横向滑块。
   侧栏固定 248px，1280 CSS px 视口下内容区仍有约 1000px 可用。 */
.main { padding: 24px clamp(10px, 0.8vw, 20px) 64px; max-width: 1760px; width: 100%; min-width: 0; margin-inline: auto; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.page-head h1 {
  margin: 0; font-size: 23px; letter-spacing: -0.35px; font-weight: 700; line-height: 1.35;
  font-family: var(--font-sans); color: var(--text);
}
.page-head h1::after {
  content: ""; display: block; width: 30px; height: 2px; background: var(--purple);
  border-radius: 2px; margin-top: 8px; opacity: .65;
}
.page-subtitle { margin: 8px 0 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.head-actions { display: flex; gap: 10px; align-items: center; }
/* 页头右侧：通知铃铛（常驻插槽，不会被 setHeadActions 覆盖）+ 本页操作按钮 */
.head-right { display: flex; align-items: center; gap: 10px; flex: none; }
.topbar-slot { display: flex; align-items: center; }

/* -------------------------------- 基础组件 ------------------------------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.card-pad { padding: 20px; }
.section { margin-top: 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.section-head h2 {
  margin: 0; font-size: 15px; letter-spacing: 0; font-weight: 650;
  display: inline-flex; align-items: center; gap: 8px;
}
.section-head h2::before {
  content: ""; width: 3px; height: 14px; border-radius: 2px;
  background: linear-gradient(180deg, var(--purple), rgba(84, 66, 196, .35));
}
.section-head .muted { font-size: 12px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 9px; border: 1px solid var(--line); background: var(--panel); color: var(--text-2);
  padding: 9px 15px; font-size: 13px; font-weight: 500; cursor: pointer; transition: .15s; white-space: nowrap;
  min-height: var(--control-h);
}
.btn:hover { border-color: rgba(84, 66, 196, 0.28); background: var(--hover-bg); color: var(--purple); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-primary {
  background: linear-gradient(160deg, #2a2450, #17142c); border-color: rgba(23, 20, 44, 0.9); color: #fff;
  font-weight: 600; letter-spacing: .2px; box-shadow: 0 4px 14px rgba(23, 20, 44, 0.26);
}
.btn-primary:hover {
  background: linear-gradient(160deg, #3a3170, #221d47); color: #fff; border-color: rgba(84, 66, 196, .55);
  box-shadow: 0 8px 22px rgba(23, 20, 44, 0.30);
}
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--hover-bg); color: var(--purple); border-color: transparent; }
.btn-danger { color: var(--red); border-color: rgba(191,74,58,0.32); background: var(--red-soft); }
.btn-danger:hover { background: rgba(191,74,58,0.2); color: var(--red); border-color: rgba(191,74,58,0.42); }
.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: var(--radius-sm); min-height: 30px; }
.btn-block { width: 100%; padding: 11px; font-size: 14px; }
.btn-link { background: none; border: 0; color: var(--purple); font-size: 12px; cursor: pointer; padding: 0; transition: color var(--dur-fast); }
.btn-link:hover { text-decoration: underline; }

.chip {
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  border-radius: 999px; padding: 0 14px; font-size: 12px; cursor: pointer; transition: .15s;
  display: inline-flex; align-items: center; min-height: var(--control-h);
}
.chip:hover { color: var(--text); border-color: var(--line-strong); }
.chip.active { background: var(--purple-soft); border-color: rgba(84,66,196,0.30); color: var(--purple); font-weight: 600; }

.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 6px;
  font-size: 12px; font-weight: 500; line-height: 1.5; border: 1px solid transparent; white-space: nowrap;
}
.badge-draft { color: var(--purple); background: var(--purple-soft); border-color: rgba(84,66,196,0.28); }
.badge-open { color: var(--blue); background: var(--blue-soft); border-color: rgba(59,98,201,0.28); }
.badge-in_progress { color: var(--amber); background: var(--amber-soft); border-color: rgba(176,122,43,0.28); }
.badge-submitted { color: var(--purple); background: var(--purple-soft); border-color: rgba(84,66,196,0.28); }
.badge-approved { color: var(--green); background: var(--green-soft); border-color: rgba(18,131,106,0.28); }
.badge-rejected { color: var(--red); background: var(--red-soft); border-color: rgba(191,74,58,0.28); }
.badge-archived { color: var(--muted); background: var(--bg-soft); border-color: var(--line); }
.badge-admin { color: var(--amber); background: var(--amber-soft); border-color: rgba(176,122,43,0.28); }
.badge-danger { color: var(--red); background: var(--red-soft); border-color: rgba(191,74,58,0.28); }

.diff { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 6px; border: 1px solid transparent; }
.diff-low { color: var(--green); background: var(--green-soft); border-color: rgba(18,131,106,0.24); }
.diff-mid { color: var(--amber); background: var(--amber-soft); border-color: rgba(176,122,43,0.28); }
.diff-high { color: var(--red); background: var(--red-soft); border-color: rgba(191,74,58,0.28); }
.diff i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
/* 明确分组的卡片区（资金管理等）：固定 3 列，避免同一页出现两种卡宽 */
.stat-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px 15px;
  display: flex; flex-direction: column; gap: 5px; position: relative; overflow: hidden; box-shadow: var(--shadow-xs);
}
.stat::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 2px;
  border-radius: 0 2px 2px 0; background: var(--line-strong);
}
.stat-label { font-size: 12px; color: var(--muted-2); letter-spacing: .04em; }
.stat-value { font-size: 25px; font-weight: 700; letter-spacing: -.5px; font-variant-numeric: tabular-nums; color: var(--text); }
.stat-value small { font-size: 12px; color: var(--muted); font-weight: 400; margin-left: 3px; letter-spacing: 0; }
.stat-sub { font-size: 12px; color: var(--muted-2); }
.stat.gold { border-color: rgba(176,122,43,0.26); background: linear-gradient(160deg, rgba(176,122,43,0.07), rgba(176,122,43,0.015) 55%), var(--panel); }
.stat.gold .stat-value { color: var(--amber); }
.stat.gold::before { background: var(--amber); }
.stat.red .stat-value { color: var(--red); }
.stat.red::before { background: var(--red); }
.stat.green .stat-value { color: var(--green); }
.stat.green::before { background: var(--green); }
/* 金额语义：收入=绿、支出/待收=琥珀、中性的合同额=墨色、异常/亏损=红 */
.stat.amber .stat-value { color: var(--amber); }
.stat.amber::before { background: var(--amber); }
.stat.blue .stat-value { color: var(--blue); }
.stat.blue::before { background: var(--blue); }
.stat.ink .stat-value { color: var(--ink); }
.stat.ink::before { background: var(--ink); }

/* 公司总览 · 本月产出 TOP 榜 */
.top-perf { margin-top: 14px; padding: 14px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
.top-perf-title { font-size: 12px; color: var(--muted-2); letter-spacing: .04em; margin-bottom: 10px; }
.top-perf-list { display: flex; flex-wrap: wrap; gap: 10px 26px; }
.top-perf-row { display: flex; align-items: center; gap: 8px; font-size: 13px; min-width: 150px; }
.top-perf-row b { font-weight: 600; }
.top-rank {
  width: 20px; height: 20px; border-radius: 50%; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: var(--muted-2);
  background: var(--bg-soft); font-variant-numeric: tabular-nums;
}
.top-rank.first { background: var(--amber-soft); color: var(--amber); }

/* 员工分析表：表头排序按钮 */
.th-sort {
  background: none; border: 0; padding: 0; font: inherit; color: inherit;
  cursor: pointer; display: inline-flex; align-items: center; gap: 3px;
}
.th-sort:hover { color: var(--text); }

.progress { height: 5px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; margin-top: 4px; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--purple), #7a64e8); }

.empty {
  padding: 30px 20px; text-align: center; color: var(--muted-2); font-size: 13px;
  border: 1px dashed var(--line); border-radius: var(--radius); background: var(--panel-2);
}
.empty b { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; font-weight: 500; }

/* -------------------------------- 工单列表 ------------------------------- */
.list-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.list-head .spacer { flex: 1; }
.search-input {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-md);
  padding: 8px 12px; color: var(--text); font-size: 13px; min-width: 220px; outline: none; min-height: var(--control-h);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.search-input::placeholder { color: var(--muted-2); }
.search-input:focus { border-color: rgba(84,66,196,0.55); box-shadow: var(--focus-ring); }
.select {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-md); color: var(--text-2);
  padding: 8px 10px; font-size: 13px; outline: none; min-height: var(--control-h);
  transition: border-color var(--dur), box-shadow var(--dur);
}
.select:focus { border-color: rgba(84,66,196,0.55); box-shadow: var(--focus-ring); }

/* 工单中心：每页条数选择 + 分页控件 */
.page-size-control {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.page-size-control .select { min-width: 82px; padding-right: 24px; cursor: pointer; }
.pager {
  display: flex; align-items: center; justify-content: center;
  flex-wrap: wrap; gap: 6px; margin-top: 18px;
}
.pager__btn, .pager__num {
  min-height: 32px; padding: 0 11px; font-size: 12px; font-family: inherit;
  border: 1px solid var(--line-strong); background: var(--panel); color: var(--text-2);
  border-radius: var(--radius-sm); cursor: pointer; transition: .15s;
}
.pager__num { min-width: 32px; padding: 0 6px; font-variant-numeric: tabular-nums; }
.pager__btn:hover:not(:disabled), .pager__num:hover:not(.is-active) {
  border-color: rgba(84, 66, 196, 0.34); background: var(--hover-bg); color: var(--purple);
}
.pager__btn:disabled { opacity: .4; cursor: not-allowed; }
.pager__num.is-active {
  background: var(--purple); border-color: var(--purple); color: #fff; font-weight: 600; cursor: default;
}
.pager__nums { display: inline-flex; align-items: center; gap: 6px; }
.pager__dots { padding: 0 4px; font-size: 12px; color: var(--muted-2); }
.pager__info { margin-left: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.page-limit-note {
  margin: 0 0 12px; padding: 9px 12px; font-size: 12px; line-height: 1.6;
  color: var(--amber); background: var(--amber-soft);
  border: 1px solid rgba(176, 122, 43, .22); border-radius: var(--radius-md);
}
@media (max-width: 720px) {
  .pager__edge { display: none; }
  .pager__info { width: 100%; margin: 4px 0 0; text-align: center; }
  .pager__btn, .pager__num { padding: 0 9px; }
}

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); }
/* 固定列宽布局：所有列都显式声明宽度，剩余空间给标题列，
   避免浏览器把固定宽度按内容重算导致"时长"列被压成两行。
   min-width 需大于固定列宽之和（约 852px），否则窄屏上标题列会被压成 0。 */
table.task-table { width: 100%; border-collapse: collapse; min-width: 1000px; table-layout: fixed; }
.task-table th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted-2); letter-spacing: .05em;
  padding: 11px 14px; border-bottom: 1px solid var(--line); background: transparent;
  white-space: nowrap;
}
.task-table td { padding: 13px 14px; border-bottom: 1px solid var(--row-divider); font-size: 13px; color: var(--text-2); vertical-align: middle; }
.task-table tr:last-child td { border-bottom: 0; }
.task-table tbody tr { cursor: pointer; transition: background .12s; }
.task-table tbody tr:hover { background: var(--hover-bg); }
/* 列宽：标题列吃掉剩余宽度，数字/日期/状态列定宽不折行 —— 否则浏览器会把
   "01分00秒（60秒）""系统管理员" 压成两三行 */
.task-table .col-title { width: auto; }
.task-table .col-duration { width: 138px; }
.task-table .col-bonus { width: 104px; }
.task-table .col-money { width: 112px; }
.task-table .col-person { width: 100px; }
.task-table .col-date { width: 118px; }
.task-table .col-status { width: 100px; }
.task-table .col-code { width: 152px; }
.task-table .col-num { width: 92px; }
.task-table .col-member { width: 168px; }
.task-table .col-insight { width: auto; }
.task-table .col-actions { width: 180px; }
/* 工单列表专用列宽：此前表头未挂 col-* class，table-layout:fixed 会把所有列等宽平分，
   导致标题被压、时长折行、操作按钮拥挤。显式定宽后标题列可吃掉剩余空间。
   用独立的 .task-list-table 限定，不影响财务/开销等其它表格的列宽。 */
table.task-table.task-list-table { min-width: 1140px; }
.task-list-table .col-seq { width: 40px; }
/* 工单编号独立成列：放在标题前，字号加大便于快速查找 */
.task-list-table .col-task-code { width: 160px; }
.task-list-table .task-code-cell {
  font-size: 15px; font-weight: 600; color: var(--text);
  font-variant-numeric: tabular-nums; letter-spacing: .02em; white-space: nowrap;
}
.task-list-table .col-title { width: auto; }
.task-list-table .col-duration { width: 118px; }
.task-list-table .col-bonus { width: 90px; }
.task-list-table .col-money { width: 98px; }
.task-list-table .col-person { width: 90px; }
.task-list-table .col-date { width: 104px; }
.task-list-table .col-status { width: 92px; }
/* 操作列需要容纳 3 个按钮，之前定宽不足会把内容撑出表格，产生横向滚动条 */
.task-list-table .col-actions { width: 200px; }
.task-list-table .actions-cell .btn { margin-left: 4px; padding-inline: 8px; }
/* 数字/日期列内容超长时省略，避免撑破固定列宽（操作列除外，按钮不能被裁） */
.task-list-table td.duration-cell,
.task-list-table td.bonus-cell,
.task-list-table td.amount-cell,
.task-list-table td.col-person,
.task-list-table td.col-date,
.task-list-table td.mono { overflow: hidden; text-overflow: ellipsis; }
.task-table td.seq-cell {
  color: var(--muted-2); font-size: 12px; font-variant-numeric: tabular-nums;
  white-space: nowrap; text-align: center;
}
/* 报表趋势图的指标切换 */
.chip-row { display: inline-flex; gap: 6px; margin-left: auto; }
/* 工作台截止提醒：提前天数选择 */
.due-days-control {
  display: inline-flex; align-items: center; gap: 8px; margin-left: auto;
  font-size: 12px; color: var(--muted); white-space: nowrap;
}
.due-days-control .select { min-height: 30px; padding: 4px 24px 4px 9px; font-size: 12px; }

/* 员工绩效表列多，压缩数字列给"分析摘要"留出可读宽度 */
.emp-table .col-member { width: 152px; }
.emp-table .col-num { width: 78px; }
.emp-table .col-bonus { width: 100px; }
.emp-table .col-actions { width: 96px; }
.task-table td.col-title,
.task-table td.duration-cell,
.task-table td.bonus-cell,
.task-table td.amount-cell,
.task-table td.money-in,
.task-table td.money-out,
.task-table td.money-pending,
.task-table td.money-neutral,
.task-table td.col-date,
.task-table td.col-person,
.task-table td.mono { white-space: nowrap; }
/* 固定列宽下超出部分裁切，避免把表格撑宽 */
.task-table td.col-person,
.task-table td.col-date,
.task-table td.mono { overflow: hidden; text-overflow: ellipsis; }
.task-table td.col-title { overflow-wrap: anywhere; }
/* 操作列吸附在右侧：窄屏横向滚动时按钮始终可见（表头与单元格都带 .actions-cell） */
.task-table .actions-cell {
  position: sticky; right: 0; background: var(--panel);
  border-left: 1px solid var(--line);
  box-shadow: -6px 0 8px -8px rgba(23, 20, 44, 0.28);
}
.task-table tbody tr:hover .actions-cell { background: var(--panel-2); }
/* 项目收款表 16 列，固定列宽之和约 1830px。若 min-width 仍为默认 1000px，
   table-layout:fixed 会按比例压缩所有列，把"工单标题""平台收款""应收金额"
   压成竖排文字。这里单独给足宽度，超出部分由 .table-wrap 横向滚动（操作列吸附）。
   同时压缩左右内边距，减少横向滚动距离。 */
table.task-table.recv-table { min-width: 1840px; }
.recv-table th,
.recv-table td { padding-left: 10px; padding-right: 10px; }
.recv-table .col-code { width: 148px; }
.recv-table .col-title { width: 200px; }
.recv-table .col-status { width: 96px; }
.recv-table .col-phone { width: 76px; }
.recv-table .col-pm { width: 96px; }
.recv-table .col-money { width: 100px; }
.recv-table .col-date { width: 112px; }
.recv-table .col-actions { width: 190px; }
/* 收款方式/手机号不允许折行，否则窄列下会逐字换行 */
.recv-table td.col-pm,
.recv-table td.col-phone { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-title-cell b { display: block; font-weight: 600; font-size: 13.5px; margin-bottom: 4px; }
.task-title-cell .sub { color: var(--muted-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.task-title-cell .sub span { margin-right: 10px; }
.points-cell { color: var(--amber); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bonus-cell { color: var(--green); font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.amount-cell { color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
/* ---- 金额语义色：收入=绿、支出/待收=琥珀、合同额等中性金额=墨色 ----
   全站只认这套规则，新增页面直接套用下面四个类即可 */
.money { color: var(--green); font-variant-numeric: tabular-nums; white-space: nowrap; }
.money-in { color: var(--green); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.money-out { color: var(--amber); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.money-pending { color: var(--amber); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.money-neutral { color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.overdue { color: var(--red); font-size: 11px; }
.recv-summary { display: flex; gap: 16px; padding: 12px 16px; background: var(--card-bg); border: 1px solid var(--border); border-radius: 8px; }
.recv-sum-item { flex: 1; }
.recv-sum-item b { font-size: 18px; font-weight: 600; }
.overdue-row { background: var(--red-soft) !important; }
.overdue-row td { border-color: rgba(191,74,58,0.2); }
.overdue-row .task-title-cell b { color: var(--red); }
.mini-task.overdue-row { background: rgba(191,74,58,0.06); border-left: 3px solid var(--red); }
.due-soon { color: var(--amber); font-size: 11px; }
.due-soon-row { background: var(--amber-soft) !important; }
.mini-task.due-soon-row { background: rgba(176,122,43,0.07); border-left: 3px solid var(--amber); }
.actions-cell { text-align: right; white-space: nowrap; }
.actions-cell .btn { margin-left: 6px; }

.mini-task {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--row-divider);
  cursor: pointer; transition: background .12s;
}
.mini-task:last-child { border-bottom: 0; }
.mini-task:hover { background: var(--hover-bg); }
.mini-task .mini-main { flex: 1; min-width: 0; }
.mini-task .mini-title { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 5px; }
.mini-task .mini-meta { font-size: 12px; color: var(--muted-2); display: flex; gap: 10px; flex-wrap: wrap; }
.mini-task .mini-meta .accent { color: var(--amber); }
.mini-task .mini-action { flex: none; }
.locked { color: var(--muted-2); font-size: 12px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-xs); }
.panel-head { padding: 15px 18px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.panel-head h3 { margin: 0; font-size: 14px; letter-spacing: .2px; font-weight: 650; }
.panel-head .muted { font-size: 12px; }

/* ------------------------------- 详情 / 弹窗 ------------------------------ */
/* 弹窗层：必须高于页面内一切 sticky 元素（开销表头 z-index:1 等），低于 toast(60)。
   ID 与 class 双写，避免容器漏写 class 时整层失效、表头穿透盖住弹窗 */
#modal-root, .modal-root { position: relative; z-index: 40; }
.modal-backdrop {
  position: fixed; inset: 0; z-index: 40; background: var(--overlay); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 24px; animation: fade .16s ease;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.modal {
  width: 100%; max-width: 560px; max-height: calc(100vh - 48px); display: flex; flex-direction: column;
  background: linear-gradient(180deg, #ffffff 0%, #fdfcf9 100%);
  border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow);
  animation: pop .18s ease;
}
@keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } to { transform: none; opacity: 1; } }
.modal.wide { max-width: 880px; }
.modal.xwide { max-width: 1180px; }
.modal.small { max-width: 440px; }
.modal-head { padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; gap: 16px; align-items: flex-start; flex: none; }
.modal-head h2 { margin: 0; font-size: 18px; letter-spacing: -.15px; line-height: 1.4; font-weight: 650; color: var(--text); }
.modal-head .sub { color: var(--muted); font-size: 12px; margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.modal-close {
  margin-left: auto; background: none; border: 0; color: var(--muted); font-size: 20px;
  cursor: pointer; line-height: 1; padding: 2px 4px; flex: none;
}
.modal-close:hover { color: var(--text); }
.modal-body { padding: 20px 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 22px; min-height: 0; flex: 1 1 auto; overscroll-behavior: contain; }
/* 弹窗主体纵向滚动：子区块高度由内容决定；否则带 overflow:hidden 的区块最小高度为 0，会被压扁裁切 */
.modal-body > *,
.modal-body > form > * { flex: none; }
.modal form { display: contents; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid var(--line); display: flex; gap: 10px;
  justify-content: flex-end; align-items: center; flex-wrap: wrap; flex: none;
}
.modal-foot .left { margin-right: auto; color: var(--muted-2); font-size: 12px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }

.meta-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px 18px; }
.meta-item label { display: block; font-size: 12px; color: var(--muted-2); letter-spacing: .2px; margin-bottom: 5px; }
.meta-item span { font-size: 13px; }

.money-strip {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1px; overflow: hidden;
  border: 1px solid rgba(176,122,43,0.2); border-radius: 12px; background: rgba(176,122,43,0.08);
}
.money-strip > div { padding: 14px 16px; background: var(--panel); }
.money-strip label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 5px; }
.money-strip b { font-size: 20px; font-variant-numeric: tabular-nums; }
.money-strip .profit b { color: var(--green); }
.money-strip .bonus b { color: var(--amber); }

.detail-block h4 { margin: 0 0 8px; font-size: 12px; color: var(--muted); letter-spacing: .2px; font-weight: 600; }
.detail-block p { margin: 0; font-size: 13.5px; line-height: 1.9; color: var(--text-2); white-space: pre-wrap; word-break: break-word; }

.file-list { display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 9px; background: var(--panel-2); font-size: 12.5px;
}
.file-icon {
  width: 28px; height: 28px; border-radius: var(--radius-sm); background: var(--blue-soft); color: var(--blue);
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; flex: none;
}
.file-item .file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-item .file-size { color: var(--muted-2); font-size: 11px; flex: none; }
.file-item a { color: var(--purple); font-size: 12px; flex: none; }

.submission {
  border: 1px solid var(--line); border-radius: 12px; padding: 15px; background: var(--bg-soft);
  display: flex; flex-direction: column; gap: 12px;
}
.submission-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); }
.submission-head .btn-link { color: var(--blue); }
.submission-head .file-actions { display: flex; gap: 12px; flex: none; }
.file-item a.muted-2 { color: var(--muted-2); }
code { background: var(--bg-soft); padding: 1px 6px; border-radius: 4px; font-size: 12px; color: var(--purple); }
.submission .video-row { display: flex; align-items: center; gap: 10px; }
.video-thumb {
  width: 54px; height: 34px; border-radius: 6px; background: linear-gradient(135deg, #2a3446, #1b2130);
  display: flex; align-items: center; justify-content: center; color: var(--blue); font-size: 10px; flex: none;
  border: 1px solid var(--line);
}

.review-note { border-left: 3px solid rgba(191,74,58,0.5); background: var(--red-soft); padding: 10px 14px; border-radius: 0 8px 8px 0; font-size: 12.5px; line-height: 1.7; color: var(--red); }
.review-note.ok { border-color: rgba(47,175,122,0.5); background: var(--green-soft); color: var(--green); }

.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 12px; position: relative; padding-bottom: 18px; }
.timeline-item::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 1px; background: var(--line); }
.timeline-item:last-child::before { display: none; }
.timeline-dot { width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--purple); background: var(--panel); flex: none; margin-top: 2px; z-index: 1; }
.timeline-common { color: var(--muted-2); font-size: 11.5px; margin-top: 2px; }
.timeline-item .t-label { font-size: 12.5px; }
.timeline-item .t-label b { font-weight: 600; margin-right: 8px; }
.timeline-item .t-time { color: var(--muted-2); font-size: 11.5px; margin-top: 4px; }

/* -------------------------------- 表单 -------------------------------- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.form-section { border: 1px solid var(--border); border-radius: 10px; padding: 16px; background: var(--bg-soft); }
.form-section-title { display: flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 650; margin-bottom: 14px; }
.form-section-title .muted { font-weight: 400; font-size: 12px; }
.form-advanced { border: 1px solid var(--border); border-radius: 10px; background: var(--bg-soft); }
.form-advanced > summary { cursor: pointer; padding: 14px 16px; font-size: 13px; font-weight: 650; list-style: none; display: flex; align-items: baseline; gap: 8px; }
.form-advanced > summary::-webkit-details-marker { display: none; }
.form-advanced > summary::before { content: '▸'; color: var(--muted); transition: transform .15s; }
.form-advanced[open] > summary::before { transform: rotate(90deg); }
.form-advanced > summary .muted { font-weight: 400; font-size: 12px; }
.form-advanced > .form-grid { padding: 0 16px 16px; }
.adv-summary { margin-left: auto; font-weight: 400; font-size: 12px; color: var(--muted-2); white-space: nowrap; }
.quick-picks { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-chip { background: var(--panel-2); border: 1px solid var(--line); color: var(--muted); border-radius: 999px; padding: 3px 10px; font-size: 11px; font-family: inherit; cursor: pointer; transition: .15s; }
.quick-chip:hover { border-color: var(--line-strong); color: var(--text); }
.field-error { border-color: var(--red) !important; box-shadow: 0 0 0 3px var(--red-soft) !important; }
.existing-materials { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; }
.file-chip { border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; color: var(--muted); background: var(--panel-2); }
.batch-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.batch-table { width: 100%; border-collapse: collapse; min-width: 1080px; }
.batch-table th { text-align: left; font-size: 11px; color: var(--muted); font-weight: 500; padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.batch-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.batch-table tr:last-child td { border-bottom: 0; }
.batch-table input, .batch-table select { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: 7px; color: var(--text); padding: 7px 9px; font-size: 12.5px; font-family: inherit; }
.batch-table input:focus, .batch-table select:focus { border-color: rgba(84,66,196,.55); outline: none; box-shadow: var(--focus-ring); }
.batch-table .batch-code { width: 118px; }
.batch-table .batch-brief { width: 210px; }
.batch-no { width: 34px; text-align: center; color: var(--muted-2); font-size: 11px; }
.batch-del { background: none; border: 0; color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer; padding: 3px 7px; border-radius: 6px; }
.batch-del:hover { color: var(--red); background: var(--red-soft); }
.batch-actions { display: flex; align-items: center; gap: 14px; margin-top: 10px; }
.batch-gen { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.batch-gen input { background: var(--panel); border: 1px solid var(--line); border-radius: 7px; color: var(--text); padding: 6px 9px; font-size: 12.5px; font-family: inherit; }
.batch-gen input:focus { border-color: rgba(84,66,196,.55); outline: none; box-shadow: var(--focus-ring); }
.batch-gen #gen-prefix { width: 210px; }
.batch-gen #gen-start, .batch-gen #gen-end { width: 72px; }
.field .help b { color: var(--purple); }
.duration-inputs {
  display: flex; align-items: center; gap: 4px; flex-wrap: nowrap;
  width: 100%; box-sizing: border-box;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--bg-soft);
}
.duration-inputs > input,
.field .duration-inputs > input {
  width: 52px; flex: none; text-align: center; max-width: 52px;
  background: var(--panel); border: 1px solid var(--border); border-radius: 7px;
  color: var(--text); padding: 7px 6px; font-size: 13px; font-family: inherit;
  -moz-appearance: textfield;
}
.duration-inputs > input::-webkit-outer-spin-button,
.duration-inputs > input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.duration-inputs > input:focus { border-color: var(--purple); outline: none; box-shadow: var(--focus-ring); }
.duration-inputs > .unit { font-size: 11px; color: var(--muted); min-width: 14px; text-align: center; }
.duration-inputs > .duration-total {
  margin-left: auto; font-size: 12px; color: var(--muted);
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 10px; border: 1px dashed var(--line-strong); border-radius: 7px;
  background: var(--panel); font-variant-numeric: tabular-nums;
}
.duration-inputs > .duration-total b { color: var(--purple); font-size: 14px; font-weight: 700; }
.batch-dur-cell { display: flex; align-items: center; gap: 4px; flex-wrap: nowrap; }
.batch-dur-cell > input { width: 46px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; color: var(--text); padding: 5px 7px; font-size: 12px; font-family: inherit; text-align: center; }
.batch-dur-cell > input:focus { border-color: rgba(84,66,196,.55); outline: none; box-shadow: var(--focus-ring); }
.batch-dur-cell > .unit { font-size: 11.5px; color: var(--muted); }
.batch-dur-cell > .batch-duration-sec { margin-left: 4px; font-size: 12px; color: var(--purple); font-variant-numeric: tabular-nums; min-width: 22px; text-align: right; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--muted); }
.field label .req { color: var(--red); margin-left: 3px; }
.field input[type="text"], .field input[type="number"], .field input[type="datetime-local"], .field input[type="date"], .field input[type="month"], .field input[type="password"], .field select, .field textarea {
  background: var(--panel); border: 1px solid var(--line-strong); border-radius: var(--radius-md); padding: 9px 12px;
  color: var(--text); font-size: 13px; outline: none; width: 100%; min-height: 38px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.field textarea { min-height: 88px; resize: vertical; line-height: 1.7; }
.field input::placeholder, .field textarea::placeholder { color: var(--muted-2); }
.field input:focus, .field select:focus, .field textarea:focus { border-color: rgba(84,66,196,0.55); box-shadow: var(--focus-ring); }
.field .help { font-size: 11px; color: var(--muted-2); line-height: 1.6; }
.field input[type="file"] { font-size: 12px; color: var(--muted); }
.field input[type="file"]::file-selector-button {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 7px 12px; margin-right: 10px; font-size: 12px; cursor: pointer; font-family: inherit; transition: border-color var(--dur);
}
.field input[type="file"]::file-selector-button:hover { border-color: var(--line-strong); }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); }
.checkbox-row input { accent-color: var(--purple); width: 15px; height: 15px; }
.form-note { font-size: 12px; color: var(--muted-2); line-height: 1.7; }
/* 危险操作提示：沿用全站赭红 token，不再借用另一套粉色告警框 */
.danger-note {
  background: var(--red-soft); border: 1px solid rgba(191, 74, 58, 0.3); border-left: 3px solid var(--red);
  border-radius: 8px; padding: 12px 14px; font-size: 13px; line-height: 1.8; color: #8e3527;
}

.difficulty-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.difficulty-option {
  border: 1px solid var(--line); border-radius: 10px; padding: 12px; cursor: pointer;
  display: flex; flex-direction: column; gap: 4px; background: var(--panel-2);
}
.difficulty-option input { display: none; }
.difficulty-option b { font-size: 13px; }
.difficulty-option span { font-size: 11px; color: var(--muted-2); line-height: 1.5; }
.difficulty-option.selected { border-color: rgba(84,66,196,0.55); background: var(--purple-soft); }

.permission-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.permission-item {
  display: flex; gap: 9px; align-items: flex-start; border: 1px solid var(--line); border-radius: 9px;
  padding: 10px 11px; cursor: pointer; background: var(--panel-2);
}
.permission-item:hover { border-color: var(--line-strong); }
.permission-item input { margin-top: 2px; accent-color: var(--purple); }
.permission-item .p-label { font-size: 12.5px; display: block; margin-bottom: 2px; }
.permission-item .p-desc { font-size: 11.5px; color: var(--muted-2); line-height: 1.5; }

/* -------------------------------- 报表 -------------------------------- */
.report-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.report-head .field { flex-direction: row; align-items: center; gap: 9px; }
.report-head .field label { white-space: nowrap; }
.report-head input[type="month"] {
  background: var(--panel); border: 1px solid var(--line); border-radius: 9px;
  padding: 9px 11px; color: var(--text); font-size: 13px; outline: none;
}
.chart { padding: 22px 20px 16px; }
.chart-bars { display: flex; align-items: flex-end; gap: clamp(8px, 3vw, 34px); height: 190px; padding: 0 6px; }
.chart-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.chart-bar {
  width: 100%; max-width: 46px; border-radius: 6px 6px 0 0;
  background: linear-gradient(180deg, rgba(176, 122, 43, 0.55), var(--amber)); min-height: 3px; position: relative;
  transition: height .3s ease;
}
.chart-bar.zero { background: var(--line-strong); }
.chart-col .bar-val { font-size: 11px; color: var(--amber); font-variant-numeric: tabular-nums; }
.chart-col .bar-label { font-size: 11px; color: var(--muted-2); }
.legend { display: flex; gap: 16px; font-size: 11px; color: var(--muted-2); margin-top: 14px; padding-left: 6px; }

.ledger-table { width: 100%; border-collapse: collapse; }
.ledger-table th { text-align: left; font-size: 11px; color: var(--muted-2); font-weight: 500; padding: 11px 14px; border-bottom: 1px solid var(--line); }
.ledger-table td { padding: 11px 14px; border-bottom: 1px solid var(--row-divider); font-size: 12.5px; }
.ledger-table tr:last-child td { border-bottom: 0; }
.ledger-table .pos { color: var(--amber); }
.ledger-table .money { color: var(--green); }

/* -------------------------------- 用户 -------------------------------- */
.user-table { width: 100%; border-collapse: collapse; min-width: 760px; }
.user-table th { text-align: left; font-size: 11px; color: var(--muted-2); font-weight: 500; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.user-table td { padding: 13px 14px; border-bottom: 1px solid var(--row-divider); font-size: 12.5px; vertical-align: middle; }
.user-table tr:last-child td { border-bottom: 0; }
.user-cell { display: flex; align-items: center; gap: 10px; }
.user-cell b { display: block; font-size: 13px; }
.user-cell small { color: var(--muted-2); font-size: 11px; }
.perm-chips { display: flex; flex-wrap: wrap; gap: 5px; max-width: 420px; }
.perm-chip { font-size: 11.5px; padding: 2px 7px; border-radius: 5px; background: var(--bg-soft); color: var(--muted); border: 1px solid var(--line); }
.perm-chip.none { color: var(--muted-2); border-style: dashed; }

/* -------------------------------- 设置 -------------------------------- */
.settings-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.tier-card { display: flex; flex-direction: column; gap: 13px; }
.tier-card .tier-title { display: flex; align-items: center; justify-content: space-between; }
.tier-card .field { gap: 5px; }
.permission-legend { display: flex; flex-direction: column; gap: 0; }
.permission-legend-item { display: flex; gap: 16px; padding: 12px 18px; border-bottom: 1px solid var(--row-divider); font-size: 12.5px; }
.permission-legend-item:last-child { border-bottom: 0; }
.permission-legend-item b { width: 150px; flex: none; font-weight: 600; }
.permission-legend-item span { color: var(--muted); }

/* -------------------------------- Toast -------------------------------- */
#toast-root { position: fixed; right: 22px; bottom: 22px; z-index: 60; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: var(--panel); color: var(--text); border: 1px solid var(--line-strong); border-left: 3px solid var(--amber);
  padding: 12px 16px; border-radius: var(--radius-md); font-size: 12.5px; box-shadow: var(--shadow); max-width: 360px;
  animation: toastIn .2s ease;
}
.toast.err { border-left-color: var(--red); }
.toast.ok { border-left-color: var(--green); }
.toast.warn { border-left-color: var(--amber); }
@keyframes toastIn { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }

.page-loading { padding: 60px 0; text-align: center; color: var(--muted-2); font-size: 13px; }

/* -------------------------------- 响应式 -------------------------------- */
@media (max-width: 1100px) {
  .auth-visual { padding: 40px; }
  .auth-visual h1 { font-size: 34px; }
}
@media (max-width: 940px) {
  .auth { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  /* minmax(0,1fr) 必须保留：裸 1fr 的 grid 子项最小宽度 = 内容宽度，
     会被表格的 min-width 撑开，导致整页横向溢出到 900px+ */
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; height: auto; flex-direction: column; padding: 14px 16px; }
  .side-brand { padding-bottom: 12px; }
  .nav {
    flex-direction: row; overflow-x: auto; overflow-y: hidden; gap: 6px;
    padding: 0 0 10px; min-height: auto;
  }
  .nav-group { display: contents; }
  .nav-group-title { display: none; }
  .nav-item { white-space: nowrap; }
  /* 右侧渐隐：提示导航条还能横向滑动，后面还有菜单 */
  .nav { mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent); }
  /* 手机/平板上侧栏横向排列，用户区改成一条窄栏，保留「修改密码 / 退出登录」入口 */
  .side-user {
    flex-direction: row; align-items: center; justify-content: space-between; gap: 12px;
    padding-top: 12px; margin-top: 2px;
  }
  .side-user-main small { display: none; }
  .side-user-actions { flex: none; }
  .side-user-actions button { padding: 7px 14px; }
  .main { padding: 20px 16px 48px; }
  /* 标题占满剩余宽度，铃铛跟在本页操作前面一起折到右侧 */
  .page-head { flex-direction: row; flex-wrap: wrap; align-items: flex-start; }
  .page-head > div:first-child { flex: 1 1 auto; min-width: 0; }
  .head-right { margin-left: auto; }
  .form-grid, .form-grid.cols-3 { grid-template-columns: 1fr; }
  .permission-grid { grid-template-columns: 1fr; }
  .stat-grid, .stat-grid.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 单数张卡片时，最后一张占满整行，不留一个空格位 */
  .stat-grid > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
}

/* --------------------- 员工分析 / 优化补充样式 --------------------- */
.insight-good { color: var(--green); font-size: 12px; }
.insight-bad { color: var(--red); font-size: 12px; }
.insight-cell { max-width: 220px; font-size: 12px; line-height: 1.6; }
.emp-table tbody tr td { white-space: nowrap; }
.emp-table .insight-cell { white-space: normal; }

.danger-link { color: var(--red); font-size: 12px; cursor: pointer; transition: color var(--dur-fast); }
.danger-link:hover { text-decoration: underline; }

.check-line { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.check-line input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--purple); }

.submission video {
  width: 240px; max-height: 300px; border-radius: 10px;
  background: #000; border: 1px solid var(--line); flex: none;
}
.video-row { display: flex; gap: 14px; align-items: flex-start; margin: 10px 0 4px; }

/* ----------------------------- 通知铃铛 ----------------------------- */
.notif-bell {
  position: relative; cursor: pointer; padding: 0; width: var(--control-h); height: var(--control-h);
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md);
  color: var(--text-2); transition: background .15s, border-color .15s, color .15s; user-select: none;
}
.notif-bell svg { width: 18px; height: 18px; }
.notif-bell:hover { background: var(--hover-bg); border-color: rgba(84, 66, 196, 0.28); color: var(--purple); }
.notif-dot {
  position: absolute; top: -5px; right: -5px; background: var(--red); color: #fff;
  border-radius: 10px; font-size: 10px; font-weight: 700; padding: 1px 5px; min-width: 16px;
  text-align: center; line-height: 14px; border: 2px solid var(--bg);
}
.notif-list { display: flex; flex-direction: column; }
.notif-item { padding: 12px; border-bottom: 1px solid var(--border); cursor: pointer; transition: background .12s; }
.notif-item:last-child { border-bottom: 0; }
.notif-item:hover { background: var(--hover-bg); }
.notif-item.muted { opacity: .5; }
.notif-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
.notif-body { font-size: 12px; color: var(--muted); margin-bottom: 4px; }
.notif-time { font-size: 11px; color: var(--muted-2); }

/* ----------------------------- 公司财务 ----------------------------- */
.dist-list { display: flex; flex-direction: column; gap: 10px; }
.dist-row { display: grid; grid-template-columns: 140px 1fr auto; align-items: center; gap: 12px; }
.dist-name { font-size: 13px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; }
.dist-bar { height: 8px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; }
.dist-fill { height: 100%; background: linear-gradient(90deg, var(--purple), #7a64e8); border-radius: 4px; transition: width .4s; }
.dist-fill.diff-low { background: linear-gradient(90deg, var(--green), #2aa184); }
.dist-fill.diff-mid { background: linear-gradient(90deg, var(--amber), #c9963f); }
.dist-fill.diff-high { background: linear-gradient(90deg, var(--red), #d2685a); }
.dist-val { font-size: 12px; color: var(--muted); white-space: nowrap; }
.inline-month { background: var(--bg-soft); border: 1px solid var(--border); color: inherit; padding: 4px 8px; border-radius: 6px; font-size: 12px; }

/* ----------------------------- 提交成品分区 ----------------------------- */
.submit-section { border: 1px solid var(--border); border-radius: 10px; padding: 14px; margin-bottom: 14px; background: var(--bg-soft); }
.submit-section-title { margin: 0 0 10px; font-size: 14px; }
.submit-section input[type="file"] { width: 100%; font-size: 13px; }
/* 可折叠的资产区块（人物/场景/视频），默认收起，减少提交表单的视觉负担 */
.asset-collapse summary { cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; margin: 0; }
.asset-collapse summary::-webkit-details-marker { display: none; }
.asset-collapse summary::before { content: '▸'; color: var(--muted); font-size: 12px; transition: transform .15s; }
.asset-collapse[open] summary::before { transform: rotate(90deg); }
.asset-collapse[open] summary { margin-bottom: 10px; }
/* 成品视频待提交队列 */
.file-queue { margin-top: 8px; display: flex; flex-direction: column; gap: 6px; }
.file-queue-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 8px; background: var(--bg); font-size: 13px; }
.file-queue-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.btn-link.danger { color: var(--danger, #e5484d); }
.prompt-list { margin-top: 10px; }
.prompt-list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.prompt-list-head label { font-size: 13px; font-weight: 600; }
.prompt-item { display: grid; grid-template-columns: 1fr 28px; gap: 6px; margin-bottom: 6px; align-items: start; }
.prompt-item textarea { width: 100%; }
.prompt-del { width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--border); background: var(--bg-soft); color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; }
.prompt-del:hover { color: var(--red); border-color: var(--red); }

/* ----------------------------- 详情页分类资产 ----------------------------- */
.img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.img-grid a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--bg-soft); }
.img-grid img { width: 100%; height: 100%; object-fit: cover; display: block; }
.asset-video { width: 100%; max-width: 360px; border-radius: 8px; margin-bottom: 8px; }
.prompt-chip { display: flex; gap: 8px; align-items: flex-start; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 6px; }
.prompt-chip-no { flex: none; width: 20px; height: 20px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: 11px; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.prompt-chip p { margin: 0; font-size: 13px; white-space: pre-wrap; word-break: break-word; }

/* ----------------------------- 素材中心 ----------------------------- */
.lib-tabs { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; }
.lib-tab { padding: 7px 16px; border-radius: 20px; border: 1px solid var(--border); background: var(--panel); color: var(--muted); cursor: pointer; font-size: 13px; }
.lib-tab.active { background: var(--purple); color: #fff; border-color: var(--purple); box-shadow: 0 4px 12px rgba(84, 66, 196, 0.24); }
.lib-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; margin-left: 8px; }
.lib-badge.pending { background: var(--amber-soft); color: var(--amber); }
.lib-badge.rejected { background: var(--red-soft); color: var(--red); }
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.lib-card { border: 1px solid var(--border); border-radius: 12px; background: var(--panel); padding: 14px; box-shadow: var(--shadow-xs); }
.lib-card-head { display: flex; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.lib-card-head b { font-size: 14px; }
.lib-card-who { margin-left: auto; font-size: 11px; color: var(--muted-2); }
.lib-reject-note { font-size: 12px; color: var(--red); background: var(--red-soft); border-radius: 6px; padding: 6px 8px; margin-bottom: 10px; }

/* ------------------------- 无障碍：尊重减弱动效偏好 ------------------------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
.lib-img-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
.lib-figure { margin: 0; }
.lib-figure a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); aspect-ratio: 1; background: var(--bg-soft); }
.lib-figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lib-figure figcaption { margin-top: 4px; }
.lib-prompt { font-size: 11px; color: var(--muted); margin: 0; white-space: pre-wrap; word-break: break-word; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.lib-content p { font-size: 13px; white-space: pre-wrap; word-break: break-word; margin: 0; }
.lib-video video { width: 100%; border-radius: 8px; background: #000; }
.lib-video-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted-2); margin: 4px 0 10px; }
.lib-card-foot { display: flex; gap: 8px; margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.lib-search {
  background: var(--panel); border: 1px solid var(--line); color: inherit; padding: 8px 12px;
  border-radius: var(--radius-md); font-size: 12.5px; width: 230px; outline: none;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.lib-search:focus { border-color: rgba(84,66,196,0.5); box-shadow: var(--focus-ring); }
.lib-filter {
  background: var(--panel); border: 1px solid var(--line); color: inherit; padding: 8px 10px;
  border-radius: var(--radius-md); font-size: 12.5px; outline: none; cursor: pointer;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.lib-filter:focus { border-color: rgba(84,66,196,0.5); box-shadow: var(--focus-ring); }

/* ----------------------------- 全局润色 ----------------------------- */
/* 滚动条 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(45,40,105,0.18); border-radius: 6px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: rgba(45,40,105,0.30); }

/* 卡片与面板：hover 微浮起 */
.card, .lib-card, .stat { transition: border-color .18s, box-shadow .18s, transform .18s; }
.lib-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow-sm); transform: translateY(-2px); }
.stat:hover { border-color: var(--line-strong); }

/* 素材中心 tab 平滑过渡 */
.lib-tab { transition: .15s; }
.lib-tab:not(.active):hover { color: var(--text); border-color: var(--line-strong); }

/* 提交分区 hover */
.submit-section { transition: border-color .18s; }
.submit-section:hover { border-color: var(--line-strong); }

/* 图片网格 hover 放大 */
.img-grid a, .lib-figure a { transition: transform .18s, border-color .18s; }
.img-grid a:hover, .lib-figure a:hover { transform: scale(1.03); border-color: var(--line-strong); }

/* 焦点可见性（可访问性） */
:focus-visible { outline: 2px solid rgba(84,66,196,0.5); outline-offset: 2px; }

/* 弹窗入场由 .modal 的 pop 动画承担，无需重复定义 */

/* ----------------------------- 开销账单 ----------------------------- */
.exp-filter-bar {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 12px;
}
/* 筛选项与全站控件统一：白底 + 同一描边 + 同一高度 */
.exp-search {
  flex: 1; min-width: 220px; max-width: 360px;
  padding: 8px 12px; border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--panel); font-size: 13px; color: var(--text); min-height: var(--control-h);
}
.exp-search:focus { border-color: rgba(84,66,196,0.55); box-shadow: var(--focus-ring); }
.exp-filter {
  padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--panel); font-size: 13px; color: var(--text-2);
  max-width: 180px; min-height: var(--control-h);
}
.exp-filter:focus { border-color: rgba(84,66,196,0.55); box-shadow: var(--focus-ring); }
.exp-date {
  padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--line-strong);
  background: var(--panel); font-size: 13px; color: var(--text-2); min-height: var(--control-h);
}
.exp-scope-group { display: flex; gap: 4px; background: var(--bg-soft); border-radius: var(--radius-md); padding: 3px; }
.exp-scope {
  padding: 0 12px; border: none; border-radius: 6px; font-size: 13px; min-height: 30px;
  background: transparent; color: var(--muted); cursor: pointer; transition: .15s;
}
.exp-scope.active { background: var(--panel); color: var(--purple); font-weight: 600; box-shadow: 0 2px 6px rgba(84,66,196,.15); }

.exp-summary-bar { display: flex; gap: 14px; margin-bottom: 14px; flex-wrap: wrap; }
.exp-summary-card {
  flex: 1; min-width: 180px; padding: 14px 16px;
  background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-xs);
}
.exp-summary-label { font-size: 12px; color: var(--muted); }
.exp-summary-value { font-size: 22px; font-weight: 700; color: var(--text); letter-spacing: -.2px; font-variant-numeric: tabular-nums; }
.exp-summary-value.accent { color: var(--amber); }
.exp-summary-sub { font-size: 12px; color: var(--muted-2); }

.exp-cat-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 20px; letter-spacing: .3px; white-space: nowrap; }

.exp-task-link { color: var(--purple); text-decoration: none; border-bottom: 1px dashed var(--purple); }
.exp-task-link:hover { color: var(--purple); }

/* ---------- 开销账单表格 ---------- */
.exp-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.exp-table {
  width: 100%; min-width: 1240px; border-collapse: collapse; font-size: 13px;
  table-layout: fixed;
}
.exp-table thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--panel-2); color: var(--muted); font-weight: 600; font-size: 12px;
  text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.exp-table tbody td {
  padding: 11px 12px; border-bottom: 1px solid var(--row-divider);
  vertical-align: middle; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.exp-table tbody tr:last-child td { border-bottom: none; }
.exp-table tbody tr:hover td { background: var(--hover-bg); }

/* 各列宽度分配：窄列固定，备注列弹性 */
.exp-table .col-cat    { width: 92px; }
.exp-table .col-amount { width: 100px; text-align: right; font-weight: 700; color: var(--amber); font-variant-numeric: tabular-nums; }
.exp-table .col-date   { width: 96px; text-align: center; }
.exp-table .col-account{ width: 84px; }
.exp-table .col-owner  { width: 76px; }
.exp-table .col-ref    { width: 96px; }
.exp-table .col-task   { width: 84px; }
.exp-table .col-phone  { width: 104px; }
.exp-table .col-by     { width: 70px; }
.exp-table .col-note   { width: auto; min-width: 110px; }
.exp-table .col-inv    { width: 96px; }
/* 操作列固定宽度 + 吸附右侧：按钮多时不被挤掉，横向滚动时也始终可点 */
.exp-table .col-actions{ width: 258px; text-align: right; white-space: nowrap; }
.exp-table th.col-actions,
.exp-table td.col-actions {
  position: sticky; right: 0;
  overflow: visible;
  background: var(--panel);
}
.exp-table thead th.col-actions { background: var(--panel-2); z-index: 3; }
.exp-table tbody tr:hover td.col-actions { background: var(--hover-bg); }
.exp-table td.col-actions .btn { margin-left: 6px; }
.exp-table td.col-actions .btn:first-child { margin-left: 0; }

.exp-table .col-note .exp-note-cell {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--muted);
}

.exp-invoice-link {
  display: inline-flex; align-items: center; gap: 5px; text-decoration: none; color: var(--text);
  max-width: 100%;
}
.exp-invoice-link:hover { color: var(--purple); }
.exp-inv-thumb {
  width: 26px; height: 26px; border-radius: 5px; object-fit: cover;
  border: 1px solid var(--border); flex: none;
}
.exp-inv-icon { font-size: 16px; flex: none; }
.exp-inv-name {
  font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.exp-invoice-preview {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px;
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px;
  margin-bottom: 10px;
}
.exp-invoice-file { display: flex; align-items: center; gap: 10px; flex: 1; }
.exp-invoice-file img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 1px solid var(--border); }
.exp-invoice-pdf { font-size: 24px; }
.exp-invoice-file small { font-size: 11px; color: var(--muted-2); display: block; margin-top: 2px; }

@media (max-width: 720px) {
  .exp-filter-bar { gap: 8px; }
  .exp-search, .exp-filter, .exp-date { flex: 1; min-width: 120px; }
  /* 金额条落在 2 列时，第 3 项独占整行，别在右侧留一个空格子 */
  .money-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .money-strip > div:nth-child(3):last-child { grid-column: 1 / -1; }
  .money-strip b { font-size: 18px; }
}


/* ============================== 运营看板 ============================== */
.ops-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-xs); }
.ops-toolbar-left, .ops-toolbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ops-field { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.ops-field input { border: 1px solid var(--line-strong); background: var(--panel); color: var(--text); border-radius: var(--radius-sm); padding: 5px 8px; font-size: 12.5px; font-family: inherit; }
.ops-tabs { display: flex; gap: 2px; padding: 2px; background: var(--bg-soft); border-radius: var(--radius-sm); }
.ops-tabs button { border: 0; background: transparent; color: var(--muted); font-size: 12px; padding: 5px 10px; border-radius: var(--radius-xs); cursor: pointer; font-family: inherit; }
.ops-tabs button:hover { color: var(--text); }
.ops-tabs button.active { background: var(--panel); color: var(--text); box-shadow: var(--shadow-xs); }
.ops-stamp { font-size: 11.5px; color: var(--muted-2); }
.ops-delta { display: inline-block; font-size: 11.5px; color: var(--muted-2); }
.ops-delta.up { color: var(--green); }
.ops-delta.down { color: var(--red); }
.ops-chart-box { padding: 12px 10px 6px; }
.ops-chart { display: block; width: 100%; height: auto; }
.ops-grid-line { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; opacity: .55; }
.ops-axis { fill: var(--muted-2); font-size: 10.5px; font-family: inherit; }
.ops-legend { display: flex; align-items: center; gap: 14px; font-size: 12px; color: var(--muted); }
.ops-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.panel-body { padding: 14px 16px; }
.ops-mini-bars { display: flex; flex-direction: column; gap: 9px; }
.ops-mini-row { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; align-items: center; gap: 8px; font-size: 12px; }
.ops-mini-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-mini-track { height: 7px; background: var(--bg-soft); border-radius: 4px; overflow: hidden; }
.ops-mini-track i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #6c5ce7, #97a4ff); }
.ops-mini-val { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-mini-row b { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ops-empty { padding: 18px 8px; text-align: center; color: var(--muted-2); font-size: 12.5px; }
.ops-risk-list { display: flex; flex-direction: column; }
.ops-risk-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 9px 16px; border: 0; border-top: 1px solid var(--row-divider); background: transparent; cursor: pointer; text-align: left; font-family: inherit; }
.ops-risk-item:hover { background: var(--hover-bg); }
.ops-risk-main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.ops-risk-main b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.ops-risk-main small { font-size: 11.5px; color: var(--muted-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ops-risk-meta { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
@media (max-width: 1180px) { .grid-3, .grid-2 { grid-template-columns: 1fr; } }
