:root {
  --bg: #0b1220;
  --bg-2: #0e1628;
  --panel: #131d33;
  --panel-2: #182444;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #22d3ee;
  --accent-2: #a78bfa;
  --danger: #f87171;
  --ok: #34d399;
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: radial-gradient(1200px 600px at 50% -10%, #16233d 0%, var(--bg) 60%);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 14px;
  min-height: 100%;
}

h1, h2, h3 { margin: 0; font-weight: 650; letter-spacing: 0.01em; }
h1 { font-size: 22px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
.sm { font-size: 12px; }

/* --------------------------------- 顶栏 --------------------------------- */

.appbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(11, 18, 32, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.appbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.brand-mini { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121f;
  font-weight: 800;
  font-size: 14px;
}
.brand-mark.sm { width: 28px; height: 28px; font-size: 12px; border-radius: 8px; }
.nav { display: flex; gap: 6px; margin-left: 8px; }
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}
.nav a:hover { color: var(--text); background: rgba(148, 163, 184, 0.1); }
.nav a.on { color: #06121f; background: var(--accent); font-weight: 600; }
.user-area { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.user-btn {
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13px;
}
.user-btn:hover { border-color: var(--accent); }

/* 头像 */
.user-btn { display: inline-flex; align-items: center; }
.avatar {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  margin-right: 8px;
  flex-shrink: 0;
}
.avatar-fallback {
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #06121f;
  font-size: 11px;
  font-weight: 700;
}
.avatar-lg {
  width: 72px; height: 72px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--panel-2);
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.avatar-row { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.avatar-ops { flex: 1; min-width: 0; }
.avatar-ops input[type='file'] { padding: 8px 10px; font-size: 12px; }
.avatar-ops p { margin-top: 6px; }
.avatar-ops .ghost { margin-top: 10px; }
.modal-body .msg-slot:empty { display: none; }

/* --------------------------------- 布局 --------------------------------- */

.main { max-width: 1100px; margin: 0 auto; padding: 24px 20px 60px; }
.section-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; margin-bottom: 18px; flex-wrap: wrap;
}
.section-head p { margin-top: 4px; }
.loading { color: var(--muted); padding: 40px 0; text-align: center; }
.loading.full { min-height: 60vh; display: grid; place-items: center; }
.empty {
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
}
.empty.err { border-color: rgba(248, 113, 113, 0.4); color: #fca5a5; }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.card {
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.card-head { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.card-head h3 { word-break: break-word; }
.meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; align-items: center; }
.chip {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  background: rgba(34, 211, 238, 0.12); color: var(--accent);
  border: 1px solid rgba(34, 211, 238, 0.28);
}
.chip.ghost-chip { background: rgba(148, 163, 184, 0.12); color: var(--muted); border-color: var(--line); }
.chip.vis-private { background: rgba(148, 163, 184, 0.12); color: var(--muted); border-color: var(--line); }
.chip.vis-link { background: rgba(167, 139, 250, 0.14); color: var(--accent-2); border-color: rgba(167, 139, 250, 0.3); }
.chip.vis-public { background: rgba(52, 211, 153, 0.14); color: var(--ok); border-color: rgba(52, 211, 153, 0.3); }
.author { font-size: 12px; color: var(--muted); }
.card-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* --------------------------- 用户标签（管理后台） -------------------------- */

.row-select { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); flex-shrink: 0; cursor: pointer; }
.row-select input { accent-color: var(--accent); cursor: pointer; }
.tag-row {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line);
}
.tag-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; padding: 3px 4px 3px 9px; border-radius: 999px;
  background: rgba(167, 139, 250, 0.14); color: var(--accent-2);
  border: 1px solid rgba(167, 139, 250, 0.32);
}
.tag-chip .tag-x {
  background: none; border: none; padding: 0 4px; margin: 0;
  color: inherit; opacity: 0.6; font-size: 10px; line-height: 1;
}
.tag-chip .tag-x:hover { opacity: 1; color: var(--danger); }
.tag-input {
  width: 84px; padding: 4px 8px; font-size: 11px;
  border-radius: 999px; border: 1px dashed var(--line);
}
.batch-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 6px 10px; border-radius: 10px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.07);
}
/* 工具栏里的通用 input 规则会把标签输入框拉到 180px 宽，这里挡回去 */
.filters .tag-input { flex: 0 0 auto; min-width: 0; width: 84px; }
.batch-bar .tag-input { width: 120px; }
.desc { color: var(--muted); font-size: 13px; line-height: 1.5; word-break: break-word; }
.card-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; padding-top: 4px;
}
.foot-right { display: flex; align-items: center; gap: 8px; }

