/* skyline-par 面板：浅色侧栏 + 圆角扁平卡片；颜色全部走变量，系统深色模式下自动切换。 */
:root {
  --bg: #f5f6f8; --surface: #fff; --surface-2: #f8fafc; --hover: #f1f5f9;
  --border: #e5e7eb; --border-strong: #d4d8de;
  --text: #0f172a; --text-2: #475569; --muted: #8a94a6; --disabled: #b4bcc8;
  --primary: #4f46e5; --primary-hover: #4338ca; --primary-soft: #eef2ff; --primary-text: #4338ca; --ring: rgba(79, 70, 229, .22);
  --success: #059669; --success-soft: #ecfdf5; --success-line: #a7f3d0;
  --warning: #d97706; --warning-soft: #fffbeb; --warning-line: #fde68a;
  --danger: #e11d48; --danger-soft: #fff1f2; --danger-line: #fecdd3;
  --info: #2563eb; --info-soft: #eff6ff; --info-line: #bfdbfe;
  --c1: #6366f1; --c2: #10b981; --c3: #f59e0b; --c4: #8b5cf6; --c5: #06b6d4;
  --track: #eef0f4; --grid: #eef0f4; --mask: rgba(15, 23, 42, .32);
  --r-lg: 16px; --r-md: 12px; --r-sm: 10px; --r-xs: 8px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow-md: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .14);
  --shadow-lg: 0 24px 48px -16px rgba(15, 23, 42, .24);
  --side-w: 236px;
  color-scheme: light;
  font-family: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d12; --surface: #12151c; --surface-2: #161a23; --hover: #1b2030;
    --border: #232837; --border-strong: #2f3547;
    --text: #e6e8ee; --text-2: #aab2c2; --muted: #7c8598; --disabled: #4f566a;
    --primary: #6366f1; --primary-hover: #818cf8; --primary-soft: rgba(99, 102, 241, .16); --primary-text: #a5b4fc; --ring: rgba(129, 140, 248, .35);
    --success: #34d399; --success-soft: rgba(16, 185, 129, .14); --success-line: rgba(52, 211, 153, .35);
    --warning: #fbbf24; --warning-soft: rgba(245, 158, 11, .14); --warning-line: rgba(251, 191, 36, .35);
    --danger: #fb7185; --danger-soft: rgba(244, 63, 94, .14); --danger-line: rgba(251, 113, 133, .35);
    --info: #60a5fa; --info-soft: rgba(59, 130, 246, .14); --info-line: rgba(96, 165, 250, .35);
    --track: #232837; --grid: #1e2330; --mask: rgba(0, 0, 0, .55);
    --shadow-sm: none; --shadow-md: 0 0 0 1px rgba(255, 255, 255, .02); --shadow-lg: 0 24px 48px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--text-2); line-height: 1.6; }
a { color: var(--primary); text-decoration: none; transition: color .15s; }
a:hover { color: var(--primary-hover); }
code, .mono { font-family: ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace; font-size: 12.5px; }
h1, h2, h3 { color: var(--text); margin: 0; letter-spacing: -.01em; }
h1 { font-size: 22px; font-weight: 650; }
h2 { font-size: 15px; font-weight: 600; }
h3 { font-size: 14px; font-weight: 600; }
.muted { color: var(--muted); }
.error { color: var(--danger); }
.notice { color: var(--success); }
.nowrap { white-space: nowrap; }
svg { flex: none; }

/* ---- 骨架 ---- */
.app { display: flex; min-height: 100vh; }
.side { width: var(--side-w); flex: none; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-right: 1px solid var(--border); padding: 18px 14px; }
.side .logo { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: var(--text); font-size: 16px; font-weight: 650; letter-spacing: -.01em; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; border-radius: 9px; background: var(--primary); color: #fff; }
.brand-mark svg { width: 17px; height: 17px; }
.side nav { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.menu-group { display: flex; flex-direction: column; gap: 2px; }
.menu-title { padding: 0 10px 4px; font-size: 11.5px; font-weight: 600; color: var(--muted); letter-spacing: .04em; }
.menu-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--r-sm); color: var(--text-2); border: 0; background: none; font: inherit; width: 100%; cursor: pointer; text-align: left; transition: background .15s, color .15s; }
.menu-item svg { width: 17px; height: 17px; opacity: .85; }
.menu-item:hover { background: var(--hover); color: var(--text); }
.menu-item.on { background: var(--primary-soft); color: var(--primary-text); font-weight: 600; }
.menu-item.on svg { opacity: 1; }
.side-foot { margin: 8px 0 0; padding-top: 10px; border-top: 1px solid var(--border); }
.content { flex: 1; min-width: 0; padding: 28px 32px 40px; max-width: 1680px; }
.page-head { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); }
.page-head .spacer, .spacer { flex: 1; }

