/* ============================================================
   龙脊少年 · 守约
   视觉系统:中世纪暗色奇幻 + 羊皮纸手稿质感
   主色:鎏金 / 龙焰赤 / 星图青 —— 三色交织,呼应三大线索
   ============================================================ */

/* ===== 设计令牌 ===== */
:root {
  color-scheme: dark;

  /* 底色:夜穹 → 炭黑 */
  --bg:            #080a10;
  --bg-deep:       #05060a;
  --bg-soft:       #10141d;
  --surface:       #141a25;
  --surface-2:     #1b2331;
  --surface-muted: #202a3a;

  /* 文字:羊皮纸色系 */
  --text:          #ece3d0;
  --text-soft:     #c9bda5;
  --text-muted:    #8b8878;
  --text-faint:    #5f6357;

  /* 鎏金:主强调 */
  --gold:          #c9a227;
  --gold-bright:   #e8cd6e;
  --gold-soft:     rgba(201, 162, 39, 0.14);
  --gold-line:     rgba(201, 162, 39, 0.28);

  /* 龙焰赤:危险 / 攻击 */
  --ember:         #d0402b;
  --ember-bright:  #ff6a45;
  --ember-soft:    rgba(208, 64, 43, 0.16);

  /* 星图青:魔法 / 辅助 */
  --arcane:        #3f8fc4;
  --arcane-bright: #6fc0e8;
  --arcane-soft:   rgba(63, 143, 196, 0.16);

  /* 语义色 */
  --hp:            #b8342a;
  --hp-bright:     #e0553f;
  --energy:        #e6b23c;
  --success:       #6fb87a;
  --danger:        #e0553f;

  /* 边框 / 阴影 */
  --border:        rgba(201, 162, 39, 0.16);
  --border-soft:   rgba(236, 227, 208, 0.09);
  --shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md:     0 8px 28px rgba(0, 0, 0, 0.55);
  --shadow-gold:   0 0 24px rgba(201, 162, 39, 0.22);

  /* 尺寸 */
  --radius:        6px;
  --radius-card:   10px;
  --radius-full:   999px;
  --sp-4: 4px;  --sp-8: 8px;  --sp-12: 12px;
  --sp-16: 16px; --sp-20: 20px; --sp-24: 24px; --sp-32: 32px;

  /* 字体 */
  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, "Times New Roman", serif;
  --font-sans: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ===== 重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 400 14px/1.6 var(--font-sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* 全域氛围底纹:顶部微光 + 边缘暗角 */
#app::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(120% 80% at 50% -10%, rgba(201, 162, 39, 0.09), transparent 55%),
    radial-gradient(90% 60% at 50% 110%, rgba(63, 143, 196, 0.07), transparent 60%),
    radial-gradient(140% 120% at 50% 50%, transparent 45%, rgba(0, 0, 0, 0.62) 100%);
}

/* ===== 布局 ===== */
.app {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-width: 1180px;
  margin: 0 auto;
  padding: var(--sp-16);
  gap: var(--sp-16);
}

/* ===== 顶部状态栏 ===== */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-16);
  padding: var(--sp-8) var(--sp-16);
  background: linear-gradient(180deg, rgba(27, 35, 49, 0.9), rgba(16, 20, 29, 0.9));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: var(--sp-8); flex-shrink: 0; }
.topbar-center { flex: 1; display: flex; justify-content: center; min-width: 0; }

.game-mark {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-bright);
  text-shadow: 0 0 12px rgba(201, 162, 39, 0.5);
  margin-right: var(--sp-8);
}
.seed-label, .meta-label { color: var(--text-muted); letter-spacing: 1px; }
.seed-value, .meta-value { font-family: var(--font-mono); color: var(--text-soft); }

/* 章节进度 */
.chapter-progress { width: 100%; max-width: 380px; text-align: center; }
.chapter-progress #chapter-title {
  display: block;
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-soft);
  margin-bottom: 5px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.progress-track {
  height: 3px;
  background: rgba(236, 227, 208, 0.1);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.progress-track > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--ember), var(--gold), var(--gold-bright));
  border-radius: var(--radius-full);
  transition: width 0.6s var(--ease);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.6);
}

/* ===== 视图切换 ===== */
.view { display: none; flex: 1; min-height: 0; }
.view.is-active { display: flex; flex-direction: column; animation: viewIn 0.45s var(--ease) both; }

@keyframes viewIn {
  from { opacity: 0; transform: translateY(10px) scale(0.995); }
  to   { opacity: 1; transform: none; }
}

/* ============================================================
   主菜单
   ============================================================ */
.view-menu { align-items: center; justify-content: center; position: relative; overflow-y: auto; overflow-x: hidden; }

/* 飘散的余烬 */
.menu-embers { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.menu-embers span {
  position: absolute;
  bottom: -12px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ember-bright);
  box-shadow: 0 0 8px 2px rgba(255, 106, 69, 0.55);
  opacity: 0;
  animation: emberRise linear infinite;
}
@keyframes emberRise {
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(0.6); }
  15%  { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-72vh) translateX(var(--drift, 20px)) scale(1.1); }
}

/* ===== 片尾字幕 ===== */
.view-credits {
  background: #000;
  overflow: hidden;
  position: relative;
}
.credits-embers {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.credits-embers span {
  position: absolute;
  bottom: -12px;
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--ember-bright);
  box-shadow: 0 0 8px 2px rgba(255, 106, 69, 0.55);
  opacity: 0;
  animation: creditsEmberRise linear infinite;
}
@keyframes creditsEmberRise {
  0%   { opacity: 0; transform: translateY(0) translateX(0) scale(0.6); }
  15%  { opacity: 0.9; }
  100% { opacity: 0; transform: translateY(-80vh) translateX(var(--drift, 20px)) scale(1.1); }
}
.credits-scroll {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 2;
  display: flex;
  justify-content: center;
}
.credits-inner {
  position: absolute;
  bottom: -100%;
  width: min(720px, 86vw);
  text-align: center;
  color: #d8cfc0;
  animation: creditsScroll 38s linear forwards;
}
@keyframes creditsScroll {
  0%   { bottom: -100%; }
  100% { bottom: 110%; }
}
.credits-inner h1 {
  font-size: 28px;
  color: var(--gold-bright, #e8cd6e);
  letter-spacing: 6px;
  margin: 0 0 28px;
  text-shadow: 0 0 18px rgba(232, 205, 110, 0.5);
}
.credits-inner h2 {
  font-size: 20px;
  color: var(--ember-bright, #ff6a45);
  letter-spacing: 3px;
  margin: 36px 0 14px;
}
.credits-inner p {
  font-size: 15px;
  line-height: 2.1;
  color: #bfb6a6;
  margin: 0 0 12px;
  letter-spacing: 0.5px;
}
.credits-inner .credits-divider {
  width: 60px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
  margin: 28px auto;
}
.credits-inner .credits-end {
  font-size: 22px;
  color: var(--gold-bright, #e8cd6e);
  letter-spacing: 4px;
  margin-top: 48px;
  text-shadow: 0 0 16px rgba(232, 205, 110, 0.6);
}
/* 小节末短字幕(第三章每章一个结果) */
.credits-inner .credits-short-title {
  font-size: 26px;
  letter-spacing: 6px;
  margin: 0 0 6px;
  color: var(--gold-bright, #e8cd6e);
}
.credits-inner .credits-short-recap {
  font-size: 15px;
  line-height: 2.1;
  max-width: 640px;
  margin: 0 auto;
}
.credits-skip {
  position: absolute;
  bottom: 20px;
  right: 24px;
  font-size: 12px;
  color: rgba(255,255,255,0.35);
  z-index: 3;
  letter-spacing: 1px;
  pointer-events: none;
  animation: creditsSkipBlink 2s ease-in-out infinite;
}
@keyframes creditsSkipBlink {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

.menu-card {
  position: relative;
  text-align: center;
  background: linear-gradient(180deg, rgba(27, 35, 49, 0.94), rgba(12, 16, 24, 0.96));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  padding: var(--sp-32) var(--sp-32) var(--sp-24);
  max-width: 640px;
  width: 100%;
  margin: auto;
  box-shadow: var(--shadow-md), var(--shadow-gold);
  animation: cardReveal 0.8s var(--ease) both;
}
@keyframes cardReveal {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: none; }
}
/* 四角鎏金饰线 */
.menu-card::before, .menu-card::after {
  content: "";
  position: absolute;
  width: 26px; height: 26px;
  border: 1px solid var(--gold);
  opacity: 0.6;
}
.menu-card::before { top: 10px; left: 10px; border-right: none; border-bottom: none; }
.menu-card::after  { bottom: 10px; right: 10px; border-left: none; border-top: none; }

.menu-eyebrow {
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--text-muted);
  margin-bottom: var(--sp-16);
}
.menu-title {
  font-family: var(--font-display);
  font-size: 46px;
  font-weight: 700;
  letter-spacing: 10px;
  color: var(--text);
  text-indent: 10px;
  text-shadow: 0 0 26px rgba(201, 162, 39, 0.45), 0 2px 0 rgba(0, 0, 0, 0.6);
  animation: titleGlow 4s ease-in-out infinite;
}
@keyframes titleGlow {
  0%, 100% { text-shadow: 0 0 22px rgba(201, 162, 39, 0.35), 0 2px 0 rgba(0, 0, 0, 0.6); }
  50%      { text-shadow: 0 0 40px rgba(232, 205, 110, 0.7), 0 2px 0 rgba(0, 0, 0, 0.6); }
}
.menu-sub {
  font-family: var(--font-display);
  font-size: 15px;
  letter-spacing: 12px;
  color: var(--gold);
  text-indent: 12px;
  margin: var(--sp-8) 0 var(--sp-20);
  position: relative;
}
.menu-sub::before, .menu-sub::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 44px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-line), transparent);
}
.menu-sub::before { left: calc(50% - 96px); }
.menu-sub::after  { right: calc(50% - 96px); }

.menu-synopsis { max-width: 470px; margin: 0 auto var(--sp-24); text-align: left; }
.synopsis-title {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 6px;
  color: var(--gold);
  text-align: center;
  margin-bottom: var(--sp-12);
}
.menu-synopsis p {
  font-family: var(--font-display);
  font-size: 13.5px;
  line-height: 1.95;
  color: var(--text-soft);
  text-indent: 2em;
}

/* 两大章入口 */
.chapter-select {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-12);
  margin-bottom: var(--sp-20);
}
.chapter-entry {
  position: relative;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: var(--text);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-16);
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.chapter-entry:hover {
  border-color: var(--gold-line);
  transform: translateY(-3px);
  box-shadow: var(--shadow-gold);
}
.chapter-entry.is-cleared { border-color: rgba(111, 184, 122, 0.45); }
.chapter-entry.is-continue {
  border-color: rgba(232, 205, 110, 0.6);
  background: linear-gradient(180deg, rgba(232, 205, 110, 0.08), var(--bg-soft));
}
.chapter-entry.is-continue:hover { border-color: var(--gold-line); }
.chapter-entry.is-locked {
  cursor: not-allowed;
  opacity: 0.55;
  filter: grayscale(0.5);
}
.chapter-entry.is-locked:hover { transform: none; box-shadow: none; border-color: var(--border); }
.chapter-entry-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-8); }
.chapter-entry-badge {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-full);
  padding: 2px 10px;
}
.chapter-entry-state { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.chapter-entry.is-cleared .chapter-entry-state { color: var(--success); }
.chapter-entry-title {
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 3px;
  margin-bottom: 6px;
}
.chapter-entry-sub { font-size: 11px; line-height: 1.6; color: var(--text-muted); }
.chapter-entry-lock { margin-top: var(--sp-8); font-size: 11px; color: var(--ember-bright); }
.chapter-entry.shake { animation: chapterShake 0.4s var(--ease); }
@keyframes chapterShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(4px); }
}

/* 背景音乐开关 */
.music-toggle {
  width: 30px;
  height: 30px;
  margin-right: var(--sp-8);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.music-toggle:hover { border-color: var(--gold-line); }
.music-toggle.is-on {
  color: var(--gold-bright);
  border-color: var(--gold-line);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.35);
}
.menu-actions { display: flex; gap: var(--sp-12); justify-content: center; margin-bottom: var(--sp-16); }
.menu-hint { font-size: 11px; letter-spacing: 1px; color: var(--text-faint); }

/* 顶栏小图标按钮(游戏说明等) */
.icon-btn {
  width: 30px;
  height: 30px;
  margin-right: var(--sp-8);
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease);
}
.icon-btn:hover { color: var(--gold-bright); border-color: var(--gold-line); }

/* ============================================================
   游戏说明(操作指南)弹窗
   ============================================================ */