/* --------------------------------- 按钮 --------------------------------- */

button { font-family: inherit; font-size: 13px; cursor: pointer; }
.primary {
  background: linear-gradient(135deg, var(--accent), #38bdf8);
  color: #06121f; border: none; font-weight: 650;
  padding: 10px 18px; border-radius: 10px;
}
.primary:hover { filter: brightness(1.08); }
.primary:disabled { opacity: 0.55; cursor: not-allowed; }
.ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--line); padding: 9px 16px; border-radius: 10px;
}
.ghost:hover { border-color: var(--accent); color: var(--accent); }
.ghost:disabled { opacity: 0.45; cursor: not-allowed; }
.danger { color: #fca5a5; border-color: rgba(248, 113, 113, 0.35); }
.danger:hover { border-color: var(--danger); color: var(--danger); }
button.sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
button.like.on { color: #f472b6; border-color: rgba(244, 114, 182, 0.5); background: rgba(244, 114, 182, 0.1); }
button.sub.on { color: var(--accent); border-color: rgba(96, 165, 250, 0.5); background: rgba(96, 165, 250, 0.12); }
.icon-btn {
  background: transparent; border: none; color: var(--muted);
  font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 8px;
}
.icon-btn:hover { color: var(--text); background: rgba(148, 163, 184, 0.12); }

/* --------------------------------- 表单 --------------------------------- */

input, select, textarea {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }
textarea { resize: vertical; }
input[readonly] { opacity: 0.6; cursor: default; }
label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 12px; }
label input, label select, label textarea { margin-top: 6px; }
.form { margin-top: 18px; }
.row { display: flex; gap: 10px; align-items: flex-end; }
.row .grow { flex: 1; margin-bottom: 12px; }
.row .ghost { margin-bottom: 12px; height: 41px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.vis-select { width: auto; padding: 6px 10px; font-size: 12px; }
.preamp-row { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; }
.preamp-row input { flex: 1; }
.preamp-row output { font-variant-numeric: tabular-nums; color: var(--accent); min-width: 66px; }

/* -------------------------------- 登录页 -------------------------------- */

.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.auth-card {
  width: 100%; max-width: 420px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 28px;
}
.brand { display: flex; gap: 14px; align-items: center; margin-bottom: 22px; }
.brand p { color: var(--muted); font-size: 13px; margin-top: 6px; line-height: 1.5; }
.tabs { display: flex; gap: 4px; background: var(--bg-2); padding: 4px; border-radius: 12px; }
.tab {
  flex: 1; background: transparent; border: none; color: var(--muted);
  padding: 9px 8px; border-radius: 9px; font-size: 13px;
}
.tab.on { background: var(--panel-2); color: var(--text); font-weight: 600; }
.msg { margin-top: 14px; font-size: 13px; padding: 10px 12px; border-radius: 10px; }
.msg.ok { background: rgba(52, 211, 153, 0.12); color: var(--ok); border: 1px solid rgba(52, 211, 153, 0.3); }
.msg.err { background: rgba(248, 113, 113, 0.12); color: #fca5a5; border: 1px solid rgba(248, 113, 113, 0.3); }

/* 注册页的身份赠送提示：限时活动用金橙色强调 */
.signup-perk {
  font-size: 13px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 14px;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid var(--line);
  color: var(--text);
}
.signup-perk b { color: var(--accent); }
.signup-perk.promo {
  background: linear-gradient(135deg, rgba(251, 191, 36, 0.16), rgba(244, 114, 182, 0.12));
  border-color: rgba(251, 191, 36, 0.4);
}
.signup-perk.promo b { color: #fbbf24; }

/* ------------------------------ 曲线与滑块 ------------------------------ */

.curve-box { position: relative; width: 100%; }
.curve-svg { width: 100%; height: 132px; display: block; }
.curve-labels { position: relative; height: 16px; margin-top: 2px; }
.curve-labels span {
  position: absolute; transform: translateX(-50%);
  font-size: 10px; color: var(--muted); font-variant-numeric: tabular-nums;
}
/* 曲线来源说明：premium 预设画的是效果链里那条真实频响，不是卡片里的 16 段 EQ */
.curve-note {
  margin: 6px 0 0; font-size: 11px; line-height: 1.5; color: var(--muted);
}
.curve-note b { color: var(--accent); font-weight: 600; }
.sliders {
  display: flex; justify-content: space-between; gap: 2px;
  padding: 10px 4px 0; overflow-x: auto;
}
.slider-col {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  flex: 1 1 0; min-width: 32px;
  padding: 6px 2px 4px; border-radius: 10px;
  border: 1px solid transparent; cursor: pointer;
}
.slider-col:hover { background: rgba(148, 163, 184, 0.08); }
.slider-col.active {
  border-color: rgba(34, 211, 238, 0.45);
  background: rgba(34, 211, 238, 0.08);
}
.slider-val { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.slider-val.up { color: var(--ok); }
.slider-val.down { color: #fbbf24; }
.slider-track { position: relative; width: 26px; height: 132px; }
.slider-freq { font-size: 10px; color: var(--muted); }
.slider-col.active .slider-freq { color: var(--accent); }
.slider-q { font-size: 9px; color: rgba(148, 163, 184, 0.75); font-variant-numeric: tabular-nums; }
.slider-col.active .slider-q { color: var(--accent-2); }

/* Q 值调节区（作用于当前选中的那一段） */
.q-editor {
  margin-top: 12px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: rgba(148, 163, 184, 0.05);
}

/* 可拖动的曲线 */
.curve-box.interactive { touch-action: none; }
.curve-box.interactive .curve-svg { cursor: crosshair; touch-action: none; }
.curve-box.interactive .curve-handles circle { pointer-events: none; }
.curve-readout {
  position: absolute; top: 4px; left: 6px; z-index: 1;
  font-size: 11px; color: var(--accent); letter-spacing: 0.02em;
  pointer-events: none; font-variant-numeric: tabular-nums;
}
.curve-help { margin: 6px 0 0; line-height: 1.5; }
.q-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.q-title { font-size: 13px; font-weight: 650; }
.q-tip { font-size: 11px; }
.q-row { display: flex; align-items: center; gap: 10px; margin: 8px 0 2px; }
.q-row input[type='range'] { flex: 1; }
.q-label {
  font-size: 12px; color: var(--accent); min-width: 54px;
  font-variant-numeric: tabular-nums;
}
.q-out {
  font-size: 12px; color: var(--accent-2); min-width: 44px; text-align: right;
  font-variant-numeric: tabular-nums;
}
.q-hint { margin-top: 6px; line-height: 1.5; }
button.tiny { padding: 5px 10px; font-size: 11px; border-radius: 8px; white-space: nowrap; }

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding: 0;
  border: none;
  width: 100%;
}
input[type='range']:focus { outline: none; }
input[type='range']::-webkit-slider-runnable-track {
  height: 4px; border-radius: 999px;
  background: linear-gradient(90deg, rgba(148,163,184,0.25), rgba(34,211,238,0.5));
}
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--accent); border: 2px solid #06121f; margin-top: -5px;
  box-shadow: 0 0 8px rgba(34, 211, 238, 0.5);
}
input[type='range']::-moz-range-track {
  height: 4px; border-radius: 999px; background: rgba(148, 163, 184, 0.3);
}
input[type='range']::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--accent); border: 2px solid #06121f;
}
/* 纵向滑块：轨道旋转 90°，容器保持垂直占位 */
.slider-track input[type='range'] {
  position: absolute;
  width: 132px;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%) rotate(-90deg);
}

