:root {
  --bg: #f5f7fa; --panel: #ffffff; --line: #e4e9f0;
  --text: #1f2d3d; --muted: #7a8699;
  --primary: #2f6fed; --primary-dark: #1d54c8;
  --red: #d9363e; --green: #1a9c6b; --orange: #d9822b;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif; background: var(--bg); color: var(--text); font-size: 14px; }
.hidden { display: none !important; }

/* 登录 */
.login-screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #eef3ff 0%, #f5f7fa 60%); }
.login-card { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 32px; width: 860px; max-width: 94vw; max-height: 92vh; overflow: auto; box-shadow: 0 8px 30px rgba(31,45,61,.08); }
.login-card h1 { font-size: 20px; margin-bottom: 6px; }
.login-card .sub { color: var(--muted); margin-bottom: 20px; }
.login-group { margin-bottom: 16px; }
.login-group > h3 { font-size: 12px; color: var(--muted); font-weight: 600; letter-spacing: .04em; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.login-group > h3::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.login-users { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.login-users button { padding: 10px 12px; border: 1px solid var(--line); background: #fafbfd; border-radius: var(--radius); cursor: pointer; text-align: left; transition: .15s; }
.login-users button:hover { border-color: var(--primary); background: #f0f5ff; }
.login-users .n { font-weight: 600; display: flex; align-items: center; gap: 6px; }
.login-users .r { color: var(--muted); font-size: 12px; margin-top: 3px; line-height: 1.45; }
.login-users .badge { font-size: 10px; font-weight: 500; border-radius: 10px; padding: 1px 6px; background: #eef2ff; color: var(--primary); }
.login-users .badge.warn { background: #fff4e6; color: var(--orange); }
.login-users .badge.off { background: #f2f4f7; color: var(--muted); }
.login-foot { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; line-height: 1.7; }
/* v0.44.0：登录页版本自检 —— 正常灰字，脚本落后于服务端时红字要求强刷 */
.login-ver { margin-top: 6px; opacity: .75; }
.login-ver-stale { margin-top: 8px; color: #c0392b; font-weight: 600; line-height: 1.6;
  background: rgba(192, 57, 43, .07); border: 1px solid rgba(192, 57, 43, .25); border-radius: 6px; padding: 7px 9px; }

/* 客户端账号密码登录 */
.login-form { display: flex; flex-direction: column; gap: 12px; max-width: 380px; margin: 4px 0 10px; }
.login-form .lf-row { font-size: 13px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.login-form input { height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--radius); font-size: 15px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.login-form input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(59,108,241,.12); }
.login-form .lf-btn { height: 42px; font-size: 15px; letter-spacing: .3em; text-indent: .3em; margin-top: 2px; }
.login-err { background: #fdecec; border: 1px solid #f5b5b5; color: #c0392b; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; }
.login-demo-row { margin: 2px 0 6px; }
.linklike { background: none; border: none; padding: 0; color: var(--primary); font-size: 12px; cursor: pointer; }
.linklike:hover { text-decoration: underline; }
.login-users.hidden { display: none; }

/* 顶栏 */
.topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 24px; background: var(--panel); border-bottom: 1px solid var(--line); padding: 10px 24px; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; font-size: 15px; white-space: nowrap; }
@media (max-width: 1000px) {
  .topbar { gap: 12px; padding: 10px 14px; }
  .me { gap: 6px; }
}
.tag { font-size: 11px; background: #eef2ff; color: var(--primary); border-radius: 20px; padding: 2px 8px; margin-left: 6px; font-weight: 500; }
.tag.on { background: #e8f7ee; color: #127a3c; }
/* 腾讯云 OCR 结论（只说明"图里有没有这些字"） */
.gs-ocr { font-size: 11px; margin-left: 6px; padding: 1px 6px; border-radius: 8px; }
.gs-ocr.ok { background: #e8f7ee; color: #127a3c; }
.gs-ocr.wr { background: #fff4e0; color: #a05a00; }
.gs-ocr.er { background: #fdeaea; color: #b3261e; font-weight: 600; }
.gs-ocr-txt { font-size: 11px; color: var(--muted); margin-left: 4px; }
.tabs { display: flex; gap: 4px; flex: 1 1 auto; min-width: 0; }
.tab-btn { border: none; background: none; padding: 8px 14px; border-radius: 8px; cursor: pointer; color: var(--muted); font-size: 14px; }
.tab-btn.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.me { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.identity-switch { position: relative; }
.identity-switch > button { display: inline-flex; align-items: center; height: 28px; border: 1px solid #dbe6ff; background: #eef3ff; color: var(--primary); padding: 0 10px; border-radius: 8px; cursor: pointer; font-size: 12px; font-family: inherit; }
.identity-switch > button:hover { background: #e3ecff; }
.identity-menu { position: absolute; right: 0; top: 34px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(31,45,61,.12); padding: 6px; min-width: 240px; z-index: 30; }
.identity-menu button { display: block; width: 100%; text-align: left; border: none; background: none; padding: 8px 10px; border-radius: 8px; cursor: pointer; font-size: 13px; color: var(--text); }
.identity-menu button:hover { background: #f0f5ff; }
.identity-menu button.active { background: #eef2ff; color: var(--primary); font-weight: 600; }
.identity-menu .m { color: var(--muted); font-size: 11px; }
/* ===== 按钮体系（v0.24 统一）=====
   标准次按钮 .btn ｜ 主操作 .btn.primary ｜ 危险 .btn.danger ｜ 警示 .btn.warn
   轻量 .btn.ghost（返回/关闭/顶栏）｜ 尺寸 .btn.sm / .btn.lg
   规则：所有可点操作统一 32px 高、8px 圆角、13px 字；只变颜色层级，不变形。 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font-size: 13px; line-height: 1; font-family: inherit;
  cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.btn:hover { border-color: #c3cede; background: #f8fafd; }
.btn:active { background: #eef2f7; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 500; }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); }
.btn.danger { background: #fff; border-color: #f0c4c6; color: var(--red); }
.btn.danger:hover { background: #fdf3f3; border-color: #e5a9ac; }
.btn.warn { background: var(--orange); border-color: var(--orange); color: #fff; }
.btn.warn:hover { background: #c4741f; border-color: #c4741f; }
.btn.ghost, .btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn.ghost:hover, .btn-ghost:hover { background: #eef2f7; border-color: transparent; color: var(--text); }
.btn.sm, .row-ops .btn { height: 26px; padding: 0 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { height: 38px; padding: 0 22px; font-size: 14px; border-radius: 9px; }
.btn:disabled, .btn:disabled:hover { background: #eef1f5; border-color: #e4e9f0; color: #a9b3c2; cursor: not-allowed; }
.btn.primary:disabled, .btn.primary:disabled:hover { background: #b9c4d6; border-color: #b9c4d6; color: #fff; }
.btn.danger:disabled, .btn.danger:disabled:hover { background: #f6f8fb; border-color: #eef1f5; color: #b9c4d6; }

/* 数据同步 */
.sync-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.sync-status .cell { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.sync-status .k { color: var(--muted); font-size: 12px; margin-bottom: 4px; }
.sync-status .v { font-weight: 600; font-size: 15px; }
.sync-status .v.small { font-size: 12px; font-weight: 400; line-height: 1.6; word-break: break-all; }
.sync-drop { border: 1.5px dashed #c8d4e6; border-radius: 12px; padding: 26px; text-align: center; background: #fbfcff; transition: .15s; }
.sync-drop.over { border-color: var(--primary); background: #f0f5ff; }
.sync-drop .dz-main { font-size: 14px; }
.sync-drop .dz-main a { color: var(--primary); }
.sync-drop .dz-sub { color: var(--muted); font-size: 12px; margin-top: 8px; }
.sync-result { margin-top: 16px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.sync-result h3 { font-size: 14px; margin-bottom: 10px; }
.diff-row { display: grid; grid-template-columns: 92px 1fr; gap: 10px; padding: 6px 0; border-top: 1px dashed var(--line); font-size: 13px; }
.diff-row:first-of-type { border-top: none; }
.diff-tag { font-size: 11px; border-radius: 10px; padding: 1px 8px; height: 20px; line-height: 18px; text-align: center; }
.diff-tag.add { background: #e8f7f0; color: var(--green); }
.diff-tag.del { background: #fdecec; color: var(--red); }
.diff-tag.chg { background: #fff4e6; color: var(--orange); }
.diff-tag.same { background: #f2f4f7; color: var(--muted); }
.sync-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; }
.sync-history { margin-top: 18px; }
.sync-history table { width: 100%; border-collapse: collapse; font-size: 13px; }
.sync-history th, .sync-history td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
.sync-history th { color: var(--muted); font-weight: 500; font-size: 12px; }

main { max-width: 1200px; margin: 0 auto; padding: 24px; }
.tab-panel h2 { font-size: 17px; margin-bottom: 6px; }
.hint { color: var(--muted); font-size: 12px; margin-bottom: 16px; }

/* 岗位工作台横幅 */
.role-banner { background: linear-gradient(135deg, #eef3ff, #f7faff); border: 1px solid #dbe6ff; border-radius: var(--radius); padding: 14px 18px; margin-bottom: 16px; }
.role-banner b { font-size: 16px; }
.role-banner .duty { display: block; color: var(--muted); font-size: 12px; line-height: 1.9; margin-top: 6px; }

/* 规则横幅 */
.rule-banner { background: #fff8ec; border: 1px solid #f0dfc0; border-radius: var(--radius); padding: 12px 16px; margin-bottom: 16px; line-height: 1.8; }

/* 表单（v0.25：修「输入框 / 下拉框超出界面」——网格列用 minmax(0,1fr)，控件一律 100% 宽并允许收缩） */
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 20px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.form-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; min-width: 0; }
.form-grid label.check { flex-direction: row; align-items: flex-start; flex-wrap: wrap; gap: 8px; grid-column: span 2; }
.form-grid label.check > span { flex: 1 1 300px; min-width: 0; line-height: 1.7; }
/* v0.34.0：「客户暂无统一社会信用代码」移到「工单类型」右侧同一行，只占半格 */
.form-grid label.check.check-side { grid-column: span 1; align-items: center; align-self: stretch; justify-content: flex-start; flex-wrap: nowrap; gap: 9px; padding: 8px 10px; background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; }
.form-grid label.check.check-side > span { flex: 1 1 0; font-size: 13px; line-height: 1.55; }
.form-grid label.check.check-side .fld-hint { color: var(--muted); }
.form-grid input[type="number"].ro { font-variant-numeric: tabular-nums; }
.form-grid input, .form-grid select, .form-grid textarea {
  width: 100%; max-width: 100%; min-width: 0; box-sizing: border-box;
  border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 14px; background: #fff; font-family: inherit;
}
/* 报价版本条目名很长：下拉框内省略显示，完整名称看悬停提示 */
.form-grid select { text-overflow: ellipsis; }
/* 勾选框/单选框不参与 100% 宽（否则会被拉伸、把后面的文字挤到第二列） */
.form-grid input[type="checkbox"], .form-grid input[type="radio"] { width: auto; max-width: none; min-width: 0; flex: 0 0 auto; padding: 0; margin: 0; }
.form-grid input[readonly], .form-grid input.ro { background: #f6f8fb; color: #5b6472; cursor: default; border-color: #e3e8f0; }
.form-grid input[readonly]:focus, .form-grid input.ro:focus { outline: none; border-color: #e3e8f0; }
.form-grid input:focus, .form-grid select:focus { outline: 2px solid #bcd2ff; border-color: var(--primary); }
/* 窄屏（笔记本 1366 以下 / 分屏）自动单列，避免格内控件被挤压 */
@media (max-width: 900px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid label.check, .hard-status, .form-actions, .form-grid .material-note { grid-column: span 1; }
}
.fld-hint { color: var(--orange, #c77c22); font-size: 11.5px; line-height: 1.6; }
.fld-hint.hidden { display: none; }
.hard-status { grid-column: span 2; background: #f6f8fb; border-radius: 8px; padding: 10px 14px; font-size: 13px; line-height: 1.8; }
.form-actions { grid-column: span 2; display: flex; align-items: center; gap: 14px; }

/* 工单表 */
.orders-table { width: 100%; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); border-collapse: separate; border-spacing: 0; overflow: hidden; }
.orders-table th, .orders-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); font-size: 13px; }
.orders-table th { background: #f6f8fb; color: var(--muted); font-weight: 600; }
.orders-table tr:last-child td { border-bottom: none; }
.orders-table tbody tr:hover { background: #f8faff; }
.chip { display: inline-block; padding: 2px 10px; border-radius: 20px; font-size: 12px; white-space: nowrap; }
.chip.blue { background: #e8f0ff; color: var(--primary); }
.chip.green { background: #e6f6ef; color: var(--green); }
.chip.red { background: #fdeaea; color: var(--red); }
.chip.gray { background: #eef1f5; color: var(--muted); }
.chip.orange { background: #fdf1e3; color: var(--orange); }
.row-link { color: var(--primary); cursor: pointer; background: none; border: none; font-size: 13px; }

/* 待办卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.card.overdue-card { border-color: #f3c1c3; background: #fffafa; }
.card h4 { margin-bottom: 8px; font-size: 14px; }
.card .meta { color: var(--muted); font-size: 12px; line-height: 1.9; }
.card .actions { margin-top: 12px; display: flex; gap: 8px; flex-wrap: wrap; }

/* 看板 */
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.kpi .v { font-size: 26px; font-weight: 700; margin-top: 6px; }
.kpi .l { color: var(--muted); font-size: 12px; }

/* 可下钻的统计数字：数字本身是"链接"，点开就是那一串具体工单 */
.kpi.link { cursor: pointer; position: relative; transition: border-color .15s, box-shadow .15s, transform .1s; }
.kpi.link:hover { border-color: var(--primary); box-shadow: 0 4px 14px rgba(37,99,235,.12); transform: translateY(-1px); }
.kpi.link .v { color: var(--primary); text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; }
.kpi.link::after { content: '明细 ›'; position: absolute; right: 12px; top: 12px; font-size: 11px; color: var(--primary); opacity: .65; }
.kpi.link:hover::after { opacity: 1; }
.kpi.zero .v { color: var(--muted); text-decoration: none; }
.status-link { cursor: pointer; border-bottom: 1px dotted currentColor; }
.status-link:hover { opacity: .75; }

/* 表格工具条与勾选列 */
.table-tools { display: flex; align-items: center; gap: 10px; margin: 10px 0; flex-wrap: wrap; font-size: 13px; }
.table-tools #pick-count, .table-tools #trash-count { font-weight: 600; color: var(--primary); }
/* v0.38.3：工单列表发起日期列 + 排序工具条 */
.orders-table th.col-created, .orders-table td.col-created { white-space: nowrap; font-variant-numeric: tabular-nums; }
.table-tools .sort-k { font-weight: 600; color: var(--muted); }
#orders-sort { min-height: 32px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 13px; }
#orders-sort-dir[disabled] { opacity: .45; cursor: not-allowed; }
.pick-col { width: 34px; text-align: center; }
.row-ops { display: flex; gap: 6px; flex-wrap: wrap; }

/* 通用弹窗（统计下钻 / 批复 / 确认） */
.modal-mask { position: fixed; inset: 0; background: rgba(20,30,45,.42); z-index: 40; }
.modal { position: fixed; z-index: 41; top: 8vh; left: 50%; transform: translateX(-50%);
  width: min(980px, 94vw); max-height: 82vh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 12px; box-shadow: 0 18px 50px rgba(15,25,40,.28); overflow: hidden; }
.modal.small { width: min(460px, 92vw); top: 22vh; }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.modal-head b { font-size: 15px; }
.modal-x { border: none; background: none; font-size: 16px; cursor: pointer; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.modal-x:hover { background: #eef1f5; color: var(--text); }
.modal-sub { padding: 8px 18px 0; font-size: 12px; color: var(--muted); }
.modal-body { padding: 14px 18px 18px; overflow: auto; }
.modal-body table { width: 100%; border-collapse: collapse; font-size: 13px; }
.modal-body th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.modal-body td { padding: 8px 6px; border-bottom: 1px dashed var(--line); vertical-align: middle; }
.modal-body tr:hover td { background: #fafbfd; }

/* 批复弹窗 */
.brief-head { background: #f7f9fc; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.8; margin-bottom: 12px; }
.brief-pick { max-height: 190px; overflow: auto; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 10px; }
.brief-pick label { display: flex; gap: 8px; align-items: center; padding: 5px 0; font-size: 13px; cursor: pointer; }
.brief-pick label .r { color: var(--muted); font-size: 12px; }
.brief-pick label .tag-self { font-size: 11px; color: var(--primary); background: #e8f0ff; border-radius: 10px; padding: 0 6px; }
.brief-ta { width: 100%; min-height: 92px; resize: vertical; }
.brief-tpl { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.brief-tpl button { font-size: 12px; padding: 3px 8px; border-radius: 12px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.brief-tpl button:hover { border-color: var(--primary); color: var(--primary); }
.brief-item { border-left: 3px solid var(--primary); background: #f7f9fc; padding: 8px 10px; border-radius: 0 8px 8px 0; margin-bottom: 8px; font-size: 13px; }
.brief-item .m { color: var(--muted); font-size: 12px; }
.brief-none { color: var(--muted); font-size: 13px; }
.list-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.list-panel h3 { font-size: 14px; margin-bottom: 10px; }
.list-panel ul { list-style: none; }
.list-panel li { padding: 6px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.list-panel li:last-child { border-bottom: none; }

/* 抽屉 */
.drawer-mask { position: fixed; inset: 0; background: rgba(20,30,45,.35); z-index: 20; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; width: 560px; max-width: 96vw; background: var(--panel); z-index: 21; box-shadow: -8px 0 30px rgba(0,0,0,.12); overflow-y: auto; padding: 20px 24px; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer h3 { font-size: 16px; }
.d-section { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; margin-bottom: 14px; }
.d-section h4 { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.d-section .kv { display: grid; grid-template-columns: 110px 1fr; gap: 6px 10px; font-size: 13px; }
.d-section .kv b { color: var(--muted); font-weight: 500; }
.ai-block { background: #fdeaea; border: 1px solid #f3c1c3; color: var(--red); border-radius: 8px; padding: 10px; font-size: 13px; line-height: 1.8; margin-bottom: 10px; }
.ai-warn { background: #fff8ec; border: 1px solid #f0dfc0; color: var(--orange); border-radius: 8px; padding: 10px; font-size: 13px; line-height: 1.8; margin-bottom: 10px; }
.ai-pass { background: #e6f6ef; border: 1px solid #bfe6d4; color: var(--green); border-radius: 8px; padding: 10px; font-size: 13px; line-height: 1.8; margin-bottom: 10px; }
.mat-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; font-size: 13px; flex-wrap: wrap; }
.mat-row input[type="checkbox"] { width: 16px; height: 16px; }
.file-link { color: var(--primary); font-size: 12px; text-decoration: none; }
.file-link:hover { text-decoration: underline; }

/* 图片缩略图 + 删除按钮（统一资料清单 / 材料清单共用） */
.pic, .file-chip { position: relative; display: inline-block; margin: 2px 6px 2px 0; vertical-align: middle; }
.pic a { display: block; line-height: 0; }
.pic img { width: 46px; height: 46px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.pic-del { position: absolute; top: -6px; right: -6px; width: 16px; height: 16px; border: none; border-radius: 50%;
  background: var(--red, #d64545); color: #fff; font-size: 10px; line-height: 16px; text-align: center;
  cursor: pointer; padding: 0; }
.pic-del:hover { background: #b93333; }
.file-chip .pic-del { top: -8px; right: -10px; }
.file-chip { background: #f6f8fb; border: 1px solid var(--line); border-radius: 6px; padding: 2px 6px; }
.fld-hint { display: block; font-size: 11px; color: var(--muted, #8a8f99); font-weight: 400; }
.mat-upload-label { background: #f0f5ff; color: var(--primary); border: 1px solid #c9dcff; border-radius: 6px; padding: 2px 10px; font-size: 12px; cursor: pointer; }
.mat-upload-label:hover { background: #e0ebff; }
.countdown { color: var(--orange); font-weight: 600; }
.timeline { list-style: none; font-size: 12px; }
.timeline li { position: relative; padding: 6px 0 6px 18px; border-left: 2px solid var(--line); margin-left: 6px; }
.timeline li::before { content: ''; position: absolute; left: -5px; top: 12px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline .t { color: var(--muted); margin-right: 8px; }
.op-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; align-items: center; }
.op-row select, .op-row input { border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px; font-size: 13px; }
.reason-box { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 13px; min-height: 60px; font-family: inherit; }

.toast { position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%); background: #1f2d3d; color: #fff; padding: 10px 20px; border-radius: 10px; font-size: 13px; z-index: 50; max-width: 80vw; }
.toast.err { background: var(--red); }

/* 消息中心（企业微信通知镜像） */
.msg-btn { position: relative; margin-right: 4px; }
.msg-dot { position: absolute; top: -6px; right: -6px; min-width: 16px; height: 16px; line-height: 16px; padding: 0 4px; border-radius: 9px; background: var(--red); color: #fff; font-size: 10px; text-align: center; }
.msg-panel { position: fixed; top: 56px; right: 16px; width: 380px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 32px rgba(20,35,60,.14); z-index: 40; }
.msg-panel .hd { display: flex; justify-content: space-between; align-items: center; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.msg-panel .hd .ch { font-weight: 400; color: var(--muted); font-size: 11.5px; }
.msg-item { padding: 10px 14px; border-bottom: 1px dashed var(--line); font-size: 12.5px; line-height: 1.7; }
.msg-item.unread { background: #f5f8ff; }
.msg-item .t { color: var(--muted); font-size: 11.5px; display: flex; justify-content: space-between; }
.msg-item .sub { font-weight: 600; margin: 2px 0; }
.msg-item pre { white-space: pre-wrap; font-family: inherit; margin: 4px 0 0; color: #35424f; }
.msg-empty { padding: 26px 14px; text-align: center; color: var(--muted); font-size: 12.5px; }

/* 工商注册 8 项资料 + AI 预审 */
.gs-hint { margin-top: 8px; font-size: 12.5px; line-height: 1.8; }
.gs-hint .ok { color: var(--green); font-weight: 600; }
.gs-hint .er { color: var(--red); }
.gs-hint .wr { color: #a05a00; }
.gs-list { margin: 6px 0 0; padding-left: 18px; }
.gs-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px dashed var(--line); font-size: 12.5px; flex-wrap: wrap; }
.gs-row:last-child { border-bottom: 0; }
.gs-row .k { min-width: 190px; color: #35424f; }
.gs-row input[type=text] { flex: 1; min-width: 160px; }
/* 文本项有未保存修改：橙色描边提醒（上传图片/刷新不会清空，点「保存当前资料」写入） */
.gs-row input[type=text].dirty { border-color: #e0a03a; box-shadow: 0 0 0 2px rgba(224, 160, 58, .14); background: #fffdf7; }
.gs-badge { font-size: 11px; padding: 1px 6px; border-radius: 8px; }
.gs-badge.ok { background: #e8f7ee; color: #127a3c; }
.gs-badge.er { background: #fdeaea; color: #b3261e; }
.gs-badge.wr { background: #fff4e0; color: #a05a00; }
/* 人工核验（AI 无 OCR：真伪由人签字负责） */
.gs-manual { display: flex; align-items: flex-start; gap: 6px; margin: 10px 0 2px; padding: 8px 10px;
  background: #fff8e6; border: 1px solid #f0d9a8; border-radius: 6px; font-size: 12.5px; line-height: 1.6; }
.gs-manual input { margin-top: 3px; }
.gs-manual.done { background: #eef8f1; border-color: #bfe0c9; color: #127a3c; font-weight: 600; }
.gs-manual-tag { margin-left: 6px; font-size: 10.5px; padding: 0 5px; border-radius: 7px; background: #fff1d6; color: #a05a00; }
.gs-manual-tag.er { background: #fdeaea; color: #b3261e; font-weight: 600; }
/* AI 驳回条（v0.12：①② 识别不到 = 不通过，不是提示） */
.ai-reject-bar { margin: 10px 0 0; padding: 10px 12px; border-radius: 8px; border: 1px solid #f0b8b3;
  background: #fdf1f0; color: #7d1b14; font-size: 12.5px; line-height: 1.75; }
.ai-reject-bar .arb-title { font-weight: 700; color: #b3261e; font-size: 13px; }
.ai-reject-bar .gs-list { margin: 4px 0 0; }
.ai-reject-bar .gs-list .er { color: #b3261e; }

/* 提单页：资料不在此填写 */
.material-note { grid-column: 1 / -1; background: #f3f7ff; border: 1px dashed #c9dcff; border-radius: 8px; padding: 10px 14px; font-size: 12.5px; line-height: 1.8; color: #34507a; }

/* 折扣闸（QT-D5） */
.disc-hint { grid-column: 1 / -1; margin-top: 8px; background: #fff8ec; border: 1px solid #f0dfc0; border-radius: 8px; padding: 9px 12px; font-size: 12.5px; line-height: 1.8; color: #8a5a00; }
.disc-hint.miss { background: #fdecec; border-color: #f3c1c3; color: #a5241c; }
.disc-box { border-radius: 8px; padding: 10px 12px; font-size: 13px; line-height: 1.9; border: 1px solid var(--line); background: #f8fafc; }
.disc-box.ok { background: #eef8f1; border-color: #bfe0c9; }
.disc-box.no { background: #fdf1f1; border-color: #f0c7c7; }
.disc-box.pending { background: #fff8ec; border-color: #f0dfc0; }
.disc-line { margin-top: 4px; color: #3a4757; }
.disc-row { display: flex; gap: 12px; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.disc-row:last-child { border-bottom: none; }
.disc-main { font-size: 13px; line-height: 1.7; }

/* 资料补充（独立页面） */
.fill-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 14px; }
.fill-summary .fs { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fill-summary .fs b { display: block; font-size: 24px; font-weight: 700; }
.fill-summary .fs span { color: var(--muted); font-size: 12px; }
.fill-summary .fs.bad { border-color: #f3c1c3; background: #fffafa; }
.fill-summary .fs.bad b { color: var(--red); }
.fill-ready { margin-top: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.fill-ready h3 { font-size: 13px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.fill-head { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 14px; }
.fill-title { font-size: 16px; font-weight: 700; }
.fill-timer { margin-top: 10px; padding: 8px 12px; border-radius: 8px; background: #fff8ec; border: 1px solid #f0dfc0; color: #8a5a00; font-size: 13px; }
.fill-timer.bad { background: #fdecec; border-color: #f3c1c3; color: var(--red); font-weight: 600; }
.fill-foot { margin: 10px 0 20px; }

/* 财务审批操作区（N04：只核三件事） */
.fin-panel { border: 1px solid #cfe0f5; background: #f7fbff; border-radius: 10px; padding: 12px 14px; }
.fin-title { font-size: 13.5px; font-weight: 700; color: #1f4d7a; margin-bottom: 8px; }
.fin-step { display: flex; gap: 10px; align-items: flex-start; flex-wrap: wrap; padding: 9px 0; border-top: 1px dashed #d8e6f5; }
.fin-step:first-of-type { border-top: none; }
.fin-no { flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%; background: #1f4d7a; color: #fff;
  font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; margin-top: 1px; }
.fin-step .check { font-size: 13px; line-height: 1.7; }
/* v0.38.6：核验 / 收款栏的文字与右侧状态标签分列，标签不再把说明挤成一字一行 */
.fin-step .fin-body { flex: 1 1 240px; min-width: 0; }
.fin-step .check > span { min-width: 0; }
.fin-step > .chip { flex: 0 0 auto; max-width: 46%; white-space: normal; text-align: center; }
.fin-step .fin-mc { margin: 4px 0 0; font-size: 12px; color: var(--muted); line-height: 1.6; word-break: break-word; }
.fin-step select { padding: 5px 8px; border: 1px solid var(--line); border-radius: 7px; font-size: 13px; }
.fin-step > .hint { flex: 1 1 200px; min-width: 0; }
.fin-step .op-row { gap: 8px; }

/* 发单人信息条（审批 / 查阅界面的第一眼信息） */
.who-bar, .approve-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 10px 12px; border-radius: 9px; background: #f2f6fb; border: 1px solid #dbe6f2; }
.approve-head { margin-bottom: 10px; }
.who-k { flex: 0 0 auto; font-size: 12px; font-weight: 700; color: #1f4d7a; background: #dfeaf7;
  padding: 2px 8px; border-radius: 20px; }
.who-v { font-size: 14px; font-weight: 700; color: var(--text, #1f2d3d); }
.who-m { font-size: 12.5px; color: var(--muted, #7a8797); }

/* 进审批闸门提示（AI 未通过 / 资料没提交齐 → 不进审批） */
.gate-bar { margin-top: 8px; padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.75;
  background: #fff8ec; border: 1px solid #f0dfc0; color: #8a5a00; }
.gate-bar.bad { background: #fdecec; border-color: #f3c1c3; color: #9a2c31; }
/* v0.27.1：折扣已同意 / 回到提交页的绿色提示条 */
.gate-bar.ok { background: #eef8f1; border-color: #bfe0c9; color: #14663a; }
.gate-bar.ok b { color: #0f5c32; }
/* v0.27.2：合同归属风险 —— 财务工作台警示条 / 详情与复核面板红条 */
.entity-alert { margin-top: 8px; padding: 10px 12px; border-radius: 9px; font-size: 13px; line-height: 1.75;
  background: #fdecec; border: 1px solid #f3c1c3; color: #9a2c31; }
.entity-alert b { color: #b3261e; }
.entity-alert .gs-list { margin: 6px 0 0; padding-left: 18px; }
.entity-alert .gs-list li { margin: 3px 0; }
.entity-alert a { color: #b3261e; text-decoration: underline; }

/* ===== v0.24 ==== */
/* 按钮靠右占位（资料补充页顶部：返回 / 详情 …… 删除当前订单） */
.spacer { flex: 1 1 auto; }

/* 已闭环工单查询（负责人 / 总经理工作台） */
.closed-filter { gap: 10px; margin-top: 4px; }
.closed-filter .inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); }
.closed-filter input[type="date"] { min-width: 134px; }
.closed-filter input#cl-kw { min-width: 240px; }
#cl-result .orders-table { margin-top: 2px; }

/* 文本项失焦即识别：字段下方的问题提示（有问题才出现，没问题自动收起） */
.gs-row-text .gs-field { flex: 1; display: flex; flex-direction: column; gap: 3px; min-width: 180px; }
.gs-row-text .gs-field input[type="text"] { flex: 0 0 auto; width: 100%; }
.gs-ftip { font-size: 11.5px; line-height: 1.55; color: var(--red); }
.gs-ftip.hidden { display: none; }
.gs-row input[type="text"].bad { border-color: #e5a9ac; box-shadow: 0 0 0 2px rgba(217, 54, 62, .12); background: #fffafb; }

/* ===== 模式二 · AI 对话助手抽屉 ===== */
.ai-mask { position: fixed; inset: 0; background: rgba(15,23,42,.28); z-index: 80; }
.ai-mask.hidden, .ai-drawer.hidden, .ai-cfg.hidden { display: none; }
.ai-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 480px; max-width: 96vw; background: #fff; border-left: 1px solid var(--line); box-shadow: -12px 0 40px rgba(15,23,42,.12); z-index: 81; display: flex; flex-direction: column; }
.ai-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.ai-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ai-mode-tag { font-size: 11px; font-weight: 500; color: var(--primary); background: #eef3ff; border-radius: 10px; padding: 2px 8px; }
.ai-sub { padding: 8px 16px; font-size: 12px; color: var(--muted); border-bottom: 1px dashed var(--line); }
.ai-sub .warn-text, .warn-text { color: #c0392b; }
.ai-skills { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 16px; border-bottom: 1px dashed var(--line); }
.ai-chip { border: 1px solid var(--line); background: #f7f9fd; border-radius: 14px; padding: 4px 12px; font-size: 12px; cursor: pointer; transition: .15s; }
.ai-chip:hover { border-color: var(--primary); color: var(--primary); background: #eef3ff; }
/* v0.34.1 · 技能选项：下拉 / 学习说明 / 参数试填（清单来自 ai/skills.json） */
.ai-skillbar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 8px 16px; border-bottom: 1px dashed var(--line); }
.ai-skillbar-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.ai-skillbar select { flex: 1 1 190px; min-width: 0; max-width: 100%; height: 32px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12px; background: #fff; }
.ai-skillbar .btn, .ai-skillbar .linklike { flex: 0 0 auto; font-size: 12px; }
.ai-skillbar-hint { font-size: 11px; color: var(--muted); white-space: nowrap; }
.ai-chip.active { border-color: var(--primary); color: var(--primary); background: #eef3ff; font-weight: 600; }
.ai-skilldoc { max-height: 240px; overflow-y: auto; padding: 10px 16px; border-bottom: 1px dashed var(--line); background: #fbfcff; font-size: 12px; }
.ai-skilldoc-h { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.ai-skilldoc-h b { font-size: 13px; }
.ai-skilldoc-h code, .ai-skilldoc-kv code, .ai-skilldoc-note code { background: #eef3fb; border-radius: 4px; padding: 1px 5px; font-size: 11px; color: #2f6fed; }
.ai-skilldoc-tag { font-size: 11px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; padding: 1px 8px; }
.ai-skilldoc-note { color: var(--muted); line-height: 1.7; margin-bottom: 8px; }
.ai-skilldoc-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px 14px; }
.ai-skilldoc-grid h6 { margin: 0 0 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.ai-skilldoc-kv { display: flex; flex-wrap: wrap; gap: 4px; line-height: 1.6; margin-bottom: 3px; word-break: break-word; }
.ai-skilldoc-pre { margin: 0; background: #f1f5fb; border-radius: 6px; padding: 6px; font-size: 11px; white-space: pre-wrap; max-height: 90px; overflow: auto; }
.ai-skillargs { margin-top: 8px; }
.ai-skillargs-t { font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.ai-skillargs label { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ai-skillargs label span { min-width: 72px; font-weight: 600; }
.ai-skillargs input { flex: 1 1 120px; min-width: 0; max-width: 100%; height: 30px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12px; }
.ai-skilldoc-guide { margin-top: 8px; padding: 8px; background: #f1f5fb; border-radius: 8px; color: var(--muted); line-height: 1.7; }
/* v0.34.2 · 上传技能自动学习：说明面板里的试跑 / 移除，以及文档型技能的知识预览 */
.ai-skilldoc .ai-skillargs .btn { margin: 0 6px 4px 0; }
.ai-msg .ai-knowledge { max-height: 220px; overflow-y: auto; white-space: pre-wrap; background: #f4f6fa; border-radius: 8px; padding: 8px; font-size: 11px; line-height: 1.6; }
.ai-skillbar #ai-skill-upload[disabled] { opacity: .6; cursor: wait; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; background: #fafbfd; }
.ai-msg { max-width: 92%; border-radius: 12px; padding: 10px 12px; font-size: 13px; line-height: 1.65; word-break: break-word; }
.ai-msg.user { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.ai-msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.ai-msg .ai-pre { max-height: 260px; overflow: auto; background: #f4f6fa; border-radius: 8px; padding: 8px; font-size: 11px; line-height: 1.5; margin-top: 6px; white-space: pre-wrap; }
/* v0.36.1 · 大模型报错卡片：标题红、细节灰，长文不糊成一整段 */
.ai-err { background: #fdf3f2; border-left: 3px solid #c0392b; border-radius: 6px; padding: 9px 11px; }
.ai-err-head { color: #c0392b; font-weight: 600; line-height: 1.7; }
.ai-err-line { margin-top: 5px; font-size: 12px; color: #6b5b58; line-height: 1.6; word-break: break-word; }
.ai-msg .ai-meta { margin-top: 8px; font-size: 11px; color: var(--muted); }
/* v0.29.1 · 技能结果中文摘要：要点 + 可横滑表格 + 可折叠原始 JSON */
.ai-msg .ai-h { font-size: 13px; margin: 2px 0 6px; }
.ai-msg .ai-h b { font-weight: 500; }
.ai-msg .ai-kpi { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 8px; }
.ai-msg .ai-kpi span { background: #f1f5fb; border: 1px solid var(--line); border-radius: 8px; padding: 5px 9px; font-size: 12px; }
.ai-msg .ai-kpi b { font-size: 14px; font-weight: 500; color: var(--primary); }
.ai-msg .ai-table { width: 100%; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 6px 0; }
.ai-msg .ai-table table { width: auto; min-width: 100%; border-collapse: collapse; font-size: 12px; white-space: nowrap; }
.ai-msg .ai-table th, .ai-msg .ai-table td { border-bottom: 1px solid var(--line); padding: 6px 8px; text-align: left; }
.ai-msg .ai-table th { background: #f7f9fc; color: var(--muted); font-weight: 500; }
.ai-msg .ai-table td { max-width: 420px; overflow: hidden; text-overflow: ellipsis; }
.ai-msg .ai-argrow { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.ai-msg .ai-argrow select { flex: 1 1 200px; min-width: 0; max-width: 100%; height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; font-size: 12px; background: #fff; }
.ai-msg .ai-note, .ai-msg .ai-empty { font-size: 12px; color: var(--muted); margin: 6px 0; }
.ai-msg .ai-raw { margin-top: 8px; font-size: 12px; color: var(--muted); }
.ai-msg .ai-raw summary { cursor: pointer; user-select: none; }
.ai-cfg { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 8px; background: #fff; }
.ai-cfg label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 4px; font-weight: 600; }
.ai-cfg input, .ai-cfg select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13px; }
.ai-cfg-row { display: flex; align-items: center; gap: 10px; }
.ai-cfg-row .hint { font-size: 11px; color: var(--muted); }
.ai-inputrow { padding: 12px 16px; border-top: 1px solid var(--line); background: #fff; position: relative; }
.ai-slash { position: absolute; left: 16px; right: 16px; bottom: 100%; margin-bottom: 6px; max-height: 230px; overflow-y: auto; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(15,23,42,.14); padding: 6px; z-index: 6; }
.ai-slash.hidden { display: none; }
.ai-slash-h { font-size: 11px; color: var(--muted); padding: 4px 8px 6px; }
.ai-slash-empty { font-size: 12px; color: var(--muted); padding: 8px; line-height: 1.6; }
.ai-slash-item { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: 7px; cursor: pointer; }
.ai-slash-item:hover, .ai-slash-item.active { background: #eef3fb; }
.ai-slash-item b { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.ai-slash-item code { font-size: 11px; color: #2f6fed; }
.ai-slash-tag { margin-left: auto; font-size: 11px; color: var(--muted); white-space: nowrap; }
.ai-inputrow textarea { width: 100%; resize: none; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font-size: 13px; font-family: inherit; line-height: 1.5; }
.ai-inputrow textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.12); }
.ai-inputbtns { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.ai-inputbtns-l { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ai-inputbtns-l .linklike { font-size: 12px; white-space: nowrap; }

/* v0.35.0 · 参考文件：对话栏旁的附件区（随本轮提问生效） */
.ai-refs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 8px; }
.ai-refs.hidden { display: none; }
.ai-ref-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 9px; border: 1px solid #cfdafa; background: #f2f6ff; border-radius: 999px; font-size: 11px; color: #1d3f8f; }
.ai-ref-chip b { font-weight: 600; max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ai-ref-chip i { font-style: normal; color: #4a6bb0; white-space: nowrap; }
.ai-ref-x { border: 0; background: transparent; color: #57719f; font-size: 13px; line-height: 1; padding: 1px 4px; cursor: pointer; border-radius: 999px; }
.ai-ref-x:hover { background: #dbe5fb; color: #b42318; }
.ai-ref-tip { font-size: 11px; color: var(--muted); }
.ai-ref-inline { margin-top: 6px; font-size: 11px; line-height: 1.6; color: #4a6bb0; background: #f2f6ff; border: 1px solid #dbe5fb; border-radius: 8px; padding: 4px 8px; }
.ai-msg.user .ai-ref-inline { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.34); color: #fff; }

/* ===== v0.29.0 移动端 / PWA 适配 ===== */
@media (max-width: 720px) {
  html, body { overflow-x: clip; }
  .topbar { gap: 8px; padding: 8px 12px; }
  .brand { font-size: 14px; }
  .brand .tag { font-size: 10px; padding: 1px 6px; }
  .tabs { order: 3; flex: 1 0 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; padding-bottom: 2px; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 0 0 auto; white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  .me { order: 2; flex: 1 1 100%; min-width: 0; max-width: 100%; flex-wrap: wrap; gap: 6px 8px; font-size: 12px; white-space: normal; }
  .me > * { min-width: 0; max-width: 100%; }
  .me button, .me .identity-switch { max-width: 100%; }
  .me button { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* v0.40.0：身份切换容器不能裁剪 —— 原来这里 overflow:hidden 会把下拉菜单整块裁掉，
     手机端点「身份：xx ▾」看起来毫无反应。按钮自身的省略效果保留在 .me button 上。 */
  .me .identity-switch { overflow: visible; }
  .me .badge { display: none; }
  main { padding: 12px; }
  .tab-panel { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .orders-table { min-width: 940px; }   /* v0.38.3：多一列发起日期，手机端改为横向滑动，别再挤成豆腐块 */
  .table-tools { gap: 6px; font-size: 12px; }
  .login-card { width: 100%; padding: 22px 18px; border-radius: 14px; }
  .login-form { max-width: 100%; }
  .lf-row input, .btn, button, select { min-height: 38px; }
  .form-grid { padding: 14px; grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .form-grid label.check, .hard-status, .form-actions, .form-grid .material-note { grid-column: span 1; }
  .role-banner, .rule-banner { padding: 12px; }
  .drawer { width: 100vw; max-width: 100vw; padding: 16px 14px; }
  .ai-drawer { width: 100vw; max-width: 100vw; }
  .ai-sub, .ai-skills, .ai-skillbar, .ai-skilldoc, .ai-log, .ai-cfg, .ai-inputrow { padding-left: 12px; padding-right: 12px; }
  .ai-skillbar select { flex-basis: 100%; }
  .ai-skilldoc-grid { grid-template-columns: minmax(0, 1fr); }
  .ai-skilldoc { max-height: 200px; }
  .ai-msg { max-width: 96%; min-width: 0; }
  .ai-msg .ai-table table { font-size: 11px; }
  .ai-msg .ai-table td { max-width: 260px; }
  .ai-msg .ai-argrow select { flex-basis: 100%; }
  .ai-inputbtns-l { gap: 8px; }
  .ai-ref-chip b { max-width: 120px; }
  .ai-ref-tip { flex-basis: 100%; }
  .ai-cfg-row { flex-wrap: wrap; }
  .toast { bottom: 18px; max-width: 92vw; font-size: 12px; }
}
/* 刘海屏 / 手势条安全区（PWA 全屏与 WebView 均生效） */
@supports (padding: env(safe-area-inset-bottom)) {
  .ai-inputrow { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .login-screen { padding-bottom: env(safe-area-inset-bottom); }
}

/* ===== v0.33.0 侧栏布局 + 首页重排（覆盖式增量，不动历史规则） ===== */
.app { display: grid; grid-template-columns: 196px minmax(0, 1fr); min-height: 100vh; align-items: start; }
.app-body { min-width: 0; }
.sidebar { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--panel); border-right: 1px solid var(--line); padding: 16px 11px; display: flex; flex-direction: column; gap: 2px; z-index: 20; }
.side-brand { font-size: 15px; font-weight: 700; padding: 2px 8px 14px; white-space: nowrap; }
.side-brand .tag { font-size: 10px; background: #eef2ff; color: var(--primary); border-radius: 20px; padding: 2px 7px; margin-left: 6px; font-weight: 500; }
.side-group { font-size: 11px; color: var(--muted); padding: 12px 9px 5px; letter-spacing: .05em; }
.side-foot { margin-top: auto; border-top: 1px solid var(--line); padding: 12px 6px 2px; display: flex; align-items: center; gap: 9px; }
.side-av { width: 30px; height: 30px; border-radius: 50%; background: #eef3ff; color: var(--primary); display: flex; align-items: center; justify-content: center; font-size: 11px; flex: 0 0 auto; }
.side-foot b { display: block; font-size: 12px; font-weight: 600; }
.side-foot small { display: block; font-size: 11px; color: var(--muted); }
.tabs { display: flex; flex-direction: column; gap: 2px; flex: 0 0 auto; min-width: 0; }
.tab-btn { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; border: none; background: none; padding: 9px 11px; border-radius: 8px; color: #5a6779; font-size: 13px; white-space: nowrap; }
.tab-btn::before { content: ""; width: 13px; height: 13px; border-radius: 4px; background: #cfd8e6; flex: 0 0 auto; }
.tab-btn:hover { background: #f5f8fd; }
.tab-btn.active { background: #eef3ff; color: var(--primary); font-weight: 600; }
.tab-btn.active::before { background: var(--primary); }
.topbar { flex-wrap: nowrap; gap: 12px; padding: 0 24px; height: 54px; }
.crumb { font-size: 12px; color: var(--muted); white-space: nowrap; }
.crumb b { color: var(--text); font-weight: 600; }
.crumb-sp { flex: 1; }
main { max-width: 1240px; }

.home-hero { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.home-hero h1 { font-size: 18px; font-weight: 700; }
.home-hero p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.hero-ops { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.home-duty { background: #f7f9fc; border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 16px; font-size: 12px; color: var(--muted); line-height: 1.9; margin-bottom: 12px; }
.home-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.home-kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 15px; cursor: pointer; }
.home-kpi:hover { border-color: #bccbe4; }
.home-kpi .k { font-size: 12px; color: var(--muted); }
.home-kpi .v { font-size: 24px; font-weight: 700; margin-top: 4px; line-height: 1.15; }
.home-kpi .v.blue { color: var(--primary); }
.home-kpi .v.red { color: var(--red); }
.home-kpi .s { font-size: 11px; color: var(--muted); margin-top: 3px; }
.home-cols { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.home-cols > div > * { margin-bottom: 14px; }
.home-cols > div > *:last-child { margin-bottom: 0; }

@media (max-width: 1000px) {
  .app { grid-template-columns: 168px minmax(0, 1fr); }
  .topbar { padding: 0 14px; }
}
@media (max-width: 720px) {
  .app { display: block; }
  .sidebar { position: fixed; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: auto; max-height: 70px; padding: 6px 5px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--line); flex-direction: row; overflow: visible; box-shadow: 0 -2px 12px rgba(31,45,61,.06); }
  .side-brand, .side-group, .side-foot { display: none; }
  .tabs { flex-direction: row; width: 100%; gap: 2px; overflow-x: auto; scrollbar-width: none; order: 0; flex: 1 1 auto; padding: 0; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab-btn { flex: 1 0 auto; min-width: 62px; flex-direction: column; gap: 3px; padding: 5px 4px; font-size: 11px; text-align: center; white-space: nowrap; }
  .tab-btn::before { width: 14px; height: 14px; }
  .topbar { height: 48px; flex-wrap: nowrap; gap: 6px; padding: 0 12px; }
  .me { order: 0; flex: 0 0 auto; min-width: 0; max-width: none; flex-wrap: nowrap; gap: 5px; white-space: nowrap; font-size: 12px; }
  .me #me-info { display: none; }
  .me .btn.sm { padding: 0 7px; font-size: 11px; }
  .me > * { min-width: 0; }
  main { padding: 12px 12px 88px; max-width: 100%; }
  .home-hero { padding: 12px 14px; flex-wrap: wrap; }
  .home-hero h1 { font-size: 16px; }
  .hero-ops { width: 100%; margin-left: 0; }
  .hero-ops .btn { flex: 1; }
  .home-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .home-kpi .v { font-size: 21px; }
  .home-cols { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .list-panel { padding: 13px; }
  .list-panel li { font-size: 13px; line-height: 1.7; }
  .toast { bottom: 80px; }
}

/* v0.33.0 细节修正：右栏 KPI 板改两列、防撑宽、手机顶栏瘦身 */
.home-main, .home-rail { min-width: 0; }
.home-rail .board { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.home-rail .kpi { padding: 12px; }
.home-rail .kpi .l { font-size: 11px; line-height: 1.5; }
.home-rail table.orders-table { table-layout: fixed; width: 100%; }
.home-rail table.orders-table th, .home-rail table.orders-table td { overflow-wrap: anywhere; }
.crumb-pre { color: var(--muted); }
@media (max-width: 720px) {
  .crumb-pre { display: none; }
  .me .identity-switch > button { max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; padding: 0 6px; }
  .tab-btn { width: auto; flex: 1 1 0; min-width: 0; }
}

/* v0.34.0 上线核验修正：721~1000px 顶栏防横向溢出。
   该区间 topbar 为 nowrap，而财务/负责人身份切换按钮与筛选下拉较宽，
   .me 默认不可收缩，会把页面撑出 6~32px。此处允许收缩并隐藏冗余用户信息。 */
@media (min-width: 721px) and (max-width: 1000px) {
  .topbar, .crumb, .me { min-width: 0; }
  .crumb { overflow: hidden; text-overflow: ellipsis; }
  .me { flex: 0 1 auto; max-width: 100%; }
  .me > * { min-width: 0; }
  .me #me-info { display: none; }
  .me select { max-width: 170px; }
  .me .identity-switch > button { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
  /* v0.31 负责人审核授权面板的人员下拉（#head-auth-user）在 881px 视口会外溢 18px */
  .op-row select { max-width: min(220px, 100%); min-width: 0; }
}

/* ---------- 采集出表（v0.37.0） ---------- */
.collect-drop { border: 1.5px dashed #c8d4e6; border-radius: 12px; padding: 26px; text-align: center; background: #fbfcff; transition: .15s; margin-bottom: 14px; }
.collect-drop.over { border-color: var(--primary); background: #f0f5ff; }
.collect-drop .dz-main { font-size: 14px; }
.collect-drop .dz-main a { color: var(--primary); }
.collect-drop .dz-sub { color: var(--muted); font-size: 12px; margin-top: 8px; }

.cf-status { display: flex; align-items: center; gap: 8px; background: #eef4ff; border: 1px solid #d8e4ff; color: var(--primary); border-radius: 8px; padding: 8px 12px; font-size: 12px; margin-bottom: 12px; }
.cf-spin { width: 12px; height: 12px; border: 2px solid #b9cdfb; border-top-color: var(--primary); border-radius: 50%; animation: cfspin .8s linear infinite; display: inline-block; }
@keyframes cfspin { to { transform: rotate(360deg); } }

.cf-files-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; font-size: 13px; flex-wrap: wrap; }
.cf-files-head .hint { margin: 0; }

.cf-card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 10px; }
.cf-card-head { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-size: 13px; }
.cf-tag { font-size: 11px; background: #eef2ff; color: var(--primary); border-radius: 10px; padding: 1px 8px; }

.cf-block { border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; background: #fcfdff; }
.cf-block.on { border-color: #bcd0f7; background: #f8fbff; }
.cf-block-top { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 13px; }
.cf-meta { color: var(--muted); font-size: 12px; margin-left: auto; }
.cf-note { color: var(--orange); font-size: 12px; margin: 6px 0 0 24px; line-height: 1.55; }
.cf-prev { margin: 8px 0 2px 24px; overflow-x: auto; }
.cf-prev table { border-collapse: collapse; font-size: 11px; color: var(--muted); }
.cf-prev th, .cf-prev td { border: 1px solid #eef1f5; padding: 3px 6px; max-width: 180px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cf-prev th { background: #f6f8fb; font-weight: 600; }

.cf-setup { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 14px 0; }
.cf-setup-row { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; font-size: 13px; }
.cf-base { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.cf-base select { height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 8px; font-size: 13px; background: #fff; color: var(--text); max-width: 320px; }
.cf-setup .check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); cursor: pointer; }
.cf-keys { margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--line); display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.cf-keys-label { font-size: 12px; color: var(--muted); }
.cf-key { background: #f6f8fb; border-radius: 6px; padding: 3px 8px; }
.cf-setup-actions { display: flex; align-items: center; gap: 12px; margin-top: 14px; }
.cf-setup-actions .hint { margin: 0; }

.cf-stat { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 16px 0 10px; font-size: 13px; }
.cf-stat b { font-size: 15px; }
.cf-stat span { color: var(--muted); font-size: 12px; }
.cf-warn { color: var(--orange) !important; }

.cf-export { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin-bottom: 12px; font-size: 13px; }
.cf-export label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.cf-export input { height: 30px; width: 220px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; font-size: 13px; font-family: inherit; }
.cf-export .hint { margin: 0; }

.cf-review { background: #fffbf0; border: 1px solid #f5e2bd; border-radius: var(--radius); padding: 10px 14px; margin-bottom: 12px; font-size: 12px; color: #8a6116; }
.cf-review summary { cursor: pointer; font-weight: 600; }
.cf-review ul { margin: 8px 0 0 4px; list-style: none; max-height: 200px; overflow: auto; }
.cf-review li { padding: 3px 0; line-height: 1.6; }
.cf-rtype { display: inline-block; background: #f7e6c4; border-radius: 8px; padding: 0 6px; margin-right: 6px; font-size: 11px; }
.cf-rrow { color: #a9822c; margin-right: 6px; }
.cf-clean { background: #f2fbf6; border: 1px solid #cdecd9; color: var(--green); border-radius: var(--radius); padding: 9px 14px; font-size: 12px; margin-bottom: 12px; }

.cf-tablewrap { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: auto; max-height: 70vh; }
.cf-table { border-collapse: separate; border-spacing: 0; font-size: 12px; width: 100%; }
.cf-table th { position: sticky; top: 0; z-index: 2; background: #f6f8fb; border-bottom: 1px solid var(--line); border-right: 1px solid #eef1f5; padding: 4px 6px; text-align: left; white-space: nowrap; }
.cf-th { border: 1px solid transparent; background: transparent; font: inherit; font-weight: 600; color: var(--text); padding: 3px 4px; border-radius: 5px; min-width: 70px; width: 100%; }
.cf-th:hover { border-color: var(--line); background: #fff; }
.cf-th:focus { outline: none; border-color: var(--primary); background: #fff; }
.cf-table td { border-bottom: 1px solid #f0f3f7; border-right: 1px solid #f4f6fa; padding: 6px 8px; vertical-align: top; line-height: 1.6; min-width: 70px; max-width: 340px; white-space: pre-wrap; word-break: break-word; cursor: text; }
.cf-table td:hover { background: #fafcff; }
.cf-table td:focus { outline: 2px solid #bcd0f7; outline-offset: -2px; background: #fff; }
.cf-table tr.mark td { background: #fffaf0; }
.cf-table tr.mark td:focus { background: #fff; }
.cf-opcol { width: 40px; min-width: 40px; text-align: center; }
.cf-table td.cf-opcol { cursor: default; }
.cf-rdel { margin-left: 10px; font-size: 11px; }

/* ---------- 本地读写（v0.38.0） ---------- */
.ai-local { display: flex; align-items: center; gap: 8px; padding: 7px 18px; font-size: 12px; color: var(--muted); border-bottom: 1px solid #eef1f5; background: #fbfcff; }
.ai-local-dot { width: 8px; height: 8px; border-radius: 50%; background: #c9d2e0; flex: none; }
.ai-local-dot.on { background: var(--green); box-shadow: 0 0 0 3px rgba(26,156,107,.14); }
.ai-local-dot.idle { background: var(--orange); }
.ai-local-dot.off { background: #c9d2e0; }
.ai-local-text { flex: 1; line-height: 1.5; }
.ai-local-text b { color: var(--text); }

.ai-localpanel { padding: 12px 18px 14px; border-bottom: 1px solid #eef1f5; background: #f7f9fd; font-size: 12px; }
.ai-local-note { line-height: 1.65; color: #6b5a2e; background: #fffbf0; border: 1px solid #f5e2bd; border-radius: 8px; padding: 8px 10px; }
.ai-local-note.sub { margin-top: 8px; background: #f2f6fd; border-color: #d8e4ff; color: var(--muted); }
.ai-local-note.sub b { color: var(--text); }
.ai-local-row { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 10px; }
.ai-lcheck { display: inline-flex; align-items: center; gap: 5px; cursor: pointer; color: var(--text); }
.ai-lcheck .tip { color: var(--muted); font-size: 11px; }
.ai-local-roots { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 9px; }
.ai-root-chip { display: inline-flex; align-items: center; gap: 4px; background: #fff; border: 1px solid #d8e4ff; color: var(--primary); border-radius: 12px; padding: 2px 4px 2px 9px; max-width: 100%; }
.ai-root-x { border: none; background: transparent; color: var(--muted); cursor: pointer; font-size: 13px; line-height: 1; padding: 0 3px; }
.ai-root-x:hover { color: var(--red); }
.ai-local-sug { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-bottom: 8px; color: var(--muted); }
.ai-local-sug button { font-size: 11px; }
.ai-local-add { display: flex; gap: 6px; }
.ai-local-add input { flex: 1; height: 28px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px; font-size: 12px; font-family: inherit; background: #fff; color: var(--text); }
.ai-local-add input:focus { outline: none; border-color: var(--primary); }
.ai-local-tip { margin-top: 7px; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* 对话里的本地文件操作轨迹 */
.ai-trace { background: #f4f8ff; border: 1px solid #dbe7fb; border-radius: 8px; padding: 7px 10px; margin-bottom: 8px; font-size: 12px; }
.ai-trace summary { cursor: pointer; color: var(--primary); font-weight: 600; }
.ai-trace ul { list-style: none; margin: 7px 0 0; }
.ai-trace li { display: flex; align-items: baseline; gap: 7px; padding: 3px 0; border-top: 1px dashed #e2ebf9; line-height: 1.5; }
.ai-trace li:first-child { border-top: none; }
.ai-trace li.bad .ai-tool-brief { color: var(--red); }
.ai-tool-name { flex: none; color: var(--text); font-weight: 600; }
.ai-tool-brief { flex: 1; color: var(--muted); word-break: break-all; }
.ai-tool-ms { flex: none; color: #a7b2c4; font-size: 11px; }

/* v0.38.7 · 本人改密 / GM 全员密码表 */
.pwd-form { grid-template-columns: 1fr !important; gap: 10px; }
.pwd-form label { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.pwd-form input { width: 100%; box-sizing: border-box; }
.pwd-table { min-width: 520px; }
.pwd-table td code { font-family: ui-monospace, Consolas, monospace; font-size: 12.5px; color: #b0352c; background: #fdf1e3; padding: 2px 6px; border-radius: 4px; }
@media (max-width: 620px) {
  .pwd-table { min-width: 480px; }
  #btn-pwd-change, #btn-pwd-list { padding: 5px 8px; font-size: 12px; }
}

/* v0.38.8 · N13 账务登记（业务类型 + 生成客户编号） */
.n13-reg { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; margin: 10px 0 6px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fafbfd; }
.n13-fld:first-child select { width: 128px; }
.n13-fld { display: flex; flex-direction: column; gap: 5px; font-size: 12.5px; color: var(--muted); }
.n13-fld > span { font-weight: 600; }
.n13-fld select, .n13-fld input { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; background: #fff; color: var(--text); font-family: inherit; }
.n13-fld select:focus, .n13-fld input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.10); }
.n13-fld input:disabled { background: #f2f4f7; color: var(--muted); cursor: not-allowed; }
.n13-no-fld { flex: 1 1 118px; min-width: 108px; }
.n13-no-fld input { font-family: ui-monospace, Consolas, monospace; letter-spacing: .06em; text-transform: uppercase; }
#n13-no.bad { border-color: var(--red); background: #fff6f5; }
.n13-chk { display: flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text); padding-bottom: 7px; white-space: nowrap; }
.n13-tip { margin: 0 0 8px; line-height: 1.7; word-break: break-word; overflow-wrap: anywhere; }
@media (max-width: 620px) {
  .n13-reg { gap: 10px; }
  .n13-chk { padding-bottom: 0; }
  .n13-no-fld { flex: 1 1 100%; }
}

/* v0.38.8 · 工作台分板块（一 工单流转 / 二 账务管理） */
.home-sec + .home-sec { margin-top: 28px; }
.home-sec-hd { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; padding: 0 0 10px; border-bottom: 2px solid var(--line); }
.home-sec-hd h2 { font-size: 16px; font-weight: 700; }
.home-sec-hd .sec-no { display: inline-flex; width: 22px; height: 22px; align-items: center; justify-content: center; border-radius: 6px; background: var(--primary); color: #fff; font-size: 12px; font-weight: 700; }
.home-sec-hd .sec-sub { color: var(--muted); font-size: 12px; }

/* v0.38.8 · 账务管理台账 */
.ledg-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.ledg-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ledg-search { height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; width: 250px; max-width: 100%; background: #fff; color: var(--text); font-family: inherit; }
.ledg-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(47,111,237,.10); }
.ledg-wrap { overflow-x: auto; }
.ledg-table { min-width: 900px; }
.ledg-table td { vertical-align: top; padding-top: 9px; padding-bottom: 9px; }
.ledg-no { white-space: nowrap; font-family: ui-monospace, Consolas, monospace; }
.ledg-renew { display: inline-block; margin-left: 5px; font-size: 10px; padding: 0 4px; border-radius: 4px; background: #e8f0ff; color: var(--primary); font-family: inherit; }
.ledg-uscc { color: var(--muted); font-size: 11.5px; margin-top: 2px; }
.ledg-term { white-space: nowrap; font-size: 12.5px; }
.ledg-days { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.ledg-days.warn { color: var(--orange); }
.ledg-days.bad { color: var(--red); }
.ledg-src { font-family: ui-monospace, Consolas, monospace; font-size: 12px; color: var(--muted); }
.pwd-form select { height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13.5px; background: #fff; color: var(--text); font-family: inherit; }
.pwd-form select:disabled, .pwd-form input:disabled { background: #f2f4f7; color: var(--muted); }
@media (max-width: 620px) {
  .ledg-search { width: 100%; }
  .home-sec-hd .sec-sub { display: none; }
  .home-sec + .home-sec { margin-top: 22px; }
}

/* ---------- v0.39.0 账务管理（一级板块）：工具栏 / 录入表单 / Excel 导入 ---------- */
.ledg-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ledg-tools .btn { white-space: nowrap; }
.ledg-form { background: transparent; border: none; padding: 0; gap: 10px 14px; }
.ledg-form label { font-size: 12.5px; }
.ledg-form label > span { color: var(--muted); }
.ledg-form .span2 { grid-column: span 2; }
.ledg-form label.check { background: #f6f8fb; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; }
.ledg-form label.check > span { font-size: 12.5px; line-height: 1.6; }
.ledg-drop { border: 1.5px dashed #c8d4e6; border-radius: 12px; padding: 22px; text-align: center; background: #fbfcff; transition: .15s; }
.ledg-drop.over { border-color: var(--primary); background: #f0f5ff; }
.ledg-drop .dz-main { font-size: 14px; }
.ledg-drop .dz-main a { color: var(--primary); }
.ledg-drop .dz-sub { color: var(--muted); font-size: 12px; margin-top: 8px; }
.ledg-imp-sum { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; align-items: center; }
.ledg-imp-table { min-width: 640px; }
.ledg-imp-table td, .ledg-imp-table th { font-size: 12.5px; }
@media (max-width: 720px) {
  .ledg-form .span2 { grid-column: span 1; }
  .ledg-tools { width: 100%; }
  .ledg-tools .ledg-search { width: 100%; }
}

/* v0.39.0：导航标签长短两版（窄屏用短标签）＋ 台账表头不折行 */
.tab-btn .tb-short { display: none; }
@media (max-width: 620px) {
  .tab-btn .tb-long { display: none; }
  .tab-btn .tb-short { display: inline; }
}
.ledg-table thead th { white-space: nowrap; }

/* ===== v0.40.0 =====
   1) 手机端身份切换改底部弹层（顶栏下拉会被裁掉，点不到）
   2) 工单详情分节折叠 / 展开
   3) 台账：初始情况分组、变更留痕、删除与回收站、新签查重提示 */

/* ---- 1) 身份底部弹层（手机端） ---- */
.id-sheet-mask { position: fixed; inset: 0; z-index: 300; background: rgba(15,23,42,.46); display: flex; align-items: flex-end; }
.id-sheet { width: 100%; max-height: 82vh; overflow: auto; background: var(--panel); border-radius: 16px 16px 0 0;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom)); box-shadow: 0 -10px 30px rgba(15,23,42,.18); }
.id-sheet-hd { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 2px 2px 10px; }
.id-sheet-hd b { font-size: 15px; }
.id-sheet-hd small { display: block; color: var(--muted); font-size: 11.5px; margin-top: 3px; }
.id-sheet-x { border: 0; background: #f2f4f8; color: #64748b; width: 28px; height: 28px; border-radius: 50%; font-size: 13px; cursor: pointer; flex: 0 0 auto; }
.id-sheet-list { display: flex; flex-direction: column; gap: 8px; }
.id-sheet-item { position: relative; display: flex; flex-direction: column; gap: 3px; text-align: left; width: 100%;
  border: 1px solid var(--line); background: #fff; border-radius: 12px; padding: 12px 14px; cursor: pointer; font-family: inherit; }
.id-sheet-item .id-l { font-size: 14.5px; font-weight: 600; color: var(--text); }
.id-sheet-item .id-m { font-size: 11.5px; color: var(--muted); }
.id-sheet-item.active { border-color: #b9cdf7; background: #f2f6ff; }
.id-sheet-item.active .id-l { color: var(--primary); }
.id-sheet-item .id-cur { position: absolute; right: 12px; top: 12px; font-size: 10.5px; color: var(--primary);
  background: #e6efff; border-radius: 20px; padding: 1px 8px; }
.id-sheet-ft { color: var(--muted); font-size: 11px; line-height: 1.7; padding: 12px 2px 0; }

/* 窄屏顶栏：挤不下时先隐藏面包屑，保住「身份 / 消息 / 退出」不被挤出屏幕 */
@media (max-width: 430px) {
  .topbar .crumb, .topbar .crumb-sp { display: none; }
  .me { flex: 0 0 auto; }
}

/* ---- 2) 详情分节折叠 ---- */
.d-section h4.d-sec-hd { display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; margin-bottom: 10px; }
.d-section h4.d-sec-hd::before { content: "▾"; font-size: 11px; color: #7d8ea8; flex: 0 0 auto; }
.d-section.collapsed h4.d-sec-hd::before { content: "▸"; }
.d-section.collapsed > :not(h4) { display: none !important; }
.d-section.collapsed h4.d-sec-hd { margin-bottom: 0; }
.d-section h4.d-sec-hd:hover { color: var(--primary); }
.d-fold-bar { display: flex; justify-content: flex-end; align-items: center; gap: 8px; margin: 0 0 10px; }
.d-fold-bar .hint { margin: 0; }
@media (max-width: 720px) { .d-fold-bar { position: sticky; top: 0; z-index: 2; background: var(--bg, #f7f9fc); padding: 2px 0; } }

/* ---- 3) 台账：初始情况 / 留痕 / 删除 / 回收站 ---- */
.ledg-sec { border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin-bottom: 12px; background: #fbfcfe; }
.ledg-sec-hd { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.ledg-sec-hd b { font-size: 13px; }
.ledg-sec-hd .hint { margin: 0; }
.ledg-sec.lock { background: #f7f8fa; }
.ledg-sec.lock .form-grid input, .ledg-sec.lock .form-grid select { background: #f2f4f7; }
.ledg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.ledg-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 12.5px; }
.ledg-grid label > span { color: var(--muted); }
.ledg-grid input, .ledg-grid select { height: 34px; border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; font-size: 13.5px; font-family: inherit; background: #fff; color: var(--text); }
.ledg-grid input:disabled, .ledg-grid select:disabled { background: #f2f4f7; color: var(--muted); }
.ledg-grid .span2 { grid-column: span 2; }
@media (max-width: 620px) { .ledg-grid { grid-template-columns: minmax(0, 1fr); } .ledg-grid .span2 { grid-column: span 1; } }
.ledg-hist { border-top: 1px dashed var(--line); margin-top: 10px; padding-top: 10px; max-height: 260px; overflow: auto; }
.ledg-hist-item { font-size: 12px; line-height: 1.75; padding: 7px 0; border-bottom: 1px dashed #eef1f6; }
.ledg-hist-item:last-child { border-bottom: 0; }
.ledg-hist-item .h { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.ledg-hist-item .h b { font-size: 12px; }
.ledg-hist-item .h span { color: var(--muted); font-size: 11px; }
.ledg-hist-item .chg { color: #475569; }
.ledg-hist-item .chg i { font-style: normal; color: #94a3b8; }
.ledg-hist-item .chg em { font-style: normal; color: var(--muted); }
.ledg-hist-item.del .h b { color: var(--red); }
/* v0.43.0 台账授权：授权条目行 */
.ledg-grant-row { display: flex; align-items: center; justify-content: space-between; gap: 10px;
  border: 1px solid var(--line); border-radius: 9px; padding: 8px 10px; margin-bottom: 8px; background: #fff; }
.ledg-grant-row b { font-size: 13px; }
.ledg-grant-row .hint { margin: 0; font-size: 12px; }
.ledg-grant-row .ledg-uscc { font-size: 11px; color: var(--muted); margin-top: 2px; }
.ledg-grant-row .btn { flex: 0 0 auto; }
@media (max-width: 430px) {
  .ledg-grant-row { flex-direction: column; align-items: flex-start; }
  .ledg-grant-row .btn { align-self: flex-end; }
}
.ledg-tabs { display: inline-flex; background: #f1f5f9; border-radius: 9px; padding: 2px; gap: 2px; }
.ledg-tabs button { border: 0; background: transparent; padding: 5px 12px; border-radius: 7px; font-size: 12.5px; color: #64748b; cursor: pointer; font-family: inherit; }
.ledg-tabs button.on { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.08); }
.ledg-trash-row td { color: #64748b; }
.chip.trash { background: #fdeaea; color: #b3261e; }
.dup-hint { background: #fff7e6; border: 1px solid #f7d9a6; color: #8a5300; border-radius: 9px; padding: 9px 12px;
  font-size: 12.5px; line-height: 1.7; margin: 0 0 12px; }
.dup-hint.hidden { display: none; }
.dup-hint b { color: #b45309; }
.dup-hint .dup-lock { display: block; margin-top: 3px; color: #8a5300; }
.form-grid label.dup-on select { border-color: #f0c07a; }

/* ===== v0.41.0 · 管理员演示模式 ===== */
.demo-banner { display:inline-flex; align-items:center; gap:4px; font-size:12px; color:#8a5300;
  background:#fff3d6; border:1px solid #f0c46a; border-radius:16px; padding:3px 10px; white-space:nowrap; }
.demo-banner b { color:#b45309; }
@media (max-width:620px) { .demo-banner { font-size:10.5px; padding:2px 7px; max-width:150px; overflow:hidden; text-overflow:ellipsis; } }
.demo-group { margin-bottom:14px; }
.demo-group h4 { font-size:12px; color:var(--muted); margin:0 0 8px; font-weight:600; }
.demo-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(210px,1fr)); gap:8px; }
.demo-user { border:1px solid var(--line); border-radius:10px; padding:9px 10px; background:#fbfcfe; }
.demo-user-n { font-size:13px; font-weight:600; margin-bottom:7px; display:flex; align-items:baseline; gap:6px; }
.demo-user-n .hint { font-weight:400; font-size:11px; }
.demo-user-ids { display:flex; flex-direction:column; gap:5px; }
.demo-id { display:flex; flex-direction:column; align-items:flex-start; gap:1px; text-align:left;
  border:1px solid #d7e2f5; background:#fff; border-radius:7px; padding:6px 9px; cursor:pointer; font-family:inherit; }
.demo-id:hover { border-color:var(--primary); background:#f4f8ff; }
.demo-id b { font-size:12.5px; color:var(--text); }
.demo-id span { font-size:11px; color:var(--muted); }

/* ===== v0.45.0 客户端云端模式标记 ===== */
.cloud-chip { font-size:11px; padding:2px 7px; border-radius:10px; background:#eef4ff; color:#2b5cad;
  border:1px solid #d3e0f7; white-space:nowrap; margin-right:4px; }
.cloud-chip.cloud-local { background:#fff6e6; color:#8a5a00; border-color:#f0dcae; }
.login-cloud-wrap { margin-top:10px; }
.login-cloud { font-size:12px; color:#6b7280; line-height:1.7; word-break:break-all; }
.login-cloud.bad { color:#b42318; }
@media (max-width:720px){ .cloud-chip{ display:none !important; } }