.modal { position: fixed; inset: 0; z-index: 1200; display: flex; align-items: center; justify-content: center; }
.modal[hidden] { display: none; }
.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 4, 8, 0.72);
  backdrop-filter: blur(2px);
  animation: fadeIn 0.25s var(--ease) both;
}
.modal-panel {
  position: relative;
  width: min(560px, calc(100vw - 32px));
  max-height: min(82vh, 720px);
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md), var(--shadow-gold);
  animation: cardReveal 0.35s var(--ease) both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-16) var(--sp-20);
  border-bottom: 1px solid var(--border-soft);
}
.modal-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--gold-bright);
}
.modal-close {
  width: 28px; height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.modal-close:hover { color: var(--ember-bright); border-color: var(--ember); }
.modal-body {
  padding: var(--sp-20);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-20);
}
.guide-group-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--gold);
  padding-bottom: var(--sp-8);
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-soft);
}
.guide-list { list-style: none; display: flex; flex-direction: column; gap: var(--sp-8); }
.guide-list > li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-soft);
}
.guide-key {
  flex: 0 0 auto;
  color: var(--text);
  font-weight: 600;
}
.guide-sep { color: var(--text-faint); }
.guide-desc { color: var(--text-muted); font-size: 12.5px; }
.guide-list kbd {
  font-family: var(--font-mono);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 1px 6px;
  color: var(--text-soft);
  font-size: 11px;
}
.g-atk { color: var(--ember-bright); font-weight: 600; }
.g-def { color: var(--arcane-bright); font-weight: 600; }
.g-buf { color: var(--gold-bright); font-weight: 600; }
.g-music { color: var(--gold-bright); }

/* ============================================================
   职业选择
   ============================================================ */
.view-career { gap: var(--sp-16); overflow-y: auto; padding-right: var(--sp-4); }
.view-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--gold-bright);
  text-align: center;
  margin-bottom: var(--sp-4);
}
.view-sub { color: var(--text-muted); font-size: 12px; text-align: center; margin-bottom: var(--sp-12); }

.career-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--sp-16);
}
.career-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-16);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.18s var(--ease), box-shadow 0.2s;
  overflow: hidden;
}
.career-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold-soft), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}
.career-card:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: var(--shadow-md), var(--shadow-gold); }
.career-card:hover::after { opacity: 1; }
.career-icon-row { display: flex; align-items: center; gap: var(--sp-12); margin-bottom: var(--sp-12); }
.career-icon {
  flex-shrink: 0;
  width: 40px; height: 40px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25), 0 2px 8px rgba(0, 0, 0, 0.5);
}
.career-title { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: 1px; }
.career-class { color: var(--text-muted); font-size: 11px; letter-spacing: 2px; }
.career-story {
  color: var(--text-soft);
  font-family: var(--font-display);
  font-size: 12.5px;
  line-height: 1.85;
  margin-bottom: var(--sp-12);
  max-height: 120px;
  overflow-y: auto;
}
.career-meta { display: flex; gap: var(--sp-12); font-size: 11px; color: var(--text-muted); flex-wrap: wrap; }
.career-meta code { font-family: var(--font-mono); color: var(--gold-bright); }

/* ============================================================
   剧情视图
   ============================================================ */
.view-narrative {
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: var(--sp-12);
}
/* 覆盖 .view.is-active 的 column(特指度需同级且靠后) */
.view-narrative.is-active {
  flex-direction: row;
}
.narrative-box {
  position: relative;
  flex: 0 1 760px;
  width: 100%;
  max-width: 760px;
  background:
    linear-gradient(180deg, rgba(20, 26, 37, 0.97), rgba(11, 14, 21, 0.98));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  padding: var(--sp-20) var(--sp-24) var(--sp-16);
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  max-height: 92vh;
  box-shadow: var(--shadow-md);
}
.narrative-box::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid var(--border-soft);
  border-radius: calc(var(--radius-card) - 4px);
  pointer-events: none;
}

.narrative-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); flex-wrap: wrap; min-height: 24px; }
.narrative-stats { display: flex; gap: var(--sp-8); flex-wrap: wrap; font-size: 11px; }
.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  padding: 3px var(--sp-8);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-soft);
  animation: chipIn 0.4s var(--ease) both;
}
@keyframes chipIn { from { opacity: 0; transform: scale(0.85); } to { opacity: 1; transform: none; } }
.stat-chip.is-career { font-family: var(--font-sans); font-weight: 600; letter-spacing: 1px; border-color: transparent; }

/* 主角生命 / 能量(剧情内常显) */
.narrative-vitals { display: flex; align-items: center; gap: var(--sp-12); font-size: 11px; color: var(--text-muted); }
.vital { display: flex; align-items: center; gap: 6px; }
.vital-bar {
  width: 96px; height: 6px;
  background: rgba(0, 0, 0, 0.5);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  overflow: hidden;
}
.vital-bar > i { display: block; height: 100%; transition: width 0.5s var(--ease); }
.vital-bar.hp > i   { background: linear-gradient(90deg, var(--hp), var(--hp-bright)); }
.vital-bar.energy-bar > i { background: linear-gradient(90deg, var(--energy), var(--gold-bright)); }
.vital code { font-family: var(--font-mono); color: var(--text-soft); }

.narrative-text {
  font-family: var(--font-display);
  font-size: 15.5px;
  line-height: 2.05;
  color: var(--text);
  overflow-y: auto;
  flex: 1;
  min-height: 220px;
  max-height: 52vh;
  padding-right: var(--sp-8);
  letter-spacing: 0.3px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-line) transparent;
}
.narrative-text::-webkit-scrollbar { width: 6px; }
.narrative-text::-webkit-scrollbar-thumb { background: var(--gold-line); border-radius: 3px; }

.narrative-image {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: var(--radius);
  margin-bottom: var(--sp-16);
  border: 1px solid var(--gold-line);
  display: block;
  background: var(--surface-2);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.6), inset 0 0 60px rgba(0, 0, 0, 0.35);
  animation: imgReveal 1s var(--ease) both;
  filter: saturate(0.94) contrast(1.03);
}
@keyframes imgReveal {
  from { opacity: 0; transform: scale(1.03); filter: saturate(0.6) brightness(0.6); }
  to   { opacity: 1; transform: none; }
}
.narrative-text-body { white-space: pre-wrap; }

/* 段落:由 JS 逐段添加 opacity/transform 过渡实现渐显 */
.narrative-text-body p { margin-bottom: 0.9em; }

.narrative-choices { display: flex; flex-direction: column; gap: var(--sp-8); }
.narrative-choices.is-waiting { opacity: 0; pointer-events: none; }

.narrative-choice-btn {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-12);
  text-align: left;
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
  border: 1px solid var(--border);
  border-left: 3px solid var(--gold-line);
  border-radius: var(--radius);
  padding: var(--sp-12) var(--sp-16);
  color: var(--text);
  font: 400 14px/1.7 var(--font-display);
  cursor: pointer;
  transition: border-color 0.18s, background 0.18s, transform 0.12s var(--ease);
  animation: choiceIn 0.5s var(--ease) both;
}
@keyframes choiceIn { from { opacity: 0; transform: translateX(-12px); } to { opacity: 1; transform: none; } }
.narrative-choice-btn .choice-key {
  flex-shrink: 0;
  width: 20px; height: 20px;
  margin-top: 1px;
  border-radius: var(--radius-full);
  border: 1px solid var(--gold-line);
  color: var(--gold);
  font-family: var(--font-mono);
  font-size: 11px;
  line-height: 18px;
  text-align: center;
  transition: background 0.18s, color 0.18s;
}
.narrative-choice-btn:hover {
  border-color: var(--gold);
  border-left-color: var(--gold-bright);
  background: linear-gradient(180deg, var(--surface-muted), var(--surface-2));
  transform: translateX(4px);
  color: var(--gold-bright);
}
.narrative-choice-btn:hover .choice-key { background: var(--gold); color: #1a1206; border-color: var(--gold); }

.narrative-continue {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  letter-spacing: 2px;
  cursor: pointer;
  padding: var(--sp-8);
  transition: color 0.18s;
  animation: caretPulse 1.8s ease-in-out infinite;
}
.narrative-continue:hover { color: var(--gold-bright); }
@keyframes caretPulse { 0%, 100% { opacity: 0.55; } 50% { opacity: 1; } }

.narrative-footer { display: flex; justify-content: space-between; align-items: center; min-height: 16px; }
.narrative-hint { font-size: 11px; color: var(--text-faint); letter-spacing: 1px; }
.narrative-hint kbd {
  font-family: var(--font-mono);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: 3px;
  padding: 1px 5px;
  color: var(--text-soft);
  font-size: 10px;
}

/* ============================================================
   剧情视图 · 像素图侧栏(人物 / 环境)
   独立于 .narrative-box,不改变文字窗口尺寸与位置
   ============================================================ */
.scene-panel {
  flex: 0 0 190px;
  width: 190px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-12) var(--sp-16);
  background: linear-gradient(180deg, rgba(20, 26, 37, 0.94), rgba(9, 12, 18, 0.96));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
  animation: viewIn 0.5s var(--ease) both;
}
.scene-panel-title {
  font-family: var(--font-display);
  font-size: 11px;
  letter-spacing: 5px;
  color: var(--gold);
  text-indent: 5px;
}
.scene-frame {
  position: relative;
  width: 100%;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: #05070c;
  padding: 4px;
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.85);
}
.scene-canvas {
  display: block;
  width: 100%;
  height: auto;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  -ms-interpolation-mode: nearest-neighbor;
}
.scene-canvas-char { width: 144px; margin: 0 auto; }
.scene-corner {
  position: absolute;
  width: 7px; height: 7px;
  border: 1px solid var(--gold-bright);
  opacity: 0.75;
}
.scene-corner.tl { top: 1px; left: 1px; border-right: 0; border-bottom: 0; }
.scene-corner.tr { top: 1px; right: 1px; border-left: 0; border-bottom: 0; }
.scene-corner.bl { bottom: 1px; left: 1px; border-right: 0; border-top: 0; }
.scene-corner.br { bottom: 1px; right: 1px; border-left: 0; border-top: 0; }
.scene-name {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--gold-bright);
  letter-spacing: 1px;
  text-align: center;
}
.scene-sub {
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-muted);
  text-align: center;
}
.scene-status {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: center;
  margin-top: 2px;
}
.scene-chip {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--radius-full);
  border: 1px solid var(--border-soft);
  background: var(--surface-muted);
  color: var(--text-soft);
  animation: chipIn 0.4s var(--ease) both;
}
.scene-chip.is-warn { border-color: rgba(224, 85, 63, 0.4); color: var(--hp-bright); }
.scene-chip.is-good { border-color: rgba(111, 184, 122, 0.4); color: var(--success); }
.scene-chip.is-arcane { border-color: rgba(111, 192, 232, 0.4); color: var(--arcane-bright); }

/* 窄屏:隐藏像素侧栏,保证剧情文字窗口不受影响 */
@media (max-width: 1140px) {
  .scene-panel { display: none; }
}

/* ============================================================
   战斗视图
   ============================================================ */
.view-battle { gap: var(--sp-8); }

.battle-stage {
  flex: 1;
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: var(--sp-8);
  min-height: 0;
}
.battle-foes { display: flex; justify-content: center; padding-top: var(--sp-8); }
.enemy-zone { display: flex; align-items: center; gap: var(--sp-16); }
.battle-hero { display: flex; justify-content: center; }
.player-zone { display: flex; align-items: center; gap: var(--sp-16); }

/* 战斗日志 */
.battle-log {
  align-self: center;
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--text-soft);
  text-align: center;
  min-height: 20px;
  letter-spacing: 1px;
  transition: color 0.2s;
}
.battle-log.is-flash { animation: logFlash 0.6s var(--ease); }
@keyframes logFlash { 0% { color: var(--gold-bright); } 100% { color: var(--text-soft); } }

