:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --line: #e5e7eb;
  --line-strong: #d5d9df;
  --text: #1f2328;
  --muted: #6b7280;
  --ink: #0f2a4a;
  --primary: #1f4e79;
  --primary-hover: #183f61;
  --primary-weak: #eef3f9;
  --ok: #2e7d5b;
  --ok-weak: #e9f5ef;
  --warn: #b26a00;
  --warn-weak: #fdf4e4;
  --danger: #b42318;
  --danger-weak: #fdeeee;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04);
}

* { box-sizing: border-box; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #cbd2da; border-radius: 999px; border: 2px solid #fff; }
::-webkit-scrollbar-thumb:hover { background: #b3bcc7; }
::-webkit-scrollbar-track { background: transparent; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: "Microsoft YaHei", "微软雅黑", -apple-system, "Segoe UI", sans-serif;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; color: var(--ink); white-space: nowrap; }
h1 { font-size: 19px; font-weight: 600; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 13.5px; font-weight: 600; }
p { margin: 0; }

.app { display: flex; min-height: 100vh; }

/* ============ 侧栏 ============ */
.sidebar {
  width: 208px;
  flex: 0 0 208px;
  background: var(--panel);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}
.brand {
  height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 16px;
  background: var(--ink);
  color: #fff;
}
.brand .mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: #fff; color: var(--ink);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
}
.brand .name { font-size: 14px; font-weight: 600; white-space: nowrap; letter-spacing: .5px; }

.nav { padding: 10px 0; flex: 1; overflow-y: auto; }
.nav .group { font-size: 11px; color: #9aa3af; padding: 12px 18px 4px; letter-spacing: .5px; }
.nav a {
  display: flex; align-items: center; gap: 9px;
  margin: 2px 8px; padding: 8px 12px;
  border-radius: 8px; color: #374151; font-size: 13.5px;
  white-space: nowrap;
}
.nav a:hover { background: #f3f4f6; }
.nav a.active { background: var(--primary-weak); color: var(--primary); font-weight: 600; }
.sidebar .foot { padding: 12px 16px; border-top: 1px solid var(--line); font-size: 11.5px; color: #9aa3af; }

/* ============ 主区 ============ */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; flex: 0 0 56px;
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 26px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 5;
}
.topbar .title { display: flex; align-items: center; gap: 10px; }
.topbar .sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.topbar .right { display: flex; align-items: center; gap: 12px; }
.menu-btn {
  display: none; width: 36px; height: 36px; flex: 0 0 36px;
  align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 8px;
  background: #fff; color: var(--ink); font-size: 17px; line-height: 1; cursor: pointer;
}
.scrim { display: none; }

.content { padding: 22px 26px 40px; max-width: 1320px; width: 100%; margin: 0 auto; }

/* ============ 组件 ============ */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card .hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--line);
}
.card .hd .h { display: flex; align-items: center; gap: 8px; }
.card .bd { padding: 16px 18px; }
.card .bd.flush { padding: 0; }

.grid { display: grid; gap: 14px; }
.grid.c4 { grid-template-columns: repeat(4, 1fr); }
.grid.c3 { grid-template-columns: repeat(3, 1fr); }
.grid.c2 { grid-template-columns: repeat(2, 1fr); }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.spacer { flex: 1; }

.stat { padding: 16px 18px; }
.stat .label { font-size: 12px; color: var(--muted); }
.stat .value { font-size: 27px; font-weight: 600; color: var(--ink); line-height: 1.3; margin-top: 4px; }
.stat .hint { font-size: 11.5px; color: var(--muted); margin-top: 2px; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 9px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.9; white-space: nowrap;
  background: #f3f4f6; color: #4b5563;
}
.badge.ok { background: var(--ok-weak); color: var(--ok); }
.badge.warn { background: var(--warn-weak); color: var(--warn); }
.badge.danger { background: var(--danger-weak); color: var(--danger); }
.badge.info { background: var(--primary-weak); color: var(--primary); }
.badge.gray { background: #f3f4f6; color: #6b7280; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 32px; padding: 0 13px;
  border-radius: 7px; border: 1px solid var(--line-strong);
  background: #fff; color: #374151;
  font-size: 12.5px; font-family: inherit; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: #f9fafb; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-hover); }
.btn.danger { color: var(--danger); border-color: #f0c9c5; background: #fff; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { height: 27px; padding: 0 10px; font-size: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--muted); background: #fafbfc; white-space: nowrap; }
td { font-size: 13px; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafbfc; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
.strong { font-weight: 600; color: var(--ink); }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.mono { font-family: Consolas, "Courier New", monospace; font-size: 12.5px; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 4px; }
.tab {
  padding: 11px 14px; font-size: 13px; color: var(--muted);
  border-bottom: 2px solid transparent; cursor: pointer; background: none; border-top: 0; border-left: 0; border-right: 0;
  font-family: inherit; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.field { display: flex; flex-direction: column; gap: 5px; }
.field label { font-size: 12px; color: var(--muted); }
.input, .select {
  height: 34px; padding: 0 11px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: var(--text); font-family: inherit; font-size: 13px;
  outline: none;
}
.input:focus, .select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(31, 78, 121, .08); }
.input::placeholder { color: #9aa3af; }
textarea.input { height: auto; padding: 9px 11px; resize: vertical; }

.toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .input { width: 240px; }
.toolbar .select { min-width: 120px; }

.progress { height: 6px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--primary); border-radius: 999px; transition: width .2s ease; }
.import-progress { margin-top: 12px; display: grid; gap: 6px; }
.import-progress[hidden] { display: none; }
.import-progress.error .progress > i { background: var(--danger); }
.import-progress.error #import-stage { color: var(--danger); }
.import-progress .progress > i {
  background-image: linear-gradient(45deg, rgba(255, 255, 255, .25) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .25) 50%, rgba(255, 255, 255, .25) 75%, transparent 75%, transparent);
  background-size: 28px 28px;
  animation: stripes .9s linear infinite;
}
.empty { animation: fadeUp .26s ease both; }
.bidinfo-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }

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

.kv { display: grid; grid-template-columns: 110px 1fr; gap: 8px 12px; font-size: 13px; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text); }

.list { display: flex; flex-direction: column; }
.list .item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 18px; border-bottom: 1px solid var(--line);
}
.list .item:last-child { border-bottom: 0; }
.list .item:hover { background: #fafbfc; }
.list .item .idx {
  flex: 0 0 20px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--primary-weak); color: var(--primary);
  font-size: 11px; display: flex; align-items: center; justify-content: center; margin-top: 1px;
}

