:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --sidebar: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1e293b;
  --muted: #64748b;
  --border: #e2e8f0;
  --blue: #2563eb;
  --amber: #d97706;
  --green: #16a34a;
  --red: #dc2626;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.05);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }

/* ---------- 启动态 ---------- */
.boot {
  display: flex; align-items: center; justify-content: center;
  height: 100vh; color: var(--muted); font-size: 14px;
}

/* ---------- 登录页 ---------- */
.login-view {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #1e293b 0%, #334155 55%, #1d4ed8 200%);
  padding: 24px;
}
.login-card {
  width: 100%; max-width: 400px;
  background: var(--panel);
  border-radius: 16px;
  padding: 32px 30px 26px;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.35);
}
.login-brand { text-align: center; margin-bottom: 22px; }
.logo {
  width: 52px; height: 52px; border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #fff; font-size: 24px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.logo.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 15px; margin: 0; }
.login-brand h1 { font-size: 19px; font-weight: 600; }
.login-brand p { color: var(--muted); font-size: 13px; margin-top: 2px; }

.tabs {
  display: flex; gap: 4px; background: #f1f5f9;
  border-radius: 8px; padding: 4px; margin-bottom: 20px;
}
.tab {
  flex: 1; border: 0; background: transparent; color: var(--muted);
  padding: 8px 0; border-radius: 6px; font-size: 13.5px;
}
.tab.active { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(15,23,42,.1); }

.login-form label { display: block; font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.login-form input[type="tel"], .login-form input[type="text"] {
  width: 100%; height: 42px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.login-form input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; }
.code-row .btn { white-space: nowrap; height: 42px; }
.field-error { color: var(--red); font-size: 12.5px; margin-top: 6px; }
.form-error { color: var(--red); font-size: 13px; margin-top: 12px; }
.login-tip { color: var(--muted); font-size: 12.5px; margin-top: 14px; text-align: center; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 16px; border-radius: 8px;
  border: 1px solid transparent; font-size: 13.5px; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s, opacity .15s;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-ghost { background: #fff; border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: #cbd5e1; background: #f8fafc; }
.btn-danger { background: #fff; border-color: #fecaca; color: var(--red); }
.btn-danger:hover:not(:disabled) { background: #fef2f2; }
.btn-wechat { background: #07c160; color: #fff; }
.btn-wechat:hover:not(:disabled) { background: #06ad56; }
.btn-block { width: 100%; height: 44px; font-size: 14.5px; margin-top: 20px; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 12.5px; border-radius: 6px; }

/* ---------- 主框架 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 216px; flex-shrink: 0;
  background: var(--sidebar); color: #cbd5e1;
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.side-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 18px 20px; font-size: 14.5px; font-weight: 600; color: #fff;
  border-bottom: 1px solid rgba(148, 163, 184, .16);
}
.nav { padding: 12px 10px; flex: 1; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; margin-bottom: 3px; border-radius: 8px;
  color: #cbd5e1; text-decoration: none; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-active); color: #fff; font-weight: 500; }
.nav-item .ico { width: 16px; text-align: center; opacity: .9; }
.side-foot {
  padding: 14px 18px; font-size: 11.5px; color: #64748b;
  border-top: 1px solid rgba(148, 163, 184, .16);
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 60px; flex-shrink: 0;
  background: #fff; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px; position: sticky; top: 0; z-index: 20;
}
.topbar h2 { font-size: 16.5px; font-weight: 600; }
.topbar .sub { font-size: 12.5px; color: var(--muted); font-weight: 400; margin-left: 8px; }
.user-chip { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 30px; height: 30px; border-radius: 50%;
  background: #e0e7ff; color: var(--primary);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-name { font-size: 13.5px; }
.role-tag {
  font-size: 11px; padding: 1px 7px; border-radius: 999px;
  background: #eff6ff; color: var(--primary); border: 1px solid #dbeafe;
}

.page { padding: 22px 24px 40px; flex: 1; }

/* ---------- 卡片 / 统计 ---------- */
.stat-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  margin-bottom: 18px;
}
.stat {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .label { font-size: 12.5px; color: var(--muted); }
.stat .value { font-size: 26px; font-weight: 650; margin-top: 4px; letter-spacing: -.5px; }
.stat .value.blue { color: var(--blue); }
.stat .value.amber { color: var(--amber); }
.stat .value.green { color: var(--green); }

.card {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
  margin-bottom: 18px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--border); flex-wrap: wrap;
}
.card-head h3 { font-size: 14.5px; font-weight: 600; }
.card-body { padding: 16px 18px; }

/* ---------- 工具条 ---------- */
.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.search-input {
  height: 34px; min-width: 200px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; outline: none;
}
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.select {
  height: 34px; padding: 0 10px; border: 1px solid var(--border);
  border-radius: 8px; background: #fff; outline: none;
}

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { background: #f8fafc; color: var(--muted); font-weight: 500; font-size: 12.5px; white-space: nowrap; }
tbody tr:hover { background: #f8fafc; }
tbody tr:last-child td { border-bottom: 0; }
td.title-cell { max-width: 320px; }
td.title-cell .t { font-weight: 500; }
td.title-cell .d {
  color: var(--muted); font-size: 12.5px; margin-top: 2px;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.mono { font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.actions { display: flex; gap: 6px; white-space: nowrap; }

.badge {
  display: inline-block; padding: 2px 9px; border-radius: 999px;
  font-size: 12px; line-height: 18px; border: 1px solid transparent; white-space: nowrap;
}
.b-open { background: #eff6ff; color: var(--blue); border-color: #dbeafe; }
.b-taken { background: #fffbeb; color: var(--amber); border-color: #fde68a; }
.b-done { background: #f0fdf4; color: var(--green); border-color: #bbf7d0; }
.b-free { background: #f0fdf4; color: var(--green); border-color: #bbf7d0; }
.b-member { background: #fef3c7; color: #b45309; border-color: #fde68a; }
.b-plain { background: #f1f5f9; color: var(--muted); border-color: var(--border); }
.b-red { background: #fef2f2; color: var(--red); border-color: #fecaca; }

.empty { padding: 48px 16px; text-align: center; color: var(--muted); font-size: 13.5px; }
.loading-row { padding: 40px; text-align: center; color: var(--muted); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px; overflow-y: auto; z-index: 100;
}
.modal {
  width: 100%; max-width: 620px; background: #fff;
  border-radius: 14px; box-shadow: 0 24px 60px rgba(2, 6, 23, .3);
  /* 入场动画统一在文件末尾「过渡动画」段（.modal → fx-pop） */
}
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15px; font-weight: 600; }
.modal-close {
  border: 0; background: transparent; font-size: 20px; line-height: 1;
  color: var(--muted); padding: 2px 6px; border-radius: 6px;
}
.modal-close:hover { background: #f1f5f9; }
.modal-body { padding: 18px 20px; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px; border-top: 1px solid var(--border); background: #f8fafc;
  border-radius: 0 0 14px 14px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid .full { grid-column: 1 / -1; }
.field label { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; background: #fff;
}
.field textarea { resize: vertical; min-height: 92px; line-height: 1.6; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.check-row { display: flex; align-items: center; gap: 8px; }
.check-row input { width: auto; }
.file-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.file-name { font-size: 12.5px; color: var(--muted); }

/* ---------- 拖拽上传 ---------- */
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  padding: 22px 16px; border: 1.5px dashed var(--border); border-radius: 10px;
  background: #fafbfc; cursor: pointer; text-align: center; transition: all .15s ease;
}
.dropzone:hover { border-color: var(--primary); background: #f5f8ff; }
.dropzone.dz-over { border-color: var(--primary); background: #eef4ff; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.dropzone .dz-icon { font-size: 22px; color: var(--primary); line-height: 1; }
.dropzone .dz-main { font-size: 13px; color: #334155; }
.dropzone .dz-link { color: var(--primary); font-weight: 500; }
.dropzone .dz-hint { font-size: 12px; color: var(--muted); }
.dropzone .dz-file { font-size: 12.5px; color: var(--primary); font-weight: 500; word-break: break-all; }
.dropzone .dz-input { display: none; }
/* 多附件列表：文件名 + 大小 + 移除 */
.dropzone .dz-file-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.dropzone .dz-file-list .dz-file {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 8px; border-radius: 6px; background: #fff; border: 1px solid var(--border);
}
.dropzone .dz-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dropzone .dz-file-size { flex-shrink: 0; color: var(--muted); font-size: 12px; font-weight: 400; }

/* ---------- 工位拆解编辑（需求弹窗） ---------- */
.stn-edit { display: flex; flex-direction: column; gap: 8px; }
.stn-row {
  display: grid; grid-template-columns: 1.2fr 0.7fr 0.9fr 1.6fr auto;
  gap: 8px; align-items: center;
  padding: 8px; border: 1px solid var(--border); border-radius: 8px; background: #fafbfc;
}
.stn-row input {
  padding: 6px 9px; border: 1px solid var(--border); border-radius: 6px;
  outline: none; font-size: 12.5px; background: #fff; width: 100%;
}
.stn-row input:focus { border-color: var(--primary); }
.stn-row .btn-danger-ghost { color: var(--red); }
.stn-row button[disabled] { opacity: .45; cursor: not-allowed; }

/* 工位行容器 + 图片/附件 */
.stn-row-wrap {
  border: 1px solid var(--border); border-radius: 8px; background: #fafbfc;
  padding: 8px;
}
.stn-row-wrap .stn-row { border: none; padding: 0; background: transparent; }

/* 发单页工位拆解（创建态）
   4 个输入走 .stn-row 的 5 列栅格，最后 auto 列留给消失的删除按钮，布局仍然对齐 */
.stn-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.stn-head b { font-size: 12.5px; color: var(--text); font-weight: 600; }
.stn-add-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 10px; }
.stn-add-row .hint { font-size: 11.5px; }
.stn-thumb {
  width: 52px; height: 52px; object-fit: cover;
  border-radius: 6px; border: 1px solid var(--border); background: #fff;
}
.stn-files { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--border); }
.stn-file-btn {
  padding: 4px 10px; font-size: 12px; border: 1px dashed var(--border);
  border-radius: 6px; background: #fff; color: #475569; cursor: pointer;
}
.stn-file-btn:hover { border-color: var(--primary); color: var(--primary); }
.stn-file-btn.has-file { border-style: solid; border-color: #86efac; background: #f0fdf4; color: #15803d; }
.stn-file-chip {
  font-size: 11.5px; color: var(--primary); cursor: pointer;
  padding: 3px 8px; background: #eef4ff; border-radius: 5px;
}
.stn-file-chip:hover { text-decoration: underline; }
.stn-file-tip { font-size: 11px; color: var(--muted); }

/* 需求说明标签选择器 */
.tag-picker { display: flex; flex-wrap: wrap; gap: 7px; padding: 2px 0; }
.tag-chip {
  padding: 5px 12px; font-size: 12.5px; border: 1px solid var(--border);
  border-radius: 999px; background: #fff; color: #475569; cursor: pointer;
  user-select: none; transition: all .12s;
}
.tag-chip:hover { border-color: var(--primary); color: var(--primary); }
.tag-chip.tag-on { background: var(--primary); border-color: var(--primary); color: #fff; }
.tag-chip .tag-x { font-weight: 400; opacity: .8; margin-left: 2px; }
.tag-new-input {
  width: 100%; margin-top: 10px; padding: 8px 11px;
  border: 1px solid var(--border); border-radius: 8px; outline: none; font-size: 13px;
}
.tag-new-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }

/* ---------- 平台补充留档（工位详情） ---------- */
.deli-add { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: #fafbfc; }
.deli-add-row { display: flex; gap: 8px; margin-bottom: 8px; }
.deli-add-row select, .deli-add-row input {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px;
  outline: none; font-size: 12.5px; background: #fff;
}
.deli-add-row select { flex: 0 0 130px; }
.deli-add-row input { flex: 1; }
.deli-add .dropzone { padding: 12px; background: #fff; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(15, 23, 42, .92); color: #fff;
  padding: 10px 20px; border-radius: 8px; font-size: 13.5px;
  z-index: 200; max-width: 80vw; text-align: center;
  animation: fadein .18s ease-out;
}
@keyframes fadein { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 工位详情（工位 + 报价 + 交付留档） ---------- */
.b-amber { background: #fffbeb; color: var(--amber); border-color: #fde68a; }

.order-meta { display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.order-meta b { color: var(--text); font-weight: 600; }
.order-desc { font-size: 13px; line-height: 1.7; color: #45505f; white-space: pre-wrap; }

.station-card { margin-bottom: 14px; }
.station-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.station-card-title { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.station-name { font-size: 15px; font-weight: 600; color: var(--text); }
.station-actions { display: flex; gap: 6px; }
.station-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 12.5px; color: var(--muted); margin-top: 10px; }
.station-meta b { color: var(--text); font-weight: 600; }
.station-desc { margin-top: 10px; font-size: 13px; line-height: 1.7; color: #45505f; white-space: pre-wrap; }
.station-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

.file-chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 5px 10px; border-radius: 6px;
  background: #f1f5f9; color: var(--blue); cursor: pointer;
  border: 1px solid var(--border);
}
.file-chip:hover { background: #e2e8f0; }

.station-detail { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--border); }
.station-sub { font-size: 13px; font-weight: 600; color: var(--text); margin: 14px 0 8px; }
.station-sub .count { font-weight: 400; color: var(--muted); font-size: 12px; margin-left: 6px; }

.delivery-list { display: flex; flex-direction: column; gap: 8px; }
.delivery-row { background: #f8fafc; border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.delivery-row-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.delivery-author { font-size: 13px; font-weight: 600; color: var(--text); }
.delivery-time { font-size: 11.5px; color: var(--muted); margin-left: auto; }
.delivery-row-content { margin-top: 6px; font-size: 13px; line-height: 1.7; color: #45505f; white-space: pre-wrap; }
.delivery-row-files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

@media (max-width: 1100px) {
  .dash-cols { grid-template-columns: 1fr !important; }
}

@media (max-width: 860px) {
  .sidebar { width: 64px; }
  .side-brand span, .nav-item .txt, .side-foot { display: none; }
  .side-brand { justify-content: center; padding: 18px 0; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .form-grid { grid-template-columns: 1fr; }
  .page { padding: 16px 14px 32px; }
  .topbar { padding: 0 14px; }
}

/* ==================== 运营配置中心 ==================== */

.tabs-inline { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--border); }
.tabs-inline .tab {
  padding: 10px 18px; font-size: 13.5px; color: #64748b; background: none;
  border: none; border-bottom: 2px solid transparent; cursor: pointer; margin-bottom: -1px;
}
.tabs-inline .tab:hover { color: var(--primary); }
.tabs-inline .tab.active { color: var(--primary); font-weight: 600; border-bottom-color: var(--primary); }

.settings-body { display: block; }
.cfg-block { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--border); }
.cfg-block-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cfg-block-head h4 { margin: 0; font-size: 13.5px; font-weight: 600; color: #334155; }
.cfg-rows { display: flex; flex-direction: column; gap: 8px; }
.cfg-row { display: grid; gap: 8px; align-items: center; }
.cfg-row-2 { grid-template-columns: 1fr 2fr auto; }
.cfg-row-plan { grid-template-columns: 1.4fr 0.7fr 0.8fr auto auto; }
.cfg-row input[type="text"], .cfg-row input:not([type]), .cfg-row input[type="number"] {
  padding: 7px 10px; border: 1px solid var(--border); border-radius: 7px;
  outline: none; font-size: 12.5px; background: #fff; width: 100%;
}
.cfg-row input:focus { border-color: var(--primary); }
.cfg-check { display: flex; align-items: center; gap: 5px; font-size: 12.5px; color: #475569; white-space: nowrap; }
.cfg-check input { width: auto; }

.tag-admin { display: flex; flex-direction: column; gap: 7px; }
.tag-admin-row { display: grid; grid-template-columns: 1fr auto auto auto; gap: 7px; align-items: center; }
.tag-admin-row input {
  padding: 7px 11px; border: 1px solid var(--border); border-radius: 7px;
  outline: none; font-size: 13px; background: #fff;
}
.tag-admin-row input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.tag-admin-add { display: flex; gap: 8px; margin-top: 12px; }
.tag-admin-add input {
  flex: 1; padding: 9px 12px; border: 1px solid var(--border);
  border-radius: 8px; outline: none; font-size: 13px;
}
.tag-admin-add input:focus { border-color: var(--primary); }

.cell-sub { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* 富文本编辑器 */
.rte { border: 1px solid var(--border); border-radius: 9px; overflow: hidden; background: #fff; }
.rte-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px;
  padding: 7px 8px; background: #f8fafc; border-bottom: 1px solid var(--border);
}
.rte-btn {
  padding: 4px 9px; font-size: 12.5px; border: 1px solid transparent;
  border-radius: 5px; background: none; cursor: pointer; color: #334155;
}
.rte-btn:hover { background: #e8eefb; border-color: #d3e0f7; color: var(--primary); }
.rte-sep { width: 1px; height: 16px; background: var(--border); margin: 0 4px; }
.rte-editor {
  min-height: 180px; max-height: 320px; overflow-y: auto;
  padding: 12px 14px; font-size: 14px; line-height: 1.75; outline: none; color: #16202c;
}
.rte-editor:empty:before {
  content: attr(data-placeholder); color: #a8b1bf; pointer-events: none;
}
.rte-editor img { max-width: 100%; border-radius: 8px; display: block; margin: 8px 0; }

/* ==================== 两级折叠菜单 ==================== */
.nav-group { display: block; }
.nav-parent {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; border-radius: 9px; cursor: pointer;
  color: #cbd5e1; font-size: 13.5px; user-select: none;
}
.nav-parent:hover { background: rgba(255,255,255,.06); color: #fff; }
.nav-parent.active { background: rgba(37,99,235,.18); color: #fff; }
.nav-parent .txt { flex: 1; }
.nav-caret { font-size: 14px; opacity: .6; transition: transform .16s; }
.nav-group.open .nav-caret { transform: rotate(90deg); }
.nav-sub { display: none; padding-left: 14px; margin: 2px 0 4px; }
.nav-group.open .nav-sub { display: block; }
.nav-item.sub { padding: 9px 14px; font-size: 13px; border-radius: 8px; }
.nav-item.sub .txt { font-size: 13px; }

/* ==================== 开关 ==================== */
.switch-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 0; border-bottom: 1px solid var(--border);
}
.switch-row:last-child { border-bottom: none; }
.switch-title { font-size: 13.5px; font-weight: 500; color: #1e293b; }
.switch-desc { font-size: 12px; color: var(--muted); margin-top: 3px; }
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch-slider {
  position: absolute; inset: 0; background: #cbd5e1;
  border-radius: 999px; cursor: pointer; transition: background .18s;
}
.switch-slider:before {
  content: ''; position: absolute; width: 18px; height: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%;
  transition: transform .18s; box-shadow: 0 1px 3px rgba(0,0,0,.15);
}
.switch input:checked + .switch-slider { background: var(--primary); }
.switch input:checked + .switch-slider:before { transform: translateX(18px); }

/* ==================== 提示条 ==================== */
.alert { padding: 11px 14px; border-radius: 9px; font-size: 12.5px; line-height: 1.7; }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warn { background: #fffbeb; border: 1px solid #fde68a; color: #92400e; }

/* ==================== 客户 / 来源标记 ==================== */
.cust-chip {
  display: inline-block; padding: 2px 8px; border-radius: 6px;
  background: #eef2ff; color: #4338ca; font-size: 12px; white-space: nowrap;
}
.src-chip {
  display: inline-block; padding: 2px 7px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
}
.src-on { background: #ecfdf5; color: #047857; }
.src-off { background: #f1f5f9; color: #64748b; }

/* ==================== 用户标签 ==================== */
.utag {
  display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0;
  border-radius: 999px; background: #f0f9ff; color: #0369a1;
  border: 1px solid #bae6fd; font-size: 11.5px; white-space: nowrap;
}
.utag-cell { max-width: 220px; }

/* ==================== 需求发布页 ==================== */
.publish-hero {
  display: flex; align-items: center; gap: 18px;
  padding: 22px 24px; border-radius: 12px;
  background: linear-gradient(135deg, #eff6ff 0%, #f8fafc 100%);
  border: 1px solid #dbeafe;
}
.ph-icon {
  width: 46px; height: 46px; flex-shrink: 0; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 22px;
  display: flex; align-items: center; justify-content: center;
}
.ph-main { flex: 1; }
.ph-main h4 { margin: 0 0 5px; font-size: 15px; color: #1e293b; }
.ph-main p { margin: 0; font-size: 12.5px; color: var(--muted); line-height: 1.65; }
.pub-notes { display: flex; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.pub-note {
  flex: 1; min-width: 240px; padding: 14px 16px; border-radius: 10px;
  background: #fafafa; border: 1px solid #eef0f3;
  font-size: 12.5px; line-height: 1.7; color: #475569;
}
.pub-note b { display: block; color: #1e293b; margin-bottom: 4px; font-size: 13px; }

/* ==================== 多选列表（关联订单 / 打标签） ==================== */
.pick-list { max-height: 420px; overflow-y: auto; border: 1px solid #eef0f3; border-radius: 10px; }
.pick-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-bottom: 1px solid #f5f6f8; cursor: pointer;
}
.pick-row:last-child { border-bottom: none; }
.pick-row:hover { background: #fafbfc; }
.pick-row input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; }
.pick-main { display: flex; flex-direction: column; gap: 3px; }
.pick-main b { font-size: 13px; font-weight: 500; color: #1e293b; }
.pick-main small { font-size: 12px; color: var(--muted); }

/* ==================== P0 · 布局 ==================== */
.stat-4 .stat { flex: 1; }
.stat .value.red { color: #dc2626; }
.stat .value.amber { color: #d97706; }
.stat .value.green { color: #059669; }
.stat .value.blue { color: #2563eb; }

.nav-sep { height: 1px; background: #eef0f3; margin: 14px 12px 10px; }
.nav-sep-title { font-size: 11px; color: #94a3b8; padding: 0 16px 6px; letter-spacing: .5px; }
.nav-item.legacy .txt { color: #94a3b8; }

/* 准备金 */
.reserve-card .card-head { border-bottom: 1px solid #f1f5f9; }
.cov-tag { font-size: 12px; padding: 3px 10px; border-radius: 999px; font-weight: 500; }
.cov-green { background: #ecfdf5; color: #047857; }
.cov-amber { background: #fffbeb; color: #b45309; }
.cov-red { background: #fef2f2; color: #b91c1c; }
.reserve-grid { display: flex; gap: 14px; padding: 16px 0 4px; flex-wrap: wrap; }
.reserve-item {
  flex: 1; min-width: 150px; padding: 12px 14px;
  border-radius: 10px; background: #fafbfc; border: 1px solid #eef0f3;
}
.ri-label { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.ri-value { font-size: 19px; font-weight: 600; font-family: ui-monospace, monospace; color: #1e293b; }
.ri-value.amber { color: #d97706; }
.ri-value.red { color: #dc2626; }
.ri-value.green { color: #059669; }
.ri-value[class*="green"] { color: #059669; }

/* 分档条 */
.bucket-bar { display: flex; gap: 12px; padding: 14px 0 2px; flex-wrap: wrap; }
.bucket { flex: 1; min-width: 130px; padding: 12px 14px; border-radius: 10px; background: #fafbfc; border: 1px solid #eef0f3; }
.bk-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.bk-value { font-size: 17px; font-weight: 600; font-family: ui-monospace, monospace; }
.bk-value.red { color: #dc2626; }
.bk-value.amber { color: #d97706; }
.bk-value.blue { color: #2563eb; }
.bk-value.green { color: #059669; }

.row-late td { background: #fffafa; }
.late-text { color: #dc2626 !important; }
.late-tag { font-size: 11px; color: #dc2626; margin-top: 2px; }

/* 发单页 */
.p0-sec { padding: 20px 0; border-bottom: 1px solid #f1f5f9; }
.p0-sec:last-of-type { border-bottom: none; }
.p0-sec-title { display: flex; align-items: center; gap: 9px; font-size: 14px; font-weight: 600; color: #1e293b; margin-bottom: 16px; }
.step-no {
  width: 22px; height: 22px; border-radius: 50%; background: var(--primary); color: #fff;
  font-size: 12px; display: flex; align-items: center; justify-content: center; font-weight: 600;
}
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  padding: 6px 13px; border-radius: 7px; border: 1px solid #e2e8f0;
  background: #fff; font-size: 13px; cursor: pointer; color: #475569;
}
.chip:hover { border-color: var(--primary); color: var(--primary); }
.chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.calc-box {
  padding: 9px 12px; border-radius: 8px; background: #f0f9ff; border: 1px solid #bae6fd;
  font-family: ui-monospace, monospace; font-size: 14px; color: #0369a1;
}
.calc-box.warn { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.p0-actions {
  display: flex; gap: 10px; justify-content: flex-end; align-items: center;
  padding-top: 18px; margin-top: 6px; border-top: 1px solid #f1f5f9;
}

/* 订单详情 */
.p0-order-head { display: flex; justify-content: space-between; align-items: flex-start; padding-bottom: 16px; border-bottom: 1px solid #f1f5f9; }
.oh-no { font-size: 20px; font-weight: 600; color: #1e293b; }
.oh-title { font-size: 15px; color: #334155; margin-top: 4px; }
.oh-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.oh-right { text-align: right; }
.oh-count { font-size: 13px; color: #475569; margin-top: 8px; }
.oh-recv { font-size: 13px; color: #b45309; }

.tabs-inline { display: flex; gap: 4px; border-bottom: 1px solid #eef0f3; margin: 16px 0 0; }
.tab-btn {
  padding: 9px 16px; border: none; background: transparent; cursor: pointer;
  font-size: 13px; color: #64748b; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab-btn:hover { color: var(--primary); }
.tab-btn.on { color: var(--primary); border-bottom-color: var(--primary); font-weight: 500; }

/* 节点时间轴 */
.ms-row { display: flex; align-items: center; gap: 16px; padding: 14px 4px; border-bottom: 1px solid #f5f6f8; }
.ms-key {
  width: 38px; height: 38px; border-radius: 9px; background: #f1f5f9; color: #475569;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px; flex-shrink: 0;
}
.ms-body { flex: 1; }
.ms-name { font-size: 13.5px; color: #1e293b; font-weight: 500; }
.ms-meta { font-size: 12px; color: var(--muted); margin-top: 3px; }
.ms-act { flex-shrink: 0; }

/* 文件 */
.file-block { margin: 16px 0; }
.file-block h4 { font-size: 13px; color: #334155; margin: 0 0 8px; }
.file-row { display: flex; gap: 14px; align-items: center; padding: 9px 12px; background: #fafbfc; border-radius: 8px; margin-bottom: 6px; font-size: 12.5px; }
.fr-name { flex: 1; color: #334155; }
.fr-meta { color: var(--muted); font-size: 11.5px; }
.fr-act { color: #059669; font-size: 12px; }
.fr-act.muted { color: #94a3b8; }

/* 收付款 */
.money-cols { display: flex; gap: 18px; flex-wrap: wrap; }
.money-col { flex: 1; min-width: 260px; }
.money-col h4 { font-size: 13px; color: #334155; margin: 14px 0 10px; }
.money-row {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 14px; background: #fafbfc; border-radius: 9px; margin-bottom: 8px; font-size: 13px;
}

/* 留痕 */
.log-list { max-height: 460px; overflow-y: auto; }
.log-row { display: flex; gap: 14px; padding: 10px 4px; border-bottom: 1px solid #f5f6f8; font-size: 12.5px; }
.log-ts { color: var(--muted); flex-shrink: 0; }
.log-flow { flex-shrink: 0; color: #475569; }
.log-note { color: #334155; flex: 1; }

/* 审图 */
.review-list { margin-top: 12px; }
.review-row { display: flex; gap: 14px; align-items: flex-start; padding: 13px 4px; border-bottom: 1px solid #f5f6f8; }
.review-row.rv-failed { background: #fffafa; }
.rv-key {
  width: 34px; height: 26px; border-radius: 6px; background: #f1f5f9; color: #475569;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0;
}
.rv-body { flex: 1; }
.rv-label { font-size: 13.5px; color: #1e293b; font-weight: 500; }
.rv-desc { font-size: 12px; color: var(--muted); margin-top: 3px; line-height: 1.6; }
.rv-note { width: 100%; margin-top: 8px; padding: 7px 10px; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 12.5px; }
.rv-toggle { display: flex; gap: 6px; flex-shrink: 0; }
.rv-btn {
  width: 36px; height: 32px; border-radius: 7px; border: 1px solid #e2e8f0;
  background: #fff; cursor: pointer; font-size: 15px; color: #cbd5e1;
}
.rv-btn.pass.on { background: #ecfdf5; border-color: #6ee7b7; color: #059669; }
.rv-btn.fail.on { background: #fef2f2; border-color: #fca5a5; color: #dc2626; }

/* 设置 */
.split-row { display: flex; gap: 14px; }
.split-item { display: flex; align-items: center; gap: 7px; }
.split-item span { font-size: 12.5px; color: #475569; }
.split-item input { width: 68px; padding: 6px 9px; border: 1px solid #e2e8f0; border-radius: 7px; font-size: 13px; }
.acc-list { border: 1px solid #eef0f3; border-radius: 10px; overflow: hidden; }
.acc-row { display: flex; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #f5f6f8; font-size: 12.5px; }
.acc-row:last-child { border-bottom: none; }
.acc-key { width: 34px; color: #2563eb; font-weight: 600; flex-shrink: 0; }
.acc-label { width: 130px; color: #1e293b; flex-shrink: 0; }
.acc-desc { color: var(--muted); flex: 1; }

/* ==================== 精简后台新增（2026-10-20） ==================== */

/* 工作台待办卡 */
.lite-todo {
  display: grid; gap: 12px; margin-bottom: 18px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.lite-todo-item {
  display: flex; align-items: baseline; gap: 10px;
  padding: 16px 18px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--border);
  box-shadow: var(--shadow); text-decoration: none; color: var(--text);
  transition: transform .12s, box-shadow .12s;
}
.lite-todo-item:hover { transform: translateY(-1px); box-shadow: 0 2px 6px rgba(15,23,42,.08), 0 10px 28px rgba(15,23,42,.07); }
.lite-todo-item .lt-num { font-size: 24px; font-weight: 700; line-height: 1; }
.lite-todo-item .lt-label { font-size: 13px; color: var(--muted); }
.lite-todo-item.has .lt-num { color: var(--text); }
.lite-todo-item:not(.has) .lt-num { color: #cbd5e1; }
.lite-todo-item.tone-red.has .lt-num { color: var(--red); }
.lite-todo-item.tone-amber.has .lt-num { color: var(--amber); }
.lite-todo-item.tone-blue.has .lt-num { color: var(--blue); }
.lite-todo-item.tone-red.has { border-color: #fecaca; }
.lite-todo-item.tone-amber.has { border-color: #fde68a; }

/* Tab 带计数 */
.lite-tabs { padding: 10px 14px 0; }
.lite-tabs .tab-btn { text-decoration: none; }
.tab-n {
  display: inline-block; margin-left: 5px; padding: 0 6px;
  border-radius: 999px; background: #eef2f7; color: #64748b;
  font-size: 11.5px; line-height: 17px; min-width: 17px; text-align: center;
}
.tab-btn.on .tab-n { background: #dbeafe; color: var(--primary); }

/* 收支柱状图（纯 CSS，不引图表库） */
.lite-chart {
  display: flex; align-items: stretch; gap: 6px;
  padding: 10px 20px 0; height: 240px;
}
.lc-col {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  min-width: 0; border-bottom: 1px solid var(--border);
}
.lc-num {
  font-size: 11px; color: #475569; height: 18px; line-height: 18px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;
}
.lc-num.muted { color: transparent; }
.lc-bars {
  flex: 1; display: flex; align-items: flex-end; gap: 4px;
  width: 100%; justify-content: center; padding: 0 6px;
}
.lc-bar {
  flex: 1; max-width: 28px; min-height: 2px;
  border-radius: 3px 3px 0 0; transition: height .3s;
}
.lc-bar.recv { background: linear-gradient(180deg, #34d399, #10b981); }
.lc-bar.pay { background: linear-gradient(180deg, #fbbf24, #f59e0b); }
.lc-bar.empty { background: #f1f5f9; height: 2px !important; min-height: 2px; }
.lc-label { font-size: 11.5px; color: var(--muted); padding: 8px 0 10px; }
.lc-legend { display: flex; gap: 16px; padding: 0 20px 16px; font-size: 12px; color: var(--muted); }
.lc-legend .lg::before {
  content: ''; display: inline-block; width: 9px; height: 9px;
  border-radius: 2px; margin-right: 5px; vertical-align: middle;
}
.lc-legend .lg.recv::before { background: #10b981; }
.lc-legend .lg.pay::before { background: #f59e0b; }

/* 状态分布条 */
.lt-list { padding: 8px 20px 16px; }
.lt-row { display: flex; align-items: center; gap: 12px; padding: 7px 0; }
.lt-k { width: 96px; font-size: 13px; color: #334155; flex-shrink: 0; }
.lt-bar { flex: 1; height: 8px; background: #f1f5f9; border-radius: 999px; overflow: hidden; }
.lt-bar i { display: block; height: 100%; background: var(--primary); border-radius: 999px; }
.lt-v { width: 40px; text-align: right; font-size: 12.5px; color: var(--muted); }

.lite-note {
  font-size: 12px; color: var(--muted); line-height: 1.9;
  padding: 0 4px 8px; max-width: 720px;
}

/* 付款确认弹窗 */
.pay-confirm .pc-amount { font-size: 15px; color: #334155; }
.pay-confirm .pc-amount b { font-size: 22px; color: var(--text); margin-left: 6px; }
.pay-confirm .pc-meta { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* 表格里的次要说明 */
.table-wrap .d { font-size: 12px; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ==================== 需求说明标签 chip ==================== */
.tag-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 6px 4px 12px; border-radius: 999px;
  background: #eff6ff; border: 1px solid #dbeafe; color: #1e40af; font-size: 13px;
}
.tag-chip-x {
  width: 18px; height: 18px; line-height: 16px; padding: 0;
  border-radius: 50%; border: none; background: rgba(30, 64, 175, .12);
  color: #1e40af; font-size: 13px; text-align: center; cursor: pointer;
}
.tag-chip-x:hover { background: rgba(220, 38, 38, .15); color: var(--red); }

/* ==================== 知识库（帖子管理） ==================== */
.kb-stats {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 10px 12px; margin-bottom: 4px;
  background: #f8fafc; border: 1px solid var(--border); border-radius: 8px;
  font-size: 13px; color: var(--muted);
}
.kb-stats b { color: var(--text); font-weight: 600; }
.kb-stats .kb-warn { color: #b45309; }
.kb-title { font-weight: 500; color: var(--text); }
.kb-sum { font-size: 12px; color: var(--muted); margin-top: 3px; }
/* 已下架的行整体压暗，避免和「已发布」混在一起看串 */
tr.kb-off .kb-title, tr.kb-off td { opacity: .62; }
.kb-switches { display: flex; flex-direction: column; gap: 8px; }
.kb-switches label { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }

/* ============================================================
   标签页功能（2026-10-21 新增）
   顶栏下方一条标签栏；每个打开过的页面在页面池里保留一份 DOM，
   切换只改显隐，所以表单输入、滚动位置、筛选条件都不会丢。
   ============================================================ */

.page-tabs {
  flex-shrink: 0;
  height: 42px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background: #fff;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  overflow-y: hidden;
  position: sticky;
  top: 60px;          /* 顶栏高度 */
  z-index: 19;
  scrollbar-width: thin;
}
.page-tabs::-webkit-scrollbar { height: 4px; }
.page-tabs::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 2px; }
.page-tabs::-webkit-scrollbar-track { background: transparent; }
.page-tabs:empty { display: none; }

.page-tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 9px 0 11px;
  font-size: 13px;
  color: #475569;
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
  transition: color .15s, background .15s, border-color .15s;
}
.page-tab:hover { color: var(--primary); border-color: #bfdbfe; background: #f0f7ff; }
.page-tab.active {
  color: var(--primary);
  background: #eff6ff;
  border-color: var(--primary);
  font-weight: 500;
}

.page-tab .tab-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--primary); flex-shrink: 0;
  opacity: 0;                       /* 只给激活标签显示，未激活时留位不显示，避免标签跳动 */
  transition: opacity .15s;
}
.page-tab.active .tab-dot { opacity: 1; }

.page-tab .tab-x {
  width: 16px; height: 16px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  font-size: 14px; line-height: 1;
  color: #94a3b8;
  flex-shrink: 0;
  transition: background .15s, color .15s;
}
.page-tab .tab-x:hover { background: #cbd5e1; color: #fff; }
.page-tab.active .tab-x { color: #60a5fa; }
.page-tab.active .tab-x:hover { background: var(--primary); color: #fff; }

/* 固定标签（工作台）：不渲染 × ，用房子图标告诉用户这是钉住的主页 */
.page-tab.pinned { padding-right: 11px; }
.page-tab .tab-pin { flex-shrink: 0; opacity: .6; transition: opacity .15s; }
.page-tab.pinned:hover .tab-pin { opacity: .85; }
.page-tab.pinned.active .tab-pin { opacity: 1; }

/* ---------- 页面池 ---------- */
.page-pool { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.page-pool > .page-pane { display: none; }
.page-pool > .page-pane.active { display: block; }
/* 页面内边距保留原 .page 的取值 */
.page-pane { padding: 22px 24px 40px; flex: 1; }

/* ---------- 标签右键菜单 ---------- */
.tab-ctxmenu {
  position: fixed;
  z-index: 1200;
  display: none;
  min-width: 136px;
  padding: 5px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 26px rgba(15, 23, 42, .16);
}
.tab-ctxmenu.show { display: block; }
.tab-ctxmenu > div {
  padding: 7px 11px;
  font-size: 13px;
  color: #475569;
  border-radius: 5px;
  cursor: pointer;
  white-space: nowrap;
}
.tab-ctxmenu > div:hover { background: #f1f5f9; color: var(--primary); }
/* 固定标签右键时「关闭标签」置灰（.is-disabled 由 tabs.js 的 showMenu 加） */
.tab-ctxmenu > div.is-disabled,
.tab-ctxmenu > div.is-disabled:hover { color: #cbd5e1; background: transparent; cursor: not-allowed; }
.tab-ctxmenu > div.danger:hover { background: #fef2f2; color: var(--red); }

/* ==================== 存储管理 ==================== */
/* 用量条：head 用大号数字 + 配额，右侧状态徽章 */
.sb-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.sb-num { font-size: 30px; font-weight: 650; letter-spacing: -.5px; color: var(--text); }
.sb-quota { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 8px; }

.sb-bar {
  margin-top: 12px; height: 12px; border-radius: 999px;
  background: #eef1f4; overflow: hidden;
}
.sb-fill { height: 100%; border-radius: 999px; transition: width .35s ease; }
.sb-ok { background: linear-gradient(90deg, #34d399, #10b981); }
.sb-warn { background: linear-gradient(90deg, #fbbf24, #f59e0b); }
.sb-danger { background: linear-gradient(90deg, #f87171, #dc2626); }
.sb-unknown { background: #cbd5e1; }

.sb-legend {
  display: flex; flex-wrap: wrap; gap: 14px;
  margin-top: 10px; font-size: 12.5px; color: var(--muted);
}
.sb-legend .sb-unknown { color: var(--amber); }
.sb-more { display: flex; align-items: center; gap: 10px; margin-top: 16px; }

.alert-danger { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }

/* 配额输入行 */
.q-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* 迁移进度 */
.sb-progress { margin-top: 16px; }

/* 表格里「大小未知」用琥珀色，避免和真实 0 字节混在一起 */
td .sb-unknown { font-size: 12px; color: var(--amber); }

/* ==================== 订单详情 · 结账与核价 / 交付沟通 ==================== */
/* 结账日一行：左边说明当前值，右边按钮，免得按钮孤零零挂在表单下面 */
.settle-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap;
  padding: 10px 12px; border: 1px solid var(--border); border-radius: 9px;
  background: #f8fafc; font-size: 13px; color: var(--muted);
}
.settle-bar b { color: var(--text); }

/* 工位核价表：比通用表格紧一点，一行放得下工位名 + 状态 */
.pz-table { width: 100%; border-collapse: collapse; margin-top: 14px; font-size: 13px; }
.pz-table th {
  text-align: left; font-weight: 500; font-size: 12.5px; color: var(--muted);
  padding: 8px 10px; background: #f8fafc; border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.pz-table td { padding: 9px 10px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.pz-table tr:last-child td { border-bottom: none; }
.pz-name { font-weight: 500; color: var(--text); }
.pz-input {
  width: 118px; height: 32px; padding: 0 9px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 7px; background: #fff;
  font-family: inherit; color: var(--text);
}
.pz-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.pz-sum {
  margin-top: 12px; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.pz-sum b { color: var(--text); font-size: 15px; }

/* 交付沟通：按工位分组，气泡式只读列表 */
.talk-group { margin-bottom: 18px; }
.talk-group-head {
  display: flex; align-items: baseline; gap: 10px;
  padding-bottom: 7px; margin-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.talk-group-head b { font-size: 13.5px; color: var(--text); }
.talk-row {
  padding: 10px 12px; margin-bottom: 8px;
  border: 1px solid var(--border); border-radius: 9px; background: #fff;
}
.talk-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.talk-head b { font-size: 13px; color: var(--text); }
.talk-stage {
  font-size: 11.5px; padding: 1px 7px; border-radius: 999px;
  background: #eff6ff; color: var(--blue); border: 1px solid #dbeafe;
}
.talk-ts { margin-left: auto; font-size: 12px; color: var(--muted); }
.talk-body {
  margin-top: 6px; font-size: 13px; line-height: 1.7; color: #334155;
  white-space: pre-wrap; word-break: break-word;
}
.talk-files { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.talk-file {
  font-size: 12px; padding: 3px 8px; border-radius: 6px;
  background: #f1f5f9; color: #475569; border: 1px solid var(--border);
  max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ==================== 发单页 · 封面图 ==================== */
.cover-pick { max-width: 420px; }
.cover-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 26px 16px;
  border: 1.5px dashed var(--border); border-radius: 11px; background: #fafbfc;
  cursor: pointer; transition: border-color .16s, background .16s;
}
.cover-empty:hover { border-color: var(--primary); background: #f5f8ff; }
.cover-empty-ico { font-size: 22px; color: #94a3b8; line-height: 1; }
.cover-empty-main { font-size: 13.5px; color: #475569; font-weight: 500; }

.cover-have {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 10px; border: 1px solid var(--border); border-radius: 11px; background: #fafbfc;
}
.cover-thumb {
  width: 150px; height: 84px; object-fit: cover; flex-shrink: 0;
  border-radius: 8px; background: #e9eef4; border: 1px solid var(--border);
}
.cover-meta { min-width: 0; flex: 1; }
.cover-name {
  font-size: 13px; font-weight: 500; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cover-act { display: flex; gap: 6px; margin-top: 8px; }

/* ==================== 通知页 ==================== */
.nt-block { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.nt-block-title { font-size: 13.5px; font-weight: 600; color: #334155; margin-bottom: 10px; }

/* 小程序消息条目预览：左边一个未读圆点 + 标题/时间/正文/元信息 */
.nt-preview { max-width: 460px; }
.nt-pv {
  display: flex; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 11px; background: #fff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
}
.nt-pv-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
  margin-top: 6px; flex-shrink: 0;
}
.nt-pv-body { min-width: 0; flex: 1; }
.nt-pv-head { display: flex; align-items: baseline; gap: 8px; }
.nt-pv-head b {
  font-size: 13.5px; color: var(--text); font-weight: 600;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nt-pv-time { margin-left: auto; font-size: 12px; color: #94a3b8; flex-shrink: 0; }
.nt-pv-text {
  margin-top: 5px; font-size: 12.5px; line-height: 1.65; color: #475569;
  white-space: pre-wrap; word-break: break-word;
}
.nt-pv-meta { margin-top: 7px; font-size: 11.5px; color: #94a3b8; }

/* 手动选择名单 */
.nt-pick-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; flex-wrap: wrap; }
.nt-search {
  height: 32px; padding: 0 10px; width: 220px; font-size: 13px;
  border: 1px solid var(--border); border-radius: 8px; background: #fff;
  color: var(--text); font-family: inherit;
}
.nt-search:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37, 99, 235, .1); }
.nt-pick-list {
  max-height: 240px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: 10px; background: #fff;
}
.nt-pick-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; border-bottom: 1px solid #f1f5f9; cursor: pointer;
  font-size: 13px;
}
.nt-pick-row:last-child { border-bottom: none; }
.nt-pick-row:hover { background: #f8fafc; }
.nt-pick-row.on { background: #eff6ff; }
.nt-pick-row input { flex-shrink: 0; }
.nt-pick-name { flex: 1; min-width: 0; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-pick-lv {
  flex-shrink: 0; font-size: 11.5px; padding: 1px 7px; border-radius: 999px;
  background: #f1f5f9; color: #64748b; border: 1px solid var(--border);
}
.nt-pick-phone { flex-shrink: 0; font-size: 12px; color: var(--muted); }

/* 发送记录 */
.nt-filter { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.nt-title { font-weight: 500; color: var(--text); }
.nt-snippet { margin-top: 2px; }

/* 发送记录 · 就地编辑 */
.nt-editing > td { background: #f8fafc; }
.nt-editing .field label { font-size: 12px; }
.nt-editing input, .nt-editing textarea { width: 100%; }
.nt-editing textarea { min-height: 84px; }
.nt-edit-act { display: flex; align-items: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* ============ 订单详情 · 历史沟通记录（迁移单） ============ */
.hist-edit {
  width: 100%;
  min-height: 160px;
  padding: 12px 14px;
  border: 1px solid var(--line, #e2e8f0);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.7;
  color: #0f172a;
  background: #fff;
  resize: vertical;
  box-sizing: border-box;
}
.hist-edit:focus {
  outline: none;
  border-color: #1d4ed8;
  box-shadow: 0 0 0 3px rgba(29, 78, 216, .12);
}
.hist-edit-act {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* ============================================================
   过渡动画（SkyLine 那套思路搬到 Web）
   ------------------------------------------------------------
   Web 支持 :active 和 display 切换重播动画，所以比小程序简单：
     - 页面切换复靠「pane 从 display:none 变回 block」自动重播，
       不需要 JS 摘类再 reflow；
     - 按压反馈直接用 :active，不用 hover-class。
   仍然只用 opacity / transform，并且一律 backwards 填充：
   延迟期间套起始帧，播完自动回到元素自身样式，不会永久盖住
   .badge 的底色、.btn 的 disabled 透明度这类基础态。
   ============================================================ */

@keyframes fx-fade-up {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fx-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes fx-pop {
  from { opacity: 0; transform: translateY(-8px) scale(.98); }
  to   { opacity: 1; transform: none; }
}
@keyframes fx-slide-right {
  from { opacity: 0; transform: translateX(-12px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fx-rise {
  from { transform: translateY(8px); }
  to   { transform: translateY(0); }
}

.fx-fade-up     { animation: fx-fade-up .26s ease-out backwards; }
.fx-fade        { animation: fx-fade .2s ease-out backwards; }
.fx-pop         { animation: fx-pop .22s ease-out backwards; }
.fx-slide-right { animation: fx-slide-right .24s ease-out backwards; }
.fx-rise        { animation: fx-rise .26s ease-out backwards; }

/* ---------- 1. 页面切换：pane 的每个直接子块错开浮入 ----------
   .page-pane 非激活时 display:none，切回来时子元素是「新渲染」，
   动画自动从头播 —— 不用 JS 插手。
   错开上限 8 块：再往下的块在折叠线以下，延迟只会让滚动时看到迟到的浮入。 */
.page-pool > .page-pane.active > * {
  animation: fx-fade-up .26s ease-out backwards;
}
.page-pool > .page-pane.active > *:nth-child(2) { animation-delay: 40ms; }
.page-pool > .page-pane.active > *:nth-child(3) { animation-delay: 80ms; }
.page-pool > .page-pane.active > *:nth-child(4) { animation-delay: 120ms; }
.page-pool > .page-pane.active > *:nth-child(5) { animation-delay: 160ms; }
.page-pool > .page-pane.active > *:nth-child(6) { animation-delay: 200ms; }
.page-pool > .page-pane.active > *:nth-child(7) { animation-delay: 240ms; }
.page-pool > .page-pane.active > *:nth-child(n+8) { animation-delay: 280ms; }

/* 页内统计块再错开一层，让「一排数字」不是一个整体砸下来 */
.page-pool > .page-pane.active .stat-grid .stat {
  animation: fx-rise .26s ease-out backwards;
}
.page-pool > .page-pane.active .stat-grid .stat:nth-child(2) { animation-delay: 40ms; }
.page-pool > .page-pane.active .stat-grid .stat:nth-child(3) { animation-delay: 80ms; }
.page-pool > .page-pane.active .stat-grid .stat:nth-child(4) { animation-delay: 120ms; }
.page-pool > .page-pane.active .stat-grid .stat:nth-child(n+5) { animation-delay: 160ms; }

/* ---------- 2. 弹窗 / 右键菜单 / 提示 ----------
   .modal 原来用的是 pop 关键帧，这里统一到 fx-pop，并给遮罩补淡入。
   遮罩必须单独淡入：不淡入就是「啪」地一下整屏变暗，比不动还难看。 */
.modal-mask { animation: fx-fade .2s ease-out backwards; }
.modal { animation: fx-pop .22s ease-out backwards; }
/* 右键菜单靠 tabs.js 加 .show（display:none → block），所以选择器要用 .show 而不是 .hidden */
.tab-ctxmenu.show { animation: fx-pop .16s ease-out backwards; }

/* ---------- 3. 按压反馈 ----------
   transition 必须挂在基础类上：只写在 :active 里时，类被激活的那一刻
   transition 才生效，等于没有过渡，看起来是「跳」一下。 */
.btn:active:not(:disabled) { transform: scale(.97); }
.btn { transition: background .15s, border-color .15s, color .15s, opacity .15s, transform .1s; }
.nav-item:active { transform: scale(.985); }
.page-tab:active { transform: scale(.97); }

/* ---------- 4. 状态过渡 ---------- */
.page-tab {
  transition: background .15s, color .15s, border-color .15s, transform .1s;
}
tbody tr { transition: background .12s; }
.badge, .role-tag { transition: background .15s, color .15s, border-color .15s; }
.card { transition: box-shadow .18s, border-color .18s; }
.card:hover { box-shadow: 0 2px 6px rgba(15,23,42,.07), 0 12px 32px rgba(15,23,42,.07); }
input, select, textarea {
  transition: border-color .15s, box-shadow .15s;
}

/* ---------- 5. 侧边栏 ----------
   .nav-caret 的旋转在 517 行已有 transition，这里不要重复定义。 */
.nav-item { transition: background .15s, color .15s, transform .1s; }

/* ---------- 6. 尊重系统「减弱动态效果」 ---------- */
@media (prefers-reduced-motion: reduce) {
  .page-pool > .page-pane.active > *,
  .page-pool > .page-pane.active .stat-grid .stat,
  .modal-mask, .modal, .tab-ctxmenu.show,
  .fx-fade-up, .fx-fade, .fx-pop, .fx-slide-right, .fx-rise {
    animation: none !important;
  }
  .btn:active:not(:disabled),
  .nav-item:active,
  .page-tab:active { transform: none; }
}
