/* =========================================================================
 * 工作台 · 市场技术部 — 前端样式
 * 浅色主题，主色 #2563eb，圆角 + 轻阴影，系统字体（含 Microsoft YaHei）
 * 无外部资源：无 CDN、无外链字体/图标
 * ========================================================================= */

/* ---------- 设计变量 ---------- */
:root {
  --brand: #2563eb;
  --brand-d: #1d4ed8;
  --brand-l: #eff6ff;
  --brand-l2: #dbeafe;
  --bg: #f5f7fb;
  --card: #ffffff;
  --line: #e6eaf1;
  --line-2: #eef1f6;
  --text: #111827;
  --text-2: #374151;
  --muted: #6b7280;
  --faint: #9aa3b2;
  --ok: #16a34a;
  --ok-l: #ecfdf5;
  --danger: #dc2626;
  --danger-l: #fef2f2;
  --warn: #d97706;
  --radius: 14px;
  --radius-s: 9px;
  --radius-xs: 7px;
  --shadow-s: 0 1px 2px rgba(16, 24, 40, .06);
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .07);
  --shadow-l: 0 16px 48px rgba(16, 24, 40, .18);
  --font: system-ui, -apple-system, "Segoe UI", "Microsoft YaHei", "PingFang SC",
          "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Cascadia Mono", "Liberation Mono", Menlo, "Courier New", monospace;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.modal-open { overflow: hidden; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, p { margin: 0; }
svg { width: 18px; height: 18px; display: block; flex: none; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
.grow { flex: 1 1 auto; }
.mono { font-family: var(--mono); }

/* ---------- 加载 / 空 / 错误状态 ---------- */
.boot, .state {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  padding: 56px 18px; color: var(--muted); text-align: center; flex-direction: column;
}
.boot { min-height: 60vh; }
.state .state-ico { color: var(--faint); }
.state .state-ico svg { width: 34px; height: 34px; }
.state .state-t { font-size: 15px; color: var(--text-2); font-weight: 600; }
.state .state-s { font-size: 13px; color: var(--muted); max-width: 420px; }
.state .state-act { margin-top: 6px; }
.spin {
  width: 16px; height: 16px; border-radius: 50%; flex: none;
  border: 2px solid var(--brand-l2); border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 36px; padding: 0 13px; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: #fff; color: var(--text-2); font-size: 13px; font-weight: 500;
  transition: background .14s, border-color .14s, color .14s, box-shadow .14s;
  white-space: nowrap;
}
.btn:hover { background: #f8fafc; border-color: #d8dfea; color: var(--text); }
.btn:active { transform: translateY(.5px); }
.btn:disabled { opacity: .55; cursor: default; transform: none; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: var(--shadow-s); }
.btn.primary:hover { background: var(--brand-d); border-color: var(--brand-d); color: #fff; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover { background: #eef2f7; color: var(--text-2); }
.btn.danger { color: var(--danger); border-color: #f0cdcd; }
.btn.danger:hover { background: var(--danger-l); border-color: #e9b9b9; }
.btn.lg { height: 42px; padding: 0 18px; font-size: 14px; }
.btn.sm { height: 30px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; justify-content: center; }
.btn svg { width: 16px; height: 16px; }

.mini {
  height: 27px; padding: 0 9px; cursor: pointer;
  border: 1px solid var(--line); border-radius: 6px; background: #fff;
  color: var(--text-2); font-size: 12.5px; transition: background .13s, border-color .13s, color .13s;
}
.mini:hover { background: var(--brand-l); border-color: var(--brand-l2); color: var(--brand-d); }
.mini.danger { color: var(--danger); }
.mini.danger:hover { background: var(--danger-l); border-color: #f0cdcd; color: var(--danger); }

.icon-btn {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; cursor: pointer; border-radius: 8px; color: var(--muted);
}
.icon-btn:hover { background: #eef2f7; color: var(--text-2); }

/* ---------- 表单 ---------- */
.input {
  width: 100%; height: 36px; padding: 0 11px;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  background: #fff; color: var(--text); font-size: 13.5px; font-family: inherit;
  transition: border-color .14s, box-shadow .14s;
}
.input:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
textarea.input { height: auto; padding: 9px 11px; line-height: 1.6; resize: vertical; }
.field { display: block; margin-bottom: 13px; }
.field-label { display: block; margin-bottom: 5px; font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.field-help { display: block; margin-top: 5px; font-size: 12px; color: var(--muted); }
.form-hint { margin-top: 2px; font-size: 12.5px; color: var(--muted); line-height: 1.6; }
.form-err {
  margin-top: 10px; padding: 8px 11px; border-radius: var(--radius-xs);
  background: var(--danger-l); color: var(--danger); font-size: 12.5px; border: 1px solid #f3cdcd;
}
.form-row { display: flex; gap: 10px; flex-wrap: wrap; }
.form-row > .field { flex: 1 1 150px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
  background:
    radial-gradient(900px 420px at 12% -10%, #e8efff 0%, rgba(232, 239, 255, 0) 62%),
    radial-gradient(760px 380px at 100% 0%, #eaf6ff 0%, rgba(234, 246, 255, 0) 58%),
    var(--bg);
}
.login-card {
  width: 100%; max-width: 384px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 30px 28px 22px;
}
.login-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.login-brand h1 { font-size: 19px; font-weight: 700; letter-spacing: .5px; }
.login-brand p { font-size: 12.5px; color: var(--muted); }
.brand-logo {
  width: 38px; height: 38px; border-radius: 11px; flex: none;
  background: linear-gradient(140deg, #3b82f6, var(--brand-d));
  color: #fff; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .28);
}
.brand-logo svg { width: 22px; height: 22px; }
.brand-logo.lg { width: 46px; height: 46px; border-radius: 13px; }
.brand-logo.lg svg { width: 26px; height: 26px; }
.login-err {
  margin: 0 0 13px; padding: 9px 12px; border-radius: var(--radius-xs);
  background: var(--danger-l); border: 1px solid #f3cdcd; color: var(--danger); font-size: 12.5px;
}
.login-form .btn.lg { margin-top: 4px; }
.login-foot { margin-top: 20px; padding-top: 14px; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--faint); text-align: center; }

/* ---------- 主框架 ---------- */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.topbar {
  height: 58px; flex: none; display: flex; align-items: center; gap: 14px;
  padding: 0 18px; background: #fff; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; color: inherit; }
.brand:hover { text-decoration: none; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-txt b { font-size: 15px; letter-spacing: .4px; }
.brand-txt i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.top-right { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.who { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--text-2); }
.who-name { font-weight: 600; }
.badge {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  background: #eef2f7; color: var(--muted); border: 1px solid var(--line);
}
.badge.admin { background: var(--brand-l); color: var(--brand-d); border-color: var(--brand-l2); }

.body { flex: 1; display: flex; align-items: stretch; min-height: 0; }
.sidebar {
  width: 208px; flex: none; padding: 16px 12px;
  border-right: 1px solid var(--line); background: #fff;
  display: flex; flex-direction: column; gap: 18px;
  position: sticky; top: 58px; align-self: flex-start; height: calc(100vh - 58px);
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 9px 11px;
  border-radius: var(--radius-s); color: var(--text-2); font-size: 13.5px; font-weight: 500;
}
.nav-item:hover { background: #f4f7fb; text-decoration: none; color: var(--text); }
.nav-item.on { background: var(--brand-l); color: var(--brand-d); }
.nav-item.on svg { color: var(--brand); }
.nav-item svg { color: var(--faint); }
.side-title { padding: 0 11px 7px; font-size: 11.5px; color: var(--faint); letter-spacing: .6px; }
.side-spaces { display: flex; flex-direction: column; gap: 3px; }
.space-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 11px; border-radius: var(--radius-s);
  font-size: 13px; color: var(--text-2);
}
.space-item:hover { background: #f4f7fb; text-decoration: none; }
.space-item.on { background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
.space-item .dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; flex: none; }
.space-item.on .dot { background: var(--brand); }
.space-item span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-foot { margin-top: auto; padding: 10px 11px 0; border-top: 1px solid var(--line-2); font-size: 12px; color: var(--faint); }
.main { flex: 1; min-width: 0; padding: 18px 22px 44px; }

/* ---------- 视图头部 ---------- */
.view-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 13px; }
.view-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.view-sub { font-size: 12.5px; color: var(--muted); }
.toolbar { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.spaces { display: flex; gap: 6px; flex-wrap: wrap; }
.space-tab {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 13px;
}
.space-tab:hover { background: #f8fafc; text-decoration: none; }
.space-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }

/* ---------- 面包屑 ---------- */
.crumbs {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  margin-bottom: 11px; font-size: 13px; color: var(--muted);
}
.crumbs .c-sep { color: var(--faint); }
.crumbs a { color: var(--text-2); padding: 3px 6px; border-radius: 6px; }
.crumbs a:hover { background: #eef2f7; text-decoration: none; }
.crumbs .c-now { color: var(--text); font-weight: 600; padding: 3px 6px; }

/* ---------- 列表面板 ---------- */
.panel {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s); overflow: hidden; position: relative;
}
.panel.drop-on { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .14); }
.dz-tip {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px; font-size: 12.5px; color: var(--faint); border-top: 1px dashed var(--line);
}
.dz-tip svg { width: 15px; height: 15px; }
.drop-veil {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  background: rgba(239, 246, 255, .93); border: 2px dashed var(--brand);
  border-radius: var(--radius); color: var(--brand-d); font-weight: 600; font-size: 14px; pointer-events: none;
}

.ftable { width: 100%; border-collapse: separate; border-spacing: 0; }
.ftable th {
  text-align: left; font-size: 12px; font-weight: 600; color: var(--muted);
  padding: 10px 12px; background: #fbfcfe; border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.ftable td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.ftable tbody tr:hover { background: var(--brand-l); }
.ftable tbody tr:hover .fname { color: var(--brand-d); }
.ftable tbody tr:last-child td { border-bottom: 0; }
.ftable .c-size, .ftable .c-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.ftable .c-act { width: 1%; white-space: nowrap; text-align: right; }
.c-name { display: flex; align-items: center; gap: 9px; min-width: 0; }
.fi { display: flex; align-items: center; justify-content: center; flex: none; }
.fi svg { width: 19px; height: 19px; }
.fi.k-dir { color: #3b82f6; }
.fi.k-text { color: #0ea5e9; }
.fi.k-image { color: #16a34a; }
.fi.k-pdf { color: #dc2626; }
.fi.k-other { color: #94a3b8; }
.fname {
  color: var(--text); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis;
  white-space: nowrap; max-width: 46ch;
}
.fname.dir { font-weight: 600; }
.tag {
  padding: 1px 6px; border-radius: 5px; font-size: 11px; flex: none;
  background: #f1f5f9; color: var(--muted); border: 1px solid var(--line);
}
.tag.t-dir { background: var(--brand-l); color: var(--brand-d); border-color: var(--brand-l2); }
.acts { display: inline-flex; gap: 5px; flex-wrap: nowrap; justify-content: flex-end; }
/* M4c：行内「更多」折叠（删除藏在这里面；[hidden] 撤回后优先级更高） */
.acts-more { display: inline-flex; gap: 5px; }
.acts-more[hidden] { display: none; }
/* M5a：常驻详情窗里的「待选」提示位 */
.m2-pane-empty { padding: 46px 20px; text-align: center; color: var(--muted); }
.m2-pane-empty-t { font-size: 14px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.m2-pane-empty-s { font-size: 12.5px; line-height: 1.75; }

/* ---------- 上传进度 ---------- */
.upbanner {
  position: fixed; left: 50%; transform: translateX(-50%); top: 68px; z-index: 70;
  width: min(440px, calc(100vw - 28px)); padding: 11px 14px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-l);
}
.upbanner.out { opacity: 0; transition: opacity .22s; }
.upbanner-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--text-2); }
.upbanner-row .up-pct { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.up-track { margin-top: 9px; height: 6px; border-radius: 999px; background: #eef2f7; overflow: hidden; }
.up-bar { height: 100%; width: 0; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, var(--brand)); transition: width .18s ease; }

/* ---------- Toast ---------- */
.toasts { position: fixed; top: 70px; right: 16px; z-index: 90; display: flex; flex-direction: column; gap: 9px; max-width: min(360px, calc(100vw - 28px)); }
.toast {
  display: flex; align-items: flex-start; gap: 9px; padding: 10px 13px;
  background: #fff; border: 1px solid var(--line); border-left: 4px solid var(--brand);
  border-radius: var(--radius-s); box-shadow: var(--shadow); font-size: 13px; color: var(--text-2);
  animation: toastIn .22s ease;
}
.toast.ok { border-left-color: var(--ok); }
.toast.err { border-left-color: var(--danger); }
.toast .ti { flex: none; margin-top: 1px; color: var(--brand); }
.toast.ok .ti { color: var(--ok); }
.toast.err .ti { color: var(--danger); }
.toast.out { opacity: 0; transform: translateX(10px); transition: opacity .24s, transform .24s; }
@keyframes toastIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }

/* ---------- 弹窗 ---------- */
.modal-root {
  position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center;
  padding: 18px; background: rgba(15, 23, 42, .46); animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff; border-radius: var(--radius); width: 100%; max-width: 460px;
  max-height: min(90vh, 900px); display: flex; flex-direction: column;
  box-shadow: var(--shadow-l); overflow: hidden; animation: modalIn .18s ease;
}
.modal.lg { max-width: 1080px; }
.modal.md { max-width: 660px; }
@keyframes modalIn { from { opacity: 0; transform: translateY(8px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; gap: 10px; padding: 13px 16px;
  border-bottom: 1px solid var(--line); flex: none;
}
.mh-t { font-size: 14.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mh-s { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.modal-head .icon-btn { margin-left: auto; }
.modal-body { padding: 16px; overflow: auto; flex: 1 1 auto; min-height: 0; }
.modal-foot {
  display: flex; align-items: center; gap: 9px; padding: 12px 16px;
  border-top: 1px solid var(--line); background: #fcfdfe; flex: none; flex-wrap: wrap;
}
.modal-foot .hint { font-size: 12px; color: var(--muted); }

/* 编辑器弹窗 */
.modal-body.split { display: flex; gap: 14px; align-items: stretch; padding: 14px; }
.editor-col { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 9px; }
.editor {
  width: 100%; min-height: 46vh; flex: 1 1 auto; resize: vertical;
  font-family: var(--mono); font-size: 13px; line-height: 1.65;
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-s);
  background: #fcfdff; color: var(--text);
}
.editor:focus { outline: 0; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .12); }
.editor.dirty { border-color: #f0c9a8; background: #fffaf5; }
.ver-col { width: 224px; flex: none; border-left: 1px solid var(--line-2); padding-left: 13px; display: flex; flex-direction: column; }
.ver-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.ver-list { overflow: auto; flex: 1 1 auto; display: flex; flex-direction: column; gap: 5px; max-height: 52vh; }
.ver-item {
  display: block; width: 100%; text-align: left; cursor: pointer;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: var(--radius-xs); background: #fff;
}
.ver-item:hover { background: var(--brand-l); border-color: var(--brand-l2); }
.ver-item.on { background: var(--brand-l); border-color: var(--brand); }
.ver-item .v-t { font-size: 12.5px; color: var(--text-2); }
.ver-item .v-s { font-size: 11.5px; color: var(--muted); }
.ver-empty { font-size: 12.5px; color: var(--faint); padding: 8px 0; }
.ver-preview { border: 1px solid var(--brand-l2); background: var(--brand-l); border-radius: var(--radius-s); padding: 10px; }
.vp-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: var(--brand-d); margin-bottom: 8px; }
.vp-content {
  margin: 0; padding: 10px; max-height: 40vh; overflow: auto; background: #fff;
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  font-family: var(--mono); font-size: 12.5px; white-space: pre-wrap; word-break: break-word;
}
.img-prev {
  display: block; max-width: 100%; max-height: 66vh; margin: 0 auto;
  border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff;
}
.pdf-prev { width: 100%; height: 70vh; border: 1px solid var(--line); border-radius: var(--radius-s); background: #fff; }
.info-list { display: grid; grid-template-columns: 82px 1fr; gap: 7px 12px; font-size: 13px; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; color: var(--text-2); word-break: break-all; }

/* 分享结果 / 链接行 */
.link-row { display: flex; gap: 8px; align-items: center; }
.link-row .input { font-family: var(--mono); font-size: 12.5px; }
.ok-note {
  display: flex; gap: 9px; align-items: flex-start; margin-bottom: 12px;
  padding: 10px 12px; border-radius: var(--radius-xs);
  background: var(--ok-l); border: 1px solid #c8e9d5; color: #14663a; font-size: 13px;
}
.ok-note svg { width: 17px; height: 17px; margin-top: 1px; }

/* 表格单元格内的次要信息 */
.cell-2 { font-size: 12.5px; color: var(--muted); }
.chip {
  display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11.5px;
  background: #f1f5f9; color: var(--text-2); border: 1px solid var(--line);
}
.chip.warn { background: #fff7ed; color: var(--warn); border-color: #f6dcb8; }
.chip.gray { color: var(--faint); }
.row-warn { color: var(--warn); }

/* 成员表单卡 */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-s); padding: 16px; margin-bottom: 15px;
}
.card-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.noscript { padding: 24px; text-align: center; color: var(--danger); }

/* ---------- 移动端 ---------- */
/* 注：2026-09-23 起侧栏/顶栏的断点规则统一挪到文件末尾「导航层 + 响应式」一节
   （照抄飞书断点：≥1024 全侧栏 / 600–1023 图标条 / <600 抽屉 + 底部 tab 条），
   原来这里的 ≤860 侧栏横排规则已删除，避免与新的三段断点打架。 */
@media (max-width: 700px) {
  .ftable .c-size, .ftable .c-time { display: none; }
  .ftable td, .ftable th { padding: 9px 10px; }
  .fname { max-width: 34vw; }
  /* 操作区：窄屏两列换行，按钮更紧凑，避免整列竖排把行撑高 */
  .ftable .c-act { width: 130px; }
  .acts { flex-wrap: wrap; gap: 4px; max-width: 130px; }
  .mini { height: 26px; padding: 0 8px; font-size: 12px; }
  .toolbar { width: 100%; margin-left: 0; }
  .toolbar .btn { flex: 1 1 auto; justify-content: center; }
  .modal-body.split { flex-direction: column; }
  .ver-col { width: auto; border-left: 0; border-top: 1px solid var(--line-2); padding: 11px 0 0; }
  .ver-list { max-height: 30vh; }
  .editor { min-height: 34vh; }
  .pdf-prev { height: 56vh; }
  .toasts { top: auto; bottom: 14px; right: 12px; left: 12px; max-width: none; }
  .upbanner { top: auto; bottom: 14px; }
  .login-card { padding: 24px 20px 18px; }
}

/* ---------- Office 在线编辑 ---------- */
.office-body { padding: 0; height: min(74vh, 840px); }
.office-frame { width: 100%; height: 100%; background: #fff; }
.office-frame iframe { width: 100% !important; height: 100% !important; border: 0; }
.office-loading { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); font-size: 14px; }

/* ---------- 弹窗增强：最大化 / 拖拽调整大小（2026-09-22 加） ---------- */
.modal { position: relative; }
.modal.max { width: 100%; max-width: none; height: 100%; max-height: none; }
.modal.sized { max-width: none; max-height: none; }
.m-maxbtn { flex: none; }
/* 拖标题栏移动窗口（像桌面软件一样挪弹窗） */
.modal-head.m-drag { cursor: move; touch-action: none; }
.modal-head.m-drag button, .modal-head.m-drag a, .modal-head.m-drag input, .modal-head.m-drag select, .modal-head.m-drag label { cursor: pointer; }
.modal.dragging { animation: none !important; }
.modal.dragging .modal-head.m-drag { cursor: grabbing; }
.modal.dragging, .modal.dragging * { user-select: none !important; -webkit-user-select: none !important; }
.modal-grip { position: absolute; right: 0; bottom: 0; width: 22px; height: 22px; cursor: nwse-resize; z-index: 6; touch-action: none; }
.modal-grip::before { content: ""; position: absolute; right: 3px; bottom: 3px; width: 12px; height: 12px; opacity: .7;
  background: linear-gradient(135deg, transparent 0 40%, var(--faint) 40% 55%, transparent 55% 66%, var(--faint) 66% 81%, transparent 81%); }
.modal-grip:hover::before { opacity: 1;
  background: linear-gradient(135deg, transparent 0 40%, var(--brand) 40% 55%, transparent 55% 66%, var(--brand) 66% 81%, transparent 81%); }
.modal-body.viewer-body { display: flex; flex-direction: column; }
.modal-body.viewer-body .pdf-prev { flex: 1 1 auto; }
.modal.max .modal-body.viewer-body .pdf-prev, .modal.sized .modal-body.viewer-body .pdf-prev { height: auto; min-height: 0; }
.modal.max .img-prev, .modal.sized .img-prev { max-width: 100%; max-height: calc(100vh - 150px); }
.modal.max .editor, .modal.sized .editor { min-height: 0; }
.modal.max .office-body, .modal.sized .office-body { height: auto; }

/* =========================================================================
 * 导航层 + 响应式（2026-09-23 · 设计文档 19 §15 施工顺序 §1-2）
 * 内容：顶栏全局搜索（内联下拉）/ 面包屑 / ＋新建下拉 / 侧栏分组 /
 *       断点（照抄飞书）：≥1024 全侧栏 · 600–1023 图标条 · <600 抽屉 + 底部 tab 条
 * 无外部资源；数据文本一律由 app.js 的 esc() 转义
 * ========================================================================= */

/* ---------- 顶栏：全局搜索 ---------- */
.gsearch { position: relative; flex: none; width: 300px; height: 34px; display: flex; align-items: center; }
.gs-btn {
  position: absolute; left: 3px; top: 3px; width: 28px; height: 28px; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 7px; color: var(--faint); cursor: pointer;
}
.gs-btn:hover { background: #eef2f7; color: var(--text-2); }
.gs-btn svg { width: 16px; height: 16px; }
.gs-input {
  width: 100%; height: 34px; padding: 0 32px 0 34px;
  border: 1px solid var(--line); border-radius: 999px; background: #f7f9fc;
  color: var(--text); font-size: 13px; font-family: inherit;
  transition: background .14s, border-color .14s, box-shadow .14s;
}
.gs-input::placeholder { color: var(--faint); }
.gs-input:focus { outline: 0; background: #fff; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(37, 99, 235, .13); }
.gs-x {
  position: absolute; right: 3px; top: 3px; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 50%; color: var(--faint); cursor: pointer;
}
.gs-x:hover { background: #eef2f7; color: var(--text-2); }
.gs-x svg { width: 14px; height: 14px; }

.gs-panel {
  position: absolute; left: 0; top: calc(100% + 7px); z-index: 46;
  width: 420px; max-width: min(560px, 92vw); max-height: min(66vh, 520px); overflow: auto;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-l); padding: 6px;
}
.gs-grp { padding: 7px 9px 4px; font-size: 11.5px; color: var(--faint); letter-spacing: .5px; }
.gs-grp i, .gs-grp b { font-style: normal; font-weight: 400; }
.gs-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 7px 9px; border: 0; border-radius: var(--radius-xs); background: transparent;
  font: inherit; color: var(--text); cursor: pointer;
}
.gs-item:hover, .gs-item.on { background: var(--brand-l); }
.gs-item.on { box-shadow: inset 0 0 0 1px var(--brand-l2); }
.gs-ico {
  flex: none; width: 22px; display: flex; align-items: center; justify-content: center;
  color: var(--faint); font-size: 15px; line-height: 1;
}
.gs-ico.fi svg { width: 17px; height: 17px; }
.gs-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.gs-t { font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-s { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gs-meta { flex: none; display: flex; align-items: center; gap: 6px; }
.gs-tag {
  font-size: 11.5px; color: var(--text-2); background: #f1f5f9;
  border: 1px solid var(--line); border-radius: 999px; padding: 1px 7px; white-space: nowrap;
}
.gs-d { font-size: 11.5px; color: var(--faint); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gs-msg { display: flex; align-items: center; gap: 8px; padding: 10px; font-size: 12.5px; color: var(--muted); }
.gs-more { padding: 7px 10px 3px; font-size: 12px; color: var(--faint); border-top: 1px dashed var(--line); margin-top: 4px; }
.gs-foot { padding: 8px 10px 4px; margin-top: 4px; border-top: 1px solid var(--line-2); font-size: 11.5px; color: var(--faint); }

/* ---------- 顶栏：面包屑 ---------- */
.crumbs-bar {
  display: flex; align-items: center; gap: 3px; min-width: 0; flex: 0 1 auto;
  font-size: 12.5px; color: var(--muted); overflow: hidden; white-space: nowrap;
}
.crumbs-bar .c-sep { color: var(--faint); flex: none; }
.crumbs-bar a { color: var(--text-2); padding: 2px 6px; border-radius: 6px; flex: none; }
.crumbs-bar a:hover { background: #eef2f7; text-decoration: none; }
.crumbs-bar .c-grp { padding: 2px 4px; color: var(--faint); flex: none; }
.crumbs-bar .c-now {
  padding: 2px 6px; color: var(--text); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; max-width: 28ch;
}
.crumbs-bar:empty { display: none; }

/* ---------- 顶栏：＋新建 ---------- */
.newmenu { position: relative; flex: none; }
.newmenu-pop {
  position: absolute; right: 0; top: calc(100% + 7px); z-index: 46; width: 240px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-l); padding: 6px;
}
.newmenu-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 8px 9px; border: 0; border-radius: var(--radius-xs); background: transparent;
  font: inherit; color: var(--text-2); cursor: pointer;
}
.newmenu-item:hover { background: var(--brand-l); color: var(--brand-d); }
.newmenu-item svg { color: var(--faint); }
.newmenu-item > span { display: flex; flex-direction: column; line-height: 1.35; }
.newmenu-item em { font-style: normal; font-size: 11.5px; color: var(--muted); }

/* ---------- 侧栏：分组标题 / 分隔线 / 系统组收起 ---------- */
.nav-sep { height: 1px; background: var(--line-2); margin: 8px 6px; flex: none; }
.nav-group-title {
  display: flex; align-items: center; gap: 4px; width: 100%; text-align: left;
  padding: 2px 11px 4px; font-size: 11.5px; color: var(--faint); letter-spacing: .6px;
  border: 0; background: transparent; font-family: inherit;
}
button.nav-group-title { cursor: pointer; }
button.nav-group-title:hover { color: var(--text-2); }
.nav-group-title svg { width: 13px; height: 13px; margin-left: auto; transition: transform .15s; }
.nav-group-title.collapsed svg { transform: rotate(-90deg); }
.nav-sub { display: flex; flex-direction: column; gap: 3px; }
.nav-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 移动端：汉堡按钮 / 抽屉背景 / 底部 tab 条 /「我」面板 ---------- */
.nav-hamb { display: none; flex: none; }
.nav-backdrop { display: none; }
.tabbar { display: none; }
.mine-sheet {
  position: fixed; inset: 0; z-index: 76; display: flex; align-items: flex-end;
  background: rgba(15, 23, 42, .38);
}
.mine-card {
  width: 100%; max-width: 520px; margin: 0 auto; background: #fff;
  border-radius: 16px 16px 0 0; box-shadow: var(--shadow-l);
  padding: 14px 14px calc(12px + env(safe-area-inset-bottom, 0px));
}
.mine-head { display: flex; align-items: center; gap: 11px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.mine-ava {
  width: 38px; height: 38px; flex: none; border-radius: 50%; color: #fff; font-weight: 600;
  background: linear-gradient(140deg, #3b82f6, var(--brand-d));
  display: flex; align-items: center; justify-content: center;
}
.mine-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mine-name { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-head .icon-btn { margin-left: auto; }
.mine-list { display: flex; flex-direction: column; gap: 2px; padding-top: 8px; }
.mine-item {
  display: flex; align-items: center; gap: 9px; width: 100%; text-align: left;
  padding: 11px 10px; border: 0; border-radius: var(--radius-s); background: transparent;
  font: inherit; font-size: 13.5px; color: var(--text-2); cursor: pointer;
}
.mine-item:hover { background: #f4f7fb; text-decoration: none; color: var(--text); }
.mine-item svg { color: var(--faint); }
.mine-item.danger { color: var(--danger); }
.mine-item.danger:hover { background: var(--danger-l); }
.mine-item.danger svg { color: var(--danger); }

/* ---------- 断点 1：≤1023（顶栏收紧，面包屑让位） ---------- */
@media (max-width: 1023px) {
  .main { padding: 14px 16px 40px; }
  .topbar { padding: 0 12px; gap: 10px; }
  .brand-txt i { display: none; }
  .who-name { max-width: 84px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .gsearch { width: 210px; }
  .crumbs-bar { display: none; }
}

/* ---------- 断点 2：600–1023 侧栏收成图标条（hover 展开名称；组标题隐藏） ---------- */
@media (min-width: 600px) and (max-width: 1023px) {
  .sidebar { width: 64px; padding: 14px 8px; gap: 12px; }
  .sidebar .nav { gap: 2px; }
  .sidebar .nav-t, .sidebar .side-title, .sidebar .side-foot { display: none; }
  .sidebar .nav-sep { margin: 7px 10px; }
  .sidebar .nav-group-title { display: none; }
  .sidebar .nav-sub { display: flex !important; }          /* 图标条不做组折叠，避免入口消失 */
  .sidebar .nav-item, .sidebar .space-item { justify-content: center; padding: 9px 0; gap: 0; }
  .sidebar .side-spaces { display: none; }                 /* 空间入口改由文件页的空间标签进入 */
  /* hover 展开：浮层形式，不挤压正文 */
  .sidebar:hover .nav {
    position: absolute; left: 8px; top: 12px; width: 196px; z-index: 27;
    background: #fff; border: 1px solid var(--line); border-radius: var(--radius-s);
    box-shadow: var(--shadow); padding: 8px;
  }
  .sidebar:hover .nav-t { display: block; }
  .sidebar:hover .nav-group-title { display: flex; }
  .sidebar:hover .nav-item { justify-content: flex-start; padding: 8px 11px; gap: 9px; }
}

/* ---------- 断点 3：<600 侧栏变抽屉 + 底部 tab 条 ---------- */
@media (max-width: 599px) {
  .main { padding: 12px 12px calc(74px + env(safe-area-inset-bottom, 0px)); }
  .topbar { padding: 0 10px; gap: 8px; }
  .nav-hamb { display: inline-flex; }
  .brand-txt { display: none; }
  .brand-logo { width: 32px; height: 32px; border-radius: 9px; }
  .brand-logo svg { width: 19px; height: 19px; }
  .who, #btnLogout { display: none; }   /* 退出/账号移到「我」面板 */
  .crumbs-bar { display: none; }

  /* 搜索：默认只剩放大镜，点击展开为全宽搜索层 */
  .gsearch { width: auto; }
  .gsearch .gs-btn { position: static; width: 34px; height: 34px; }
  .gsearch .gs-input, .gsearch .gs-x { display: none; }
  .gsearch.open {
    position: absolute; left: 8px; right: 8px; top: 12px; width: auto; z-index: 47;
    background: #fff;
  }
  .gsearch.open .gs-btn { display: none; }
  .gsearch.open .gs-input { display: block; padding-left: 12px; }
  .gsearch.open .gs-x { display: flex; }
  .gsearch.open .gs-panel { left: 0; right: 0; width: auto; max-width: none; }

  /* ＋新建下拉：窄屏贴边 */
  .newmenu-pop { position: fixed; left: 10px; right: 10px; top: 62px; width: auto; }

  /* 侧栏 = 抽屉（汉堡控制） */
  .body { flex-direction: column; }
  .nav-backdrop {
    display: block; position: fixed; left: 0; right: 0; top: 58px; bottom: 0;
    z-index: 38; background: rgba(15, 23, 42, .4);
  }
  .sidebar {
    position: fixed; left: 0; top: 58px; bottom: 0; width: 252px; height: auto;
    align-self: auto; z-index: 40; padding: 14px 12px 26px;
    border-right: 1px solid var(--line); border-bottom: 0; overflow-y: auto;
    transform: translateX(-103%); transition: transform .2s ease;
  }
  .sidebar.open { transform: none; box-shadow: var(--shadow-l); }

  /* 底部 tab 条（5 项：今天 / 任务 / 日程 / 记一句 / 我） */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; height: 58px;
    background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .tab-item {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; padding: 0 2px; border: 0; background: transparent; cursor: pointer;
    color: var(--muted); font: inherit; font-size: 11px; line-height: 1.2;
  }
  .tab-item:hover { text-decoration: none; }
  .tab-item svg { width: 20px; height: 20px; }
  .tab-item span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tab-item.on { color: var(--brand); font-weight: 600; }

  /* 小屏不横向溢出：表格必要时在面板内横向滚动 */
  .panel { overflow-x: auto; }
  .panel > .ftable { min-width: 460px; }
  .toasts { top: auto; bottom: 68px; right: 12px; left: 12px; max-width: none; }
  .upbanner { top: auto; bottom: 68px; }
}

/* 历史版本浮层（Office 文档同样可用：列表/下载/恢复） */
.vov { position: fixed; inset: 0; background: rgba(15, 23, 42, .42); z-index: 4200; display: flex; align-items: center; justify-content: center; }
.vov-box { width: min(560px, 94vw); max-height: 78vh; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 48px rgba(15, 23, 42, .28); overflow: hidden; }
.vov-head { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); }
.vov-body { overflow: auto; padding: 8px 10px; }
.vov-row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-s); }
.vov-row:hover { background: var(--brand-l); }
.vov-t { flex: 1 1 auto; font-size: 12.5px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.vov-s { font-size: 11.5px; color: var(--muted); min-width: 62px; text-align: right; }
.vov-foot { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line-2); }
.vov-foot .hint { font-size: 11.5px; color: var(--faint); }

/* M3h：停用的成员行（灰一点，但整行还在，方便随时恢复） */
.ftable tr.row-off { opacity: .55; }
.ftable tr.row-off .fname { text-decoration: line-through; }

/* =========================================================================
 * 前端打磨（2026-09-24 追加 · style.css）
 * 内容：① 深色模式 ② 空状态引导样式 ③ 手机端手感 ④ 深色切换按钮
 * 原则：本节全部是「追加覆盖」，不改动上方任何一行原有规则；
 *       浅色模式一行都不受影响（深色规则一律带 html[data-theme="dark"] 或
 *       @media (prefers-color-scheme: dark) 前缀）。
 * 深色两处同源（取值保持一致，改色请一起改）：
 *   A. @media (prefers-color-scheme: dark) → 跟随系统（脚本没跑也生效）
 *   B. html[data-theme="dark"]            → 手动切换（m2polish.js 写入 localStorage: wb-theme）
 *   m2polish.js 在「未手动选择」时会把系统偏好镜像成 B，细节覆盖因此也一起生效。
 * ========================================================================= */

/* ---------- ① A/B 核心调色板（背景/卡片/文字/边框/主色/阴影） ---------- */
html[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f141b;
  --card: #171e28;
  --line: #2a3442;
  --line-2: #212a36;
  --line-3: #3a4a63;
  --text: #e9eef5;
  --text-2: #ccd6e2;
  --muted: #9fabbd;
  --faint: #8b98ab;
  --brand: #4d8dff;
  --brand-d: #9ec2ff;
  --brand-l: #1a2740;
  --brand-l2: #27406b;
  --ok: #4ade80;
  --ok-l: #13291d;
  --danger: #f87171;
  --danger-l: #3a1e1f;
  --warn: #fbbf24;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .5);
  --shadow-l: 0 16px 48px rgba(0, 0, 0, .62);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
  color-scheme: dark;
  --bg: #0f141b;
  --card: #171e28;
  --line: #2a3442;
  --line-2: #212a36;
  --line-3: #3a4a63;
  --text: #e9eef5;
  --text-2: #ccd6e2;
  --muted: #9fabbd;
  --faint: #8b98ab;
  --brand: #4d8dff;
  --brand-d: #9ec2ff;
  --brand-l: #1a2740;
  --brand-l2: #27406b;
  --ok: #4ade80;
  --ok-l: #13291d;
  --danger: #f87171;
  --danger-l: #3a1e1f;
  --warn: #fbbf24;
  --shadow-s: 0 1px 2px rgba(0, 0, 0, .55);
  --shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 6px 18px rgba(0, 0, 0, .5);
  --shadow-l: 0 16px 48px rgba(0, 0, 0, .62);
  }
}

/* ---------- ① 细节覆盖：按钮 / 输入框 / 表格 / 弹窗 / 侧栏 / 抽屉 / 浮层 ---------- */
html[data-theme="dark"] .btn { background: #1b2330; border-color: #2a3442; }
html[data-theme="dark"] .btn:hover { background: #232e3d; border-color: #3a4a63; }
html[data-theme="dark"] .btn.primary, html[data-theme="dark"] .space-tab.on { background: #2563eb; border-color: #2563eb; }
html[data-theme="dark"] .btn.ghost:hover, html[data-theme="dark"] .icon-btn:hover, html[data-theme="dark"] .gs-btn:hover, html[data-theme="dark"] .gs-x:hover, html[data-theme="dark"] .crumbs a:hover, html[data-theme="dark"] .crumbs-bar a:hover { background: #232e3d; }
html[data-theme="dark"] .mini { background: #1b2330; border-color: #2a3442; }
html[data-theme="dark"] .btn.danger, html[data-theme="dark"] .mini.danger:hover, html[data-theme="dark"] .form-err, html[data-theme="dark"] .login-err { border-color: #4a2a2b; }
html[data-theme="dark"] .input, html[data-theme="dark"] .gs-input { background: #1b2330; }
html[data-theme="dark"] .gs-input:focus { background: #1b2330; }
html[data-theme="dark"] .topbar, html[data-theme="dark"] .sidebar, html[data-theme="dark"] .tabbar, html[data-theme="dark"] .gsearch.open, html[data-theme="dark"] .gs-panel, html[data-theme="dark"] .newmenu-pop, html[data-theme="dark"] .modal, html[data-theme="dark"] .mine-card, html[data-theme="dark"] .space-tab, html[data-theme="dark"] .upbanner, html[data-theme="dark"] .toast, html[data-theme="dark"] .ver-item, html[data-theme="dark"] .vp-content, html[data-theme="dark"] .img-prev, html[data-theme="dark"] .pdf-prev, html[data-theme="dark"] .m2-io-i, html[data-theme="dark"] .m2-pop, html[data-theme="dark"] .m2-kbcard { background: var(--card); }
html[data-theme="dark"] .nav-item:hover, html[data-theme="dark"] .space-item:hover, html[data-theme="dark"] .mine-item:hover { background: #1d2634; }
html[data-theme="dark"] .space-tab:hover { background: #232e3d; }
html[data-theme="dark"] .ftable th, html[data-theme="dark"] .modal-foot, html[data-theme="dark"] .badge, html[data-theme="dark"] .up-track, html[data-theme="dark"] .tag, html[data-theme="dark"] .gs-tag, html[data-theme="dark"] .chip { background: #1a222e; }
html[data-theme="dark"] .drop-veil { background: rgba(26, 39, 64, .93); }
html[data-theme="dark"] .modal-root { background: rgba(0, 0, 0, .62); }
html[data-theme="dark"] .mine-sheet, html[data-theme="dark"] .nav-backdrop { background: rgba(0, 0, 0, .55); }
html[data-theme="dark"] .vov { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .editor { background: #1b2330; }
html[data-theme="dark"] .editor.dirty { background: #2b2415; border-color: #5a4520; }
html[data-theme="dark"] .space-item .dot { background: #5b6779; }
html[data-theme="dark"] .m2-cell.empty .m2-ph { color: #5b6779; }
html[data-theme="dark"] .ok-note { border-color: #245134; color: #7ee2a8; }
html[data-theme="dark"] .brand-logo, html[data-theme="dark"] .mine-ava { background: linear-gradient(140deg, #3b82f6, #2563eb); }
html[data-theme="dark"] .fi.k-dir { color: #7ab0ff; }
html[data-theme="dark"] .fi.k-text { color: #4fc3f7; }
html[data-theme="dark"] .fi.k-image { color: #4ade80; }
html[data-theme="dark"] .fi.k-pdf { color: #f87171; }
html[data-theme="dark"] .fi.k-other { color: #8b98ab; }
html[data-theme="dark"] .login-wrap { background: radial-gradient(900px 420px at 12% -10%, #131c2c 0%, rgba(19, 28, 44, 0) 62%), radial-gradient(760px 380px at 100% 0%, #101a28 0%, rgba(16, 26, 40, 0) 58%), var(--bg); }
/* M8a：LIMS 列表「流程」列 */
.lims-table td.c-flow { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 12px; }
.lims-flow { display: inline-flex; align-items: center; font-size: 11.5px; line-height: 1; padding: 3px 8px; border-radius: 999px; border: 1px solid transparent; white-space: nowrap; }
.lims-flow.f-done { background: #e8f7ee; color: #16794c; border-color: #bfe8d0; }
.lims-flow.f-doing { background: #eaf2ff; color: #1d4ed8; border-color: #c9dcff; }
.lims-flow.f-wait, .lims-flow.f-unk, .lims-flow.f-load { background: #f1f5f9; color: #64748b; border-color: #e2e8f0; }
.lims-table td.c-flow .lf-cur { margin-left: 7px; font-weight: 600; color: var(--text); }
.lims-table td.c-flow .lf-who { margin-left: 5px; color: var(--muted); }
.lims-table td.c-flow .lf-who::before { content: '·'; margin-right: 4px; }
html[data-theme="dark"] .lims-table th { background: #1a222e; }
html[data-theme="dark"] .lims-tag, html[data-theme="dark"] .lp-node { background: #232e3d; }
html[data-theme="dark"] .lp-badge.done, html[data-theme="dark"] .lp-node.st-finish { border-color: #245134; }
html[data-theme="dark"] .lp-node.st-finish { color: #6ee7a8; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { background: #1b2330; border-color: #2a3442; }
  :root:not([data-theme="light"]) .btn:hover { background: #232e3d; border-color: #3a4a63; }
  :root:not([data-theme="light"]) .btn.primary,
  :root:not([data-theme="light"]) .space-tab.on { background: #2563eb; border-color: #2563eb; }
  :root:not([data-theme="light"]) .btn.ghost:hover,
  :root:not([data-theme="light"]) .icon-btn:hover,
  :root:not([data-theme="light"]) .gs-btn:hover,
  :root:not([data-theme="light"]) .gs-x:hover,
  :root:not([data-theme="light"]) .crumbs a:hover,
  :root:not([data-theme="light"]) .crumbs-bar a:hover { background: #232e3d; }
  :root:not([data-theme="light"]) .mini { background: #1b2330; border-color: #2a3442; }
  :root:not([data-theme="light"]) .btn.danger,
  :root:not([data-theme="light"]) .mini.danger:hover,
  :root:not([data-theme="light"]) .form-err,
  :root:not([data-theme="light"]) .login-err { border-color: #4a2a2b; }
  :root:not([data-theme="light"]) .input,
  :root:not([data-theme="light"]) .gs-input { background: #1b2330; }
  :root:not([data-theme="light"]) .gs-input:focus { background: #1b2330; }
  :root:not([data-theme="light"]) .topbar,
  :root:not([data-theme="light"]) .sidebar,
  :root:not([data-theme="light"]) .tabbar,
  :root:not([data-theme="light"]) .gsearch.open,
  :root:not([data-theme="light"]) .gs-panel,
  :root:not([data-theme="light"]) .newmenu-pop,
  :root:not([data-theme="light"]) .modal,
  :root:not([data-theme="light"]) .mine-card,
  :root:not([data-theme="light"]) .space-tab,
  :root:not([data-theme="light"]) .upbanner,
  :root:not([data-theme="light"]) .toast,
  :root:not([data-theme="light"]) .ver-item,
  :root:not([data-theme="light"]) .vp-content,
  :root:not([data-theme="light"]) .img-prev,
  :root:not([data-theme="light"]) .pdf-prev,
  :root:not([data-theme="light"]) .m2-io-i,
  :root:not([data-theme="light"]) .m2-pop,
  :root:not([data-theme="light"]) .m2-kbcard { background: var(--card); }
  :root:not([data-theme="light"]) .nav-item:hover,
  :root:not([data-theme="light"]) .space-item:hover,
  :root:not([data-theme="light"]) .mine-item:hover { background: #1d2634; }
  :root:not([data-theme="light"]) .space-tab:hover { background: #232e3d; }
  :root:not([data-theme="light"]) .ftable th,
  :root:not([data-theme="light"]) .modal-foot,
  :root:not([data-theme="light"]) .badge,
  :root:not([data-theme="light"]) .up-track,
  :root:not([data-theme="light"]) .tag,
  :root:not([data-theme="light"]) .gs-tag,
  :root:not([data-theme="light"]) .chip { background: #1a222e; }
  :root:not([data-theme="light"]) .drop-veil { background: rgba(26, 39, 64, .93); }
  :root:not([data-theme="light"]) .modal-root { background: rgba(0, 0, 0, .62); }
  :root:not([data-theme="light"]) .mine-sheet,
  :root:not([data-theme="light"]) .nav-backdrop { background: rgba(0, 0, 0, .55); }
  :root:not([data-theme="light"]) .vov { background: rgba(0, 0, 0, .6); }
  :root:not([data-theme="light"]) .editor { background: #1b2330; }
  :root:not([data-theme="light"]) .editor.dirty { background: #2b2415; border-color: #5a4520; }
  :root:not([data-theme="light"]) .space-item .dot { background: #5b6779; }
  :root:not([data-theme="light"]) .m2-cell.empty .m2-ph { color: #5b6779; }
  :root:not([data-theme="light"]) .ok-note { border-color: #245134; color: #7ee2a8; }
  :root:not([data-theme="light"]) .brand-logo,
  :root:not([data-theme="light"]) .mine-ava { background: linear-gradient(140deg, #3b82f6, #2563eb); }
  :root:not([data-theme="light"]) .fi.k-dir { color: #7ab0ff; }
  :root:not([data-theme="light"]) .fi.k-text { color: #4fc3f7; }
  :root:not([data-theme="light"]) .fi.k-image { color: #4ade80; }
  :root:not([data-theme="light"]) .fi.k-pdf { color: #f87171; }
  :root:not([data-theme="light"]) .fi.k-other { color: #8b98ab; }
  :root:not([data-theme="light"]) .login-wrap { background: radial-gradient(900px 420px at 12% -10%, #131c2c 0%, rgba(19, 28, 44, 0) 62%), radial-gradient(760px 380px at 100% 0%, #101a28 0%, rgba(16, 26, 40, 0) 58%), var(--bg); }
  :root:not([data-theme="light"]) .lims-table th { background: #1a222e; }
  :root:not([data-theme="light"]) .lims-tag,
  :root:not([data-theme="light"]) .lp-node { background: #232e3d; }
  :root:not([data-theme="light"]) .lp-badge.done,
  :root:not([data-theme="light"]) .lp-node.st-finish { border-color: #245134; }
  :root:not([data-theme="light"]) .lp-node.st-finish { color: #6ee7a8; }
}

/* 侧栏图标条 hover 展开的浮层（只存在于 600–1023px 断点，故限定在同一范围） */
@media (min-width: 600px) and (max-width: 1023px) {
  html[data-theme="dark"] .sidebar:hover .nav { background: var(--card); border-color: var(--line); }
}
@media (prefers-color-scheme: dark) {
  @media (min-width: 600px) and (max-width: 1023px) {
    :root:not([data-theme="light"]) .sidebar:hover .nav { background: var(--card); border-color: var(--line); }
  }
}
html[data-theme="dark"] .btn { background: #1b2330; border-color: #2a3442; }
html[data-theme="dark"] .btn:hover { background: #232e3d; border-color: #3a4a63; }
html[data-theme="dark"] .btn.primary, html[data-theme="dark"] .space-tab.on { background: #2563eb; border-color: #2563eb; }
html[data-theme="dark"] .btn.ghost:hover, html[data-theme="dark"] .icon-btn:hover, html[data-theme="dark"] .gs-btn:hover, html[data-theme="dark"] .gs-x:hover, html[data-theme="dark"] .crumbs a:hover, html[data-theme="dark"] .crumbs-bar a:hover { background: #232e3d; }
html[data-theme="dark"] .mini { background: #1b2330; border-color: #2a3442; }
html[data-theme="dark"] .btn.danger, html[data-theme="dark"] .mini.danger:hover, html[data-theme="dark"] .form-err, html[data-theme="dark"] .login-err { border-color: #4a2a2b; }
html[data-theme="dark"] .input, html[data-theme="dark"] .gs-input { background: #1b2330; }
html[data-theme="dark"] .gs-input:focus { background: #1b2330; }
html[data-theme="dark"] .topbar, html[data-theme="dark"] .sidebar, html[data-theme="dark"] .tabbar, html[data-theme="dark"] .gsearch.open, html[data-theme="dark"] .gs-panel, html[data-theme="dark"] .newmenu-pop, html[data-theme="dark"] .modal, html[data-theme="dark"] .mine-card, html[data-theme="dark"] .space-tab, html[data-theme="dark"] .upbanner, html[data-theme="dark"] .toast, html[data-theme="dark"] .ver-item, html[data-theme="dark"] .vp-content, html[data-theme="dark"] .img-prev, html[data-theme="dark"] .pdf-prev, html[data-theme="dark"] .m2-io-i, html[data-theme="dark"] .m2-pop, html[data-theme="dark"] .m2-kbcard { background: var(--card); }
html[data-theme="dark"] .nav-item:hover, html[data-theme="dark"] .space-item:hover, html[data-theme="dark"] .mine-item:hover { background: #1d2634; }
html[data-theme="dark"] .space-tab:hover { background: #232e3d; }
html[data-theme="dark"] .ftable th, html[data-theme="dark"] .modal-foot, html[data-theme="dark"] .badge, html[data-theme="dark"] .up-track, html[data-theme="dark"] .tag, html[data-theme="dark"] .gs-tag, html[data-theme="dark"] .chip { background: #1a222e; }
html[data-theme="dark"] .drop-veil { background: rgba(26, 39, 64, .93); }
html[data-theme="dark"] .modal-root { background: rgba(0, 0, 0, .62); }
html[data-theme="dark"] .mine-sheet, html[data-theme="dark"] .nav-backdrop { background: rgba(0, 0, 0, .55); }
html[data-theme="dark"] .vov { background: rgba(0, 0, 0, .6); }
html[data-theme="dark"] .editor { background: #1b2330; }
html[data-theme="dark"] .editor.dirty { background: #2b2415; border-color: #5a4520; }
html[data-theme="dark"] .space-item .dot { background: #5b6779; }
html[data-theme="dark"] .m2-cell.empty .m2-ph { color: #5b6779; }
html[data-theme="dark"] .ok-note { border-color: #245134; color: #7ee2a8; }
html[data-theme="dark"] .brand-logo, html[data-theme="dark"] .mine-ava { background: linear-gradient(140deg, #3b82f6, #2563eb); }
html[data-theme="dark"] .fi.k-dir { color: #7ab0ff; }
html[data-theme="dark"] .fi.k-text { color: #4fc3f7; }
html[data-theme="dark"] .fi.k-image { color: #4ade80; }
html[data-theme="dark"] .fi.k-pdf { color: #f87171; }
html[data-theme="dark"] .fi.k-other { color: #8b98ab; }
html[data-theme="dark"] .login-wrap { background: radial-gradient(900px 420px at 12% -10%, #131c2c 0%, rgba(19, 28, 44, 0) 62%), radial-gradient(760px 380px at 100% 0%, #101a28 0%, rgba(16, 26, 40, 0) 58%), var(--bg); }
html[data-theme="dark"] .lims-table th { background: #1a222e; }
html[data-theme="dark"] .lims-tag, html[data-theme="dark"] .lp-node { background: #232e3d; }
html[data-theme="dark"] .lp-badge.done, html[data-theme="dark"] .lp-node.st-finish { border-color: #245134; }
html[data-theme="dark"] .lp-node.st-finish { color: #6ee7a8; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .btn { background: #1b2330; border-color: #2a3442; }
  :root:not([data-theme="light"]) .btn:hover { background: #232e3d; border-color: #3a4a63; }
  :root:not([data-theme="light"]) .btn.primary,
  :root:not([data-theme="light"]) .space-tab.on { background: #2563eb; border-color: #2563eb; }
  :root:not([data-theme="light"]) .btn.ghost:hover,
  :root:not([data-theme="light"]) .icon-btn:hover,
  :root:not([data-theme="light"]) .gs-btn:hover,
  :root:not([data-theme="light"]) .gs-x:hover,
  :root:not([data-theme="light"]) .crumbs a:hover,
  :root:not([data-theme="light"]) .crumbs-bar a:hover { background: #232e3d; }
  :root:not([data-theme="light"]) .mini { background: #1b2330; border-color: #2a3442; }
  :root:not([data-theme="light"]) .btn.danger,
  :root:not([data-theme="light"]) .mini.danger:hover,
  :root:not([data-theme="light"]) .form-err,
  :root:not([data-theme="light"]) .login-err { border-color: #4a2a2b; }
  :root:not([data-theme="light"]) .input,
  :root:not([data-theme="light"]) .gs-input { background: #1b2330; }
  :root:not([data-theme="light"]) .gs-input:focus { background: #1b2330; }
  :root:not([data-theme="light"]) .topbar,
  :root:not([data-theme="light"]) .sidebar,
  :root:not([data-theme="light"]) .tabbar,
  :root:not([data-theme="light"]) .gsearch.open,
  :root:not([data-theme="light"]) .gs-panel,
  :root:not([data-theme="light"]) .newmenu-pop,
  :root:not([data-theme="light"]) .modal,
  :root:not([data-theme="light"]) .mine-card,
  :root:not([data-theme="light"]) .space-tab,
  :root:not([data-theme="light"]) .upbanner,
  :root:not([data-theme="light"]) .toast,
  :root:not([data-theme="light"]) .ver-item,
  :root:not([data-theme="light"]) .vp-content,
  :root:not([data-theme="light"]) .img-prev,
  :root:not([data-theme="light"]) .pdf-prev,
  :root:not([data-theme="light"]) .m2-io-i,
  :root:not([data-theme="light"]) .m2-pop,
  :root:not([data-theme="light"]) .m2-kbcard { background: var(--card); }
  :root:not([data-theme="light"]) .nav-item:hover,
  :root:not([data-theme="light"]) .space-item:hover,
  :root:not([data-theme="light"]) .mine-item:hover { background: #1d2634; }
  :root:not([data-theme="light"]) .space-tab:hover { background: #232e3d; }
  :root:not([data-theme="light"]) .ftable th,
  :root:not([data-theme="light"]) .modal-foot,
  :root:not([data-theme="light"]) .badge,
  :root:not([data-theme="light"]) .up-track,
  :root:not([data-theme="light"]) .tag,
  :root:not([data-theme="light"]) .gs-tag,
  :root:not([data-theme="light"]) .chip { background: #1a222e; }
  :root:not([data-theme="light"]) .drop-veil { background: rgba(26, 39, 64, .93); }
  :root:not([data-theme="light"]) .modal-root { background: rgba(0, 0, 0, .62); }
  :root:not([data-theme="light"]) .mine-sheet,
  :root:not([data-theme="light"]) .nav-backdrop { background: rgba(0, 0, 0, .55); }
  :root:not([data-theme="light"]) .vov { background: rgba(0, 0, 0, .6); }
  :root:not([data-theme="light"]) .editor { background: #1b2330; }
  :root:not([data-theme="light"]) .editor.dirty { background: #2b2415; border-color: #5a4520; }
  :root:not([data-theme="light"]) .space-item .dot { background: #5b6779; }
  :root:not([data-theme="light"]) .m2-cell.empty .m2-ph { color: #5b6779; }
  :root:not([data-theme="light"]) .ok-note { border-color: #245134; color: #7ee2a8; }
  :root:not([data-theme="light"]) .brand-logo,
  :root:not([data-theme="light"]) .mine-ava { background: linear-gradient(140deg, #3b82f6, #2563eb); }
  :root:not([data-theme="light"]) .fi.k-dir { color: #7ab0ff; }
  :root:not([data-theme="light"]) .fi.k-text { color: #4fc3f7; }
  :root:not([data-theme="light"]) .fi.k-image { color: #4ade80; }
  :root:not([data-theme="light"]) .fi.k-pdf { color: #f87171; }
  :root:not([data-theme="light"]) .fi.k-other { color: #8b98ab; }
  :root:not([data-theme="light"]) .login-wrap { background: radial-gradient(900px 420px at 12% -10%, #131c2c 0%, rgba(19, 28, 44, 0) 62%), radial-gradient(760px 380px at 100% 0%, #101a28 0%, rgba(16, 26, 40, 0) 58%), var(--bg); }
  :root:not([data-theme="light"]) .lims-table th { background: #1a222e; }
  :root:not([data-theme="light"]) .lims-tag,
  :root:not([data-theme="light"]) .lp-node { background: #232e3d; }
  :root:not([data-theme="light"]) .lp-badge.done,
  :root:not([data-theme="light"]) .lp-node.st-finish { border-color: #245134; }
  :root:not([data-theme="light"]) .lp-node.st-finish { color: #6ee7a8; }
}

/* ---------- ② 空状态引导（m2polish.js 的 WBEmptyState 插入） ---------- */
.m2-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  padding: 34px 18px; margin: 0; text-align: center; color: var(--muted);
  font-size: 13px; line-height: 1.75; box-sizing: border-box;
}
.m2-empty-ic {
  width: 42px; height: 42px; border-radius: 13px; margin-bottom: 6px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px dashed var(--line-3); background: var(--card);
  color: var(--brand); font-size: 20px; font-weight: 600; line-height: 1;
}
.m2-empty-t { color: var(--text-2); font-size: 13.5px; }
.m2-empty-s { color: var(--faint); font-size: 12px; }
.m2-empty kbd {
  font-family: var(--mono); font-size: 11px; line-height: 1.5; padding: 0 5px;
  border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 5px;
  background: var(--bg); color: var(--text-2);
}
.wb-sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- ① 深色下的空状态 ---------- */
html[data-theme="dark"] .m2-empty-ic { background: #1b2330; border-color: #3a4a63; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .m2-empty-ic { background: #1b2330; border-color: #3a4a63; }
}

/* ---------- ③ 手机端手感（<700px）：表格横滚 + 首列冻结 / 点按 ≥44px / 字号 ≥16px ---------- */
/* 注：顶栏 .topbar 本身已是 flex-wrap:nowrap，这里不给它加 overflow-x：
   顶栏是 position:sticky，加 overflow 会把 600-700px 下绝对定位的「＋新建」下拉裁掉。
   需要横向滚动的是一页之内的工具条（.toolbar 等），见下。 */
@media (max-width: 700px) {
  /* 点按区域 ≥44px */
  .btn { height: 44px; padding: 0 14px; }
  .btn.sm, .mini { height: 40px; padding: 0 12px; }
  .icon-btn { width: 44px; height: 44px; }
  .input { height: 44px; }
  .tab-item { min-height: 44px; }
  .nav-item, .space-item, .mine-item, .gs-item { min-height: 44px; }
  /* 字号 ≥16px：避免 iPhone 聚焦自动放大，也更好点 */
  .btn, .mini, .input, textarea.input, .gs-input, select { font-size: 16px; }
  .ftable td, .ftable th { padding: 12px 10px; }
  /* 页内工具条：横向滚动不换行（原来的换行规则被覆盖） */
  .toolbar, .crumbs-bar { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; margin-left: 0; }
  .toolbar .btn { flex: 0 0 auto; }
  .view-head { flex-wrap: wrap; }              /* 标题行仍允许换行，别把标题挤没 */
  /* 列表：面板内横向滚动 + 首列冻结 */
  .panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .ftable { min-width: 560px; }
  .ftable th:first-child, .ftable td:first-child {
    position: sticky; left: 0; z-index: 3; background: var(--card);
    box-shadow: 1px 0 0 var(--line-2);
  }
  .ftable thead th:first-child { background: #fbfcfe; z-index: 4; }
  .ftable tbody tr:hover td:first-child { background: var(--brand-l); }
  /* 弹窗：窄屏接近全屏 */
  .modal-root { padding: 8px; align-items: flex-start; }
  .modal, .modal.md { max-width: none; max-height: calc(100vh - 16px); }
  .modal-head { padding: 11px 12px; }
  .modal-body { padding: 12px; }
}
html[data-theme="dark"] .ftable thead th:first-child { background: #1a222e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ftable thead th:first-child { background: #1a222e; }
}

/* ---------- 侧栏/抽屉在窄屏：抽屉铺满（右侧详情抽屉原本已是 100vw，见 m2.css） ---------- */
@media (max-width: 980px) {
  .drawer .modal-body { padding: 12px 12px 18px; }
}
@media (max-width: 599px) {
  .sidebar { width: min(88vw, 300px); }        /* 导航抽屉尽量铺满，但留一条缝方便点背板关闭 */
}

/* ---------- ④ 深色切换按钮（m2polish.js 注入到 .top-right） ---------- */
.wb-theme-btn { font-size: 15px; line-height: 1; }
.wb-theme-btn .wb-theme-ic { display: inline-flex; align-items: center; justify-content: center; }
