/* =========================================================
   管理后台 · 样式
   沿用游戏中心的手绘羊皮纸风格：奶白底、深棕字、金棕描边
   ========================================================= */
:root {
  --cream: #fdf7ea;
  --cream-2: #f7ecd7;
  --card: #fffdf7;
  --ink: #3d2b17;
  --ink-2: #7a6142;
  --ink-3: #a08a68;
  --brown: #6b4410;
  --gold: #e8b45a;
  --gold-d: #c98f2e;
  --line: rgba(120, 85, 40, .16);
  --line-2: rgba(120, 85, 40, .28);
  --ok: #3f9b62;
  --warn: #c4782a;
  --danger: #c0392b;
  --shadow: 0 10px 30px rgba(90, 60, 20, .12);
  --radius: 14px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 12% -10%, #fff8e6 0%, rgba(255, 248, 230, 0) 60%),
    radial-gradient(900px 500px at 100% 0%, #fdf1d8 0%, rgba(253, 241, 216, 0) 55%),
    linear-gradient(180deg, #fdf6e8 0%, #f6ead4 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

/* ---------------- 登录门 ---------------- */
.gate {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(56, 36, 12, .5);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}

.gate__card {
  width: min(360px, 92vw);
  padding: 28px 26px 24px;
  border-radius: 20px;
  background: linear-gradient(180deg, #fffdf6, #fdf3dd);
  border: 2px solid rgba(255, 255, 255, .9);
  box-shadow: 0 24px 60px rgba(60, 35, 5, .35), inset 0 2px 0 #fff;
  text-align: center;
}

.gate__ico { font-size: 34px; line-height: 1; }
.gate h1 { margin: 10px 0 4px; font-size: 19px; letter-spacing: .5px; color: var(--brown); }
.gate p { margin: 0 0 18px; font-size: 12.5px; color: var(--ink-3); }

.pin {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 14px;
}

.pin input {
  width: 46px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-weight: 800;
  color: var(--brown);
  background: #fff;
  border: 2px solid var(--line-2);
  border-radius: 12px;
  outline: none;
  transition: border-color .16s, box-shadow .16s, transform .16s;
}

.pin input:focus {
  border-color: var(--gold-d);
  box-shadow: 0 0 0 4px rgba(232, 180, 90, .25);
}

.pin.is-error input {
  border-color: var(--danger);
  animation: shake .36s;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}

.gate__tip {
  min-height: 18px;
  margin: 4px 0 12px;
  font-size: 12px;
  color: var(--danger);
}

/* ---------------- 布局 ---------------- */
.wrap {
  /* 横屏 / 宽屏铺满整个视口；窄屏靠下方响应式规则收口 */
  width: 100%;
  max-width: none;
  margin: 0 auto;
  padding: 22px clamp(14px, 2.2vw, 40px) 60px;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  margin-bottom: 16px;
  background: linear-gradient(180deg, rgba(255, 253, 246, .96), rgba(250, 240, 220, .96));
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}

.topbar__title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-right: auto;
}

.topbar h1 {
  margin: 0;
  font-size: 17px;
  letter-spacing: .6px;
  color: var(--brown);
}

.topbar small { color: var(--ink-3); font-size: 11.5px; font-weight: 600; }

.coin-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff6dd, #ffe7b4);
  border: 1.5px solid rgba(255, 255, 255, .9);
  box-shadow: 0 3px 10px rgba(160, 110, 30, .18), inset 0 1px 0 #fff;
  font-weight: 800;
  color: #7a4d0c;
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 196px 1fr;
  gap: 16px;
  align-items: start;
}

.nav {
  position: sticky;
  top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: rgba(255, 253, 246, .92);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

.nav button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-2);
  text-align: left;
  background: transparent;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background .18s, color .18s;
}

.nav button:hover { background: rgba(232, 180, 90, .16); }

.nav button.is-on {
  color: var(--brown);
  background: linear-gradient(180deg, #fff3d2, #ffe3ad);
  box-shadow: inset 0 1px 0 #fff, 0 2px 8px rgba(170, 115, 30, .18);
}

.nav svg { flex: none; }

.panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

/* 横屏 / 宽屏：左侧导航固定，右侧卡片并排铺开，横向空间利用更合理 */
@media (min-width: 1280px) {
  .panel { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1800px) {
  .layout { grid-template-columns: 240px minmax(0, 1fr); gap: 20px; }
  .panel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .nav button { font-size: 14px; padding: 11px 14px; }
}

/* 重型卡片需要整行展示：内嵌内容后台、场景/路径编辑器、数据表、橱窗 */
.panel .card:has(.fq-admin-frame),
.panel .card:has(.gs-editor),
.panel .card:has(.tbl-wrap),
.panel .card:has(.wardrobe-group) {
  grid-column: 1 / -1;
}

/* 页内子页签（角色库/小屋库/橱窗）栏本身要占整行；
   并且该页同一时间只显示一个分区，卡片也应铺满整行，否则会挤在右半边 */
.panel > .kb-mode { grid-column: 1 / -1; }
.panel:has(> .kb-mode) > .card { grid-column: 1 / -1; }

/* 整页只有一张卡片时（角色信息/金币/道具商城/持有道具/题库/备份等），
   让它铺满整行：否则在 2/3 列网格里只占左半边，右侧大片空白，
   长列表还会被压窄拉得极长 */
.panel > .card:only-of-type { grid-column: 1 / -1; }

/* 页头说明 / 选择器类卡片（关卡进度、音乐音效顶部）也铺满整行，
   避免按钮在窄卡里换行、下方留白 */
.panel > .card--wide { grid-column: 1 / -1; }

/* 超宽屏（3 列）下的补位：只有两张普通卡时，第二张补满剩余两列，
   避免右侧空一整列；游戏设置页固定两列（选择器+配置并排、编辑器整行） */
@media (min-width: 1800px) {
  .panel > .card:nth-child(2):last-child:not(.card--wide) { grid-column: span 2; }
  .panel:has(.gs-games),
  .panel:has(.audio-select) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.card {
  min-width: 0;
  padding: 18px;
  background: rgba(255, 253, 247, .96);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 16px;
  box-shadow: var(--shadow), inset 0 1px 0 #fff;
}

.card__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}

.card__head h2 {
  margin: 0;
  font-size: 15px;
  color: var(--brown);
  letter-spacing: .4px;
}

.card__head .grow { margin-left: auto; }

.hint {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}

.hint b { color: var(--ink-2); }

/* ---------------- 控件 ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #5a3a0e;
  background: linear-gradient(180deg, #fff6e0, #ffe3b0);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 10px;
  box-shadow: 0 2px 0 rgba(160, 110, 30, .25), inset 0 1px 0 #fff;
  cursor: pointer;
  transition: transform .14s, box-shadow .18s, filter .18s;
}

.btn:hover { filter: brightness(1.03); }
.btn:active { transform: translateY(1px); box-shadow: 0 1px 0 rgba(160, 110, 30, .25), inset 0 1px 0 #fff; }

.btn--ghost {
  color: var(--ink-2);
  background: rgba(255, 255, 255, .7);
  box-shadow: none;
  border: 1.5px solid var(--line-2);
}

.btn--danger {
  color: #fff;
  background: linear-gradient(180deg, #e06a55, #c0392b);
  border-color: rgba(255, 255, 255, .5);
  box-shadow: 0 2px 0 rgba(140, 40, 30, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
}

.btn--sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; }

.btn:disabled { opacity: .45; cursor: not-allowed; }

input[type="number"], input[type="text"], select, textarea {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 9px;
  padding: 7px 10px;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}

input[type="number"] { width: 96px; }
input[type="text"] { width: 100%; }

input:focus, select:focus, textarea:focus {
  border-color: var(--gold-d);
  box-shadow: 0 0 0 3px rgba(232, 180, 90, .22);
}

textarea {
  width: 100%;
  min-height: 68px;
  resize: vertical;
  line-height: 1.55;
}

.row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.row + .row { margin-top: 10px; }

.row > label { font-size: 13px; color: var(--ink-2); font-weight: 700; }

/* ---------------- 概览 ---------------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.stat {
  padding: 14px;
  border-radius: 12px;
  background: linear-gradient(180deg, #fffdf4, #fbf0d9);
  border: 1.5px solid var(--line);
}

.stat__k { font-size: 11.5px; color: var(--ink-3); font-weight: 700; letter-spacing: .4px; }
.stat__v { margin-top: 6px; font-size: 22px; font-weight: 900; color: var(--brown); font-variant-numeric: tabular-nums; }
.stat__s { margin-top: 4px; font-size: 11.5px; color: var(--ink-3); }

.game-list { display: flex; flex-direction: column; gap: 8px; }

.game-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .7);
  border: 1.5px solid var(--line);
}

.game-row__ico { font-size: 20px; }
.game-row__name { font-weight: 800; color: var(--ink); min-width: 86px; }
.game-row__sum { flex: 1; font-size: 12.5px; color: var(--ink-2); }
.game-row__bar {
  width: 120px;
  height: 7px;
  border-radius: 999px;
  background: rgba(150, 115, 60, .16);
  overflow: hidden;
}
.game-row__bar i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #f3c46a, #e09b2d);
  transition: width .35s;
}

/* ---------------- 表格 ---------------- */
.tbl-wrap {
  max-height: 340px;
  overflow: auto;
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
}

table { width: 100%; border-collapse: collapse; font-size: 12.5px; }

th, td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fdf5e4;
  font-size: 11.5px;
  color: var(--ink-2);
  letter-spacing: .3px;
}
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: #fffaf0; }
td.keys { font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.stars { display: inline-flex; gap: 2px; }

.star {
  width: 24px;
  height: 24px;
  padding: 0;
  font-size: 17px;
  line-height: 1;
  color: rgba(150, 120, 70, .3);
  background: none;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: color .14s, transform .14s;
}

.star.on { color: #f0a92a; text-shadow: 0 1px 2px rgba(200, 140, 20, .35); }
.star:hover { transform: scale(1.15); }

.flag {
  width: 26px;
  height: 26px;
  font-size: 15px;
  color: rgba(150, 120, 70, .35);
  background: none;
  border: none;
  cursor: pointer;
}
.flag.on { color: var(--ok); }

.empty {
  padding: 26px 12px;
  text-align: center;
  font-size: 12.5px;
  color: var(--ink-3);
}

/* ---------------- 题库 ---------------- */
.bank-list { display: flex; flex-direction: column; gap: 8px; }

.bank-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 13px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .78);
  border: 1.5px solid var(--line);
  cursor: pointer;
  transition: border-color .16s, background .16s, transform .16s;
}

.bank-item:hover { border-color: var(--gold); background: #fffcf3; transform: translateY(-1px); }
.bank-item.is-on { border-color: var(--gold-d); background: linear-gradient(180deg, #fff8e6, #fdefd0); }

.bank-item__t { font-weight: 800; font-size: 13px; }
.bank-item__m { font-size: 11.5px; color: var(--ink-3); }
.bank-item__n {
  margin-left: auto;
  padding: 3px 9px;
  font-size: 11.5px;
  font-weight: 800;
  color: #7a4d0c;
  background: #ffeec6;
  border-radius: 999px;
}

.q-editor { display: flex; flex-direction: column; gap: 10px; }

.q-item {
  padding: 12px;
  border-radius: 11px;
  background: #fff;
  border: 1.5px solid var(--line);
}

.q-item__head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.q-item__id { font-size: 11.5px; font-weight: 800; color: var(--ink-3); }
.q-item__unit { font-size: 11.5px; color: var(--ink-3); }
.q-item__body { display: grid; gap: 8px; }
.q-item label { font-size: 11.5px; font-weight: 700; color: var(--ink-2); }
.q-item__ops { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }

.chip {
  padding: 3px 9px;
  font-size: 11.5px;
  color: var(--ink-2);
  background: #fbf3e2;
  border: 1px solid var(--line-2);
  border-radius: 999px;
}

.chip.is-answer { color: #1f6b3f; background: #e6f7ec; border-color: rgba(60, 160, 100, .35); font-weight: 800; }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 14px);
  padding: 10px 20px;
  font-size: 13px;
  font-weight: 800;
  color: #5a3a0e;
  background: linear-gradient(180deg, #fffdf4, #ffedc6);
  border: 1.5px solid rgba(255, 255, 255, .9);
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(90, 55, 10, .28);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  z-index: 200;
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast.is-bad { color: #7d1f16; background: linear-gradient(180deg, #fff1ee, #ffd9d2); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 800;
  border-radius: 999px;
  background: #f0f7f1;
  color: #2f7a4d;
  border: 1px solid rgba(60, 160, 100, .3);
}

.badge--off { background: #fdf0ee; color: #a23a2a; border-color: rgba(190, 80, 60, .3); }

.section-title {
  margin: 18px 0 10px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-2);
  letter-spacing: .4px;
}

.section-title:first-child { margin-top: 0; }

/* ---------------- 知识题库：按游戏分类 ---------------- */
.kb-mode { display: flex; gap: 6px; }

.seg-btn {
  height: 28px;
  padding: 0 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-3);
  background: rgba(255, 255, 255, .7);
  border: 1.5px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  transition: all .16s;
}

.seg-btn.is-on {
  color: var(--brown);
  background: linear-gradient(180deg, #fff3d2, #ffe3ad);
  border-color: var(--gold-d);
}

.kb-games { display: flex; flex-wrap: wrap; gap: 8px; }

.kb-game {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 36px;
  padding: 0 14px;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
  background: rgba(255, 255, 255, .82);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all .16s;
}

.kb-game:hover { border-color: var(--gold); transform: translateY(-1px); }

.kb-game.is-on {
  color: var(--brown);
  background: linear-gradient(180deg, #fff8e6, #fdefd0);
  border-color: var(--gold-d);
  box-shadow: 0 2px 8px rgba(170, 115, 30, .18), inset 0 1px 0 #fff;
}

.kb-game__n {
  margin-left: 4px;
  padding: 1px 7px;
  font-size: 10.5px;
  font-weight: 800;
  color: #7a4d0c;
  background: #ffeec6;
  border-radius: 999px;
}

.kb-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.kb-filter > label {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-3);
  letter-spacing: .3px;
}

.kb-pills { display: flex; flex-wrap: wrap; gap: 6px; }

.kb-pill {
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}

.kb-pill:hover { border-color: var(--gold); }

.kb-pill.is-on {
  color: #7a4d0c;
  background: #fff0c8;
  border-color: var(--gold-d);
  font-weight: 800;
}

.kb-sum {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 700;
}

.kb-sum .btn { margin-left: auto; }

.kb-unit {
  border: 1.5px solid var(--line);
  border-radius: 11px;
  background: #fff;
  margin-bottom: 8px;
  overflow: hidden;
}

.kb-unit summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 13px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
}

.kb-unit summary::-webkit-details-marker { display: none; }

.kb-unit summary::before {
  content: '▸';
  color: var(--gold-d);
  font-size: 11px;
  transition: transform .18s;
}

.kb-unit[open] summary::before { transform: rotate(90deg); }
.kb-unit[open] summary { background: #fffaf0; border-bottom: 1px solid var(--line); }

.kb-unit__n {
  margin-left: auto;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 800;
  color: #7a4d0c;
  background: #ffeec6;
  border-radius: 999px;
}

.kb-kind {
  flex: none;
  padding: 1px 8px;
  font-size: 10.5px;
  font-weight: 800;
  color: #7a4d0c;
  background: #f4ead4;
  border-radius: 999px;
}

.kb-words {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 6px;
  padding: 12px;
}

.kb-words--block { grid-template-columns: 1fr; }

.kb-q {
  padding: 9px 11px;
  background: #fdf9f0;
  border-radius: 9px;
}

.kb-poem {
  padding: 3px 2px;
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--ink);
  letter-spacing: .5px;
}

.kb-q__t { font-size: 12.5px; font-weight: 700; color: var(--ink); line-height: 1.55; }
.kb-q__o { margin-top: 4px; font-size: 12px; color: var(--ink-3); line-height: 1.65; }
.kb-q__a { margin-top: 5px; font-size: 11.5px; font-weight: 800; color: var(--ink-3); }
.kb-q__a.is-ans { color: #1f6b3f; }

.kb-word {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 6px 9px;
  font-size: 12.5px;
  background: #fdf9f0;
  border-radius: 8px;
}

.kb-word b { color: var(--ink); font-weight: 800; }
.kb-word span { color: var(--ink-3); }
.kb-word__n { margin-left: auto; font-size: 13px; }

/* 板块样例题 */
.kb-board-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px 10px;
}

.kb-board-tools .hint { flex: 1; font-size: 11.5px; }
.kb-board-tools .btn { flex: none; }

.kb-samples { display: flex; flex-direction: column; gap: 8px; padding: 0 12px 12px; }

.kb-qcard {
  padding: 10px 12px;
  background: #fffdf6;
  border: 1.5px solid var(--line);
  border-radius: 10px;
}

.kb-qcard__h { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.kb-qcard__lv { font-size: 10.5px; font-weight: 800; color: var(--ink-3); }
.kb-qcard__t { font-size: 13.5px; font-weight: 800; color: var(--ink); letter-spacing: .3px; }
.kb-qcard__t.is-audio { font-size: 12.5px; font-weight: 700; color: var(--ink-3); }
.kb-qcard__hint { font-size: 11.5px; color: var(--ink-3); }

.kb-opts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.kb-opt {
  padding: 4px 11px;
  font-size: 12px;
  color: var(--ink-2);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
}

.kb-opt.is-ans {
  color: #1f6b3f;
  background: #e6f7ec;
  border-color: rgba(60, 160, 100, .45);
  font-weight: 800;
}

.kb-qcard__a { margin-top: 8px; font-size: 11.5px; font-weight: 800; color: var(--ink-3); }

.kb-sent { padding: 0 12px 12px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
.kb-sent__t { font-weight: 800; color: var(--ink-3); font-size: 11.5px; margin-bottom: 2px; }

/* ---------------- 图片字段 / 热点编辑 ---------------- */
.img-field { display: flex; gap: 6px; }
.img-field input[type="text"] { flex: 1; min-width: 0; }
.img-field .btn { flex: none; height: 34px; }

.hot-edit {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  margin-bottom: 6px;
}

.hot-edit input[type="number"] { width: 50px; padding: 4px 5px; font-size: 12px; }
.hot-edit select { width: 92px; padding: 4px 5px; font-size: 12px; }
.hot-edit input[type="text"] { height: 28px; }
.hot-edit { gap: 5px; }
.hot-edit input[type="checkbox"] { width: 16px; height: 16px; accent-color: #c98f2e; }
.hot-edit .btn { padding: 0 8px; height: 26px; font-size: 11px; }
.hot-edit__tail {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.hot-edit.is-off { opacity: .5; background: #fbf6ec; }
.hot-edit.is-off input[type="text"] { text-decoration: line-through; }

.role-card.is-off { opacity: .55; }
.role-card.is-off img { filter: grayscale(1); }

/* 小屋图片预览 */
.pv-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
  padding: 10px;
  background: rgba(255, 255, 255, .55);
  border: 1.5px dashed var(--line-2);
  border-radius: 11px;
}

.pv-cell { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pv-cell .cat-img { width: 74px; height: 54px; }
.pv-cell__n { font-size: 11px; color: var(--ink-3); text-align: center; }

/* ---------------- 图片放大查看 ---------------- */
.cat-img.is-zoomable { cursor: zoom-in; position: relative; }
.cat-img.is-zoomable:hover { box-shadow: 0 0 0 2px rgba(201, 143, 46, .55); }

.img-zoom {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  place-items: center;
  padding: 28px;
  background: rgba(28, 20, 10, .78);
}

.img-zoom.is-on { display: grid; }

.img-zoom__in {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  max-height: 100%;
}

.img-zoom__img {
  max-width: 90vw;
  max-height: 78vh;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .45);
}

.img-zoom__cap { font-size: 12px; color: #fff; opacity: .88; }

.img-zoom__x {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 34px;
  height: 34px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #fff;
  color: #5b4322;
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .3);
}

/* ---------------- 热点实时预览 ---------------- */
.hot-layout {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.hot-layout > .tankbox__stage { flex: none; }
.hot-layout > .tankbox__stage.is-landscape { width: 320px; max-width: 100%; }
.hot-layout > .tankbox__stage.is-portrait { width: 180px; max-width: 100%; }
.hot-list { flex: 1 1 320px; min-width: 0; }

.hotdot {
  position: absolute;
  width: 11px;
  height: 11px;
  transform: translate(-50%, -50%);
  border: 1.5px solid #fff;
  border-radius: 50%;
  background: #e8a33d;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  cursor: pointer;
  z-index: 2;
  transition: box-shadow .12s, transform .12s;
}

.hotdot.is-tank { background: #3fa9c9; }
.hotdot.is-cabinet { background: #9a7bd0; }

.hotdot:hover {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 0 0 4px rgba(232, 163, 61, .3);
  z-index: 4;
}

/* 名字默认藏着，鼠标移上去才显示，避免多个热点挤在一起时标签打架 */
.hotdot__l {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  padding: 1px 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .94);
  color: #6b4a1c;
  font-size: 9.5px;
  line-height: 1.35;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s;
}

.hotdot:hover .hotdot__l { opacity: 1; }

.hotdot.is-off { background: #b9b3a8; border-style: dashed; opacity: .65; }
.hotdot.is-off .hotdot__l { color: #9a948a; text-decoration: line-through; }

.hot-edit.is-hl {
  outline: 2px solid #e8a33d;
  background: #fff7e3;
}

/* ---------------- 鱼缸尺寸盒 ---------------- */
.tankbox {
  margin: 10px 0;
  padding: 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
}

.tankbox__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.tankbox__ori { font-size: 12px; font-weight: 800; color: var(--ink); }
.tankbox__f { display: flex; align-items: center; gap: 4px; }
.tankbox__fl { font-size: 11px; color: var(--ink-3); white-space: nowrap; }
.tankbox__f input { width: 56px; padding: 4px 6px; font-size: 12px; }

.tankbox__stage {
  position: relative;
  background: #f3ece0 center/cover no-repeat;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.tankbox__stage.is-landscape { width: 260px; aspect-ratio: 16 / 10; }
.tankbox__stage.is-portrait { width: 132px; aspect-ratio: 9 / 16; }
.tankbox__stage.is-empty { background-image: linear-gradient(135deg, #efe7d8, #f8f2e6); }

.tankbox__water {
  position: absolute;
  transform: translate(-50%, -50%);
  border-radius: 46%;
  background: rgba(120, 200, 225, .45);
  border: 1.5px dashed rgba(40, 115, 150, .8);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, .55);
}

.tankbox__tips {
  margin: 6px 0 10px;
  padding-left: 18px;
  font-size: 12px;
  line-height: 1.75;
  color: var(--ink-2);
}

.tankbox__tips b { color: var(--ink); }

/* ---------------- 角色 / 小屋库 ---------------- */
.cat-img {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 9px;
  overflow: hidden;
  font-size: 16px;
  color: var(--ink-3);
}

.cat-img img { width: 100%; height: 100%; object-fit: contain; }

.cat-ops {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 6px;
}

.cat-ops .btn { white-space: nowrap; }

.cat-ops .btn { height: 24px; padding: 0 8px; font-size: 11px; }

.role-card .cat-ops { position: relative; z-index: 2; }

.house-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 11px;
}

.house-row + .house-row { margin-top: 8px; }
.house-row__imgs { display: flex; gap: 6px; flex: none; }
.house-row__main { flex: 1; min-width: 0; }

.hot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin-bottom: 6px;
}

.hot-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 9px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 9px;
}

.hot-cell__l {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hot-cell input[type="number"] { width: 62px; padding: 4px 6px; font-size: 12px; }
.hot-cell--wide { background: #fffaf0; }

/* ---------------- 关卡进度：游戏选择 ---------------- */
.prog-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.prog-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}

.prog-tab:hover { border-color: var(--gold); }

.prog-tab.is-on {
  background: linear-gradient(180deg, #fff6e0, #fdeecb);
  border-color: var(--gold-d);
  box-shadow: 0 2px 10px rgba(200, 150, 60, .18);
}

.prog-tab__ico { font-size: 20px; line-height: 1; }
.prog-tab__txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prog-tab__txt b { font-size: 13px; color: var(--ink); }
.prog-tab.is-on .prog-tab__txt b { color: #7a4d0c; }
.prog-tab__sum { font-size: 11px; color: var(--ink-3); line-height: 1.45; }

/* 分组行（按册分组时的册标题） */
tr.group-row td {
  padding: 7px 10px;
  background: #fbf3e2;
  font-size: 11.5px;
  font-weight: 800;
  color: #8a6320;
  letter-spacing: .3px;
}

/* ---------------- 商品分类展示 ---------------- */
.shop-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 6px;
}

.shop-pill {
  padding: 5px 12px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}

.shop-pill:hover { border-color: var(--gold); }

.shop-pill.is-on {
  color: #7a4d0c;
  background: #fff0c8;
  border-color: var(--gold-d);
  font-weight: 800;
}

/* 1-n 级分类 tab：一级 / 二级 / 三级逐层缩进 */
.tabtree {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 14px 0 10px;
}

.tabtree__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.tabtree__row--l2 {
  padding-left: 10px;
  border-left: 2px solid rgba(224, 162, 63, .38);
}

.tabtree__row--l3 {
  margin-left: 4px;
  padding-left: 18px;
  border-left: 2px dashed rgba(224, 162, 63, .38);
}

.tabtag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
  transition: all .15s;
}

.tabtag:hover { border-color: var(--gold); }

.tabtag.is-on {
  color: #7a4d0c;
  background: #fff0c8;
  border-color: var(--gold-d);
  font-weight: 800;
}

.tabtag--l2 { font-size: 12px; padding: 5px 10px; }
.tabtag--l3 { font-size: 11.5px; padding: 4px 9px; background: #fffdf6; }

.tabtag__n {
  font-style: normal;
  padding: 0 5px;
  border-radius: 999px;
  background: rgba(224, 162, 63, .16);
  color: #8a6320;
  font-size: 10.5px;
  font-weight: 800;
}

.goods-group { margin-top: 14px; }

.goods-group__h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 8px 2px;
  border-bottom: 2px solid rgba(224, 162, 63, .22);
}

.goods-group__t { font-size: 14px; font-weight: 800; color: var(--ink); }
.goods-group__n { font-size: 11.5px; color: var(--ink-3); font-weight: 700; }

.goods-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0 6px;
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ink-3);
  letter-spacing: .6px;
}

.goods-sub::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

.goods-sub__n {
  order: 2;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(224, 162, 63, .16);
  color: #8a6320;
  font-size: 10.5px;
}

/* 缩略图可放大时的提示 */
.shop-item-row__art.is-zoomable { cursor: zoom-in; }
.shop-item-row__art.is-zoomable:hover { box-shadow: 0 0 0 2px rgba(201, 143, 46, .55); }

/* ---------------- 道具商城 ---------------- */
.shop-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
}

.shop-preview {
  display: inline-grid;
  place-items: center;
  width: 46px;
  height: 46px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.shop-preview img { width: 100%; height: 100%; object-fit: contain; }
.shop-preview span { font-size: 22px; }

.shop-item-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 11px;
}

.shop-item-row + .shop-item-row { margin-top: 8px; }

.shop-item-row__art {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: #fdf6e6;
  border-radius: 9px;
  overflow: hidden;
}

.shop-item-row__art img { width: 100%; height: 100%; object-fit: contain; }
.shop-item-row__art span { font-size: 22px; }

.shop-item-row__main { flex: 1; min-width: 0; }
.shop-item-row__name { font-size: 13px; font-weight: 800; color: var(--ink); }
.shop-item-row__desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.5; }
.shop-item-row__price { flex: none; font-size: 13.5px; font-weight: 900; color: #b87418; }
.shop-item-row__price::after { content: ' 金币'; font-size: 10.5px; font-weight: 700; color: var(--ink-3); }
.shop-item-row__ops { flex: none; display: flex; gap: 6px; }
.shop-off { opacity: .5; }
.shop-off .shop-item-row__name { text-decoration: line-through; }

/* ---------------- 持有道具 ---------------- */
.inv-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px dashed var(--line);
}

.inv-row:last-child { border-bottom: none; }
.inv-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: #c98f2e; cursor: pointer; }
.inv-row .shop-item-row__art { width: 34px; height: 34px; }
.inv-row .shop-item-row__art span { font-size: 17px; }
.inv-row__name { flex: 1; font-size: 12.5px; color: var(--ink); }
.inv-row__name b { font-weight: 800; }
.inv-row input[type="number"] { width: 74px; }

/* ---------------- 角色信息 ---------------- */
.role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  gap: 10px;
}

.role-card {
  position: relative;
  padding: 8px 8px 10px;
  font: inherit;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
  text-align: center;
  transition: all .16s;
}

.role-card img { width: 100%; height: 112px; object-fit: contain; display: block; }
.role-card span { display: block; margin-top: 6px; font-size: 12px; font-weight: 700; color: var(--ink-2); }

.role-card:hover { border-color: var(--gold); transform: translateY(-1px); }

.role-card.is-on {
  border-color: var(--gold-d);
  background: linear-gradient(180deg, #fff8e6, #fdefd0);
  box-shadow: 0 0 0 3px rgba(232, 180, 90, .22), inset 0 1px 0 #fff;
}

.role-card.is-locked img { filter: grayscale(.85); opacity: .72; }

.role-card em {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-style: normal;
  font-weight: 800;
  color: #7a4d0c;
  background: #ffeec6;
  border-radius: 999px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 14px;
}

.field { display: flex; flex-direction: column; gap: 6px; }
.field > label { font-size: 12px; font-weight: 800; color: var(--ink-3); }
.field input, .field select, .field textarea { width: 100%; }
.field textarea {
  min-height: 76px;
  padding: 9px 11px;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
}
.field--wide { grid-column: 1 / -1; }
.chat-note { font-size: 11px; line-height: 1.5; color: var(--ink-soft); opacity: .85; }
.chat-status {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 12px;
  border-radius: 99px;
  background: #fff2d8;
  color: #94601b;
  font-size: 12px;
  font-weight: 800;
}
.chat-status.is-ready { background: #e5f6e5; color: #2f7a36; }
/* 对话管理：大类 Tab */
.chat-admin { grid-column: 1 / -1; display: block; min-width: 0; }
.chat-admin-tabs { width: 100%; box-sizing: border-box; }
.chat-admin-panel > .card { width: 100%; box-sizing: border-box; }
.chat-admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .5);
  border: 1px solid rgba(160, 118, 55, .2);
}
.chat-admin-tab {
  padding: 8px 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-soft, #6b5a46);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background .18s ease, color .18s ease, transform .18s ease;
}
.chat-admin-tab:hover { background: rgba(255, 255, 255, .75); transform: translateY(-1px); }
.chat-admin-tab.is-on {
  background: linear-gradient(135deg, #fff3d4, #ffe1ad);
  border-color: rgba(196, 139, 55, .45);
  color: #6b4310;
  box-shadow: 0 3px 10px rgba(150, 100, 30, .12);
}
.chat-admin-panel > .card { margin-top: 0; }
/* 对话管理：全局设置 / 角色专属设置 分区 */
.chat-config-group {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(160, 118, 55, .24);
  border-radius: 12px;
  background: rgba(255, 255, 255, .46);
}
.chat-config-group + .chat-config-group { margin-top: 4px; }
.chat-config-group__title {
  grid-column: 1 / -1;
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(160, 118, 55, .22);
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-2);
}
/* 上下文会话 / 记忆库管理列表 */
.chat-store { display: grid; gap: 12px; margin-top: 12px; }
.chat-store-row {
  padding: 12px 14px;
  border: 1px solid rgba(160, 110, 30, .22);
  border-radius: 14px;
  background: rgba(255, 253, 246, .86);
}
.chat-store-row__head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 8px; }
.chat-store-row__head b { font-size: 13px; color: var(--ink); }
.chat-store__text {
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  padding: 8px 10px;
  border: 1px solid rgba(140, 100, 50, .28);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  resize: vertical;
}
.chat-store-row .row { margin-top: 8px; flex-wrap: wrap; }
.chat-log-view { display: grid; gap: 8px; margin-top: 8px; max-height: 420px; overflow: auto; }
.chat-log-row {
  padding: 8px 11px;
  border-left: 3px solid #d79a3c;
  border-radius: 10px;
  background: rgba(255, 253, 246, .86);
}
.chat-log-row--assistant { border-left-color: #4a86b8; }
.chat-log-row__body { margin-top: 4px; font-size: 12px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; color: var(--ink); }
.bubble-preview {
  grid-column: 1 / -1;
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border: 2px solid #e8b25a;
  border-radius: 20px 20px 6px 20px;
  background-color: #fff8e7;
  background-size: cover;
  background-position: center;
  color: #5d3a12;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(80, 40, 20, .12);
}

@media (max-width: 820px) {
  .wrap { padding: 14px 12px 48px; }
  .layout { grid-template-columns: minmax(0, 1fr); }
  /* min-width:0 才能让 grid 子项真正出现横向滚动，而不是把页面撑宽 */
  .nav { position: static; flex-direction: row; overflow-x: auto; padding: 8px; min-width: 0; }
  .nav button { white-space: nowrap; padding: 8px 10px; font-size: 13px; }
  .game-row__bar { display: none; }

  /* 顶部栏在窄屏会挤成竖排，改成两行：标题一行、按钮一行 */
  .topbar { flex-wrap: wrap; gap: 8px; padding: 12px 14px; }
  .topbar__title { flex: 1 1 100%; margin-right: 0; }
  .topbar__title h1 { font-size: 16px; white-space: nowrap; }
  .topbar small { display: none; }
  .topbar .btn, .coin-chip { white-space: nowrap; }
  #srvTag { display: none; }
  .coin-chip { flex: 0 0 auto; }
  .topbar .btn { flex: 1 1 auto; }

  .stat__v { font-size: 19px; }
  .card { padding: 14px; }

  .prog-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  /* 商品行：窄屏下按钮换到第二行，避免名称被挤成竖排 */
  .shop-item-row { flex-wrap: wrap; gap: 8px 10px; }
  .shop-item-row__main { flex: 1 1 120px; }
  .shop-item-row__price { margin-left: auto; }
  .shop-item-row__ops { flex: 1 1 100%; justify-content: flex-end; }
  .inv-row { gap: 8px; }

  /* 预览图在窄屏占满一行，不做固定宽 */
  .hot-layout { min-width: 0; }
  .hot-layout > .tankbox__stage.is-landscape,
  .hot-layout > .tankbox__stage.is-portrait { width: 100%; }
}

/* ============================================================
   游戏设置：按游戏配置关卡素材
   ============================================================ */
.gs-games {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.gs-pick {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 10px;
}

.gs-pick__label {
  flex: 0 0 42px;
  padding-top: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--ink-3);
}

.gs-seg {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.gs-levels {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.gs-lv {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  height: 44px;
  padding: 0;
  font: inherit;
  color: var(--ink-3);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 12px;
  cursor: pointer;
  transition: all .15s;
}

.gs-lv b { font-size: 13px; font-weight: 900; color: var(--ink-2); }
.gs-lv span { font-size: 10px; color: var(--ink-3); }
.gs-lv:hover { border-color: var(--gold); }
.gs-lv.is-on {
  background: linear-gradient(180deg, #fff7e4, #ffe8b8);
  border-color: var(--gold-d);
  box-shadow: 0 2px 8px rgba(190, 130, 40, .18);
}
.gs-lv.is-on b { color: #7a4d0c; }
.gs-lv.has-set { border-style: dashed; }
.gs-lv.is-on.has-set { border-style: solid; }
.gs-lv__dot {
  position: absolute;
  top: 4px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--gold-d);
}

/* ---- 场景 / 路径绘制 ---- */
.gs-editwrap { margin: 12px 0 4px; }

.gs-edit__tip {
  margin: 0 0 8px;
  font-size: 11.5px;
  line-height: 1.6;
  color: var(--ink-3);
}

.gs-edit__tip b { color: #b87418; }

.gs-editor {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  border-radius: 16px;
  overflow: hidden;
  background: #e9f4d8;
  box-shadow: inset 0 0 0 2px rgba(224, 162, 63, .35), 0 6px 16px rgba(120, 80, 20, .12);
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

.gs-editor__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.gs-editor__paths {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.gs-editor__dots {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.gs-dot {
  position: absolute;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px var(--gold-d), 0 2px 5px rgba(0, 0, 0, .25);
  cursor: grab;
  pointer-events: auto;
  touch-action: none;
}

.gs-dot b { font-size: 9.5px; font-weight: 900; color: #7a4d0c; }
.gs-dot.is-start { background: #ffe08a; box-shadow: 0 0 0 3px #e05a3a, 0 2px 6px rgba(0, 0, 0, .3); }
.gs-dot.is-end { background: #cdeedd; box-shadow: 0 0 0 3px #2f8f6a, 0 2px 6px rgba(0, 0, 0, .3); }
.gs-dot:active { cursor: grabbing; }

.gs-editor__marker {
  position: absolute;
  width: 12%;
  max-height: 30%;
  transform: translate(-50%, -50%);
  object-fit: contain;
  cursor: grab;
  filter: drop-shadow(0 3px 5px rgba(40, 30, 10, .35));
  pointer-events: auto;
  touch-action: none;
}

.gs-editor__tower { width: 9%; }
.gs-editor__marker:active { cursor: grabbing; }

.gs-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.gs-warn {
  margin: 10px 0 0;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #8a4b12;
  background: #fff4e2;
  border-radius: 10px;
  box-shadow: inset 0 0 0 1.5px rgba(224, 162, 63, .45);
}

/* ---- 素材下拉 ---- */
.gs-asset {
  display: flex;
  align-items: center;
  gap: 8px;
}

.gs-asset__thumb {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: contain;
  background: #fffaf0;
  box-shadow: inset 0 0 0 1.5px var(--line-2);
}

.gs-asset select { flex: 1; min-width: 0; }

/* ---- 路径配色 ---- */
.gs-path-field { margin-top: 14px; }

.gs-colors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.gs-color {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
}

.gs-color input[type="color"] {
  width: 26px;
  height: 26px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: none;
  cursor: pointer;
}
.gs-color input[type="color"]::-webkit-color-swatch-wrapper { padding: 0; }
.gs-color input[type="color"]::-webkit-color-swatch { border: 1.5px solid rgba(120, 80, 20, .25); border-radius: 50%; }

.gs-palettes {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.gs-palettes__t { font-size: 11.5px; color: var(--ink-3); }

.gs-palette {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px 4px 6px;
  font: inherit;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-2);
  background: #fff;
  border: 1.5px solid var(--line-2);
  border-radius: 999px;
  cursor: pointer;
}
.gs-palette:hover { border-color: var(--gold); }
.gs-palette i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(120, 80, 20, .18);
}

/* ---- 其他游戏：信息概览 ---- */
.gs-info { margin-top: 10px; }

.gs-info__row {
  display: flex;
  gap: 10px;
  padding: 7px 2px;
  border-bottom: 1px dashed rgba(224, 162, 63, .3);
  font-size: 12.5px;
}

.gs-info__k { flex: 0 0 76px; color: var(--ink-3); font-weight: 700; }
.gs-info__v { flex: 1; min-width: 0; color: var(--ink); }

@media (max-width: 720px) {
  .gs-levels { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .gs-pick { flex-direction: column; gap: 6px; }
  .gs-pick__label { padding-top: 0; }
}

/* 持有道具：数量输入 */
.inv-row__num {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.inv-row__num i {
  font-style: normal;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}

/* 卡牌皮肤：正反面实时预览 */
.card-prev {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  gap: 22px;
  align-items: flex-start;
  padding: 12px;
  background: #fbf6ea;
  border-radius: 12px;
  box-shadow: inset 0 0 0 1.5px rgba(224, 162, 63, .35);
}

.card-prev__item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: center;
}

.card-prev__item img {
  width: 96px;
  height: 132px;
  object-fit: fill;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 14px rgba(60, 40, 10, .18);
}

.card-prev__item span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-3);
}

/* 消消乐道具图标：圆形徽章裁切 */
.shop-item-row__art img[src*="match3-item-"],
.inv-row .shop-item-row__art img[src*="match3-item-"] {
  border-radius: 50%;
}

/* ---------------- 音乐音效 ---------------- */
.audio-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-top: 1px dashed #ece2d2;
  flex-wrap: wrap;
}

.audio-row:first-of-type { border-top: 0; }

.audio-row__main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 520px;
  flex-wrap: wrap;
  min-width: 0;
}

.audio-row__ops { display: flex; gap: 6px; flex: none; }

.audio-name {
  width: 128px;
  padding: 6px 9px;
  border-radius: 9px;
  border: 1.5px solid #e6d8bf;
  background: #fffdf8;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  color: #5b452c;
}

.audio-row--trash .audio-name {
  border: 0;
  background: none;
  padding: 0;
  width: auto;
}

.audio-name:focus { outline: 2px solid #f0c877; border-color: #edc06a; }

.audio-id {
  font-size: 11.5px;
  color: #9c8b72;
  font-family: ui-monospace, Menlo, Consolas, monospace;
}

.audio-field {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: #6b5a3e;
}

.audio-field input[type="number"] {
  padding: 5px 7px;
  border-radius: 8px;
  border: 1.5px solid #e6d8bf;
  background: #fffdf8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #5b452c;
}

.audio-field select {
  padding: 5px 7px;
  border-radius: 8px;
  border: 1.5px solid #e6d8bf;
  background: #fffdf8;
  font: inherit;
  font-size: 12.5px;
  font-weight: 700;
  color: #5b452c;
}

.audio-field--vol input[type="range"] { width: 86px; }

.audio-val {
  min-width: 40px;
  text-align: right;
  font-size: 12px;
  color: #8a6a3a;
}

.audio-sfx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 2px;
  border-top: 1px dashed #ece2d2;
  flex-wrap: wrap;
}

.audio-sfx-row:first-of-type { border-top: 0; }

.audio-sfx-name { flex: 0 0 118px; font-size: 13px; color: #5b452c; }

.audio-sfx-row input[type="range"] { width: 120px; }

/* 音乐音效页：开关（后台原来没有这个控件） */
.switch {
  position: relative;
  width: 46px;
  height: 26px;
  border: 0;
  border-radius: 999px;
  background: #e6dcc8;
  cursor: pointer;
  flex: none;
  padding: 0;
  transition: background .18s ease;
}

.switch::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(90, 60, 20, .28);
  transition: transform .18s ease;
}

.switch.on { background: #79c48d; }
.switch.on::after { transform: translateX(20px); }

/* 名称输入框不要被拉满整行 */
.audio-name { flex: 0 0 132px; width: 132px; }

.audio-row--trash .audio-name { flex: 0 0 auto; width: auto; }

/* 音乐音效：二级下拉与上传 */
.audio-select {
  padding: 8px 12px;
  border-radius: 10px;
  border: 1.5px solid #e6d8bf;
  background: #fffdf8;
  font: inherit;
  font-size: 13.5px;
  font-weight: 800;
  color: #5b452c;
  cursor: pointer;
}

.audio-file { font-size: 11.5px; color: #9c8b72; }
.audio-file.is-on { color: #2f7f6a; font-weight: 800; }
.audio-upload { display: inline-flex; }

.card-note {
  margin: 10px 2px 0;
  font-size: 12px;
  color: #9a8a70;
}

/* 双人模式头像 */
.duel-ava__row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 2px;
  border-top: 1px dashed #ece2d2;
  flex-wrap: wrap;
}

.duel-ava__row:first-of-type { border-top: 0; }

.duel-ava__box {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  overflow: hidden;
  flex: none;
  display: grid;
  place-items: center;
  background: #fff7e6;
  box-shadow: inset 0 0 0 2px #eadcc2;
}

.duel-ava__box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.duel-ava__meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 96px;
  font-size: 13.5px;
  color: #5b452c;
}

.duel-ava__ops { display: flex; gap: 8px; flex-wrap: wrap; }

/* 答题吞吞鱼内容后台（iframe 嵌入） */
.fq-admin-frame {
  width: 100%;
  height: calc(100vh - 210px);
  min-height: 560px;
  border: 1px solid #e6d8bf;
  border-radius: 12px;
  background: #fffdf8;
  display: block;
  margin-top: 4px;
}

/* =========================================================
   橱窗 · 精灵衣橱（按角色归类陈列服装款式）
   ========================================================= */
.wardrobe-group { margin-top: 18px; }
.wardrobe-group:first-of-type { margin-top: 8px; }

.wardrobe-group__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1.5px dashed var(--line);
}

.wardrobe-group__ava {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(#f7f1e6, #efe4d1);
  border: 1.5px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}

.wardrobe-group__ava img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.wardrobe-group__title { display: flex; flex-direction: column; gap: 1px; }
.wardrobe-group__title b { font-size: 14px; color: var(--ink); }
.wardrobe-group__title em { font-style: normal; font-size: 11.5px; color: var(--ink-3); }

.wardrobe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.outfit {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  transition: all .16s;
}

.outfit:hover {
  border-color: var(--gold);
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(120, 90, 40, .1);
}

.outfit__shot {
  position: relative;
  height: 205px;
  background: radial-gradient(120% 90% at 50% 8%, #fffdf7, #f3ebdc);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 6px;
}

.outfit__shot.is-zoomable { cursor: zoom-in; }
.outfit__shot.is-zoomable:hover { box-shadow: inset 0 0 0 2px rgba(201, 143, 46, .5); }

.outfit__shot img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center bottom;
  display: block;
}

.outfit__shot.is-broken::after {
  content: '图片缺失';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: var(--ink-3);
}

.outfit__meta {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px 4px;
  min-width: 0;
}

.outfit__no {
  flex: none;
  font-size: 10.5px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(#d8a64e, #c58d2f);
  border-radius: 6px;
  padding: 1px 5px;
  letter-spacing: .5px;
}

.outfit__name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.outfit__ops { padding: 0 10px 10px; }
.outfit__ops .btn { width: 100%; }

@media (max-width: 520px) {
  .wardrobe-grid { grid-template-columns: repeat(auto-fill, minmax(108px, 1fr)); gap: 10px; }
  .outfit__shot { height: 140px; }
}

/* 窄屏（手机）：角色库网格降为 2 列，避免 168px 最小宽导致只剩 1 列 */
@media (max-width: 560px) {
  .role-grid { grid-template-columns: repeat(auto-fill, minmax(138px, 1fr)); gap: 8px; }
  .role-card img { height: 96px; }
}

/* ---------- 橱窗：衣服管理控件 ---------- */
.outfit.is-off { opacity: .72; }
.outfit.is-off .outfit__shot img { filter: grayscale(.55); }

.outfit__stat {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 10px 6px;
}

.outfit__flag {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 999px;
  color: #1f6b3a;
  background: #e4f7e8;
  border: 1px solid #bfe8c9;
}
.outfit__flag.is-off { color: #8a5a12; background: #fdf2dc; border-color: #f0dcb0; }
.outfit__flag.is-lock { color: #a33; background: #fde9e9; border-color: #f3cccc; }

.outfit__price {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 10px 8px;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 700;
}
.outfit__price input {
  flex: 1;
  min-width: 0;
  height: 28px;
  padding: 0 8px;
  font: inherit;
  font-size: 12.5px;
  color: var(--ink);
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
}
.outfit__price input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px rgba(232, 180, 90, .22); }

.outfit__ops { display: flex; gap: 6px; padding: 0 10px 6px; }
.outfit__ops .btn { flex: 1 1 0; }
.outfit__ops:last-child { padding-bottom: 10px; }

.outfit__num-badge-ghost { opacity: .6; }
