/* AI智能投标系统 —— 公文蓝做结构，印章红只用于截止与必须修改 */
:root {
  --ink: #1d2b3a;
  --ink-2: #4a5a6b;
  --ink-3: #7b8a99;
  --line: #dde3ea;
  --line-2: #eef1f5;
  --bg: #f4f6f9;
  --panel: #ffffff;
  --navy: #1f3a5f;
  --navy-2: #2c5282;
  --navy-soft: #e8eef6;
  --seal: #b8322a;
  --seal-soft: #fbecea;
  --ok: #2e7d4f;
  --ok-soft: #e7f4ec;
  --amber: #a8650d;
  --amber-soft: #fbf1e1;
  --gray-soft: #eef0f3;
  --radius: 6px;
  --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  font-variant-numeric: tabular-nums;
}
a { color: var(--navy-2); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }

/* ---------- 布局 ---------- */
.app { display: grid; grid-template-columns: 212px minmax(0, 1fr); min-height: 100vh; }
.app > div { min-width: 0; }
.side {
  background: var(--navy);
  color: #d6e0ec;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
}
.brand { padding: 20px 18px 16px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand b { display: block; color: #fff; font-size: 16px; letter-spacing: .5px; }
.brand small { color: #9fb2c8; font-size: 12px; }
.nav { padding: 10px 8px; flex: 1; overflow: auto; scrollbar-width: none; -ms-overflow-style: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin: 2px 0; border-radius: 4px;
  color: #d6e0ec; text-decoration: none; font-size: 13px;
}
.nav a:hover { background: rgba(255,255,255,.07); }
.nav a.on { background: #fff; color: var(--navy); font-weight: 600; }
.nav .grp { margin: 14px 12px 4px; font-size: 11px; color: #7f95ad; }
.nav .cnt { margin-left: auto; background: var(--seal); color: #fff; font-size: 11px; border-radius: 9px; padding: 0 6px; line-height: 17px; }
.side-foot { padding: 12px 18px; font-size: 12px; color: #7f95ad; border-top: 1px solid rgba(255,255,255,.08); }
.dev-mark { font-size: 11px; letter-spacing: .3px; color: #8ea3ba; opacity: .7; user-select: none; }
.side-foot .dev-mark { margin-top: 6px; }

.top {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 14px; padding: 0 24px;
  position: sticky; top: 0; z-index: 20;
}
.top h1 { font-size: 17px; margin: 0; font-weight: 600; }
.top .grow { flex: 1; }
.main { padding: 20px 24px 60px; max-width: 1480px; }

/* ---------- 基础组件 ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); }
.panel > .hd { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }
.panel > .hd h3 { margin: 0; font-size: 15px; font-weight: 600; }
.panel > .bd { padding: 14px 16px; }
.panel + .panel { margin-top: 16px; }
.grid2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; align-items: start; }
.grid2e { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row > select { width: auto; min-width: 120px; }
.spacer { flex: 1; }
.muted { color: var(--ink-3); }
.small { font-size: 12px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.pre { white-space: pre-wrap; word-break: break-word; }

.btn {
  display: inline-flex; align-items: center; gap: 6px;
  height: 32px; padding: 0 14px; border-radius: 4px;
  border: 1px solid var(--line); background: #fff; cursor: pointer;
  white-space: nowrap;
}
.btn:hover { border-color: var(--navy-2); color: var(--navy-2); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); color: #fff; }
.btn.danger { color: var(--seal); border-color: #e9c4c0; }
.btn.danger:hover { background: var(--seal-soft); }
.btn.sm { height: 26px; padding: 0 10px; font-size: 12px; }
.btn.link { border: none; background: none; padding: 0 4px; height: auto; color: var(--navy-2); }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn .spin { width: 12px; height: 12px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=url], select, textarea {
  width: 100%; height: 32px; padding: 4px 10px;
  border: 1px solid var(--line); border-radius: 4px; background: #fff;
}
textarea { height: auto; min-height: 80px; padding: 8px 10px; line-height: 1.7; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--navy-2); outline: none; box-shadow: 0 0 0 3px rgba(44,82,130,.12); }
label.fld { display: block; }
label.fld > span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 4px; }
label.fld > em { display: block; font-style: normal; font-size: 12px; color: var(--ink-3); margin-top: 3px; }
.form { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px 16px; }
.form .full { grid-column: 1 / -1; }
.chk { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }

table.t { width: 100%; border-collapse: collapse; }
table.t th, table.t td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); text-align: left; vertical-align: top; }
table.t th { font-weight: 500; color: var(--ink-2); font-size: 12px; background: #fafbfc; }
table.t tr:hover td { background: #fafcff; }
table.t td.num { text-align: right; }

.tag {
  display: inline-block; padding: 0 7px; border-radius: 3px; font-size: 12px; line-height: 20px;
  background: var(--gray-soft); color: var(--ink-2); white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.amber { background: var(--amber-soft); color: var(--amber); }
.tag.red { background: var(--seal-soft); color: var(--seal); }
.tag.blue { background: var(--navy-soft); color: var(--navy-2); }
.tag.line { background: none; border: 1px solid var(--line); }

/* 资格结论 */
.lv { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 3px; white-space: nowrap; }
.lv::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.lv.能投 { color: var(--ok); background: var(--ok-soft); }
.lv.差一项 { color: var(--amber); background: var(--amber-soft); }
.lv.不能投 { color: var(--seal); background: var(--seal-soft); }
.lv.待评估 { color: var(--ink-2); background: var(--gray-soft); }

/* ---------- 印章倒计时（唯一的强调元素） ---------- */
.seal {
  --c: var(--seal);
  width: 54px; height: 54px; border-radius: 50%;
  border: 2px solid var(--c); color: var(--c);
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  transform: rotate(-8deg); flex: none; line-height: 1.05; background: rgba(255,255,255,.6);
  box-shadow: inset 0 0 0 3px #fff, inset 0 0 0 4px var(--c);
}
.seal b { font-size: 17px; font-weight: 700; }
.seal small { font-size: 10px; }
.seal.far { --c: #9aa7b4; }
.seal.unk { --c: #b9c3cd; transform: none; box-shadow: none; border-style: dashed; border-width: 1px; }
.seal.unk b { font-size: 12px; font-weight: 500; }
.seal.mid { --c: var(--amber); }
.seal.over { --c: #9aa7b4; transform: rotate(0); box-shadow: none; border-style: dashed; }
.seal.sm { width: 42px; height: 42px; }
.seal.sm b { font-size: 14px; }

/* ---------- 标讯列表 ---------- */
.nlist { }
.nitem {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 14px; align-items: center;
  padding: 12px 16px; border-bottom: 1px solid var(--line-2); cursor: pointer;
}
.nitem:hover { background: #fafcff; }
.nitem .title { font-weight: 500; font-size: 15px; line-height: 1.45; }
.nitem.read .title { color: var(--ink-2); font-weight: 400; }
.nitem .meta { color: var(--ink-3); font-size: 12px; margin-top: 4px; display: flex; flex-wrap: wrap; gap: 4px 14px; }
.nitem .why { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.nitem .side-r { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.score { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1; }
.score small { font-size: 11px; color: var(--ink-3); font-weight: 400; }

.filters { display: grid; grid-template-columns: 2fr repeat(5, 1fr) auto; gap: 8px; padding: 12px 16px; border-bottom: 1px solid var(--line-2); }

/* ---------- 统计块 ---------- */
.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.kpi .v { font-size: 26px; font-weight: 700; color: var(--navy); line-height: 1.2; }
.kpi .k { color: var(--ink-2); font-size: 13px; }
.kpi .s { color: var(--ink-3); font-size: 12px; }

/* 上手引导 */
.steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.step { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; background: #fff; }
.step.done { background: var(--ok-soft); border-color: #cfe7d8; }
.step b { display: block; font-size: 13px; }
.step span { font-size: 12px; color: var(--ink-3); }

/* ---------- 抽屉 / 弹窗 ---------- */
.mask { position: fixed; inset: 0; background: rgba(20,32,48,.35); z-index: 50; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(860px, 96vw);
  background: var(--panel); z-index: 51; display: flex; flex-direction: column;
  box-shadow: -8px 0 24px rgba(20,32,48,.12);
}
.drawer .dh { padding: 16px 20px; border-bottom: 1px solid var(--line); display: flex; gap: 12px; align-items: flex-start; }
.drawer .dh h2 { font-size: 17px; margin: 0; line-height: 1.45; flex: 1; }
.drawer .db { flex: 1; overflow: auto; padding: 16px 20px; }
.drawer .df { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; gap: 8px; flex-wrap: wrap; }
.modal {
  position: fixed; top: 6vh; left: 50%; transform: translateX(-50%);
  width: min(720px, 94vw); max-height: 88vh; display: flex; flex-direction: column;
  background: var(--panel); border-radius: 8px; z-index: 61; box-shadow: 0 12px 40px rgba(20,32,48,.25);
}
.modal.wide { width: min(1000px, 96vw); }
.modal .mh { padding: 14px 20px; border-bottom: 1px solid var(--line); font-weight: 600; font-size: 15px; display: flex; }
.modal .mb { padding: 16px 20px; overflow: auto; }
.modal .mf { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.modal-mask { z-index: 60; }
.x { margin-left: auto; border: none; background: none; font-size: 20px; line-height: 1; cursor: pointer; color: var(--ink-3); }

.toasts { position: fixed; top: 66px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 8px; }
.toast { background: var(--ink); color: #fff; padding: 10px 14px; border-radius: 4px; max-width: 420px; box-shadow: 0 6px 18px rgba(0,0,0,.18); }
.toast.err { background: var(--seal); }
.toast.ok { background: var(--ok); }

/* ---------- 页签 ---------- */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: none; background: none; padding: 9px 14px; cursor: pointer; color: var(--ink-2); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--navy); font-weight: 600; }

dl.kv { display: grid; grid-template-columns: 132px 1fr; gap: 6px 12px; margin: 0; }
dl.kv dt { color: var(--ink-3); }
dl.kv dd { margin: 0; word-break: break-all; }

/* ---------- 看板 ---------- */
.kanban { display: grid; grid-template-columns: repeat(6, minmax(200px, 1fr)); gap: 12px; overflow-x: auto; }
.kcol { background: #eef1f5; border-radius: var(--radius); padding: 8px; min-height: 200px; }
.kcol h4 { margin: 4px 6px 8px; font-size: 13px; display: flex; color: var(--ink-2); }
.kcol h4 span { margin-left: auto; color: var(--ink-3); font-weight: 400; }
.pcard { background: #fff; border: 1px solid var(--line); border-radius: 4px; padding: 10px; margin-bottom: 8px; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.pcard:hover { border-color: var(--navy-2); }
.pcard .n { font-weight: 500; line-height: 1.4; }
.pcard .m { font-size: 12px; color: var(--ink-3); margin-top: 4px; }

/* ---------- 标书编辑器 ---------- */
.editor { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
.outline { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.ol-item { display: flex; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 4px; cursor: pointer; font-size: 13px; }
.ol-item:hover { background: var(--line-2); }
.ol-item.on { background: var(--navy-soft); color: var(--navy); font-weight: 600; }
.ol-item.l2 { padding-left: 24px; }
.ol-item.l3 { padding-left: 38px; }
.ol-item .t { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: #c6ced8; flex: none; }
.dot.ok { background: var(--ok); }
.dot.warn { background: var(--amber); }
.dot.red { background: var(--seal); }
.ed-text { min-height: 420px; font-family: var(--font); font-size: 14px; }
.req { background: #f7f9fc; border-left: 3px solid var(--navy-2); padding: 8px 12px; font-size: 13px; color: var(--ink-2); white-space: pre-wrap; max-height: 160px; overflow: auto; }

.md h1, .md h2, .md h3, .md h4 { font-size: 15px; margin: 14px 0 6px; }
.md h1 { font-size: 16px; }
.md p { margin: 6px 0; }
.md table { border-collapse: collapse; margin: 8px 0; width: 100%; }
.md td, .md th { border: 1px solid var(--line); padding: 5px 8px; font-size: 13px; }
.md tr:first-child td { background: #fafbfc; font-weight: 500; }
.md .ph { background: #fff3c4; color: var(--seal); font-weight: 600; padding: 0 2px; }
.md blockquote { margin: 6px 0; padding: 6px 12px; background: var(--amber-soft); border-left: 3px solid var(--amber); color: var(--ink-2); }
.md img { max-width: 100%; max-height: 360px; border: 1px solid var(--line); }

/* 体检结果 */
.chk-item { display: grid; grid-template-columns: 76px 1fr auto; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.chk-item:last-child { border-bottom: none; }
.lvl { font-size: 12px; font-weight: 600; }
.lvl.error { color: var(--seal); }
.lvl.warning { color: var(--amber); }
.lvl.info { color: var(--ink-3); }

.bar { height: 6px; background: var(--line-2); border-radius: 3px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--navy-2); }

.empty { text-align: center; padding: 36px 16px; color: var(--ink-3); }
.empty b { display: block; color: var(--ink-2); font-size: 15px; margin-bottom: 6px; }

.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--navy); position: relative; }
.login-wrap > .dev-mark { position: absolute; left: 0; right: 0; bottom: 18px; text-align: center; }
.login { width: 360px; background: #fff; border-radius: 8px; padding: 28px; }
.login h2 { margin: 0 0 4px; }

.bell { position: relative; }
.bell i { position: absolute; top: -4px; right: -4px; background: var(--seal); color: #fff; font-style: normal; font-size: 10px; border-radius: 8px; padding: 0 5px; line-height: 15px; }
.notes { position: absolute; right: 24px; top: 52px; width: 420px; max-height: 70vh; overflow: auto; background: #fff; border: 1px solid var(--line); border-radius: 6px; box-shadow: 0 10px 30px rgba(20,32,48,.15); z-index: 40; }
.note { padding: 10px 14px; border-bottom: 1px solid var(--line-2); cursor: pointer; }
.note.unread { background: #f7faff; }
.note b { font-size: 13px; font-weight: 500; display: block; }
.note small { color: var(--ink-3); }

.chart svg { width: 100%; height: auto; display: block; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--ink-2); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 4px; vertical-align: -1px; }

@media (max-width: 1100px) {
  .grid2, .grid2e { grid-template-columns: 1fr; }
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .filters { grid-template-columns: 1fr 1fr; }
  .editor { grid-template-columns: 1fr; }
  .outline { position: static; max-height: 260px; }
  .steps { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; }
  .side { position: static; height: auto; }
  .nav { display: flex; flex-wrap: wrap; }
  .nav .grp { display: none; }
  .main { padding: 14px 16px 40px; }
  .top { padding: 0 16px; }
  .form { grid-template-columns: 1fr; }
  .nitem { grid-template-columns: 48px 1fr; }
  .nitem .side-r { grid-column: 1 / -1; flex-direction: row; justify-content: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
