:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --line: #e3e6ea;
  --line-strong: #d0d5db;
  --text: #1d2126;
  --text-2: #5b636d;
  --text-3: #8b939d;
  --accent: #185fa5;
  --accent-soft: #e6f1fb;
  --danger: #a32d2d;
  --radius: 10px;
  --radius-lg: 14px;
  --shadow: 0 1px 2px rgba(20, 25, 32, .05), 0 8px 24px rgba(20, 25, 32, .06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-weight: 500; margin: 0; }
button, input, select, textarea { font-family: inherit; font-size: 14px; color: inherit; }
code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--surface-2); border: 1px solid var(--line); border-radius: 4px; padding: 0 4px; font-size: 12px; }
.hidden { display: none !important; }

/* ---------------------------------- 顶栏 ---------------------------------- */

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand h1 { font-size: 17px; letter-spacing: .5px; }
.brand .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.project-picker { display: flex; align-items: center; gap: 6px; color: var(--text-2); font-size: 13px; }
.project-picker select {
  appearance: none; border: 1px solid var(--line-strong); background: var(--surface);
  border-radius: 8px; padding: 7px 30px 7px 12px; font-weight: 500; cursor: pointer;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path d='M2 4l4 4 4-4' fill='none' stroke='%235b636d' stroke-width='1.4' stroke-linecap='round'/></svg>");
  background-repeat: no-repeat; background-position: right 10px center;
  max-width: 240px;
}
.whoami { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 20px; background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); font-size: 13px; cursor: pointer; }
.whoami:hover { border-color: var(--line-strong); }
.whoami b { color: var(--text); font-weight: 500; }

/* --------------------------------- 登录页 --------------------------------- */

.login-screen { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; background: var(--bg); }
.login-screen.hidden { display: none; }
.login-card { width: min(400px, 94vw); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 30px 28px; box-shadow: var(--shadow); }
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-brand h1 { font-size: 19px; }
.login-brand .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.login-sub { color: var(--text-2); font-size: 13px; margin: 0 0 20px; }
.login-card .field { margin-bottom: 14px; }
.login-err { color: var(--danger); font-size: 13px; min-height: 20px; margin-bottom: 6px; }
.btn.block { width: 100%; padding: 10px; }
.hint.center { text-align: center; }
.sep { border: none; border-top: 1px solid var(--line); margin: 16px 0; }

/* ------------------------------ 用户与角色 ------------------------------ */

