@charset "UTF-8";
/* ==========================================================================
   易讯 OA · 设计系统 v2.0
   自研轻量方案：零外部依赖、零 CDN、支持深色模式
   替换原 Bootstrap + FontAwesome + Google Fonts（约 600KB → 30KB）
   ========================================================================== */

/* ------------------------------ 设计令牌 ------------------------------ */
:root {
  --c-bg:        #f4f6fb;
  --c-surface:   #ffffff;
  --c-surface-2: #fafbfe;
  --c-elev:      #ffffff;
  --c-side:      #ffffff;
  --c-text:      #131a2a;
  --c-text-2:    #4a5568;
  --c-muted:     #8992a6;
  --c-border:    #e6e9f2;
  --c-border-2:  #eef1f7;

  --c-primary:   #4f46e5;
  --c-primary-d: #4338ca;
  --c-primary-l: #eef0ff;
  --c-accent:    #06b6d4;
  --c-ok:        #10b981;
  --c-ok-l:      #e7f8f2;
  --c-warn:      #f59e0b;
  --c-warn-l:    #fef5e4;
  --c-err:       #e5484d;
  --c-err-l:     #fdeced;
  --c-info:      #3b82f6;
  --c-info-l:    #eaf2fe;
  --c-grad:      linear-gradient(135deg, #4f46e5 0%, #7c3aed 50%, #06b6d4 100%);

  --r-xs: 6px;  --r-sm: 9px;  --r: 12px;  --r-lg: 16px;  --r-xl: 22px;  --r-full: 999px;

  --sh-xs: 0 1px 2px rgba(19,26,42,.05);
  --sh-sm: 0 1px 3px rgba(19,26,42,.06), 0 1px 2px rgba(19,26,42,.04);
  --sh:    0 4px 16px rgba(19,26,42,.06), 0 1px 3px rgba(19,26,42,.04);
  --sh-lg: 0 16px 44px rgba(19,26,42,.12), 0 4px 12px rgba(19,26,42,.06);

  --side-w: 250px;
  --top-h:  62px;

  --ff: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", Roboto, sans-serif;
  --ff-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --ease: cubic-bezier(.4,0,.2,1);
}

html[data-theme="dark"] {
  --c-bg:        #080b14;
  --c-surface:   #10151f;
  --c-surface-2: #151b28;
  --c-elev:      #151b28;
  --c-side:      #0c111b;
  --c-text:      #e8ebf2;
  --c-text-2:    #b3bccd;
  --c-muted:     #7c879c;
  --c-border:    #1f2738;
  --c-border-2:  #1a2130;

  --c-primary:   #818cf8;
  --c-primary-d: #6d78f0;
  --c-primary-l: #1b2140;
  --c-ok-l:      #10281f;
  --c-warn-l:    #2c2312;
  --c-err-l:     #2b1519;
  --c-info-l:    #101f36;

  --sh-xs: 0 1px 2px rgba(0,0,0,.5);
  --sh-sm: 0 1px 3px rgba(0,0,0,.5);
  --sh:    0 4px 18px rgba(0,0,0,.45);
  --sh-lg: 0 18px 50px rgba(0,0,0,.6);
}

/* -------------------------------- 基础 -------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body.oa-body {
  margin: 0;
  font-family: var(--ff);
  font-size: 14px;
  line-height: 1.62;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-d); }
img { max-width: 100%; }
h1,h2,h3,h4,h5,h6 { margin: 0 0 .5em; font-weight: 650; line-height: 1.3; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
hr { border: 0; border-top: 1px solid var(--c-border); margin: 20px 0; }
code, pre, .mono { font-family: var(--ff-mono); font-size: .92em; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--c-muted) 40%, transparent); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: var(--c-muted); }
::-webkit-scrollbar-track { background: transparent; }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; border-radius: 4px; }

/* ============================== 布局骨架 ============================== */
.oa-shell { display: flex; min-height: 100vh; }

.oa-side {
  position: fixed; inset: 0 auto 0 0;
  width: var(--side-w);
  background: var(--c-side);
  border-right: 1px solid var(--c-border);
  display: flex; flex-direction: column;
  z-index: 60;
  transition: transform .26s var(--ease);
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--c-border-2);
}
.brand-mark {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border-radius: 10px; background: var(--c-grad);
  color: #fff; font-weight: 800; font-size: 17px;
  box-shadow: 0 4px 12px rgba(79,70,229,.35);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; overflow: hidden; }
.brand-text strong { font-size: 15px; letter-spacing: -.02em; }
.brand-text small { font-size: 10.5px; color: var(--c-muted); letter-spacing: .02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-close { display: none; margin-left: auto; }

.side-nav { flex: 1; overflow-y: auto; padding: 12px 10px 4px; }
.nav-group { margin-bottom: 16px; }
.nav-group-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: .09em;
  color: var(--c-muted); text-transform: uppercase;
  padding: 0 10px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8.5px 10px; margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--c-text-2); font-weight: 500; font-size: 13.5px;
  transition: background .15s var(--ease), color .15s var(--ease);
  position: relative;
}
.nav-item:hover { background: var(--c-surface-2); color: var(--c-text); }
html[data-theme="dark"] .nav-item:hover { background: rgba(255,255,255,.05); }
.nav-item.is-active {
  background: var(--c-primary-l); color: var(--c-primary); font-weight: 650;
}
.nav-item.is-active::before {
  content: ''; position: absolute; left: -10px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 20px; border-radius: 0 3px 3px 0; background: var(--c-primary);
}
.nav-ic { display: grid; place-items: center; flex: 0 0 18px; opacity: .92; }
.nav-tx { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  min-width: 19px; height: 19px; padding: 0 6px;
  display: grid; place-items: center;
  border-radius: var(--r-full);
  background: var(--c-err); color: #fff;
  font-size: 10.5px; font-weight: 700;
}

.side-foot {
  border-top: 1px solid var(--c-border-2);
  padding: 12px; display: flex; align-items: center; gap: 8px;
}
.side-user { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 0; }
.side-user-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.side-user-meta strong { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user-meta small { font-size: 11px; color: var(--c-muted); }
.side-logout {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: grid; place-items: center; border-radius: var(--r-sm);
  color: var(--c-muted);
}
.side-logout:hover { background: var(--c-err-l); color: var(--c-err); }

/* 视图切换（手机版 ⇄ 电脑版） */
.side-view-switch {
  display: flex; align-items: center; gap: 8px;
  margin: 0 10px 10px; padding: 9px 12px;
  border: 1px dashed var(--c-border);
  border-radius: var(--r-sm);
  color: var(--c-muted); font-size: 12.5px; font-weight: 550;
  transition: border-color .15s, color .15s;
}
.side-view-switch:hover { border-color: var(--c-primary); color: var(--c-primary); }
/* 同上：手机版入口改成了 <button>，需要抹掉浏览器默认样式，
   并让它占满侧栏宽度（原来的 <a> 是 block 级的 flex 容器）。 */
.side-view-switch.is-btn {
  display: flex; width: calc(100% - 20px);
  background: none; font: inherit; text-align: left; cursor: pointer;
}
html[data-view="mobile"] .side-view-switch { padding: 12px; font-size: 14px; }

/* --------------------- 手机版二维码弹窗 --------------------- */
/*  二维码必须「白底 + 深色码」，不能用主题色：多数扫码 App 对
    低对比度的码识别率会明显下降，深色主题下尤其明显。 */
.qr-body { text-align: center; }
.qr-lead { margin: 0 0 12px; font-size: 13px; color: var(--c-text-2); }
.qr-frame {
  display: inline-block; padding: 12px; background: #fff;
  border: 1px solid var(--c-border-2); border-radius: var(--r-md);
  line-height: 0;
}
/* 二维码 SVG 只做等比约束，**不指定固定像素**：
   单个模块必须落在整数像素上才锐利，一旦被 CSS 拉伸成非整数倍
   （216/33 = 6.545px），模块边缘会出现亚像素灰边，屏幕上看不出来，
   扫码时却会丢模块。尺寸由 Qr::svg() 按「整数倍 × 模块数」算好后写在
   SVG 的 width/height 属性里，这里只负责别让它溢出容器。 */
.qr-frame svg { display: block; max-width: 100%; height: auto; }
.qr-url {
  margin: 12px 0 0; padding: 7px 10px;
  background: var(--c-surface-2); border-radius: var(--r-xs);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11.5px; color: var(--c-text-2);
  word-break: break-all; line-height: 1.5;
}
.qr-warn {
  margin: 10px 0 0; padding: 8px 10px;
  background: var(--c-warn-l); color: var(--c-warn);
  border-radius: var(--r-xs); font-size: 12px; line-height: 1.55; text-align: left;
}
.qr-tip { margin: 10px 0 0; font-size: 11.5px; color: var(--c-muted); }

.oa-scrim {
  position: fixed; inset: 0; background: rgba(8,11,20,.5);
  z-index: 55; backdrop-filter: blur(2px);
}

.oa-main {
  flex: 1; min-width: 0;
  margin-left: var(--side-w);
  display: flex; flex-direction: column;
}

/* --------------------------------- 顶栏 -------------------------------- */
.oa-top {
  position: sticky; top: 0; z-index: 40;
  height: var(--top-h);
  display: flex; align-items: center; gap: 10px;
  padding: 0 20px;
  background: color-mix(in srgb, var(--c-surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--c-border);
}
.top-spacer { flex: 1; }
/* 顶栏账本切换器。宽度按最长账本名留位，避免切换瞬间顶栏宽度跳动。
   ⚠️ 用 `.top-book .top-book-sel` 两级选择器（0,2,0）而不是单类（0,1,0）：
   单类会和后面第 417 行的 `.input, .select { padding: 9px 12px }` 同优先级，
   谁在后面谁生效 —— 一旦这条被覆盖，height 固定 34px 而上下 padding 各 9px，
   内容盒只剩 14px、装不下 21.87px 行高，「2026 年度账」字形被上下切掉一半。
   提高特异性后无论 .input 规则挪到哪都压不住。 */
.top-book { display: flex; align-items: center; flex: 0 0 auto; }
.top-book .top-book-sel {
  width: auto; max-width: 210px; min-width: 132px;
  height: 34px; padding: 0 32px 0 11px; font-size: 13.5px;
  line-height: 32px;                 /* 与 height 对齐，文字垂直居中不被裁 */
  background-position: right 10px center;
}
.crumb { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--c-muted); flex-wrap: nowrap; }
/* 面包屑每一项都要 nowrap —— flex 子项默认 min-width:auto，
   空间不够时浏览器会压缩它并把「工作台」压成「工作 / 台」两行。
   宁可让它被顶栏的 overflow 裁掉，也不能让它竖排。 */
.crumb > * { white-space: nowrap; flex: 0 0 auto; }
.crumb a { color: var(--c-muted); }
.crumb a:hover { color: var(--c-primary); }
.crumb-sep { opacity: .5; }
.crumb-cur { color: var(--c-text); font-weight: 600; }

.top-search {
  display: flex; align-items: center; gap: 7px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-full);
  padding: 6px 13px; width: 268px;
  /* 固定 268px 宽的搜索框在 1000px 视口下会把顶栏挤爆：
     面包屑被压成「工作 / 台」两行。改成可收缩并给最小宽度，
     空间不够时先让搜索框变窄，面包屑保持完整。 */
  flex: 0 1 268px; min-width: 120px;
  color: var(--c-muted);
  transition: border-color .15s, box-shadow .15s;
}
.top-search:focus-within { border-color: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 14%, transparent); }
.top-search input {
  border: 0; background: none; outline: none; flex: 1;
  font: inherit; color: var(--c-text); min-width: 0;
}

