/* ============================================================
   技术协议功能清单 Dashboard
   ============================================================ */
:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #94a3b8;
  --brand: #1d4ed8;
  --brand-soft: #eff6ff;

  --s-todo: #94a3b8;
  --s-todo-bg: #f1f5f9;
  --s-doing: #2563eb;
  --s-doing-bg: #eff6ff;
  --s-live: #059669;
  --s-live-bg: #ecfdf5;
  --s-issue: #dc2626;
  --s-issue-bg: #fef2f2;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .05);
  --shadow-md: 0 4px 12px rgba(15, 23, 42, .08);
  --shadow-lg: 0 12px 32px rgba(15, 23, 42, .16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

button { font-family: inherit; font-size: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ---------- Header ---------- */
.hdr {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.hdr-main {
  max-width: 1560px;
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.hdr-logo { height: 30px; width: auto; display: block; flex-shrink: 0; }
.hdr-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.hdr-title h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
  white-space: nowrap;
}
.hdr-title span { font-size: 12px; color: var(--text-3); white-space: nowrap; }
.hdr-spacer { flex: 1; }

/* segmented control */
.seg {
  display: inline-flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.seg button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 5px 13px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  transition: .15s;
}
.seg button:hover { color: var(--text); }
.seg button.on {
  background: var(--surface);
  color: var(--brand);
  font-weight: 600;
  box-shadow: var(--shadow);
}

.hdr-bar {
  max-width: 1560px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  border-top: 1px solid var(--border);
}
.tabs { display: flex; gap: 2px; }
.tabs button {
  border: 0;
  background: transparent;
  padding: 10px 4px 9px;
  margin-right: 18px;
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: .15s;
}
.tabs button:hover { color: var(--text-2); }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }

.btn {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  padding: 6px 13px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: .15s;
  white-space: nowrap;
}
.btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--text-3); }
.btn-primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}
.btn-primary:hover { background: #1e40af; border-color: #1e40af; color: #fff; }
.btn-sm { padding: 4px 9px; font-size: 12px; border-radius: 6px; }

/* ---------- Layout ---------- */
.wrap { max-width: 1560px; margin: 0 auto; padding: 22px 24px 60px; }
.view { display: none; }
.view.on { display: block; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card-hd {
  padding: 13px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-hd h2 {
  margin: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: .2px;
}
.card-hd .sub { font-size: 12px; color: var(--text-3); font-weight: 400; }
.card-bd { padding: 18px; }

/* ---------- KPI ---------- */
.kpis {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}
.kpi {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 18px 16px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  transition: .15s;
}
.kpi:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.kpi::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--kc, var(--text-3));
}
.kpi-lbl {
  font-size: 12px;
  color: var(--text-2);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 6px;
}
.kpi-val {
  font-size: 30px;
  font-weight: 700;
  line-height: 1.15;
  margin-top: 4px;
  letter-spacing: -.5px;
  font-variant-numeric: tabular-nums;
}
.kpi-val small { font-size: 14px; font-weight: 600; color: var(--text-3); margin-left: 3px; }
.kpi-ft { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--kc, var(--text-3)); display: inline-block; }

/* ---------- Dashboard grid ---------- */
.dash-grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 14px;
  margin-bottom: 14px;
}
.ring-box { display: flex; flex-direction: column; align-items: center; padding: 20px 18px 18px; }
.ring { position: relative; width: 168px; height: 168px; }
.ring svg { transform: rotate(-90deg); display: block; }
.ring-txt {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ring-num {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
}
.ring-sub { font-size: 11.5px; color: var(--text-3); margin-top: -2px; }
.ring-note { font-size: 12px; color: var(--text-2); margin-top: 14px; text-align: center; }
.ring-legend {
  display: flex;
  gap: 12px;
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--text-2);
  flex-wrap: wrap;
  justify-content: center;
}
.ring-legend i { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 4px; }

