:root {
  color-scheme: light;
  --bg: #f6f3ec;
  --surface: #fffdfa;
  --surface-strong: #ffffff;
  --ink: #232323;
  --muted: #68625b;
  --line: #ded6c8;
  --green: #4f9f64;
  --blue: #3285b9;
  --red: #c65a42;
  --gold: #c48a26;
  --ice: #72aeb9;
  --locked: #9a9690;
  --shadow: 0 16px 40px rgba(67, 54, 36, 0.12);
  font-family:
    "Microsoft YaHei",
    "PingFang SC",
    "Noto Sans SC",
    system-ui,
    sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.66), rgba(255, 255, 255, 0)),
    var(--bg);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

.app-shell {
  width: min(1480px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 22px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 86px;
  padding: 20px 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.eyebrow,
.tile-label,
.tile-note {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(1.85rem, 4vw, 3.25rem);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.05rem;
  letter-spacing: 0;
}

.save-status {
  flex: 0 0 auto;
  max-width: 260px;
  padding: 9px 12px;
  border: 1px solid #b9d7be;
  border-radius: 8px;
  color: #276438;
  background: #edf8ee;
  font-size: 0.9rem;
  text-align: right;
}

.app-grid {
  display: grid;
  grid-template-columns: minmax(280px, 320px) minmax(0, 1fr) minmax(280px, 340px);
  align-items: start;
  gap: 18px;
  margin-top: 18px;
}

.panel,
.status-tile {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel {
  padding: 18px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.create-form,
.teacher-login,
.teacher-controls {
  display: grid;
  gap: 14px;
}

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.field input,
.field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--surface-strong);
}

.field input:focus,
.field select:focus,
.gender-field input:focus-visible + span,
button:focus-visible {
  outline: 3px solid rgba(50, 133, 185, 0.24);
  outline-offset: 2px;
}

.gender-field {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}

.gender-field legend {
  grid-column: 1 / -1;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.88rem;
}

.gender-field input {
  position: absolute;
  opacity: 0;
}

.gender-field span {
  display: grid;
  place-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
}

.gender-field input:checked + span {
  border-color: #4f9f64;
  color: #215b31;
  background: #edf8ee;
  font-weight: 700;
}

.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  border: 1px solid transparent;
  font-weight: 700;
  letter-spacing: 0;
}

.primary-button {
  color: #ffffff;
  background: #2d7442;
}

.primary-button:hover:not(:disabled) {
  background: #235d34;
}

.secondary-button {
  color: #214f6f;
  border-color: #bdd6e5;
  background: #edf7fc;
}

.secondary-button:hover:not(:disabled) {
  background: #dff0f9;
}

.danger-button {
  color: #79301f;
  border-color: #e6bfad;
  background: #fff1eb;
}

.danger-button:hover:not(:disabled) {
  background: #ffe4d9;
}

.ghost-button {
  color: var(--muted);
  border-color: var(--line);
  background: var(--surface-strong);
}

.button-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  line-height: 1;
}

.profile-list {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.profile-record {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 8px;
  align-items: stretch;
}

.profile-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  font-size: 0.92rem;
}

.profile-option {
  display: grid;
  gap: 5px;
  width: 100%;
  min-height: 76px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: var(--ink);
  background: var(--surface-strong);
  text-align: left;
}

.profile-option:hover,
.profile-option.active {
  border-color: #4f9f64;
  background: #f1faf2;
}

.profile-option strong {
  font-size: 1rem;
}

.profile-option span {
  color: var(--muted);
  font-size: 0.82rem;
}

.profile-delete {
  width: 42px;
  min-height: 76px;
  border: 1px solid #e6bfad;
  border-radius: 8px;
  color: #79301f;
  background: #fff1eb;
  font-size: 0.86rem;
  font-weight: 800;
}

.profile-delete:hover {
  background: #ffe4d9;
}

.teacher-panel {
  padding: 12px;
  font-size: 0.9rem;
}

.teacher-panel .panel-heading {
  margin-bottom: 10px;
}

.teacher-panel .teacher-login,
.teacher-panel .teacher-controls {
  gap: 10px;
}

.teacher-panel .field {
  gap: 5px;
  font-size: 0.82rem;
}

.teacher-panel .field input,
.teacher-panel .field select,
.teacher-panel .secondary-button,
.teacher-panel .danger-button,
.teacher-panel .ghost-button {
  min-height: 34px;
  padding: 0 9px;
}

.teacher-panel .button-icon {
  width: 14px;
  height: 14px;
}

.game-area {
  min-width: 0;
}

/* 游戏区：侧栏（宠物信息）+ 主区（场景/商店/排行榜） */
.game-stage {
  display: grid;
  gap: 18px;
}

.game-sidebar,
.game-main {
  display: grid;
  gap: 18px;
  align-content: start;
  min-width: 0;
}

/* 学生端：桌面宽屏，侧栏固定右侧主区 */
.app-grid.is-student {
  grid-template-columns: minmax(0, 1fr);
}

.app-grid.is-student .game-stage {
  grid-template-columns: minmax(340px, 430px) minmax(0, 1fr);
  align-items: start;
}

.app-grid.is-student .status-grid {
  grid-template-columns: minmax(200px, 1fr) 150px minmax(230px, 300px);
}

.app-grid.is-student .pet-status-row {
  align-items: flex-start;
}

.app-grid.is-student .pet-status-row .tile-note {
  word-break: normal;
  overflow-wrap: break-word;
}

.empty-state {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  min-height: 520px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(120deg, rgba(79, 159, 100, 0.13), rgba(50, 133, 185, 0.12)),
    var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}

.empty-state[hidden] {
  display: none;
}

.empty-note {
  max-width: 470px;
  margin: 0 auto;
  color: var(--ink-soft, #6b6152);
  font-size: 14px;
  line-height: 1.75;
}

.empty-note[hidden] {
  display: none;
}

.empty-state .primary-button {
  margin-top: 2px;
}


.empty-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--green);
  background: rgba(255, 255, 255, 0.75);
  font-size: 2.25rem;
}

.game-view {
  display: grid;
  gap: 18px;
}

.status-grid {
  display: grid;
  grid-template-columns: minmax(260px, 1.3fr) 0.7fr 0.8fr;
  gap: 14px;
}

.status-tile {
  min-height: 104px;
  padding: 16px;
  min-width: 0;
}

.status-tile strong {
  display: block;
  margin-top: 8px;
  font-size: 2rem;
  line-height: 1;
}

.pet-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  margin-top: 8px;
}

.pet-small-icon {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  object-fit: contain;
}

.pet-status-row .tile-note {
  margin-top: 0;
}

.hero-tile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background:
    linear-gradient(135deg, rgba(79, 159, 100, 0.13), rgba(196, 138, 38, 0.12)),
    var(--surface);
}

.hero-tile h2 {
  margin-top: 8px;
  font-size: 1.5rem;
  word-break: break-word;
}

.gender-badge {
  display: inline-grid;
  place-items: center;
  min-width: 48px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #255c70;
  background: #eef8fb;
  font-weight: 700;
}

.stat-row {
  display: grid;
  gap: 8px;
}

.stat-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.95rem;
}

.stat-meta strong {
  white-space: nowrap;
}

.progress-track {
  width: 100%;
  height: 13px;
  overflow: hidden;
  border-radius: 999px;
  background: #ebe5da;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.hp-fill {
  background: var(--green);
}

.exp-fill {
  background: var(--gold);
}

.scene-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 12px;
}

.scene-card:not(:disabled):hover,
.scene-card.selected {
  border-color: #2d7442;
  box-shadow: 0 0 0 3px rgba(79, 159, 100, 0.14);
}

.scene-card.locked {
  color: #6f6a64;
  filter: grayscale(0.92);
  opacity: 0.72;
}

.scene-art {
  position: relative;
  overflow: hidden;
  min-height: 92px;
  background: #eef4e8;
}

.scene-title span {
  color: var(--muted);
  font-size: 0.78rem;
}

.result-message,
.teacher-message {
  min-height: 36px;
  margin-top: 12px;
  color: #38553f;
  font-size: 0.92rem;
  line-height: 1.45;
}

.result-message.warning,
.teacher-message.warning {
  color: #8a3d29;
}

.hatch-content {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  min-height: 180px;
}

.egg-visual {
  display: grid;
  place-items: center;
  width: 110px;
  height: 126px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbfd;
}

.pet-card {
  display: grid;
  place-items: center;
  width: 180px;
  height: 180px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(150deg, rgba(114, 174, 185, 0.24), rgba(196, 138, 38, 0.14)),
    #ffffff;
}

