:root {
  --bg: #080b0e;
  --panel: #0f1418;
  --panel-2: #141b20;
  --panel-3: #1a2329;
  --line: #273137;
  --line-strong: #3a474e;
  --text: #edf2ea;
  --muted: #a8b3b4;
  --faint: #748186;
  --acid: #c7f36b;
  --acid-2: #8fcb37;
  --cyan: #6dd9d0;
  --warning: #ffba66;
  --danger: #ff6f61;
  --ok: #80da85;
  --label: #c4cecd;
  --input-bg: #0c1114;
  --input-focus: #10161a;
  --soft-bg: #0d1215;
  --sidebar-bg: rgba(10, 14, 17, .96);
  --topbar-bg: rgba(8, 11, 14, .9);
  --terminal-bg: #080c0e;
  --terminal-text: #d4ddda;
  --modal-bg: #10161a;
  --overlay: rgba(2, 5, 7, .76);
  --shadow: 0 28px 80px rgba(0, 0, 0, .34);
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
  --sans: "Microsoft YaHei UI", "PingFang SC", "Segoe UI Variable", sans-serif;
}

:root[data-theme="light"] {
  --bg: #f3f2ec;
  --panel: #ffffff;
  --panel-2: #f6f6f1;
  --panel-3: #ebece5;
  --line: #d7d9d2;
  --line-strong: #b8beb7;
  --text: #111713;
  --muted: #4f5e59;
  --faint: #6f7b77;
  --acid: #6d981c;
  --acid-2: #537d0d;
  --cyan: #087d76;
  --warning: #9b5700;
  --danger: #b7352b;
  --ok: #21792f;
  --label: #303c38;
  --input-bg: #fbfcf8;
  --input-focus: #ffffff;
  --soft-bg: #f7f7f2;
  --sidebar-bg: rgba(250, 250, 247, .97);
  --topbar-bg: rgba(255, 255, 252, .92);
  --terminal-bg: #ffffff;
  --terminal-text: #1d2824;
  --modal-bg: #ffffff;
  --overlay: rgba(24, 31, 27, .42);
  --shadow: 0 28px 80px rgba(31, 39, 34, .18);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, .018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .018) 1px, transparent 1px),
    radial-gradient(circle at 85% -10%, rgba(199, 243, 107, .08), transparent 30%),
    var(--bg);
  background-size: 36px 36px, 36px 36px, auto, auto;
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button { color: inherit; }
a { color: var(--acid); }
::selection { color: #101509; background: var(--acid); }
:focus-visible { outline: 2px solid var(--acid); outline-offset: 2px; }

.skip-link {
  position: fixed;
  left: 12px;
  top: -60px;
  z-index: 100;
  background: var(--acid);
  color: #111;
  padding: 10px 14px;
}
.skip-link:focus { top: 12px; }

.app-loading {
  display: grid;
  min-height: 100vh;
  place-items: center;
  color: var(--muted);
  font-family: var(--mono);
  letter-spacing: .08em;
}
.pulse-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 10px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 0 rgba(199, 243, 107, .5);
  animation: pulse 1.5s infinite;
}
@keyframes pulse { 70% { box-shadow: 0 0 0 10px rgba(199, 243, 107, 0); } }

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(390px, .85fr);
  min-height: 100vh;
}
.login-visual {
  position: relative;
  display: flex;
  min-height: 640px;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  padding: clamp(32px, 6vw, 88px);
  border-right: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(199, 243, 107, .09), transparent 44%),
    var(--input-bg);
}
.login-visual::after {
  position: absolute;
  right: -16%;
  bottom: -12%;
  width: min(55vw, 680px);
  aspect-ratio: 1;
  border: 1px solid rgba(199, 243, 107, .2);
  border-radius: 50%;
  box-shadow: inset 0 0 0 36px rgba(199, 243, 107, .018), inset 0 0 0 72px rgba(199, 243, 107, .018);
  content: "";
}
.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand-mark {
  position: relative;
  display: grid;
  width: 35px;
  height: 35px;
  place-items: center;
  border: 1px solid var(--acid);
  color: var(--acid);
  font: 700 15px/1 var(--mono);
  transform: rotate(45deg);
}
.brand-mark span { transform: rotate(-45deg); }
.brand-name { font: 650 17px/1 var(--mono); letter-spacing: .08em; }
.brand-tag { color: var(--faint); font: 11px/1.4 var(--mono); text-transform: uppercase; }
.login-copy { position: relative; z-index: 1; max-width: 740px; }
.eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--acid);
  font: 600 11px/1.3 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
}
.eyebrow::before { width: 28px; height: 1px; background: currentColor; content: ""; }
.login-copy h1 {
  max-width: 740px;
  margin: 0 0 22px;
  font-size: clamp(44px, 6vw, 86px);
  font-weight: 620;
  letter-spacing: -.055em;
  line-height: .98;
}
.login-copy p { max-width: 600px; margin: 0; color: var(--muted); font-size: 16px; line-height: 1.8; }
.login-meta {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 28px;
  color: var(--faint);
  font: 11px/1.4 var(--mono);
}
.login-meta span::before { color: var(--acid); content: "// "; }
.login-panel {
  display: grid;
  place-items: center;
  padding: 38px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(20px);
}
.login-box { width: min(100%, 430px); }
.login-box h2 { margin: 0 0 9px; font-size: 27px; font-weight: 620; letter-spacing: -.03em; }
.login-box > p { margin: 0 0 34px; color: var(--muted); line-height: 1.65; }