/* 战斗实体 */
.entity-card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-12) var(--sp-16);
  min-width: 190px;
  box-shadow: var(--shadow-sm);
}
.entity-card.is-enemy { border-color: rgba(208, 64, 43, 0.35); }
.entity-card.is-player { border-color: rgba(201, 162, 39, 0.3); }
.entity-card.is-hit { animation: hitShake 0.4s var(--ease); }
@keyframes hitShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-7px); }
  40% { transform: translateX(6px); }
  60% { transform: translateX(-4px); }
  80% { transform: translateX(3px); }
}
.entity-card.is-dead { opacity: 0.35; filter: grayscale(0.8); }
.entity-card.is-selected { border-color: #f1c40f; box-shadow: 0 0 12px rgba(241, 196, 15, 0.5); }
.entity-card.is-ally { border-color: rgba(46, 204, 113, 0.4); min-width: 140px; }
.entity-card.is-ally .entity-avatar { background: linear-gradient(160deg, #1e8449, #0b3d1e); }
.entity-card.is-ally .hpbar > i { background: linear-gradient(90deg, #1e8449, #2ecc71); }

.entity-top { display: flex; align-items: center; gap: var(--sp-8); margin-bottom: var(--sp-8); }
.entity-avatar {
  width: 34px; height: 34px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}
.entity-card.is-enemy .entity-avatar { background: linear-gradient(160deg, #7a2418, #3a1109); }
.entity-card.is-player .entity-avatar { background: linear-gradient(160deg, #8a6a1a, #3a2d08); }
.entity-name { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: 1px; }
.entity-block {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--arcane-bright);
  opacity: 0;
  transition: opacity 0.2s;
}
.entity-block.is-on { opacity: 1; }

.hpbar { position: relative; height: 14px; background: rgba(0, 0, 0, 0.55); border-radius: var(--radius-full); overflow: hidden; border: 1px solid var(--border-soft); }
.hpbar > i { display: block; height: 100%; border-radius: var(--radius-full); transition: width 0.45s var(--ease); }
.entity-card.is-enemy .hpbar > i { background: linear-gradient(90deg, #8f2a1c, var(--hp-bright)); }
.entity-card.is-player .hpbar > i { background: linear-gradient(90deg, #4e8a52, var(--success)); }
.hpbar > span {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  color: #fff;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.9);
}

.entity-intent {
  margin-top: var(--sp-8);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-soft);
}
.entity-intent.is-attack { color: var(--ember-bright); }
.entity-intent.is-block  { color: var(--arcane-bright); }
.entity-intent.is-buff   { color: var(--gold-bright); }
.entity-intent .intent-icon { font-size: 14px; }
.entity-statuses { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.status-pill {
  font-size: 10px;
  font-family: var(--font-mono);
  padding: 1px 6px;
  border-radius: var(--radius-full);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  color: var(--text-soft);
}
.status-pill.neg { border-color: rgba(208, 64, 43, 0.4); color: var(--ember-bright); }
.status-pill.pos { border-color: rgba(201, 162, 39, 0.4); color: var(--gold-bright); }

/* 伤害飘字 */
.dmg-float {
  position: absolute;
  left: 50%;
  top: -4px;
  transform: translateX(-50%);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 24px;
  pointer-events: none;
  z-index: 5;
  animation: dmgFloat 1s var(--ease) forwards;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.9);
}
.dmg-float.dmg { color: var(--ember-bright); }
.dmg-float.block { color: var(--arcane-bright); font-size: 18px; }
.dmg-float.heal { color: var(--success); }
@keyframes dmgFloat {
  0%   { opacity: 0; transform: translateX(-50%) translateY(6px) scale(0.7); }
  25%  { opacity: 1; transform: translateX(-50%) translateY(-10px) scale(1.15); }
  100% { opacity: 0; transform: translateX(-50%) translateY(-46px) scale(1); }
}

/* HUD:牌堆 + 能量 */
.battle-hud { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--sp-8); }
.hud-piles { display: flex; gap: var(--sp-16); font-size: 12px; color: var(--text-muted); }
.hud-piles .pile code { font-family: var(--font-mono); color: var(--text-soft); }
.hud-energy { display: flex; align-items: center; }
.energy-orb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 62px;
  height: 30px;
  padding: 0 var(--sp-12);
  border-radius: var(--radius-full);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 14px;
  color: #2a1d02;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--energy));
  box-shadow: 0 0 16px rgba(230, 178, 60, 0.5), inset 0 -2px 6px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s var(--ease);
}
.energy-orb.pulse { animation: orbPulse 0.5s var(--ease); }
@keyframes orbPulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.14); } }

/* 手牌 */
.hand {
  display: flex;
  gap: var(--sp-8);
  overflow-x: auto;
  padding: var(--sp-8) var(--sp-8) var(--sp-12);
  min-height: 158px;
  scrollbar-width: thin;
  scrollbar-color: var(--gold-line) transparent;
}
.hand::-webkit-scrollbar { height: 6px; }
.hand::-webkit-scrollbar-thumb { background: var(--gold-line); border-radius: 3px; }

.card {
  position: relative;
  flex-shrink: 0;
  width: 128px;
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: var(--sp-12) var(--sp-12) var(--sp-16);
  cursor: pointer;
  transition: border-color 0.16s, transform 0.16s var(--ease), box-shadow 0.16s;
  user-select: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: cardDraw 0.35s var(--ease) both;
}
@keyframes cardDraw { from { opacity: 0; transform: translateY(26px) scale(0.9); } to { opacity: 1; transform: none; } }
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent 45%);
}
.card:hover { transform: translateY(-10px) scale(1.03); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6); z-index: 2; }
.card.type-attack { border-color: rgba(208, 64, 43, 0.42); }
.card.type-attack:hover { border-color: var(--ember-bright); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(208, 64, 43, 0.32); }
.card.type-skill { border-color: rgba(63, 143, 196, 0.42); }
.card.type-skill:hover { border-color: var(--arcane-bright); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(63, 143, 196, 0.32); }
.card.type-power { border-color: rgba(201, 162, 39, 0.5); }
.card.type-power:hover { border-color: var(--gold-bright); box-shadow: 0 14px 30px rgba(0, 0, 0, 0.6), 0 0 20px rgba(201, 162, 39, 0.4); }

.card-cost {
  position: absolute;
  top: -8px; left: -8px;
  width: 26px; height: 26px;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 13px;
  color: #2a1d02;
  background: radial-gradient(circle at 35% 30%, var(--gold-bright), var(--energy));
  box-shadow: 0 0 10px rgba(230, 178, 60, 0.55);
}
.card-name { font-family: var(--font-display); font-weight: 700; font-size: 14px; letter-spacing: 1px; }
.card-type-tag { font-size: 9px; letter-spacing: 2px; color: var(--text-faint); }
.card-desc { color: var(--text-soft); font-family: var(--font-display); font-size: 12px; line-height: 1.6; }
.card.is-unplayable { opacity: 0.42; cursor: not-allowed; filter: grayscale(0.5); }
.card.is-unplayable:hover { transform: none; box-shadow: none; }
.card.is-playing { animation: cardPlay 0.4s var(--ease) forwards; }
@keyframes cardPlay {
  0%   { transform: translateY(0) scale(1); opacity: 1; }
  100% { transform: translateY(-90px) scale(1.05); opacity: 0; }
}

.battle-actions { display: flex; justify-content: flex-end; gap: var(--sp-8); }
.battle-actions .btn.is-active { background: var(--gold-bright); color: #1a1410; border-color: var(--gold-bright); }

/* ============================================================
   战利品 / 奖励视图
   ============================================================ */
.view-reward { align-items: center; justify-content: center; gap: var(--sp-8); }
.reward-grid { display: flex; gap: var(--sp-16); flex-wrap: wrap; justify-content: center; margin: var(--sp-16) 0; }
.reward-grid .card { width: 150px; min-height: 190px; }
.reward-grid .card:hover { transform: translateY(-8px) scale(1.04); }

/* ============================================================
   结局视图
   ============================================================ */
.view-result { align-items: center; justify-content: center; }
.result-card {
  position: relative;
  text-align: center;
  background: linear-gradient(180deg, rgba(23, 29, 41, 0.96), rgba(8, 10, 16, 0.98));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  padding: var(--sp-32) var(--sp-32) var(--sp-24);
  max-width: 460px;
  width: 100%;
  box-shadow: var(--shadow-md), var(--shadow-gold);
  animation: cardReveal 0.9s var(--ease) both;
}
.result-eyebrow { font-size: 11px; letter-spacing: 6px; color: var(--text-muted); margin-bottom: var(--sp-12); }
.result-title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 8px;
  text-indent: 8px;
  margin-bottom: var(--sp-16);
  text-shadow: 0 0 26px rgba(201, 162, 39, 0.4);
}
.result-art {
  height: 4px;
  width: 90px;
  margin: 0 auto var(--sp-20);
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}
.result-desc {
  font-family: var(--font-display);
  font-size: 14px;
  line-height: 2;
  color: var(--text-soft);
  margin-bottom: var(--sp-20);
}
.result-stats { display: flex; gap: var(--sp-8); justify-content: center; flex-wrap: wrap; margin-bottom: var(--sp-24); }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  position: relative;
  font: 500 14px var(--font-sans);
  letter-spacing: 2px;
  padding: var(--sp-8) var(--sp-20);
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.16s, border-color 0.16s, transform 0.1s var(--ease), box-shadow 0.16s;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #241a05;
  border-color: var(--gold-bright);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(201, 162, 39, 0.32);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(232, 205, 110, 0.5); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-soft); border-color: var(--gold-line); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold-bright); }
.btn-danger {
  background: linear-gradient(180deg, var(--ember-bright), var(--ember));
  color: #2a0d07;
  border-color: var(--ember-bright);
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(208, 64, 43, 0.32);
}
.btn-danger:hover { box-shadow: 0 6px 22px rgba(255, 106, 69, 0.5); transform: translateY(-1px); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; transform: none; }

/* 触屏优化:移除点击延迟,扩大可点区域的即时响应 */
.btn, .icon-btn, .music-toggle, .chapter-entry,
.narrative-choice-btn, .narrative-continue, .modal-close, .stop-card, .item-chip, .card {
  touch-action: manipulation;
}

/* 通用:按钮按下反馈(触屏无 hover 时也能感知点击) */
@media (hover: none) {
  .chapter-entry:active { transform: scale(0.985); border-color: var(--gold-line); }
  .icon-btn:active, .music-toggle:active, .modal-close:active { transform: scale(0.92); }
}

/* ============================================================
   地区地图 / 商店 / 市场 / 背包 / 打工
   ============================================================ */
.view-map, .view-shop, .view-market, .view-bag, .view-job { gap: var(--sp-12); overflow-y: auto; padding-right: var(--sp-4); }

.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); flex-wrap: wrap; }
.map-res { display: flex; gap: var(--sp-8); }
.res-chip {
  font-family: var(--font-mono); font-size: 12px; color: var(--text-soft);
  background: var(--surface-muted); border: 1px solid var(--border-soft);
  border-radius: var(--radius-full); padding: 2px 10px; white-space: nowrap;
}

.map-hint {
  font-family: var(--font-display); font-size: 13.5px; line-height: 1.7;
  color: var(--gold-bright); background: var(--gold-soft);
  border: 1px solid var(--gold-line); border-left: 3px solid var(--gold);
  border-radius: var(--radius); padding: var(--sp-8) var(--sp-12);
}

.map-stops { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-12); }
.stop-card {
  text-align: left; font: inherit; color: var(--text); cursor: pointer;
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--sp-12);
  transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.stop-card:hover:not(:disabled) { border-color: var(--gold-line); transform: translateY(-3px); }
.stop-card.is-here { border-color: var(--arcane); background: var(--arcane-soft); cursor: default; }
.stop-card.is-objective { border-color: var(--gold); box-shadow: var(--shadow-gold); }
.stop-card:disabled { opacity: 1; }
.stop-head { display: flex; justify-content: space-between; align-items: center; gap: var(--sp-8); margin-bottom: 6px; }
.stop-name { font-family: var(--font-display); font-size: 16px; letter-spacing: 2px; }
.stop-tag {
  font-size: 11px; color: var(--text-muted); border: 1px solid var(--border-soft);
  border-radius: var(--radius-full); padding: 1px 8px; white-space: nowrap;
}
.stop-card.is-objective .stop-tag { color: var(--gold-bright); border-color: var(--gold-line); }
.stop-card.is-here .stop-tag { color: var(--arcane-bright); border-color: var(--arcane); }
.stop-meta { font-size: 11.5px; color: var(--text-muted); margin-bottom: 6px; }
.stop-services { display: flex; gap: 6px; flex-wrap: wrap; }
.svc {
  font-size: 10.5px; color: var(--success);
  border: 1px solid rgba(111, 184, 122, 0.35);
  border-radius: var(--radius-full); padding: 1px 8px;
}
.svc.is-off { color: var(--text-faint); border-color: var(--border-soft); }

.map-services { display: flex; gap: var(--sp-12); justify-content: center; flex-wrap: wrap; }
.panel-actions { display: flex; gap: var(--sp-12); justify-content: center; flex-wrap: wrap; margin-top: var(--sp-4); }

