:root {
  --ink: #111113;
  --ink-2: #3a3a42;
  --muted: #6b6b76;
  --faint: #8a8a93;
  --accent: #6b4de6;
  --accent-2: #5b3fe6;
  --soft: #f0eef5;
  --canvas: #f4f3f7;
  --surface: #fff;
  --line: rgba(17, 17, 19, .08);
  --line-2: rgba(17, 17, 19, .1);
  --high: #b42318;
  --med: #a16207;
  --low: #0d7a4f;
  --crit: #9f1239;
  --danger-bg: #fdecec;
  --warn-bg: #fbf3e4;
  --ok-bg: #e7f6ee;
  --sidebar: #1f1a33;
  --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", Inter, "Segoe UI", sans-serif;
  --font-en: Inter, "PingFang SC", "Noto Sans SC", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --shadow: 0 8px 24px rgba(20, 13, 41, .04);
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font-family: var(--font); background: var(--canvas); color: var(--ink-2); font-size: 14px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
h1, h2, h3, p { margin: 0; }

.login-wrap {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 640px 1fr;
  background: var(--canvas);
}
.login-brand {
  background: linear-gradient(165deg, #1c1533 0%, #331e6b 100%);
  color: #e6e1f3;
  padding: 72px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.login-brand .brand-mark { width: 28px; height: 28px; display: block; }
.login-brand .brand-word { height: 28px; width: auto; display: block; margin-bottom: 72px; }
.login-brand h1 {
  color: #fff; font-family: var(--font-en); font-size: 48px; font-weight: 300;
  letter-spacing: -.02em; margin: 0 0 20px; line-height: 1.15;
}
.login-brand p { max-width: 420px; color: #c9bdf0; font-size: 16px; line-height: 1.75; margin: 0; }
.login-points { display: flex; flex-direction: column; gap: 18px; margin-top: 48px; }
.login-points span { display: flex; gap: 14px; align-items: center; color: #f2eeff; font-size: 15px; font-weight: 300; }
.login-points i { width: 5px; height: 5px; border-radius: 50%; background: #a78bfa; display: block; flex: none; }
.login-brand .foot { color: #a78bfa; font-family: var(--font-en); font-size: 12px; letter-spacing: .12em; }
.login-panel { display: grid; place-items: center; padding: 32px; background: #f4f3f7; }
.login-card {
  width: 420px; background: #fff; border: 0; border-radius: 16px; padding: 40px;
  box-shadow: 0 24px 48px rgba(20, 13, 41, .08);
}
.login-card h2 { font-size: 28px; color: var(--ink); font-weight: 500; letter-spacing: -.02em; }
.login-card .sub { color: var(--muted); margin: 8px 0 28px; font-size: 14px; font-weight: 400; }
.demo-accounts { display: flex; gap: 0; margin-top: 24px; background: #f0eef5; border-radius: 10px; padding: 3px; }
.demo-accounts button {
  flex: 1; border: 0; background: transparent; height: 34px; border-radius: 8px;
  color: var(--muted); font-size: 13px;
}
.demo-accounts button:hover { color: var(--ink); }
.demo-accounts button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.mark {
  width: 24px; height: 24px; border-radius: 6px;
  background: linear-gradient(160deg, #9a8cff, #6b4de6);
  color: #fff; font-weight: 600; font-size: 11px;
  display: grid; place-items: center;
}

.stack { display: flex; flex-direction: column; gap: 12px; }
label.field, .field { display: flex; flex-direction: column; gap: 8px; font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  border: 1px solid transparent; border-radius: 10px; padding: 10px 14px; background: #f7f6fa; outline: none; font-weight: 400; color: var(--ink);
  min-height: 40px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px rgba(107, 77, 230, .14); }
input[readonly], textarea[readonly] {
  background: #f0eef5; color: var(--muted); border-color: transparent; cursor: default;
}
input[readonly]:focus, textarea[readonly]:focus { border-color: var(--line); box-shadow: none; }
.secret-line { position: relative; display: block; }
.secret-line input { width: 100%; box-sizing: border-box; padding-right: 36px; }
.eye {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; padding: 0; border: 0; border-radius: 6px;
  background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.eye:hover { color: var(--ink-2); background: rgba(15, 23, 42, .06); }
.eye:disabled { opacity: .4; cursor: not-allowed; }
.eye svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.eye .eye-open { display: none; }
.eye.is-open .eye-shut { display: none; }
.eye.is-open .eye-open { display: block; }
label.field .hint { color: var(--med); font-weight: 500; line-height: 1.4; }
textarea { width: 100%; resize: vertical; }
.btn {
  height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line);
  background: #fff; color: var(--ink-2); transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
  font-weight: 400;
}
.btn:hover { border-color: rgba(17,17,19,.16); background: #fafafa; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); font-weight: 500; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--high); border-color: #fecaca; background: var(--danger-bg); }
.btn.danger:hover { background: #fee2e2; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.block { width: 100%; height: 44px; border-radius: 10px; font-size: 15px; }
button.link, .link {
  border: 0; background: transparent; color: var(--muted); height: auto; padding: 0;
  font-size: 13px; font-weight: 400;
}
button.link:hover, .link:hover { color: var(--ink); }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.space { justify-content: space-between; }
.muted, .cell-sub { color: var(--muted); }

.shell { display: grid; grid-template-columns: 232px 1fr; min-height: 100vh; }
.side {
  background: linear-gradient(180deg, #1f1a33 0%, #291e4d 100%);
  color: #c9c3dc;
  padding: 0 12px 28px;
  position: sticky; top: 0; height: 100vh; overflow: auto;
}
.brand {
  display: flex; gap: 12px; align-items: center;
  height: 64px; padding: 0 12px; margin: 0 -4px 8px;
}
.brand-mark { width: 24px; height: 24px; display: block; flex: none; }
.brand-name {
  color: #fff; font-family: var(--font-en); font-size: 13px; font-weight: 500;
  letter-spacing: .02em; line-height: 1.3;
}
.side .group {
  margin: 18px 12px 6px; font-size: 11px; color: #8b7fb8;
  letter-spacing: .1em; font-weight: 400;
}
.side button.nav {
  width: 100%; text-align: left; border: 0; background: transparent;
  padding: 9px 10px; border-radius: 8px; color: #c9c3dc;
  display: flex; gap: 10px; align-items: center; font-size: 13px; font-weight: 400;
}
.side button.nav:hover { background: rgba(255,255,255,.06); color: #fff; }
.side button.nav .d {
  width: 2px; height: 14px; border-radius: 1px; background: transparent; flex: none;
}
.side button.nav.active { background: rgba(255,255,255,.1); color: #fff; font-weight: 500; }
.side button.nav.active .d { background: #c4b5fd; }
.main { padding: 0; min-width: 0; background: var(--canvas); display: flex; flex-direction: column; }
.main-body { padding: 20px 36px 48px; flex: 1; }
.topbar {
  display: flex; justify-content: flex-end; align-items: center; gap: 16px;
  height: 52px; padding: 0 36px; border-bottom: 1px solid var(--line); background: transparent;
}
.topbar-end { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.who { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 13px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff;
  display: grid; place-items: center; font-size: 12px; font-weight: 500;
}
.crumbs { display: none; }
.crumbs b { color: var(--muted); font-weight: 500; }
button.crumb {
  border: 0; background: transparent; color: var(--muted); height: auto; padding: 0;
  font-size: 13px; font-weight: 400; margin-right: auto;
}
button.crumb:hover { color: var(--accent); }
.check { display: flex; gap: 8px; align-items: center; font-size: 13px; color: var(--ink-2); margin: 4px 0; font-weight: 450; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.checks { display: flex; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0 2px; }
.page-hd {
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  margin-bottom: 16px; padding: 0;
}
.page-hd h1 { font-size: 16px; color: var(--ink); font-weight: 500; letter-spacing: -.01em; }
.page-hd .hint { display: none; }
.page-hd:has(h1:only-child) { display: none; }
.page-hd .row:empty { display: none; }

.tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 4px;
  font-size: 12px; font-weight: 500; border: 1px solid transparent; white-space: nowrap;
}
.tag.high, .tag.block { background: var(--danger-bg); color: var(--high); }
.tag.crit { background: #fff1f2; color: var(--crit); }
.tag.med, .tag.watch { background: var(--warn-bg); color: var(--med); }
.tag.low, .tag.pass { background: var(--ok-bg); color: var(--low); }
.tag.phase, .tag.neutral { background: #f3f3f5; color: var(--muted); }
.tag.policy { background: #f0ecf7; color: #5438c8; }
.mono { font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums; }
.status-text { font-size: 13px; font-weight: 500; }
.status-text.ok { color: var(--low); }
.status-text.warn { color: var(--med); }
.status-text.muted { color: var(--muted); }

.panel { background: var(--surface); border: 0; border-radius: 14px; padding: 20px; box-shadow: var(--shadow); }
.panel + .panel, .table-card { margin-top: 16px; }
.panel h3 { font-size: 15px; color: var(--ink); font-weight: 500; letter-spacing: -.01em; }
.table-card { background: #fff; border: 0; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow); }
.table-card.table-scroll { overflow-x: auto; }
.toolbar {
  display: flex; justify-content: space-between; gap: 12px; align-items: center;
  padding: 16px 18px 12px; border-bottom: 0; background: #fff;
}
.toolbar b, .toolbar h3 { font-size: 15px; font-weight: 500; color: var(--ink); }
table.list { width: 100%; border-collapse: collapse; }
table.list th {
  text-align: left; font-size: 12px; color: var(--faint); font-weight: 500;
  padding: 12px 16px; background: #fafafb; border-bottom: 1px solid rgba(17,17,19,.05); white-space: nowrap;
}
table.list td { padding: 14px 16px; border-bottom: 1px solid rgba(17,17,19,.05); vertical-align: middle; font-size: 13px; color: var(--ink); }
table.list.list-runs th, table.list.list-runs td { padding: 12px 12px; }
table.list tr:last-child td { border-bottom: 0; }
table.list tr.click { cursor: pointer; }
table.list tr.click:hover td { background: #fafafb; }
.cell-title { color: var(--ink); font-weight: 500; }
.cell-sub { color: var(--muted); font-size: 12px; margin-top: 2px; font-weight: 400; }
.cell-brief { max-width: 220px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nowrap { white-space: nowrap; }
.kv-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; margin-top: 12px;
}
.kv-grid .k {
  display: block; font-size: 12px; color: var(--faint); margin-bottom: 4px; font-weight: 500;
}
@media (max-width: 900px) {
  .kv-grid { grid-template-columns: 1fr; }
}

.kpis {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 0;
  background: #fff; border-radius: 14px; box-shadow: var(--shadow); overflow: hidden;
}
button.kpi, .kpi {
  background: transparent; border: 0; border-right: 1px solid rgba(17,17,19,.06);
  border-radius: 0; padding: 28px; box-shadow: none; text-align: left; position: relative; overflow: hidden;
  transition: background .15s ease;
}
button.kpi:hover { transform: none; background: #fafafb; box-shadow: none; }
.kpi:last-child { border-right: 0; }
.kpi::before { display: none; }
.kpi .lab { color: var(--muted); font-size: 12px; font-weight: 500; letter-spacing: .04em; }
.kpi b {
  display: block; margin-top: 8px; font-family: var(--font-en); font-size: 32px; font-weight: 300;
  letter-spacing: -.03em; color: var(--ink); font-variant-numeric: tabular-nums; line-height: 1.1;
}
.kpi .delta { margin-top: 8px; font-size: 12px; color: var(--faint); }
.grid-2 { display: grid; grid-template-columns: 1.45fr .8fr; gap: 14px; margin-top: 14px; }
.grid-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.filters label.field { min-width: 150px; flex: 1; }
.drawer.wide { width: 640px; }
.cond-card { border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; background: #fbfafe; }
.cond-card .span2 { grid-column: 1 / -1; }
.seg { display: inline-flex; background: #f0eef5; border-radius: 8px; padding: 2px; gap: 0; }
.seg button { height: 26px; border: 0; border-radius: 6px; background: transparent; color: var(--muted); padding: 0 10px; font-weight: 400; font-size: 12px; }
.seg button.on { background: #fff; color: var(--ink); font-weight: 500; box-shadow: 0 1px 2px rgba(0,0,0,.06); }
table.pivot th, table.pivot td { text-align: right; }
table.pivot th:first-child, table.pivot td:first-child, table.pivot th.mix-col, table.pivot td.mix-col { text-align: left; }
table.pivot tr.total td { background: #fbfafe; font-weight: 650; }
table.pivot tbody tr:hover td { background: #f7f4fb; }
button.cell-link { height: auto; border: 0; background: transparent; color: var(--accent); font-weight: 750; padding: 2px 6px; border-radius: 6px; font-variant-numeric: tabular-nums; }
button.cell-link.zero { color: var(--faint); font-weight: 500; }
button.cell-link:hover { background: var(--soft); text-decoration: none; }
table.pivot td:first-child { white-space: nowrap; }
.mix { display: flex; height: 6px; width: 120px; border-radius: 99px; overflow: hidden; background: #eeebf4; }
.mix i { display: block; height: 100%; }
.mix .pass { background: #0d7a4f; }
.mix .watch { background: #a16207; }
.mix .block { background: #b42318; }
.bars { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 52px 1fr 36px; gap: 8px; align-items: center; font-size: 12px; }
.track { height: 6px; background: #eeebf4; border-radius: 99px; overflow: hidden; }
.fill { height: 100%; border-radius: 99px; }
.health { display: flex; flex-direction: column; gap: 4px; }
.h-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 12px 0; background: transparent; border-radius: 0; border: 0;
  border-bottom: 1px solid rgba(17,17,19,.05);
}
.h-item:last-child { border-bottom: 0; }
.h-item > span:first-child { white-space: nowrap; display: flex; align-items: center; color: var(--ink); font-size: 14px; }
.h-item .tag { flex: none; white-space: nowrap; height: auto; background: transparent; border: 0; padding: 0; font-weight: 500; }
.dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; margin-right: 10px; }
.dot.ok { background: var(--low); box-shadow: none; }
.dot.warn { background: #8a8a93; box-shadow: none; }
.dot.bad { background: var(--high); box-shadow: none; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: -4px -6px 16px; padding: 0 6px; }
.tabs button { border: 0; background: transparent; padding: 10px 12px; color: var(--muted); border-bottom: 2px solid transparent; border-radius: 0; font-weight: 600; }
.tabs button.on { color: var(--accent); border-bottom-color: var(--accent); }
.sec-title { font-size: 14px; color: var(--ink); font-weight: 680; margin: 0 0 8px; letter-spacing: -.01em; }
.banner { background: var(--danger-bg); color: var(--crit); border: 1px solid #fecdd3; border-radius: 12px; padding: 12px 14px; margin-bottom: 12px; }

.drawer-mask { position: fixed; inset: 0; background: rgba(34, 26, 64, .42); display: flex; justify-content: flex-end; z-index: 20; backdrop-filter: blur(2px); }
.drawer {
  width: 480px; max-width: 100%; height: 100%; background: #fff;
  box-shadow: -16px 0 48px rgba(34, 26, 64, .12); padding: 20px 22px 40px; overflow: auto;
}
.drawer header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.drawer h2 { color: var(--ink); letter-spacing: -.02em; }
.opinion-list { margin: 0; padding-left: 18px; }
.opinion-list li { margin: 6px 0; }
.shot {
  margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: #fff;
}
.shot .still {
  height: 132px;
  background:
    linear-gradient(180deg, rgba(34,26,64,.12), rgba(34,26,64,.42)),
    linear-gradient(120deg, #6b4de6, #221a40 55%, #9a8cff);
}
.shot .cap { padding: 8px 10px; font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.chunk { padding: 12px 0; border-top: 1px solid var(--line); }
.chunk b { display: block; font-size: 12px; color: var(--muted); font-weight: 650; margin-bottom: 4px; }
.run-hero { display: flex; justify-content: space-between; gap: 12px; align-items: center; }

.cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kcard { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 16px; text-align: left; box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease; }
button.kcard:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(34, 26, 64, .08); }
.kcard h3 { font-size: 16px; color: var(--ink); margin: 8px 0 6px; letter-spacing: -.02em; }
.toast { position: fixed; bottom: 20px; right: 20px; background: #221a40; color: #fff; padding: 12px 16px; border-radius: 12px; font-size: 13px; z-index: 40; box-shadow: 0 12px 32px rgba(34, 26, 64, .28); }

.oa { background: #eef1f6; border: 1px solid #dde3ea; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow); }
.oa-top { height: 48px; background: linear-gradient(90deg, #1d4ed8, #2563eb); color: #fff; display: flex; align-items: center; padding: 0 16px; gap: 16px; }
.oa-top b { font-size: 14px; }
.oa-top span { opacity: .85; font-size: 12px; }
.oa-body { display: grid; grid-template-columns: 168px 1fr; min-height: 640px; background: #f5f7fa; }
.oa-side { background: #fff; border-right: 1px solid #e6ebf2; padding: 12px; }
.oa-side div { padding: 8px 10px; border-radius: 8px; color: #64748b; }
.oa-side .on { background: #e8f2ff; color: #1a66d1; font-weight: 650; }
.oa-main { padding: 16px; }
.oa-card { background: #fff; border: 1px solid #e4e8ee; border-radius: 10px; overflow: hidden; }
.oa-card h2 { padding: 12px 16px; border-bottom: 1px solid #eef2f6; font-size: 15px; }
.oa-grid { display: grid; grid-template-columns: 120px 1fr 120px 1fr; }
.oa-grid div { border-bottom: 1px solid #eef2f6; border-right: 1px solid #eef2f6; padding: 10px 12px; min-height: 40px; }
.oa-grid .k { background: #fafbfc; color: #64748b; }
.oa-actions { display: flex; gap: 8px; padding: 12px 16px; background: #fafbfc; border-top: 1px solid #eef2f6; }

.phone-stage { display: grid; place-items: center; padding: 12px 0 40px; }
.phone {
  width: 390px; background: #fff; border: 10px solid #221a40; border-radius: 32px;
  min-height: 700px; padding: 18px 16px 24px; box-shadow: 0 24px 50px rgba(34,26,64,.18);
}
.phone .status { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink); font-weight: 650; margin-bottom: 12px; }
pre.mono { background: #221a40; color: #f4f1fa; border-radius: 12px; padding: 14px; margin-top: 12px; }
@media (max-width: 960px) {
  .login-wrap, .shell, .grid-2, .kpis, .cards, .grid-form, .oa-body { grid-template-columns: 1fr; }
  .login-brand { display: none; }
  .side { position: relative; height: auto; }
  .oa-grid { grid-template-columns: 100px 1fr; }
  .mix { width: 72px; }
}