.field { display: grid; gap: 8px; margin-bottom: 18px; }
.field > label,
.field-label {
  color: var(--label);
  font-size: 12px;
  font-weight: 620;
  letter-spacing: .02em;
}
.field small { color: var(--faint); font-size: 11px; line-height: 1.5; }
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  background: var(--input-bg);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input, .select { height: 44px; padding: 0 13px; }
.textarea { min-height: 118px; padding: 12px 13px; line-height: 1.55; resize: vertical; }
.input::placeholder, .textarea::placeholder { color: var(--faint); opacity: .78; }
.input:focus, .select:focus, .textarea:focus {
  border-color: rgba(199, 243, 107, .65);
  outline: 0;
  background: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(199, 243, 107, .08);
}
.input.mono, .textarea.mono { font-family: var(--mono); font-size: 12px; }
.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  color: var(--text);
  background: var(--panel-2);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform .15s, background .15s, border-color .15s, color .15s;
}
.btn:hover { border-color: #56636a; background: var(--panel-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .48; cursor: not-allowed; }
.btn-primary { border-color: var(--acid); color: #11170a; background: var(--acid); }
.btn-primary:hover { border-color: #d7ff88; background: #d7ff88; }
.btn-danger { border-color: rgba(255, 111, 97, .34); color: #ff9389; background: rgba(255, 111, 97, .08); }
.btn-ghost { border-color: transparent; background: transparent; }
.btn-wide { width: 100%; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }

.shell { display: grid; grid-template-columns: 238px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 23px 16px 16px;
  border-right: 1px solid var(--line);
  background: var(--sidebar-bg);
  backdrop-filter: blur(18px);
}
.sidebar .brand { padding: 0 8px 28px; }
.nav-label { margin: 14px 10px 8px; color: var(--faint); font: 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; }
.nav { display: grid; gap: 3px; }
.nav-btn {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  gap: 12px;
  padding: 0 11px;
  border: 1px solid transparent;
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}
.nav-btn:hover { color: var(--text); background: rgba(255, 255, 255, .025); }
.nav-btn.active { border-color: rgba(199, 243, 107, .14); color: var(--acid); background: rgba(199, 243, 107, .07); }
.nav-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; }
.nav-count { margin-left: auto; color: var(--faint); font: 11px/1 var(--mono); }
.sidebar-bottom { display: grid; gap: 10px; margin-top: auto; }
.system-mini {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--soft-bg);
}
.system-mini-line { display: flex; align-items: center; gap: 8px; color: var(--muted); font: 11px/1.5 var(--mono); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 8px rgba(128, 218, 133, .45); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 8px; }
.avatar { display: grid; width: 33px; height: 33px; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--panel-2); font: 650 12px/1 var(--mono); }
.user-meta { min-width: 0; flex: 1; }
.user-name { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.user-role { color: var(--faint); font: 10px/1.5 var(--mono); text-transform: uppercase; }

.main { min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  height: 69px;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(20px, 3vw, 42px);
  border-bottom: 1px solid var(--line);
  background: var(--topbar-bg);
  backdrop-filter: blur(18px);
}
.breadcrumbs { color: var(--muted); font: 11px/1 var(--mono); }
.breadcrumbs b { color: var(--text); font-weight: 550; }
.top-actions { display: flex; align-items: center; gap: 9px; }
.menu-toggle { display: none; }
.content { width: 100%; max-width: 1540px; margin: 0 auto; padding: clamp(24px, 3.2vw, 46px); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 31px; }
.page-head h1 { margin: 0 0 8px; font-size: clamp(27px, 3vw, 39px); font-weight: 600; letter-spacing: -.045em; }
.page-head p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.page-actions { display: flex; flex-wrap: wrap; gap: 9px; }

.grid { display: grid; gap: 16px; }
.stats-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 17px; }
.stat-card {
  position: relative;
  min-height: 146px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(255,255,255,.018), transparent), var(--panel);
}
.stat-card::after {
  position: absolute;
  right: 14px;
  bottom: 11px;
  color: rgba(255,255,255,.035);
  font: 700 54px/1 var(--mono);
  content: attr(data-index);
}
.stat-label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.stat-label svg { width: 16px; height: 16px; fill: none; stroke: var(--acid); stroke-width: 1.7; }
.stat-value { margin-top: 22px; font: 570 34px/1 var(--mono); letter-spacing: -.05em; }
.stat-foot { margin-top: 9px; color: var(--faint); font: 10px/1.5 var(--mono); }
.stat-foot.ok { color: var(--ok); }
.dashboard-grid { grid-template-columns: minmax(0, 1.55fr) minmax(300px, .7fr); }