/* 本地随机 NPC(主城人多,超出高度时本行内滚动) */
.map-npcs-wrap { display: flex; flex-direction: column; gap: 6px; margin-top: var(--sp-12); }
.map-npcs-title { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; }
.map-npcs {
  display: flex; gap: var(--sp-8); flex-wrap: wrap;
  max-height: 172px; overflow-y: auto;
  align-content: flex-start;
  scrollbar-width: thin;
}
.npc-chip {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer;
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-soft); border-radius: var(--radius-full);
  padding: 3px 12px; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease);
  touch-action: manipulation;
}
.npc-chip:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.npc-chip-name { font-family: var(--font-display); font-size: 13px; letter-spacing: 1px; }
.npc-chip-tag { font-size: 10.5px; color: var(--text-muted); }
.npc-empty { font-size: 11.5px; color: var(--text-faint); }
.stop-eta { display: block; margin-top: 6px; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* ============================================================
   世界地图(全部地区总览)
   ============================================================ */
.view-world, .view-travel { gap: var(--sp-12); overflow-y: auto; padding-right: var(--sp-4); }
.world-note { font-size: 11.5px; color: var(--text-muted); font-family: var(--font-mono); }

/* 剧情引导横幅:世界地图顶部常驻,报出主线所在与一键前往 */
.story-banner {
  display: flex; align-items: center; gap: var(--sp-12); flex-wrap: wrap;
  padding: 10px var(--sp-12);
  background: linear-gradient(90deg, rgba(192, 57, 43, 0.16), rgba(192, 57, 43, 0.03));
  border: 1px solid var(--ember); border-radius: var(--radius-card);
}
.story-banner[hidden] { display: none; }
.story-banner-icon { font-size: 16px; line-height: 1; }
.story-banner-text { flex: 1 1 220px; font-size: 12.5px; line-height: 1.6; color: var(--text); }
.story-banner-actions { display: flex; gap: var(--sp-8); flex-wrap: wrap; }

.world-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, 1fr); gap: var(--sp-12); align-items: start; }

