: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;
  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: 16px 16px 10px;
}

.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: 0 16px 12px; }

.strip-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}

.realm-name {
  font-family: var(--serif);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: 2px;
}

.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;
}

.mentor-bar {
  margin: 10px 12px 0;
  padding: 10px 12px;
  background: var(--card);
  border-left: 3px solid var(--gold);
  border-radius: 3px;
  font-size: 13px;
  line-height: 1.7;
}

.mentor-bar b { color: var(--gold); font-weight: 600; }

/* ---------- 主交互区 ---------- */

#panel {
  max-height: 65vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 14px 16px 72px;
  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; }

.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(4, 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: 12px;
  letter-spacing: 2px;
  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: #f1ead8; }
.map-cell.cell-mountain { background: #b3bda9; }
.map-cell.cell-water { background: #b9cdd1; }
.map-cell.cell-place { background: #e3d9bd; }
.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;
}

.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;
}

.dpad button:hover { border-color: var(--teal); color: var(--teal); }

/* ---------- 任务列表 ---------- */

.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-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; }

/* ---------- 主线与支线 ---------- */

.quest-section { margin-top: 18px; letter-spacing: 3px; }
.sec-main { color: var(--cinnabar); }
.sec-side { color: var(--ink-2); }

.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-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: visible; 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; }
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: 8px; }
.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 #b88a39; background: linear-gradient(180deg, #29484a, #142d31); 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; }
.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: 170px; }
body.tutorial-active .story-overlay, body.tutorial-active .lv-overlay { padding-top: 170px; align-items: center; }
.tutorial-card { position: fixed; max-height: 154px; overflow: hidden; 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: 60px; 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: 6px 0 0 auto; padding: 4px 13px; font-size: 11px; }
.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: 4px 2px 0;
  margin-bottom: 4px;
}

.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-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: flex; flex-direction: column; 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; margin-left: 6px; font-size: 9px; color: var(--gold); }
.set-title span { display: block; margin-top: 2px; font-size: 10px; color: var(--ink-2); }
.set-titles.locked .set-title { opacity: .55; cursor: default; }

.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);
}

/* 隐藏工具类必须压过所有 overlay 的 display:flex */
.hidden { display: none !important; }