.panel { border: 1px solid var(--line); background: var(--panel); box-shadow: 0 1px 0 rgba(255,255,255,.018) inset; }
.panel-head { display: flex; min-height: 58px; align-items: center; justify-content: space-between; gap: 16px; padding: 0 18px; border-bottom: 1px solid var(--line); }
.panel-title { font-size: 13px; font-weight: 650; }
.panel-kicker { color: var(--faint); font: 10px/1 var(--mono); letter-spacing: .06em; }
.panel-body { padding: 18px; }
.empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 30px;
  color: var(--muted);
  text-align: center;
}
.empty-icon { margin: 0 auto 14px; color: var(--faint); }
.empty-icon svg { width: 32px; height: 32px; fill: none; stroke: currentColor; stroke-width: 1.3; }
.empty strong { display: block; margin-bottom: 7px; color: var(--text); font-size: 14px; }
.empty p { max-width: 380px; margin: 0 0 17px; font-size: 12px; line-height: 1.7; }

.timeline { display: grid; }
.timeline-row {
  display: grid;
  grid-template-columns: 11px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  min-height: 61px;
  border-bottom: 1px solid var(--line);
}
.timeline-row:last-child { border-bottom: 0; }
.run-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); }
.run-dot.failed { background: var(--danger); }
.timeline-title { font-size: 12px; font-weight: 620; }
.timeline-sub { margin-top: 4px; color: var(--faint); font: 10px/1 var(--mono); }
.timeline-time { color: var(--muted); font: 10px/1 var(--mono); }
.quick-grid { display: grid; gap: 9px; }
.quick-action {
  display: grid;
  grid-template-columns: 37px minmax(0, 1fr) 14px;
  gap: 11px;
  align-items: center;
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  color: inherit;
  background: var(--soft-bg);
  text-align: left;
  cursor: pointer;
}
.quick-action:hover { border-color: var(--line-strong); background: var(--panel-2); }
.quick-icon { display: grid; width: 37px; height: 37px; place-items: center; color: var(--acid); background: rgba(199,243,107,.07); }
.quick-icon svg, .quick-action > svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.quick-title { font-size: 12px; font-weight: 650; }
.quick-sub { margin-top: 3px; color: var(--faint); font-size: 10px; }

