/* 设计令牌：从 studio.goar.ai 线上 CSS 变量实抓（见 RECON.md §1） */
:root, [data-theme="light"] {
  --brand: #00c2b2;
  --brand-hover: #00a99b;
  --brand-soft: rgba(0, 194, 178, 0.12);
  --canvas: #f0f6f8;
  --surface: #ffffff;
  --surface-2: #f7fafb;
  --ink: #2a2e37;
  --text: #707682;
  --text-soft: #9aa1ad;
  --line: #e3e9ec;
  --destructive: #d64c43;
  --warning: #c47a00;
  --grad-brand: linear-gradient(135deg, #f16fb8, #ff784d);
  --r-sm: 4px; --r-md: 8px; --r-lg: 14px; --r-xl: 20px; --r-pill: 9999px;
  --sh-sm: 0 1px 2px rgba(20, 30, 40, 0.06);
  --sh-md: 0 4px 14px rgba(20, 30, 40, 0.08);
  --sh-lg: 0 12px 32px rgba(20, 30, 40, 0.14);
  --font: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  --sidebar-w: 232px;
  color-scheme: light;
}
[data-theme="dark"] {
  --canvas: #0d1218;
  --surface: #151c24;
  --surface-2: #1a222c;
  --ink: #eef2f6;
  --text: #9aa5b1;
  --text-soft: #6b7684;
  --line: #242e39;
  --brand-soft: rgba(0, 194, 178, 0.16);
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { color: var(--ink); font-weight: 600; margin: 0; }
a { color: var(--brand); text-decoration: none; }
button { font-family: inherit; }

/* ---------- 通用控件（shadcn 风） ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: var(--r-md); padding: 7px 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; transition: background .12s, border-color .12s;
}
.btn:hover { background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-hover); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--destructive); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--r-md); border: none; background: transparent;
  color: var(--text); cursor: pointer;
}
.icon-btn:hover { background: var(--brand-soft); color: var(--ink); }
.input, select.input, textarea.input {
  font-family: inherit; font-size: 13px; color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: var(--surface); padding: 7px 10px; outline: none;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 600; border-radius: var(--r-pill);
  padding: 2px 8px; background: var(--surface-2); color: var(--text);
  border: 1px solid var(--line);
}
.badge.live { background: #e7f8f5; color: #00857a; border-color: #b8ebe3; }
.badge.warn { background: #fdf3e2; color: #a3610a; border-color: #f3ddb0; }
.badge.off { background: #fbeceb; color: var(--destructive); border-color: #f2c8c5; }
[data-theme="dark"] .badge.live { background: rgba(0,194,178,.14); color: #2fd4c2; border-color: transparent; }
[data-theme="dark"] .badge.warn { background: rgba(196,122,0,.15); color: #e0a23c; border-color: transparent; }
[data-theme="dark"] .badge.off { background: rgba(214,76,67,.15); color: #ef8078; border-color: transparent; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--sh-sm);
}
.callout {
  border: 1px solid var(--line); border-left: 3px solid var(--brand);
  background: var(--surface); border-radius: var(--r-md); padding: 10px 14px; font-size: 13px;
}
.toast-wrap { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 300; }
.toast {
  background: var(--ink); color: var(--surface); padding: 10px 14px; border-radius: var(--r-md);
  font-size: 13px; box-shadow: var(--sh-lg); animation: toast-in .18s ease-out;
}
[data-theme="dark"] .toast { background: #eef2f6; color: #151c24; }
@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
.dialog-backdrop {
  position: fixed; inset: 0; background: rgba(15, 22, 30, .45); z-index: 200;
  display: flex; align-items: center; justify-content: center; animation: fade .12s ease-out;
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.dialog {
  background: var(--surface); border-radius: var(--r-xl); box-shadow: var(--sh-lg);
  width: min(680px, calc(100vw - 48px)); max-height: calc(100vh - 64px); overflow: auto;
  border: 1px solid var(--line);
}
.dialog h3 { font-size: 16px; }
.dialog .dlg-body { padding: 16px 20px 20px; }
.dialog .dlg-foot { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }

/* ---- Share / Publish：按 studio.devar.ai 发布弹窗实抓尺寸与层级复刻 ---- */
.dialog.share-dialog {
  width: min(512px, calc(100vw - 32px));
  max-height: calc(100dvh - 64px);
  padding: 24px;
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 32px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(42,46,55,.05), 0 16px 48px rgba(42,46,55,.13);
}
.dialog.share-dialog .share-dlg-head { position: relative; flex: 0 0 auto; padding-right: 24px; }
.share-dlg-head h2 { color: #1c2028; font-size: 20px; line-height: 20px; font-weight: 700; letter-spacing: -.025em; }
.share-dlg-head h2 .share-title-row { display: flex; align-items: center; gap: 8px; }
.share-dlg-head h2 svg { color: var(--brand); }
.share-dlg-head p { margin: 16px 0 0; color: #707682; font-size: 14px; line-height: 20px; font-weight: 400; }
.share-dlg-head a { color: var(--brand); font-weight: 500; text-underline-offset: 2px; }
.share-dlg-head a:hover { text-decoration: underline; }
.share-dlg-close {
  position: absolute; right: -8px; top: -8px; width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 2px; border: none; border-radius: 6px; background: transparent;
  color: #2a2e37; opacity: .7; cursor: pointer;
}
.share-dlg-close:hover { opacity: 1; background: var(--surface-2); }
.share-dlg-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: -4px; padding: 4px; }
.share-dlg-scroll::-webkit-scrollbar { width: 4px; }
.share-dlg-scroll::-webkit-scrollbar-thumb { background: #d7dde1; border-radius: 999px; }
.share-stack { display: flex; flex-direction: column; gap: 16px; }
.share-center { display: flex; justify-content: center; }
.share-qr-img, .share-qr-canvas {
  display: block; width: 192px; height: 192px; padding: 10px;
  background: #fff; border: 1px solid #e7ecef; border-radius: 14px;
  image-rendering: pixelated;
}
.share-empty-qr {
  width: 192px; height: 192px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 10px;
  border: 1px solid #e7ecef; border-radius: 14px;
  color: #707682; font-size: 12px; line-height: 16px;
}
.share-text-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 12px; border: 0; border-radius: 8px;
  background: transparent; color: #2a2e37; font-size: 14px; font-weight: 600; cursor: pointer;
}
.share-text-btn:hover { background: var(--surface-2); }
.share-timer {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 8px;
  border: 1px solid rgba(232, 81, 117, .30);
  background: rgba(232, 81, 117, .10);
  color: #2a2e37; font-size: 13px; line-height: 19.5px;
}
.share-timer .share-timer-label, .share-timer svg { color: #707682; }
.share-timer b { color: #1c2028; font-weight: 600; font-variant-numeric: tabular-nums; }
.share-plan-note {
  padding: 12px 16px; border-radius: 10px;
  border: 1px solid rgba(232, 81, 117, .18);
  background: rgba(232, 81, 117, .10);
  color: #707682; font-size: 13px; line-height: 19.5px; text-align: center;
}
.share-plan-note p { margin: 0; }
.share-plan-note p + p { margin-top: 6px; }
.share-plan-note a { color: #2a2e37; font-weight: 500; text-underline-offset: 2px; }
.share-plan-note a:hover { text-decoration: underline; }
.share-link-row { display: flex; gap: 8px; }
.share-link-row input {
  flex: 1 1 auto; min-width: 0; height: 40px;
  border: 1px solid #e7ecef; border-radius: 8px;
  background: var(--surface); color: #2a2e37;
  padding: 4px 14px; font-size: 14px; line-height: 20px; outline: none;
}
.share-copy-btn {
  flex: 0 0 40px; width: 40px; height: 40px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid #e7ecef; border-radius: 8px;
  background: var(--surface); color: #2a2e37; cursor: pointer;
}
.share-copy-btn:hover { background: var(--surface-2); }
.share-action-row { display: flex; flex-wrap: wrap; gap: 8px; }
.share-action {
  flex: 1 1 0; min-width: 0; height: 40px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 0; border-radius: 8px;
  background: #ebf9fc; color: #0a5c55;
  font-size: 14px; font-weight: 600; cursor: pointer;
  box-shadow: 0 1px 2px rgba(42,46,55,.06);
}
.share-action:hover { background: #dff4f8; }
.share-print-hint { margin: 0; color: #707682; font-size: 12px; line-height: 16px; }
.share-status {
  display: flex; align-items: center; justify-content: space-between;
  border-top: 1px solid #e7ecef; padding-top: 16px;
  color: #707682; font-size: 12px; line-height: 16px;
}
.share-open { display: inline-flex; align-items: center; gap: 4px; color: #2a2e37; font-weight: 500; }
.share-open:hover { text-decoration: underline; }
.share-publish-btn {
  height: 36px; padding: 0 16px; border: 0; border-radius: 8px;
  background: var(--brand); color: #fff; font-size: 13px; font-weight: 600; cursor: pointer;
}
.share-publish-btn:hover { background: var(--brand-hover); }
.share-download { position: relative; flex: 1 1 0; min-width: 0; }
.share-qr-menu {
  position: absolute; left: 0; bottom: calc(100% + 8px); z-index: 5;
  min-width: 222px; padding: 6px;
  background: var(--surface); border: 1px solid #e7ecef; border-radius: 10px;
  box-shadow: 0 12px 28px rgba(42,46,55,.16);
}
.share-qr-menu button {
  width: 100%; display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 10px; border: 0; border-radius: 7px;
  background: transparent; color: #2a2e37; text-align: left; cursor: pointer;
}
.share-qr-menu button:hover { background: var(--surface-2); }
.share-qr-menu strong { font-size: 13px; font-weight: 600; }
.share-qr-menu span { color: #707682; font-size: 12px; line-height: 16px; }
@media (max-width: 640px) {
  .dialog.share-dialog { align-self: flex-start; margin-top: 8vh; padding: 20px; gap: 24px; max-height: calc(100dvh - 12vh); }
  .share-dlg-close { right: -4px; top: -4px; }
  .share-qr-img, .share-qr-canvas, .share-empty-qr { width: 168px; height: 168px; }
  .share-action-row { flex-direction: column; }
}
.menu {
  position: fixed; z-index: 250; min-width: 180px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  box-shadow: var(--sh-md); padding: 4px;
}
.menu button {
  display: flex; width: 100%; align-items: center; gap: 8px;
  border: none; background: transparent; color: var(--ink); font-size: 13px;
  padding: 7px 10px; border-radius: var(--r-sm); cursor: pointer; text-align: left;
}
.menu button:hover { background: var(--surface-2); }
.menu button.danger { color: var(--destructive); }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; }
.tabs button {
  border: none; background: transparent; color: var(--text); font-size: 13px; font-weight: 500;
  padding: 8px 12px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs button.on { color: var(--ink); border-bottom-color: var(--brand); }

/* ---- 源站对齐：编辑器胶囊分段 tab / 浮动工具条 / 浮动场景条 ---- */
.tabs-seg { display:flex; gap:3px; background:var(--surface-2); border:1px solid var(--line); border-radius:10px; padding:3px; }
.tabs-seg button { border:none; background:transparent; color:var(--text); font-size:12.5px; font-weight:500; padding:6px 12px; border-radius:8px; cursor:pointer; white-space:nowrap; }
.tabs-seg button:hover { color:var(--ink); }
.tabs-seg button.on { background:var(--surface); color:var(--ink); font-weight:600; box-shadow:0 1px 3px rgba(16,24,40,.10); }
.tb-float { display:inline-flex; align-items:center; gap:4px; background:var(--surface); border:1px solid var(--line); border-radius:12px; box-shadow:0 4px 16px rgba(16,24,40,.10); padding:4px; }
.tb-seg { display:inline-flex; align-items:center; gap:6px; border:1px solid transparent; background:transparent; color:var(--text); font-size:13px; font-weight:500; padding:6px 11px; border-radius:9px; cursor:pointer; }
.tb-seg:hover { color:var(--ink); }
.tb-seg.on { background:var(--surface); border-color:var(--line); color:var(--ink); font-weight:600; box-shadow:0 1px 3px rgba(16,24,40,.10); }
.tb-ico { display:inline-flex; align-items:center; justify-content:center; width:32px; height:32px; border:1px solid transparent; background:transparent; color:var(--text); border-radius:9px; cursor:pointer; font-size:15px; }
.tb-ico:hover { color:var(--ink); background:var(--surface-2); }
.tb-ico.on { background:var(--surface); border-color:var(--line); color:var(--ink); box-shadow:0 1px 3px rgba(16,24,40,.10); }
.tb-ico:disabled, .tb-seg:disabled { opacity:.4; cursor:default; }
.tb-ico.mag { color:var(--brand); }
.tb-ico.mag.on { background:var(--brand-soft); border-color:var(--line); color:var(--brand); }
.tb-sep { width:1px; height:22px; background:var(--line); margin:0 2px; flex:0 0 auto; }
.save-state { font-size:12.5px; color:var(--text-soft); font-weight:500; }
.scene-strip { display:inline-flex; align-items:center; gap:8px; background:var(--surface); border:1px solid var(--line); border-radius:14px; box-shadow:0 4px 16px rgba(16,24,40,.10); padding:6px 10px; }
.grid { display: grid; gap: 12px; }
.muted { color: var(--text-soft); font-size: 12px; }
.row { display: flex; align-items: center; gap: 8px; }
.spread { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.hidden { display: none !important; }

/* ---------- SPA 外壳（对齐源站：浅灰画布 + 白卡片浮起侧栏 + 留间隙） ---------- */
.shell { display: flex; height: 100vh; overflow: hidden; background: var(--canvas); gap: 12px; padding: 12px; box-sizing: border-box; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 auto; background: var(--surface);
  border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--sh-sm, 0 1px 3px rgba(16,24,40,.06));
  display: flex; flex-direction: column; padding: 16px 10px; margin: 0;
}
.sidebar .logo { display: flex; align-items: center; gap: 8px; padding: 4px 8px 14px; }
.sidebar .logo b { color: var(--ink); font-size: 15px; letter-spacing: -0.2px; }
.sidebar .logo .mark {
  width: 26px; height: 26px; border-radius: 8px; background: var(--grad-brand);
  display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 13px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%;
  border: none; background: transparent; color: var(--text); font-size: 13px; font-weight: 500;
  padding: 8px 10px; border-radius: var(--r-md); cursor: pointer; text-align: left;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.on { background: var(--brand-soft); color: var(--ink); }
.nav-item svg { flex: 0 0 auto; }
.sidebar .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
/* 侧栏折叠（对齐源站：展开 232px → 折叠 64px。折叠后仅菜单项变图标；logo 行与底部按钮收敛为图标，plan-card 隐藏；顶部/底部 New experience 收敛为圆形 +） */
.sidebar { transition: width .2s ease; overflow: hidden; }
.sidebar.collapsed { width: 64px; padding: 12px 8px; }
/* logo 行：折叠后 mark 居中，隐藏文字 */
.sidebar.collapsed .row { justify-content: center; padding: 2px 0 10px; flex-direction: column; gap: 8px; }
.sidebar.collapsed .row .mark { flex: 0 0 auto; }
.sidebar.collapsed .row b { display: none; }
/* 抽屉式折叠按钮（与管理后台统一）：正方形、淡红底、位于 logo 区域右边缘、一半压侧栏 */
.side-toggle {
  position: fixed; left: 228px; top: 45px; z-index: 60;
  width: 32px; height: 43px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  color: var(--brand, #00c2b2);
  transition: left .2s ease, background .15s;
}
.side-toggle:hover { background: var(--brand-soft, rgba(0,194,178,.12)); }
.side-toggle svg { width: 24px; height: 24px; stroke-width: 2.6; }
/* 折叠态：侧栏宽 64 + shell padding 12 → 右边缘 76，按钮中心压边 → left 60 */
.sidebar.collapsed ~ .side-toggle { left: 60px; }
/* 菜单项：仅图标，居中 */
.sidebar.collapsed .nav-item { justify-content: center; padding: 8px; }
.sidebar.collapsed .nav-item > span { display: none; }
/* 底部 plan-card：折叠隐藏（源站折叠态底部仅留 + 圆形按钮） */
.sidebar.collapsed .plan-card { display: none; }
/* 底部 New experience：折叠收敛为 42px 圆形 + */
.sidebar.collapsed .side-foot .btn { width: 42px; height: 42px; padding: 0; justify-content: center; font-size: 18px; border-radius: 10px; }
.sidebar.collapsed .side-foot .btn .btn-lbl { display: none; }
.plan-card {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 10px; font-size: 12px;
}
.plan-card b { color: var(--ink); display: block; margin-bottom: 2px; }
.main { flex: 1; overflow: auto; padding: 26px 34px 60px; }
.main-editor { padding: 0; overflow: hidden; }
.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.page-head h1 { font-size: 20px; }
.page-head .sub { font-size: 13px; margin-top: 3px; }
.section { margin-bottom: 26px; }
.section h2 { font-size: 15px; margin-bottom: 10px; }
.kv { display: grid; grid-template-columns: 200px 1fr; gap: 6px 16px; font-size: 13px; }
.kv dt { color: var(--text-soft); }
.kv dd { margin: 0; color: var(--ink); font-weight: 500; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
table.tbl th { text-align: left; color: var(--text-soft); font-weight: 500; font-size: 12px; padding: 8px 10px; border-bottom: 1px solid var(--line); }
table.tbl td { padding: 10px; border-bottom: 1px solid var(--line); color: var(--ink); }
.check-yes { color: var(--brand); font-weight: 700; }
.progress { height: 8px; border-radius: var(--r-pill); background: var(--surface-2); overflow: hidden; border: 1px solid var(--line); }
.progress > i { display: block; height: 100%; background: var(--brand); border-radius: var(--r-pill); }
.file-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.file-card { border: 1px solid var(--line); border-radius: var(--r-md); padding: 10px; background: var(--surface); }
.file-card .thumb { height: 64px; border-radius: var(--r-sm); background: var(--surface-2); display: flex; align-items: center; justify-content: center; font-size: 20px; margin-bottom: 8px; overflow: hidden; }
.file-card .thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.file-card b { display: block; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.file-card .muted { margin-top: 2px; }

/* 类型选择卡 */
.type-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.type-card {
  border: 1.5px solid var(--line); border-radius: var(--r-lg); padding: 14px; cursor: pointer;
  background: var(--surface); text-align: left; font-family: inherit;
}
.type-card:hover { border-color: var(--brand); background: var(--brand-soft); }
.type-card .ico { font-size: 20px; margin-bottom: 8px; }
.type-card b { display: block; color: var(--ink); font-size: 13px; margin-bottom: 3px; }
.type-card span { font-size: 12px; color: var(--text); }

/* 源站对齐：Resize content panel 分割条 hover */
#ed-splitter:hover, #ed-splitter:active { background:rgba(16,24,40,.12); }

/* 源站对齐：range/checkbox/radio 控件品牌青绿 */
input[type="range"], input[type="checkbox"], input[type="radio"] { accent-color: var(--brand); }

/* Interface 左栏行：hover 背景 + action 按钮悬停显示（源站 group-hover 对齐） */
.if-row { transition: background-color .15s cubic-bezier(0,0,0.2,1); }
.if-row:hover { background: #eef1f3; }
.if-row .if-ctl { opacity: 0; transition: opacity .15s cubic-bezier(0,0,0.2,1); }
.if-row:hover .if-ctl { opacity: 1; }
.if-ctl[aria-pressed="true"] { opacity: 1; }
@keyframes b-spin { to { transform: rotate(360deg); } }
@keyframes b-bounce { 0%, 80%, 100% { transform: translateY(0); opacity: .45; } 40% { transform: translateY(-6px); opacity: 1; } }
@keyframes b-pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.55); opacity: .5; } }

@keyframes dvr-spin { to { transform: rotate(360deg); } }

/* ===== 居中对话框（登录/注册、二维码、版本等弹窗） ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(12, 17, 24, 0.62);
  display: flex; align-items: center; justify-content: center;
  padding: 18px;
}
.modal-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-lg);
  width: 400px; max-width: 94vw;
  max-height: 92vh; overflow-y: auto;
  padding: 24px 26px 20px;
  text-align: center;
}
.modal-box h3 { margin: 0 0 6px; font-size: 20px; font-weight: 700; color: var(--ink); }
.modal-actions { display: flex; gap: 8px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }

/* 登录/注册对话框细节 */
.am-logo {
  width: 46px; height: 46px; border-radius: 13px;
  background: var(--grad-brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 23px; font-weight: 800; margin: 0 auto 12px;
  box-shadow: var(--sh-sm);
}
.am-tabs { display: flex; gap: 6px; justify-content: center; margin: 14px 0 16px; flex-wrap: wrap; }
.am-tab {
  border: 1px solid var(--line); background: transparent; color: var(--text);
  border-radius: var(--r-pill); padding: 5px 14px; font-size: 12.5px; cursor: pointer;
  transition: background .12s, color .12s, border-color .12s;
}
.am-tab.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.am-field {
  display: flex; align-items: center; gap: 9px; text-align: left;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface); padding: 0 12px; margin-bottom: 10px;
  transition: border-color .15s, box-shadow .15s;
}
.am-field:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.am-ico { display: inline-flex; flex: none; color: var(--text-soft); }
.am-field .input, .am-wx-phone .input { flex: 1; min-width: 0; border: none; box-shadow: none; padding: 9px 0; background: transparent; }
.am-field .input:focus, .am-wx-phone .input:focus { box-shadow: none; }
.am-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text); cursor: pointer; user-select: none; }
.am-check input { accent-color: var(--brand); }
#am-forgot, .am-switch a { color: var(--brand); font-size: 12.5px; text-decoration: none; font-weight: 600; }
.am-big {
  width: 100%; justify-content: center;
  padding: 10px 0; font-size: 15px; font-weight: 700; letter-spacing: 3px;
  border-radius: 10px; margin-top: 10px;
}
.am-big .am-ico-inline { margin-right: 6px; }
.am-switch { margin: 14px 0 0; font-size: 12.5px; color: var(--text); }
.am-msg { margin: 10px 0 0; font-size: 12.5px; min-height: 16px; text-align: left; }
.am-wx-qr { display: flex; justify-content: center; align-items: center; min-height: 48px; padding: 10px; background: #fff; border: 1px solid var(--line); border-radius: 12px; margin: 6px 0 12px; }
.am-wx-phone { border: 1px dashed var(--line); border-radius: 10px; padding: 10px 12px; text-align: left; margin-top: 14px; }
/* ---------- Plans 页细节（对齐源站） ---------- */
.price { font-size: 26px; letter-spacing: -0.5px; }
/* popular 卡四角 teal 取景框括号（源站 Pro 卡特有） */
.pcorners i { position: absolute; width: 18px; height: 18px; border: 3px solid var(--brand); }
.pcorners .c1 { top: -9px; left: -9px; border-right: none; border-bottom: none; border-top-left-radius: 10px; }
.pcorners .c2 { top: -9px; right: -9px; border-left: none; border-bottom: none; border-top-right-radius: 10px; }
.pcorners .c3 { bottom: -9px; left: -9px; border-right: none; border-top: none; border-bottom-left-radius: 10px; }
.pcorners .c4 { bottom: -9px; right: -9px; border-left: none; border-top: none; border-bottom-right-radius: 10px; }
/* 计划卡功能列表：虚线分隔（源站样式） */
.pcard .feat { display: flex; gap: 10px; align-items: flex-start; font-size: 13px; color: var(--ink); padding: 9px 2px; border-bottom: 1px dashed var(--line); }
.pcard .feat:last-child { border-bottom: none; }
/* compare 表列高亮：Pro 列 popular 常亮，其余列随卡片悬停联动 */
#p-tbl .col-hi { background: rgba(0, 194, 178, 0.08); }

/* ---------- 移动端自适应（安卓窄屏 ≤860px，对齐源站移动布局） ---------- */
@media (max-width: 860px) {
  .shell { padding: 8px; gap: 8px; }
  /* 侧栏收敛为 64px 图标栏（导航可用，无需折叠按钮） */
  .sidebar { width: 64px !important; padding: 12px 8px; }
  .sidebar .row { justify-content: center; padding: 2px 0 12px; flex-direction: column; gap: 6px; }
  .sidebar .row b, .sidebar .plan-card { display: none; }
  /* 移动端侧栏固定 64px，折叠按钮固定在右边缘压边位置 */
  .side-toggle, .sidebar.collapsed ~ .side-toggle { left: 60px; }
  .nav-item { justify-content: center; padding: 8px; }
  .nav-item > span { display: none; }
  .side-foot .btn { width: 42px; height: 42px; padding: 0; justify-content: center; font-size: 18px; }
  .side-foot .btn .btn-lbl { display: none; }
  .main { padding: 18px 14px 50px; }
  /* 计划卡：单卡占满、横向 snap 滑动（源站移动端形态） */
  #p-cards { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 18px; scrollbar-width: none; }
  #p-cards::-webkit-scrollbar { display: none; }
  #p-cards > .pcard { flex: 0 0 86%; scroll-snap-align: center; }
  #p-cards .price { font-size: 34px !important; }
  /* compare 表：横向滑动查看各列（对齐源站移动端） */
  .tbl-wrap { overflow-x: auto; }
  #p-tbl { min-width: 560px; }
  /* chips 行允许换行，杜绝主区横向溢出（保持整页单滚动条） */
  #p-chips { flex-wrap: wrap; }
}

/* ---------- 管理后台（宝塔风格控制台） ---------- */
.adm-top { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.adm-title { flex: 1; min-width: 0; }
.adm-avatar { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line); background: var(--grad-brand); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; cursor: pointer; flex: 0 0 auto; }
.adm-tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.adm-tab { border: none; background: none; padding: 9px 14px; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.adm-tab:hover { color: var(--ink); }
.adm-tab.on { color: var(--brand); font-weight: 600; border-bottom-color: var(--brand); }
.adm-body { min-height: 400px; }
.adm-loading { padding: 40px 0; text-align: center; color: var(--text-soft); font-size: 13px; }
/* 状态卡网格（宝塔首页式：宽屏 3 列 × 2 行，窄屏 1 列） */
.adm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.adm-grid > .adm-span-4:nth-child(1) { grid-column: 1; }
.adm-grid > .adm-span-4:nth-child(2) { grid-column: 2; }
.adm-grid > .adm-span-4:nth-child(3) { grid-column: 3; }
.adm-grid > .adm-span-4:nth-child(4) { grid-column: 1; grid-row: 2; }
.adm-grid > .adm-span-4:nth-child(5) { grid-column: 2; grid-row: 2; }
.adm-grid > .adm-span-4:nth-child(6) { grid-column: 3; grid-row: 2; }
.adm-grid > .adm-span-4 > .adm-stat { height: 100%; }
.adm-stat { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.adm-stat-label { font-size: 12px; color: var(--text-soft); }
.adm-stat-value { font-size: 24px; font-weight: 700; color: var(--ink); margin-top: 4px; letter-spacing: -0.5px; }
.adm-stat-sub { font-size: 11.5px; color: var(--text-soft); margin-top: 4px; }
/* 双栏卡片 */
.adm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 16px; }
.adm-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; }
.adm-card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 13.5px; }
/* 常用工具宫格（宝塔工具卡） */
.adm-tools { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.adm-tool { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); cursor: pointer; font-size: 12.5px; color: var(--ink); font-weight: 500; }
.adm-tool:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.adm-tool i { font-size: 20px; color: var(--brand); font-style: normal; line-height: 1; }
/* 状态徽标 */
.st { display: inline-block; padding: 2px 8px; border-radius: var(--r-pill); font-size: 11px; font-weight: 600; }
.st-ok { background: #e7f8f5; color: #00857a; }
.st-warn { background: #fdf3e2; color: #a3610a; }
.st-bad { background: #fbeceb; color: var(--destructive); }
.st-info { background: var(--surface-2); color: var(--text-soft); }
/* 批量操作条（危险区） */
.adm-bulk-bar { display: flex; align-items: center; gap: 10px; padding: 10px 12px; background: #fdf6f6; border: 1px solid #f5dcdc; border-radius: 8px; margin-bottom: 12px; flex-wrap: wrap; }
/* 系统状态行 */
.adm-sysrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.adm-sysrow:last-child { border-bottom: none; }
.adm-dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; }
.adm-dot.ok { background: var(--brand); }
.adm-dot.bad { background: var(--destructive); }
/* 管理后台响应式 */
@media (max-width: 860px) {
  .adm-grid { grid-template-columns: 1fr; }
  .adm-grid > .adm-span-4:nth-child(n) { grid-column: auto; grid-row: auto; }
  .adm-two { grid-template-columns: 1fr; }
  .adm-tools { grid-template-columns: repeat(3, 1fr); }
}

/* ============================================================
   管理后台 · 宝塔风格外壳（SPA 内纯管理页，隐藏主站旧侧栏）
   左侧深色可折叠菜单 + 返回首页 + 右侧内容大栏
   ============================================================ */
/* 管理后台铺满全屏（去掉主站 .shell 的 padding/gap），右侧内容区自适应剩余宽度 */
#app.app-admin { padding: 0; gap: 0; }
.adm-shell { position: relative; display: flex; width: 100%; height: 100vh; overflow: hidden; background: #f0f2f5; }
.adm-side {
  width: 220px; flex: 0 0 auto; display: flex; flex-direction: column;
  background: #2b3038; color: #c9d0da; transition: width .2s ease; overflow: hidden;
}
.adm-shell.collapsed .adm-side { width: 62px; }
.adm-side-head {
  display: flex; align-items: center; gap: 8px; height: 56px; padding: 0 14px;
  border-bottom: 1px solid rgba(255,255,255,.07); flex: 0 0 auto;
}
.adm-side-logo { display: flex; align-items: center; gap: 9px; min-width: 0; flex: 1; }
.adm-side-mark {
  width: 30px; height: 30px; flex: 0 0 auto; border-radius: 8px;
  background: linear-gradient(135deg,#20a9c9,#00c2b2); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 16px;
}
.adm-side-name { font-size: 14px; font-weight: 700; color: #fff; white-space: nowrap; }
.adm-side-toggle {
  flex: 0 0 auto; width: 28px; height: 28px; display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,.15); background: rgba(255,255,255,.05); color: #c9d0da;
  border-radius: 6px; cursor: pointer;
}
.adm-side-toggle:hover { background: rgba(255,255,255,.13); color: #fff; }
.adm-back {
  display: flex; align-items: center; gap: 9px; margin: 10px 10px 4px; padding: 9px 12px;
  border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.04); color: #c9d0da;
  border-radius: 7px; cursor: pointer; font-size: 13px; flex: 0 0 auto; white-space: nowrap;
}
.adm-back:hover { background: rgba(255,255,255,.1); color: #fff; }
.adm-nav { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; flex: 1; overflow-y: auto; }
/* 菜单分组标签（站点管理 / 支付平台） */
.adm-nav-group { padding: 12px 12px 5px; font-size: 10.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: #64748b; white-space: nowrap; }
.adm-shell.collapsed .adm-nav-group { text-align: center; padding: 12px 0 5px; font-size: 0; }
.adm-shell.collapsed .adm-nav-group::after { content: '•••'; font-size: 8px; letter-spacing: 1px; }
.adm-nav-item {
  display: flex; align-items: center; gap: 11px; width: 100%; padding: 10px 12px;
  border: none; background: transparent; color: #b8c0cc; font-size: 13px; font-weight: 500;
  border-radius: 7px; cursor: pointer; text-align: left; white-space: nowrap;
}
.adm-nav-item svg { flex: 0 0 auto; }
.adm-nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.adm-nav-item.on { background: #00c2b2; color: #fff; font-weight: 600; }
.adm-side-foot { padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.07); flex: 0 0 auto; }
.adm-side-ver { font-size: 11px; color: #6b7480; white-space: nowrap; }
/* 折叠态：只留图标，隐藏所有文字；toggle 保留可点 */
.adm-shell.collapsed .adm-side-name,
.adm-shell.collapsed .adm-back span,
.adm-shell.collapsed .adm-nav-item span,
.adm-shell.collapsed .adm-side-ver { display: none; }
.adm-shell.collapsed .adm-side-head { justify-content: center; padding: 10px 0; flex-direction: column; gap: 6px; height: auto; }
.adm-shell.collapsed .adm-side-toggle { margin: 0; }
.adm-shell.collapsed .adm-back { justify-content: center; padding: 9px 0; margin: 10px 8px 4px; }
.adm-shell.collapsed .adm-nav-item { justify-content: center; padding: 10px 0; }
/* 抽屉式折叠按钮（与主页统一）：正方形、淡红底、位于 logo 与返回首页中间、一半压侧栏边缘 */
.adm-drawer {
  position: absolute; left: 204px; top: 40px; z-index: 50;
  width: 32px; height: 43px; padding: 0;
  display: flex; align-items: center; justify-content: center;
  background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer;
  color: var(--brand, #00c2b2);
  transition: left .2s ease, background .15s;
}
.adm-drawer:hover { background: var(--brand-soft, rgba(0,194,178,.12)); }
.adm-drawer svg { width: 24px; height: 24px; stroke-width: 2.6; }
/* 折叠态侧栏宽 62 → 右边缘 62，按钮中心压边 → left 46 */
.adm-shell.collapsed .adm-drawer { left: 46px; }
.adm-main { flex: 1; min-width: 0; overflow: auto; padding: 22px 26px 60px; }
/* 外壳接管菜单后，隐藏 pageAdmin 自带的顶部标题与横向 tab，只留内容体 */
.adm-shell .adm-main > .adm-top,
.adm-shell .adm-main > .adm-tabs { display: none; }
.adm-shell .adm-main > .adm-body { display: block; }
