/* ============================================================
   卡密商城 · 共用样式（前台 / 后台 / 代理后台三个页面共用）
   - 移动端优先：窄屏下表格自动变卡片、按钮和输入框加大点按区域
   - 前台只保留「开房入口」，购卡相关样式已全部移除
   ============================================================ */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e5e7eb;
  --text: #1b1d22;
  --muted: #6b7280;
  --gold: #d4af37;
  --gold-dark: #8a6a2a;
  --gold-soft: #fdf6e3;
  --danger: #d9534f;
  --radius: 16px;
  --btn-h: 40px;
  --btn-radius: 11px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-wrap: anywhere;
  /* 固定框架：禁止双击/双指缩放（配合 viewport 的 user-scalable=no） */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button, a, label, select, input[type="checkbox"] { touch-action: manipulation; }
button { -webkit-user-select: none; user-select: none; }

.hidden { display: none !important; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding: 10px 16px;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  place-items: center;
  overflow: hidden;
  border-radius: 12px;
  background: linear-gradient(145deg, #ffe9a8, #d4af37 46%, #8a6a2a);
  color: #1a1206;
  font-size: 17px;
  font-weight: 900;
  box-shadow: 0 6px 16px rgba(212, 175, 55, .35);
}

.brand-mark.has-image { background: #fff; }
.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand strong { display: block; font-size: 16px; letter-spacing: .02em; }
.brand small { display: block; color: var(--muted); font-size: 12px; }

.top-actions { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; flex-wrap: wrap; }

/* ---------- 布局 ---------- */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px 14px calc(40px + env(safe-area-inset-bottom));
  display: grid;
  gap: 14px;
}

/* 前台只有一个开房卡片，居中收窄更好看 */
.wrap:has(> .room-card:only-of-type) {
  max-width: 560px;
}

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

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.card-head h2 { margin: 0; font-size: 15px; letter-spacing: .02em; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* 注意：行内操作条有时写成 class="row-actions wrap"（wrap=允许折行），
   这跟页面布局的 .wrap（max-width/padding）撞名，会把按钮挤扁、把行撑高。这里显式清掉。 */
.row-actions.wrap { max-width: none; padding: 0; height: auto; min-height: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- 按钮（前台 / 后台 / 代理后台统一：同一高度、同一圆角、同一套配色） ---------- */
.gold-btn, .ghost-btn, .primary-btn, .btn-danger, .btn-ok {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: var(--btn-h);
  min-height: var(--btn-h);
  padding: 0 14px;
  border-radius: var(--btn-radius);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms var(--ease), box-shadow 160ms ease, background 160ms ease, border-color 160ms ease;
}

.gold-btn {
  background: linear-gradient(150deg, #17130b, #0a0a0c 48%, #1c1608);
  border-color: rgba(245, 214, 122, .55);
  color: #f5d67a;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .2), 0 0 14px rgba(214, 178, 92, .18);
}

.gold-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(0, 0, 0, .26), 0 0 20px rgba(245, 214, 122, .34); }

.ghost-btn { background: #fff; border-color: var(--line); color: #374151; }
.ghost-btn:hover { background: #f9fafb; border-color: #d7dae0; }

.primary-btn:hover { filter: brightness(1.08); }
.gold-btn:active, .ghost-btn:active, .primary-btn:active, .btn-danger:active, .btn-ok:active { transform: scale(.98); }

.primary-btn {
  width: 100%;
  background: var(--primary-bg, linear-gradient(150deg, #17130b, #0a0a0c 48%, #1c1608));
  border-color: var(--primary-border, rgba(245, 214, 122, .55));
  color: var(--primary-fg, #f5d67a);
  box-shadow: 0 8px 20px rgba(0, 0, 0, .2);
}

/* 后台配了自定义按钮颜色：去掉金边，改成柔和的白色描边 */
body.custom-btn .primary-btn {
  border-color: rgba(255, 255, 255, .28);
  box-shadow: 0 8px 22px rgba(16, 24, 40, .18);
}

.btn-ok { background: linear-gradient(150deg, #047857, #059669); border-color: #6ee7b7; color: #fff; }
.btn-danger { background: linear-gradient(150deg, #b91c1c, #dc2626); border-color: #fca5a5; color: #fff; }

.gold-btn:disabled, .ghost-btn:disabled, .primary-btn:disabled, .btn-danger:disabled, .btn-ok:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* 状态胶囊：尺寸统一（颜色由各页补充） */
.pill { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }

/* ---------- 表单 ---------- */
.field { display: grid; gap: 6px; margin-bottom: 12px; }
.field > span { color: var(--muted); font-size: 12.5px; }
.field .field { margin-bottom: 0; }
input, select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  color: var(--text);
  font: inherit;
  outline: 0;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, .16);
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

/* ---------- 开房区（本站原生开房） ---------- */
.room-card .card-head h2 { font-size: 17px; }

.code-row { display: flex; gap: 8px; }
.code-row input { flex: 1; min-width: 0; font-size: 15px; letter-spacing: .06em; }
.code-row .ghost-btn { flex: 0 0 auto; }

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fcfcfd;
  color: #4b5563;
  font-size: 12.5px;
  cursor: pointer;
}

.check-row input { width: 16px; height: 16px; flex: 0 0 auto; accent-color: var(--gold); }

/* 撞车模式：开关按钮（替代原来的勾选框） */
.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 2px 0 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfcfd;
  color: #374151;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease;
}

.switch-row:hover { background: #f9fafb; }
.switch-row[aria-checked="true"] { border-color: rgba(212, 175, 55, .6); background: var(--gold-soft); }
.switch-text { display: grid; gap: 2px; font-size: 13px; font-weight: 600; }
.switch-text small { color: var(--muted); font-size: 11.5px; font-weight: 400; }

.switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 180ms ease;
}

.switch-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(16, 24, 40, .28);
  transition: transform 180ms var(--ease);
}

.switch-row[aria-checked="true"] .switch { background: linear-gradient(150deg, #e8c860, #c39a2c); }
.switch-row[aria-checked="true"] .switch-knob { transform: translateX(20px); }

/* ---------- 前台验证卡密（简洁干净的一张卡） ---------- */
.gate-card { padding: 22px 18px 20px; }

.gate-hero { display: grid; justify-items: center; gap: 4px; margin-bottom: 18px; text-align: center; }

.gate-mark {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  overflow: hidden;
  margin-bottom: 6px;
  border-radius: 17px;
  background: linear-gradient(145deg, #ffe9a8, #d4af37 46%, #8a6a2a);
  color: #1a1206;
  font-size: 23px;
  font-weight: 900;
  box-shadow: 0 8px 20px rgba(212, 175, 55, .34);
}

.gate-mark.has-image { background: #fff; border: 1px solid var(--line); }
.gate-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.gate-hero h2 { margin: 0; font-size: 19px; letter-spacing: .02em; }
.gate-hero p { margin: 0; color: var(--muted); font-size: 12.5px; }

.gate-paused {
  margin-bottom: 12px;
  padding: 9px 12px;
  border: 1px solid rgba(183, 121, 31, .4);
  border-radius: 11px;
  background: #fff7e6;
  color: #b7791f;
  font-size: 12.5px;
  font-weight: 700;
  text-align: center;
}

.gate-form { display: grid; gap: 10px; }
.gate-form input { height: var(--btn-h); padding: 0 14px; font-size: 15.5px; letter-spacing: .06em; text-align: center; }
.gate-form .primary-btn { height: var(--btn-h); font-size: 14.5px; }

.gate-tips { margin: 14px 0 0; padding: 12px 14px 12px 30px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 12px; line-height: 1.9; }
.gate-tips li + li { margin-top: 2px; }
.gate-tips b { color: #8a6a2a; }

/* ---------- 公告弹窗 ---------- */
.notice-modal { width: min(430px, 100%); }
.notice-modal .primary-btn { margin-top: 14px; }

/* ---------- 底部悬浮 Tab 栏（圆角胶囊 + 图标文字 + 中间圆形按钮） ---------- */
.tabbar {
  position: fixed;
  left: 14px;
  right: 14px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 40;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: center;
  gap: 2px;
  height: 72px;
  padding: 0 8px;
  border-radius: 34px;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 34px rgba(16, 24, 40, .13), 0 1px 0 rgba(255, 255, 255, .9) inset;
}

/* 普通项：上图标下文字 */
.tab-item {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  height: 100%;
  padding: 0;
  border: none;
  border-radius: 20px;
  background: transparent;
  color: #b3b8c2;
  font-family: inherit;
  cursor: pointer;
  transition: color 160ms ease, transform 160ms ease;
}
.tab-item svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tab-item span { font-size: 11.5px; font-weight: 600; letter-spacing: .02em; }
.tab-item:active { transform: scale(.94); }
.tab-item.active { color: #17130b; }
.tab-item.active span { font-weight: 800; }

/* 红色数量角标 */
.tab-badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 7px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #f5222d;
  color: #fff;
  font-size: 10.5px;
  font-style: normal;
  font-weight: 800;
  line-height: 17px;
  text-align: center;
  box-shadow: 0 2px 6px rgba(245, 34, 45, .4);
}

/* 有 Tab 栏时给内容留出空间 */
body:has(.tabbar:not(.hidden)) .wrap { padding-bottom: calc(104px + env(safe-area-inset-bottom)); }

/* ---------- 我的卡密弹窗 ---------- */
.mine-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.mine-row:last-child { border-bottom: none; }
.mine-row .k { color: var(--muted); }
.mine-row .v { font-weight: 700; text-align: right; }

/* 验证卡密页：垂直居中，并且这一页隐藏顶部框架 / Tab 栏 / 页脚 */
body.gate-mode .wrap {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  align-content: center;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
body.gate-mode .foot { display: none; }
body.gate-mode .topbar { display: none; }

/* ---------- 维护提醒横幅（所有页面可见） ---------- */
.maintain-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 11px 14px;
  border: 1px solid rgba(212, 175, 55, .45);
  border-radius: 13px;
  background: linear-gradient(150deg, #fffaf0, var(--gold-soft));
  color: #8a6a2a;
  font-size: 13px;
  line-height: 1.6;
}
.maintain-banner b { color: #7a5c1f; }
.maintain-ico { font-size: 18px; line-height: 1; }

/* 开房成功弹窗里的房间号：银白底 + 黑色字 */
.room-modal .room-item {
  background: #f4f5f7;
  border-color: #e3e5e9;
}
.room-modal .room-item.is-main {
  background: #f2f3f5;
  border-color: #d9dbe0;
}
.room-modal .room-code { color: #111827; }
.room-modal .room-badge { background: #e6e8ec; color: #3f4550; }
.room-modal .room-item-left { color: #6b7280; }
/* ---------- 可爱风卡片（公告 / 售后） ---------- */
.cute-card { border-radius: 18px; }

.cute-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.cute-head h2 { margin: 0; font-size: 15.5px; letter-spacing: .02em; }
.cute-head small { display: block; color: var(--muted); font-size: 11.5px; font-weight: 400; letter-spacing: 0; }
.cute-head .row-actions, .cute-head > a, .cute-head > button { margin-left: auto; }

.cute-ico {
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(150deg, #fff6dc, var(--gold-soft));
  border: 1px solid rgba(212, 175, 55, .3);
  font-size: 19px;
  line-height: 1;
  box-shadow: 0 3px 10px rgba(212, 175, 55, .18);
}

.bound-ico { margin-right: 2px; }

/* 公告正文：舒服的阅读块 */
.notice-sep { height: 1px; margin: 12px 0; background: #f0f2f5; }
.notice-content {
  padding: 12px 14px;
  border-radius: 13px;
  background: #fbfbfc;
  border: 1px solid var(--line);
  color: #4b5563;
  font-size: 13.5px;
  line-height: 1.9;
}
.notice-block + .notice-block { margin-top: 12px; }
.notice-sub {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6a2a;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- 统一弹窗框架（前台所有弹窗共用） ---------- */
.modal-panel {
  width: min(420px, 100%);
  padding: 20px;
  border: 1px solid #eef0f3;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 22px 56px rgba(16, 24, 40, .2);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f2f5;
}
.modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 800; }
.modal-panel .primary-btn { width: 100%; }
.modal-panel .tip { margin: 0 0 14px; }

/* ---------- 「核验成功」卡密信息：标签定宽、数值右对齐，整排对齐 ---------- */
.room-info { display: grid; gap: 0; }
.room-info-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 9px 2px;
  border-bottom: 1px dashed #f0f2f5;
  font-size: 13px;
}
.room-info-row:last-child { border-bottom: none; }
.room-info-row > span { color: #8b93a1; }
.room-info-row > b { text-align: right; font-weight: 700; overflow-wrap: anywhere; }

/* ---------- 售后页：整齐划一 ---------- */
#page-service .card { padding: 18px; }
#page-service .field { margin-bottom: 12px; }
#page-service textarea { min-height: 92px; resize: vertical; }
.bound-card {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid #eef0f3;
  border-radius: 13px;
  background: #fbfcfd;
  font-size: 13px;
  color: #8b93a1;
}
.bound-card .code { color: #17130b; font-weight: 800; margin-left: auto; }
.as-list { display: grid; gap: 10px; }
.as-item {
  display: grid;
  gap: 6px;
  padding: 13px 15px;
  border: 1px solid #eef0f3;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}
.as-item-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.as-item-head .code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.as-problem { margin: 0; color: #374151; font-size: 13px; line-height: 1.7; }
.as-item .tiny { line-height: 1.6; }
.as-new { display: flex; align-items: center; gap: 8px; margin-top: 2px; padding: 9px 11px; border-radius: 11px; background: var(--gold-soft); font-size: 12.5px; }
.as-new .ghost-btn { margin-left: auto; }
/* ---------- 公告页：公告 / 教程 切换 + 教程条目 ---------- */
.seg-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-bottom: 12px;
  padding: 4px;
  border: 1px solid #eef0f3;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}
.seg-switch .seg-btn {
  height: 38px;
  border: none;
  border-radius: 999px;
  background: transparent;
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: #8b93a1;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}
.seg-switch .seg-btn.active { background: var(--accent, #17130b); color: #f5d67a; }
.seg-switch .seg-btn.hidden { display: none; }
.seg-switch:has(.seg-btn.hidden) { grid-template-columns: 1fr; }

.tuto-list { display: grid; gap: 10px; }
.tuto-item {
  display: grid;
  grid-template-columns: 26px 1fr;
  align-items: start;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid #eef0f3;
  border-radius: 14px;
  background: #fbfcfd;
}
.tuto-num {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 9px;
  background: var(--accent-soft, #fdf6e3);
  color: var(--accent-text, #8a6a2a);
  font-size: 12.5px;
  font-weight: 800;
}
.tuto-text { font-size: 13px; line-height: 1.75; color: #374151; }
/* ---------- 公告弹窗（简约 + 手机端友好） ---------- */
.notice-modal { width: min(400px, 100%); padding: 0; overflow: hidden; }
.notice-modal .notice-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 18px;
  border-bottom: 1px solid #f0f2f5;
  background: linear-gradient(160deg, #fffaf0, var(--accent-soft, #fdf6e3));
}
.notice-modal .notice-head .notice-ico {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #fff;
  font-size: 18px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
}
.notice-modal .notice-head h3 { flex: 1 1 auto; margin: 0; font-size: 15px; font-weight: 800; }
.notice-modal .notice-body {
  max-height: 52vh;
  overflow-y: auto;
  padding: 16px 18px;
  font-size: 13.5px;
  line-height: 1.9;
  color: #374151;
  -webkit-overflow-scrolling: touch;
}
.notice-modal .notice-foot { padding: 0 18px 16px; }
.notice-modal .notice-foot .primary-btn { width: 100%; }
.notice-modal .modal-panel { padding: 0; }
.notice-modal .notice-sep { margin: 14px 0; }

/* 手机端：贴底、圆角、内容可滚动 */
@media (max-width: 480px) {
  .notice-modal { width: 100%; border-radius: 20px; }
  .notice-modal .notice-body { max-height: 46vh; }
}
/* ---------- 房间保活 ---------- */
.keepalive-box {
  margin: 12px 0 8px;
  padding: 11px 13px;
  border: 1px solid #eef0f3;
  border-radius: 13px;
  background: #fbfcfd;
}
.keepalive-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
}
.keepalive-box .ghost-btn { height: 32px; padding: 0 11px; font-size: 12.5px; }
.keepalive-box .tiny { margin: 0; line-height: 1.6; }
.keepalive-box .tiny.keep-ok { color: #047857; font-weight: 600; }
/* ---------- 核验成功弹窗 ---------- */
.ok-dot {
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  margin-right: 6px;
  border-radius: 50%;
  background: #ecfdf5;
  color: #047857;
  font-size: 12px;
  font-weight: 900;
  vertical-align: -1px;
}
.verify-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid #eef0f3;
  border-radius: 12px;
  background: #fbfcfd;
}
.verify-code-row .code { flex: 1 1 auto; min-width: 0; color: #17130b; font-weight: 800; overflow-wrap: anywhere; }
.verify-code-row .ghost-btn { flex: 0 0 auto; height: 34px; padding: 0 12px; font-size: 12.5px; }
/* ---------- 公告块（本站公告） ---------- */
.notice-block + .notice-block { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line); }
.notice-sub { margin: 0 0 6px; font-size: 13px; color: #8a6a2a; }

/* ---------- 「向前冲」可爱动漫少女加载动画（小巧，纯 CSS） ---------- */
.run-loading { display: grid; justify-items: center; gap: 8px; padding: 14px 0 4px; }

.runner {
  position: relative;
  width: 40px;
  height: 40px;
  animation: runner-bob .42s ease-in-out infinite;
}

/* 后发（长发） */
.runner .hair-back {
  position: absolute;
  left: 12px;
  top: 3px;
  width: 16px;
  height: 17px;
  border-radius: 9px 9px 6px 6px;
  background: linear-gradient(170deg, #b98a45, #8a6224);
}

/* 双马尾 */
.runner .tail {
  position: absolute;
  top: 8px;
  width: 5px;
  height: 14px;
  border-radius: 3px;
  background: linear-gradient(180deg, #c39150, #8a6224);
  transform-origin: top center;
}
.runner .tail.l { left: 6px; animation: tail-a .42s ease-in-out infinite; }
.runner .tail.r { left: 29px; animation: tail-b .42s ease-in-out infinite; }

/* 头 + 刘海 + 蝴蝶结 + 脸部 */
.runner .head {
  position: absolute;
  left: 13px;
  top: 5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: linear-gradient(150deg, #ffe9d2, #f7d3ad);
  box-shadow: 0 1px 4px rgba(212, 175, 55, .35);
}
.runner .bang {
  position: absolute;
  left: -1px;
  top: -1px;
  width: 16px;
  height: 8px;
  border-radius: 8px 8px 3px 3px;
  background: linear-gradient(180deg, #b98a45, #a5762f);
}
.runner .bow {
  position: absolute;
  left: 4px;
  top: -4px;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: #f7a8c4;
  transform: rotate(45deg);
  box-shadow: 0 1px 3px rgba(247, 168, 196, .6);
}
.runner .face { position: absolute; inset: 0; }
.runner .eye {
  position: absolute;
  top: 6px;
  width: 2.5px;
  height: 3px;
  border-radius: 50%;
  background: #4a3a20;
  animation: blink 3.2s infinite;
}
.runner .eye.l { left: 3px; }
.runner .eye.r { left: 8.5px; }
.runner .blush {
  position: absolute;
  top: 9px;
  width: 3px;
  height: 2px;
  border-radius: 50%;
  background: #f7a8c4;
  opacity: .85;
}
.runner .blush.l { left: 1.5px; }
.runner .blush.r { left: 9.5px; }

/* 身体 + 手臂 + 裙子 + 腿 */
.runner .body {
  position: absolute;
  left: 17px;
  top: 19px;
  width: 7px;
  height: 8px;
  border-radius: 3px;
  background: #f7e6c8;
}
.runner .skirt {
  position: absolute;
  left: 13px;
  top: 25px;
  width: 0;
  height: 0;
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-top: 9px solid #d4af37;
  filter: drop-shadow(0 1px 2px rgba(138, 106, 42, .3));
}
.runner .leg {
  position: absolute;
  top: 33px;
  width: 3px;
  height: 7px;
  border-radius: 2px;
  background: #f7d3ad;
  transform-origin: top center;
}
.runner .leg.l { left: 15px; animation: runner-swap-a .42s ease-in-out infinite; }
.runner .leg.r { left: 22px; animation: runner-swap-b .42s ease-in-out infinite; }
.runner .arm {
  position: absolute;
  top: 20px;
  width: 3px;
  height: 8px;
  border-radius: 2px;
  background: #f7d3ad;
  transform-origin: top center;
}
.runner .arm.l { left: 13px; animation: runner-swap-b .42s ease-in-out infinite; }
.runner .arm.r { left: 25px; animation: runner-swap-a .42s ease-in-out infinite; }

.runner-lines {
  position: absolute;
  left: -14px;
  top: 22px;
  width: 14px;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .8));
  animation: runner-lines .5s linear infinite;
}

.sparkle {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #f7a8c4;
  animation: sparkle 1.1s ease-in-out infinite;
}
.sparkle.s1 { left: 34px; top: 7px; animation-delay: .1s; }
.sparkle.s2 { left: 3px; top: 3px; animation-delay: .45s; }
.sparkle.s3 { left: 30px; top: 26px; animation-delay: .75s; }

.run-text { margin: 0; color: #8a6a2a; font-size: 12px; font-weight: 700; }
.run-text::after { content: ""; animation: runner-dots 1.2s steps(4, end) infinite; }

@keyframes runner-bob { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-2px) } }
@keyframes runner-swap-a { 0%, 100% { transform: rotate(24deg) } 50% { transform: rotate(-24deg) } }
@keyframes runner-swap-b { 0%, 100% { transform: rotate(-24deg) } 50% { transform: rotate(24deg) } }
@keyframes tail-a { 0%, 100% { transform: rotate(18deg) } 50% { transform: rotate(-8deg) } }
@keyframes tail-b { 0%, 100% { transform: rotate(-18deg) } 50% { transform: rotate(8deg) } }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1) } 96% { transform: scaleY(.15) } }
@keyframes runner-lines { 0% { opacity: 0; transform: translateX(5px) scaleX(.4) } 50% { opacity: 1; transform: translateX(0) scaleX(1) } 100% { opacity: 0; transform: translateX(-5px) scaleX(.4) } }
@keyframes sparkle { 0%, 100% { opacity: 0; transform: scale(.6) } 50% { opacity: 1; transform: scale(1.15) } }
@keyframes runner-dots { 0% { content: "" } 25% { content: "." } 50% { content: ".." } 75% { content: "..." } }

/* ---------- 开房失败弹窗 ---------- */
.fail-modal { text-align: center; }
.fail-modal h3 { margin: 6px 0 4px; font-size: 16px; }
.fail-emoji { font-size: 40px; line-height: 1.1; }
.fail-reason { margin: 0 0 4px; padding: 10px 12px; border: 1px solid rgba(217, 83, 79, .3); border-radius: 11px; background: #fef2f2; color: var(--danger); font-size: 13px; line-height: 1.7; }
.fail-modal .tip { margin-bottom: 12px; }

/* ---------- 卡密有问题（blocked）引导卡 ---------- */
.blocked-reason {
  margin: 4px 0 10px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 83, 79, .3);
  border-radius: 12px;
  background: #fef2f2;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.75;
}
.blocked-code { margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.blocked-code .code { color: var(--text); }

/* 售后页：已自动绑定的卡密 */
.bound-card {
  margin-bottom: 12px;
  padding: 10px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fafafb;
  font-size: 13px;
  color: var(--muted);
}
.bound-card .code { color: var(--text); }

/* 售后结论：此卡正常（绿色勾） */
.as-item.as-normal { border-color: rgba(16, 185, 129, .35); background: linear-gradient(160deg, #f4fdf9, #ecfdf5); }
.as-check {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  margin-right: 6px;
  border-radius: 50%;
  background: #10b981;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}
.pill.NORMAL { background: #ecfdf5; color: #047857; }

/* ---------- 解绑弹窗 ---------- */
.release-modal { text-align: center; }
.release-modal h3 { margin: 6px 0 6px; font-size: 16px; }
.unbind-ico { font-size: 34px; line-height: 1.1; }
.release-modal .tip { margin-bottom: 14px; }
.as-list { display: grid; gap: 10px; }
.empty-tip { color: var(--muted); }
.as-item { padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #fcfcfd; box-shadow: 0 2px 8px rgba(16, 24, 40, .04); }
.as-item-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.as-problem { margin-top: 6px; font-size: 13px; line-height: 1.7; }
.as-new { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: var(--gold-soft); font-size: 12.5px; }

.pill-room-paused {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff7e6;
  border: 1px solid rgba(183, 121, 31, .4);
  color: #b7791f;
  font-size: 11.5px;
  font-weight: 700;
}

.room-info {
  margin: 10px 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfcfd;
  font-size: 12.5px;
}

.room-info-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 3px 0; }
.room-info-row + .room-info-row { border-top: 1px dashed var(--line); }
.room-info-row > span { color: var(--muted); flex: 0 0 auto; }
.room-info-row .good { color: #047857; }
.room-info-row .warn { color: #b7791f; }
.room-info-row .bad { color: var(--danger); }

.room-status { display: none; margin-top: 10px; padding: 9px 12px; border-radius: 11px; font-size: 12.5px; line-height: 1.6; }
.room-status.ok { display: block; background: #ecfdf5; border: 1px solid rgba(4, 120, 87, .28); color: #047857; }
.room-status.err { display: block; background: #fef2f2; border: 1px solid rgba(217, 83, 79, .3); color: var(--danger); }
.room-status.loading { display: block; background: #f9fafb; border: 1px solid var(--line); color: var(--muted); }

.room-result { margin-top: 14px; padding-top: 14px; border-top: 1px dashed var(--line); }
.room-result-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.room-result-head h3 { margin: 0; font-size: 14px; }

.room-list { display: grid; gap: 8px; }
.room-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fcfcfd;
}
.room-item.is-main {
  border-color: var(--accent, rgba(212, 175, 55, .55));
  background: var(--accent-soft, var(--gold-soft));
}
.room-item.is-single { flex-direction: column; gap: 6px; padding: 16px 13px; }
.room-item-left { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.room-badge { padding: 2px 8px; border-radius: 999px; background: var(--accent-soft, rgba(212, 175, 55, .18)); color: var(--accent-text, #8a6a2a); font-size: 11px; font-weight: 800; white-space: nowrap; }
.room-badge.main { background: var(--accent-soft, rgba(212, 175, 55, .26)); }
.room-code { color: var(--accent-text, #b8860b); font-size: 16px; font-weight: 900; letter-spacing: .12em; }
.room-code-lg { font-size: clamp(26px, 8vw, 32px); letter-spacing: .16em; text-align: center; }

/* ---------- 公告（前台 / 代理后台共用） ---------- */
.notice-card {
  border-color: rgba(212, 175, 55, .5);
  background: linear-gradient(180deg, #fffdf5, #fff);
}

.notice-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.notice-head h2 { margin: 0; font-size: 15px; color: #8a6a2a; }

/* ---------- 表格（后台 / 代理后台） ---------- */
.table-wrap { overflow: auto; -webkit-overflow-scrolling: touch; }
table.grid-table { width: 100%; border-collapse: collapse; font-size: 13px; }
table.grid-table th, table.grid-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
table.grid-table th { color: var(--muted); font-weight: 600; font-size: 12px; white-space: nowrap; }
.code, .card-code span { font-family: ui-monospace, Menlo, Consolas, monospace; word-break: break-all; }

/* 卡密清单 / 复制区 */
.card-code-list { display: grid; gap: 6px; }
.card-code { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fcfcfd; }
.card-code span { font-size: 13px; }

.pick-col { width: 42px; text-align: center !important; }
.pick-col input { width: 18px; height: 18px; accent-color: var(--gold); }

.empty { padding: 18px 8px; color: var(--muted); font-size: 13px; text-align: center; }

/* ---------- 弹窗（前台 / 后台 / 代理统一观感） ---------- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(23, 19, 11, .45);
  backdrop-filter: blur(3px);
  animation: modal-fade 160ms ease;
}

.modal-panel {
  width: min(430px, 100%);
  max-height: min(86vh, 720px);
  max-height: min(86dvh, 720px);
  overflow: auto;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(16, 24, 40, .24);
  animation: modal-pop 200ms var(--ease);
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.modal-head h3 { margin: 0; font-size: 15px; letter-spacing: .02em; }
.modal-panel .field:last-of-type { margin-bottom: 12px; }
.modal-panel .primary-btn { margin-top: 4px; }

@keyframes modal-fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes modal-pop { from { opacity: 0; transform: translateY(8px) scale(.98) } to { opacity: 1; transform: none } }

/* ---------- 其它 ---------- */
.query-input { width: 170px; }
.tip { margin: 10px 2px 0; color: var(--muted); font-size: 12px; line-height: 1.7; }
.foot { text-align: center; color: var(--muted); font-size: 12px; padding: 6px 0 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  z-index: 90;
  max-width: 86vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: rgba(23, 19, 11, .95);
  color: #f5d67a;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(10px);
  transition: opacity 200ms ease, transform 200ms var(--ease);
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.error { background: rgba(153, 27, 27, .95); color: #fff; }

/* ============================================================
   手机端适配
   ============================================================ */

/* 输入框 / 按钮：窄屏下加大点按区域，避免误触 */
@media (hover: none) and (pointer: coarse) {
  :root { --btn-h: 46px; }
  input, select, textarea { padding: 12px 13px; font-size: 16px; }
}

@media (max-width: 720px) {
  .topbar { padding: 10px 12px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; border-radius: 11px; font-size: 15px; }
  .brand strong { font-size: 15px; }
  .wrap { padding: 12px 12px calc(32px + env(safe-area-inset-bottom)); gap: 12px; }
  .card { padding: 13px; border-radius: 14px; }
  .form-grid { grid-template-columns: 1fr; }
  .query-input { width: 100%; }

  /* 表格 → 卡片：每行变成一张卡，字段名由 td[data-label] 提供 */
  /* 用 body 前缀提高优先级，压过各页面 <style> 里的桌面表格样式 */
  body table.grid-table thead { display: none; }
  body table.grid-table,
  body table.grid-table tbody,
  body table.grid-table tr,
  body table.grid-table td,
  body table.grid-table tbody > tr > th { display: block; width: 100%; }

  body table.grid-table tr {
    margin-bottom: 10px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 13px;
    background: #fff;
    box-shadow: var(--shadow);
  }

  body table.grid-table tbody > tr > th {
    padding: 0 0 4px;
    border: none;
    color: var(--text);
    font-size: 13px;
    font-weight: 700;
  }

  body table.grid-table td {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    border: none;
    text-align: right;
    white-space: normal;
  }

  body table.grid-table td + td { border-top: 1px dashed var(--line); }

  body table.grid-table td::before {
    content: attr(data-label);
    flex: 0 0 5.5em;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    text-align: left;
  }

  /* 空行（colspan 占位）和操作列特殊处理 */
  body table.grid-table td[colspan]::before { content: none; }
  body table.grid-table td[colspan] { justify-content: center; text-align: center; }
  body table.grid-table td[data-label="操作"] { flex-direction: column; align-items: stretch; gap: 8px; }
  body table.grid-table td[data-label="操作"]::before { flex: none; }
  body table.grid-table td[data-label="操作"] .row-actions { justify-content: flex-end; }
  body table.grid-table td[data-label="操作"] .ghost-btn,
  body table.grid-table td[data-label="操作"] .gold-btn { min-height: 44px; }

  .card-code { flex-direction: row; }
  .card-code span { font-size: 12.5px; }

  /* 只有按钮的字段（空标签只是为了桌面端和输入框对齐），窄屏不需要占位 */
  .field-btn > span { display: none; }
}

@media (max-width: 420px) {
  .brand small { display: none; }
  .room-code-lg { font-size: 26px; letter-spacing: .1em; }
  .room-info-row { align-items: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