.icon-btn {
  position: relative;
  width: 36px; height: 36px; flex: 0 0 36px;
  display: grid; place-items: center;
  border: 0; border-radius: var(--r-sm);
  background: transparent; color: var(--c-text-2);
  cursor: pointer; transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--c-surface-2); color: var(--c-text); }
html[data-theme="dark"] .icon-btn:hover { background: rgba(255,255,255,.06); }
.icon-btn .dot {
  position: absolute; top: 7px; right: 8px;
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--c-err); border: 1.5px solid var(--c-surface);
}

.user-menu { position: relative; }
.user-trigger {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 9px 4px 4px;
  border: 1px solid var(--c-border); border-radius: var(--r-full);
  background: var(--c-surface); color: var(--c-text);
  font: inherit; font-size: 13px; font-weight: 550; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.user-trigger:hover { border-color: var(--c-primary); }
.dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  min-width: 208px; padding: 6px;
  background: var(--c-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  box-shadow: var(--sh-lg);
  opacity: 0; visibility: hidden; transform: translateY(-6px) scale(.98);
  transition: all .16s var(--ease);
  z-index: 70;
}
[data-dropdown].is-open .dropdown { opacity: 1; visibility: visible; transform: none; }
.dropdown-head { padding: 8px 10px 10px; border-bottom: 1px solid var(--c-border-2); margin-bottom: 5px; }
.dropdown-head strong { display: block; font-size: 13.5px; }
.dropdown-head small { color: var(--c-muted); font-size: 12px; }
.dropdown-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--r-xs);
  color: var(--c-text-2); font-size: 13.5px; font-weight: 500;
}
.dropdown-item:hover { background: var(--c-surface-2); color: var(--c-text); }
html[data-theme="dark"] .dropdown-item:hover { background: rgba(255,255,255,.06); }
.dropdown-item.is-danger { color: var(--c-err); }
.dropdown-item.is-danger:hover { background: var(--c-err-l); }
/* dropdown-item 原本只挂在 <a> 上；现在手机版入口改成了 <button>，
   浏览器默认的 button 样式（灰底 + 边框 + 字体不一致）会让菜单错位。
   这几行把它拉回和 <a> 完全一致的排版。 */
.dropdown-item.is-btn {
  width: 100%; text-align: left;
  background: none; border: 0; font: inherit; cursor: pointer;
}
.dropdown-divider { height: 1px; background: var(--c-border-2); margin: 5px 0; }

/* ------------------------------- 内容区 ------------------------------- */
.oa-content { flex: 1; padding: 22px 24px 8px; max-width: 1440px; width: 100%; margin: 0 auto; }
.oa-content.is-full { max-width: none; }
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
.page-title { font-size: 21px; margin: 0; letter-spacing: -.02em; }
.page-sub { margin: 4px 0 0; color: var(--c-muted); font-size: 13px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.oa-foot {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 18px 24px 22px; color: var(--c-muted); font-size: 12px;
  flex-wrap: wrap;
}
/* 页脚右侧那段「版本号 · 调试模式」。此前没有样式，版本号与调试标记
   跟左侧公司名同色同字号，中间只靠一个「·」分隔，读起来是一长串。
   这里让右侧整体更淡、调试标记单独变红。 */
.foot-meta { display: inline-flex; align-items: center; gap: 6px; color: var(--c-muted); opacity: .85; }
.foot-meta .text-danger { font-weight: 650; }

/* --------------------------------- 卡片 -------------------------------- */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-sm);
  overflow: hidden;
}
.card + .card { margin-top: 16px; }
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--c-border-2);
  background: var(--c-surface);
}
.card-head h2, .card-head h3 { margin: 0; font-size: 15px; }
.card-head .spacer { flex: 1; }
.card-body { padding: 18px; }
.card-body.is-flush { padding: 0; }
.card-foot { padding: 12px 18px; border-top: 1px solid var(--c-border-2); background: var(--c-surface-2); }

.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0,1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0,1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0,1fr)); }
.grid-2-1 { grid-template-columns: minmax(0,2fr) minmax(0,1fr); }
.grid-1-2 { grid-template-columns: minmax(0,1fr) minmax(0,2fr); }
.grid-1-3 { grid-template-columns: minmax(0,1fr) minmax(0,3fr); }

/* -------------------------------- 统计块 ------------------------------- */
.stat {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  padding: 16px 18px;
  box-shadow: var(--sh-sm);
  position: relative; overflow: hidden;
  /* 同一行里的卡片被 grid 拉到等高后，内容默认顶部对齐 ——
     没有副标题的卡片（客户档案页）就会在下方留一大块空白，
     和隔壁有副标题的卡片一比明显"没坐到底"。垂直居中把这块空白均分掉。 */
  display: flex; flex-direction: column; justify-content: center;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease);
}
.stat:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.stat-label { font-size: 12px; color: var(--c-muted); font-weight: 550; letter-spacing: .01em; }
.stat-value { font-size: 25px; font-weight: 720; letter-spacing: -.03em; margin: 5px 0 0; line-height: 1.15; }
.stat-value small { font-size: 13px; font-weight: 600; color: var(--c-muted); margin-left: 3px; }
.stat-foot { margin-top: 7px; font-size: 12px; color: var(--c-muted); display: flex; align-items: center; gap: 5px; }
.stat-ic {
  position: absolute; right: 14px; top: 14px;
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: var(--c-primary-l); color: var(--c-primary);
}
.stat.is-ok .stat-ic { background: var(--c-ok-l); color: var(--c-ok); }
.stat.is-warn .stat-ic { background: var(--c-warn-l); color: var(--c-warn); }
.stat.is-err .stat-ic { background: var(--c-err-l); color: var(--c-err); }
.stat.is-info .stat-ic { background: var(--c-info-l); color: var(--c-info); }

/* -------------------------------- 按钮 -------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: all .15s var(--ease);
  text-decoration: none; line-height: 1.4;
}
.btn:disabled, .btn.is-disabled { opacity: .5; pointer-events: none; }
.btn-primary { background: var(--c-primary); color: #fff; box-shadow: 0 1px 2px rgba(79,70,229,.3); }
.btn-primary:hover { background: var(--c-primary-d); color: #fff; box-shadow: 0 4px 14px rgba(79,70,229,.35); }
.btn-ghost { background: var(--c-surface); color: var(--c-text-2); border-color: var(--c-border); }
.btn-ghost:hover { border-color: var(--c-primary); color: var(--c-primary); background: var(--c-primary-l); }
.btn-soft { background: var(--c-primary-l); color: var(--c-primary); }
.btn-soft:hover { background: color-mix(in srgb, var(--c-primary) 18%, transparent); }
.btn-ok { background: var(--c-ok); color: #fff; }
.btn-ok:hover { background: #0ea371; color: #fff; }
.btn-warn { background: var(--c-warn); color: #fff; }
.btn-warn:hover { background: #dd8b06; color: #fff; }
.btn-danger { background: var(--c-err); color: #fff; }
.btn-danger:hover { background: #cf3b40; color: #fff; }
.btn-danger-ghost { background: transparent; color: var(--c-err); border-color: color-mix(in srgb, var(--c-err) 35%, transparent); }
.btn-danger-ghost:hover { background: var(--c-err-l); }
.btn-sm { padding: 5px 11px; font-size: 12.5px; border-radius: var(--r-xs); }
.btn-lg { padding: 11px 22px; font-size: 15px; border-radius: var(--r); }
.btn-block { width: 100%; }
.btn-icon { padding: 7px; }

/* -------------------------------- 表单 -------------------------------- */
.field { margin-bottom: 16px; }
.label { display: block; font-size: 13px; font-weight: 620; margin-bottom: 6px; color: var(--c-text); }
.label .req { color: var(--c-err); margin-left: 2px; }
.hint { font-size: 12px; color: var(--c-muted); margin-top: 5px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--c-border); border-radius: var(--r-sm);
  background: var(--c-surface); color: var(--c-text);
  font: inherit; font-size: 13.5px;
  transition: border-color .15s, box-shadow .15s;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none; border-color: var(--c-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 14%, transparent);
}
.input:disabled, .input[readonly] { background: var(--c-surface-2); color: var(--c-muted); cursor: not-allowed; }
.textarea { resize: vertical; min-height: 88px; line-height: 1.6; }

