:root {
  --bg: #f3f6fb;
  --panel: #ffffff;
  --ink: #16233b;
  --muted: #6b7690;
  --faint: #98a2b5;
  --line: #e3e9f3;
  --navy: #0e1f3d;
  --navy-soft: #172c52;
  --blue: #2563eb;
  --blue-soft: #e9f0fe;
  --green: #0f7a55;
  --green-soft: #e2f5ec;
  --orange: #b45309;
  --orange-soft: #fdf0e2;
  --red: #b42318;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(18, 32, 58, .04), 0 10px 28px rgba(18, 32, 58, .06);
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }

.app-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 24px;
  height: 66px;
  padding: 0 24px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo {
  width: 38px;
  height: 38px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #0f7a55);
  color: #fff;
  font-weight: 700;
  font-size: 17px;
}
.brand h1 { margin: 0; font-size: 15.5px; font-weight: 650; white-space: nowrap; }
.brand p { margin: 0; font-size: 11.5px; color: var(--muted); }

.role-box { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.role-label { font-size: 11.5px; color: var(--faint); }
.role-switch {
  display: flex;
  padding: 3px;
  border-radius: 10px;
  background: #eef2f9;
  border: 1px solid var(--line);
}
.role-switch button {
  border: 0;
  background: transparent;
  padding: 6px 16px;
  border-radius: 8px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
  transition: background .15s, color .15s, box-shadow .15s;
}
.role-switch button:hover { color: var(--ink); }
.role-switch button.active {
  background: #fff;
  color: var(--blue);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(18, 32, 58, .12);
}

.user { display: flex; align-items: center; gap: 10px; min-width: 150px; justify-content: flex-end; }
.avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 650;
  font-size: 13px;
}
.user-name { font-size: 13px; font-weight: 600; line-height: 1.3; }
.user-sub { font-size: 11px; color: var(--muted); }

.shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 66px);
}

