/* 渊海贴吧 · 实用后台 */
:root {
  --bg: #121417;
  --bg-elev: #1a1e24;
  --bg-soft: #232830;
  --line: #2e3540;
  --line-strong: #4a5564;
  --text: #d8dde6;
  --muted: #8b95a5;
  --accent: #3d8fd1;
  --accent-ink: #e8ecf2;
  --accent-2: #5aa0d8;
  --warn: #d4a017;
  --danger: #d06060;
  --ok: #4cb38a;
  --radius: 4px;
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --display: "Microsoft YaHei", "PingFang SC", sans-serif;
  --mono: Consolas, "Courier New", "IBM Plex Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 13px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

.app {
  display: grid;
  grid-template-columns: 200px 1fr;
  min-height: 100vh;
}

.sidebar {
  padding: 12px 10px;
  border-right: 1px solid var(--line);
  background: #0e1014;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 4px 2px 10px;
  border-bottom: 1px solid var(--line);
}
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 3px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line-strong);
}
.brand-mark svg { display: block; width: 100%; height: 100%; }
.brand-name {
  font-family: var(--display);
  font-weight: 700;
  letter-spacing: 0;
  font-size: 16px;
  color: var(--accent-ink);
  line-height: 1.2;
}
.brand-sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  letter-spacing: 0;
}

.nav { display: flex; flex-direction: column; gap: 1px; }
.nav-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
  padding: 7px 8px;
  border-radius: 3px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.nav-item:hover { color: var(--text); background: var(--bg-soft); }
.nav-item.active {
  color: #fff;
  background: #2a5f8f;
}