.egg-core {
  width: 62px;
  height: 82px;
  border-radius: 54% 54% 48% 48%;
  border: 2px solid rgba(35, 35, 35, 0.16);
  background:
    radial-gradient(circle at 64% 27%, rgba(255, 255, 255, 0.86) 0 11px, transparent 12px),
    linear-gradient(160deg, #eaf6ff, #f5fcff 50%, #d5e8f5);
  box-shadow: inset 0 -9px 15px rgba(50, 133, 185, 0.16);
}

.hatch-panel.male-style .egg-core {
  background:
    radial-gradient(circle at 64% 27%, rgba(255, 255, 255, 0.78) 0 10px, transparent 11px),
    linear-gradient(160deg, #dbeaff, #f3f8ff 46%, #9bbbe6);
  box-shadow: inset 0 -11px 16px rgba(34, 71, 127, 0.2);
}

.hatch-panel.female-style .egg-core {
  background:
    radial-gradient(circle at 64% 27%, rgba(255, 255, 255, 0.82) 0 10px, transparent 11px),
    linear-gradient(160deg, #fff0f5, #fffaff 45%, #f5bdd0);
  box-shadow: inset 0 -11px 16px rgba(189, 92, 126, 0.18);
}

.hatch-copy {
  display: grid;
  gap: 9px;
}

.hatch-copy h3 {
  margin: 0;
  font-size: 1.18rem;
}

.hatch-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.hatch-copy button {
  width: fit-content;
  margin-top: 4px;
}

.evolution-track {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 0 2px;
}

.evolution-step {
  display: grid;
  grid-template-columns: 38px 1fr;
  align-items: center;
  gap: 6px;
  min-width: 132px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 5px 7px;
  color: var(--muted);
  background: #f2f0eb;
  font-size: 0.78rem;
}

.evolution-step.reached {
  color: var(--ink);
  border-color: #b9d7be;
  background: #f2faf2;
}

.evolution-step.locked {
  opacity: 0.55;
  filter: grayscale(0.8);
}

.evolution-step img {
  width: 38px;
  height: 38px;
  object-fit: contain;
}

.pet-avatar {
  width: 180px;
  height: 180px;
  object-fit: contain;
}

.pet-mark {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  color: #ffffff;
  background: #2d7442;
  font-size: 1.6rem;
  font-weight: 800;
}

.hatch-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hatch-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 9px;
  color: var(--muted);
  background: var(--surface-strong);
  font-size: 0.82rem;
}

.teacher-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.scene-grass {
  background: linear-gradient(#ccecc7 0 45%, #81c784 46% 100%);
}

.scene-fire {
  background: linear-gradient(#ffd2a6 0 48%, #c65a42 49% 100%);
}

.scene-water {
  background: linear-gradient(#c8edf8 0 45%, #3285b9 46% 100%);
}

.scene-lab {
  background: linear-gradient(#f2f0e8 0 52%, #b8b0a2 53% 100%);
}

.scene-ice {
  background: linear-gradient(#e8fbff 0 48%, #72aeb9 49% 100%);
}

.scene-thunder {
  background: linear-gradient(#1a1a2e 0 48%, #4a4e69 49% 100%);
}

.scene-shadow {
  background: linear-gradient(#1a1a2e 0 48%, #2d1b3d 49% 100%);
}

.scene-swamp {
  background: linear-gradient(#1b2e1b 0 48%, #3e2723 49% 100%);
}

.scene-dragon {
  background: linear-gradient(#fff3e0 0 48%, #ff7043 49% 100%);
}

.scene-sky {
  background: linear-gradient(#e3f2fd 0 48%, #64b5f6 49% 100%);
}

.scene-art svg {
  width: 100%;
  height: 100%;
  display: block;
}

@media (max-width: 1280px) {
  .app-grid {
    grid-template-columns: minmax(240px, 300px) minmax(0, 1fr);
    grid-template-areas:
      "teacher game"
      "profile game";
    grid-template-rows: max-content 1fr;
    gap: 14px;
    align-items: start;
  }

  .teacher-panel {
    grid-area: teacher;
    position: static;
    max-height: 80vh;
    overflow-y: auto;
  }

  .profile-panel {
    grid-area: profile;
  }

  .game-area {
    grid-area: game;
  }

  .app-grid.is-student .profile-panel,
  .app-grid.is-student .teacher-panel,
  .app-grid.is-student .game-area {
    grid-area: auto;
  }

  .scene-grid {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
  }

  .app-grid.is-student .game-stage {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
  }

  .app-grid.is-student .status-grid {
    grid-template-columns: minmax(180px, 1fr) 130px minmax(200px, 260px);
  }
}

@media (min-width: 1281px) {
  .teacher-panel {
    position: sticky;
    top: 18px;
    max-height: calc(100vh - 36px);
    overflow-y: auto;
  }
}

@media (max-width: 820px) {
  .app-shell {
    padding: 12px;
  }

  .topbar,
  .app-grid,
  .status-grid,
  .hatch-content {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
    padding: 16px;
  }

  .save-status {
    width: 100%;
    max-width: none;
    text-align: left;
  }

  .app-grid {
    display: grid;
  }

  .profile-panel,
  .game-area,
  .teacher-panel {
    grid-column: auto;
    grid-row: auto;
  }

  .scene-grid {
    grid-template-columns: repeat(2, minmax(135px, 1fr));
  }

}

@media (max-width: 520px) {
  .scene-grid {
    grid-template-columns: 1fr;
  }

  .teacher-actions {
    grid-template-columns: 1fr;
  }

  .panel,
  .status-tile {
    padding: 14px;
  }
}

/* ===== 宠物亲密度 & 道具背包 ===== */

.inventory-panel {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.inventory-heading {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--ink);
}

.inventory-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.inventory-tab {
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  font-size: 0.75rem;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
}

.inventory-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.inventory-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.inventory-tab.bond-done {
  border-color: #2e7d32;
}

.inventory-tab.active.bond-done {
  background: #2e7d32;
  border-color: #2e7d32;
}

.inventory-scene-group {
  margin-bottom: 12px;
}

.inventory-scene-group:last-child {
  margin-bottom: 0;
}

.inventory-scene-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.inventory-scene-name {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

.inventory-scene-progress {
  font-size: 0.78rem;
  color: var(--muted);
}

.inventory-scene-progress.bond-done {
  color: #2e7d32;
  font-weight: 700;
}

.inventory-item-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
}

.inventory-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 6px 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  text-align: center;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.inventory-item.owned {
  border-color: #b9d7be;
  background: #f6fbf6;
}

.inventory-item.owned:hover {
  border-color: #81c784;
  box-shadow: 0 2px 8px rgba(76, 175, 80, 0.15);
}

.inventory-item.locked {
  opacity: 0.45;
  filter: grayscale(0.9);
}

.inventory-item-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
}

.inventory-item-icon svg {
  width: 44px;
  height: 44px;
  display: block;
}

.inventory-item-name {
  font-size: 0.72rem;
  color: var(--ink);
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-item-count {
  font-size: 0.7rem;
  color: var(--muted);
  font-weight: 700;
}

.inventory-item.owned .inventory-item-count {
  color: #2e7d32;
}

@media (max-width: 820px) {
  .inventory-item-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== 全局结果消息 ===== */
.global-result {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 8px;
  background: #f0f7f0;
  border: 1px solid #c8e6c9;
  color: #2e7d32;
  font-size: 0.9rem;
  min-height: 20px;
  transition: all 0.3s ease;
}

.global-result.warning {
  background: #fff3e0;
  border-color: #ffcc80;
  color: #e65100;
}

/* ===== 视图导航 ===== */
.view-nav {
  display: flex;
  gap: 8px;
  margin: 12px 0;
}

.view-nav-btn {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.view-nav-btn:hover {
  border-color: #a5d6a7;
  color: var(--ink);
  transform: translateY(-1px);
}

.view-nav-btn.active {
  background: linear-gradient(135deg, #4f9f64, #66bb6a);
  color: #fff;
  border-color: #4f9f64;
  box-shadow: 0 4px 12px rgba(79, 159, 100, 0.3);
}

.panel-hint {
  font-size: 0.78rem;
  color: var(--muted);
  font-weight: 400;
}

/* ===== 场景内部视图 ===== */
.scene-inner-panel {
  overflow: hidden;
}

.scene-atmosphere {
  margin-bottom: 14px;
  border-radius: 10px;
  overflow: hidden;
}

/* 场景氛围动画 */
.scene-atmosphere-bg.scene-grass {
  background: linear-gradient(180deg, #87ceeb 0%, #98d98e 60%, #66bb6a 100%);
}
.scene-atmosphere-bg.scene-grass::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(255,255,255,0.8) 0%, transparent 8%),
    radial-gradient(circle at 60% 20%, rgba(255,255,255,0.6) 0%, transparent 6%),
    radial-gradient(circle at 80% 35%, rgba(255,255,255,0.7) 0%, transparent 7%);
  animation: cloudDrift 8s ease-in-out infinite alternate;
}
@keyframes cloudDrift {
  from { transform: translateX(0); }
  to { transform: translateX(10px); }
}

.scene-atmosphere-bg.scene-fire {
  background: linear-gradient(180deg, #ff7043 0%, #d84315 50%, #bf360c 100%);
}
.scene-atmosphere-bg.scene-fire::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(255,235,59,0.4) 0%, transparent 15%),
    radial-gradient(circle at 70% 60%, rgba(255,152,0,0.3) 0%, transparent 12%);
  animation: lavaGlow 2s ease-in-out infinite alternate;
}
@keyframes lavaGlow {
  from { opacity: 0.6; }
  to { opacity: 1; }
}

.scene-atmosphere-bg.scene-water {
  background: linear-gradient(180deg, #81d4fa 0%, #4fc3f7 50%, #29b6f6 100%);
}
.scene-atmosphere-bg.scene-water::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 80%, rgba(255,255,255,0.3) 0%, transparent 5%),
    radial-gradient(circle at 50% 90%, rgba(255,255,255,0.25) 0%, transparent 4%),
    radial-gradient(circle at 75% 85%, rgba(255,255,255,0.3) 0%, transparent 5%);
  animation: bubbleRise 3s ease-in-out infinite;
}
@keyframes bubbleRise {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50% { transform: translateY(-8px); opacity: 1; }
}

.scene-atmosphere-bg.scene-lab {
  background: linear-gradient(180deg, #b39ddb 0%, #9575cd 50%, #7e57c2 100%);
}
.scene-atmosphere-bg.scene-lab::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 25%, #fff 0%, transparent 2%),
    radial-gradient(circle at 70% 15%, #fff 0%, transparent 1.5%),
    radial-gradient(circle at 50% 35%, #fff 0%, transparent 2%),
    radial-gradient(circle at 85% 30%, #fff 0%, transparent 1.5%);
  animation: starTwinkle 2s ease-in-out infinite alternate;
}
@keyframes starTwinkle {
  from { opacity: 0.4; }
  to { opacity: 1; }
}

.scene-atmosphere-bg.scene-ice {
  background: linear-gradient(180deg, #b3e5fc 0%, #81d4fa 40%, #4fc3f7 100%);
}
.scene-atmosphere-bg.scene-ice::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 15% 20%, rgba(255,255,255,0.9) 0%, transparent 3%),
    radial-gradient(circle at 40% 40%, rgba(255,255,255,0.7) 0%, transparent 2.5%),
    radial-gradient(circle at 65% 15%, rgba(255,255,255,0.8) 0%, transparent 3%),
    radial-gradient(circle at 85% 35%, rgba(255,255,255,0.6) 0%, transparent 2%);
  animation: snowFall 4s linear infinite;
}
@keyframes snowFall {
  from { transform: translateY(-10px); }
  to { transform: translateY(15px); }
}

.scene-atmosphere-bg.scene-thunder {
  background: linear-gradient(180deg, #1a1a2e 0%, #16213e 40%, #0f3460 100%);
}
.scene-atmosphere-bg.scene-thunder::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, transparent 40%, rgba(255,255,255,0.3) 45%, transparent 50%),
    linear-gradient(45deg, transparent 60%, rgba(255,235,59,0.2) 65%, transparent 70%);
  animation: thunderFlash 3s ease-in-out infinite;
}
@keyframes thunderFlash {
  0%, 90%, 100% { opacity: 0.3; }
  92% { opacity: 1; }
  94% { opacity: 0.2; }
  96% { opacity: 0.8; }
}

.scene-atmosphere-bg.scene-shadow {
  background: linear-gradient(180deg, #1a1a2e 0%, #2d1b3d 50%, #1a1a2e 100%);
}
.scene-atmosphere-bg.scene-shadow::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(124,77,255,0.3) 0%, transparent 20%),
    radial-gradient(circle at 70% 60%, rgba(79,195,247,0.2) 0%, transparent 25%);
  animation: ghostFloat 5s ease-in-out infinite;
}
@keyframes ghostFloat {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(-10px); opacity: 1; }
}

.scene-atmosphere-bg.scene-swamp {
  background: linear-gradient(180deg, #1b2e1b 0%, #2e3d1b 50%, #1b2e1b 100%);
}
.scene-atmosphere-bg.scene-swamp::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 70%, rgba(124,179,66,0.3) 0%, transparent 25%),
    radial-gradient(circle at 60% 40%, rgba(76,175,80,0.2) 0%, transparent 20%);
  animation: bubbleRise 4s ease-in-out infinite;
}
@keyframes bubbleRise {
  0% { transform: translateY(10px); opacity: 0.4; }
  50% { transform: translateY(-5px); opacity: 0.8; }
  100% { transform: translateY(10px); opacity: 0.4; }
}

.scene-atmosphere-bg.scene-dragon {
  background: linear-gradient(180deg, #bf360c 0%, #e64a19 40%, #ff7043 100%);
}
.scene-atmosphere-bg.scene-dragon::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 25% 20%, rgba(255,235,59,0.4) 0%, transparent 15%),
    radial-gradient(circle at 75% 50%, rgba(255,152,0,0.3) 0%, transparent 20%);
  animation: emberGlow 3s ease-in-out infinite;
}
@keyframes emberGlow {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

.scene-atmosphere-bg.scene-sky {
  background: linear-gradient(180deg, #81d4fa 0%, #4fc3f7 40%, #29b6f6 100%);
}
.scene-atmosphere-bg.scene-sky::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 25%, rgba(255,255,255,0.9) 0%, transparent 18%),
    radial-gradient(ellipse at 60% 15%, rgba(255,255,255,0.8) 0%, transparent 22%),
    radial-gradient(ellipse at 80% 50%, rgba(255,255,255,0.7) 0%, transparent 15%);
  animation: cloudDrift 8s linear infinite;
}
@keyframes cloudDrift {
  from { transform: translateX(-10px); }
  to { transform: translateX(10px); }
}

.back-button {
  margin-right: auto;
}

.scene-spot-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.spot-card.selected {
  border-color: #4f9f64;
  background: #f1f8e9;
}

/* 探索中动画 */
.result-message.exploring {
  color: #1565c0;
  background: #e3f2fd;
  border-color: #90caf9;
}

.result-message.exploring::after {
  content: " 🔍";
  display: inline-block;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* 道具掉落动画 */
.result-message.has-item-drop {
  animation: itemPop 0.5s ease;
}

@keyframes itemPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.03); background: #fff8e1; border-color: #ffd54f; }
  100% { transform: scale(1); }
}

/* 亲密度升级动画 */
.result-message.has-bond-up {
  animation: bondCelebrate 0.8s ease;
  background: linear-gradient(135deg, #fce4ec, #f3e5f5);
  border-color: #f48fb1;
  color: #880e4f;
  font-weight: 600;
}

@keyframes bondCelebrate {
  0% { transform: scale(1); }
  30% { transform: scale(1.05); }
  60% { transform: scale(0.98); }
  100% { transform: scale(1); }
}

/* ===== 商店面板 ===== */
.shop-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}

.shop-tab {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  transition: all 0.2s ease;
}

.shop-tab:hover {
  border-color: #ffcc80;
  color: var(--ink);
}

.shop-tab.active {
  background: linear-gradient(135deg, #ff9800, #ffb74d);
  color: #fff;
  border-color: #ff9800;
}

.shop-hint {
  margin: 0 0 12px;
  padding: 8px 12px;
  background: #fff8e1;
  border-radius: 6px;
  font-size: 0.82rem;
  color: #e65100;
}

.shop-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 0.9rem;
}

.shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
  align-items: stretch;
}

.shop-item-card {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 6px 12px;
  min-height: 72px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.shop-item-card:hover {
  border-color: #ffcc80;
  box-shadow: 0 4px 14px rgba(255, 152, 0, 0.12);
}

.shop-item-card.sell-card {
  cursor: pointer;
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
}

.shop-item-card.sell-card:hover {
  border-color: #ffcc80;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(255, 152, 0, 0.15);
}

/* 我的上架：图标 + 名称/售价 + 价格 + 下架按钮 */
.shop-item-card.mine-card {
  grid-template-columns: 44px minmax(0, 1fr) auto auto;
}

.shop-item-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #fff8e1;
  overflow: hidden;
}

.shop-item-icon svg {
  width: 32px;
  height: 32px;
}

.shop-item-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.shop-item-info strong {
  font-size: 0.9rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-seller {
  font-size: 0.75rem;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-item-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: #e65100;
  white-space: nowrap;
  text-align: right;
  justify-self: end;
  font-variant-numeric: tabular-nums;
}

.shop-buy-btn {
  min-width: 76px;
  justify-self: end;
  padding: 7px 12px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.shop-cancel-btn {
  min-width: 64px;
  justify-self: end;
  padding: 6px 12px;
  font-size: 0.8rem;
  white-space: nowrap;
}

.shop-own-tag {
  min-width: 76px;
  justify-self: end;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: #f1f8f2;
  font-size: 0.72rem;
  color: #4f9f64;
  font-weight: 700;
  white-space: nowrap;
}

.shop-list-tag {
  min-width: 76px;
  justify-self: end;
  text-align: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: #fff4e5;
  font-size: 0.72rem;
  color: #ff9800;
  font-weight: 700;
  white-space: nowrap;
}

/* 市场摘要条：在售 / 最低价 / 我的余额 */
.shop-stats {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 20px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border: 1px solid #ffe0b2;
  border-radius: 10px;
  background: #fffaf0;
  font-size: 0.82rem;
  color: #7a5a2e;
}

.shop-stats b {
  color: #e65100;
  font-size: 0.95rem;
}

/* ===== 宠物呼吸动画 ===== */
.pet-avatar {
  animation: petBreathe 3s ease-in-out infinite;
}

@keyframes petBreathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

/* ===== 按钮通用交互 ===== */
.primary-button,
.secondary-button,
.ghost-button,
.danger-button {
  transition: all 0.2s ease;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 159, 100, 0.3);
}

.primary-button:active:not(:disabled) {
  transform: translateY(0);
}

.secondary-button:hover:not(:disabled) {
  transform: translateY(-1px);
}

/* ===== 面板淡入 ===== */
.view-container {
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 场景卡片悬停 ===== */
.scene-card:hover:not(.locked) {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}

/* ===== 响应式 ===== */
@media (max-width: 820px) {
  .scene-spot-list {
    grid-template-columns: 1fr;
  }
  .shop-grid {
    grid-template-columns: 1fr;
  }
  /* 窄屏：名称与价格上下两行，右侧留给按钮，避免商品名和卖家名被截断 */
  .shop-item-card {
    grid-template-columns: 44px minmax(0, 1fr) auto;
    grid-template-areas:
      "icon info act"
      "icon price act";
    row-gap: 2px;
    column-gap: 10px;
    padding: 12px;
  }
  .shop-item-icon {
    grid-area: icon;
  }
  .shop-item-info {
    grid-area: info;
  }
  .shop-item-price {
    grid-area: price;
    justify-self: start;
    text-align: left;
    font-size: 0.88rem;
  }
  .shop-buy-btn,
  .shop-cancel-btn,
  .shop-own-tag,
  .shop-list-tag {
    grid-area: act;
    justify-self: end;
  }
}

@media (max-width: 520px) {
  .view-nav-btn {
    padding: 8px 10px;
    font-size: 0.85rem;
  }
}

/* ===== 优化后的数值面板 ===== */
.stat-panel .panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.power-score {
  font-size: 0.85rem;
  color: var(--muted);
  background: linear-gradient(135deg, #fff3e0, #ffe0b2);
  padding: 4px 12px;
  border-radius: 20px;
  border: 1px solid #ffcc80;
}

.power-score strong {
  color: #e65100;
  font-size: 1.1rem;
  margin-left: 4px;
}

/* ===== 宠物栏 ===== */
/* 分页条：数量 + 第几页 + 圆点页码 + 上一页/下一页 */
.pet-team-pager {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 4px 0 10px;
  padding: 7px 10px;
  border: 1px dashed #d8c9a8;
  border-radius: 10px;
  background: rgba(255, 252, 244, 0.75);
}

.pet-team-pager-info {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  gap: 14px;
  font-size: 12px;
  color: #8a7657;
}

.pet-team-pager-ctrl {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  gap: 6px;
}

.pet-page-btn {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1px solid #d8c9a8;
  border-radius: 8px;
  background: #fffdf6;
  color: #6b5a3e;
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
}

.pet-page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.pet-page-dots {
  display: flex;
  flex: 0 1 auto;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  flex-wrap: wrap;
}

.pet-page-dot {
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border: 1px solid #d8c9a8;
  border-radius: 7px;
  background: #fffdf6;
  color: #6b5a3e;
  font-size: 12px;
  cursor: pointer;
}

.pet-page-dot.active {
  border-color: #e0a020;
  background: linear-gradient(180deg, #ffd76a, #f5b93b);
  color: #4a3208;
  font-weight: 700;
}

.pet-team-list {
  display: flex;
  gap: 10px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 8px;
}

.pet-team-item {
  flex: 0 0 calc(33.333% - 7px);
  min-width: 200px;
  max-width: calc(33.333% - 7px);
  padding: 12px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: #fafafa;
  cursor: pointer;
  transition: all 0.2s;
}

.pet-team-item.active {
  border-color: var(--primary);
  background: #f0f7ff;
  box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.pet-team-item:hover {
  border-color: var(--primary);
}

.pet-team-empty {
  flex: 1;
  min-width: 180px;
  padding: 24px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
}

.pet-team-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pet-team-header img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
}

.pet-team-name {
  font-weight: 600;
  font-size: 14px;
}

.pet-team-level {
  font-size: 12px;
  color: var(--muted);
}

.pet-team-actions .btn-switch {
  background: #e3f2fd;
  color: #1976d2;
}

.pet-team-actions .btn-switch:hover {
  background: #bbdefb;
}

.pet-team-actions .btn-bond {
  background: #fce4ec;
  color: #c2185b;
}

.pet-team-actions .btn-bond:hover {
  background: #f8bbd0;
}

.pet-team-actions .btn-release {
  background: #ffebee;
  color: #c62828;
}

.pet-team-actions .btn-release:hover {
  background: #ffcdd2;
}

.stat-bars {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.exp-hint {
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 2px;
  text-align: right;
}

.battle-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.battle-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  transition: all 0.2s ease;
}

.battle-stat:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}

.battle-stat-icon {
  font-size: 1.2rem;
}

.battle-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
}

.battle-stat strong {
  font-size: 1.15rem;
  color: var(--ink);
}

.type-info {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: #f5f5f5;
  border-radius: 8px;
  font-size: 0.78rem;
  line-height: 1.5;
}

.type-label {
  font-weight: 700;
  color: var(--ink);
  background: #e8f5e9;
  padding: 2px 8px;
  border-radius: 4px;
}

.type-strong {
  color: #2e7d32;
}

.type-weak {
  color: #c62828;
}

@media (max-width: 520px) {
  .battle-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .battle-stat {
    padding: 8px 4px;
  }
  .power-score {
    font-size: 0.75rem;
    padding: 3px 8px;
  }
}

/* ===== 战斗弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: modalPop 0.3s ease;
}

@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.battle-modal {
  background: #fff;
  border-radius: 16px;
  padding: 20px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  animation: battlePop 0.3s ease;
}

@keyframes battlePop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.battle-header {
  text-align: center;
  margin-bottom: 12px;
}

.battle-header strong {
  font-size: 1.2rem;
  color: var(--ink);
}

/* ===== 战斗演出：双方对峙舞台 ===== */
.battle-stage {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
  padding: 14px 12px 10px;
  margin-bottom: 10px;
  border-radius: 14px;
  background: linear-gradient(160deg, #eef7ff 0%, #f7f2ff 55%, #fff5ec 100%);
  overflow: hidden;
  min-height: 166px;
}

.battle-side {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.battle-side.player {
  align-items: flex-start;
}

.battle-side.enemy {
  align-items: flex-end;
}

.battle-sprite-wrap {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.battle-sprite {
  width: 76px;
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.battle-sprite img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.18));
}

.battle-side.enemy .battle-sprite img {
  transform: scaleX(-1);
}

.battle-sprite-fallback {
  font-size: 2.1rem;
  line-height: 1;
}

.battle-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 5px;
  max-width: 100%;
}

.battle-name {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--ink);
  max-width: 130px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.battle-name.is-boss {
  max-width: 172px;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.12;
  word-break: keep-all;
}

@media (max-width: 640px) {
  .battle-name.is-boss {
    max-width: 118px;
    font-size: 0.64rem;
  }
}

.battle-lv {
  font-size: 0.66rem;
  color: #e65100;
  font-weight: 700;
  flex: 0 0 auto;
}

.battle-hp-track {
  width: 100%;
  max-width: 104px;
  height: 8px;
  border-radius: 999px;
  background: #dfe6ee;
  overflow: hidden;
}

.battle-hp-fill {
  height: 100%;
  width: 100%;
  border-radius: 999px;
  transition: width 0.32s cubic-bezier(0.22, 0.61, 0.36, 1), background-color 0.3s ease;
}

.battle-hp-fill.player {
  background: linear-gradient(90deg, #57c97a, #35a35b);
}

.battle-hp-fill.enemy {
  background: linear-gradient(90deg, #f08a5d, #e0453a);
}

.battle-hp-fill.is-low {
  background: linear-gradient(90deg, #f5c542, #e0453a) !important;
}

.battle-hp-num {
  font-size: 0.64rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.battle-vs {
  align-self: center;
  font-size: 0.76rem;
  font-weight: 800;
  color: #9aa5b1;
  letter-spacing: 0.06em;
  padding: 0 2px;
  user-select: none;
}

.battle-fx {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
  overflow: hidden;
}

.battle-damage {
  position: absolute;
  font-weight: 800;
  font-size: 1.02rem;
  color: #ff4757;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.92), 0 0 10px rgba(255, 71, 87, 0.5);
  font-variant-numeric: tabular-nums;
  animation: damageFloat 0.82s ease-out forwards;
}

@keyframes damageFloat {
  0% { opacity: 0; transform: translate(-50%, 5px) scale(0.72); }
  16% { opacity: 1; transform: translate(-50%, -7px) scale(1.14); }
  100% { opacity: 0; transform: translate(-50%, -36px) scale(0.94); }
}

@keyframes battleEnterPlayer {
  from { opacity: 0; transform: translateX(-46px) scale(0.86); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes battleEnterEnemy {
  from { opacity: 0; transform: translateX(46px) scale(0.86); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.battle-side.is-entering-player { animation: battleEnterPlayer 0.38s cubic-bezier(0.34, 1.26, 0.64, 1); }
.battle-side.is-entering-enemy { animation: battleEnterEnemy 0.38s cubic-bezier(0.34, 1.26, 0.64, 1); }

@keyframes battleLungePlayer {
  0% { transform: translateX(0) translateY(0); }
  44% { transform: translateX(24px) translateY(-5px); }
  100% { transform: translateX(0) translateY(0); }
}

@keyframes battleLungeEnemy {
  0% { transform: translateX(0) translateY(0); }
  44% { transform: translateX(-24px) translateY(-5px); }
  100% { transform: translateX(0) translateY(0); }
}

.battle-sprite.is-lunge-player { animation: battleLungePlayer 0.3s ease-in-out; }
.battle-sprite.is-lunge-enemy { animation: battleLungeEnemy 0.3s ease-in-out; }

@keyframes battleHit {
  0% { transform: translateX(0); filter: none; }
  16% { transform: translateX(-7px); filter: brightness(1.85) saturate(0.55) hue-rotate(-16deg); }
  36% { transform: translateX(7px); }
  58% { transform: translateX(-4px); }
  78% { transform: translateX(3px); }
  100% { transform: translateX(0); filter: none; }
}

.battle-sprite.is-hit { animation: battleHit 0.28s ease-out; }

@keyframes battleStageShake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-3px, 2px); }
  40% { transform: translate(3px, -2px); }
  60% { transform: translate(-2px, 1px); }
  80% { transform: translate(2px, -1px); }
}

.battle-stage.is-shaking { animation: battleStageShake 0.34s ease-out; }

@keyframes battleWinJump {
  0% { transform: translateY(0) scale(1); }
  28% { transform: translateY(-15px) scale(1.05); }
  52% { transform: translateY(0) scale(1); }
  72% { transform: translateY(-7px) scale(1.02); }
  100% { transform: translateY(0) scale(1); }
}

.battle-side.is-win { animation: battleWinJump 0.62s ease-out; }

@keyframes battleLoseDrop {
  from { transform: translateY(0); opacity: 1; filter: none; }
  to { transform: translateY(9px); opacity: 0.55; filter: grayscale(1); }
}

.battle-side.is-lose { animation: battleLoseDrop 0.6s ease-out forwards; }

@keyframes winGlow {
  0% { box-shadow: inset 0 0 0 0 rgba(255, 196, 0, 0); }
  36% { box-shadow: inset 0 0 32px 6px rgba(255, 196, 0, 0.42); }
  100% { box-shadow: inset 0 0 0 0 rgba(255, 196, 0, 0); }
}

.battle-stage.is-win-glow { animation: winGlow 0.72s ease-out; }

@media (prefers-reduced-motion: reduce) {
  .battle-side,
  .battle-sprite,
  .battle-stage,
  .battle-damage {
    animation: none !important;
  }
  .battle-hp-fill {
    transition: none !important;
  }
}

.battle-log {
  max-height: 96px;
  overflow-y: auto;
  margin-bottom: 12px;
  padding: 10px;
  background: #fafafa;
  border-radius: 8px;
  font-size: 0.85rem;
  line-height: 1.8;
}

.battle-log-line {
  margin: 0;
  animation: logSlide 0.3s ease;
}

@keyframes logSlide {
  from { opacity: 0; transform: translateX(-10px); }
  to { opacity: 1; transform: translateX(0); }
}

.battle-result {
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
}

.battle-result.win {
  background: #e8f5e9;
  color: #2e7d32;
}

.battle-result.lose {
  background: #ffebee;
  color: #c62828;
}

.battle-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.battle-continue {
  min-width: 140px;
  padding: 9px 22px;
  border: 0;
  border-radius: 999px;
  background: #ffb300;
  color: #4a2c00;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: 0 3px 0 #c98a00;
}

.battle-continue:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #c98a00;
}

.battle-hint {
  font-size: 12px;
  color: #8a7a5c;
}

/* ===== 捕捉窗口 ===== */
.capture-modal {
  max-width: 420px;
}

.capture-pet-info {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: #f5f5f5;
  border-radius: 12px;
  margin-bottom: 16px;
}

.capture-pet-info img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  border-radius: 50%;
  background: #fff;
}

.capture-pet-detail {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.capture-pet-detail strong {
  font-size: 18px;
}

.capture-pet-detail span {
  font-size: 14px;
  color: #666;
}

.capture-balls {
  margin-bottom: 16px;
}

.capture-balls p {
  margin-bottom: 8px;
  font-size: 14px;
  color: #666;
}

.capture-guarantee-hint {
  margin: -2px 0 10px !important;
  padding: 6px 10px;
  border-radius: 8px;
  background: #fff7d6;
  color: #9a6a00 !important;
  font-size: 13px !important;
  font-weight: 700;
}

.capture-ball-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.capture-ball-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s;
}

.capture-ball-item:hover {
  border-color: var(--primary);
  background: #f0f7ff;
}

.capture-ball-item:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.capture-ball-item .ball-name {
  font-size: 14px;
}

.capture-ball-item .ball-info {
  font-size: 12px;
  color: #999;
}

.capture-result {
  padding: 12px;
  border-radius: 8px;
  text-align: center;
  font-weight: 500;
}

.capture-result.success {
  background: #e8f5e9;
  color: #2e7d32;
}

/* ===== 系别克制弹窗 ===== */
.type-tooltip {
  position: fixed;
  z-index: 999;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.82rem;
  transition: opacity 0.5s ease;
  max-width: 240px;
}

.type-tooltip.fade-out {
  opacity: 0;
}

.type-tooltip strong {
  font-size: 0.95rem;
  color: var(--ink);
  margin-bottom: 2px;
}

.tt-strong {
  color: #2e7d32;
}

.tt-weak {
  color: #c62828;
}

/* 系别标签可点击 */
.type-label {
  cursor: pointer;
  transition: all 0.2s ease;
}

.type-label:hover {
  transform: scale(1.05);
}

.type-strong {
  color: var(--muted);
  font-size: 0.75rem;
  font-style: italic;
}

/* 6个探索地点保持3列，自动换行 */
.scene-spot-list {
  grid-template-columns: repeat(3, 1fr);
}

/* ===== 战斗跳过复选框 ===== */
/* ===== 拉入学生功能 ===== */
.pet-debug-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pet-debug-section .teacher-message {
  min-height: 1.1em;
  font-size: 0.76rem;
  line-height: 1.35;
  color: #4f9f64;
}

.pet-debug-section .teacher-message.warning {
  color: #d1495b;
}

.pet-debug-section .teacher-actions {
  grid-template-columns: 1fr;
}

.pet-debug-section .teacher-actions button {
  white-space: nowrap;
}

.pull-student-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.pulled-list {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--muted);
  background: #f5f5f5;
  padding: 6px 10px;
  border-radius: 6px;
  min-height: 20px;
}

/* ===== 老师登录界面 ===== */
.login-view.hidden {
  display: none;
}

@keyframes loginPop {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.login-title {
  font-size: 1.6rem;
  color: #232323;
  margin: 0 0 4px;
}

.login-subtitle {
  font-size: 0.85rem;
  color: #68625b;
  margin: 0 0 24px;
}

/* ===== 排行榜 ===== */
.rank-modal {
  width: 420px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  background: #fffdfa;
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.rank-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.rank-tab {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rank-tab.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.rank-list {
  overflow-y: auto;
  max-height: 50vh;
}

.rank-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  gap: 10px;
}

.rank-item:last-child {
  border-bottom: none;
}

.rank-item.top1 { background: linear-gradient(90deg, #fff8e1, transparent); }
.rank-item.top2 { background: linear-gradient(90deg, #f5f5f5, transparent); }
.rank-item.top3 { background: linear-gradient(90deg, #fff3e0, transparent); }

.rank-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.rank-item.top1 .rank-num { background: #ffd54f; color: #e65100; }
.rank-item.top2 .rank-num { background: #bdbdbd; color: #424242; }
.rank-item.top3 .rank-num { background: #ffab91; color: #bf360c; }

.rank-info {
  flex: 1;
  min-width: 0;
}

.rank-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--ink);
}

.rank-sub {
  font-size: 0.75rem;
  color: var(--muted);
}

.rank-value {
  font-weight: 700;
  font-size: 1rem;
  color: var(--accent);
  flex-shrink: 0;
}


/* 场景内部道具收集 */
.scene-inventory {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.scene-inventory-item.owned {
  background: #e8f5e9;
  border-color: #4caf50;
}

.scene-inventory-item.owned .scene-inventory-name {
  color: #2e7d32;
  font-weight: 500;
}

.scene-inventory-item.owned .scene-inventory-count {
  color: #4caf50;
  font-weight: 600;
}

/* 宠物栏和孵蛋面板布局优化 */
.pet-team-panel {
  margin-bottom: 16px;
}

.hatch-panel {
  margin-bottom: 16px;
}

.hatch-content {
  display: flex;
  gap: 20px;
  align-items: flex-start;
}

.hatch-copy {
  flex: 1;
  min-width: 0;
}

/* 响应式 */
@media (max-width: 768px) {
  .hatch-content {
    flex-direction: column;
    align-items: center;
  }
  
}

/* 调整面板间距，去掉多余空白 */
.pet-team-panel,
.hatch-panel,
.stat-panel {
  margin-top: 0;
  margin-bottom: 12px;
}

.pet-team-panel:first-child,
.hatch-panel:first-child,
.stat-panel:first-child {
  margin-top: 0;
}


/* ===== 两分钟计时器 ===== */
.timer-panel {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px;
  padding: 20px 24px;
  color: white;
  margin-bottom: 16px;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.timer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.timer-title {
  font-size: 16px;
  font-weight: 600;
  opacity: 0.9;
}

.timer-display {
  font-size: 36px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.timer-display.warning {
  color: #ffeb3b;
  animation: pulse 1s infinite;
}

.timer-controls {
  display: flex;
  gap: 10px;
}

.timer-btn {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.timer-btn.primary {
  background: #4caf50;
  color: white;
}

.timer-btn.primary:hover {
  background: #45a049;
  transform: translateY(-1px);
}

.timer-btn.secondary {
  background: #ff9800;
  color: white;
}

.timer-btn.secondary:hover {
  background: #f57c00;
  transform: translateY(-1px);
}

.timer-btn.danger {
  background: #f44336;
  color: white;
}

.timer-btn.danger:hover {
  background: #d32f2f;
  transform: translateY(-1px);
}

.timer-btn.add {
  background: #9c27b0;
  color: white;
  font-size: 12px;
}

.timer-btn.add:hover {
  background: #7b1fa2;
  transform: translateY(-1px);
}

.timer-btn.add:disabled {
  cursor: not-allowed;
  transform: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== 排行榜视图样式 ===== */
.rank-panel {
  background: white;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.rank-content {
  max-height: 500px;
  overflow-y: auto;
}

.rank-item {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  margin-bottom: 8px;
  background: #f8f9fa;
  transition: all 0.2s ease;
}

.rank-item:hover {
  background: #e9ecef;
  transform: translateX(4px);
}

.rank-item.top1 {
  background: linear-gradient(90deg, #ffd700 0%, #ffed4e 100%);
  border: 2px solid #ffc107;
}

.rank-item.top2 {
  background: linear-gradient(90deg, #c0c0c0 0%, #e8e8e8 100%);
  border: 2px solid #9e9e9e;
}

.rank-item.top3 {
  background: linear-gradient(90deg, #cd7f32 0%, #e8a87c 100%);
  border: 2px solid #b87333;
}

.rank-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 18px;
  border-radius: 50%;
  background: white;
  margin-right: 14px;
  flex-shrink: 0;
}

.top1 .rank-num { background: #ffd700; color: #fff; }
.top2 .rank-num { background: #c0c0c0; color: #fff; }
.top3 .rank-num { background: #cd7f32; color: #fff; }

.rank-info {
  flex: 1;
}

.rank-name {
  font-weight: 600;
  font-size: 15px;
  color: #333;
}

.rank-sub {
  font-size: 13px;
  color: #666;
  margin-top: 2px;
}

.rank-value {
  font-weight: 700;
  font-size: 16px;
  color: #e65100;
}

/* ===== 老师后台排行榜奖励样式 ===== */
.rank-reward-section {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e0e0e0;
}

.field-hint {
  display: block;
  font-size: 12px;
  color: #888;
  margin-top: 4px;
}

.teacher-message.success {
  color: #2e7d32;
  background: #e8f5e9;
  padding: 10px;
  border-radius: 8px;
  margin-top: 10px;
  white-space: pre-line;
}

/* ===== 新手引导系统（手指引导 + 功能卡） ===== */
.guide-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.guide-block {
  position: fixed;
  background: rgba(24, 20, 12, 0.62);
  transition: all 0.18s ease;
  pointer-events: none;
}

.guide-ring {
  position: fixed;
  border-radius: 14px;
  pointer-events: none;
  z-index: 10002;
  animation: guideRingPulse 1.8s ease-in-out infinite;
}

@keyframes guideRingPulse {
  0%, 100% {
    box-shadow: 0 0 0 3px #f0b429, 0 0 0 6px rgba(240, 180, 41, 0.28), 0 0 26px rgba(240, 180, 41, 0.55);
  }
  50% {
    box-shadow: 0 0 0 3px #ffd35c, 0 0 0 9px rgba(255, 211, 92, 0.35), 0 0 34px rgba(255, 211, 92, 0.7);
  }
}

.guide-tip {
  position: fixed;
  z-index: 10003;
  pointer-events: auto;
  width: 296px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(150deg, #fffdf6, #fff3d6);
  border: 1px solid #ecd9a8;
  border-radius: 16px;
  padding: 16px 18px 14px;
  box-shadow: 0 18px 44px rgba(60, 40, 10, 0.28);
}

.guide-tip-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.guide-step {
  background: #f0b429;
  color: #4a3208;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.guide-skip {
  background: none;
  border: none;
  color: #a08a63;
  font-size: 13px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
}

.guide-skip:hover {
  color: #6b4a12;
  background: rgba(107, 74, 18, 0.08);
}

.guide-tip-title {
  margin: 0 0 6px;
  font-size: 18px;
  color: #3f2c0d;
  font-weight: 800;
}

.guide-tip-desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.75;
  color: #6b5a3a;
}

.guide-tip-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.guide-btn {
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  padding: 9px 20px;
  transition: all 0.18s;
}

.guide-btn.primary {
  background: linear-gradient(135deg, #f7c948, #e0a020);
  color: #4a3208;
}

.guide-btn.primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(224, 160, 32, 0.35);
}

.guide-btn.secondary {
  background: #efe6d3;
  color: #8a7350;
}

.guide-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

.guide-cards-wrap {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 10003;
  pointer-events: auto;
  width: 420px;
  max-width: calc(100vw - 32px);
  background: linear-gradient(160deg, #fffdf6, #fff4dc);
  border: 1px solid #ecd9a8;
  border-radius: 20px;
  padding: 18px;
  box-shadow: 0 24px 60px rgba(60, 40, 10, 0.32);
}

.guide-cards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #8a7350;
  margin-bottom: 10px;
}

.guide-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.guide-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: #fffaf0;
  border: 1px solid #f0e2c2;
  border-radius: 14px;
  padding: 12px 14px;
}

.guide-card-icon {
  font-size: 22px;
  line-height: 1;
}

.guide-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #3f2c0d;
  margin-bottom: 2px;
}

.guide-card-sub {
  font-size: 12.5px;
  color: #8a7350;
  line-height: 1.6;
}

.guide-cards-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  font-size: 12px;
  color: #8a7350;
}

.guide-cards-btns {
  display: flex;
  gap: 8px;
}

.guide-help-btn {
  position: fixed;
  right: 16px;
  bottom: 96px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid #ecd9a8;
  background: #fff6e2;
  color: #a07b28;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  z-index: 9000;
  box-shadow: 0 4px 12px rgba(60, 40, 10, 0.16);
}

.guide-help-btn:hover {
  background: #ffeec6;
}

@media (max-width: 520px) {
  .guide-cards-wrap {
    width: calc(100vw - 24px);
  }
}


/* ===== 咕噜球商店美化 ===== */
.ball-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.ball-shop-card {
  position: relative;
  background: linear-gradient(145deg, #ffffff, #f5f5f5);
  border: 2px solid #e0e0e0;
  border-radius: 16px;
  padding: 20px 16px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
}

.ball-shop-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--ball-color, #9e9e9e);
  opacity: 0.8;
}

.ball-shop-card:hover {
  transform: translateY(-6px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--ball-color, #9e9e9e);
}

.ball-shop-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  background: linear-gradient(145deg, var(--ball-color, #9e9e9e), color-mix(in srgb, var(--ball-color, #9e9e9e) 70%, #000));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2), inset 0 2px 4px rgba(255, 255, 255, 0.3);
  animation: ballFloat 3s ease-in-out infinite;
  position: relative;
}

.ball-shop-icon::after {
  content: '';
  position: absolute;
  top: 8px;
  left: 12px;
  width: 16px;
  height: 10px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 50%;
  transform: rotate(-30deg);
}

@keyframes ballFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-6px) rotate(5deg); }
}

.ball-shop-name {
  font-weight: 700;
  font-size: 15px;
  color: #333;
  margin-bottom: 6px;
}

.ball-shop-desc {
  font-size: 12px;
  color: #888;
  margin-bottom: 10px;
  min-height: 32px;
}

.ball-shop-owned {
  font-size: 13px;
  color: #666;
  margin-bottom: 12px;
  padding: 4px 10px;
  background: #f0f0f0;
  border-radius: 12px;
  display: inline-block;
}

.ball-shop-buy {
  width: 100%;
  padding: 10px 16px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ball-color, #9e9e9e), color-mix(in srgb, var(--ball-color, #9e9e9e) 80%, #000));
  color: white;
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ball-shop-buy:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}

.ball-shop-buy:active:not(:disabled) {
  transform: scale(0.98);
}

.ball-shop-buy:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
}

.shop-header {
  background: linear-gradient(135deg, #fff8e6 0%, #ffecc6 100%);
  color: #6b4a12;
  padding: 20px;
  border-radius: 12px;
  border: 1px solid #efdcae;
  margin-bottom: 16px;
}

.shop-header h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.shop-header p {
  margin: 4px 0;
  font-size: 14px;
  opacity: 0.9;
}

.shop-header strong {
  background: rgba(107, 74, 18, 0.12);
  color: #6b4a12;
  padding: 2px 8px;
  border-radius: 6px;
}

/* ===== 捕捉窗口咕噜球美化 ===== */
.capture-ball-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.capture-ball-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: linear-gradient(145deg, #ffffff, #f8f8f8);
  border: 2px solid #e8e8e8;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.capture-ball-item::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ball-color, #9e9e9e);
}

.capture-ball-item:hover:not(.disabled) {
  transform: translateX(4px);
  border-color: var(--ball-color, #9e9e9e);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.capture-ball-item.disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.5);
}

.capture-ball-icon {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  background: linear-gradient(145deg, var(--ball-color, #9e9e9e), color-mix(in srgb, var(--ball-color, #9e9e9e) 70%, #000));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  animation: ballWiggle 2s ease-in-out infinite;
}

@keyframes ballWiggle {
  0%, 100% { transform: rotate(-5deg); }
  50% { transform: rotate(5deg); }
}

.capture-ball-info {
  flex: 1;
}

.capture-ball-info strong {
  display: block;
  font-size: 14px;
  color: #333;
  margin-bottom: 2px;
}

.capture-ball-info span {
  font-size: 11px;
  color: #999;
}

/* ===== 全局动画增强 ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 5px rgba(102, 126, 234, 0.3); }
  50% { box-shadow: 0 0 20px rgba(102, 126, 234, 0.6); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

@keyframes successPop {
  0% { transform: scale(0.8); opacity: 0; }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); opacity: 1; }
}

/* 视图切换动画 */
.view-container {
  animation: fadeInUp 0.4s ease;
}

/* 场景卡片悬停增强 */
.scene-card:not(.locked):hover {
  transform: translateY(-4px) scale(1.02);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}

.scene-card:not(.locked):hover .scene-art {
  transform: scale(1.05);
}

.scene-art {
  transition: transform 0.3s ease;
}

/* 探索点卡片动画 */
/* 宠物栏卡片动画 */
.pet-team-item {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.pet-team-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.pet-team-item.active {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* 按钮通用动画 */
button {
  transition: all 0.2s ease;
}

button:hover:not(:disabled) {
  transform: translateY(-1px);
}

button:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
}

/* 导航按钮动画 */
.view-nav-btn {
  position: relative;
  overflow: hidden;
}

.view-nav-btn::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 3px;
  background: var(--primary);
  transition: all 0.3s ease;
  transform: translateX(-50%);
}

.view-nav-btn.active::after,
.view-nav-btn:hover::after {
  width: 80%;
}

/* 道具图标动画 */
.inventory-item.owned .inventory-item-icon {
  animation: successPop 0.4s ease;
}

.inventory-item:hover {
  transform: scale(1.05);
  transition: transform 0.2s ease;
}

/* 排行榜项目动画 */
.rank-item {
  transition: all 0.25s ease;
}

.rank-item:hover {
  transform: translateX(6px);
  background: #f8f9ff;
}

.rank-item.top1 {
  animation: pulseGlow 2s ease-in-out infinite;
}

/* 计时器动画 */
.timer-panel {
  transition: all 0.3s ease;
}

.timer-display {
  font-variant-numeric: tabular-nums;
  transition: color 0.3s ease;
}

.timer-display.warning {
  color: #ff5722;
  animation: shake 0.5s ease infinite;
}

/* 滚动条美化 */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea, #764ba2);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd6, #6a4190);
}

/* ===== 智能提示 Toast ===== */
.toast-container {
  position: fixed;
  top: 14px;
  right: 14px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-width: 320px;
}

.toast {
  pointer-events: auto;
  padding: 9px 12px 10px;
  border-radius: 10px;
  background: white;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: flex-start;
  gap: 8px;
  animation: toastSlideIn 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  border-left: 3px solid #667eea;
  position: relative;
  overflow: hidden;
}

.toast.toast-info {
  border-left-color: #2196f3;
}

.toast.toast-success {
  border-left-color: #4caf50;
}

.toast.toast-warning {
  border-left-color: #ff9800;
}

.toast.toast-error {
  border-left-color: #f44336;
}

.toast-icon {
  font-size: 17px;
  flex-shrink: 0;
  margin-top: -2px;
}

.toast-content {
  flex: 1;
}

.toast-title {
  font-weight: 700;
  font-size: 13px;
  color: #333;
  margin-bottom: 2px;
}

.toast-message {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  font-size: 14px;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  transition: color 0.2s;
}

.toast-close:hover {
  color: #333;
}

.toast.toast-out {
  animation: toastSlideOut 0.3s ease forwards;
}

@keyframes toastSlideIn {
  from {
    opacity: 0;
    transform: translateX(100px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastSlideOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(100px);
  }
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  animation: toastProgress 2s linear;
}

@keyframes toastProgress {
  from { width: 100%; }
  to { width: 0%; }
}

/* 临时购买咕噜球按钮 */
.temp-buy-ball {
  margin-top: 12px;
  padding: 10px 16px;
  background: linear-gradient(135deg, #ff9800, #f57c00);
  color: white;
  border: none;
  border-radius: 10px;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
  box-shadow: 0 2px 8px rgba(255, 152, 0, 0.3);
}

.temp-buy-ball:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(255, 152, 0, 0.4);
}

.temp-buy-ball:disabled {
  background: #ccc;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.temp-buy-hint {
  font-size: 12px;
  color: #ff9800;
  text-align: center;
  margin-top: 8px;
  padding: 8px;
  background: #fff3e0;
  border-radius: 8px;
}


/* 宠物栏优化 */
.btn-bond {
  background: linear-gradient(135deg, #ff9a9e, #fecfef) !important;
  color: #c2185b;
  border-color: #f8bbd0 !important;
  font-weight: 600;
}

.btn-bond:hover:not(:disabled) {
  background: linear-gradient(135deg, #ff8a8e, #febfdf) !important;
}

.btn-rename {
  background: linear-gradient(135deg, #a1c4fd, #c2e9fb) !important;
  color: #1565c0;
  border-color: #90caf9 !important;
}

.btn-rename:hover:not(:disabled) {
  background: linear-gradient(135deg, #91b4fd, #b2d9fb) !important;
}

.pet-team-active-tag {
  flex: 1;
  text-align: center;
  padding: 4px 8px;
  font-size: 12px;
  background: linear-gradient(135deg, #4caf50, #81c784);
  color: white;
  border-radius: 6px;
  font-weight: 600;
}



/* ===== 异色稀有宠物样式 ===== */
.shiny-pet {
  position: relative;
  border: 2px solid #ffd700;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.6);
  animation: shiny-glow 2s ease-in-out infinite;
}

@keyframes shiny-glow {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 215, 0, 0.4); }
  50% { box-shadow: 0 0 16px rgba(255, 215, 0, 0.8); }
}

.shiny-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: linear-gradient(135deg, #ffd700, #ff8c00);
  color: #fff;
  font-size: 11px;
  font-weight: bold;
  padding: 2px 8px;
  border-radius: 10px;
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.shiny-label {
  display: inline-block;
  background: linear-gradient(135deg, #ffd700, #ff6b6b);
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  animation: shiny-pulse 1.5s ease-in-out infinite;
}

@keyframes shiny-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

/* ===== 五行神兽样式（比异色更"重"：双层描边 + 元素色） ===== */
.wuxing-pet {
  position: relative;
  border: 3px solid var(--wx-color, #ffd75e);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 215, 90, 0.12) 0%, rgba(255, 215, 90, 0) 62%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45), 0 0 14px rgba(255, 215, 90, 0.55);
  animation: wuxing-glow 3s ease-in-out infinite;
}

@keyframes wuxing-glow {
  0%, 100% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4), 0 0 10px rgba(255, 215, 90, 0.4); }
  50% { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6), 0 0 22px rgba(255, 215, 90, 0.85); }
}

.wuxing-badge {
  position: absolute;
  top: -9px;
  right: -8px;
  background: linear-gradient(135deg, #ffd75e, var(--wx-color, #ff9a5c));
  color: #2b2110;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 9px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  z-index: 10;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

.wuxing-label {
  display: inline-block;
  background: linear-gradient(135deg, #ffd75e, var(--wx-color, #ff9a5c));
  color: #3a2a10;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  box-shadow: 0 0 10px rgba(255, 215, 90, 0.45);
}

/* 宠物状态：等级用大字、亲密度用小字分两行，窄卡片里也能完整显示 */
.pet-status-tile {
  min-width: 0;
  overflow: hidden;
}

#petStatus {
  line-height: 1.2;
}

#petStatus .pet-status-lv {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

#petStatus .pet-status-bond {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--muted);
}

.pet-status-row .tile-note {
  min-width: 0;
  overflow-wrap: anywhere;
}

/* ============================================
   宠物进化演出
   ============================================ */
.evolve-overlay {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(18, 22, 40, 0.82);
  backdrop-filter: blur(3px);
  animation: evolveFadeIn 0.25s ease;
}

@keyframes evolveFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.evolve-card {
  position: relative;
  width: 82%;
  max-width: 320px;
  padding: 26px 20px 20px;
  border-radius: 20px;
  background: linear-gradient(170deg, #1d2440 0%, #2b1f3d 55%, #12172b 100%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 24px 60px rgba(0, 0, 0, 0.55);
  text-align: center;
  overflow: hidden;
  animation: evolveCardPop 0.32s cubic-bezier(0.34, 1.4, 0.64, 1);
}

@keyframes evolveCardPop {
  from { opacity: 0; transform: scale(0.82); }
  to { opacity: 1; transform: scale(1); }
}

/* 全屏闪白 */
.evolve-flash {
  position: absolute;
  inset: 0;
  background: #ffffff;
  opacity: 0;
  pointer-events: none;
}

.evolve-card.is-flashing .evolve-flash {
  animation: evolveWhiteFlash 0.42s ease-out;
}

@keyframes evolveWhiteFlash {
  0% { opacity: 0; }
  35% { opacity: 1; }
  100% { opacity: 0; }
}

/* 金色爆发光环 */
.evolve-burst {
  position: absolute;
  left: 50%;
  top: 92px;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 128, 0.95) 0%, rgba(255, 196, 0, 0.4) 45%, transparent 70%);
  opacity: 0;
  pointer-events: none;
}

.evolve-card.is-revealed .evolve-burst {
  animation: evolveBurst 0.75s ease-out;
}

@keyframes evolveBurst {
  0% { opacity: 0; transform: scale(0.3); }
  30% { opacity: 1; transform: scale(3.2); }
  100% { opacity: 0; transform: scale(7); }
}

/* 精灵容器 */
.evolve-sprite-wrap {
  position: relative;
  width: 118px;
  height: 118px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.evolve-sprite {
  position: relative;
  z-index: 2;
  width: 108px;
  height: 108px;
  object-fit: contain;
  filter: drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45));
  animation: evolveCharging 0.95s ease-in-out;
}

@keyframes evolveCharging {
  0% { filter: brightness(0.55) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.45)); transform: scale(0.94); }
  55% { filter: brightness(2.6) drop-shadow(0 0 24px rgba(255, 255, 255, 0.9)); transform: scale(1.02); }
  75% { filter: brightness(0.9); transform: scale(0.97) translateX(-3px); }
  88% { transform: scale(0.97) translateX(3px); }
  100% { filter: brightness(1); transform: scale(1); }
}

.evolve-fallback {
  font-size: 3rem;
  line-height: 1;
}

.evolve-halo {
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  opacity: 0;
  background: radial-gradient(circle, rgba(255, 240, 170, 0.55) 0%, rgba(255, 205, 60, 0.22) 45%, transparent 72%);
}

.evolve-card.is-revealed .evolve-halo {
  animation: evolveHalo 1.2s ease-out 2;
}

@keyframes evolveHalo {
  0% { opacity: 0; transform: scale(0.6); }
  35% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0; transform: scale(1.5); }
}

/* 揭示后的弹跳 */
.evolve-card.is-revealed .evolve-sprite {
  animation: evolveReveal 0.72s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes evolveReveal {
  0% { transform: scale(0.66); opacity: 0.4; }
  55% { transform: scale(1.12); opacity: 1; }
  78% { transform: scale(0.97); }
  100% { transform: scale(1); }
}

.evolve-caption {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  color: rgba(255, 255, 255, 0.62);
}

.evolve-card.is-revealed .evolve-caption {
  display: none;
}

.evolve-title {
  margin: 0 0 6px;
  font-size: 1.05rem;
  font-weight: 800;
  color: #ffe27a;
  text-shadow: 0 0 18px rgba(255, 204, 60, 0.6);
  animation: evolveTitlePop 0.45s cubic-bezier(0.34, 1.5, 0.64, 1);
}

@keyframes evolveTitlePop {
  from { opacity: 0; transform: translateY(8px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.evolve-name {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 700;
  color: #ffffff;
  min-height: 1.2em;
}

.evolve-close {
  margin-top: 14px;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffd66b, #ffae3d);
  color: #4a2b00;
  font-size: 0.84rem;
  font-weight: 800;
  cursor: pointer;
  animation: evolveTitlePop 0.35s ease;
}

.evolve-close:hover {
  filter: brightness(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .evolve-overlay,
  .evolve-card,
  .evolve-sprite,
  .evolve-title,
  .evolve-close {
    animation: none !important;
  }
  .evolve-card.is-flashing .evolve-flash,
  .evolve-card.is-revealed .evolve-burst,
  .evolve-card.is-revealed .evolve-halo {
    animation: none !important;
  }
}

/* ============================================
   宠物卡片：升级 / 切换出战 强调
   ============================================ */
.pet-team-item.is-levelup {
  animation: petLevelUp 0.72s ease-out;
}

@keyframes petLevelUp {
  0% { box-shadow: 0 0 0 0 rgba(255, 200, 60, 0); border-color: var(--primary); }
  32% { box-shadow: 0 0 0 4px rgba(255, 200, 60, 0.5), 0 0 22px rgba(255, 200, 60, 0.7); transform: translateY(-4px); }
  100% { box-shadow: 0 0 0 0 rgba(255, 200, 60, 0); transform: translateY(0); }
}

.pet-team-item.is-switching {
  animation: petSwitchIn 0.42s cubic-bezier(0.34, 1.3, 0.64, 1);
}

@keyframes petSwitchIn {
  0% { transform: translateX(14px) scale(0.96); box-shadow: 0 0 0 0 rgba(255, 196, 0, 0); }
  45% { transform: translateX(0) scale(1.02); box-shadow: 0 0 0 3px rgba(255, 196, 0, 0.55); }
  100% { transform: translateX(0) scale(1); box-shadow: 0 0 0 0 rgba(255, 196, 0, 0); }
}

/* ===== 学生端：宠物栏改竖排紧凑卡片，3 只宠物也不横向溢出 ===== */
.app-grid.is-student .pet-team-list {
  flex-direction: column;
  flex-wrap: nowrap;
  overflow-x: visible;
  overflow-y: visible;
  padding-bottom: 0;
  gap: 8px;
}

.app-grid.is-student .pet-team-item {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  max-width: none;
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  grid-template-areas:
    "pic name"
    "pic bond"
    "acts acts";
  align-items: center;
  column-gap: 10px;
  row-gap: 2px;
}

.app-grid.is-student .pet-team-header {
  display: contents;
}

.app-grid.is-student .pet-team-img {
  grid-area: pic;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: contain;
  background: #fff;
}

.app-grid.is-student .pet-team-meta {
  grid-area: name;
  min-width: 0;
}

.app-grid.is-student .pet-team-meta .pet-team-name {
  font-size: 13px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-grid.is-student .pet-team-meta .pet-team-level {
  font-size: 11px;
  color: var(--muted);
}

.app-grid.is-student .pet-team-bond {
  grid-area: bond;
  margin: 0;
  font-size: 11px;
  color: #e91e63;
}

.app-grid.is-student .pet-team-actions {
  grid-area: acts;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
  flex-wrap: wrap;
  gap: 4px;
}

.app-grid.is-student .pet-team-actions button {
  flex: 1 1 0;
  min-width: 0;
  padding: 5px 4px;
  font-size: 11px;
  white-space: nowrap;
}

.app-grid.is-student .pet-team-empty {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
/* ===== 学生端：窄窗口降级为单列，避免主区被压扁溢出 ===== */
@media (max-width: 900px) {
  .app-grid.is-student .game-stage {
    grid-template-columns: minmax(0, 1fr);
  }

  .app-grid.is-student .status-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .app-grid.is-student .status-grid > :nth-child(3) {
    grid-column: 1 / -1;
  }
}
/* ===== 箱庭大世界 · 大陆地图（新增） ===== */
#sceneGrid.map-mode {
  display: block;
}

.continent {
  position: relative;
  width: 100%;
  max-width: 1180px;
  aspect-ratio: 16 / 9;
  margin: 0 auto;
  border-radius: 14px;
  overflow: hidden;
  background: #9fd8f0;
  box-shadow: 0 10px 26px rgba(20, 40, 30, 0.18);
}

.continent-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.map-pin {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  font-family: inherit;
}

.map-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3), 0 0 0 4px rgba(255, 255, 255, 0.24);
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: transform 0.16s ease;
}

.map-name {
  font-size: 12px;
  font-weight: 700;
  color: #12311d;
  background: rgba(255, 255, 255, 0.86);
  padding: 2px 8px;
  border-radius: 9px;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.92);
}

.map-meta {
  font-size: 10px;
  color: #1f4a2e;
  background: rgba(255, 255, 255, 0.7);
  padding: 1px 6px;
  border-radius: 7px;
  white-space: nowrap;
}

.map-pin:hover:not(:disabled) .map-dot {
  transform: scale(1.16) translateY(-2px);
}

.map-pin.selected .map-dot {
  border-color: #ffd54f;
  box-shadow: 0 0 0 5px rgba(255, 213, 79, 0.45);
}

.map-pin.locked {
  filter: grayscale(1);
  opacity: 0.62;
  cursor: not-allowed;
}

.map-pin.locked .map-name {
  color: #525252;
}

/* ===== 场景内 · 真实底图舞台 ===== */
.scene-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: 12px;
  overflow: hidden;
  background: #16261a;
}

.scene-stage-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.scene-stage-desc {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  margin: 0;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.84rem;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.55));
  z-index: 2;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}

.stage-spot {
  position: absolute;
  transform: translate(-50%, -50%);
  display: grid;
  justify-items: center;
  gap: 3px;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 0;
  z-index: 3;
  font-family: inherit;
}

.stage-dot {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 2.5px solid #ffffff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), 0 0 0 5px rgba(255, 255, 255, 0.2);
  display: grid;
  place-items: center;
  font-size: 15px;
  transition: transform 0.16s ease;
}

.stage-tag {
  font-size: 11.5px;
  color: #f2ffe8;
  background: rgba(18, 32, 18, 0.72);
  padding: 2px 8px;
  border-radius: 8px;
  white-space: nowrap;
}

.stage-spot:hover:not(:disabled) .stage-dot {
  transform: scale(1.15);
}

.stage-spot.selected .stage-dot {
  border-color: #ffd54f;
  box-shadow: 0 0 0 5px rgba(255, 213, 79, 0.45);
}

.stage-spot:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.stage-player {
  position: absolute;
  left: 50%;
  top: 72%;
  height: 20%;
  transform: translate(-50%, -100%);
  z-index: 5;
  pointer-events: none;
}

.stage-player img {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.3));
}

.stage-pet {
  position: absolute;
  left: 44%;
  top: 73%;
  height: 9%;
  transform: translate(-50%, -100%);
  z-index: 4;
  pointer-events: none;
}

.stage-pet img {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.28));
}

@media (max-width: 780px) {
  .map-dot { width: 28px; height: 28px; font-size: 13px; }
  .map-name { font-size: 10.5px; padding: 1px 6px; }
  .map-meta { display: none; }
  .stage-dot { width: 28px; height: 28px; font-size: 13px; }
  .stage-tag { font-size: 10px; padding: 1px 6px; }
}
.stage-spot-layer {
  position: absolute;
  inset: 0;
  display: block;
  margin: 0;
  padding: 0;
  z-index: 3;
  pointer-events: none;
}

.stage-spot-layer .stage-spot {
  pointer-events: auto;
}
/* ===== 布局精简：学生端 ===== */
.app-grid.is-student .status-grid {
  grid-template-columns: minmax(160px, 1fr) 120px minmax(190px, 260px);
  gap: 10px;
}

.app-grid.is-student .status-tile {
  padding: 12px 16px;
}

.app-grid.is-student .game-main {
  gap: 12px;
}

.app-grid.is-student .game-sidebar {
  gap: 12px;
}

/* ===== 布局精简：老师端分区 ===== */
.pet-debug-section,
.pull-student-section,
.rank-reward-section,
.guide-reset-section,
.student-account-section,
.export-save-section {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed rgba(60, 100, 70, 0.22);
}

.student-account-section .field input {
  margin-top: 6px;
}

.teacher-roster-chip {
  position: relative;
}

.teacher-roster-online {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #b9b3a7;
}

.teacher-roster-online.is-online {
  background: #2fb45f;
  box-shadow: 0 0 0 2px rgba(47, 180, 95, 0.16);
}
/* ===== 稳定性修复：视图切换不再依赖 opacity 动画 =====
   后台标签页会冻结 CSS animation，若停在 from{opacity:0} 会导致整块内容不可见 */
.view-container {
  animation: none;
}
/* 登录卡片同理：后台标签冻结 opacity 动画会让整个登录框不可见 */
/* 地图光点 / 探索点本身是 button，会被全局 button:hover 的位移覆盖，
   丢失 translate(-50%,-50%) 的居中偏移，导致悬停时整块向右下跳。
   这里把居中位移固定住，只保留圆点的放大反馈。 */
.scene-grid.map-mode .map-pin,
.scene-grid.map-mode .map-pin:hover,
.scene-grid.map-mode .map-pin:active,
.stage-spot-layer .stage-spot,
.stage-spot-layer .stage-spot:hover,
.stage-spot-layer .stage-spot:active {
  transform: translate(-50%, -50%) !important;
}
/* ===== 洛克王国式全屏大世界（学生端） ===== */
.app-grid.is-student {
  display: block;
  padding: 0;
  max-width: none;
  margin: 0;
}

.app-grid.is-student .game-area {
  position: fixed;
  inset: 0;
  z-index: 15;
  margin: 0;
  padding: 0;
  border-radius: 0;
  background: #10301f;
  display: block;
  overflow: hidden;
}

.app-grid.is-student .game-view {
  height: 100%;
  display: block;
  margin: 0;
  padding: 0;
}

/* 顶部信息条：角色名 / 行动点 */
.app-grid.is-student .status-grid {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 30;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  width: auto;
}

.app-grid.is-student .status-tile {
  padding: 5px 12px;
  margin: 0;
  border: none;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.16);
  min-width: 0;
  width: auto;
}

.app-grid.is-student .status-tile .tile-label {
  font-size: 10px;
  margin: 0 0 1px;
  color: #5b7a68;
}

.app-grid.is-student .hero-tile h2 {
  font-size: 17px;
  margin: 0;
  line-height: 1.15;
}

.app-grid.is-student .status-tile > strong {
  font-size: 19px;
  line-height: 1.15;
}

.app-grid.is-student .pet-status-tile {
  display: none;
}

.app-grid.is-student .game-stage {
  display: block;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.app-grid.is-student .game-sidebar {
  display: none;
}

.app-grid.is-student .game-main {
  display: block;
  height: 100%;
  margin: 0;
  padding: 0;
  gap: 0;
}

.app-grid.is-student .view-nav {
  display: none;
}

.app-grid.is-student .view-container {
  height: 100%;
  margin: 0;
  padding: 0;
}

.app-grid.is-student .world-panel {
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.app-grid.is-student .world-panel .panel-heading {
  display: none;
}

.app-grid.is-student .scene-inner-panel {
  background: #f7fbf5;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 96px 12px 8px;
  margin: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  position: relative;
  overflow-y: auto;
}

.app-grid.is-student .scene-inner-panel .panel-heading {
  position: absolute;
  top: 58px;
  left: 12px;
  right: 12px;
  z-index: 30;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

.app-grid.is-student .scene-inner-panel .panel-heading h2 {
  color: #ffffff;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.65);
  font-size: 20px;
  margin: 0;
}

.app-grid.is-student .scene-grid.map-mode {
  height: 100%;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  gap: 0;
}

/* 地图保持 16:9，坐标点不会错位 */
.app-grid.is-student .continent {
  width: min(100%, calc((100vh - 24px) * 16 / 9));
  max-height: calc(100vh - 24px);
  aspect-ratio: 16 / 9;
  border-radius: 0;
  box-shadow: none;
}

.app-grid.is-student .scene-stage {
  width: min(96vw, calc((100vh - 240px) * 16 / 9));
  min-width: 300px;
  flex: 0 0 auto;
  border-radius: 0;
  margin: 0 auto;
}

/* 场景舞台的父级氛围层原本是 0 宽，这里补上占位 */
.app-grid.is-student .scene-result,
.app-grid.is-student .scene-inventory {
  width: min(100%, 920px);
  margin: 0 auto;
}

/* 地图上的训练师 */
.map-player {
  position: absolute;
  width: 46px;
  height: 78px;
  transform: translate(-50%, -100%);
  z-index: 7;
  pointer-events: none;
  transition: left 0.42s linear, top 0.42s linear;
  filter: drop-shadow(0 6px 9px rgba(0, 0, 0, 0.38));
}

.map-player img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 右下角功能坞 */
.dock-bar {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  display: flex;
  gap: 10px;
}

.dock-icon {
  font-size: 19px;
  line-height: 1;
}

.dock-label {
  font-size: 10.5px;
  font-weight: 700;
  color: #24402e;
  line-height: 1.15;
}

.dock-btn:hover {
  background: #ffffff;
  box-shadow: 0 7px 20px rgba(0, 0, 0, 0.3);
  transform: none !important;
}

/* 弹窗：宠物 / 商店 / 计时 */
.zone-modal {
  z-index: 1200;
}

.zone-modal-box {
  width: min(760px, 92vw);
  max-height: 84vh;
  display: flex;
  flex-direction: column;
  padding: 0 0 10px;
}

.zone-modal-box.wide {
  width: min(940px, 94vw);
}

.zone-modal-box.narrow {
  width: min(440px, 92vw);
}

.zone-modal-body {
  overflow-y: auto;
  padding: 6px 14px 4px;
}

.zone-modal-body .panel {
  border: none;
  box-shadow: none;
  background: transparent;
  padding: 0 0 10px;
  margin: 0 0 6px;
  border-bottom: 1px dashed rgba(60, 100, 70, 0.18);
}

.zone-modal-body .panel:last-child {
  border-bottom: none;
}

.zone-modal-body .timer-panel {
  border: none;
  box-shadow: none;
  background: transparent;
}

/* 弹窗进场也不要依赖 opacity 动画（后台标签会冻结） */
.modal-overlay,
.zone-modal {
  animation: none;
}
/* 弹窗外框：覆盖通用 .modal 的 400px 限宽与弹出动画 */
.zone-modal-box {
  animation: none;
  max-width: none;
  padding: 0 0 10px;
}

.zone-modal-box .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 6px;
}

.zone-modal-box .modal-header h3 {
  margin: 0;
  font-size: 18px;
  color: #24402e;
}

.modal-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: #eef2ee;
  color: #3a5a45;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  padding: 0;
}

.modal-close:hover {
  background: #e2e9e2;
  transform: none !important;
}
/* 所有弹窗内框都不要 opacity 入场动画（后台标签会冻结在 opacity:0） */
.modal {
  animation: none;
}

.zone-modal-box,
.rank-modal,
.capture-modal {
  animation: none;
}
/* 所有弹窗统一头部布局：标题左、关闭右 */
.modal .modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
}

.modal .modal-header h3 {
  margin: 0;
  font-size: 18px;
}

.modal .modal-close {
  margin: 0;
}

.rank-modal {
  max-width: 520px;
}
/* 排行榜标签激活态（--accent 变量未定义，这里显式给色） */
.rank-tab.active {
  background: linear-gradient(135deg, #ff9800, #ffb74d);
  color: #ffffff;
  border-color: #ff9800;
}

/* 计时器在白色弹窗里的可读性 */
.timer-display {
  color: #24402e;
  font-weight: 800;
}

.timer-title {
  color: #4c6b56;
}
/* ===== P0-1 底部工具栏（对标洛克王国一条横栏） ===== */
.dock-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 48px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(180deg, rgba(26, 58, 40, 0.88), rgba(14, 36, 24, 0.96));
  border-top: 2px solid rgba(255, 226, 160, 0.3);
  backdrop-filter: blur(10px);
  box-shadow: 0 -6px 22px rgba(0, 0, 0, 0.35);
  z-index: 40;
}

.dock-icon {
  font-size: 16px;
  line-height: 1;
}

.dock-label {
  font-size: 13px;
  font-weight: 600;
  color: #f0f8f1;
  line-height: 1;
}

.dock-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  box-shadow: none;
  transform: none !important;
}

/* 底栏占了 48px，地图相应让出高度 */
.app-grid.is-student .continent {
  width: min(100%, calc((100vh - 76px) * 16 / 9));
  max-height: calc(100vh - 76px);
}
/* 去掉老规则留下的 1180px 限宽，让地图真正铺满 */
.app-grid.is-student .continent {
  max-width: none;
}

/* 底栏 4 个入口沿整条均分，像洛克王国那样铺开 */
.dock-bar {
  justify-content: space-evenly;
  gap: 0;
}

/* 地图在可用区域内垂直居中，别贴着顶、下方留一大片 */
.app-grid.is-student .scene-grid.map-mode {
  padding: 46px 0 54px;
  box-sizing: border-box;
}

/* 底栏按钮收紧并居中，别拉成四条长条 */
.dock-bar {
  justify-content: center;
  gap: 10px;
}

/* ===== P0-2 出战宠物跟随 ===== */
.map-pet {
  position: absolute;
  width: 42px;
  height: 42px;
  transform: translate(-50%, -100%);
  z-index: 6;
  pointer-events: none;
  transition: left 0.42s linear, top 0.42s linear;
  filter: drop-shadow(0 4px 7px rgba(0, 0, 0, 0.36));
}

.map-pet img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
/* ===== P0-3 宠物弹窗三栏布局 ===== */
.zone-modal-box.pet {
  width: min(96vw, 1080px);
  max-width: none;
}

.pet-three-col {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr) 290px;
  gap: 14px;
  align-items: start;
  width: 100%;
  box-sizing: border-box;
}

.pet-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

/* 三栏内的面板去掉自身外边距，靠 grid 间距控制 */
.pet-col > .panel {
  margin: 0;
}

/* 左栏宠物列表撑满，内部可滚动 */
.pet-col-list .pet-team-list {
  max-height: calc(100vh - 260px);
  overflow-y: auto;
}

/* 中栏大图与资料 */
.pet-col-detail .hatch-content {
  padding: 4px 0;
}

/* 右栏能力条 */
.pet-col-ability .stat-bars,
.pet-col-ability .battle-stats {
  margin-top: 6px;
}

@media (max-width: 900px) {
  .pet-three-col {
    grid-template-columns: 170px minmax(0, 1fr) 230px;
    gap: 10px;
  }
}
/* 三栏各自滚动，弹窗整体不溢出 */
.zone-modal-box.pet .zone-modal-body {
  overflow: visible;
  max-height: none;
}

.pet-three-col {
  max-height: calc(100vh - 170px);
}

.pet-col {
  overflow-y: auto;
  max-height: calc(100vh - 170px);
}

.pet-col-list > .panel {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 200px);
}

.pet-col-list .pet-team-list {
  flex: 1 1 auto;
  max-height: none;
  overflow-y: auto;
}

/* 中栏大图稍微收一点，给资料留空间 */
.pet-col-detail .pet-showcase,
.pet-col-detail .hatch-visual {
  max-width: 300px;
}
/* 弹窗放宽到 92vh，左栏列表自然长开 */
.zone-modal-box.pet {
  max-height: 92vh;
}

.pet-col-list,
.pet-col-list > .panel,
.pet-col-list .pet-team-list {
  max-height: none;
  overflow: visible;
}

.pet-col-list > .panel {
  display: block;
}

.pet-col-detail {
  overflow-y: auto;
}
/* 左栏宠物列表改成块级堆叠，宽度铺满、高度自然 */
.pet-col-list .pet-team-list {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 8px;
  height: auto;
  overflow: visible;
  padding-left: 0;
  padding-right: 0;
}

.pet-col-list .pet-team-item {
  flex: 0 0 auto;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.pet-col-list .pet-team-item img {
  max-width: 100%;
}
/* 左栏卡片紧凑化：头像 + 名字 + 等级 一行，按钮缩到下方 */
.pet-col-list .pet-team-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 8px;
  box-sizing: border-box;
}

.pet-col-list .pet-team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.pet-col-list .pet-team-img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

.pet-col-list .pet-team-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pet-col-list .pet-team-name {
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-col-list .pet-team-level {
  font-size: 11px;
  line-height: 1.3;
  color: #6b7d70;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-col-list .pet-team-bond {
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pet-col-list .pet-team-actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pet-col-list .pet-team-row {
  display: flex;
  gap: 4px;
  flex-wrap: nowrap;
}

.pet-col-list .pet-team-row button,
.pet-col-list .pet-team-active-tag {
  flex: 1 1 0;
  min-width: 0;
  font-size: 11px;
  line-height: 1.5;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
/* 卡片在左栏里必须撑满整宽 */
.pet-col-list .pet-team-list {
  align-items: stretch;
  width: 100%;
}

.pet-col-list .pet-team-item {
  align-self: stretch;
  width: auto;
  flex: 0 0 auto;
  min-width: 0;
  display: flex;
}

.pet-col-list .pet-team-item > * {
  width: 100%;
  box-sizing: border-box;
}

.pet-col-list .pet-team-item {
  flex-direction: column;
}
/* 用 id 选择器压过 .app-grid.is-student .pet-team-* 的老规则 */
#petColList .pet-team-list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
  gap: 8px;
  height: auto;
  overflow: visible;
  padding: 0;
}

#petColList .pet-team-item {
  display: flex;
  flex-direction: column;
  align-self: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  flex: 0 0 auto;
  gap: 6px;
  padding: 8px;
  box-sizing: border-box;
}

#petColList .pet-team-header {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  width: 100%;
}

#petColList .pet-team-img {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  object-fit: contain;
}

#petColList .pet-team-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

#petColList .pet-team-name {
  font-size: 13px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#petColList .pet-team-level {
  font-size: 11px;
  line-height: 1.3;
  color: #6b7d70;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#petColList .pet-team-row button,
#petColList .pet-team-active-tag {
  flex: 1 1 0;
  min-width: 0;
  font-size: 11px;
  line-height: 1.5;
  padding: 2px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
}
/* ========== 场景页全屏重做 ========== */
.app-grid.is-student .scene-inner-panel {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 52px);
  padding: 0;
  margin: 0;
  gap: 0;
  border-radius: 0;
  background: #0d1f15;
}

.app-grid.is-student .scene-topbar {
  flex: 0 0 52px;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 0 16px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(26,58,40,0.96), rgba(14,36,24,0.98));
  border-bottom: 2px solid rgba(255,226,160,0.28);
}

.app-grid.is-student .scene-topbar .back-button {
  flex: 0 0 auto;
  margin: 0;
  padding: 5px 12px;
  font-size: 13px;
  line-height: 1.4;
  color: #f0f8f1;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.22);
  border-radius: 8px;
  transform: none !important;
}

.app-grid.is-student .scene-topbar .back-button:hover {
  background: rgba(255,255,255,0.26);
}

.app-grid.is-student .scene-topbar #sceneInnerTitle {
  flex: 0 0 auto;
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: #ffe9b0;
  letter-spacing: 1px;
  text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}

.app-grid.is-student .scene-topbar .scene-inventory {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: flex-end;
  margin: 0;
  padding: 0;
}

.app-grid.is-student .scene-atmosphere {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  border-radius: 0;
  overflow: hidden;
}

.app-grid.is-student .scene-atmosphere .scene-stage {
  width: 100%;
  height: 100%;
  aspect-ratio: auto;
  min-width: 0;
  margin: 0;
  border-radius: 0;
  background: #16261a;
}

.app-grid.is-student .scene-stage .scene-stage-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* 场景内角色走动 */
.stage-player {
  transition: left 0.12s linear, top 0.12s linear;
}

/* ========== 底栏角色信息面板 ========== */
.app-grid.is-student .dock-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  box-sizing: border-box;
}

.app-grid.is-student .dock-profile {
  flex: 0 1 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding-right: 14px;
  border-right: 1px solid rgba(255,255,255,0.18);
}

.dock-profile-avatar {
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,226,160,0.45);
  object-fit: cover;
}

.dock-profile-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.dock-profile-name {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  font-weight: 700;
  color: #ffe9b0;
  line-height: 1.3;
  white-space: nowrap;
}

.dock-profile-gender {
  font-size: 10px;
  padding: 0 5px;
  border-radius: 4px;
  background: rgba(255,255,255,0.16);
  color: #dfeee4;
  line-height: 1.5;
}

.dock-profile-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: #cfe3d6;
  line-height: 1.3;
  white-space: nowrap;
}

.dock-profile-meta b {
  color: #ffe9b0;
  font-weight: 700;
}

.dock-actions {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 0;
}
/* 角色信息已挪到底栏，隐藏原左上角 HUD */
.app-grid.is-student .status-grid {
  display: none !important;
}
/* 氛围层宽度必须显式给足，否则舞台会塌成 0 宽 */
.app-grid.is-student .scene-atmosphere {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0;
  border-radius: 0;
  overflow: hidden;
}

.app-grid.is-student .scene-atmosphere .scene-stage {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
  aspect-ratio: auto;
  margin: 0;
  border-radius: 0;
}
/* 全局提示条改成浮动，不再占文档流（否则会把场景页顶下去） */
.app-grid.is-student .global-result,
.app-grid.is-student #resultMessage {
  position: fixed;
  top: 60px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 46;
  margin: 0;
  padding: 5px 16px;
  max-width: 70vw;
  border-radius: 10px;
}

/* 场景页顶条里的道具：压成横排小格 */
.app-grid.is-student .scene-topbar .inventory-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  padding: 0;
  background: none;
  border: none;
  box-shadow: none;
}
/* 顶条道具：图标 + 数量的小方块，一行排开 */
.app-grid.is-student .scene-topbar .inventory-heading {
  flex: 0 0 auto;
  margin: 0;
  max-width: 165px;
  font-size: 11px;
  color: #dfeee4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.app-grid.is-student .scene-topbar .inventory-item-grid {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  grid-template-columns: none;
}

.app-grid.is-student .scene-topbar .inventory-item {
  width: 40px;
  height: 38px;
  flex: 0 0 40px;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1px;
  padding: 2px;
  border-radius: 7px;
  box-sizing: border-box;
  overflow: hidden;
}

.app-grid.is-student .scene-topbar .inventory-item-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.app-grid.is-student .scene-topbar .inventory-item-name {
  display: none;
}

.app-grid.is-student .scene-topbar .inventory-item-count,
.app-grid.is-student .scene-topbar .inventory-count {
  font-size: 10px;
  line-height: 1;
  color: #3d5a47;
}

.app-grid.is-student .scene-topbar .scene-inventory {
  align-items: center;
}
/* 场景页里的结果条也浮起来，避免挤压舞台高度 */
.app-grid.is-student #sceneResult {
  position: fixed;
  top: 64px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 47;
  margin: 0;
  padding: 5px 16px;
  max-width: 70vw;
  border-radius: 10px;
}

/* 已被搬进舞台/顶条的空壳不再占位置 */
.app-grid.is-student .scene-inner-panel > .scene-spot-list,
.app-grid.is-student .scene-inner-panel > .scene-inventory {
  display: none;
}

.app-grid.is-student .scene-inner-panel {
  gap: 0;
}
/* 场景内走动不做过渡，按下即到位（避免后台标签冻结动画导致位置不刷新） */
.stage-player,
.stage-pet {
  transition: none !important;
}
/* ===== 宠物栏重做：洛克王国式紧凑列表 ===== */
#petColList .pet-team-item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 8px;
  min-height: 74px;
  height: auto;
  box-sizing: border-box;
}

#petColList .pet-team-header {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

#petColList .pet-team-img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  object-fit: contain;
}

#petColList .pet-team-meta {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}

#petColList .pet-team-name {
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#petColList .pet-team-level {
  font-size: 11px;
  line-height: 1.25;
  color: #6b7d70;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#petColList .pet-team-row button,
#petColList .pet-team-active-tag {
  width: 24px;
  height: 24px;
  padding: 0;
  margin: 0;
  font-size: 12px;
  line-height: 1;
  display: grid;
  place-items: center;
  border-radius: 6px;
  transform: none !important;
}
/* 修正：按钮区不能吃满整行宽度 */
#petColList .pet-team-header {
  width: auto;
  flex: 1 1 auto;
}

#petColList .pet-team-img {
  width: 44px;
  min-width: 44px;
  flex: 0 0 44px;
}

#petColList .pet-team-meta {
  width: auto;
  min-width: 0;
}
/* 顶条道具图标放大并让内嵌图形铺满 */
.app-grid.is-student .scene-topbar .inventory-item {
  width: 46px;
  flex: 0 0 46px;
  height: 40px;
  gap: 2px;
}

.app-grid.is-student .scene-topbar .inventory-item-icon {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  display: grid;
  place-items: center;
  font-size: 18px;
  line-height: 1;
}

.app-grid.is-student .scene-topbar .inventory-item-icon svg,
.app-grid.is-student .scene-topbar .inventory-item-icon img {
  width: 100%;
  height: 100%;
  display: block;
}
/* ===== 宠物操作按钮：挂在属性栏底部 ===== */
#petActionBar {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #e2ece5;
}

.pet-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pet-actions-row {
  display: flex;
  gap: 6px;
}

.pet-act-btn,
.pet-act-tag {
  flex: 1 1 0;
  min-width: 0;
  font-size: 12px;
  line-height: 1.4;
  padding: 5px 8px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  transform: none !important;
}

.pet-act-tag {
  display: grid;
  place-items: center;
  background: #e8f5e9;
  color: #2e7d32;
  font-weight: 600;
}

/* 概览里的进化提示：一行就好 */
.pet-evolve-line {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: #55705f;
  background: #f3f8f4;
  border-radius: 8px;
  padding: 6px 10px;
}
/* 进化阶段改成一行横排 */
#petColDetail .evolution-track {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

#petColDetail .evolution-step {
  flex: 0 0 auto;
  width: 88px;
  padding: 5px;
  gap: 2px;
}

#petColDetail .evolution-step img {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

#petColDetail .evolution-step span {
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 82px;
}

/* 概览区整体压紧 */
#petColDetail .hatch-content {
  gap: 10px;
}