.tabs { display: flex; gap: 6px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button { border: none; background: none; padding: 8px 14px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 500; }

table.grid { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid th { text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2); padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.grid td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.grid tr:last-child td { border-bottom: none; }
table.grid select, table.grid input { padding: 5px 8px; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); }
.state-tag { font-size: 12px; padding: 1px 8px; border-radius: 5px; }
.state-on { background: #eaf3de; color: #3b6d11; }
.state-off { background: #f1efe8; color: #5f5e5a; }

.perm-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 14px; margin-top: 8px; }
.perm-grid label { display: flex; align-items: flex-start; gap: 7px; font-size: 13px; color: var(--text); cursor: pointer; }
.perm-grid input { margin-top: 3px; }
.perm-list { display: flex; flex-wrap: wrap; gap: 6px; }
.perm-list span { font-size: 12px; padding: 2px 8px; border-radius: 5px; background: var(--accent-soft); color: var(--accent); }
.form-inline { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); margin-bottom: 14px; }
.form-inline .field.full { grid-column: 1 / -1; }
.form-inline .proj-pick { display: flex; flex-wrap: wrap; gap: 10px 16px; }
.form-inline .proj-pick label { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.row-actions { display: flex; gap: 6px; }
.warn-box { background: #faeeda; border: 1px solid #f0d6a8; color: #854f0b; border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.hidden { display: none !important; }

/* ---------------------------------- 按钮 ---------------------------------- */

.btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text);
  border-radius: 8px; padding: 7px 13px; cursor: pointer; white-space: nowrap;
  transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); border-color: #b9c0c8; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #14508c; border-color: #14508c; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--danger); border-color: #e8c7c7; }
.btn.danger:hover { background: #fcebeb; }
.btn.icon { border: none; background: transparent; padding: 4px 8px; font-size: 15px; color: var(--text-3); }
.btn.icon:hover { color: var(--text); background: var(--surface-2); }
.btn.tiny { padding: 3px 9px; font-size: 12px; border-radius: 6px; }

/* ---------------------------------- 统计 ---------------------------------- */

.stats { display: flex; gap: 10px; padding: 14px 20px 0; flex-wrap: wrap; }
.stat {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 9px 14px; cursor: pointer; min-width: 92px; transition: border-color .12s;
}
.stat:hover { border-color: var(--line-strong); }
.stat.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.stat .n { font-size: 19px; font-weight: 500; line-height: 1.2; }
.stat .l { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.stat .swatch { width: 8px; height: 8px; border-radius: 2px; }

/* --------------------------------- 工具栏 --------------------------------- */

.toolbar { display: flex; gap: 10px; padding: 14px 20px; align-items: center; flex-wrap: wrap; }
.search { flex: 1 1 240px; min-width: 200px; }
.search input {
  width: 100%; border: 1px solid var(--line-strong); border-radius: 8px;
  padding: 8px 12px; background: var(--surface); outline: none;
}
.search input:focus { border-color: var(--accent); }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.filters select, select.mini {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px;
  padding: 8px 10px; max-width: 160px; cursor: pointer; color: var(--text-2);
}
.toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-left: auto; }
.seg { display: flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; }
.seg button { border: none; background: var(--surface); padding: 8px 14px; cursor: pointer; color: var(--text-2); }
.seg button.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }

/* ---------------------------------- 列表 ---------------------------------- */

main { padding: 0 20px 60px; }
.view { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; }

table.req { width: 100%; border-collapse: collapse; min-width: 1340px; }
table.req th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2);
  padding: 11px 12px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.req td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.req tr:last-child td { border-bottom: none; }