/* 表格内联编辑用的紧凑输入框（价格矩阵）
 * 用 .input 默认的 9px/12px 内边距会把表格行撑得很高，一屏看不到几个人，
 * 而这里每行要放三个价格框、只想快速扫读 + 就地改。缩到 5px/9px，
 * 并把数字右对齐，与同列的 .num 保持一致。 */
.input-sm { padding: 5px 9px; font-size: 13px; }
.num .input-sm { text-align: right; }
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%238992a6' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; padding-right: 34px; }
.form-row { display: flex; gap: 14px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 200px; margin-bottom: 0; }
/* 相邻两行之间必须有间距：.form-row > .field 的 margin-bottom 被清成 0 了，
   不补这一条，多行表单（转账、新增科目、期初设置）的行与行会完全贴死，
   标签直接压上一行的输入框。 */
.form-row + .form-row, .form-row + .field, .field + .form-row { margin-top: 14px; }
/* 单列表单的输入框不该无限拉宽 —— 账本/科目这种表单在 1440 宽屏下
   输入框能到 1000px，光标在左、右半边全空，很难对准。
   只约束「form 直接子级 .field 里的单行控件」，两列 .form-row 不受影响。 */
.form > .field > .input,
.form > .field > .select { max-width: 520px; }
.form-row .input, .form-row .select { max-width: none; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13.5px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--c-primary); cursor: pointer; margin: 0; }
/* max-width:100% 不是可有可无的：inline-flex 的宽度是 max-content，
   长文案（「允许提交人审批自己的单据（默认关闭；只有在……」）不会换行，
   直接顶出卡片右边界被裁掉。加上上限后文字才会正常折行。 */
.switch { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; font-weight: 550; max-width: 100%; }
.switch > span { min-width: 0; }
.switch input { appearance: none; width: 38px; height: 21px; border-radius: var(--r-full);
  background: var(--c-border); position: relative; cursor: pointer; transition: background .2s; margin: 0; flex: 0 0 38px; }
.switch input::after { content:''; position:absolute; top:2px; left:2px; width:17px; height:17px;
  border-radius:50%; background:#fff; transition: transform .2s var(--ease); box-shadow: var(--sh-xs); }
.switch input:checked { background: var(--c-primary); }
.switch input:checked::after { transform: translateX(17px); }

/* ---------------------------- 选项卡（单选卡片） ----------------------------
 * 用途：线索来源这类「一组互斥选项 + 每项带说明/费率」的录入场景。
 * 原实现是把 .card 塞进 grid-3 里，四个选项排成 3+1 且说明文案长短不一时
 * 卡片高矮参差、选中与否只能靠原生小圆点辨认。
 *
 * 实现要点：
 *  · 2×2 网格 + grid 自带等高，卡片高度天然对齐（不靠 min-height 硬撑）。
 *  · 选中态用 `input:checked + .pick-box`（相邻兄弟选择器）。因此 input 必须
 *    是 .pick-box 的**前一个兄弟节点**，不能包在里面 —— 包着就只能用 :has()，
 *    而本工程已确立「不依赖 :has()」的约定。
 *  · input 用 sr-only 式隐藏而非 display:none：后者会让带 required 的控件在
 *    表单校验时抛 "not focusable"，提交被静默卡住（.oa-editor-src 同一坑）。
 * ------------------------------------------------------------------------- */
/* grid-auto-rows: 1fr —— 让**两行之间**也等高。
 * 只写 grid-template-columns 时每行各自按内容定高：带两个费率徽章的那张
 * （内部线索转介）会把标题行挤到换行、整行自然高度变成 100px，而第二行
 * 只有 70px，2×2 网格看起来就是"上大下小、没对齐"。
 * 1fr 让两行取同一高度，四张卡完全对齐。 */
.pick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 1fr; gap: 10px; }
.pick { position: relative; display: block; cursor: pointer; }
.pick-in {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.pick-box {
  display: flex; align-items: flex-start; gap: 10px;
  height: 100%; padding: 12px 13px;
  border: 1px solid var(--c-border); border-radius: var(--r);
  background: var(--c-surface);
  transition: border-color .16s var(--ease), background .16s var(--ease), box-shadow .16s var(--ease);
}
.pick:hover .pick-box { border-color: color-mix(in srgb, var(--c-primary) 42%, var(--c-border)); }
.pick-in:checked + .pick-box {
  border-color: var(--c-primary);
  background: var(--c-primary-l);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 13%, transparent);
}
.pick-in:focus-visible + .pick-box { outline: 2px solid var(--c-primary); outline-offset: 2px; }

.pick-dot {
  flex: 0 0 auto; width: 16px; height: 16px; margin-top: 2px;
  border: 1.5px solid var(--c-border-2); border-radius: 50%;
  display: grid; place-items: center; background: var(--c-surface);
  transition: border-color .16s, background .16s;
}
.pick-dot::after {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: #fff; transform: scale(0); transition: transform .16s var(--ease);
}
.pick-in:checked + .pick-box .pick-dot { border-color: var(--c-primary); background: var(--c-primary); }
.pick-in:checked + .pick-box .pick-dot::after { transform: scale(1); }

.pick-body { display: block; min-width: 0; flex: 1 1 auto; }
.pick-title { display: block; font-size: 13.5px; font-weight: 650; color: var(--c-text); }
/* 费率徽章单独占一行，不跟标题挤在一起。
   放在标题行右侧时，是否折行取决于「标题字数 + 徽章字数」和卡片宽度的
   毫厘之差（内部线索转介有两个徽章，在 1280 宽下恰好被挤到第二行，
   1280 以上的宽屏又回到一行），同一份代码在不同屏宽下呈现两种版式。
   独立成行后版式与屏宽无关，四张卡永远同构。 */
.pick-chips { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.pick-chip {
  display: inline-flex; align-items: baseline; gap: 4px;
  padding: 2px 7px; border-radius: var(--r-full);
  background: var(--c-surface-2); border: 1px solid var(--c-border-2);
  font-size: 11px; color: var(--c-text-2); white-space: nowrap;
}
.pick-chip em {
  font-style: normal; font-weight: 700; font-variant-numeric: tabular-nums;
  color: var(--c-primary);
}
.pick-in:checked + .pick-box .pick-chip { background: var(--c-surface); }
.pick-desc { display: block; margin-top: 3px; font-size: 11.5px; line-height: 1.5; color: var(--c-muted); }

/* 深色主题下 --c-primary-l 是一块深靛蓝，直接当底色可用，但 chip 需要提亮文字 */
html[data-theme="dark"] .pick-in:checked + .pick-box .pick-chip {
  background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .1);
}

/* 窄屏：2 列会把说明文字挤成竖排，直接塌成单列 */
@media (max-width: 640px) {
  .pick-grid { grid-template-columns: 1fr; }
}


/* -------------------------------- 表格 -------------------------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
.table th {
  text-align: left; font-weight: 650; font-size: 12px; letter-spacing: .03em;
  color: var(--c-muted); text-transform: uppercase;
  padding: 11px 14px; background: var(--c-surface-2);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap; position: sticky; top: 0; z-index: 2;
}
.table td { padding: 12px 14px; border-bottom: 1px solid var(--c-border-2); vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--c-surface-2); }
html[data-theme="dark"] .table tbody tr:hover { background: rgba(255,255,255,.03); }
.table tbody tr:last-child td { border-bottom: 0; }
/* 当前所在账本行的高亮。用 color-mix 而不是写死色值：
   深浅两套主题共用同一份规则，写死 rgba 会导致深色模式下刺眼。 */
.table tbody tr.row-current { background: color-mix(in srgb, var(--c-primary) 8%, transparent); }
.table tbody tr.row-current:hover { background: color-mix(in srgb, var(--c-primary) 13%, transparent); }
/* 小计行（毛利 / 营业利润 / 净利润）：只对「本行有数」的列着色，
   收入与支出两列是空的 —— 用淡底色把整行圈起来，比单纯加粗更容易分辨
   这一行不是明细、是汇总。background 写在 td 上，才不会被 tr:hover 覆盖。 */
.table tbody tr.row-subtotal td { background: var(--c-surface-2); border-top: 1px solid var(--c-border); font-weight: 720; }
.table .num { font-variant-numeric: tabular-nums; text-align: right; font-weight: 620; }
.table .actions { display: flex; gap: 6px; flex-wrap: wrap; }
.table-sm td, .table-sm th { padding: 8px 11px; }
/* 表格内的空状态。此前新功能页面一律写成
   <td class="text-center text-muted" style="padding:28px"> 一行灰字 ——
   .text-center 这个类压根没定义，于是提示文字**左对齐贴在最左列**，
   右边的列全空，看起来像表格崩了。统一成一个类，居中、灰字、留白足。 */
.table-empty { text-align: center; color: var(--c-muted); font-size: 13px; padding: 40px 16px; }
.table-empty a { color: var(--c-primary); font-weight: 600; }
.table-empty .ic { opacity: .3; display: block; margin: 0 auto 8px; }

/* -------------------------- 徽章 / 标签 / 头像 -------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2.5px 9px; border-radius: var(--r-full);
  font-size: 11.5px; font-weight: 650; line-height: 1.6; white-space: nowrap;
  background: var(--c-surface-2); color: var(--c-text-2); border: 1px solid var(--c-border);
}
.badge-primary { background: var(--c-primary-l); color: var(--c-primary); border-color: transparent; }
.badge-ok      { background: var(--c-ok-l);   color: var(--c-ok);   border-color: transparent; }
.badge-warn    { background: var(--c-warn-l); color: #b8760a;        border-color: transparent; }
.badge-err     { background: var(--c-err-l);  color: var(--c-err);  border-color: transparent; }
.badge-info    { background: var(--c-info-l); color: var(--c-info); border-color: transparent; }
html[data-theme="dark"] .badge-warn { color: var(--c-warn); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 11px; border-radius: var(--r-full);
  background: var(--c-surface); border: 1px solid var(--c-border);
  font-size: 12.5px; font-weight: 550; color: var(--c-text-2);
}
.chip.is-on { background: var(--c-primary-l); color: var(--c-primary); border-color: transparent; font-weight: 650; }

/* ------------------------------ 页签条（tabbar） ------------------------------
   页签多的时候（收支账有 8 个），原来用一排 .chip 加 flex-wrap：
   一换行，第二行的页签就贴着第一行，且右边的区间文字被 flex 挤到中间去，
   整条看起来是散的。这里拆成两层：
     .tabbar      —— 横向 flex，两侧间距统一
     .tabbar-nav  —— 可换行的页签本体，gap 与行距都由它管
     .tabbar-meta —— 右侧口径说明，换行时自动落到下一行末尾而不是插进页签中间
   ------------------------------------------------------------------------ */
.tabbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.tabbar-nav {
  display: flex; flex-wrap: wrap; gap: 6px;
  align-items: center; min-width: 0; flex: 1 1 auto;
  row-gap: 6px;
}
.tabbar-item {
  display: inline-flex; align-items: center;
  padding: 6px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 560; color: var(--c-text-2);
  white-space: nowrap; transition: background .14s, color .14s;
}
.tabbar-item:hover { background: var(--c-surface-2); color: var(--c-text); }
.tabbar-item.is-on { background: var(--c-primary); color: #fff; font-weight: 650; }
/* 口径说明单独一行，左对齐紧跟页签组下方。
   放在同一行右端时宽屏会把它推到 1000px 外，
   页签与口径之间只剩一条竖白边，看着像两个不相干的控件。 */
.tabbar-foot {
  margin-top: 10px; padding-top: 9px;
  border-top: 1px dashed var(--c-border-2);
}
.tabbar-meta {
  flex: 0 0 auto; font-size: 12px; color: var(--c-muted);
  white-space: nowrap; align-self: center;
}
@media (max-width: 720px) {
  .tabbar-meta { flex: 1 0 100%; }
}

.ava { border-radius: 50%; object-fit: cover; background: var(--c-surface-2); flex: 0 0 auto; display: block; }
.ava-xs { width: 24px; height: 24px; }
.ava-sm { width: 32px; height: 32px; }
.ava-md { width: 44px; height: 44px; }
.ava-lg { width: 84px; height: 84px; }
.ava-xl { width: 108px; height: 108px; }
.ava-ring { border: 3px solid var(--c-surface); box-shadow: 0 0 0 1px var(--c-border); }

.person { display: flex; align-items: center; gap: 9px; min-width: 0; }
.person-meta { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.person-meta strong { font-size: 13.5px; font-weight: 620; }
.person-meta small { font-size: 11.5px; color: var(--c-muted); }

/* ============================ 组织架构图 ============================
 * 结构：.org-chart → .org-unit.is-top（顶级部门卡片）
 *                    └ .org-body → .org-members（成员药丸）
 *                                → .org-children（子部门网格 + 连接线）
 *
 * 为什么不用 margin-left 递进表示层级（原实现的做法）：
 *   每深一层左边距就少 22px，到第三层卡片已经被压得没有内容宽度；
 *   而且"缩进"只说明纵深，说明不了"这个部门挂在哪个父部门下面"。
 *   改成：父级内容在上、子部门在下方网格里并排，用**树干+支线**连接。
 * ------------------------------------------------------------------ */
.org-chart { display: flex; flex-direction: column; gap: 16px; }

.org-unit {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-lg);
  min-width: 0;
}
.org-unit.is-top { box-shadow: var(--sh-sm); overflow: hidden; }
.org-unit.is-sub {
  position: relative;
  border-radius: var(--r);
  box-shadow: none;
}

.org-head {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 12px 15px;
  border-bottom: 1px solid var(--c-border-2);
}
.org-unit.is-top > .org-head { background: var(--c-surface-2); padding: 14px 18px; }
.org-unit.is-sub > .org-head { padding: 10px 13px; }

.org-dot {
  flex: 0 0 auto; width: 10px; height: 10px; border-radius: 50%;
  background: var(--c-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-primary) 18%, transparent);
}
.org-unit.is-sub .org-dot {
  width: 8px; height: 8px; background: var(--c-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 18%, transparent);
}
.org-name {
  margin: 0; font-size: 15px; font-weight: 700; letter-spacing: -.01em; color: var(--c-text);
}
.org-unit.is-sub .org-name { font-size: 13.5px; font-weight: 650; }

.org-body { padding: 14px 18px 16px; }
.org-unit.is-sub > .org-body { padding: 12px 13px 14px; }

/* 成员药丸：头像 + 姓名 + 职级徽章。用 auto-fill 而非固定列数 —— 部门人数
   从 0 到 20 都有，固定列数要么留大片空白要么把名字挤断。 */