.server-layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 16px; }
.server-list { display: grid; max-height: calc(100vh - 240px); gap: 7px; overflow: auto; padding: 10px; }
.server-item {
  width: 100%;
  padding: 13px;
  border: 1px solid transparent;
  border-radius: 2px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.server-item:hover { background: rgba(255,255,255,.025); }
.server-item.active { border-color: rgba(199,243,107,.2); background: rgba(199,243,107,.065); }
.server-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.server-name { overflow: hidden; font-size: 12px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.server-host { margin-top: 7px; color: var(--muted); font: 10px/1 var(--mono); }
.server-os { margin-top: 9px; color: var(--faint); font-size: 10px; }
.badge {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 6px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--muted);
  background: rgba(255,255,255,.02);
  font: 9px/1 var(--mono);
  text-transform: uppercase;
}
.badge.ok { border-color: rgba(128,218,133,.24); color: var(--ok); background: rgba(128,218,133,.05); }
.badge.warn { border-color: rgba(255,186,102,.24); color: var(--warning); }
.badge.danger { border-color: rgba(255,111,97,.24); color: var(--danger); }
.workspace { min-width: 0; }
.workspace-head {
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-bottom: 1px solid var(--line);
}
.workspace-title { font-size: 14px; font-weight: 650; }
.workspace-host { margin-top: 5px; color: var(--faint); font: 10px/1 var(--mono); }
.workspace-actions { display: flex; gap: 8px; }
.analysis-form { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(240px, .6fr); gap: 14px; padding: 17px; border-bottom: 1px solid var(--line); background: var(--input-bg); }
.analysis-form .field { margin: 0; }
.analysis-submit { display: flex; align-items: flex-end; }
.terminal { min-height: 420px; background: var(--terminal-bg); }
.terminal-bar { display: flex; height: 43px; align-items: center; justify-content: space-between; padding: 0 15px; border-bottom: 1px solid var(--line); color: var(--faint); font: 10px/1 var(--mono); }
.terminal-lights { display: flex; gap: 6px; }
.terminal-lights i { display: block; width: 7px; height: 7px; border-radius: 50%; background: #344047; }
.terminal-lights i:first-child { background: var(--acid-2); }
.terminal-output {
  max-height: 620px;
  min-height: 377px;
  margin: 0;
  overflow: auto;
  padding: 19px;
  color: var(--terminal-text);
  font: 11.5px/1.7 var(--mono);
  white-space: pre-wrap;
  word-break: break-word;
}
.terminal-placeholder { color: var(--muted); white-space: pre-wrap; }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th {
  height: 42px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font: 10px/1 var(--mono);
  letter-spacing: .05em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.table td { min-height: 56px; padding: 13px 14px; border-bottom: 1px solid var(--line); color: var(--terminal-text); font-size: 12px; vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: rgba(255,255,255,.016); }
.table .mono { color: var(--muted); font: 10px/1.5 var(--mono); }
.cell-title { max-width: 360px; color: var(--text); font-weight: 650; }
.cell-sub { max-width: 430px; margin-top: 4px; overflow: hidden; color: var(--faint); font-size: 10px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }
.row-actions { display: flex; justify-content: flex-end; gap: 5px; }
.icon-btn {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid transparent;
  border-radius: 2px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}
.icon-btn:hover { border-color: var(--line); color: var(--text); background: var(--panel-2); }
.icon-btn.danger:hover { color: var(--danger); }
.icon-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; }

.settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 16px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
.span-2 { grid-column: span 2; }
.notice {
  padding: 12px 14px;
  border-left: 2px solid var(--cyan);
  color: var(--terminal-text);
  background: rgba(109,217,208,.05);
  font-size: 11px;
  line-height: 1.7;
}
.notice.warning { border-color: var(--warning); background: rgba(255,186,102,.05); }
.check-row { display: flex; align-items: center; gap: 10px; min-height: 42px; }
.switch {
  position: relative;
  display: inline-block;
  width: 38px;
  height: 21px;
}
.switch input { width: 0; height: 0; opacity: 0; }
.switch span { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 20px; background: var(--input-bg); cursor: pointer; transition: .2s; }
.switch span::after { position: absolute; top: 3px; left: 3px; width: 13px; height: 13px; border-radius: 50%; background: var(--muted); content: ""; transition: .2s; }
.switch input:checked + span { border-color: var(--acid-2); background: rgba(199,243,107,.1); }
.switch input:checked + span::after { background: var(--acid); transform: translateX(17px); }

.dropzone {
  display: grid;
  min-height: 200px;
  place-items: center;
  padding: 28px;
  border: 1px dashed var(--line-strong);
  background: repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(255,255,255,.009) 8px, rgba(255,255,255,.009) 16px);
  text-align: center;
  transition: border-color .15s, background .15s;
}
.dropzone.drag { border-color: var(--acid); background-color: rgba(199,243,107,.03); }
.dropzone input { display: none; }
.drop-icon { display: grid; width: 50px; height: 50px; margin: 0 auto 13px; place-items: center; border: 1px solid var(--line); color: var(--acid); background: var(--panel); }
.drop-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.5; }
.dropzone strong { display: block; margin-bottom: 7px; font-size: 13px; }
.dropzone p { margin: 0 0 14px; color: var(--faint); font-size: 10px; line-height: 1.6; }
.skills-top { display: grid; grid-template-columns: minmax(0, .75fr) minmax(0, 1.25fr); gap: 16px; margin-bottom: 16px; }
.skill-note { display: flex; flex-direction: column; justify-content: space-between; min-height: 200px; padding: 23px; border: 1px solid rgba(199,243,107,.17); background: linear-gradient(135deg, rgba(199,243,107,.065), transparent), var(--panel); }
.skill-note h3 { margin: 0 0 10px; font-size: 19px; font-weight: 600; letter-spacing: -.025em; }
.skill-note p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.code-line { color: var(--faint); font: 10px/1.5 var(--mono); }

