:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #1f2937;
  --ink-2: #4b5563;
  --ink-3: #6b7280;
  --line: #e5e7eb;
  --brand: #2b4c9b;
  --brand-2: #1e3a78;
  --brand-soft: #eef2fb;
  --green: #0f766e;
  --red: #b91c1c;
  --amber: #b45309;
  --purple: #6d28d9;
  --blue: #1d4ed8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 8px 24px -12px rgba(16, 24, 40, .12);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  font-size: 14px; line-height: 1.65; color: var(--ink); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .6em; font-weight: 650; line-height: 1.35; color: var(--ink); }
h1 { font-size: 22px; }
h2 { font-size: 17px; }
h3 { font-size: 15px; }
p { margin: 0 0 .8em; }
small, .muted { color: var(--ink-3); }
.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- 布局 ---------- */
.shell { display: grid; grid-template-columns: 218px 1fr; min-height: 100vh; }
.side {
  background: #16233f; color: #c9d4ea; padding: 18px 12px; position: sticky; top: 0;
  height: 100vh; overflow-y: auto;
}
.brand { display: flex; gap: 10px; align-items: center; padding: 2px 8px 16px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px; background: linear-gradient(135deg, #4c7bf3, #2b4c9b);
  display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .5px;
}
.brand-name { color: #fff; font-weight: 650; font-size: 14px; line-height: 1.2; }
.brand-sub { font-size: 11px; color: #8fa3c9; letter-spacing: .06em; }
.nav-group { margin: 14px 0 4px; padding: 0 10px; font-size: 11px; color: #7f92b8; letter-spacing: .1em; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 8px 10px; margin: 2px 0;
  color: #c9d4ea; border-radius: 8px; font-size: 13.5px; text-decoration: none;
}
.nav a:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav a.on { background: #2b4c9b; color: #fff; font-weight: 600; }
.nav .dot { width: 5px; height: 5px; border-radius: 50%; background: #6b83ad; }
.nav a.on .dot { background: #9ec1ff; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  height: 56px; background: var(--panel); border-bottom: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; padding: 0 22px; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.identity { display: flex; align-items: center; gap: 10px; }
.identity select {
  appearance: none; border: 1px solid var(--line); background: var(--brand-soft); color: var(--brand-2);
  padding: 7px 30px 7px 10px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, #2b4c9b 50%), linear-gradient(135deg, #2b4c9b 50%, transparent 50%);
  background-position: calc(100% - 15px) 51%, calc(100% - 10px) 51%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
}
.topbar-right { display: flex; align-items: center; gap: 16px; font-size: 13px; }
.bell { position: relative; color: var(--ink-2); }
.bell b {
  position: absolute; top: -6px; right: -9px; background: var(--red); color: #fff;
  font-size: 10px; border-radius: 9px; padding: 0 4px; line-height: 15px; font-weight: 600;
}
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 12px;
}
.content { padding: 22px; max-width: 1360px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.page-head .sub { color: var(--ink-3); font-size: 12.5px; margin-top: 3px; }
.crumb { font-size: 12.5px; color: var(--ink-3); margin-bottom: 6px; }

/* ---------- 卡片与表格 ---------- */
.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 16px;
}
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid var(--line); background: #fbfcfe;
}
.card-head h2 { margin: 0; font-size: 15px; }
.card-body { padding: 18px; }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 1100px) { .g4, .g5 { grid-template-columns: repeat(2, minmax(0,1fr)); } .g3 { grid-template-columns: 1fr; } }

table.tb { width: 100%; border-collapse: collapse; font-size: 13.2px; }
table.tb th {
  text-align: left; font-weight: 600; color: var(--ink-3); font-size: 12px; letter-spacing: .02em;
  padding: 10px 12px; background: #f8fafc; border-bottom: 1px solid var(--line); white-space: nowrap;
}
table.tb td { padding: 10px 12px; border-bottom: 1px solid #f1f3f7; vertical-align: middle; }
table.tb tr:last-child td { border-bottom: 0; }
table.tb tr:hover td { background: #fbfcff; }
table.tb .r { text-align: right; }
table.tb .c { text-align: center; }
.tb-empty { padding: 36px; text-align: center; color: var(--ink-3); }

.badge {
  display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 11.5px;
  font-weight: 600; line-height: 19px; white-space: nowrap; border: 1px solid transparent;
}
.b-gray { background: #f1f3f7; color: #4b5563; border-color: #e3e7ee; }
.b-blue { background: #eaf1ff; color: #1d4ed8; border-color: #d5e2fb; }
.b-green { background: #e7f6f1; color: #0f766e; border-color: #cfeadf; }
.b-red { background: #fdecec; color: #b91c1c; border-color: #f7d4d4; }
.b-amber { background: #fdf4e3; color: #b45309; border-color: #f6e3c2; }
.b-purple { background: #f2ecfd; color: #6d28d9; border-color: #e3d7fb; }
.b-orange { background: #fff0e6; color: #c2410c; border-color: #fad9c2; }
.tag {
  display: inline-block; font-size: 11px; padding: 0 6px; border-radius: 4px;
  background: #f1f3f7; color: var(--ink-2); margin-left: 4px;
}

/* ---------- 表单 ---------- */
label.f { display: block; margin-bottom: 12px; }
label.f > span { display: block; font-size: 12.5px; color: var(--ink-2); margin-bottom: 5px; font-weight: 500; }
input[type=text], input[type=password], input[type=number], input[type=date], input[type=email],
select, textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #d8dde7; border-radius: 7px;
  font: inherit; font-size: 13.2px; color: var(--ink); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: #8aa4dd; box-shadow: 0 0 0 3px rgba(43,76,155,.1); }
input[readonly] { background: #f7f8fb; color: var(--ink-2); }
textarea { resize: vertical; min-height: 72px; }
.hint { font-size: 11.5px; color: var(--ink-3); margin-top: 4px; }
.req::after { content: " *"; color: var(--red); }

.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 15px; border-radius: 7px;
  border: 1px solid transparent; font-size: 13.2px; font-weight: 600; cursor: pointer;
  background: var(--brand); color: #fff; line-height: 1.3; text-decoration: none;
}
.btn:hover { background: var(--brand-2); text-decoration: none; color: #fff; }
.btn.ghost { background: #fff; border-color: #d8dde7; color: var(--ink-2); }
.btn.ghost:hover { background: #f7f9fc; color: var(--ink); }
.btn.green { background: var(--green); }
.btn.red { background: var(--red); }
.btn.sm { padding: 4px 10px; font-size: 12.4px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.actions form { display: inline; }

/* ---------- 指标卡 ---------- */
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 15px 16px; box-shadow: var(--shadow); }
.kpi .k { font-size: 12.2px; color: var(--ink-3); }
.kpi .v { font-size: 25px; font-weight: 680; letter-spacing: -.2px; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .d { font-size: 11.5px; color: var(--ink-3); }

/* ---------- 时间线 ---------- */
.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 5px; top: 6px; bottom: 6px; width: 1px; background: var(--line); }
.tl-item { position: relative; padding: 0 0 16px 4px; }
.tl-item::before {
  content: ""; position: absolute; left: -17px; top: 5px; width: 9px; height: 9px; border-radius: 50%;
  background: #fff; border: 2px solid #c3cee3;
}
.tl-item.done::before { background: var(--green); border-color: var(--green); }
.tl-item.reject::before { background: var(--red); border-color: var(--red); }
.tl-item .t { font-size: 13px; font-weight: 600; }
.tl-item .m { font-size: 12px; color: var(--ink-3); }

/* ---------- 提示 ---------- */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 14px; font-size: 13.2px; border: 1px solid; }
.flash.ok { background: #eaf7f2; border-color: #c6e8db; color: #0b5f57; }
.flash.error { background: #fdeeee; border-color: #f6d3d3; color: #9b1c1c; }
.errors { background: #fdf3f3; border: 1px solid #f5d5d5; border-radius: 8px; padding: 12px 16px; margin-bottom: 14px; }
.errors li { font-size: 12.8px; color: #9b1c1c; }
.notice { background: #eef3fc; border: 1px solid #d5e0f6; border-radius: 8px; padding: 10px 14px; font-size: 12.8px; color: #25457f; }

/* ---------- 明细行 ---------- */
.items { width: 100%; border-collapse: collapse; }
.items th { font-size: 11.8px; color: var(--ink-3); text-align: left; padding: 6px 6px; font-weight: 600; }
.items td { padding: 4px 6px; vertical-align: top; }
.items input, .items select { padding: 6px 8px; font-size: 12.8px; }
.items .del { color: var(--red); cursor: pointer; font-size: 16px; line-height: 1; background: none; border: 0; padding: 6px; }
.summary-bar {
  display: flex; justify-content: flex-end; gap: 26px; padding: 12px 8px 0; border-top: 1px dashed var(--line);
  font-size: 13px; color: var(--ink-2);
}
.summary-bar b { font-size: 17px; color: var(--brand-2); font-variant-numeric: tabular-nums; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; background: #0f1a30; }
.login-art { position: relative; padding: 56px; color: #dbe4f5; display: flex; flex-direction: column; justify-content: space-between;
  background: radial-gradient(900px 500px at 15% 10%, #2b4c9b55, transparent 60%), radial-gradient(700px 400px at 85% 90%, #0f766e33, transparent 55%); }
.login-art h1 { color: #fff; font-size: 30px; letter-spacing: -.4px; }
.login-art p { color: #9fb0cf; max-width: 460px; }
.login-art ul { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 9px; }
.login-art li { font-size: 13px; color: #b9c7e2; padding-left: 18px; position: relative; }
.login-art li::before { content: ""; position: absolute; left: 0; top: 9px; width: 6px; height: 6px; border-radius: 2px; background: #4c7bf3; }
.login-box { background: #fff; display: grid; align-items: center; padding: 48px; }
.login-form { width: 100%; max-width: 330px; margin: 0 auto; }
.login-form h2 { font-size: 21px; }
.demo-accounts { margin-top: 22px; border-top: 1px solid var(--line); padding-top: 14px; }
.demo-accounts table { width: 100%; font-size: 11.8px; color: var(--ink-3); }
.demo-accounts td { padding: 3px 4px; }
.demo-accounts code { background: #f4f6fa; padding: 1px 5px; border-radius: 4px; font-size: 11.5px; color: var(--ink-2); }

/* ---------- 打印 ---------- */
@media print {
  .side, .topbar, .no-print { display: none !important; }
  .shell { display: block; }
  .content { padding: 0; max-width: none; }
  .card { box-shadow: none; border: 0; }
  body { background: #fff; }
}

/* ---------- 其他 ---------- */
.stack { display: grid; gap: 10px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spread { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.right { margin-left: auto; }
.pill { display: inline-block; padding: 2px 8px; background: #f4f6fa; border-radius: 6px; font-size: 11.5px; color: var(--ink-2); }
.bar { height: 6px; background: #eef1f6; border-radius: 4px; overflow: hidden; min-width: 80px; }
.bar > i { display: block; height: 100%; background: var(--green); }
.bar.warn > i { background: #d97706; }
.bar.danger > i { background: var(--red); }
.kv { display: grid; grid-template-columns: 96px 1fr; gap: 6px 10px; font-size: 13px; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs a { padding: 8px 14px; font-size: 13px; color: var(--ink-2); border-bottom: 2px solid transparent; }
.tabs a.on { color: var(--brand); border-bottom-color: var(--brand); font-weight: 600; }
.section-title { font-size: 12px; letter-spacing: .08em; color: var(--ink-3); text-transform: uppercase; margin: 18px 0 8px; }