.org-members {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 8px;
}
.org-person {
  display: flex; align-items: center; gap: 8px; min-width: 0;
  padding: 5px 9px 5px 6px;
  border: 1px solid var(--c-border-2); border-radius: var(--r-full);
  background: var(--c-surface-2);
  transition: border-color .15s, background .15s;
}
.org-person:hover { border-color: var(--c-border); background: var(--c-surface); }
.org-person-name {
  flex: 1 1 auto; min-width: 0;
  font-size: 13px; font-weight: 600; color: var(--c-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.org-person .rank { flex: 0 0 auto; margin-left: auto; }

/* 职级徽章 */
.rank {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 1px 7px; border-radius: var(--r-full);
  font-size: 10.5px; font-weight: 700; line-height: 1.65; white-space: nowrap;
  background: var(--c-surface); color: var(--c-muted);
  border: 1px solid var(--c-border);
}
.rank-2 { background: var(--c-info-l);  color: var(--c-info);    border-color: transparent; }
.rank-3 { background: var(--c-primary-l); color: var(--c-primary); border-color: transparent; }
.rank-4 { background: var(--c-warn-l);  color: #b8760a;          border-color: transparent; }
.rank-admin { padding: 1px 5px; background: var(--c-err-l); color: var(--c-err); border-color: transparent; }
html[data-theme="dark"] .rank-4 { color: var(--c-warn); }

/* 子部门：网格并排 + 树干/支线连接 */
.org-children {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(292px, 1fr));
  gap: 12px;
  margin-top: 14px;
  padding-left: 18px;
}
/* 树干：从父级内容底部延伸下来，纵向贯穿所有子节点 */
.org-children::before {
  content: ''; position: absolute; left: 6px; top: -8px; bottom: 22px;
  width: 2px; border-radius: 2px; background: var(--c-border);
}
/* 支线：每个子节点向左接到树干上 */
.org-unit.is-sub::before {
  content: ''; position: absolute; left: -12px; top: 21px;
  width: 12px; height: 2px; background: var(--c-border);
}

.org-empty { margin: 0; font-size: 13px; color: var(--c-muted); }

/* ============================== 图片灯箱 ==============================
 * 替换「点图片 → 浏览器打开裸图片地址」的老行为。
 * 原做法的问题：没有导航、没有上下文、后退才能回到列表，而且是把 6~11MB
 * 的原图当独立页面下载，手机上几乎不可用。
 *
 * 深色底是刻意的，且**不随主题切换** —— 看图时深色环境色能让画面本身更突出，
 * 浅色主题下用白底看证书会明显发灰。
 * ------------------------------------------------------------------ */
.lb-mask {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(6, 9, 16, .93);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
  opacity: 0; transition: opacity .2s var(--ease);
}
.lb-mask.is-open { opacity: 1; }
.lb-inner { position: absolute; inset: 0; display: flex; flex-direction: column; }

.lb-stage {
  flex: 1 1 auto; position: relative; min-height: 0;
  display: grid; place-items: center; padding: 22px 68px 8px;
}
.lb-stage img {
  position: absolute; max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain; border-radius: 6px;
  user-select: none; -webkit-user-drag: none;
}
/* 占位图先显示；原图加载完再淡入覆盖，避免 10MB 原图造成几秒白屏 */
.lb-full { opacity: 0; transition: opacity .26s var(--ease); }
.lb-full.is-on { opacity: 1; }

.lb-btn {
  position: absolute; z-index: 2;
  display: grid; place-items: center;
  width: 42px; height: 42px; border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .1); color: #fff;
  cursor: pointer; padding: 0;
  transition: background .15s, border-color .15s, transform .15s;
}
.lb-btn:hover { background: rgba(255, 255, 255, .2); border-color: rgba(255, 255, 255, .3); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.lb-close { top: 16px; right: 16px; }
.lb-prev  { left: 16px;  top: 50%; transform: translateY(-50%); }
.lb-next  { right: 16px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover { transform: translateY(-50%) scale(1.06); }

.lb-bar {
  flex: 0 0 auto; display: flex; align-items: center; gap: 14px;
  padding: 10px 22px 6px; color: #eef1f7;
}
.lb-cap { display: flex; flex-direction: column; line-height: 1.45; min-width: 0; }
.lb-cap-t { font-size: 14px; font-weight: 650; }
.lb-cap-s { font-size: 12px; color: #9aa5b8; }
.lb-count {
  margin-left: auto; flex: 0 0 auto;
  font-size: 12.5px; font-variant-numeric: tabular-nums;
  padding: 3px 11px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .1); color: #dfe4ee;
}

.lb-strip {
  flex: 0 0 auto; display: flex; gap: 7px; justify-content: flex-start;
  padding: 8px 22px 16px; overflow-x: auto; -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.lb-thumb-btn {
  flex: 0 0 auto; width: 58px; height: 44px; padding: 0; overflow: hidden;
  border: 2px solid transparent; border-radius: 6px;
  background: rgba(255, 255, 255, .08); cursor: pointer;
  opacity: .6; transition: opacity .15s, border-color .15s;
}
.lb-thumb-btn img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lb-thumb-btn:hover { opacity: .9; }
.lb-thumb-btn.is-on { opacity: 1; border-color: #fff; }

@media (max-width: 640px) {
  .lb-stage { padding: 14px 10px 4px; }
  .lb-btn { width: 36px; height: 36px; }
  .lb-close { top: 10px; right: 10px; }
  .lb-prev  { left: 6px; }
  .lb-next  { right: 6px; }
  .lb-bar { padding: 8px 14px 4px; }
  .lb-strip { padding: 6px 14px 12px; }
  .lb-thumb-btn { width: 48px; height: 36px; }
}

/* 打印时不输出灯箱（否则打出来的纸上是全屏黑底） */
@media print { .lb-mask { display: none !important; } }

/* ============================ 荣誉墙 ============================
 * 荣誉素材以证书/牌匾为主，长宽比横竖都有，所以图片区用 contain 而不是
 * cover —— cover 会把证书的抬头/落款裁掉，而"看得全"正是这一页的意义。
 * 因此这里给图片加一层"装裱"效果：浅色卡纸底 + 内阴影，看起来像挂在墙上。
 * ---------------------------------------------------------------- */
.honor-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.honor-card { display: flex; flex-direction: column; }
/* 首项跨两列：一排等宽卡片看不出主次，最新/最重要的一项放大后层次立刻分明 */
.honor-card.is-feature { grid-column: span 2; }
.honor-card.is-feature .honor-frame { aspect-ratio: 16 / 9; }
@media (max-width: 640px) {
  .honor-grid { grid-template-columns: 1fr; }
  .honor-card.is-feature { grid-column: span 1; }
  .honor-card.is-feature .honor-frame { aspect-ratio: 4 / 3; }
}
.honor-frame {
  position: relative; display: block; aspect-ratio: 4 / 3; overflow: hidden;
  background: linear-gradient(160deg, var(--c-surface-2), var(--c-surface));
  border-bottom: 1px solid var(--c-border-2);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .02);
}
.honor-frame img {
  width: 100%; height: 100%; object-fit: contain; padding: 14px;
  transition: transform .28s var(--ease);
}
.honor-card:hover .honor-frame img { transform: scale(1.035); }
/* 悬浮提示"可点开看大图"——原来的行为是新开标签访问裸图片地址，
   界面上没有任何暗示，用户根本不知道点下去会跳走 */
.honor-zoom {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(10, 14, 24, .34); color: #fff;
  opacity: 0; transition: opacity .2s;
}
.honor-card:hover .honor-zoom, .honor-zoom:focus-visible { opacity: 1; }
.honor-zoom span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 13px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .3);
  font-size: 12.5px; font-weight: 600;
}
.honor-date {
  position: absolute; top: 10px; left: 10px;
  padding: 2px 9px; border-radius: var(--r-full);
  background: rgba(10, 14, 24, .6); color: #fff;
  font-size: 11px; font-variant-numeric: tabular-nums;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}

/* ============================ 活动相册 ============================ */
.album-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.album-cover {
  position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden;
  background: var(--c-surface-2);
}
.album-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s var(--ease); }
.album-card:hover .album-cover img { transform: scale(1.045); }
/* 底部渐变 + 标题压在图上：相册卡的标题本来就是"这张照片在讲什么"，
   放在图下方要多占一行，压在图上信息层级更清楚 */
.album-cover::after {
  content: ''; position: absolute; inset: auto 0 0 0; height: 58%;
  background: linear-gradient(to top, rgba(8, 11, 20, .78), rgba(8, 11, 20, 0));
  pointer-events: none;
}
.album-cover-txt {
  position: absolute; left: 12px; right: 12px; bottom: 10px; z-index: 1;
  color: #fff; line-height: 1.4;
}
.album-cover-txt strong {
  display: block; font-size: 14px; font-weight: 650;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.album-cover-txt em {
  font-style: normal; font-size: 11.5px; color: rgba(255, 255, 255, .82);
  font-variant-numeric: tabular-nums;
}
.album-flags { position: absolute; top: 10px; left: 10px; z-index: 1; display: flex; gap: 5px; }
.album-flags .badge { background: rgba(10, 14, 24, .62); color: #fff; border: 0; backdrop-filter: blur(4px); }
.album-strip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.album-strip a { display: block; border-radius: 7px; overflow: hidden; line-height: 0; }
.album-strip img {
  width: 42px; height: 42px; object-fit: cover; display: block;
  transition: transform .2s var(--ease);
}
.album-strip a:hover img { transform: scale(1.08); }
.album-strip .more {
  width: 42px; height: 42px; border-radius: 7px; display: grid; place-items: center;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  font-size: 11.5px; font-weight: 650; color: var(--c-text-2); line-height: 1;
}


/* 窄屏：两列并排会把姓名挤成省略号，直接塌成单列，连接线一并收起 */
@media (max-width: 640px) {
  .org-members { grid-template-columns: repeat(auto-fill, minmax(146px, 1fr)); }
  .org-children { grid-template-columns: 1fr; padding-left: 14px; }
  .org-children::before { left: 4px; }
  .org-unit.is-sub::before { left: -10px; width: 10px; }
  .org-body { padding: 12px 13px 14px; }
}


/* ------------------------------ 提示条 ------------------------------- */
.alert {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 15px; border-radius: var(--r);
  font-size: 13.5px; margin-bottom: 16px;
  border: 1px solid transparent;
  flex-wrap: wrap;
  /* 中文长句在整宽容器里换行时，最后一行常常只剩一两个字
     （「…建」「一个新账本即可」这种）—— pretty 会把断行位置往回挪一点。 */
  text-wrap: pretty;
}
.alert-ok    { background: var(--c-ok-l);   color: var(--c-ok);   border-color: color-mix(in srgb, var(--c-ok) 22%, transparent); }
.alert-err   { background: var(--c-err-l);  color: var(--c-err);  border-color: color-mix(in srgb, var(--c-err) 22%, transparent); }
.alert-warn  { background: var(--c-warn-l); color: #b8760a;       border-color: color-mix(in srgb, var(--c-warn) 24%, transparent); }
.alert-info  { background: var(--c-info-l); color: var(--c-info); border-color: color-mix(in srgb, var(--c-info) 22%, transparent); }
html[data-theme="dark"] .alert-warn { color: var(--c-warn); }

/* ----------------------------- 空态 / 状态页 ----------------------------- */
.empty-state { text-align: center; padding: 52px 20px; color: var(--c-muted); }
.empty-icon { opacity: .35; margin-bottom: 12px; display: grid; place-items: center; }
.empty-state p { margin: 0; font-size: 13.5px; }
.oa-center { display: grid; place-items: center; min-height: 100vh; padding: 24px; }
.state-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  padding: 44px 40px; max-width: 460px; text-align: center;
}
.state-code { font-size: 54px; font-weight: 800; letter-spacing: -.05em; background: var(--c-grad);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.state-card h1 { font-size: 19px; margin: 6px 0 10px; }
.state-card p { color: var(--c-muted); font-size: 13.5px; margin-bottom: 22px; }
.state-actions { display: flex; gap: 9px; justify-content: center; flex-wrap: wrap; }

/* -------------------------------- 分页 -------------------------------- */
.pager { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; padding: 14px 18px; }
.pg-item {
  min-width: 33px; height: 33px; padding: 0 9px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--c-border); border-radius: var(--r-xs);
  background: var(--c-surface); color: var(--c-text-2);
  font-size: 13px; font-weight: 600;
}
.pg-item:hover { border-color: var(--c-primary); color: var(--c-primary); }
.pg-item.is-active { background: var(--c-primary); border-color: var(--c-primary); color: #fff; }
.pg-item.is-disabled { opacity: .45; pointer-events: none; }
.pg-info { margin-left: auto; font-size: 12.5px; color: var(--c-muted); }

/* -------------------------------- 弹窗 -------------------------------- */
.modal-mask {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(8,11,20,.55); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 20px;
  opacity: 0; visibility: hidden; transition: opacity .18s var(--ease), visibility .18s;
}
.modal-mask.is-open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--c-elev); border: 1px solid var(--c-border);
  border-radius: var(--r-lg); box-shadow: var(--sh-lg);
  width: 100%; max-width: 560px; max-height: 90vh;
  display: flex; flex-direction: column;
  transform: translateY(14px) scale(.97); transition: transform .2s var(--ease);
}
.modal-mask.is-open .modal-box { transform: none; }
.modal-box.is-wide { max-width: 860px; }
.modal-box.is-narrow { max-width: 420px; }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 15px 20px; border-bottom: 1px solid var(--c-border-2);
}
.modal-head h3 { margin: 0; font-size: 15.5px; flex: 1; }
.modal-body { padding: 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 13px 20px; border-top: 1px solid var(--c-border-2);
  display: flex; justify-content: flex-end; gap: 9px; background: var(--c-surface-2);
}

/* -------------------------------- 提示 -------------------------------- */
.toast-wrap {
  position: fixed; right: 20px; bottom: 20px; z-index: 300;
  display: flex; flex-direction: column; gap: 9px; pointer-events: none;
}
.toast {
  pointer-events: auto;
  display: flex; align-items: center; gap: 9px;
  min-width: 240px; max-width: 380px;
  padding: 12px 16px;
  background: var(--c-elev); border: 1px solid var(--c-border);
  border-left: 3px solid var(--c-primary);
  border-radius: var(--r); box-shadow: var(--sh-lg);
  font-size: 13.5px; font-weight: 550;
  animation: toastIn .24s var(--ease);
}
.toast.is-ok  { border-left-color: var(--c-ok); }
.toast.is-err { border-left-color: var(--c-err); }
.toast.is-warn{ border-left-color: var(--c-warn); }
@keyframes toastIn { from { opacity:0; transform: translateX(24px); } to { opacity:1; transform:none; } }

/* ------------------------------- 时间线 ------------------------------- */
/* ------------------------------ 时间线（跟进记录） ------------------------------
   原来每条记录只有一个小圆点 + 一行灰字，正文直接平铺在页面背景上，
   长内容（老板原话、下步计划）连成一片灰，分不清几次跟进、每次说了什么。
   现在每条是独立卡片：左边留时间线的轴，圆点压在卡片边上，层次一眼可辨。
   ------------------------------------------------------------------------ */
.timeline { position: relative; padding-left: 26px; }
.timeline::before { content:''; position:absolute; left:7px; top:10px; bottom:10px; width:2px; background: var(--c-border); border-radius:2px; }
.tl-item {
  position: relative; margin-bottom: 12px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 11px 14px;
}
.tl-item:last-child { margin-bottom: 0; }
.tl-item::before {
  content:''; position:absolute; left:-24px; top:14px; width:10px; height:10px;
  border-radius:50%; background: var(--c-surface); border: 2px solid var(--c-primary);
}
.tl-item.is-ok::before   { border-color: var(--c-ok); }
.tl-item.is-warn::before { border-color: var(--c-warn); }
.tl-item.is-err::before  { border-color: var(--c-err); }
/* 时间/人/渠道是「这条记录是谁在什么时候用什么方式记的」，
   做成一行 chip 样的小标签，和下面的正文明显分层。 */
.tl-time {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--c-muted); margin-bottom: 6px;
}
.tl-time b { font-weight: 600; color: var(--c-text-2); }
.tl-time i {
  font-style: normal; background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-full); padding: 1px 8px; font-size: 11px;
}
.tl-title { font-size: 13.5px; font-weight: 620; margin: 1px 0 2px; }
.tl-desc { font-size: 12.5px; color: var(--c-text-2); line-height: 1.65; }
.tl-desc + .tl-desc { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--c-border); }
.tl-desc b { font-weight: 600; color: var(--c-text); }