.world-map {
  position: relative; width: 100%; aspect-ratio: 16 / 10; min-height: 340px;
  background:
    /* 牛皮纸纹理:斑驳的棕黄色调,模拟手绘地图的 aged parchment */
    radial-gradient(ellipse at 30% 20%, rgba(255, 240, 200, 0.35), transparent 55%),
    radial-gradient(ellipse at 75% 80%, rgba(180, 140, 80, 0.25), transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(230, 200, 150, 0.15), transparent 70%),
    /* 纸张底色 */
    linear-gradient(135deg, #d9c39a 0%, #c9a876 30%, #b8945f 60%, #a67c45 100%);
  border: 1px solid #8b6914; border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow:
    inset 0 0 60px rgba(120, 80, 30, 0.35),
    inset 0 0 120px rgba(90, 60, 20, 0.2),
    0 4px 16px rgba(0, 0, 0, 0.3);
}
/* 牛皮纸的做旧斑驳(叠加层,不影响点击) */
.world-map::before {
  content: '';
  position: absolute; inset: 0;
  background-image:
    radial-gradient(circle at 15% 35%, rgba(100, 65, 25, 0.18) 0%, transparent 8%),
    radial-gradient(circle at 85% 15%, rgba(100, 65, 25, 0.12) 0%, transparent 6%),
    radial-gradient(circle at 45% 75%, rgba(100, 65, 25, 0.15) 0%, transparent 10%),
    radial-gradient(circle at 70% 55%, rgba(100, 65, 25, 0.1) 0%, transparent 7%),
    radial-gradient(circle at 25% 85%, rgba(100, 65, 25, 0.12) 0%, transparent 9%);
  pointer-events: none;
  mix-blend-mode: multiply;
}
/* 牛皮纸边缘的撕裂/烧焦效果 */
.world-map::after {
  content: '';
  position: absolute; inset: 0;
  box-shadow: inset 0 0 30px rgba(80, 50, 15, 0.5);
  pointer-events: none;
  border-radius: var(--radius-card);
}
.wm-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(100, 70, 30, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(100, 70, 30, 0.06) 1px, transparent 1px);
  background-size: 10% 10%;
  pointer-events: none;
}
/* 可缩放层:所有地区 / POI 标记都在这一层,缩放围绕地图中心 */
.wm-canvas {
  position: absolute; inset: 0; z-index: 2;
  transform-origin: 50% 50%;
  transition: transform 0.18s var(--ease);
}
/* 世界地图右下角的缩放控件 */
.wm-zoom {
  position: absolute; right: 8px; bottom: 8px; z-index: 6;
  display: flex; flex-direction: column; gap: 4px;
}
.wm-zoom button {
  width: 26px; height: 26px; padding: 0; cursor: pointer;
  font: inherit; font-size: 14px; line-height: 1;
  color: #4a3018; background: rgba(255, 244, 220, 0.92);
  border: 1px solid #8b6914; border-radius: 6px;
  box-shadow: 0 1px 3px rgba(90, 60, 20, 0.35);
  touch-action: manipulation;
}
.wm-zoom button:hover { background: #fff6de; }
.wm-zoom button:active { transform: translateY(1px); }
.wm-marker {
  position: absolute; transform: translate(-50%, -50%);
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; border: 0; padding: 2px; cursor: pointer; font: inherit;
  touch-action: manipulation;
  z-index: 2; /* 确保标记在牛皮纸纹理之上可点击 */
}
.wm-dot {
  width: 11px; height: 11px; border-radius: 50%;
  background: #6b4423; border: 2px solid rgba(60, 35, 12, 0.85);
  box-shadow: 0 0 0 1px rgba(120, 80, 30, 0.6);
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.wm-label {
  font-family: var(--font-display); font-size: 10px; letter-spacing: 1px;
  color: #4a3018; white-space: nowrap;
  text-shadow: 0 1px 2px rgba(255, 240, 200, 0.7), 0 0 4px rgba(255, 240, 200, 0.5);
}
.wm-flag {
  font-family: var(--font-display); font-size: 9px; letter-spacing: 1px;
  color: #fff2e6; background: #c0392b; border-radius: var(--radius-full);
  padding: 0 6px; white-space: nowrap;
  box-shadow: 0 1px 3px rgba(120, 20, 10, 0.5);
}
.wm-marker:hover .wm-dot { transform: scale(1.35); }
.wm-marker:hover .wm-label { color: #2a1a08; }
.wm-marker.is-visited .wm-dot { background: #8b6914; }
.wm-marker.is-city .wm-dot { background: #c9a227; box-shadow: 0 0 10px rgba(201, 162, 39, 0.7); }
.wm-marker.is-city .wm-label { color: #5a4510; font-weight: 700; }
.wm-marker.is-current .wm-dot { background: #2e7d4f; box-shadow: 0 0 12px rgba(46, 125, 79, 0.7); }
.wm-marker.is-current .wm-label { color: #1a4a2e; }
.wm-marker.is-story .wm-dot { background: #c0392b; box-shadow: 0 0 14px rgba(192, 57, 43, 0.75); animation: wmPulse 2.2s infinite; }
.wm-marker.is-story .wm-label { color: #8b2820; }
.wm-marker.is-selected .wm-dot { outline: 2px solid #8b2820; outline-offset: 3px; }
.wm-marker.is-selected .wm-label { color: #8b2820; }
/* POI 标记在牛皮纸上的样式 */
.wm-poi-dot {
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(255, 240, 200, 0.9); border: 2px solid #6b4423;
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; line-height: 1;
}
.wm-marker.wm-poi .wm-label { color: #4a3018; font-weight: 600; }
.wm-marker.poi-restaurant .wm-poi-dot { background: #e8c07a; }
.wm-marker.poi-hotel .wm-poi-dot { background: #c8a8d8; }
.wm-marker.poi-market .wm-poi-dot { background: #a8c8d8; }
@keyframes wmPulse {
  0%, 100% { box-shadow: 0 0 10px rgba(192, 57, 43, 0.5); }
  50%      { box-shadow: 0 0 20px rgba(192, 57, 43, 0.95); }
}

.world-side { display: flex; flex-direction: column; gap: var(--sp-8); min-width: 0; }
.world-panel {
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--sp-12);
}
.wp-head { display: flex; flex-direction: column; gap: 6px; margin-bottom: var(--sp-8); }
.wp-name { font-family: var(--font-display); font-size: 18px; letter-spacing: 2px; margin: 0; }
.wp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.wp-tag {
  font-size: 10.5px; color: var(--text-muted); border: 1px solid var(--border-soft);
  border-radius: var(--radius-full); padding: 1px 8px; white-space: nowrap;
}
.wp-tag-city { color: var(--gold-bright); border-color: var(--gold-line); }
.wp-tag-story { color: var(--ember-bright); border-color: var(--ember); }
.wp-tag-here { color: var(--arcane-bright); border-color: var(--arcane); }
.wp-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px var(--sp-12); margin: 0 0 var(--sp-8); }
.wp-stats > div { display: flex; justify-content: space-between; gap: var(--sp-8); border-bottom: 1px dashed var(--border-soft); padding-bottom: 3px; }
.wp-stats dt { font-size: 11px; color: var(--text-muted); }
.wp-stats dd { margin: 0; font-family: var(--font-mono); font-size: 12px; color: var(--text-soft); }
.wp-note { font-size: 11.5px; line-height: 1.7; color: var(--text-muted); margin: 0 0 var(--sp-8); }
.wp-actions { display: flex; gap: var(--sp-8); flex-wrap: wrap; }

.world-list-head { font-size: 11px; color: var(--text-muted); letter-spacing: 1px; margin-top: var(--sp-4); }
.world-list { display: flex; flex-direction: column; gap: 4px; max-height: 300px; overflow-y: auto; }
.world-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'name meta' 'dist dist';
  gap: 2px var(--sp-8); align-items: center; text-align: left; font: inherit; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border-soft); border-radius: var(--radius);
  padding: 6px 10px; color: var(--text); touch-action: manipulation;
  transition: border-color 0.2s var(--ease);
}
.world-row:hover { border-color: var(--gold-line); }
.world-row.is-current { border-color: var(--arcane); background: var(--arcane-soft); }
.world-row.is-story .wr-name { color: var(--ember-bright); }
.wr-name { grid-area: name; font-family: var(--font-display); font-size: 13.5px; letter-spacing: 1px; }
.wr-meta { grid-area: meta; display: flex; gap: 6px; align-items: center; }
.wr-city { font-size: 10px; color: var(--gold-bright); border: 1px solid var(--gold-line); border-radius: var(--radius-full); padding: 0 6px; }
.wr-lv { font-size: 10.5px; color: var(--text-muted); }
.wr-dist { grid-area: dist; font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }
.wr-terrain { font-size: 10px; color: var(--text-soft); border: 1px solid var(--border-soft); border-radius: var(--radius-full); padding: 0 6px; }
/* 当前载具去不了的地方:淡出提示 */
.world-row.is-unreachable { opacity: 0.45; cursor: not-allowed; }
.wm-marker.is-unreachable .wm-dot { background: rgba(120, 90, 50, 0.4); box-shadow: none; }
.wm-marker.is-unreachable .wm-label { color: rgba(80, 55, 25, 0.45); }

/* ============================================================
   旅途(实时行进)
   ============================================================ */
.view-travel.is-active { display: flex; align-items: center; justify-content: center; }
.travel-card {
  width: min(560px, 100%);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--border); border-radius: var(--radius-card);
  padding: var(--sp-24); text-align: center; box-shadow: var(--shadow-md);
}
.travel-eyebrow { font-size: 11px; letter-spacing: 6px; color: var(--text-muted); margin: 0 0 var(--sp-12); }
.travel-route { display: flex; align-items: center; justify-content: center; gap: var(--sp-12); margin-bottom: var(--sp-16); }
.travel-stop { font-family: var(--font-display); font-size: 17px; letter-spacing: 2px; }
#travel-to { color: var(--gold-bright); }
.travel-arrow { color: var(--text-faint); }
.travel-track {
  position: relative; height: 10px; border-radius: var(--radius-full);
  background: var(--surface-muted); overflow: hidden; border: 1px solid var(--border-soft);
}
#travel-bar {
  display: block; height: 100%; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
  box-shadow: 0 0 12px var(--gold-line);
  transition: width 0.25s linear;
}
.travel-remain { font-family: var(--font-mono); font-size: 12.5px; color: var(--text-soft); margin: var(--sp-12) 0 4px; }
.travel-note { font-size: 11.5px; color: var(--text-muted); margin: 0; }
/* 旅途提示:每 13 秒换一条 */
.travel-tip {
  margin: var(--sp-12) 0 0;
  padding: 8px 12px;
  font-size: 12.5px;
  line-height: 1.7;
  text-align: left;
  color: var(--gold-bright);
  background: var(--gold-soft);
  border-left: 2px solid var(--gold);
  border-radius: var(--radius);
}
.travel-tip:empty { display: none; }
.travel-tip::before { content: '提示 · '; font-size: 11px; letter-spacing: 1px; color: var(--text-muted); }
.travel-tip.is-fresh { animation: tipIn 0.5s var(--ease) both; }
@keyframes tipIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.travel-log { display: flex; flex-direction: column; gap: 4px; margin-top: var(--sp-12); }
.tl-line {
  font-size: 12px; color: var(--text-soft); font-family: var(--font-display);
  border-left: 2px solid var(--border-soft); padding-left: var(--sp-8); text-align: left;
}
/* 休息:与旅途同一界面,改用安眠的绿色调 */
.travel-card.is-rest .travel-eyebrow { color: var(--success); }
.travel-card.is-rest #travel-to { color: var(--success); }
.travel-card.is-rest #travel-bar {
  background: linear-gradient(90deg, var(--success), #8fd0a0);
  box-shadow: 0 0 12px rgba(111, 184, 122, 0.5);
}

/* ============================================================
   地区地图 · 左下角人物形象
   ============================================================ */
.map-bottom { display: flex; align-items: flex-end; gap: var(--sp-16); margin-top: var(--sp-4); }
.map-actions { flex: 1 1 auto; justify-content: flex-end; }
.map-portrait {
  flex: 0 0 auto;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: var(--sp-8) var(--sp-8) var(--sp-8);
  background: linear-gradient(180deg, rgba(20, 26, 37, 0.94), rgba(9, 12, 18, 0.96));
  border: 1px solid var(--border); border-radius: var(--radius-card);
  box-shadow: var(--shadow-sm);
}
.scene-canvas-map { width: 96px; height: 128px; display: block; }
.map-portrait-name {
  font-family: var(--font-display); font-size: 11px; letter-spacing: 1px;
  color: var(--gold-bright); text-align: center;
}

/* ============================================================
   市场 / 密市
   ============================================================ */
.market-stall-head {
  display: flex; align-items: baseline; gap: var(--sp-8);
  margin-top: var(--sp-8); padding-bottom: 4px;
  border-bottom: 1px solid var(--border-soft);
}
.market-stall-head .stall-icon { font-size: 16px; }
.market-stall-head .stall-name { font-family: var(--font-display); font-size: 13.5px; color: var(--gold-bright); letter-spacing: 1px; }
.market-stall-head .stall-title { font-size: 11px; color: var(--text-faint); }
.market-venue-note {
  font-size: 12px; line-height: 1.7; color: var(--text-soft);
  background: var(--surface-2); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: var(--sp-8) var(--sp-12);
}
.item-rare {
  font-size: 10.5px; font-weight: 600;
  color: #e8cd6e; border: 1px solid rgba(232, 205, 110, 0.5);
  border-radius: var(--radius-full); padding: 0 6px;
}
.item-row.is-rare { border-color: rgba(232, 205, 110, 0.45); box-shadow: inset 0 0 22px rgba(232, 205, 110, 0.08); }
.res-chip.is-token { color: var(--gold-bright); border-color: rgba(232, 205, 110, 0.35); }

/* ============================================================
   NPC 对话 / 新手引导
   ============================================================ */
.npc-panel { max-width: 520px; }
.npc-dialog-title { letter-spacing: 4px; }
.npc-who { display: flex; align-items: baseline; gap: var(--sp-8); padding: 0 var(--sp-4) var(--sp-8); border-bottom: 1px solid var(--border-soft); }
.npc-dialog-name { font-family: var(--font-display); font-size: 17px; letter-spacing: 2px; color: var(--gold-bright); }
.npc-dialog-tag { font-size: 11px; color: var(--text-muted); }
.npc-lines {
  display: flex; flex-direction: column; gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-4); max-height: 46vh; overflow-y: auto;
}
.npc-line {
  margin: 0; font-family: var(--font-display); font-size: 14px; line-height: 1.9;
  color: var(--text); background: var(--surface-muted); border-left: 3px solid var(--gold-line);
  border-radius: var(--radius); padding: var(--sp-8) var(--sp-12);
}
.npc-said-player {
  margin: 0; align-self: flex-end; max-width: 88%;
  font-family: var(--font-display); font-size: 13px; line-height: 1.8;
  color: var(--arcane-bright); background: var(--arcane-soft);
  border-right: 3px solid var(--arcane); border-radius: var(--radius);
  padding: var(--sp-8) var(--sp-12); text-align: right;
}
.npc-hint { margin: 0; font-size: 12px; color: var(--text-faint); padding: 0 var(--sp-4); }
.npc-topics { display: flex; flex-wrap: wrap; gap: var(--sp-8); padding: var(--sp-8) var(--sp-4) 0; }
.npc-topic {
  font-family: var(--font-display); font-size: 12.5px; letter-spacing: 1px;
  color: var(--text-soft); background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: var(--radius-full);
  padding: 7px var(--sp-12); cursor: pointer;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.npc-topic:hover { color: var(--gold-bright); border-color: var(--gold-line); background: var(--gold-soft); }
.npc-topics:empty { display: none; }
/* 支线任务按钮(NPC 对话触发) */
.npc-quest-text { flex-basis: 100%; margin: 0; font-size: 12.5px; color: var(--gold-bright); letter-spacing: 0.5px; }
.npc-quest-btn { color: var(--gold-bright); border-color: var(--gold-line); background: var(--gold-soft); font-weight: 600; }
.npc-quest-btn:hover { color: #fff; background: var(--gold-line); border-color: var(--gold-line); }
.npc-quest-done { flex-basis: 100%; margin: 0; font-size: 12px; color: var(--text-faint); letter-spacing: 0.5px; }
.stop-chest { margin-left: 6px; font-size: 11px; opacity: 0.9; }
.stop-chest.is-opened { opacity: 0.5; }

/* ============================================================
   宝箱(密码开箱)
   ============================================================ */
.chest-panel { max-width: 460px; }
.chest-name {
  margin: 0 0 var(--sp-4); font-family: var(--font-display); font-size: 17px;
  letter-spacing: 2px; color: var(--gold-bright); text-align: center;
}
.chest-hint { margin: 0 0 var(--sp-16); font-size: 12.5px; line-height: 1.9; color: var(--text-soft); }
.chest-code { display: flex; flex-direction: column; align-items: center; gap: var(--sp-8); }
.chest-code label { font-size: 11px; letter-spacing: 3px; color: var(--text-muted); }
.chest-input {
  width: 150px; padding: 10px 0; text-align: center;
  font-family: var(--font-mono); font-size: 26px; letter-spacing: 12px;
  color: var(--gold-bright); background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: var(--radius);
  outline: none; transition: border-color 0.18s var(--ease);
}
.chest-input:focus { border-color: var(--gold-line); box-shadow: 0 0 0 2px var(--gold-soft); }
.chest-input:disabled { opacity: 0.5; }

/* 记忆之书 · 剧情简介弹窗 */
.summary-panel { max-width: 520px; }
.summary-chapter {
  margin: 0 0 var(--sp-8); font-family: var(--font-display); font-size: 16px;
  letter-spacing: 2px; color: var(--gold-bright); text-align: center;
}
.summary-text {
  margin: 0 0 var(--sp-16); font-size: 13px; line-height: 2; color: var(--text);
  text-indent: 2em;
}
.summary-rewards {
  margin: 0 0 var(--sp-16); padding: var(--sp-12);
  background: var(--surface-muted); border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 12.5px; line-height: 1.9; color: var(--text-soft);
}
.summary-rewards-label { color: var(--gold-bright); margin-right: var(--sp-8); }

/* ============================================================
   情报(已知宝箱密码与位置)
   ============================================================ */
.intel-panel { max-width: 520px; }
.intel-note { margin: 0 0 var(--sp-12); font-size: 12px; color: var(--text-muted); }
.intel-list { display: flex; flex-direction: column; gap: var(--sp-8); max-height: 46vh; overflow-y: auto; }
.intel-row {
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--surface-muted); padding: var(--sp-8) var(--sp-12);
}
.intel-row.is-opened { opacity: 0.6; }
/* 交谈得来的剧情线索 */
.intel-row.is-clue { border-color: var(--gold-line); background: rgba(201, 162, 39, 0.07); }
.intel-row.is-clue .intel-name { color: var(--gold-bright); }
.intel-row.is-clue .intel-place { line-height: 1.8; }
.intel-head { display: flex; align-items: baseline; gap: var(--sp-8); }
.intel-name { font-family: var(--font-display); font-size: 14px; letter-spacing: 1px; color: var(--text); }
.intel-chapter { font-size: 11px; color: var(--text-muted); }
.intel-state { margin-left: auto; font-size: 11px; color: var(--gold-bright); }
.intel-row.is-opened .intel-state { color: var(--text-faint); }
.intel-place { font-size: 12px; color: var(--text-soft); margin-top: 4px; }
.intel-code { font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); margin-top: 2px; }
.intel-code b { color: var(--gold-bright); font-size: 14px; letter-spacing: 3px; }
.tutorial-lead { font-family: var(--font-display); font-size: 14px; color: var(--gold-bright); margin: 0 0 var(--sp-12); }
.tutorial-steps { margin: 0 0 var(--sp-16); padding-left: 1.4em; display: flex; flex-direction: column; gap: var(--sp-12); }
.tutorial-steps li { font-size: 13px; line-height: 1.85; color: var(--text-soft); }
.tutorial-steps b { color: var(--gold-bright); font-weight: 600; }

@media (max-width: 760px) {
  .world-layout { grid-template-columns: 1fr; }
  .world-map { min-height: 260px; }
  .wm-label { font-size: 9px; }
}

/* 物品列表(商店 / 背包 / 打工共用) */
.shop-list, .bag-list, .job-list { display: flex; flex-direction: column; gap: var(--sp-8); }
.item-row {
  display: flex; align-items: center; gap: var(--sp-12);
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: var(--sp-8) var(--sp-12);
}
.item-icon { font-size: 22px; width: 34px; text-align: center; flex-shrink: 0; }
.item-body { flex: 1; min-width: 0; }
.item-name { font-size: 13.5px; color: var(--text); font-weight: 600; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.item-cat {
  font-size: 10.5px; color: var(--text-faint); font-weight: 400;
  border: 1px solid var(--border-soft); border-radius: var(--radius-full); padding: 0 6px;
}
/* 品级标签(武器 / 防具)与「超 130 级不可售」标记 */
.item-grade {
  font-size: 10.5px; font-weight: 600; letter-spacing: 1px;
  color: var(--grade, var(--text-faint));
  border: 1px solid var(--grade, var(--border-soft));
  border-radius: var(--radius-full); padding: 0 6px;
}
.item-locked {
  font-size: 10px; color: var(--danger);
  border: 1px solid rgba(226, 112, 90, 0.45);
  border-radius: var(--radius-full); padding: 0 5px;
}
.item-qty { font-family: var(--font-mono); font-size: 12px; color: var(--gold-bright); }
.item-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.item-actions { display: flex; align-items: center; gap: var(--sp-8); flex-shrink: 0; }
.item-price { font-family: var(--font-mono); font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.item-price.is-poor { color: var(--danger); }
.item-was { font-size: 11px; color: var(--text-faint); margin-left: 2px; }
.btn-sm { padding: 4px 12px; font-size: 12px; letter-spacing: 1px; }
.shop-section-title {
  font-family: var(--font-display); font-size: 12px; letter-spacing: 3px; color: var(--gold);
  margin-top: var(--sp-8); padding-bottom: 4px; border-bottom: 1px solid var(--border-soft);
}
.bag-empty { font-size: 12.5px; color: var(--text-faint); text-align: center; padding: var(--sp-12); }
.bag-equipped { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: var(--sp-8); margin-bottom: var(--sp-12); }
.equip-slot {
  display: flex; align-items: center; gap: var(--sp-8);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: var(--sp-8) var(--sp-12); font-size: 12.5px;
}
.equip-label { color: var(--text-muted); flex-shrink: 0; }
.equip-value { flex: 1; color: var(--text); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ============================================================
   交易:左右分块(左分类导航 / 右具体货物)
   ============================================================ */
.trade-layout {
  display: grid; grid-template-columns: 152px 1fr; gap: var(--sp-12);
  align-items: start;
}
.trade-nav {
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: var(--sp-8);
  max-height: 58vh; overflow-y: auto;
}
.trade-cat {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  font: inherit; font-size: 12.5px; text-align: left; cursor: pointer;
  color: var(--text-soft); background: transparent;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 7px 10px; letter-spacing: 1px;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.trade-cat:hover { color: var(--gold-bright); background: var(--gold-soft); }
.trade-cat.is-active { color: var(--gold-bright); background: var(--gold-soft); border-color: var(--gold-line); }
.trade-cat-count {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  border: 1px solid var(--border-soft); border-radius: var(--radius-full); padding: 0 6px;
}
.trade-goods { min-width: 0; }

/* 搜索框(商店 / 市场 / 商人 / 背包) */
.trade-search { margin-bottom: var(--sp-12); }
.trade-search-input {
  width: 100%; padding: 8px 12px; font: inherit; font-size: 12.5px;
  color: var(--text); background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--radius); outline: none;
}
.trade-search-input::placeholder { color: var(--text-faint); }
.trade-search-input:focus { border-color: var(--gold-line); box-shadow: inset 0 0 14px var(--gold-soft); }

/* 背包:搜索 + 分类栏 */
.bag-toolbar { display: flex; flex-direction: column; gap: var(--sp-8); margin-bottom: var(--sp-12); }
.bag-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.bag-filter {
  display: inline-flex; align-items: center; gap: 5px;
  font: inherit; font-size: 12px; letter-spacing: 1px; cursor: pointer;
  color: var(--text-soft); background: var(--surface-2);
  border: 1px solid var(--border-soft); border-radius: var(--radius-full);
  padding: 4px 10px;
  transition: color 0.16s var(--ease), background 0.16s var(--ease), border-color 0.16s var(--ease);
}
.bag-filter i { font-family: var(--font-mono); font-style: normal; font-size: 11px; color: var(--text-faint); }
.bag-filter:hover { color: var(--gold-bright); background: var(--gold-soft); }
.bag-filter.is-active { color: var(--gold-bright); background: var(--gold-soft); border-color: var(--gold-line); }
.bag-filter.is-active i { color: var(--gold-bright); }

/* 涨跌标记 */
.trend { font-size: 10.5px; margin-left: 4px; }
.trend.is-up { color: #e2705a; }
.trend.is-down { color: #5aa9e2; }
.trend.is-flat { color: var(--text-faint); }

/* 物品副信息 */
.item-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 2px; }

/* 玩家货架 */
.shelf-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--sp-8);
  background: var(--surface-2); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: var(--sp-8) var(--sp-12);
}
.shelf-count { font-family: var(--font-mono); font-size: 12.5px; color: var(--gold-bright); }
.shelf-hint { flex: 1; font-size: 11.5px; color: var(--text-muted); }
.shelf-price-input {
  width: 86px; padding: 5px 8px; font: inherit; font-size: 12px; text-align: right;
  color: var(--gold-bright); background: var(--surface-muted);
  border: 1px solid var(--border); border-radius: var(--radius); outline: none;
}
.shelf-price-input:focus { border-color: var(--gold-line); }

/* 铁匠铺 */
.forge-card {
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: var(--sp-12);
  display: flex; flex-direction: column; gap: var(--sp-8);
}
.forge-card.is-locked { opacity: 0.72; }
.forge-head { display: flex; align-items: center; gap: var(--sp-12); }
.forge-icon { font-size: 26px; width: 36px; text-align: center; flex-shrink: 0; }
.forge-title { flex: 1; min-width: 0; }
.forge-name { font-size: 14px; font-weight: 600; color: var(--text); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.forge-lock { font-size: 10.5px; color: var(--danger); border: 1px solid var(--danger); border-radius: var(--radius-full); padding: 0 6px; }
.forge-desc { font-size: 12px; color: var(--text-muted); line-height: 1.5; }
.forge-mats { display: flex; flex-wrap: wrap; gap: 6px; }
.forge-mat {
  font-size: 11.5px; padding: 2px 8px; border-radius: var(--radius-full);
  border: 1px solid var(--border-soft); background: var(--surface-muted); color: var(--text-soft);
}
.forge-mat.is-ok { color: #7ec98a; border-color: rgba(126, 201, 138, 0.4); }
.forge-mat.is-lack { color: var(--danger); border-color: rgba(226, 112, 90, 0.4); }
.forge-foot { display: flex; align-items: center; gap: var(--sp-8); }
.forge-req { flex: 1; font-size: 11.5px; color: var(--text-faint); }

/* 精益师 */
.jeweler-weapon.is-selected { border-color: var(--gold-line); box-shadow: inset 0 0 18px var(--gold-soft); }

/* 背包窗格 */
.bag-cap {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-8);
  margin-bottom: var(--sp-12); padding: var(--sp-8) var(--sp-12);
  background: var(--surface-2); border: 1px solid var(--border-soft); border-radius: var(--radius);
  font-size: 12.5px; color: var(--text-soft);
}
.bag-cap-text b { color: var(--gold-bright); font-family: var(--font-mono); }
.bag-cap-hint { font-size: 11.5px; color: var(--text-faint); }
.bag-list.bag-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(98px, 1fr)); gap: var(--sp-8);
}
.bag-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  position: relative; min-height: 118px;
  background: var(--surface); border: 1px solid var(--border-soft);
  border-radius: var(--radius); padding: var(--sp-8) 6px;
}
.bag-tile.is-empty { background: var(--surface-muted); border-style: dashed; opacity: 0.55; }
.bag-tile-icon { font-size: 26px; line-height: 1; }
.bag-tile-qty {
  position: absolute; top: 6px; right: 8px;
  font-family: var(--font-mono); font-size: 11px; color: var(--gold-bright);
}
.bag-tile-name {
  font-size: 11.5px; color: var(--text); text-align: center; line-height: 1.35;
  max-width: 100%; overflow: hidden; display: -webkit-box;
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.bag-tile-cat {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px;
  font-size: 10px; color: var(--text-faint);
}
.bag-tile-empty { color: var(--text-faint); font-size: 11px; margin: auto; }
.bag-tile-actions { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; margin-top: auto; }
.bag-tile-actions .btn-sm { padding: 2px 8px; font-size: 11px; letter-spacing: 0; }

@media (max-width: 620px) {
  .trade-layout { grid-template-columns: 1fr; }
  .trade-nav { flex-direction: row; flex-wrap: wrap; max-height: none; }
}

/* 战斗内药品条 */
.battle-items { display: flex; gap: var(--sp-8); justify-content: center; flex-wrap: wrap; min-height: 26px; }
.item-chip {
  font: inherit; font-size: 12px; cursor: pointer; color: var(--text-soft);
  background: var(--surface-muted); border: 1px solid var(--border-soft);
  border-radius: var(--radius-full); padding: 3px 12px;
  transition: border-color 0.16s, color 0.16s;
}
.item-chip:hover { border-color: var(--gold); color: var(--gold-bright); }
.battle-items-empty { font-size: 11px; color: var(--text-faint); }

/* 魔力条 / 卡牌魔力标记 */
.vital-bar.mp-bar > i { background: linear-gradient(90deg, var(--arcane), var(--arcane-bright)); }
.card-mp { position: absolute; top: 8px; left: 30px; font-family: var(--font-mono); font-size: 11px; color: var(--arcane-bright); }

/* ============================================================
   职业解锁 toast / 切换
   ============================================================ */
.career-toast {
  position: fixed;
  top: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(-40px);
  display: flex;
  align-items: center;
  gap: var(--sp-8);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
  border: 1px solid var(--gold);
  color: var(--gold-bright);
  padding: var(--sp-12) var(--sp-24);
  border-radius: var(--radius-full);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
  box-shadow: var(--shadow-md), var(--shadow-gold);
  z-index: 1000;
  opacity: 0;
  transition: opacity 0.35s, transform 0.35s var(--ease);
  pointer-events: none;
  white-space: nowrap;
}
.career-toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }

.switch-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  font-size: 12.5px;
  color: var(--text-soft);
  letter-spacing: 1px;
  padding: var(--sp-8);
  background: var(--surface-muted);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  margin-bottom: var(--sp-8);
}
.switch-none { text-align: center; color: var(--text-muted); font-size: 12px; padding: var(--sp-12); }
.career-grid-compact { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: var(--sp-8); margin-bottom: var(--sp-8); }
.career-grid-compact .career-card { padding: var(--sp-12); }
.career-grid-compact .career-story { display: none; }
.switch-keep-btn { margin-top: var(--sp-8); width: 100%; }

/* 剧情内职业选择提示条 */
.career-note {
  font-family: var(--font-display);
  font-size: 12.5px;
  color: var(--gold-bright);
  background: var(--gold-soft);
  border: 1px dashed var(--gold-line);
  border-radius: var(--radius);
  padding: var(--sp-8) var(--sp-12);
  margin-bottom: var(--sp-8);
  text-align: center;
  letter-spacing: 1px;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 760px) {
  .app { padding: var(--sp-8); gap: var(--sp-8); }
  .topbar { flex-wrap: wrap; gap: var(--sp-8); }
  .topbar-center { order: 3; width: 100%; }
  .menu-title { font-size: 34px; letter-spacing: 6px; }
  .narrative-box { padding: var(--sp-16); max-height: 96vh; }
  .narrative-text { font-size: 15px; line-height: 1.95; }
  .career-grid { grid-template-columns: 1fr; }
  .entity-card { min-width: 150px; padding: var(--sp-8) var(--sp-12); }
  .card { width: 112px; }
  .reward-grid .card { width: 130px; }
}
@media (max-width: 460px) {
  .menu-title { font-size: 28px; }
  .menu-synopsis p { font-size: 13px; }
  .chapter-select { grid-template-columns: 1fr; }
  .hand { min-height: 140px; }
  .card { width: 100px; }
}

/* ===== 打工(小游戏) ===== */
.job-list { display: flex; flex-direction: column; gap: var(--sp-12); }
.job-card {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-12) var(--sp-16);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
}
.job-head { display: flex; align-items: flex-start; gap: var(--sp-12); }
.job-icon { font-size: 24px; line-height: 1.2; }
.job-title { flex: 1; min-width: 0; }
.job-name { font-weight: 700; letter-spacing: 1px; color: var(--text); }
.job-desc { margin-top: 2px; font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.job-mode {
  flex: none;
  padding: 2px 10px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold-bright);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-full);
  white-space: nowrap;
}
.job-tiers { display: flex; flex-direction: column; gap: 6px; }
.job-tier {
  display: grid;
  grid-template-columns: 48px 1fr auto auto;
  align-items: center;
  gap: var(--sp-8);
  padding: 6px 10px;
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.job-tier-label { font-size: 12px; letter-spacing: 1px; color: var(--gold-bright); }
.job-tier-goal { font-size: 12px; color: var(--text-soft); }
.job-tier-pay { font-size: 12px; color: var(--text-soft); white-space: nowrap; }
.job-tier-pay.is-poor { color: var(--ember-bright); }

/* 打工小游戏弹窗 */
.mg-panel { width: min(780px, calc(100vw - 24px)); }
.mg-body { gap: var(--sp-12); }
.mg-sub { font-size: 12px; letter-spacing: 1px; color: var(--text-soft); }
.mg-hud { display: flex; align-items: center; gap: var(--sp-16); font-size: 13px; color: var(--text); }
.mg-goal { flex: 1; }
.mg-time { color: var(--text-soft); }
.mg-lives { color: var(--ember-bright); letter-spacing: 3px; }
.mg-stage {
  position: relative;
  overflow: hidden;
  background: #0b1020;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
}
.mg-canvas { display: block; width: 100%; height: auto; touch-action: none; }
.mg-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-8);
  padding: var(--sp-16);
  text-align: center;
  background: rgba(5, 6, 10, 0.74);
  color: var(--text);
}
.mg-overlay[hidden] { display: none; }
.mg-overlay b { font-family: var(--font-display); font-size: 20px; letter-spacing: 3px; color: var(--gold-bright); }
.mg-overlay b.is-lose { color: var(--ember-bright); }
.mg-overlay span { font-size: 13px; line-height: 1.7; color: var(--text-soft); }

/* 降低动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.05ms !important; }
}

/* 窄屏:打工难度行改为换行排布 */
@media (max-width: 560px) {
  .job-tier { display: flex; flex-wrap: wrap; }
  .job-tier-goal { flex: 1 1 100%; order: 3; font-size: 11px; }
  .job-tier .btn { margin-left: auto; }
}

/* ============================================================
   右下角功能坞(邮箱 / 兑换码,圆形图标,右对齐)
   ============================================================ */
.dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  pointer-events: none;   /* 仅按钮本身可点,避免整块遮挡界面 */
}
.dock-btn {
  pointer-events: auto;
  position: relative;
  width: 48px; height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  border: 1px solid var(--gold-line);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
  box-shadow: var(--shadow-md), var(--shadow-gold);
  color: var(--gold-bright);
  cursor: pointer;
  transition: transform 0.18s var(--ease), border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.dock-btn:hover { transform: translateY(-2px) scale(1.05); border-color: var(--gold); box-shadow: var(--shadow-md), 0 0 20px rgba(201, 162, 39, 0.4); }
.dock-btn:active { transform: translateY(0) scale(0.97); }
.dock-icon { font-size: 22px; line-height: 1; }
.dock-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 18px; height: 18px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: #1a1206;
  background: var(--ember-bright);
  border: 1px solid var(--bg-deep);
  border-radius: var(--radius-full);
  box-shadow: 0 0 8px rgba(255, 106, 69, 0.6);
}
.dock-badge[hidden] { display: none; }

/* 左下角功能坞:回忆 / 衣橱(圆形图标,左对齐) */
.dock-left {
  right: auto;
  left: 18px;
  align-items: flex-start;
}

/* ============================================================
   回忆 · 剧情回顾
   ============================================================ */
.memorial-note { font-size: 12px; color: var(--text-muted); text-align: center; }
.memorial-list { display: flex; flex-direction: column; gap: var(--sp-12); }
.memorial-empty { text-align: center; color: var(--text-muted); padding: var(--sp-16) 0; }
.memorial-card {
  padding: var(--sp-12);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
}
.memorial-card.is-locked { opacity: 0.55; border-style: dashed; }
.memorial-card.is-current { border-color: var(--gold); }
.memorial-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-8);
  margin-bottom: 6px;
}
.memorial-no { font-size: 12px; color: var(--gold); letter-spacing: 0.06em; white-space: nowrap; }
.memorial-title { font-weight: 700; color: var(--text); }
.memorial-state {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}
.memorial-state.is-current { color: var(--gold-bright); }
.memorial-body { font-size: 13px; line-height: 1.8; color: var(--text); white-space: pre-wrap; }
.memorial-card.is-locked .memorial-body { font-style: italic; }

/* ============================================================
   衣橱 · 更换时装
   ============================================================ */
.wardrobe-note { font-size: 12px; color: var(--text-muted); text-align: center; line-height: 1.7; }
.wardrobe-layout {
  display: flex;
  gap: var(--sp-16);
  align-items: flex-start;
  margin-top: var(--sp-12);
}
.wardrobe-side {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--sp-8);
  padding: var(--sp-12);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
}
.wardrobe-look { font-size: 12px; color: var(--text-muted); }
.wardrobe-slots {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  max-height: 52vh;
  overflow-y: auto;
  padding-right: var(--sp-4);
}
.wardrobe-slot {
  padding: var(--sp-8) var(--sp-12);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
}
.wardrobe-slot-head {
  display: flex;
  align-items: baseline;
  gap: var(--sp-8);
  margin-bottom: var(--sp-8);
}
.wardrobe-slot-name { font-weight: 700; font-size: 13px; color: var(--gold); white-space: nowrap; }
.wardrobe-slot-cur { font-size: 12px; color: var(--text-muted); margin-left: auto; }
.wardrobe-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wardrobe-opt {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--text);
  background: var(--bg-soft);
  border: 1px solid var(--gold-line);
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.15s var(--ease), color 0.15s var(--ease);
}
.wardrobe-opt:hover { border-color: var(--gold); color: var(--gold-bright); }
.wardrobe-opt.is-active {
  border-color: var(--gold);
  color: var(--gold-bright);
  box-shadow: var(--shadow-gold);
}
.wardrobe-opt-icon { line-height: 1; }
.wardrobe-opt-text { max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media (max-width: 720px) {
  .wardrobe-layout { flex-direction: column; align-items: stretch; }
  .wardrobe-side { flex-direction: row; justify-content: center; }
  .wardrobe-slots { max-height: 44vh; }
  .wardrobe-opt-text { max-width: 110px; }
}

/* ============================================================
   设置 · 音量 / 注销
   ============================================================ */
.settings-group {
  display: flex;
  flex-direction: column;
  gap: var(--sp-12);
  padding: var(--sp-12) var(--sp-16);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--surface-2), var(--bg-soft));
}
.settings-group.is-danger { border-color: rgba(208, 64, 43, 0.5); }
.settings-group-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 3px;
  color: var(--gold);
  padding-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-soft);
}
.settings-group.is-danger .settings-group-title { color: var(--ember-bright); border-bottom-color: rgba(208, 64, 43, 0.35); }
.settings-row { display: flex; align-items: center; gap: var(--sp-12); }
.settings-icon { font-size: 18px; color: var(--gold-bright); line-height: 1; }
.settings-volume {
  flex: 1 1 auto;
  min-width: 0;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: var(--surface-muted);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}
