:root {
  --bg: #f5f5f7;
  --card: #ffffff;
  --text: #1d1d1f;
  --muted: #86868b;
  --line: #e8e8ed;
  --blue: #0071e3;
  --blue-hover: #0077ed;
  --green: #34c759;
  --orange: #ff9500;
  --red: #ff3b30;
  --gray: #8e8e93;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 18px rgba(0, 0, 0, .045);
  --shadow-hover: 0 2px 6px rgba(0, 0, 0, .06), 0 14px 32px rgba(0, 0, 0, .08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; }

html, body { height: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overflow: hidden;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; }
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 12.5px; }
.error { color: #c4281c; font-size: 12.5px; min-height: 18px; margin-top: 8px; }
button { font: inherit; }
svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 32px; padding: 7px 16px; border: none; border-radius: 980px;
  background: rgba(0, 0, 0, .05); color: var(--text);
  font-size: 13px; font-weight: 500; white-space: nowrap; cursor: pointer;
  transition: background .2s ease, transform .1s ease, opacity .2s ease;
  user-select: none;
}
.btn:hover:not(:disabled) { background: rgba(0, 0, 0, .08); }
.btn:active:not(:disabled) { transform: scale(.97); }
.btn:disabled { opacity: .45; cursor: default; }
.btn.primary { background: var(--blue); color: #fff; }
.btn.primary:hover:not(:disabled) { background: var(--blue-hover); }
.btn.ghost { background: transparent; }
.btn.ghost:hover:not(:disabled) { background: rgba(0, 0, 0, .05); }
.btn.danger { color: var(--red); background: rgba(255, 59, 48, .07); }
.btn.danger:hover:not(:disabled) { background: rgba(255, 59, 48, .12); }
.btn.small { min-height: 26px; padding: 4px 12px; font-size: 12px; }
.btn.block { width: 100%; min-height: 44px; font-size: 15px; margin-top: 18px; }
.btn-icon { width: 15px; height: 15px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border: none; border-radius: 10px;
  background: transparent; color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: rgba(0, 0, 0, .05); }
#collapseBtn { width: 28px; height: 28px; border-radius: 8px; background: rgba(120, 120, 128, .08); color: var(--muted); }
#collapseBtn:hover { background: rgba(120, 120, 128, .16); color: var(--text); }
#collapseBtn svg { transition: transform .2s ease; }
.only-mobile { display: none; }
.only-desktop { display: inline-flex; }

@media (min-width: 961px) {
  .layout.collapsed { grid-template-columns: 72px minmax(0, 1fr); }
  .layout.collapsed .brand { justify-content: center; padding: 0; }
  .layout.collapsed .brand-text { display: none; }
  .layout.collapsed .nav { padding: 14px 10px; }
  .layout.collapsed .nav-label { display: none; }
  .layout.collapsed .nav-item { justify-content: center; padding: 10px 0; }
  .layout.collapsed .nav-text,
  .layout.collapsed .nav-count { display: none; }
  .layout.collapsed .nav-item svg { width: 20px; height: 20px; }
  .layout.collapsed .sidebar-foot { padding: 14px 0; text-align: center; }
  .layout.collapsed .sidebar-foot small { display: none; }
  .layout.collapsed .status-line { justify-content: center; }
  .layout.collapsed .status-line span { display: none; }
  .layout.collapsed #collapseBtn svg { transform: rotate(180deg); }
}

/* ---------- 输入 ---------- */
.input {
  font: inherit; font-size: 14px; color: var(--text);
  background: rgba(120, 120, 128, .08);
  border: 1px solid transparent; border-radius: var(--radius-sm);
  padding: 9px 13px; outline: none;
  transition: border-color .2s, background .2s;
}
.input:focus { background: #fff; border-color: var(--blue); }
.input::placeholder { color: var(--muted); }
.input.tiny { width: 90px; }
.select { min-width: 132px; cursor: pointer; }
textarea.input { width: 100%; resize: vertical; line-height: 1.6; }
.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; }
.label { display: block; font-size: 12.5px; color: var(--muted); margin: 14px 0 7px; }

/* ---------- 下拉菜单 ---------- */
.dropdown { position: relative; display: inline-block; }
.dropdown-btn {
  display: inline-flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 32px; padding: 6px 12px 6px 14px;
  border: none; border-radius: 980px; background: rgba(120, 120, 128, .10);
  color: var(--text); font-size: 13px; font-weight: 500; white-space: nowrap;
  cursor: pointer; transition: background .2s ease;
}
.dropdown-btn:hover { background: rgba(120, 120, 128, .16); }
.dropdown-btn .chevron { width: 12px; height: 12px; color: var(--muted); transition: transform .2s ease; }
.dropdown.open .dropdown-btn .chevron { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 100%;
  max-height: 300px; overflow-y: auto; padding: 6px;
  background: #fff; border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, .14), 0 0 0 .5px rgba(0, 0, 0, .05);
  opacity: 0; transform: translateY(-4px) scale(.98); pointer-events: none;
  transition: opacity .16s ease, transform .16s ease; z-index: 60;
}
.dropdown.open .dropdown-menu { opacity: 1; transform: none; pointer-events: auto; }
.dropdown-item {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 10px; border: none; border-radius: 8px; background: transparent;
  font-size: 13px; color: var(--text); text-align: left; white-space: nowrap; cursor: pointer;
}
.dropdown-item:hover { background: #f5f5f7; }
.dropdown-item.selected { color: var(--blue); font-weight: 500; }
.dropdown-item .check { width: 14px; height: 14px; }

.link-btn {
  border: none; background: none; color: var(--blue); font-size: 12.5px; cursor: pointer; padding: 0;
}
.link-btn:hover { opacity: .75; }

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
}

.sidebar {
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, .72);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-right: 1px solid rgba(0, 0, 0, .06);
  z-index: 40;
}