/* -------------------------------- 看板 -------------------------------- */
.kanban { display: flex; gap: 14px; overflow-x: auto; padding-bottom: 8px; }
.kanban-col { flex: 0 0 264px; background: var(--c-surface-2); border: 1px solid var(--c-border); border-radius: var(--r); display: flex; flex-direction: column; }
.kanban-head { padding: 11px 14px; border-bottom: 1px solid var(--c-border); font-size: 13px; font-weight: 650; display: flex; align-items: center; gap: 7px; }
.kanban-count { margin-left: auto; font-size: 11.5px; color: var(--c-muted); background: var(--c-surface); padding: 1px 8px; border-radius: var(--r-full); }
.kanban-list { padding: 10px; display: flex; flex-direction: column; gap: 9px; min-height: 90px; max-height: 62vh; overflow-y: auto; }
.kanban-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); padding: 11px 13px; box-shadow: var(--sh-xs);
  transition: transform .15s, box-shadow .15s;
}
.kanban-card:hover { transform: translateY(-2px); box-shadow: var(--sh); }
.kanban-card h4 { font-size: 13.5px; margin: 0 0 5px; }
.kanban-card .meta { font-size: 11.5px; color: var(--c-muted); display: flex; gap: 9px; flex-wrap: wrap; }

/* ------------------------------- 进度条 ------------------------------- */
.bar { height: 6px; background: var(--c-border); border-radius: var(--r-full); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--c-grad); border-radius: inherit; transition: width .4s var(--ease); }
.bar.is-ok > i { background: var(--c-ok); }
.bar.is-warn > i { background: var(--c-warn); }
.bar.is-err > i { background: var(--c-err); }

/* ------------------------------ 工具类 ------------------------------ */
/* ⚠️ .flex 默认必须换行。
   原来是 `display:flex` 不换行：任何 `input + button` 的横向组合
   （合同详情的「退回/终止原因」输入框、筛选栏）一旦视口不够宽，
   后面的元素就被硬挤出容器、压在前面元素上面 ——
   在 1080 宽的笔记本上「终止原因」输入框直接被「终止合同」按钮盖掉一半。
   Flex 的默认收缩会把 input 压到内容宽度以下而不是换行，所以必须显式开 wrap。
   `flex-nowrap` 留给确实不能折行的场景（面包屑、工具条）。 */
