:root {
  --ink: #122033;
  --muted: #68768a;
  --line: #e4e9f0;
  --line-strong: #cfd7e3;
  --surface: #ffffff;
  --canvas: #f3f6f9;
  --navy: #101d2f;
  --navy-soft: #1a2b42;
  --accent: #08a88a;
  --accent-strong: #087f6d;
  --accent-soft: #e5f8f3;
  --cyan: #36c5f0;
  --danger: #d94b5c;
  --danger-soft: #fff0f2;
  --warning: #c77d16;
  --warning-soft: #fff6e6;
  --success: #188560;
  --success-soft: #e7f7f0;
  --shadow: 0 12px 35px rgba(24, 43, 66, .08);
  --radius: 16px;
}

* { box-sizing: border-box; }
html { font-size: 15px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  line-height: 1.55;
}
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.shell { min-height: 100vh; display: grid; grid-template-columns: 252px minmax(0, 1fr); }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 252px; padding: 24px 18px 18px;
  color: #d9e2ee; background:
    radial-gradient(circle at 15% 5%, rgba(54,197,240,.14), transparent 28%),
    linear-gradient(180deg, var(--navy), #0c1727 80%);
  display: flex; flex-direction: column; z-index: 40;
}
.brand { display: flex; align-items: center; gap: 12px; color: white; }
.brand strong { display: block; font-size: 1rem; letter-spacing: .02em; }
.brand small { display: block; color: #8fa1b6; font-size: .72rem; letter-spacing: .1em; }
.brand-mark {
  display: grid; place-items: center; width: 38px; height: 38px; border-radius: 11px;
  background: linear-gradient(135deg, var(--accent), var(--cyan));
  color: #061716; font-weight: 900; font-size: 1.2rem;
}
.nav { margin-top: 30px; display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  margin: 17px 12px 6px; color: #6f8299; font-size: .68rem;
  letter-spacing: .14em; text-transform: uppercase;
}
.nav-link {
  display: flex; align-items: center; gap: 11px; min-height: 42px; padding: 9px 12px;
  color: #b3c1d2; border-radius: 10px; transition: .18s ease;
}
.nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.nav-link.active { color: white; background: rgba(8,168,138,.22); box-shadow: inset 3px 0 var(--accent); }
.nav-glyph { width: 20px; color: #6ed9c4; text-align: center; font-weight: 800; }
.sidebar-note {
  margin-top: auto; padding: 14px; border: 1px solid rgba(255,255,255,.09); border-radius: 12px;
  color: #8295ab; font-size: .76rem; background: rgba(255,255,255,.035);
}
.sidebar-note strong { display: block; color: #c3d0de; margin-bottom: 3px; }
.main { grid-column: 2; min-width: 0; }
.topbar {
  position: sticky; top: 0; z-index: 30; height: 70px; padding: 0 34px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  background: rgba(255,255,255,.9); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.topbar-context { font-size: .82rem; color: var(--muted); letter-spacing: .04em; }
.topbar-user { display: flex; align-items: center; gap: 10px; }
.topbar-user strong { display: block; font-size: .84rem; }
.topbar-user small { color: var(--muted); font-size: .7rem; }
.avatar {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
  color: var(--accent-strong); background: var(--accent-soft); font-weight: 800;
}
.text-button { border: 0; background: none; color: var(--muted); padding: 6px; }
.menu-toggle { display: none; }
.content { width: min(1500px, 100%); margin: 0 auto; padding: 30px 34px 24px; }
.app-footer {
  display: flex; justify-content: space-between; gap: 16px; margin-top: 28px; padding-top: 18px;
  border-top: 1px solid var(--line); color: #8492a3; font-size: .72rem; letter-spacing: .03em;
}

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.eyebrow { color: var(--accent-strong); font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 6px; font-size: clamp(1.65rem, 2vw, 2.2rem); line-height: 1.18; letter-spacing: -.03em; }
h2 { font-size: 1.2rem; letter-spacing: -.015em; }
h3 { font-size: 1rem; }
.page-head p, .muted { color: var(--muted); }
.head-actions, .button-row { display: flex; flex-wrap: wrap; gap: 9px; align-items: center; }
.button {
  display: inline-flex; align-items: center; justify-content: center; min-height: 39px; padding: 8px 15px;
  border: 1px solid var(--line-strong); border-radius: 10px; color: var(--ink); background: white;
  font-weight: 700; font-size: .84rem; transition: .18s ease;
}
.button:hover { border-color: #aeb9c7; transform: translateY(-1px); }
.button-primary { border-color: var(--accent); color: white; background: var(--accent-strong); }
.button-primary:hover { border-color: var(--accent-strong); background: #056b5c; }
.button-danger { color: var(--danger); border-color: #f0b7c0; background: white; }
.button-small { min-height: 32px; padding: 5px 10px; font-size: .75rem; }
.button-block { width: 100%; }
.icon-button { display: grid; place-items: center; width: 40px; height: 40px; border: 1px solid var(--line); background: white; border-radius: 10px; }

.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stats-grid.five { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.stat-card, .panel {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 4px 18px rgba(24,43,66,.035);
}
.stat-card { position: relative; padding: 20px; overflow: hidden; }
.stat-card::after { content: ""; position: absolute; right: -18px; bottom: -32px; width: 80px; height: 80px; border-radius: 50%; background: var(--accent-soft); }
.stat-label { color: var(--muted); font-size: .78rem; }
.stat-value { display: block; margin: 5px 0 1px; font-size: 2rem; font-weight: 850; letter-spacing: -.05em; }
.stat-note { color: var(--muted); font-size: .72rem; }
.stat-card.alert::after { background: var(--danger-soft); }
.stat-card.alert .stat-value { color: var(--danger); }
.stat-card.warn::after { background: var(--warning-soft); }
.stat-card.warn .stat-value { color: var(--warning); }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; }
.panel { padding: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.panel-head h2, .panel-head h3 { margin: 0; }
.panel-link { color: var(--accent-strong); font-size: .78rem; font-weight: 700; }
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; min-width: 720px; }
.data-table th {
  padding: 11px 12px; border-bottom: 1px solid var(--line); color: var(--muted);
  font-size: .7rem; font-weight: 800; text-align: left; letter-spacing: .04em;
}
.data-table td { padding: 14px 12px; border-bottom: 1px solid #edf0f4; font-size: .84rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table tbody tr:hover { background: #f9fbfc; }
.table-primary { display: block; font-weight: 800; }
.table-secondary { display: block; color: var(--muted); font-size: .72rem; margin-top: 2px; }
.code { font-family: "SFMono-Regular", Consolas, monospace; font-size: .76rem; color: #52647a; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 8px; border-radius: 999px;
  background: #eef2f6; color: #566477; font-size: .69rem; font-weight: 750; white-space: nowrap;
}
.badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.badge-success { background: var(--success-soft); color: var(--success); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-warning { background: var(--warning-soft); color: var(--warning); }
.badge-accent { background: var(--accent-soft); color: var(--accent-strong); }
.empty { padding: 32px 15px; text-align: center; color: var(--muted); }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px;
  margin-bottom: 16px; background: white; border: 1px solid var(--line); border-radius: 14px;
}
.toolbar input, .toolbar select { min-width: 145px; }
input, select, textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border: 1px solid var(--line-strong);
  border-radius: 9px; color: var(--ink); background: #fff; outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(8,168,138,.12); }
textarea { min-height: 104px; resize: vertical; }
.toolbar input { width: min(300px, 100%); }
.filter-actions { display: flex; gap: 8px; margin-left: auto; }

.form-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.form-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field > span { color: #3e4e63; font-size: .78rem; font-weight: 750; }
.field small { color: var(--muted); font-size: .7rem; }
.checkbox-row { display: flex; align-items: center; gap: 8px; color: #3e4e63; }
.checkbox-row input { width: 17px; min-height: 17px; }
.stack-form { display: flex; flex-direction: column; gap: 15px; }
.form-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.side-panel { display: flex; flex-direction: column; gap: 14px; }
.info-list { display: grid; gap: 10px; }
.info-list div { display: flex; justify-content: space-between; gap: 14px; padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: .8rem; }
.info-list div:last-child { border-bottom: 0; padding-bottom: 0; }
.info-list dt { color: var(--muted); }
.info-list dd { margin: 0; text-align: right; font-weight: 700; }

.alert { padding: 12px 15px; border-radius: 10px; margin-bottom: 16px; font-size: .84rem; }
.alert-success { color: var(--success); background: var(--success-soft); border: 1px solid #bce8d7; }
.alert-error { color: var(--danger); background: var(--danger-soft); border: 1px solid #f2c3ca; }
.alert-error ul { margin-bottom: 0; padding-left: 18px; }
.callout { padding: 14px; border-radius: 11px; background: #f5f8fa; border: 1px solid var(--line); color: #536277; font-size: .8rem; }
.callout.warn { background: var(--warning-soft); border-color: #f2d4a4; color: #7d5c22; }
.callout.danger { background: var(--danger-soft); border-color: #f0b7c0; color: #8e3542; }
.secret-panel { border-color: #f0b7c0; box-shadow: 0 10px 30px rgba(217,75,92,.1); }
.secret-values { display: grid; gap: 10px; }
.secret-row {
  display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 14px; align-items: center;
  padding: 12px; border-radius: 10px; background: #fff7f8; border: 1px solid #f3d5da;
}
.secret-row > span { color: var(--muted); font-size: .76rem; font-weight: 700; }
.secret-value { overflow-wrap: anywhere; color: #7c2633; font-weight: 800; }

.timeline { display: grid; gap: 0; }
.timeline-item { position: relative; padding: 0 0 19px 26px; border-left: 1px solid var(--line); }
.timeline-item:last-child { border-left-color: transparent; padding-bottom: 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -5px; top: 5px; width: 9px; height: 9px;
  border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft);
}
.timeline-title { font-weight: 800; font-size: .84rem; }
.timeline-meta { color: var(--muted); font-size: .7rem; margin-top: 2px; }
.timeline-text { margin: 7px 0 0; font-size: .8rem; color: #4c5b6e; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 18px; }
.detail-hero { padding: 24px; background: linear-gradient(135deg, #102438, #163a4e); color: white; border-radius: var(--radius); }
.detail-hero h1 { margin: 8px 0 4px; }
.detail-hero p { color: #b4c5d4; margin-bottom: 16px; }
.detail-hero .badge { background: rgba(255,255,255,.11); color: white; }
.detail-hero .button { color: white; border-color: rgba(255,255,255,.2); background: rgba(255,255,255,.08); }
.detail-hero .button-primary { background: var(--accent); border-color: var(--accent); }
.inline-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.inline-form { display: inline-flex; gap: 8px; align-items: center; }
.inline-form select { min-width: 170px; }
.section-stack { display: flex; flex-direction: column; gap: 18px; }
.subheading { margin: 0 0 12px; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.risk-row { display: flex; justify-content: space-between; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.risk-row:last-child { border-bottom: 0; }
.risk-row strong { display: block; font-size: .82rem; }
.risk-row span { color: var(--muted); font-size: .72rem; }
.progress { height: 7px; border-radius: 999px; background: #edf1f5; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.pagination { display: flex; gap: 6px; justify-content: flex-end; padding-top: 16px; }
.pagination a, .pagination span {
  display: grid; place-items: center; min-width: 34px; height: 34px; border-radius: 8px;
  border: 1px solid var(--line); background: white; font-size: .76rem;
}
.pagination .active { color: white; background: var(--accent-strong); border-color: var(--accent-strong); }
.pagination .disabled { color: #b3bdc9; }

.login-page { min-height: 100vh; background: #0b1626; }
.login-shell { min-height: 100vh; display: grid; grid-template-columns: 1.15fr .85fr; }
.login-brand {
  padding: clamp(40px, 7vw, 100px); color: white; display: flex; flex-direction: column; justify-content: center;
  background:
    linear-gradient(120deg, rgba(7,24,34,.8), rgba(8,75,73,.4)),
    radial-gradient(circle at 70% 20%, rgba(54,197,240,.35), transparent 30%),
    radial-gradient(circle at 20% 80%, rgba(8,168,138,.3), transparent 35%),
    #0b1b2b;
}
.login-kicker { color: #61cbbb; font-size: .72rem; letter-spacing: .2em; font-weight: 800; margin-bottom: 24px; }
.login-brand h1 { font-size: clamp(3rem, 6vw, 6.4rem); line-height: .98; letter-spacing: -.075em; margin-bottom: 28px; }
.login-brand p { max-width: 620px; font-size: 1.05rem; color: #b8c8d4; }
.login-points { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 26px; color: #88a1b0; font-size: .76rem; letter-spacing: .07em; }
.login-card {
  align-self: center; width: min(440px, calc(100% - 48px)); margin: 34px auto; padding: 34px;
  border-radius: 22px; background: #fff; box-shadow: 0 30px 90px rgba(0,0,0,.35);
}
.login-card h2 { margin: 32px 0 4px; font-size: 1.65rem; }
.login-card .muted { margin-bottom: 24px; }
.login-footnote { margin-top: 18px; color: #8a97a7; font-size: .72rem; text-align: center; }
.brand.compact { color: var(--ink); }
.brand.compact small { color: var(--muted); }

.scrim { display: none; }
@media (max-width: 1100px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats-grid.five { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-2, .detail-grid, .form-layout { grid-template-columns: 1fr; }
}
@media (max-width: 780px) {
  .shell { display: block; }
  .main { min-width: 0; }
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  .menu-open .sidebar { transform: translateX(0); }
  .menu-open .scrim { display: block; position: fixed; inset: 0; z-index: 35; background: rgba(5,12,20,.52); }
  .menu-toggle { display: grid; }
  .topbar { padding: 0 16px; }
  .topbar-context { display: none; }
  .content { padding: 22px 16px 24px; }
  .app-footer { flex-direction: column; gap: 4px; }
  .page-head { flex-direction: column; }
  .stats-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stats-grid.five { grid-template-columns: 1fr 1fr; }
  .stat-card { padding: 15px; }
  .stat-value { font-size: 1.6rem; }
  .form-grid, .form-grid.three { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .toolbar .filter-actions { margin-left: 0; width: 100%; }
  .login-shell { display: block; padding: 24px 0; }
  .login-brand { min-height: auto; padding: 34px 24px; }
  .login-brand h1 { font-size: 3rem; }
  .login-points { display: none; }
  .login-card { margin: 24px auto; }
}
