/* ============================================================
 * styles.css · 设计系统
 * 造价咨询工作流程管理系统（原型）
 * tier: teal-enterprise · 青绿主色 + 琥珀点缀 · 同 zl 主站配色
 * ============================================================ */

/* ---------- 设计令牌 ---------- */
:root {
  --primary: #0f766e;
  --primary-hover: #134e4a;
  --primary-soft: #e0f2f1;
  --accent: #fbbf24;
  --accent-soft: #fef3c7;
  --bg: #f5f6fa;
  --surface: #FFFFFF;
  --border: #e5e7eb;
  --text: #1a1a2e;
  --text-sub: #64748b;
  --text-main: #1a1a2e;
  --success: #0f766e;
  --success-soft: #f0fdfa;
  --warning: #fbbf24;
  --warning-soft: #fef3c7;
  --danger: #b91c1c;
  --danger-soft: #fef2f2;
  --sidebar-bg: linear-gradient(135deg, #0f766e, #134e4a);
  --sidebar-ink: rgba(255, 255, 255, .75);
  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 14px;
  --shadow-s: 0 1px 2px rgba(15, 118, 110, .06);
  --shadow-m: 0 4px 14px rgba(15, 118, 110, .08);
  --shadow-l: 0 12px 32px rgba(15, 118, 110, .16);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Consolas, "Courier New", monospace;
}

/* ---------- 基础 ---------- */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 14px; color: var(--text); }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--text-sub); }
.ic { flex: none; vertical-align: -2px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 布局骨架 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  position: fixed; inset: 0 auto 0 0;
  width: 232px;
  background: var(--sidebar-bg);
  color: var(--sidebar-ink);
  display: flex; flex-direction: column;
  z-index: 30;
}
.side-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 18px 16px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}
.logo-mark {
  width: 34px; height: 34px; flex: none;
  display: grid; place-items: center;
  background: var(--primary);
  color: #fff; font-weight: 700; font-size: 16px;
  border-radius: 8px;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.3; min-width: 0; }
.logo-text b { color: #fff; font-size: 14px; letter-spacing: .04em; }
.logo-text span { font-size: 11px; opacity: .72; white-space: nowrap; }

.side-nav { flex: 1; padding: 12px 10px; display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav-item {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active { background: var(--primary); color: #fff; font-weight: 600; }
.nav-item .nav-badge {
  margin-left: auto;
  min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-grid; place-items: center;
  background: var(--warning); color: #fff;
  border-radius: 9px; font-size: 11px; font-weight: 700;
}
.nav-item .nav-badge:empty, .nav-item .nav-badge[data-zero="1"] { display: none; }

.side-back { padding: 10px; border-top: 1px solid rgba(255, 255, 255, .08); }
.nav-back { opacity: .85; }
.nav-back:hover { opacity: 1; background: rgba(255, 255, 255, .08); color: #fff; }

.side-foot { padding: 12px 14px 14px; border-top: 1px solid rgba(255, 255, 255, .08); }
.reset-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 8px 10px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, .22);
  color: var(--sidebar-ink);
  border-radius: var(--radius-s);
  font-size: 12.5px;
  transition: all .15s;
}
.reset-btn:hover { border-color: rgba(255, 255, 255, .5); color: #fff; }
.side-ver { margin-top: 10px; font-size: 11px; text-align: center; opacity: .5; }

.main-wrap { margin-left: 232px; flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  height: 56px; flex: none;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.topbar h1 { font-size: 16px; font-weight: 700; letter-spacing: .02em; }
.topbar-back {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: var(--radius-s);
  font-size: 13px; font-weight: 500;
  text-decoration: none;
  transition: background .15s, color .15s;
}
.topbar-back:hover { background: var(--primary); color: #fff; }
.topbar-right { margin-left: auto; display: flex; align-items: center; gap: 14px; }
.role-switch { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-sub); }
.role-switch .select { width: 172px; height: 32px; }

.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: inline-grid; place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--text-sub);
  transition: all .15s;
}
.icon-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--primary-soft); }
.bell-badge {
  position: absolute; top: -6px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--danger); color: #fff;
  border-radius: 8px; font-size: 10px; font-weight: 700;
}
.bell-badge[data-zero="1"] { display: none; }

