/* ============================================================
   crm-work 管理端设计系统（Blade + 原生 CSS，零构建）
   配色令牌取自 docs/design/palette.css（木兰有道官网样式提取值）
   ============================================================ */

:root {
  /* —— 品牌令牌（palette.css 原值） —— */
  --color-primary: #005850;
  --color-primary-light: #00756A;
  --color-accent: #FF9432;
  --color-accent-deep: #FD6B00;
  --color-text-primary: #333333;
  --color-text-secondary: #666666;
  --color-text-muted: #888888;
  --color-text-on-dark: #FFFFFF;
  --color-bg-page: #FFFFFF;
  --color-bg-section: #F8F8F8;
  --color-bg-footer: #2E2E2E;
  --color-bg-overlay: rgba(0, 88, 80, 0.1);
  --color-border-light: #EEEEEE;
  --color-border: #DDDDDD;
  --color-highlight-gold: #FDD000;

  /* —— 语义映射（设计文档 8 章） —— */
  --ok: var(--color-primary);
  --info: var(--color-primary-light);
  --warn: var(--color-accent);
  --danger: var(--color-accent-deep);
  --muted: var(--color-text-muted);

  /* —— 结构 —— */
  --sidebar-w: 236px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow-card: 0 2px 10px rgba(0, 88, 80, 0.06);
  --shadow-hover: 0 6px 18px rgba(0, 88, 80, 0.10);
  --shadow-pop: 0 12px 40px rgba(0, 40, 36, 0.18);
  --font: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei",
    "Segoe UI", system-ui, sans-serif;

  /* —— v2 设计令牌（UI升级规范.md §1，追加不重命名） —— */
  /* 背景五层 */
  --bg-page: #F8F8F8;
  --bg-card: #FFFFFF;
  --bg-inset: #F3F6F5;
  --bg-overlay-card: rgba(255, 255, 255, 0.96);
  --bg-mask: rgba(0, 20, 18, 0.5);
  /* 描边与分隔 */
  --border-light: #EEEEEE;
  --border-strong: #C4C9C8;
  --border-live: rgba(255, 148, 50, 0.45);
  --border-done: rgba(0, 88, 80, 0.18);
  --divider-dash: 1px dashed #DDD;
  /* 文字三级 + 链接 */
  --text-1: #333333;
  --text-2: #666666;
  --text-3: #888888;
  --text-link: #00756A;
  --text-num: linear-gradient(90deg, #FF9432, #FD6B00, #FF9432);
  /* 语义紧迫度三阶（同色相明度+填充差，不引入红相） */
  --warn-text: #B95E00;
  --danger-deep: #C24E00;
  /* 字号阶梯（基准 13.5px） */
  --fs-xs: 11.5px;
  --fs-caption: 12px;
  --fs-body: 13px;
  --fs-base: 13.5px;
  --fs-sub: 15.5px;
  --fs-h3: 17px;
  --fs-h1: 21px;
  --fs-stat: 30px;
  /* 缓动库（全端共用命名） */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-back: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-inout: cubic-bezier(0.65, 0, 0.35, 1);
  /* 渐变四条 */
  --grad-main: linear-gradient(135deg, #00756A 0%, #005850 70%);
  --grad-accent: linear-gradient(135deg, #FF9432, #FD6B00);
  --grad-num: linear-gradient(90deg, #FF9432, #FD6B00, #FF9432);
  --grad-v: linear-gradient(180deg, #00756A, #005850);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--color-text-primary);
  background: var(--color-bg-section);
  line-height: 1.6;
}

a { color: var(--color-primary-light); text-decoration: none; }
a:hover { color: var(--color-primary); }

/* ================= 布局骨架 ================= */

.admin-shell { min-height: 100vh; }

.admin-sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-w);
  background: linear-gradient(160deg, #006460 0%, var(--color-primary) 46%, #003d38 100%);
  color: var(--color-text-on-dark);
  display: flex;
  flex-direction: column;
  z-index: 40;
  transition: transform .25s ease;
}

.admin-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 18px;
}

.admin-brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-accent-deep) 100%);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .5px;
  box-shadow: 0 4px 10px rgba(253, 107, 0, .35);
}