.settings-volume::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
  cursor: pointer;
}
.settings-volume::-moz-range-thumb {
  width: 18px; height: 18px;
  border-radius: var(--radius-full);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: 1px solid var(--bg-deep);
  box-shadow: 0 0 10px rgba(201, 162, 39, 0.5);
  cursor: pointer;
}
.settings-volume:focus-visible { box-shadow: 0 0 0 2px var(--gold-soft); }
.settings-volume-val {
  flex: none;
  min-width: 46px;
  text-align: right;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--gold-bright);
}
.settings-hint { font-size: 12px; line-height: 1.7; color: var(--text-muted); }
.settings-danger-text { font-size: 12.5px; line-height: 1.85; color: var(--text-soft); }
.settings-danger-text b { color: var(--ember-bright); }
.settings-confirm {
  display: flex;
  flex-direction: column;
  gap: var(--sp-8);
  padding: var(--sp-12);
  border: 1px dashed rgba(208, 64, 43, 0.5);
  border-radius: var(--radius);
  background: var(--ember-soft);
}
.settings-confirm[hidden] { display: none; }
.settings-confirm-text { font-size: 12.5px; line-height: 1.7; color: var(--ember-bright); text-align: center; }

/* ============================================================
   邮箱
   ============================================================ */
.mail-note { font-size: 12px; color: var(--text-muted); text-align: center; }
.mail-list { display: flex; flex-direction: column; gap: var(--sp-12); }
.mail-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: var(--sp-12) var(--sp-16);
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
}
.mail-card.is-claimed { opacity: 0.72; }
.mail-head { display: flex; align-items: center; gap: var(--sp-8); }
.mail-from { font-size: 12px; color: var(--gold-bright); letter-spacing: 1px; }
.mail-no {
  margin-left: auto;
  flex: none;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--text-faint);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  padding: 1px 8px;
}
.mail-title { font-family: var(--font-display); font-size: 15px; color: var(--text); letter-spacing: 1px; }
.mail-body { font-size: 12.5px; line-height: 1.8; color: var(--text-soft); white-space: pre-wrap; }
.mail-foot { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-12); margin-top: 2px; }
.mail-reward { font-size: 12px; color: var(--gold-bright); }
.mail-state { font-size: 12px; color: var(--text-faint); letter-spacing: 1px; }
.mail-empty { text-align: center; color: var(--text-muted); font-size: 12px; padding: var(--sp-16); }