.brand {
  height: 64px; display: flex; align-items: center; gap: 10px;
  padding: 0 20px; border-bottom: 1px solid var(--line);
}
.brand-logo {
  width: 30px; height: 30px; border-radius: 9px;
  display: grid; place-items: center;
  background: linear-gradient(160deg, #0a84ff, #0055c4);
  color: #fff; font-size: 12px; font-weight: 700; letter-spacing: -.5px;
  box-shadow: 0 4px 12px rgba(0, 113, 227, .25);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 15px; letter-spacing: -.01em; }
.brand-text span { font-size: 11px; color: var(--muted); }

.nav { flex: 1; padding: 14px 12px; overflow-y: auto; }
.nav-label {
  margin: 16px 12px 7px; font-size: 11px; font-weight: 500;
  letter-spacing: .04em; color: var(--muted); text-transform: uppercase;
}
.nav-label:first-child { margin-top: 0; }
.nav-item {
  width: 100%; display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; margin-bottom: 2px;
  border: none; border-radius: 9px; background: transparent;
  color: #3a3a3c; cursor: pointer; text-align: left;
  font-size: 13.5px; font-weight: 500;
  transition: background .2s ease, color .2s ease;
}
.nav-item svg { width: 17px; height: 17px; color: var(--muted); }
.nav-item:hover { background: rgba(0, 0, 0, .04); }
.nav-item.active { background: rgba(0, 113, 227, .1); color: var(--blue); }
.nav-item.active svg { color: var(--blue); }
.nav-count {
  margin-left: auto; font-size: 11px; color: var(--muted);
  background: rgba(120, 120, 128, .14); border-radius: 980px; padding: 1px 7px;
}
.nav-item.active .nav-count { background: rgba(0, 113, 227, .14); color: var(--blue); }

.sidebar-foot {
  padding: 14px 20px; border-top: 1px solid var(--line);
  font-size: 11.5px; color: var(--muted);
}
.status-line { display: flex; align-items: center; gap: 7px; margin-bottom: 3px; color: #3a3a3c; font-size: 12px; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }

.main {
  min-width: 0; height: 100%; overflow-y: auto; overflow-x: hidden;
  display: flex; flex-direction: column;
}

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  min-height: 64px; padding: 10px 24px; flex-wrap: wrap;
  background: rgba(245, 245, 247, .78);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(0, 0, 0, .06);
}
.page-head { min-width: 0; }
.page-head h2 { font-size: 17px; }
.page-head p { font-size: 12px; color: var(--muted); margin-top: 1px; }
.top-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar-box { display: flex; align-items: center; gap: 8px; margin-left: 4px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(0, 113, 227, .12); color: var(--blue);
  font-size: 12px; font-weight: 600;
}

.content { width: 100%; max-width: 1160px; margin: 0 auto; padding: 22px 24px 60px; }

/* ---------- 视图 ---------- */
.view { display: none; }
.view.active { display: block; }

/* ---------- 通用面板 ---------- */
.panel {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-card);
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-head h3 { font-size: 15px; }
.panel-head.sub { margin-top: 22px; }
.head-actions { display: flex; gap: 8px; }

/* ---------- 总览 ---------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 16px; }
.stat-card {
  background: var(--card); border-radius: var(--radius); padding: 16px 18px;
  box-shadow: var(--shadow-card);
  display: flex; align-items: center; gap: 12px;
}
.stat-icon { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; flex: none; }
.stat-icon svg { width: 19px; height: 19px; }
.stat-icon.blue { background: rgba(0, 113, 227, .1); color: var(--blue); }
.stat-icon.green { background: rgba(52, 199, 89, .12); color: #248a3d; }
.stat-icon.orange { background: rgba(255, 149, 0, .12); color: #b25000; }
.stat-icon.purple { background: rgba(88, 86, 214, .1); color: #5856d6; }
.stat-body strong { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-body span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.stat-body em { font-style: normal; color: #248a3d; font-size: 11.5px; margin-left: 6px; }

.overview-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 16px; align-items: start; }

.usage-list { display: flex; flex-direction: column; gap: 12px; }
.usage-row { background: #fbfbfd; border-radius: 14px; padding: 14px 16px; }
.usage-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.usage-top b { font-size: 13.5px; font-weight: 600; }
.usage-top span { font-size: 12px; color: var(--muted); }
.usage-line { display: grid; grid-template-columns: 48px 1fr 78px; gap: 10px; align-items: center; font-size: 12px; color: var(--muted); margin-top: 7px; }

.quick-actions { display: flex; flex-direction: column; background: #fbfbfd; border-radius: 14px; overflow: hidden; }
.quick-btn {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  background: transparent; border: none; border-bottom: 1px solid var(--line);
  text-align: left; cursor: pointer; transition: background .15s ease;
}
.quick-btn:last-child { border-bottom: none; }
.quick-btn:hover { background: rgba(0, 0, 0, .03); }
.quick-btn b { display: block; font-size: 13px; font-weight: 500; }
.quick-btn small { display: block; color: var(--muted); font-size: 11.5px; }
.quick-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; }
.quick-icon svg { width: 16px; height: 16px; }
.quick-icon.blue { background: rgba(0, 113, 227, .1); color: var(--blue); }
.quick-icon.green { background: rgba(52, 199, 89, .12); color: #248a3d; }
.quick-icon.orange { background: rgba(255, 149, 0, .12); color: #b25000; }

.mini-logs { display: flex; flex-direction: column; }
.mini-log { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 12px; align-items: baseline; }
.mini-log:last-child { border-bottom: none; }
.mini-log time { color: var(--gray); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 10.5px; white-space: nowrap; width: 116px; flex: none; }
.mini-log b { font-weight: 500; color: var(--text); white-space: nowrap; }
.mini-log span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 机器 ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; align-items: center; }
.toolbar-left, .toolbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

.banner {
  background: rgba(255, 149, 0, .1); color: #8a4500;
  border-radius: var(--radius-sm); padding: 8px 14px; font-size: 12.5px;
}

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 16px; }

.card {
  background: var(--card); border-radius: var(--radius); padding: 20px;
  box-shadow: var(--shadow-card);
  display: flex; flex-direction: column; gap: 12px;
  transition: box-shadow .25s ease, transform .25s ease;
}
.card:hover { box-shadow: var(--shadow-hover); transform: translateY(-1px); }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.card-title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; word-break: break-all; min-width: 0; }
.card-sub { color: var(--muted); font-size: 12px; margin-top: 2px; word-break: break-all; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 500; padding: 3px 10px; border-radius: 980px;
  white-space: nowrap; flex-shrink: 0; background: rgba(142, 142, 147, .14); color: #6e6e73;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.running { background: rgba(52, 199, 89, .12); color: #248a3d; }
.badge.suspended { background: rgba(255, 149, 0, .14); color: #b25000; }
.badge.stopped { background: rgba(142, 142, 147, .14); color: #6e6e73; }
.badge.error { background: rgba(255, 59, 48, .12); color: #c4281c; }
.badge.pending { background: rgba(0, 113, 227, .12); color: #0060c0; }

.meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 16px; font-size: 12.5px; color: var(--text); }
.meta div span { color: var(--muted); }
.meta div b { font-weight: 500; }

.meters { display: flex; flex-direction: column; gap: 7px; }
.meter { display: grid; grid-template-columns: 40px 1fr 48px; gap: 10px; align-items: center; font-size: 11.5px; color: var(--muted); }
.bar { height: 6px; background: rgba(120, 120, 128, .16); border-radius: 980px; overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--blue); border-radius: 980px; transition: width .3s ease; }
.bar.warn > i { background: var(--orange); }
.bar.err > i { background: var(--red); }

.lease { font-size: 11.5px; color: var(--muted); border-top: 1px solid var(--line); padding-top: 12px; line-height: 1.6; }
.lease b { color: var(--text); font-weight: 500; }

.actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; }
.actions .btn { min-height: 28px; padding: 5px 13px; font-size: 12px; }

.toggle { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); cursor: pointer; }
.switch { position: relative; width: 51px; height: 31px; flex: none; display: inline-block; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span {
  position: absolute; inset: 0; background: rgba(120, 120, 128, .16);
  border-radius: 16px; cursor: pointer; transition: background .25s ease;
}
.switch span::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 27px; height: 27px; border-radius: 50%; background: #fff;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .15), 0 1px 1px rgba(0, 0, 0, .06);
  transition: transform .25s cubic-bezier(.4, 0, .2, 1);
}
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }

/* ---------- 监控 ---------- */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: rgba(120, 120, 128, .12); border-radius: 10px; }
.seg button {
  border: none; background: transparent; color: var(--text);
  font-size: 13px; font-weight: 500; padding: 5px 16px; border-radius: 8px; cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
}
.seg button.active { background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .1), 0 0 1px rgba(0, 0, 0, .06); }

