:root {
  --ink-bg: #0b1015;
  --ink-panel: rgba(15, 22, 30, 0.84);
  --ink-border: rgba(235, 195, 114, 0.28);
  --gold: #f0c265;
  --gold-dim: #b48a3b;
  --crimson: #ef5b49;
  --cyan: #5ed4e6;
  --jade: #6ee09c;
  --text: #eef3f8;
  --muted: #9ab0c4;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--ink-bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

#gameStage {
  position: fixed;
  inset: 0;
  z-index: 1;
}

/* 山门界面 */
.shanmen-root {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.shanmen-backdrop {
  position: fixed;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: brightness(0.45) saturate(1.05);
  z-index: -2;
}

.shanmen-vignette {
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at 50% 45%, rgba(12, 18, 25, 0.25), rgba(8, 12, 17, 0.9));
  z-index: -1;
}

.shanmen-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 24px;
  border-bottom: 1px solid var(--ink-border);
  background: rgba(10, 15, 21, 0.72);
  backdrop-filter: blur(8px);
}

.brand-title {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 4px;
  color: var(--gold);
  text-shadow: 0 2px 14px rgba(240, 194, 101, 0.35);
}

.brand-sub {
  font-size: 12px;
  color: var(--cyan);
  margin-top: 2px;
}

.header-status {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pill {
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 12px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.pill.gold {
  color: var(--gold);
  border-color: var(--ink-border);
  background: rgba(240, 194, 101, 0.12);
}

.btn-ghost {
  padding: 7px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(20, 28, 38, 0.78);
  color: var(--text);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  transition: .18s;
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold);
}

.shanmen-main {
  flex: 1;
  display: grid;
  grid-template-columns: 310px minmax(280px, 1fr) 390px;
  gap: 18px;
  padding: 18px 24px;
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  align-items: stretch;
}

@media (max-width: 1080px) {
  .shanmen-main {
    grid-template-columns: 1fr;
  }
}

.section-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 1px;
  margin-bottom: 8px;
}

.hero-cards, .chapter-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-card, .chapter-card {
  background: var(--ink-panel);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  transition: transform .15s, border-color .15s, background .15s;
}

.hero-card:hover, .chapter-card:hover:not(.locked) {
  transform: translateY(-1px);
  border-color: var(--gold);
}

.hero-card.active, .chapter-card.active {
  border-color: var(--gold);
  background: linear-gradient(135deg, rgba(240, 194, 101, 0.18), rgba(16, 24, 34, 0.9));
  box-shadow: 0 0 18px rgba(240, 194, 101, 0.14);
}

.chapter-card.locked {
  opacity: 0.45;
  cursor: not-allowed;
}

.card-row-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}

.card-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.hero-showcase-col {
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-portrait-frame {
  position: relative;
  width: 100%;
  max-width: 460px;
  height: 100%;
  min-height: 430px;
  max-height: 610px;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--ink-border);
  background: #0d141b;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.55);
}

.hero-portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.portrait-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 12px;
  background: rgba(10, 15, 22, 0.8);
  border: 1px solid var(--ink-border);
  color: var(--gold);
}

.portrait-caption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px 16px 14px;
  background: linear-gradient(transparent, rgba(7, 11, 16, 0.95) 55%);
}

.portrait-caption h2 {
  margin: 0;
  font-size: 20px;
  color: var(--gold);
}

.portrait-caption p {
  margin: 4px 0 0;
  font-size: 12px;
  color: #cdd8e4;
}

.loadout-col {
  display: flex;
  flex-direction: column;
  background: var(--ink-panel);
  border: 1px solid var(--ink-border);
  border-radius: 14px;
  padding: 14px;
  backdrop-filter: blur(8px);
}

.nav-pills {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 12px;
}

.nav-pill {
  padding: 8px 4px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nav-pill.active {
  background: rgba(240, 194, 101, 0.18);
  border-color: var(--gold);
  color: var(--gold);
}

.panel-box {
  display: none;
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}

.panel-box.active {
  display: block;
}

.kit-block {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.kit-block h4 {
  margin: 0 0 4px;
  font-size: 13px;
  color: var(--gold);
}

.kit-block p {
  margin: 0;
  font-size: 12px;
  color: #cfdbe6;
  line-height: 1.55;
}

.small-tip {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.launch-bar {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.vfx-toggle {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 10px;
}

.btn-launch {
  width: 100%;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #f3cb72, #cf8f2c);
  color: #1a1102;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 1px;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(240, 194, 101, 0.3);
}

.btn-launch:hover {
  filter: brightness(1.06);
}

/* 战斗 HUD */
.combat-hud {
  position: fixed;
  inset: 0;
  z-index: 20;
  pointer-events: none;
}

.hud-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px 18px;
  gap: 14px;
}

.hud-left {
  width: 240px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hp-wrap, .xp-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  text-shadow: 0 1px 3px #000;
}

.hp-bar, .xp-bar {
  flex: 1;
  height: 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
}

.hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #e74c3c, #ff7e5f);
  transition: width .12s;
}

.xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #43d9ad, #62b6ff);
  transition: width .12s;
}

.res-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--gold);
}