/* 读标清单 */
.req-group + .req-group { margin-top: 14px; }
.req-group .gh {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 18px; background: #fafbfc; border-bottom: 1px solid var(--line);
  font-weight: 600; color: var(--ink); font-size: 13px;
}
.req {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 18px; border-bottom: 1px solid var(--line);
}
.req:last-child { border-bottom: 0; }
.req input[type="checkbox"] { margin-top: 3px; width: 14px; height: 14px; accent-color: var(--primary); }
.req .body { flex: 1; min-width: 0; }
.req .text { font-size: 13px; }
.req .text { line-height: 1.7; }
.req .src { font-size: 11.5px; color: var(--muted); margin-top: 4px; line-height: 1.6; }
.req.done .text { color: var(--muted); text-decoration: line-through; }

.stars { color: var(--danger); font-weight: 600; }

/* 检查项 */
.check {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 18px; border-bottom: 1px solid var(--line);
}
.check:last-child { border-bottom: 0; }
.check .lv { flex: 0 0 46px; }
.check .lv .badge { min-width: 46px; justify-content: center; }
.check .body { flex: 1; }
.check .t { font-weight: 600; color: var(--ink); }
.check .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.check .loc { font-size: 11.5px; color: #9aa3af; margin-top: 3px; }

/* 详情头 */
.detail-head { padding: 18px 20px; }
.detail-head .name { font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-head .meta { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }

/* 设置 */
.form { display: grid; gap: 14px; max-width: 640px; }
.form .hint { font-size: 12px; color: var(--muted); }
.callout {
  background: #fbfcfe; border: 1px solid var(--line); border-left: 3px solid var(--primary);
  border-radius: 6px; padding: 11px 14px; font-size: 12.5px; color: #4b5563;
}
.callout.warn { border-left-color: var(--warn); background: #fffdf7; }

/* 流程条 */
.steps { display: flex; align-items: center; gap: 10px; padding: 11px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); margin-top: 12px; }
.steps .s { display: flex; align-items: center; gap: 8px; color: #9aa3af; font-size: 12.5px; white-space: nowrap; }
.steps .s .n { width: 22px; height: 22px; border-radius: 50%; background: #eef0f3; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.steps .s.done .n { background: var(--ok-weak); color: var(--ok); }
.steps .s.active .n { background: var(--primary); color: #fff; }
.steps .s.active { color: var(--ink); font-weight: 600; }
.steps .arrow { color: #c3cad3; }

/* 写标编辑器 */
.editor { display: flex; min-height: 420px; }
.editor .side { width: 236px; flex: 0 0 236px; border-right: 1px solid var(--line); background: #fafbfc; }
.editor .side .si { padding: 11px 14px; border-bottom: 1px solid var(--line); cursor: pointer; font-size: 12.5px; color: #374151; }
.editor .side .si:hover { background: #f3f6fa; }
.editor .side .si.active { background: #fff; border-left: 3px solid var(--primary); font-weight: 600; color: var(--ink); }
.editor .side .si .st { font-size: 11px; color: var(--muted); font-weight: 400; margin-top: 2px; }
.editor .pane { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.editor .pane .ph { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.editor textarea { flex: 1; min-height: 480px; border: 0; padding: 16px; font-family: inherit; font-size: 13px; line-height: 1.85; color: var(--text); resize: vertical; outline: none; background: #fff; }
.editor .pane .pf { padding: 10px 16px; border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; }

.file-link { display: inline-block; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; vertical-align: middle; color: var(--primary); font-size: 12.5px; }
.file-link:hover { text-decoration: underline; }
input[type="file"] { font-size: 12.5px; color: var(--muted); }
input[type="file"]::file-selector-button {
  height: 30px; padding: 0 12px; margin-right: 10px;
  border: 1px solid var(--line-strong); border-radius: 7px;
  background: #fff; color: #374151; font-family: inherit; font-size: 12.5px; cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: #f9fafb; }

/* Agent 时间线 */
.timeline { position: relative; padding: 6px 0; }
.tl-item { display: flex; gap: 12px; padding: 11px 18px; position: relative; }
.tl-item::before { content: ''; position: absolute; left: 29px; top: 0; bottom: 0; width: 1px; background: var(--line); }
.tl-item:first-child::before { top: 22px; }
.tl-item:last-child::before { bottom: calc(100% - 22px); }
.tl-dot { position: relative; z-index: 1; width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; background: #eef0f3; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.tl-dot.done { background: var(--ok-weak); color: var(--ok); }
.tl-dot.waiting { background: var(--warn-weak); color: var(--warn); }
.tl-dot.running { background: var(--primary); color: #fff; }
.tl-dot.error { background: var(--danger-weak); color: var(--danger); }
.tl-body { flex: 1; min-width: 0; }
.tl-h { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tl-d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

/* Agent 工作台 */
.fhead { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding: 16px 18px; }
.fh-title { display: flex; align-items: center; gap: 10px; }
.fh-sub { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.fprogress { width: 320px; max-width: 100%; margin-top: 8px; }
.fbody2 { display: grid; grid-template-columns: 300px 1fr; gap: 14px; margin-top: 14px; align-items: start; }
.fsteps { padding: 8px 0; }
.fgroup { font-size: 11px; color: #9aa3af; padding: 10px 14px 4px; letter-spacing: .5px; }
.fnode { display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 12px; border: 0; background: none; text-align: left; cursor: pointer; font-family: inherit; }
.fnode:hover { background: #fafbfc; }
.fnode.active { background: var(--primary-weak); }
.fic { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; background: #eef0f3; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.fic.done { background: var(--ok-weak); color: var(--ok); }
.fic.waiting { background: var(--warn-weak); color: var(--warn); }
.fic.running { background: var(--primary); color: #fff; }
.fic.error { background: var(--danger-weak); color: var(--danger); }
.fbody2n { flex: 1; min-width: 0; }
.fname { display: block; font-size: 12.5px; color: #1f2328; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fnode.active .fname { font-weight: 600; color: var(--ink); }
.fmeta { display: block; font-size: 10.5px; color: var(--muted); }
.fst { font-size: 10.5px; white-space: nowrap; }
.fst.ok { color: var(--ok); } .fst.warn { color: var(--warn); } .fst.info { color: var(--primary); } .fst.danger { color: var(--danger); } .fst.gray { color: #9aa3af; }
.fmain { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.detail-status { margin-bottom: 8px; }
.detail-sum { font-size: 13px; color: #374151; line-height: 1.75; }
.detail-meta { font-size: 11.5px; color: #9aa3af; margin-top: 6px; }
.fbadge { font-size: 9.5px; padding: 0 5px; border-radius: 999px; line-height: 1.6; display: inline-block; }
.fbadge.info { background: var(--primary-weak); color: var(--primary); }
.fbadge.gray { background: #f3f4f6; color: #6b7280; }
.detail-json { background: #f6f8fa; border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; font-size: 11.5px; line-height: 1.6; max-height: 260px; overflow: auto; white-space: pre-wrap; }
.flog .log-row { display: grid; grid-template-columns: 58px 108px 58px 1fr; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line); font-size: 11.5px; align-items: center; }
.flog .log-row:last-child { border-bottom: 0; }
.log-time { color: #9aa3af; }
.log-name { color: var(--ink); font-weight: 600; white-space: nowrap; }
.log-sum { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.log-st.ok { color: var(--ok); } .log-st.warn { color: var(--warn); } .log-st.danger { color: var(--danger); } .log-st.info { color: var(--primary); } .log-st.gray { color: #9aa3af; }
@media (max-width: 1100px) {
  .fbody2 { grid-template-columns: 1fr; }
  .bidinfo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- 平板 / 移动端 ---------- */
@media (max-width: 980px) {
  .sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; z-index: 40;
    width: 236px; flex-basis: 236px; height: 100vh;
    transform: translateX(-100%); transition: transform .22s ease;
    box-shadow: 6px 0 24px rgba(15, 42, 74, .16);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open { overflow: hidden; }
  .scrim {
    position: fixed; inset: 0; z-index: 35;
    background: rgba(15, 42, 74, .38);
  }
  body.nav-open .scrim { display: block; }
  .menu-btn { display: inline-flex; }
  .topbar { padding: 0 14px; gap: 10px; }
  .topbar .title { flex: 1; min-width: 0; }
  .topbar .title h1 { overflow: hidden; text-overflow: ellipsis; }
  .topbar .sub { display: none; }
  .content { padding: 16px 14px 32px; }
  .grid.c4 { grid-template-columns: repeat(2, 1fr); }
  .grid.c2, .grid.c3 { grid-template-columns: 1fr; }
  .fhead { flex-wrap: wrap; }
  .fprogress { width: 260px; }
}

@media (max-width: 720px) {
  /* 表格转卡片：依赖 td 的 data-label */
  table, thead, tbody, tr, td { display: block; width: 100%; }
  thead { display: none; }
  tbody tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  tbody tr:last-child { border-bottom: 0; }
  tbody tr:hover td { background: transparent; }
  td { border: 0; padding: 3px 0; font-size: 13px; }
  td[data-label] { position: relative; padding-left: 88px; text-align: left; }
  td[data-label]::before {
    content: attr(data-label); position: absolute; left: 0; top: 3px; width: 80px;
    color: var(--muted); font-size: 12px; line-height: 1.7;
  }
  td[colspan] { padding-left: 0; }
  td[colspan]::before { content: none; }
  td.nowrap { white-space: normal; }
  td .textarea { width: 100%; }
  .file-link { max-width: 200px; }
  .detail-head .name { white-space: normal; }
  .detail-head .row.between { flex-wrap: wrap; gap: 8px; }
  .card .hd { flex-wrap: wrap; gap: 8px; }
  .card .hd .h { flex-wrap: wrap; gap: 6px; }
  .field .input, .field .select { width: 100%; }
  .steps { overflow-x: auto; }
  .tabs { overflow-x: auto; padding: 0; }
  .tab { padding: 10px 12px; }
  .kv { grid-template-columns: 88px 1fr; }
  .editor { flex-direction: column; min-height: 0; }
  .editor .side {
    width: 100%; flex: 0 0 auto; display: flex; overflow-x: auto;
    border-right: 0; border-bottom: 1px solid var(--line);
  }
  .editor .side .si { flex: 0 0 auto; border-bottom: 0; border-right: 1px solid var(--line); padding: 9px 12px; white-space: nowrap; }
  .editor .side .si.active { border-left: 0; border-bottom: 2px solid var(--primary); background: #fff; }
  .editor .side .si .st { display: none; }
  .editor .pane .ph { flex-wrap: wrap; gap: 6px; padding: 9px 12px; }
  .editor textarea { min-height: 340px; padding: 12px; font-size: 14px; }
  .editor .pane .pf {
    position: sticky; bottom: 0; z-index: 3; background: #fff;
    padding: 9px 12px; flex-wrap: wrap;
  }
  .editor .pane .pf .btn { flex: 1; }
  .flog .log-row { grid-template-columns: 46px 1fr 56px; }
  .flog .log-row .log-sum { grid-column: 1 / -1; white-space: normal; }
  .fname { white-space: normal; }
}

@media (max-width: 560px) {
  body { font-size: 13px; }
  .topbar { height: 52px; flex-basis: 52px; }
  .topbar .right { display: none; }
  .topbar .title h1 { white-space: nowrap; }
  .content { padding: 12px 10px 26px; }
  .grid.c4 { gap: 10px; }
  .stat { padding: 12px 13px; }
  .stat .value { font-size: 22px; }
  .card .hd { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
  .card .bd { padding: 13px 14px; }
  .bidinfo-grid { grid-template-columns: 1fr; }
  .toolbar .input { width: 100%; }
  .toolbar .select { flex: 1; min-width: 0; }
  .fhead { flex-direction: column; align-items: stretch; padding: 14px; gap: 10px; }
  .fprogress { width: 100%; }
  .fsteps { border: 1px solid var(--line); border-radius: 8px; background: #fff; max-height: 260px; overflow-y: auto; }
  .detail-head { padding: 14px; }
  .detail-json { max-height: 200px; }
  .list .item, .req, .check { padding: 10px 14px; }
  h1, h2, h3, h4 { white-space: normal; }
  .btn { height: 36px; }
  .btn.sm { height: 30px; }
  .import-progress { margin-top: 10px; }
}
/* ---------- 项目页与新建向导 ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page-head h2 { font-size: 18px; }
.ph-stats { display: flex; gap: 16px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.ph-stats b { color: var(--ink); font-size: 14px; margin-left: 2px; }

.seg { display: inline-flex; background: #f3f4f6; border-radius: 8px; padding: 2px; }
.seg-btn { border: 0; background: none; padding: 5px 12px; border-radius: 6px; font-size: 12.5px; color: #4b5563; cursor: pointer; font-family: inherit; }
.seg-btn.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(16, 24, 40, .08); font-weight: 600; }

.proj-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.proj-card {
  position: relative;
  display: block; border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; background: #fff;
  transition: box-shadow .18s ease, transform .18s ease, border-color .18s ease;
}
.proj-card:hover { box-shadow: 0 8px 22px rgba(16, 24, 40, .08); border-color: #d8e0e9; transform: translateY(-1px); }
.proj-manage {
  position: absolute; top: 8px; right: 8px; width: 26px; height: 26px;
  border-radius: 6px; border: 1px solid transparent; background: transparent;
  color: #9aa3af; cursor: pointer; font-size: 16px; line-height: 1; opacity: 0;
  transition: opacity .16s ease, background .16s ease, color .16s ease;
}
.proj-card:hover .proj-manage { opacity: 1; }
.proj-manage:hover { background: #f3f4f6; color: var(--ink); border-color: var(--line); }
@media (hover: none) { .proj-manage { opacity: 1; } }
.pc-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-right: 24px; }
.pc-name { font-weight: 600; color: var(--ink); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pc-full {
  font-size: 12px; color: var(--muted); margin-top: 4px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; line-height: 1.5; min-height: 2.9em;
}
.pc-meta { display: flex; gap: 6px; font-size: 12px; color: var(--muted); margin-top: 8px; }
.pc-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 12.5px; }
.pc-budget { font-weight: 600; color: var(--ink); }
.pc-progress { margin-top: 10px; height: 4px; }
.pc-progress.ok > i { background: var(--ok); }

.wizard-steps { display: flex; align-items: center; gap: 10px; padding: 4px 0 18px; flex-wrap: wrap; }
.ws { display: flex; align-items: center; gap: 7px; font-size: 12.5px; color: #9aa3af; }
.ws-n { width: 22px; height: 22px; border-radius: 50%; background: #eef0f3; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.ws.active { color: var(--ink); font-weight: 600; }
.ws.active .ws-n { background: var(--primary); color: #fff; }
.ws.done .ws-n { background: var(--ok-weak); color: var(--ok); }
.ws-arrow { color: #c3cad3; }

.source-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.source-card {
  border: 1px solid var(--line); border-radius: 10px; background: #fff; padding: 20px 16px;
  text-align: left; cursor: pointer; font-family: inherit; min-height: 156px;
  transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease;
}
.source-card:hover { box-shadow: 0 8px 22px rgba(16, 24, 40, .08); border-color: #cfd8e3; transform: translateY(-2px); }
.sc-ic { color: var(--primary); height: 28px; }
.sc-ic svg { width: 26px; height: 26px; display: block; }
.sc-t { font-weight: 600; color: var(--ink); margin-top: 8px; font-size: 14px; }
.sc-d { font-size: 12px; color: var(--muted); margin-top: 4px; line-height: 1.6; }

.wizard-panel { max-width: 760px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.wizard-actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.pick-list { display: flex; flex-direction: column; gap: 8px; max-height: 360px; overflow: auto; }
.pick-item { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; background: #fff; text-align: left; cursor: pointer; font-family: inherit; }
.pick-item:hover { border-color: #cfd8e3; background: #fafbfc; }
.pi-title { display: block; font-size: 13px; color: var(--ink); font-weight: 600; }
.pi-meta { display: block; font-size: 11.5px; color: var(--muted); margin-top: 3px; }

.done { text-align: center; padding: 10px 0 4px; }
.done-ic {
  width: 44px; height: 44px; border-radius: 50%; background: var(--ok-weak); color: var(--ok);
  display: flex; align-items: center; justify-content: center; font-size: 22px; margin: 0 auto 10px;
  animation: fadeUp .3s ease both;
}
.done-t { font-size: 16px; font-weight: 600; color: var(--ink); }
.done-d { font-size: 12.5px; color: var(--muted); margin-top: 4px; }
.done-stats { display: flex; justify-content: center; gap: 18px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.done-stats b { color: var(--ink); font-size: 15px; }

@media (max-width: 980px) {
  .source-grid { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
}

/* ---------- 项目详情与写标页 ---------- */
.detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; padding: 18px 20px; }
.dh-main { flex: 1; min-width: 0; }
.detail-head .name { font-size: 17px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.detail-head .meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px; color: var(--muted); font-size: 12.5px; }
.detail-head .meta i { width: 3px; height: 3px; border-radius: 50%; background: #c3cad3; display: inline-block; }
.dh-badges { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; flex: 0 0 auto; }

.tabs { margin: 14px 0; display: flex; gap: 2px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 10px 10px 0 0; padding: 0 6px; overflow-x: auto; }
.tab { padding: 12px 14px; font-size: 13px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

.bidinfo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px 14px; }
.bidinfo-grid > div { min-width: 0; }
.bidinfo-grid .input { width: 100%; }

.dev-table { table-layout: fixed; }
.dev-table th:nth-child(1), .dev-table td:nth-child(1) { width: 46px; }
.dev-table th:nth-child(3), .dev-table td:nth-child(3) { width: 92px; }
.dev-table th:nth-child(4), .dev-table td:nth-child(4) { width: 150px; }
.dev-table th:nth-child(5), .dev-table td:nth-child(5) { width: 116px; }
.dev-table th, .dev-table td { padding: 10px 12px; }
.dev-table td:nth-child(2) { word-break: break-word; }
.dev-text, .dev-note { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.55; word-break: break-word; }
.dev-actions { display: flex; flex-direction: column; gap: 4px; }
.dev-actions .btn { width: 100%; }

@media (max-width: 980px) {
  .detail-head { flex-direction: column; align-items: stretch; }
  .dh-badges { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .dev-text, .dev-note { -webkit-line-clamp: unset; }
  .dev-actions { flex-direction: row; }
}

.req.focus { background: #fff8e6; box-shadow: inset 3px 0 0 var(--warn); border-radius: 4px; }
.req-link { color: var(--primary); font-size: 11.5px; }
.req-link:hover { text-decoration: underline; }

/* ---------- 写标三步 ---------- */
.bid-steps-card { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 18px; margin-bottom: 14px; flex-wrap: wrap; }
.bs-steps { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bs { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 8px 12px; cursor: pointer; font-family: inherit; text-align: left; transition: border-color .16s ease, background .16s ease; }
.bs:hover { border-color: #cfd8e3; background: #fafbfc; }
.bs.done { border-color: #cfe7dc; background: var(--ok-weak); }
.bs-n { width: 22px; height: 22px; border-radius: 50%; background: #eef0f3; color: #6b7280; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; }
.bs.done .bs-n { background: #fff; color: var(--ok); }
.bs-t { font-size: 12.5px; font-weight: 600; color: var(--ink); }
.bs-s { font-size: 11px; color: var(--muted); }
.bs-arrow { color: #c3cad3; }
.bid-sec { margin-bottom: 14px; scroll-margin-top: 70px; }
.sec-no { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-weak); color: var(--primary); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; flex: 0 0 22px; }

@media (max-width: 720px) {
  .bid-steps-card { align-items: stretch; }
  .bs-steps { width: 100%; }
  .bs { flex: 1; }
  .bs-arrow { display: none; }
}

/* ---------- 运行条与运行记录 ---------- */
.run-bar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 12px 18px; margin-top: 12px; flex-wrap: wrap; }
.rb-main { min-width: 0; }
.rb-title { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.rb-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rb-progress { width: 280px; max-width: 100%; margin-top: 6px; }
.drawer-mask { position: fixed; inset: 0; background: rgba(15, 23, 42, .3); z-index: 60; animation: fadeUp .18s ease both; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: 440px; max-width: 94vw; background: #fff; z-index: 61; display: flex; flex-direction: column; box-shadow: -10px 0 30px rgba(0, 0, 0, .14); animation: drawerIn .22s ease both; }
.drawer-hd { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-bd { flex: 1; overflow: auto; }
.drawer-sec { font-size: 11px; color: #9aa3af; padding: 12px 18px 4px; letter-spacing: .5px; }
.drawer-row { display: flex; align-items: center; gap: 8px; padding: 8px 18px; border-bottom: 1px solid var(--line); }
.drawer-row:last-child { border-bottom: 0; }
.dr-name { flex: 0 0 96px; font-size: 12.5px; font-weight: 600; color: var(--ink); }
.dr-sum { flex: 1; min-width: 0; font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mat-row { display: flex; align-items: center; gap: 10px; padding: 9px 18px; border-bottom: 1px solid var(--line); }
.mat-row:last-child { border-bottom: 0; }
.mr-main { flex: 1; min-width: 0; }
.sec-mats { border-top: 1px solid var(--line); padding: 10px 16px; }
.sec-mats summary { cursor: pointer; font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 8px; list-style: none; }
.sec-mats summary::-webkit-details-marker { display: none; }
.mat-list { max-height: 220px; overflow: auto; margin-top: 6px; }
@keyframes drawerIn { from { transform: translateX(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (max-width: 720px) { .drawer { width: 100%; } .run-bar { align-items: stretch; } .rb-progress { width: 100%; } }

/* ---------- 动效 ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes stripes { from { background-position: 0 0; } to { background-position: 28px 0; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 0%, 100% { box-shadow: 0 0 0 0 rgba(31, 78, 121, .22); } 50% { box-shadow: 0 0 0 5px rgba(31, 78, 121, 0); } }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

.app-toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: #0f2a4a; color: #fff; padding: 10px 16px; border-radius: 8px;
  font-size: 13px; z-index: 999; box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
  max-width: 80vw; animation: toastIn .22s ease both;
}

.content { animation: fadeUp .26s ease both; }

.card { transition: box-shadow .18s ease, border-color .18s ease, transform .18s ease; }
.card:hover { box-shadow: 0 8px 22px rgba(16, 24, 40, .08); border-color: #d8e0e9; }
tbody tr { transition: background .16s ease; }
.nav a { transition: background .16s ease, color .16s ease; }
.btn { transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .06s ease; }
.btn:active:not(:disabled) { transform: translateY(1px); }

.progress > i { transition: width .5s cubic-bezier(.22, .61, .36, 1); }
.fprogress > i {
  background-image: linear-gradient(45deg, rgba(255, 255, 255, .25) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .25) 50%, rgba(255, 255, 255, .25) 75%, transparent 75%, transparent);
  background-size: 28px 28px;
  animation: stripes .9s linear infinite;
}

.fic { transition: background .18s ease, color .18s ease; }
.fic.running { position: relative; color: transparent; }
.fic.running::after {
  content: ''; position: absolute; inset: 1px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff;
  animation: spin .8s linear infinite;
}
.fic.waiting { animation: breathe 1.8s ease-in-out infinite; }

.badge.running-pulse { background: var(--primary-weak); color: var(--primary); }
.badge.running-pulse::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; margin-right: 5px; animation: pulse 1.1s ease-in-out infinite;
}

.btn.loading { position: relative; color: transparent; }
.btn.loading::after {
  content: ''; position: absolute; width: 14px; height: 14px; border-radius: 50%;
  border: 2px solid rgba(31, 78, 121, .25); border-top-color: var(--primary);
  animation: spin .8s linear infinite;
}
.btn.primary.loading::after { border-color: rgba(255, 255, 255, .55); border-top-color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}