.admin-brand-name { font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.admin-brand-sub { font-size: 11px; color: rgba(255, 255, 255, .62); letter-spacing: 2px; }

.admin-nav { flex: 1; overflow-y: auto; padding: 6px 12px 18px; }
.admin-nav::-webkit-scrollbar { width: 4px; }
.admin-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 2px; }

.admin-nav-group {
  font-size: 11px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, .55);
  padding: 16px 10px 6px;
}

.admin-nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0;
  padding: 9px 12px;
  border-radius: var(--radius);
  color: rgba(255, 255, 255, .82);
  font-size: 13.5px;
  position: relative;
  transition: background .15s ease, color .15s ease;
}

.admin-nav a svg { width: 17px; height: 17px; flex: none; opacity: .85; }

.admin-nav a:hover { background: rgba(255, 255, 255, .09); color: #fff; }

.admin-nav a.active {
  background: rgba(255, 255, 255, .14);
  color: #fff;
  font-weight: 600;
}
.admin-nav a.active::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 8px;
  bottom: 8px;
  width: 3px;
  border-radius: 2px;
  background: var(--color-accent);
}

.admin-nav .nav-badge {
  margin-left: auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-accent);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: grid;
  place-items: center;
}

.admin-sidebar-foot { padding: 16px 18px 18px; border-top: 1px solid rgba(255, 255, 255, .12); }

.admin-user-chip { display: flex; align-items: center; gap: 10px; }

.admin-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .3);
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 600;
}

.admin-user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.admin-user-meta { font-size: 11px; color: rgba(255, 255, 255, .55); }

.admin-logout {
  margin-top: 10px;
  width: 100%;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .28);
  color: rgba(255, 255, 255, .85);
  border-radius: var(--radius);
  padding: 7px 0;
  font-size: 12.5px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease;
}
.admin-logout:hover { background: rgba(255, 255, 255, .1); color: #fff; }

.admin-main {
  margin-left: var(--sidebar-w);
  min-height: 100vh;
  padding: 26px 30px 60px;
}

.admin-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-title-wrap h1 {
  font-size: 21px;
  font-weight: 700;
  color: var(--color-text-primary);
  line-height: 1.35;
}
.admin-title-wrap .title-bar {
  width: 40px;
  height: 3px;
  border-radius: 2px;
  background: var(--color-accent);
  margin-top: 7px;
}
.admin-title-wrap p {
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--color-text-muted);
}

.admin-topbar-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.menu-toggle {
  display: none;
  border: 1px solid var(--color-border);
  background: #fff;
  border-radius: var(--radius);
  width: 36px;
  height: 36px;
  cursor: pointer;
  color: var(--color-primary);
  place-items: center;
}
.menu-toggle svg { width: 18px; height: 18px; }

.scrim {
  position: fixed;
  inset: 0;
  background: rgba(0, 20, 18, .45);
  z-index: 35;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
body.nav-open .scrim { opacity: 1; pointer-events: auto; }

/* ================= 卡片 ================= */

.card {
  background: var(--color-bg-page);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
}

.card + .card, .card + section, section + .card { margin-top: 18px; }

/* v2 卡片变体（§1.2）：强调卡 / 当前节点卡 / 完成卡 */
.card--live { border-color: var(--border-live); background: linear-gradient(0deg, rgba(255, 148, 50, 0.03), rgba(255, 148, 50, 0.03)), #fff; }
.card--done { border-color: var(--border-done); background: linear-gradient(0deg, rgba(0, 88, 80, 0.05), rgba(0, 88, 80, 0.05)), #fff; }

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.card-head > div { min-width: 0; }
.card-head h2 { font-size: 15.5px; font-weight: 700; }
.card-head .sub { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; }

/* ================= 统计卡 ================= */

.stat-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 14px;
}

.stat-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 16px 16px 14px;
  position: relative;
  overflow: hidden;
}
.stat-card::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-primary-light), var(--color-primary));
}
.stat-card.hot::after { background: linear-gradient(180deg, var(--color-accent), var(--color-accent-deep)); }
.stat-card.danger::after { background: var(--danger-deep); }

