:root {
  --paper: #f3eee1;
  --card: #fdfaf1;
  --ink: #2b2f2e;
  --ink-2: #7b7462;
  --line: #ddd2b9;
  --line-soft: #e9e1cd;
  --teal: #2f5d62;
  --teal-soft: #e6edeb;
  --cinnabar: #a8442a;
  --cinnabar-soft: #f8ece4;
  --gold: #93712c;
  --gold-soft: #f7efdc;
  --serif: "Songti SC", "STSong", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #e7e0cf;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.75;
}

#app {
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.topbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 8px 16px 6px;
}

.brand h1 {
  margin: 0;
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 600;
  letter-spacing: 4px;
}

.tag {
  display: inline-block;
  margin-top: 2px;
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--ink-2);
}

/* ---------- 顶部境界条 ---------- */

.status-strip { padding: 2px 16px 6px; }

/* 顶部只留境界+称号一行，进度条贴右边撑满剩余宽度 */
.strip-top {
  display: flex;
  align-items: center;
  gap: 8px;
}

.strip-top .progress {
  flex: 1 1 auto;
  margin: 0 0 0 4px;
  position: relative;
  height: 18px;
}
.progress-label {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-style: normal; font-weight: 600; letter-spacing: .5px;
  color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.7), 0 0 3px rgba(0,0,0,.5);
  white-space: nowrap; z-index: 1;
}

.realm-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 2px;
  white-space: nowrap;
}

.realm-title { font-size: 12px; color: var(--ink-2); }
.total-layers { font-size: 12px; color: var(--ink-2); }

.progress {
  height: 7px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
  margin: 8px 0 4px;
}

.progress > span {
  display: block;
  height: 100%;
  background: var(--teal);
  transition: width .25s ease;
}

.progress.qi-full > span { background: var(--gold); }

.strip-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-2);
}

/* ---------- 中央画面 ---------- */

.scene-frame {
  position: relative;
  margin: 0 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #f6f1e3;
}

.scene { display: block; }

.scene-frame.burst::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(233, 206, 138, .55);
  animation: burstFlash 1.1s ease-out forwards;
  pointer-events: none;
}

/* NPC 引路条已撤：主线提示统一去「任务」页看，顶部不再占一行 */
.mentor-bar { display: none !important; }

.mentor-bar b { color: var(--gold); font-weight: 600; }

/* ---------- 主交互区 ---------- */

#panel {
  max-height: 65vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--teal) var(--line-soft);
  scrollbar-gutter: stable;
}
#panel::-webkit-scrollbar { width: 10px; height: 10px; }
#panel::-webkit-scrollbar-track { background: var(--line-soft); border-radius: 4px; }
#panel::-webkit-scrollbar-thumb { background: var(--teal); border: 2px solid var(--line-soft); border-radius: 6px; }
#panel::-webkit-scrollbar-corner { background: var(--line-soft); }

h2 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 2px;
}

h3 {
  margin: 18px 0 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  letter-spacing: 1px;
}

.hint { margin: 0 0 12px; font-size: 12px; color: var(--ink-2); }

.btn {
  display: inline-block;
  border: 1px solid var(--teal);
  background: var(--teal);
  color: #fdfaf1;
  border-radius: 3px;
  padding: 9px 22px;
  font-size: 15px;
  font-family: inherit;
  letter-spacing: 2px;
  cursor: pointer;
  transition: opacity .15s ease;
}

.btn:hover { opacity: .88; }
.btn:disabled { opacity: .4; cursor: not-allowed; }

.btn-ghost {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink-2);
  border-radius: 3px;
  padding: 6px 12px;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
}

.btn-ghost:hover { border-color: var(--ink-2); color: var(--ink); }

.subj-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--ink-2);
}

.subj-cell {
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 9px;
  background: #fbf7ec;
}

.subj-cell.full {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}

.choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.choice {
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 3px;
  padding: 12px 14px;
  text-align: left;
  font-family: inherit;
  font-size: 15px;
  cursor: pointer;
  color: var(--ink);
}

.choice:hover { border-color: var(--teal); }
.choice.picked { border-color: var(--teal); background: var(--teal-soft); }

.choice .craft {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--ink-2);
}

.picked-line {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  border-radius: 3px;
  font-size: 14px;
}

.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }

.tab {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 3px;
  padding: 8px 6px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  text-align: center;
}

.tab-sub {
  display: block;
  font-size: 11px;
  margin-top: 2px;
  color: var(--ink-2);
}

.tab.active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }

.timer {
  height: 4px;
  background: var(--line-soft);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 12px;
}

.timer > span { display: block; height: 100%; background: var(--teal); }

.question-place {
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 6px;
}

.question { margin: 0 0 14px; font-size: 18px; font-weight: 500; line-height: 1.7; }

/* 题干里的填空位：题库原文写作「（ ）」，直接显示时括号里几乎看不见空，
   玩家不知道要填哪儿。统一渲染成一条明显的下划线。 */
.q-blank {
  display: inline-block;
  min-width: 2.6em;
  height: 1em;
  margin: 0 3px;
  vertical-align: baseline;
  border-bottom: 1.6px solid var(--ink-2);
  transform: translateY(1px);
}

.options { display: grid; gap: 9px; margin-bottom: 14px; }

.option {
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 3px;
  padding: 11px 14px;
  text-align: left;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  cursor: pointer;
}

.option:hover:not(:disabled) { border-color: var(--teal); }
.option:disabled { cursor: default; }
.option.correct { border-color: var(--teal); background: var(--teal-soft); }
.option.wrong { border-color: var(--cinnabar); background: var(--cinnabar-soft); }

.result {
  border-left: 3px solid var(--line);
  border-radius: 3px;
  padding: 12px 14px;
  font-size: 14px;
  margin-bottom: 14px;
  background: #faf5e9;
}

.result.perfect { border-left-color: var(--gold); background: var(--gold-soft); color: #6d5215; }
.result.normal { border-left-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.result.wrong { border-left-color: var(--cinnabar); background: var(--cinnabar-soft); color: var(--cinnabar); }

.result-meta { font-size: 12px; opacity: .85; }

.level-up {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid var(--cinnabar);
  border-radius: 3px;
  color: var(--cinnabar);
  background: #fdf6ef;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: 1px;
}

.missing-note { margin-top: 8px; font-size: 13px; color: var(--gold); }

.capped-note {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--gold-soft);
  border-left: 3px solid var(--gold);
  color: #6d5215;
  border-radius: 3px;
  font-size: 14px;
}

/* ---------- 洞府与剧情 ---------- */

.info-list { display: grid; gap: 10px; margin-top: 10px; }

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px dashed var(--line);
  padding-bottom: 8px;
  font-size: 14px;
}

.info-row span:first-child { color: var(--ink-2); }

.node-list { list-style: none; margin: 12px 0 0; padding: 0; }

.node-list li {
  position: relative;
  padding: 10px 0 10px 30px;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
}

.node-list li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fbf7ec;
}

.node-list li.done::before { background: var(--teal); border-color: var(--teal); }
.node-list li.doing::before { background: var(--gold); border-color: var(--gold); }

.node-list li .node-state {
  float: right;
  font-size: 12px;
  color: var(--ink-2);
}

.node-list li.doing { color: var(--gold); }

/* ---------- 底部功能按钮 ---------- */

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  background: var(--card);
  border-top: 1px solid var(--line);
  z-index: 10;
}

.nav-btn {
  border: none;
  border-top: 3px solid transparent;
  background: transparent;
  padding: 9px 0 11px;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--ink-2);
  cursor: pointer;
}

.nav-ico {
  display: block;
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 0;
  margin-bottom: 1px;
}

.nav-btn.active {
  color: var(--teal);
  border-top-color: var(--teal);
  font-weight: 600;
}

.footnote {
  margin-top: 22px;
  font-size: 11px;
  color: var(--ink-2);
  text-align: center;
  letter-spacing: 1px;
}

/* ---------- 剧情引导 ---------- */

.story-overlay {
  position: fixed;
  inset: 0;
  background: rgba(35, 40, 38, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 20;
}

.story-box {
  width: 100%;
  max-width: 440px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 26px 26px 20px;
}

.story-place {
  font-size: 11px;
  letter-spacing: 3px;
  color: var(--teal);
  border-bottom: 1px solid var(--line-soft);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

.story-speaker {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  color: var(--cinnabar);
  letter-spacing: 2px;
}

.story-speaker span {
  margin-left: 10px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: 1px;
}

.story-text { margin: 12px 0 22px; font-size: 17px; line-height: 2; }

.story-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line-soft);
  padding-top: 14px;
}

.story-step { font-size: 12px; color: var(--ink-2); letter-spacing: 2px; }

/* ---------- 动画 ---------- */

@media (prefers-reduced-motion: no-preference) {
  .scene .qi { animation: qiRise 3.8s linear infinite; opacity: 0; }
  .scene .q2 { animation-delay: .6s; }
  .scene .q3 { animation-delay: 1.2s; }
  .scene .q4 { animation-delay: 1.9s; }
  .scene .q5 { animation-delay: 2.5s; }
  .scene .q6 { animation-delay: 3.1s; }
  .scene .cloud-a { animation: driftA 24s ease-in-out infinite alternate; }
  .scene .cloud-b { animation: driftA 32s ease-in-out infinite alternate-reverse; }

  @keyframes qiRise {
    0% { transform: translateY(0); opacity: 0; }
    20% { opacity: .95; }
    100% { transform: translateY(-46px); opacity: 0; }
  }

  @keyframes driftA {
    from { transform: translateX(-10px); }
    to { transform: translateX(16px); }
  }

  @keyframes burstFlash {
    0% { opacity: 0; }
    25% { opacity: 1; }
    100% { opacity: 0; }
  }
}

/* ---------- 格子地图 ---------- */

.map-grid { display: grid; gap: 2px; margin: 6px 0 10px; }

.map-cell {
  position: relative;
  aspect-ratio: 1;
  border-radius: 3px;
  background: #f7f2e4;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: default;
}

/* 四类地格拉开明度与纹理：山最深、水次之、地面最浅、建筑带描边，
   不然一屏看下去全是色块，分不清哪能走、哪是殿 */