.sidebar-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.skin-picker {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: var(--muted);
}
.skin-picker select {
  width: 100%;
  min-height: 30px;
  font: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 4px 6px;
}
.svc {
  font-size: 12px;
  padding: 6px 8px;
  border-radius: 3px;
  text-align: center;
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--mono);
  line-height: 1.35;
  white-space: normal;
  word-break: break-all;
}
.svc.active { color: #7dcea0; border-color: #3a6b52; background: #152820; }
.svc.inactive { color: #e0a0a0; border-color: #6b3a3a; background: #281515; }
.svc.guest {
  color: var(--muted);
  border: 1px dashed var(--line-strong);
  background: transparent;
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.06em;
}
.svc.unknown { color: var(--muted); }

.main { padding: 16px 20px 32px; max-width: 1100px; }

.site-announce {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid rgba(29, 122, 214, 0.35);
  background: linear-gradient(90deg, rgba(29, 122, 214, 0.12), rgba(30, 200, 168, 0.1));
  color: var(--text);
  font-size: 14px;
  line-height: 1.45;
}
.site-announce--auth {
  margin: 0 0 12px;
  font-size: 13px;
}
.site-announce-label {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.site-announce-qq {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}
.site-announce-qq:hover {
  text-decoration: underline;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.topbar h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
}

.panel { display: none; }
.panel.active { display: block; }

.stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.stat {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 12px;
}
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 10px; }
.card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 10px;
}
.card-h {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.card-h h2 {
  margin: 0;
  font-family: var(--display);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0;
  color: var(--text);
  border-left: 3px solid var(--accent);
  padding-left: 8px;
}
.muted { color: var(--muted); font-size: 12px; }

.btn {
  appearance: none;
  border: 1px solid var(--line-strong);
  background: var(--bg-soft);
  color: var(--text);
  padding: 6px 12px;
  border-radius: 3px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.btn:hover {
  border-color: var(--accent);
  background: #2a3140;
}
.btn:active { background: #1e2430; }
.btn.primary {
  background: #2a6db0;
  border-color: #1e5a96;
  color: #fff;
  font-weight: 600;
}
.btn.primary:hover { filter: none; background: #3480c8; }
.btn.ghost {
  background: transparent;
  border-color: var(--line);
}
.btn.ghost:hover { border-color: var(--line-strong); background: var(--bg-soft); }
.btn.danger { border-color: #8a4040; color: #e8a0a0; }
.btn.block { width: 100%; }
.btn-row { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.form-row, .form-grid { display: grid; gap: 10px; }
.form-row { grid-template-columns: 1fr 1fr auto; align-items: end; }
.form-row-post { grid-template-columns: minmax(180px, 1fr) minmax(160px, 1.2fr) auto; align-items: end; }
.form-row-vi-account {
  grid-template-columns: minmax(240px, 1fr) auto;
  align-items: end;
}
.vi-account-label { display: flex; flex-direction: column; gap: 4px; }
.vi-account-label select {
  width: 100%;
  min-height: 34px;
  cursor: pointer;
}
.post-preview {
  min-height: 34px;
  padding: 7px 10px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg);
  display: flex;
  align-items: center;
  font-size: 13px;
}
.post-preview.ok { border-color: #3a6b52; color: #7dcea0; }
.post-preview.err { border-color: #6b3a3a; color: #e0a0a0; }
.form-grid { grid-template-columns: 1fr 1fr; }
.form-grid .span-2 { grid-column: 1 / -1; }
label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--muted); }
label span { color: var(--muted); }
label em { font-style: normal; font-size: 11px; color: #6a7382; }
label.check {
  flex-direction: row;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  max-width: 100%;
}
label.check span {
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
label.check input[type="checkbox"] {
  appearance: auto;
  -webkit-appearance: checkbox;
  width: 14px;
  height: 14px;
  min-width: 14px;
  margin-top: 2px;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--accent);
  cursor: pointer;
}
input:not([type="checkbox"]):not([type="radio"]),
select,
textarea {
  appearance: none;
  width: 100%;
  background: #0e1014;
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 3px;
  padding: 7px 9px;
  font: inherit;
  font-size: 13px;
}
input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: none;
}
textarea { font-family: var(--mono); font-size: 12px; line-height: 1.45; resize: vertical; }
.form-actions { display: flex; gap: 6px; margin-top: 6px; }
.hint { color: var(--muted); font-size: 12px; line-height: 1.5; }
.hint code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--bg);
  padding: 1px 4px;
  border-radius: 2px;
  border: 1px solid var(--line);
}
.ck-qr-box {
  margin: 4px 0 8px;
  padding: 12px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}
.ck-qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: flex-start;
}
.ck-qr-box img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  background: #fff;
  border: 1px solid var(--line);
}
.ck-qr-meta { flex: 1; min-width: 200px; }
.ck-qr-name, .ck-qr-auto {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
}
.ck-qr-auto {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}
.ck-qr-name input {
  max-width: 280px;
}

.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  text-align: left;
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
}
.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
  background: var(--bg-soft);
}
.table td code { font-family: var(--mono); font-size: 12px; }