.stat-label { font-size: 12px; color: var(--color-text-secondary); }

.stat-value {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--color-primary);
  font-variant-numeric: tabular-nums;
}
.stat-card.hot .stat-value {
  background: linear-gradient(135deg, var(--color-accent) 20%, var(--color-accent-deep) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
/* 逾期卡数字：深橙实色（§5.2.1，与临期/未分配的渐变橙拉开） */
.stat-card.danger .stat-value { background: none; color: var(--danger-deep); }

.stat-foot { margin-top: 2px; font-size: 11.5px; color: var(--color-text-muted); }
.stat-foot a { color: inherit; }
.stat-foot a:hover { color: var(--color-primary); }

/* 待办区块标题图标（线性 SVG，颜色随语义） */
.attn-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attn-ico {
  width: 26px; height: 26px; border-radius: 8px; flex: none;
  display: inline-grid; place-items: center;
  background: rgba(0, 117, 106, 0.09);
  color: var(--color-primary-light);
}
.attn-ico svg { width: 15px; height: 15px; }
.attn-ico.is-hot { background: rgba(253, 107, 0, 0.1); color: var(--danger-deep); }

/* ================= 按钮 ================= */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 8px 16px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
  text-decoration: none;
  line-height: 1.4;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn:not(:disabled):active { transform: scale(0.97); transition-duration: 100ms; }
.btn-accent:not(:disabled):active, .btn-primary:not(:disabled):active { transition: transform 180ms var(--ease-back); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-light); color: #fff; }

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), var(--color-accent-deep));
  color: #fff;
  box-shadow: 0 4px 12px rgba(253, 107, 0, .25);
}
.btn-accent:hover { filter: brightness(1.05); color: #fff; }

.btn-outline { background: #fff; border-color: var(--color-primary); color: var(--color-primary); }
.btn-outline:hover { background: var(--color-bg-overlay); }

.btn-ghost { background: #fff; border-color: var(--color-border); color: var(--color-text-secondary); }
.btn-ghost:hover { border-color: var(--color-primary); color: var(--color-primary); }

.btn-danger { background: var(--color-accent-deep); color: #fff; }
.btn-danger:hover { filter: brightness(1.06); color: #fff; }

.btn svg { width: 15px; height: 15px; }
.btn-sm { padding: 4px 10px; font-size: 12px; border-radius: 6px; }
.btn-xs { padding: 2px 8px; font-size: 11.5px; border-radius: 5px; }
.btn-block { width: 100%; }

.btn-icon-plain {
  background: transparent;
  border: none;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 15px;
  padding: 4px 6px;
  border-radius: 6px;
  font-family: inherit;
}
.btn-icon-plain:hover { color: var(--color-primary); background: var(--color-bg-section); }
.btn-icon-plain:disabled { opacity: .35; cursor: not-allowed; }

/* ================= 表单 ================= */

.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.form-grid .full { grid-column: 1 / -1; }

.field label, .field-plain label {
  display: block;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  margin-bottom: 5px;
  font-weight: 600;
}
.field label .req, .field-plain label .req { color: var(--color-accent-deep); margin-left: 2px; }

.field-plain { margin-bottom: 14px; }

.input, select.input, textarea.input {
  width: 100%;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  padding: 8px 12px;
  font-size: 13.5px;
  font-family: inherit;
  color: var(--color-text-primary);
  transition: border-color .15s ease, box-shadow .15s ease;
  outline: none;
}
.input:focus {
  border-color: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(0, 117, 106, .13);
}
.input.is-invalid { border-color: var(--color-danger); }
textarea.input { resize: vertical; min-height: 74px; }

select.input { appearance: none; background-image: linear-gradient(45deg, transparent 50%, #888 50%), linear-gradient(135deg, #888 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }

.field-error { color: var(--color-danger); font-size: 12px; margin-top: 4px; }

.field-hint { color: var(--color-text-muted); font-size: 11.5px; margin-top: 4px; }

.filter-bar {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}
.filter-bar .field { min-width: 150px; flex: none; }
.filter-bar .field.grow { flex: 1; min-width: 180px; }

.inline-form { display: inline-flex; align-items: center; gap: 6px; }

.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--color-text-secondary); }
.checkbox-row input { width: 15px; height: 15px; accent-color: var(--color-primary); }

.seg {
  display: inline-flex;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
}
.seg button, .seg label {
  border: none;
  background: transparent;
  padding: 7px 14px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  cursor: pointer;
  font-family: inherit;
  border-right: 1px solid var(--color-border-light);
  transition: all .15s ease;
}
.seg > *:last-child { border-right: none; }
.seg .on, .seg input:checked + span { background: var(--color-primary); color: #fff; }
.seg label { display: inline-flex; align-items: center; cursor: pointer; margin: 0; }
.seg label input { position: absolute; opacity: 0; pointer-events: none; }

/* ================= 表格 ================= */

.table-wrap { overflow-x: auto; }

table.table { width: 100%; border-collapse: collapse; font-size: 13px; }

.table th {
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: .5px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--color-border);
  white-space: nowrap;
  background: var(--bg-inset);
}

.table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
  vertical-align: middle;
}

.table tr:hover td { background: rgba(0, 117, 106, .035); }
.table td .strong, .table .cell-title { color: var(--color-text-primary); font-weight: 600; }
.table td.num { font-variant-numeric: tabular-nums; }
.table .actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ================= 徽章 / 状态 ================= */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.badge-teal { background: rgba(0, 88, 80, .09); color: var(--color-primary); }
.badge-greenlight { background: rgba(0, 117, 106, .12); color: var(--color-primary-light); }
.badge-orange { background: rgba(255, 148, 50, .14); color: var(--warn-text); }
.badge-red { background: var(--danger); color: #fff; }
.badge-red .dot { background: #fff; }
.badge-gray { background: #F1F1F1; color: var(--color-text-muted); }
.badge-gray-dashed { background: transparent; border: 1px dashed var(--color-border); color: var(--color-text-muted); }
.badge-gold { background: rgba(253, 208, 0, .16); color: #8a6d00; }

.tag {
  display: inline-block;
  padding: 1.5px 8px;
  border-radius: 5px;
  font-size: 11px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-light);
  color: var(--color-text-secondary);
}
.tag-orange { background: rgba(255, 148, 50, .1); border-color: rgba(255, 148, 50, .3); color: var(--color-accent-deep); }

/* 截止时间色标三档（§1.5）：绿>24h / 临期浅底深字 / 逾期实底反白 */
.ddl { font-size: 12px; font-weight: 600; white-space: nowrap; border-radius: 5px; }
.ddl-ok { color: var(--color-primary); }
.ddl-warn { color: var(--warn-text); background: rgba(255, 148, 50, 0.14); padding: 1px 7px; }
.ddl-over { color: #fff; background: var(--danger); padding: 1px 7px; font-weight: 600; }
.ddl-none { color: var(--color-text-muted); font-weight: 400; }

/* ================= 进度条 ================= */

.progress {
  height: 8px;
  border-radius: 999px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-light);
  overflow: hidden;
}
.progress > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-primary-light), var(--color-primary));
  transition: width 600ms cubic-bezier(0.22, 1, 0.36, 1);
}
.progress.accent > span { background: linear-gradient(90deg, var(--color-accent), var(--color-accent-deep)); }
.progress.flat > span { background: #DDD; }

.progress-meta { display: flex; justify-content: space-between; font-size: 11px; color: var(--color-text-muted); margin-top: 5px; }

/* ================= 模态框 ================= */

.modal-mask {
  position: fixed;
  inset: 0;
  background: var(--bg-mask);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 7vh 16px 16px;
  z-index: 100;
  overflow-y: auto;
}
.modal-mask.open { display: flex; animation: maskFade .2s ease; }

.modal {
  background: #fff;
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 560px;
  box-shadow: var(--shadow-pop);
  animation: modalIn 220ms var(--ease-back);
}
.modal.modal-lg { max-width: 720px; }
.modal.modal-sm { max-width: 420px; }

@keyframes modalIn { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@keyframes maskFade { from { opacity: 0; } to { opacity: 1; } }

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--color-border-light);
}
.modal-head h3 { font-size: 15.5px; font-weight: 700; }
.modal-close { background: none; border: none; font-size: 18px; color: var(--color-text-muted); cursor: pointer; line-height: 1; }
.modal-close:hover { color: var(--color-danger); }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--color-border-light); }

/* ================= Toast ================= */

.toast-box {
  position: fixed;
  top: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.toast {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  border-left: 4px solid var(--color-primary);
  padding: 10px 18px;
  font-size: 13px;
  color: var(--color-text-primary);
  animation: toastIn .2s ease;
  max-width: 84vw;
}
.toast.err { border-left-color: var(--color-danger); }
.toast.warn { border-left-color: var(--color-accent); }

@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ================= 空态 ================= */

.empty {
  text-align: center;
  padding: 42px 16px;
  color: var(--color-text-muted);
}
.empty .empty-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--bg-inset);
  display: grid;
  place-items: center;
  font-size: 24px;
  color: var(--border-strong);
}
.empty .empty-icon svg { width: 24px; height: 24px; color: rgba(0, 117, 106, .55); }
.empty p { font-size: 13px; color: var(--text-2); }
.empty .empty-hint { font-size: 12px; color: rgba(136, 136, 136, .75); margin-top: 4px; }

/* ================= 看板 ================= */

.kanban {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 288px;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
  align-items: start;
}

.kanban-col {
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 12px;
  min-height: 120px;
}
.kanban { padding-right: 4px; }

/* 已终止列：降透明 + 进度灰（§5.2.3，橙色误导修正） */
.kanban-col[data-st="cancelled"] .kanban-card { opacity: .75; }
.kanban-col[data-st="cancelled"] .progress > span { background: #DDD; }

.kanban-col-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 4px;
}
.kanban-col-head h3 { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px; }
.kanban-col-head .cnt { font-size: 11px; color: var(--color-text-muted); background: #fff; border: 1px solid var(--color-border-light); border-radius: 999px; padding: 1px 8px; }

.kanban-card {
  background: #fff;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  padding: 12px 13px;
  margin-bottom: 10px;
  box-shadow: 0 1px 4px rgba(0, 60, 55, .05);
  transition: box-shadow .15s ease, transform .15s ease;
}
.kanban-card:hover { box-shadow: var(--shadow-card); transform: translateY(-1px); }
.kanban-card:last-child { margin-bottom: 0; }

.kanban-card .kc-title { font-weight: 600; font-size: 13px; margin-bottom: 4px; }
.kanban-card .kc-title a { color: var(--color-text-primary); }
.kanban-card .kc-meta { font-size: 11.5px; color: var(--color-text-muted); display: flex; flex-wrap: wrap; gap: 4px 10px; margin-top: 6px; }

/* ================= 时间轴 ================= */

.timeline { position: relative; padding-left: 26px; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-border) 100%);
  border-radius: 1px;
}