.map-cell.cell-ground { background: #f6f0de; }
.map-cell.cell-mountain {
  background:
    repeating-linear-gradient(135deg, rgba(72, 92, 74, .22) 0 2px, transparent 2px 5px),
    linear-gradient(180deg, #93a58f, #7c8f79);
  box-shadow: inset 0 -2px 0 rgba(60, 80, 62, .25);
}
.map-cell.cell-water {
  background:
    repeating-linear-gradient(0deg, rgba(110, 160, 175, .28) 0 1px, transparent 1px 4px),
    linear-gradient(180deg, #a9c8d0, #8fb6c2);
}
.map-cell.cell-place {
  background: linear-gradient(180deg, #f0e3c2, #e0d0a8);
  box-shadow: inset 0 0 0 1.5px #b99a63, 0 1px 2px rgba(90, 70, 30, .18);
}
.map-cell.cell-place .place-mark { color: #6b4712; font-weight: 600; }
.map-cell.cell-near { cursor: pointer; box-shadow: inset 0 0 0 1px #c9b98f; }
.map-cell.cell-player { box-shadow: inset 0 0 0 2px var(--cinnabar); }

.place-mark {
  font-family: var(--serif);
  font-size: 13px;
  color: #6d5a35;
  white-space: nowrap;
}
/* 「秘境」「围猎」这类两字地名：字号收一点，两字并排也塞得下 */
.place-mark.wide { font-size: 10px; letter-spacing: -0.5px; line-height: 1.1; }

.npc-mark {
  position: relative;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.npc-face {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  background: #fffdf6;
  border: 1px solid rgba(47, 93, 98, .45);
  box-shadow: 0 1px 3px rgba(60, 50, 30, .2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.npc-face .portrait-svg { width: 100%; height: 100%; }

.npc-name {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  margin-top: 1px;
  padding: 0 3px;
  font-style: normal;
  font-size: 9px;
  line-height: 1.25;
  white-space: nowrap;
  letter-spacing: 0;
  color: #2f3a38;
  background: rgba(253, 250, 241, .92);
  border-radius: 3px;
  box-shadow: 0 1px 2px rgba(60, 50, 30, .16);
  pointer-events: none;
  z-index: 3;
}

.npc-ge .npc-face { border-color: rgba(147, 113, 44, .75); }
.npc-zhou .npc-face { border-color: rgba(107, 74, 53, .75); }
.npc-liu .npc-face { border-color: rgba(138, 74, 90, .75); }

.quest-dot {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.dot-new { background: var(--teal); }
.dot-ready { background: var(--gold); }

.pawn { position: relative; width: 12px; height: 17px; }

.pawn::before {
  content: "";
  position: absolute;
  top: 0;
  left: 2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--cinnabar);
}

.pawn::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 12px;
  height: 9px;
  border-radius: 5px 5px 2px 2px;
  background: var(--cinnabar);
}

.map-status {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 8px;
}

.map-action { min-height: 40px; text-align: center; }

.dpad {
  display: grid;
  grid-template-columns: repeat(3, 58px);
  gap: 6px;
  justify-content: center;
  margin-top: 8px;
}

.dpad button {
  height: 38px;
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 4px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dpad button:hover { border-color: var(--teal); color: var(--teal); }
.dpad button:active { background: var(--teal-soft); border-color: var(--teal); }
/* 手机没有键盘，方向键是唯一走路方式：教程高亮/锁区期间也必须能按 */
body.tutorial-active .dpad button { pointer-events: auto !important; }

/* ---------- 任务列表 ---------- */

.quest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.quest-item {
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 4px;
  padding: 12px 14px;
}

.quest-item.st-ready { border-color: var(--gold); background: var(--gold-soft); }
.quest-item.st-active { border-color: var(--teal); }
.quest-item.st-done { opacity: .55; }
.quest-item.st-locked { opacity: .5; }

.quest-head { display: flex; justify-content: space-between; gap: 10px; font-weight: 600; }
.quest-title { font-family: var(--serif); font-size: 16px; letter-spacing: 1px; }
.quest-state { font-size: 12px; color: var(--ink-2); font-weight: 400; }
.quest-meta { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.quest-goal { font-size: 13px; margin-top: 6px; }

/* 任务指引：前置 / 领取仙师 / 场景位置 / 本章待办，嵌在每张任务卡片头部 */
.quest-guide { margin-top: 6px; padding: 6px 9px; background: var(--paper-2, rgba(0,0,0,.03)); border-left: 2px solid var(--teal); border-radius: 3px; font-size: 12px; line-height: 1.7; }
.guide-row { display: flex; gap: 8px; }
.guide-k { flex: 0 0 30px; color: var(--teal); font-weight: 600; }
.guide-v { flex: 1 1 auto; color: var(--ink-2); min-width: 0; }

.quest-bar { height: 5px; background: var(--line-soft); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.quest-bar span { display: block; height: 100%; background: var(--teal); }
.quest-reward { font-size: 12px; color: var(--gold); margin-top: 6px; }

.row-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* ---------- 突破特效 ---------- */

.lv-overlay {
  position: fixed;
  inset: 0;
  background: rgba(28, 36, 32, .82);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
}

.lv-box {
  position: relative;
  text-align: center;
  color: #f3ecdc;
  padding: 40px 46px;
}

.lv-title {
  position: relative;
  font-family: var(--serif);
  font-size: 48px;
  letter-spacing: 16px;
  color: #e8d3a0;
  animation: lvZoom .9s ease-out;
}

.lv-realm {
  position: relative;
  font-family: var(--serif);
  font-size: 30px;
  letter-spacing: 6px;
  margin-top: 18px;
  animation: lvFadeUp 1.1s ease-out;
}

.lv-text {
  position: relative;
  margin: 16px 0 26px;
  font-size: 15px;
  opacity: .85;
  animation: lvFadeUp 1.4s ease-out;
}

.lv-ring {
  position: absolute;
  left: 50%;
  top: 34%;
  width: 90px;
  height: 90px;
  border: 2px solid rgba(232, 211, 160, .55);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: ringGrow 1.8s ease-out infinite;
}

.lv-ring.r2 { animation-delay: .9s; }

@keyframes ringGrow {
  0% { width: 90px; height: 90px; opacity: .9; }
  100% { width: 360px; height: 360px; opacity: 0; }
}

@keyframes lvZoom {
  0% { transform: scale(.55); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); }
}

@keyframes lvFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 激活码与调试 ---------- */

.debug-area { margin-top: 18px; border-top: 1px dashed var(--line); padding-top: 12px; }
.act-row { display: flex; gap: 8px; margin-bottom: 8px; }

.text-input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 3px;
  padding: 8px 10px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
}

.act-msg { font-size: 12px; color: var(--cinnabar); }

/* ---------- 错题本 ---------- */

.mistake-list { display: grid; gap: 10px; margin-bottom: 6px; }

.mistake-item {
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 4px;
  padding: 12px 14px;
}

.mistake-item.mastered { opacity: .55; }
.m-subj { font-size: 12px; color: var(--gold); margin-bottom: 4px; }
.m-q { font-size: 15px; margin-bottom: 6px; }
.m-a { font-size: 13px; color: var(--ink-2); }
.mistake-item .btn-ghost { margin-top: 8px; }

/* ---------- 修行簿 ---------- */

.j-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0 4px;
}

.j-metric {
  border: 1px solid var(--line);
  background: #fbf7ec;
  border-radius: 4px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.j-metric span { font-size: 12px; color: var(--ink-2); }
.j-metric b { font-size: 19px; color: var(--gold); letter-spacing: 1px; }

.j-subj-list,
.j-weak-list { display: grid; gap: 8px; margin-bottom: 6px; }

.j-subj-row {
  display: grid;
  grid-template-columns: 62px 1fr 46px;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.j-subj-row:hover { border-color: var(--gold); }
.j-subj-name { font-size: 13px; }

.j-bar {
  display: block;
  height: 7px;
  background: rgba(0, 0, 0, .08);
  border-radius: 4px;
  overflow: hidden;
}

.j-bar i { display: block; height: 7px; border-radius: 4px; }
.j-subj-val { font-size: 13px; color: var(--ink-2); text-align: right; }

.j-weak-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 9px 12px;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.j-weak-row:hover { border-color: var(--gold); }
.j-weak-main { display: flex; flex-direction: column; gap: 2px; }
.j-weak-main b { font-size: 14px; font-weight: normal; }
.j-weak-main em { font-size: 12px; color: var(--ink-2); font-style: normal; }
.j-weak-val { font-size: 13px; color: var(--cinnabar); white-space: nowrap; }

.j-days {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 88px;
  margin: 6px 0 14px;
}

.j-day {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 3px;
}

.j-day-count { font-size: 11px; color: var(--ink-2); height: 14px; line-height: 14px; }
.j-day-bar {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, .05);
  border-radius: 3px;
}
.j-day-bar i { display: block; width: 100%; background: var(--gold); border-radius: 3px; opacity: .7; }
.j-day em { font-size: 11px; color: var(--ink-2); font-style: normal; }

.j-filter {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 8px 0 12px;
  font-size: 13px;
  color: var(--ink-2);
}

.j-group-title { font-size: 14px; margin: 14px 0 8px; letter-spacing: 2px; }

@media (max-width: 560px) {
  .j-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .j-subj-row { grid-template-columns: 54px 1fr 42px; }
}

/* ---------- 主线与支线 ---------- */

.quest-section { margin-top: 18px; letter-spacing: 3px; }
.sec-main { color: var(--cinnabar); }
.sec-side { color: var(--ink-2); }

/* 已完成的收在最下面：默认折叠，只留一行标题，不占正文 */
.quest-line-empty {
  margin: 10px 2px 0;
  font-size: 11px;
  color: var(--ink-2);
  letter-spacing: 1px;
}
.quest-done-fold { margin-top: 16px; padding-top: 8px; border-top: 1px dashed rgba(150, 122, 70, .38); }
.quest-done-fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding: 6px 2px;
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--ink-2);
  list-style: none;
}
.quest-done-fold > summary::-webkit-details-marker { display: none; }
.quest-done-fold > summary span::before {
  content: '▸';
  display: inline-block;
  margin-right: 6px;
  transform-origin: 40% 55%;
  transition: transform .18s ease;
}
.quest-done-fold[open] > summary span::before { transform: rotate(90deg); }
.quest-done-fold > summary em { font-style: normal; font-size: 10px; color: #9a8a6a; letter-spacing: 1px; }
.quest-done-fold[open] > summary em { opacity: 0; }
.quest-done-fold > .quest-list { margin-top: 6px; }

.line-tag {
  display: inline-block;
  font-size: 11px;
  border-radius: 2px;
  padding: 0 6px;
  margin-right: 8px;
  vertical-align: 2px;
  font-family: var(--sans);
  letter-spacing: 1px;
}

.tag-main { background: var(--cinnabar); color: #fdfaf1; }
.tag-side { background: var(--line); color: var(--ink-2); }

/* ---------- 修炼待开始 ---------- */

.ready-box {
  border: 1px dashed var(--line);
  background: #fbf7ec;
  border-radius: 4px;
  padding: 22px 18px;
  text-align: center;
}

.ready-title {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--teal);
  margin-bottom: 10px;
}

.ready-box .hint { margin-bottom: 16px; }

/* ---------- 调试修改界面 ---------- */

.debug-scroll {
  overflow: visible;
  border: 0;
  background: transparent;
}
.debug-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
.debug-scroll::-webkit-scrollbar-track { background: var(--line-soft); border-radius: 4px; }
.debug-scroll::-webkit-scrollbar-thumb { background: var(--teal); border: 2px solid var(--line-soft); border-radius: 6px; }
.debug-scroll::-webkit-scrollbar-corner { background: var(--line-soft); }
.debug-scroll-inner { min-width: 520px; padding: 4px 14px 16px; }
.debug-scroll-inner > h3:first-child { margin-top: 12px; }

.dbg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.dbg-grid .dbg-field {
  min-width: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 3px;
  margin-bottom: 0;
}
.dbg-grid .dbg-field > span {
  flex: none;
  font-size: 10px;
  line-height: 1.35;
  white-space: normal;
  color: var(--ink-2);
}
.dbg-grid .dbg-field .text-input { width: 100%; min-width: 0; padding: 4px 6px; font-size: 11px; }

.dbg-field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 13px;
}

.dbg-field > span { flex: 0 0 108px; color: var(--ink-2); }
.dbg-field .text-input { flex: 1; }

.dbg-io { width: 100%; min-height: 90px; resize: vertical; font-size: 12px; }

/* ---------- 战斗属性、六艺与渡劫 ---------- */
.attr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.attr-grid > div { padding: 10px 12px; border: 1px solid var(--line); background: #fbf7ec; border-radius: 4px; }
.attr-grid span, .attr-grid small { display: block; color: var(--ink-2); font-size: 11px; }
.attr-grid b { display: block; margin: 2px 0; color: var(--teal); font-family: var(--serif); font-size: 22px; }
.craft-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.craft-row { display: grid; grid-template-columns: 1fr auto; padding: 8px 10px; border: 1px solid var(--line); border-radius: 3px; font-size: 12px; }
.craft-row.is-picked { border-color: #b9aa7c; background: var(--gold-soft); }
.craft-row em { margin-left: 5px; color: var(--gold); font-size: 10px; font-style: normal; }
.craft-row small { grid-column: 1 / -1; color: var(--ink-2); }
.trib-panel { position: relative; margin-bottom: 18px; padding: 18px; border: 1px solid #b9aa7c; border-radius: 5px; background: var(--gold-soft); overflow: hidden; }
.trib-panel h2 { color: #6d5215; }
.trib-cloud { position: absolute; right: 12px; top: 4px; width: 72px; height: 28px; border-radius: 50%; background: #ddd2b9; opacity: .35; }
.trib-cloud::before, .trib-cloud::after { content: ""; position: absolute; border-radius: 50%; background: inherit; }
.trib-cloud::before { width: 34px; height: 34px; left: 8px; top: -12px; }
.trib-cloud::after { width: 42px; height: 42px; right: 4px; top: -16px; }
.trib-rate { display: flex; align-items: baseline; gap: 12px; margin: 10px 0 14px; color: #6d5215; }
.trib-rate strong { font-family: var(--serif); font-size: 42px; }
.trib-rate span { font-size: 12px; }
.rate-line { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #d8c9a4; font-size: 13px; }
/* 渡劫主线清单：点一条跳到对应仙师 */
.trib-quests { margin: 12px 0; }
.trib-quests h4 { margin: 0 0 6px; font-size: 13px; color: #6d5215; }
.trib-quests h4 small { font-weight: 400; color: var(--ink-2); }
.trib-quest-list { display: flex; flex-direction: column; gap: 4px; max-height: 220px; overflow-y: auto; }
.trib-quest { display: flex; align-items: center; gap: 8px; width: 100%; padding: 6px 9px; border: 1px solid #d8c9a4; border-radius: 4px; background: rgba(255,255,255,.5); font-size: 12px; text-align: left; cursor: pointer; color: var(--ink); }
.trib-quest:hover { background: rgba(255,255,255,.9); border-color: #b9aa7c; }
.trib-quest.done { opacity: .6; }
.trib-quest .tq-mark { flex: 0 0 14px; color: var(--teal); font-weight: 700; }
.trib-quest .tq-title { flex: 1 1 auto; min-width: 0; }
.trib-quest .tq-where { flex: 0 0 auto; color: var(--ink-2); }
.trib-quest .tq-state { flex: 0 0 42px; text-align: right; color: #6d5215; }
.trib-record { color: var(--ink-2); font-size: 12px; }
.tribulation-entry { display: block; margin: 14px auto 0; }
.trib-overlay { background: rgba(24, 29, 38, .9); animation: tribFlash 1.2s ease-out; }
.trib-result .lv-title { font-size: 40px; letter-spacing: 8px; }
.trib-fail .lv-title { color: #c5cbd6; }
.lightning { position: fixed; top: -20px; width: 10px; height: 48vh; background: #f5e7b0; clip-path: polygon(45% 0, 100% 0, 60% 38%, 100% 38%, 0 100%, 35% 52%, 0 52%); filter: drop-shadow(0 0 12px #fff0a8); animation: lightningStrike 1.4s ease-out both; }
.lightning.l1 { left: 24%; }
.lightning.l2 { left: 52%; animation-delay: .2s; }
.lightning.l3 { left: 74%; animation-delay: .45s; }
@keyframes lightningStrike { 0% { opacity: 0; transform: translateY(-30%); } 20% { opacity: 1; } 100% { opacity: 0; transform: translateY(30%); } }
@keyframes tribFlash { 0%, 30% { background: rgba(243, 238, 225, .82); } 100% { background: rgba(24, 29, 38, .9); } }

/* ---------- 校场切磋 ---------- */
.versus-card { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding: 14px 10px; border: 1px solid var(--line); background: #fbf7ec; border-radius: 4px; text-align: center; }
.versus-card b, .versus-card span, .versus-card small { display: block; }
.versus-card strong { color: var(--cinnabar); font-family: var(--serif); }
.versus-card span { margin: 4px 0; color: var(--teal); }
.versus-card small { color: var(--ink-2); font-size: 10px; }
.rule-box { margin-top: 10px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: #6d5215; font-size: 12px; }
.combatant { margin: 10px 0; }
.combatant > div:first-child { display: flex; justify-content: space-between; font-size: 13px; }
.combatant.foe b { color: var(--cinnabar); }
.hp-bar { height: 9px; margin-top: 5px; background: var(--line-soft); border-radius: 3px; overflow: hidden; }
.hp-bar span { display: block; height: 100%; background: var(--teal); transition: width .25s ease; }
.foe .hp-bar span { background: var(--cinnabar); }
.attack-choices { display: grid; gap: 8px; }
.attack-choices .choice { width: 100%; }
.battle-log { margin-top: 14px; padding: 8px 12px; background: #eee7d6; border-radius: 4px; color: var(--ink-2); font-size: 12px; }
.battle-log p { margin: 4px 0; }
.battle-end { padding: 16px; border: 1px solid var(--teal); background: var(--teal-soft); color: var(--teal); border-radius: 4px; text-align: center; font-family: var(--serif); font-size: 20px; }
.battle-end.loss { border-color: var(--line); background: #eee7d6; color: var(--ink-2); }
.area-switch { justify-content: center; }
.npc-gu, .npc-bai { background: #425f73; }
.npc-qin { background: #8b4a36; }
.npc-tang { background: #65517d; }
.npc-azhi { background: #4f7b70; }

/* ---------- 六艺修炼、材料与世界地图 ---------- */
.practice-switch { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; padding: 8px 10px; border: 1px solid var(--line); background: #fbf7ec; border-radius: 4px; font-size: 12px; color: var(--ink-2); }
.craft-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }
.craft-workbench { padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #fbf7ec; }
.craft-title { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.craft-title h2 { margin: 0; }
.craft-title p { margin: 3px 0 8px; color: var(--ink-2); font-size: 12px; }
.craft-title strong { color: var(--gold); font-size: 13px; white-space: nowrap; }
.recipe-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed #c9b98f; background: var(--gold-soft); border-radius: 4px; }
.recipe-box h3 { margin-top: 0; color: var(--gold); }
.recipe-box p { margin: 8px 0 0; color: var(--ink-2); font-size: 12px; }
.recipe-material { display: flex; justify-content: space-between; padding: 5px 0; border-bottom: 1px dashed #d8c9a4; font-size: 13px; }
.recipe-material b { color: var(--cinnabar); }
.recipe-material.enough b { color: var(--teal); }
.craft-notice { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--teal); background: var(--teal-soft); color: var(--teal); font-size: 13px; }
.craft-notice.grade-up { border-left-color: var(--gold); background: var(--gold-soft); color: #6d5215; font-weight: 600; }
.material-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.material-grid > div { padding: 7px 8px; border: 1px solid var(--line); border-radius: 3px; background: #fbf7ec; }
.material-grid span, .material-grid small { display: block; font-size: 10px; color: var(--ink-2); }
.material-grid b { display: block; color: var(--teal); font-size: 18px; }
.gather-rules { display: grid; gap: 5px; margin-bottom: 10px; padding: 10px 12px; border-left: 3px solid var(--gold); background: var(--gold-soft); color: #6d5215; font-size: 12px; }
.gather-inventory { display: flex; gap: 8px; margin-bottom: 12px; }
.gather-inventory span { flex: 1; display: flex; justify-content: space-between; padding: 7px 10px; border: 1px solid var(--line); background: #fbf7ec; font-size: 12px; }
.gather-inventory b { color: var(--teal); }
/* 地图比手机屏宽：让横向滚动只发生在地图容器内，
   标题/地点详情/按钮留在原处，不跟着被拖走。 */
.world-map-scroll { overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 5px; }
.world-map-scroll::-webkit-scrollbar { height: 9px; }
.world-map-scroll::-webkit-scrollbar-track { background: var(--line-soft); }
.world-map-scroll::-webkit-scrollbar-thumb { background: var(--teal); border-radius: 5px; }
.world-map-canvas { position: relative; min-width: 720px; height: 420px; background: #eee7d4; overflow: hidden; }
.world-map-bg { position: absolute; inset: 0; width: 100%; height: 100%; }
.world-mountain { fill: #d3d9c7; opacity: .75; }
.world-river { fill: none; stroke: #a9c5c9; stroke-width: 2.2; opacity: .8; }
.world-links { fill: none; stroke: #b6a77d; stroke-width: .35; stroke-dasharray: 1.4 1.2; }
.world-node { position: absolute; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; min-width: 86px; padding: 6px; border: 1px solid transparent; background: transparent; color: var(--ink); font-family: inherit; cursor: pointer; }
.world-node > span { display: flex; align-items: center; justify-content: center; width: 34px; height: 34px; border: 2px solid #f7f1df; border-radius: 50%; background: var(--teal); color: #fffaf0; box-shadow: 0 2px 6px rgba(43,47,46,.18); font-family: var(--serif); }
.world-node > b { margin-top: 3px; padding: 1px 5px; border-radius: 3px; background: rgba(243,238,225,.88); font-size: 12px; white-space: nowrap; }
.world-node > small { background: rgba(243,238,225,.85); color: var(--cinnabar); font-size: 10px; }
.world-node.type-gather > span { background: var(--gold); }
.world-node.type-battle > span { background: var(--cinnabar); }
.world-node.selected { border-color: var(--gold); border-radius: 5px; background: rgba(247,239,220,.72); }
.world-node.locked { opacity: .55; }
.world-detail { margin-top: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 5px; background: #fbf7ec; }
.world-detail-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.world-detail-head h2 { margin: 0; }
.world-detail-head span { color: var(--gold); font-size: 12px; }
.world-detail > p { font-size: 13px; }
.world-tags { display: flex; flex-wrap: wrap; gap: 5px; }
.world-tags span { padding: 2px 7px; border: 1px solid var(--line); border-radius: 3px; color: var(--teal); font-size: 11px; }
.world-line { margin: 8px 0 0; color: var(--ink-2); }

/* ---------- 主副科同修与新手教程 ---------- */
.inline-crafts { margin-top: 22px; padding-top: 12px; border-top: 2px solid var(--line); }
.inline-craft-tabs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.inline-craft-tabs button { padding: 6px 4px; border: 1px solid var(--line); background: #fbf7ec; color: var(--ink-2); border-radius: 3px; font-family: inherit; font-size: 11px; cursor: pointer; }
.inline-craft-tabs button.active { border-color: var(--teal); background: var(--teal-soft); color: var(--teal); }
.inline-recipe { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; margin-top: 8px; padding: 10px; border: 1px solid var(--line); background: var(--gold-soft); border-radius: 4px; }
.inline-recipe b, .inline-recipe span { display: block; }
.inline-recipe b { color: var(--gold); font-size: 12px; }
.inline-recipe span { margin-top: 4px; color: var(--ink-2); font-size: 11px; }
.tutorial-overlay { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
.tutorial-card { position: absolute; left: 50%; bottom: 82px; transform: translateX(-50%); width: min(440px, calc(100vw - 28px)); padding: 12px 16px; border: 2px solid var(--gold); border-radius: 6px; background: var(--card); box-shadow: 0 8px 30px rgba(43,47,46,.24); }
.tutorial-card span, .tutorial-card small { display: block; color: var(--gold); font-size: 11px; }
.tutorial-card b { display: block; margin: 4px 0; font-size: 14px; line-height: 1.65; }
.tutorial-complete { pointer-events: auto; }
.tutorial-complete .btn { margin-top: 10px; }
.tutorial-target { position: relative; z-index: 61 !important; pointer-events: auto !important; outline: 3px solid #d29c28 !important; outline-offset: 3px; box-shadow: 0 0 0 7px rgba(232,211,160,.38), 0 0 22px rgba(210,156,40,.75) !important; animation: tutorialPulse 1.2s ease-in-out infinite alternate; }
/* 重入轮回（刷新）任何时候都要能按：
   ①教程锁不住它 ②剧情/弹层盖屏时它仍在最上层（storyOverlay z-index:20） */
body.tutorial-active #resetBtn { pointer-events: auto !important; }
#resetBtn { position: relative; z-index: 30; }
/* 右下角那颗「随时刷新」圆钮：教程/剧情期间也必须能按，自救用。
   原先被教程的 pointer-events 锁和 storyOverlay 盖住，等于没有。 */
body.tutorial-active #quickRefresh { pointer-events: auto !important; }
#quickRefresh { z-index: 70 !important; }
body.tutorial-active button:not(.tutorial-target),
body.tutorial-active input,
body.tutorial-active select,
body.tutorial-active textarea,
body.tutorial-active .map-cell:not(.tutorial-target),
body.tutorial-active .world-node:not(.tutorial-target) { pointer-events: none !important; }
@keyframes tutorialPulse { from { outline-color: #d29c28; } to { outline-color: #f1d37e; } }
.onboarding-actions { display: grid; gap: 12px; }
.onboarding-actions .btn, .onboarding-actions .btn-ghost { width: 100%; padding: 12px; }
.npc-miner, .npc-herbalist, .npc-qinsong, .npc-jin, .npc-qian, .npc-granny, .npc-zhao { background: #78623d; }

/* ---------- v1.2 鎏金网游视觉、实物背包与雷劫 ---------- */
body { background: radial-gradient(circle at 50% 0, #f4e8c8 0, #d7ceb9 52%, #b9b29f 100%); }
#app { box-shadow: 0 0 42px rgba(63, 45, 16, .22); border-color: #aa8950; }
.topbar { background: linear-gradient(180deg, rgba(255,250,229,.8), transparent); }
.brand h1, .realm-name { color: #795217; text-shadow: 0 1px #fff5ce; }
.status-strip { padding-top: 2px; }
.progress { height: 9px; border: 1px solid #c7a96c; background: #cfc4aa; box-shadow: inset 0 1px 3px rgba(50,35,15,.25); }
.progress > span { background: linear-gradient(90deg, #2d7374, #65b7a7); box-shadow: 0 0 8px rgba(64,145,132,.5); }
.progress.qi-full > span { background: linear-gradient(90deg, #a86616, #ffe389, #c28a2c); }
.scene-frame { border: 2px solid #b89550; border-radius: 10px; box-shadow: 0 5px 18px rgba(77,54,19,.18), inset 0 0 0 1px #fff0bb; }
.mentor-bar { border: 1px solid #d4bd84; border-left: 4px solid #b88225; background: linear-gradient(100deg, #fff8df, #eee2c4); box-shadow: 0 3px 10px rgba(81,59,25,.08); }
#panel { background: linear-gradient(180deg, rgba(255,252,241,.45), transparent 180px); }
.btn { border: 1px solid #ffdf87; background: linear-gradient(180deg, #f7d878, #c58a2d 58%, #a76a1c); color: #3d280c; border-radius: 6px; box-shadow: inset 0 1px #fff2b8, 0 3px 8px rgba(105,67,17,.25); font-weight: 700; text-shadow: 0 1px rgba(255,244,195,.65); }
.btn:hover { opacity: 1; filter: brightness(1.08); }
.btn-ghost { border-color: #bca879; border-radius: 5px; background: rgba(255,250,235,.5); }
.story-box { border: 2px solid #c49a4c; border-radius: 10px; background: linear-gradient(160deg, #fffbed, #eee2c6); box-shadow: 0 0 0 4px rgba(240,204,120,.16), 0 22px 70px rgba(0,0,0,.4); }
.bottom-nav {
  border-top: 2px solid rgba(184, 138, 57, .9);
  background: linear-gradient(180deg, rgba(41, 72, 74, .93), rgba(20, 45, 49, .96));
  backdrop-filter: blur(6px);
  box-shadow: 0 -4px 16px rgba(38, 39, 26, .22);
}
.nav-btn { color: #c9c3a9; border-top-color: transparent; }
.nav-btn.active { color: #ffe398; border-top-color: #f4c65f; background: linear-gradient(180deg, rgba(238,190,86,.16), transparent); text-shadow: 0 0 10px rgba(255,211,107,.45); }
.nav-ico { color: inherit; }

/* 乾坤袋：每一格都有独立实物图 */
.material-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.material-grid .item-tile { position: relative; min-height: 116px; padding: 6px 5px 8px; text-align: center; border: 1px solid #bda575; border-radius: 7px; background: radial-gradient(circle at 50% 28%, #fff8d9, #e9dec2 75%); box-shadow: inset 0 0 12px rgba(170,126,45,.12); }
.item-art { height: 58px; display: flex; align-items: center; justify-content: center; filter: drop-shadow(0 3px 3px rgba(65,43,15,.18)); }
.item-art svg { display: block; max-width: 100%; }
.material-grid .item-tile > span { display: block; overflow: hidden; color: #514326; font-size: 11px; font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.material-grid .item-tile > b { position: absolute; right: 5px; top: 48px; padding: 0 4px; border-radius: 5px; background: rgba(34,45,42,.82); color: #ffeaa6; font-size: 11px; }
.material-grid .item-tile > small { display: block; color: #8a7956; font-size: 9px; }
.recipe-product-art { display: flex; align-items: center; gap: 12px; }
.recipe-product-art > svg { flex: 0 0 92px; }
.recipe-product-art h3 { margin: 0; }
.recipe-product-art span { color: var(--ink-2); font-size: 12px; }
.gather-inventory { display: grid; grid-template-columns: 1fr 1fr; }
.gather-inventory .item-tile { position: relative; text-align: center; border: 1px solid #bda575; border-radius: 6px; background: #fff8e5; }
.gather-inventory .item-tile > span, .gather-inventory .item-tile > small { display: block; font-size: 11px; }
.gather-inventory .item-tile > b { position: absolute; right: 10px; top: 48px; color: #795217; }
.empty-inventory { padding: 20px 14px; border: 1px dashed #bda575; border-radius: 6px; color: var(--ink-2); text-align: center; font-size: 12px; }
.quest-reward { padding-top: 6px; border-top: 1px dashed #ded0ae; }
.reward-items { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.reward-item { display: inline-flex; align-items: center; gap: 2px; padding: 2px 5px 2px 2px; border: 1px solid #ddca99; border-radius: 5px; background: #fff8e4; }
.reward-item svg { flex: 0 0 30px; }
.reward-item b { color: #72531e; font-size: 10px; font-weight: 500; }
.tutorial-intro-btn { display: block; margin: 9px 0 0 auto; padding: 5px 16px; pointer-events: auto; font-size: 12px; }

/* 野外怪物点 */
.cell-monster { background: radial-gradient(circle, #f4dca0, #d6c299); }
.monster-mark { display: flex; align-items: center; justify-content: center; width: 23px; height: 23px; border: 1px solid #ffe09a; border-radius: 50% 50% 45% 45%; background: linear-gradient(145deg, #a95731, #592f29); color: #ffe7aa; box-shadow: 0 0 8px rgba(174,92,39,.55); font-family: var(--serif); font-size: 12px; animation: monsterBreathe 1.8s ease-in-out infinite alternate; }

/* 金色突破：法阵、日轮、光柱与灵子 */
.breakthrough-overlay { overflow: hidden; background: radial-gradient(circle at 50% 42%, rgba(158,102,19,.52), rgba(17,26,25,.96) 62%); }
.lv-rays { position: absolute; left: 50%; top: 42%; width: 900px; height: 900px; transform: translate(-50%,-50%); background: repeating-conic-gradient(from 0deg, rgba(255,212,108,.14) 0 5deg, transparent 5deg 15deg); animation: raySpin 24s linear infinite; }
.lv-flash { position: absolute; inset: 0; background: radial-gradient(circle at 50% 42%, rgba(255,249,215,.95), rgba(255,205,83,.45) 32%, transparent 72%); animation: goldFlash .6s ease-out forwards; pointer-events: none; }
.lv-particles { position: absolute; inset: 0; overflow: hidden; }
.lv-particles i { position: absolute; left: calc(var(--i) * 5%); bottom: -12px; width: 5px; height: 5px; border-radius: 50%; background: #ffe49a; box-shadow: 0 0 10px #ffc44f; animation: particleRise 3.2s linear infinite; animation-delay: calc(var(--i) * -.17s); }
.lv-particles i:nth-child(3n) { width: 3px; height: 12px; border-radius: 2px; }
.lv-box { z-index: 2; width: min(440px, 94vw); padding: 34px 28px 28px; }
.lv-sigil { position: absolute; z-index: -1; left: 50%; top: 34%; width: 230px; height: 230px; transform: translate(-50%,-50%); fill: rgba(255,193,68,.07); stroke: #f7cd6c; stroke-width: 1.2; filter: drop-shadow(0 0 12px rgba(255,193,68,.8)); animation: sigilPulse 2.4s ease-in-out infinite alternate; }
.lv-kicker { position: relative; color: #e9c679; font-size: 11px; letter-spacing: 4px; }
.lv-title { margin-top: 8px; font-size: 64px; line-height: 1.25; color: #ffe49a; background: linear-gradient(180deg, #fff9cf, #ffd369 48%, #b86b16); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; filter: drop-shadow(0 0 13px rgba(255,187,57,.65)); }
.lv-realm { color: #fff0b8; font-size: 34px; text-shadow: 0 0 15px #d28a23; }
.lv-text { max-height: 120px; overflow: auto; color: #f3e6c7; line-height: 1.9; }
.lv-ring { border-color: rgba(255,209,105,.8); box-shadow: 0 0 16px rgba(255,184,53,.28); }
.lv-ring.r3 { animation-delay: .45s; }
.lv-continue { position: relative; min-width: 190px; }

/* 五道连续雷劫与实时生命条 */
.trib-overlay { overflow: hidden; background: radial-gradient(circle at 50% 20%, #485369, #101723 68%); }
.trib-sky { position: absolute; inset: 0; opacity: .65; }
.trib-sky i { position: absolute; width: 70%; height: 180px; border-radius: 50%; background: #111724; filter: blur(20px); animation: cloudRoll 5s ease-in-out infinite alternate; }
.trib-sky i:nth-child(1) { left: -15%; top: -30px; }
.trib-sky i:nth-child(2) { right: -20%; top: 80px; animation-delay: -2s; }
.trib-sky i:nth-child(3) { left: 10%; bottom: -60px; animation-delay: -3s; }
.trib-bolt { top: -10%; width: 24px; height: 72vh; opacity: 0; animation: none; background: linear-gradient(180deg, #fff, #fff3a6 55%, #a9c8ff); filter: drop-shadow(0 0 10px #fff) drop-shadow(0 0 28px #8fb5ff); }
.trib-bolt.strike { animation: tribBoltStrike .72s ease-out both; }
.bolt-0 { left: 19%; }.bolt-1 { left: 69%; }.bolt-2 { left: 43%; }.bolt-3 { left: 78%; }.bolt-4 { left: 48%; width: 34px; }
.strike-flash::after { content: ""; position: absolute; inset: 0; z-index: 4; background: rgba(238,245,255,.75); pointer-events: none; animation: strikeFlash .5s ease-out forwards; }
.trib-sequence { position: relative; z-index: 5; width: min(410px, calc(100vw - 36px)); padding: 25px 24px; border: 1px solid rgba(202,218,255,.4); border-radius: 12px; background: rgba(10,17,29,.7); box-shadow: 0 0 45px rgba(129,164,255,.18); color: #eef3ff; text-align: center; }
.trib-kicker { color: #b9c9eb; font-size: 11px; letter-spacing: 3px; }
.trib-live-title { margin: 8px 0; color: #fff1b2; font-family: var(--serif); font-size: 38px; letter-spacing: 8px; text-shadow: 0 0 16px #9db8ff; }
.trib-strike-count { color: #dbe7ff; font-size: 14px; }
.trib-person { position: relative; width: 50px; height: 86px; margin: 18px auto 12px; filter: drop-shadow(0 0 12px #e9dc9c); }
.trib-person::before { content: ""; position: absolute; left: 17px; width: 18px; height: 18px; border-radius: 50%; background: #f5e6b5; }
.trib-person::after { content: ""; position: absolute; left: 5px; bottom: 0; width: 42px; height: 64px; clip-path: polygon(35% 0,65% 0,100% 100%,0 100%); background: linear-gradient(#f4e7b6,#6982a8); }
.trib-person span { position: absolute; inset: -12px; z-index: -1; border: 2px solid #f6df8c; border-radius: 50%; animation: shieldPulse 1s ease-in-out infinite alternate; }
.trib-hp-head { display: flex; justify-content: space-between; margin-top: 8px; color: #f5e9c7; font-size: 13px; }
.trib-hp { height: 18px; margin-top: 5px; padding: 2px; border: 1px solid #c8b77c; border-radius: 5px; background: #1e2531; overflow: hidden; }
.trib-hp span { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, #b93f32, #ffcf67); box-shadow: 0 0 10px rgba(255,176,74,.65); transition: width .45s ease; }
.trib-live-log { min-height: 44px; margin-top: 10px; color: #cbd7eb; font-size: 12px; }
.trib-pips { display: flex; justify-content: center; gap: 12px; margin-top: 8px; }
.trib-pips i { width: 12px; height: 22px; clip-path: polygon(55% 0,100% 0,63% 40%,100% 40%,0 100%,35% 52%,0 52%); background: #4b566b; }
.trib-pips i.hit { background: #fff0a2; filter: drop-shadow(0 0 6px #b5cbff); }
.trib-result-bolts { margin-bottom: 10px; color: #ffe99c; font-size: 26px; letter-spacing: 8px; filter: drop-shadow(0 0 8px #a9c5ff); }
.trib-final-hp { margin: 10px 0; color: #ffe7a0; font-size: 14px; }

@keyframes rewardIn { from { opacity: 0; transform: translate(-50%,-15px); } to { opacity: 1; transform: translate(-50%,0); } }
@keyframes monsterBreathe { to { transform: scale(1.1); filter: brightness(1.16); } }
@keyframes raySpin { to { transform: translate(-50%,-50%) rotate(360deg); } }
@keyframes goldFlash { 0% { opacity: 1; } 100% { opacity: 0; } }
@keyframes particleRise { 0% { opacity: 0; transform: translateY(0) rotate(0); } 15% { opacity: 1; } 100% { opacity: 0; transform: translateY(-105vh) rotate(300deg); } }
@keyframes sigilPulse { from { opacity: .55; transform: translate(-50%,-50%) scale(.92) rotate(0); } to { opacity: 1; transform: translate(-50%,-50%) scale(1.05) rotate(12deg); } }
@keyframes tribBoltStrike { 0% { opacity: 0; transform: translateY(-35%) scaleX(.4); } 12% { opacity: 1; transform: translateY(0) scaleX(1.3); } 35% { opacity: 1; } 100% { opacity: 0; transform: translateY(25%) scaleX(.7); } }
@keyframes strikeFlash { from { opacity: 1; } to { opacity: 0; } }
@keyframes cloudRoll { to { transform: translateX(16%) scale(1.15); } }
@keyframes shieldPulse { to { transform: scale(1.14); opacity: .45; } }

/* ---------- v1.3 教程避让、页面退路、道具详情与滑动指引 ---------- */
.scroll-guide { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 12px 0; padding: 5px 9px; border: 1px dashed #c9ae73; border-radius: 4px; background: rgba(255,248,224,.62); color: #7b6030; font-size: 10px; line-height: 1.4; }
.scroll-guide span { color: #a8442a; font-weight: 700; letter-spacing: 1px; white-space: nowrap; }
.scroll-guide b { font-weight: 400; text-align: right; }
#panel { scrollbar-width: auto; }
#panel::-webkit-scrollbar { width: 12px; height: 12px; }
#panel::-webkit-scrollbar-thumb { background: linear-gradient(135deg, #d0a843, #8a6521); border: 2px solid #f1e6cc; }

.subpage-nav { position: static; z-index: 6; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin: -4px 0 12px; padding: 7px 8px; border: 1px solid #c9ae73; border-radius: 6px; background: rgba(255,249,229,.96); box-shadow: 0 3px 10px rgba(75,55,20,.1); }
.subpage-nav b { color: #795217; font-size: 12px; text-align: center; }
.subpage-nav .btn-ghost { padding: 4px 8px; font-size: 11px; white-space: nowrap; }
.subpage-nav #pageEnd { border-color: #b47f3d; color: #8a4a2a; }
.story-foot { flex-wrap: wrap; gap: 8px; }
.story-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.story-actions .btn, .story-actions .btn-ghost { padding: 6px 12px; font-size: 12px; }
.story-actions .btn-ghost:disabled { opacity: .35; }

.item-detail-overlay { position: fixed; inset: 0; z-index: 52; display: flex; align-items: center; justify-content: center; padding: 20px; background: rgba(25,31,30,.7); }
.item-detail-box { width: min(430px, calc(100vw - 28px)); max-height: 80vh; overflow: auto; padding: 18px; border: 2px solid #d0a642; border-radius: 10px; background: linear-gradient(155deg, #fff9df, #eadcb9); box-shadow: 0 20px 70px rgba(0,0,0,.4); }
.item-detail-head { display: flex; align-items: center; gap: 14px; padding-bottom: 12px; border-bottom: 1px solid #d3c096; }
.item-detail-art { flex: 0 0 92px; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; border: 1px solid #c59c4b; border-radius: 8px; background: radial-gradient(circle, #fff8cf, #dfcf9f); }
.item-detail-head span { display: block; color: #a8442a; font-size: 11px; }
.item-detail-head h2 { margin: 3px 0; color: #684614; }
.item-detail-head b { color: #795217; font-size: 12px; }
.item-detail-row { display: grid; grid-template-columns: 72px 1fr; gap: 10px; padding: 10px 0; border-bottom: 1px dashed #d3c096; }
.item-detail-row span { color: #84652c; font-size: 12px; font-weight: 700; }
.item-detail-row p { margin: 0; color: var(--ink); font-size: 13px; line-height: 1.7; }
/* 长弹窗（战技/装备等）内容滚动时，关闭/操作按钮始终可见，不必滑到底 */
.item-detail-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin-top: 14px; position: sticky; bottom: -14px; padding: 8px 0 4px; background: linear-gradient(to top, rgba(255,252,244,1) 60%, rgba(255,252,244,0)); z-index: 2; }
.item-detail-actions .btn { padding: 7px 16px; font-size: 13px; }
.item-tile, .reward-item { cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.item-tile:hover, .reward-item:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(140,96,25,.22); }
body.tutorial-active .item-tile, body.tutorial-active .reward-item { pointer-events: none; }
@keyframes rewardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

body.tutorial-active #app { padding-top: calc(var(--tutorial-card-h, 158px) + 14px); }
body.tutorial-active .story-overlay, body.tutorial-active .lv-overlay { padding-top: calc(var(--tutorial-card-h, 158px) + 14px); align-items: center; }
.tutorial-card { position: fixed; overflow: visible; pointer-events: none; padding: 10px 14px; border: 2px solid #d29c28; border-radius: 9px; background: linear-gradient(145deg, rgba(255,251,234,.99), rgba(242,224,177,.99)); box-shadow: 0 8px 28px rgba(39,30,10,.28), inset 0 0 0 1px #fff8d6; }
.tutorial-card .tutorial-step { display: block; padding-bottom: 5px; border-bottom: 1px solid #d8bd7e; color: #8a5a17; font-size: 10px; letter-spacing: 1px; }
.tutorial-card .tutorial-copy { display: block; max-height: 136px; overflow: hidden; margin: 5px 0; color: #2e302c; font-size: 12px; line-height: 1.55; }
.tutorial-card .tutorial-hint { display: block; padding-top: 4px; border-top: 1px dashed #d8bd7e; color: #7a6b48; font-size: 10px; }
.tutorial-card .tutorial-intro-btn { pointer-events: auto; margin: 0; padding: 4px 13px; font-size: 11px; }
.tutorial-card .tutorial-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 7px; }
.tutorial-card .tutorial-actions .btn, .tutorial-card .tutorial-actions .btn-ghost { pointer-events: auto !important; padding: 4px 12px; font-size: 11px; }
.tutorial-card .tutorial-actions .tutorial-skip { pointer-events: auto !important; border: 0; background: none; padding: 2px 4px; color: #8a7a52; font-size: 10px; text-decoration: underline; }
.tutorial-card .tutorial-actions .tutorial-skip:hover { color: #6b4a12; }
body.tutorial-active .tutorial-card.tutorial-complete .btn { pointer-events: auto !important; }
.tutorial-card.tutorial-complete { pointer-events: auto; padding-bottom: 12px; }
.tutorial-card.tutorial-complete .btn { margin-top: 9px; padding: 7px 18px; font-size: 12px; }
.battle-exit { margin-top: 12px; text-align: center; }
.battle-exit .btn-ghost { border-color: #a8442a; color: #8a3824; }

@media (max-width: 380px) {
  .scroll-guide { font-size: 9px; }
  .scroll-guide b { max-width: 210px; }
  .subpage-nav { gap: 4px; padding: 6px 5px; }
  .subpage-nav .btn-ghost { padding: 4px 6px; font-size: 10px; }
  .story-actions { justify-content: center; }
}

/* 特效遮罩必须完全不透明，底层页面文字不能透上来形成叠字 */
.lv-overlay.breakthrough-overlay { background: radial-gradient(circle at 50% 40%, #b17c28 0, #5b4117 30%, #21251e 66%, #0e1514 100%); }
.lv-overlay.trib-overlay { animation: none; background: radial-gradient(circle at 50% 18%, #53617a 0, #202c3d 38%, #0d1420 78%); }

/* v1.5 金丹 / 元婴章节：章节切换、三阶配方、本章考纲 */
.chapter-switch { margin: 12px 0; padding: 8px 10px; border: 1px solid #c9b98f; border-radius: 5px; background: rgba(247,239,220,.75); }
.chapter-switch > span { display: block; margin-bottom: 6px; color: var(--gold); font-size: 11px; letter-spacing: 2px; }
.chapter-switch .row-btns { margin-top: 0; gap: 6px; }
.chapter-switch .btn-ghost { padding: 5px 10px; font-size: 11px; }
.chapter-switch .btn-ghost.is-current { border-color: var(--gold); background: linear-gradient(180deg, #f7d878, #c58a2d); color: #3d280c; font-weight: 700; }
.chapter-syllabus { margin: 10px 0 14px; padding: 10px 12px; border-left: 3px solid var(--gold); border-radius: 3px; background: linear-gradient(90deg, rgba(247,231,190,.85), rgba(251,247,236,.35)); }
.chapter-syllabus > div { display: flex; flex-wrap: wrap; gap: 10px; align-items: baseline; }
.chapter-syllabus b { color: var(--cinnabar); font-family: var(--serif); font-size: 15px; }
.chapter-syllabus span { color: var(--gold); font-size: 11px; }
.chapter-syllabus p { margin: 6px 0 0; color: var(--ink-2); font-size: 12px; line-height: 1.7; }
.tier-recipe { margin-top: 12px; padding: 10px 12px; border: 1px dashed #c9b98f; border-radius: 4px; background: var(--gold-soft); }
.tier-recipe.tier-active { border: 1px solid var(--gold); box-shadow: inset 0 0 0 1px rgba(255,235,170,.9), 0 2px 10px rgba(160,116,38,.16); background: linear-gradient(180deg, #fff6dc, #f2e6c6); }
.tier-recipe-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; align-items: baseline; }
.tier-recipe-head b { color: var(--gold); font-family: var(--serif); font-size: 14px; }
.tier-recipe-head span { color: var(--ink-2); font-size: 11px; }
.tier-recipe .recipe-product-art { margin: 6px 0; }
.tier-recipe .recipe-product-art > svg { flex: 0 0 76px; }
.tier-recipe .recipe-product-art h3 { color: var(--gold); font-size: 13px; }
.tier-recipe .recipe-product-art span { font-size: 11px; }
.tier-recipe > .btn { width: 100%; margin-top: 9px; }
#panel h4 { margin: 12px 0 6px; color: var(--teal); font-family: var(--serif); font-size: 12px; letter-spacing: 1px; }
.world-node { min-width: 76px; }
.world-node > b { font-size: 11px; }

/* ---------- 开局：学习进度问卷 ---------- */

.story-box.study-box {
  max-width: 520px;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding-bottom: 14px;
}

.study-tip {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-2);
}

.study-shortcuts {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}

.btn-ghost.sm {
  padding: 6px 10px;
  font-size: 11px;
  border-radius: 4px;
}

.study-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 8px 2px;
  margin-bottom: 12px;
}

.study-row {
  padding: 7px 0;
  border-bottom: 1px dashed var(--line-soft);
}
.study-row:last-child { border-bottom: 0; }

.study-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
  margin-bottom: 5px;
}
.study-name i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(147, 113, 44, .14);
  color: var(--gold);
}
.study-name i.sub {
  background: rgba(47, 93, 98, .12);
  color: var(--teal);
}

.study-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.sem-chip {
  flex: 1 1 0;
  min-width: 56px;
  padding: 5px 0;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.2;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 252, 244, .8);
  color: var(--ink-2);
  cursor: pointer;
  transition: .15s;
}
.sem-chip:hover { border-color: var(--gold); color: var(--ink); }
.sem-chip.on {
  border-color: var(--gold);
  background: linear-gradient(180deg, #f7d878, #c58a2d);
  color: #3d280c;
  font-weight: 700;
}

.study-books {
  margin-top: 5px;
  font-size: 10px;
  line-height: 1.55;
  color: var(--ink-3, var(--ink-2));
  opacity: .85;
}
.study-books em { font-style: normal; color: #a8442a; }
.study-books .cov { color: var(--teal); opacity: .9; }

.study-box .onboarding-actions {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
}
.study-box .onboarding-actions .btn,
.study-box .onboarding-actions .btn-ghost { width: auto; flex: 1 1 0; padding: 10px 12px; font-size: 13px; }
.study-box .onboarding-actions .btn:disabled { opacity: .45; cursor: not-allowed; }

/* ---------- 开局问卷：逐章勾选 ---------- */

.study-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 6px; }
.study-speaker { font-family: var(--serif); font-size: 15px; color: var(--ink); }
.study-counter { font-size: 11px; color: var(--teal); text-align: right; line-height: 1.4; }
.study-counter .warn { color: #a8442a; font-weight: 400; font-size: 10px; }

.study-tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 6px;
  margin-bottom: 6px;
}
.study-tab {
  position: relative;
  flex: 0 0 auto;
  padding: 5px 9px;
  font-family: inherit;
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 252, 244, .8);
  color: var(--ink-2);
  cursor: pointer;
}
.study-tab.on { border-color: var(--gold); background: linear-gradient(180deg, #f7d878, #c58a2d); color: #3d280c; font-weight: 700; }
.study-tab.has::after {
  content: '';
  position: absolute;
  top: 2px; right: 3px;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--teal);
}
.study-tab.on.has::after { background: #3d280c; }

.ch-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  padding: 6px 2px;
  margin-bottom: 12px;
}

.ch-book { margin-bottom: 10px; }
.ch-book-head { display: flex; align-items: center; gap: 8px; padding: 3px 2px 5px; }
.ch-book-head b { font-family: var(--serif); font-size: 12px; color: var(--gold); }
.ch-book-head span { flex: 1 1 auto; font-size: 10px; color: var(--ink-2); }
.ch-all {
  flex: 0 0 auto;
  padding: 2px 7px;
  font-family: inherit;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(255, 250, 235, .6);
  color: var(--teal);
  cursor: pointer;
}
.ch-all:hover { border-color: var(--gold); color: var(--ink); }

.ch-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 8px;
  margin-bottom: 3px;
  font-family: inherit;
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  border: 1px solid var(--line-soft);
  border-radius: 4px;
  background: rgba(255, 252, 244, .7);
  color: var(--ink-2);
  cursor: pointer;
}
.ch-item:hover { border-color: var(--gold); }
.ch-item i {
  flex: 0 0 12px;
  height: 12px;
  line-height: 12px;
  font-style: normal;
  font-size: 9px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: transparent;
}
.ch-item span { flex: 1 1 auto; }
.ch-item em.q { font-style: normal; font-size: 9px; opacity: .7; }
.ch-item em.q.none { opacity: .45; }
.ch-item.on { border-color: var(--gold); background: rgba(240, 204, 120, .25); color: var(--ink); }
.ch-item.on i { background: var(--gold); border-color: var(--gold); color: #fffbed; }

.text-input.sm { width: auto; padding: 5px 8px; font-size: 11px; }

/* ---------- 修炼大殿 · 两扇门 ---------- */

.hall { display: flex; flex-direction: column; gap: 12px; }

.hall-title { text-align: center; }
.hall-title h2 {
  margin: 0 0 4px;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 4px;
  color: var(--ink);
}
.hall-title p { margin: 0; font-size: 11px; color: var(--ink-2); letter-spacing: 1px; }

.hall-doors { display: flex; flex-direction: column; gap: 10px; }

.door {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  font-family: inherit;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .18s, box-shadow .18s, border-color .18s;
}
.door:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(60, 50, 30, .16); }
.door:active { transform: translateY(0); }

.door-main {
  border-color: #cbb077;
  background: linear-gradient(135deg, #fffaf0, #f4e7c8 65%, #efdcb4);
}
.door-main:hover { border-color: var(--gold); }
.door-sub {
  border-color: #a8c8c6;
  background: linear-gradient(135deg, #f7fdfc, #e2efee 65%, #d6e8e6);
}
.door-sub:hover { border-color: var(--teal); }

.door-art { flex: 0 0 92px; }
.door-svg { display: block; width: 92px; height: auto; }

.door-halo { animation: doorSpin 16s linear infinite; }
.door-sub .door-halo { animation-duration: 22s; animation-direction: reverse; }
@keyframes doorSpin { to { transform: rotate(360deg); } }

.door-qi circle { animation: doorRise 3.4s ease-in-out infinite; }
.door-qi circle:nth-child(2) { animation-delay: .8s; }
.door-qi circle:nth-child(3) { animation-delay: 1.6s; }
.door-qi circle:nth-child(4) { animation-delay: 2.4s; }
@keyframes doorRise {
  0%, 100% { opacity: .25; transform: translateY(5px); }
  50% { opacity: 1; transform: translateY(-6px); }
}

.door-body { flex: 1 1 auto; min-width: 0; }
.door-body b {
  display: block;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 2px;
  margin-bottom: 3px;
}
.door-main .door-body b { color: #7a5410; }
.door-sub .door-body b { color: var(--teal); }
.door-body span { display: block; font-size: 11px; color: var(--ink-2); margin-bottom: 4px; }
.door-body i { display: block; font-style: normal; font-size: 10px; line-height: 1.5; color: var(--ink-2); opacity: .8; }

.door-foot {
  flex: 0 0 auto;
  align-self: flex-end;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--ink-2);
  opacity: .75;
  white-space: nowrap;
}
.door-main .door-foot { color: #7a5410; }
.door-sub .door-foot { color: var(--teal); }

.hall-mirror {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding-top: 4px;
  border-top: 1px solid var(--line-soft);
}
.hall-col h3 {
  margin: 8px 0 6px;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--gold);
}
.hall-col:last-child h3 { color: var(--teal); }

.hall-row { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 11px; }
.hall-row b { flex: 0 0 30px; font-weight: 400; color: var(--ink); }
.hall-row em { flex: 0 0 auto; font-style: normal; font-size: 10px; color: var(--ink-2); }
.hall-row em.ok { color: #2f7a4d; }
.hall-craft { flex: 0 0 auto; font-size: 10px; color: var(--ink-2); opacity: .7; }

.hall-bar {
  flex: 1 1 auto;
  height: 5px;
  min-width: 20px;
  border-radius: 3px;
  background: rgba(147, 113, 44, .16);
  overflow: hidden;
}
.hall-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, #c58a2d, #f7d878);
  transition: width .4s ease;
}
.hall-bar span.ok { background: linear-gradient(90deg, #2f7a4d, #6fbf8b); }

/* ---------- 修炼动图：打坐聚气 ---------- */

.dantian {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 2px 0 8px;
}
.dantian-svg { display: block; width: 208px; max-width: 72%; height: auto; }
.dantian-label { margin-top: -4px; font-size: 10px; letter-spacing: 2px; color: var(--teal); opacity: .85; }

.dt-ring { animation: dtSpin 14s linear infinite; }
.dt-ring2 { animation: dtSpin 22s linear infinite reverse; }
@keyframes dtSpin { to { transform: rotate(360deg); } }

.dt-glow { transform-origin: 100px 64px; animation: dtPulse 3.6s ease-in-out infinite; }
@keyframes dtPulse {
  0%, 100% { opacity: .5; transform: scale(.93); }
  50% { opacity: 1; transform: scale(1.06); }
}

.dt-qi circle { animation: dtRise 3s ease-in-out infinite; }
.dt-qi circle:nth-child(2) { animation-delay: .6s; }
.dt-qi circle:nth-child(3) { animation-delay: 1.2s; }
.dt-qi circle:nth-child(4) { animation-delay: 1.8s; }
.dt-qi circle:nth-child(5) { animation-delay: 2.4s; }
@keyframes dtRise {
  0%, 100% { opacity: .15; transform: translateY(6px); }
  50% { opacity: 1; transform: translateY(-9px); }
}

.dt-burst { transform-origin: 100px 64px; }

.dantian.gain .dt-burst { animation: dtBurst .95s ease-out; }
@keyframes dtBurst {
  0% { opacity: 1; transform: scale(.6); }
  100% { opacity: 0; transform: scale(5.2); }
}
.dantian.gain .dantian-label { color: var(--gold); }
.dantian.gain .dt-glow { animation: dtBurstFlash .95s ease-out; }
@keyframes dtBurstFlash {
  0% { opacity: 1; transform: scale(1.25); }
  100% { opacity: .55; transform: scale(1); }
}

.dantian.miss .dt-glow { animation: none; opacity: .12; }
.dantian.miss .dt-qi circle { animation-play-state: paused; opacity: .08; }
.dantian.miss .dt-body { opacity: .5; }
.dantian.miss .dantian-label { color: #8a8070; }

/* ---------- 战斗动图：双方剪影对峙 ---------- */

.arena {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 4px;
  padding: 12px 6px 0;
  margin-bottom: 4px;
  min-height: 172px;
  border-radius: 10px;
  overflow: hidden;
  background-image: url(../art/battle.jpg);
  background-size: cover;
  background-position: center 62%;
  box-shadow: inset 0 0 40px rgba(20, 34, 30, .35);
  animation: arenaDrift 26s ease-in-out infinite alternate;
}
/* 背景缓慢横移，像云雾在走；两层叠加避免抽搐 */
@keyframes arenaDrift {
  from { background-position: 46% 62% }
  to { background-position: 54% 62% }
}
/* 底部压暗，让角色站得住 */
.arena::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 46%;
  background: linear-gradient(180deg, transparent, rgba(26, 40, 36, .38));
  pointer-events: none;
}
/* 角色在复杂背景上要浮起来 */
.arena .fighter-svg { filter: drop-shadow(0 3px 7px rgba(12, 24, 20, .55)); position: relative; z-index: 1; }
.arena .fighter-img {
  position: relative; z-index: 1; display: block; height: 156px; width: auto;
  filter: drop-shadow(0 4px 8px rgba(10, 22, 18, .5));
  user-select: none; -webkit-user-drag: none;
}
.arena .foe-img { height: 118px; }   /* 野兽趴着，比人矮一截才自然 */
.arena .fighter > span { position: relative; z-index: 1; text-shadow: 0 1px 3px rgba(0, 0, 0, .5); }

.fighter {
  position: relative;
  flex: 0 0 42%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.fighter-svg { display: block; width: 100%; max-width: 88px; height: auto; }
.fighter span { margin-top: 2px; font-size: 10px; line-height: 1.3; color: var(--ink-2); text-align: center; }

.me-aura { transform-origin: 44px 58px; animation: dtSpin 20s linear infinite; }
.foe-aura { transform-origin: 44px 60px; animation: dtSpin 15s linear infinite reverse; }

.arena-mid { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; padding-bottom: 22px; }
.arena-mid i {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: radial-gradient(circle, #f7d878, rgba(247, 216, 120, 0) 70%);
  animation: midPulse 2.4s ease-in-out infinite;
}
@keyframes midPulse {
  0%, 100% { opacity: .3; transform: scale(.75); }
  50% { opacity: 1; transform: scale(1.15); }
}

.fighter.strike-r { animation: strikeR .4s ease-out; }
.fighter.strike-l { animation: strikeL .4s ease-out; }
@keyframes strikeR {
  0% { transform: translateX(0); }
  38% { transform: translateX(26px) scale(1.05); }
  100% { transform: translateX(0); }
}
@keyframes strikeL {
  0% { transform: translateX(0); }
  38% { transform: translateX(-26px) scale(1.05); }
  100% { transform: translateX(0); }
}

.fighter.hurt { animation: hurtShake .45s linear; }
@keyframes hurtShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-5px, 2px); }
  40% { transform: translate(5px, -2px); }
  60% { transform: translate(-4px, 1px); }
  80% { transform: translate(3px, -1px); }
}
.fighter.hurt .fighter-svg { filter: drop-shadow(0 0 7px rgba(200, 70, 45, .85)); }

.dmg-float {
  position: absolute;
  top: 16%;
  left: 50%;
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 1px;
  pointer-events: none;
  white-space: nowrap;
  -webkit-text-stroke: 2px rgba(255, 253, 240, .9);
  paint-order: stroke fill;
  animation: dmgUp 1.05s cubic-bezier(.2, 1.5, .4, 1) forwards;
}
.dmg-float.to-foe { color: #b4791a; text-shadow: 0 0 10px rgba(255, 226, 140, 1), 0 2px 0 rgba(90, 60, 10, .35); }
.dmg-float.to-me { color: #a8442a; text-shadow: 0 0 10px rgba(255, 210, 190, 1), 0 2px 0 rgba(80, 20, 10, .35); }

.dmg-float.crit {
  font-size: 30px;
  color: #c0392b;
  animation: dmgCrit 1.3s cubic-bezier(.2, 1.6, .4, 1) forwards;
}
.dmg-float.crit + .dmg-float,
.dmg-float:nth-child(n+2) { top: 4%; }
.dmg-float.dodge {
  font-size: 15px;
  font-weight: 400;
  letter-spacing: 2px;
  color: #7c8a86;
  -webkit-text-stroke: 0;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .9);
}

@keyframes dmgUp {
  0% { opacity: 0; transform: translate(-50%, 10px) scale(.5) rotate(-6deg); }
  22% { opacity: 1; transform: translate(-50%, -4px) scale(1.35) rotate(2deg); }
  42% { transform: translate(-50%, -8px) scale(1) rotate(0); }
  100% { opacity: 0; transform: translate(-50%, -46px) scale(.95); }
}
@keyframes dmgCrit {
  0% { opacity: 0; transform: translate(-50%, 12px) scale(.4) rotate(-10deg); }
  20% { opacity: 1; transform: translate(-50%, -6px) scale(1.7) rotate(4deg); }
  38% { transform: translate(-50%, -10px) scale(1.15) rotate(-2deg); }
  100% { opacity: 0; transform: translate(-50%, -54px) scale(1); }
}

/* 暴击标签：单独一行，避免和数字叠在一起 */
.dmg-tag {
  position: absolute;
  top: -5%;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: 1px;
  color: #a8442a;
  pointer-events: none;
  white-space: nowrap;
  text-shadow: 0 1px 3px rgba(255, 255, 255, .95);
  animation: tagUp 1.15s ease-out forwards;
}
@keyframes tagUp {
  0% { opacity: 0; transform: translate(-50%, 8px); }
  25% { opacity: 1; transform: translate(-50%, 0); }
  100% { opacity: 0; transform: translate(-50%, -26px); }
}

/* 命中白闪 */
.arena-flash {
  position: absolute;
  inset: -6px;
  border-radius: 10px;
  pointer-events: none;
  opacity: 0;
  background: radial-gradient(circle at 50% 55%, rgba(255, 250, 225, .85), rgba(255, 236, 170, 0) 68%);
}
.arena-flash.on { animation: arenaFlash .32s ease-out; }
@keyframes arenaFlash {
  0% { opacity: .9; }
  100% { opacity: 0; }
}

/* ---------- 立绘与三栏对话 ---------- */

.portrait-svg { display: block; width: 100%; height: auto; }

.dialog-box { max-width: 520px; padding: 16px 12px 12px; }
.dialog-box .story-place { margin-bottom: 10px; }

.dialog-stage {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  gap: 6px;
  align-items: end;
  margin-bottom: 12px;
}

.dialog-side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  transition: opacity .25s, filter .25s;
}
.dialog-side span {
  font-size: 9px;
  letter-spacing: 1px;
  color: var(--ink-2);
  opacity: .8;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dialog-side.dim { opacity: .42; filter: saturate(.35); }
.dialog-side.left .portrait-svg { transform: scaleX(-1); }

.dialog-none {
  width: 100%;
  aspect-ratio: 120 / 176;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 2px;
  color: var(--ink-2);
  opacity: .35;
  border: 1px dashed var(--line-soft);
  border-radius: 6px;
}

.dialog-main {
  min-width: 0;
  padding-bottom: 4px;
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.dialog-main .story-speaker { margin-bottom: 8px; }
.dialog-main .story-text { margin: 0; font-size: 13px; line-height: 1.85; }

/* 立绘呼吸感：主角轻微起伏，NPC 光晕呼吸 */
.dialog-side.right .portrait-svg { animation: portraitFloat 5s ease-in-out infinite; }
.dialog-side.left .portrait-svg { animation: portraitFloat 6.4s ease-in-out infinite; }
@keyframes portraitFloat {
  0%, 100% { translate: 0 0; }
  50% { translate: 0 -3px; }
}

/* ---------- 开局：选择形象 ---------- */

.story-box.avatar-box {
  max-width: 520px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.avatar-box .avatar-grid { flex: 1 1 auto; min-height: 0; }
.avatar-box .onboarding-actions { flex: 0 0 auto; }
.avatar-box .study-tip, .avatar-box .study-speaker, .avatar-box .story-place { flex: 0 0 auto; }

.avatar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-height: 52vh;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 4px 2px 8px;
  margin-bottom: 10px;
}

.avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 8px 10px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, rgba(255, 253, 246, .95), rgba(246, 238, 220, .9));
  cursor: pointer;
  transition: transform .16s, border-color .16s, box-shadow .16s;
}
.avatar-card:hover { transform: translateY(-2px); border-color: var(--gold); }
.avatar-card.on {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(197, 138, 45, .35), 0 8px 20px rgba(120, 90, 30, .15);
  background: linear-gradient(180deg, #fffaf0, #f2e3c2);
}
.avatar-art { width: 100%; max-width: 104px; }
.avatar-card b {
  display: flex;
  align-items: center;
  gap: 5px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 2px;
  color: var(--ink);
}
.avatar-card b i {
  font-style: normal;
  font-size: 9px;
  letter-spacing: 1px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(147, 113, 44, .14);
  color: var(--gold);
}
.avatar-card span { font-size: 9px; line-height: 1.5; color: var(--ink-2); text-align: center; }

/* ---------- 任务页：NPC 头像 + 谢礼实物 ---------- */

.quest-item { display: flex; gap: 9px; align-items: flex-start; }
.quest-face {
  flex: 0 0 44px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding-top: 2px;
}
.quest-face .portrait-svg {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid #cbb077;
  background: #fffdf6;
  box-shadow: 0 1px 3px rgba(60, 50, 30, .16);
}
.quest-face em {
  font-style: normal;
  font-size: 9px;
  line-height: 1.2;
  color: var(--ink-2);
  text-align: center;
  max-width: 46px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.quest-body { flex: 1 1 auto; min-width: 0; }

.reward-items { display: flex; flex-wrap: wrap; gap: 6px; }
.reward-item { display: inline-flex; align-items: center; gap: 5px; }
.reward-item b { font-size: 10px; font-weight: 400; color: var(--ink-2); }
.reward-item .portrait-svg, .reward-item svg { flex: 0 0 auto; }
.qi-gem-wrap { display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center; }
.qi-gem { filter: drop-shadow(0 0 4px rgba(247, 216, 120, .7)); }

/* 对话里的谢礼条 */
.story-rewards {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 9px;
  margin-bottom: 10px;
  border: 1px dashed #cbb077;
  border-radius: 6px;
  background: rgba(255, 249, 229, .7);
}
.story-rewards-label {
  flex: 0 0 auto;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: 2px;
  color: var(--gold);
}
.story-rewards .reward-items { flex: 1 1 auto; }

/* ---------- 洞府：主角立绘 ---------- */

.cave-hero {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  margin-bottom: 12px;
  border: 1px solid #cbb077;
  border-radius: 8px;
  background: linear-gradient(135deg, #fffaf0, #f2e7cd 70%, #ecdfc2);
}
.cave-hero-art { flex: 0 0 76px; }
.cave-hero-info { flex: 1 1 auto; min-width: 0; }
.cave-hero-info b {
  display: block;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: 2px;
  color: #7a5410;
}
.cave-hero-info span { display: block; font-size: 11px; color: var(--teal); margin: 2px 0 4px; }
.cave-hero-info p { margin: 0; font-size: 10px; line-height: 1.6; color: var(--ink-2); }

.rate-line.gate b { font-weight: 600; }
.rate-line.gate.ok b { color: #2f7a4d; }
.rate-line.gate.no b { color: #a8442a; }
.trib-gate-hint {
  margin: 8px 0 0;
  padding: 7px 9px;
  font-size: 11px;
  line-height: 1.6;
  color: #8a3824;
  border: 1px dashed rgba(168, 68, 42, .5);
  border-radius: 5px;
  background: rgba(255, 240, 232, .7);
}

/* ---------- 奖励特效 ---------- */

.reward-toast {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 60;
  animation: rewardFadeOut .4s ease-in 1.9s forwards;
}
@keyframes rewardFadeOut { to { opacity: 0; } }

.reward-rays {
  position: absolute;
  width: 460px;
  height: 460px;
  border-radius: 50%;
  background: conic-gradient(from 0deg,
    rgba(247, 216, 120, .55), rgba(247, 216, 120, 0) 10%,
    rgba(247, 216, 120, .45) 22%, rgba(247, 216, 120, 0) 32%,
    rgba(247, 216, 120, .5) 45%, rgba(247, 216, 120, 0) 56%,
    rgba(247, 216, 120, .4) 68%, rgba(247, 216, 120, 0) 78%,
    rgba(247, 216, 120, .5) 90%, rgba(247, 216, 120, 0) 100%);
  -webkit-mask-image: radial-gradient(circle, #000 34%, transparent 70%);
  mask-image: radial-gradient(circle, #000 34%, transparent 70%);
  filter: blur(.4px);
  animation: raysSpin 6s linear infinite, raysIn .5s ease-out;
}
@keyframes raysSpin { to { transform: rotate(360deg); } }
@keyframes raysIn { from { opacity: 0; transform: scale(.6); } to { opacity: 1; transform: scale(1); } }

.reward-card {
  position: relative;
  min-width: 200px;
  max-width: 84vw;
  padding: 14px 18px 16px;
  text-align: center;
  border: 2px solid #c49a4c;
  border-radius: 10px;
  background: linear-gradient(160deg, #fffbed, #f2e2bd);
  box-shadow: 0 0 0 3px rgba(255, 226, 140, .55), 0 0 60px rgba(255, 206, 70, .95), 0 20px 56px rgba(40, 30, 10, .4);
  animation: rewardPop .5s cubic-bezier(.2, 1.7, .45, 1);
}
@keyframes rewardPop {
  0% { opacity: 0; transform: scale(.55) translateY(10px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.reward-title {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 2px;
  color: #7a5410;
}

.reward-gain {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}
.gain-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  animation: chipIn .45s cubic-bezier(.2, 1.8, .45, 1) backwards;
}
.gain-chip b {
  font-size: 10px;
  font-weight: 400;
  color: #5d4a22;
  white-space: nowrap;
}
@keyframes chipIn {
  0% { opacity: 0; transform: scale(.3) rotate(-12deg); }
  100% { opacity: 1; transform: scale(1) rotate(0); }
}
.gain-orb {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fffdf0, #f7d878 42%, #c58a2d);
  box-shadow: 0 0 16px rgba(247, 216, 120, .95);
  animation: orbPulse 1.1s ease-in-out infinite;
}
@keyframes orbPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.spark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  margin: -3px;
  border-radius: 50%;
  background: #f7d878;
  box-shadow: 0 0 8px #f7d878;
  animation: sparkFly .95s ease-out forwards;
}
@keyframes sparkFly {
  0% { opacity: 1; transform: rotate(var(--a)) translateX(0) scale(1); }
  100% { opacity: 0; transform: rotate(var(--a)) translateX(150px) scale(.2); }
}

/* ---------- 自定义外观 ---------- */

.avatar-card.custom { grid-column: 1 / -1; }
.avatar-card.custom .avatar-art { max-width: 76px; transition: max-width .2s; }
.avatar-card.custom.on .avatar-art { max-width: 120px; }

.custom-editor {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px 10px;
  margin-bottom: 10px;
  border: 1px dashed #cbb077;
  border-radius: 6px;
  background: rgba(255, 249, 229, .75);
  max-height: 34vh;
  overflow-y: auto;
  overflow-x: hidden;
}
.cs-row { display: flex; align-items: center; gap: 8px; }
.cs-row > span {
  flex: 0 0 30px;
  font-size: 10px;
  color: var(--gold);
  letter-spacing: 1px;
}
.cs-chips { display: flex; flex-wrap: wrap; gap: 4px; flex: 1 1 auto; }
.cs-chip {
  padding: 3px 8px;
  font-family: inherit;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 252, 244, .9);
  color: var(--ink-2);
  cursor: pointer;
}
.cs-chip.on { border-color: var(--gold); background: linear-gradient(180deg, #f7d878, #c58a2d); color: #3d280c; font-weight: 700; }
.cs-swatch {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid rgba(255, 253, 246, .9);
  box-shadow: 0 0 0 1px rgba(120, 100, 60, .35);
  cursor: pointer;
}
.cs-swatch.on { box-shadow: 0 0 0 2px var(--gold), 0 0 8px rgba(197, 138, 45, .6); }

.crit-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 400;
  letter-spacing: 1px;
  color: #7a3a00;
  border-radius: 3px;
  background: linear-gradient(180deg, #ffe08a, #e8b23c);
  animation: critPop .5s cubic-bezier(.2, 1.7, .45, 1);
}
@keyframes critPop {
  0% { opacity: 0; transform: scale(.5); }
  100% { opacity: 1; transform: scale(1); }
}
.timeout-badge {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 400;
  color: #8a3824;
  border: 1px solid rgba(168, 68, 42, .45);
  border-radius: 3px;
  background: rgba(255, 240, 232, .8);
}

.study-warn {
  flex: 0 0 auto;
  margin: 0 0 8px;
  padding: 8px 10px;
  border: 1px dashed rgba(168, 68, 42, .55);
  border-radius: 6px;
  background: rgba(255, 243, 234, .9);
}
.study-warn b {
  display: block;
  font-size: 12px;
  color: #8a3824;
  margin-bottom: 4px;
}
.study-warn p {
  margin: 0 0 6px;
  font-size: 10px;
  line-height: 1.6;
  color: var(--ink-2);
}
.study-warn .btn-ghost.sm { padding: 4px 10px; }

.lv-sub {
  margin: 6px 0 10px;
  font-size: 10px;
  line-height: 1.6;
  color: rgba(255, 248, 228, .72);
}
.lv-actions { display: flex; gap: 8px; justify-content: center; }
.lv-actions .btn, .lv-actions .btn-ghost { min-width: 104px; }
.lv-skip { border-color: rgba(255, 240, 200, .5); color: rgba(255, 248, 228, .85); }

/* ---------- 功法条 ---------- */

.gongfa-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 8px;
  margin-bottom: 8px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 251, 240, .8);
}
.gongfa-label {
  flex: 0 0 auto;
  font-size: 10px;
  letter-spacing: 1px;
  color: var(--gold);
}
.gongfa-bar select { flex: 0 1 150px; padding: 4px 6px; font-size: 11px; }
.gongfa-bar em {
  flex: 1 1 100%;
  font-style: normal;
  font-size: 10px;
  color: var(--teal);
  letter-spacing: .5px;
}

/* ---------- 坊市 ---------- */

.hall-shop {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  margin-top: 2px;
  font-family: inherit;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(135deg, #fdfaf3, #f1e8d6);
  cursor: pointer;
  transition: border-color .16s, transform .16s;
}
.hall-shop:hover { border-color: var(--gold); transform: translateY(-1px); }
.hall-shop-ico {
  flex: 0 0 30px;
  height: 30px;
  line-height: 30px;
  text-align: center;
  font-family: var(--serif);
  font-size: 15px;
  color: #7a5410;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 32%, #fff3c8, #d9a94a);
}
.hall-shop-body { flex: 1 1 auto; min-width: 0; }
.hall-shop-body b { display: block; font-family: var(--serif); font-size: 13px; letter-spacing: 2px; color: var(--ink); }
.hall-shop-body em { font-style: normal; font-size: 10px; color: var(--ink-2); }
.hall-shop i { font-style: normal; color: var(--gold); font-size: 13px; }

.shop-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.shop-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: rgba(255, 252, 244, .85);
}
.shop-item.poor { opacity: .72; }
.shop-art { flex: 0 0 52px; }
.shop-body { flex: 1 1 auto; min-width: 0; }
.shop-head { display: flex; align-items: baseline; gap: 6px; }
.shop-head b { font-family: var(--serif); font-size: 13px; letter-spacing: 1px; color: var(--ink); }
.shop-tag { font-size: 9px; padding: 1px 5px; border-radius: 3px; background: rgba(147, 113, 44, .14); color: var(--gold); }
.shop-desc { margin: 3px 0 5px; font-size: 10px; line-height: 1.5; color: var(--ink-2); }
.shop-cost { display: flex; flex-wrap: wrap; gap: 8px; }
.shop-cost span { display: inline-flex; align-items: center; gap: 3px; font-size: 10px; }
.shop-cost em { font-style: normal; color: var(--ink-2); }
.shop-cost span.ok em { color: #2f7a4d; }
.shop-cost span.no em { color: #a8442a; }
.shop-item > .btn, .shop-item > .btn-ghost { flex: 0 0 auto; padding: 6px 12px; font-size: 12px; }
.shop-item.soldout { opacity: .55; }
.shop-qi { font-size: 10px; color: var(--teal); }
.shop-limit { margin-left: auto; font-size: 9px; color: var(--ink-2); opacity: .8; }
.shop-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  margin-bottom: 8px;
  font-size: 10px;
  color: var(--ink-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: rgba(255, 251, 240, .7);
}

.stone-num { color: #7a5410; font-weight: 600; }

/* 坊市：灵石价格 */
.shop-price { display: flex; align-items: center; gap: 5px; font-size: 11px; }
.stone-icon {
  width: 15px; height: 15px; line-height: 15px; text-align: center;
  font-size: 9px; color: #fffbed; border-radius: 3px;
  background: linear-gradient(180deg, #9fd6d0, #2f5d62);
}
.shop-price b { font-size: 13px; }
.shop-price b.ok { color: #7a5410; }
.shop-price b.no { color: #a8442a; }
.shop-price s { font-size: 10px; color: var(--ink-2); opacity: .6; }
.shop-price i { font-style: normal; font-size: 9px; color: var(--ink-2); opacity: .7; margin-left: auto; }
.deal-tag { font-style: normal; font-size: 9px; padding: 1px 5px; border-radius: 3px; color: #8a3824; background: rgba(255, 226, 140, .7); }

/* 收购 */
.buyer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 7px; }
.buyer-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 8px;
  background: rgba(255, 252, 244, .85);
}
.buyer-art { flex: 0 0 46px; }
.buyer-body { flex: 1 1 auto; min-width: 0; }
.buyer-body b { display: block; font-size: 12px; color: var(--ink); }
.buyer-body span { font-size: 10px; color: var(--ink-2); }
.buyer-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 3px; }
.buyer-actions .btn-ghost { padding: 3px 8px; font-size: 10px; }
.buyer-empty { padding: 16px 10px; text-align: center; font-size: 11px; color: var(--ink-2); }
.buyer-quote {
  margin-bottom: 8px;
  padding: 8px 10px;
  font-family: var(--serif);
  font-size: 11px;
  line-height: 1.75;
  color: #5d4a22;
  border-left: 3px solid var(--gold);
  background: rgba(255, 249, 229, .8);
  border-radius: 0 5px 5px 0;
}
.buyer-demand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
  padding: 7px 9px;
  margin-bottom: 8px;
  border: 1px dashed rgba(168, 68, 42, .45);
  border-radius: 6px;
  background: rgba(255, 243, 234, .75);
  font-size: 10px;
}
.buyer-demand span { color: #8a3824; letter-spacing: 1px; }
.buyer-demand b { font-size: 11px; color: var(--ink); font-weight: 600; }
.buyer-demand em { font-style: normal; color: var(--ink-2); opacity: .8; }
.buyer-item.hot { border-color: rgba(168, 68, 42, .5); background: rgba(255, 246, 240, .9); }
.hot-tag {
  font-style: normal;
  margin-left: 5px;
  padding: 1px 5px;
  font-size: 9px;
  border-radius: 3px;
  color: #8a3824;
  background: rgba(255, 214, 150, .8);
}

.shop-tabs { display: flex; gap: 6px; margin-bottom: 8px; }
.shop-tab {
  flex: 1 1 0; padding: 6px 8px; font-family: inherit; font-size: 11px;
  border: 1px solid var(--line); border-radius: 5px;
  background: rgba(255, 252, 244, .85); color: var(--ink-2); cursor: pointer;
}
.shop-tab.on { border-color: var(--gold); background: linear-gradient(180deg, #f7d878, #c58a2d); color: #3d280c; font-weight: 700; }
.shop-bar-btns { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.shop-item.rare { border-color: rgba(147, 113, 44, .55); background: linear-gradient(135deg, #fffdf5, #f7edd6); }
.rare-tag { background: rgba(197, 138, 45, .22); color: #7a5410; }

.bag-note { font-size: 10px; color: var(--ink-2); opacity: .7; font-family: inherit; letter-spacing: 0; font-weight: 400; }
.bag-empty { grid-column: 1 / -1; margin: 0; padding: 10px 0; font-size: 10px; color: var(--ink-2); }

.battle-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 8px;
  margin-bottom: 6px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: rgba(255, 251, 240, .7);
}
.battle-pills > span { font-size: 10px; color: var(--gold); letter-spacing: 1px; }
.battle-pills i { font-style: normal; font-size: 9px; color: var(--ink-2); opacity: .7; margin-left: auto; }
.pill-btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 8px 3px 4px;
  font-family: inherit;
  font-size: 10px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 252, 244, .95);
  color: var(--ink);
  cursor: pointer;
}
.pill-btn:hover { border-color: var(--gold); }
.pill-btn em { font-style: normal; }
.pill-btn b { font-size: 9px; color: var(--ink-2); font-weight: 400; }

.topbar-actions { display: flex; gap: 6px; align-items: center; }
.player-title {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 9px;
  letter-spacing: 1px;
  color: #7a5410;
  border-radius: 3px;
  background: rgba(197, 138, 45, .18);
  vertical-align: middle;
}

/* ---------- 设置 ---------- */

/* 吸顶分区条：设置页太长，点到哪滚到哪；底部细线是本页阅读进度 */
.set-jump {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; gap: 5px; overflow-x: auto;
  margin: -14px -16px 12px; padding: 7px 12px 9px;
  background: linear-gradient(180deg, var(--paper) 72%, rgba(243, 238, 225, .9));
  border-bottom: 1px solid var(--line-soft);
  scrollbar-width: none;
}
.set-jump::-webkit-scrollbar { display: none; }
.set-jump button {
  flex: 0 0 auto; padding: 3px 9px; font-family: inherit; font-size: 11px;
  color: var(--ink-2); background: rgba(255, 252, 244, .8);
  border: 1px solid var(--line); border-radius: 11px; cursor: pointer;
}
.set-jump button.on { color: #7a5410; border-color: rgba(147, 113, 44, .45); background: rgba(197, 138, 45, .14); }
.set-jump-track { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(216, 205, 180, .55); }
.set-jump-track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #93712c, #c9a44f); transition: width .1s linear; }

.set-row { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.set-row .text-input { flex: 1 1 auto; }
.set-avatars { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.set-avatar {
  flex: 0 0 62px;
  padding: 4px 2px 5px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 252, 244, .85);
  cursor: pointer;
}
.set-avatar.on { border-color: var(--gold); box-shadow: 0 0 0 2px rgba(197, 138, 45, .3); background: #fffaf0; }
.set-avatar-art { width: 44px; margin: 0 auto; }
.set-avatar-art .portrait-svg { width: 100%; height: auto; }
.set-avatar b { display: block; font-size: 9px; font-weight: 400; color: var(--ink-2); margin-top: 2px; }

.set-titles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 5px; margin-bottom: 10px; }
.set-title {
  display: block;
  width: 100%;
  padding: 7px 9px;
  text-align: left;
  font-family: inherit;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 252, 244, .85);
  cursor: pointer;
}
.set-title.on { border-color: var(--gold); background: linear-gradient(135deg, #fffaf0, #f3e6c8); }
.set-title b { font-family: var(--serif); font-size: 12px; letter-spacing: 1px; color: var(--ink); }
.set-title em { font-style: normal; font-size: 9px; color: var(--gold); }
.set-title span { display: block; margin-top: 2px; font-size: 10px; color: var(--ink-2); }

.set-switch { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--ink); }
.set-vol-label { flex: 0 0 auto; font-size: 11px; color: var(--ink-2); }
.set-vol-val { margin-left: auto; font-size: 11px; color: var(--gold); }
.set-range { flex: 1 1 auto; }

.stone-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.stone-tile {
  flex: 1 1 70px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 7px 6px 6px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 252, 244, .85);
}
.stone-tile.empty { opacity: .45; }
.stone-dot {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  box-shadow: 0 0 8px rgba(0, 0, 0, .12) inset, 0 0 6px rgba(247, 216, 120, .6);
}
.dot-xia { background: radial-gradient(circle at 38% 32%, #fffdf0, #f0e2b8 45%, #c9b06a); }
.dot-zhong { background: radial-gradient(circle at 38% 32%, #f4fffd, #a8dcd6 45%, #2f7d75); }
.dot-shang { background: radial-gradient(circle at 38% 32%, #f6f0ff, #c3aee0 45%, #6b4a8a); }
.dot-ji { background: radial-gradient(circle at 38% 32%, #fff6e8, #f5b96a 45%, #8a4a1a); }
.stone-tile b { font-size: 9px; font-weight: 400; color: var(--ink-2); }
.stone-tile em { font-style: normal; font-size: 12px; color: var(--ink); }

.hint-toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 78px;
  z-index: 62;
  margin: 0 auto;
  max-width: 456px;
  padding: 8px 12px;
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  color: #5d4a22;
  border: 1px solid rgba(201, 174, 115, .8);
  border-radius: 18px;
  background: rgba(255, 250, 235, .96);
  box-shadow: 0 4px 16px rgba(60, 50, 20, .18);
  pointer-events: none;
  animation: hintIn .28s ease-out;
}
@keyframes hintIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.act-msg { min-height: 16px; font-size: 10px; line-height: 1.5; margin-top: 4px; }
.act-msg.bad { color: #a8442a; }

.update-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 9px 12px;
  font-size: 12px;
  color: #fffbed;
  background: linear-gradient(180deg, #8a3824, #6d2b1b);
  box-shadow: 0 -4px 16px rgba(60, 20, 10, .35);
}
.update-bar button {
  padding: 4px 12px;
  font-family: inherit;
  font-size: 12px;
  color: #6d2b1b;
  border: 0;
  border-radius: 4px;
  background: linear-gradient(180deg, #ffe08a, #e8b23c);
  cursor: pointer;
}

/* ---------- 仙榜 ---------- */

.rank-ico { background: radial-gradient(circle at 38% 32%, #e8f4ff, #7f9fb8); color: #1f3a4a; }
.rank-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.rank-row {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  grid-template-areas: "no name realm" "no sub1 sub2";
  gap: 1px 8px;
  padding: 7px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  background: rgba(255, 252, 244, .88);
}
.rank-row.top1 { border-color: #d4af37; background: linear-gradient(135deg, #fffbe8, #f7ecc8); }
.rank-row.top2 { border-color: #b8b8b8; background: linear-gradient(135deg, #fdfcf8, #f0efea); }
.rank-row.top3 { border-color: #c9956a; background: linear-gradient(135deg, #fdf6ef, #f4e6d6); }
.rank-no { grid-area: no; align-self: center; font-family: var(--serif); font-size: 15px; color: var(--gold); text-align: center; }
.rank-name { grid-area: name; font-size: 12px; color: var(--ink); font-weight: 600; }
.rank-realm { grid-area: realm; font-size: 10px; color: var(--teal); }
.rank-sub { font-size: 9px; color: var(--ink-2); }
.rank-row .rank-sub:nth-of-type(1) { grid-area: sub1; }
.rank-row .rank-sub:nth-of-type(2) { grid-area: sub2; text-align: right; }
.rank-empty { padding: 22px 10px; text-align: center; font-size: 11px; color: var(--ink-2); }

/* ---------- 账号 ---------- */

.acc-inline { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; font-size: 12px; color: var(--ink); }
.acc-card {
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 252, 244, .9);
}
.acc-line { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; padding: 3px 0; }
.acc-line span { color: var(--ink-2); }
.acc-line b { color: var(--ink); font-weight: 600; }
.acc-form { display: flex; flex-direction: column; gap: 8px; }
.acc-field { display: flex; align-items: center; gap: 8px; }
.acc-field span { flex: 0 0 52px; font-size: 11px; color: var(--ink-2); }
.acc-field .text-input { flex: 1 1 auto; }
.acc-msg { min-height: 16px; font-size: 11px; color: #2f7a4d; }
.acc-msg.bad { color: var(--red); }
.acc-choose {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 78;
  padding: 10px 12px; text-align: center;
  background: rgba(255, 250, 235, .98);
  border-top: 1px solid var(--line);
}
.acc-choose button {
  padding: 8px 16px; font-family: inherit; font-size: 12px;
  color: #fffbed; border: 0; border-radius: 6px; cursor: pointer;
  background: linear-gradient(180deg, #2f5d62, #23474b);
}

/* 账号页分区：账号名锁死、昵称可改、曾用名留档 */
.acc-sec { margin-bottom: 16px; }
.acc-sec-title {
  display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap;
  margin: 0 0 8px; padding-left: 8px; border-left: 3px solid var(--gold);
  font-size: 13px; letter-spacing: 1px; color: var(--ink);
}
.acc-sec-title small { font-size: 10px; font-weight: 400; letter-spacing: 0; color: var(--ink-2); }
.acc-sec-danger .acc-sec-title { border-left-color: var(--cinnabar); }
.acc-name-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255, 252, 244, .9);
}
.acc-name-label { flex: 0 0 44px; font-size: 11px; color: var(--ink-2); }
.acc-name-val { flex: 1 1 auto; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-name-lock {
  flex: 0 0 auto; padding: 1px 7px; font-size: 10px; color: #8a7a55;
  border: 1px solid rgba(147, 113, 44, .35); border-radius: 10px;
  background: rgba(147, 113, 44, .08);
}
.acc-nick-input { flex: 1 1 auto; min-width: 0; }
.acc-name-row .btn { flex: 0 0 auto; padding: 6px 14px; font-size: 12px; }
.acc-nick-meta { margin: -2px 0 6px 52px; font-size: 10px; color: var(--ink-2); }
.acc-history { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 11px; }
.acc-history-label { font-size: 10px; color: var(--ink-2); }
.acc-old-nick {
  padding: 2px 8px; font-size: 11px; color: var(--teal);
  border: 1px solid rgba(47, 93, 98, .18); border-radius: 10px;
  background: rgba(47, 93, 98, .08);
}
.acc-history-none { font-style: normal; font-size: 11px; color: var(--ink-2); }
.set-acct-lock { padding-top: 2px; font-size: 11px; color: var(--ink-2); }
.set-acct-lock b { color: var(--ink); }
.set-acct-lock i {
  font-style: normal; font-size: 10px; color: #8a7a55;
  border: 1px solid rgba(147, 113, 44, .35); border-radius: 10px; padding: 1px 6px;
}

/* ---------- 开局强制登录遮罩 ---------- */

.account-gate-box {
  width: min(92vw, 420px);
  padding: 22px 20px 18px;
}
.gate-title {
  font-family: var(--serif);
  font-size: 20px;
  letter-spacing: 4px;
  margin: 6px 0 10px;
  color: var(--ink);
  text-align: center;
}
.gate-sub {
  margin: 0 0 16px;
  font-size: 11px;
  line-height: 1.8;
  color: var(--ink-2);
  text-align: center;
}
.account-gate-box .acc-form { gap: 10px; }
.account-gate-box .acc-field span { flex: 0 0 48px; font-size: 11px; }
.account-gate-box .acc-field .text-input { padding: 8px 10px; font-size: 13px; }
.account-gate-box .row-btns { margin-top: 4px; }
.account-gate-box .row-btns .btn,
.account-gate-box .row-btns .btn-ghost { flex: 1 1 0; padding: 9px 10px; font-size: 13px; }
.gate-back {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  text-align: center;
}
.gate-back .btn-ghost { font-size: 11px; padding: 6px 14px; }

/* 身份选择 */
.identity-choices {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}
.identity-choices .btn,
.identity-choices .btn-ghost {
  width: 100%;
  padding: 11px 12px;
  font-size: 13px;
  letter-spacing: 1px;
}

/* ---------- 更新公告 ---------- */

.notice-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-left: 3px;
  border-radius: 50%;
  background: #c0392b;
  vertical-align: super;
}

.notice-box {
  width: min(94vw, 460px);
  height: 82vh;
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.notice-box .gate-title,
.notice-box .gate-sub { flex: 0 0 auto; }
.notice-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 4px 6px 4px 0;
}
.notice-item {
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  padding: 10px 12px;
  background: rgba(255, 252, 244, .92);
}
.notice-item.newest { border-color: rgba(147, 113, 44, .6); background: linear-gradient(135deg, #fffdf5, #f8efdb); }
.notice-item header {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}
.notice-item header b {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 1px;
  color: var(--ink);
}
.notice-item header span { font-size: 9px; color: var(--ink-2); margin-left: auto; }
.notice-new {
  font-style: normal;
  font-size: 9px;
  color: #fffbed;
  background: #c0392b;
  padding: 1px 5px;
  border-radius: 3px;
}
.notice-item ul { margin: 0; padding-left: 15px; }
.notice-item li { font-size: 11px; line-height: 1.8; color: var(--ink); }

/* ---------- 设置全屏（盖住整个界面） ---------- */

body.settings-gate #panel {
  position: fixed;
  inset: 0;
  z-index: 72;
  width: 100%;
  max-width: none;
  height: 100vh;
  height: 100dvh;      /* 移动端地址栏伸缩时更准 */
  max-height: none;    /* 关键：原本的 65vh 会把这层截断，下面点不到 */
  margin: 0;
  padding: 18px 16px 96px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #f7f3e8;
}
body.settings-gate .topbar,
body.settings-gate .status-strip,
body.settings-gate .scene-frame,
body.settings-gate .mentor-bar,
body.settings-gate .scroll-guide,
body.settings-gate .bottom-nav { display: none !important; }

/* 教程指向箭头 */
.tutorial-arrow {
  position: fixed;
  width: 30px;
  height: 30px;
  margin: 0;
  pointer-events: none;
  display: none;
  transform-origin: center center;
  z-index: 62;
}
.tutorial-arrow b {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, #f0c052, #c9861d);
  clip-path: polygon(50% 0%, 100% 100%, 50% 72%, 0% 100%);
  filter: drop-shadow(0 2px 5px rgba(120, 80, 10, .5));
  animation: arrowBob .7s ease-in-out infinite alternate;
}
@keyframes arrowBob {
  from { transform: translateY(2.5px) scale(.93); opacity: .8; }
  to { transform: translateY(-2.5px) scale(1.07); opacity: 1; }
}

/* ---------- 屏幕适配：手机 → 平板 → 桌面 ---------- */

/* 大一点的手机 / 小平板：栏宽放宽 */
@media (min-width: 560px) {
  #app { max-width: 540px; }
  .bottom-nav { max-width: 540px; }
  #panel { max-height: 68vh; }
  .tutorial-card { width: min(500px, calc(100vw - 40px)); }
}

/* 平板竖屏：内容更宽，面板给更高 */
@media (min-width: 768px) {
  #app { max-width: 600px; border-radius: 0; }
  .bottom-nav { max-width: 600px; }
  #panel { max-height: 70vh; padding-left: 22px; padding-right: 22px; }
  .notice-box,
  .account-gate-box { width: min(88vw, 520px); }
}

/* 桌面浏览器：居中窄栏 + 左右留白，保持“掌上修仙”的观感 */
@media (min-width: 1024px) {
  #app {
    max-width: 620px;
    box-shadow: 0 0 60px rgba(63, 45, 16, .18);
  }
  #panel { max-height: 72vh; }
  .bottom-nav { max-width: 620px; }
}

/* 横屏手机 / 矮屏：把纵向高度让给内容 */
@media (max-height: 560px) and (orientation: landscape) {
  #panel { max-height: 52vh; }
  .scene-frame { display: none; }
  .scroll-guide { display: none; }
}

/* ---------- 玩家反馈 ---------- */

.feedback-box {
  width: min(94vw, 480px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
}
.fb-input {
  width: 100%;
  min-height: 96px;
  resize: vertical;
  font-size: 13px;
  line-height: 1.7;
  font-family: inherit;
}
.fb-contact { width: 100%; margin-top: 8px; font-size: 12px; }
.fb-history {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
  flex: 1 1 auto;
}
.fb-item {
  border: 1px solid var(--line-soft);
  border-radius: 7px;
  padding: 8px 10px;
  margin-bottom: 8px;
  background: rgba(255, 252, 244, .92);
}
.fb-item-head {
  display: flex;
  justify-content: space-between;
  font-size: 9px;
  color: var(--ink-2);
  margin-bottom: 4px;
}
.fb-item-head em { font-style: normal; color: #8a6a2f; }
.fb-item-head em.done { color: #2f7a4d; }
.fb-item-text {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.fb-reply {
  margin-top: 8px;
  padding: 7px 9px;
  border-left: 3px solid var(--gold);
  background: rgba(255, 249, 229, .92);
  border-radius: 0 5px 5px 0;
}
.fb-reply b { display: block; font-size: 9px; color: var(--gold); margin-bottom: 3px; }
.fb-reply p { margin: 0; font-size: 11px; line-height: 1.7; white-space: pre-wrap; }
.fb-empty { padding: 14px 0; text-align: center; font-size: 11px; color: var(--ink-2); }

/* 隐藏工具类必须压过所有 overlay 的 display:flex */
.hidden { display: none !important; }

/* ══════════════════════════════════════════════════════════════
   手机窄屏（≤559px）：一屏放下尽可能多的内容
   目标：① 标题不换行 ② 四个顶栏按钮排一行 ③ 场景图压扁
        ④ #panel 用 calc 算高度，避免「页面滚一层、面板再滚一层」
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 559px) {
  .topbar { padding: 4px 10px 3px; gap: 6px; flex-wrap: nowrap; }
  .brand { min-width: 0; }
  .brand h1 { font-size: 17px; letter-spacing: 1px; white-space: nowrap; }
  .tag { font-size: 9px; letter-spacing: 1px; margin-top: 1px; }

  .topbar-actions { gap: 4px; flex: 0 0 auto; }
  .pill-btn { padding: 3px 6px; min-height: 28px; font-size: 9px; gap: 2px; white-space: nowrap; }
  .pill-btn b { display: none; }

  .status-strip { padding: 0 10px 6px; }
  .strip-top { gap: 6px; flex-wrap: nowrap; }
  .strip-top .realm-name { font-size: 17px; }

  .scene-frame { margin: 0 8px; }
  .scene { height: 156px; }

  .mentor-bar { margin: 6px 8px 0; padding: 7px 9px; font-size: 11px; line-height: 1.55; }
  .scroll-guide { margin: 6px 8px 0; padding: 3px 7px; font-size: 9px; }

  #panel { min-height: 0; padding: 10px 12px 16px; }
}

/* 极窄屏（≤360px）：再收一档 */
@media (max-width: 360px) {
  .brand h1 { font-size: 15px; letter-spacing: 0; }
  .pill-btn { padding: 2px 4px; font-size: 8px; }
  .scene { height: 112px; }
  #panel { min-height: 0; }
}

/* 平板 / 桌面：场景图放大一点，高度按视口给 */
@media (min-width: 768px) {
  .scene { height: auto; max-height: 240px; }
}

/* ---------- 六艺制作：每阶五件成品 ---------- */
.tier-group { margin: 10px 0 14px; border: 1px solid var(--line); border-radius: 6px; padding: 8px 9px 10px; background: rgba(255,252,244,.5); }
.tier-group-active { border-color: #c49a4c; background: linear-gradient(180deg, rgba(247,231,190,.55), rgba(255,252,244,.4)); }
.tier-group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.tier-group-head b { font-family: var(--serif); font-size: 14px; color: var(--gold); letter-spacing: 1px; }
.tier-group-head span { font-size: 10px; color: var(--ink-2); }
.tier-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.tier-card { border: 1px solid var(--line); border-radius: 6px; padding: 7px 7px 8px; background: rgba(255,253,246,.9); display: flex; flex-direction: column; gap: 4px; }
.tier-card-top { display: flex; align-items: center; gap: 5px; }
.tier-card-top b { flex: 1 1 auto; min-width: 0; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tier-card-top small { flex: 0 0 auto; font-size: 9px; color: var(--ink-2); }
.tier-card-fx { margin: 0; font-size: 10px; line-height: 1.5; color: #7a5410; }
.tier-card .recipe-material { margin: 0; font-size: 10px; padding: 3px 6px; }
.tier-card-btn { padding: 5px 6px; font-size: 11px; margin-top: 2px; }
@media (max-width: 380px) { .tier-grid { grid-template-columns: 1fr; } }

/* ---------- 仙榜：三榜切换 + 挑战按钮 ---------- */
.rank-tabs { margin: 10px 0 8px; }
.rank-subs { display: flex; gap: 6px; flex-wrap: wrap; margin: 0 0 10px; }
.rank-sub-chip {
  padding: 5px 11px;
  font-family: inherit;
  font-size: 11px;
  color: var(--ink-2);
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 252, 244, .75);
  cursor: pointer;
}
.rank-sub-chip.active { border-color: var(--gold); background: linear-gradient(180deg, #f7d878, #c58a2d); color: #3d280c; font-weight: 700; }
.rank-row {
  grid-template-columns: 26px 1fr auto auto;
  grid-template-areas: "no name realm fight" "no sub1 sub2 fight";
}
.rank-row .rank-sub:nth-of-type(1) { grid-area: sub1; text-align: left; }
.rank-row .rank-sub:nth-of-type(2) { grid-area: sub2; text-align: right; }
.rank-fight { grid-area: fight; align-self: center; padding: 4px 9px; font-size: 11px; white-space: nowrap; }
@media (max-width: 380px) {
  .rank-row { grid-template-columns: 22px 1fr auto; grid-template-areas: "no name realm" "no sub1 sub2" "no fight fight"; }
  .rank-fight { justify-self: stretch; margin-top: 4px; }
}

/* ══════════════════════════════════════════════════════════════
   整屏固定：页面本身永不滚动，只有内容面板内部滚动
   主界面（大殿）压进一屏，其余子页在 #panel 里滚
   ══════════════════════════════════════════════════════════════ */
html, body { height: 100%; overflow: hidden; }

#app {
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.topbar,
.status-strip,
.scene-frame,
.mentor-bar,
.scroll-guide { flex: 0 0 auto; }

/* #panel 是唯一滚动容器：flex 已经算出高度，别再叠一层 max-height，
   两层高度约束打架时面板会在滚动中反复改变可视高度，手感直接乱掉 */
#panel {
  flex: 1 1 auto;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;   /* 内容重绘时别让浏览器偷偷挪滚动位置（表现为「弹回去」） */
  -webkit-overflow-scrolling: touch;
}

/* 大殿：两扇门并排 + 两张小卡并排，明细默认收起 */
.hall { display: flex; flex-direction: column; gap: 8px; }
.hall-title h2 { margin: 0 0 2px; }
.hall-title p { margin: 0; font-size: 11px; color: var(--ink-2); }
.hall-doors { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hall-doors .door { flex-direction: column; align-items: flex-start; gap: 6px; padding: 8px 9px; }
.hall-doors .door-art { width: 100%; }
.hall-doors .door-art svg { width: 100%; height: auto; max-height: 86px; }
.hall-doors .door-body b { font-size: 13px; }
.hall-doors .door-body span { font-size: 10px; }
.hall-doors .door-body i { display: none; }
.hall-doors .door-foot { font-size: 10px; }
.hall-shops { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.hall-shops .hall-shop { margin-top: 0; padding: 7px 9px; }
.hall-shops .hall-shop-body em { font-size: 10px; }
.hall-more {
  width: 100%;
  padding: 7px 10px;
  font-family: inherit;
  font-size: 11px;
  color: var(--ink-2);
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: rgba(255, 252, 244, .6);
  cursor: pointer;
}
.hall-mirror.hidden { display: none; }

@media (max-width: 380px) {
  .hall-doors .door-art svg { max-height: 60px; }
  .hall-doors .door-foot { display: none; }
}

/* 大殿门卡：底部箭头贴底对齐，两扇门看起来一样高 */
.hall-doors .door-foot { margin-top: auto; }
.hall-doors .door { justify-content: flex-start; }

/* 桌面/平板：场景图不要抢太多高度，主界面同样尽量一屏放下 */
@media (min-width: 768px) {
  .scene { height: 190px; max-height: 190px; }
  .hall-doors .door-art svg { max-height: 56px; }
  .hall-mirror { grid-template-columns: 1fr 1fr; }
}
#panel { padding-bottom: 16px; }

/* 宽屏：两扇门改成「左图右文」的横条，整页高度立刻省一半 */
@media (min-width: 768px) {
  .hall-doors .door {
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
  }
  .hall-doors .door-art { flex: 0 0 78px; width: 78px; }
  .hall-doors .door-art svg { max-height: 78px; }
  .hall-doors .door-body { flex: 1 1 auto; min-width: 0; }
  .hall-doors .door-foot { margin-top: 0; white-space: nowrap; }
  .hall-doors .door-body i { display: block; font-size: 10px; color: var(--ink-2); }
}
@media (min-width: 768px) { #panel { padding-bottom: 16px; } }
/* 宽屏门卡那一行小字会把「入殿修炼」挤到中间，直接不显示 */
@media (min-width: 768px) { .hall-doors .door-body i { display: none; } }

/* ---------- 地图页：世界地图入口做主角 ---------- */
.map-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; margin: 8px 0 4px; }
.map-bar .btn { padding: 10px 12px; font-size: 13px; letter-spacing: 1px; }
.map-bar .btn-ghost { padding: 10px 14px; font-size: 12px; }

/* 洞府小像：再收一点，别喧宾夺主 */
.cave-hero { padding: 8px 10px; margin-bottom: 8px; }
.cave-hero-art { flex: 0 0 58px; }
.cave-hero-art svg { max-height: 58px; width: auto; }
.cave-hero-info p { display: none; }

/* ══════════════════════════════════════════════════════════════
   仙气动效：门上的打坐人物、环绕粒子、称号金光
   ══════════════════════════════════════════════════════════════ */

/* 环绕粒子：整组慢转，形成「灵气绕身」 */
.door-orbit { animation: doorSpin 14s linear infinite; }
.door-orbit-b { animation-duration: 10s; animation-direction: reverse; }

/* 打坐的人：极缓的呼吸起伏，像在吐纳 */
.door-monk { animation: monkBreath 4.8s ease-in-out infinite; transform-origin: 66px 76px; }
@keyframes monkBreath {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-1.2px) scale(1.012); }
}

/* 门内光晕呼吸 */
.door-main .door-svg > circle:first-of-type { animation: doorGlowPulse 5.2s ease-in-out infinite; }
@keyframes doorGlowPulse {
  0%, 100% { opacity: .85; }
  50% { opacity: 1; }
}

/* 称号：金光流转 + 外发光，佩戴处与列表都亮 */
.player-title {
  position: relative;
  overflow: hidden;
  color: #2b1c05 !important;
  border: 1px solid rgba(247, 216, 120, .85);
  background-image: linear-gradient(100deg, #8a5a17 0%, #f7d878 28%, #fff6cf 44%, #f7d878 58%, #8a5a17 100%);
  background-size: 240% 100%;
  animation: titleShine 4.5s linear infinite;
  box-shadow: 0 0 8px rgba(247, 216, 120, .55), inset 0 0 6px rgba(255, 246, 200, .55);
  text-shadow: 0 1px 0 rgba(255, 246, 200, .8);
}
@keyframes titleShine { to { background-position: -240% 0; } }

.set-title {
  position: relative;
  overflow: hidden;
}
.set-title.on {
  border-color: #d9a93a !important;
  box-shadow: 0 0 0 1px rgba(247, 216, 120, .7), 0 0 14px rgba(247, 216, 120, .45);
}
.set-title.on::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 30%, rgba(255, 246, 200, .75) 48%, transparent 66%);
  transform: translateX(-120%);
  animation: titleSweep 3.6s ease-in-out infinite;
  pointer-events: none;
}
@keyframes titleSweep {
  0%, 55% { transform: translateX(-120%); }
  85%, 100% { transform: translateX(120%); }
}

/* 标题与境界名的一点金粉感 */
.brand h1 {
  background-image: linear-gradient(100deg, #795217 0%, #b8862c 35%, #f3d489 50%, #b8862c 66%, #795217 100%);
  background-size: 220% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 9s linear infinite;
  text-shadow: none;
}
.realm-name { text-shadow: 0 0 10px rgba(247, 216, 120, .55); }

/* 装备四槽 */
.equip-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.equip-slot {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 7px 4px 8px;
  font-family: inherit;
  border: 1px dashed var(--line);
  border-radius: 7px;
  background: rgba(255, 252, 244, .7);
  cursor: pointer;
  min-height: 104px;
}
.equip-slot > span { font-size: 10px; color: var(--ink-2); letter-spacing: 1px; }
.equip-slot .equip-art { height: 42px; display: flex; align-items: center; justify-content: center; }
.equip-slot .equip-art i { font-style: normal; font-size: 11px; color: #b6a887; }
.equip-slot b { font-size: 10px; color: var(--ink); line-height: 1.3; text-align: center; }
.equip-slot em { font-style: normal; font-size: 9px; color: #8a7956; line-height: 1.3; text-align: center; }
.equip-slot.has { border-style: solid; border-color: #c49a4c; background: linear-gradient(180deg, #fff8dd, #f2e6c8); box-shadow: 0 0 0 1px rgba(247, 216, 120, .35); }
@media (max-width: 380px) { .equip-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* 换装弹层 */
.equip-pick-list { max-height: 46vh; overflow-y: auto; margin: 10px 0; }
.equip-pick-row { display: flex; align-items: center; gap: 9px; padding: 7px 6px; border-bottom: 1px dashed var(--line-soft); }
.equip-pick-row.on { background: rgba(247, 216, 120, .2); }
.equip-pick-info { flex: 1 1 auto; min-width: 0; }
.equip-pick-info b { display: block; font-size: 12px; }
.equip-pick-info em { font-style: normal; font-size: 10px; color: #7a5410; }

/* 教程聚光：目标以外压暗，中间留一个亮口——一次只指一个地方 */
.tutorial-spot {
  position: fixed;
  z-index: 60;
  display: none;
  pointer-events: none;
  border-radius: 8px;
  box-shadow: 0 0 0 9999px rgba(18, 22, 18, .34), 0 0 0 2px rgba(247, 216, 120, .95) inset;
  transition: left .18s ease, top .18s ease, width .18s ease, height .18s ease;
}
body.tutorial-active .tutorial-card { z-index: 63; }
.tutorial-arrow { z-index: 64; }

/* ---------- 图形化入口：坊市小铺 / 仙榜名次牌 / 底部导航线描图标 ---------- */
.hall-shop-art { flex: 0 0 46px; width: 46px; display: flex; align-items: center; justify-content: center; }
.hall-shop-art .mini-art { width: 46px; height: 46px; }
.hall-shop { align-items: center; }

.shop-banner { animation: shopBanner 3.2s ease-in-out infinite; transform-origin: 38px 13px; }
@keyframes shopBanner {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(6deg); }
}
.shop-lamp { animation: shopLamp 2.4s ease-in-out infinite; }
@keyframes shopLamp {
  0%, 100% { opacity: .55; }
  50% { opacity: 1; }
}

.rank-star { animation: rankStar 2.6s ease-in-out infinite; }
@keyframes rankStar {
  0%, 100% { transform: scale(1); opacity: .85; }
  50% { transform: scale(1.16) rotate(8deg); opacity: 1; }
}

.nav-ico { display: flex; align-items: center; justify-content: center; height: 20px; }
.nav-svg { width: 19px; height: 19px; display: block; }
.nav-btn .nav-ico { margin-bottom: 2px; }

/* ══════════════════════════════════════════════════════════════
   称号分级：1 青碧入门 → 2 靛蓝学问 → 3 紫/赤 → 4 鎏金 → 5 虹彩
   等级越高越亮、越会动
   ══════════════════════════════════════════════════════════════ */
.player-title,
.set-title { position: relative; overflow: hidden; }

/* 1 入门：青碧，素净 */
.title-r1 {
  color: #14453f !important;
  background-image: linear-gradient(100deg, #cfe9df, #8fc9b8 55%, #cfe9df);
  border-color: #7fb6a6;
  box-shadow: 0 0 6px rgba(120, 190, 170, .35);
}
/* 2 学问：靛蓝，带一点霜色 */
.title-r2 {
  color: #16294d !important;
  background-image: linear-gradient(100deg, #c9d8f2 0%, #8aa9dd 45%, #dfe9ff 55%, #8aa9dd 100%);
  background-size: 200% 100%;
  border-color: #7f9bd0;
  box-shadow: 0 0 10px rgba(120, 160, 230, .4);
  animation: titleShine 7s linear infinite;
}
/* 3 六艺/武备：紫赤过渡 */
.title-r3 {
  color: #2c1030 !important;
  background-image: linear-gradient(100deg, #d9b8f0 0%, #b06ad0 32%, #e8a0a0 58%, #b06ad0 82%, #d9b8f0 100%);
  background-size: 220% 100%;
  border-color: #a86bc4;
  box-shadow: 0 0 12px rgba(176, 106, 208, .45);
  animation: titleShine 6s linear infinite;
}
/* 4 渡劫/境界：鎏金 */
.title-r4 {
  color: #3a2506 !important;
  background-image: linear-gradient(100deg, #f5dda0 0%, #e0a83c 30%, #fff3c8 48%, #e0a83c 66%, #f5dda0 100%);
  background-size: 240% 100%;
  border-color: #e0b552;
  box-shadow: 0 0 14px rgba(224, 168, 60, .55), inset 0 0 8px rgba(255, 240, 190, .5);
  animation: titleShine 4.5s linear infinite;
}
/* 5 大修士：虹彩 + 呼吸光环 + 扫光 */
.title-r5 {
  color: #241a02 !important;
  background-image: linear-gradient(100deg, #9be7d8 0%, #8fc0ff 20%, #c9a6ff 40%, #ffb3c9 58%, #ffe08a 76%, #9be7d8 100%);
  background-size: 260% 100%;
  border-color: #ffd86b;
  box-shadow: 0 0 18px rgba(255, 216, 107, .6), 0 0 34px rgba(160, 200, 255, .4), inset 0 0 10px rgba(255, 255, 255, .6);
  animation: titleShine 3.4s linear infinite, titleBreath 2.8s ease-in-out infinite;
}
@keyframes titleBreath {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 216, 107, .45), 0 0 26px rgba(160, 200, 255, .3), inset 0 0 8px rgba(255, 255, 255, .5); }
  50% { box-shadow: 0 0 22px rgba(255, 216, 107, .8), 0 0 42px rgba(160, 200, 255, .6), inset 0 0 12px rgba(255, 255, 255, .75); }
}
.title-r5::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(115deg, transparent 34%, rgba(255, 255, 255, .85) 50%, transparent 66%);
  transform: translateX(-130%);
  animation: titleSweep 2.8s ease-in-out infinite;
  pointer-events: none;
}

/* ══════════════════════════════════════════════════════════════
   仙气背景：远山、月轮、云气、星子，压在一切内容之下
   ══════════════════════════════════════════════════════════════ */
#app { position: relative; background: transparent; }
.sky-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  border-radius: inherit;
}
/* 整页背景：AI 宗门全景铺满，上面盖一层宣纸色薄纱保证文字读得清。
   以前这里是一片渐变天空，看着就是「纯白」。 */
.sky-bg {
  background-image: url(../art/hall.jpg);
  background-size: cover;
  background-position: center 32%;
  background-repeat: no-repeat;
  background-color: #eef2ea;
}
.sky-bg svg { display: none; }
.sky-bg::after {
  content: '';
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 253, 246, .66) 0%, rgba(252, 249, 240, .58) 34%, rgba(248, 245, 236, .74) 100%);
}

#app > .topbar,
#app > .status-strip,
#app > .scene-frame,
#app > .mentor-bar,
#app > .scroll-guide,
#app > #panel,
#app > .bottom-nav { position: relative; z-index: 1; }
/* topbar 要浮在剧情弹层(storyOverlay z-index:20)之上，教程/剧情期间刷新键才点得到 */
#app > .topbar { z-index: 21; }

/* 云气缓慢漂移，星子一明一暗 */
.sky-clouds { animation: skyDrift 34s ease-in-out infinite alternate; }
.sky-clouds-b { animation: skyDrift 46s ease-in-out infinite alternate-reverse; }
@keyframes skyDrift {
  from { transform: translateX(-14px); }
  to { transform: translateX(14px); }
}
.sky-stars circle { animation: skyTwinkle 4.2s ease-in-out infinite; }
.sky-stars circle:nth-child(2n) { animation-delay: 1.1s; }
.sky-stars circle:nth-child(3n) { animation-delay: 2.3s; }
@keyframes skyTwinkle {
  0%, 100% { opacity: .25; }
  50% { opacity: .9; }
}

/* 内容区不要整块盖住背景，改成半透明宣纸 */
#app { background: linear-gradient(180deg, rgba(255, 253, 245, .58), rgba(250, 250, 242, .42)); }
#panel { background: linear-gradient(180deg, rgba(255, 252, 241, .52), rgba(255, 253, 246, .2) 180px); }

/* 装备标签 */
.equip-tag {
  display: inline-block;
  margin: 4px 0 3px;
  padding: 2px 8px;
  font-style: normal;
  font-size: 10px;
  letter-spacing: 1px;
  color: #2f6b4f;
  border: 1px solid #7fb99a;
  border-radius: 10px;
  background: rgba(180, 226, 200, .45);
}
.equip-tag.on { color: #7a4a06; border-color: #d9a93a; background: rgba(247, 216, 120, .38); }
p.hint.equip-tip { margin: 2px 0 8px; }

/* ══════════════════════════════════════════════════════════════
   大殿：云海宗门全景，点建筑进功能
   ══════════════════════════════════════════════════════════════ */
.hall-scene-wrap {
  position: relative;
  width: 100%;
  flex: 1 1 auto;
  min-height: 150px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
/* 画面实际尺寸由 fitHallScene() 按剩余高度算好写进来，热区百分比才对得上 */
.hall-stage { position: relative; background: #eef2ea; border-radius: 10px; overflow: hidden; }
.hall-art { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; -webkit-user-drag: none; }
.hall-svg { display: block; width: 100%; height: 100%; }
/* 矮屏（小手机横屏 / 老机型）：标题只是装饰，先让它让位给画面 */
@media (max-height: 700px) {
  .hall-title { display: none; }
}
.hall-svg text { text-anchor: middle; }
.hall-label { font-size: 9px; fill: #4a4640; letter-spacing: .5px; }
.hall-plaque { font-size: 8px; fill: #ffe9b0; letter-spacing: 1px; }

.hall-hot {
  position: absolute;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0;
  cursor: pointer;
  transition: transform .12s ease;
  -webkit-tap-highlight-color: transparent;
}
.hall-hot:focus-visible { background: rgba(247, 216, 120, .16); border-color: rgba(196, 154, 76, .65); }
.hall-hot:active { transform: scale(.985); }

/* 热区按 AI 场景图（art/hall.jpg，780x940）重新标定，与建筑一一对齐 */
.hot-main { left: 24%; top: 14%; width: 54%; height: 34%; }
.hot-sub-1 { left: 0%; top: 10%; width: 24%; height: 14%; }   /* 炼器阁 · 左上 */
.hot-sub-2 { left: 0%; top: 24%; width: 23%; height: 14%; }   /* 炼丹房 · 左中 */
.hot-sub-3 { left: 0%; top: 39%; width: 22%; height: 14%; }   /* 经脉堂 · 左下 */
.hot-sub-4 { left: 78%; top: 8%; width: 22%; height: 14%; }   /* 阵法台 · 右上 */
.hot-sub-5 { left: 78%; top: 24%; width: 22%; height: 14%; }  /* 画符楼 · 右中 */
.hot-sub-6 { left: 77%; top: 39%; width: 23%; height: 14%; }  /* 坤舆轩 · 右下 */
.hot-shop { left: 2%; top: 57%; width: 34%; height: 23%; }    /* 坊市 · 左下大屋 */
.hot-rank { left: 72%; top: 57%; width: 18%; height: 33%; }   /* 仙榜 · 右下石碑 */

.hall-clouds { animation: skyDrift 28s ease-in-out infinite alternate; }
.hall-clouds-b { animation: skyDrift 40s ease-in-out infinite alternate-reverse; }

/* ---------- 地图：每个地方自己的头图 ---------- */
.map-sky { position: relative; margin: 6px 0 4px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: linear-gradient(180deg, #f6f1e2, #eaf0ee); }
.map-sky svg { display: block; width: 100%; height: 108px; }
.map-sky > span { position: absolute; left: 10px; bottom: 6px; font-family: var(--serif); font-size: 12px; letter-spacing: 2px; color: #3b4a46; text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.map-sky-cave { background: linear-gradient(180deg, #dfe4e1, #c8d2d0); }
.map-sky-water { background: linear-gradient(180deg, #eef3f2, #dbe9ea); }
.map-sky-sand { background: linear-gradient(180deg, #f6efdf, #eadfc6); }
.map-sky-forest { background: linear-gradient(180deg, #eef3e8, #dde9d9); }

/* ---------- 洞府：盘膝而坐 ---------- */
.cave-hero-art .seated-hero { width: 72px; height: 66px; display: block; }
.seated-body { animation: monkBreath 4.8s ease-in-out infinite; transform-origin: 60px 88px; }

/* ---------- 任务：垂轴卷子 ---------- */
.quest-scroll { margin: 8px 0 6px; }
.scroll-rod {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(180deg, #e6cf9f, #b9914f 42%, #8a6a30);
  box-shadow: 0 2px 6px rgba(90, 66, 22, .28), inset 0 1px rgba(255, 245, 210, .7);
  position: relative;
}
.scroll-rod::before, .scroll-rod::after {
  content: '';
  position: absolute;
  top: -2px; width: 9px; height: 16px;
  border-radius: 4px;
  background: linear-gradient(180deg, #c9a469, #8a6a30);
}
.scroll-rod::before { left: -5px; }
.scroll-rod::after { right: -5px; }
.scroll-paper {
  margin: 0 2px;
  padding: 12px 10px 14px;
  background:
    linear-gradient(90deg, rgba(120, 92, 42, .10), transparent 8%, transparent 92%, rgba(120, 92, 42, .10)),
    repeating-linear-gradient(0deg, rgba(180, 160, 120, .1) 0 1px, transparent 1px 26px),
    linear-gradient(180deg, #fdf7e6, #f7eed7);
  border-left: 1px solid rgba(150, 122, 70, .35);
  border-right: 1px solid rgba(150, 122, 70, .35);
  box-shadow: inset 0 8px 12px -8px rgba(90, 66, 22, .35), inset 0 -8px 12px -8px rgba(90, 66, 22, .35);
}
.quest-scroll .quest-section { margin-top: 4px; }

/* 大殿细节动效：灯笼摇曳、灵光上浮 */
.hall-lantern { animation: hallLantern 3.6s ease-in-out infinite; }
.hall-lantern:nth-of-type(2n) { animation-delay: 1.2s; }
@keyframes hallLantern {
  0%, 100% { opacity: .72; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-1px); }
}
.hall-motes circle { animation: hallMote 6.5s ease-in-out infinite; }
.hall-motes circle:nth-child(2n) { animation-delay: 1.8s; }
.hall-motes circle:nth-child(3n) { animation-delay: 3.4s; }
@keyframes hallMote {
  0% { transform: translateY(6px); opacity: .2; }
  50% { opacity: 1; }
  100% { transform: translateY(-14px); opacity: 0; }
}

/* ---------- 启动页：一张完整山水，标题金光 ---------- */
#bootTip {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: #eef4f2;
  color: #4a4030;
  font-family: -apple-system, 'PingFang SC', sans-serif;
  font-size: 12px;
  line-height: 1.7;
  text-align: center;
  padding: 24px;
  overflow: hidden;
}
.boot-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .96; }
.boot-title {
  position: relative;
  font-family: Songti SC, SimSun, serif;
  font-size: 26px;
  letter-spacing: 8px;
  font-weight: 600;
  background-image: linear-gradient(100deg, #795217 0%, #b8862c 34%, #ffeec2 50%, #b8862c 66%, #795217 100%);
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  animation: titleShine 6s linear infinite;
  text-shadow: 0 2px 12px rgba(120, 90, 30, .18);
}
#bootTipText { position: relative; color: #5a5137; letter-spacing: 1px; }

/* 洞府内景舞台 */
.cave-stage { position: relative; margin: 4px 0 8px; border: 1px solid #6b5238; border-radius: 10px; overflow: hidden; box-shadow: 0 4px 16px rgba(40, 30, 12, .22); }
.cave-scene-svg { display: block; width: 100%; height: auto; }
.cave-art { display: block; width: 100%; height: 188px; object-fit: cover; object-position: center 58%; }
.map-art { display: block; width: 100%; height: 128px; object-fit: cover; object-position: center 55%; border-radius: 8px; }
.cave-stage-tag {
  position: absolute; left: 10px; bottom: 8px;
  padding: 3px 9px;
  font-size: 10px; line-height: 1.5;
  color: #f6ecd2;
  background: rgba(20, 30, 28, .55);
  border: 1px solid rgba(232, 200, 135, .5);
  border-radius: 6px;
  backdrop-filter: blur(2px);
}
.cave-stage-tag b { display: block; font-family: var(--serif); font-size: 12px; letter-spacing: 1px; color: #ffe9b0; }

/* 称号列表里的徽章：紧凑网格，描述/进度移到图鉴里看，这里只留徽章+名字+tier */
.set-title { display: grid; grid-template-columns: 34px 1fr; grid-template-areas: "badge name" "badge tier"; align-items: center; column-gap: 6px; row-gap: 0; text-align: left; padding: 5px 6px; }
.set-title-badge { grid-area: badge; display: flex; align-items: center; justify-content: center; }
.set-title b { grid-area: name; font-size: 11px; }
.set-title em { grid-area: tier; font-size: 9px; margin-left: 0; }
.set-title span:not(.set-title-badge) { display: none; }

/* 设置页称号：分类标签 + 限高滚动，一屏就能看一块，不再长长拖到底 */
.set-title-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 6px 0 5px; }
.set-title-tab { font-family: inherit; font-size: 11px; line-height: 1; padding: 5px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,246,.7); color: var(--ink-2); cursor: pointer; }
.set-title-tab i { font-style: normal; font-size: 9px; opacity: .7; margin-left: 2px; }
.set-title-tab.on { border-color: var(--gold); color: var(--gold); background: rgba(247,216,120,.12); }
.set-titles { max-height: 190px; overflow-y: auto; align-content: start; padding-right: 3px; }
.set-title.locked { opacity: .5; cursor: default; filter: grayscale(1); }
.set-title.locked .set-title-badge { filter: grayscale(1); }
/* 图鉴未得卡片同样处理 */
.title-card.locked { filter: grayscale(1); }

/* 卷轴封泥印章 */
.scroll-seal {
  position: absolute;
  right: 8px;
  top: 2px;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-style: normal;
  font-family: var(--serif);
  font-size: 9px;
  line-height: 1.05;
  letter-spacing: 0;
  color: #fdf3e2;
  background: radial-gradient(circle at 36% 30%, #b8503a, #9c3325 70%);
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(90, 30, 20, .35), inset 0 0 0 1.5px rgba(255, 235, 210, .55);
  transform: rotate(-8deg);
  z-index: 2;
}
.quest-scroll { position: relative; }

/* ---------- 信匣 ---------- */
.mail-box { width: min(94vw, 500px); max-height: 86vh; display: flex; flex-direction: column; }
.mail-list { flex: 1 1 auto; min-height: 0; overflow-y: auto; margin: 10px 0 6px; padding-right: 2px; }
.mail-row { border: 1px solid var(--line); border-radius: 8px; padding: 9px 11px; margin-bottom: 9px; background: rgba(255, 253, 246, .95); }
.mail-row.claimed { opacity: .72; background: rgba(246, 242, 232, .9); }
.mail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.mail-head b { font-family: var(--serif); font-size: 14px; color: #7a4a12; letter-spacing: 1px; }
.mail-head span { font-size: 10px; color: var(--ink-2); }
.mail-body { margin: 6px 0 0; font-size: 12px; line-height: 1.7; color: #4a4640; white-space: pre-wrap; }
.mail-reward { margin-top: 7px; padding: 6px 8px; font-size: 11px; line-height: 1.6; color: #6b4408; border-left: 3px solid #c58a2d; background: #fff8e3; border-radius: 3px; }
.mail-foot { margin-top: 8px; display: flex; justify-content: flex-end; }
.mail-done { font-size: 11px; color: #8a7956; }
#mailBtn { position: relative; }
#mailDot { position: absolute; top: -3px; right: -3px; }
.tier-card-warn { margin: 2px 0 0; font-size: 9px; line-height: 1.4; color: #a8442a; }

/* 制作按钮：材料不足时保持「禁用」外观，但仍然可点（点了会说明差什么） */
.btn.is-disabled {
  opacity: .55;
  filter: none !important;
  box-shadow: none;
  cursor: not-allowed;
  border-color: #c9bda0;
  background: linear-gradient(180deg, #e8e2d2, #cfc7b3 58%, #b8ae97);
  color: #6b6455;
}
.btn.is-disabled:hover { filter: none !important; }
.btn:disabled { opacity: .55; filter: none !important; cursor: not-allowed; }

/* ---------- 称号图鉴（分类标签 + 密网格，不再一长条） ---------- */
.title-book { width: min(94vw, 560px); max-height: 84vh; display: flex; flex-direction: column; }
.title-book-h { margin: 10px 0 6px; font-size: 12px; letter-spacing: 2px; color: var(--gold); }
/* 分类标签：一行尽量排完，小圆角按钮 */
.title-book-tabs { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0 6px; }
.title-book-tab { font-family: inherit; font-size: 11px; line-height: 1; padding: 5px 9px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,246,.7); color: var(--ink-2); cursor: pointer; }
.title-book-tab i { font-style: normal; font-size: 9px; opacity: .7; margin-left: 2px; }
.title-book-tab.on { border-color: var(--gold); color: var(--gold); background: rgba(247,216,120,.12); }
/* 单一滚动区，自动填充列，卡片小一圈 */
.title-book-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; overflow-y: auto; min-height: 0; max-height: 55vh; padding: 2px 4px 2px 2px; }
.title-card {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 5px 2px 6px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 253, 246, .92);
  cursor: pointer;
}
.title-card.on { border-color: #d9a93a; box-shadow: 0 0 0 1px rgba(247, 216, 120, .6), 0 0 12px rgba(247, 216, 120, .4); }
.title-card.locked { cursor: default; background: rgba(246, 242, 232, .7); opacity: .72; }
.title-card-badge { display: flex; }
.title-card b { font-size: 10px; line-height: 1.25; text-align: center; }

/* 答题结果里的本层进度行 */
.cell-line { margin-top: 6px; font-size: 11px; color: #4a4640; }
.cell-line span { color: #8a7956; }
.cell-line span.done { color: #2f7a4d; font-weight: 600; }

/* 进度条走得更顺，答对时能看出在动 */
.progress > span { transition: width .35s ease; }

/* ══════════════════════════════════════════════════════════════
   答题特效：灵气爆裂 / 符文环 / 光柱 / 灰烟 / 震屏
   ══════════════════════════════════════════════════════════════ */
.fx-canvas {
  position: fixed;
  inset: 0;
  z-index: 58;
  pointer-events: none;
}

/* 符文环 */
.fx-ring {
  position: fixed;
  width: 200px;
  height: 200px;
  margin: -100px 0 0 -100px;
  z-index: 59;
  pointer-events: none;
}
.fx-ring svg { width: 100%; height: 100%; overflow: visible; }
.fx-ring circle { fill: none; stroke-width: 1.4; }
.fx-ring .r1 { stroke: #f7d878; }
.fx-ring .r2 { stroke: #ffe9a8; }
.fx-ring .r3 { stroke: #fff6d8; }
.fx-ring .runes rect { fill: #ffd76a; opacity: .9; }

.fx-ring-normal { animation: fxRingIn .9s ease-out forwards; }
.fx-ring-perfect { animation: fxRingIn 1.25s ease-out forwards; }
.fx-ring-wrong { animation: fxRingIn .8s ease-out forwards; }
.fx-ring-wrong circle { stroke: #7f8b88; }
.fx-ring-wrong .runes rect { fill: #93a09c; }

@keyframes fxRingIn {
  0% { transform: scale(.28) rotate(-24deg); opacity: 0; }
  18% { opacity: 1; }
  100% { transform: scale(3.2) rotate(16deg); opacity: 0; }
}
.fx-ring-perfect svg { animation: fxRuneSpin 1.2s ease-out forwards; }
@keyframes fxRuneSpin { to { transform: rotate(140deg); } }

/* 灵气光柱 */
.fx-pillar {
  position: fixed;
  width: 96px;
  margin-left: -48px;
  height: 74vh;
  z-index: 57;
  pointer-events: none;
  background: linear-gradient(to top, rgba(255, 236, 170, .85) 0%, rgba(247, 216, 120, .42) 38%, rgba(247, 216, 120, 0) 100%);
  filter: blur(6px);
  mix-blend-mode: screen;
}
.fx-pillar-perfect {
  width: 140px;
  margin-left: -70px;
  animation: fxPillar 1.1s ease-out forwards;
}
.fx-pillar-normal { animation: fxPillar 1.05s ease-out forwards; }
@keyframes fxPillar {
  0% { opacity: 0; transform: scaleY(.1); }
  22% { opacity: 1; transform: scaleY(1.05); }
  100% { opacity: 0; transform: scaleY(1.2); }
}

/* 闪屏 */
.fx-flash {
  position: fixed;
  inset: 0;
  z-index: 56;
  pointer-events: none;
}
.fx-flash-perfect {
  background: radial-gradient(circle at 50% 55%, rgba(255, 246, 214, .85), rgba(247, 216, 120, .25) 40%, transparent 72%);
  animation: fxFlash .62s ease-out forwards;
}
.fx-flash-wrong {
  background: radial-gradient(circle at 50% 55%, rgba(120, 130, 128, .5), rgba(30, 36, 34, .28) 45%, transparent 74%);
  animation: fxFlash .5s ease-out forwards;
}
@keyframes fxFlash {
  0% { opacity: 0; }
  18% { opacity: 1; }
  100% { opacity: 0; }
}

/* 震屏 */
.fx-shake { animation: fxShake .42s cubic-bezier(.36, .07, .19, .97); }
.fx-shake-strong { animation: fxShakeStrong .46s cubic-bezier(.36, .07, .19, .97); }
@keyframes fxShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, -1px); }
  80% { transform: translate(2px, 1px); }
}
@keyframes fxShakeStrong {
  0%, 100% { transform: translate(0, 0) scale(1); }
  15% { transform: translate(-6px, 4px) scale(1.006); }
  32% { transform: translate(6px, -5px) scale(1.006); }
  52% { transform: translate(-5px, -3px) scale(1.004); }
  74% { transform: translate(4px, 3px) scale(1.002); }
}

@media (prefers-reduced-motion: reduce) {
  .fx-ring, .fx-pillar, .fx-flash, .fx-shake, .fx-shake-strong { display: none !important; }
}

/* ---------- 常驻灵气漩涡 / 连击 / 紧迫计时 ---------- */
.dt-swirl { animation: dtSwirl 16s linear infinite; }
.dt-swirl-b { animation: dtSwirl 9s linear infinite reverse; }
@keyframes dtSwirl { to { transform: rotate(360deg); } }

.dt-stream { animation: dtStream 3.4s ease-in-out infinite; }
.dt-stream path:nth-child(2) { animation-delay: 1.1s; }
@keyframes dtStream {
  0% { opacity: .15; transform: translateY(4px); }
  55% { opacity: .85; }
  100% { opacity: 0; transform: translateY(-10px); }
}

.dantian { position: relative; }
.combo-badge {
  position: absolute;
  right: 10px;
  top: 8px;
  padding: 3px 10px;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: 2px;
  border-radius: 12px;
  animation: comboPop .32s cubic-bezier(.2, 1.6, .4, 1);
  pointer-events: none;
}
.combo-badge.tier-1 { color: #7a4a06; background: rgba(247, 216, 120, .55); border: 1px solid #d9a93a; }
.combo-badge.tier-2 {
  color: #4a1f00; background: linear-gradient(100deg, #ffd97a, #ffb347 60%, #ffd97a);
  border: 1px solid #e08a1e; box-shadow: 0 0 12px rgba(255, 179, 71, .7);
}
.combo-badge.tier-3 {
  color: #2b1300;
  background: linear-gradient(100deg, #fff2c0, #ffcf5a 30%, #ff9f43 55%, #ffcf5a 80%, #fff2c0);
  background-size: 200% 100%;
  border: 1px solid #ffb020;
  box-shadow: 0 0 18px rgba(255, 176, 32, .85), 0 0 34px rgba(255, 220, 140, .5);
  animation: comboPop .32s cubic-bezier(.2, 1.6, .4, 1), titleShine 3s linear infinite;
}
@keyframes comboPop {
  0% { transform: scale(.6) rotate(-6deg); opacity: 0; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}

/* 最后三秒：计时条转红并呼吸 */
.timer.urgent { box-shadow: 0 0 0 1px rgba(200, 60, 40, .45), 0 0 12px rgba(200, 60, 40, .35); }
.timer.urgent > span { background: linear-gradient(90deg, #e0523a, #c8301f); animation: timerPulse .6s ease-in-out infinite alternate; }
@keyframes timerPulse { from { opacity: .65; } to { opacity: 1; } }

/* 战斗中的成品按钮：与丹药的金色区分开 */
.battle-pills .craft-btn { border-color: #9ec9bd; background: linear-gradient(180deg, #f2fbf7, #e0f0ea); }
.battle-pills .craft-btn em { color: #2f6b57; }
.battle-pills { flex-wrap: wrap; max-height: 116px; overflow-y: auto; align-content: flex-start; }

/* 战斗页：穿戴中的装备（永久加成）一览 */
.equip-buffs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 6px 0 4px;
  padding: 6px 8px;
  border: 1px dashed #c9b98f;
  border-radius: 6px;
  background: rgba(255, 250, 235, .7);
  font-size: 10px;
  color: var(--ink-2);
}
.equip-buffs > span { color: #8a5a17; letter-spacing: 1px; }
.equip-buff { display: inline-flex; align-items: baseline; gap: 4px; color: #4a4640; }
.equip-buff i { font-style: normal; color: #a08a5e; }
.equip-buff em { font-style: normal; color: #2f7a4d; }

/* 洞府：气血条 */
.hp-line { display: inline-flex; align-items: center; gap: 6px; }
.hp-bar-mini { display: inline-block; width: 62px; height: 7px; border-radius: 4px; background: #e6ddc8; overflow: hidden; }
.hp-bar-mini > i { display: block; height: 100%; background: linear-gradient(90deg, #d9534f, #e8804f); transition: width .3s ease; }

/* 制作卡片的成功率 */
.tier-card-rate { margin: 2px 0 0; font-size: 10px; color: #7a5410; }
.tier-card-rate.sure { color: #2f7a4d; font-weight: 600; }
.tier-card-rate.risky { color: #a8442a; }
.tier-card-rate em { font-style: normal; margin-left: 5px; color: #9a8b6b; }

/* ══════════════════════════════════════════════════════════════
   炼制场景：进房间、把材料按进器皿、开炉见成败
   ══════════════════════════════════════════════════════════════ */
.craft-overlay {
  position: fixed; inset: 0; z-index: 56;
  display: flex; flex-direction: column;
  background: radial-gradient(circle at 50% 32%, #201d17, #0e0d0a 78%);
  animation: craftFadeIn .28s ease;
}
@keyframes craftFadeIn { from { opacity: 0 } to { opacity: 1 } }

.craft-head {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 12px; border-bottom: 1px solid #3a3428;
  background: linear-gradient(180deg, rgba(60,52,38,.9), rgba(28,25,19,.9));
}
.craft-head b { font-family: var(--serif); font-size: 14px; color: #f0dfae; letter-spacing: 2px; }
.craft-head span { font-size: 10px; color: #b7a680; }
.craft-head .btn-ghost { padding: 4px 9px; font-size: 11px; }

/* ── 房间 ── */
.craft-room {
  position: relative;
  flex: 1 1 auto; min-height: 250px; overflow: hidden;
  border-bottom: 1px solid #2c2720;
}
.craft-room .room-svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
/* AI 场景图铺满房间；图没加载出来时才回退到 SVG 房间 */
.craft-room-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.craft-fallback { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.craft-room.no-art .craft-fallback { opacity: 1; }
.craft-room.no-art .room-svg { opacity: 1; }
.craft-fallback .room-svg { width: 100%; height: 100%; display: block; }
.craft-room-title {
  position: absolute; left: 12px; top: 10px; display: flex; flex-direction: column; gap: 1px;
  text-shadow: 0 1px 4px #000;
}
.craft-room-title b { font-family: var(--serif); font-size: 13px; color: #f0dfae; letter-spacing: 2px; }
.craft-room-title span { font-size: 9px; color: #9c8f74; letter-spacing: 1px; }

/* 投料热区：一圈虚线，器皿摆在中央 */
.craft-drop {
  position: absolute; left: 50%; bottom: 7%;
  width: min(66vw, 296px); aspect-ratio: 1;
  transform: translateX(-50%);
  border: 2px dashed rgba(255, 210, 120, .35); border-radius: 50%;
  box-shadow: inset 0 0 46px rgba(255, 200, 100, .12);
  animation: dropPulse 2.6s ease-in-out infinite;
  pointer-events: none; transition: border-color .2s, box-shadow .2s;
}
@keyframes dropPulse {
  0%, 100% { opacity: .55; transform: translateX(-50%) scale(.97) }
  50% { opacity: 1; transform: translateX(-50%) scale(1.02) }
}
.craft-drop.hot { border-color: rgba(255, 226, 150, .95); box-shadow: inset 0 0 70px rgba(255, 210, 110, .3), 0 0 26px rgba(255, 200, 100, .35); }

/* ── 器皿 ── */
/* 器皿要坐在房间中央那块石台上（背景里石台中心约在 0.79H 处） */
.craft-vessel {
  position: absolute; left: 50%; bottom: 16%;
  width: min(64vw, 292px); aspect-ratio: 220 / 200;
  transform: translateX(-50%);
  transition: filter .3s;
}
.craft-vessel .vessel-svg { width: 100%; height: 100%; display: block; }
/* 器皿已画进 AI 图里，这个容器只剩特效层 */
.craft-room:not(.no-art) .craft-vessel .vessel-svg { display: none; }
.craft-vessel .vessel-lid {
  transform-box: fill-box; transform-origin: 50% 100%;
  transition: transform .9s cubic-bezier(.2, .9, .2, 1), opacity .8s ease .15s;
}
.craft-vessel .vessel-ring { transform-box: fill-box; transform-origin: 50% 50%; animation: vesselSpin 26s linear infinite; }
@keyframes vesselSpin { to { transform: rotate(360deg) } }
.craft-vessel .vessel-core { animation: corePulse 2.8s ease-in-out infinite; transform-box: fill-box; transform-origin: 50% 50%; }
@keyframes corePulse { 0%, 100% { opacity: .8 } 50% { opacity: 1 } }

/* 落地式器皿（阵盘）要压低一点，正好压住背景那块石台 */
.craft-vessel[data-vessel="lishi"] { bottom: 11%; width: min(62vw, 282px); }

/* 投入一份材料时的一下震动 */
.craft-vessel.hit { animation: vesselHit .34s ease; }
@keyframes vesselHit {
  0%, 100% { transform: translateX(-50%) translateY(0) }
  25% { transform: translateX(-50%) translateY(-5px) rotate(-1.2deg) }
  60% { transform: translateX(-50%) translateY(2px) rotate(1deg) }
}

/* 开炉：持续三秒越抖越凶 */
.craft-vessel.brewing { animation: vesselBrew 3s cubic-bezier(.4, 0, .3, 1) forwards; }
@keyframes vesselBrew {
  0%   { transform: translateX(-50%) translateY(0) rotate(0) }
  12%  { transform: translateX(-50%) translateY(-3px) rotate(-1deg) }
  25%  { transform: translateX(-50%) translateY(2px) rotate(1.2deg) }
  40%  { transform: translateX(-50%) translateY(-5px) rotate(-1.8deg) }
  55%  { transform: translateX(-50%) translateY(3px) rotate(2deg) }
  70%  { transform: translateX(-50%) translateY(-7px) rotate(-2.4deg) }
  84%  { transform: translateX(-50%) translateY(4px) rotate(2.6deg) }
  100% { transform: translateX(-50%) translateY(-2px) rotate(-1deg) }
}
.craft-vessel.brewing .vessel-ring { animation-duration: 2.2s; }
.craft-vessel.brewing .vessel-core { animation-duration: .5s; }
.craft-vessel.brewing { filter: drop-shadow(0 0 16px rgba(255, 190, 90, .55)); }

/* 成功：开盖 + 金光 + 仙气 */
.craft-vessel.is-success { filter: drop-shadow(0 0 26px rgba(255, 224, 140, .85)); }
.craft-vessel.is-success .vessel-lid { transform: translateY(-86px) rotate(-14deg); opacity: 0; }
.craft-vessel.is-success .vessel-core { opacity: 1; }

/* 失败：炸炉 */
.craft-vessel.is-fail { animation: vesselBlast .62s ease; filter: drop-shadow(0 0 20px rgba(255, 80, 40, .8)); }
@keyframes vesselBlast {
  0%   { transform: translateX(-50%) translateY(0) scale(1) }
  14%  { transform: translateX(-53%) translateY(-4px) scale(1.05) }
  28%  { transform: translateX(-47%) translateY(3px) scale(.98) }
  44%  { transform: translateX(-52%) translateY(-2px) scale(1.03) }
  62%  { transform: translateX(-49%) translateY(2px) scale(1) }
  100% { transform: translateX(-50%) translateY(0) scale(1) }
}

/* 仙气：三团往上飘 */
.vessel-smoke {
  position: absolute; left: 50%; bottom: 42%;
  width: 46%; height: 52%; margin-left: -23%;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255,255,255,.85), rgba(255,255,255,0) 68%);
  filter: blur(5px);
}
.vessel-smoke.s2 { width: 34%; height: 40%; margin-left: -34%; animation-delay: .45s !important; }
.vessel-smoke.s3 { width: 30%; height: 36%; margin-left: -6%; animation-delay: .9s !important; }
.craft-vessel.is-success .vessel-smoke { animation: smokeRise 2.4s ease-out forwards; }
.craft-vessel.is-fail .vessel-smoke {
  background: radial-gradient(circle, rgba(90,86,80,.9), rgba(40,38,34,0) 70%);
  animation: smokeRise 2s ease-out forwards;
}
@keyframes smokeRise {
  0%   { opacity: 0; transform: translateY(10px) scale(.7) }
  25%  { opacity: .85 }
  100% { opacity: 0; transform: translateY(-90px) scale(1.45) }
}
.craft-vessel .vessel-aura {
  position: absolute; inset: -14% -8% 6%;
  border-radius: 50%; pointer-events: none; opacity: 0;
  background: radial-gradient(circle, rgba(255, 226, 140, .5), rgba(255, 210, 110, 0) 62%);
}
.craft-vessel.is-success .vessel-aura { animation: auraBurst 1.5s ease-out forwards; }
@keyframes auraBurst { 0% { opacity: 0; transform: scale(.5) } 30% { opacity: 1 } 100% { opacity: 0; transform: scale(1.5) } }

/* ── 材料托盘 ── */
.craft-tray {
  flex: 0 0 auto; max-height: 46vh; overflow-y: auto;
  padding: 10px 12px 16px;
  background: linear-gradient(180deg, #1c1a15, #100f0c);
  border-top: 1px solid #332d22;
}
.craft-tray-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  margin-bottom: 7px; font-size: 11px; color: #c9b78f;
}
.craft-tray-head b { font-family: var(--serif); font-size: 12px; color: #f0dfae; letter-spacing: 1px; }
.craft-tray-head em { font-style: normal; color: #8fbf8f; }
.craft-tray-head em.todo { color: #d9a05a; }
.craft-chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.craft-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  width: 74px; padding: 6px 3px 5px;
  border: 1px solid #6d5f45; border-radius: 8px;
  background: radial-gradient(circle at 50% 22%, #322d22, #1a1712);
  color: #e8dcc0; font-size: 9.5px; line-height: 1.25; text-align: center;
  cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none;
  transition: transform .12s, opacity .18s, border-color .18s, box-shadow .18s;
}
.craft-chip:active { cursor: grabbing; }
.craft-chip.main { border-color: #a97c3e; box-shadow: inset 0 0 14px rgba(220, 160, 70, .2); }
.craft-chip.aux { border-color: #5f7f74; box-shadow: inset 0 0 14px rgba(110, 180, 160, .16); }
.craft-chip b { font-size: 10px; color: #ffe3a6; font-weight: 600; }
.craft-chip small { font-size: 8.5px; color: #9a8d70; }
.craft-chip.dragging { opacity: .35; transform: scale(.94); }
.craft-chip.done { opacity: .25; filter: grayscale(1); pointer-events: none; }
.craft-chip-ghost {
  position: fixed; z-index: 70; pointer-events: none;
  transform: translate(-50%, -50%) scale(1.12);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .6), 0 0 18px rgba(255, 210, 120, .5);
  opacity: .95;
}
.craft-tray-tip { margin: 9px 0 0; font-size: 10px; line-height: 1.6; color: #9d8f74; }

/* ── 结算面板 ── */
/* 结果做成底部抽屉：上面那口炉子开盖也好、炸炉也好，全程都看得见 */
.craft-result {
  position: absolute; left: 50%; bottom: 0;
  transform: translate(-50%, 110%);
  width: 100%; max-width: 520px; padding: 14px 16px 18px;
  border: 2px solid #c49a4c; border-bottom: none; border-radius: 14px 14px 0 0;
  background: linear-gradient(160deg, #fffbed, #efe2c4);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .55);
  text-align: center; opacity: 0; pointer-events: none;
  transition: opacity .28s ease, transform .36s cubic-bezier(.2, 1.25, .4, 1);
  z-index: 6;
}
.craft-result.show { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.craft-result.fail { border-color: #b4623c; box-shadow: 0 -8px 40px rgba(60, 20, 8, .6); }
.craft-result h3 { margin: 0 0 4px; font-family: var(--serif); font-size: 17px; letter-spacing: 2px; color: #7a4a06; }
.craft-result.fail h3 { color: #8f3b1e; }
.craft-result .res-art { width: 74px; height: 74px; margin: 4px auto 6px; display: grid; place-items: center; }
.craft-result p { margin: 5px 0; font-size: 11.5px; line-height: 1.65; color: #4b4237; }
.craft-result p.warn { color: #8f3b1e; }
.craft-result .row-btns { margin-top: 10px; }
.craft-result .row-btns .btn, .craft-result .row-btns .btn-ghost { padding: 6px 14px; font-size: 12px; }

@media (max-width: 360px) {
  .craft-chip { width: 66px; font-size: 9px; }
  .craft-room { height: min(42vh, 300px); }
}

/* ══════════════════════════════════════════════════════════════
   战技：法力条 + 技能按钮 + 持续状态
   ══════════════════════════════════════════════════════════════ */
.skill-bar {
  margin: 8px 0 4px; padding: 8px 10px;
  border: 1px dashed #7c93a8; border-radius: 8px;
  background: linear-gradient(180deg, rgba(238, 246, 252, .8), rgba(226, 238, 248, .6));
}
.skill-bar.empty { border-style: dotted; }
.skill-mana { display: flex; align-items: center; gap: 7px; font-size: 11px; color: #2f5d78; }
.skill-mana > span { flex: 0 0 auto; letter-spacing: 1px; color: #46688a; }
.skill-mana > b { flex: 0 0 auto; font-size: 11px; color: #2f5d78; }
.mana-bar { flex: 1 1 auto; height: 8px; border-radius: 4px; background: #cfe0ee; overflow: hidden; }
.mana-bar > i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, #5aa6d8, #2f6fa8); transition: width .3s ease; }

.skill-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 7px; }
.skill-btn {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  flex: 1 1 132px; min-width: 132px; padding: 6px 8px;
  border: 1px solid #8fa9c0; border-radius: 7px;
  background: linear-gradient(180deg, #f6fbff, #e2eef8);
  font-family: inherit; text-align: left; cursor: pointer;
  transition: transform .12s, box-shadow .18s, border-color .18s;
}
.skill-btn:hover { border-color: #45759c; box-shadow: 0 3px 10px rgba(47, 111, 168, .18); }
.skill-btn:active { transform: scale(.98); }
.skill-btn b { font-size: 12px; color: #24506e; letter-spacing: .5px; }
.skill-btn em { font-style: normal; font-size: 9.5px; color: #5b7f9c; }
.skill-btn small { font-size: 9px; line-height: 1.45; color: #6a7f8f; }
.skill-btn.poor { opacity: .45; cursor: not-allowed; filter: grayscale(.5); }
.skill-tip { margin: 7px 0 0; font-size: 9.5px; color: #6d8296; }

.buff-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 7px; }
.buff-chip {
  padding: 2px 7px; border-radius: 10px; font-size: 9.5px;
  border: 1px solid #9fb6c9; background: rgba(255, 255, 255, .75); color: #2f5d78;
}
.buff-chip.heal { border-color: #a9c9a2; color: #3d6b34; background: rgba(243, 252, 240, .85); }

/* 洞府 · 随身战技 */
.skill-slot-grid { display: grid; gap: 7px; }
.skill-slot-row {
  display: grid; grid-template-columns: 34px 1fr auto; align-items: center; gap: 9px;
  padding: 7px 9px; border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255, 252, 244, .7);
}
.skill-slot-row.on { border-color: #8fa9c0; background: rgba(238, 246, 252, .8); }
.skill-slot-row > i {
  display: grid; place-items: center; height: 26px; border-radius: 6px;
  font-style: normal; font-size: 11px; color: #6d8296;
  background: rgba(0, 0, 0, .05);
}
.skill-slot-row .sk-name { font-size: 12px; color: var(--ink); }
.skill-slot-row .sk-eff { display: block; margin-top: 1px; font-size: 9.5px; color: var(--ink-2); }
.skill-slot-row .sk-empty { font-size: 11px; color: #9a8d70; }
.skill-pick-row {
  display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px;
  padding: 6px 8px; border-bottom: 1px dashed #d3c096;
}
.skill-pick-row:last-child { border-bottom: none; }
.skill-pick-row b { font-size: 12px; }
.skill-pick-row em { display: block; font-style: normal; font-size: 9.5px; color: var(--ink-2); }

/* ══════════════════════════════════════════════════════════════
   战技特效：剑光 / 符文 / 翠绿治愈 / 脚下法阵
   ══════════════════════════════════════════════════════════════ */
.sk-fx { position: fixed; inset: 0; pointer-events: none; z-index: 58; overflow: hidden; }
.sk-fx > i { position: absolute; display: block; }

/* 技能名：金（伤害）/ 碧（辅助）/ 靛（增益），由 --sk-tint 控制 */
.sk-fx-name {
  position: fixed; left: 50%; top: 20%; transform: translateX(-50%);
  font-family: var(--serif); font-size: 30px; font-weight: 600;
  letter-spacing: 7px; white-space: nowrap; pointer-events: none; z-index: 59;
  color: #fffbe8;
  text-shadow: 0 0 14px var(--sk-tint, #ffd27a), 0 0 34px var(--sk-tint, #ffd27a), 0 2px 0 rgba(60, 34, 4, .85);
  animation: skName 1.15s cubic-bezier(.2, .9, .2, 1) forwards;
}
@keyframes skName {
  0% { opacity: 0; transform: translateX(-50%) scale(.68) }
  18% { opacity: 1; transform: translateX(-50%) scale(1.08) }
  34% { transform: translateX(-50%) scale(1) }
  72% { opacity: 1 }
  100% { opacity: 0; transform: translateX(-50%) translateY(-26px) scale(1) }
}

/* 伤害：一道横斩光刃（画面是宣纸浅色底，纯白看不见，得用朱砂压深、金线提亮） */
.sk-blade {
  left: 50%; top: 42%; width: 200vw; height: 13px;
  margin-left: -100vw; margin-top: -6.5px;
  transform: rotate(-36deg); transform-origin: 50% 50%;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(168, 68, 42, .2) 18%,
    rgba(168, 68, 42, .9) 38%,
    #fff6cf 50%,
    rgba(168, 68, 42, .9) 62%,
    rgba(168, 68, 42, .2) 82%,
    transparent 100%);
  box-shadow: 0 0 16px rgba(255, 226, 150, .95), 0 0 44px rgba(200, 70, 30, .8), 0 0 90px rgba(160, 40, 16, .5);
  border-radius: 999px;
  clip-path: inset(0 100% 0 0);
  animation: skBlade .52s cubic-bezier(.1, .85, .2, 1) forwards;
}
/* 中心那道最亮的金线 */
.sk-blade::after {
  content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 2px;
  margin-top: -1px; border-radius: 999px;
  background: linear-gradient(90deg, transparent, #fffdf0 30%, #ffffff 50%, #fffdf0 70%, transparent);
  box-shadow: 0 0 10px rgba(255, 248, 210, 1);
}
/* 第二道更细的残影，前后错开一点，斩击才有速度感 */
.sk-blade.ghost { height: 5px; opacity: .8; animation-delay: .07s; filter: blur(1.2px); }

@keyframes skBlade {
  0% { opacity: 0; clip-path: inset(0 100% 0 0) }
  12% { opacity: 1 }
  68% { clip-path: inset(0 0 0 0); opacity: 1 }
  100% { clip-path: inset(0 0 0 0); opacity: 0 }
}

/* 伤害：命中处的符文环 */
.sk-rune {
  left: 50%; top: 42%; width: 230px; height: 230px; margin: -115px 0 0 -115px;
  border-radius: 50%;
  border: 3px solid rgba(168, 68, 42, .9);
  box-shadow: inset 0 0 50px rgba(255, 200, 110, .7), 0 0 30px rgba(200, 80, 40, .7), 0 0 60px rgba(255, 190, 90, .5);
  animation: skRune .8s ease-out .18s forwards; opacity: 0;
}
.sk-rune::before, .sk-rune::after {
  content: ''; position: absolute; inset: 12px; border-radius: 50%;
  border: 2px dashed rgba(168, 68, 42, .8);
}
.sk-rune::after { inset: 34px; border-style: dotted; }
@keyframes skRune {
  0% { opacity: 0; transform: scale(.28) rotate(0) }
  26% { opacity: 1 }
  100% { opacity: 0; transform: scale(1.65) rotate(150deg) }
}

/* 伤害：爆点白光 */
.sk-hit-bloom {
  left: 50%; top: 42%; width: 150px; height: 150px; margin: -75px 0 0 -75px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.98), rgba(255,230,160,.7) 30%, rgba(255,170,60,.25) 58%, transparent 72%);
  animation: skBloom .46s ease-out .2s forwards; opacity: 0;
}
@keyframes skBloom {
  0% { opacity: 0; transform: scale(.25) }
  30% { opacity: 1 }
  100% { opacity: 0; transform: scale(1.9) }
}

/* 辅助：翠绿光柱裹身 */
.sk-heal-column {
  left: 50%; top: 56%; width: 190px; height: 62vh; margin-left: -95px;
  transform: translateY(-100%);
  background: linear-gradient(180deg, transparent, rgba(150, 245, 190, .38) 45%, rgba(210, 255, 230, .75) 92%, transparent);
  filter: blur(7px);
  animation: skHealColumn 1.25s ease-out forwards; opacity: 0;
}
@keyframes skHealColumn {
  0% { opacity: 0; transform: translateY(-70%) scaleX(.55) }
  25% { opacity: 1 }
  100% { opacity: 0; transform: translateY(-108%) scaleX(1.25) }
}
/* 辅助：莲花光印 */
.sk-heal-seal {
  left: 50%; top: 56%; width: 210px; height: 210px; margin: -105px 0 0 -105px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(235, 255, 244, .9), rgba(120, 230, 175, .55) 40%, transparent 68%);
  animation: skHealSeal 1.1s ease-out forwards; opacity: 0;
}
.sk-heal-seal::before {
  content: ''; position: absolute; inset: 30px; border-radius: 50%;
  border: 3px solid rgba(47, 122, 84, .85);
  box-shadow: 0 0 26px rgba(90, 200, 150, .85), inset 0 0 24px rgba(120, 230, 175, .7);
}
@keyframes skHealSeal {
  0% { opacity: 0; transform: scale(.4) }
  28% { opacity: 1 }
  100% { opacity: 0; transform: scale(1.5) }
}
/* 辅助：上升光点 */
.sk-heal-motes {
  left: 50%; top: 56%; width: 190px; height: 190px; margin: -95px 0 0 -95px;
  border-radius: 50%;
  background-image:
    radial-gradient(circle 3px at 20% 70%, rgba(220,255,235,.95), transparent 70%),
    radial-gradient(circle 2px at 38% 88%, rgba(190,250,215,.9), transparent 70%),
    radial-gradient(circle 3px at 62% 78%, rgba(235,255,245,.95), transparent 70%),
    radial-gradient(circle 2px at 78% 62%, rgba(180,250,210,.85), transparent 70%),
    radial-gradient(circle 2px at 50% 50%, rgba(255,255,255,.9), transparent 70%);
  animation: skMotes 1.3s ease-out forwards; opacity: 0;
}
@keyframes skMotes {
  0% { opacity: 0; transform: translateY(18px) scale(.85) }
  30% { opacity: 1 }
  100% { opacity: 0; transform: translateY(-58px) scale(1.1) }
}

/* 增益：脚下双层法阵 */
.sk-ward-ring {
  left: 50%; top: 58%; width: 320px; height: 140px; margin: -70px 0 0 -160px;
  border-radius: 50%;
  border: 3px solid rgba(74, 86, 168, .95);
  box-shadow: 0 0 26px rgba(110, 130, 240, .85), inset 0 0 34px rgba(120, 145, 240, .7), 0 0 60px rgba(150, 170, 255, .45);
  animation: skWard 1.2s ease-out forwards; opacity: 0;
}
.sk-ward-ring.r1 { animation-delay: 0s; }
.sk-ward-ring.r2 {
  width: 250px; height: 110px; margin: -55px 0 0 -125px;
  border-style: dashed; border-color: rgba(90, 105, 190, .85);
  animation-delay: .12s;
}
@keyframes skWard {
  0% { opacity: 0; transform: scale(.45) rotate(-40deg) }
  30% { opacity: 1 }
  100% { opacity: 0; transform: scale(1.45) rotate(110deg) }
}
/* 增益：护罩六边形 */
.sk-ward-hex {
  left: 50%; top: 53%; width: 190px; height: 190px; margin: -95px 0 0 -95px;
  background: radial-gradient(circle, rgba(200, 215, 255, .34), transparent 68%);
  clip-path: polygon(50% 0%, 93% 25%, 93% 75%, 50% 100%, 7% 75%, 7% 25%);
  box-shadow: 0 0 40px rgba(150, 175, 255, .9);
  animation: skHex 1.15s ease-out forwards; opacity: 0;
}
@keyframes skHex {
  0% { opacity: 0; transform: scale(.6) }
  26% { opacity: 1 }
  60% { opacity: .85 }
  100% { opacity: 0; transform: scale(1.18) }
}

/* 法力条：和内丹气血条长得像，但用靛蓝区分 */
.hp-bar-mini.mana { background: #d8deee; }
.hp-bar-mini.mana > i { background: linear-gradient(90deg, #7fa6dd, #3f6bb0); }

/* 设置 · 曲目三选一 */
.music-src-list { display: grid; gap: 6px; }
.music-src {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: rgba(255, 252, 244, .75); cursor: pointer;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
.music-src:hover { border-color: #b99a63; }
.music-src.on { border-color: var(--gold); background: linear-gradient(180deg, #fff8e2, #f7eccd); box-shadow: inset 0 0 12px rgba(200, 160, 70, .18); }
.music-src.locked { opacity: .55; cursor: not-allowed; }
.music-src input { flex: 0 0 auto; width: 15px; height: 15px; accent-color: #c58a2d; cursor: inherit; }
.music-src > span { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.music-src b { font-size: 12.5px; color: var(--ink); }
.music-src em { font-style: normal; font-size: 9.5px; color: var(--ink-2); }
.music-src.on b { color: #7a4a06; }

/* 大殿天空：云缓慢横移、光尘轻飘，画面才有活气 */
.hall-clouds { animation: hallCloudDrift 42s ease-in-out infinite alternate; }
.hall-clouds-b { animation-duration: 58s; animation-direction: alternate-reverse; }
@keyframes hallCloudDrift { from { transform: translateX(-10px) } to { transform: translateX(12px) } }
.hall-dust circle { animation: hallDustFloat 7s ease-in-out infinite; }
.hall-dust circle:nth-child(2n) { animation-duration: 9s; animation-delay: -2s; }
.hall-dust circle:nth-child(3n) { animation-duration: 11s; animation-delay: -4s; }
@keyframes hallDustFloat {
  0%, 100% { transform: translateY(0); opacity: .35 }
  50% { transform: translateY(-7px); opacity: .85 }
}
.hall-birds { animation: hallBirdGlide 24s linear infinite; }
@keyframes hallBirdGlide { from { transform: translate(0, 0) } to { transform: translate(-26px, -6px) } }
@media (prefers-reduced-motion: reduce) {
  .hall-clouds, .hall-dust circle, .hall-birds { animation: none; }
}

/* 随时刷新的小圆钮：固定右下，横竖屏都能点到 */
.quick-refresh {
  position: fixed; right: 10px; bottom: 78px; z-index: 47;
  width: 36px; height: 36px; padding: 0;
  display: grid; place-items: center;
  border: 1px solid rgba(184, 138, 57, .75); border-radius: 50%;
  background: rgba(255, 251, 240, .92); color: #7a4a12;
  font-size: 17px; line-height: 1; cursor: pointer;
  box-shadow: 0 2px 10px rgba(60, 44, 16, .2);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: transform .12s, background .18s;
}
.quick-refresh:hover { background: #fff7e2; }
.quick-refresh:active { transform: scale(.92); }
.quick-refresh.spin { animation: qrSpin .6s linear; }
@keyframes qrSpin { to { transform: rotate(360deg) } }
/* 横屏时位置往上挪一点，别压在底栏上 */
@media (orientation: landscape) and (max-height: 520px) {
  .quick-refresh { right: 8px; bottom: auto; top: 8px; }
}

/* ── 背景音乐悬浮圆钮：常驻主界面，一键播放/暂停 ───────────────── */
.music-fab {
  position: fixed; right: 10px; bottom: 122px; z-index: 47;
  min-width: 40px; height: 40px; padding: 0 9px;
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid rgba(184, 138, 57, .75); border-radius: 20px;
  background: rgba(255, 251, 240, .92); color: #7a4a12;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(60, 44, 16, .2);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
  transition: transform .12s, background .18s, opacity .18s;
}
.music-fab:hover { background: #fff7e2; }
.music-fab:active { transform: scale(.92); }
.music-fab-ico { font-size: 18px; line-height: 1; }
.music-fab-label { font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
/* 播放中：暖金底 + 音符轻摆，一眼分得清开没开 */
.music-fab.is-on {
  background: linear-gradient(180deg, #ffe9a8, #f0c766);
  border-color: #b8862f; color: #5a3608;
}
.music-fab.is-on .music-fab-ico { animation: musicSway 1.6s ease-in-out infinite; }
@keyframes musicSway { 0%,100% { transform: rotate(-12deg) } 50% { transform: rotate(12deg) } }
/* 暂停：灰底 + 划掉的音符 */
.music-fab.is-off { opacity: .72; }
.music-fab.is-off .music-fab-ico { opacity: .55; }
@media (orientation: landscape) and (max-height: 520px) {
  .music-fab { right: 8px; bottom: auto; top: 8px; }
  .quick-refresh { right: 8px; bottom: auto; top: 52px; }
}

/* ══════════════════════════════════════════════════════════════
   横屏（矮屏）：顶部那一堆会把内容挤成一条缝，这里统一收窄
   ══════════════════════════════════════════════════════════════ */
@media (orientation: landscape) and (max-height: 540px) {
  .topbar { padding: 3px 10px; }
  .topbar .brand h1 { font-size: 15px; letter-spacing: 1px; }
  .topbar .brand .tag { display: none; }
  .pill-btn { padding: 2px 6px; font-size: 10px; }
  .status-strip { padding: 4px 10px; }
  .strip-top .realm-name { font-size: 15px; }
  .strip-meta { font-size: 10px; }
  .bar { height: 6px; }
  .mentor-bar, .scroll-guide { display: none; }
  .bottom-nav { height: 52px; }
  .nav-btn { font-size: 10px; }
  .nav-ico svg { width: 18px; height: 18px; }
  #panel { padding: 8px 12px 10px; }
  /* 大厅舞台在矮屏里按剩余高度自适应，别撑成正方形 */
  .hall-stage { max-height: 100%; }
}

/* ---------- 宗门（练气七层解锁） ---------- */
.nav-btn.locked { opacity: .55; cursor: pointer; }
.nav-btn.locked .nav-ico { filter: grayscale(1); }
.nav-lock { position: absolute; top: 2px; right: 3px; font-size: 8px; font-style: normal; color: #fff; background: #8a7550; border-radius: 6px; padding: 0 3px; }
.nav-btn { position: relative; }
.sect-card { display: flex; gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); }
.sect-card h3 { margin: 0 0 4px; color: var(--gold); }
.sect-card p { margin: 2px 0; }
.sect-seal { flex: 0 0 auto; width: 54px; height: 54px; display: grid; place-items: center; border: 2px solid var(--gold); border-radius: 8px; font-family: var(--serif); font-size: 30px; color: var(--gold); background: var(--gold-soft); }
.sect-choice-grid { display: grid; gap: 10px; }
.sect-choice-grid .btn { padding: 14px; text-align: left; }
.sect-choice-grid small { display: block; margin-top: 4px; font-size: 11px; font-weight: 400; opacity: .8; }
.sect-board { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.sect-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); }
.sect-row .sect-seal { flex: 0 0 auto; }
.sect-row-main { flex: 1 1 auto; min-width: 0; }
.sect-row-main b { display: block; color: var(--ink); }
.sect-row-main span { display: block; font-size: 11px; color: var(--ink-2); }
.sect-row > .btn, .sect-row > .btn-ghost { flex: 0 0 auto; }
.sect-row.mine { border-color: #d8c08a; background: #fdf7e8; }
.sect-tag { flex: 0 0 auto; padding: 3px 7px; border: 1px solid #d8c08a; border-radius: 4px; background: #fdf6e6; color: #8a6512; font-size: 10px; line-height: 1.4; }
.sect-tag.on { background: var(--gold-soft); font-weight: 600; }
.hint-warn { color: #a8442a; }

/* 灵石奖励 chip：金色菱形徽记（任务谢礼 / 奖励飘字共用） */
.gain-stone { color: #b8791a; font-size: 34px; line-height: 40px; text-shadow: 0 0 10px rgba(232,190,86,.9); }
.reward-item.stone .stone-gem { color: #b8791a; font-size: 24px; }
.reward-item.stone b { color: #8a5a12; }

/* 宗门创建向导 */
.sect-icon-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0; }
.sect-icon-opt { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); cursor: pointer; }
.sect-icon-opt.on { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold-soft); }
.sect-icon-opt span { font-size: 12px; color: var(--ink-2); }
.sect-opt-list { display: grid; gap: 8px; margin: 10px 0; }
.sect-opt { padding: 11px 12px; border: 1px solid var(--line); border-radius: 5px; background: var(--card); text-align: left; cursor: pointer; font-family: inherit; font-size: 13px; }
.sect-opt.on { border-color: var(--gold); background: var(--gold-soft); color: var(--gold); font-weight: 600; }
.sect-motto { width: 100%; min-height: 90px; resize: vertical; margin: 8px 0; }

/* ---------- 统一二次确认弹层 ---------- */
.confirm-gate {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(24, 30, 29, .62);
  animation: confirmFade .16s ease-out;
}
.confirm-card {
  width: min(340px, 100%);
  padding: 20px 20px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 18px 46px rgba(24, 20, 10, .35);
  animation: confirmPop .18s cubic-bezier(.2, .9, .3, 1.2);
}
.confirm-title {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--ink);
}
.confirm-body { margin: 0 0 16px; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
.confirm-actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-actions .btn, .confirm-actions .btn-ghost { min-width: 84px; }
.btn.danger { background: var(--cinnabar); border-color: var(--cinnabar); color: #fff8f2; }
.btn.danger:hover { background: #93391f; }
@keyframes confirmFade { from { opacity: 0 } to { opacity: 1 } }
@keyframes confirmPop { from { opacity: 0; transform: translateY(10px) scale(.97) } to { opacity: 1; transform: none } }

/* ---------- 道名弹窗：金丹真人 / 元婴真君 ---------- */
.dao-card { width: min(400px, 100%); padding: 26px 24px 18px; text-align: center; position: relative; }
.dao-seal {
  width: 54px; height: 54px; margin: -4px auto 10px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--gold, #b8893f); border-radius: 50%;
  color: var(--gold, #b8893f); font-family: var(--serif); font-size: 27px;
  box-shadow: 0 0 0 4px rgba(184, 137, 63, .12), inset 0 0 12px rgba(184, 137, 63, .18);
}
.dao-card .confirm-body { text-align: left; }
.dao-inline { color: var(--gold, #b8893f); }
.dao-field { display: block; margin: 4px 0 10px; text-align: left; }
.dao-field > span { display: block; margin-bottom: 6px; font-size: 12px; color: var(--ink-2); letter-spacing: 1px; }
.dao-field .text-input { width: 100%; box-sizing: border-box; text-align: center; font-family: var(--serif); font-size: 22px; letter-spacing: 6px; }
.dao-preview {
  margin: 2px 0 4px; padding: 9px 12px; border: 1px dashed var(--line); border-radius: 6px;
  font-size: 13px; color: var(--ink-2); background: rgba(184, 137, 63, .06);
}
.dao-preview b { color: var(--ink-2); font-size: 16px; letter-spacing: 1px; }
.dao-preview b.valid { color: var(--gold, #b8893f); }
.dao-err { min-height: 18px; color: var(--cinnabar, #b34a2e); font-size: 12px; text-align: left; }
.dao-card .confirm-actions { justify-content: center; margin-top: 6px; }

/* ---------- 仙榜：道号前缀 + 居中资料卡 ---------- */
.rank-dao {
  color: var(--gold, #b8893f); font-weight: 700;
  margin-right: 5px; letter-spacing: .5px;
}
.rank-name[data-rank-profile] { cursor: pointer; }
.rank-name[data-rank-profile]:hover { color: var(--gold, #b8893f); text-decoration: underline dotted; }
.rank-profile-card { text-align: center; width: min(360px, 100%); padding: 24px 22px 18px; }
.profile-seal {
  width: 52px; height: 52px; margin: 0 auto 12px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(145deg, rgba(184,137,63,.28), rgba(184,137,63,.08));
  border: 1px solid rgba(184,137,63,.5); color: var(--gold, #b8893f);
  font-family: var(--serif); font-size: 21px; letter-spacing: 1px;
}
.rank-profile-card .confirm-title { margin-bottom: 2px; }
.profile-sub { margin: 0 0 16px; font-size: 12px; color: var(--ink-2); }
.profile-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  margin: 0 0 12px; text-align: left;
}
.profile-grid span {
  padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px;
  font-size: 12px; color: var(--ink-2);
}
.profile-grid b { display: block; margin-top: 3px; color: var(--ink); font-size: 14px; }
.profile-title { margin: 0 0 12px; font-size: 12px; color: var(--gold, #b8893f); }

/* 宗门 · 需要云端账号的说明页 */
.sect-gate {
  margin: 12px 0;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--card);
  text-align: center;
}
.sect-gate-seal {
  width: 62px; height: 62px; margin: 0 auto 10px;
  display: grid; place-items: center;
  border: 2px solid var(--gold); border-radius: 10px;
  background: var(--gold-soft); color: var(--gold);
  font-family: var(--serif); font-size: 34px;
}
.sect-gate h3 { margin: 0 0 8px; font-family: var(--serif); letter-spacing: 1px; }
.sect-gate p { margin: 0 0 8px; font-size: 13px; }
.sect-gate .row-btns { margin-top: 10px; }

/* 仙榜行内的称号（所有人可见）：和界面佩戴的称号共用 .title-rN 的流光，
   这里只收尺寸与排版，底色/描边/动画都交给称号分级样式 */
.rank-title {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-left: 5px;
  padding: 0 5px 0 2px;
  height: 22px;
  border-width: 1px;
  border-style: solid;
  border-color: transparent;
  border-radius: 3px;
  font-size: 9px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  vertical-align: 1px;
  white-space: nowrap;
}
.rank-title-badge { display: flex; flex: 0 0 22px; width: 22px; height: 22px; }
.rank-title-badge svg { width: 22px; height: 22px; display: block; }
.rank-title-name { max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-title.title-r4 .rank-title-badge,
.rank-title.title-r5 .rank-title-badge { animation: rankBadgeGlow 2.6s ease-in-out infinite; }

/* 长列表里每一行都挂着称号：几十个「无限流光 + drop-shadow」同时跑，
   手机上滚动会直接掉帧，手感就是「划一下飞很远、松手又弹回去」。
   榜首三名保留动态流光，其余改成静态金渐变——颜色一样亮，但不再每帧重绘。 */
.rank-row:not(.top1):not(.top2):not(.top3) .rank-title { animation: none !important; }
.rank-row:not(.top1):not(.top2):not(.top3) .rank-title .rank-title-badge { animation: none !important; }
.rank-row:not(.top1):not(.top2):not(.top3) .rank-title::after { animation: none !important; }
@keyframes rankBadgeGlow {
  0%, 100% { filter: drop-shadow(0 0 0 rgba(247, 216, 120, 0)); }
  50% { filter: drop-shadow(0 0 5px rgba(247, 216, 120, 0.95)); }
}
@media (prefers-reduced-motion: reduce) {
  .rank-title .rank-title-badge { animation: none !important; }
}

/* ---------- 学习范围（设置页） ---------- */
.scope-chips { display: flex; flex-wrap: wrap; gap: 5px; margin: 4px 0 8px; }
.scope-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  padding: 3px 8px;
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  background: rgba(255, 253, 246, .85);
  font-size: 11px;
  color: var(--ink-2);
}
.scope-chip b { font-size: 12px; color: var(--gold); font-weight: 700; }
.scope-chip.empty { border-style: dashed; opacity: .6; }
.scope-chip.empty b { color: var(--ink-2); }

/* ---------- 称号详情（长按弹出） ---------- */
.title-info-card { width: min(320px, 100%); }
.title-info-top { display: flex; align-items: center; gap: 10px; }
.title-info-badge { display: flex; flex: 0 0 auto; }
.title-info-head { min-width: 0; }
.title-info-head .confirm-title { margin: 0 0 2px; font-size: 19px; }
.title-info-tier { display: block; font-size: 10px; font-weight: 400; letter-spacing: 1px; color: var(--gold); }
.title-info-desc { margin: 10px 0 8px; font-size: 12px; line-height: 1.65; color: var(--ink-2); }
.title-info-rows { margin: 0 0 14px; padding: 8px 10px; border: 1px solid var(--line-soft); border-radius: 6px; background: rgba(250, 246, 235, .7); }
.title-info-rows > div { display: flex; gap: 8px; padding: 2px 0; }
.title-info-rows dt { flex: 0 0 58px; font-size: 11px; color: var(--ink-2); }
.title-info-rows dd { flex: 1 1 auto; margin: 0; font-size: 11px; line-height: 1.6; color: var(--ink); }
.set-title.locked { cursor: help; }

/* ---------- 仙榜 · 本榜榜名说明 ---------- */
.rank-legend { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 5px; margin: 6px 0 2px; }
.rank-legend-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 5px 4px 4px;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background-size: 200% 100%;
}
.rank-legend-item b { font-family: var(--serif); font-size: 11px; letter-spacing: .5px; }
.rank-legend-item em { font-style: normal; font-size: 9px; opacity: .8; }
.rank-my-title {
  margin: 4px 0 0;
  padding: 5px 8px;
  border: 1px dashed #c9ab63;
  border-radius: 6px;
  background: #fdf6e6;
  color: #6b4a12;
  font-size: 11px;
  line-height: 1.6;
}
.rank-my-title b { color: #8a6512; }

/* ---------- 布局修补（v3.182） ---------- */
/* 手机端整页只该上下滚：排行榜长昵称+称号曾把行撑宽，底部闪出横向滚动条 */
#panel { overflow-x: hidden; }
.rank-row { min-width: 0; overflow: hidden; }
.rank-name { min-width: 0; overflow-wrap: anywhere; }
.rank-title { max-width: 94px; overflow: hidden; text-overflow: ellipsis; }
.rank-legend-item { min-width: 0; overflow: hidden; }

/* 「看看主科进度」按钮：手指按下去要有够大的落点，滚动后也不容易被吞点击 */
.hall-more { min-height: 40px; touch-action: manipulation; }
.hall-mirror { scroll-margin: 70px; }

/* 左右滑动提示只属于可横滑的世界地图，别的页面不必占一行 */
#app > .scroll-guide { display: none; }
body[data-tab="world"] #app > .scroll-guide { display: flex; }

/* ---------- 仙友 ---------- */
.fx-bar { display: flex; gap: 8px; margin: 8px 0 10px; }
.fx-bar .btn { flex: 1 1 auto; }
.fx-avatar {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 50%;
  overflow: hidden;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 30%, #fff8e2, #e5d7b6);
}
.fx-avatar svg { display: block; width: 100%; height: 100%; }
.fx-title {
  display: inline-block;
  margin-left: 4px;
  padding: 0 4px;
  border: 1px solid #d8c08a;
  border-radius: 3px;
  background: #fdf6e6;
  color: #8a6512;
  font-size: 9px;
  font-style: normal;
  line-height: 14px;
  white-space: nowrap;
}
.fx-main { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; min-width: 0; }
.fx-main b { font-size: 13px; color: var(--ink); }
.fx-main small { font-size: 10px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-reqs { display: grid; gap: 6px; margin-bottom: 10px; }
.fx-req {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid #d8c08a;
  border-radius: 8px;
  background: linear-gradient(180deg, #fffdf3, #faf3dd);
}
.fx-req .fx-main { flex: 1 1 auto; }
.fx-req-btns { display: flex; gap: 5px; flex: 0 0 auto; }
.fx-list { display: grid; gap: 6px; }
.fx-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--line-soft);
  border-radius: 8px;
  background: var(--card);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
}
.fx-row:active { background: #fbf4e0; }
.fx-row .fx-main { flex: 1 1 auto; }
.fx-unread {
  flex: 0 0 auto;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #c0392b;
  color: #fff;
  font-size: 10px;
  font-style: normal;
  line-height: 18px;
  text-align: center;
}
.fx-sent { display: grid; gap: 4px; }
.fx-sent-row { display: flex; align-items: center; gap: 7px; font-size: 11px; color: var(--ink-2); }
.fx-sent-row span { flex: 1 1 auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fx-sent-row em { font-style: normal; opacity: .75; }
.fx-form { margin: 10px 0 4px; }
.fx-form input {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  font-family: inherit;
  font-size: 14px;
}
.nav-btn { letter-spacing: .5px; }
.nav-badge {
  position: absolute;
  top: 3px;
  left: 50%;
  transform: translateX(8px);
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #c0392b;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  line-height: 15px;
  text-align: center;
}

/* ---------- 世界频道入口（只在大殿） ---------- */
.hall-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.world-pill {
  flex: 0 0 auto;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 10px 3px;
  border: 1px solid #b8923f;
  border-radius: 8px;
  background: linear-gradient(180deg, #fdf3d2, #f0dfae);
  color: #6b4a12;
  font-family: inherit;
  font-size: 9px;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(140, 100, 30, .18);
}
.world-pill i { font-family: var(--serif); font-style: normal; font-size: 15px; line-height: 1.05; }
.world-pill:active { transform: scale(.97); }

.fx-avatar { width: 38px; height: 38px; }
.fx-gate {
  margin-top: 12px;
  padding: 18px 14px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: var(--card);
  text-align: center;
}
.fx-gate p { margin: 0 0 12px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }
/* 聊天浮层里的门禁内容：可滚动，留出底部安全区 */
.chat-gate-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 16px 14px calc(24px + env(safe-area-inset-bottom)); }
.chat-gate-body .fx-gate { margin-top: 8px; }
.fx-form input { margin-bottom: 2px; }

/* ---------- 聊天层（世界 / 私聊共用） ---------- */
.chat-gate {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: flex;
  flex-direction: column;
  background: #f7f2e4;
}
.chat-head {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #fffdf5, #f7efd9);
}
.chat-back {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}
.chat-who { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.chat-who b { font-family: var(--serif); font-size: 15px; letter-spacing: 1px; color: var(--ink); }
.chat-who em { font-style: normal; font-size: 10px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-tip { flex: 0 0 auto; font-size: 9px; color: var(--ink-2); opacity: .8; }
.chat-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 10px; }
.chat-msg { display: flex; align-items: flex-start; gap: 8px; }
.chat-msg.mine { justify-content: flex-end; }
.chat-main { min-width: 0; max-width: 74%; }
.chat-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; margin-bottom: 2px; font-size: 10px; color: var(--ink-2); }
.chat-msg.mine .chat-meta { justify-content: flex-end; }
.chat-meta b { font-size: 11px; font-weight: 600; color: var(--ink); }
.chat-meta time { font-size: 9px; opacity: .6; }
.chat-bubble {
  padding: 8px 11px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  background: #fffdf6;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.mine .chat-bubble { background: linear-gradient(180deg, #fbeec6, #f3dfa4); border-color: #d9bd78; }
.chat-foot {
  flex: 0 0 auto;
  display: flex;
  gap: 8px;
  padding: 8px 12px calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--card);
}
.chat-input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffdf7;
  font-family: inherit;
  font-size: 13px;
  color: var(--ink);
}
.chat-input:focus { outline: 2px solid rgba(196, 154, 76, .35); outline-offset: 0; }

/* ---------- 洞天秘境（走格子） ---------- */
.dg-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  margin-bottom: 10px;
}
.dg-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.dg-card-head b { font-size: 15px; letter-spacing: 1px; }
.dg-tier { font-size: 11px; color: var(--gold); white-space: nowrap; }

.dg-wrap { margin: 6px 0; }
.dg-wrap h3 { margin: 4px 0 8px; font-family: var(--serif); letter-spacing: 2px; }
.dg-wrap h3 small { font-weight: 400; color: var(--ink-2); margin-left: 6px; }
.dg-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; margin-bottom: 8px; font-size: 11px; color: var(--ink-2); }
.dg-legend span { padding: 1px 6px; border-radius: 4px; background: var(--card); border: 1px solid var(--line); }

.dg-grid {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: radial-gradient(circle at 50% 30%, #efe6cf, #ddd2b8 70%, #c9bda0);
}
.dg-cell {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
  background: rgba(255, 250, 240, .6);
  font-size: 12px;
  color: var(--ink-2);
}
.dg-cell.dg-wall { background: #6b6252; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.dg-cell.dg-entrance { background: #cbb077; color: #fff; font-weight: 700; }
.dg-cell.dg-boss { background: #8c3f30; color: #ffe9b0; font-weight: 700; box-shadow: 0 0 8px rgba(140,63,48,.5); }
.dg-cell.dg-elite { background: #b5622f; color: #fff7e8; }
.dg-cell.dg-small { background: #6c7a5a; color: #fff; }
.dg-cell.dg-chest { background: #c89b2a; color: #fff; }
.dg-cell.dg-fortune { background: #5b8a6f; color: #fff; }
.dg-cell.dg-npc { background: #6b7f9e; color: #fff; }
.dg-cell.dg-cleared { opacity: .55; }
.dg-cell.dg-player { background: #3d6b9e; box-shadow: 0 0 0 2px #fff, 0 0 10px rgba(61,107,158,.6); }
.dg-pawn { width: 60%; height: 60%; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #fff, #3d6b9e); box-shadow: 0 1px 3px rgba(0,0,0,.3); }

.dg-bossbar { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.dg-bossbar > div:first-child { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.dg-bossbar small { color: var(--ink-2); font-size: 11px; }

.dg-control { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.dg-pos { font-size: 12px; margin-bottom: 8px; color: var(--ink-2); }
.dg-dice { text-align: center; font-size: 14px; margin-bottom: 8px; }
.dg-dice b { color: var(--cinnabar); font-size: 20px; }
.dg-dirs { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dg-dirs-mid { display: flex; gap: 6px; }
.dg-dir { width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 8px; background: #fffdf7; font-size: 20px; cursor: pointer; color: var(--ink); }
.dg-dir:active { background: #f0e7d2; }
.dg-dir.dg-stay { width: 58px; font-size: 12px; }
.dg-exit { margin-top: 10px; text-align: center; }

/* ---------- 灵兽围猎（割草小游戏） ---------- */
.slasher-box {
  position: relative;
  width: 100%;
  height: 460px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #131a12;
}
.slasher-canvas { display: block; width: 100%; height: 100%; touch-action: none; }
.slasher-over {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(19, 26, 18, .9); color: #e8f0ff; text-align: center; padding: 20px;
}
.slasher-over b { font-size: 20px; font-family: var(--serif); letter-spacing: 2px; color: #ffd27a; }
.slasher-over p { font-size: 13px; color: #c8d4c8; margin: 0; }

/* 灵兽围猎 · 入场前准备区（选完难度就收起，游戏内不再显示） */
.slash-prep, .slasher-prep {
  background: var(--card); border: 1px solid var(--line); border-radius: 10px;
  padding: 14px; margin-bottom: 12px; text-align: center;
}
.slash-prep-title, .slasher-prep-title { margin: 0 0 10px; font-size: 14px; color: var(--gold); font-weight: 700; }
.slash-prep-tip, .slasher-prep-tip { margin: 10px 0 12px; font-size: 12px; color: var(--ink-2); line-height: 1.7; }

/* 灵兽围猎模式选择 */
.slasher-modes { display: flex; gap: 10px; margin-bottom: 10px; }
.slasher-mode { flex: 1; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); text-align: center; cursor: pointer; }
.slasher-mode b { display: block; font-size: 15px; }
.slasher-mode span { font-size: 11px; color: var(--ink-2); }
.slasher-mode.on { border-color: var(--gold); background: #fdf6e3; box-shadow: 0 0 8px rgba(196,154,76,.4); }

/* ---------- 藏宝阁（宝箱开奖） ---------- */
.chest-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 12px 0; }
.chest-card {
  position: relative; padding: 14px 12px; border: 2px solid var(--chest-c, #a87a3a);
  border-radius: 12px; background: radial-gradient(circle at 50% 20%, var(--chest-bg, #e8dcc0), #d8cba8);
  text-align: center; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.chest-card:hover { transform: translateY(-2px); }
.chest-card.on { box-shadow: 0 0 0 3px var(--gold), 0 0 18px rgba(196,154,76,.6); }
.chest-glyph { display: block; font-size: 34px; color: var(--chest-c, #a87a3a); font-family: var(--serif); }
.chest-card b { display: block; font-size: 15px; letter-spacing: 2px; margin: 2px 0; }
.chest-card em { display: block; font-style: normal; font-size: 13px; color: var(--ink-2); }
.chest-card small { display: block; font-size: 10px; color: var(--ink-2); margin-top: 4px; }

.treasure-result {
  position: fixed; inset: 0; z-index: 200; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(circle at 50% 30%, rgba(30,24,10,.92), rgba(8,6,2,.97));
}
.treasure-cards { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; max-width: 92vw; }
.treasure-drop {
  padding: 14px; border: 2px solid var(--tc, #c89b2a); border-radius: 12px;
  background: rgba(255,250,235,.95); min-width: 110px; text-align: center;
  animation: dropIn .5s cubic-bezier(.2,.9,.3,1.4) both;
}
.treasure-drop b { display: block; color: var(--tc); font-size: 15px; }
.treasure-drop p { margin: 4px 0; font-size: 12px; color: var(--ink-2); }
.drop-item { display: block; font-size: 12px; color: var(--ink); }
.drop-item.qi { color: var(--cinnabar); }
.drop-item.stone { color: var(--gold); }
.treasure-result.shine::before {
  content: ""; position: absolute; inset: -50%;
  background: conic-gradient(from 0deg, transparent, rgba(255,215,120,.25), transparent 30%);
  animation: treasureSpin 2.4s linear infinite; pointer-events: none;
}
@keyframes treasureSpin { to { transform: rotate(360deg); } }
@keyframes dropIn { from { opacity: 0; transform: translateY(30px) scale(.7); } to { opacity: 1; transform: none; } }

/* 藏宝阁让开右下石碑：旧热区 left62%~94% 把仙榜（72%~90%）整个盖住，
   点仙榜中心实际落进藏宝阁。现在挪到坊市与石碑之间的空地，两块互不重叠。 */
.hot-treasure { left: 38%; top: 58%; width: 30%; height: 18%; }  /* 藏宝阁 · 中下 */

/* 手机端虚拟摇杆（灵兽围猎）：按住拖动走动，松手即停 */
.slasher-stick {
  position: absolute; left: 16px; bottom: 16px; z-index: 5;
  width: 108px; height: 108px; border-radius: 50%;
  border: 2px solid rgba(232, 211, 160, .55);
  background: radial-gradient(circle, rgba(80, 100, 70, .35), rgba(20, 30, 18, .55));
  box-shadow: inset 0 0 18px rgba(0, 0, 0, .38), 0 2px 12px rgba(0, 0, 0, .35);
  display: flex; align-items: center; justify-content: center;
  touch-action: none; user-select: none; -webkit-user-select: none;
}
.slasher-stick.active { border-color: #ffd27a; background: radial-gradient(circle, rgba(120, 140, 90, .42), rgba(20, 30, 18, .6)); }
.slasher-stick > i {
  display: block; width: 42px; height: 42px; border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #f5e8b8, #b18b3c 70%, #7a5a22);
  border: 2px solid #ffe9a8; box-shadow: 0 2px 10px rgba(0, 0, 0, .45);
  transition: transform .04s linear;
}
.slasher-stick > span {
  position: absolute; bottom: -2px; left: 50%; transform: translateX(-50%);
  color: rgba(255, 240, 200, .68); font-size: 10px; white-space: nowrap; pointer-events: none;
}
/* 桌面上也保留摇杆：键鼠玩家可以直接按住拖动，不必非用 WASD。
   只是缩小一点、挪到左下角，别挡视野。 */
@media (hover: hover) and (pointer: fine) {
  .slasher-stick { width: 90px; height: 90px; opacity: .72; }
  .slasher-stick:hover, .slasher-stick.active { opacity: 1; }
  .slasher-stick > i { width: 34px; height: 34px; }
}

/* 坊市 · 灵石兑换（下品→中品→上品→极品） */
.stone-exchange {
  margin: 10px 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--card);
}
.stone-exchange .se-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.stone-exchange .se-head b { font-family: var(--serif); font-size: 15px; color: var(--gold); }
.stone-exchange .se-head span { font-size: 11px; color: var(--ink-2); }
.stone-exchange .se-wallet { display: flex; gap: 6px; margin-bottom: 8px; }
.stone-exchange .se-tier { flex: 1; text-align: center; padding: 6px 4px; border: 1px solid var(--line-soft); border-radius: 4px; background: #fbf7ec; }
.stone-exchange .se-tier i { display: block; font-style: normal; font-size: 10px; color: var(--ink-2); }
.stone-exchange .se-tier b { font-size: 15px; color: var(--ink); }
.stone-exchange .se-btns { display: flex; flex-wrap: wrap; gap: 6px; }
.stone-exchange .se-btns .btn-ghost { padding: 5px 9px; font-size: 11px; }


/* 围猎 · 开局装配技能 */
.slasher-skill-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px;
  margin: 8px 0 10px; max-height: 260px; overflow-y: auto;
}
.slasher-skill {
  text-align: left; padding: 7px 9px; border-radius: 5px;
  border: 1px solid var(--line); background: #fbf7ec;
  font-family: inherit; color: var(--ink-2); cursor: pointer;
}
.slasher-skill b { display: block; font-size: 12px; color: var(--ink); }
.slasher-skill span { display: block; font-size: 10px; line-height: 1.35; margin-top: 2px; }
.slasher-skill.on { border-color: var(--teal); background: var(--teal-soft); }
.slasher-skill.on b { color: var(--teal); }
.sla-count { color: var(--gold); font-size: 12px; margin-left: 4px; }

/* 设置页 · 开发者模式 */
.dev-code-row { display: flex; gap: 8px; margin: 8px 0 4px; }
.dev-code-row .text-input { flex: 1; }
.dev-skill-list { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; max-height: 320px; overflow-y: auto; }
.dev-skill-row { display: flex; align-items: center; gap: 8px; padding: 5px 8px; border: 1px solid var(--line-soft); border-radius: 5px; background: #fbf7ec; }
.dev-skill-row.on { border-color: var(--teal); background: var(--teal-soft); }
.dev-own { min-width: 64px; font-size: 11px; padding: 3px 6px; border-radius: 4px; border: 1px solid var(--line); background: #fff; cursor: pointer; }
.dev-skill-row.on .dev-own { border-color: var(--teal); color: var(--teal); }
.dev-skill-name { flex: 1; font-size: 12px; }
.dev-lv { display: flex; align-items: center; gap: 4px; font-size: 11px; color: var(--ink-2); }
.dev-lv-input { width: 54px; padding: 2px 4px; }