/* --------------------------------- 弹窗 --------------------------------- */

.modal-overlay {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: 20px;
  overflow-y: auto;
}
.modal {
  width: 100%; max-width: 720px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: 16px;
  display: flex; flex-direction: column;
  max-height: calc(100vh - 40px);
}
.modal.narrow { max-width: 420px; }
/* EQ 编辑器：16 段滑杆需要横向空间，比其他弹窗宽一档 */
.modal.wide { max-width: 880px; }
.modal-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-bottom: 1px solid var(--line);
}
.modal-body { padding: 20px; overflow-y: auto; }
.modal-foot {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 20px; border-top: 1px solid var(--line);
}
/* 站内确认弹窗：替掉 window.confirm（在 iframe / WebView 里会被静默吞掉） */
.modal.confirm .confirm-text { font-size: 13px; line-height: 1.7; color: var(--text); }
.primary.danger {
  background: linear-gradient(135deg, var(--danger), #fb7185);
  color: #2a0a0a;
}

/* ------------------------------ 广场与分页 ------------------------------ */

.filters { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.filters select { width: 150px; }
.filters input { flex: 1; min-width: 180px; }
.filters button { flex-shrink: 0; }
.pager {
  display: flex; align-items: center; justify-content: flex-end;
  gap: 10px; margin-top: 20px; flex-wrap: wrap;
}

/* ------------------------------ 身份标识徽章 ------------------------------ */

.flag {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  vertical-align: 2px;
  white-space: nowrap;
}
.flag-standard { background: linear-gradient(135deg, #e2e8f0, #f8fafc); color: #334155; }
.flag-subscribe { background: linear-gradient(135deg, #1d4ed8, #60a5fa); color: #ffffff; }
.flag-premium { background: linear-gradient(135deg, #db2777, #f9a8d4); color: #ffd700; }
.flag-dev { background: linear-gradient(135deg, #12061f, #6d28d9); color: #c4b5fd; }
.flag-banned { background: #dc2626; color: #ffffff; }

/* ------------------------------- 管理后台 ------------------------------- */

.stat-row { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.stat-card {
  flex: 1;
  min-width: 110px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat-value { font-size: 22px; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; color: var(--muted); }
.admin-body { margin-top: 4px; }

/* ------------------------------- 下载中心 ------------------------------- */

.notice {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px; padding: 12px 16px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  background: rgba(34, 211, 238, 0.07);
  border-radius: var(--radius);
  font-size: 13px;
}
.release-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 16px; }
.release-card {
  display: flex; flex-direction: column; gap: 10px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius);
  padding: 16px 18px;
}
/* 档位用左边那条彩条区分，扫一眼就知道这条是给谁的 */
.release-card.tier-public { border-left-color: var(--ok); }
.release-card.tier-standard { border-left-color: #e2e8f0; }
.release-card.tier-subscriber { border-left-color: #60a5fa; }
.release-card.tier-premium { border-left-color: #f9a8d4; }
/* 下载卡片标题旁的档位小标签 */
.chip.tier-chip-standard { background: rgba(226, 232, 240, 0.14); color: #e2e8f0; border-color: rgba(226, 232, 240, 0.35); }
.chip.tier-chip-subscriber { background: rgba(96, 165, 250, 0.14); color: #60a5fa; border-color: rgba(96, 165, 250, 0.3); }
.chip.tier-chip-premium { background: rgba(249, 168, 212, 0.14); color: #f9a8d4; border-color: rgba(249, 168, 212, 0.3); }
.release-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.release-title { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.release-title h3 { font-size: 16px; }
.release-ver { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.release-meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums;
}
.release-meta .dot { opacity: 0.45; }
.release-notes { font-size: 13px; line-height: 1.6; color: var(--text); white-space: pre-wrap; }
.release-foot {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; margin-top: auto; padding-top: 4px; flex-wrap: wrap;
}
.release-tip { margin-top: 18px; line-height: 1.6; }

/* -------------------------------- 聊天社区 -------------------------------- */

.head-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* 房间条：横向滚动的 tab，人数直接标在名字后面 */
.room-bar {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin-top: 14px; padding-bottom: 2px;
}
.room-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--panel);
  color: var(--muted); font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s;
}
.room-tab:hover { border-color: var(--accent); color: var(--text); }
.room-tab.on {
  border-color: rgba(34, 211, 238, 0.5);
  background: rgba(34, 211, 238, 0.12);
  color: var(--accent);
}
.room-count {
  min-width: 18px; text-align: center;
  padding: 1px 6px; border-radius: 999px;
  background: rgba(52, 211, 153, 0.18); color: var(--ok);
  font-size: 11px; font-variant-numeric: tabular-nums;
}
.room-tab.on .room-count { background: rgba(34, 211, 238, 0.25); color: var(--accent); }
.room-lock { font-size: 11px; opacity: 0.8; }

/* 聊天主体：左消息流 + 右在线名单 */
.chat-shell {
  display: grid; grid-template-columns: minmax(0, 1fr) 200px;
  gap: 12px; margin-top: 12px; align-items: start;
}
@media (max-width: 860px) {
  .chat-shell { grid-template-columns: minmax(0, 1fr); }
  .online-panel { order: -1; }
}

.chat-stream {
  display: flex; flex-direction: column; gap: 12px;
  max-height: 58vh; overflow-y: auto;
  padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: rgba(11, 18, 32, 0.55);
  scroll-behavior: smooth;
}

/* 在线名单 */
.online-panel {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  padding: 12px 14px;
}
.online-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.online-head strong { font-size: 13px; }
.online-topic { margin: 6px 0 10px; line-height: 1.5; }
.online-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.online-list li {
  font-size: 12px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.online-hint { display: block; margin-top: 8px; }

.chat-msg {
  padding: 10px 12px; border-radius: 12px;
  border: 1px solid transparent;
  background: var(--panel);
}
.chat-msg.mine {
  border-color: rgba(34, 211, 238, 0.25);
  background: linear-gradient(180deg, rgba(34, 211, 238, 0.08) 0%, var(--panel) 100%);
}
.chat-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chat-author { font-weight: 650; font-size: 13px; }
.chat-time { margin-left: auto; }
.chat-del {
  background: transparent; border: none; color: var(--muted);
  cursor: pointer; font-size: 13px; padding: 2px 6px; border-radius: 6px;
}
.chat-del:hover { color: var(--danger); background: rgba(248, 113, 113, 0.12); }
.chat-body { margin-top: 8px; }
.chat-text { font-size: 13px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }

/* /cfg 配置串：不能折行错位，必须等宽 + 可横向滚动 */
.cfg-wrap { position: relative; }
.cfg-block {
  margin: 0; padding: 12px 60px 12px 12px;
  background: #07101d; border: 1px solid var(--line); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px; line-height: 1.6; color: #c7f9ff;
  white-space: pre; overflow-x: auto;
}
.cfg-copy { position: absolute; top: 8px; right: 8px; }

.chat-preset {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 10px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 12px;
  background: var(--bg-2);
}
.chat-preset .curve-box { width: 180px; flex-shrink: 0; }
.chat-preset .curve-svg { height: 60px; }
.chat-preset .curve-labels { display: none; }
.chat-preset-info { flex: 1; min-width: 140px; display: flex; flex-direction: column; gap: 4px; }
.chat-preset-ops { display: flex; gap: 6px; align-items: center; }

.composer {
  margin-top: 14px; padding: 14px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
}
.composer textarea { min-height: 76px; }
.composer-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.composer-row .kind-select { width: 130px; }
.composer-row .attach-select { flex: 1; min-width: 160px; }
.grow-hint { flex: 1; min-width: 180px; line-height: 1.5; }
.composer-hint { margin-top: 8px; }

/* --------------------------- 管理后台：版本发布 --------------------------- */

.release-admin { display: flex; flex-direction: column; gap: 16px; margin-top: 16px; }
.release-form .grid-2 { gap: 0 14px; }
.release-form h3 { margin-bottom: 12px; }
.form-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 14px; flex-wrap: wrap;
}
.inline-check {
  display: inline-flex; align-items: center; gap: 8px;
  margin: 0; color: var(--text); font-size: 13px;
}
.inline-check input { width: 16px; accent-color: var(--accent); }
.form-btns { display: flex; gap: 8px; }
.desc.warn { color: #fbbf24; }

/* ---------------------- 我的库：订阅预设 / 订阅者 / 开放调节 ---------------------- */

/* 「订阅预设」区块与「我的预设」拉开距离，形成两个分组 */
.section-head.sub-head { margin-top: 40px; }
.section-head.sub-head h2::before {
  content: '★';
  color: var(--accent);
  margin-right: 8px;
  font-size: 0.8em;
}

/* 订阅来的卡片用左侧高亮条与自己的预设区分开 */
.card.sub-card { border-left: 3px solid rgba(96, 165, 250, 0.5); }

/* 作者发了新更新：整卡描边加重 + 标题旁一个小角标 */
.card.sub-card.has-fresh {
  border-left-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.35), 0 6px 20px -14px rgba(129, 140, 248, 0.6);
}
.fresh-dot {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.6;
  vertical-align: middle;
  color: #fff;
  background: var(--accent);
  white-space: nowrap;
}

/* 「最新更新」横幅：订阅卡里折叠展示作者最近一条更新说明 */
.update-banner {
  margin: 10px 0 2px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(129, 140, 248, 0.1);
  border: 1px solid rgba(129, 140, 248, 0.28);
}
.update-banner .update-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.update-banner .update-body {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 更新历史弹窗里的记录列表 */
.update-history {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 52vh;
  overflow-y: auto;
}
.update-history > li {
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(148, 163, 184, 0.07);
  border: 1px solid rgba(148, 163, 184, 0.12);
}
.update-history .update-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}
.update-history .update-body {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

/* 强调型次要按钮（发布更新 / 全部标为已读）：描边用主题色，不做成实心主按钮 */
.ghost.accent {
  color: var(--accent);
  border-color: rgba(129, 140, 248, 0.45);
}
.ghost.accent:hover {
  background: rgba(129, 140, 248, 0.12);
  border-color: rgba(129, 140, 248, 0.65);
}

/* "开放调节 / 仅可加载" 状态徽章 */
.chip.tier-open {
  background: rgba(52, 211, 153, 0.14);
  color: var(--ok);
  border-color: rgba(52, 211, 153, 0.3);
}

/* 卡片底部的「开放调节」开关 */
.adjust-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  font-size: 13px;
  color: var(--text);
}
.adjust-row input { width: 16px; margin-top: 2px; accent-color: var(--accent); flex: none; }
.adjust-row em { font-style: normal; color: var(--muted); font-size: 12px; }
.editor-adjust { margin-bottom: 12px; }

/* 订阅者名单弹窗 */
.subscriber-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 46vh;
  overflow-y: auto;
}
.subscriber-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 8px;
}
.subscriber-list li:nth-child(odd) { background: rgba(148, 163, 184, 0.06); }
.subscriber-list .sub-name { font-size: 14px; }

.sub-count { white-space: nowrap; }

/* 编辑器横幅提示（订阅预设另存为 / 只读说明） */
.modal-banner {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.3);
  color: var(--text);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  margin-bottom: 14px;
}

/* 只读模式：控件区盖一层遮罩，吃掉拖动/点击 */
.modal.readonly .curve-slot,
.modal.readonly .sliders-slot { position: relative; }
.readonly-shield {
  position: absolute;
  inset: 0;
  z-index: 2;
  cursor: not-allowed;
  background: transparent;
}
.modal.readonly .modal-head h2::after {
  content: '（只读）';
  color: var(--muted);
  font-size: 13px;
  font-weight: 400;
}

/* ------------------------- 提示 / 公告：共用卡片样式 ------------------------- */

/*
 * 操作提示（toast）与悬浮公告用同一套视觉：卡片 + 圆形图标 + 描边。
 * 两者唯一的区别是**生命周期**：提示自动消失，公告常驻到手动关闭。
 *
 * 提示在左下角、公告在左下角偏上（用 bottom 错开），都以列方向堆叠，
 * 多条不会互相顶掉。z-index：提示 80 > 公告 60 > 顶栏 20。
 */

/* ---- 操作提示（自动消失，多条堆叠）---- */

.toast-host {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 80;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}
.toast-host:empty { display: none; }
.toast {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto; /* host 是 none，卡片自己要能点关闭 */
  animation: announce-in 0.28s ease-out;
}
.toast.leaving {
  animation: announce-out 0.22s ease-in forwards;
}
@keyframes announce-out {
  from { opacity: 1; transform: translateY(0); }
  to { opacity: 0; transform: translateY(8px); }
}
@media (prefers-reduced-motion: reduce) {
  .toast, .toast.leaving { animation: none; }
}

.toast-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: rgba(34, 211, 238, 0.16);
  color: var(--accent);
}
.toast-text {
  flex: 1;
  min-width: 0;
  line-height: 1.6;
  word-break: break-word;
}
.toast-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.toast-close:hover { background: rgba(148, 163, 184, 0.16); color: var(--text); }

/* 成功：绿色描边 + ✓ */
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.ok .toast-icon { background: rgba(52, 211, 153, 0.18); color: var(--ok); }
/* 失败：红色描边 + ! */
.toast.err { border-color: rgba(248, 113, 113, 0.5); }
.toast.err .toast-icon { background: rgba(248, 113, 113, 0.18); color: #fca5a5; }
/* 普通：青色描边（默认） */

/* ------------------------------ 悬浮公告 ------------------------------ */

/*
 * 左下角悬浮条。挂在 body 上（不在 #root 里），所以切页重绘不会把它清掉。
 * 支持多条：在 #announce-host 里纵向堆叠，各条可单独关闭。
 */
#announce-host {
  position: fixed;
  left: 20px;
  /* 给操作提示让出位置：提示层可能有多条，公告整体上移一段 */
  bottom: 76px;
  z-index: 60;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(360px, calc(100vw - 40px));
  pointer-events: none;
}
#announce-host:empty { display: none; }
.announce {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 12px 12px 14px;
  border-radius: var(--radius);
  background: var(--panel-2);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.5);
  pointer-events: auto;
  animation: announce-in 0.32s ease-out;
}
@keyframes announce-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .announce { animation: none; }
}

.announce-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: rgba(34, 211, 238, 0.16);
  color: var(--accent);
}
.announce-text {
  flex: 1;
  min-width: 0;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
  word-break: break-word;
}
.announce-close {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  line-height: 1;
}
.announce-close:hover { background: rgba(148, 163, 184, 0.16); color: var(--text); }

/* 醒目档：描边高亮，提醒"这条要留意" */
.announce.warn {
  border-color: rgba(251, 191, 36, 0.5);
  background: linear-gradient(180deg, rgba(251, 191, 36, 0.1), var(--panel-2));
}
.announce.warn .announce-icon { background: rgba(251, 191, 36, 0.18); color: #fbbf24; }

/* --------------------------- 后台：悬浮公告面板 --------------------------- */

.announce-admin { display: grid; gap: 12px; }
.announce-form { max-width: 720px; }
.announce-form h3 { margin-bottom: 12px; }
.announce-form textarea { resize: vertical; min-height: 72px; }
/* 预览行里的 chip 会换行，给它一点上下呼吸感 */
.announce-form [data-el="preview-slot"] { line-height: 2; word-break: break-word; }
/* 已发布的公告列表项：正文可能较长，给出换行与行高 */
.announce-row .desc { white-space: pre-wrap; line-height: 1.65; }

/* ------------------------------ 危险操作区 ------------------------------ */

/* 个人资料弹窗底部的「注销账号」——视觉上明确隔开，避免误点 */
.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding: 14px 16px;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: var(--radius);
  background: rgba(248, 113, 113, 0.06);
}
.danger-copy { min-width: 0; }
.danger-copy strong { display: block; font-size: 13px; color: #fca5a5; margin-bottom: 4px; }
.danger-copy p { margin: 0; line-height: 1.5; }
.danger-zone .danger { flex-shrink: 0; }

/* promptDialog 的输入行（沿用 modal-body 里的 label 排版，但不要底部留白） */
.prompt-field { margin-bottom: 0; }
.prompt-field input {
  width: 100%;
  margin-top: 6px;
}

/* ------------------------------ 预设版本 ------------------------------ */

/* PREMIUM 预设带整套 DSP 参数，用强调色把它和满地的 ANDROEQ 区分开 */
.chip.ver-premium {
  background: rgba(167, 139, 250, 0.16);
  color: var(--accent-2);
  border-color: rgba(167, 139, 250, 0.42);
}
.version-hint { margin: -4px 0 12px; }

/* DSP 效果链面板：premium/dev 可直接调节（开关 + 滑杆），其余用户只读展示 */
.dsp-panel {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(148, 163, 184, 0.05);
}
.dsp-panel:empty { display: none; }
.dsp-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.dsp-head strong { font-size: 13px; }
.dsp-group {
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid transparent;
  margin-bottom: 4px;
}
.dsp-group.on { background: rgba(34, 211, 238, 0.06); border-color: rgba(34, 211, 238, 0.22); }
.dsp-group-head { display: flex; align-items: center; gap: 8px; }
.dsp-name { font-size: 13px; }
.dsp-fields { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 6px; }
.dsp-field { display: inline-flex; gap: 6px; font-size: 12px; }
.dsp-field-label { color: var(--muted); }
.dsp-field-value { color: var(--text); font-variant-numeric: tabular-nums; }
.dsp-foot { margin: 10px 0 0; }

/* 工具行：摘要 + 全部关闭 / 恢复默认 */
.dsp-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 10px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--line);
}
.dsp-tools > span { margin-right: auto; }

/* 开关：把 checkbox 藏起来，用轨道 + 圆点画一个拨杆 */
.dsp-switch { display: inline-flex; align-items: center; cursor: pointer; flex: none; }
.dsp-switch .dsp-switch-box {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.dsp-switch .dsp-switch-track {
  position: relative;
  display: block;
  width: 34px;
  height: 18px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.28);
  border: 1px solid var(--line);
  transition: background 0.15s ease, border-color 0.15s ease;
}
.dsp-switch .dsp-switch-track::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--text);
  transition: transform 0.15s ease;
}
.dsp-switch .dsp-switch-box:checked + .dsp-switch-track {
  background: rgba(34, 211, 238, 0.45);
  border-color: rgba(34, 211, 238, 0.6);
}
.dsp-switch .dsp-switch-box:checked + .dsp-switch-track::after {
  transform: translateX(16px);
  background: #04121c;
}
/* 只读模式下整块被禁掉了交互，光标也别再暗示可点 */
.dsp-switch .dsp-switch-box:disabled + .dsp-switch-track { opacity: 0.5; }
.dsp-switch:has(.dsp-switch-box:disabled) { cursor: default; }

/* 数值字段：标签 + 滑杆 + 数字框 + 读数，整行占满便于对齐 */
.dsp-field-num {
  display: grid;
  grid-template-columns: 96px minmax(120px, 1fr) 72px 74px;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}
.dsp-field-text {
  display: grid;
  grid-template-columns: 96px minmax(120px, 1fr);
  align-items: start;
  gap: 8px;
  padding: 3px 0;
}
.dsp-field-num .dsp-field-label,
.dsp-field-text .dsp-field-label { text-align: right; line-height: 26px; }
.dsp-slider { width: 100%; accent-color: var(--accent); }
.dsp-num {
  width: 100%;
  padding: 3px 6px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.dsp-field-out {
  font-size: 12px;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.dsp-text {
  width: 100%;
  padding: 4px 7px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 12px;
  resize: vertical;
}
.dsp-num:focus, .dsp-text:focus { outline: 1px solid var(--accent); outline-offset: 1px; }
.dsp-num:disabled, .dsp-text:disabled, .dsp-slider:disabled { opacity: 0.55; }

@media (max-width: 640px) {
  .dsp-field-num { grid-template-columns: 1fr 1fr; }
  .dsp-field-num .dsp-field-label { text-align: left; }
}

/* ------------------------- 聊天板块：只读与附件 ------------------------- */

/* 只读板块的标记（如「公告板块」仅 DEV 可发言） */
.room-ro {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.18);
  color: var(--muted);
  white-space: nowrap;
}

.composer-slot { display: block; }
.composer-locked { padding: 14px 16px; }
.composer-lock { display: flex; align-items: flex-start; gap: 12px; }
.composer-lock .lock-icon { font-size: 18px; line-height: 1.4; }
.composer-lock strong { display: block; font-size: 14px; margin-bottom: 4px; }
.composer-lock p { margin: 0; }

.file-input { display: none; }
.attach-chip { display: inline-flex; align-items: center; gap: 8px; }
.attach-chip:empty { display: none; }
.attach-name { font-size: 12px; color: var(--text); word-break: break-all; }
.attach-status { font-size: 11px; color: var(--muted); }
.attach-status.ok { color: var(--ok); }
.attach-rm {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  padding: 0 2px;
}
.attach-rm:hover { color: var(--danger); }

.chat-attach { margin-top: 8px; }
.attach-image { max-width: 320px; }
.attach-image img {
  display: block;
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}
.attach-meta { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.attach-file-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.attach-file-head .attach-name { font-size: 13px; }
.attach-ops { margin-left: auto; display: flex; gap: 6px; }
.attach-text {
  margin: 8px 0 0;
  max-height: 240px;
  overflow: auto;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(11, 18, 32, 0.7);
  border: 1px solid var(--line);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text);
}

/* --------------------------- 后台：聊天板块 --------------------------- */

.rooms-admin { display: grid; gap: 12px; }
.room-form { max-width: 760px; }
.room-form h3 { margin-bottom: 12px; }
.room-row .desc { white-space: pre-wrap; line-height: 1.65; }

@media (max-width: 640px) {
  .appbar-inner { flex-wrap: wrap; gap: 12px; }
  .nav { margin-left: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .danger-zone { flex-direction: column; align-items: stretch; }
  .danger-zone .danger { width: 100%; }
  /* 手机上占满宽度；公告层往上让出提示层的位置 */
  .toast-host { left: 12px; right: 12px; bottom: 12px; max-width: none; }
  #announce-host { left: 12px; right: 12px; bottom: 64px; max-width: none; }
}