.tl-item { position: relative; padding: 0 0 18px; }
.tl-item:last-child { padding-bottom: 2px; }

.tl-dot {
  position: absolute;
  left: -26px;
  top: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--color-border);
  display: grid;
  place-items: center;
  font-size: 9px;
  color: var(--color-text-muted);
  z-index: 1;
}
/* 圆点状态填充（§5.2.4③）：completed=青绿实心✓ / in_progress=橙实心 / delivered=橙描边 / pending=灰描边 / skipped=虚线 */
.tl-item.done .tl-dot { border-color: var(--color-primary); background: var(--color-primary); color: #fff; font-size: 0; }
.tl-item.done .tl-dot::after { content: "✓"; font-size: 10px; font-weight: 700; }
.tl-item.doing .tl-dot { border-color: var(--color-accent); background: var(--color-accent); color: #fff; }
.tl-item.review .tl-dot { border-color: var(--color-accent); background: #fff; color: var(--color-accent-deep); }
.tl-item.over .tl-dot { border-color: var(--color-accent-deep); background: var(--color-accent-deep); color: #fff; }
.tl-item.skip .tl-dot { border-style: dashed; color: var(--color-text-muted); }

/* 当前节点卡（delivered 待审核 / in_progress）：暖描边轻底（§1.2 card--live，一屏 ≤1） */
.tl-card.is-live { border-color: var(--border-live); background: linear-gradient(0deg, rgba(255, 148, 50, 0.03), rgba(255, 148, 50, 0.03)), #fff; }

.tl-card {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
}
.tl-card.over { border-color: rgba(253, 107, 0, .35); background: rgba(253, 107, 0, .03); }
.tl-card.skip { border-style: dashed; }

.tl-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tl-head h4 { font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-head .tl-no { font-size: 11px; color: var(--color-text-muted); font-weight: 600; background: var(--color-bg-section); border-radius: 5px; padding: 1px 7px; }

.tl-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 12.5px; color: var(--color-text-secondary); }
.tl-meta b { color: var(--color-text-primary); font-weight: 600; }
.tl-meta .missing { color: var(--color-accent-deep); font-weight: 600; }

.tl-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 10px; border-top: 1px dashed var(--color-border-light); align-items: flex-start; }
.tl-actions .more-ops { margin-top: 0; }
.tl-actions .ops-row { display: flex; gap: 6px; flex-wrap: wrap; padding-top: 8px; }

.node-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--color-text-secondary);
  background: var(--color-bg-section);
  border-left: 3px solid var(--color-accent);
  border-radius: 0 6px 6px 0;
  padding: 7px 10px;
}

/* ================= 节点评分两列（§5.2.4⑤） ================= */

.score-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin-top: 8px; }
.score-grid .score-item {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--bg-inset);
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
}
.score-grid .score-item b { color: var(--color-text-primary); margin-left: 4px; font-size: 13px; }
.score-grid .score-item .si-cap { color: var(--color-text-muted); margin-right: 6px; }
.score-grid .score-item .si-note { display: block; margin-top: 3px; font-size: 11.5px; color: var(--color-text-muted); }
@media (max-width: 720px) { .score-grid { grid-template-columns: 1fr; } }