.guide-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 16px; }
.guide-card { min-height: 200px; padding: 21px; border: 1px solid var(--line); background: var(--panel); }
.guide-no { color: var(--acid); font: 11px/1 var(--mono); }
.guide-card h3 { margin: 30px 0 10px; font-size: 16px; }
.guide-card p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.75; }
.guide-card code { color: var(--cyan); font: 11px/1.5 var(--mono); }

.modal-backdrop {
  position: fixed;
  z-index: 80;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: var(--overlay);
  backdrop-filter: blur(8px);
}
.modal {
  width: min(100%, 670px);
  max-height: min(880px, calc(100vh - 40px));
  overflow: auto;
  border: 1px solid var(--line-strong);
  background: var(--modal-bg);
  box-shadow: var(--shadow);
}
.modal-head { display: flex; min-height: 64px; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 16px; font-weight: 650; }
.modal-body { padding: 20px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 9px; padding: 15px 20px; border-top: 1px solid var(--line); background: var(--input-bg); }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.auth-tab { display: flex; height: 44px; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 3px; color: var(--muted); background: var(--input-bg); font-weight: 650; cursor: pointer; }
.auth-tab.active { border-color: rgba(199,243,107,.4); color: var(--acid); background: rgba(199,243,107,.055); }

.toast-stack { position: fixed; z-index: 120; top: 18px; right: 18px; display: grid; width: min(380px, calc(100vw - 36px)); gap: 9px; }
.toast {
  display: grid;
  grid-template-columns: 9px minmax(0,1fr) auto;
  gap: 11px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line-strong);
  background: var(--modal-bg);
  box-shadow: 0 15px 45px rgba(0,0,0,.35);
  animation: toast-in .25s ease-out;
}
.toast-mark { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--ok); }
.toast.error .toast-mark { background: var(--danger); }
.toast-title { font-size: 12px; font-weight: 650; }
.toast-msg { margin-top: 4px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.toast button { border: 0; color: var(--faint); background: transparent; cursor: pointer; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

.spinner { width: 14px; height: 14px; border: 2px solid rgba(0,0,0,.25); border-top-color: currentColor; border-radius: 50%; animation: spin .7s linear infinite; }
.btn:not(.btn-primary) .spinner { border-color: rgba(255,255,255,.18); border-top-color: currentColor; }
@keyframes spin { to { transform: rotate(360deg); } }
.login-theme-toggle {
  position: fixed;
  z-index: 30;
  top: 22px;
  right: 22px;
  border-color: var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}
.theme-toggle svg { width: 17px; height: 17px; }

.markdown-output {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.78;
  white-space: normal;
}
.markdown-output > :first-child { margin-top: 0; }
.markdown-output > :last-child { margin-bottom: 0; }
.markdown-output h1,
.markdown-output h2,
.markdown-output h3,
.markdown-output h4 {
  margin: 1.45em 0 .6em;
  color: var(--text);
  font-weight: 680;
  letter-spacing: -.025em;
  line-height: 1.35;
}
.markdown-output h1 { padding-bottom: 10px; border-bottom: 1px solid var(--line); font-size: 24px; }
.markdown-output h2 { font-size: 19px; }
.markdown-output h3 { font-size: 16px; }
.markdown-output h4 { font-size: 14px; }
.markdown-output p { margin: .7em 0; }
.markdown-output ul,
.markdown-output ol { margin: .75em 0; padding-left: 1.6em; }
.markdown-output li { margin: .3em 0; padding-left: .2em; }
.markdown-output strong { color: var(--text); font-weight: 720; }
.markdown-output code {
  padding: .12em .38em;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--cyan);
  background: var(--panel-2);
  font: .92em/1.5 var(--mono);
}
.markdown-output .md-code {
  margin: 1em 0;
  overflow: auto;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--input-bg);
}
.markdown-output .md-code code {
  padding: 0;
  border: 0;
  color: var(--terminal-text);
  background: transparent;
  white-space: pre;
}
.markdown-output blockquote {
  margin: 1em 0;
  padding: 8px 14px;
  border-left: 3px solid var(--acid);
  color: var(--muted);
  background: rgba(199, 243, 107, .055);
}
.markdown-output hr { height: 1px; margin: 1.5em 0; border: 0; background: var(--line); }
.markdown-output a { color: var(--cyan); text-decoration-thickness: 1px; text-underline-offset: 3px; }