/* ============================================================
   兑换码
   ============================================================ */
.redeem-lead { font-size: 12.5px; line-height: 1.8; color: var(--text-soft); }
.redeem-form { display: flex; gap: var(--sp-8); }
.redeem-input {
  flex: 1;
  min-width: 0;
  padding: 10px var(--sp-12);
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: 2px;
  text-transform: uppercase;
}
.redeem-input::placeholder { color: var(--text-faint); letter-spacing: 1px; text-transform: none; }
.redeem-input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.redeem-msg { min-height: 18px; font-size: 12.5px; letter-spacing: 1px; color: var(--text-muted); }
.redeem-msg.is-ok { color: var(--success); }
.redeem-msg.is-bad { color: var(--ember-bright); }

@media (max-width: 760px) {
  .dock { right: 10px; bottom: 10px; gap: 8px; }
  .dock-left { right: auto; left: 10px; bottom: 10px; gap: 8px; }
  .dock-btn { width: 42px; height: 42px; }
  .dock-icon { font-size: 19px; }
}

/* ============================================================
   游戏前 · 年龄限制与内容警告门(每次打开都需通过;需真人验证)
   ============================================================ */
.agegate {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--sp-24);
  overflow-y: auto;
  background:
    radial-gradient(120% 80% at 50% 0%, rgba(208, 64, 43, 0.14), transparent 60%),
    radial-gradient(120% 90% at 50% 100%, rgba(201, 162, 39, 0.10), transparent 62%),
    rgba(4, 5, 9, 0.94);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.3s var(--ease) both;
}
.agegate[hidden] { display: none; }
.agegate.is-leaving { animation: fadeOut 0.45s var(--ease) both; }
@keyframes fadeOut { to { opacity: 0; } }

/* 门未通过期间:锁住背景滚动,并屏蔽游戏内的指针操作 */
body.is-gated { overflow: hidden; }
body.is-gated #app { pointer-events: none; user-select: none; }

.agegate-panel {
  position: relative;
  width: min(560px, 100%);
  margin: auto;
  display: flex;
  flex-direction: column;
  gap: var(--sp-16);
  padding: var(--sp-32) var(--sp-24);
  background: linear-gradient(180deg, var(--surface), var(--bg-soft));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md), var(--shadow-gold);
  animation: cardReveal 0.4s var(--ease) both;
}
.agegate-badge {
  align-self: center;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 4px 16px;
  border: 2px solid var(--ember);
  border-radius: var(--radius);
  color: var(--ember-bright);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 2px;
  box-shadow: 0 0 22px var(--ember-soft);
}
.agegate-badge span { font-size: 15px; }
.agegate-title {
  text-align: center;
  font-family: var(--font-display);
  font-size: 20px;
  letter-spacing: 4px;
  color: var(--gold-bright);
}
.agegate-lead { font-size: 13px; line-height: 1.9; color: var(--text-soft); }
.agegate-lead b { color: var(--ember-bright); }
.agegate-sub {
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--text-muted);
  margin-bottom: var(--sp-8);
}
.agegate-list { display: flex; flex-direction: column; gap: 6px; }
.agegate-list li {
  position: relative;
  padding-left: 16px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--text-soft);
}
.agegate-list li::before { content: "▸"; position: absolute; left: 0; color: var(--gold); }
.agegate-list b { color: var(--text); }

.agegate-claims { display: flex; flex-direction: column; gap: var(--sp-8); }
.agegate-claim {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px var(--sp-12);
  background: var(--bg-soft);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.agegate-claim:hover { border-color: var(--gold-line); }
.agegate-claim:has(input:checked) { border-color: var(--gold); background: var(--gold-soft); }
.agegate-claim input { flex: none; width: 15px; height: 15px; margin-top: 2px; accent-color: var(--gold); }
.agegate-claim b { color: var(--text); }

.agegate-human { display: flex; flex-direction: column; gap: var(--sp-8); }
.agegate-human-tip { font-size: 12px; letter-spacing: 1px; color: var(--text-muted); }
.agegate-hold {
  position: relative;
  overflow: hidden;
  height: 46px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  color: var(--text-soft);
  font: 600 14px var(--font-sans);
  letter-spacing: 2px;
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.agegate-hold-fill {
  position: absolute;
  inset: 0;
  transform: scaleX(0);
  transform-origin: left center;
  background: linear-gradient(90deg, var(--gold-soft), var(--gold));
  opacity: 0.55;
}
.agegate-hold.is-holding { border-color: var(--gold); color: var(--gold-bright); }
.agegate-hold.is-verified { border-color: var(--success); color: var(--success); cursor: default; }
.agegate-hold.is-verified .agegate-hold-fill { background: var(--success); opacity: 0.22; }
.agegate-hold-label { position: relative; }

.agegate-enter { align-self: stretch; }
.agegate-foot { min-height: 18px; font-size: 12px; line-height: 1.7; text-align: center; color: var(--text-muted); }
.agegate-foot.is-ok { color: var(--success); }

@media (max-width: 760px) {
  .agegate { padding: var(--sp-12); }
  .agegate-panel { padding: var(--sp-20) var(--sp-16); gap: var(--sp-12); }
  .agegate-title { font-size: 18px; letter-spacing: 2px; }
}

/* 门未通过时,右下角功能坞也一并封锁(关于入口在门内) */
body.is-gated #dock { pointer-events: none; }

/* ============================================================
   关于 · 条款与声明(分节文档)
   ============================================================ */
.about { z-index: 2200; } /* 需高于年龄门(2000),以便在门前也能查阅 */
.modal-panel-wide {
  width: min(880px, calc(100vw - 32px));
  height: min(84vh, 760px);
  max-height: min(84vh, 760px);
}
.about-body {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 208px 1fr;
  gap: var(--sp-20);
  padding: var(--sp-20);
  overflow: hidden;
}

.about-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
  padding-right: 4px;
  border-right: 1px solid var(--border-soft);
}
.about-nav-btn {
  display: flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 10px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: var(--text-soft);
  font: 500 12.5px var(--font-sans);
  text-align: left;
  cursor: pointer;
  transition: background 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease);
}
.about-nav-btn:hover { background: var(--bg-soft); color: var(--text); }
.about-nav-btn.is-active { background: var(--gold-soft); border-color: var(--gold-line); color: var(--gold-bright); }
.about-nav-no { flex: none; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 1px; color: var(--text-faint); }
.about-nav-btn.is-active .about-nav-no { color: var(--gold); }
.about-nav-title { flex: 1; min-width: 0; }

.about-main { min-height: 0; overflow-y: auto; padding-right: 4px; }
.about-doc-title {
  margin-bottom: var(--sp-12);
  font-family: var(--font-display);
  font-size: 16px;
  letter-spacing: 2px;
  color: var(--gold-bright);
}
.about-sub {
  margin: var(--sp-16) 0 var(--sp-8);
  font-family: var(--font-display);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--text);
}
.about-doc .about-sub:first-child { margin-top: 0; }
.about-p { font-size: 12.5px; line-height: 1.95; color: var(--text-soft); }
.about-p + .about-p { margin-top: 6px; }
.about-list { display: flex; flex-direction: column; gap: 5px; margin: 4px 0; }
.about-list li {
  position: relative;
  padding-left: 15px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--text-soft);
}
.about-list li::before { content: "▸"; position: absolute; left: 0; color: var(--gold); }
.about-updated {
  margin-top: var(--sp-20);
  padding-top: var(--sp-12);
  border-top: 1px solid var(--border-soft);
  font-size: 11.5px;
  letter-spacing: 1px;
  color: var(--text-faint);
}