table.req tbody tr { cursor: pointer; }
table.req tbody tr:hover { background: var(--surface-2); }
.col-desc { min-width: 260px; }
.desc-text { white-space: pre-wrap; word-break: break-word; max-height: 66px; overflow: hidden; display: block; }
.desc-meta { color: var(--text-3); font-size: 12px; margin-top: 4px; }
.no { color: var(--text-3); font-variant-numeric: tabular-nums; }
.muted { color: var(--text-3); }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 20px; font-size: 12px; white-space: nowrap;
  border: 1px solid transparent;
}
.badge .swatch { width: 7px; height: 7px; border-radius: 50%; }
.chip { display: inline-block; padding: 1px 8px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--line); font-size: 12px; color: var(--text-2); }
.pri { font-size: 12px; padding: 1px 8px; border-radius: 5px; }
.pri-高 { background: #fcebeb; color: #a32d2d; }
.pri-中 { background: #faeeda; color: #854f0b; }
.pri-低 { background: #eaf3de; color: #3b6d11; }
.dates { font-size: 12px; color: var(--text-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.mini-counts { display: flex; gap: 8px; font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ------------------------------- 行内编辑 ------------------------------- */

.cell-edit {
  border: 1px solid transparent; background: transparent; border-radius: 6px;
  padding: 3px 6px; font-size: 12px; cursor: pointer; color: var(--text);
  max-width: 112px; appearance: none; -webkit-appearance: none; outline: none;
}
.cell-edit:hover, .cell-edit:focus { border-color: var(--line-strong); background: var(--surface); }
.cell-date { width: 128px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.st-wrap { display: inline-flex; align-items: center; border: 1px solid transparent; border-radius: 20px; }
.st-sel { font-weight: 500; }
.counts-cell { white-space: nowrap; text-align: right; color: var(--text-3); font-size: 12px; line-height: 1.5; }
.counts-cell div { min-width: 38px; }
.overdue-tip { color: var(--danger); font-size: 11px; margin-top: 2px; }

/* ---------------------------------- 分页 ---------------------------------- */

.pager {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 11px 16px; margin-top: 12px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  font-size: 12px; color: var(--text-2);
}
.pg-info { flex: 1 1 auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.pg-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pg-btn {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  border-radius: 7px; padding: 4px 10px; font-size: 12px; cursor: pointer;
  font-variant-numeric: tabular-nums; min-width: 30px; line-height: 1.5;
}
.pg-btn:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.pg-btn:disabled { opacity: .4; cursor: default; }
.pg-num.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.pg-dots { color: var(--text-3); padding: 0 2px; }
.pg-size select {
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--text-2);
  border-radius: 7px; padding: 4px 8px; font-size: 12px; cursor: pointer; outline: none;
}
.pg-size select:hover { border-color: var(--accent); }

/* 行内编辑保存后，那一行留在原位闪一下，提示「改的是这里」 */
@keyframes rowFlash {
  from { background: var(--accent-soft); }
  to { background: transparent; }
}
table.req tbody tr.row-flash > td { animation: rowFlash 2s ease-out 1; }

/* ---------------------------------- 看板 ---------------------------------- */

.board { display: flex; gap: 12px; padding: 14px; overflow-x: auto; background: var(--bg); border: none; border-radius: 0; }
.bcol { min-width: 236px; flex: 0 0 236px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); display: flex; flex-direction: column; max-height: calc(100vh - 300px); }
.bcol-head { padding: 10px 12px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.bcol-body { padding: 10px; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.bcard { border: 1px solid var(--line); border-radius: 8px; padding: 10px; cursor: pointer; background: var(--surface); }
.bcard:hover { border-color: var(--line-strong); background: var(--surface-2); }
.bcard .t { white-space: pre-wrap; word-break: break-word; max-height: 60px; overflow: hidden; font-size: 13px; }
.bcard .m { margin-top: 8px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--text-3); }

/* --------------------------------- 空状态 --------------------------------- */

.empty { text-align: center; padding: 70px 20px; color: var(--text-3); }
.empty h3 { font-size: 15px; color: var(--text-2); margin-bottom: 6px; }

/* ---------------------------------- 抽屉 ---------------------------------- */

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(660px, 94vw);
  background: var(--surface); border-left: 1px solid var(--line);
  transform: translateX(102%); transition: transform .22s ease; z-index: 50;
  display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.drawer.open { transform: translateX(0); }
.drawer-inner { overflow-y: auto; padding: 20px 22px 40px; }
.scrim { position: fixed; inset: 0; background: rgba(20,25,32,.28); opacity: 0; pointer-events: none; transition: opacity .22s; z-index: 40; }
.scrim.open { opacity: 1; pointer-events: auto; }

.dhead { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 14px; }
.dhead h2 { font-size: 15px; color: var(--text-2); }
.dtitle { font-size: 16px; white-space: pre-wrap; word-break: break-word; margin-bottom: 10px; }
.dtags { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.dgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px; padding: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.dgrid .k { font-size: 12px; color: var(--text-3); }
.dgrid .v { font-size: 13px; }
.section { margin-top: 22px; }
.section h3 { font-size: 13px; color: var(--text-2); margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }

/* --------------------------------- 附件 ---------------------------------- */

.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr)); gap: 10px; }
.att-thumb {
  border: 1px solid var(--line); border-radius: 8px; overflow: hidden; cursor: pointer;
  background: var(--surface-2); display: flex; flex-direction: column;
}
.att-thumb:hover { border-color: var(--accent); }
.att-thumb .img { height: 80px; background: #eef1f4 center/cover no-repeat; }
.att-thumb .ficon { height: 80px; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 500; color: #fff; }
.att-thumb .nm { padding: 6px 8px; font-size: 12px; word-break: break-all; line-height: 1.35; }
.att-thumb .sz { padding: 0 8px 6px; font-size: 11px; color: var(--text-3); }
.fi-word { background: #2b579a; }
.fi-excel { background: #217346; }
.fi-pdf { background: #b3261e; }
.fi-other { background: #6b7280; }
.fi-text { background: #5f5e5a; }

.dropzone {
  border: 1px dashed var(--line-strong); border-radius: 8px; padding: 18px; text-align: center;
  color: var(--text-3); font-size: 13px; cursor: pointer; background: var(--surface-2);
}
.dropzone.hot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.upload-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.upl { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); }
.upl .bar { flex: 1; height: 4px; background: var(--line); border-radius: 3px; overflow: hidden; }
.upl .bar i { display: block; height: 100%; background: var(--accent); width: 0; }

/* ---------------------------------- 评论 ---------------------------------- */

.cm { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; margin-bottom: 8px; background: var(--surface); }
.cm.sys { background: var(--surface-2); border-style: dashed; color: var(--text-2); font-size: 13px; }
.cm-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; font-size: 12px; color: var(--text-3); }
.cm-head b { color: var(--text); font-weight: 500; font-size: 13px; }
.cm-head .role { padding: 0 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); }
.cm-body { white-space: pre-wrap; word-break: break-word; }
.cm-form { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }

/* ---------------------------------- 表单 ---------------------------------- */

.modal { position: fixed; inset: 0; z-index: 60; display: none; align-items: center; justify-content: center; padding: 24px; background: rgba(20,25,32,.4); }
.modal.open { display: flex; }
.modal-box { background: var(--surface); border-radius: var(--radius-lg); width: min(560px, 96vw); max-height: 92vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.modal-box.wide { width: min(820px, 96vw); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { font-size: 15px; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--line); }
.foot-right { display: flex; gap: 8px; }
.hint { font-size: 12px; color: var(--text-3); }

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--text-2); }
.field label .req { color: var(--danger); }
.field input[type=text], .field input[type=date], .field select, .field textarea, .cm-form textarea, .cm-form input, .cfg-row textarea, .cfg-row input {
  border: 1px solid var(--line-strong); border-radius: 8px; padding: 8px 10px; background: var(--surface); outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus, .cm-form textarea:focus, .cfg-row textarea:focus { border-color: var(--accent); }
.field textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.cm-form textarea { min-height: 74px; resize: vertical; }

.cfg-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.cfg-row { display: flex; flex-direction: column; gap: 5px; }
.cfg-row label { font-size: 12px; color: var(--text-2); }
.cfg-row textarea { min-height: 104px; resize: vertical; font-size: 13px; }
.cfg-colors { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 8px; margin-top: 6px; }
.cfg-color { display: flex; align-items: center; gap: 8px; font-size: 13px; }

/* ------------------------------- 字典维护 --------------------------------- */
.dict-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.dict-card { border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; background: var(--surface); }
.dict-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 4px; }
.dict-head b { font-size: 13px; }
.dict-tip { font-size: 11px; color: var(--text-3); margin-bottom: 8px; line-height: 1.5; }
.dict-items { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow: auto; margin-bottom: 8px; }
.dict-item { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 8px; background: var(--surface-2); }
.dict-item:hover { background: var(--line); }
.dict-item input[type=color] { width: 22px; height: 22px; padding: 0; border: none; background: none; cursor: pointer; }
.dict-val { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dict-ops { display: flex; gap: 2px; opacity: 0; transition: opacity 0.12s; }
.dict-item:hover .dict-ops { opacity: 1; }
.dict-ops .btn { font-size: 11px; }
.dict-add { display: flex; gap: 6px; }
.dict-add input { flex: 1; padding: 6px 10px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: 13px; }
.dict-add input:focus { border-color: var(--accent); outline: none; }

/* 列头排序 */
table.req th[data-sk] { cursor: pointer; user-select: none; white-space: nowrap; }
table.req th[data-sk]:hover { color: var(--accent); }
.sort-arrow { font-style: normal; font-size: 10px; margin-left: 3px; color: var(--accent); }
.cfg-color input[type=color] { width: 30px; height: 26px; padding: 0; border: 1px solid var(--line-strong); border-radius: 6px; background: none; cursor: pointer; }

/* --------------------------------- 预览器 --------------------------------- */

.preview-box { background: var(--surface); border-radius: var(--radius-lg); width: min(1080px, 96vw); height: 90vh; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.preview-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; border-bottom: 1px solid var(--line); gap: 12px; }
.preview-head span { font-size: 14px; word-break: break-all; }
.preview-actions { display: flex; gap: 8px; align-items: center; flex: 0 0 auto; }
.preview-body { flex: 1; overflow: auto; background: var(--surface-2); display: flex; align-items: center; justify-content: center; padding: 16px; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; }
.preview-body iframe { width: 100%; height: 100%; border: none; background: #fff; }
.preview-body .doc { background: #fff; padding: 32px 40px; width: 100%; height: 100%; overflow: auto; align-self: stretch; }
.preview-body .doc table { border-collapse: collapse; width: 100%; font-size: 13px; }
.preview-body .doc td, .preview-body .doc th { border: 1px solid var(--line); padding: 5px 8px; }
.preview-center { color: var(--text-3); text-align: center; }

.help h3 { font-size: 14px; margin: 18px 0 6px; }
.help h3:first-child { margin-top: 0; }
.help p, .help li { color: var(--text-2); font-size: 13px; }
.help ul { margin: 6px 0; padding-left: 20px; }

/* ---------------------------------- Toast --------------------------------- */

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #2c2c2a; color: #fff; padding: 10px 18px; border-radius: 8px; font-size: 13px;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 90;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.err { background: #a32d2d; }

/* -------------------------------- 操作记录 -------------------------------- */

.modal-box.tall { width: min(1140px, 96vw); height: 88vh; }
.logs-toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 12px; }
.logs-toolbar select, .logs-toolbar input {
  border: 1px solid var(--line-strong); background: var(--surface); border-radius: 8px;
  padding: 7px 10px; max-width: 170px; color: var(--text-2); outline: none;
}
.logs-toolbar input[type=search] { max-width: 240px; flex: 1 1 180px; }
.logs-toolbar select:focus, .logs-toolbar input:focus { border-color: var(--accent); }
.logs-toolbar select.on, .logs-toolbar input.on { border-color: var(--accent); color: var(--accent); font-weight: 500; }
.logs-count { margin-bottom: 8px; }
table.logs { width: 100%; border-collapse: collapse; font-size: 13px; }
table.logs th {
  text-align: left; font-weight: 500; font-size: 12px; color: var(--text-2);
  padding: 9px 10px; background: var(--surface-2); border-bottom: 1px solid var(--line);
  white-space: nowrap; position: sticky; top: 0; z-index: 1;
}
table.logs td { padding: 9px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.logs tr:last-child td { border-bottom: none; }
.lg-time { white-space: nowrap; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.lg-target { white-space: nowrap; }
.lg-detail { word-break: break-word; min-width: 220px; }
.act { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 5px; white-space: nowrap; }
.act-ok { background: #eaf3de; color: #3b6d11; }
.act-info { background: var(--accent-soft); color: var(--accent); }
.act-danger { background: #fcebeb; color: var(--danger); }
.act-warn { background: #faeeda; color: #854f0b; }
.chgs { margin-top: 5px; display: flex; flex-direction: column; gap: 3px; }
.chg { font-size: 12px; color: var(--text-2); display: flex; gap: 6px; flex-wrap: wrap; align-items: baseline; }
.chg .f { color: var(--text-3); flex: 0 0 auto; }
.chg .from { text-decoration: line-through; color: var(--text-3); }
.chg .arrow { color: var(--text-3); }
.chg .to { color: var(--accent); }
.req-logs { display: flex; flex-direction: column; gap: 8px; }
.rl { display: flex; gap: 8px; flex-wrap: wrap; align-items: baseline; font-size: 12px; border-bottom: 1px dashed var(--line); padding-bottom: 8px; }
.rl:last-child { border-bottom: none; padding-bottom: 0; }
.rl-t { color: var(--text-3); font-variant-numeric: tabular-nums; }
.rl-d { color: var(--text-2); }
.rl .chgs { flex-basis: 100%; }

/* --------------------------------- 响应式 --------------------------------- */

@media (max-width: 820px) {
  .topbar { padding: 10px 12px; }
  .stats, .toolbar, main { padding-left: 12px; padding-right: 12px; }
  .form-grid, .cfg-grid, .dgrid { grid-template-columns: 1fr; }
  .toolbar-right { margin-left: 0; width: 100%; }
  table.req .hide-sm { display: none; }
  .pager { gap: 10px; }
  .pg-info { flex-basis: 100%; }
}
