/* ============================================================
   心镜映廊 STAR卡 · Web 版样式
   ============================================================ */
:root {
  /* 品牌主色：橙 #F09000 / 蓝 #0868B8 / 白 —— 取自品牌 logo 实测色值 */
  --brand: #f09000;          /* 主色 · 品牌橙 */
  --brand-deep: #a36200;     /* 橙的文字色 · 深橙（白底对比约 4.8:1） */
  --brand-soft: #fdf3e2;     /* 橙的浅底 */
  --brand-grad: linear-gradient(135deg, #f59400, #ffb03a);       /* 主按钮橙渐变 */
  --brand-grad-deep: linear-gradient(135deg, #e8850a, #f79a1f);  /* 橙渐变悬停 */
  --accent: #0868b8;         /* 辅色 · 品牌蓝（仅少量点缀） */
  --accent-deep: #06538f;    /* 蓝的加深 */
  --accent-soft: #e8f1fa;    /* 蓝的浅底 */
  --bg: #fdfaf5;             /* 页面底色 · 暖白（偏橙调） */
  --bg-soft: #fffdf9;        /* 更浅的暖白 */
  --panel: #ffffff;          /* 面板 · 纯白 */
  --ink: #1f2a33;            /* 正文 · 深墨蓝 */
  --ink-soft: #55636e;
  --ink-faint: #8b98a3;
  --line: #e2e8ef;
  --maze: #f09000;           /* 玩法一 · 品牌橙 */
  --maze-soft: #fdf3e2;
  --maze-deep: #a36200;      /* 玩法一文字色 · 深橙 */
  --alliance: #d2691e;       /* 玩法二 · 琥珀橙棕（同属橙系，与玩法一亮橙区分） */
  --alliance-soft: #fbeee2;
  --alliance-deep: #a85216;  /* 玩法二文字色 */
  --emotion: #2f9dd8;        /* 玩法三 · 品牌蓝（全站仅此处保留蓝主题） */
  --emotion-soft: #eaf6fc;
  --emotion-deep: #1d7fb0;   /* 玩法三文字色 · 深亮蓝 */
  --warn: #a36200;
  --ok: #0868b8;
  --radius: 14px;
  --shadow: 0 2px 14px rgba(31, 42, 51, 0.07);
  --shadow-lg: 0 12px 40px rgba(31, 42, 51, 0.16);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", "Source Han Sans SC", system-ui, -apple-system, sans-serif;
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 26px;
  background: linear-gradient(115deg, #f59400, #ffa733 55%, #ffbe5e 80%, #ffb03a 90%, #2f9dd8);
  color: #3d2600;
  box-shadow: 0 2px 16px rgba(240, 144, 0, 0.28);
  position: sticky;
  top: 0;
  z-index: 60;
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: #ffffff;
  border-radius: 9px;
  padding: 4px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.18);
  flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 18px; letter-spacing: 1.5px; }
.brand-text em {
  font-style: normal;
  font-size: 11px;
  opacity: 0.78;
  letter-spacing: 0.6px;
}
.brand-text .tm {
  font-size: 0.62em;
  vertical-align: super;
  line-height: 0;
  margin-left: 1px;
  opacity: 0.9;
  font-weight: 400;
  letter-spacing: 0;
}
.topbar-right { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pill {
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.7);
  color: #3d2600;
  white-space: nowrap;
}
.pill-ok { background: rgba(255, 255, 255, 0.62); border-color: rgba(255, 255, 255, 0.8); }
.pill-warn { background: rgba(163, 98, 0, 0.16); border-color: rgba(163, 98, 0, 0.32); }
.pill-btn {
  font-family: inherit;
  cursor: pointer;
  transition: background .16s, transform .16s;
}
.pill-btn:hover { background: rgba(255, 255, 255, 0.72); transform: translateY(-1px); }
.pill-ok-strong {
  background: rgba(255, 255, 255, 0.75);
  border-color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
}

/* ---------- 设置弹窗 ---------- */
.settings-sec {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.settings-sec:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.settings-sec h5 {
  margin: 0 0 7px;
  font-size: 12px;
  letter-spacing: 1px;
  color: var(--brand-deep);
  font-weight: 700;
}
.settings-note {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.75;
}
.settings-note code {
  background: var(--bg);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 11.5px;
  color: var(--brand-deep);
}
.settings-msg {
  margin-top: 12px;
  padding: 9px 13px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.65;
}
.settings-msg.ok { background: #e9f6ef; border: 1px solid #b9ddc9; color: #23664a; }
.settings-msg.err { background: #fdeee2; border: 1px solid #f0c9a1; color: #a85216; }
.lic-grid { display: grid; grid-template-columns: auto 1fr; gap: 5px 12px; font-size: 13px; }
.lic-grid dt { color: var(--ink-faint); }
.lic-grid dd { margin: 0; color: var(--ink); font-weight: 500; }

/* ---------- 导航 ---------- */
.tabs {
  display: flex;
  gap: 6px;
  padding: 10px 26px 0;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  position: sticky;
  top: 66px;
  z-index: 55;
}
.tab {
  appearance: none;
  border: 1px solid transparent;
  border-bottom: none;
  background: transparent;
  color: var(--ink-soft);
  padding: 10px 20px 9px;
  border-radius: 12px 12px 0 0;
  cursor: pointer;
  font-size: 15px;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
  transition: background .18s, color .18s;
}
.tab-sub { font-size: 11px; opacity: 0.62; }
.tab:hover { background: #eef2f7; color: var(--ink); }
.tab.active {
  background: var(--panel);
  border-color: var(--line);
  color: var(--brand-deep);
  font-weight: 600;
  box-shadow: 0 -2px 8px rgba(31,42,51,0.05);
}

main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 26px 60px;
}

.view { display: none; }
.view.active { display: block; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 面板 ---------- */
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}
.intro h1 {
  margin: 0 0 12px;
  font-size: 24px;
  letter-spacing: 0.8px;
  color: var(--brand-deep);
}
.intro p { margin: 0 0 12px; color: var(--ink-soft); }
.intro p strong { color: var(--ink); }
.theory-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  margin: 16px 0 12px;
}
.theory {
  background: var(--brand-soft);
  border: 1px solid #f5dfb8;
  border-radius: 10px;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theory b { color: var(--brand-deep); font-size: 14px; }
.theory span { font-size: 12px; color: var(--ink-faint); }
.tip { font-size: 13px; color: var(--ink-faint); }

/* ---------- 筛选栏 ---------- */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 22px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
}
.filter-group { display: flex; align-items: center; gap: 10px; }
.filter-group.grow { flex: 1; min-width: 220px; }
.filter-label {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 1px;
  flex-shrink: 0;
}
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  padding: 5px 13px;
  border-radius: 999px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: all .16s;
}
.chip:hover { border-color: var(--brand); color: var(--brand-deep); }
.chip.on {
  background: var(--brand-grad);
  border-color: #f0a52e;
  color: #4a2e00;
  font-weight: 600;
}
input[type="search"], input[type="text"], textarea, select {
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 8px 12px;
  background: var(--bg-soft);
  outline: none;
  transition: border-color .16s, box-shadow .16s;
  width: 100%;
}
input:focus, textarea:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 144, 0, 0.16);
  background: #fff;
}
textarea { resize: vertical; line-height: 1.7; }

.stat-line {
  font-size: 13px;
  color: var(--ink-faint);
  margin-bottom: 14px;
}

/* ---------- 卡牌网格 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
}
.card-cell {
  cursor: pointer;
  perspective: 900px;
}
.card-flip {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4,.1,.2,1);
}
.card-cell.flipped .card-flip { transform: rotateY(180deg); }
.card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 2px 8px rgba(31,42,51,0.09);
}
.card-face img { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-back { transform: rotateY(180deg); }
.card-cell:hover .card-face { border-color: var(--brand); }
.card-meta { padding: 7px 2px 0; }
.card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 5px; }
.tag {
  font-size: 10.5px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-faint);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.tag.t-Self { background: #fdf3e2; border-color: #f5dfb8; color: #a36200; }
.tag.t-Arena { background: #e8f1fa; border-color: #c9ddef; color: #06538f; }
.tag.t-Trigger { background: #eaf6fc; border-color: #cfe6f4; color: #1d7fb0; }
.tag.t-Resource { background: #fbe8cc; border-color: #f0d3a1; color: #8a5300; }

/* ---------- 玩法通用 ---------- */
.game-intro { border-left: 5px solid var(--brand); }
.game-intro h2 { margin: 0 0 8px; font-size: 21px; letter-spacing: 0.6px; }
.game-intro p { margin: 0; color: var(--ink-soft); font-size: 14px; }
.accent-maze { border-left-color: var(--maze); background: linear-gradient(180deg, var(--maze-soft), #fff 42%); }
.accent-maze h2 { color: var(--maze-deep); }
.accent-alliance { border-left-color: var(--alliance); background: linear-gradient(180deg, var(--alliance-soft), #fff 42%); }
.accent-alliance h2 { color: var(--alliance-deep); }
.accent-emotion { border-left-color: var(--emotion); background: linear-gradient(180deg, var(--emotion-soft), #fff 42%); }
.accent-emotion h2 { color: var(--emotion-deep); }

.stages { display: flex; flex-direction: column; gap: 16px; }
.stage {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  opacity: 0.5;
  pointer-events: none;
  transition: opacity .25s;
}
.stage.active { opacity: 1; pointer-events: auto; }
.stage.done { opacity: 0.85; pointer-events: auto; }
.stage-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.stage-no {
  font-size: 11px;
  letter-spacing: 1.4px;
  color: #fff;
  background: var(--ink-faint);
  padding: 3px 11px;
  border-radius: 999px;
  flex-shrink: 0;
}
.stage.active .stage-no { background: var(--brand-grad); color: #4a2e00; }
.stage-head h3 { margin: 0; font-size: 17px; }
.stage-desc { margin: 0 0 14px; color: var(--ink-faint); font-size: 13.5px; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.btn {
  appearance: none;
  font-family: inherit;
  font-size: 14px;
  border-radius: 9px;
  padding: 9px 20px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all .16s;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn.primary {
  background: var(--brand-grad);
  color: #4a2e00;
  border-color: #f0a52e;
  font-weight: 600;
}
.btn.primary:hover:not(:disabled) { background: var(--brand-grad-deep); transform: translateY(-1px); }
.btn.ghost {
  background: var(--bg-soft);
  color: var(--ink-soft);
  border-color: var(--line);
}
.btn.ghost:hover:not(:disabled) { border-color: var(--brand); color: var(--brand-deep); }
.btn.small { padding: 6px 13px; font-size: 13px; }
.btn.wide { width: 100%; margin-top: 12px; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after {
  content: "";
  position: absolute;
  inset: 0; margin: auto;
  width: 15px; height: 15px;
  border: 2px solid rgba(163, 98, 0, 0.3);
  border-top-color: #4a2e00;
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
.btn.ghost.loading::after { border-color: rgba(240,144,0,0.25); border-top-color: var(--brand); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 卡槽 ---------- */
.slot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 14px;
}
.slot {
  border: 2px dashed var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--bg-soft);
  text-align: center;
  transition: all .18s;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.slot.filled { border-style: solid; border-color: var(--brand); background: #fff; }
.slot-label {
  font-size: 12px;
  color: var(--ink-faint);
  letter-spacing: 0.8px;
}
.slot-label b { display: block; font-size: 13.5px; color: var(--ink-soft); margin-bottom: 2px; letter-spacing: 0; }
.slot-card { cursor: pointer; }
.slot-card .card-flip { aspect-ratio: 2 / 3; }
.slot-empty {
  flex: 1;
  display: grid;
  place-items: center;
  color: var(--ink-faint);
  font-size: 13px;
  cursor: pointer;
  border-radius: 9px;
  transition: background .16s;
  padding: 10px;
}
.slot-empty:hover { background: #eef2f7; color: var(--brand-deep); }
.slot-actions { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.slot-actions .btn { padding: 5px 11px; font-size: 12px; }
.slot-custom-note {
  font-size: 11.5px;
  color: var(--warn);
  background: var(--brand-soft);
  border-radius: 7px;
  padding: 5px 8px;
  line-height: 1.5;
}

/* ---------- 对话区 ---------- */
.maze-board { display: grid; grid-template-columns: 1fr 268px; gap: 16px; align-items: start; }
.chat-col { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.chat {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  max-height: 460px;
  min-height: 190px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 13px;
}
.msg { display: flex; flex-direction: column; gap: 4px; max-width: 88%; }
.msg-who { font-size: 11px; color: var(--ink-faint); letter-spacing: 0.5px; padding: 0 4px; }
.msg-bubble {
  padding: 11px 15px;
  border-radius: 13px;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
}
.msg.user { align-self: flex-end; align-items: flex-end; }
.msg.user .msg-bubble { background: var(--brand-grad); color: #4a2e00; border-bottom-right-radius: 4px; }
.msg.ai .msg-bubble { background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.msg.sys { align-self: center; max-width: 100%; }
.msg.sys .msg-bubble {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--ink-faint);
  font-size: 12.5px;
  text-align: center;
  border-radius: 9px;
  padding: 7px 13px;
}
.msg.typing .msg-bubble { color: var(--ink-faint); font-style: italic; }
.dots::after { content: ""; animation: dots 1.2s steps(4, end) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "·"; } 50% { content: "··"; } 75% { content: "···"; } }

.composer {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.composer-hint { font-size: 12px; color: var(--ink-faint); }
.composer-bar { display: flex; gap: 9px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.resource-pick { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.tag-hidden { display: none; }
.res-tag {
  font-size: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  border: 1px solid #f5dfb8;
  border-radius: 999px;
  padding: 4px 11px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.res-tag button {
  appearance: none; border: none; background: none;
  color: inherit; cursor: pointer; font-size: 14px; line-height: 1; padding: 0;
}

.side-col {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
}
.side-col h4 {
  margin: 0 0 9px;
  font-size: 12px;
  letter-spacing: 1.2px;
  color: var(--ink-faint);
  font-weight: 600;
}
.side-col h4:not(:first-child) { margin-top: 18px; }
.side-cards { display: flex; flex-direction: column; gap: 9px; }
.side-card { display: flex; gap: 9px; align-items: center; }
.side-card img {
  width: 42px; height: 63px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid var(--line);
  flex-shrink: 0;
  background: #fff;
}
.side-card .sc-txt { min-width: 0; }
.side-card .sc-label { font-size: 10.5px; color: var(--ink-faint); }
.side-card .sc-name { font-size: 12.5px; font-weight: 600; line-height: 1.35; }
.mini-log { list-style: none; margin: 0; padding: 0; font-size: 12.5px; color: var(--ink-soft); }
.mini-log li { padding: 4px 0; border-bottom: 1px dashed var(--line); }
.mini-log li:last-child { border-bottom: none; }
.mini-log li.empty { color: var(--ink-faint); font-style: italic; }

/* ---------- 排列画布（玩法二） ---------- */
.map-canvas {
  position: relative;
  width: 100%;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 50% 50%, rgba(240,144,0,0.10) 0 2px, transparent 2px),
    var(--bg-soft);
  background-size: auto, 22px 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  touch-action: none;
}
.map-canvas::before {
  content: "我";
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--brand);
  color: var(--brand-deep);
  display: grid; place-items: center;
  font-size: 14px; font-weight: 600;
  z-index: 1;
}
.canvas-card {
  position: absolute;
  width: 104px;
  cursor: grab;
  z-index: 5;
  user-select: none;
  text-align: center;
  perspective: 800px;
}
.canvas-card:active { cursor: grabbing; }
.cc-flip {
  position: relative;
  width: 100%;
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.4,.1,.2,1);
}
.cc-flip[data-facing="side"] { transform: rotateY(58deg); }
.cc-flip[data-facing="away"] { transform: rotateY(180deg); }
.cc-face {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 8px;
  border: 2px solid #fff;
  box-shadow: 0 4px 14px rgba(31,42,51,0.22);
  display: block;
  background: #fff;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  pointer-events: none;
}
.cc-back {
  position: absolute;
  inset: 0;
  transform: rotateY(180deg);
}
.canvas-card .cc-name {
  font-size: 11px;
  margin-top: 4px;
  background: rgba(255,255,255,0.92);
  border-radius: 6px;
  padding: 2px 4px;
  line-height: 1.35;
  border: 1px solid var(--line);
  pointer-events: none;
}
.canvas-card .cc-facing {
  font-size: 10px;
  color: var(--ink-faint);
  pointer-events: none;
}
.canvas-card .cc-btn {
  margin-top: 3px;
  padding: 2px 8px;
  font-size: 10.5px;
  pointer-events: auto;
  cursor: pointer;
}
.canvas-hint { font-size: 12px; color: var(--ink-faint); margin-top: 9px; }

.field { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 12.5px; color: var(--ink-soft); font-weight: 600; }

/* ---------- 对话方向条 ---------- */
.turn-bar { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 13px; }
.turn-btn {
  appearance: none;
  font-family: inherit;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all .16s;
}
.turn-btn:hover { border-color: var(--brand); color: var(--brand-deep); }
.turn-btn.on { background: var(--brand-grad); border-color: #f0a52e; color: #4a2e00; font-weight: 600; }

/* ---------- 情绪地图 ---------- */
.emotion-map {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 12px;
  align-items: stretch;
  margin-bottom: 16px;
}
.emo-zone {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--bg-soft);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 9px;
  cursor: pointer;
  transition: all .18s;
}
.emo-zone:hover { border-color: var(--emotion); }
.emo-zone.on { border-color: var(--emotion); background: var(--emotion-soft); box-shadow: 0 0 0 3px rgba(47,157,216,0.15); }
.emo-zone h5 {
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.8px;
  color: var(--ink-faint);
  font-weight: 600;
}
.emo-zone.on h5 { color: var(--emotion-deep); }
.emo-zone img {
  width: 100%;
  max-width: 118px;
  aspect-ratio: 2 / 3;
  object-fit: contain;
  border-radius: 8px;
  border: 1px solid var(--line);
  margin: 0 auto;
  display: block;
}
.emo-zone .ez-name { font-size: 12.5px; font-weight: 600; line-height: 1.4; }
.emo-zone .ez-emo { font-size: 11.5px; color: var(--emotion-deep); }
.emotion-panel {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 15px;
  background: #fff;
}
.emotion-panel h4 { margin: 0 0 4px; font-size: 15px; color: var(--emotion-deep); }
.marker-row {
  display: flex;
  gap: 9px;
  align-items: center;
  margin-bottom: 9px;
  flex-wrap: wrap;
}
.marker-row input[type="text"] { flex: 1; min-width: 110px; }
.marker-row input[type="range"] { flex: 1.4; min-width: 130px; accent-color: var(--emotion); }
.marker-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--emotion-deep);
  min-width: 34px;
  text-align: center;
}
.marker-del {
  appearance: none; border: none; background: none;
  color: var(--ink-faint); cursor: pointer; font-size: 17px; line-height: 1; padding: 2px 5px;
}
.marker-del:hover { color: var(--warn); }
.emotion-suggest { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 10px; }
.suggest-chip {
  appearance: none; font-family: inherit; font-size: 11.5px;
  border: 1px solid var(--line); background: var(--bg-soft);
  color: var(--ink-soft); border-radius: 999px; padding: 3px 10px; cursor: pointer;
}
.suggest-chip:hover { border-color: var(--emotion); color: var(--emotion-deep); }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(16, 26, 36, 0.55);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: grid; place-items: center;
  padding: 20px;
}
.modal-mask[hidden] { display: none; }
.modal {
  background: var(--panel);
  border-radius: 16px;
  width: min(940px, 100%);
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: pop .2s ease;
}
.modal-sm { width: min(520px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close {
  appearance: none; border: none; background: none;
  font-size: 26px; line-height: 1; color: var(--ink-faint); cursor: pointer; padding: 0 4px;
}
.modal-close:hover { color: var(--ink); }
.modal-filter {
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 9px;
  flex-shrink: 0;
}
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.modal-foot > div { display: flex; gap: 8px; flex-wrap: wrap; }
.hint { font-size: 12px; color: var(--ink-faint); }
.picker-grid { grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }
.picker-grid .card-cell { position: relative; }
.picker-grid .card-cell.on .card-face {
  border: 2px solid var(--brand);
  box-shadow: 0 0 0 3px rgba(240,144,0,0.2);
}
.picker-grid .card-name { font-size: 11.5px; }
.pick-mark {
  position: absolute; top: 5px; right: 5px; z-index: 3;
  width: 21px; height: 21px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: none; place-items: center;
  font-size: 12px;
  box-shadow: 0 2px 6px rgba(0,0,0,.25);
}
.picker-grid .card-cell.on .pick-mark { display: grid; }

/* ---------- 卡牌详情 ---------- */
.detail-hero { text-align: center; margin-bottom: 14px; }
.detail-hero img {
  max-width: 210px; width: 100%;
  aspect-ratio: 2 / 3; object-fit: contain;
  border-radius: 11px; border: 1px solid var(--line);
  background: #fff;
}
.detail-name { font-size: 18px; font-weight: 700; margin: 11px 0 5px; }
.detail-sub { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.detail-sec { margin-bottom: 13px; }
.detail-sec h5 {
  margin: 0 0 5px; font-size: 11.5px; letter-spacing: 1.2px;
  color: var(--ink-faint); font-weight: 600;
}
.detail-sec p { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.75; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%; bottom: 34px;
  transform: translateX(-50%);
  background: rgba(31, 42, 51, 0.94);
  color: #fff;
  padding: 10px 22px;
  border-radius: 999px;
  font-size: 13.5px;
  z-index: 300;
  box-shadow: var(--shadow-lg);
  animation: toastIn .22s ease;
}
.toast[hidden] { display: none; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ---------- 页脚 ---------- */
.foot {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: 18px 26px 26px;
  text-align: center;
}
.foot p { margin: 0 auto; max-width: 860px; font-size: 12.5px; color: var(--ink-faint); line-height: 1.7; }
.foot b { color: var(--warn); }
.foot .icp { margin: 10px auto 0; font-size: 12px; }
.foot .icp a { color: var(--ink-faint); text-decoration: none; }
.foot .icp a:hover { text-decoration: underline; }

/* ---------- 账号与审批 ---------- */
.btn-row .btn.active { border-color: var(--brand); color: var(--brand); background: #fff7ec; }
.admin-row { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center;
  padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.admin-row span { flex: 1 1 100%; color: var(--ink-faint); }
.admin-row button { padding: 4px 10px; border-radius: 6px; border: 1px solid var(--line);
  background: #fff; cursor: pointer; }

/* ---------- 响应式 ---------- */
@media (max-width: 900px) {
  .maze-board { grid-template-columns: 1fr; }
  .emotion-map { grid-template-columns: 1fr; }
  main { padding: 16px 14px 50px; }
  /* 窄屏统一策略：顶栏可换行且不再吸顶，标签栏吸顶到 top:0。
     避免顶栏换行变高后与标签栏的 sticky 偏移错位（原 top:62px 是硬编码魔数，
     顶栏一旦高于该值就会遮挡标签栏）。 */
  .topbar {
    flex-wrap: wrap;
    gap: 8px 10px;
    padding: 10px 14px;
    position: static;
  }
  .brand { flex: 1 1 auto; min-width: 0; }
  .brand-text { min-width: 0; }
  .topbar-right { flex: 1 1 100%; justify-content: flex-start; }
  .tabs { padding: 8px 14px 0; top: 0; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
  .panel { padding: 17px 15px; }
  .stage { padding: 16px 14px; }
}
@media (max-width: 560px) {
  /* 更窄屏：进一步压缩品牌区，确保英文名与 ® 能在一行内完整显示
     （此前 .brand-text em 被 display:none 整行隐藏，导致英文名不可见）。 */
  .brand { gap: 10px; }
  .brand-logo { width: 36px; height: 36px; flex-shrink: 0; }
  .brand-text strong { font-size: 15px; letter-spacing: 0.8px; }
  .brand-text em {
    font-size: 10px;
    letter-spacing: 0.1px;
    opacity: 0.9;
  }
  .topbar-right { gap: 6px; }
  .pill { font-size: 11px; padding: 3px 9px; }
  .tab { padding: 9px 13px 8px; font-size: 14px; }
  .slot-row { grid-template-columns: 1fr 1fr; }
  .map-canvas { aspect-ratio: 4 / 3; }
  .canvas-card { width: 84px; }
}
