/* 模具开发工作台 —— 样式 */
:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e6e8ec;
  --line-2: #eef0f3;
  --text: #1a2233;
  --text-2: #5b6577;
  --text-3: #8b94a5;
  --blue: #2563eb;
  --blue-bg: #eff4ff;
  --green: #15803d;
  --green-bg: #e8f7ee;
  --amber: #b45309;
  --amber-bg: #fef3e2;
  --red: #dc2626;
  --red-bg: #fdecec;
  --purple: #6d28d9;
  --purple-bg: #f1ecfe;
  --side: #111827;
  --side-2: #1b2434;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .06);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; }
button { font-family: inherit; }
.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* ---------------- 布局 ---------------- */
.app { display: flex; height: 100vh; overflow: hidden; }

.side {
  width: 216px; flex: 0 0 216px;
  background: var(--side);
  color: #cbd5e1;
  display: flex; flex-direction: column;
  padding: 18px 12px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 18px; }
.brand-mark {
  width: 34px; height: 34px; border-radius: 9px;
  background: linear-gradient(140deg, #3b82f6, #1d4ed8);
  color: #fff; font-weight: 700; font-size: 17px;
  display: grid; place-items: center;
  box-shadow: 0 4px 12px rgba(37, 99, 235, .35);
}
.brand-txt b { display: block; color: #fff; font-size: 14px; letter-spacing: .2px; }
.brand-txt span { font-size: 9.5px; letter-spacing: 1.6px; color: #64748b; }

.nav { display: flex; flex-direction: column; gap: 2px; margin-top: 6px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px; border-radius: 8px;
  color: #9aa6b8; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item svg { width: 17px; height: 17px; fill: currentColor; opacity: .85; }
.nav-item:hover { background: var(--side-2); color: #e2e8f0; }
.nav-item.active { background: #1d2b45; color: #fff; }
.nav-item.active svg { fill: #60a5fa; opacity: 1; }

.side-foot { margin-top: auto; padding: 10px 6px 0; border-top: 1px solid #1f2937; }
.export-link { display: block; font-size: 12px; color: #7d8aa0; padding: 4px 0; }
.export-link:hover { color: #93c5fd; }
.side-note { font-size: 10.5px; color: #4b5563; margin-top: 10px; line-height: 1.5; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow: hidden; }

.topbar {
  height: 56px; flex: 0 0 56px;
  background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 18px;
  padding: 0 22px; z-index: 20;
}
.crumb { font-size: 14.5px; font-weight: 600; white-space: nowrap; }
.search-wrap { position: relative; margin-left: auto; width: 300px; max-width: 40vw; }
.search-ico { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 15px; height: 15px; fill: #94a3b8; }
#gsearch {
  width: 100%; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: #f8fafc;
  padding: 0 12px 0 32px; font-size: 13px; outline: none;
  transition: border .15s, background .15s;
}
#gsearch:focus { border-color: #b9cdfb; background: #fff; box-shadow: 0 0 0 3px rgba(37, 99, 235, .08); }
.search-results {
  position: absolute; top: 40px; left: 0; right: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 10px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
  max-height: 380px; overflow: auto; padding: 6px;
}
.sr-item { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 7px; cursor: pointer; }
.sr-item:hover { background: #f1f5f9; }
.sr-item b { font-size: 13px; }
.sr-item span { font-size: 12px; color: var(--text-2); }
.today { font-size: 12.5px; color: var(--text-3); white-space: nowrap; }

.page { flex: 1; overflow: auto; padding: 22px 24px 60px; }
.loading { color: var(--text-3); padding: 40px; text-align: center; }

/* ---------------- 通用 ---------------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.card-h {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--line-2);
}
.card-h h3 { margin: 0; font-size: 14px; font-weight: 650; }
.card-h .sub { font-size: 12px; color: var(--text-3); }
.card-h .right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.card-b { padding: 14px 16px; }
.card-b.tight { padding: 0; }

.page-head { display: flex; align-items: flex-end; gap: 14px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h1 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.page-head .desc { color: var(--text-2); font-size: 13px; }
.page-head .spacer { flex: 1; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 13px; border-radius: 8px;
  border: 1px solid var(--line); background: #fff; color: var(--text);
  font-size: 13px; cursor: pointer; white-space: nowrap;
  transition: all .15s;
}
.btn:hover { border-color: #c9cfda; background: #f8fafc; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: #1d4ed8; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.ghost:hover { background: #eef1f5; }
.btn.sm { height: 27px; padding: 0 9px; font-size: 12px; border-radius: 6px; }
.btn.danger { color: var(--red); border-color: #f3cccc; }
.btn:disabled { opacity: .5; cursor: default; }

.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 22px; padding: 0 8px; border-radius: 6px;
  font-size: 11.5px; font-weight: 500; white-space: nowrap;
  background: #f1f3f6; color: var(--text-2);
}
.chip.blue { background: var(--blue-bg); color: #1d4ed8; }
.chip.green { background: var(--green-bg); color: var(--green); }
.chip.amber { background: var(--amber-bg); color: var(--amber); }
.chip.red { background: var(--red-bg); color: var(--red); }
.chip.purple { background: var(--purple-bg); color: var(--purple); }
.chip.gray { background: #f1f3f6; color: #64748b; }
.chip.dot::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.health { font-weight: 600; }
.health.正常 { color: var(--green); background: var(--green-bg); }
.health.关注 { color: #a16207; background: #fef9e7; }
.health.预警 { color: var(--amber); background: var(--amber-bg); }
.health.延期 { color: var(--red); background: var(--red-bg); }
.health.暂停 { color: #64748b; background: #f1f3f6; }
.health.已结案 { color: #475569; background: #eef1f5; }

.muted { color: var(--text-3); }
.small { font-size: 12px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; }

/* 表格 */
.tbl-wrap { overflow: auto; }
table.tbl { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.tbl th {
  position: sticky; top: 0; z-index: 2;
  background: #f8f9fb; text-align: left; font-weight: 600;
  color: var(--text-2); font-size: 11.5px; letter-spacing: .3px;
  padding: 9px 12px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.tbl tbody tr:hover td { background: #fafbfc; }
.tbl tr.click { cursor: pointer; }
.tbl td.r, .tbl th.r { text-align: right; }
.tbl .wrap { white-space: normal; min-width: 160px; }

/* ---------------- 工作台 ---------------- */
.kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.kpi {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 15px; box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.kpi .k-label { font-size: 12px; color: var(--text-2); display: flex; align-items: center; gap: 5px; }
.kpi .k-val { font-size: 26px; font-weight: 700; letter-spacing: -.5px; margin-top: 2px; line-height: 1.25; }
.kpi .k-sub { font-size: 11.5px; color: var(--text-3); margin-top: 1px; }
.kpi.alert .k-val { color: var(--red); }
.kpi.warn .k-val { color: var(--amber); }
.kpi.ok .k-val { color: var(--green); }

.grid-main { display: grid; grid-template-columns: minmax(0, 1.62fr) minmax(300px, 1fr); gap: 14px; align-items: start; }

.proj-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 14px 16px; }
.proj-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 13px 14px;
  cursor: pointer; transition: all .15s; background: #fff;
}
.proj-card:hover { border-color: #c7d2fe; box-shadow: 0 4px 14px rgba(37, 99, 235, .08); transform: translateY(-1px); }
.proj-top { display: flex; align-items: center; gap: 8px; }
.proj-code { font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-bg); padding: 1px 6px; border-radius: 5px; }
.proj-name { font-weight: 600; font-size: 14px; }
.proj-meta { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.proj-nums { display: flex; gap: 12px; margin-top: 10px; font-size: 11.5px; color: var(--text-2); }
.proj-nums b { font-size: 15px; color: var(--text); font-weight: 650; }
.proj-nums .red b { color: var(--red); }
.proj-nums .amber b { color: var(--amber); }

.pbar { height: 6px; background: #eef1f5; border-radius: 4px; overflow: hidden; margin-top: 10px; }
.pbar > i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 4px; }

.todo-list { max-height: 460px; overflow: auto; }
.todo {
  display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2);
  cursor: pointer; align-items: flex-start;
}
.todo:hover { background: #fafbfc; }
.todo-date {
  width: 62px; flex: 0 0 62px; text-align: center; font-size: 10px; white-space: nowrap; line-height: 1.25;
  padding: 3px 0; border-radius: 6px; background: #f4f6f9; color: var(--text-2); font-variant-numeric: tabular-nums;
}
.todo-date b { display: block; font-size: 14px; color: var(--text); }
.todo-date.over { background: var(--red-bg); color: var(--red); }
.todo-date.over b { color: var(--red); }
.todo-date.soon { background: var(--amber-bg); color: var(--amber); }
.todo-date.soon b { color: var(--amber); }
.todo-main { min-width: 0; flex: 1; }
.todo-title { font-size: 13px; font-weight: 550; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.todo-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.feed { padding: 2px 0; }
.feed-item { display: flex; gap: 10px; padding: 10px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.feed-item:hover { background: #fafbfc; }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; margin-top: 7px; flex: 0 0 7px; }
.feed-dot.结构 { background: #2563eb; } .feed-dot.尺寸 { background: #7c3aed; }
.feed-dot.材料 { background: #0891b2; } .feed-dot.工艺 { background: #d97706; }
.feed-dot.外观 { background: #db2777; } .feed-dot.客户需求 { background: #dc2626; }
.feed-dot.供应商 { background: #059669; } .feed-dot.进度 { background: #64748b; }
.feed-dot.信息修订 { background: #94a3b8; }
.feed-body { min-width: 0; flex: 1; }
.feed-title { font-size: 12.8px; }
.feed-meta { font-size: 11px; color: var(--text-3); margin-top: 1px; }

/* ---------------- 项目详情 / 矩阵 ---------------- */
.stat-row { display: flex; gap: 26px; flex-wrap: wrap; }
.stat-row .st b { font-size: 20px; font-weight: 700; display: block; line-height: 1.2; }
.stat-row .st span { font-size: 11.5px; color: var(--text-3); }

.matrix { font-size: 11.5px; }
.matrix th.stage-h { text-align: center; padding: 7px 2px; font-size: 10.5px; letter-spacing: 0; }
.matrix td { padding: 4px 3px; border-bottom: 1px solid var(--line-2); }
.matrix td.name { min-width: 156px; padding-left: 12px; }
.matrix td.name .pc { font-size: 10.5px; color: var(--text-3); display: block; line-height: 1.2; }
.matrix td.name b { font-weight: 550; }
.cell {
  display: block; text-align: center; padding: 2px 0; border-radius: 5px;
  font-size: 10.5px; font-variant-numeric: tabular-nums; cursor: pointer;
  border: 1px solid transparent; line-height: 1.5;
}
.cell:hover { filter: brightness(.96); box-shadow: 0 0 0 1px rgba(37,99,235,.3); }
.cell.done { background: var(--green-bg); color: #166534; }
.cell.late { background: var(--red-bg); color: #991b1b; }
.cell.warn { background: #fef9e7; color: #a16207; }
.cell.current { background: var(--blue-bg); color: #1d4ed8; font-weight: 700; border-color: #bfdbfe; }
.cell.overdue { background: var(--red-bg); color: #b91c1c; font-weight: 700; border-color: #fecaca; }
.cell.future { background: #f8fafc; color: #a3aab8; }
.cell.empty { background: transparent; color: #d0d5dd; }
.legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--text-2); flex-wrap: wrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; margin-right: 4px; vertical-align: -1px; }

/* ---------------- 模具详情 ---------------- */
.mold-head { display: flex; gap: 16px; align-items: flex-start; flex-wrap: wrap; }
.mold-title { font-size: 20px; font-weight: 700; letter-spacing: -.2px; }
.mold-sub { color: var(--text-2); font-size: 13px; margin-top: 2px; }
.meta-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; }
.meta-grid > div { padding: 10px 14px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.meta-grid > div:nth-child(4n) { border-right: none; }
.meta-grid .ml { font-size: 11px; color: var(--text-3); }
.meta-grid .mv { font-size: 13px; font-weight: 550; margin-top: 1px; }

.steps { display: flex; padding: 6px 4px 0; overflow-x: auto; }
.step { flex: 1; min-width: 86px; position: relative; padding: 0 4px 12px; text-align: center; }
.step::before { content: ""; position: absolute; top: 13px; left: 0; right: 0; height: 2px; background: var(--line); }
.step:first-child::before { left: 50%; }
.step:last-child::before { right: 50%; }
.step .dot {
  position: relative; z-index: 1; width: 26px; height: 26px; margin: 0 auto 6px;
  border-radius: 50%; background: #fff; border: 2px solid var(--line);
  display: grid; place-items: center; font-size: 11px; color: var(--text-3);
}
.step.done .dot { background: var(--green); border-color: var(--green); color: #fff; }
.step.done::before { background: #86efac; }
.step.done.late .dot { background: #d97706; border-color: #d97706; }
.step.current .dot { background: #fff; border-color: var(--blue); color: var(--blue); box-shadow: 0 0 0 4px rgba(37,99,235,.12); font-weight: 700; }
.step.overdue .dot { background: #fff; border-color: var(--red); color: var(--red); box-shadow: 0 0 0 4px rgba(220,38,38,.1); }
.step .s-name { font-size: 11.5px; color: var(--text-2); }
.step.current .s-name { color: var(--blue); font-weight: 650; }
.step .s-date { font-size: 10px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.step .s-date.late { color: var(--red); }
.step .s-date.slight { color: var(--amber); }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); padding: 0 14px; background: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.tab {
  padding: 11px 13px; font-size: 13px; color: var(--text-2); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }
.tab .cnt { font-size: 11px; background: #eef1f5; border-radius: 8px; padding: 0 5px; margin-left: 4px; }

.timeline { padding: 14px 18px; }
.tl-item { position: relative; padding: 0 0 18px 22px; border-left: 1px solid var(--line); margin-left: 5px; }
.tl-item:last-child { border-left-color: transparent; padding-bottom: 2px; }
.tl-item::before {
  content: ""; position: absolute; left: -5.5px; top: 4px; width: 10px; height: 10px;
  border-radius: 50%; background: #fff; border: 2px solid #94a3b8;
}
.tl-item.结构::before, .tl-item.尺寸::before { border-color: #2563eb; }
.tl-item.材料::before { border-color: #0891b2; }
.tl-item.工艺::before { border-color: #d97706; }
.tl-item.外观::before { border-color: #db2777; }
.tl-item.客户需求::before { border-color: #dc2626; }
.tl-item.供应商::before { border-color: #059669; }
.tl-item.信息修订::before { border-color: #cbd5e1; }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-title { font-size: 13.5px; font-weight: 600; }
.tl-time { font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.tl-body { margin-top: 6px; font-size: 12.5px; color: var(--text-2); }
.diff { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 6px; }
.diff .old, .diff .new { padding: 7px 10px; border-radius: 7px; font-size: 12px; line-height: 1.5; }
.diff .old { background: #fdf2f2; color: #7f1d1d; border: 1px solid #fde2e2; }
.diff .new { background: #f0fdf4; color: #14532d; border: 1px solid #dcfce7; }
.diff .lbl { font-size: 10px; letter-spacing: .5px; opacity: .65; display: block; margin-bottom: 2px; }
.tl-meta { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 6px; font-size: 11.5px; color: var(--text-3); }

.empty-box { padding: 34px; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------- 表单 / 弹窗 ---------------- */
.modal-mask {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .42);
  display: grid; place-items: center; z-index: 100; padding: 20px;
  animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  background: #fff; border-radius: 14px; width: 640px; max-width: 100%;
  max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(15, 23, 42, .28);
  animation: pop .16s ease-out;
}
@keyframes pop { from { transform: translateY(8px) scale(.99); opacity: .6; } }
.modal-h { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; font-size: 15.5px; }
.modal-h .x { margin-left: auto; cursor: pointer; color: var(--text-3); font-size: 20px; line-height: 1; padding: 0 4px; }
.modal-b { padding: 18px 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; gap: 10px; justify-content: flex-end; background: #fafbfc; border-radius: 0 0 14px 14px; }

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12px; color: var(--text-2); font-weight: 500; }
.field input, .field select, .field textarea {
  border: 1px solid var(--line); border-radius: 8px; padding: 7px 10px;
  font-size: 13px; font-family: inherit; color: var(--text); background: #fff; outline: none;
  transition: border .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: #a9c1f8; box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}
.field textarea { resize: vertical; min-height: 62px; line-height: 1.5; }
.field .hint { font-size: 11px; color: var(--text-3); }

.toast {
  position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: #111827; color: #fff; padding: 9px 16px; border-radius: 9px;
  font-size: 13px; opacity: 0; pointer-events: none; transition: all .22s; z-index: 200;
  box-shadow: 0 10px 30px rgba(0,0,0,.2);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------------- 台账筛选 ---------------- */
.filters { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.filters select, .filters input {
  height: 30px; border: 1px solid var(--line); border-radius: 7px; padding: 0 9px;
  font-size: 12.5px; background: #fff; color: var(--text); outline: none; font-family: inherit;
}
.filters input { min-width: 190px; }
.filters label input[type="checkbox"] {
  min-width: 0; width: 15px; height: 15px; padding: 0; margin: 0;
  accent-color: var(--blue); cursor: pointer;
}
.filters label { cursor: pointer; white-space: nowrap; }
.filters .cnt { font-size: 12px; color: var(--text-3); margin-left: auto; }

/* 供应商 */
.sup-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.sup-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.sup-h { padding: 13px 15px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 9px; }
.sup-h .nm { font-weight: 650; font-size: 14px; }
.sup-h .right { margin-left: auto; }
.sup-stats { display: flex; gap: 16px; padding: 11px 15px; font-size: 11.5px; color: var(--text-3); border-bottom: 1px solid var(--line-2); }
.sup-stats b { display: block; font-size: 15px; color: var(--text); font-weight: 650; }
.sup-list { max-height: 220px; overflow: auto; }
.sup-row { display: flex; align-items: center; gap: 8px; padding: 7px 15px; font-size: 12.5px; cursor: pointer; }
.sup-row:hover { background: #fafbfc; }
.sup-row .cd { font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-2); }

/* 报告 */
.report { padding: 22px 26px; font-size: 13.5px; line-height: 1.75; }
.report h1 { font-size: 19px; margin: 0 0 4px; }
.report h2 { font-size: 15px; margin: 22px 0 8px; padding-bottom: 5px; border-bottom: 1px solid var(--line-2); }
.report h3 { font-size: 13.5px; margin: 14px 0 6px; }
.report table { border-collapse: collapse; width: 100%; margin: 8px 0 14px; font-size: 12px; }
.report th { background: #f8f9fb; text-align: left; padding: 6px 9px; border: 1px solid var(--line); font-weight: 600; white-space: nowrap; }
.report td { padding: 6px 9px; border: 1px solid var(--line-2); vertical-align: top; }
.report ul { margin: 6px 0; padding-left: 20px; }
.report code { background: #f1f3f6; padding: 1px 5px; border-radius: 4px; font-size: 12px; }
.report hr { border: none; border-top: 1px solid var(--line); margin: 18px 0; }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .grid-main { grid-template-columns: 1fr; }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-grid > div:nth-child(2n) { border-right: none; }
}
@media (max-width: 860px) {
  .side { width: 60px; flex: 0 0 60px; padding: 16px 8px; }
  .side .brand-txt, .side .nav-item span, .side .side-foot { display: none; }
  .nav-item { justify-content: center; padding: 10px 0; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .proj-grid { grid-template-columns: 1fr; }
  .today { display: none; }
  .search-wrap { width: 180px; }
  .page { padding: 16px 14px 50px; }
  .diff { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------------- 打印 ---------------- */
@media print {
  .side, .topbar, .page-head .btn, .page-head a, .modal-mask, .toast { display: none !important; }
  .app, .main, .page { height: auto; overflow: visible; display: block; }
  .page { padding: 0; }
  .card { border: none; box-shadow: none; }
  .report { padding: 0; }
  body { background: #fff; }
}

/* ---------------- 登录 ---------------- */
.login-mask {
  position: fixed; inset: 0; z-index: 300;
  background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, #0f172a 55%, #0b1220 100%);
  display: grid; place-items: center; padding: 20px;
}
.login-card {
  width: 380px; max-width: 100%; background: #fff; border-radius: 16px;
  padding: 26px 28px 22px; box-shadow: 0 30px 80px rgba(0, 0, 0, .45);
}
.login-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.login-brand .brand-txt b { color: var(--text); font-size: 15px; }
.login-brand .brand-txt span { color: var(--text-3); }
.login-card h2 { margin: 0 0 4px; font-size: 21px; letter-spacing: -.3px; }
.login-sub { margin: 0 0 18px; font-size: 12.5px; color: var(--text-2); line-height: 1.6; }
.login-card label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 12px; }
.login-card input {
  display: block; width: 100%; margin-top: 5px; height: 38px;
  border: 1px solid var(--line); border-radius: 9px; padding: 0 12px;
  font-size: 14px; outline: none; font-family: inherit; background: #fbfcfd;
  transition: border .15s, box-shadow .15s;
}
.login-card input:focus { border-color: #a9c1f8; background: #fff; box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.login-card .btn { width: 100%; height: 40px; justify-content: center; font-size: 14px; margin-top: 4px; }
.login-err { color: var(--red); font-size: 12.5px; min-height: 18px; margin-bottom: 6px; }
.login-hint { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); font-size: 11.5px; color: var(--text-3); line-height: 1.8; }
.login-hint b { color: var(--text-2); font-family: ui-monospace, monospace; }

/* ---------------- 侧边用户 ---------------- */
.side-user { display: flex; align-items: center; gap: 8px; padding: 8px 4px 10px; margin-bottom: 6px; border-bottom: 1px solid #1f2937; }
.side-user .avatar {
  width: 30px; height: 30px; border-radius: 50%; flex: 0 0 30px;
  background: #1d4ed8; color: #fff; display: grid; place-items: center;
  font-size: 12.5px; font-weight: 600;
}
.side-user .uinfo { min-width: 0; }
.side-user .uinfo b { display: block; color: #e2e8f0; font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-user .uinfo span { display: block; color: #64748b; font-size: 10.5px; white-space: nowrap; }
.side-user .logout {
  margin-left: auto; background: transparent; border: 1px solid #334155; color: #94a3b8;
  border-radius: 6px; font-size: 11px; padding: 3px 7px; cursor: pointer;
  white-space: nowrap; flex: 0 0 auto;
}
.side-user .logout:hover { color: #fca5a5; border-color: #7f1d1d; }

.readonly-note {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  color: #92400e; background: #fef3e2; border: 1px solid #fde68a;
  padding: 5px 10px; border-radius: 8px;
}

/* 成员管理 */
.user-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.user-row .nm { width: 130px; font-weight: 550; }
.user-row .un { width: 110px; font-family: ui-monospace, monospace; font-size: 11.5px; color: var(--text-3); }
.user-row select { height: 28px; border: 1px solid var(--line); border-radius: 6px; font-size: 12px; padding: 0 6px; }
.user-row input { height: 28px; width: 110px; border: 1px solid var(--line); border-radius: 6px; padding: 0 8px; font-size: 12px; }
.user-row .right { margin-left: auto; display: flex; gap: 6px; align-items: center; }

/* 项目协作人 */
.member-line { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.member-line .btn { height: 24px; font-size: 11.5px; padding: 0 8px; }
.member-list {
  display: grid; grid-template-columns: 1fr 1fr; gap: 2px 14px;
  max-height: 340px; overflow: auto; padding: 4px 2px;
}
.member-pick {
  display: flex; align-items: center; gap: 8px; padding: 7px 8px;
  border-radius: 8px; cursor: pointer; font-size: 13px;
}
.member-pick:hover { background: #f6f8fb; }
.member-pick input {
  width: 16px; height: 16px; margin: 0; accent-color: var(--blue); cursor: pointer;
}
.member-pick .nm { font-weight: 550; }
.member-pick .small { margin-left: auto; }

/* ---------------- 手机端：表格转卡片 ---------------- */
@media (max-width: 720px) {
  .tbl.cards { min-width: 0 !important; }
  .tbl.cards thead { display: none; }
  .tbl.cards tbody tr {
    display: block; border: 1px solid var(--line); border-radius: 10px;
    margin: 10px; padding: 8px 12px; background: #fff;
  }
  .tbl.cards tbody tr:hover td { background: transparent; }
  .tbl.cards tbody td {
    display: block; border: none; padding: 5px 0; text-align: left;
  }
  .tbl.cards tbody td::before {
    content: attr(data-label); display: block; color: var(--text-3);
    font-size: 11px; margin-bottom: 1px;
  }
  .tbl.cards tbody td:first-child {
    display: block; text-align: left; border-bottom: 1px solid var(--line-2);
    padding-bottom: 7px; margin-bottom: 3px;
  }
  .tbl.cards tbody td:first-child::before { content: ""; }
  .tbl.cards .hide-m { display: none !important; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .page-head h1 { font-size: 18px; }
  .grid-main .todo-card { order: -1; }
  .tbl:not(.cards) { min-width: 620px; }
}

/* 图片附件 */
.thumbs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.thumb { position: relative; width: 88px; height: 88px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: #f8fafc; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb button {
  position: absolute; top: 2px; right: 2px; width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(15,23,42,.65); color: #fff; cursor: pointer; font-size: 13px; line-height: 1;
}

/* 更多菜单 */
.more { position: relative; }
.more > summary { list-style: none; cursor: pointer; }
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary { background: #eef1f5; border-color: #c9cfda; }
.more .menu {
  position: absolute; right: 0; top: 38px; z-index: 50; min-width: 130px;
  background: #fff; border: 1px solid var(--line); border-radius: 9px;
  box-shadow: 0 12px 30px rgba(15,23,42,.14); padding: 5px;
}
.more .menu button {
  display: block; width: 100%; text-align: left; border: none; background: transparent;
  padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--text); cursor: pointer;
}
.more .menu button:hover { background: #f4f6f9; }
.more .menu button.danger { color: var(--red); }

/* ================= 手机端（≤720px）：底部导航 + 抽屉 ================= */
.mnav, .side-mask { display: none; }

@media (max-width: 720px) {
  .app { display: block; height: auto; overflow: visible; }
  .main { height: auto; min-height: 100vh; overflow: visible; padding-bottom: 62px; }

  /* 侧边栏改成抽屉 */
  .side {
    position: fixed; top: 0; bottom: 0; left: -280px; width: 264px; flex: none;
    z-index: 200; padding: 18px 12px 24px; overflow-y: auto;
    transition: left .22s ease; box-shadow: 0 0 40px rgba(0,0,0,.35);
  }
  .side.open { left: 0; }
  .side .brand-txt, .side .side-foot { display: block; }
  .side .nav-item { justify-content: flex-start; padding: 11px 12px; font-size: 14px; }
  .side .nav-item span { display: inline; }
  .side-mask {
    display: block; position: fixed; inset: 0; background: rgba(15,23,42,.45);
    opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 150;
  }
  .side-mask.show { opacity: 1; pointer-events: auto; }

  /* 底部导航 */
  .mnav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 120;
    height: 60px; background: #fff; border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 12px rgba(15,23,42,.06);
  }
  .mnav-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; font-size: 10.5px; color: #64748b; border: none; background: none;
    cursor: pointer; text-decoration: none; padding: 4px 0;
  }
  .mnav-item svg { width: 20px; height: 20px; fill: currentColor; }
  .mnav-item.active { color: var(--blue); }
  .mnav-item:active { background: #f1f5f9; }

  /* 顶栏 */
  .topbar { padding: 0 12px; gap: 10px; }
  .crumb { font-size: 15px; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .search-wrap { flex: 1; width: auto; max-width: none; }
  .page { padding: 14px 12px 28px; }

  /* 页头按钮：等宽换行，手指好点 */
  .page-head { gap: 8px; }
  .page-head > div:first-child { flex: 1 1 100%; }
  .page-head .spacer { display: none; }
  .page-head h1 { font-size: 19px; }
  .page-head .btn { flex: 1 1 auto; justify-content: center; min-width: 92px; height: 40px; }
  .page-head .more { flex: 1 1 auto; }
  .page-head .more > summary { width: 100%; justify-content: center; }

  .btn { height: 38px; }
  .btn.sm { height: 32px; }

  /* 卡片头、图例、标签页 */
  .card-h { flex-wrap: wrap; gap: 6px; }
  .card-h .right { margin-left: 0; width: 100%; justify-content: flex-end; }
  .legend { gap: 8px; font-size: 11px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .tab { flex: 0 0 auto; padding: 11px 10px; }

  /* 阶段矩阵：横向滚动，首列固定，日期不折行 */
  .tbl.matrix { min-width: 720px; }
  .matrix td.name { position: sticky; left: 0; background: #fff; z-index: 1; min-width: 128px; }
  .matrix .cell { white-space: nowrap; font-size: 10px; padding: 3px 1px; }

  /* 弹窗 */
  .modal-mask { padding: 8px; align-items: flex-start; }
  .modal { width: 100% !important; max-height: 94vh; }
  .modal-f { position: sticky; bottom: 0; }

  .kpi-grid { gap: 10px; }
  .stat-row { gap: 14px 18px; }
  .filters select { flex: 1 1 45%; min-width: 0; }
  .filters input { flex: 1 1 100%; min-width: 0; }
  .filters .cnt { width: 100%; text-align: right; margin-left: 0; }
  .stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
  .toast { bottom: 76px; }
}

/* 快捷操作列 */
.quick { white-space: nowrap; text-align: right; }
.quick .btn { height: 28px; padding: 0 9px; font-size: 12px; }
.quick .btn + .btn { margin-left: 6px; }
@media (max-width: 720px) {
  .tbl.cards td.quick { display: flex; gap: 8px; align-items: center; padding-top: 8px; }
  .tbl.cards td.quick::before { margin: 0 8px 0 0; }
  .quick .btn { height: 36px; padding: 0 14px; font-size: 13px; }
}

/* 我的模具：手机紧凑卡片 */
.my-list { display: none; padding: 10px 12px; }
.my-card {
  border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
  margin-bottom: 10px; background: #fff; cursor: pointer;
}
.my-card:active { background: #f8fafc; }
.mc-top { display: flex; align-items: center; gap: 8px; }
.mc-top b { font-size: 13px; }
.mc-top .chip { margin-left: auto; }
.mc-mid { font-size: 12.5px; color: var(--text-2); margin-top: 3px; }
.mc-actions { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.mc-actions .btn { height: 32px; padding: 0 12px; font-size: 12.5px; }
@media (max-width: 720px) {
  .my-list { display: block; }
  .my-table { display: none; }
}

/* ================= 汇报看板 ================= */
.board { max-width: 1400px; margin: 0 auto; }
.board-head { display: flex; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.bh-date { font-size: 13px; color: var(--text-3); letter-spacing: .5px; }
.bh-title { font-size: 26px; font-weight: 700; letter-spacing: -.4px; margin-top: 2px; line-height: 1.35; }
.bh-actions { margin-left: auto; display: flex; gap: 8px; flex-shrink: 0; }

.bnum-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 22px; }
.bnum {
  background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
  box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.bnum::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #cbd5e1; }
.bnum.red::after { background: #dc2626; }
.bnum.amber::after { background: #d97706; }
.bnum.green::after { background: #16a34a; }
.bn-v { display: block; font-size: 46px; font-weight: 750; line-height: 1; letter-spacing: -1.5px; }
.bnum.red .bn-v { color: #dc2626; }
.bnum.amber .bn-v { color: #b45309; }
.bnum.green .bn-v { color: #15803d; }
.bn-l { display: block; margin-top: 6px; font-size: 12.5px; color: var(--text-3); }

.bsec-title { font-size: 14px; font-weight: 650; color: var(--text-2); margin: 22px 0 10px; }

.bproj-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.bproj {
  background: #fff; border: 1px solid var(--line); border-left: 5px solid #cbd5e1;
  border-radius: 12px; padding: 14px 16px; box-shadow: var(--shadow);
}
.bproj.p-red { border-left-color: #dc2626; }
.bproj.p-amber { border-left-color: #d97706; }
.bproj.p-green { border-left-color: #16a34a; }
.bp-top { display: flex; align-items: baseline; gap: 8px; }
.bp-top b { font-size: 16px; }
.bp-name { font-size: 14px; color: var(--text-2); }
.bp-progress { margin-left: auto; font-size: 20px; font-weight: 700; color: var(--text); }
.bp-line { margin-top: 8px; font-size: 13.5px; color: var(--text); line-height: 1.5; }
.bproj.p-red .bp-line { color: #991b1b; }
.bproj.p-amber .bp-line { color: #92400e; }
.bp-meta { margin-top: 6px; font-size: 12px; color: var(--text-3); }
.bp-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; display: inline-block; }
.p-red .bp-dot { background: #dc2626; }
.p-amber .bp-dot { background: #d97706; }
.p-green .bp-dot { background: #16a34a; }

.brisk-list { display: flex; flex-direction: column; gap: 8px; }
.brisk {
  display: flex; align-items: center; gap: 12px; background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 14px; cursor: pointer;
}
.brisk:hover { border-color: #c7d2fe; }
.br-idx { width: 22px; height: 22px; border-radius: 6px; background: #fef2f2; color: #dc2626; font-size: 12px; font-weight: 700; display: grid; place-items: center; flex: 0 0 22px; }
.br-main { display: flex; flex-direction: column; min-width: 0; }
.br-main b { font-size: 14px; }
.br-meta { font-size: 12px; color: var(--text-3); }
.br-days { margin-left: auto; font-size: 18px; font-weight: 700; color: #dc2626; white-space: nowrap; }

.bweek { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-top: 22px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; }
.bweek > div { text-align: center; }
.bweek b { display: block; font-size: 24px; font-weight: 700; }
.bweek span { font-size: 11.5px; color: var(--text-3); }
.board-foot { margin-top: 14px; font-size: 11.5px; color: var(--text-3); text-align: right; }

body.board-mode .side, body.board-mode .topbar, body.board-mode .mnav { display: none !important; }
body.board-mode .main { height: auto; }
body.board-mode .page { padding: 28px 40px; }

@media (max-width: 1100px) {
  .bnum-row, .bweek { grid-template-columns: repeat(3, 1fr); }
  .bproj-grid { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .board-head { flex-wrap: wrap; }
  .bh-title { font-size: 20px; }
  .bh-actions { margin-left: 0; width: 100%; }
  .bh-actions .btn { flex: 1; }
  .bnum-row { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .bnum { padding: 12px 14px; }
  .bn-v { font-size: 34px; }
  .bweek { grid-template-columns: repeat(2, 1fr); gap: 10px; }
}

/* 快速登记变更 */
.cat-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.cat-chip {
  border: 1px solid var(--line); background: #fff; border-radius: 999px;
  padding: 6px 13px; font-size: 13px; color: var(--text-2); cursor: pointer;
  font-family: inherit; transition: all .12s;
}
.cat-chip:active { transform: scale(.97); }
.cat-chip.on { background: var(--blue); border-color: var(--blue); color: #fff; font-weight: 600; }
.diff-edit { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.diff-edit textarea { min-height: 56px; }
.adv { margin-top: 16px; border-top: 1px solid var(--line-2); padding-top: 10px; }
.adv > summary {
  cursor: pointer; font-size: 13px; color: var(--blue); list-style: none; user-select: none;
}
.adv > summary::-webkit-details-marker { display: none; }
.adv > summary::before { content: "＋ "; }
.adv[open] > summary::before { content: "－ "; }
@media (max-width: 720px) {
  .diff-edit { grid-template-columns: 1fr; }
  .cat-chip { padding: 8px 14px; font-size: 13.5px; }
}

/* 图纸版本 */
.dw-cur { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line-2); }
.dw-ver {
  width: 46px; height: 46px; border-radius: 12px; background: var(--blue-bg); color: #1d4ed8;
  display: grid; place-items: center; font-weight: 750; font-size: 15px; flex: 0 0 46px;
}
.dw-main { min-width: 0; flex: 1; }
.dw-main b { font-size: 14.5px; word-break: break-all; }
.dw-ack { padding: 12px 16px 14px; }
.dw-ack-head { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--text-2); }
.dw-ack-head b { color: var(--text); font-size: 15px; }
.dw-ack-head .btn { margin-left: auto; }
.dw-ack-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
@media (max-width: 720px) {
  .dw-cur { padding: 12px; gap: 10px; }
  .dw-ver { width: 40px; height: 40px; flex: 0 0 40px; font-size: 13px; }
  .dw-ack-head { flex-wrap: wrap; }
  .dw-ack-head .btn { margin-left: 0; width: 100%; }
}