.rank-list, .history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 360px;
  overflow: auto;
}
.rank-item, .hist-item {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-radius: 3px;
  background: var(--bg);
  border: 1px solid var(--line);
}
.rank-item { grid-template-columns: 1fr auto; align-items: center; }
.rank-item .bar { font-weight: 600; }
.rank-item .pid { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.rank-pill {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  min-width: 44px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 2px;
  background: var(--bg-elev);
  border: 1px solid var(--line);
}
.rank-pill.good { color: #7dcea0; border-color: #3a6b52; }
.rank-pill.mid { color: #e0c070; border-color: #6b5a2a; }
.rank-pill.bad { color: #e0a0a0; border-color: #6b3a3a; }
.hist-item .meta { font-size: 12px; color: var(--muted); }
.hist-item .text { font-size: 13px; }

.vi-preview-wrap { margin-bottom: 12px; }
.vi-preview-bg {
  width: 100%;
  max-width: 360px;
  aspect-ratio: 1;
  border-radius: 3px;
  border: 1px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: #1e2732;
  position: relative;
}
.vi-preview-bg img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  opacity: 1;
}
.vi-preview-empty { font-size: 13px; padding: 14px; text-align: center; color: var(--muted); }

/* 贴吧主页真机布局：粉头图 + 居中大白卡（上传图铺满白卡） */
.tb-home-demo { max-width: 320px; }
.tb-home-demo[hidden] { display: none !important; }
.tb-phone {
  position: relative;
  background: #f3f0f8;
  color: #222;
  border: 1px solid #cfc8d8;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}
.tb-status {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 10px 0;
  font-size: 10px;
  color: #fff;
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 5;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}
.tb-banner {
  position: relative;
  height: 248px;
  background: #ff1493;
  overflow: hidden;
}
.tb-banner-deco {
  position: absolute;
  left: 8px;
  bottom: 48px;
  font-size: 52px;
  font-weight: 800;
  letter-spacing: 4px;
  color: rgba(255, 255, 255, 0.16);
  line-height: 1;
  pointer-events: none;
  user-select: none;
}
.tb-back {
  appearance: none;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 26px;
  line-height: 1;
  position: absolute;
  left: 6px;
  top: 22px;
  z-index: 6;
  cursor: default;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
/* 真机：白卡靠右上；加大显示区减少缩放发糊 */
.tb-vi-card {
  position: absolute;
  top: 30px;
  right: 8px;
  z-index: 2;
  width: 210px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.tb-vi-card-tag {
  position: absolute;
  top: 8px;
  left: 8px;
  z-index: 2;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 3px;
  background: rgba(120, 120, 120, 0.55);
  color: #fff;
}
.tb-vi-card-media {
  width: 100%;
  height: 168px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.tb-vi-card-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}
.tb-vi-card-media img[hidden] { display: none !important; }
.tb-vi-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 12px 12px;
  box-sizing: border-box;
  text-align: center;
  background: #faf9fc;
}
.tb-vi-placeholder[hidden] { display: none !important; }
.tb-vi-ph-title {
  font-size: 15px;
  font-weight: 700;
  color: #222;
  line-height: 1.3;
}
.tb-vi-ph-sub {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}
.tb-vi-ph-btn {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #333;
  background: #ffd84d;
  padding: 7px 16px;
  border-radius: 16px;
  line-height: 1.2;
}
/* 相对整屏粉头图居中；贴在粉区底部内侧，避免掉进下方白底看不清 */
.tb-banner-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 22px;
  z-index: 4;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  pointer-events: none;
}
.tb-body {
  background: #fff;
  padding: 0 12px 10px;
  position: relative;
  z-index: 2;
}
.tb-identity {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: -22px;
}
.tb-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, #7b6cff, #5a4ed6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  font-weight: 700;
  border: 3px solid #fff;
  flex-shrink: 0;
  box-shadow: 0 1px 4px rgba(0,0,0,.12);
}
.tb-actions { display: flex; gap: 6px; padding-bottom: 2px; }
.tb-btn-follow,
.tb-btn-msg {
  appearance: none;
  border: 0;
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 14px;
  cursor: default;
  line-height: 1.2;
}
.tb-btn-follow { background: #7b6cff; color: #fff; }
.tb-btn-msg {
  background: #fff;
  color: #7b6cff;
  border: 1px solid #7b6cff;
}
.tb-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
}
.tb-nick {
  font-size: 17px;
  font-weight: 700;
  color: #1a1a1a;
}
.tb-lv {
  font-size: 10px;
  color: #7b6cff;
  background: #efeaff;
  border-radius: 3px;
  padding: 1px 5px;
  font-weight: 600;
}
.tb-meta {
  margin-top: 4px;
  font-size: 11px;
  color: #999;
}
.tb-sign-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
  font-size: 12px;
}
.tb-sign { color: #999; }
.tb-about { color: #666; white-space: nowrap; }
.tb-stats {
  display: flex;
  gap: 14px;
  margin-top: 10px;
  font-size: 12px;
  color: #888;
}
.tb-stats b { color: #222; font-size: 14px; margin-right: 2px; }
.tb-tabs {
  display: flex;
  gap: 18px;
  margin-top: 12px;
  border-bottom: 1px solid #f0eef5;
  font-size: 13px;
  color: #888;
}
.tb-tabs span { padding: 0 0 8px; }
.tb-tabs .on {
  color: #222;
  font-weight: 700;
  box-shadow: inset 0 -2px 0 #7b6cff;
}
.tb-empty {
  background: #f6f3fb;
  margin: 0 -12px;
  padding: 28px 12px 32px;
  text-align: center;
}
.tb-empty-art {
  width: 64px;
  height: 64px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #ffe56a;
  color: #5a4ed6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: 0 4px 0 #7b6cff33;
}
.tb-empty-text { font-size: 13px; color: #888; }
.tb-home-caption {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.4;
}
/* 游客与开通用户都用贴吧实景；旧预览条隐藏 */
#viPreviewBg { display: none !important; }
#viTbHomeDemo { display: block !important; }
.vi-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 12px;
  margin: 0 0 12px;
}
.vi-meta > div { display: flex; gap: 6px; font-size: 12px; }
.vi-meta dt { color: var(--muted); min-width: 56px; }
.vi-meta dd { margin: 0; word-break: break-all; font-family: var(--mono); font-size: 12px; }

.log {
  margin: 0;
  padding: 8px 10px;
  background: #0a0c0f;
  border-radius: 3px;
  border: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 12px;
  color: #9aa8b8;
  max-height: 220px;
  overflow: auto;
  white-space: pre-wrap;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  padding: 7px 11px;
  border-radius: 3px;
  font-size: 13px;
  max-width: 420px;
}
.toast.ok { border-color: #3a6b52; color: #7dcea0; }
.toast.err { border-color: #6b3a3a; color: #e0a0a0; }

.steps { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.65; }
.steps strong { color: var(--text); }

.account-check-list { display: flex; flex-direction: column; gap: 4px; }
.account-check-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
  cursor: pointer;
}
.account-check-item input { width: 14px; height: 14px; }
.account-check-item .acc-check-name { font-weight: 600; flex: 1; }
.account-check-item .acc-check-meta { font-size: 12px; }
.pub-bar-list { max-height: 260px; overflow: auto; }
.pub-bar-item { cursor: default; }
.pub-bar-item .pub-bar-label {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
  margin: 0;
}
.pub-bar-item .pub-bar-rm {
  flex: 0 0 auto;
  padding: 2px 10px;
  min-height: 28px;
}

.acc-status-ok { color: #7dcea0; }
.acc-status-bad { color: #e0a0a0; }
.acc-status-mid { color: #e0c070; }
.acc-status-detail { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }

.captcha-preview {
  min-height: 56px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: var(--bg);
}
.captcha-preview img {
  max-height: 64px;
  image-rendering: pixelated;
  background: #fff;
  border-radius: 2px;
}
.pub-img-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
}
.pub-img-preview .pub-img-item {
  position: relative;
  width: 72px;
  height: 72px;
}
.pub-img-preview img {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 2px;
  border: 1px solid var(--line);
  background: #111;
  display: block;
}
.pub-img-preview .pub-img-rm {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 22px;
  height: 22px;
  padding: 0;
  line-height: 20px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--card, #fff);
  color: inherit;
  cursor: pointer;
  font-size: 14px;
}

[data-admin-only] { display: none !important; }
/* 管理员显示所有 data-admin-only（含卡片；原先只放开了 nav/btn/svc） */
body.is-admin [data-admin-only] {
  display: block !important;
}
body.is-admin button.nav-item[data-admin-only] {
  display: flex !important;
}
body.is-admin .card[data-admin-only] {
  display: block !important;
}
/* 面板切换优先于 data-admin-only，避免管理员看到所有 Tab 叠在一起 */
body.is-admin .panel[data-admin-only]:not(.active) {
  display: none !important;
}
body.is-admin .panel[data-admin-only].active {
  display: block !important;
}
html.auth-open .app,
body.auth-open .app {
  visibility: hidden;
  pointer-events: none;
}
.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}
.auth-gate[hidden] { display: none !important; }
html.auth-pending #authGate { display: none !important; }
html.auth-pending body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 70;
  background: var(--bg, #121417);
}
.auth-card {
  width: min(400px, 92vw);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  padding: 16px;
}
.auth-tabs {
  display: flex;
  gap: 0;
  margin: 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.auth-tab {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 7px 12px;
  border-radius: 0;
  font: inherit;
  cursor: pointer;
  flex: 1;
  border-right: 1px solid var(--line);
}
.auth-tab:last-child { border-right: 0; }
.dm-tab.active {
  border-bottom: 2px solid #e53e3e;
  font-weight: 600;
  color: inherit;
}

.auth-tab.active {
  color: #fff;
  background: #2a6db0;
}
.auth-pane { display: block; }
.auth-pane[hidden],
.auth-pane:not(.active) { display: none !important; }
.auth-form { grid-template-columns: 1fr; }
.auth-extra { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.buy-card-link { text-align: center; text-decoration: none; }
.plan-buy-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}
.plan-buy-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: 3px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
  text-decoration: none;
}
.plan-buy-btn:hover {
  border-color: var(--accent);
  background: var(--bg-soft);
}
.plan-buy-label { color: var(--muted); font-size: 12px; }
.plan-buy-price {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
  color: #7eb8e8;
}
.plan-buy-price::before {
  content: "¥";
  font-size: 0.62em;
  font-weight: 600;
  margin-right: 1px;
  vertical-align: 0.12em;
}
.plan-buy-cta {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 960px) {
  .plan-buy-row { grid-template-columns: 1fr 1fr; }
}
.feature-lock {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 10px;
}
.feature-lock.is-on,
.panel.is-locked > .feature-lock {
  display: block !important;
  pointer-events: auto;
  user-select: auto;
  opacity: 1;
}
.feature-lock-card {
  background: var(--bg-elev);
  border: 1px solid #8a6a2a;
  border-radius: var(--radius);
  padding: 14px 12px;
  text-align: center;
}
.feature-lock-card h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0;
  color: #e0c070;
}
.feature-lock-card p {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}
/* 虚拟形象：未开通也完整展示演示界面，不灰掉 */
.panel.is-locked .card,
.panel.is-locked .grid-2 {
  opacity: 1;
  pointer-events: auto;
  user-select: auto;
}
.vi-demo-bar {
  display: none;
  position: sticky;
  top: 0;
  z-index: 20;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.vi-demo-bar.is-on,
#viLock.is-on,
#ckExtractLock.is-on {
  display: flex !important;
}
#ckExtractCard.is-locked #ckExtractActions,
#ckExtractCard.is-locked #ckQrBox,
#ckExtractCard.is-locked details.hint,
#tab-ck.is-locked #ckExtractActions,
#tab-ck.is-locked #ckQrBox,
#tab-ck.is-locked details.hint {
  opacity: 0.45;
  pointer-events: none;
}
/* 次卡用完会立刻 is-locked，但刚提取的 CK 必须仍可复制 */
#ckExtractCard.is-locked #ckResultBox:not([hidden]),
#tab-ck.is-locked #ckResultBox:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}
#ckExtractCard.is-locked #ckResultBox:not([hidden]) textarea,
#tab-ck.is-locked #ckResultBox:not([hidden]) textarea {
  user-select: text;
  cursor: text;
}
.ck-result-box {
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}
.vi-demo-bar-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.vi-demo-bar-text strong {
  font-size: 13px;
  color: var(--accent);
}
.vi-demo-bar-text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.45;
}

@media (max-width: 960px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .stat-row, .grid-2, .form-row, .form-grid { grid-template-columns: 1fr; }
  .plan-buy-row { grid-template-columns: 1fr; }
}