.user-badge { display: flex; align-items: center; gap: 9px; padding-left: 14px; border-left: 1px solid var(--border); }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 13px; }
.user-meta span { font-size: 11.5px; color: var(--text-sub); }

.avatar {
  width: 30px; height: 30px; flex: none;
  display: inline-grid; place-items: center;
  background: var(--primary-soft); color: var(--primary);
  border-radius: 50%;
  font-size: 13px; font-weight: 700;
}
.avatar.sm { width: 24px; height: 24px; font-size: 11.5px; }

.view { padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.view > * { flex-shrink: 0; }
.loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 80px 0; color: var(--text-sub); font-size: 13px;
}
.loading .ic { animation: spin 1.1s linear infinite; }
.spin { display: inline-grid; place-items: center; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 按钮 / 表单控件 ---------- */
.btn {
  height: 34px; padding: 0 14px;
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-s);
  border: 1px solid transparent;
  font-size: 13px; font-weight: 500;
  transition: all .15s;
  white-space: nowrap;
}
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.btn-ghost { background: var(--surface); border-color: var(--border); color: var(--text); }
.btn-ghost:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover:not(:disabled) { filter: brightness(.94); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12.5px; }

.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--surface);
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  -webkit-user-select: text;
  user-select: text;
  transition: border-color .15s, box-shadow .15s;
}
.input, .select { height: 34px; padding: 0 10px; }
.textarea { padding: 8px 10px; min-height: 74px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

/* ---------- 标签 / 徽章 / 进度 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px; font-weight: 500;
  white-space: nowrap;
}
.tag-primary { background: var(--primary-soft); color: var(--primary); }
.tag-success { background: var(--success-soft); color: var(--success); }
.tag-warning { background: var(--warning-soft); color: var(--warning); }
.tag-danger  { background: var(--danger-soft);  color: var(--danger); }
.tag-neutral { background: #f1f5f9; color: var(--text-sub); }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: var(--text-sub);
  white-space: nowrap;
}
.chip.warning { color: var(--warning); font-weight: 600; }
.chip.danger { color: var(--danger); font-weight: 600; }

.progress {
  position: relative;
  height: 6px; min-width: 90px; flex: 1;
  background: #e2e8f0;
  border-radius: 3px;
  overflow: hidden;
}
.progress > i {
  position: absolute; inset: 0 auto 0 0;
  background: var(--primary);
  border-radius: 3px;
  transition: width .4s ease;
}

/* ---------- 卡片 / 栅格 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}
.card-head {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}
.card-head h2 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.card-head h2 .ic { color: var(--primary); }
.card-head .head-extra { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card-body { padding: 16px 18px; }
.card-body.flush { padding: 0; }

/* ---------- 流程图横幅 ---------- */
.flow-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  padding: 16px 20px;
  margin-bottom: 16px;
}
.flow-banner-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.flow-banner-title {
  font-size: 15px; font-weight: 600; color: var(--text);
  display: flex; align-items: center; gap: 6px;
}
.flow-banner-title .ic { color: var(--primary); }
.flow-btn {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.flow-btn:hover { border-color: var(--primary); color: var(--primary); }
.flow-btn .ic { width: 12px; height: 12px; fill: currentColor; }
.flow-svg { display: block; width: 100%; height: auto; aspect-ratio: 520 / 124; }
.flow-dots {
  display: flex; gap: 8px; justify-content: center;
  margin-top: 10px;
}
.flow-dot {
  width: 24px; height: 24px; border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  padding: 0; transition: all .15s;
}
.flow-dot:hover { border-color: var(--primary); color: var(--primary); }
.flow-dot.done { border-color: var(--primary); color: var(--primary); background: var(--primary-soft); }
.flow-dot.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.flow-detail {
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  padding: 10px 14px;
  min-height: 60px;
}
.flow-chip {
  background: var(--primary-soft);
  color: var(--primary);
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 12px; font-weight: 500;
}
.flow-d-name { font-size: 14px; font-weight: 500; color: var(--text); margin-left: 8px; }
.flow-d-meta { font-size: 12px; color: var(--text-muted); margin-left: 8px; }
.flow-d-desc { margin-top: 4px; font-size: 13px; color: var(--text-muted); }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-s);
}
.stat-icon {
  width: 42px; height: 42px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-m);
  background: var(--primary-soft); color: var(--primary);
}
.stat-icon.success { background: var(--success-soft); color: var(--success); }
.stat-icon.warning { background: var(--warning-soft); color: var(--warning); }
.stat-num { font-size: 24px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12.5px; color: var(--text-sub); }