.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); gap: 16px; }
.chart { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-card); }
.chart h3 { font-size: 14px; margin-bottom: 2px; }
.chart .value { font-size: 26px; font-weight: 600; letter-spacing: -.02em; margin-bottom: 10px; font-variant-numeric: tabular-nums; }
.chart svg { width: 100%; height: 120px; display: block; }
.chart svg polygon { stroke: none; }
.chart .empty { color: var(--muted); font-size: 12.5px; padding: 32px 0; text-align: center; }
.chart .axis { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--gray); margin-top: 6px; font-variant-numeric: tabular-nums; }

/* ---------- 批量执行 ---------- */
.exec-options { display: flex; gap: 16px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.check { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 7px; }
.machine-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.machine-picker label {
  border-radius: 980px; padding: 6px 14px; font-size: 12.5px;
  display: flex; align-items: center; gap: 7px; cursor: pointer;
  background: rgba(120, 120, 128, .08); transition: background .2s ease;
}
.machine-picker label:hover { background: rgba(120, 120, 128, .13); }
.machine-picker label:has(input:checked) { background: rgba(0, 113, 227, .1); color: var(--blue); }

.results { margin-top: 18px; display: flex; flex-direction: column; gap: 12px; }
.result { border-radius: 14px; overflow: hidden; background: #fbfbfd; }
.result header { padding: 10px 14px; display: flex; justify-content: space-between; font-size: 12.5px; align-items: center; border-bottom: 1px solid var(--line); }
.result pre { margin: 0; padding: 12px 14px; background: #fff; font-size: 12.5px; white-space: pre-wrap; word-break: break-all; max-height: 260px; overflow: auto; }
.result .err-text { color: #c4281c; }
.pill { font-size: 11.5px; font-weight: 500; padding: 2px 9px; border-radius: 980px; }
.pill.ok { background: rgba(52, 199, 89, .12); color: #248a3d; }
.pill.bad { background: rgba(255, 59, 48, .12); color: #c4281c; }

/* ---------- 端口 ---------- */
.publish { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }
.publish .input { flex: 1 1 150px; }
.publish .dropdown { flex: 1 1 150px; }
.publish .dropdown-btn {
  width: 100%; min-height: 37px; border-radius: 12px;
  background: rgba(120, 120, 128, .08); justify-content: space-between;
}
.port-list { display: flex; flex-direction: column; }
.port-row {
  display: flex; align-items: center; gap: 12px; justify-content: space-between;
  padding: 12px 4px; border-bottom: 1px solid var(--line); flex-wrap: wrap;
}
.port-row:last-child { border-bottom: none; }
.port-row a { color: var(--blue); text-decoration: none; word-break: break-all; font-size: 13px; }
.port-row a:hover { text-decoration: underline; }
.port-row .who { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- 日志 ---------- */
.log-list { display: flex; flex-direction: column; }
.log-head, .log-row {
  display: grid; grid-template-columns: 170px 180px 1fr; gap: 12px; align-items: baseline;
  padding: 10px 2px; font-size: 12.5px;
}
.log-head { color: var(--muted); font-size: 12px; border-bottom: 1px solid var(--line); font-weight: 500; }
.log-row { border-bottom: 1px solid var(--line); }
.log-row:last-child { border-bottom: none; }
.log-row > span:first-child { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 11px; color: var(--gray); font-variant-numeric: tabular-nums; }
.log-row .detail { color: var(--muted); word-break: break-word; }
.log-row .ok { color: #248a3d; }
.log-row .bad { color: #c4281c; }

/* ---------- 登录 ---------- */
.login-wrap {
  position: fixed; inset: 0; z-index: 100; overflow-y: auto;
  display: flex; align-items: center; justify-content: center;
  padding: 24px; background: var(--bg);
}
.login-card {
  width: 100%; max-width: 360px; background: var(--card); border-radius: 22px;
  padding: 36px 32px; text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .04), 0 20px 50px rgba(0, 0, 0, .08);
}
.login-card .logo {
  width: 56px; height: 56px; margin: 0 auto 18px; border-radius: 16px;
  background: linear-gradient(160deg, #0a84ff, #0055c4);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 22px; font-weight: 700; letter-spacing: -.5px;
  box-shadow: 0 6px 18px rgba(0, 113, 227, .3);
}
.login-card h1 { font-size: 24px; margin-bottom: 4px; }
.login-card .sub { color: var(--muted); font-size: 13px; margin-bottom: 26px; }
.login-card .field {
  width: 100%; font: inherit; font-size: 15px; color: var(--text);
  background: rgba(120, 120, 128, .08); border: 1px solid transparent;
  border-radius: 12px; padding: 12px 14px; outline: none;
  transition: border-color .2s, background .2s;
}
.login-card .field:focus { background: #fff; border-color: var(--blue); }
.login-card .field::placeholder { color: var(--muted); }

/* ---------- 提示 ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: rgba(29, 29, 31, .92); color: #fff; font-size: 13px;
  padding: 10px 18px; border-radius: 980px; opacity: 0; pointer-events: none;
  transition: opacity .22s ease, transform .22s ease; z-index: 200;
  max-width: 86vw; text-align: center; backdrop-filter: blur(10px);
}
.toast:not(.hidden) { opacity: 1; transform: translate(-50%, 0); }
.toast.bad { background: rgba(196, 40, 28, .95); }

.sidebar-mask { display: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 1200px) {
  .stat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr); height: 100vh; height: 100dvh; }
  .only-desktop { display: none; }
  .sidebar {
    position: fixed; inset: 0 auto 0 0; width: 232px; height: 100vh; height: 100dvh;
    transform: translateX(-100%); transition: transform .25s cubic-bezier(.4, 0, .2, 1);
    background: rgba(255, 255, 255, .92);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-mask { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .32); backdrop-filter: blur(4px); z-index: 35; opacity: 0; pointer-events: none; transition: opacity .2s; }
  .sidebar-mask.show { opacity: 1; pointer-events: auto; }
  .only-mobile { display: inline-flex; }
  .topbar { padding: 8px 14px; gap: 8px; }
  .page-head p { display: none; }
  .content { padding: 16px 16px 40px; }
  .overview-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 620px) {
  .topbar { height: auto; min-height: 56px; flex-wrap: wrap; row-gap: 8px; }
  .page-head { flex: 1; min-width: 0; }
  .page-head h2 { font-size: 16px; white-space: nowrap; }
  .top-actions { width: 100%; margin-left: 0; flex-wrap: wrap; padding-bottom: 2px; }
  .top-actions .avatar-box { display: none; }
  .stat-grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: 1fr; }
  #summary { display: none; }
  .log-head { display: none; }
  .log-row { grid-template-columns: 1fr; gap: 2px; }
}