/* ================= SVG 对勾动效（§3.1.2 A 管理端参数） ================= */

.ck-badge { width: 52px; height: 52px; margin: 0 auto 10px; display: block; }
.ck-badge circle { animation: ck-pop 240ms var(--ease-back) both; transform-box: fill-box; transform-origin: center; }
.ck-badge path {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: ck-draw 400ms var(--ease-out) 120ms forwards;
}
@keyframes ck-draw { to { stroke-dashoffset: 0; } }
@keyframes ck-pop { from { transform: scale(0.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ================= 星级 ================= */

.stars { color: var(--color-highlight-gold); font-size: 15px; letter-spacing: 2px; white-space: nowrap; }
.stars .off { color: var(--color-border); }
.stars-sm { font-size: 12.5px; letter-spacing: 1px; }
.stars-input { display: flex; gap: 4px; }
.stars-input button {
  background: none;
  border: none;
  font-size: 26px;
  color: var(--color-border);
  cursor: pointer;
  padding: 0 2px;
  transition: color .12s ease, transform .12s ease;
  font-family: inherit;
}
.stars-input button.on { color: var(--color-highlight-gold); }
.stars-input button:hover { transform: scale(1.15); }

/* ================= 分页 ================= */

.pager { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: 14px; flex-wrap: wrap; font-size: 12.5px; }
.pager a, .pager span {
  padding: 5px 11px;
  border-radius: 6px;
  border: 1px solid var(--color-border-light);
  background: #fff;
  color: var(--color-text-secondary);
}
.pager .cur { background: var(--color-primary); border-color: var(--color-primary); color: #fff; font-weight: 600; }
.pager a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pager .disabled { opacity: .45; pointer-events: none; }
.pager .pager-info { border: none; background: none; color: var(--color-text-muted); }

/* ================= 满意度趋势图（SVG 直绘） ================= */

.trend-chart svg { width: 100%; height: auto; display: block; }
.trend-legend { display: flex; flex-wrap: wrap; gap: 8px 16px; font-size: 12px; color: var(--color-text-secondary); margin-bottom: 8px; }
.trend-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 5px; }
/* 空月占位柱（§5.2.2）：4px 高浅灰，消除"渲染故障感" */
.trend-chart .bar-ph { fill: #EEE; }
.trend-chart .bar-ph-note { fill: #999; font-size: 9px; }

/* ================= 代码 / 键值展示 ================= */

.kv-list { display: grid; grid-template-columns: 120px 1fr; gap: 8px 14px; font-size: 13px; }
.kv-list dt { color: var(--color-text-muted); }
.kv-list dd { color: var(--color-text-primary); word-break: break-all; }

.mono {
  font-family: "JetBrains Mono", Consolas, "Courier New", monospace;
  font-size: 12.5px;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border-light);
  border-radius: 6px;
  padding: 2px 7px;
}

.masked-phone { letter-spacing: 1px; }

.code-block {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  background: #0d2b28;
  color: #d6efe9;
  border-radius: var(--radius);
  padding: 10px 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  line-height: 1.55;
}

/* ================= 详情两栏 ================= */

.detail-cols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
/* 窄屏单列下允许列内滚动而非撑破视口（grid item min-width:auto 修正） */
.detail-cols > * { min-width: 0; }
.detail-cols .table-wrap, .card > .table-wrap { min-width: 0; }

/* ================= 模板编辑器节点列表 ================= */

.node-editor-list { display: flex; flex-direction: column; gap: 10px; }

.tpl-node {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: #fff;
  padding: 11px 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.tpl-node:hover { border-color: rgba(0, 117, 106, .4); box-shadow: var(--shadow-card); }

.tpl-node .tn-idx {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-primary));
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
}

.tpl-node .tn-main { min-width: 0; }
.tpl-node .tn-name { font-weight: 600; font-size: 13.5px; color: var(--color-text-primary); display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tpl-node .tn-desc { font-size: 12px; color: var(--color-text-muted); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tpl-node .tn-specs { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }

.tpl-node .tn-ops { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }

/* ================= 订单创建步骤条 ================= */

.steps { display: flex; gap: 0; margin-bottom: 20px; }
.steps li {
  flex: 1;
  list-style: none;
  text-align: center;
  position: relative;
  font-size: 12.5px;
  color: var(--color-text-muted);
  padding-top: 26px;
}
.steps li::before {
  content: attr(data-no);
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--color-bg-section);
  border: 1px solid var(--color-border);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 700;
}
.steps li::after {
  content: "";
  position: absolute;
  top: 11px;
  left: calc(50% + 14px);
  right: calc(-50% + 14px);
  height: 2px;
  background: var(--color-border-light);
}
.steps li:last-child::after { display: none; }
.steps li.on { color: var(--color-primary); font-weight: 700; }
.steps li.on::before { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ================= 页头工具条 ================= */

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.legend-row { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; font-size: 12px; color: var(--color-text-muted); }
.legend-row i { width: 9px; height: 9px; border-radius: 50%; display: inline-block; margin-right: 5px; }

/* ================= 折叠面板（details 原生实现） ================= */

details.disclose {
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius);
  background: var(--color-bg-section);
  margin-top: 10px;
}
details.disclose > summary {
  cursor: pointer;
  list-style: none;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--color-text-secondary);
  font-weight: 600;
  user-select: none;
  display: flex;
  align-items: center;
  gap: 7px;
}
details.disclose > summary::-webkit-details-marker { display: none; }
details.disclose > summary::before {
  content: "▸";
  color: var(--color-text-muted);
  transition: transform .15s ease;
  font-size: 11px;
}
details.disclose[open] > summary::before { transform: rotate(90deg); }
details.disclose > summary:hover { color: var(--color-primary); }
details.disclose .disclose-body { padding: 4px 12px 12px; border-top: 1px solid var(--color-border-light); }

.assign-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: end; margin-top: 10px; }
.assign-row .field label { font-size: 11.5px; }
.deadline-edit-row { display: flex; gap: 8px; align-items: center; margin-top: 10px; flex-wrap: wrap; }
.deadline-edit-row input { max-width: 210px; }
.upload-inline { display: flex; gap: 8px; align-items: end; flex-wrap: wrap; margin-top: 10px; }

.feed-item {
  padding: 8px 10px;
  border-left: 3px solid var(--color-accent);
  background: #fff;
  border-radius: 0 6px 6px 0;
  margin-bottom: 8px;
  font-size: 12.5px;
}
.feed-item .fi-meta { font-size: 11px; color: var(--color-text-muted); margin-bottom: 3px; }

/* ================= 交付物列表（与执行端 op.css 对齐，管理端补传/下载/预览） ================= */

.op-file {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--color-border-light);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 9px;
  background: #fff;
}
.op-file:last-child { margin-bottom: 0; }
.op-file .ico {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 9px;
  background: rgba(0, 88, 80, .08);
  color: var(--color-primary);
  display: grid;
  place-items: center;
  font-size: 16px;
}
.op-file .fi-main { flex: 1; min-width: 0; }
.op-file .fi-name { font-size: 13.5px; font-weight: 600; color: var(--color-text-primary); word-break: break-all; }
.op-file .fi-meta { font-size: 11.5px; color: var(--color-text-muted); margin-top: 2px; }
.op-file .fi-ops { display: flex; gap: 6px; flex: none; align-items: center; }
.op-file .fi-ops a, .op-file .fi-ops button {
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-text-secondary);
  font-size: 12px;
  border-radius: 8px;
  padding: 6px 10px;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.op-file .fi-ops a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.op-file .fi-ops button:hover { border-color: var(--color-accent-deep); color: var(--color-accent-deep); }
.op-file.visibility-open { border-color: rgba(0, 117, 106, .35); background: rgba(0, 117, 106, .03); }

/* 预览弹窗：图片/PDF 大窗预览 */
.modal.modal-preview { max-width: min(920px, 92vw); }
.modal-preview .modal-body { padding: 0; }
.preview-stage {
  background: #2b2f2e;
  min-height: 220px;
  max-height: 72vh;
  overflow: auto;
  display: flex;
  align-items: center;
  justify-content: center;
}
.preview-stage img { max-width: 100%; max-height: 72vh; object-fit: contain; display: block; min-width: 48px; min-height: 48px; image-rendering: pixelated; }
.preview-stage iframe { width: 100%; height: 72vh; border: 0; display: block; background: #fff; }
.preview-stage .preview-fail { color: #cfd6d4; font-size: 13px; padding: 40px 20px; text-align: center; }

/* ================= 响应式 ================= */

@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-cols { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .admin-sidebar { transform: translateX(-100%); }
  body.nav-open .admin-sidebar { transform: none; box-shadow: var(--shadow-pop); }
  .admin-main { margin-left: 0; padding: 18px 16px 50px; }
  .menu-toggle { display: inline-grid; place-items: center; }
}

@media (max-width: 720px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
  .filter-bar .field { min-width: 130px; flex: 1; }
  .card { padding: 15px 14px; }
}

@media print {
  .admin-sidebar, .admin-topbar-actions, .scrim, .toast-box { display: none !important; }
  .admin-main { margin: 0; padding: 0; }
  .card { box-shadow: none; }
}