/* ---- 卡片 ---- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 18px; min-width: 0; box-shadow: var(--shadow-sm); overflow: hidden; }
.card-head { display: flex; align-items: center; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--border); flex-wrap: wrap; }
.card-body { padding: 20px 22px; }
.card-body.flush { padding: 0; }
.card-body > p:first-child { margin-top: 0; }
.card-body > p:last-child { margin-bottom: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 18px; }
.card .stats:last-child { margin-bottom: 0; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 16px 18px; box-shadow: var(--shadow-sm); min-width: 0; }
.card .stat { background: var(--surface-2); box-shadow: none; }
.stat > span:not(.bar) { color: var(--muted); display: block; font-size: 12.5px; }
.stat b { display: block; font-size: 24px; font-weight: 650; color: var(--text); margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat b.dual { font-size: 16px; font-weight: 600; line-height: 1.75; letter-spacing: 0; }
.stat.warn { border-color: var(--warning-line); background: var(--warning-soft); }
.stat.warn b { color: var(--warning); }
.stat.bad b { color: var(--danger); }
.stat .bar { margin-top: 10px; }

/* ---- 工具条 ---- */
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar .spacer { flex: 1; }
.toolbar select, .toolbar input:not([type=checkbox]) { width: 200px; }
.toolbar input.search { width: 240px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--hover); border-radius: var(--r-sm); }
.seg a { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 30px; border-radius: var(--r-xs); color: var(--muted); }
.seg a:hover { color: var(--text); }
.seg a.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .1); }
.seg svg { width: 16px; height: 16px; }

/* ---- 表单控件 ---- */
input, select, textarea { width: 100%; height: 38px; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; transition: border-color .15s, box-shadow .15s; }
select { padding-right: 30px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 15px) 16px, calc(100% - 10px) 16px; background-size: 5px 5px; background-repeat: no-repeat; }
textarea { height: auto; min-height: 72px; padding: 10px 12px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; resize: vertical; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { outline: 0; border-color: var(--primary); box-shadow: 0 0 0 4px var(--ring); }
input[type=checkbox] { width: 16px; height: 16px; padding: 0; accent-color: var(--primary); vertical-align: -3px; border-radius: 4px; }
input::placeholder, textarea::placeholder { color: var(--disabled); }
button, a.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: inherit; font-weight: 550; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s; }
button:hover, a.btn:hover { background: var(--hover); color: var(--text); }
button:active, a.btn:active { transform: translateY(1px); }
button:focus-visible, a:focus-visible { outline: 0; box-shadow: 0 0 0 4px var(--ring); }
button.primary, a.btn.primary { background: var(--primary); border-color: transparent; color: #fff; box-shadow: 0 1px 2px rgba(79, 70, 229, .25); }
button.primary:hover, a.btn.primary:hover { background: var(--primary-hover); color: #fff; }
button.danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-soft); }
button.danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
button.link { border: 0; background: none; padding: 0 4px; height: auto; color: var(--primary); font-weight: 500; box-shadow: none; }
button.link:hover { color: var(--primary-hover); background: none; }
button.link.danger { color: var(--danger); background: none; }
button.link.danger:hover { opacity: .8; color: var(--danger); }
button.small, a.btn.small { height: 28px; padding: 0 10px; font-size: 12.5px; border-radius: var(--r-xs); }

/* 竖排表单（抽屉 / 编辑卡片） */
.form .field { margin-bottom: 18px; }
.form .field > label, .form .field > .label { display: block; color: var(--text); font-weight: 550; margin-bottom: 6px; font-size: 13px; }
.form .field small, .form .hint { display: block; color: var(--muted); margin-top: 6px; font-size: 12.5px; }
.form .field.short input { max-width: 180px; }
.form .checks { display: flex; flex-wrap: wrap; gap: 10px 22px; }
label.check { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); cursor: pointer; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.collapse { border: 1px solid var(--border); border-radius: var(--r-md); margin-bottom: 16px; background: var(--surface); }
.collapse > summary { padding: 13px 16px; cursor: pointer; color: var(--text); font-weight: 600; list-style: none; display: flex; align-items: center; gap: 10px; }
.collapse > summary::-webkit-details-marker { display: none; }
.collapse > summary::before { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(-45deg); transition: transform .2s; margin: 0 2px; }
.collapse[open] > summary::before { transform: rotate(45deg); }
.collapse > .inner { padding: 16px 16px 14px; border-top: 1px solid var(--border); }
.collapse > .inner > .field:last-child { margin-bottom: 4px; }
.form-actions { display: flex; gap: 8px; justify-content: flex-end; padding-top: 4px; }