/* module bars */
.mods { display: flex; flex-direction: column; gap: 11px; }
.mod {
  display: grid; grid-template-columns: 168px 1fr 118px; gap: 12px; align-items: center;
  padding: 5px 8px; margin: 0 -8px; border-radius: 8px; cursor: pointer;
  transition: background .15s ease;
}
.mod:hover { background: var(--surface-2); }
.mod:hover .mod-nm { color: var(--accent); }
.mod:hover .mod-meta::after { content: " ›"; color: var(--accent); font-weight: 700; }
.mod-nm { font-size: 13px; font-weight: 600; color: var(--text); }
.mod-bar {
  height: 9px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  overflow: hidden;
  display: flex;
}
.mod-bar i { height: 100%; display: block; transition: width .4s ease; }
.mod-meta {
  font-size: 11.5px;
  color: var(--text-2);
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.mod-meta b { color: var(--text); font-weight: 700; }

/* ---------- Table ---------- */
.toolbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 11px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.search {
  position: relative;
  flex: 1;
  min-width: 220px;
  max-width: 340px;
}
.search input {
  width: 100%;
  padding: 7px 12px 7px 32px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  outline: none;
  transition: .15s;
}
.search input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); opacity: .45; }
select.flt {
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  background: var(--surface);
  outline: none;
  max-width: 160px;
}
select.flt:focus { border-color: var(--brand); }