#petColDetail .hatch-copy {
  gap: 8px;
}
/* 进化阶段三等分，不再横向溢出 */
#petColDetail .evolution-track {
  gap: 6px;
  overflow: visible;
}

#petColDetail .evolution-step {
  flex: 1 1 0;
  width: auto;
  min-width: 0;
}
/* ===== 宠物概览重新布局 ===== */
#petColDetail .hatch-content {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 200px;
}

#petColDetail .pet-card {
  flex: 0 0 auto;
  width: 184px;
  max-width: 46%;
}

#petColDetail .hatch-copy {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}

#petColDetail .hatch-copy h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
  color: #274236;
}

#petColDetail .pet-evolve-line {
  font-size: 12.5px;
  padding: 7px 10px;
}

/* 属性栏亲密度 */
.bond-row {
  margin-top: 10px;
  padding: 8px 10px;
  border-radius: 10px;
  background: #fbf6f9;
}

.bond-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: #7b5b6b;
  margin-bottom: 5px;
}

.bond-meta strong {
  color: #b0477a;
  font-size: 12.5px;
}

.bond-track {
  height: 6px;
}

.bond-fill {
  width: 0;
  background: linear-gradient(90deg, #f4a7c3, #e2639c);
}
/* ===== 鼠标点击走动 ===== */
.scene-stage {
  cursor: pointer;
}

.walk-mark {
  position: absolute;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 0 2px rgba(90, 160, 255, 0.65);
  pointer-events: none;
  z-index: 5;
  animation: walkPulse 0.6s ease-out forwards;
}

@keyframes walkPulse {
  from { transform: scale(0.45); opacity: 1; }
  to { transform: scale(1.7); opacity: 0; }
}
/* ============================================================
   界面视觉改造 V0–V5  |  2026-11-17
   本块追加在 styles.css 末尾，靠"后写覆盖先写"生效。
   凡是涉及学生端三栏 / 场景页的规则，统一用 #id 前缀，
   以免被前面的 .app-grid.is-student .xxx (0,3,0) 压掉。
   ============================================================ */

/* ---------------- V0 设计令牌 ---------------- */
:root {
  --bg-deep: #e8dfcc;
  --bg: #f7f1e3;
  --surface: #fffdf6;
  --surface-hi: #ffffff;
  --ink: #2f2a22;
  --muted: #7a6f5d;
  --ink-soft: #6b6152;
  --line: #cbbda3;
  --green: #58a35f;
  --green-deep: #2f6b3c;
  --gold: #f2b23e;
  --gold-deep: #b9751a;
  --blue: #4b9ec9;
  --red: #d9614a;
  --ice: #7fc0c9;
  --locked: #9a9690;
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 18px;
  --r-lg: 26px;
  --r-pill: 999px;
  --stroke: 2px solid var(--line);
  --stroke-strong: 3px solid #a8916f;
  --shadow-hard: 0 4px 0 #cdbb9c;
  --shadow-soft: 0 10px 24px rgba(96, 76, 44, 0.14);
  --shadow: 0 10px 24px rgba(96, 76, 44, 0.14);
  --inner-hi: inset 0 2px 0 rgba(255, 255, 255, 0.85);
  --font-num: "Bahnschrift", "DIN Alternate", "Microsoft YaHei", sans-serif;
}

body {
  background:
    radial-gradient(1100px 520px at 50% -8%, rgba(255, 246, 222, 0.95), rgba(255, 246, 222, 0)),
    var(--bg);
  color: var(--ink);
}

/* ---------------- V1 面板与卡片 ---------------- */
.panel {
  padding: 18px 18px 20px;
  border: var(--stroke);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-hard), var(--inner-hi);
}