/* 年龄门上的文档入口 */
.agegate-link {
  align-self: center;
  padding: 2px 6px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font: 400 12px var(--font-sans);
  letter-spacing: 1px;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.16s var(--ease);
}
.agegate-link:hover { color: var(--gold-bright); }

/* 进入前必读清单 */
.agegate-reads { display: flex; flex-direction: column; gap: var(--sp-8); }
.agegate-reads-title { font-size: 12px; letter-spacing: 1px; color: var(--text-muted); }
.agegate-read-list { display: flex; flex-wrap: wrap; gap: 6px; }
.agegate-read-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-full);
  font-size: 12px;
  color: var(--text-muted);
}
.agegate-read-item::before { content: "○"; font-size: 10px; color: var(--text-faint); }
.agegate-read-item.is-done { border-color: var(--success); color: var(--success); }
.agegate-read-item.is-done::before { content: "✓"; color: var(--success); }

@media (max-width: 760px) {
  .modal-panel-wide { width: calc(100vw - 20px); height: min(88vh, 760px); max-height: min(88vh, 760px); }
  .about-body {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    gap: var(--sp-12);
    padding: var(--sp-12);
  }
  .about-nav {
    flex-direction: row;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 8px;
    border-right: none;
    border-bottom: 1px solid var(--border-soft);
  }
  .about-nav-btn { flex: none; white-space: nowrap; }
}

/* ============================================================
   主页面 · 任务窗格(至多三项)
   ============================================================ */
.map-tasks-wrap { margin-top: var(--sp-12); }
.map-tasks-title {
  font-family: var(--font-display);
  font-size: 12px;
  letter-spacing: 3px;
  color: var(--gold);
  padding-bottom: 6px;
  margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-soft);
}
.map-tasks { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--sp-8); }
.map-task {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: var(--sp-8) var(--sp-12);
  background: linear-gradient(180deg, rgba(24, 30, 42, 0.9), rgba(12, 16, 23, 0.92));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
}
.map-task.is-empty { color: var(--text-faint); font-size: 12px; justify-content: center; }
.map-task-dot {
  flex: 0 0 auto;
  width: 7px; height: 7px; margin-top: 5px;
  border-radius: var(--radius-full);
  background: var(--gold-bright);
  box-shadow: 0 0 6px var(--ember);
}
.map-task-body { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.map-task-body b { font-family: var(--font-display); font-size: 12.5px; color: var(--gold-bright); letter-spacing: 1px; }
.map-task-body i { font-style: normal; font-size: 11.5px; color: var(--text-muted); }
.map-task-tag {
  flex: 0 0 auto;
  align-self: center;
  font-size: 10.5px;
  padding: 1px 7px;
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-full);
  color: var(--gold);
}
.map-portrait { cursor: pointer; transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
.map-portrait:hover { border-color: var(--gold-line); transform: translateY(-2px); }
.map-portrait-hint { font-size: 10px; color: var(--text-faint); letter-spacing: 1px; }
.scene-character[data-char-open] { cursor: pointer; }

/* ============================================================
   角色弹窗(形象居中 · 七格防具环绕 · 服饰 / 职业 / 形象)
   ============================================================ */
.charsheet { z-index: 1600; }
.charsheet-panel { width: min(940px, calc(100vw - 32px)); }
.charsheet-body {
  flex: 1; min-height: 0;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: var(--sp-20);
  padding: var(--sp-20);
  overflow-y: auto;
}
.cs-stage {
  display: grid;
  grid-template-columns: minmax(92px, 1fr) minmax(150px, 1.5fr) minmax(92px, 1fr);
  grid-template-areas:
    "head  head   head"
    "hands figure earring"
    "body  figure legs"
    "ring  figure feet";
  gap: var(--sp-8);
  align-items: center;
}
.cs-area-head { grid-area: head; }
.cs-area-hands { grid-area: hands; }
.cs-area-ring { grid-area: ring; }
.cs-area-earring { grid-area: earring; }
.cs-area-body { grid-area: body; }
.cs-area-legs { grid-area: legs; }
.cs-area-feet { grid-area: feet; }
.cs-figure {
  grid-area: figure;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--sp-8);
}
.cs-frame {
  padding: 6px;
  background: radial-gradient(circle at 50% 30%, rgba(60, 70, 92, 0.5), rgba(10, 13, 19, 0.9));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  box-shadow: inset 0 0 24px rgba(0, 0, 0, 0.55);
}
.cs-canvas { width: 180px; height: 240px; display: block; }
.cs-name { font-family: var(--font-display); font-size: 15px; color: var(--gold-bright); letter-spacing: 2px; }
.cs-sub { font-size: 11.5px; color: var(--text-muted); }

.cs-slot {
  padding: var(--sp-8) var(--sp-12);
  background: linear-gradient(180deg, rgba(24, 30, 42, 0.92), rgba(11, 14, 20, 0.94));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.cs-slot:hover { border-color: var(--gold-line); transform: translateY(-1px); }
.cs-slot.is-empty { opacity: 0.62; border-style: dashed; }
.cs-slot-label { font-size: 10.5px; color: var(--gold); letter-spacing: 2px; margin-bottom: 5px; }
.cs-slot-body { display: flex; align-items: center; gap: 8px; }
.cs-slot-icon { font-size: 20px; line-height: 1; }
.cs-slot-text { display: flex; flex-direction: column; min-width: 0; }
.cs-slot-text b { font-size: 12px; color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-slot-text i { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.cs-armor-note {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
}

.cs-side { display: flex; flex-direction: column; gap: var(--sp-12); min-width: 0; }
.cs-card {
  padding: var(--sp-12);
  background: linear-gradient(180deg, rgba(21, 26, 37, 0.86), rgba(10, 13, 19, 0.9));
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-card);
}
.cs-card-title {
  font-family: var(--font-display);
  font-size: 12.5px; letter-spacing: 3px; color: var(--gold);
  padding-bottom: 6px; margin-bottom: var(--sp-8);
  border-bottom: 1px solid var(--border-soft);
}
.cs-sub-label { font-size: 11px; color: var(--text-faint); letter-spacing: 1px; margin: var(--sp-8) 0 6px; }

/* 职业 */
.cs-career-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cs-career-job { font-family: var(--font-display); font-size: 14px; color: var(--gold-bright); letter-spacing: 1px; }
.cs-career-lv { font-size: 13px; color: var(--text); }
.cs-career-lv i { font-style: normal; font-size: 10.5px; color: var(--text-faint); }
.cs-career-rank { font-size: 12px; color: var(--ember-bright); margin-top: 3px; }
.cs-progress { height: 7px; margin: var(--sp-8) 0 4px; background: rgba(0, 0, 0, 0.45); border: 1px solid var(--border-soft); border-radius: var(--radius-full); overflow: hidden; }
.cs-progress > i { display: block; height: 100%; background: linear-gradient(90deg, var(--ember), var(--gold-bright)); }
.cs-career-exp { font-size: 11px; color: var(--text-muted); }
.cs-career-switch { display: flex; flex-wrap: wrap; gap: 6px; }
/* 各职业等级互不相通,按钮内标出各自的等级 */
.cs-career-btn i { font-style: normal; font-size: 10px; color: var(--text-faint); margin-left: 5px; }
.cs-career-btn.is-active i { color: var(--gold); }
.cs-career-btn {
  padding: 4px 12px; font-size: 12px; cursor: pointer;
  color: var(--text-muted); background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius-full);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.cs-career-btn:hover:not(:disabled) { color: var(--gold-bright); border-color: var(--gold-line); }
.cs-career-btn.is-active { color: var(--gold-bright); border-color: var(--gold-line); background: rgba(201, 162, 39, 0.12); }

/* 服饰 */
.cs-outfits { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.cs-outfit {
  display: flex; align-items: center; gap: 8px; text-align: left; cursor: pointer;
  padding: 7px 10px; color: var(--text);
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.18s var(--ease);
}
.cs-outfit:hover { border-color: var(--gold-line); }
.cs-outfit.is-empty { opacity: 0.62; border-style: dashed; }
.cs-outfit-icon { font-size: 17px; }
.cs-outfit-text { display: flex; flex-direction: column; min-width: 0; }
.cs-outfit-text i { font-style: normal; font-size: 10px; color: var(--text-faint); }
.cs-outfit-text b { font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 形象 / 肤色 / 改名 */
.cs-body-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.cs-look-btn {
  display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer;
  padding: 5px 2px; background: transparent;
  border: 1px solid var(--border); border-radius: var(--radius);
  color: var(--text-muted); font-size: 11px;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.cs-look-btn:hover:not(:disabled) { border-color: var(--gold-line); color: var(--gold-bright); }
.cs-look-btn.is-active { border-color: var(--ember); color: var(--gold-bright); background: rgba(201, 162, 39, 0.14); }
.cs-look-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cs-look-emoji { font-size: 16px; }
.cs-look-name { font-size: 10.5px; }
.cs-skin-row { display: flex; gap: 6px; }
.cs-skin-btn {
  width: 26px; height: 26px; cursor: pointer; padding: 0;
  background: var(--sw, #ccc);
  border: 2px solid var(--border); border-radius: var(--radius-full);
  transition: border-color 0.18s var(--ease), transform 0.18s var(--ease);
}
.cs-skin-btn:hover:not(:disabled) { transform: scale(1.08); }
.cs-skin-btn.is-active { border-color: var(--gold-bright); box-shadow: 0 0 0 2px rgba(201, 162, 39, 0.35); }
.cs-skin-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.cs-look-actions { margin-top: var(--sp-8); }
.cs-look-actions .btn { width: 100%; }
.cs-rename-row { display: flex; gap: 6px; }
.cs-rename-input {
  flex: 1 1 auto; min-width: 0;
  padding: 6px 10px; font-size: 12.5px; color: var(--text);
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.cs-rename-input:focus { outline: none; border-color: var(--gold-line); }
.cs-rename-row .btn { flex: 0 0 auto; }

/* 部位更换浮层 */
.cs-picker {
  padding: var(--sp-12);
  background: linear-gradient(180deg, rgba(28, 34, 48, 0.96), rgba(12, 15, 22, 0.98));
  border: 1px solid var(--gold-line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-md);
}
.cs-picker-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-8); font-size: 12px; color: var(--gold); letter-spacing: 1px; }
.cs-picker-close { background: transparent; border: none; color: var(--text-muted); cursor: pointer; font-size: 12px; }
.cs-picker-close:hover { color: var(--ember-bright); }
.cs-picker-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.cs-picker-item {
  display: flex; align-items: center; gap: 8px; cursor: pointer; text-align: left;
  padding: 6px 10px; color: var(--text);
  background: transparent; border: 1px solid var(--border-soft); border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.cs-picker-item:hover { border-color: var(--gold-line); background: rgba(201, 162, 39, 0.08); }
.cs-picker-item.is-active { border-color: var(--ember); }
.cs-picker-icon { font-size: 16px; }
.cs-picker-name { flex: 1 1 auto; font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-picker-meta { font-size: 11px; color: var(--text-faint); }
.cs-picker-empty { font-size: 11.5px; color: var(--text-faint); padding: 6px 2px; text-align: center; }
.cs-picker-unequip { margin-top: var(--sp-8); width: 100%; }

/* 宠物 */
.cs-pets { display: flex; flex-direction: column; gap: 6px; }
.cs-pet-grid { display: flex; flex-direction: column; gap: 5px; max-height: 190px; overflow-y: auto; }
.cs-pet {
  display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto;
  gap: 2px 8px; align-items: center; text-align: left; cursor: pointer;
  padding: 6px 10px; color: var(--text);
  background: transparent; border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 0.18s var(--ease);
}
.cs-pet:hover:not(:disabled) { border-color: var(--gold-line); }
.cs-pet.is-active { border-color: var(--ember); background: rgba(201, 162, 39, 0.12); }
.cs-pet-icon { grid-row: span 2; font-size: 20px; }
.cs-pet-text { display: flex; align-items: baseline; gap: 6px; }
.cs-pet-text b { font-size: 12px; font-weight: 600; }
.cs-pet-text i { font-style: normal; font-size: 10.5px; color: var(--gold); }
.cs-pet-skill { grid-column: 2; font-size: 10.5px; color: var(--text-faint); }
.cs-pet-rest { margin-top: var(--sp-8); width: 100%; }

/* 绝世商品标记 */
.item-tag-rare {
  margin-left: 6px; font-size: 10px; padding: 0 6px;
  color: #ffd76e; border: 1px solid #a8842a; border-radius: var(--radius-full);
  background: rgba(168, 132, 42, 0.18);
}

@media (max-width: 860px) {
  .charsheet-body { grid-template-columns: 1fr; }
  .cs-canvas { width: 144px; height: 192px; }
}