.chips { display: flex; gap: 6px; }
.chip {
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-2);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  transition: .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.chip .n {
  font-size: 11px;
  background: var(--surface-2);
  border-radius: 99px;
  padding: 0 5px;
  font-variant-numeric: tabular-nums;
}
.chip:hover { border-color: var(--text-3); }
.chip.on { color: #fff; border-color: transparent; }
.chip.on .n { background: rgba(255, 255, 255, .25); }
.chip.on[data-s="todo"] { background: #64748b; }
.chip.on[data-s="doing"] { background: var(--s-doing); }
.chip.on[data-s="live"] { background: var(--s-live); }
.chip.on[data-s="issue"] { background: var(--s-issue); }
.chip.on[data-s="all"] { background: #334155; }

.tbl-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
table.tbl { width: 100%; border-collapse: collapse; }
table.tbl th {
  text-align: left;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  text-transform: none;
  letter-spacing: .3px;
  padding: 9px 12px;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 5;
}
table.tbl td {
  padding: 9px 12px;
  border-bottom: 1px solid #eef2f6;
  vertical-align: top;
}
table.tbl tbody tr:hover { background: #fafbfc; }

tr.grp td {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
tr.grp .grp-n { color: var(--text-3); font-weight: 500; font-size: 11.5px; margin-left: 8px; }
tr.grp .grp-r { float: right; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
tr.grp .grp-r b { color: var(--s-live); }

.c-code {
  font-variant-numeric: tabular-nums;
  color: var(--brand);
  font-weight: 700;
  font-size: 12.5px;
  white-space: nowrap;
}
.c-item { font-weight: 600; font-size: 13px; min-width: 150px; }
.c-desc { color: var(--text-2); font-size: 12.5px; max-width: 460px; }
.c-desc .clamp {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.c-desc .full { display: none; white-space: pre-wrap; }
.c-desc.open .clamp { display: none; }
.c-desc.open .full { display: block; }
.c-sub { color: var(--text-3); font-size: 12px; white-space: nowrap; }
.c-dept { color: var(--text-2); font-size: 12px; white-space: nowrap; }
.c-dept[data-act] { cursor: pointer; border-bottom: 1px dashed var(--border-strong); }
.c-dept[data-act]:hover { color: var(--brand); border-bottom-color: var(--brand); }
.c-ord { font-size: 12px; color: var(--text-2); }
.c-mut { font-size: 12px; color: var(--text-2); }
.c-mut .owner { color: var(--text); font-weight: 500; }

.badge {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
}
.badge[data-s="todo"] { background: var(--s-todo-bg); color: #64748b; }
.badge[data-s="doing"] { background: var(--s-doing-bg); color: var(--s-doing); }
.badge[data-s="live"] { background: var(--s-live-bg); color: var(--s-live); }
.badge[data-s="issue"] { background: var(--s-issue-bg); color: var(--s-issue); }

.st-btns { display: inline-flex; gap: 3px; flex-wrap: wrap; }
.st-b {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-3);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 600;
  transition: .12s;
}
.st-b:hover { border-color: var(--text-3); color: var(--text-2); }
.st-b.on { color: #fff; border-color: transparent; }
.st-b.on[data-s="todo"] { background: #64748b; }
.st-b.on[data-s="doing"] { background: var(--s-doing); }
.st-b.on[data-s="live"] { background: var(--s-live); }
.st-b.on[data-s="issue"] { background: var(--s-issue); }

.icon-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-3);
  border-radius: 6px;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.note-flag {
  display: inline-block;
  margin-left: 5px;
  cursor: pointer;
  color: var(--s-issue);
  font-size: 12px;
}
.acts { white-space: nowrap; }

/* ---------- Kanban ---------- */
.kb {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  align-items: start;
}
.kb-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  min-height: 160px;
}
.kb-hd {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 700;
}
.kb-hd .n {
  margin-left: auto;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 1px 8px;
  font-variant-numeric: tabular-nums;
}
.kb-bd { padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 80px; }
.kb-col.over { border-color: var(--brand); background: var(--brand-soft); }
.kb-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
  background: var(--surface);
  cursor: grab;
  transition: .15s;
}
.kb-card:hover { box-shadow: var(--shadow-md); border-color: var(--border-strong); }
.kb-card.dragging { opacity: .4; }
.kb-card .t { font-size: 12.5px; font-weight: 600; display: flex; gap: 6px; align-items: baseline; }
.kb-card .t .cd { color: var(--brand); font-variant-numeric: tabular-nums; }
.kb-card .m { font-size: 11px; color: var(--text-3); margin-top: 3px; }
.kb-card .d {
  font-size: 11.5px;
  color: var(--s-issue);
  margin-top: 4px;
  background: var(--s-issue-bg);
  border-radius: 4px;
  padding: 3px 6px;
}
.kb-empty { text-align: center; color: var(--text-3); font-size: 12px; padding: 18px 0; }

/* ---------- History ---------- */
.hist { display: flex; flex-direction: column; }
.hist-item {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 12.5px;
}
.hist-item:last-child { border-bottom: 0; }
.hist-t { color: var(--text-3); font-size: 11.5px; font-variant-numeric: tabular-nums; padding-top: 1px; }
.hist-b b { font-weight: 600; }
.hist-b .arrow { color: var(--text-3); margin: 0 4px; }

/* ---------- Modal ---------- */
.mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, .45);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.mask.on { display: flex; }
.modal {
  background: var(--surface);
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 540px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.modal.wide { max-width: 720px; }
.modal-hd {
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-hd h3 { margin: 0; font-size: 15px; font-weight: 700; }
.modal-hd .x {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-3);
  font-size: 20px;
  line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
}
.modal-hd .x:hover { background: var(--surface-2); color: var(--text); }
.modal-bd { padding: 18px 20px; overflow: auto; }
.modal-ft {
  padding: 13px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  background: var(--surface-2);
}
.fld { margin-bottom: 14px; }
.fld:last-child { margin-bottom: 0; }
.fld label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 5px;
}
.fld input[type=text], .fld input[type=date], .fld select, .fld textarea {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  outline: none;
  background: var(--surface);
  transition: .15s;
  resize: vertical;
}
.fld textarea { min-height: 88px; line-height: 1.6; }
.fld input:focus, .fld textarea:focus, .fld select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.fld .hint { font-size: 11.5px; color: var(--text-3); margin-top: 5px; }
.info-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-bottom: 16px;
}
.info-box b { color: var(--text); }
.seg-status { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.seg-status button {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 7px;
  padding: 7px 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  transition: .12s;
}
.seg-status button.on { color: #fff; border-color: transparent; }
.seg-status button.on[data-s="todo"] { background: #64748b; }
.seg-status button.on[data-s="doing"] { background: var(--s-doing); }
.seg-status button.on[data-s="live"] { background: var(--s-live); }
.seg-status button.on[data-s="issue"] { background: var(--s-issue); }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #0f172a;
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: .25s;
  z-index: 300;
  pointer-events: none;
}
.toast.on { opacity: 1; transform: translateX(-50%) translateY(0); }

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

/* ---------- Responsive ---------- */
@media (max-width: 1240px) {
  .dash-grid { grid-template-columns: 1fr; }
  .kb { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .hdr-main { flex-wrap: wrap; gap: 10px; padding: 10px 14px; }
  .hdr-logo { height: 24px; }
  .hdr-bar { padding: 0 14px; overflow-x: auto; }
  .wrap { padding: 14px 14px 50px; }
  .kb { grid-template-columns: 1fr; }
}

/* ---------- Print (汇报模式) ---------- */
@media print {
  @page { size: A4 landscape; margin: 12mm; }
  body { background: #fff; font-size: 10.5pt; }
  .hdr { position: static; }
  .hdr-bar, .toolbar, .acts, .st-btns, .no-print, .tabs { display: none !important; }
  .view { display: block !important; page-break-after: always; }
  .view-kanban { display: none !important; }
  .wrap { max-width: none; padding: 0; }
  .card, .kpi, .tbl-wrap, .kb-col { box-shadow: none; border-color: #ccc; }
  .kpis { grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .kpi-val { font-size: 22pt; }
  .dash-grid { grid-template-columns: 260px 1fr; }
  .c-desc .clamp { display: none; }
  .c-desc .full { display: block; white-space: pre-wrap; -webkit-line-clamp: unset; }
  table.tbl td { padding: 5px 8px; }
  .view-dash { page-break-after: always; }
}

/* ---------------- 只读模式（线上展示） ---------------- */
.ro-badge {
  font-size: 11.5px;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  padding: 3px 10px;
  border-radius: 999px;
  margin-right: 10px;
  letter-spacing: .2px;
  white-space: nowrap;
}
.readonly .st-btns,
.readonly .icon-btn[data-act="edit"],
.readonly #btnImport,
.readonly .ro-hide { display: none !important; }
.readonly .c-dept[data-act] { cursor: default; border-bottom: 0; }
.readonly .c-dept[data-act]:hover { color: var(--text-2); }
.readonly .kb-card { cursor: default; }
.readonly #saveTip { color: #0369a1; }
@media print { .ro-badge { display: none !important; } }

/* ---------------- 需求反馈 ---------------- */
.view-req .card { margin-top: 14px; }
.req-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.req-search { margin-left: auto; min-width: 220px; }
.req-list { display: flex; flex-direction: column; gap: 10px; }

.req-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 15px;
  background: #fff;
  transition: box-shadow .15s, border-color .15s;
}
.req-item:hover { border-color: var(--border-strong); box-shadow: 0 2px 10px rgba(15,23,42,.05); }

.req-hd { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 7px; }
.req-no { font-size: 11px; font-weight: 700; color: var(--text-3); letter-spacing: .5px; }
.req-date { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.req-dept {
  font-size: 11.5px; color: var(--text-2);
  background: #f1f5f9; border-radius: 5px; padding: 2px 7px;
}
.req-mod {
  font-size: 11.5px; color: #1d4ed8;
  background: #eff6ff; border-radius: 5px; padding: 2px 7px;
}
.req-hd .st-tag { margin-left: auto; }

.st-tag {
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  white-space: nowrap; border: 1px solid transparent;
}
.st-tag.todo  { color: #475569; background: #f1f5f9; border-color: #e2e8f0; }
.st-tag.doing { color: #1d4ed8; background: #eff6ff; border-color: #bfdbfe; }
.st-tag.done  { color: #047857; background: #ecfdf5; border-color: #a7f3d0; }
.st-tag.hold  { color: #b45309; background: #fffbeb; border-color: #fde68a; }

.req-desc {
  font-size: 13.5px; line-height: 1.62; color: var(--text-1); font-weight: 500;
}
.req-reply {
  margin-top: 7px; font-size: 12.5px; line-height: 1.6; color: var(--text-2);
  background: #f8fafc; border-left: 2px solid #cbd5e1; border-radius: 0 6px 6px 0;
  padding: 7px 10px;
}
.req-reply b { color: var(--text-1); font-weight: 600; margin-right: 4px; }

.req-shots { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.req-shots img {
  width: 150px; height: 96px; object-fit: contain; border-radius: 6px;
  border: 1px solid var(--border); cursor: zoom-in; background: #f8fafc;
  padding: 2px;
  transition: transform .12s, border-color .12s;
}
.req-shots img:hover { transform: translateY(-1px); border-color: var(--brand); }

.req-ft {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--border);
  font-size: 12px; color: var(--text-3);
}
.req-ft .st-btns { margin-left: auto; }

/* 需求卡片的状态按钮：选中态配色（对应 data-rs） */
.st-b.on[data-rs="todo"]  { background: #64748b; }
.st-b.on[data-rs="doing"] { background: #2563eb; }
.st-b.on[data-rs="done"]  { background: #059669; }
.st-b.on[data-rs="hold"]  { background: #d97706; }

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

/* 图片查看器 */
.lightbox {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(15,23,42,.93);
  display: none; align-items: center; justify-content: center;
  padding: 40px;
}
.lightbox.on { display: flex; }
.lightbox img {
  max-width: 92vw; max-height: 84vh; border-radius: 6px;
  background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.lb-close {
  position: absolute; top: 18px; right: 22px;
  width: 38px; height: 38px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff;
  font-size: 24px; line-height: 1; cursor: pointer;
}
.lb-close:hover { background: rgba(255,255,255,.26); }
.lb-nav {
  position: absolute; bottom: 22px; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 16px;
  color: #e2e8f0; font-size: 13px;
}
.lb-nav button {
  width: 32px; height: 32px; border-radius: 50%; border: 0;
  background: rgba(255,255,255,.14); color: #fff; font-size: 19px; cursor: pointer;
  line-height: 1;
}
.lb-nav button:hover { background: rgba(255,255,255,.26); }
.lb-nav button:disabled { opacity: .3; cursor: default; }

@media print {
  .view-req { display: block !important; page-break-before: always; }
  .lightbox { display: none !important; }
  .req-shots img { width: 88px; height: 58px; }
}

/* 只读模式下的需求卡片 */
.readonly .req-ft .st-btns { display: none !important; }
.readonly .req-ops { display: none !important; }

/* ---------- 需求录入表单 ---------- */
.fld-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.fld-hint { font-weight: 400; color: var(--text-3); font-size: 11px; margin-left: 6px; }

.seg-status button.on[data-s="done"] { background: #059669; }
.seg-status button.on[data-s="hold"] { background: #d97706; }

.drop-zone {
  border: 1.5px dashed var(--border-strong);
  border-radius: 8px;
  padding: 10px;
  min-height: 64px;
  cursor: pointer;
  background: #fafbfc;
  outline: none;
  transition: .15s;
}
.drop-zone:hover, .drop-zone:focus { border-color: var(--brand); background: #f7fbff; }
.drop-zone.over { border-color: var(--brand); background: #eef6ff; }
.dz-tip { font-size: 12px; color: var(--text-3); text-align: center; padding: 8px 0; }
.drop-zone:has(.dz-item) { padding: 8px; }
.drop-zone:has(.dz-item) .dz-tip { display: none; }
.dz-list { display: flex; gap: 8px; flex-wrap: wrap; }
.dz-item {
  position: relative; width: 112px; height: 76px;
  border-radius: 6px; overflow: hidden;
  border: 1px solid var(--border); background: #fff;
}
.dz-item img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dz-x {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px; padding: 0;
  border: 0; border-radius: 50%;
  background: rgba(15,23,42,.66); color: #fff;
  font-size: 14px; line-height: 1; cursor: pointer;
}
.dz-x:hover { background: #dc2626; }

.req-ops { margin-left: auto; display: flex; gap: 4px; }
.req-ft .st-btns { margin-left: 8px; }

@media (max-width: 720px) {
  .fld-row { grid-template-columns: 1fr; gap: 0; }
}