.topbar {
  border: var(--stroke);
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-hard), var(--inner-hi);
}

/* 左栏宠物卡片：厚边 + 硬影（#petColList 权重 1,1,0 高于 0,3,0） */
#petColList .pet-team-item {
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface-hi);
  box-shadow: 0 3px 0 #d8c8ab;
  transition: transform 160ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 160ms ease,
    border-color 160ms ease;
}

#petColList .pet-team-item.active {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(242, 178, 62, 0.35), 0 3px 0 #d8c8ab;
  transform: translateY(-1px);
}

/* 中栏：独立卡片 */
.pet-col-detail {
  border: var(--stroke);
  border-radius: var(--r-md);
  background: var(--surface-hi);
  box-shadow: var(--shadow-hard), var(--inner-hi);
}

/* ---------------- V2 按钮体系 ---------------- */
.primary-button,
.secondary-button,
.danger-button,
.ghost-button {
  min-height: 42px;
  padding: 0 20px;
  border-radius: var(--r-pill);
  font-weight: 700;
  transition: transform 0.08s ease-out, box-shadow 0.08s ease-out, background 0.16s ease;
}

.primary-button {
  border: 2px solid var(--green-deep);
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--green-deep), var(--inner-hi);
}

.primary-button:hover:not(:disabled) {
  background: #4d9453;
}