.flex { display: flex; flex-wrap: wrap; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.justify-between { justify-content: space-between; }
.justify-end { justify-content: flex-end; }
.flex-wrap { flex-wrap: wrap; }
.flex-nowrap { flex-wrap: nowrap; }
.gap-4 { gap: 4px; } .gap-6 { gap: 6px; } .gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.text-muted { color: var(--c-muted); }
.text-ok { color: var(--c-ok); } .text-err { color: var(--c-err); } .text-warn { color: var(--c-warn); }
.text-primary { color: var(--c-primary); }
/* 别名：模板里长期写的是 text-danger / text-success（14 个页面都在用），
   而 CSS 里只有 text-err / text-ok —— 于是「调试模式」「亏损金额」这类本该
   醒目的文字全是默认黑色，className 看着对、效果为零。两组现在等价。 */
.text-danger { color: var(--c-err); } .text-success { color: var(--c-ok); }
.text-center { text-align: center; } .text-right { text-align: right; }
.text-sm { font-size: 12.5px; } .text-xs { font-size: 11.5px; }
.fw-6 { font-weight: 620; } .fw-7 { font-weight: 720; }
.num { font-variant-numeric: tabular-nums; }
.mt-0{margin-top:0}.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-24{margin-top:24px}
.mb-0{margin-bottom:0}.mb-4{margin-bottom:4px}.mb-8{margin-bottom:8px}.mb-12{margin-bottom:12px}.mb-16{margin-bottom:16px}.mb-24{margin-bottom:24px}
.py-0{padding-top:0;padding-bottom:0}
.w-100{width:100%}
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 工作台的活动 / 荣誉卡片靠 clamp-1 把标题压成一行来保证等高 ——
   这个类原先**根本不存在**（只有 clamp-2 / clamp-3），于是标题想占几行占几行，
   同一行里的卡片高度参差不齐，看起来就是"没对齐"。 */
.clamp-1 { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* 荣誉卡片的描述允许三行：两行会把"2022年荣获商洛市…直播基地"这类
   带年份和颁发单位的说明拦腰截断，读起来像坏掉的文本 */
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ------------------------------ 时间色块（回访/任务类） ------------------------------
   表格里的时间原来是一行灰色小字（10-22 15:00），和旁边的客户名、方式、
   目的混在同一层，扫一眼看不出哪条是今天、哪条已经过期。
   现在做成独立色块，日期与时刻分行：
     late   逾期   红底 —— 需要立刻处理
     today  今天   橙底 —— 今天的事
     future 未来   灰底 —— 弱化，不抢注意力
     done   已完成 绿底 —— 已闭环
   ------------------------------------------------------------------------ */
.when-cell { white-space: nowrap; vertical-align: middle; }
.when-cell > .text-xs { display: block; margin-top: 3px; font-weight: 600; }
.when {
  display: inline-flex; flex-direction: column; align-items: center; gap: 1px;
  min-width: 62px; padding: 5px 10px; border-radius: var(--r-sm);
  border: 1px solid transparent; line-height: 1.2;
}
.when b { font-size: 13px; font-weight: 700; letter-spacing: .2px; }
.when i { font-style: normal; font-size: 11.5px; opacity: .82; }
.when-late   { background: color-mix(in srgb, var(--c-err) 14%, transparent);  border-color: color-mix(in srgb, var(--c-err) 34%, transparent);  color: var(--c-err); }
.when-today  { background: color-mix(in srgb, var(--c-warn) 20%, transparent); border-color: color-mix(in srgb, var(--c-warn) 46%, transparent);  color: var(--c-warn); }
.when-future { background: var(--c-surface-2); border-color: var(--c-border); color: var(--c-text-2); }
.when-done   { background: color-mix(in srgb, var(--c-ok) 13%, transparent);   border-color: color-mix(in srgb, var(--c-ok) 30%, transparent);   color: var(--c-ok); }
/* 深色模式下 color-mix 会偏亮，给文字换回高对比度 */
[data-theme="dark"] .when-late  { color: color-mix(in srgb, var(--c-err) 72%, #fff); }
[data-theme="dark"] .when-today { color: color-mix(in srgb, var(--c-warn) 65%, #fff); }
[data-theme="dark"] .when-done  { color: color-mix(in srgb, var(--c-ok) 62%, #fff); }
/* ------------------------------ 员工职级（L1/L2/P1/P2） ------------------------------
   纯标签样式，四档用「冷/暖 + 深浅」区分：L 序列（专业）冷色、P 序列（管理）暖色，
   同序列内数字越大颜色越深，一眼能看出谁是资深、谁是新主管。 */
.jl {
  display: inline-block; margin-left: 5px; padding: 1px 7px;
  border-radius: var(--r-full); font-size: 11px; font-weight: 700;
  letter-spacing: .4px; line-height: 1.6; vertical-align: 1px;
}
.jl-L1 { background: color-mix(in srgb, var(--c-info) 12%, transparent);  color: var(--c-info);  border: 1px solid color-mix(in srgb, var(--c-info) 34%, transparent); }
.jl-L2 { background: color-mix(in srgb, var(--c-info) 22%, transparent);  color: var(--c-info);  border: 1px solid color-mix(in srgb, var(--c-info) 52%, transparent); }
.jl-P1 { background: color-mix(in srgb, var(--c-warn) 20%, transparent);  color: var(--c-warn);  border: 1px solid color-mix(in srgb, var(--c-warn) 46%, transparent); }
.jl-P2 { background: color-mix(in srgb, var(--c-warn) 32%, transparent);  color: var(--c-warn);  border: 1px solid color-mix(in srgb, var(--c-warn) 62%, transparent); }
[data-theme="dark"] .jl-L1, [data-theme="dark"] .jl-L2 { color: color-mix(in srgb, var(--c-info) 70%, #fff); }
[data-theme="dark"] .jl-P1, [data-theme="dark"] .jl-P2 { color: color-mix(in srgb, var(--c-warn) 62%, #fff); }

/* ------------------------------ 首页通知重点区 ------------------------------
   原来首页五条通知长得一模一样，主管发的紧急通知和三个月前的旧公告视觉上无差别，
   等于「重点展示」不存在。现在：第一条放大成头条卡（置顶优先），其余退回紧凑行。 */
.notice-hero {
  display: block; padding: 16px 18px 15px;
  border-bottom: 1px solid var(--c-border-2);
  color: inherit;
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-info) 7%, transparent), transparent 78%);
  transition: background .15s;
}
.notice-hero:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--c-info) 12%, transparent), transparent 82%); }
.notice-hero.is-top {
  background: linear-gradient(180deg, color-mix(in srgb, var(--c-warn) 14%, transparent), transparent 80%);
  border-left: 3px solid var(--c-warn); padding-left: 15px;
}
.notice-hero.is-top:hover { background: linear-gradient(180deg, color-mix(in srgb, var(--c-warn) 20%, transparent), transparent 84%); }
.notice-hero-top { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.notice-hero-tag {
  display: inline-block; padding: 1px 8px; border-radius: var(--r-full);
  font-size: 11px; font-weight: 700; letter-spacing: .5px;
  background: var(--c-primary); color: #fff;
}
.notice-hero-tag.is-new { background: var(--c-info); }
.notice-hero.is-top .notice-hero-tag { background: var(--c-warn); color: #111827; }
.notice-hero-title {
  margin: 0 0 5px; font-size: 16.5px; font-weight: 700;
  line-height: 1.45; color: var(--c-text); letter-spacing: -.01em;
}
.notice-hero-ex {
  margin: 0 0 9px; font-size: 13px; line-height: 1.7;
  color: var(--c-text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.notice-hero-more { font-size: 12.5px; font-weight: 600; color: var(--c-primary); }
.notice-list { padding: 4px 0; }
.notice-row {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 18px; color: inherit;
  border-bottom: 1px solid var(--c-border-2);
  transition: background .13s;
}
.notice-row:last-child { border-bottom: 0; }
.notice-row:hover { background: var(--c-surface-2); }
.notice-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--c-border); flex: 0 0 auto; }
.notice-dot.is-top { background: var(--c-warn); }
.notice-row-title {
  flex: 1 1 auto; min-width: 0; font-size: 13.5px; color: var(--c-text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.notice-row:hover .notice-row-title { color: var(--c-text); }

.hide { display: none !important; }
.sr-only { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip:rect(0,0,0,0); border:0; }
.only-mobile { display: none; }
.divider { height: 1px; background: var(--c-border-2); margin: 16px 0; }
/* 键值小标题（运维页的「运行环境」「来源 IP Top」这类分节标签） */
.row-label {
  font-size: 11.5px; font-weight: 700; letter-spacing: .6px;
  color: var(--c-muted); text-transform: none;
  margin: 2px 0 8px;
}
/* 等宽块：用于命令提示与日志。日志里是长行，必须能横向滚动 +
   等宽字体，否则时间戳与错误消息的列对不齐，很难看出问题发生在哪一列。 */
.code-block {
  font-family: var(--ff-mono); font-size: 12.5px; line-height: 1.6;
  background: var(--c-surface-2); border: 1px solid var(--c-border);
  border-radius: var(--r-sm); padding: 12px 14px; margin: 0;
  color: var(--c-text-2); overflow-x: auto; white-space: pre;
}
/* 防塌陷：.divider 的语义是「一条分隔线」，但全站曾有 4 处把它当成区块容器
   套在内容外面（荣誉录入表单、员工手册正文、制度正文、制度签收区）。
   height:1px 会把里面的内容整块压没，而现场看起来是「排版全乱」「内容不见了」，
   完全不像 CSS 类名问题，排查成本极高。这里让「非空 divider」自动退回
   普通块级容器：即使以后再误用，也只会多一条线，不会吞内容。 */
.divider:not(:empty) { height: auto; background: none; margin: 16px 0; }

/* 员工手册章节折叠指示器。summary 用 list-style:none 去掉了原生三角，
   这里补一个会随展开状态翻转的箭头，否则看不出「这一条可以点开」。 */
.man-chev { display: inline-flex; align-items: center; color: var(--c-muted); transition: transform .2s var(--ease); }
details[open] > summary .man-chev { transform: rotate(180deg); }
/* ======================================================================
   富文本正文排版
   ----------------------------------------------------------------------
   本系统的正文有三个入口：手动录入、飞书文档整页粘贴、纯文本粘贴。
   三者原始排版差异极大（飞书带固定 px 字号与内联缩进、纯文本没有换行），
   所以这里做的是「统一收敛」——不论来源，渲染出来都长成同一副样子。

   与 core/Rich.php 的分工：
     Rich 负责**结构**（分段、编号层级、剥离粘贴噪音）
     这里负责**视觉**（间距、缩进、表格、引用）
   两边改动需要同步，尤其是 ri-N 这个层级类名。
   ====================================================================== */
.rich-content {
  font-size: 14.5px;
  line-height: 1.85;
  color: var(--c-text);
  overflow-wrap: break-word;   /* 长 URL / 连续英文不撑破容器 */
  word-break: break-word;
}
/* 首尾元素不留外边距，避免卡片上下出现莫名空白 */
.rich-content > *:first-child { margin-top: 0 !important; }
.rich-content > *:last-child  { margin-bottom: 0 !important; }

.rich-content p { margin: 0 0 12px; }
/* 编号层级缩进：与 Rich::textToHtml() 输出的 ri-N 类一一对应 */
.rich-content p.ri-2 { padding-left: 1.5em; }
.rich-content p.ri-3 { padding-left: 3em; }
.rich-content p.ri-4 { padding-left: 4.5em; }

.rich-content h1, .rich-content h2, .rich-content h3,
.rich-content h4, .rich-content h5, .rich-content h6 {
  margin: 22px 0 12px; line-height: 1.45; font-weight: 700; letter-spacing: -.01em;
}
.rich-content h1 { font-size: 21px; }
.rich-content h2 { font-size: 18.5px; }
.rich-content h3 { font-size: 16.5px; }
.rich-content h4 { font-size: 15.5px; }
.rich-content h5, .rich-content h6 { font-size: 14.5px; color: var(--c-text-2); }
/* 大标题下的细分隔线，让长文档读起来有节奏 */
.rich-content h1, .rich-content h2 { border-bottom: 1px solid var(--c-border-2); padding-bottom: 8px; }

.rich-content ul, .rich-content ol { margin: 0 0 12px; padding-left: 1.6em; }
.rich-content li { margin: 4px 0; }
.rich-content li > ul, .rich-content li > ol { margin: 4px 0 0; }
.rich-content ul { list-style: disc; }
.rich-content ul ul { list-style: circle; }
.rich-content ol { list-style: decimal; }

.rich-content blockquote {
  margin: 14px 0; padding: 10px 16px;
  border-left: 3px solid var(--c-primary);
  background: var(--c-surface-2);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
  color: var(--c-text-2);
}
.rich-content blockquote > *:last-child { margin-bottom: 0; }

.rich-content pre {
  margin: 14px 0; padding: 14px 16px;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  overflow-x: auto;
  font-size: 13px; line-height: 1.7;
}
.rich-content code {
  font-family: var(--ff-mono);
  font-size: .92em;
  background: var(--c-surface-2);
  border: 1px solid var(--c-border-2);
  border-radius: 5px;
  padding: 1px 5px;
}
.rich-content pre code { background: none; border: 0; padding: 0; font-size: 13px; }

.rich-content hr { margin: 22px 0; border: 0; border-top: 1px solid var(--c-border); }

.rich-content a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 2px; }
.rich-content a:hover { text-decoration: none; }

/* ---- 中文制度文档的编号层级：靠左侧竖线 + 浅底做出「章节」的块感 ----
   纯文字排版的长制度（奖惩规定、管理人员岗位制度）最缺的就是层次：
   一屏全是同字号灰字，读者分不清哪句是标题、哪句是解释。
   现在 h2/h3/h4 各自带一条左侧色带，视觉上把文档切成若干块。 */
.rich-content h2 {
  padding: 6px 0 6px 12px;
  border-left: 3px solid var(--c-primary);
  background: linear-gradient(to right, var(--c-primary-l), transparent 70%);
  border-radius: 0 var(--r-sm) var(--r-sm) 0;
}
.rich-content h3 {
  padding: 4px 0 4px 11px;
  border-left: 3px solid color-mix(in srgb, var(--c-primary) 62%, transparent);
}
.rich-content h4 {
  padding-left: 10px;
  border-left: 2px solid var(--c-border);
  color: var(--c-text-2);
}
/* 标题之后紧跟的第一个段落：去掉上边距，标题和它的正文贴成一个块 */
.rich-content h2 + p, .rich-content h3 + p, .rich-content h4 + p { margin-top: 0; }
/* 标题前面不留过多空白：连着几个标题时不会拉出大片空隙 */
.rich-content > * + h2, .rich-content > * + h3, .rich-content > * + h4 { margin-top: 20px; }
/* 有序列表：制度里的 1..10 条，用浏览器自动编号，数字与正文间距固定 */
.rich-content ol > li { margin: 6px 0; padding-left: 4px; }
.rich-content ol { margin: 4px 0 14px; }


.rich-content img { max-width: 100%; height: auto; border-radius: var(--r-sm); margin: 10px 0; }

/* 表格：窄屏必须能横向滚动 —— 制度条款里的表格常常七八列。
   外壳由 Rich::render() 输出，不依赖 CSS 的 :has()（兼容性不够）。 */
.rich-table { overflow-x: auto; margin: 14px 0; -webkit-overflow-scrolling: touch; }
.rich-content table { width: 100%; border-collapse: collapse; margin: 0; font-size: 13.5px; }
.rich-content th, .rich-content td {
  border: 1px solid var(--c-border); padding: 8px 11px; text-align: left; vertical-align: top;
}
.rich-content th { background: var(--c-surface-2); font-weight: 650; white-space: nowrap; }
/* 隔行底色用令牌而不是 rgba(0,0,0,...)，否则深色主题下整行发黑 */
.rich-content tbody tr:nth-child(even) { background: var(--c-surface-2); }

.rich-content figure { margin: 16px 0; }
.rich-content figcaption { font-size: 12.5px; color: var(--c-muted); text-align: center; margin-top: 6px; }

.rich-content dl { margin: 0 0 12px; }
.rich-content dt { font-weight: 650; margin-top: 8px; }
.rich-content dd { margin: 2px 0 0 1.6em; }

/* ----------------------------------------------------------------------
   Quill 结构的展示兼容
   ----------------------------------------------------------------------
   列表本身已在服务端（Rich::quillLists）还原成 <ul>/<ol> 标准语义，
   这里只需要处理「缩进」与「代码块」这两个 Quill 特有的表示：

   · 缩进：Quill 用平铺的 .ql-indent-N 类表达层级，而不是嵌套列表。
     列表项用 margin-left（整体右移，marker 跟着走），
     段落用 padding-left（只推正文，保持与 ri-N 一致的观感）。
   · 代码块：Quill 输出 <div class="ql-code-block-container">，
     不是 <pre>，需要补上等宽字体与底色。
   ---------------------------------------------------------------------- */
.rich-content li.ql-indent-1 { margin-left: 1.6em; }
.rich-content li.ql-indent-2 { margin-left: 3.2em; }
.rich-content li.ql-indent-3 { margin-left: 4.8em; }
.rich-content li.ql-indent-4 { margin-left: 6.4em; }
.rich-content li.ql-indent-5 { margin-left: 8em; }
.rich-content li.ql-indent-6 { margin-left: 9.6em; }
.rich-content li.ql-indent-7 { margin-left: 11.2em; }
.rich-content li.ql-indent-8 { margin-left: 12.8em; }
.rich-content p.ql-indent-1 { padding-left: 1.6em; }
.rich-content p.ql-indent-2 { padding-left: 3.2em; }
.rich-content p.ql-indent-3 { padding-left: 4.8em; }
.rich-content p.ql-indent-4 { padding-left: 6.4em; }

.rich-content .ql-code-block-container {
  background: var(--c-surface-2);
  border: 1px solid var(--c-border);
  border-radius: var(--r);
  padding: 12px 14px;
  margin: 14px 0;
  overflow-x: auto;
  font-family: var(--ff-mono);
  font-size: 13px;
  line-height: 1.7;
}
.rich-content .ql-code-block { white-space: pre-wrap; color: var(--c-text); }

/* ======================================================================
   手机版占位与上传状态
   ----------------------------------------------------------------------
   这两个元素在桌面端必须「存在但不显示」：它们由 layout 无条件输出，
   再由 html[data-view="mobile"] 激活，避免 PHP 端到处写 if 判断。
   ====================================================================== */
.oa-tabbar { display: none; }        /* 桌面：不渲染；移动版 oa-mobile.css 里改为 grid */
.oa-main-title { display: none; }    /* 桌面：顶栏用面包屑；移动版改用标题 */

/* 上传前压缩的状态条 */
.upl-status {
  margin-top: 6px; font-size: 12.5px; color: var(--c-muted);
  display: flex; align-items: center; gap: 6px;
}
.upl-status.is-ok   { color: var(--c-ok); }
.upl-status.is-busy { color: var(--c-primary); }
.upl-status.is-err  { color: var(--c-err); }
.upl-status.is-busy::before {
  content: ''; width: 11px; height: 11px; flex: 0 0 11px;
  border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: uplSpin .7s linear infinite;
}
@keyframes uplSpin { to { transform: rotate(360deg); } }
.upl-thumb {
  width: 78px; height: 78px; object-fit: cover;
  border-radius: var(--r-sm); border: 1px solid var(--c-border);
  background: var(--c-surface-2);
}

/* 图片渐进加载：解码完成后淡入，避免大图「先白后闪」 */
img[loading="lazy"], img[decoding="async"] { background: var(--c-surface-2); }
.js-img-in { animation: imgIn .32s var(--ease) both; }
@keyframes imgIn { from { opacity: 0; } to { opacity: 1; } }

/* 顶部阅读/滚动进度条（由 oa-motion.js 注入，纯装饰，失败无副作用） */
.oa-progress {
  position: fixed; top: 0; left: 0; right: 0;
  height: 2.5px; z-index: 90;
  background: var(--c-grad);
  transform: scaleX(0); transform-origin: 0 50%;
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
  will-change: transform;
}
html[data-view="mobile"] .oa-progress { top: var(--safe-t); }

/* ------------------------------- 响应式 ------------------------------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .grid-2-1, .grid-1-2, .grid-1-3 { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .oa-side { transform: translateX(-100%); box-shadow: var(--sh-lg); }
  body.side-open .oa-side { transform: none; }
  body.side-open { overflow: hidden; }
  .oa-main { margin-left: 0; }
  .only-mobile { display: grid; }
  .only-desktop { display: none !important; }
  .oa-content { padding: 16px 15px 4px; }
  .oa-top { padding: 0 12px; gap: 6px; }
  .grid-4, .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .page-title { font-size: 18.5px; }
  .side-close { display: grid; }
}
/* ======================================================================
   富文本编辑器（Quill 2.0.3）
   ----------------------------------------------------------------------
   编辑器样式只在带编辑框的页面加载（见 View::page 的 'editor' 选项）。

   这里做的是「让 Quill 长成本站输入框的样子」：雪主题默认是 Helvetica
   字体 + #ccc 直角边框，与本设计系统的字体、圆角、描边语言都不同，
   不覆盖就会像从别的系统里抠出来的一块。

   深色主题必须单独覆盖 —— Quill 雪主题的颜色是硬编码的
   （#ccc / #444 / #fff），不跟随 CSS 变量，不处理就是「白底编辑框
   浮在深色界面上」。
   ====================================================================== */
.oa-editor-src {
  /* 原 textarea 留在表单里继续当「提交源」，但不再占据视觉位置。
     用 sr-only 式隐藏而不是 display:none —— 后者会让某些浏览器在
     表单校验时抛 "not focusable" 并静默卡住提交。 */
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.oa-editor .ql-toolbar.ql-snow {
  border: 1px solid var(--c-border);
  border-bottom: 0;
  border-radius: var(--r) var(--r) 0 0;
  background: var(--c-surface-2);
  padding: 7px 9px;
}
.oa-editor .ql-container.ql-snow {
  border: 1px solid var(--c-border);
  border-radius: 0 0 var(--r) var(--r);
  background: var(--c-surface);
  font-family: var(--ff);
  font-size: 14.5px;
}
.oa-editor .ql-editor {
  min-height: var(--ql-min-h, 220px);
  line-height: 1.8;
  padding: 14px 16px;
  color: var(--c-text);
}
.oa-editor .ql-editor.ql-blank::before {
  color: var(--c-muted);
  font-style: normal;
  left: 16px; right: 16px;
}
/* 焦点态与 .input:focus 保持同一套视觉语言 */
.oa-editor:focus-within .ql-toolbar.ql-snow,
.oa-editor:focus-within .ql-container.ql-snow { border-color: var(--c-primary); }

/* 编辑区排版与 .rich-content 对齐，做到「所见即所得」 */
.oa-editor .ql-editor h1, .oa-editor .ql-editor h2,
.oa-editor .ql-editor h3 { font-weight: 700; line-height: 1.45; margin: 16px 0 10px; }
.oa-editor .ql-editor h1 { font-size: 20px; }
.oa-editor .ql-editor h2 { font-size: 17.5px; }
.oa-editor .ql-editor h3 { font-size: 15.5px; }
.oa-editor .ql-editor p { margin: 0 0 10px; }
.oa-editor .ql-editor ul, .oa-editor .ql-editor ol { padding-left: 1.5em; margin-bottom: 10px; }
.oa-editor .ql-editor blockquote {
  border-left: 3px solid var(--c-primary);
  background: var(--c-surface-2);
  padding: 8px 14px; margin: 12px 0;
  color: var(--c-text-2);
}
.oa-editor .ql-editor pre.ql-syntax {
  background: var(--c-surface-2);
  color: var(--c-text);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}
.oa-editor .ql-editor img { max-width: 100%; border-radius: var(--r-sm); }

/* 工具栏图标（SVG）跟随主题着色 */
.oa-editor .ql-snow .ql-stroke { stroke: var(--c-text-2); }
.oa-editor .ql-snow .ql-fill  { fill: var(--c-text-2); }
.oa-editor .ql-snow .ql-picker { color: var(--c-text-2); }
.oa-editor .ql-snow .ql-picker-options {
  background: var(--c-elev);
  border-color: var(--c-border);
  border-radius: var(--r-sm);
  box-shadow: var(--sh);
}
.oa-editor .ql-snow .ql-picker-item:hover { color: var(--c-primary); }
.oa-editor .ql-snow button:hover .ql-stroke,
.oa-editor .ql-snow button.ql-active .ql-stroke { stroke: var(--c-primary); }
.oa-editor .ql-snow button:hover .ql-fill,
.oa-editor .ql-snow button.ql-active .ql-fill { fill: var(--c-primary); }

/* 链接气泡 / 提示框 */
.oa-editor .ql-snow .ql-tooltip {
  background: var(--c-elev);
  border: 1px solid var(--c-border);
  border-radius: var(--r-sm);
  box-shadow: var(--sh);
  color: var(--c-text);
  z-index: 20;
}
.oa-editor .ql-snow .ql-tooltip input[type=text] {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--r-xs);
  color: var(--c-text);
}

/* 窄屏：工具栏换行，避免横向溢出把页面撑宽 */
@media (max-width: 900px) {
  .oa-editor .ql-toolbar.ql-snow { display: flex; flex-wrap: wrap; gap: 2px; }
  .oa-editor .ql-toolbar.ql-snow .ql-formats { margin-right: 6px; }
  /* 16px 是 iOS 的防聚焦缩放阈值，小于它会触发页面自动放大 */
  .oa-editor .ql-editor { font-size: 16px; }
  .oa-editor .ql-editor { min-height: 200px; }
}

@media print {
  .oa-side, .oa-top, .oa-foot, .page-actions, .pager { display: none !important; }
  /* 打印时只留正文，工具栏与边框毫无意义 */
  .oa-editor .ql-toolbar.ql-snow { display: none !important; }
  .oa-editor .ql-container.ql-snow { border: 0; }
  .oa-main { margin-left: 0; }
  .card { box-shadow: none; border-color: #ccc; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
