/* ===== 交付进度中心 · 设计系统 ===== */
:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --ink: #0f172a;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e6e9ef;
  --line-strong: #d5dbe5;
  --brand: #0f766e;
  --brand-dark: #0b5d57;
  --brand-soft: #e9f7f4;
  --blue: #2563eb;
  --blue-soft: #edf3ff;
  --amber: #b45309;
  --amber-soft: #fff7e8;
  --red: #b91c1c;
  --red-soft: #fef2f2;
  --nav: #0b1422;
  --nav-2: #101d30;
  --nav-ink: #a8b6c9;
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 18px 40px -28px rgba(15, 23, 42, .28);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
          "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { width: 18px; height: 18px; fill: currentColor; }
[hidden] { display: none !important; }

/* ===== 外壳 ===== */
.shell { display: grid; grid-template-columns: 244px minmax(0, 1fr); min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 22px 16px 18px;
  background: linear-gradient(180deg, #0c1727 0%, #0a1220 100%);
  color: #dbe4ef;
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 4px 6px; }
.brand-mark {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #19a394, #0f766e);
  color: #fff; font-size: 19px; font-weight: 700;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .28);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.35; }
.brand-text strong { color: #fff; font-size: 15px; letter-spacing: .01em; }
.brand-text small { color: #7d8ea5; font-size: 11px; }
.brand-light .brand-text small { color: #8fa3bd; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-group {
  margin: 16px 10px 4px;
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #5f7189;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--nav-ink);
  font-size: 13.5px;
  transition: background .15s ease, color .15s ease;
}
.nav-link svg { width: 17px; height: 17px; opacity: .8; }
.nav-link em {
  margin-left: auto;
  font-style: normal; font-size: 11px; color: #74869d;
  background: rgba(255, 255, 255, .06);
  padding: 1px 7px; border-radius: 99px;
}
.nav-link:hover { background: rgba(255, 255, 255, .055); color: #fff; }
.nav-link.on { background: rgba(25, 163, 148, .14); color: #eafffb; box-shadow: inset 2px 0 0 #19a394; }
.nav-link.on svg { opacity: 1; color: #38c4b4; }
.nav-badge {
  margin-left: auto;
  min-width: 20px; padding: 1px 6px;
  border-radius: 99px;
  background: #f59e0b; color: #241503;
  font-size: 11px; font-weight: 700; text-align: center;
}

.sidebar-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
.me {
  display: flex; align-items: center; gap: 10px;
  padding: 9px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .04);
  transition: background .15s ease;
}
.me:hover { background: rgba(255, 255, 255, .07); }
.avatar {
  width: 32px; height: 32px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #1e3a5f; color: #cfe3ff;
  font-size: 13px; font-weight: 600;
}
.me-text { display: flex; flex-direction: column; line-height: 1.35; min-width: 0; }
.me-text strong { color: #eef4fb; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-text small { color: #7d8ea5; font-size: 11px; }
.logout-form { padding: 0 9px; }
.linkbtn {
  background: none; border: 0; padding: 0;
  color: #7d8ea5; font-size: 12px; cursor: pointer;
}
.linkbtn:hover { color: #cfe3ff; }

/* ===== 主区 ===== */
.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 34px;
  background: rgba(244, 246, 249, .86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(214, 220, 230, .7);
}
.topbar-crumb { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.crumb-sep { margin: 0 5px; color: #b7c0cd; }
.topbar-actions { display: flex; align-items: center; gap: 14px; }
.sync-note { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--muted); }
.sync-dot { width: 6px; height: 6px; border-radius: 50%; background: #19a394; box-shadow: 0 0 0 3px rgba(25, 163, 148, .12); }

.content { width: 100%; max-width: 1380px; margin: 0 auto; padding: 28px 34px 40px; }
.foot {
  margin-top: auto;
  display: flex; justify-content: space-between; gap: 16px;
  padding: 18px 34px 22px;
  font-size: 11px; color: #94a3b8;
  border-top: 1px solid var(--line);
}

/* ===== 通用部件 ===== */
.eyebrow {
  font-size: 10.5px; font-weight: 700; letter-spacing: .17em;
  color: var(--brand); text-transform: uppercase;
  margin-bottom: 8px;
}
.eyebrow.light { color: #4dd6c6; }
.pagehead {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 28px;
  margin-bottom: 26px;
}
.pagehead-text h1 { font-size: clamp(25px, 2.6vw, 33px); line-height: 1.2; letter-spacing: -.025em; }
.lead { max-width: 720px; margin-top: 10px; color: var(--muted); font-size: 13.5px; }
.pagehead-side { display: flex; gap: 10px; flex: none; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px; font-weight: 600;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, transform .1s ease;
  white-space: nowrap;
}
.btn:hover { background: var(--brand-dark); }
.btn:active { transform: translateY(1px); }
.btn.sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn.block { width: 100%; padding: 11px 16px; font-size: 14px; }
.btn.ghost { background: var(--panel); border-color: var(--line-strong); color: var(--ink-2); }
.btn.ghost:hover { background: #f8fafc; border-color: #bec8d6; }
.btn.danger { color: var(--red); border-color: #f3c9c9; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 11px; font-weight: 600;
  background: #eef2f7; color: #475569;
  white-space: nowrap;
}
.chip.active { background: var(--blue-soft); color: var(--blue); }
.chip.blocked { background: var(--amber-soft); color: var(--amber); }
.chip.delivered { background: var(--brand-soft); color: var(--brand); }
.chip.warn { background: #fff1d6; color: #92400e; }
.chip.danger { background: var(--red-soft); color: var(--red); }
.chip.muted { background: #f1f5f9; color: #64748b; }

.tag {
  display: inline-flex; align-items: center;
  padding: 1px 8px;
  border-radius: 6px;
  background: #f1f5f9; color: #64748b;
  font-size: 10.5px; font-weight: 600;
  white-space: nowrap;
}
.tag.warn { background: #fff1d6; color: #92400e; }
.tag.danger { background: var(--red-soft); color: var(--red); }
.tag.ok { background: var(--brand-soft); color: var(--brand); }
.mini {
  display: inline-flex; align-items: center;
  margin-left: 6px; padding: 0 6px;
  border-radius: 5px;
  background: #f1f5f9; color: #7c899c;
  font-size: 10px; font-weight: 500;
  vertical-align: 1px;
}
.mini.manual { background: #eef2ff; color: #4f46e5; }

.notice {
  display: flex; align-items: center; gap: 9px;
  margin: 14px 34px 0;
  padding: 10px 14px;
  border-radius: 11px;
  font-size: 12.5px;
  border: 1px solid transparent;
}
.notice.ok { background: #ecfdf7; border-color: #b9ebdf; color: #0b655a; }
.notice.bad { background: #fff5f5; border-color: #f6caca; color: #a51f1f; }
.notice-ico {
  width: 18px; height: 18px; flex: none;
  display: grid; place-items: center;
  border-radius: 50%;
  background: currentColor; color: #fff;
  font-size: 11px; font-weight: 700;
}
.notice.ok .notice-ico { background: #0f9d8a; }
.notice.bad .notice-ico { background: #dc4c4c; }

.tiny { font-size: 11.5px; color: var(--muted); }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 11.5px; }
.pre { white-space: pre-wrap; }
.grow { flex: 1; }
.err-text, .err-inline { color: var(--red); font-size: 11.5px; }
.err-inline { display: block; margin-top: 3px; }

/* ===== KPI ===== */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 22px; }
.kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.kpi::after {
  content: ""; position: absolute; right: -18px; top: -24px;
  width: 76px; height: 76px; border-radius: 50%;
  background: radial-gradient(circle, rgba(15, 118, 110, .07), transparent 70%);
}
.kpi-label { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.kpi strong {
  display: block; margin: 4px 0 0;
  font-size: 32px; line-height: 1.15; letter-spacing: -.03em;
}
.kpi small { color: #8b97a8; font-size: 11px; }
.kpi-warn::after { background: radial-gradient(circle, rgba(180, 83, 9, .10), transparent 70%); }
.kpi-warn strong { color: var(--amber); }
.kpi-ok::after { background: radial-gradient(circle, rgba(15, 118, 110, .12), transparent 70%); }
.kpi-ok strong { color: var(--brand); }

/* ===== 筛选 ===== */
.filterbar {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  margin-bottom: 16px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.fchip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px;
  border-radius: 9px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 12px;
  transition: border-color .15s ease, background .15s ease;
}
.fchip em { font-style: normal; color: #94a3b8; font-size: 11px; }
.fchip:hover { border-color: var(--line-strong); }
.fchip.on { background: #0f172a; border-color: #0f172a; color: #fff; }
.fchip.on em { color: #9fb0c7; }

.searchbox {
  position: relative;
  flex: none;
  width: 260px;
  display: flex; align-items: center;
}
.searchbox svg { position: absolute; left: 10px; width: 15px; height: 15px; color: #94a3b8; }
.searchbox input {
  width: 100%;
  padding: 8px 52px 8px 32px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--panel);
  font-size: 12.5px;
  outline: none;
}
.searchbox input:focus { border-color: #99c9c2; box-shadow: 0 0 0 3px rgba(15, 118, 110, .09); }
.searchbox .clear { position: absolute; right: 9px; font-size: 11px; color: var(--muted); }

/* ===== 项目卡片 ===== */
.pgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 14px; }
.pcard {
  display: flex; flex-direction: column;
  padding: 17px 18px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: transform .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.pcard:hover {
  transform: translateY(-2px);
  border-color: #c6d3d0;
  box-shadow: 0 2px 3px rgba(15, 23, 42, .04), 0 24px 48px -30px rgba(15, 118, 110, .35);
}
.pcard-head { display: flex; align-items: flex-start; gap: 11px; }
.logo {
  width: 38px; height: 38px; flex: none;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(135deg, #e7f6f3, #d3ece7);
  color: var(--brand-dark);
  font-size: 16px; font-weight: 700;
}
.logo.xl { width: 52px; height: 52px; border-radius: 14px; font-size: 22px; }
.pcard-title { min-width: 0; flex: 1; }
.pcard-title h3 {
  font-size: 14.5px; line-height: 1.4; letter-spacing: -.01em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.pcard-title p { margin-top: 2px; font-size: 11.5px; color: #8a96a8; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.ticks { display: flex; gap: 9px; margin: 14px 0 9px; }
.tick-group { display: flex; gap: 3px; flex: 1; }
.tick {
  flex: 1; height: 7px; border-radius: 2px;
  background: #e9edf3;
  transition: background .2s ease;
}
.tick.done { background: #10917f; }
.tick.in_progress { background: #4b7fe8; }
.tick.blocked { background: #e08a1e; }
.ticks-lg { margin: 18px 0 12px; gap: 12px; }
.ticks-lg .tick { height: 10px; border-radius: 3px; }
.ticks-lg .tick-group { gap: 4px; }

.pcard-row { display: flex; align-items: baseline; justify-content: space-between; margin-top: 2px; }
.pcard-count { font-size: 11.5px; color: var(--muted); }
.pcard-count strong { color: var(--ink); font-size: 13px; }
.pcard-pct { font-size: 12px; font-weight: 700; color: var(--brand); }
.pbar { height: 4px; margin: 5px 0 12px; border-radius: 99px; background: #eef1f6; overflow: hidden; }
.pbar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #139b89, #0f766e); }

.pcard-now { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--ink-2); }
.pcard-now strong { font-weight: 600; }
.now-label { color: #94a3b8; font-size: 11px; }
.dot { width: 7px; height: 7px; flex: none; border-radius: 50%; background: #cbd5e1; }
.dot.done { background: #10917f; }
.dot.in_progress { background: #4b7fe8; box-shadow: 0 0 0 3px rgba(75, 127, 232, .12); }
.dot.blocked { background: #e08a1e; box-shadow: 0 0 0 3px rgba(224, 138, 30, .14); }
.pcard-line {
  margin: 6px 0 12px;
  font-size: 11.5px; line-height: 1.55; color: #6b7789;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 36px;
}
.pcard-foot {
  display: flex; justify-content: space-between; gap: 10px;
  padding-top: 10px;
  border-top: 1px solid #f0f2f6;
  font-size: 10.5px; color: #8b97a8;
}

/* ===== 项目详情 ===== */
.detail-hero {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 24px;
  margin-bottom: 20px;
}
.hero-main { display: flex; gap: 16px; align-items: center; min-width: 0; }
.hero-text { min-width: 0; }
.hero-text h1 { font-size: clamp(24px, 2.4vw, 31px); letter-spacing: -.03em; line-height: 1.2; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.hero-actions { display: flex; gap: 8px; flex: none; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.detail-main, .detail-side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.card-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  margin-bottom: 13px;
}
.card-head h2 { font-size: 14.5px; letter-spacing: -.01em; }
.card-head p { margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.card-head .count { font-style: normal; color: var(--muted); font-weight: 400; margin-left: 4px; }

.progress-card { display: flex; gap: 24px; align-items: center; }
.ring {
  width: 132px; height: 132px; flex: none;
  border-radius: 50%;
  background: conic-gradient(#10917f calc(var(--p, 0) * 1%), #edf0f5 0);
  display: grid; place-items: center;
  position: relative;
}
.ring::before {
  content: ""; position: absolute; inset: 9px;
  border-radius: 50%; background: var(--panel);
  box-shadow: inset 0 0 0 1px #f2f5f8;
}
.ring-in { position: relative; z-index: 1; text-align: center; line-height: 1.2; }
.ring-in strong { display: block; font-size: 30px; letter-spacing: -.04em; }
.ring-in strong span { font-size: 14px; color: var(--muted); font-weight: 500; margin-left: 1px; }
.ring-in small { display: block; margin-top: 3px; font-size: 10.5px; color: var(--muted); }
.progress-side { flex: 1; min-width: 0; }
.progress-head { display: flex; justify-content: space-between; gap: 14px; align-items: flex-start; }
.progress-head h2 { font-size: 15px; }
.progress-head p { margin-top: 2px; font-size: 11.5px; color: var(--muted); }
.progress-badge {
  padding: 3px 9px; border-radius: 7px;
  background: #f1f5f9; color: #526071;
  font-size: 10.5px; font-weight: 600; white-space: nowrap;
}
.progress-badge.warn { background: var(--amber-soft); color: var(--amber); }
.progress-badge.ok { background: var(--brand-soft); color: var(--brand); }
.phase-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; margin-top: 4px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: #6b7789; }
.legend-item i { width: 6px; height: 6px; border-radius: 50%; background: #cbd5e1; }
.legend-item em { font-style: normal; color: #9aa6b5; }
.legend-item.done i { background: #10917f; }
.legend-item.in_progress i { background: #4b7fe8; }
.legend-item.blocked i { background: #e08a1e; }

.callout {
  border-radius: var(--radius);
  padding: 16px 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.callout.warn { background: linear-gradient(180deg, #fffaf0, #fffdf8 70%); border-color: #f0d9ad; }
.callout.ok { background: linear-gradient(180deg, #f2fbf8, #ffffff 70%); border-color: #c3e8df; }
.callout-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.callout-k { font-size: 11px; font-weight: 700; letter-spacing: .08em; color: var(--amber); text-transform: uppercase; }
.callout.ok .callout-k { color: var(--brand); }
.callout-date { font-size: 10.5px; color: #a19a8c; }
.callout-text { margin-top: 7px; font-size: 13.5px; color: #3f3527; line-height: 1.65; }
.callout.ok .callout-text { color: #17564f; }
.callout-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 10px; }
.callout-tip { font-size: 11.5px; color: #7a6a4d; }
.callout.ok .callout-tip { color: #3d6f68; }
.callout-tip b { font-weight: 700; }
.callout-act { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px dashed #ecd9b4; }

.phase-block { padding: 14px 0 4px; border-top: 1px solid #f0f2f6; }
.phase-block:first-of-type { border-top: 0; padding-top: 2px; }
.phase-title { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.phase-no {
  width: 26px; height: 26px; flex: none;
  display: grid; place-items: center;
  border-radius: 8px;
  background: #f1f5f9; color: #64748b;
  font-family: var(--mono); font-size: 10.5px;
}
.phase-title strong { font-size: 12.5px; }
.phase-title small { display: block; font-size: 10.5px; color: #94a3b8; }
.phase-count { margin-left: auto; font-size: 10.5px; color: #94a3b8; font-variant-numeric: tabular-nums; }
.phase-block.done .phase-no { background: var(--brand-soft); color: var(--brand); }
.phase-block.blocked .phase-no { background: var(--amber-soft); color: var(--amber); }
.phase-block.in_progress .phase-no { background: var(--blue-soft); color: var(--blue); }

.ms-list { margin-left: 36px; }
.ms {
  display: grid;
  grid-template-columns: 13px minmax(0, 1fr) auto;
  gap: 10px 12px;
  align-items: start;
  padding: 10px 0;
  border-top: 1px dashed #edf0f4;
}
.ms:first-child { border-top: 0; }
.ms-dot {
  width: 9px; height: 9px; margin-top: 6px;
  border-radius: 50%;
  background: #d4dbe5;
  box-shadow: 0 0 0 4px #f5f7fa;
}
.ms.done .ms-dot { background: #10917f; box-shadow: 0 0 0 4px #e9f7f4; }
.ms.in_progress .ms-dot { background: #4b7fe8; box-shadow: 0 0 0 4px #edf3ff; }
.ms.blocked .ms-dot { background: #e08a1e; box-shadow: 0 0 0 4px #fff7e8; }
.ms-body { min-width: 0; }
.ms-name { font-size: 12.5px; font-weight: 600; color: #293548; }
.ms-ev {
  margin-top: 2px;
  font-size: 11.5px; line-height: 1.55; color: #7b8799;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.ms-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; min-width: 74px; }
.ms-state { font-size: 10.5px; font-weight: 600; color: #94a3b8; }
.ms.done .ms-state { color: var(--brand); }
.ms.in_progress .ms-state { color: var(--blue); }
.ms.blocked .ms-state { color: var(--amber); }
.ms-date { font-size: 10px; color: #a6b1bf; font-variant-numeric: tabular-nums; }
.ms-edit { grid-column: 2 / -1; margin-top: 2px; }
.ms-edit summary {
  display: inline-flex; cursor: pointer;
  font-size: 10.5px; color: #98a4b4;
  list-style: none;
}
.ms-edit summary::-webkit-details-marker { display: none; }
.ms-edit summary:hover { color: var(--brand); }
.ms-edit-grid {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px;
  margin-top: 8px; padding: 10px;
  background: #f8fafc; border: 1px solid var(--line); border-radius: 10px;
}
.ms-edit-grid label { display: flex; flex-direction: column; gap: 4px; font-size: 10.5px; color: var(--muted); min-width: 120px; }
.ms-edit-grid input, .ms-edit-grid select { padding: 6px 8px; font-size: 11.5px; }
.ms-edit-grid .grow { min-width: 180px; }

.meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.meta > div { min-width: 0; }
.meta > .full { grid-column: 1 / -1; }
.meta dt { font-size: 10.5px; color: #94a3b8; }
.meta dd { margin-top: 1px; font-size: 12.5px; color: #334155; overflow-wrap: anywhere; }
.meta dd .tag { margin-left: 6px; }

.stack { display: flex; flex-direction: column; gap: 9px; }
.stack label, .field { display: flex; flex-direction: column; gap: 5px; font-size: 11.5px; color: var(--muted); }
.stack textarea, .field textarea { resize: vertical; }
.ack-line { margin-top: 10px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.tl-item { display: grid; grid-template-columns: 66px 1fr; gap: 10px; padding: 9px 0; border-top: 1px dashed #edf0f4; }
.tl-item:first-child { border-top: 0; }
.tl-date { display: flex; flex-direction: column; line-height: 1.3; }
.tl-date strong { font-size: 11px; color: #475569; font-variant-numeric: tabular-nums; }
.tl-date span { font-size: 9.5px; color: #a6b1bf; }
.tl-text { font-size: 11.5px; line-height: 1.6; color: #5b6779; white-space: pre-wrap; overflow-wrap: anywhere; }
.tl-item.manual .tl-text { color: #334155; }

.doclinks { display: flex; flex-direction: column; gap: 2px; }
.doclinks a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 2px;
  font-size: 12.5px; color: #334155;
  border-bottom: 1px solid #f2f4f7;
}
.doclinks a:last-child { border-bottom: 0; }
.doclinks a span { color: #a6b1bf; font-size: 12px; }
.doclinks a:hover { color: var(--brand); }

.entry-form { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.entry-form .date-field { flex: none; width: 140px; }
.entry-form .grow { min-width: 220px; }

/* ===== 表单控件 ===== */
input[type="text"], input[type="password"], input[type="date"], input[type="search"],
input:not([type]), select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: #fff;
  font-size: 12.5px;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus {
  border-color: #8cc9c0;
  box-shadow: 0 0 0 3px rgba(15, 118, 110, .09);
}
textarea { min-height: 54px; line-height: 1.6; }

/* ===== 待跟进 ===== */
.queue { margin-bottom: 26px; }
.queue-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.queue-head h2 { font-size: 14.5px; }
.queue-head h2 em {
  font-style: normal; margin-left: 5px; padding: 0 7px;
  border-radius: 99px; background: #fff1d6; color: #92400e;
  font-size: 11px; font-weight: 700;
}
.attn-list { display: flex; flex-direction: column; gap: 10px; }
@media (min-width: 1180px) {
  .attn-list.compact { display: grid; grid-template-columns: 1fr 1fr; }
}
.attn {
  display: flex; gap: 18px; justify-content: space-between;
  padding: 16px 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid #e8a33c;
  border-radius: 13px;
  box-shadow: var(--shadow);
}
.attn.compact { border-left-color: #cbd5e1; }
.attn-body { min-width: 0; }
.attn-top { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.attn-top a { font-size: 14px; }
.attn-top a:hover { color: var(--brand); }
.attn-ev { margin-top: 6px; font-size: 12.5px; color: #3f4a5c; line-height: 1.6; }
.attn-meta { margin-top: 6px; font-size: 10.5px; color: #94a3b8; }
.attn-tip { margin-top: 8px; display: flex; gap: 8px; align-items: flex-start; font-size: 11.5px; color: #6b7789; }
.attn-tip span {
  flex: none; padding: 0 6px; border-radius: 5px;
  background: var(--brand-soft); color: var(--brand);
  font-size: 10px; font-weight: 700; line-height: 1.7;
}
.attn-act { display: flex; flex-direction: column; gap: 7px; flex: none; align-items: stretch; }

/* ===== 管理 ===== */
.admin-list { display: flex; flex-direction: column; gap: 12px; }
.admin-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 18px;
}
.admin-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.admin-card-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.admin-card-head h3 { font-size: 14.5px; }
.admin-form { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 11px 13px; }
.admin-form label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--muted); min-width: 0; }
.admin-form .wide { grid-column: 1 / -1; }
.admin-actions { grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-top: 4px; }

.account-grid { display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); gap: 16px; align-items: start; }
.bullets { padding-left: 18px; color: #526071; font-size: 12.5px; display: flex; flex-direction: column; gap: 6px; }

.table { width: 100%; border-collapse: collapse; }
.table th {
  padding: 8px 10px; text-align: left;
  font-size: 10.5px; font-weight: 600; color: #94a3b8;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table td { padding: 10px; border-bottom: 1px solid #f2f4f7; font-size: 12.5px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.pw-input { width: 116px; padding: 5px 8px; font-size: 11.5px; }

.user-create { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 11px; }
.user-create label { display: flex; flex-direction: column; gap: 5px; font-size: 10.5px; color: var(--muted); min-width: 130px; flex: 1; }
.user-create .btn { flex: none; }

/* ===== 空状态 ===== */
.empty {
  text-align: center;
  padding: 56px 24px;
  background: var(--panel);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
}
.empty.small { padding: 34px 20px; }
.empty-mark {
  width: 46px; height: 46px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--brand-soft); color: var(--brand);
  font-size: 22px;
}
.empty h2 { font-size: 16px; }
.empty p { margin: 6px auto 16px; max-width: 420px; color: var(--muted); font-size: 12.5px; }
.empty-hint { margin-top: 14px; color: var(--muted); font-size: 12px; }

/* ===== 登录 ===== */
.login-body { background: #0b1422; }
.login-shell { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr); min-height: 100vh; }
.login-brand {
  position: relative;
  display: flex; flex-direction: column; gap: 34px;
  padding: 38px 48px 30px;
  background:
    radial-gradient(900px 460px at 12% 8%, rgba(25, 163, 148, .20), transparent 62%),
    radial-gradient(700px 420px at 92% 96%, rgba(37, 99, 235, .16), transparent 60%),
    linear-gradient(160deg, #0c1727 0%, #0a1220 58%, #0a1526 100%);
  color: #e8eef7;
  overflow: hidden;
}
.login-brand::before {
  content: "";
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148, 163, 184, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, .045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.55), transparent 78%);
  pointer-events: none;
}
.login-copy { position: relative; margin: auto 0; max-width: 560px; }
.login-copy h1 {
  margin-top: 6px;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1.16;
  letter-spacing: -.035em;
  color: #fff;
  font-weight: 700;
}
.login-lead { margin-top: 18px; max-width: 470px; color: #9fb0c7; font-size: 14px; line-height: 1.75; }
.login-points { list-style: none; margin: 34px 0 0; padding: 0; display: flex; flex-direction: column; gap: 18px; }
.login-points li { display: flex; gap: 14px; align-items: flex-start; }
.login-points li > span {
  flex: none; width: 28px; height: 28px; display: grid; place-items: center;
  border-radius: 8px; border: 1px solid rgba(77, 214, 198, .28);
  color: #4dd6c6; font-family: var(--mono); font-size: 10px;
}
.login-points strong { display: block; color: #e8eef7; font-size: 13.5px; }
.login-points p { margin-top: 2px; color: #8395ad; font-size: 12px; }
.login-foot { position: relative; color: #5f7189; font-size: 11px; }

.login-panel {
  display: grid; place-items: center;
  padding: 40px;
  background: #f6f8fb;
}
.login-card { width: 100%; max-width: 380px; }
.login-card h2 { font-size: 23px; letter-spacing: -.025em; }
.login-sub { margin: 6px 0 20px; color: var(--muted); font-size: 12.5px; }
.login-form { display: flex; flex-direction: column; gap: 13px; }
.login-form label { display: flex; flex-direction: column; gap: 6px; font-size: 11.5px; color: var(--muted); font-weight: 600; }
.login-form input { padding: 10px 12px; font-size: 13.5px; }
.login-form .btn { margin-top: 5px; }
.login-card .notice { margin: 0 0 14px; }
.login-help { margin-top: 18px; color: #94a3b8; font-size: 11.5px; line-height: 1.7; }

/* ===== 错误页 ===== */
.error-body { display: grid; place-items: center; min-height: 100vh; background: radial-gradient(800px 400px at 50% 0%, #eaf6f4, #f4f6f9 60%); }
.error-card {
  width: min(440px, 90vw);
  padding: 34px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
}
.error-card h1 { font-size: 24px; letter-spacing: -.02em; }
.error-card > p:not(.eyebrow) { margin-top: 8px; color: var(--muted); font-size: 13px; }
.error-actions { display: flex; gap: 9px; margin-top: 22px; }

/* ===== 响应式 ===== */
@media (max-width: 1180px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 310px; }
  .admin-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1000px) {
  .shell { grid-template-columns: 214px minmax(0, 1fr); }
  .content { padding: 24px 22px 36px; }
  .topbar { padding: 12px 22px; }
  .notice { margin-left: 22px; margin-right: 22px; }
  .detail-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-side { display: grid; grid-template-columns: 1fr 1fr; align-items: start; }
  .detail-side .card:last-child { grid-column: 1 / -1; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 760px) {
  .shell { display: block; }
  .sidebar {
    position: static; height: auto; overflow: visible;
    padding: 14px 16px;
    gap: 14px;
  }
  .brand { padding: 0; }
  .brand-text small { display: none; }
  .nav { flex-direction: row; overflow-x: auto; gap: 4px; padding-bottom: 2px; }
  .nav-link { flex: none; padding: 8px 11px; }
  .nav-link em { display: none; }
  .nav-group { display: none; }
  .nav-badge { margin-left: 0; }
  .sidebar-foot { display: none; }
  .topbar { position: static; padding: 10px 16px; }
  .topbar-crumb { font-size: 11.5px; }
  .sync-note { display: none; }
  .content { padding: 18px 16px 30px; }
  .notice { margin: 12px 16px 0; }
  .pagehead { flex-direction: column; align-items: stretch; gap: 14px; }
  .pagehead-side { justify-content: flex-start; }
  .filterbar { flex-direction: column; align-items: stretch; }
  .searchbox { width: 100%; }
  .pgrid { grid-template-columns: 1fr; }
  .detail-hero { flex-direction: column; }
  .hero-actions { align-self: flex-start; }
  .detail-side { grid-template-columns: 1fr; }
  .detail-side .card:last-child { grid-column: auto; }
  .progress-card { flex-direction: column; align-items: flex-start; }
  .ring { width: 112px; height: 112px; }
  .ms-list { margin-left: 0; }
  .ms { grid-template-columns: 12px minmax(0, 1fr); }
  .ms-meta { grid-column: 2; flex-direction: row; gap: 8px; justify-content: flex-start; }
  .admin-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-actions { flex-direction: column; align-items: flex-start; }
  .attn { flex-direction: column; }
  .attn-act { flex-direction: row; }
  .account-grid { grid-template-columns: 1fr; }
  .foot { flex-direction: column; gap: 4px; padding: 16px; }
  .login-shell { grid-template-columns: 1fr; }
  .login-brand { padding: 26px 24px 30px; gap: 22px; }
  .login-copy h1 { font-size: 32px; }
  .login-points { display: none; }
  .login-panel { padding: 30px 24px 46px; }
  .login-card { max-width: 420px; }
  .users-table { display: block; overflow-x: auto; }
}
@media (max-width: 520px) {
  .kpis { grid-template-columns: 1fr 1fr; gap: 9px; }
  .kpi { padding: 13px 14px; }
  .kpi strong { font-size: 26px; }
  .admin-form { grid-template-columns: 1fr; }
  .meta { grid-template-columns: 1fr; }
  .entry-form .date-field { width: 100%; }
  .entry-form .btn { width: 100%; }
  .topbar-actions .btn { padding: 6px 9px; font-size: 11px; }
}

/* ===== 顶栏移动端账号 / 只读字段 ===== */
.topbar-user { display: none; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-2); }
.topbar-user form { display: inline-flex; margin: 0; }
.topbar-user .linkbtn { color: var(--muted); font-size: 11.5px; }

.admin-form label.readonly span {
  padding: 8px 2px;
  font-size: 12.5px; font-weight: 600; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.admin-form label.readonly small { color: #a6b1bf; font-size: 9.5px; }

@media (max-width: 760px) {
  .topbar-user { display: flex; padding-left: 10px; border-left: 1px solid var(--line-strong); }
}