.primary-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 var(--green-deep), var(--inner-hi);
}

.secondary-button {
  border: 2px solid #a9c8da;
  background: #eff8fd;
  color: #214f6f;
  box-shadow: 0 3px 0 #a9c8da, var(--inner-hi);
}

.secondary-button:active:not(:disabled) {
  transform: translateY(3px);
  box-shadow: 0 0 0 #a9c8da, var(--inner-hi);
}

/* 底栏四个入口：方块化 + 硬影（保留原有 flex 宽度设定） */
.dock-btn:active {
  transform: translateY(3px) !important;
  box-shadow: 0 0 0 #d8c8ab;
}

/* 宠物操作按钮（右侧属性栏下方） */
.pet-act-btn {
  border-radius: var(--r-pill) !important;
  box-shadow: 0 2px 0 #d8c8ab;
}

/* ---------------- V3 进度条与数值 ---------------- */
.progress-track {
  height: 16px;
  padding: 2px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: #efe6d2;
  box-sizing: border-box;
}

.progress-fill {
  border-radius: var(--r-pill);
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.14), inset 0 2px 0 rgba(255, 255, 255, 0.45);
}

.bond-track {
  height: 12px;
  border: 2px solid #d9b8c9;
  border-radius: var(--r-pill);
  background: #f7ecf2;
  box-sizing: border-box;
}

/* 数值用等宽圆体，和标签拉开对比 */
.stat-meta strong,
.bond-meta strong {
  font-family: var(--font-num);
  font-weight: 800;
  letter-spacing: 0.3px;
}

/* ---------------- V4 弹窗体系 ---------------- */
.modal-overlay {
  background: rgba(46, 36, 22, 0.58);
}

.zone-modal-box {
  border: var(--stroke-strong);
  border-radius: var(--r-lg);
  background: var(--surface-hi);
  box-shadow: 0 10px 0 rgba(168, 145, 111, 0.3), 0 26px 60px rgba(60, 45, 25, 0.3);
}

.zone-modal-box .modal-header {
  margin: 0;
  padding: 14px 18px;
  background: linear-gradient(180deg, #ffe9b8, #ffd98a);
  border-bottom: var(--stroke);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

/* ---------------- V5 三栏分区 ---------------- */
.pet-col-detail,
#petColAbility {
  position: relative;
}

#petColDetail::before,
#petColAbility::before {
  content: "";
  position: absolute;
  left: -8px;
  top: 10%;
  width: 0;
  height: 80%;
  border-left: 1px dashed #c9bca4;
  pointer-events: none;
}

/* ============================================================
   界面视觉改造 V6–V8  |  2026-11-17
   场景页 / 大地图 / 登录页 / 动效
   注意：.map-pin 与 .stage-spot 外层负责 translate 定位，
   这里一律只改内部 .map-dot / .stage-dot，绝不动外层 transform，
   否则地图点位会整体偏移。
   ============================================================ */

/* ---------------- V6 场景页 ---------------- */
#sceneView .scene-topbar {
  padding: 10px 14px;
  border: 2px solid #d9c49c;
  border-radius: var(--r-sm);
  background: linear-gradient(180deg, #fff8e6, #fdeecb);
  box-shadow: 0 3px 0 #d8c8ab;
}

#sceneView .scene-topbar .back-button {
  border: 2px solid #8a6f4a;
  border-radius: var(--r-pill);
  background: #fff3d2;
  color: #5d4526;
  box-shadow: 0 3px 0 #8a6f4a;
  transform: none !important;
}

#sceneView .scene-topbar .back-button:active {
  transform: translateY(3px) !important;
  box-shadow: 0 0 0 #8a6f4a;
}

#sceneView #sceneInnerTitle {
  color: #5d4526;
  font-weight: 800;
  letter-spacing: 1px;
  padding-bottom: 2px;
  border-bottom: 2px solid #e2c88f;
}

/* 探索点：小木牌 */
#sceneView .stage-dot {
  border: 2px solid #8a6f4a;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff6da, #ffe9b0);
  box-shadow: 0 3px 0 #8a6f4a, 0 0 0 3px rgba(255, 255, 255, 0.5);
}

#sceneView .stage-tag {
  color: #5d4526;
  background: rgba(255, 246, 218, 0.94);
  border: 1px solid #d9c49c;
  border-radius: 8px;
}

/* 底部提示条：羊皮纸 */
#sceneView #sceneResult {
  color: var(--ink);
  background: #fff7e0;
  border: 2px solid var(--line);
  border-radius: var(--r-sm);
  box-shadow: 0 3px 0 #d8c8ab;
}

/* 顶条道具图标：统一放大到 22px（原规则用 0,3,0 压制，这里用 id 前缀反压） */
#sceneView .scene-topbar .inventory-item-icon {
  width: 22px !important;
  height: 22px !important;
}

#sceneView .scene-topbar .inventory-item-icon svg,
#sceneView .scene-topbar .inventory-item-icon img {
  width: 22px !important;
  height: 22px !important;
}

/* ---------------- V7 大地图 + 登录页 ---------------- */
/* 地标：米黄木牌 */
#worldView .map-dot {
  border: 2px solid #8a6f4a;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff6da, #ffe9b0);
  box-shadow: 0 3px 0 #8a6f4a, 0 0 0 3px rgba(255, 255, 255, 0.55);
}

#worldView .map-name {
  color: #5d4526;
  background: rgba(255, 248, 230, 0.92);
  border: 1px solid #d9c49c;
  border-radius: 8px;
  padding: 2px 8px;
  white-space: nowrap;
}

/* 训练师脚下投影，人不再"浮"在地图上方 */
.map-player::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 2px;
  width: 54px;
  height: 16px;
  transform: translateX(-50%);
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.32), rgba(0, 0, 0, 0) 70%);
  pointer-events: none;
  z-index: -1;
}

/* 登录卡：游戏面板而非网页卡片 */
/* ---------------- V8 动效 ---------------- */
/* 弹窗不做缩放入场：历史上 opacity 动画会在后台标签停在 from 导致白屏，
   这里显式加固为 none，只保留按钮与呼吸动画。 */
.zone-modal-box,
.modal-overlay,
.modal,
.zone-modal,
.rank-modal,
.view-container {
  animation: none !important;
}

@keyframes pet-breathe {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

/* 中栏宠物大图轻微呼吸（只用 transform，不涉及 opacity，后台冻结也不会白屏） */
.pet-col-detail .hatch-visual img {
  animation: pet-breathe 3s ease-in-out infinite;
}

.button-icon svg {
  width: 18px;
  height: 18px;
}

/* ---------------- V7+ 登录页背景与按钮修正 ---------------- */
/* 原 .login-view 是紫色渐变（#667eea → #764ba2），与整套暖色令牌冲突，整体换掉 */
.login-title {
  font-weight: 800;
  letter-spacing: 1px;
  color: #3b3125;
}

.login-subtitle {
  color: var(--muted);
}

/* ---------------- V9 补齐：底栏木色化 / 引导弹窗去紫 ---------------- */
/* 底栏原来是近黑的深绿渐变，改成木质深条，保留白字可读性 */
.dock-bar {
  border-top: 3px solid #a8916f;
  background: linear-gradient(180deg, #6f5637 0%, #4c3b24 100%);
  box-shadow: 0 -6px 18px rgba(60, 45, 25, 0.22);
}

/* 新手引导：与主弹窗同一套"厚边 + 大圆角 + 硬影" */
.guide-btn {
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 3px 0 #d8c8ab;
  transform: none !important;
}

.guide-btn:active {
  transform: translateY(3px) !important;
  box-shadow: 0 0 0 #d8c8ab;
}

.guide-btn.primary {
  border-color: var(--green-deep);
  background: var(--green);
  color: #ffffff;
  box-shadow: 0 3px 0 var(--green-deep);
}

.guide-btn.primary:active {
  box-shadow: 0 0 0 var(--green-deep);
}

/* ---------------- V10 计时面板去紫 ---------------- */
.timer-panel {
  border: var(--stroke);
  border-radius: var(--r-md);
  background: linear-gradient(180deg, #fff8e6 0%, #fbeed0 100%);
  box-shadow: var(--shadow-hard), var(--inner-hi);
  color: var(--ink);
}

.timer-panel .timer-label,
.timer-panel .timer-heading {
  color: #5d4526;
}

.timer-panel .timer-time,
.timer-panel .timer-value {
  color: #2f2a22;
  font-family: var(--font-num);
  font-weight: 800;
}

/* ---------------- V11 全屏画布与底栏对比度 ---------------- */
/* 地图外的留白不再用深绿，改成云海浅色，和地图本身衔接 */
.app-grid.is-student .game-area {
  background: linear-gradient(180deg, #d7ebf9 0%, #eef7fd 55%, #f8fcfe 100%);
}

/* 地图在可视区垂直居中，上下留白均匀；底部留出底栏高度 */
.app-grid.is-student .scene-grid.map-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 58px;
  box-sizing: border-box;
}

/* 底栏按钮：米白底 + 深色字（原白字配白底几乎看不见） */
.dock-btn span,
.dock-btn strong,
.dock-btn small {
  color: var(--ink);
}

/* ---------------- V12 覆盖 #sceneGrid 的 id 级 display:block ---------------- */
/* #sceneGrid.map-mode 是 (1,1,0)，权重压过 .app-grid.is-student .scene-grid.map-mode，
   必须带 id 才能把地图容器切成 flex 并垂直居中 */
.app-grid.is-student #sceneGrid.map-mode {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 0 58px;
  box-sizing: border-box;
}

#sceneGrid.map-mode {
  align-items: center;
  justify-content: center;
}

/* ---------------- V13 三栏细节修正 ---------------- */
/* 旧规则给选中卡片挂了紫色外发光（#667eea 系），用 !important 换成金色 */
#petColList .pet-team-item.active {
  border-color: var(--gold) !important;
  box-shadow: 0 0 0 2px rgba(242, 178, 62, 0.4), 0 3px 0 #d8c8ab !important;
  background: #fffdf3 !important;
}

/* 中栏"下一阶段"提示框：由浅绿改米黄，与整体暖色统一 */
.pet-col-detail .pet-evolve-line,
.pet-col-detail .evolve-hint {
  border: 1px solid #e2c88f;
  border-radius: var(--r-sm);
  background: #fff7e0;
  color: #6b5230;
}

/* 宠物大图相框 */
.pet-col-detail .hatch-visual {
  border: 2px solid #e2c88f;
  border-radius: var(--r-md);
  background: radial-gradient(circle at 50% 45%, #fffdf3 0%, #fdf2d8 70%);
  box-shadow: 0 3px 0 #e2c88f;
}

/* ---------------- V14 场景顶条重排（两行） ---------------- */
/* 原顶条把「返回 + 场景名 + 道具栏」挤在一行，道具栏被压成竖条、文字重叠。
   改为：第一行「返回大世界 + 场景名」，第二行整行留给道具。 */
#sceneView .scene-topbar {
  display: flex !important;
  flex-wrap: wrap !important;
  align-items: center !important;
  gap: 6px 12px !important;
  padding: 8px 14px !important;
  border-radius: var(--r-md) !important;
  border: var(--stroke) !important;
  background: linear-gradient(180deg, #fff8e6, #fdf1d8) !important;
  box-shadow: var(--shadow-hard) !important;
  row-gap: 8px !important;
}

#sceneView .scene-topbar .back-button {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
}

#sceneView #sceneInnerTitle {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  margin: 0 !important;
  font-size: 16px !important;
  font-weight: 800 !important;
}

/* 道具栏独占一行，内部横向排列，禁止挤压 */
#sceneView #sceneInventory {
  flex: 1 0 100% !important;
  min-width: 0 !important;
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  overflow: hidden !important;
}

#sceneView #sceneInventory > div {
  display: flex !important;
  align-items: center !important;
  gap: 10px !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}

#sceneView #sceneInventory .inventory-item-grid {
  display: flex !important;
  gap: 6px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
  justify-content: flex-end !important;
  overflow: hidden !important;
}

#sceneView #sceneInventory .inventory-item {
  flex: 0 1 76px !important;
  min-width: 52px !important;
  max-width: 76px !important;
  text-align: center !important;
  padding: 4px 5px !important;
  border-radius: var(--r-sm) !important;
  border: 1.5px solid #dcc9a4 !important;
  background: #fffdf5 !important;
  box-sizing: border-box !important;
}

#sceneView #sceneInventory .inventory-item.locked {
  opacity: 0.55 !important;
}

#sceneView #sceneInventory .inventory-item-name {
  display: block !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #6b5230 !important;
}

#sceneView #sceneInventory .inventory-item-icon {
  width: 22px !important;
  height: 22px !important;
  margin: 0 auto 2px !important;
  line-height: 22px !important;
  font-size: 16px !important;
}

/* 道具标题不换行、不被压 */
#sceneView #sceneInventory h4,
#sceneView #sceneInventory h5,
#sceneView #sceneInventory .inventory-heading {
  flex: 0 0 auto !important;
  white-space: nowrap !important;
  margin: 0 !important;
  font-size: 12px !important;
  color: #8a7452 !important;
}

/* ---------------- V15 场景容器铺满 + 提示条归位 ---------------- */
/* 顶条只有 573px，两侧露出深绿底：panel 是内容宽，露出的背景是 game-area 旧深绿 */
#sceneView {
  background: transparent !important;
}

#sceneView .scene-inner-panel {
  width: 100% !important;
  max-width: none !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  box-sizing: border-box !important;
}

#sceneView .scene-topbar {
  width: 100% !important;
  box-sizing: border-box !important;
  margin: 8px 0 0 !important;
}

/* 让场景舞台整块铺满，去掉左右深绿边 */
#sceneView .scene-atmosphere {
  width: 100% !important;
  left: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  border-radius: 0 !important;
}

/* 提示条（"角色已创建…"之类）原来压在道具栏上，挪到画面底部居中 */
#sceneView #sceneResult {
  position: absolute !important;
  top: auto !important;
  bottom: 86px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: min(620px, 84%) !important;
  margin: 0 !important;
  z-index: 8 !important;
  border: 2px solid #dcc9a4 !important;
  border-radius: var(--r-md) !important;
  background: rgba(253, 246, 227, 0.96) !important;
  box-shadow: 0 4px 0 #cdbb9c !important;
  color: #4a3b28 !important;
  font-size: 13px !important;
}

/* ---------------- V16 全局提示条避让 + 道具名不换行 ---------------- */
/* .global-result 固定定位于 top:60，在大世界顶部居中没毛病，
   但进了场景视图会正好压住顶条第二行的道具栏 —— 用 :has() 只在场景视图里挪到底部。 */
.game-main:has(#sceneView:not([hidden])) .global-result,
.game-main:has(#sceneView:not([hidden])) #resultMessage {
  top: auto !important;
  bottom: 132px !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  z-index: 30 !important;
  max-width: min(620px, 84%) !important;
}

/* 道具名不再竖排 */
#sceneView #sceneInventory .inventory-item-name {
  width: 100% !important;
  max-width: 100% !important;
  writing-mode: horizontal-tb !important;
  letter-spacing: 0 !important;
}

#sceneView #sceneInventory .inventory-item {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 2px !important;
}

/* ---------------- V17 角色弹窗 + 底栏五入口 ---------------- */
/* 左下角角色名牌下线：名字/行动点改由角色弹窗承载，不再压在画面左下 */
#dockProfile {
  display: none !important;
}

/* 底栏 5 个入口平分（角色 / 宠物 / 商店 / 排行榜 / 计时） */
.dock-bar .dock-actions {
  flex: 1 1 auto !important;
  justify-content: center !important;
  gap: 10px !important;
}

.dock-bar .dock-btn {
  flex: 0 1 150px !important;
  max-width: 150px !important;
  min-width: 104px !important;
}

/* ---- 角色弹窗外壳 ---- */
.zone-modal-box.role {
  width: min(880px, 94vw) !important;
}

.role-body {
  padding: 0 14px 14px !important;
}

.role-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

/* ---- 左侧立绘 ---- */
.role-portrait {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.role-portrait-frame {
  width: 100%;
  aspect-ratio: 3 / 4;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: radial-gradient(circle at 50% 38%, #fffdf3 0%, #fdf1d6 72%);
  box-shadow: var(--shadow-hard), var(--inner-hi);
  box-sizing: border-box;
}

.role-portrait-frame img {
  width: 84%;
  height: auto;
  max-height: 94%;
  object-fit: contain;
  image-rendering: auto;
}

.role-portrait-name {
  font-size: 15px;
  font-weight: 800;
  color: #3f2f1c;
}

/* ---- 右侧页签 ---- */
.role-main {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.role-tabs {
  display: flex;
  gap: 8px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.role-tab {
  flex: 1 1 0;
  padding: 9px 0;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: #fffdf5;
  color: #5b4630;
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, background 120ms ease;
}

.role-tab:hover {
  background: #fff6e2;
}

.role-tab.active {
  background: var(--green);
  border-color: var(--green-deep);
  color: #fff;
  box-shadow: 0 3px 0 var(--green-deep);
}

.role-panel-area {
  min-height: 386px;
  max-height: 56vh;
  overflow-y: auto;
  padding-right: 4px;
}

/* ---- 信息页 ---- */
.role-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.role-info-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 9px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: #fffdf5;
  box-shadow: 0 3px 0 #e6d9bd;
  box-sizing: border-box;
  min-width: 0;
}

.role-info-key {
  font-size: 12px;
  color: #8a7452;
}

.role-info-value {
  font-size: 14px;
  letter-spacing: -0.2px;
  color: #3f2f1c;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---- 角色页两个"一次性"操作：性别互换 / 改密码 ---- */
.role-info-pane {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.role-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 8px;
}

.role-actions.is-editing {
  flex-direction: column;
}

.role-actions.is-editing .role-action-btn {
  flex: 0 0 auto;
  width: 100%;
}

.role-pass-area {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
}

.role-pass-area .role-action-btn {
  width: 100%;
}

.role-actions.is-editing .role-pass-area {
  flex: 1 1 auto;
  width: 100%;
}

.role-action-btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 800;
  color: #4a3a22;
  background: #fdf3d6;
  border: 2px solid #e9d7ac;
  border-radius: 10px;
  box-shadow: 0 3px 0 #e2cf9f;
  cursor: pointer;
  text-align: center;
}

.role-action-btn:hover:not(:disabled) {
  background: #fbeabb;
}

.role-action-btn:disabled,
.role-action-btn.is-used {
  color: #9c8a6c;
  background: #f3ede0;
  border-color: #e0d8c6;
  box-shadow: none;
  cursor: default;
}

.role-pass-editor {
  margin: 0;
}

.role-pass-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px;
  background: #fffdf5;
  border: 2px solid #e9d7ac;
  border-radius: 10px;
}

.role-pass-tip {
  font-size: 12px;
  color: #8a7452;
}

.role-pass-line {
  display: flex;
  gap: 6px;
}

.role-pass-input {
  flex: 1;
  min-width: 0;
  padding: 7px 10px;
  font-size: 15px;
  color: #3f2f1c;
  background: #fff;
  border: 2px solid #e6d9bd;
  border-radius: 8px;
}

.role-pass-ok {
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  background: #f0a832;
  border: none;
  border-radius: 8px;
  box-shadow: 0 3px 0 #cf8a1c;
  cursor: pointer;
}

.role-pass-cancel {
  padding: 7px 10px;
  font-size: 13px;
  color: #7a6a50;
  background: #f3ede0;
  border: 2px solid #e0d8c6;
  border-radius: 8px;
  cursor: pointer;
}

/* ---- 道具页 ---- */
.role-items-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.role-item-section {
  margin-bottom: 12px;
}

.role-item-section h4 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #6b5230;
}

.role-item-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.role-item-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 6px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: #fffdf5;
  box-sizing: border-box;
  min-width: 0;
}