.res-dots {
  display: flex;
  gap: 6px;
}

.res-dot {
  width: 16px;
  height: 10px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.55);
}

.res-dot.active {
  background: var(--gold);
  box-shadow: 0 0 10px var(--gold);
}

.hud-center {
  text-align: center;
  flex: 1;
  max-width: 440px;
}

.chapter-tag {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold);
  text-shadow: 0 2px 6px #000;
}

.timer-tag {
  font-size: 22px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  text-shadow: 0 2px 8px #000;
}

.boss-banner {
  margin-top: 6px;
  background: rgba(18, 10, 12, 0.78);
  padding: 6px 12px;
  border-radius: 10px;
  border: 1px solid rgba(239, 91, 73, 0.6);
}

.boss-name {
  font-size: 13px;
  font-weight: 700;
  color: #ff9c8f;
  margin-bottom: 4px;
}

.boss-hp-bar {
  height: 10px;
  border-radius: 99px;
  background: rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.boss-hp-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #ff3e30, #f59e42);
}

.hud-right {
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: auto;
}

.stat-chip {
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(12, 18, 25, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-size: 12px;
}

.btn-hud {
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--ink-border);
  background: rgba(12, 18, 25, 0.85);
  color: var(--gold);
  cursor: pointer;
}

.event-banner {
  position: fixed;
  top: 96px;
  left: 50%;
  transform: translateX(-50%);
  padding: 10px 24px;
  border-radius: 99px;
  background: rgba(14, 20, 28, 0.88);
  border: 1px solid var(--gold);
  color: var(--gold);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.6);
}

.hud-daojue-bar {
  position: fixed;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 520px;
}

.dj-chip {
  padding: 4px 10px;
  border-radius: 8px;
  background: rgba(11, 17, 24, 0.8);
  border: 1px solid rgba(94, 212, 230, 0.35);
  font-size: 11px;
  color: var(--cyan);
}

.touch-controls {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.joystick-zone {
  position: fixed;
  left: 22px;
  bottom: 22px;
  width: 140px;
  height: 140px;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.joystick-base {
  width: 106px;
  height: 106px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  position: relative;
}

.joystick-knob {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(240, 194, 101, 0.72);
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.ctrl-hint {
  margin-top: 6px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.65);
  text-shadow: 0 1px 2px #000;
}

.action-buttons {
  position: fixed;
  right: 24px;
  bottom: 28px;
  display: flex;
  gap: 14px;
  pointer-events: auto;
}

.act-btn {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: rgba(15, 22, 30, 0.82);
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.55);
}

.act-btn span {
  font-size: 15px;
  font-weight: 800;
  color: var(--gold);
}

.act-btn small {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
}

.act-btn.skill-btn {
  width: 88px;
  height: 88px;
  border-color: var(--cyan);
}

.act-btn.skill-btn span {
  color: var(--cyan);
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(6, 10, 15, 0.76);
  backdrop-filter: blur(5px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-card {
  width: 100%;
  max-width: 820px;
  background: #121b24;
  border: 1px solid var(--gold);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.7);
}

.modal-title {
  font-size: 21px;
  font-weight: 800;
  color: var(--gold);
  text-align: center;
}

.modal-sub {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin-top: 4px;
}

.wudao-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.wudao-opt {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 14px;
  cursor: pointer;
  transition: .16s;
  text-align: left;
}

.wudao-opt:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
  background: rgba(240, 194, 101, 0.12);
}

.wudao-opt.shentong-opt {
  border-color: #ffd86b;
  background: linear-gradient(145deg, rgba(255, 216, 107, 0.2), rgba(24, 30, 42, 0.95));
}

.wudao-opt-type {
  font-size: 11px;
  color: var(--cyan);
  margin-bottom: 4px;
}

.wudao-opt-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--gold);
  margin-bottom: 6px;
}

.wudao-opt-desc {
  font-size: 12px;
  color: #d6e2ee;
  line-height: 1.5;
}

.modal-footer {
  margin-top: 16px;
  display: flex;
  justify-content: center;
  gap: 12px;
}

.settle-body {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.28);
  border-radius: 10px;
  padding: 14px;
  font-size: 13px;
  line-height: 1.8;
}
