/* ============================================================
   智联云 IoT · 控制台样式
   ============================================================ */
:root {
  --bg: #070b14;
  --bg-soft: #0a1120;
  --panel: #0d1626;
  --panel-2: #101c30;
  --panel-hi: #14213a;
  --line: rgba(96, 138, 220, 0.14);
  --line-strong: rgba(96, 138, 220, 0.26);
  --text: #e8eefc;
  --text-2: #c3d0e8;
  --muted: #7d90b3;
  --muted-2: #5d6f8e;
  --accent: #22d3ee;
  --accent-2: #3b82f6;
  --ok: #22c55e;
  --warn: #f59e0b;
  --crit: #f43f5e;
  --info: #60a5fa;
  --radius: 16px;
  --shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.9);
}

* { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Inter", "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  background:
    radial-gradient(900px 500px at 12% -10%, rgba(34, 211, 238, 0.09), transparent 60%),
    radial-gradient(900px 600px at 100% 0%, rgba(59, 130, 246, 0.10), transparent 55%),
    var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
input, select, textarea { font-family: inherit; }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(96, 138, 220, 0.22); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(96, 138, 220, 0.36); }

.hidden { display: none !important; }
.muted { color: var(--muted); }
.mono { font-family: "JetBrains Mono", "SFMono-Regular", Consolas, monospace; font-size: 12.5px; letter-spacing: 0.02em; }
.nowrap { white-space: nowrap; }
.tabular { font-variant-numeric: tabular-nums; }

/* ============================ 登录 ============================ */
.login {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
}

