:root {
  --blue: #1a73e8;
  --blue-dark: #1557b0;
  --red: #e53935;
  --ink: #1f2329;
  --muted: #7a828c;
  --line: #e8ebf0;
  --bg: #f0f2f5;
  --card: #ffffff;
  --shadow: 0 1px 3px rgba(16,24,40,.05), 0 1px 2px rgba(16,24,40,.03);
  --shadow-lg: 0 4px 16px rgba(16,24,40,.08);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.6;
}

.wrap { max-width: 720px; margin: 0 auto; padding: 16px 16px 40px; }

.card {
  background: var(--card);
  border-radius: 14px;
  padding: 18px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

/* ---------- 买家页顶栏 ---------- */
.topbar {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar .name { font-weight: 600; font-size: 15px; }
.topbar a { color: var(--blue); text-decoration: none; font-size: 13px; }

/* 顶部固定区（标题栏 + 红色警告） */
.sticky-head {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #f0f2f5;
}
.sticky-head .topbar { position: static; }
.sticky-warn { padding: 8px 16px 10px; }
.sticky-warn .warn-alert { margin-bottom: 0; }

.warn {
  color: var(--blue);
  font-weight: 600;
  text-align: center;
  font-size: 15px;
  padding: 14px 12px;
  background: #eef4ff;
  border-radius: 12px;
  margin-bottom: 14px;
}
.warn-red { color: var(--red); }

/* 顶部红色警告条（兑换页 + 交付页） */
.warn-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: linear-gradient(135deg,#fff1f0 0%,#ffe4e1 100%);
  border: 1.5px solid #ffb8b2;
  border-left: 5px solid #e53935;
  color: #c62828;
  font-weight: 700;
  font-size: 15.5px;
  line-height: 1.75;
  padding: 16px 15px;
  border-radius: 12px;
  margin-bottom: 14px;
  box-shadow: 0 3px 12px rgba(229,57,53,.10);
}
.warn-alert .ico {
  font-size: 19px;
  line-height: 1.3;
  flex: 0 0 auto;
}

.err {
  background: #fff0f0;
  color: var(--red);
  padding: 10px 12px;
  border-radius: 10px;
  margin-bottom: 12px;
  font-size: 14px;
}

label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }

input[type=text], input[type=password], input[type=number],
select, textarea, input[type=file] {
  width: 100%;
  padding: 11px;
  font-size: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fafbfc;
  outline: none;
  font-family: inherit;
  color: var(--ink);
}
input:focus, select:focus, textarea:focus {
  border-color: var(--blue);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(26,115,232,.1);
}
textarea { resize: vertical; }

.btn {
  display: block;
  width: 100%;
  padding: 13px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: var(--blue);
  border: 0;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  margin-top: 10px;
}
.btn:active { background: var(--blue-dark); }
.btn-ghost { background: #fff; color: var(--blue); border: 1px solid var(--blue); }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; display: inline-block; margin-top: 0; }
.btn-red { background: var(--red); }

.field { margin-bottom: 14px; }

.kv {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  margin-bottom: 10px;
}
.kv .k { font-size: 12px; color: var(--muted); margin-bottom: 2px; }
.kv .v {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 17px;
  word-break: break-all;
  color: #111;
}

.code-btn {
  display: block;
  width: 100%;
  padding: 14px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 600;
  border-radius: 10px;
  border: 0;
  background: #e8f0fe;
  color: var(--blue);
  cursor: pointer;
}
.code-btn.primary { background: var(--blue); color: #fff; }
.code-btn:disabled { opacity: .6; }

#codeResult {
  margin-top: 12px;
  padding: 14px;
  border-radius: 12px;
  background: #f1f8e9;
  border: 1px solid #c5e1a5;
  text-align: center;
  display: none;
}
#codeResult .num {
  font-family: ui-monospace, monospace;
  font-size: 34px;
  letter-spacing: 8px;
  font-weight: 700;
  color: #2e7d32;
}
#codeResult .tip { font-size: 13px; color: var(--muted); margin-top: 6px; }

details {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
}
details summary { cursor: pointer; font-weight: 600; color: var(--blue); font-size: 15px; }
details ol { padding-left: 20px; margin: 10px 0 0; }

.badge {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 7px;
  font-size: 12px;
  background: #eef1f5;
  color: #555;
  margin-right: 4px;
  vertical-align: middle;
}
.badge.ok { background: #e8f5e9; color: #2e7d32; }
.badge.warn { background: #fff8e1; color: #f57c00; }
.badge.dead { background: #ffebee; color: #c62828; }

.role-owner { background: linear-gradient(135deg,#667eea,#764ba2); color:#fff; }
.role-admin { background: #eef1f5; color:#555; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--muted); font-weight: 600; white-space: nowrap; font-size: 12.5px; }
td.mono { font-family: ui-monospace, monospace; font-size: 12.5px; word-break: break-all; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }

@media (max-width: 560px) {
  .grid3, .grid4 { grid-template-columns: 1fr 1fr; }
}

.stat {
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  text-align: center;
}
.stat .n { font-size: 22px; font-weight: 700; color: var(--blue); }
.stat .l { font-size: 12px; color: var(--muted); }

.stat.c1 { background: linear-gradient(135deg,#667eea,#764ba2); border: 0; box-shadow: 0 4px 14px rgba(102,126,234,.25); }
.stat.c2 { background: linear-gradient(135deg,#11998e,#38ef7d); border: 0; box-shadow: 0 4px 14px rgba(17,153,142,.25); }
.stat.c3 { background: linear-gradient(135deg,#f2994a,#f2c94c); border: 0; box-shadow: 0 4px 14px rgba(242,153,74,.25); }
.stat.c4 { background: linear-gradient(135deg,#eb3349,#f45c43); border: 0; box-shadow: 0 4px 14px rgba(235,51,73,.25); }
.stat.c1 .n, .stat.c2 .n, .stat.c3 .n, .stat.c4 .n { color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.18); }
.stat.c1 .l, .stat.c2 .l, .stat.c3 .l, .stat.c4 .l { color: rgba(255,255,255,.92); }

.foot { text-align: center; font-size: 12px; color: var(--muted); margin-top: 20px; }

.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
h2 { font-size: 17px; margin: 0 0 14px; font-weight: 650; }

.block-text { white-space: pre-wrap; font-size: 15px; color: #333; }

/* 富文本内容里的字号映射 */
.block-text font[size="1"] { font-size: 12px; }
.block-text font[size="2"] { font-size: 14px; }
.block-text font[size="3"] { font-size: 16px; }
.block-text font[size="4"] { font-size: 18px; }
.block-text font[size="5"] { font-size: 22px; }
.block-text font[size="6"] { font-size: 28px; }
.block-text font[size="7"] { font-size: 34px; }
.block-text div { margin: 0; }

/* ============ 富文本编辑器 ============ */
.rte-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.rte-btn {
  min-width: 34px;
  height: 32px;
  padding: 0 9px;
  border: 1px solid #dde3ea;
  background: #fff;
  border-radius: 7px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  line-height: 30px;
}
.rte-btn:hover { background: #eef2f7; }
.rte-btn.active { background: #e8f0fe; border-color: #b6d0fb; color: var(--blue); }
.rte-sep { width: 1px; height: 22px; background: #dde3ea; margin: 0 4px; }
.rte-color {
  width: 34px;
  height: 32px;
  padding: 2px;
  border: 1px solid #dde3ea;
  border-radius: 7px;
  background: #fff;
  cursor: pointer;
}
.rte-area {
  min-height: 180px;
  max-height: 460px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: #fff;
  font-size: 15px;
  line-height: 1.75;
  outline: none;
}
.rte-area:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
.rte-area:empty:before {
  content: attr(data-ph);
  color: #b0b7c0;
}
.rte-area font[size="1"] { font-size: 12px; }
.rte-area font[size="2"] { font-size: 14px; }
.rte-area font[size="3"] { font-size: 16px; }
.rte-area font[size="4"] { font-size: 18px; }
.rte-area font[size="5"] { font-size: 22px; }
.rte-area font[size="6"] { font-size: 28px; }
.rte-area font[size="7"] { font-size: 34px; }

/* 标题富文本 */
.title-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
  padding: 7px 8px;
  background: #f7f9fc;
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: 10px 10px 0 0;
}
.title-area {
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  background: #fff;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.5;
  outline: none;
}
.title-area:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,115,232,.1); }
.title-area:empty:before {
  content: attr(data-ph);
  color: #b0b7c0;
  font-weight: 400;
}

/* 页面上的块标题 */
.block-title {
  font-size: 16px;
  font-weight: 650;
  color: var(--ink);
  margin: 0 0 12px;
  line-height: 1.5;
}

/* 正文内插入的图片 / 视频 */
.rte-area img,
.block-text img {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 10px 0;
}
.rte-area video,
.block-text video {
  max-width: 100%;
  border-radius: 10px;
  display: block;
  margin: 10px 0;
  background: #000;
}

/* 编辑器里的媒体包裹 + 删除按钮 */
.rte-media {
  position: relative;
  display: inline-block;
  max-width: 100%;
  margin: 8px 0;
}
.rte-media video,
.rte-media img {
  margin: 0;
  display: block;
}
.rte-media-del {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 0;
  background: rgba(229,57,53,.92);
  color: #fff;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,.3);
}
.rte-media-del:hover { background: #c62828; transform: scale(1.08); }

/* 买家页面永远不显示编辑器控件 */
.block-text .rte-media-del,
.block-text .rte-media > button,
.card .rte-media-del,
.card .rte-media > button,
#credArea .rte-media-del {
  display: none !important;
}

/* 媒体不继承文字背景色 */
.rte-media,
.rte-media img,
.rte-media video {
  background-color: transparent !important;
}
.rte-area img,
.rte-area video,
.block-text img,
.block-text video {
  background-color: #fff;
}
.block-img { width: 100%; border-radius: 10px; display: block; cursor: pointer; }
.block-video { width: 100%; border-radius: 10px; display: block; background: #000; }

/* 视频嵌入（B站/腾讯等 iframe） */
.video-embed {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  border-radius: 10px;
  overflow: hidden;
  background: #000;
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
.preview-empty {
  background: #f0f2f5;
  border-radius: 8px;
  padding: 26px 10px;
  text-align: center;
  color: #a8b0ba;
  font-size: 12px;
}
.block-link {
  display: block;
  text-align: center;
  padding: 12px;
  background: #e8f0fe;
  color: var(--blue);
  border-radius: 10px;
  text-decoration: none;
  font-weight: 600;
}

code {
  background: #f0f2f5;
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 12.5px;
}

hr { border: 0; border-top: 1px solid var(--line); }

/* 教程解锁提示 */
.lock-hint {
  text-align: center;
  padding: 36px 20px;
  background: #fff;
  border: 1px dashed #d5dbe3;
  border-radius: 14px;
  margin-bottom: 16px;
  color: #666;
}

/* 交付页右下角倒计时 */
.timer-box {
  position: fixed;
  right: 14px;
  bottom: 14px;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 6px 22px rgba(16,24,40,.14);
  padding: 10px 14px;
  font-size: 13px;
  z-index: 50;
  min-width: 132px;
  backdrop-filter: blur(6px);
}
.timer-box .row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  line-height: 2;
}
.timer-box .row span { color: #8a929c; }
.timer-box .row b {
  color: var(--blue);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

/* ================= 内容管理：左编辑 右预览 ================= */

.content-layout {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.content-left { flex: 1; min-width: 0; }

.content-right {
  width: 340px;
  flex: 0 0 340px;
  position: sticky;
  top: 16px;
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #8a929c;
  margin-bottom: 8px;
  padding: 0 4px;
}
.pv-tag {
  background: #e8f0fe;
  color: var(--blue);
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 12px;
}

.phone-frame {
  background: #16181d;
  border-radius: 32px;
  padding: 10px;
  box-shadow: 0 14px 44px rgba(16,24,40,.22);
  position: relative;
}
.phone-notch {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  width: 90px;
  height: 20px;
  background: #16181d;
  border-radius: 12px;
  z-index: 2;
}
.phone-screen {
  background: #f0f2f5;
  border-radius: 24px;
  height: 640px;
  overflow-y: auto;
  padding: 26px 10px 12px;
}

.pv-card {
  background: #fff;
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  border: 1px solid #e8ebf0;
}
.pv-h {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #1f2329;
}
.pv-text {
  font-size: 13px;
  color: #333;
  white-space: pre-wrap;
  line-height: 1.75;
}
.pv-img { width: 100%; border-radius: 8px; display: block; }
.pv-ph {
  background: #f0f2f5;
  border-radius: 8px;
  padding: 26px 10px;
  text-align: center;
  color: #a8b0ba;
  font-size: 12px;
}
.pv-link {
  background: #e8f0fe;
  color: var(--blue);
  text-align: center;
  padding: 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
}

@media (max-width: 1100px) {
  .content-right { display: none; }
  .preview-fab { display: flex; }
}

/* 窄屏浮动预览按钮 + 全屏预览 */
.preview-fab {
  display: none;
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  align-items: center;
  gap: 8px;
  padding: 13px 20px;
  border-radius: 999px;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border: 0;
  box-shadow: 0 8px 24px rgba(102,126,234,.42);
  cursor: pointer;
}
.preview-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.62);
  display: none;
  z-index: 900;
  padding: 16px;
  overflow-y: auto;
}
.preview-modal.show { display: block; }
.preview-modal-bar {
  max-width: 420px;
  margin: 0 auto 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-size: 14px;
}
.preview-modal-bar button {
  background: rgba(255,255,255,.2);
  border: 0;
  color: #fff;
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}
.preview-modal-inner {
  max-width: 420px;
  margin: 0 auto;
  background: #f0f2f5;
  border-radius: 18px;
  padding: 16px 10px 30px;
}

/* ================= 重要须知页（倒计时门） ================= */

.gate-card {
  background: #fff;
  border-radius: 20px;
  padding: 26px 22px 22px;
  box-shadow: 0 10px 40px rgba(16,24,40,.10);
  border: 1px solid var(--line);
}
.gate-title {
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  color: #c62828;
  margin-bottom: 20px;
  letter-spacing: 1px;
}
.gate-body p {
  font-size: 15px;
  line-height: 1.95;
  margin: 0 0 12px;
  color: #2b3138;
}
.gate-body .card {
  box-shadow: none;
  border: 0;
  padding: 0;
  margin: 0;
  background: transparent;
}
.gate-body h2 { display: none; }
.gate-wait {
  text-align: center;
  font-size: 14px;
  color: #8a929c;
  margin: 18px 0 14px;
}
.gate-btn {
  width: 100%;
  padding: 15px;
  border: 0;
  border-radius: 12px;
  background: #d5d9de;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: not-allowed;
  transition: background .2s;
}
.gate-btn.ready {
  background: var(--blue);
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(26,115,232,.3);
}
.gate-tip {
  font-size: 12px;
  color: #a8b0ba;
  text-align: center;
  margin-top: 14px;
  line-height: 1.7;
}

/* 黄提示条 */
.tip-yellow {
  background: #fffbe6;
  border: 1px solid #ffe58f;
  color: #874d00;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  margin-bottom: 14px;
}

/* 查看账号密码入口 */
.unlock-wrap { text-align: center; margin: 20px 0 18px; }
.unlock-btn {
  width: 100%;
  padding: 17px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  font-size: 17px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(102,126,234,.35);
  letter-spacing: .5px;
}
.unlock-sub { font-size: 12px; color: #a8b0ba; margin-top: 8px; }

/* 账号密码卡片 */
.cred-card {
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  border: 1px solid #dbe3ec;
  border-radius: 18px;
  padding: 4px 18px;
  box-shadow: 0 6px 22px rgba(16,24,40,.09);
  margin-bottom: 16px;
}
.cred-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0;
  border-bottom: 1px solid #e3e9f0;
}
.cred-row:last-child { border-bottom: 0; }
.cred-left { flex: 1; min-width: 0; }
.cred-label {
  font-size: 12px;
  color: #8a929c;
  margin-bottom: 5px;
  letter-spacing: .5px;
}
.cred-value {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 16.5px;
  font-weight: 700;
  color: #0f1318;
  word-break: break-all;
  line-height: 1.4;
}
.cred-row:last-child .cred-value {
  font-size: 20px;
  letter-spacing: 3px;
}
.copy-btn {
  border: 0;
  background: var(--blue);
  color: #fff;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  flex: 0 0 auto;
  box-shadow: 0 4px 12px rgba(26,115,232,.3);
  transition: transform .1s, background .15s;
}
.copy-btn:active { background: var(--blue-dark); transform: scale(.95); }
.eye-btn {
  border: 1px solid #dbe3ec;
  background: #fff;
  width: 42px;
  height: 42px;
  border-radius: 10px;
  font-size: 17px;
  cursor: pointer;
  flex: 0 0 auto;
  line-height: 1;
}
.eye-btn:active { background: #f0f4f9; }

/* 取码卡片 */
.verify-card {
  background: #fff;
  border: 2px solid #d7e7fd;
  border-radius: 18px;
  box-shadow: 0 8px 26px rgba(26,115,232,.10);
}
.verify-card h2 {
  font-size: 18px;
  color: var(--blue);
  margin-bottom: 8px;
}
.verify-card .hint {
  font-size: 13.5px;
  color: #6b7280;
  line-height: 1.6;
}
.verify-card .code-btn {
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  border-radius: 12px;
}
.verify-card .code-btn.primary {
  box-shadow: 0 6px 18px rgba(26,115,232,.32);
}
.verify-card .code-btn.primary:active { transform: scale(.985); }
.verify-card #codeResult {
  margin-top: 14px;
  padding: 18px 14px;
  border-radius: 14px;
}
.verify-card #codeResult .num {
  font-size: 40px;
  letter-spacing: 10px;
}
.verify-card #codeResult .tip { font-size: 13px; }

/* 弹层 */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}
.modal.show { display: flex; }
.modal-card {
  background: #fff;
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
}
.modal-title { font-size: 18px; font-weight: 700; text-align: center; margin-bottom: 16px; }
.modal-video {
  background: #16181d;
  border-radius: 12px;
  height: 200px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  position: relative;
  overflow: hidden;
}
.modal-video video {
  width: 100% !important;
  height: 100% !important;
  border-radius: 12px;
  background: #000;
  object-fit: contain;
}
.modal-video-status {
  position: absolute;
  bottom: 8px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 11px;
  color: #9aa3ad;
  pointer-events: none;
}

/* 链接有效期提示 */
.link-validity {
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 12px;
  line-height: 1.6;
}
.link-validity.buyout {
  background: #fff8e1;
  color: #e65100;
  border: 1px solid #ffe0a3;
}
.link-validity.arcade {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #c5e1a5;
}

/* 视频封面层 */
.video-cover {
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: linear-gradient(135deg, #2b1a4a 0%, #14121f 60%, #1e1a2e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  z-index: 3;
  transition: opacity .25s;
}
.video-cover.hide { opacity: 0; pointer-events: none; }

/* 有封面图时的遮罩，保证文字看得清 */
.video-cover.has-img {
  background-size: cover;
  background-position: center;
}
.video-cover.has-img::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 12px;
  background: rgba(0, 0, 0, .42);
}
.video-cover > * { position: relative; z-index: 1; }
.vc-play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255,255,255,.18);
  border: 2px solid rgba(255,255,255,.75);
  color: #fff;
  font-size: 22px;
  line-height: 52px;
  text-align: center;
  padding-left: 4px;
  box-sizing: border-box;
  margin-bottom: 4px;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
}
.vc-title {
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .5px;
}
.vc-sub {
  color: rgba(255,255,255,.62);
  font-size: 12px;
}
.pv-play { color: #fff; font-size: 34px; }
.modal-video-tip { color: #9aa3ad; font-size: 12px; margin-top: 10px; }
.modal-label { font-size: 13px; color: #666; margin-bottom: 8px; }
.modal-input {
  width: 100%;
  padding: 14px;
  font-size: 22px;
  letter-spacing: 8px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafbfc;
  font-family: ui-monospace, monospace;
}
.modal-err { color: #e53935; font-size: 13px; margin-top: 8px; min-height: 18px; text-align: center; }

/* 看视频提示 */
.watch-tip {
  background: #fff8e1;
  border: 1px solid #ffe0a3;
  color: #e65100;
  border-radius: 10px;
  padding: 12px;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.6;
  margin-bottom: 8px;
}

/* 复制账号后的引导图（底部浮条，不挡操作） */
.popup-tip {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(16px);
  width: 86%;
  max-width: 320px;
  background: rgba(20,22,28,.92);
  border-radius: 16px;
  padding: 10px 10px 12px;
  box-shadow: 0 12px 40px rgba(0,0,0,.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s ease, transform .22s ease, visibility .22s;
  z-index: 9998;
  pointer-events: none;
}
.popup-tip.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.popup-tip img {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.popup-tip-bar {
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  margin-top: 9px;
  letter-spacing: .3px;
}

/* 底部提示条 */
.alert-red {
  background: #e53935;
  color: #fff;
  text-align: center;
  padding: 15px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 700;
  margin-top: 18px;
  box-shadow: 0 6px 18px rgba(229,57,53,.28);
}
.alert-gray {
  text-align: center;
  font-size: 13px;
  color: #999;
  margin-top: 10px;
}

/* 内容编辑折叠面板 */
.edit-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.edit-panel > summary {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 650;
  font-size: 16px;
  color: var(--ink);
  list-style: none;
  user-select: none;
}
.edit-panel > summary::-webkit-details-marker { display: none; }
.edit-panel > summary::before {
  content: '▸';
  display: inline-block;
  width: 16px;
  color: #a8b0ba;
  transition: transform .15s;
}
.edit-panel[open] > summary::before { transform: rotate(90deg); }
.edit-panel[open] > summary { border-bottom: 1px solid var(--line); background: #fafbfc; }
.edit-panel > form { padding: 18px 20px 20px; }

/* 新建/保存后闪烁高亮 */
@keyframes blockFlash {
  0%   { outline: 3px solid #ffd666; outline-offset: 2px; }
  70%  { outline: 3px solid #ffd666; outline-offset: 2px; }
  100% { outline: 3px solid transparent; outline-offset: 2px; }
}
.block-flash { animation: blockFlash 2.2s ease; }

/* ============ 主号网格卡片 ============ */
.account-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 1600px) {
  .account-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1180px) {
  .account-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .account-grid { grid-template-columns: 1fr; }
}
.account-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-head { display: flex; align-items: center; gap: 6px; min-width: 0; }
.ac-email {
  flex: 1; min-width: 0;
  font-size: 13.5px; font-weight: 600; color: #1f2329;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

.ac-line {
  display: flex;
  align-items: center;
  gap: 7px;
}
.ac-progress {
  flex: 1; min-width: 40px;
  height: 5px;
  background: #eef1f5;
  border-radius: 99px;
  overflow: hidden;
}
.ac-progress-fill {
  height: 100%;
  background: linear-gradient(90deg,#667eea,#764ba2);
  border-radius: 99px;
  transition: width .3s;
}
.ac-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  white-space: nowrap;
}
.ac-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  white-space: nowrap;
}
.tag-arc {
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  box-shadow: 0 2px 6px rgba(102,126,234,.35);
}
.tag-pay { background: linear-gradient(135deg,#f2994a,#f2c94c); color: #fff; box-shadow: 0 2px 6px rgba(242,153,74,.3); }
.tag-off { background: #ffebee; color: #c62828; }
.tag-rotate {
  background: #e53935; color: #fff;
  box-shadow: 0 2px 6px rgba(229,57,53,.35);
  animation: pulseRed 1.6s ease-in-out infinite;
}
.tag-near { background: #fff3e0; color: #e65100; }

@keyframes pulseRed {
  0%, 100% { opacity: 1; }
  50% { opacity: .55; }
}

/* 异常 / 停用 / 已满 的卡片置灰 */
.account-card.is-dead {
  opacity: .5;
  filter: grayscale(.92);
  background: #f7f8fa;
}
.account-card.is-dead:hover { opacity: .75; filter: grayscale(.5); }
.account-card.is-off {
  opacity: .72;
  background: #fafbfc;
}
.account-card.is-off:hover { opacity: 1; }

.ac-more { border: 0; padding: 0; margin: 0; background: transparent; box-shadow: none; }
.ac-more > summary {
  cursor: pointer; font-size: 12px; color: #8a929c;
  list-style: none; padding: 2px 0; user-select: none;
}
.ac-more > summary::-webkit-details-marker { display: none; }
.ac-more > summary::before { content: '▸ '; }
.ac-more[open] > summary::before { content: '▾ '; }
.ac-more > summary:hover { color: var(--blue); }
.ac-panel {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}
.ac-panel .field { margin-bottom: 9px; }
.ac-panel label { font-size: 12px; margin-bottom: 3px; }
.ac-panel input, .ac-panel select { padding: 7px; font-size: 13px; }
.ac-panel .btn-sm { padding: 6px 12px; font-size: 12px; }

.health-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex: 0 0 9px;
  display: inline-block;
}
.health-ok { background: #34c759; box-shadow: 0 0 0 3px rgba(52,199,89,.16); }
.health-warn { background: #ff9500; box-shadow: 0 0 0 3px rgba(255,149,0,.16); }
.health-bad { background: #ff3b30; box-shadow: 0 0 0 3px rgba(255,59,48,.16); }
.health-unknown { background: #c7ccd4; }

.ac-del {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: #c7ccd4;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  flex: 0 0 22px;
  padding: 0;
}
.ac-del:hover { background: #ffe8e8; color: var(--red); }

/* 状态 chip */
.chip {
  padding: 6px 14px; border-radius: 999px; background: #f3f5f8;
  color: #59606a; text-decoration: none; font-size: 13px; font-weight: 600;
}
.chip.active { background: #1f2329; color: #fff; }

/* ============ 卡密分组 ============ */
.code-group {
  background: #fff; border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); padding: 14px 16px; margin-bottom: 14px;
}
.cg-head {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; flex-wrap: wrap; margin-bottom: 10px;
}
.cg-title { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cg-title b { font-size: 14px; }

.code-table { font-size: 13px; }
.code-cell code {
  font-family: ui-monospace, monospace; font-size: 13px;
  background: #f4f7fb; padding: 3px 8px; border-radius: 6px;
  color: var(--blue); font-weight: 600;
}
.time-cell { font-size: 12px; color: #a8b0ba; white-space: nowrap; }
.act-cell { white-space: nowrap; text-align: right; }
.mini-btn {
  border: 1px solid #dbe3ec; background: #fff; color: var(--blue);
  padding: 4px 10px; border-radius: 6px; font-size: 12px;
  cursor: pointer; margin-left: 4px;
}
.mini-btn.danger { color: var(--red); border-color: #ffd6d6; }
.mini-btn:active { background: #f0f4f9; }

/* 复制网盘链接按钮 */
.copy-link-btn {
  width: 100%;
  padding: 14px;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 12px;
  box-shadow: 0 6px 18px rgba(26,115,232,.3);
  transition: background .15s, transform .1s;
}
.copy-link-btn:active { transform: scale(.98); }

@media (max-width: 640px) {
  .account-grid { grid-template-columns: 1fr; }
}

/* 类型切换 tab */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab {
  padding: 9px 18px;
  border-radius: 999px;
  background: #f3f5f8;
  color: #59606a;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.tab:hover { background: #e9edf2; }
.tab.active {
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(102,126,234,.3);
}

/* ================= 后台布局：悬浮卡片侧栏 ================= */

.layout {
  display: flex;
  gap: 16px;
  padding: 16px;
  min-height: 100vh;
  align-items: flex-start;
}

.sidebar {
  width: 288px;
  flex: 0 0 288px;
  background: var(--card);
  border-radius: 18px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 20px 14px;
  position: sticky;
  top: 16px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 700;
  font-size: 17px;
  padding: 4px 14px 6px;
  color: var(--ink);
  letter-spacing: .2px;
}

.sidebar .sub {
  font-size: 11px;
  color: #a8b0ba;
  padding: 0 14px 18px;
  letter-spacing: 2px;
}

.sidebar .group {
  font-size: 11px;
  color: #a8b0ba;
  padding: 14px 14px 6px;
  letter-spacing: 1px;
}

.sidebar a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: 11px;
  color: #2b3138;
  text-decoration: none;
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 3px;
  transition: background .15s, color .15s;
}
.sidebar a:hover { background: #f4f6f9; }

.sidebar a.active {
  background: linear-gradient(135deg,#667eea,#764ba2);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(102,126,234,.32);
}

.sidebar .ico {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  stroke-width: 2;
}

.sidebar .sep { height: 1px; background: var(--line); margin: 14px 12px; }

.sidebar .user {
  margin-top: 6px;
  padding: 14px;
  border-radius: 12px;
  background: #f7f9fc;
  font-size: 13.5px;
  color: #333;
  line-height: 1.7;
}
.sidebar .user .uname { font-weight: 600; display: block; margin-bottom: 4px; }
.sidebar .user .logout {
  display: inline-block;
  margin-top: 6px;
  color: var(--red);
  font-size: 13px;
  text-decoration: none;
}
.sidebar .user .logout:hover { text-decoration: underline; background: none; }

.main {
  flex: 1;
  min-width: 0;
  max-width: 1200px;
  padding: 0 0 60px;
}
.main > .card:first-child { margin-top: 0; }

@media (min-width: 1600px) {
  .main { max-width: 1400px; }
}

/* 手机：侧栏变顶部横滑 */
@media (max-width: 820px) {
  .layout { flex-direction: column; gap: 12px; padding: 12px; }
  .sidebar {
    width: 100%;
    flex: none;
    position: sticky;
    top: 0;
    z-index: 30;
    max-height: none;
    padding: 8px;
    border-radius: 14px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .sidebar .brand,
  .sidebar .sub,
  .sidebar .group,
  .sidebar .sep,
  .sidebar .user { display: none; }
  .sidebar a {
    display: inline-flex;
    margin: 0 4px 0 0;
    padding: 9px 13px;
    font-size: 14px;
  }
  .sidebar .ico { display: none; }
  .main { padding: 0 0 40px; }
}