:root[data-theme="light"] body {
  background:
    linear-gradient(rgba(17, 23, 19, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(17, 23, 19, .035) 1px, transparent 1px),
    radial-gradient(circle at 85% -10%, rgba(109, 152, 28, .11), transparent 30%),
    var(--bg);
  background-size: 36px 36px, 36px 36px, auto, auto;
}
:root[data-theme="light"] .btn-primary { color: #fff; }
:root[data-theme="light"] .btn-primary:hover { border-color: #5b8414; color: #fff; background: #5b8414; }
:root[data-theme="light"] .nav-btn:hover,
:root[data-theme="light"] .server-item:hover,
:root[data-theme="light"] .table tbody tr:hover { background: rgba(17, 23, 19, .035); }
:root[data-theme="light"] .stat-card::after { color: rgba(17, 23, 19, .055); }
:root[data-theme="light"] .dropzone {
  background: repeating-linear-gradient(-45deg, transparent, transparent 8px, rgba(17, 23, 19, .018) 8px, rgba(17, 23, 19, .018) 16px);
}
:root[data-theme="light"] .badge { background: rgba(17, 23, 19, .025); }
:root[data-theme="light"] .btn:not(.btn-primary) .spinner { border-color: rgba(17,23,19,.16); border-top-color: currentColor; }
.muted { color: var(--muted); }
.danger-text { color: var(--danger); }
.mono { font-family: var(--mono); }
.hidden { display: none !important; }

@media (max-width: 1120px) {
  .stats-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-grid, .settings-grid { grid-template-columns: 1fr; }
  .server-layout { grid-template-columns: 260px minmax(0, 1fr); }
  .analysis-form { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .login { grid-template-columns: 1fr; }
  .login-visual { min-height: 400px; padding: 36px 28px; border-right: 0; border-bottom: 1px solid var(--line); }
  .login-copy h1 { font-size: clamp(42px, 12vw, 66px); }
  .login-meta { display: none; }
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; z-index: 60; width: 250px; transform: translateX(-100%); transition: transform .2s; }
  .shell.menu-open .sidebar { transform: translateX(0); }
  .menu-toggle { display: grid; }
  .topbar { height: 61px; padding: 0 18px; }
  .content { padding: 24px 18px; }
  .server-layout, .skills-top { grid-template-columns: 1fr; }
  .server-list { max-height: 260px; }
  .guide-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .login-panel { padding: 42px 22px; }
  .stats-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .page-actions { width: 100%; }
  .page-actions .btn { flex: 1; }
  .form-grid { grid-template-columns: 1fr; }
  .span-2 { grid-column: span 1; }
  .workspace-head { align-items: flex-start; flex-direction: column; }
  .workspace-actions { width: 100%; }
  .workspace-actions .btn { flex: 1; }
  .modal-backdrop { padding: 0; }
  .modal { width: 100%; max-height: 100vh; min-height: 100vh; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