.grid-2 { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; align-items: start; }
.grid-2-even { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th {
  background: #f8fafc;
  color: var(--text-sub);
  font-weight: 600; font-size: 12.5px;
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.table td { padding: 11px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.table tbody tr { transition: background .12s; }
.table tbody tr:hover { background: var(--primary-soft); }
.table tbody tr.clickable { cursor: pointer; }
.table .cell-main { font-weight: 600; }
.table .cell-sub { font-size: 12px; color: var(--text-sub); }
.table .progress-cell { display: flex; align-items: center; gap: 8px; min-width: 130px; }

/* ---------- 筛选条 ---------- */
.filter-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-bar .select { width: 150px; }
.search-box { position: relative; flex: 1; min-width: 200px; max-width: 320px; }
.search-box .ic { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--text-sub); }
.search-box .input { padding-left: 32px; }
.filter-count { margin-left: auto; font-size: 12.5px; color: var(--text-sub); white-space: nowrap; }

/* ---------- 步骤条（8 节点） ---------- */
.stepper { display: flex; list-style: none; }
.stepper li { flex: 1; position: relative; text-align: center; padding-top: 4px; }
.stepper li::before, .stepper li::after {
  content: ""; position: absolute; top: 15px;
  width: 50%; height: 2px;
  background: var(--border);
}
.stepper li::before { left: 0; }
.stepper li::after { right: 0; }
.stepper li:first-child::before, .stepper li:last-child::after { display: none; }
.stepper li.done::before, .stepper li.done::after { background: var(--primary); }
.stepper li.current::before { background: var(--primary); }

.step-dot {
  position: relative; z-index: 1;
  width: 26px; height: 26px;
  margin: 0 auto;
  display: grid; place-items: center;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--border);
  color: transparent;
}
.stepper li.done .step-dot { background: var(--primary); border-color: var(--primary); color: #fff; }
.stepper li.current .step-dot {
  border-color: var(--primary);
  animation: pulse 1.8s ease-out infinite;
}
.stepper li.current .step-dot::after {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--primary);
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(15, 118, 110, .35); }
  70% { box-shadow: 0 0 0 9px rgba(15, 118, 110, 0); }
  100% { box-shadow: 0 0 0 0 rgba(15, 118, 110, 0); }
}
.step-name { margin-top: 8px; font-size: 12.5px; font-weight: 600; }
.stepper li.pending .step-name { color: var(--text-sub); font-weight: 500; }
.stepper li.current .step-name { color: var(--primary); }
.step-meta { font-size: 11px; color: var(--text-sub); margin-top: 1px; min-height: 15px; }

