:root {
  --bg: #f4f7fb;
  --panel: #ffffff;
  --ink: #1c2b3a;
  --ink-2: #51637a;
  --ink-3: #8496ab;
  --line: #e3eaf3;
  --primary: #0e4da4;
  --primary-deep: #0a3a7d;
  --primary-soft: #e8f0fb;
  --teal: #0fa37f;
  --teal-soft: #e3f6f0;
  --amber: #c77c11;
  --amber-soft: #fdf1de;
  --red: #c0392b;
  --red-soft: #fdeae7;
  --green: #1e8e5a;
  --green-soft: #e4f4ec;
  --violet: #6b4fbb;
  --violet-soft: #efeafa;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(16, 42, 80, .06), 0 4px 16px rgba(16, 42, 80, .05);
  font-size: 15px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }

/* ---------- topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(90deg, var(--primary-deep) 0%, #0e4da4 62%, #1272b8 100%);
  box-shadow: 0 2px 10px rgba(8, 40, 90, .25);
}
.topbar-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 24px;
  display: flex; align-items: center; gap: 22px; height: 62px;
}
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-logo {
  width: 38px; height: 38px; border-radius: 9px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.35);
  color: #fff; font-size: 20px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { color: #fff; font-size: 19px; letter-spacing: 2px; }
.brand-text em { color: rgba(255,255,255,.72); font-style: normal; font-size: 11px; }
.topbar-nav { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.topbar-nav::-webkit-scrollbar { display: none; }
.topbar-nav a {
  color: rgba(255,255,255,.82); font-size: 13.5px; padding: 6px 11px; border-radius: 7px;
  white-space: nowrap; transition: background .15s;
}
.topbar-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }
.topbar-nav a.active { background: rgba(255,255,255,.2); color: #fff; font-weight: 600; }
.topbar-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-chip { color: rgba(255,255,255,.85); font-size: 12px; }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; padding: 2.5px 9px; border-radius: 999px; white-space: nowrap;
}
.pill-demo { background: #ffd54d; color: #6b4d00; font-weight: 700; }
.pill-demo::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #c0392b; }

/* ---------- layout ---------- */
.view { max-width: 1440px; margin: 0 auto; padding: 26px 24px 60px; min-height: calc(100vh - 210px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head h1 { font-size: 23px; letter-spacing: 1px; }
.page-head .sub { color: var(--ink-2); font-size: 13px; margin-top: 3px; }
.crumbs { font-size: 12px; color: var(--ink-3); margin-bottom: 6px; }

/* ---------- panels & cards ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 18px; }
.panel-head { padding: 14px 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.panel-head h2 { font-size: 16px; display: flex; align-items: center; gap: 8px; }
.panel-head h2 .dot { width: 8px; height: 8px; border-radius: 2px; background: var(--primary); display: inline-block; }
.panel-head .hint { font-size: 12px; color: var(--ink-3); }
.panel-body { padding: 14px 18px 18px; }
.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 1100px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media (max-width: 760px) { .grid-2,.grid-3,.grid-4 { grid-template-columns: 1fr; } }

.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; position: relative; overflow: hidden; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--primary); }
.kpi.teal::before { background: var(--teal); } .kpi.amber::before { background: var(--amber); }
.kpi.red::before { background: var(--red); } .kpi.violet::before { background: var(--violet); }
.kpi.green::before { background: var(--green); }
.kpi .k-label { font-size: 12.5px; color: var(--ink-2); }
.kpi .k-value { font-size: 25px; font-weight: 700; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi .k-value small { font-size: 13px; color: var(--ink-3); font-weight: 400; margin-left: 3px; }
.kpi .k-foot { font-size: 11.5px; color: var(--ink-3); margin-top: 3px; }

.note {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--primary-soft); border: 1px solid #cddff5; border-radius: 8px;
  padding: 10px 14px; font-size: 12.8px; color: #17457e; margin-bottom: 14px;
}
.note.warn { background: var(--amber-soft); border-color: #f2ddb8; color: #7c5300; }
.note.good { background: var(--teal-soft); border-color: #bfe8db; color: #0b5f49; }
.note b { flex-shrink: 0; }

/* ---------- tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 16px; flex-wrap: wrap; }
.tabs button {
  border: 0; background: none; padding: 9px 15px; font-size: 13.8px; color: var(--ink-2);
  cursor: pointer; border-radius: 8px 8px 0 0; border-bottom: 2.5px solid transparent; margin-bottom: -2px;
  font-family: inherit;
}
.tabs button:hover { color: var(--primary); background: var(--primary-soft); }
.tabs button.active { color: var(--primary); font-weight: 700; border-bottom-color: var(--primary); }

/* ---------- table ---------- */
.tbl-wrap { overflow-x: auto; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 12.8px; }
.tbl th {
  text-align: left; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  background: #f7fafd; padding: 9px 12px; border-bottom: 1.5px solid var(--line);
}
.tbl td { padding: 9px 12px; border-bottom: 1px solid #eef3f9; vertical-align: top; }
.tbl tr:hover td { background: #fafcff; }
.tbl .num { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.tbl .mono { font-family: Consolas, "Courier New", monospace; font-size: 12px; }
.tbl .muted { color: var(--ink-3); }
.empty { text-align: center; color: var(--ink-3); padding: 26px 0; font-size: 13px; }

/* ---------- badges ---------- */
.badge { display: inline-block; font-size: 11.5px; padding: 2px 9px; border-radius: 999px; white-space: nowrap; font-weight: 600; }
.b-blue   { background: var(--primary-soft); color: var(--primary); }
.b-teal   { background: var(--teal-soft);   color: #0b7a5f; }
.b-green  { background: var(--green-soft);  color: var(--green); }
.b-amber  { background: var(--amber-soft);  color: var(--amber); }
.b-red    { background: var(--red-soft);    color: var(--red); }
.b-gray   { background: #eef1f6; color: var(--ink-2); }
.b-violet { background: var(--violet-soft); color: var(--violet); }
.up { color: var(--red); font-weight: 600; }   /* 中式：涨红 */
.down { color: var(--green); font-weight: 600; }

/* ---------- hero (home) ---------- */
.hero {
  background: linear-gradient(120deg, #0a3a7d 0%, #0e4da4 55%, #0fa37f 140%);
  border-radius: 14px; color: #fff; padding: 44px 42px 40px; margin-bottom: 20px;
  position: relative; overflow: hidden;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -60px; width: 320px; height: 320px;
  border-radius: 50%; border: 40px solid rgba(255,255,255,.06);
}
.hero .tag { display: inline-block; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.35); padding: 3px 13px; border-radius: 999px; font-size: 12.5px; margin-bottom: 16px; }
.hero h1 { font-size: 32px; letter-spacing: 2px; margin-bottom: 12px; }
.hero p.lead { font-size: 15px; max-width: 760px; color: rgba(255,255,255,.9); }
.hero .hero-chips { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero .hero-chips span { background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.28); padding: 6px 14px; border-radius: 8px; font-size: 13px; }
.value-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 20px; }
@media (max-width: 900px) { .value-cards { grid-template-columns: 1fr; } }
.vc { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px; }
.vc .vc-icon { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 10px; }
.vc h3 { font-size: 15.5px; margin-bottom: 6px; }
.vc p { font-size: 12.8px; color: var(--ink-2); }
.chain { display: flex; align-items: stretch; gap: 0; flex-wrap: wrap; }
.chain-node {
  flex: 1; min-width: 130px; background: var(--panel); border: 1px solid var(--line);
  padding: 13px 14px; position: relative; margin-right: 26px; border-radius: 9px; box-shadow: var(--shadow);
}
.chain-node:last-child { margin-right: 0; }
.chain-node::after {
  content: "▶"; position: absolute; right: -21px; top: 50%; transform: translateY(-50%);
  color: var(--ink-3); font-size: 12px;
}
.chain-node:last-child::after { content: ""; }
.chain-node .c-step { font-size: 11px; color: var(--ink-3); }
.chain-node .c-name { font-weight: 700; font-size: 14px; margin: 2px 0; }
.chain-node .c-desc { font-size: 11.5px; color: var(--ink-2); }

/* ---------- steps / timeline ---------- */
.steps { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.step { font-size: 11.5px; padding: 3px 10px; border-radius: 999px; background: #eef1f6; color: var(--ink-2); white-space: nowrap; }
.step.done { background: var(--teal-soft); color: #0b7a5f; font-weight: 600; }
.step.cur { background: var(--primary); color: #fff; font-weight: 600; }
.step.arrow { background: none; padding: 0; color: var(--ink-3); }

.timeline { list-style: none; }
.timeline li { position: relative; padding: 0 0 14px 22px; font-size: 12.8px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.timeline li::after { content: ""; position: absolute; left: 8.5px; top: 16px; bottom: 0; width: 1.5px; background: var(--line); }
.timeline li:last-child::after { display: none; }
.timeline .t-time { color: var(--ink-3); font-size: 11.5px; }

/* ---------- misc ---------- */
.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; color: var(--ink-2); margin-top: 8px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.btn {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--primary);
  color: var(--primary); background: #fff; padding: 5px 14px; border-radius: 8px;
  font-size: 12.8px; cursor: pointer; font-family: inherit; transition: all .15s;
}
.btn:hover { background: var(--primary-soft); }
.btn.solid { background: var(--primary); color: #fff; }
.btn.solid:hover { background: var(--primary-deep); }
.btn.teal { border-color: var(--teal); color: var(--teal); }
.btn.teal:hover { background: var(--teal-soft); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.kv-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 24px; font-size: 13px; }
.kv-list .kv { display: flex; justify-content: space-between; border-bottom: 1px dashed var(--line); padding: 5px 0; }
.kv-list .kv span:first-child { color: var(--ink-2); }
.kv-list .kv span:last-child { font-weight: 600; }
@media (max-width: 700px) { .kv-list { grid-template-columns: 1fr; } }

.footer { background: #10243f; color: rgba(255,255,255,.75); padding: 26px 24px; font-size: 12.8px; }
.footer-inner { max-width: 1440px; margin: 0 auto; }
.footer strong { color: #fff; }
.footer-note { margin-top: 8px; color: rgba(255,255,255,.5); font-size: 12px; }
.footer-note b { color: #ffd54d; }

/* ---------- login ---------- */
.login-wrap { display: flex; justify-content: center; padding: 30px 0 10px; }
.login-card {
  width: 460px; max-width: 100%; background: var(--panel); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.login-head { background: linear-gradient(120deg, #0a3a7d, #0e4da4); color: #fff; padding: 26px 28px 20px; }
.login-head h1 { font-size: 21px; letter-spacing: 1px; }
.login-head p { font-size: 12.5px; color: rgba(255,255,255,.8); margin-top: 4px; }
.login-body { padding: 22px 28px 26px; }
.login-body label { display: block; font-size: 12.5px; color: var(--ink-2); margin: 12px 0 5px; }
.login-body input {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 14px; font-family: inherit; outline: none; transition: border .15s;
}
.login-body input:focus { border-color: var(--primary); }
.login-err { color: var(--red); font-size: 12.5px; margin-top: 10px; min-height: 18px; }
.login-btn { width: 100%; justify-content: center; padding: 10px 0; font-size: 14.5px; margin-top: 8px; }
.quick-accounts { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 14px; }
.quick-accounts h4 { font-size: 12.5px; color: var(--ink-3); margin-bottom: 8px; font-weight: 600; }
.qa {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  border: 1px solid var(--line); background: #fafcff; border-radius: 8px; padding: 7px 12px;
  margin-bottom: 7px; cursor: pointer; font-size: 12.8px; font-family: inherit; color: var(--ink);
  transition: all .15s; text-align: left;
}
.qa:hover { border-color: var(--primary); background: var(--primary-soft); }
.qa b { font-size: 13px; }
.qa .mono { color: var(--ink-3); font-size: 11.5px; }
.btn.ghost-top { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.4); color: #fff; padding: 3px 12px; font-size: 12px; }
.btn.ghost-top:hover { background: rgba(255,255,255,.25); }
.role-tag { display: inline-block; font-size: 11px; background: var(--primary-soft); color: var(--primary); border-radius: 6px; padding: 1px 8px; margin-left: 6px; vertical-align: 1px; }
