:root {
  --ink: #17202a;
  --muted: #687385;
  --line: #dfe5ec;
  --surface: #ffffff;
  --soft: #f5f7fa;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --warning: #b45309;
  --danger: #b91c1c;
  --shadow: 0 12px 30px rgb(23 32 42 / 8%);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: #eef2f6;
  font-family: "Segoe UI", "Microsoft YaHei", sans-serif;
}
button, textarea { font: inherit; }
.hidden { display: none !important; }
.login-screen { display: grid; min-height: 100vh; place-items: center; padding: 24px; background: #e7edf2; }
.login-panel { display: grid; gap: 16px; width: min(430px, 100%); border: 1px solid var(--line); border-radius: 8px; padding: 26px; background: var(--surface); box-shadow: var(--shadow); }
.login-panel .mark { width: 44px; height: 44px; }
.login-copy { margin-top: 8px; color: var(--muted); line-height: 1.6; }
.login-error { min-height: 20px; color: var(--danger); font-size: 13px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink); }
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: #102027; color: #f8fafc; padding: 24px 18px; }
.brand { display: flex; gap: 12px; align-items: center; margin-bottom: 32px; }
.mark { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 8px; background: var(--accent); font-weight: 700; }
.brand span, .eyebrow, small { color: var(--muted); font-size: 12px; }
.brand span { display: block; color: #b9c4cf; }
nav { display: grid; gap: 8px; }
.nav-item { width: 100%; border: 0; border-radius: 8px; padding: 11px 12px; color: #d6dee6; background: transparent; text-align: left; cursor: pointer; }
.nav-item.active, .nav-item:hover { background: #1d333d; color: #fff; }
.workspace { padding: 28px; }
.topbar, .panel-header, .button-row, .status-strip { display: flex; align-items: center; }
.topbar { justify-content: space-between; gap: 20px; margin-bottom: 18px; }
h1, h2, p { margin: 0; }
h1 { font-size: 28px; }
h2 { font-size: 18px; }
.eyebrow { margin-bottom: 5px; text-transform: uppercase; }
.status-strip { flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
.status { display: inline-flex; align-items: center; min-height: 30px; border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--muted); background: var(--surface); font-size: 13px; white-space: nowrap; }
.status.ok { color: var(--accent-dark); border-color: #9dd7cf; background: #e7f6f3; }
.status.bad { color: var(--danger); border-color: #fecaca; background: #fef2f2; }
.notice { display: flex; gap: 12px; align-items: center; border: 1px solid #f1d19b; border-radius: 8px; padding: 12px 14px; color: var(--warning); background: #fff7ed; }
.notice span { flex: 1; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0; }
.metrics article, .panel { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); box-shadow: var(--shadow); }
.metrics article { padding: 16px; }
.metrics span { color: var(--muted); font-size: 13px; }
.metrics strong { display: block; margin-top: 8px; font-size: 26px; }
.view { display: none; }
.view.active { display: block; }
.panel { padding: 18px; }
.panel-header { justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.split { display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 16px; }
.order-list { display: grid; gap: 10px; }
.order-row { display: flex; justify-content: space-between; gap: 12px; width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 12px; color: var(--ink); background: #fff; text-align: left; cursor: pointer; }
.order-row.selected { border-color: #8ccfc7; background: #f0fbf9; }
.order-row span { display: grid; gap: 4px; }
.order-row em { color: var(--accent-dark); font-size: 13px; font-style: normal; white-space: nowrap; }
.detail-card { border: 1px solid var(--line); border-radius: 8px; padding: 16px; background: var(--soft); min-height: 220px; }
.detail-grid, .permission-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.detail-grid div, .permission-grid div { border: 1px solid var(--line); border-radius: 8px; padding: 12px; background: #fff; }
.permission-grid span { display: block; margin-top: 8px; color: var(--muted); }
label { display: grid; gap: 7px; margin-bottom: 12px; color: var(--muted); font-size: 13px; }
textarea { width: 100%; min-height: 110px; border: 1px solid var(--line); border-radius: 8px; padding: 10px; color: var(--ink); resize: vertical; }
.button-row { gap: 10px; }
.primary, .secondary { border: 1px solid transparent; border-radius: 8px; padding: 10px 12px; cursor: pointer; }
.primary { color: #fff; background: var(--accent); }
.secondary { color: var(--ink); border-color: var(--line); background: var(--soft); }
.secondary:disabled { color: #96a0ad; cursor: not-allowed; background: #edf1f5; }
.compact { padding: 7px 10px; white-space: nowrap; }
.result { margin-top: 14px; color: var(--accent-dark); }
.hint { margin: 0 0 12px; color: var(--muted); font-size: 13px; }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { border-bottom: 1px solid var(--line); padding: 11px 8px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 12px; }
@media (max-width: 900px) {
  .shell, .metrics, .split, .detail-grid, .permission-grid { grid-template-columns: 1fr; }
  .topbar, .notice { align-items: flex-start; flex-direction: column; }
}