.login-visual {
  position: relative;
  overflow: hidden;
  padding: 46px 54px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: linear-gradient(160deg, #081226 0%, #071626 45%, #050a14 100%);
  border-right: 1px solid var(--line);
}

.login-grid {
  position: absolute;
  inset: -40%;
  background-image:
    linear-gradient(rgba(96, 138, 220, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(96, 138, 220, 0.09) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(circle at 40% 45%, #000 0%, transparent 68%);
  -webkit-mask-image: radial-gradient(circle at 40% 45%, #000 0%, transparent 68%);
  animation: gridDrift 26s linear infinite;
}

@keyframes gridDrift {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(46px, 46px, 0); }
}

.login-glow {
  position: absolute;
  width: 620px; height: 620px;
  right: -160px; top: 40px;
  background: radial-gradient(circle, rgba(34, 211, 238, 0.20), transparent 62%);
  filter: blur(18px);
  pointer-events: none;
}

.login-brand {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo-mark {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 13px;
  color: #06202a;
  background: linear-gradient(140deg, #67e8f9, #22d3ee 45%, #3b82f6);
  box-shadow: 0 8px 22px -8px rgba(34, 211, 238, 0.75);
}
.logo-mark svg { width: 26px; height: 26px; }
.logo-mark.small { width: 38px; height: 38px; border-radius: 11px; }
.logo-mark.small svg { width: 21px; height: 21px; }

.login-brand strong { display: block; font-size: 17px; letter-spacing: 0.04em; }
.login-brand em { display: block; font-style: normal; font-size: 11px; color: var(--muted); letter-spacing: 0.16em; text-transform: uppercase; }

.login-copy { position: relative; margin-top: 40px; }
.login-copy h1 {
  font-size: 42px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: -0.5px;
}
.login-copy h1 span {
  background: linear-gradient(100deg, #67e8f9, #60a5fa 65%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-copy p { margin-top: 18px; max-width: 460px; color: var(--text-2); font-size: 14.5px; text-wrap: pretty; }
.login-points { list-style: none; margin: 30px 0 0; padding: 0; display: grid; gap: 12px; }
.login-points li {
  display: flex; align-items: center; gap: 10px;
  color: var(--muted); font-size: 13px;
}
.login-points li::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}
.login-points b { color: var(--text); font-weight: 600; }

.login-stats {
  position: relative;
  display: flex; gap: 44px;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}
.login-stats b { display: block; font-size: 24px; font-weight: 600; }
.login-stats span { font-size: 12px; color: var(--muted); }

.login-form-wrap {
  display: grid;
  place-items: center;
  padding: 40px 32px;
}

.login-card {
  width: 100%;
  max-width: 380px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.login-card h2 { font-size: 24px; font-weight: 600; }
.login-card h2 + p { font-size: 13px; margin-top: -8px; margin-bottom: 6px; }

.field { display: flex; flex-direction: column; gap: 7px; }
.field > span { font-size: 12.5px; color: var(--muted); }

input, select, textarea {
  width: 100%;
  padding: 11px 13px;
  background: rgba(10, 20, 36, 0.9);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--text);
  font-size: 13.5px;
  outline: none;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
input::placeholder, textarea::placeholder { color: var(--muted-2); }
input:focus, select:focus, textarea:focus {
  border-color: rgba(34, 211, 238, 0.65);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.14);
  background: rgba(12, 24, 42, 0.95);
}
textarea { resize: vertical; min-height: 78px; font-family: "JetBrains Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.6; }
select { appearance: none; cursor: pointer; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 550;
  cursor: pointer;
  transition: transform .15s, box-shadow .2s, background .2s, border-color .2s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
  background: linear-gradient(120deg, #22d3ee, #3b82f6);
  color: #04121c;
  font-weight: 650;
  box-shadow: 0 12px 26px -14px rgba(34, 211, 238, 0.9);
}
.btn-primary:hover { box-shadow: 0 16px 30px -12px rgba(59, 130, 246, 0.9); }

.btn-ghost {
  background: rgba(96, 138, 220, 0.08);
  border-color: var(--line-strong);
  color: var(--text-2);
}
.btn-ghost:hover { background: rgba(96, 138, 220, 0.16); color: var(--text); }

.btn-danger {
  background: rgba(244, 63, 94, 0.12);
  border-color: rgba(244, 63, 94, 0.32);
  color: #fda4af;
}
.btn-danger:hover { background: rgba(244, 63, 94, 0.2); }

.btn-sm { padding: 6px 11px; font-size: 12px; border-radius: 8px; }
.btn-block { width: 100%; padding: 11px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

.form-error { color: #fb7185; font-size: 12.5px; min-height: 16px; margin: -4px 0 0; }
.login-foot { font-size: 11.5px; color: var(--muted-2); text-align: center; margin-top: 2px; }

/* ============================ 框架 ============================ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 222px;
  flex: 0 0 222px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 14px;
  background: linear-gradient(180deg, #0a1424, #080e1a);
  border-right: 1px solid var(--line);
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 20;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 6px 18px; }
.brand-text strong { display: block; font-size: 14.5px; letter-spacing: .02em; }
.brand-text em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); letter-spacing: .1em; }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  transition: background .18s, color .18s;
}
.nav-item svg { width: 18px; height: 18px; flex: 0 0 18px; }
.nav-item:hover { background: rgba(96, 138, 220, 0.08); color: var(--text-2); }
.nav-item.active {
  color: #ecfeff;
  background: linear-gradient(100deg, rgba(34, 211, 238, 0.16), rgba(59, 130, 246, 0.10));
  box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.18);
}
.nav-item.active::before {
  content: "";
  position: absolute; left: -14px; top: 50%;
  width: 3px; height: 18px; margin-top: -9px;
  border-radius: 0 3px 3px 0;
  background: linear-gradient(180deg, #67e8f9, #3b82f6);
}
.nav-badge {
  margin-left: auto;
  min-width: 19px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(244, 63, 94, 0.18);
  color: #fda4af;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.sidebar-foot { margin-top: auto; padding: 12px 6px 4px; border-top: 1px solid var(--line); }
.mqtt-state { display: flex; align-items: center; gap: 10px; }
.mqtt-state b { display: block; font-size: 12px; font-weight: 550; }
.mqtt-state em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted-2); }

.live-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
  animation: livePulse 2.2s infinite;
  flex: 0 0 8px;
}
@keyframes livePulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5); }
  70% { box-shadow: 0 0 0 8px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 26px;
  background: rgba(8, 14, 26, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.page-title h1 { font-size: 19px; font-weight: 600; letter-spacing: .01em; }
.page-title p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.topbar-right { display: flex; align-items: center; gap: 10px; }

.mode-badge {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  color: #67e8f9;
  background: rgba(34, 211, 238, 0.10);
  border: 1px solid rgba(34, 211, 238, 0.25);
}

.icon-btn {
  position: relative;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(96, 138, 220, 0.06);
  color: var(--muted);
  cursor: pointer;
  transition: all .18s;
}
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn:hover { color: var(--text); border-color: var(--line-strong); background: rgba(96, 138, 220, 0.14); }
.icon-btn .badge {
  position: absolute; top: -5px; right: -5px;
  min-width: 17px; height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--crit);
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 600;
  display: grid; place-items: center;
  box-shadow: 0 0 0 2px #0a1120;
}

.user-chip { display: flex; align-items: center; gap: 9px; padding: 4px 10px 4px 4px; border-radius: 999px; border: 1px solid var(--line); }
.user-chip .avatar {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(140deg, rgba(34, 211, 238, .9), rgba(59, 130, 246, .9));
  color: #041220;
  font-size: 12px;
  font-weight: 700;
}
.user-meta b { display: block; font-size: 12.5px; line-height: 1.2; }
.user-meta em { display: block; font-style: normal; font-size: 10.5px; color: var(--muted); }

.view { padding: 22px 26px 48px; max-width: 1640px; width: 100%; }

/* ============================ 通用块 ============================ */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 26px 0 14px; }
.section-head h2 { font-size: 15px; font-weight: 600; }
.section-head p { font-size: 12px; color: var(--muted); margin-top: 2px; }

.panel {
  background: linear-gradient(180deg, rgba(17, 28, 48, 0.92), rgba(11, 19, 33, 0.96));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.03);
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 18px 12px;
}
.panel-head h3 { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.panel-head .hint { font-size: 11.5px; color: var(--muted); }
.panel-body { padding: 0 18px 16px; }
.panel-body.flush { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }

.stat {
  position: relative;
  padding: 16px 18px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    radial-gradient(420px 140px at 100% 0%, rgba(34, 211, 238, 0.10), transparent 70%),
    linear-gradient(180deg, rgba(17, 28, 48, 0.95), rgba(11, 19, 33, 0.98));
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, border-color .2s;
}
.stat:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.stat-top { display: flex; align-items: center; justify-content: space-between; }
.stat-label { font-size: 12.5px; color: var(--muted); }
.stat-icon {
  width: 30px; height: 30px;
  display: grid; place-items: center;
  border-radius: 9px;
  background: rgba(34, 211, 238, 0.10);
  color: #67e8f9;
}
.stat-icon svg { width: 16px; height: 16px; }
.stat-value { margin-top: 10px; font-size: 30px; font-weight: 620; letter-spacing: -0.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-foot { margin-top: 8px; display: flex; align-items: center; gap: 8px; font-size: 11.5px; color: var(--muted); }
.stat-foot .up { color: #4ade80; }
.stat-foot .down { color: #fb7185; }
.stat-spark { position: absolute; right: 0; bottom: 0; width: 110px; height: 44px; opacity: .7; }

.grid-2 { display: grid; grid-template-columns: 1.6fr 1fr; gap: 14px; margin-top: 14px; }
.grid-3 { display: grid; grid-template-columns: 1.55fr 1fr; gap: 14px; margin-top: 14px; }
.grid-main { display: grid; grid-template-columns: 1fr 380px; gap: 14px; }

/* ============================ 图表 ============================ */
.chart-wrap { position: relative; height: 250px; }
.chart-wrap.sm { height: 190px; }
.chart-wrap canvas { width: 100%; height: 100%; display: block; }

.legend { display: flex; flex-wrap: wrap; gap: 14px; padding: 6px 18px 16px; }
.legend-item { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.legend-item i { width: 9px; height: 9px; border-radius: 3px; }
.legend-item b { color: var(--text); font-weight: 550; font-variant-numeric: tabular-nums; }

.donut-center { font-size: 12px; }

/* ============================ 表格 ============================ */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13px; }
table.data th {
  text-align: left;
  padding: 10px 16px;
  font-size: 11px;
  font-weight: 550;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted-2);
  background: rgba(9, 16, 28, 0.6);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(96, 138, 220, 0.08);
  color: var(--text-2);
  vertical-align: middle;
}
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: rgba(96, 138, 220, 0.06); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data td .primary { color: var(--text); font-weight: 550; }
table.data td .sub { font-size: 11.5px; color: var(--muted-2); margin-top: 2px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.pill i { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.online { color: #4ade80; background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.24); }
.pill.online i { animation: livePulse 2.2s infinite; }
.pill.offline { color: #94a3b8; background: rgba(148, 163, 184, 0.10); border-color: rgba(148, 163, 184, 0.22); }
.pill.never { color: #94a3b8; background: rgba(148, 163, 184, 0.06); border-color: rgba(148, 163, 184, 0.16); }
.pill.critical { color: #fb7185; background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.3); }
.pill.warn { color: #fbbf24; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.28); }
.pill.info { color: #7dd3fc; background: rgba(56, 189, 248, 0.10); border-color: rgba(56, 189, 248, 0.24); }
.pill.success { color: #4ade80; background: rgba(34, 197, 94, 0.10); border-color: rgba(34, 197, 94, 0.24); }
.pill.pending { color: #fbbf24; background: rgba(245, 158, 11, 0.10); border-color: rgba(245, 158, 11, 0.24); }
.pill.neutral { color: var(--muted); background: rgba(148, 163, 184, 0.10); border-color: rgba(148, 163, 184, 0.2); }

.row-actions { display: flex; gap: 6px; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
}
.toolbar .grow { flex: 1; }
.toolbar input, .toolbar select { width: auto; min-width: 140px; }
.toolbar .search { min-width: 220px; }

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
}
.pager-btns { display: flex; gap: 6px; }

/* ============================ 实时流 ============================ */
.ticker { display: flex; flex-direction: column; }
.ticker-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  border-bottom: 1px solid rgba(96, 138, 220, 0.07);
  font-size: 12.5px;
  animation: fadeUp .35s ease;
}
.ticker-row:last-child { border-bottom: none; }
.ticker-row .t-key { color: var(--muted); font-size: 11px; }
.ticker-row .t-val { margin-left: auto; color: #67e8f9; font-variant-numeric: tabular-nums; }
.ticker-row .t-name { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================ 产品卡片 ============================ */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.product-card {
  position: relative;
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 28, 48, 0.9), rgba(11, 19, 33, 0.96));
  transition: transform .18s, border-color .18s;
}
.product-card:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.product-card .pc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.product-card h3 { font-size: 14.5px; font-weight: 600; }
.product-card .pc-key { font-size: 11.5px; color: var(--muted-2); margin-top: 3px; }
.product-card .pc-desc { margin-top: 12px; font-size: 12.5px; color: var(--muted); min-height: 38px; line-height: 1.55; }
.product-card .pc-foot { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.product-card .pc-foot b { color: var(--text); font-size: 15px; font-weight: 600; }

.proto {
  font-size: 10.5px;
  letter-spacing: .08em;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(59, 130, 246, 0.12);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #93c5fd;
}

/* ============================ 标签页 ============================ */
.tabs { display: flex; gap: 6px; padding: 4px; border-radius: 11px; background: rgba(9, 16, 28, 0.7); border: 1px solid var(--line); width: fit-content; }
.tabs button {
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  transition: all .18s;
}
.tabs button.active { background: rgba(34, 211, 238, 0.14); color: #a5f3fc; box-shadow: inset 0 0 0 1px rgba(34, 211, 238, 0.22); }

/* ============================ 抽屉 ============================ */
.drawer-mask {
  position: fixed; inset: 0;
  background: rgba(3, 7, 14, 0.6);
  backdrop-filter: blur(3px);
  z-index: 40;
  animation: fadeIn .2s ease;
}
.drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(580px, 100vw);
  background: linear-gradient(180deg, #0b1526, #080e1a);
  border-left: 1px solid var(--line-strong);
  z-index: 41;
  display: flex;
  flex-direction: column;
  animation: slideIn .26s cubic-bezier(.22, .8, .3, 1);
  box-shadow: -30px 0 60px -30px rgba(0, 0, 0, 0.9);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: .4; } to { transform: none; opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 20px 12px; }
.drawer-head h2 { font-size: 17px; font-weight: 600; }
.drawer-head p { margin-top: 4px; }
.drawer-tabs { display: flex; gap: 4px; padding: 0 20px; border-bottom: 1px solid var(--line); }
.drawer-tabs button {
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all .18s;
}
.drawer-tabs button.active { color: #a5f3fc; border-bottom-color: var(--accent); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 20px 30px; }

.kv { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kv-item { padding: 11px 13px; border-radius: 10px; background: rgba(96, 138, 220, 0.06); border: 1px solid var(--line); }
.kv-item span { display: block; font-size: 11px; color: var(--muted-2); }
.kv-item b { display: block; margin-top: 3px; font-size: 13px; font-weight: 550; word-break: break-all; }

.prop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.prop-card {
  padding: 13px 14px;
  border-radius: 12px;
  background:
    radial-gradient(220px 90px at 100% 0%, rgba(34, 211, 238, 0.10), transparent 70%),
    rgba(96, 138, 220, 0.06);
  border: 1px solid var(--line);
}
.prop-card span { font-size: 11.5px; color: var(--muted); display: block; }
.prop-card b { display: block; margin-top: 6px; font-size: 21px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prop-card b em { font-style: normal; font-size: 11.5px; color: var(--muted); margin-left: 3px; font-weight: 400; }

.timeline { position: relative; padding-left: 18px; }
.timeline::before { content: ""; position: absolute; left: 4px; top: 4px; bottom: 4px; width: 1px; background: var(--line-strong); }
.timeline-item { position: relative; padding: 0 0 16px 0; }
.timeline-item::before {
  content: ""; position: absolute; left: -18px; top: 5px;
  width: 9px; height: 9px; border-radius: 50%;
  background: #0b1526; border: 2px solid var(--accent-2);
}
.timeline-item.online::before { border-color: var(--ok); }
.timeline-item.offline::before { border-color: var(--muted); }
.timeline-item b { font-size: 12.5px; font-weight: 550; }
.timeline-item p { font-size: 12px; color: var(--muted); margin-top: 2px; }
.timeline-item time { font-size: 11px; color: var(--muted-2); }

/* ============================ 弹窗 ============================ */
.modal-mask {
  position: fixed; inset: 0; z-index: 60;
  display: grid; place-items: center;
  background: rgba(3, 7, 14, 0.66);
  backdrop-filter: blur(4px);
  padding: 20px;
  animation: fadeIn .18s ease;
}
.modal {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(180deg, #0d1829, #0a1120);
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 1);
  animation: modalIn .22s cubic-bezier(.22, .8, .3, 1);
}
@keyframes modalIn { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head { padding: 18px 20px 0; display: flex; align-items: flex-start; justify-content: space-between; }
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head p { font-size: 12px; color: var(--muted); margin-top: 3px; }
.modal-body { padding: 16px 20px; display: grid; gap: 12px; }
.modal-foot { padding: 4px 20px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid .full { grid-column: 1 / -1; }

/* ============================ 提示 ============================ */
.toasts { position: fixed; right: 22px; bottom: 22px; z-index: 80; display: flex; flex-direction: column; gap: 10px; }
.toast {
  min-width: 240px;
  max-width: 380px;
  padding: 12px 14px;
  border-radius: 11px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 22, 38, 0.96);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.95);
  font-size: 12.5px;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  animation: toastIn .25s cubic-bezier(.22, .8, .3, 1);
}
.toast.out { animation: toastOut .25s forwards; }
.toast .t-dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 5px; flex: 0 0 7px; background: var(--accent); }
.toast.error .t-dot { background: var(--crit); }
.toast.warn .t-dot { background: var(--warn); }
.toast.success .t-dot { background: var(--ok); }
.toast b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.toast span { color: var(--muted); font-size: 11.5px; }
@keyframes toastIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(20px); } }

.empty { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 12.5px; }
.empty b { display: block; color: var(--text-2); font-size: 13.5px; margin-bottom: 4px; }

.skeleton {
  background: linear-gradient(90deg, rgba(96,138,220,.06), rgba(96,138,220,.14), rgba(96,138,220,.06));
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ============================ 指令表单 ============================ */
.cmd-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cmd-chip {
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: rgba(96, 138, 220, 0.07);
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  transition: all .16s;
}
.cmd-chip:hover { border-color: rgba(34, 211, 238, .5); color: #a5f3fc; background: rgba(34, 211, 238, .1); }
.cmd-chip.active { border-color: rgba(34, 211, 238, .6); background: rgba(34, 211, 238, .14); color: #a5f3fc; }

.result-box {
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(2, 8, 18, 0.7);
  border: 1px dashed var(--line-strong);
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11.5px;
  color: #7dd3fc;
  white-space: pre-wrap;
  word-break: break-all;
  min-height: 62px;
}

/* ============================ 响应式 ============================ */
@media (max-width: 1280px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-main { grid-template-columns: 1fr; }
}

@media (max-width: 980px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { display: none; }
  .sidebar { width: 66px; flex: 0 0 66px; padding: 16px 10px; }
  .brand-text, .nav-item span, .sidebar-foot, .nav-badge { display: none; }
  .brand { justify-content: center; padding: 4px 0 16px; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item.active::before { display: none; }
  .topbar { padding: 12px 16px; }
  .view { padding: 16px 16px 40px; }
  .user-meta { display: none; }
  .mode-badge { display: none; }
}

@media (max-width: 620px) {
  .stat-grid { grid-template-columns: 1fr; }
  .page-title p { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .kv { grid-template-columns: 1fr; }
}

/* ============================================================
   实时监控大屏
   ============================================================ */
body.screen-mode .sidebar,
body.screen-mode .topbar { display: none; }
body.screen-mode .view { padding: 16px 18px 28px; max-width: none; }
body.screen-mode .main { min-height: 100vh; }

.screen { display: flex; flex-direction: column; gap: 14px; }

.screen-head {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  padding: 14px 20px; border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(600px 120px at 0% 0%, rgba(34, 211, 238, 0.16), transparent 70%),
    linear-gradient(180deg, rgba(16, 28, 48, 0.96), rgba(9, 16, 29, 0.98));
  box-shadow: var(--shadow);
}
.screen-brand { display: flex; align-items: center; gap: 12px; }
.screen-brand strong { display: block; font-size: 16px; letter-spacing: .4px; }
.screen-brand em { font-style: normal; font-size: 11.5px; color: var(--muted); letter-spacing: 1.5px; text-transform: uppercase; }
.screen-clock { display: flex; flex-direction: column; align-items: center; line-height: 1.25; }
.screen-clock b { font-size: 24px; letter-spacing: 2px; color: var(--accent); font-variant-numeric: tabular-nums; }
.screen-clock span { font-size: 11.5px; color: var(--muted); }
.screen-actions { display: flex; align-items: center; gap: 12px; }
.screen-live {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ok);
  padding: 5px 11px; border-radius: 999px; border: 1px solid rgba(34, 197, 94, .35);
  background: rgba(34, 197, 94, .1);
}
.screen-live i { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); animation: pulseDot 1.6s infinite; }

.screen-kpis { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.kpi {
  position: relative; padding: 14px 16px; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 28, 48, 0.95), rgba(10, 17, 30, 0.98));
}
.kpi::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--kpi, var(--accent));
  opacity: .85;
}
.kpi span { font-size: 12px; color: var(--muted); }
.kpi b {
  display: block; font-size: 26px; line-height: 1.25; font-variant-numeric: tabular-nums;
  color: var(--kpi, var(--text));
}
.kpi em { font-style: normal; font-size: 11.5px; color: var(--muted-2); }

.screen-grid { display: grid; grid-template-columns: 300px minmax(0, 1fr) 330px; gap: 14px; align-items: stretch; }
.sc-col { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.s-panel {
  display: flex; flex-direction: column; gap: 10px; padding: 14px 16px 16px;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 25, 43, 0.94), rgba(9, 16, 28, 0.97));
  box-shadow: var(--shadow); min-width: 0;
}
.s-panel.grow { flex: 1; }
.s-panel h3 {
  margin: 0; font-size: 13px; font-weight: 600; letter-spacing: .3px;
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
}
.s-panel h3 em { font-style: normal; font-size: 11px; font-weight: 400; color: var(--muted-2); }
.s-panel.grow canvas { flex: 1; min-height: 230px; width: 100%; display: block; }

.s-donut { position: relative; height: 168px; }
.s-donut canvas { width: 100%; height: 100%; display: block; }
.s-donut-center {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; pointer-events: none;
}
.s-donut-center b { font-size: 26px; color: var(--accent); font-variant-numeric: tabular-nums; }
.s-donut-center span { font-size: 11.5px; color: var(--muted); }

.s-legend { display: flex; flex-wrap: wrap; gap: 10px 16px; font-size: 12px; color: var(--muted); }
.s-legend span { display: inline-flex; align-items: center; gap: 6px; }
.s-legend i { width: 8px; height: 8px; border-radius: 3px; }

.s-bars, .s-sites { display: flex; flex-direction: column; gap: 9px; }
.s-bar, .s-site { display: grid; grid-template-columns: 92px minmax(0, 1fr) 42px; align-items: center; gap: 10px; font-size: 12px; }
.s-site { grid-template-columns: 104px minmax(0, 1fr) 54px; }
.s-bar span, .s-site span { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.s-bar b, .s-site b { text-align: right; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 500; }
.s-bar-track { height: 7px; border-radius: 99px; background: rgba(96, 138, 220, .14); overflow: hidden; }
.s-bar-track i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #22d3ee, #3b82f6); }

.s-feed { display: flex; flex-direction: column; gap: 2px; max-height: 268px; overflow: auto; }
.s-feed-row {
  display: grid; grid-template-columns: 6px minmax(0, 1fr) auto; align-items: start; gap: 9px;
  padding: 8px 2px; border-bottom: 1px dashed rgba(96, 138, 220, .12);
}
.s-feed-row:last-child { border-bottom: none; }
.s-feed-row > i { width: 6px; height: 6px; border-radius: 50%; margin-top: 6px; }
.s-feed-row b { display: block; font-size: 12.5px; font-weight: 550; }
.s-feed-row span {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
  overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.s-feed-row em { font-style: normal; font-size: 11px; color: var(--muted-2); white-space: nowrap; }

/* ============================================================
   审计 / 开放平台 通用小件
   ============================================================ */
.tag {
  display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 6px;
  color: var(--tag, var(--muted));
  background: color-mix(in srgb, var(--tag, #7d90b3) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--tag, #7d90b3) 32%, transparent);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
}
.stat { border-top-color: var(--accent, var(--line)); }

.hook-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 13px 15px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(14, 24, 41, .75);
}
.hook-main { min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.hook-title { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.hook-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: 11.5px; color: var(--muted-2); }

.code-block {
  margin: 8px 0 0; padding: 12px 14px; border-radius: 10px;
  background: rgba(6, 12, 22, .86); border: 1px solid var(--line);
  font-family: ui-monospace, "SFMono-Regular", Menlo, monospace;
  font-size: 12px; line-height: 1.6; color: var(--text-2);
  overflow: auto; white-space: pre-wrap; word-break: break-word;
}

@media (max-width: 1400px) {
  .screen-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .screen-grid { grid-template-columns: 1fr; }
  .s-panel.grow canvas { min-height: 200px; }
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: .45; transform: scale(.82); }
}

/* ============================================================
   项目文档（README 查看页）
   ============================================================ */

/* ---------------- 密码门 ---------------- */
.readme-gate {
  min-height: calc(100vh - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}

.gate-card {
  width: 392px;
  max-width: 100%;
  background: linear-gradient(180deg, var(--panel-2), var(--panel));
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 34px 30px 24px;
  box-shadow: var(--shadow);
  text-align: center;
}

.gate-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.26);
}

.gate-icon svg { width: 28px; height: 28px; }

.gate-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 650;
  color: var(--text);
}

.gate-desc {
  margin: 0 0 20px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
}

.gate-field { margin-bottom: 12px; }

.gate-field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  font-size: 14px;
  letter-spacing: 2px;
  text-align: center;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  outline: none;
  transition: border-color .18s, box-shadow .18s;
}

.gate-field input::placeholder { letter-spacing: 0; color: var(--muted-2); }

.gate-field input:focus {
  border-color: rgba(34, 211, 238, 0.6);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.gate-error {
  min-height: 18px;
  margin: 12px 0 0;
  font-size: 12.5px;
  color: var(--crit);
}

.gate-hint {
  margin: 14px 0 0;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--muted-2);
}

.gate-hint code {
  padding: 1px 5px;
  border-radius: 4px;
  background: rgba(96, 138, 220, 0.14);
  font-size: 11px;
}

.shake { animation: gateShake .42s cubic-bezier(.36, .07, .19, .97); }

@keyframes gateShake {
  10%, 90% { transform: translateX(-2px); }
  20%, 80% { transform: translateX(4px); }
  30%, 50%, 70% { transform: translateX(-7px); }
  40%, 60% { transform: translateX(7px); }
}

/* ---------------- 文档布局 ---------------- */
.readme-wrap {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.readme-side {
  position: sticky;
  top: 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  max-height: calc(100vh - 132px);
  overflow: hidden;
}

.readme-side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-2);
}

.readme-side-head b { font-weight: 600; }
.readme-side-head .muted { font-size: 11.5px; }

.readme-toc {
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow-y: auto;
  padding-right: 4px;
  flex: 1;
  min-height: 60px;
}

.readme-toc::-webkit-scrollbar { width: 5px; }
.readme-toc::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 3px; }

.toc-item {
  display: block;
  padding: 6px 9px;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--muted);
  border-radius: 7px;
  border-left: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: color .16s, background .16s, border-color .16s;
}

.toc-item:hover { color: var(--text); background: rgba(96, 138, 220, 0.08); }

.toc-item.lv3 { padding-left: 20px; font-size: 12px; color: var(--muted-2); }

.toc-item.active {
  color: var(--accent);
  background: rgba(34, 211, 238, 0.08);
  border-left-color: var(--accent);
}

.readme-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px 0 0;
  border-top: 1px dashed var(--line);
}

.readme-meta > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 11.5px;
}

.readme-meta span { color: var(--muted-2); flex: none; }

.readme-meta b {
  font-weight: 500;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readme-side-foot {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ---------------- 正文 ---------------- */
.readme-main {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.readme-bar {
  position: sticky;
  top: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 18px;
  background: rgba(13, 22, 38, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.readme-crumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  min-width: 0;
}

.readme-crumb b {
  font-weight: 600;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readme-crumb svg { width: 14px; height: 14px; color: var(--muted-2); flex: none; }

.readme-actions { display: flex; align-items: center; gap: 10px; flex: none; }

.readme-stat { font-size: 11.5px; color: var(--muted-2); }

.readme-body {
  padding: 26px 34px 60px;
  font-size: 14px;
  line-height: 1.78;
  color: var(--text-2);
  max-width: 1020px;
  overflow-wrap: break-word;
}

/* ---------------- Markdown 元素 ---------------- */
.readme-body h1,
.readme-body h2,
.readme-body h3,
.readme-body h4,
.readme-body h5,
.readme-body h6 {
  color: var(--text);
  font-weight: 650;
  line-height: 1.4;
  scroll-margin-top: 74px;
}

.readme-body h1 {
  margin: 4px 0 20px;
  font-size: 26px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.readme-body h2 {
  margin: 36px 0 14px;
  font-size: 20px;
  padding-left: 11px;
  border-left: 3px solid var(--accent);
}

.readme-body h3 {
  margin: 26px 0 10px;
  font-size: 16px;
  color: var(--text);
}

.readme-body h4 { margin: 20px 0 8px; font-size: 14.5px; }

.readme-body p { margin: 0 0 13px; }

.readme-body a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(34, 211, 238, 0.35);
}

.readme-body a:hover { border-bottom-color: var(--accent); }

.readme-body strong { color: var(--text); font-weight: 600; }

.readme-body code {
  padding: 1.5px 6px;
  font-family: "JetBrains Mono", "Cascadia Code", Consolas, monospace;
  font-size: 12.5px;
  color: #7dd3fc;
  background: rgba(96, 138, 220, 0.14);
  border-radius: 5px;
}

.readme-body .md-list { margin: 0 0 14px; padding-left: 22px; }

.readme-body .md-list li { margin: 5px 0; }
.readme-body .md-list li::marker { color: var(--muted-2); }

.readme-body .md-quote {
  margin: 0 0 16px;
  padding: 12px 16px;
  background: rgba(96, 138, 220, 0.06);
  border-left: 3px solid var(--line-strong);
  border-radius: 0 8px 8px 0;
  color: var(--muted);
}

.readme-body .md-quote p:last-child { margin-bottom: 0; }

.readme-body .md-hr {
  margin: 26px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* 代码块 */
.readme-body .md-code {
  position: relative;
  margin: 0 0 16px;
  padding: 14px 16px;
  background: #060a12;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow-x: auto;
  font-size: 12.8px;
  line-height: 1.65;
}

.readme-body .md-code code {
  padding: 0;
  background: none;
  color: #b8c7e0;
  font-size: inherit;
  white-space: pre;
}

.readme-body .md-code[data-lang]::before {
  content: attr(data-lang);
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted-2);
  user-select: none;
}

.readme-body .md-code[data-lang] { padding-top: 26px; }

.md-copy {
  position: absolute;
  top: 7px;
  right: 9px;
  padding: 3px 9px;
  font-size: 11px;
  color: var(--muted);
  background: rgba(96, 138, 220, 0.12);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  opacity: 0;
  user-select: none;
  transition: opacity .16s, color .16s;
}

.readme-body .md-code:hover .md-copy { opacity: 1; }
.md-copy:hover { color: var(--accent); }

/* 表格 */
.readme-body .md-table-wrap {
  margin: 0 0 18px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.readme-body .md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.readme-body .md-table th {
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  color: var(--text);
  background: rgba(96, 138, 220, 0.08);
  border-bottom: 1px solid var(--line-strong);
  white-space: nowrap;
}

.readme-body .md-table td {
  padding: 9px 14px;
  border-bottom: 1px solid rgba(96, 138, 220, 0.08);
  vertical-align: top;
}

.readme-body .md-table tbody tr:last-child td { border-bottom: 0; }
.readme-body .md-table tbody tr:hover td { background: rgba(96, 138, 220, 0.05); }

/* ---------------- 响应式 ---------------- */
@media (max-width: 1180px) {
  .readme-wrap { grid-template-columns: 1fr; }
  .readme-side {
    position: static;
    max-height: none;
    flex-direction: column;
  }
  .readme-toc {
    flex-direction: row;
    flex-wrap: wrap;
    max-height: 132px;
    overflow-y: auto;
  }
  .toc-item.lv3 { padding-left: 9px; }
  .readme-side-foot { flex-direction: row; }
}

@media (max-width: 720px) {
  .readme-body { padding: 18px 16px 44px; }
  .readme-body h1 { font-size: 22px; }
  .readme-bar { padding: 10px 12px; }
  .readme-stat { display: none; }
}

/* 未登录直接访问 /readme 时的独立模式：隐藏侧边栏与顶栏，全宽展示文档 */
body.readme-standalone .sidebar,
body.readme-standalone .topbar {
  display: none;
}

body.readme-standalone .main {
  width: 100%;
}

body.readme-standalone #view {
  max-width: 1320px;
  margin: 0 auto;
  width: 100%;
}

.gate-back {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--muted-2);
  text-decoration: none;
  border-bottom: 1px dashed var(--line-strong);
  padding-bottom: 1px;
}

.gate-back:hover { color: var(--accent); border-bottom-color: var(--accent); }

.readme-body img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
  border-radius: 4px;
}