.role-item-cell.owned {
  border-color: #bfa76d;
  background: #fff9ea;
}

.role-item-cell.locked {
  opacity: 0.45;
}

.role-item-icon {
  font-size: 20px;
  line-height: 1.1;
}

.role-item-name {
  max-width: 100%;
  font-size: 11px;
  color: #5b4630;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.role-item-count {
  font-size: 11px;
  color: #8a7452;
}

/* ---- 衣服页 ---- */
.role-clothes {
  display: block !important;
  width: 100%;
  box-sizing: border-box;
}

.role-empty {
  margin: 0;
  padding: 40px 0;
  text-align: center;
  color: #8a7452;
}

/* ---------------- V18 宠物弹窗页签 + 页签文字对比度修正 ---------------- */
/* 页签在 :focus 后文字发白看不清，补强对比度 */
.role-tab {
  color: #5b4630 !important;
}

.role-tab.active {
  color: #fffdf6 !important;
}

.role-tab:focus {
  outline: 2px solid rgba(242, 178, 62, 0.55);
  outline-offset: 2px;
}

/* 滚动条换暖色，跟纸面风格一致（原来沿用紫色） */
.role-panel-area::-webkit-scrollbar,
.zone-modal-body::-webkit-scrollbar,
.pet-items-view::-webkit-scrollbar {
  width: 10px;
}

.role-panel-area::-webkit-scrollbar-track,
.zone-modal-body::-webkit-scrollbar-track,
.pet-items-view::-webkit-scrollbar-track {
  background: #f2e8d4;
  border-radius: 999px;
}

.role-panel-area::-webkit-scrollbar-thumb,
.zone-modal-body::-webkit-scrollbar-thumb,
.pet-items-view::-webkit-scrollbar-thumb {
  background: #c9b294;
  border-radius: 999px;
}

/* ---- 宠物弹窗顶部页签 ---- */
.pet-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
}

.pet-tabs .role-tab {
  flex: 0 1 180px;
  padding: 8px 0;
  font-size: 14px;
}

/* ---- 宠物道具页 ---- */
.pet-items-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 320px;
  max-height: 58vh;
  overflow-y: auto;
  padding: 2px 4px 4px 2px;
}

.pet-items-view[hidden] {
  display: none !important;
}

.pet-item-card {
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: var(--r-md);
  background: #fffdf5;
  box-shadow: 0 3px 0 #e6d9bd;
  box-sizing: border-box;
}

.pet-item-card h4 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: #3f2f1c;
}

.pet-item-card p {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
  color: #6b5230;
}

.pet-info-view[hidden] {
  display: none !important;
}

/* 页签选中态强制上色（宠物弹窗里被 .pet-tabs 的规则盖掉了背景） */
.pet-tabs .role-tab.active,
.pet-tabs .role-tab.active:hover,
.role-tabs .role-tab.active,
.role-tabs .role-tab.active:hover {
  background: var(--green) !important;
  border-color: var(--green-deep) !important;
  color: #fffdf6 !important;
}

.pet-tabs .role-tab:not(.active):hover,
.role-tabs .role-tab:not(.active):hover {
  background: #fff6e2 !important;
  color: #5b4630 !important;
}


/* ---------------- V19 场景页全屏化：图铺满 + 顶栏浮层 + 道具抽屉 ---------------- */
/* 原来的顶条是实体卡片（占 110px 高度），把场景图往下挤，看着就是"图上多一块白"。
   这里把它彻底改成浮层：不占布局高度，只浮在图上。 */

#sceneView {
  height: 100% !important;
  padding: 0 !important;
  overflow: hidden !important;
}

#sceneView .scene-inner-panel {
  display: block !important;
  height: 100% !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* 场景舞台：撑满视口减底栏，跟大地图一张图的尺寸感一致 */
#sceneView .scene-atmosphere {
  position: relative !important;
  width: 100% !important;
  height: calc(100vh - 118px) !important;
  min-height: 430px !important;
  left: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  overflow: hidden !important;
}

#sceneView .scene-stage {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  border-radius: 0 !important;
  overflow: hidden !important;
}

#sceneView .scene-stage-bg {
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  display: block !important;
}

/* 顶栏：绝对定位浮层，透明背景 */
#sceneView .scene-topbar {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  z-index: 20 !important;
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 14px !important;
  padding: 14px 20px !important;
  width: auto !important;
  margin: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  pointer-events: none !important;
}

#sceneView .scene-topbar > * {
  pointer-events: auto !important;
}

/* 返回大世界：无底色方案 → 极淡半透明底 + 白字深描边，浅背景也读得清 */
#sceneView .scene-topbar .back-button {
  flex: 0 0 auto !important;
  padding: 8px 16px !important;
  border: 0 !important;
  border-radius: var(--r-pill) !important;
  background: rgba(24, 20, 14, 0.26) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 8px rgba(0, 0, 0, 0.4) !important;
  box-shadow: none !important;
  transform: none !important;
}

#sceneView .scene-topbar .back-button:hover {
  background: rgba(24, 20, 14, 0.42) !important;
}

#sceneView .scene-topbar .back-button .button-icon {
  color: #ffffff !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
}

/* 场景名：白字 + 阴影，不要纸条 */
#sceneView #sceneInnerTitle {
  flex: 0 0 auto !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  color: #ffffff !important;
  font-size: 21px !important;
  font-weight: 800 !important;
  letter-spacing: 1px !important;
  white-space: nowrap !important;
  text-decoration: none !important;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.65), 0 0 3px rgba(0, 0, 0, 0.9) !important;
}

/* 道具胶囊：顶栏右侧 */
#sceneView .scene-bag-btn {
  flex: 0 0 auto !important;
  margin-left: auto !important;
  padding: 8px 16px !important;
  border: 2px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: var(--r-pill) !important;
  background: rgba(24, 20, 14, 0.3) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  font-family: inherit !important;
  cursor: pointer !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  transition: background 140ms ease !important;
}

#sceneView .scene-bag-btn:hover {
  background: rgba(24, 20, 14, 0.46) !important;
}

/* 遇宠模式按钮：和道具胶囊并排放在顶栏右侧 */
#sceneView .scene-topbar-actions {
  flex: 0 0 auto !important;
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  margin-left: auto !important;
}

#sceneView .scene-topbar-actions .scene-bag-btn {
  margin-left: 0 !important;
}

#sceneView .scene-mode-btn {
  flex: 0 0 auto !important;
  padding: 8px 13px !important;
  border: 2px solid rgba(255, 255, 255, 0.72) !important;
  border-radius: var(--r-pill) !important;
  background: rgba(24, 20, 14, 0.3) !important;
  color: #ffffff !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  font-family: inherit !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  cursor: pointer !important;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6) !important;
  transition: background 140ms ease, border-color 140ms ease !important;
}

#sceneView .scene-mode-btn.mode-normal {
  border-color: rgba(255, 255, 255, 0.72) !important;
  background: rgba(24, 20, 14, 0.34) !important;
}

#sceneView .scene-mode-btn.mode-rage {
  border-color: #ffb26b !important;
  background: rgba(166, 53, 20, 0.62) !important;
  color: #fff3df !important;
}

#sceneView .scene-mode-btn.mode-quiet {
  border-color: #a7d8ff !important;
  background: rgba(26, 62, 106, 0.58) !important;
  color: #ecf8ff !important;
}

#sceneView .scene-mode-btn:hover {
  filter: brightness(1.12);
}

#sceneView .scene-mode-btn:disabled {
  opacity: 0.55 !important;
  cursor: not-allowed !important;
}

/* 道具抽屉：默认收起，点胶囊从底部滑出 */
#sceneView #sceneInventory {
  position: fixed !important;
  left: 50% !important;
  bottom: 126px !important;
  transform: translate(-50%, 150%) !important;
  width: min(780px, 93vw) !important;
  max-height: 44vh !important;
  overflow-y: auto !important;
  margin: 0 !important;
  padding: 14px 16px !important;
  border: 2px solid var(--line) !important;
  border-radius: var(--r-lg) !important;
  background: rgba(255, 251, 240, 0.98) !important;
  box-shadow: 0 6px 0 #cdbb9c, 0 -10px 28px rgba(0, 0, 0, 0.22) !important;
  opacity: 0 !important;
  visibility: hidden !important;
  transition: transform 230ms cubic-bezier(0.22, 1, 0.36, 1), opacity 180ms ease !important;
  z-index: 45 !important;
}

#sceneView #sceneInventory.open {
  transform: translate(-50%, 0) !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* 抽屉内部：一行放得下 4 个道具，说明文字在左 */
#sceneView #sceneInventory > div {
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  width: 100% !important;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
}

#sceneView #sceneInventory .inventory-item-grid {
  display: flex !important;
  gap: 8px !important;
  flex: 1 1 auto !important;
  min-width: 0 !important;
  justify-content: flex-end !important;
  flex-wrap: nowrap !important;
}

#sceneView #sceneInventory .inventory-item {
  flex: 0 1 84px !important;
  min-width: 58px !important;
  max-width: 84px !important;
  padding: 6px 6px 5px !important;
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 2px !important;
  border: 2px solid var(--line) !important;
  border-radius: var(--r-md) !important;
  background: #fffdf5 !important;
  box-sizing: border-box !important;
}

#sceneView #sceneInventory .inventory-item.locked {
  opacity: 0.5 !important;
}

#sceneView #sceneInventory .inventory-item-name {
  width: 100% !important;
  max-width: 100% !important;
  font-size: 11px !important;
  line-height: 1.2 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #6b5230 !important;
}

/* 场景底部的说明文字往上提，别被底栏压住 */
#sceneView .scene-stage-desc {
  bottom: 14px !important;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.65) !important;
}


/* ---------------- V20 场景页收尾：提示条收纳 + 高度对齐底栏 ---------------- */
/* 场景图高度改成减 112px，跟底栏严丝合缝，不留缝 */
#sceneView .scene-atmosphere {
  height: calc(100vh - 112px) !important;
}

/* 场景提示条原来是文档流里的一块（占 36px 高），会露出一条空米色条。
   改成浮层，贴在底栏上方；内容为空时彻底不显示。 */
#sceneView #sceneResult {
  position: fixed !important;
  left: 50% !important;
  bottom: 124px !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  max-width: 68% !important;
  z-index: 46 !important;
}

#sceneView #sceneResult:empty {
  display: none !important;
}

/* 顶栏间距：返回按钮和场景名之间留出呼吸感 */
#sceneView .scene-topbar {
  gap: 22px !important;
}


/* ---------------- V21 场景道具抽屉细节：名字横排 + 图标放大 ---------------- */
#sceneView #sceneInventory .inventory-item {
  flex: 0 1 92px !important;
  min-width: 76px !important;
  max-width: 92px !important;
  padding: 8px 8px 7px !important;
  gap: 3px !important;
}

#sceneView #sceneInventory .inventory-item-icon {
  font-size: 20px !important;
  line-height: 1.1 !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
}

#sceneView #sceneInventory .inventory-item-name {
  writing-mode: horizontal-tb !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  width: 100% !important;
  max-width: 100% !important;
  font-size: 12px !important;
  line-height: 1.25 !important;
  text-align: center !important;
  color: #6b5230 !important;
}

#sceneView #sceneInventory .inventory-heading {
  font-size: 13px !important;
  white-space: nowrap !important;
  margin: 0 !important;
  color: #6b5230 !important;
  font-weight: 800 !important;
}


/* ---------------- V22 宠物弹窗：一排六格 + 右栏页签切换 ---------------- */

/* 布局改成：顶部横跨一整行的宠物栏 + 下面左右两栏 */
#petInfoView .pet-three-col {
  display: grid !important;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) !important;
  grid-template-rows: auto minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  height: auto !important;
  min-height: 0 !important;
}

#petColList {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  overflow: visible !important;
}

#petColDetail {
  grid-column: 1 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

#petColAbility {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 0 !important;
  min-height: 0 !important;
}

/* —— 宠物栏：一排六格 —— */
#petColList .pet-team-panel {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  height: auto !important;
  overflow: visible !important;
}

#petColList .pet-team-list {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100% !important;
  height: auto !important;
  overflow: visible !important;
}

#petColList .pet-team-item {
  flex: 1 1 0 !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  padding: 8px 6px !important;
  box-sizing: border-box !important;
  border-radius: var(--r-md) !important;
  height: auto !important;
}

#petColList .pet-team-item .pet-team-header {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  gap: 5px !important;
  width: 100% !important;
}

#petColList .pet-team-img {
  width: 42px !important;
  height: 42px !important;
  object-fit: contain !important;
  flex: 0 0 auto !important;
}

#petColList .pet-team-meta {
  display: block !important;
  width: 100% !important;
  min-width: 0 !important;
  text-align: center !important;
}

#petColList .pet-team-name {
  display: block !important;
  width: 100% !important;
  font-size: 12px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

#petColList .pet-team-level {
  display: block !important;
  width: 100% !important;
  font-size: 11px !important;
  line-height: 1.3 !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  color: #8a7657 !important;
}

/* 空槽：虚线框 + 「空位」，让 6 只的容量一眼可见 */
#petColList .pet-team-item.is-empty {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  min-height: 92px !important;
  border: 2px dashed #cbbda3 !important;
  background: rgba(255, 253, 245, 0.65) !important;
  box-shadow: none !important;
}

#petColList .pet-team-empty-label {
  font-size: 12px !important;
  color: #a08e6c !important;
  letter-spacing: 2px !important;
}

/* —— 右栏：页签在顶部 + 内容区 —— */
#petColAbility {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  overflow-y: auto !important;
  padding-right: 6px !important;
}

#petTabs {
  display: flex !important;
  flex: 0 0 auto !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#petTabs .role-tab {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  padding: 8px 10px !important;
  font-size: 13px !important;
  border-radius: var(--r-pill) !important;
}

#petColAbility .stat-panel {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

#petColAbility #petItemsView {
  flex: 1 1 auto !important;
  min-width: 0 !important;
}

#petColAbility[data-mode="items"] .stat-panel {
  display: none !important;
}

#petColAbility #petActionBar {
  margin-top: auto !important;
  flex: 0 0 auto !important;
}

/* —— 中栏：宠物大图撑满，不留大片空白 —— */
#petColDetail {
  display: flex !important;
  flex-direction: column !important;
  overflow-y: auto !important;
}

#petColDetail .hatch-panel {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  display: flex !important;
  flex-direction: column !important;
}


/* ---------------- V23 宠物弹窗中栏：大图撑满，别留空白 ---------------- */
#petColDetail .hatch-content {
  display: flex !important;
  flex-direction: column !important;
  gap: 10px !important;
  height: 100% !important;
  min-height: 0 !important;
  box-sizing: border-box !important;
}

#petColDetail .pet-card {
  flex: 1 1 auto !important;
  min-height: 250px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  overflow: hidden !important;
  padding: 10px !important;
  box-sizing: border-box !important;
}

#petColDetail .pet-avatar {
  max-height: 100% !important;
  max-width: 100% !important;
  width: auto !important;
  height: auto !important;
  object-fit: contain !important;
}

#petColDetail .hatch-copy {
  flex: 0 0 auto !important;
  min-width: 0 !important;
}

#petColDetail .hatch-copy h3 {
  font-size: 15px !important;
  line-height: 1.35 !important;
  margin: 0 0 4px !important;
  white-space: normal !important;
}

#petColDetail .pet-evolve-line {
  font-size: 12px !important;
  line-height: 1.4 !important;
  margin: 0 !important;
  padding: 6px 10px !important;
  border-radius: var(--r-sm) !important;
  background: #fdf4dd !important;
  border: 2px solid #e8d8b4 !important;
  color: #7a5c2a !important;
  white-space: normal !important;
}


/* ---------------- V24 宠物右栏滚动条换暖色（去紫） ---------------- */
#petColAbility {
  scrollbar-width: thin !important;
  scrollbar-color: #c2b294 #f4ecda !important;
  padding-right: 8px !important;
}

#petColAbility::-webkit-scrollbar {
  width: 9px !important;
}

#petColAbility::-webkit-scrollbar-track {
  background: #f4ecda !important;
  border-radius: 5px !important;
}

#petColAbility::-webkit-scrollbar-thumb {
  background: #c2b294 !important;
  border-radius: 5px !important;
  border: 2px solid #f4ecda !important;
}

#petColDetail::-webkit-scrollbar {
  width: 9px !important;
}

#petColDetail::-webkit-scrollbar-track {
  background: #f4ecda !important;
  border-radius: 5px !important;
}

#petColDetail::-webkit-scrollbar-thumb {
  background: #c2b294 !important;
  border-radius: 5px !important;
  border: 2px solid #f4ecda !important;
}

/* 宠物栏标题更紧凑一点，给六个槽位多留空间 */
#petColList .panel-heading {
  margin: 0 0 6px !important;
  padding: 0 !important;
}

#petColList .panel-heading h2 {
  font-size: 14px !important;
  margin: 0 !important;
}


/* ---------------- V25 角色弹窗：页签右竖排 + 内容撑满 ---------------- */
#roleModal .role-layout {
  grid-template-columns: 220px minmax(0, 1fr) !important;
  align-items: stretch !important;
  height: 100% !important;
  min-height: 0 !important;
}

#roleModal .role-main {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) 92px !important;
  grid-template-rows: minmax(0, 1fr) !important;
  gap: 12px !important;
  align-items: stretch !important;
  min-width: 0 !important;
  min-height: 0 !important;
  height: 100% !important;
}

#roleModal #rolePanelArea {
  grid-column: 1 !important;
  grid-row: 1 !important;
  min-width: 0 !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  padding-right: 6px !important;
  scrollbar-width: thin !important;
  scrollbar-color: #c2b294 #f4ecda !important;
}

#roleModal .role-tabs {
  grid-column: 2 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  gap: 8px !important;
  width: 100% !important;
  height: auto !important;
  align-self: start !important;
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}

#roleModal .role-tabs .role-tab {
  flex: 0 0 auto !important;
  width: 100% !important;
  padding: 12px 6px !important;
  font-size: 14px !important;
  line-height: 1.2 !important;
  border-radius: var(--r-md) !important;
  writing-mode: horizontal-tb !important;
  text-align: center !important;
  box-sizing: border-box !important;
}

/* 信息 8 格：两列自适应，把下方空白吃掉 */
#roleModal .role-info-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(74px, 1fr) !important;
  gap: 10px !important;
  height: 100% !important;
  align-content: stretch !important;
}

/* 道具：每行 5 格 */
#roleModal .role-item-grid {
  display: grid !important;
  grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
  gap: 8px !important;
}

#roleModal #rolePanelArea::-webkit-scrollbar {
  width: 9px !important;
}

#roleModal #rolePanelArea::-webkit-scrollbar-track {
  background: #f4ecda !important;
  border-radius: 5px !important;
}

#roleModal #rolePanelArea::-webkit-scrollbar-thumb {
  background: #c2b294 !important;
  border-radius: 5px !important;
  border: 2px solid #f4ecda !important;
}


/* ---------------- V26 角色弹窗页签对比度 + 道具四列 ---------------- */
/* 竖排页签选中态强制可见（白字必须配绿底，否则白底白字看不见） */
#roleModal .role-tabs .role-tab.active,
#roleModal .role-tabs .role-tab.active:hover,
#roleModal .role-tabs .role-tab.active:focus {
  background: var(--green) !important;
  border-color: var(--green-deep) !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

#roleModal .role-tabs .role-tab:not(.active) {
  background: #fffdf6 !important;
  color: #5b4630 !important;
}

#roleModal .role-tabs .role-tab:not(.active):hover {
  background: #fff6e2 !important;
  color: #5b4630 !important;
}

/* 每个场景固定 4 个道具，改成 4 列，格子更宽也不空位 */
#roleModal .role-item-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  gap: 10px !important;
}

#roleModal .role-item-cell {
  padding: 10px 8px !important;
  box-sizing: border-box !important;
}

/* ---------------- V27 大世界铺满 / 场景去白边 / 提示条透明 ---------------- */
/* 1) 场景页底部那条米白：底栏真实高度只有 48px，旧 calc(100vh - 112px) 多留了 64px */
#sceneView .scene-inner-panel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  margin: 0 !important;
}
#sceneView .scene-atmosphere {
  height: calc(100vh - 50px) !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
#sceneView .scene-stage,
#sceneView .scene-atmosphere .scene-stage {
  border-radius: 0 !important;
}
#sceneView .scene-stage-bg {
  object-fit: cover;
}

/* 2) 大世界：地图按高度撑满，左右空档用天空渐变接过去，看起来是一整张图 */
#worldView .scene-grid.map-mode,
.app-grid.is-student #sceneGrid.map-mode {
  padding: 0 !important;
  overflow: hidden;
  background: radial-gradient(115% 95% at 50% 38%, #d8effb 0%, #b6e2f6 42%, #93d1ea 72%, #7cc4e2 100%);
}
#sceneGrid .continent {
  flex: 0 0 auto;
  max-width: none !important;
  max-height: none !important;
  /* 宽屏：按高度放大 1.16 倍，左右留白压到最小；窄屏：按宽度铺满，不横向溢出 */
  width: min(100%, calc((100vh - 48px) * 16 / 9 * 1.16)) !important;
  height: auto !important;
  aspect-ratio: 16 / 9;
  border-radius: 0 !important;
  box-shadow: none !important;
  margin: 0 auto;
}
#sceneGrid .continent-bg {
  object-fit: cover;
  object-position: center;
}

/* 3) 全局提示条：透明底 + 黑字 + 白描边，浮在画面上不占布局 */
#resultMessage,
#resultMessage.global-result {
  position: fixed !important;
  top: 74px !important;
  left: 50% !important;
  right: auto !important;
  bottom: auto !important;
  transform: translateX(-50%) !important;
  z-index: 60 !important;
  pointer-events: none !important;
  max-width: 82vw;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #14120d !important;
  font-weight: 800 !important;
  padding: 2px 8px !important;
  text-align: center;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.95), 0 0 10px rgba(255, 255, 255, 0.8), 0 0 18px rgba(255, 255, 255, 0.6);
}
/* 没内容时彻底不占位，避免底部露出一条米白 */
#resultMessage:empty {
  display: none !important;
}
#resultMessage.warning {
  color: #8a2b12 !important;
}

/* 覆盖 V16「场景视图里把提示条压到底部 132px」的规则：
   同权重 + 后出现，提示条统一浮在顶部，不再压住底部道具区 */
.game-main:has(#sceneView:not([hidden])) #resultMessage,
.game-main:has(#sceneView:not([hidden])) .global-result {
  top: 76px !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  margin: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #14120d !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.85);
}
.game-main:has(#sceneView:not([hidden])) #resultMessage:empty {
  display: none !important;
}

/* 4) 场景内提示条同样透明化 */
#sceneResult,
#sceneResult.result-message {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  color: #14120d !important;
  font-weight: 800 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.95), 0 0 10px rgba(255, 255, 255, 0.8);
}

/* 覆盖旧规则 #sceneView #sceneResult（两个 id + !important，权重高于 #sceneResult）：
   同权重 + 后出现，把米黄胶囊换成透明黑字，并移到画面偏上，不压底部道具区 */
#sceneView #sceneResult {
  top: 96px !important;
  bottom: auto !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: max-content !important;
  max-width: 92% !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  margin: 0 !important;
  padding: 2px 10px !important;
  border: none !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #14120d !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  text-align: center;
  z-index: 9 !important;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 3px rgba(255, 255, 255, 0.95), 0 0 12px rgba(255, 255, 255, 0.85);
}
#sceneView #sceneResult:empty {
  display: none !important;
}

/* ================= V28 洛克贝货币体系 ================= */
.store-tabs {
  display: flex;
  gap: 8px;
  padding: 2px 18px 0;
}