.substepper {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 6px;
}
.substep {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 11px;
  background: #f1f5f9; color: var(--text-sub);
}
.substep.done { background: var(--primary-soft); color: var(--primary); }
.substep.current { background: var(--primary); color: #fff; font-weight: 600; }
.substep-arrow { color: #cbd5e1; font-size: 11px; }

/* ---------- 时间线（流程日志） ---------- */
.tl { list-style: none; position: relative; padding-left: 22px; }
.tl::before { content: ""; position: absolute; left: 7px; top: 6px; bottom: 6px; width: 2px; background: #e2e8f0; }
.tl li { position: relative; padding: 0 0 18px 6px; }
.tl li:last-child { padding-bottom: 2px; }
.tl-dot {
  position: absolute; left: -21px; top: 5px;
  width: 12px; height: 12px; border-radius: 50%;
  background: #fff; border: 2px solid #cbd5e1;
}
.tl li.tl-return .tl-dot { border-color: var(--danger); background: var(--danger-soft); }
.tl li.tl-pass .tl-dot { border-color: var(--success); background: var(--success-soft); }
.tl-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; }
.tl-head b { font-weight: 600; }
.tl-action { font-weight: 600; }
.tl-node { font-size: 11.5px; }
.tl-comment {
  margin-top: 4px; padding: 7px 10px;
  background: #f8fafc; border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-s) var(--radius-s) 0;
  font-size: 12.5px; color: var(--text-sub);
}
.tl li.tl-return .tl-comment { border-left-color: var(--danger); }
.tl-time { margin-left: auto; font-family: var(--mono); font-size: 11.5px; color: var(--text-sub); }

/* ---------- 待办列表 ---------- */
.todo-list { display: flex; flex-direction: column; }
.todo-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}
.todo-item:last-child { border-bottom: none; }
.todo-item:hover { background: var(--primary-soft); }
.todo-main { flex: 1; min-width: 0; }
.todo-main .t1 { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.todo-main .t2 { font-size: 12px; color: var(--text-sub); margin-top: 2px; }

/* ---------- 项目详情 ---------- */
.detail-head { padding: 18px 20px 16px; }
.detail-title-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.detail-title-row h2 { font-size: 18px; font-weight: 800; letter-spacing: .01em; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--text-sub); font-size: 13px; }
.back-link:hover { color: var(--primary); }
.meta-grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 14px 24px;
  margin-top: 16px; padding-top: 14px;
  border-top: 1px dashed var(--border);
}
.meta-item .k { font-size: 12px; color: var(--text-sub); display: flex; align-items: center; gap: 5px; }
.meta-item .v { font-size: 13.5px; font-weight: 600; margin-top: 2px; }
.team-avatars { display: flex; align-items: center; }
.team-avatars .avatar { margin-left: -6px; border: 2px solid #fff; }
.team-avatars .avatar:first-child { margin-left: 0; }

.action-card { border-left: 4px solid var(--primary); }
.action-card.is-other { border-left-color: var(--border); }
.action-card.is-archived { border-left-color: var(--success); }
.action-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.action-row .spacer { flex: 1; }
.action-comment { flex: 1; min-width: 240px; max-width: 460px; }

.form-chips { display: flex; flex-direction: column; gap: 8px; }
.form-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  transition: all .15s;
}
.form-chip:hover { border-color: var(--primary); background: var(--primary-soft); }
.form-chip .code { font-family: var(--mono); font-size: 12px; font-weight: 700; color: var(--primary); }
.form-chip .fname { font-size: 13px; font-weight: 600; }
.form-chip .fnode { margin-left: auto; }

