:root {
  --bg: #eef5fb;
  --panel: rgba(255, 255, 255, 0.9);
  --panel-strong: #ffffff;
  --line: #d6e5f4;
  --line-strong: #b6d1ec;
  --text: #17324d;
  --muted: #5c7892;
  --primary: #2b78c6;
  --primary-soft: #e6f2ff;
  --danger: #c64747;
  --danger-soft: #fff0f0;
  --warn: #cf8a12;
  --warn-soft: #fff7e7;
  --shadow: 0 18px 40px rgba(31, 85, 141, 0.12);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(94, 170, 240, 0.22), transparent 32%),
    linear-gradient(180deg, #f6fbff 0%, var(--bg) 100%);
  color: var(--text);
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4, p { margin: 0; }

.shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
}

.sidebar {
  padding: 28px;
  background: linear-gradient(180deg, rgba(17, 62, 104, 0.96), rgba(35, 104, 171, 0.88));
  color: #eef7ff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.brand-mark {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #eaf5ff, #8ec4ff);
  color: #104373;
  font-weight: 700;
}

.brand-title { font-size: 18px; font-weight: 700; }
.brand-subtitle { font-size: 12px; opacity: 0.8; }
.nav { display: grid; gap: 10px; }

.nav-link {
  padding: 12px 14px;
  border-radius: 14px;
  color: rgba(238, 247, 255, 0.9);
}

.nav-link.active,
.nav-link:hover { background: rgba(255, 255, 255, 0.14); }

.sidebar-card {
  margin-top: 28px;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.1);
  line-height: 1.6;
  font-size: 13px;
}

.sidebar-card-title { font-weight: 700; margin-bottom: 8px; }
.main { padding: 28px; }
.topbar { margin-bottom: 24px; }
.topbar h1 { font-size: 30px; }

.page-kicker,
.eyebrow {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(43, 120, 198, 0.1);
  color: var(--primary);
  font-size: 12px;
  margin-bottom: 10px;
}

.hero,
.panel,
.stat-card {
  background: var(--panel);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(214, 229, 244, 0.9);
  box-shadow: var(--shadow);
}

.hero {
  border-radius: 26px;
  padding: 26px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
}

.hero h2 { margin-bottom: 10px; font-size: 30px; }

.status-box {
  min-width: 220px;
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  color: var(--muted);
}

.status-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  background: #b7bcc2;
}

.status-dot.online { background: #1daa67; }

.stats-grid,
.panel-grid,
.detail-grid {
  display: grid;
  gap: 18px;
  margin-top: 20px;
}

.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.panel-grid,
.detail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.stat-card { border-radius: 24px; padding: 22px; }
.stat-card span,
.meta-grid span,
.muted { color: var(--muted); }

.stat-card strong {
  display: block;
  margin-top: 10px;
  font-size: 34px;
}

.panel { border-radius: 24px; padding: 22px; }
.panel.subtle { margin-top: 16px; background: #f7fbff; box-shadow: none; }

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.list-table,
.timeline,
.risk-list { display: grid; gap: 10px; }

.list-row,
.timeline-item,
.table-row {
  display: grid;
  gap: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #f9fcff;
  border: 1px solid var(--line);
}

.list-row { grid-template-columns: 2fr 1fr 120px; }

.table { display: grid; gap: 10px; }
.table-head,
.table-row {
  grid-template-columns: 1.6fr 1fr 1.5fr 120px 100px;
  align-items: center;
}

.timeline-item { grid-template-columns: 1fr 180px; }
.table-head { color: var(--muted); padding: 0 14px; }

.risk-overview,
.diff-counters,
.inline-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.risk-chip,
.badge {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eff6fd;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.risk-chip.high,
.risk-card.high {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: #f0c8c8;
}

.risk-chip.success {
  background: #edf9f2;
  color: #178a51;
  border-color: #b8e4cb;
}

.risk-chip.medium,
.risk-card.medium {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: #f1d49d;
}

.risk-card,
.memory-card {
  padding: 16px;
  border-radius: 18px;
  background: #fbfdff;
  border: 1px solid var(--line);
  line-height: 1.7;
}

.stack {
  display: grid;
  gap: 12px;
}

.text-list {
  display: grid;
  gap: 8px;
  padding-left: 18px;
  margin: 0;
}

.text-list li {
  line-height: 1.7;
  color: var(--text);
}

.text-block {
  padding: 16px 18px;
  border-radius: 18px;
  background: #f9fcff;
  border: 1px solid var(--line);
  line-height: 1.8;
}

.muted-box {
  padding: 14px 16px;
  border-radius: 16px;
  background: #f9fcff;
  border: 1px dashed var(--line-strong);
  color: var(--muted);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.meta-grid strong { display: block; margin-top: 6px; }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.form-grid.compact { gap: 14px; }
.form-grid label { display: grid; gap: 8px; }
.form-grid label span { color: var(--muted); font-size: 14px; }
.span-2 { grid-column: 1 / -1; }

input,
select,
textarea,
.code-block {
  width: 100%;
  padding: 14px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font: inherit;
}

input:disabled,
select:disabled,
textarea:disabled,
button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

textarea { resize: vertical; }

.code-block {
  white-space: pre-wrap;
  min-height: 220px;
  overflow: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

.button.primary {
  background: linear-gradient(135deg, #3a8de0, #2b78c6);
  border-color: #2b78c6;
  color: #fff;
}

.actions { display: flex; justify-content: flex-end; }
.text-link { color: var(--primary); }

.empty {
  padding: 16px;
  border-radius: 16px;
  background: #f9fcff;
  color: var(--muted);
  border: 1px dashed var(--line-strong);
}

.busy-mask {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(238, 245, 251, 0.72);
  backdrop-filter: blur(6px);
  z-index: 9999;
}

.busy-card {
  min-width: 260px;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: grid;
  justify-items: center;
  gap: 14px;
}

.busy-spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid #cfe2f5;
  border-top-color: var(--primary);
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.diff-wrap { overflow: auto; }

.diff-wrap table.diff {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

table.diff td,
table.diff th {
  padding: 6px;
  border: 1px solid #d7e4f2;
}

@media (max-width: 1100px) {
  .shell,
  .stats-grid,
  .panel-grid,
  .detail-grid,
  .form-grid,
  .table-head,
  .table-row,
  .list-row,
  .timeline-item { grid-template-columns: 1fr; }

  .sidebar { display: none; }
  .main { padding: 18px; }
}