.fashion-shop-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0 10px;
}

.fashion-shop-card {
  background: #fff;
  border: 2px solid #e6e0d3;
  border-radius: 14px;
  padding: 18px 10px;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .08);
}

.fashion-shop-card.is-locked {
  opacity: .62;
  filter: grayscale(.35);
}

.fashion-shop-icon {
  font-size: 30px;
  line-height: 1;
}

.fashion-shop-name {
  margin-top: 8px;
  font-weight: 800;
  color: #3c3830;
  font-size: 14px;
}

.fashion-shop-tag {
  margin-top: 4px;
  font-size: 12px;
  color: #9a8f7c;
}

.shop-note {
  text-align: center;
  color: #7d7466;
  font-size: 13px;
  margin: 6px 0 2px;
}

/* ================= 时装系统：衣柜 + 商店 ================= */
.fashion-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
  margin: 14px 0 10px;
}

.fashion-shop-card {
  background: #fff;
  border: 2px solid #e6e0d3;
  border-radius: 14px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.fashion-shop-card.is-owned {
  border-color: #8fbf6b;
  background: #fbfff5;
}

.fashion-shop-icon {
  width: 100%;
  height: 152px;
  background: linear-gradient(180deg, #fdf6e3, #f2ead6);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fashion-shop-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.fashion-shop-name {
  margin-top: 4px;
  font-weight: 800;
  color: #3c3830;
  font-size: 14px;
}

.fashion-shop-tag {
  font-size: 12px;
  color: #9a8f7c;
}

.fashion-shop-intro {
  font-size: 11px;
  line-height: 1.4;
  color: #8a8171;
  margin: 2px 0 4px;
  min-height: 30px;
}

.fashion-shop-btns {
  display: flex;
  flex-direction: column;
  gap: 5px;
  width: 100%;
  margin-top: auto;
}

.fashion-buy-bell,
.fashion-buy-item,
.fashion-wear-btn {
  width: 100%;
  border: 0;
  border-radius: 9px;
  padding: 7px 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
}

.fashion-buy-bell {
  background: #5b9bd5;
}

.fashion-buy-item {
  background: #7cae5c;
}

.fashion-wear-btn {
  background: #d9a441;
  margin-top: auto;
}

.fashion-wear-btn.is-on {
  background: #e8e2d2;
  color: #8a8171;
  cursor: default;
}

.fashion-buy-bell:disabled,
.fashion-buy-item:disabled {
  background: #ddd6c7;
  color: #a89f8d;
  cursor: not-allowed;
}

#roleModal .role-layout.is-clothes {
  grid-template-columns: 132px minmax(0, 1fr) !important;
}

#roleModal .role-layout.is-clothes .role-portrait-frame {
  min-height: 0 !important;
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)) !important;
  gap: 8px;
}

/* 角色弹窗 · 衣柜 */
.role-clothes-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 2px 8px;
  border-bottom: 1px solid #ece5d6;
  margin-bottom: 10px;
}

.role-clothes-head strong {
  font-size: 15px;
  color: #3c3830;
}

.role-clothes-head span {
  font-size: 12px;
  color: #9a8f7c;
}

.outfit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 9px;
}

.outfit-card {
  border: 2px solid #e6e0d3;
  border-radius: 11px;
  background: #fff;
  padding: 6px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  transition: transform .12s ease, border-color .12s ease;
}

.outfit-card:hover {
  transform: translateY(-2px);
  border-color: #d9a441;
}

.outfit-card.is-wearing {
  border-color: #d9a441;
  background: #fff8e6;
  box-shadow: 0 0 0 2px rgba(217, 164, 65, .25);
}

.outfit-card.is-locked {
  opacity: .55;
  filter: grayscale(.5);
}

.outfit-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: contain;
  background: linear-gradient(180deg, #fdf6e3, #f5efe2);
  border-radius: 8px;
}

.outfit-name {
  font-size: 12px;
  font-weight: 800;
  color: #3c3830;
  line-height: 1.2;
  text-align: center;
}

.outfit-tag {
  font-size: 10px;
  color: #9a8f7c;
}

.outfit-card.is-wearing .outfit-tag {
  color: #b07d1c;
  font-weight: 700;
}

.role-clothes-note {
  margin: 10px 0 2px;
  font-size: 12px;
  line-height: 1.5;
  color: #8a8171;
}
/* ================= V29 老师后台：名单 + 详情 ================= */
.teacher-select-hidden {
  display: none !important;
}

.teacher-roster-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.teacher-roster-head h3 {
  margin: 0;
  font-size: 15px;
  color: #2f2c26;
}

#teacherRosterSearch {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid #d8d2c4;
  background: #fff;
  font-size: 13px;
}

.teacher-roster {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.teacher-roster-chip {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 10px;
  border: 2px solid #ddd6c6;
  background: #fff;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s;
}

.teacher-roster-chip:hover {
  border-color: #9fd0ab;
}

.teacher-roster-chip.active {
  border-color: #3f9d62;
  background: #eef8ef;
}

.teacher-roster-name {
  font-weight: 800;
  font-size: 13px;
  color: #2f2c26;
}

.teacher-roster-bell {
  font-size: 12px;
  color: #8a7f6b;
}

.teacher-detail {
  border-top: 1px solid #e6e0d2;
  padding-top: 10px;
  margin-bottom: 10px;
}

.teacher-detail-info {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.teacher-info-cell {
  background: #fff;
  border: 1px solid #e6e0d2;
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.teacher-info-key {
  font-size: 11px;
  color: #8a7f6b;
}

.teacher-info-value {
  font-weight: 800;
  color: #2f2c26;
  font-size: 14px;
}

.teacher-item-section {
  margin-bottom: 10px;
}

.teacher-item-section h4 {
  margin: 0 0 6px;
  font-size: 13px;
  color: #5a5346;
}

.teacher-item-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(158px, 1fr));
  gap: 6px;
}

.teacher-item-row {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 1px solid #e6e0d2;
  border-radius: 8px;
  padding: 4px 6px;
}

.teacher-item-name {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  color: #3c3830;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.teacher-item-count {
  font-size: 12px;
  font-weight: 800;
  color: #4a4436;
}

.teacher-item-btn {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1px solid #cfc7b5;
  background: #f7f3e8;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.teacher-item-btn.plus {
  background: #e7f6ea;
  border-color: #9fd0ab;
}

.teacher-item-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
}

.teacher-detail-empty,
.teacher-roster-empty {
  color: #8a7f6b;
  font-size: 13px;
  margin: 6px 0;
}

/* ================= 老师模式：纯后台界面 ================= */
body.is-teacher-mode .app-grid {
  display: block !important;
}

body.is-teacher-mode .app-grid > .panel.profile-panel,
body.is-teacher-mode .app-grid > .game-area {
  display: none !important;
}

body.is-teacher-mode .teacher-panel {
  display: block !important;
  width: 100% !important;
  max-width: none !important;
  min-height: 100vh;
  margin: 0 !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  background: #fbf7ec;
  padding: 24px 28px 48px;
}

body.is-teacher-mode .app-shell .topbar {
  display: none !important;
}

body.is-teacher-mode .teacher-panel #teacherRoster,
body.is-teacher-mode .teacher-panel .teacher-detail {
  max-width: 1180px;
}

body.is-teacher-mode .teacher-panel #teacherTitle {
  font-size: 22px;
}
/* 后台道具行：图标 + 名称，整体不超出面板 */
body.is-teacher-mode .teacher-panel *,
.teacher-panel * {
  box-sizing: border-box;
}

#teacherRoster,
.teacher-item-list,
.teacher-detail,
.teacher-detail-info {
  width: 100%;
  max-width: 100%;
}

.teacher-roster {
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
}

.teacher-item-list {
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
}

.teacher-item-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  margin-right: 4px;
  vertical-align: middle;
  flex: 0 0 auto;
}

.teacher-item-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.teacher-item-label {
  vertical-align: middle;
}

.teacher-item-name {
  display: flex;
  align-items: center;
}
body.is-teacher-mode .app-shell {
  padding: 0 !important;
  max-width: none !important;
}

body.is-teacher-mode .teacher-panel {
  box-sizing: border-box !important;
  overflow-x: hidden;
}

body.is-teacher-mode .teacher-panel .panel-heading,
body.is-teacher-mode .teacher-panel .teacher-roster-head {
  max-width: 100%;
}

.teacher-item-list {
  grid-template-columns: repeat(auto-fill, minmax(166px, 1fr));
}

.teacher-item-label {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.teacher-controls {
  min-width: 0;
}

.teacher-controls > * {
  min-width: 0;
  max-width: 100%;
}

.teacher-detail,
.teacher-detail-info,
.teacher-item-section,
.teacher-item-list,
.teacher-roster,
.teacher-roster-head {
  min-width: 0;
  max-width: 100%;
}

.teacher-item-row {
  min-width: 0;
}
/* ---- 市场：卖家自己定价 ---- */
.sell-card { cursor: pointer; }
.sell-card.is-editing { cursor: default; }
.sell-price-form { display: flex; flex-direction: column; gap: 6px; width: 100%; padding: 4px 2px; }
.sell-price-title { font-size: 13px; color: #3f2f1c; }
.sell-price-tip { font-size: 11px; color: #8a7452; }
.sell-price-row { display: flex; gap: 6px; align-items: center; }
.sell-price-input {
  width: 92px; padding: 6px 8px; font-size: 15px; color: #3f2f1c;
  border: 2px solid #e6d9bd; border-radius: 8px; background: #fff;
}
.sell-price-ok {
  padding: 6px 12px; font-size: 13px; font-weight: 800; color: #fff;
  background: #f0a832; border: none; border-radius: 8px;
  box-shadow: 0 3px 0 #cf8a1c; cursor: pointer;
}
.sell-price-cancel {
  padding: 6px 10px; font-size: 13px; color: #7a6a50;
  background: #f3ede0; border: 2px solid #e0d8c6; border-radius: 8px; cursor: pointer;
}
/* ===== 排行榜四个榜单 tab 适配（战力 / 经验 / 财富 / 时装） ===== */
.rank-tabs {
  flex-wrap: wrap;
}

.rank-tab {
  flex: 1 1 calc(25% - 8px);
  min-width: 64px;
  padding: 7px 4px;
  font-size: 0.82rem;
  white-space: nowrap;
}

.rank-value {
  font-variant-numeric: tabular-nums;
}
/* 四个榜单 tab 统一配色，避免继承到白字白底看不见 */
.rank-tabs .rank-tab {
  color: #4a3a22;
  background: #fffdf7;
  border-color: #e8dcc6;
}

.rank-tabs .rank-tab.active {
  color: #ffffff;
  background: linear-gradient(135deg, #ff9800, #ffb74d);
  border-color: #ff9800;
  font-weight: 600;
}
/* 榜单 tab 最终配色（用 :not(.active) + !important 兜住，避免别处的规则把非激活态染成白字白底） */
#rankModal .rank-tab:not(.active),
#rankView .rank-tab:not(.active) {
  color: #4a3a22 !important;
  background: #fffdf7 !important;
  background-image: none !important;
  border-color: #e8dcc6 !important;
}

#rankModal .rank-tab.active,
#rankView .rank-tab.active {
  color: #ffffff !important;
  background: linear-gradient(135deg, #ff9800, #ffb74d) !important;
  border-color: #ff9800 !important;
}
/* ===== 排行榜点赞区 ===== */
.rank-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex: 0 0 auto;
  margin-left: 8px;
}

.rank-liked {
  font-size: 0.72rem;
  color: #8a6a3a;
  white-space: nowrap;
}

.rank-like-btn {
  border: 1px solid #ffb74d;
  background: #fff8e8;
  color: #b26a00;
  border-radius: 8px;
  padding: 2px 8px;
  font-size: 0.72rem;
  line-height: 1.4;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s;
}

.rank-like-btn:hover:not(:disabled) {
  background: #ffe9c2;
}

.rank-like-btn:disabled {
  opacity: 0.5;
  cursor: default;
}

#rankModal .rank-value,
#rankView .rank-value {
  font-size: 0.88rem;
}

#rankModal .rank-item,
#rankView .rank-item {
  gap: 6px;
}

/* 角色面板"被赞"这一格稍微醒目一点 */
#roleLikedValue {
  color: #d17b00;
}
/* 榜单右侧点赞区收窄一点，别把战力数字挤歪 */
#rankModal .rank-value, #rankView .rank-value { margin-right: 4px; }
#rankModal .rank-actions, #rankView .rank-actions { min-width: 58px; flex-shrink: 0; }
/* 排行榜点赞说明条 */
.rank-like-tip {
  font-size: 0.72rem;
  color: #8a7355;
  background: #fff8e8;
  border: 1px dashed #f0d0a0;
  border-radius: 8px;
  padding: 5px 8px;
  margin: 0 0 6px;
  line-height: 1.35;
}
.rank-like-btn { padding: 3px 10px; }
#rankModal .rank-item, #rankView .rank-item { padding-right: 10px; }
#rankModal .rank-actions, #rankView .rank-actions { gap: 3px; }
/* 被赞数 + 点赞按钮改成同一行，省高度不挤 */
#rankModal .rank-actions, #rankView .rank-actions {
  flex-direction: row;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
}
/* 副标题别换行，挤了就用省略号 */
#rankModal .rank-sub, #rankView .rank-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.7rem; }
#rankModal .rank-info, #rankView .rank-info { min-width: 0; flex: 1 1 auto; }
#rankModal .rank-value, #rankView .rank-value { white-space: nowrap; flex-shrink: 0; }
/* 角色信息格：加了"被赞"这一行后格子更挤，字号收一点、允许换行，别再显示成"引…" */
#roleModal .role-info-item { padding: 6px 7px !important; gap: 3px !important; }
#roleModal .role-info-key { font-size: 11px !important; }
#roleModal .role-info-value {
  font-size: 12px !important;
  line-height: 1.25 !important;
  white-space: normal !important;
  overflow: visible !important;
  overflow-wrap: anywhere !important;
  text-overflow: clip !important;
}
/* 信息格行高收一点，让"被赞"这一行不用滚动也能看到 */
#roleModal .role-info-grid {
  grid-auto-rows: minmax(56px, auto) !important;
  gap: 8px !important;
}
/* 再收一点，让下面两个一次性按钮也露出来 */
#roleModal .role-info-grid { grid-auto-rows: minmax(50px, auto) !important; gap: 7px !important; }
#roleModal .role-info-pane { gap: 7px !important; }
/* 信息格改三列，8 格刚好三行，下面两个按钮能完整露出来 */
#roleModal .role-info-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(48px, auto) !important;
  gap: 7px !important;
}
/* 三列太窄，回到两列；按钮文字缩短后一行就能放下 */
#roleModal .role-info-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-rows: minmax(50px, auto) !important;
  gap: 7px !important;
}
#roleModal .role-actions button {
  font-size: 12px !important;
  padding: 6px 4px !important;
  min-height: 34px !important;
  white-space: nowrap !important;
}
/* 信息页不要再出横向滚动条 */
#roleModal #rolePanelArea { overflow-x: hidden !important; }
#roleModal .role-actions button { overflow: hidden; text-overflow: ellipsis; }
/* 两个一次性按钮等宽两列，文字不会被切 */
#roleModal .role-actions {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 6px !important;
  width: 100% !important;
}
/* ===== 多人可见 · 同伴图层 ===== */
.peer-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 6;
}

.peer-avatar {
  position: absolute;
  height: 20%;
  transform: translate(-50%, -100%);
  pointer-events: none;
  transition: left 0.3s linear, top 0.3s linear;
  will-change: left, top;
}

.peer-avatar.is-map {
  height: 78px;
  width: 46px;
}

.peer-avatar.is-teleport {
  transition: none;
}

.peer-avatar.is-leaving {
  opacity: 0.4;
  transition: opacity 0.2s linear;
}

.peer-avatar .peer-sprite {
  height: 100%;
  width: auto;
  display: block;
  filter: drop-shadow(0 5px 7px rgba(0, 0, 0, 0.32));
}

.peer-avatar.is-map .peer-sprite {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.peer-avatar .peer-pet {
  position: absolute;
  height: 34%;
  left: -30%;
  top: 60%;
  pointer-events: none;
  filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}

.peer-name {
  position: absolute;
  left: 50%;
  bottom: 100%;
  transform: translateX(-50%);
  margin-bottom: 2px;
  padding: 1px 7px;
  font-size: 11px;
  line-height: 1.5;
  color: #fff7e2;
  background: rgba(46, 32, 18, 0.82);
  border: 1px solid rgba(255, 232, 190, 0.55);
  border-radius: 6px;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
/* 点赞奖励提示：中间弹一下「恭喜获得」，1 秒后自己淡出 */
.coin-gain {
  position: fixed;
  left: 50%;
  top: 40%;
  transform: translate(-50%, -50%) scale(0.88);
  z-index: 10050;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 14px 30px 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, #fffaf0, #ffe9bd);
  border: 2px solid rgba(201, 141, 44, 0.85);
  box-shadow: 0 12px 30px rgba(46, 32, 18, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  pointer-events: none;
  opacity: 0;
  animation: coinGainIn 0.24s ease-out forwards;
}

.coin-gain-title {
  font-size: 15px;
  font-weight: 700;
  color: #8a5a1a;
  letter-spacing: 0.5px;
}

.coin-gain-amount {
  font-size: 28px;
  font-weight: 900;
  color: #d97706;
  line-height: 1.15;
  text-shadow: 0 1px 0 #fff;
}

.coin-gain-total {
  font-size: 12px;
  color: #9a7a4a;
}

.coin-gain.is-out {
  animation: coinGainOut 0.3s ease-in forwards;
}

@keyframes coinGainIn {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.88); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

@keyframes coinGainOut {
  from { opacity: 1; transform: translate(-50%, -50%) scale(1); }
  to   { opacity: 0; transform: translate(-50%, -62%) scale(0.96); }
}
/* 探索点悬停小面板：野生等级 / 遇敌概率 / 道具概率 */
.spot-tip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 9px);
  transform: translate(-50%, 0);
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 8px 11px;
  border-radius: 10px;
  background: rgba(28, 22, 14, 0.92);
  border: 1px solid rgba(255, 220, 160, 0.5);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
  color: #ffe8be;
  font-size: 12px;
  line-height: 1.3;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 60;
}

.spot-tip::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: rgba(28, 22, 14, 0.92);
}

.spot-tip.is-below {
  top: calc(100% + 9px);
  bottom: auto;
}

.spot-tip.is-below::after {
  top: auto;
  bottom: 100%;
  border-top-color: transparent;
  border-bottom-color: rgba(28, 22, 14, 0.92);
}

.stage-spot:hover .spot-tip,
.stage-spot:focus-visible .spot-tip {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

.spot-tip-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.spot-tip-icon {
  font-size: 12px;
}

.spot-tip-text {
  font-weight: 600;
  letter-spacing: 0.2px;
}
/* 左右边缘的探索点：面板向内对齐，避免被舞台裁切 */
.spot-tip.is-left {
  left: -4px;
  transform: translate(0, 0);
}

.spot-tip.is-right {
  left: auto;
  right: -4px;
  transform: translate(0, 0);
}

.spot-tip.is-left::after {
  left: 26px;
}

.spot-tip.is-right::after {
  left: auto;
  right: 26px;
  transform: none;
}

.stage-spot:hover .spot-tip.is-left,
.stage-spot:focus-visible .spot-tip.is-left,
.stage-spot:hover .spot-tip.is-right,
.stage-spot:focus-visible .spot-tip.is-right {
  transform: translate(0, 0);
}

/* ---------------- 登录三角色外壳（学生 / 家长 / 老师） ---------------- */
/* 三个 tab 挤在 340px 卡片里，字缩一点、别换行 */
/* 学生登录后的选择页：卡片内容换成「你好 + 两个按钮」 */
#studentLanding {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: stretch;
}

/* 学习台按钮走"次要按钮"：白底绿字，视觉上比开始游戏轻一档 */
/* 行内提示：不弹 alert，只在卡片里露一行字 */
/* 切换账号做成文字链接，不抢按钮位置 */
.login-link {
  background: none;
  border: none;
  padding: 4px 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
  text-decoration: underline;
  cursor: pointer;
}

/* 顶栏右侧：学习台按钮 + 存档状态 */
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}



.topbar-home {
  min-height: 34px;
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: var(--r-pill);
  background: var(--surface-hi);
  color: var(--green-deep);
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: 0 2px 0 #d8c8ab;
  cursor: pointer;
  white-space: nowrap;
}

.topbar-home:hover {
  background: #f6f1e4;
}

.topbar-home:active {
  transform: translateY(2px);
  box-shadow: none;
}


/* ===== v20261125 窄屏弹窗修复 ===== */
.rank-modal {
  width: min(420px, calc(100vw - 24px));
  max-width: min(520px, calc(100vw - 24px));
}