/* ---------- 表单中心 ---------- */
.form-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.form-card { display: flex; flex-direction: column; padding: 16px 18px 14px; gap: 8px; }
.form-card-top { display: flex; align-items: center; gap: 8px; }
.form-code { font-family: var(--mono); font-size: 13px; font-weight: 800; color: var(--primary); }
.form-card h3 { font-size: 14.5px; font-weight: 700; }
.form-card .fdesc { font-size: 12.5px; color: var(--text-sub); flex: 1; }
.form-card-foot { display: flex; align-items: center; gap: 8px; margin-top: 6px; padding-top: 10px; border-top: 1px dashed var(--border); }
.form-card-foot .fmeta { font-size: 12px; color: var(--text-sub); margin-right: auto; }

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0, 0, 0, .5);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
  animation: fadeIn .16s ease;
}
@keyframes fadeIn { from { opacity: 0; } }
.modal {
  width: 560px; max-width: 100%;
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-l);
  box-shadow: var(--shadow-l);
  animation: popIn .18s ease;
}
.modal.modal-wide { width: 720px; }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.modal-head {
  display: flex; align-items: center; gap: 10px;
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 15.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.modal-head h3 .ic { color: var(--primary); }
.modal-head .icon-btn { margin-left: auto; border: none; }
.modal-body { padding: 18px 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.field { display: flex; flex-direction: column; gap: 5px; }
.field.full { grid-column: 1 / -1; }
.field > label { font-size: 12.5px; font-weight: 600; color: var(--text-sub); }
.field > label .req { color: var(--danger); margin-left: 2px; }
.radio-row { display: flex; gap: 16px; align-items: center; height: 34px; }
.radio-row label { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; cursor: pointer; }
.radio-row input { accent-color: var(--primary); }

.preview-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.preview-table th, .preview-table td { padding: 8px 12px; border: 1px solid #f1f5f9; text-align: left; }
.preview-table th { background: #f8fafc; color: var(--text-sub); font-size: 12.5px; }

.checklist { display: flex; flex-direction: column; gap: 4px; }
.check-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-s);
  transition: background .12s;
  cursor: pointer;
}
.check-item:hover { background: #f8fafc; }
.check-item input { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }
.check-item .ck-label { font-size: 13.5px; }
.check-item.done .ck-label { color: var(--text-sub); }
.check-item .ck-state { margin-left: auto; }
.check-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }

/* ---------- 提示条 ---------- */
.banner {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-radius: var(--radius-s);
  font-size: 13px;
}
.banner .ic { flex: none; }
.banner-info { background: var(--primary-soft); color: var(--primary); }
.banner-warning { background: var(--warning-soft); color: var(--warning); }
.banner-success { background: var(--success-soft); color: var(--success); }

/* ---------- 空状态 ---------- */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 44px 20px;
  color: var(--text-sub);
  text-align: center;
}
.empty .ic { opacity: .45; }
.empty p { font-size: 13px; }

/* ---------- Toast ---------- */
#toast-root {
  position: fixed; right: 20px; bottom: 20px; z-index: 200;
  display: flex; flex-direction: column; gap: 10px;
}
.toast {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 16px;
  background: var(--text); color: #fff;
  border-radius: var(--radius-s);
  box-shadow: var(--shadow-m);
  font-size: 13px;
  opacity: 0; transform: translateY(8px);
  transition: all .25s ease;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }

/* ---------- 附件 ---------- */
.att-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border); }
.att-tab {
  padding: 10px 16px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.att-tab:hover { color: var(--primary); }
.att-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.att-tab .cnt {
  min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-grid; place-items: center;
  background: #f1f5f9; border-radius: 9px;
  font-size: 11px; font-weight: 700;
}
.att-tab.active .cnt { background: var(--primary-soft); color: var(--primary); }

.att-list { display: flex; flex-direction: column; }
.att-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border-bottom: 1px solid #f1f5f9;
  transition: background .12s;
}
.att-item:last-child { border-bottom: none; }
.att-item:hover { background: #f8fafc; }
.att-icon {
  width: 36px; height: 36px; flex: none;
  display: grid; place-items: center;
  border-radius: var(--radius-s);
  background: var(--primary-soft); color: var(--primary);
  font-weight: 800; font-size: 11px; text-transform: uppercase;
  font-family: var(--mono);
  letter-spacing: .02em;
}
.att-icon.pdf  { background: #fef2f2; color: #b91c1c; }
.att-icon.xlsx { background: #f0fdfa; color: var(--success); }
.att-icon.docx { background: #e0f2f1; color: var(--primary); }
.att-icon.zip  { background: #fef3c7; color: var(--warning); }
.att-icon.dwg  { background: #f5f3ff; color: #5b21b6; }
.att-icon.other { background: #f1f5f9; color: var(--text-sub); }
.att-main { flex: 1; min-width: 0; }
.att-name { font-weight: 600; font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att-meta { font-size: 12px; color: var(--text-sub); margin-top: 2px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.att-meta .ver { font-weight: 600; color: var(--primary); }
.att-meta .round { color: var(--warning); font-weight: 600; }
.att-note { font-size: 12px; color: var(--text-sub); margin-top: 4px; line-height: 1.5; }
.att-actions { display: flex; align-items: center; gap: 4px; }
.att-actions .icon-btn { width: 30px; height: 30px; }
.att-actions .icon-btn .ic { width: 14px; height: 14px; }

.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius-m);
  padding: 22px 20px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
  transition: all .15s;
}
.upload-zone:hover { border-color: var(--primary); background: var(--primary-soft); }
.upload-zone .up-icon { color: var(--primary); margin-bottom: 6px; }
.upload-zone p { font-size: 13px; font-weight: 600; }
.upload-zone span { font-size: 12px; color: var(--text-sub); }

.ver-timeline { display: flex; flex-direction: column; gap: 14px; }
.ver-round {
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  background: var(--surface);
  overflow: hidden;
}
.ver-round-head {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  font-size: 13px; font-weight: 700;
}
.ver-round-head.current { background: var(--primary-soft); color: var(--primary); border-bottom-color: var(--primary); }
.ver-round-head .round-badge {
  padding: 1px 10px;
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
}
.ver-round-head.current .round-badge { background: var(--success); }
.ver-round-body { padding: 4px 0; }
.ver-round-body .att-item { padding: 9px 14px; }
.ver-note-title {
  padding: 8px 14px 4px;
  font-size: 12px;
  color: var(--text-sub);
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}

.review-block {
  border-top: 1px solid var(--border);
  padding: 12px 14px;
  background: #f8fafc;
}
.review-block.is-pass { background: #f0fdfa; border-top-color: var(--success-soft); }
.review-block.is-return { background: #fef2f2; border-top-color: var(--danger-soft); }
.review-block-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700;
  margin-bottom: 6px;
}
.review-block-head .stage-badge {
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 11px; font-weight: 700;
  background: #f1f5f9; color: var(--text-main);
}
.review-block-head .stage-badge.r2 { background: var(--primary-soft); color: var(--primary); }
.review-block-head .stage-badge.r3 { background: var(--accent-soft); color: var(--accent); }
.review-block-head .verdict {
  margin-left: auto;
  font-size: 12px; font-weight: 700;
  display: inline-flex; align-items: center; gap: 4px;
}
.review-block-head .verdict.pass { color: var(--success); }
.review-block-head .verdict.return { color: var(--danger); }
.review-block-head .verdict.pending { color: var(--warning); }
.review-meta {
  font-size: 12px; color: var(--text-sub);
  margin-bottom: 6px;
  display: flex; gap: 12px; flex-wrap: wrap;
}
.review-comment {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  padding: 8px 10px;
  font-size: 12.5px;
  line-height: 1.6;
  white-space: pre-wrap;
  color: var(--text-main);
}
.modify-block {
  padding: 10px 14px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
}
.modify-block-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; font-weight: 700;
  margin-bottom: 4px;
  color: var(--primary);
}
.modify-note {
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-main);
  white-space: pre-wrap;
}

.detail-tabs {
  display: flex; gap: 0;
  border-bottom: 1px solid var(--border);
  margin: -1px -18px 16px;
  padding: 0 18px;
}
.detail-tab {
  padding: 12px 14px;
  font-size: 13.5px; font-weight: 600;
  color: var(--text-sub);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all .15s;
  display: inline-flex; align-items: center; gap: 6px;
}
.detail-tab:hover { color: var(--primary); }
.detail-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.detail-tab .cnt {
  min-width: 20px; height: 18px; padding: 0 6px;
  display: inline-grid; place-items: center;
  background: #f1f5f9; border-radius: 9px;
  font-size: 11px; font-weight: 700;
}
.detail-tab.active .cnt { background: var(--primary-soft); color: var(--primary); }

/* ---------- 响应式 ---------- */
@media (max-width: 1180px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
  .meta-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-2-even { grid-template-columns: 1fr; }
}
@media (max-width: 920px) {
  .sidebar { width: 62px; }
  .logo-text, .nav-item span.nav-text, .side-ver { display: none; }
  .nav-item { justify-content: center; padding: 10px; }
  .nav-item .nav-badge { position: absolute; margin: 0; top: 2px; right: 2px; }
  .main-wrap { margin-left: 62px; }
  .form-grid { grid-template-columns: 1fr; }
  .view { padding: 16px; }
  .topbar-back span { display: none; }
  .topbar-back { padding: 6px; }
}

/* ================= 登录覆盖层（明亮清新风格） ================= */
.login-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background:
    radial-gradient(circle at 10% 20%, rgba(14, 165, 156, 0.08) 0%, transparent 30%),
    radial-gradient(circle at 90% 80%, rgba(56, 189, 248, 0.08) 0%, transparent 30%),
    linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.login-card {
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  padding: 42px 38px 34px;
  box-shadow:
    0 4px 6px -1px rgba(15, 118, 110, 0.04),
    0 10px 20px -3px rgba(15, 118, 110, 0.08),
    0 24px 48px -12px rgba(15, 118, 110, 0.12);
  text-align: center;
  width: 100%;
  max-width: 360px;
}
.login-logo {
  display: flex; align-items: center; gap: 12px; justify-content: center;
  margin-bottom: 26px;
}
.login-logo .logo-mark {
  width: 48px; height: 48px; border-radius: 12px;
  background: linear-gradient(135deg, #14b8a6 0%, #0d9488 100%);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.25);
}
.login-logo .logo-text { text-align: left; }
.login-logo .logo-text b { font-size: 18px; color: #0f172a; letter-spacing: -0.3px; }
.login-logo .logo-text span { display: block; font-size: 12px; color: #64748b; margin-top: 2px; }
.login-hint {
  font-size: 15px; color: #334155; margin-bottom: 24px;
}
.btn-login {
  display: inline-flex; align-items: center; gap: 8px;
  background: linear-gradient(135deg, #14b8a6 0%, #0f766e 100%);
  color: #fff; border: none;
  border-radius: 10px; padding: 12px 30px; font-size: 15px;
  cursor: pointer; transition: transform .12s, box-shadow .15s, filter .15s;
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.28);
}
.btn-login:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(13, 148, 136, 0.35);
}
.btn-login:active { transform: translateY(0); }
.login-sub {
  margin-top: 20px; font-size: 12.5px; color: #94a3b8;
}
.login-back-link {
  display: inline-flex; align-items: center; gap: 4px;
  color: var(--primary);
  text-decoration: none;
  transition: color .15s;
}
.login-back-link:hover { color: var(--primary-hover); text-decoration: underline; }

/* ================= 扫码身份确认 ================= */
.qr-card { max-width: 380px; }
.qr-wrap {
  width: 210px; height: 210px;
  margin: 0 auto 22px;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.8), 0 2px 8px rgba(15, 118, 110, 0.05);
}
.qr-wrap img {
  width: 188px; height: 188px;
  display: block;
}
.qr-placeholder {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  color: #94a3b8;
  font-size: 13px;
}
.qr-placeholder svg { color: #cbd5e1; }
.qr-status {
  font-size: 14px;
  color: #334155;
  font-weight: 500;
  margin-bottom: 4px;
}
.qr-status.scanned { color: #0f766e; }
.qr-status.expired { color: var(--danger); }
.qr-status.success { color: #059669; }
.btn-qr-refresh {
  margin-top: 16px;
  background: #f0fdfa;
  color: #0f766e;
  border: 1px solid #ccfbf1;
  border-radius: 10px;
  padding: 10px 24px;
  font-size: 14px;
  cursor: pointer;
  font-weight: 500;
  transition: background .15s, transform .12s;
}
.btn-qr-refresh:hover { background: #ccfbf1; transform: translateY(-1px); }