/* 设置页：左标题右控件 */
.tabs { display: flex; gap: 4px; padding: 10px 14px; border-bottom: 1px solid var(--border); overflow-x: auto; }
.tabs a { padding: 6px 12px; border-radius: var(--r-xs); color: var(--text-2); white-space: nowrap; font-weight: 500; }
.tabs a:hover { background: var(--hover); color: var(--text); }
.tabs a.on { background: var(--primary-soft); color: var(--primary-text); }
.setting { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; padding: 18px 22px; border-bottom: 1px solid var(--border); align-items: center; }
.setting:last-child { border-bottom: 0; }
.setting .name { color: var(--text); font-weight: 550; }
.setting .desc { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.setting-actions { padding: 16px 22px; display: flex; gap: 8px; align-items: center; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---- 表格 ---- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 13px 14px; border-bottom: 1px solid var(--border); text-align: center; white-space: nowrap; }
th { background: var(--surface-2); color: var(--muted); font-weight: 600; font-size: 12px; letter-spacing: .02em; position: sticky; top: 0; z-index: 1; }
td { color: var(--text-2); }
tbody tr { transition: background .12s; }
tbody tr:hover td { background: var(--hover); }
tbody tr:last-child td { border-bottom: 0; }
tr.off td { color: var(--disabled); }
tr.off td a { opacity: .7; }
td.left, th.left { text-align: left; }
td.tags { white-space: normal; min-width: 180px; max-width: 340px; }
td.wrap { white-space: normal; text-align: left; }
table.compact th, table.compact td { padding: 9px 14px; }
.pager { display: flex; gap: 6px; align-items: center; justify-content: flex-end; padding: 14px 22px; flex-wrap: wrap; border-top: 1px solid var(--border); }
.pager a, .pager b { min-width: 34px; height: 34px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-xs); color: var(--text-2); }
.pager a:hover { background: var(--hover); color: var(--text); }
.pager b { background: var(--primary); color: #fff; font-weight: 600; }

/* ---- 标签、开关、进度条 ---- */
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; font-size: 12px; font-weight: 550; border-radius: 999px; background: var(--hover); color: var(--text-2); white-space: nowrap; margin: 2px; }
.tag.green, .tag.ok { color: var(--success); background: var(--success-soft); }
.tag.blue { color: var(--info); background: var(--info-soft); }
.tag.red, .tag.bad { color: var(--danger); background: var(--danger-soft); }
.tag.orange, .tag.warn { color: var(--warning); background: var(--warning-soft); }
.tag.gray, .tag.muted { color: var(--muted); }
.tag.green::before, .tag.ok::before, .tag.red::before, .tag.bad::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; }
.switch { display: inline-block; position: relative; width: 40px; height: 22px; border-radius: 999px; background: var(--border-strong); border: 0; padding: 0; vertical-align: middle; cursor: pointer; transition: background .2s; box-shadow: none; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(15, 23, 42, .25); transition: transform .2s; }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }
.switch:hover { background: var(--muted); }
.switch.on:hover { background: var(--primary-hover); }
form.toggle { display: inline; margin: 0; }
.bar { display: flex; align-items: center; gap: 10px; }
.bar .track { display: block; flex: 1; height: 6px; border-radius: 999px; background: var(--track); overflow: hidden; min-width: 60px; }
.bar .fill { display: block; height: 100%; border-radius: 999px; background: var(--c2); transition: width .4s ease; }
.bar .fill.mid { background: var(--c3); }
.bar .fill.high { background: var(--danger); }
.bar .pct { width: 38px; text-align: right; color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
td.barcell .bar { min-width: 120px; }

/* 网速：↓ 收、↑ 发 */
.net { display: inline-flex; gap: 12px; flex-wrap: wrap; font-variant-numeric: tabular-nums; }
.stat .net { display: flex; flex-direction: column; gap: 0; }
.net .rx { color: var(--c1); }
.net .tx { color: var(--c2); }
.up::before { content: "↑"; color: var(--c2); margin-right: 2px; }
.down::before { content: "↓"; color: var(--c1); margin: 0 2px 0 8px; }

/* ---- 节点监控卡片 ---- */
.nodes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.ncard { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px 18px; min-width: 0; box-shadow: var(--shadow-sm); transition: box-shadow .2s, transform .2s, border-color .2s; }
.ncard:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); border-color: var(--border-strong); }
.ncard.off { opacity: .72; }
.ncard-head { display: flex; align-items: center; gap: 6px; margin-bottom: 14px; min-width: 0; }
.ncard-head .name { font-size: 15px; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ncard-head .spacer { flex: 1; }
.kv { display: grid; grid-template-columns: 64px minmax(0, 1fr); row-gap: 9px; align-items: center; font-size: 13px; }
.kv > span:nth-child(odd) { color: var(--muted); font-size: 12.5px; }
.kv > span:nth-child(even) { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.empty { color: var(--muted); text-align: center; padding: 36px 0; }

/* ---- 曲线 ---- */
.charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; margin-top: 18px; }
.chart { border: 1px solid var(--border); border-radius: var(--r-md); padding: 14px 16px 10px; background: var(--surface); }
.chart .title { display: flex; gap: 12px; align-items: center; color: var(--text); font-weight: 600; margin-bottom: 8px; flex-wrap: wrap; }
.chart .legend { font-size: 12px; font-weight: 500; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.chart .legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.chart svg { width: 100%; height: 120px; display: block; overflow: visible; }
.chart .grid { stroke: var(--grid); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { opacity: .08; stroke: none; }
.chart .axis { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }

/* ---- 提示 ---- */
.alert { border-radius: var(--r-md); padding: 11px 16px; margin-bottom: 16px; border: 1px solid; }
.alert.error, .errors { background: var(--danger-soft); border-color: var(--danger-line); color: var(--text); }
.alert.ok { background: var(--success-soft); border-color: var(--success-line); color: var(--text); }
.alert.info { background: var(--info-soft); border-color: var(--info-line); color: var(--text); }
.errors { border: 1px solid var(--danger-line); border-radius: var(--r-md); padding: 11px 16px; margin-bottom: 16px; }
.errors ul { margin: 0; padding-left: 18px; }
ul.problems { list-style: none; margin: 0; padding: 4px 0; }
ul.problems li { padding: 10px 22px; border-bottom: 1px solid var(--border); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
ul.problems li:last-child { border-bottom: 0; }
pre.log { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 12px 14px; max-height: 360px; overflow: auto; white-space: pre-wrap; margin: 10px 0 0; font-size: 12.5px; }
pre.doc { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 14px 16px; margin: 0; overflow: auto; white-space: pre-wrap; word-break: break-word; font-size: 12.5px; line-height: 1.6; }
.more { padding: 12px 22px; text-align: center; border-top: 1px solid var(--border); }

/* ---- 下拉（批量操作） ---- */
details.drop { position: relative; display: inline-block; }
details.drop > summary { list-style: none; display: inline-flex; align-items: center; height: 38px; padding: 0 16px; border: 1px solid var(--border-strong); border-radius: var(--r-sm); background: var(--surface); color: var(--text); font-weight: 550; cursor: pointer; }
details.drop > summary:hover { background: var(--hover); }
details.drop > summary::-webkit-details-marker { display: none; }
details.drop .pop { position: absolute; z-index: 30; top: 44px; left: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; min-width: 250px; box-shadow: var(--shadow-lg); display: grid; gap: 8px; }
.batchbar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 12px 22px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.batchbar select { width: auto; min-width: 140px; }

/* ---- 抽屉 ---- */
#drawer:empty { display: none; }
#drawer { position: fixed; inset: 0; z-index: 100; }
#drawer .mask { position: absolute; inset: 0; background: var(--mask); backdrop-filter: blur(2px); animation: fade .2s ease-out; }
#drawer .editor { position: absolute; top: 10px; right: 10px; bottom: 10px; width: min(780px, calc(100% - 20px)); margin: 0; border-radius: var(--r-lg); display: flex; flex-direction: column; box-shadow: var(--shadow-lg); animation: slide .25s cubic-bezier(.2, .8, .2, 1); overflow: hidden; }
@keyframes slide { from { transform: translateX(32px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.editor { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: 18px; }
.editor-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--border); }
.editor-head h2 { flex: 1; font-size: 16px; }
.editor-head a.close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--r-xs); color: var(--muted); font-size: 20px; line-height: 1; }
.editor-head a.close:hover { background: var(--hover); color: var(--text); }
.editor-body { padding: 22px; overflow-y: auto; flex: 1; }
.editor-foot { padding: 12px 18px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }
#drawer .editor-foot { position: sticky; bottom: 0; background: var(--surface); }

/* ---- htmx 局部刷新：换入时淡入 ---- */
.htmx-added { opacity: 0; }
.htmx-settling .htmx-added, .htmx-added.htmx-settling { opacity: 1; transition: opacity .2s; }

/* ---- 登录 ---- */
body.login { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px; background: radial-gradient(1200px 600px at 10% -10%, var(--primary-soft), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--info-soft), transparent 60%), var(--bg); }
.login-box { width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 36px 32px 30px; box-shadow: var(--shadow-lg); text-align: center; }
.login-box .brand-mark { width: 44px; height: 44px; border-radius: 13px; margin-bottom: 14px; }
.login-box .brand-mark svg { width: 24px; height: 24px; }
.login-box h1 { font-size: 22px; }
.login-box .login-sub { color: var(--muted); margin: 4px 0 26px; }
.login-box .pill { position: relative; margin-bottom: 14px; }
.login-box .pill svg { position: absolute; left: 14px; top: 13px; width: 18px; height: 18px; color: var(--muted); }
.login-box input { height: 44px; border-radius: var(--r-md); padding: 0 14px 0 42px; }
.login-box button { width: 100%; height: 44px; border-radius: var(--r-md); margin-top: 8px; font-size: 15px; }
.login-box .error { background: var(--danger-soft); color: var(--danger); border-radius: var(--r-sm); padding: 9px 14px; margin: 0 0 16px; }

/* ---- 窄屏 ---- */
@media (max-width: 900px) {
  .app { flex-direction: column; }
  .side { width: 100%; height: auto; position: sticky; top: 0; z-index: 50; flex-direction: row; align-items: center; padding: 10px 12px; border-right: 0; border-bottom: 1px solid var(--border); gap: 8px; }
  .side .logo { padding: 0 6px 0 0; }
  .side .logo > span:last-child { display: none; }
  .side nav { flex-direction: row; overflow-x: auto; gap: 2px; }
  .menu-group { flex-direction: row; gap: 2px; }
  .menu-title { display: none; }
  .menu-item { width: auto; white-space: nowrap; height: 34px; }
  .side-foot { margin: 0; padding: 0; border: 0; }
  .side-foot .menu-item span { display: none; }
  .side .lang-switch { margin: 0; flex: none; }
  .side .lang-switch > svg { display: none; }
  .side .lang-switch a { padding: 5px 9px; }
  .content { padding: 18px 14px 32px; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { padding: 12px 14px; }
  .stat b { font-size: 19px; }
  .setting { grid-template-columns: 1fr; gap: 8px; }
  .form .row2 { grid-template-columns: 1fr; }
  .toolbar select, .toolbar input:not([type=checkbox]), .toolbar input.search { width: 100%; }
  #drawer .editor { top: 0; right: 0; bottom: 0; width: 100%; border-radius: 0; }
}
section > h3 { font-size: 14px; margin: 22px 0 10px; }
/* 语言切换：地球图标 + 分段按钮，当前语言是浮起的白色胶囊 */
.lang-switch { display: inline-flex; align-items: center; gap: 2px; padding: 3px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--border); font-size: 12.5px; line-height: 1; }
.lang-switch > svg { width: 15px; height: 15px; margin: 0 3px 0 7px; color: var(--muted); flex: none; }
.lang-switch a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); font-weight: 500; letter-spacing: .01em; white-space: nowrap; transition: background .18s, color .18s, box-shadow .18s; }
.lang-switch a:hover { color: var(--text); }
.lang-switch a.on { background: var(--surface); color: var(--text); font-weight: 600; box-shadow: 0 1px 2px rgba(15, 23, 42, .08), 0 0 0 1px var(--border); }
.lang-switch a:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.login-lang { position: fixed; top: 20px; right: 24px; z-index: 5; }
.login-lang .lang-switch { background: color-mix(in srgb, var(--surface) 70%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: var(--shadow-sm); }
.side .lang-switch { display: flex; margin: 10px 0 0; }
.side .lang-switch a { flex: 1; text-align: center; }