.sidebar {
  position: sticky;
  top: 66px;
  height: calc(100vh - 66px);
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  background: var(--navy);
  color: #c8d3e8;
}
.side-title {
  padding: 0 12px 14px;
  font-size: 12px;
  letter-spacing: .12em;
  color: #7f8fb0;
}
.nav { display: flex; flex-direction: column; gap: 3px; }
.nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #b9c6de;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.nav button::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background: #3c4f73;
  transition: background .15s;
}
.nav button:hover { background: var(--navy-soft); color: #fff; }
.nav button.active { background: var(--navy-soft); color: #fff; }
.nav button.active::before { background: #5b8cff; }
.side-foot {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid #24395e;
  font-size: 11px;
  line-height: 1.6;
  color: #6f80a1;
}

.main { padding: 26px 30px 70px; max-width: 1240px; width: 100%; }
.loading { padding: 60px 0; color: var(--muted); text-align: center; }

.section { margin-bottom: 30px; scroll-margin-top: 84px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 12px;
}
.section-head h3 { margin: 0; font-size: 16px; font-weight: 650; }
.section-head .sub { font-size: 12px; color: var(--muted); }

.hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 28px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #0e1f3d 0%, #1b3d78 58%, #2563eb 100%);
  color: #fff;
  box-shadow: var(--shadow);
}
.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -80px;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .07);
}
.eyebrow { margin: 0 0 4px; font-size: 11.5px; letter-spacing: .12em; color: #9fc0ff; }
.hero h2 { margin: 0 0 6px; font-size: 23px; font-weight: 650; }
.hero p { margin: 0; font-size: 12.5px; color: #c9d9f5; }
.hero-key {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 10px;
  background: rgba(255, 255, 255, .08);
  font-size: 12px;
  color: #dbe7fb;
  white-space: nowrap;
}
.hero-key code { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12.5px; color: #fff; }

.cards { display: grid; gap: 14px; margin-top: 16px; }
.cards.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cards.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.card {
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.card h4 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.card .big { font-size: 26px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.card .big small { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.card .hint { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.card .row .hint { margin: 0; }

.key-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.key-line code {
  padding: 4px 8px;
  border-radius: 6px;
  background: #f3f6fb;
  border: 1px solid var(--line);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12.5px;
}

.progress { height: 7px; margin-top: 10px; border-radius: 999px; background: #edf1f8; overflow: hidden; }
.progress > span { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, #2563eb, #0f7a55); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.4;
  background: #f1f4fa;
  color: #4d5974;
  white-space: nowrap;
}
.tag.ok { background: var(--green-soft); color: var(--green); }
.tag.warn { background: var(--orange-soft); color: var(--orange); }
.tag.blue { background: var(--blue-soft); color: var(--blue); }
.tag.muted { background: #f3f5f9; color: #78839a; }
.tag.red { background: #fdecea; color: var(--red); }
.dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }

.table-wrap {
  overflow: auto;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 11px 14px;
  background: #f8fafd;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  white-space: nowrap;
}
tbody td { padding: 11px 14px; border-bottom: 1px solid #eef2f8; vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfcff; }
td .sub { display: block; font-size: 11px; color: var(--faint); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; font-size: 12px; }
.center { text-align: center; }
.muted { color: var(--muted); }

.bar-row { display: grid; grid-template-columns: 180px 1fr 52px; align-items: center; gap: 12px; margin: 9px 0; font-size: 12.5px; }
.bar-row .track { height: 8px; border-radius: 999px; background: #edf1f8; overflow: hidden; }
.bar-row .track span { display: block; height: 100%; border-radius: 999px; background: #2563eb; }
.bar-row .val { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.feature-groups { display: grid; gap: 16px; }
.fg {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px 16px 16px;
}
.fg h4 { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.fg h4 span { padding: 1px 7px; border-radius: 999px; background: #f1f4fa; color: var(--muted); font-size: 11px; font-weight: 400; }
.fg-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.feat {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #e9eef7;
  border-radius: 9px;
  background: #fbfcff;
  text-align: left;
  cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.feat:hover { border-color: #bcd0f6; background: #f5f9ff; transform: translateY(-1px); }
.feat .no { flex: none; margin-top: 1px; font-size: 10.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.feat .txt { min-width: 0; }
.feat .txt b { display: block; font-size: 12.5px; font-weight: 600; }
.feat .txt span { display: block; font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty {
  padding: 30px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
  background: #fbfcff;
}

.notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  margin-top: 12px;
  border-radius: 10px;
  background: #fff8ec;
  border: 1px solid #f4e3c3;
  color: #7a5314;
  font-size: 12px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: #fff;
  color: var(--ink);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, border-color .15s;
  white-space: nowrap;
}
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover { background: #1d4fd0; }
.btn.ghost { border-color: var(--line); color: var(--muted); }
.btn.ghost:hover { border-color: #c3cfe3; color: var(--ink); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.link { background: transparent; color: var(--blue); padding: 0; }

.cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  border-radius: var(--radius);
  background: linear-gradient(120deg, #0e1f3d, #1b3d78);
  color: #fff;
  box-shadow: var(--shadow);
}
.cta-card h3 { margin: 0 0 4px; font-size: 16px; }
.cta-card p { margin: 0; font-size: 12.5px; color: #c9d9f5; }

.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(14, 24, 41, .48);
}
.modal.hidden { display: none; }
.modal-card {
  width: min(600px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(14, 24, 41, .3);
}
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.modal-eyebrow { font-size: 11.5px; color: var(--muted); }
.modal-head h3 { margin: 2px 0 0; font-size: 17px; }
.icon-btn { border: 0; background: transparent; color: var(--muted); font-size: 22px; line-height: 1; cursor: pointer; }
.modal-tags { display: flex; gap: 6px; flex-wrap: wrap; margin: 10px 0 0; }
.modal-desc {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: #f7f9fd;
  border-radius: 9px;
  color: #44506a;
  font-size: 13px;
  line-height: 1.7;
}
.modal-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; }
.modal-foot .hint { font-size: 11px; color: var(--faint); }

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translate(-50%, 18px);
  z-index: 80;
  padding: 9px 16px;
  border-radius: 8px;
  background: #14223c;
  color: #fff;
  font-size: 12.5px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--red); }

@media (max-width: 1050px) {
  .cards.three, .cards.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .brand p { display: none; }
}

@media (max-width: 860px) {
  .app-bar { height: auto; padding: 10px 14px; flex-wrap: wrap; gap: 10px; }
  .role-box { margin-left: 0; order: 3; width: 100%; justify-content: space-between; }
  .user { margin-left: auto; }
  .shell { grid-template-columns: 1fr; }
  .sidebar {
    position: static;
    height: auto;
    padding: 10px;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    overflow-x: auto;
  }
  .side-title, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 4px; }
  .nav button { white-space: nowrap; padding: 7px 10px; }
  .main { padding: 18px 14px 50px; }
  .hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .hero-key { white-space: normal; }
  .cards.three, .cards.four { grid-template-columns: 1fr; }
  .fg-list { grid-template-columns: 1fr; }
  .bar-row { grid-template-columns: 120px 1fr 46px; }
  .cta-card { flex-direction: column; align-items: flex-start; }
  .modal-foot { flex-direction: column; align-items: flex-start; }
}