.wuxing-notice-modal {
  position: relative;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.wuxing-notice-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 30px;
  height: 30px;
  border: 1px solid rgba(255, 215, 90, .55);
  border-radius: 50%;
  background: rgba(0, 0, 0, .24);
  color: #ffd75e;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.battle-modal {
  max-height: calc(100dvh - 16px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

@media (max-height: 560px) {
  .wuxing-notice-modal {
    padding: 12px 16px 10px;
  }
  .wuxing-notice-kicker {
    font-size: 10px;
    padding: 2px 9px;
    margin-bottom: 6px;
  }
  .wuxing-notice-title {
    margin-bottom: 4px;
    font-size: 20px;
  }
  .wuxing-notice-desc {
    margin-bottom: 6px;
    font-size: 12px;
    line-height: 1.5;
  }
  .wuxing-notice-pets {
    gap: 4px;
    margin: 2px 0 6px;
  }
  .wuxing-notice-pet {
    padding: 3px 2px 2px;
  }
  .wuxing-notice-pet img {
    height: 54px;
    width: auto;
    max-width: 100%;
    aspect-ratio: auto;
    margin: 0 auto;
  }
  .wuxing-notice-pet figcaption {
    font-size: 10px;
  }
  .wuxing-notice-tip {
    margin: 0 0 6px;
    font-size: 11px;
    line-height: 1.4;
  }
  .wuxing-notice-actions {
    gap: 6px;
  }
  .wuxing-btn {
    padding: 7px 10px;
    font-size: 12px;
  }

  .battle-modal {
    padding: 10px 12px;
  }
  .battle-header {
    margin-bottom: 4px;
  }
  .battle-header strong {
    font-size: 1rem;
  }
  .battle-stage {
    min-height: 112px;
    padding: 6px 8px;
    margin-bottom: 4px;
  }
  .battle-sprite-wrap,
  .battle-sprite {
    width: 54px;
    height: 54px;
  }
  .battle-log {
    max-height: 36px;
    font-size: 11px;
    line-height: 1.35;
    padding: 4px 6px;
  }
  .battle-result {
    font-size: 12px;
  }
}

.wuxing-notice-overlay {
  z-index: 1200;
  background: radial-gradient(900px 600px at 50% 20%, rgba(60, 46, 12, .85) 0%, rgba(6, 9, 16, .92) 70%);
  backdrop-filter: blur(3px);
}

.wuxing-notice-modal {
  width: min(94vw, 660px);
  max-width: 660px;
  padding: 26px 26px 22px;
  border: 2px solid #ffd75e;
  border-radius: 18px;
  background: linear-gradient(180deg, #1b2334 0%, #0d121b 100%);
  color: #eaf0f8;
  text-align: center;
  box-shadow: 0 0 34px rgba(255, 215, 90, .35), inset 0 0 40px rgba(255, 215, 90, .06);
}

.wuxing-notice-kicker {
  display: inline-block;
  font-size: 12px;
  letter-spacing: 2px;
  color: #ffd75e;
  border: 1px solid rgba(255, 215, 90, .55);
  border-radius: 999px;
  padding: 3px 12px;
  margin-bottom: 12px;
}

.wuxing-notice-title {
  margin: 0 0 10px;
  font-size: 26px;
  letter-spacing: 4px;
  color: #ffd75e;
  text-shadow: 0 0 18px rgba(255, 215, 90, .45);
}

.wuxing-notice-desc {
  margin: 0 auto 16px;
  max-width: 520px;
  font-size: 14px;
  line-height: 1.85;
  color: #c8d3e4;
}

.wuxing-notice-desc b { color: #ffd75e; }

.wuxing-notice-pets {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin: 6px 0 16px;
}

.wuxing-notice-pet {
  margin: 0;
  padding: 6px 4px 4px;
  border: 1px solid var(--wx-color, #ffd75e);
  border-radius: 12px;
  background: radial-gradient(circle at 50% 55%, rgba(255, 215, 90, .12), rgba(0, 0, 0, 0) 70%);
}

.wuxing-notice-pet img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
}

.wuxing-notice-pet figcaption {
  font-size: 11.5px;
  color: #dbe5f2;
  white-space: nowrap;
}

.wuxing-notice-pet figcaption span {
  display: inline-block;
  margin-right: 4px;
  padding: 0 5px;
  border-radius: 6px;
  background: var(--wx-color, #ffd75e);
  color: #2b2110;
  font-weight: 700;
}

.wuxing-notice-tip {
  margin: 0 0 18px;
  font-size: 13px;
  color: #ffd75e;
}

.wuxing-notice-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

@media (max-width: 560px) {
  .wuxing-notice-pets {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.wuxing-btn {
  border: 0;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 10px 22px;
  border-radius: 999px;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.wuxing-btn.primary {
  background: linear-gradient(135deg, #ffe07a, #ffb340);
  color: #3a2a10;
  box-shadow: 0 6px 18px rgba(255, 179, 64, .35);
}

.wuxing-btn.primary:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(255, 179, 64, .45); }

.wuxing-btn.ghost {
  background: rgba(255, 255, 255, .08);
  color: #eaf0f8;
  border: 1px solid rgba(255, 255, 255, .25);
}

.wuxing-btn.ghost:hover { background: rgba(255, 255, 255, .16); }

/* 首页：站点说明 + 备案号占位 */
.icp{margin:10px 0 0;font-size:12px;color:#9aa3b2;text-align:center}
.icp a{color:#9aa3b2;text-decoration:none}
.icp a:hover{color:#4a5266}

/* 矮屏（360×640 等）：捕捉弹窗限高并允许内部滚动，保证关闭按钮可见 */
@media (max-height: 700px) {
  #captureModal {
    align-items: flex-start;
    overflow-y: auto;
    padding: 12px 0;
  }
  #captureModal .capture-modal {
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    margin: 0 auto;
  }
}
/* v20261125 矮屏压缩：覆盖前面基础样式 */
@media (max-height: 560px) {
  .wuxing-notice-modal { padding: 12px 16px 10px; }
  .wuxing-notice-kicker { font-size: 10px; padding: 2px 9px; margin-bottom: 6px; }
  .wuxing-notice-title { margin-bottom: 4px; font-size: 20px; }
  .wuxing-notice-desc { margin-bottom: 6px; font-size: 12px; line-height: 1.5; }
  .wuxing-notice-pets { gap: 4px; margin: 2px 0 6px; }
  .wuxing-notice-pet { padding: 3px 2px 2px; }
  .wuxing-notice-pet img { height: 54px; width: auto; max-width: 100%; aspect-ratio: auto; margin: 0 auto; }
  .wuxing-notice-pet figcaption { font-size: 10px; }
  .wuxing-notice-tip { margin: 0 0 6px; font-size: 11px; line-height: 1.4; }
  .wuxing-notice-actions { gap: 6px; }
  .wuxing-btn { padding: 7px 10px; font-size: 12px; }
  .battle-modal { padding: 10px 12px; }
  .battle-header { margin-bottom: 4px; }
  .battle-header strong { font-size: 1rem; }
  .battle-stage { min-height: 112px; padding: 6px 8px; margin-bottom: 4px; }
  .battle-sprite-wrap, .battle-sprite { width: 54px; height: 54px; }
  .battle-log { max-height: 36px; font-size: 11px; line-height: 1.35; padding: 4px 6px; }
  .battle-result { font-size: 12px; }
}

/* ===== 第一批扩展玩法：今日委托 ===== */
.daily-quest-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  box-sizing: border-box;
}
.daily-quest-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #e6d7bd;
  border-radius: 12px;
  background: #fffaf0;
}
.daily-quest-head h4 {
  margin: 0;
  font-size: 16px;
  color: #3f2f1c;
}
.daily-quest-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: #8b7355;
}
.daily-quest-week {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1e4cc;
  color: #7a5c36;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.daily-quest-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.daily-quest-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  padding: 9px 10px;
  border: 2px solid #e6d7bd;
  border-radius: 12px;
  background: #fffdf7;
  box-sizing: border-box;
}
.daily-quest-row.is-ready {
  border-color: #78a95c;
  background: #f8fff1;
}
.daily-quest-row.is-claimed {
  opacity: .72;
  background: #f6f2e8;
}
.daily-quest-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #f7ead3;
  font-size: 18px;
}
.daily-quest-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.daily-quest-main strong {
  font-size: 13.5px;
  color: #3f2f1c;
}
.daily-quest-main span {
  font-size: 11.5px;
  line-height: 1.35;
  color: #8b7355;
}
.daily-quest-bar {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #efe3cf;
}
.daily-quest-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #9bc47a, #5f9a46);
}
.daily-quest-claim {
  min-width: 58px;
  min-height: 34px;
  padding: 7px 9px;
  border: 2px solid #c9b294;
  border-radius: 999px;
  background: #fffdf6;
  color: #5b4630;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}
.daily-quest-claim:not(:disabled) {
  border-color: #5f9a46;
  background: #6da951;
  color: #fff;
  box-shadow: 0 2px 0 #4b7d36;
}
.daily-quest-claim:disabled {
  opacity: .6;
  cursor: not-allowed;
}
.daily-quest-foot {
  margin: 0;
  padding: 2px 2px 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #8b7355;
}

/* ===== 第一批扩展玩法：场景首领 ===== */
.scene-boss-chip {
  position: absolute;
  right: 18px;
  top: 84px;
  bottom: auto;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 366px;
  max-width: min(44%, 372px);
  padding: 12px 16px 13px 12px;
  border: 3px solid #ffd166;
  border-radius: 18px;
  background: linear-gradient(158deg, rgba(74, 48, 18, .96), rgba(30, 20, 9, .94));
  color: #fff6dc;
  font-family: inherit;
  text-align: left;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 1px rgba(255, 226, 150, .35) inset;
  animation: bossCardPulse 2.8s ease-in-out infinite;
}
.scene-boss-chip:hover:not(:disabled) {
  filter: brightness(1.1);
}
.scene-boss-chip:disabled {
  cursor: not-allowed;
}
.scene-boss-chip.is-locked,
.scene-boss-chip.is-used {
  border-color: rgba(255, 226, 150, .55);
  background: linear-gradient(158deg, rgba(48, 42, 34, .92), rgba(26, 24, 20, .92));
  color: rgba(255, 255, 255, .8);
  cursor: not-allowed;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .32);
  animation: none;
}
.scene-boss-chip.is-locked {
  border-style: dashed;
}
.scene-boss-chip.is-locked .scene-boss-avatar {
  filter: grayscale(.72) brightness(.72);
}
@keyframes bossCardPulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(0, 0, 0, .45), 0 0 0 0 rgba(255, 209, 102, .55), 0 0 0 1px rgba(255, 226, 150, .35) inset; }
  50% { box-shadow: 0 12px 32px rgba(0, 0, 0, .5), 0 0 0 8px rgba(255, 209, 102, 0), 0 0 0 1px rgba(255, 226, 150, .55) inset; }
}
.scene-boss-avatar-wrap {
  position: relative;
  flex: 0 0 104px;
  width: 104px;
  height: 104px;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 62%, rgba(255, 224, 150, .4), rgba(120, 76, 22, .18) 70%);
  box-shadow: 0 0 0 2px rgba(255, 226, 150, .45) inset;
}
.scene-boss-avatar {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4));
}
.scene-boss-badge {
  position: absolute;
  left: -12px;
  top: -14px;
  padding: 3px 9px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffcf4d, #ff8a1f);
  color: #5a2600;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .5px;
  line-height: 1.5;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35);
  white-space: nowrap;
}
.scene-boss-chip.is-locked .scene-boss-badge {
  background: rgba(70, 62, 50, .92);
  color: #ffe7a8;
}
.scene-boss-lock {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(20, 18, 14, .92);
  color: #ffd66e;
  font-size: 16px;
  line-height: 32px;
  text-align: center;
  box-shadow: 0 3px 8px rgba(0, 0, 0, .4);
}
.scene-boss-lock[hidden] {
  display: none;
}
.scene-boss-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 3px;
  min-width: 0;
  flex: 1 1 auto;
}
.scene-boss-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  color: #ffd66e;
}
.scene-boss-name {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 19px;
  font-weight: 900;
  line-height: 1.25;
}
.scene-boss-status {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  color: #ffe9b6;
}
.scene-boss-cond {
  width: 100%;
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.4;
  color: #f7e7c6;
  white-space: normal;
}
.scene-boss-chip.is-locked .scene-boss-status,
.scene-boss-chip.is-used .scene-boss-status {
  color: rgba(255, 255, 255, .8);
}
.scene-boss-chip.is-locked .scene-boss-cond {
  color: #ffce7a;
}
.scene-boss-bar {
  display: block;
  width: 100%;
  height: 7px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .18);
  overflow: hidden;
}
.scene-boss-bar[hidden] {
  display: none;
}
.scene-boss-bar-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #ffb84d, #ffd166);
  transition: width .3s ease;
}
.scene-boss-chip.is-locked .scene-boss-bar-fill {
  background: linear-gradient(90deg, #b98b3c, #ffce7a);
}

/* ===== V23 底栏 7 入口 + 每周任务 + 邮件 ===== */
.dock-btn {
  width: auto;
  height: 36px;
  border-radius: var(--r-sm);
  border: 2px solid var(--line);
  background: var(--surface);
  box-shadow: 0 3px 0 #d8c8ab;
  display: flex;
  place-items: center;
  align-content: center;
  cursor: pointer;
  padding: 0 16px;
  font-family: inherit;
  transition: background 0.15s ease;
  min-width: 110px;
  color: var(--ink);
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding-block: 0;
  flex: 0 1 160px;
  max-width: 160px;
  transform: none !important;
  position: relative;
}

.dock-badge {
  position: absolute;
  top: -5px;
  right: -4px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  box-sizing: border-box;
  border-radius: 999px;
  background: #e25b4a;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  line-height: 17px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .35);
}

.dock-badge[hidden] {
  display: none;
}

/* 7 个入口均分整条底栏，不再使用旧的 104px 最小宽度 */
.dock-bar .dock-actions {
  flex: 1 1 auto !important;
  justify-content: center !important;
  gap: 8px !important;
}

.dock-bar .dock-btn {
  flex: 1 1 0 !important;
  max-width: 150px !important;
  min-width: 0 !important;
  padding: 0 10px !important;
  box-sizing: border-box;
}

/* 手机竖屏：7 个入口改成图标在上、文字在下，避免横向溢出 */
@media (max-width: 1180px) {
  /* 学习台已并入底栏按钮组，不再单独定位 */
}

@media (max-width: 700px) {
  .dock-bar {
    padding: 0 4px !important;
  }
  .dock-bar .dock-actions {
    gap: 2px !important;
    width: 100%;
  }
  .dock-bar .dock-btn {
    flex: 1 1 0 !important;
    max-width: none !important;
    min-width: 0 !important;
    height: 46px !important;
    padding: 0 1px !important;
    flex-direction: column !important;
    gap: 1px !important;
  }
  .dock-icon {
    font-size: 13px !important;
  }
  .dock-label {
    font-size: 9px !important;
    white-space: nowrap;
  }
  .dock-badge {
    top: -4px;
    right: -2px;
    min-width: 14px;
    height: 14px;
    font-size: 9px;
    line-height: 14px;
  }
  /* 学习台已并入底栏按钮组，不再单独定位 */
}

/* 任务 / 邮件独立弹窗 */
#questModal,
#mailModal {
  z-index: 9500;
}

.zone-modal-box.side-modal {
  width: min(560px, 94vw) !important;
  max-height: min(720px, 84vh);
}

.zone-modal-box.side-modal .side-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px 14px 6px !important;
}

.daily-quest-view > .daily-quest-head {
  flex: 0 0 auto;
}

.mail-view {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 100%;
  box-sizing: border-box;
}

.mail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border: 2px solid #e6d7bd;
  border-radius: 12px;
  background: #fffaf0;
}

.mail-head h4 {
  margin: 0;
  font-size: 16px;
  color: #3f2f1c;
}

.mail-head p {
  margin: 3px 0 0;
  font-size: 12px;
  line-height: 1.4;
  color: #8b7355;
}

.mail-claim-all {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 7px 11px;
  border: 2px solid #5f9a46;
  border-radius: 999px;
  background: #6da951;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 0 #4b7d36;
}

.mail-claim-all:disabled {
  border-color: #c9b294;
  background: #fffdf6;
  color: #8b7355;
  box-shadow: none;
  cursor: not-allowed;
}

.mail-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mail-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  grid-template-areas:
    "icon main action"
    "icon rewards action";
  align-items: center;
  gap: 6px 9px;
  padding: 9px 10px;
  border: 2px solid #e6d7bd;
  border-radius: 12px;
  background: #fffdf7;
  box-sizing: border-box;
}

.mail-card.is-unread {
  border-color: #d9b35c;
  background: #fffbf0;
}

.mail-card.is-claimed {
  opacity: .78;
}

.mail-icon {
  grid-area: icon;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: #f7ead3;
  font-size: 18px;
}

.mail-main {
  grid-area: main;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mail-title-row {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mail-title-row strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  color: #3f2f1c;
}

.mail-unread-dot {
  flex: 0 0 7px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e25b4a;
}

.mail-unread-dot[hidden] {
  display: none;
}

.mail-meta {
  font-size: 10.5px;
  color: #a08968;
}

.mail-body {
  margin: 2px 0 0;
  font-size: 11.5px;
  line-height: 1.45;
  color: #75624a;
}

.mail-rewards {
  grid-area: rewards;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.mail-rewards:empty {
  display: none;
}

.mail-chip {
  padding: 2px 7px;
  border: 1px solid #e0cbaa;
  border-radius: 999px;
  background: #fff5df;
  color: #7a5c36;
  font-size: 10.5px;
  line-height: 1.4;
  white-space: nowrap;
}

.mail-action {
  grid-area: action;
  align-self: center;
  display: flex;
  flex-direction: column;
}

.mail-claim {
  min-width: 56px;
  min-height: 32px;
  padding: 6px 8px;
  border: 2px solid #5f9a46;
  border-radius: 999px;
  background: #6da951;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  box-shadow: 0 2px 0 #4b7d36;
}

.mail-claim:disabled {
  border-color: #c9b294;
  background: #fffdf6;
  color: #8b7355;
  box-shadow: none;
  cursor: not-allowed;
}

.mail-empty {
  margin: 0;
  padding: 22px 10px;
  text-align: center;
  font-size: 13px;
  color: #8b7355;
}

@media (max-width: 700px) {
  .mail-head {
    flex-direction: column;
    gap: 7px;
  }
  .mail-claim-all {
    width: 100%;
  }
  .mail-card {
    grid-template-columns: 28px minmax(0, 1fr) 50px;
    gap: 5px 6px;
    padding: 7px;
  }
  .mail-icon {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .mail-title-row strong {
    font-size: 12.5px;
  }
  .mail-meta,
  .mail-chip {
    font-size: 10px;
  }
  .mail-body {
    font-size: 10.8px;
  }
  .mail-claim {
    min-width: 46px;
    min-height: 30px;
    padding: 5px 3px;
    font-size: 10.5px;
  }
}

@media (max-width: 700px) {
  #roleModal .zone-modal-box.role {
    width: calc(100vw - 12px) !important;
  }
  #roleModal .role-layout {
    grid-template-columns: 84px minmax(0, 1fr) !important;
    gap: 8px !important;
  }
  #roleModal .role-main {
    grid-template-columns: minmax(0, 1fr) 60px !important;
    gap: 8px !important;
  }
  #roleModal .role-tabs {
    gap: 6px !important;
  }
  #roleModal .role-tabs .role-tab {
    padding: 10px 3px !important;
    font-size: 12px !important;
  }
  #roleModal .role-portrait-frame {
    aspect-ratio: 3 / 4;
  }
  #roleModal .role-portrait-name {
    font-size: 12px;
  }
  #roleModal .role-info-grid {
    grid-template-columns: 1fr !important;
  }
  #roleModal .role-item-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .daily-quest-head {
    flex-direction: column;
    gap: 6px;
  }
  .daily-quest-week {
    white-space: normal;
  }
  .daily-quest-row {
    grid-template-columns: 28px minmax(0, 1fr) 52px;
    gap: 6px;
    padding: 7px;
    min-height: 52px;
  }
  .daily-quest-icon {
    width: 28px;
    height: 28px;
    font-size: 15px;
  }
  .daily-quest-claim {
    min-width: 48px;
    padding: 6px 4px;
    font-size: 11px;
  }
  .daily-quest-main strong {
    font-size: 12.5px;
  }
  .daily-quest-main span {
    font-size: 10.5px;
  }
  .scene-boss-chip {
    right: 6px;
    top: 42%;
    bottom: auto;
    transform: translateY(-50%);
    width: 158px;
    max-width: 158px;
    padding: 9px 7px 10px;
    gap: 5px;
    flex-direction: column;
    align-items: center;
    border-width: 2px;
    border-radius: 14px;
  }
  .scene-boss-avatar-wrap {
    flex-basis: 66px;
    width: 66px;
    height: 66px;
    border-radius: 12px;
  }
  .scene-boss-badge {
    left: -6px;
    top: -10px;
    padding: 2px 6px;
    font-size: 9px;
  }
  .scene-boss-copy {
    align-items: center;
    text-align: center;
    gap: 2px;
  }
  .scene-boss-name {
    max-width: 130px;
    min-height: 2.4em;
    white-space: normal;
    overflow: hidden;
    text-overflow: clip;
    font-size: 12px;
    line-height: 1.25;
  }
  .scene-boss-kicker {
    font-size: 9px;
    letter-spacing: .2px;
  }
  .scene-boss-status {
    max-width: 130px;
    font-size: 10px;
    line-height: 1.3;
  }
  .scene-boss-cond {
    max-width: 130px;
    font-size: 9.5px;
    line-height: 1.35;
  }
  .scene-boss-bar {
    height: 5px;
  }
  .scene-boss-lock {
    width: 24px;
    height: 24px;
    font-size: 13px;
    line-height: 24px;
  }
}

/* 手机竖屏：角色弹窗改为「头像条 + 横向页签 + 全宽内容」 */
@media (max-width: 560px) {
  #roleModal .role-layout,
  #roleModal .role-layout.is-clothes {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 7px !important;
  }
  #roleModal .role-portrait {
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;
  }
  #roleModal .role-portrait-frame {
    width: 58px !important;
    height: 76px !important;
    aspect-ratio: auto !important;
    flex: 0 0 auto !important;
  }
  #roleModal .role-portrait-name {
    font-size: 13px !important;
  }
  #roleModal .role-main {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto minmax(0, 1fr) !important;
    gap: 6px !important;
  }
  #roleModal .role-tabs {
    grid-column: 1 !important;
    grid-row: 1 !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 5px !important;
  }
  #roleModal .role-tabs .role-tab {
    flex: 1 1 calc(33.333% - 5px) !important;
    width: auto !important;
    padding: 8px 2px !important;
    font-size: 12px !important;
  }
  #roleModal #rolePanelArea {
    grid-column: 1 !important;
    grid-row: 2 !important;
    max-height: calc(100vh - 218px) !important;
    min-height: 0 !important;
  }
  .daily-quest-row {
    grid-template-columns: 26px minmax(0, 1fr) 44px;
    gap: 4px;
    padding: 6px;
  }
  .daily-quest-main strong {
    font-size: 12px;
  }
  .daily-quest-main span {
    font-size: 10px;
  }
  .daily-quest-claim {
    min-width: 42px;
    padding: 5px 3px;
    font-size: 10.5px;
  }
}

/* ===== 地图游荡宠（2026-11-26） ===== */
.roam-pet-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  pointer-events: none;
}

.roam-pet {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 58px;
  min-height: 58px;
  padding: 0;
  border: 0;
  background: transparent;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  font-family: inherit;
  transition: left var(--roam-move-ms, 2s) ease-in-out, top var(--roam-move-ms, 2s) ease-in-out;
  -webkit-tap-highlight-color: transparent;
}

.roam-pet img {
  width: 58px;
  height: 58px;
  object-fit: contain;
  display: block;
  position: relative;
  z-index: 1;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.35));
  transition: transform 0.16s ease, filter 0.16s ease;
  user-select: none;
  -webkit-user-drag: none;
}

.roam-pet:hover img,
.roam-pet:focus-visible img {
  transform: scale(1.12);
  filter: drop-shadow(0 6px 10px rgba(0, 0, 0, 0.38)) brightness(1.05);
}

/* 宠物本体是 button，会被全局 button:hover 的 translateY 覆盖掉 translate(-50%,-50%)，
   导致悬停时整只向右下跳半个身位。这里固定回居中偏移，只让图片轻微放大。 */
.roam-pet:hover,
.roam-pet:focus-visible,
.roam-pet:active {
  transform: translate(-50%, -50%) !important;
}

.roam-pet-label {
  margin-top: -2px;
  padding: 1px 6px;
  border-radius: 8px;
  position: relative;
  z-index: 2;
  background: rgba(18, 30, 18, 0.78);
  color: #f4ffe8;
  font-size: 10px;
  line-height: 1.35;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.roam-pet.is-rare {
  width: 72px;
  min-height: 72px;
}

.roam-pet.is-rare img {
  width: 72px;
  height: 72px;
  filter: drop-shadow(0 0 8px rgba(255, 211, 79, 0.95)) drop-shadow(0 4px 6px rgba(0, 0, 0, 0.38));
}

.roam-pet.is-rare .roam-pet-label {
  background: linear-gradient(135deg, #ffd24f, #ff8a1f);
  color: #4a2500;
  font-weight: 700;
  box-shadow: 0 0 10px rgba(255, 198, 47, 0.7);
}

.roam-pet.is-rare::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 34px;
  width: 74px;
  height: 34px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(ellipse, rgba(255, 214, 79, 0.5), rgba(255, 214, 79, 0) 70%);
  z-index: 0;
  pointer-events: none;
}

.roam-pet-count {
  position: absolute;
  left: 50%;
  top: 12px;
  transform: translateX(-50%);
  z-index: 8;
  padding: 5px 10px;
  border-radius: 12px;
  background: rgba(18, 34, 18, 0.78);
  border: 1px solid rgba(214, 255, 184, 0.55);
  color: #f2ffe8;
  font-size: 11.5px;
  line-height: 1.35;
  white-space: nowrap;
  text-align: center;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  cursor: default;
}

.roam-pet-count.is-empty {
  background: rgba(38, 50, 26, 0.82);
  border-color: rgba(255, 231, 160, 0.6);
}

.roam-rare-pet {
  position: relative;
  border: 2px solid #ffd24f;
  border-radius: 12px;
  box-shadow: 0 0 12px rgba(255, 210, 79, 0.55);
}

.roam-rare-badge {
  position: absolute;
  top: -9px;
  right: -8px;
  z-index: 10;
  padding: 2px 7px;
  border-radius: 10px;
  background: linear-gradient(135deg, #ffd24f, #ff8a1f);
  color: #4a2500;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}

@media (max-width: 780px) {
  .roam-pet {
    width: 34px;
    min-height: 34px;
  }
  .roam-pet img {
    width: 34px;
    height: 34px;
  }
  .roam-pet.is-rare {
    width: 44px;
    min-height: 44px;
  }
  .roam-pet.is-rare img {
    width: 44px;
    height: 44px;
  }
  .roam-pet.is-rare::before {
    top: 21px;
    width: 46px;
    height: 22px;
  }
  .roam-pet-label {
    margin-top: -3px;
    font-size: 8.5px;
    padding: 0 4px;
  }
  .roam-pet-count {
    left: 50%;
    top: 6px;
    padding: 4px 8px;
    font-size: 10px;
  }
}

