/**
 * 炼物 DEMO - 主样式表
 * 国风修仙主题，移动端优化
 */

/* ===== 重置与基础 ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  -webkit-user-select: none;
}

:root {
  --bg-dark: #110e09;
  --bg-panel: rgba(38, 30, 20, 0.92);
  --bg-card: rgba(52, 40, 28, 0.82);
  --gold: #c9a04c;
  --gold-light: #e4c87a;
  --fire-red: #ff4422;
  --fire-orange: #ff8833;
  --fire-blue: #66ccff;
  --text-main: #eadbc2;
  --text-dim: #9a8a72;
  --text-bright: #fff5e0;
  --green: #6bd98f;
  --red: #ff5a4a;
  --purple: #b080c8;
  --border: #5a4a36;
  --shadow: rgba(0, 0, 0, 0.55);
  --stone-warm: #8b7d6b;
  --wood-warm: #6b4e35;
  /* 后台可自定义的按钮配色（留空则用下面默认值） */
  --c-btn-primary: linear-gradient(135deg, var(--gold), var(--gold-light));
  --c-btn-primary-text: var(--bg-dark);
  --c-btn-secondary: rgba(52, 40, 28, 0.8);
  --c-btn-secondary-text: var(--text-main);
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: var(--bg-dark);
  color: var(--text-main);
  font-family: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

#app {
  max-width: 430px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #110e09 url('../assets/room.jpg') center center / cover no-repeat;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
}

#app::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center 35%, rgba(17, 14, 9, 0.25) 0%, rgba(17, 14, 9, 0.72) 70%);
  pointer-events: none;
  z-index: 0;
}

/* ===== 界面切换 ===== */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(17, 14, 9, 0.78);
}

.screen.active {
  display: flex;
}

/* ===== 主界面（八卦炉主场景） ===== */
#screen-hub {
  background: transparent;
}

.hub-header {
  padding: 12px 16px;
  background: rgba(38, 30, 20, 0.78);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(201, 160, 76, 0.35);
  position: relative;
  z-index: 1;
}

.hub-info-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hub-info-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 12px;
}

.hub-info-item .label {
  color: var(--text-dim);
  font-size: 10px;
}

.hub-info-item .value {
  color: var(--gold);
  font-weight: bold;
  font-size: 13px;
}

.exp-bar-container {
  margin-top: 8px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 10px;
  height: 6px;
  overflow: hidden;
  border: 1px solid var(--border);
}

.exp-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  border-radius: 10px;
  transition: width 0.3s;
  box-shadow: 0 0 8px var(--gold);
}

/* 八卦炉中心区域 */
.hub-furnace-area {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  position: relative;
  z-index: 0;
  min-height: 300px;
}

.furnace-icon {
  width: 400px;
  height: 400px;
  object-fit: contain;
  position: absolute;
  left: 50%;
  margin-left: -200px;
  top: 150px;
  z-index: 1;
  filter: drop-shadow(0 0 18px rgba(255, 100, 40, 0.45));
}

/* 开炉动画（后台可切换：pulse 默认脉冲 / none 无 / flame 火焰 / scale 缩放） */
body.anim-pulse .furnace-icon { animation: furnace-pulse 3.5s ease-in-out infinite; }
body.anim-none .furnace-icon { animation: none; }
body.anim-flame .furnace-icon { animation: furnace-flame 1.8s ease-in-out infinite; }
body.anim-scale .furnace-icon { animation: furnace-scale 2.4s ease-in-out infinite; }

@keyframes furnace-pulse {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 14px rgba(255, 100, 40, 0.4)); }
  50% { transform: scale(1.04); filter: drop-shadow(0 0 28px rgba(255, 60, 30, 0.6)); }
}

@keyframes furnace-flame {
  0%, 100% { transform: scale(1); filter: drop-shadow(0 0 10px rgba(255, 120, 40, 0.5)); }
  50% { transform: scale(1.05); filter: drop-shadow(0 0 30px rgba(255, 90, 30, 0.95)) brightness(1.1); }
}

@keyframes furnace-scale {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.07); }
}

.hub-caption {
  position: relative;
  z-index: 2;
  text-align: center;
  margin-top: 10px;
  pointer-events: none;
}

.hub-status-text {
  margin-top: 20px;
  font-size: 16px;
  color: var(--gold);
  text-shadow: 0 0 10px rgba(212, 168, 73, 0.5);
}

.shichen-info {
  margin-top: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

.shichen-info span {
  color: var(--gold);
}

/* 统计区域 */
.hub-stats {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-around;
  padding: 12px 16px;
  border-top: 1px solid rgba(201, 160, 76, 0.3);
  border-bottom: 1px solid rgba(201, 160, 76, 0.3);
  background: rgba(38, 30, 20, 0.6);
  backdrop-filter: blur(4px);
}

.stat-box {
  text-align: center;
}

.stat-box .num {
  font-size: 18px;
  font-weight: bold;
  color: var(--gold-light);
}

.stat-box .label {
  font-size: 10px;
  color: var(--text-dim);
}

/* 最近炼成 */
.hub-recent {
  position: relative;
  z-index: 1;
  padding: 8px 16px;
  max-height: 100px;
  overflow-y: auto;
  background: rgba(38, 30, 20, 0.35);
}

.recent-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 13px;
}

.recent-icon {
  font-size: 20px;
}

.recent-name {
  flex: 1;
}

.recent-quality {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
}

/* 底部按钮栏 */
.hub-nav {
  display: flex;
  justify-content: space-around;
  padding: 10px 8px 20px;
  background: rgba(26, 20, 14, 0.92);
  border-top: 1px solid rgba(201, 160, 76, 0.35);
  position: relative;
  z-index: 1;
}

.nav-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 11px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  transition: all 0.2s;
}

.nav-btn:active {
  background: rgba(212, 168, 73, 0.15);
  color: var(--gold);
}

.nav-btn .nav-icon {
  font-size: 24px;
}

/* ===== 通用页面头部 ===== */
.page-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(38, 30, 20, 0.82);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 160, 76, 0.32);
}

.btn-back {
  background: none;
  border: 1px solid var(--border);
  color: var(--gold);
  width: 32px;
  height: 32px;
  border-radius: 8px;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-title {
  font-size: 18px;
  color: var(--gold-light);
  font-weight: bold;
}

/* ===== 许愿炼物界面 ===== */
#wish-list {
  flex: 1;
  padding: 12px;
  overflow-y: auto;
}

.recipe-section {
  margin-bottom: 20px;
}

.recipe-section h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 8px;
  padding-left: 4px;
}

.recipe-section.locked h3 {
  color: var(--text-dim);
}

.recipe-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.recipe-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.recipe-card:active {
  transform: scale(0.98);
  border-color: var(--gold);
}

.recipe-card.disabled {
  opacity: 0.5;
}

.recipe-card.locked {
  opacity: 0.3;
  cursor: not-allowed;
}

.recipe-icon {
  font-size: 36px;
  flex-shrink: 0;
}

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

.recipe-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-bright);
  margin-bottom: 2px;
}

.recipe-tag {
  display: inline-block;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
  vertical-align: middle;
}

.tag-real {
  background: rgba(68, 221, 136, 0.2);
  color: var(--green);
  border: 1px solid var(--green);
}

.tag-virtual {
  background: rgba(155, 89, 182, 0.2);
  color: var(--purple);
  border: 1px solid var(--purple);
}

.recipe-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.recipe-meta {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-dim);
}

/* ===== 炼制筹备界面 ===== */
#prepare-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  padding-bottom: 80px;
}

.prepare-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.prepare-icon {
  font-size: 48px;
}

.prepare-header h2 {
  color: var(--gold-light);
  font-size: 20px;
}

.prepare-header p {
  color: var(--text-dim);
  font-size: 12px;
}

.real-tag {
  display: inline-block;
  background: rgba(68, 221, 136, 0.2);
  color: var(--green);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  margin-top: 4px;
}

.warning {
  background: rgba(255, 68, 68, 0.15);
  border: 1px solid var(--red);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--red);
}

.prepare-section {
  margin-bottom: 16px;
}

.prepare-section h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 8px;
}

.mat-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(52, 40, 28, 0.65);
  border: 1px solid rgba(201, 160, 76, 0.15);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.mat-row.ok { color: var(--green); }
.mat-row.lack { color: var(--red); }

.phase-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.phase-bar {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(52, 40, 28, 0.65);
  border: 1px solid rgba(201, 160, 76, 0.15);
  border-radius: 6px;
  font-size: 12px;
}

.phase-name { color: var(--text-main); }
.phase-range { color: var(--gold); }

.equip-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 12px;
  background: rgba(52, 40, 28, 0.65);
  border: 1px solid rgba(201, 160, 76, 0.15);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 13px;
}

.talisman-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.talisman-btn {
  padding: 6px 12px;
  background: rgba(52, 40, 28, 0.7);
  border: 1px solid rgba(201, 160, 76, 0.22);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 12px;
  cursor: pointer;
}

.talisman-btn.available {
  border-color: var(--gold);
}

.talisman-btn.unavailable {
  opacity: 0.5;
}

.talisman-btn.selected {
  background: var(--gold);
  color: var(--bg-dark);
}

.talisman-btn.none-btn {
  border-color: var(--text-dim);
}

/* ===== 炼制界面（核心） ===== */
#screen-refine {
  background: rgba(17, 14, 9, 0.82);
}

#screen-refine.danger {
  animation: danger-flash 0.5s ease-in-out infinite;
}

@keyframes danger-flash {
  0%, 100% { background: rgba(17, 14, 9, 0.82); }
  50% { background: rgba(45, 18, 12, 0.88); }
}

.shake {
  animation: screen-shake 0.4s ease-in-out;
}

@keyframes screen-shake {
  0%, 100% { transform: translate(0, 0); }
  20% { transform: translate(-8px, 4px); }
  40% { transform: translate(8px, -4px); }
  60% { transform: translate(-6px, 2px); }
  80% { transform: translate(6px, -2px); }
}

.refine-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(38, 30, 20, 0.72);
  backdrop-filter: blur(4px);
}

.refine-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

.refine-header-left .icon {
  font-size: 28px;
}

.refine-header-left .name {
  font-size: 16px;
  color: var(--gold-light);
  font-weight: bold;
}

.refine-timer {
  font-size: 24px;
  font-weight: bold;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

/* 进度条 + 理想光标 */
.progress-track {
  position: relative;
  height: 40px;
  margin: 8px 16px;
  background: rgba(26, 20, 14, 0.55);
  border-radius: 8px;
  border: 1px solid rgba(201, 160, 76, 0.28);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, rgba(212, 168, 73, 0.2), rgba(255, 136, 51, 0.3));
  border-radius: 8px;
  transition: width 0.1s linear;
  position: relative;
}

/* 阶段标记线 */
.phase-marker {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 2px;
  background: rgba(255, 255, 255, 0.2);
}

/* 理想光标 */
.ideal-cursor {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: var(--gold-light);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--gold-light);
  transition: left 0.1s linear;
  z-index: 3;
}

.ideal-cursor::before {
  content: '★';
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--gold-light);
  text-shadow: 0 0 6px var(--gold-light);
}

/* 实际光标 */
.actual-cursor {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 3px;
  background: var(--fire-orange);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--fire-orange);
  transition: left 0.1s linear;
  z-index: 2;
}

.actual-cursor::before {
  content: '▼';
  position: absolute;
  bottom: -16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  color: var(--fire-orange);
}

/* 火焰画布区域 */
.fire-canvas-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  margin: 0 16px;
}

#fire-canvas, #explosion-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none; /* 画布不拦截触摸，避免遮挡滑杆 */
}

#explosion-canvas {
  z-index: 10;
}

/* 火候数值显示 */
.temp-display {
  display: flex;
  justify-content: space-around;
  padding: 8px 16px;
  font-size: 13px;
}

.temp-item {
  text-align: center;
}

.temp-item .label {
  font-size: 10px;
  color: var(--text-dim);
}

.temp-item .value {
  font-size: 20px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

#temp-actual { color: var(--fire-orange); }
#temp-ideal { color: var(--gold-light); }
#temp-target { color: var(--text-dim); }

/* 偏差显示 */
.deviation-display {
  margin: 0 16px;
  padding: 8px 12px;
  background: rgba(26, 20, 14, 0.55);
  border-radius: 8px;
  border: 1px solid rgba(201, 160, 76, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
}

.deviation-info {
  display: flex;
  flex-direction: column;
}

#deviation-value {
  font-size: 18px;
  font-weight: bold;
  font-variant-numeric: tabular-nums;
}

#deviation-label {
  font-size: 12px;
  font-weight: bold;
}

.deviation-bar-container {
  flex: 1;
  height: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 4px;
  overflow: hidden;
}

#deviation-bar {
  height: 100%;
  border-radius: 4px;
  transition: width 0.2s, background 0.2s;
}

/* 成功率与阶段 */
.refine-footer {
  padding: 8px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.success-rate {
  font-size: 14px;
}

.success-rate .label {
  color: var(--text-dim);
  font-size: 11px;
}

.success-rate .value {
  color: var(--green);
  font-weight: bold;
  font-size: 18px;
}

.current-phase {
  font-size: 13px;
  color: var(--gold);
}

/* 火候滑杆 */
.slider-container {
  flex-shrink: 0;
  padding: 12px 16px 24px;
  background: rgba(26, 20, 14, 0.92);
  border-top: 1px solid rgba(201, 160, 76, 0.35);
}

.slider-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 12px;
  color: var(--text-dim);
}

.slider-track {
  position: relative;
  height: 48px;
}

#fire-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 48px;
  background: transparent;
  position: relative;
  z-index: 2;
  cursor: pointer;
  touch-action: none; /* 关键：避免移动端拖动时页面滚动，保证滑杆可拖 */
}

#fire-slider::-webkit-slider-runnable-track {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #2a1a0a, #4a2a1a, #1a2a4a);
  border: 1px solid var(--border);
}

#fire-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--fire-orange), var(--fire-red));
  border: 2px solid var(--gold-light);
  box-shadow: 0 0 15px var(--fire-orange);
  margin-top: -12px;
  cursor: grab;
}

#fire-slider::-moz-range-track {
  height: 12px;
  border-radius: 6px;
  background: linear-gradient(90deg, #2a1a0a, #4a2a1a, #1a2a4a);
  border: 1px solid var(--border);
}

#fire-slider::-moz-range-thumb {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--fire-orange), var(--fire-red));
  border: 2px solid var(--gold-light);
  box-shadow: 0 0 15px var(--fire-orange);
  cursor: grab;
}

.slider-fill-indicator {
  position: absolute;
  bottom: 6px;
  left: 0;
  height: 4px;
  border-radius: 2px;
  background: var(--fire-orange);
  box-shadow: 0 0 8px var(--fire-orange);
  pointer-events: none;
  transition: width 0.05s;
}

/* ===== 背包界面 ===== */
#inventory-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

.inv-section {
  margin-bottom: 16px;
}

.inv-section h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 8px;
}

.inv-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.inv-item {
  padding: 10px 6px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.22);
  border-radius: 10px;
  text-align: center;
}

.inv-item.quality-legendary { border-color: #f1c40f; box-shadow: 0 0 10px rgba(241, 196, 15, 0.3); }
.inv-item.quality-epic { border-color: var(--purple); }
.inv-item.quality-rare { border-color: var(--fire-blue); }
.inv-item.quality-good { border-color: var(--green); }

.inv-icon {
  font-size: 32px;
}

.inv-name {
  font-size: 11px;
  color: var(--text-main);
  margin-top: 4px;
}

.inv-type {
  font-size: 10px;
  color: var(--text-dim);
}

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

.mat-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.15);
  border-radius: 8px;
  font-size: 12px;
}

.mat-count {
  color: var(--gold);
  font-weight: bold;
  margin-left: auto;
}

/* ===== 采集界面 ===== */
#gather-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

.gather-info {
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.22);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 16px;
}

.gather-info h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 4px;
}

.gather-info p {
  font-size: 12px;
  color: var(--text-dim);
}

.gather-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gather-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.gather-card:active {
  transform: scale(0.98);
  border-color: var(--gold);
}

.gather-card.urgent {
  border-color: var(--red);
  background: rgba(255, 68, 68, 0.1);
}

.gather-card.shop {
  border-color: var(--gold);
}

.gather-icon {
  font-size: 32px;
}

.gather-card h3 {
  font-size: 15px;
  color: var(--text-bright);
}

.gather-card p {
  font-size: 12px;
  color: var(--text-dim);
}

.gather-cost {
  font-size: 11px;
  color: var(--gold);
}

/* ===== 弹窗系统 ===== */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

#modal-overlay.show {
  display: flex;
}

#modal-content {
  max-width: 380px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  background: rgba(38, 30, 20, 0.96);
  border: 1px solid rgba(201, 160, 76, 0.55);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 0 30px rgba(201, 160, 76, 0.22);
}

#modal-content h2 {
  color: var(--gold-light);
  font-size: 20px;
  text-align: center;
  margin-bottom: 12px;
}

#modal-content h3 {
  color: var(--gold);
  font-size: 16px;
  margin-bottom: 8px;
}

#modal-content p {
  font-size: 13px;
  color: var(--text-main);
  margin-bottom: 8px;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.modal-actions button {
  flex: 1;
}

/* ===== 按钮 ===== */
.btn-primary {
  background: var(--c-btn-primary);
  color: var(--c-btn-primary-text);
  border: none;
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:active {
  transform: scale(0.96);
  box-shadow: 0 0 15px rgba(212, 168, 73, 0.5);
}

.btn-secondary {
  background: var(--c-btn-secondary);
  color: var(--c-btn-secondary-text);
  border: 1px solid rgba(201, 160, 76, 0.3);
  border-radius: 8px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
}

.btn-large {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  margin-top: 12px;
}

.btn-small {
  background: var(--gold);
  color: var(--bg-dark);
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
}

/* ===== 结果弹窗 ===== */
.result-modal {
  text-align: center;
}

.result-icon {
  font-size: 56px;
  margin-bottom: 8px;
}

.result-icon.success-icon {
  animation: success-bounce 0.6s ease;
}

@keyframes success-bounce {
  0% { transform: scale(0); }
  50% { transform: scale(1.3); }
  100% { transform: scale(1); }
}

.result-modal.success h2 {
  color: var(--gold-light);
}

.result-modal.fail h2 {
  color: var(--red);
}

.result-reason {
  color: var(--text-dim);
  font-size: 13px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 16px 0;
}

.result-item-icon {
  font-size: 40px;
}

.result-item-name {
  font-size: 18px;
  color: var(--text-bright);
}

.quality-tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 12px;
  margin-top: 4px;
}

.quality-legendary { background: rgba(241, 196, 15, 0.3); color: #f1c40f; border: 1px solid #f1c40f; }
.quality-epic { background: rgba(155, 89, 182, 0.3); color: var(--purple); border: 1px solid var(--purple); }
.quality-rare { background: rgba(102, 204, 255, 0.3); color: var(--fire-blue); border: 1px solid var(--fire-blue); }
.quality-good { background: rgba(68, 221, 136, 0.3); color: var(--green); border: 1px solid var(--green); }
.quality-normal { background: rgba(138, 122, 101, 0.3); color: var(--text-dim); border: 1px solid var(--text-dim); }

.result-stats {
  background: rgba(26, 20, 14, 0.5);
  border: 1px solid rgba(201, 160, 76, 0.18);
  border-radius: 10px;
  padding: 12px;
  margin: 12px 0;
}

.result-stat {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 13px;
  color: var(--text-main);
}

.result-stat span:first-child {
  color: var(--text-dim);
}

.result-hint {
  font-size: 12px;
  color: var(--gold);
  margin-top: 8px;
}

/* 现实配送 */
.real-delivery {
  background: rgba(68, 221, 136, 0.1);
  border: 1px solid var(--green);
  border-radius: 10px;
  padding: 16px;
  margin: 12px 0;
}

.delivery-icon {
  font-size: 36px;
  text-align: center;
}

.real-delivery h3 {
  color: var(--green);
  text-align: center;
}

.real-delivery p {
  text-align: center;
  color: var(--text-dim);
}

.delivery-note {
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

.delivery-form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.delivery-input {
  background: rgba(52, 40, 28, 0.7);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-main);
  font-size: 13px;
  font-family: inherit;
}

.delivery-input:focus {
  border-color: var(--gold);
  outline: none;
}

/* 炸炉抢救 */
.danger-modal h2 {
  color: var(--red);
  font-size: 24px;
  animation: danger-pulse 0.5s infinite;
}

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

.danger-info {
  text-align: center;
  color: var(--fire-orange);
  font-size: 14px;
}

.rescue-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.rescue-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 12px 8px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.22);
  border-radius: 10px;
  cursor: pointer;
  gap: 4px;
}

.rescue-btn:active {
  transform: scale(0.96);
}

.rescue-btn.danger-btn {
  border-color: var(--red);
}

.rescue-icon {
  font-size: 28px;
}

.rescue-name {
  font-size: 13px;
  color: var(--text-bright);
  font-weight: bold;
}

.rescue-desc {
  font-size: 10px;
  color: var(--text-dim);
}

/* 商城 */
.shop-modal h2 {
  text-align: center;
}

.shop-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 12px 0;
}

.shop-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.18);
  border-radius: 8px;
  font-size: 13px;
}

.shop-balance {
  text-align: center;
  color: var(--gold);
  font-size: 13px;
}

/* 新手引导 */
.tutorial-modal h2 {
  text-align: center;
  color: var(--gold-light);
}

.tutorial-content {
  font-size: 13px;
}

.tutorial-content p {
  margin-bottom: 8px;
}

.tutorial-content ul {
  padding-left: 20px;
  margin-bottom: 8px;
}

.tutorial-content li {
  font-size: 12px;
  color: var(--text-main);
  margin-bottom: 4px;
}

/* Toast */
#toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(38, 30, 20, 0.96);
  border: 1px solid rgba(201, 160, 76, 0.55);
  color: var(--gold-light);
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  max-width: 90%;
  text-align: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
}

#toast.show {
  opacity: 1;
}

/* 空状态 */
.empty-hint {
  text-align: center;
  color: var(--text-dim);
  padding: 40px 20px;
  font-size: 13px;
}

/* 滚动条隐藏 */
.screen::-webkit-scrollbar,
#modal-content::-webkit-scrollbar {
  width: 0;
}

/* ===== 登录/注册界面 ===== */
#screen-login {
  background: rgba(17, 14, 9, 0.92);
  justify-content: center;
  align-items: center;
}

.login-wrap {
  width: 100%;
  max-width: 320px;
  padding: 20px;
  text-align: center;
}

.login-logo {
  font-size: 48px;
  font-weight: bold;
  color: var(--gold);
  text-shadow: 0 0 20px rgba(201, 160, 76, 0.6);
  letter-spacing: 8px;
  margin-bottom: 4px;
}

.login-subtitle {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 32px;
  letter-spacing: 4px;
}

.login-tabs {
  display: flex;
  margin-bottom: 16px;
  border: 1px solid rgba(201, 160, 76, 0.35);
  border-radius: 8px;
  overflow: hidden;
}

.login-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}

.login-tab.active {
  background: var(--gold);
  color: var(--bg-dark);
  font-weight: bold;
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.login-input {
  width: 100%;
  padding: 12px 14px;
  background: rgba(52, 40, 28, 0.7);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 8px;
  color: var(--text-main);
  font-size: 14px;
  font-family: inherit;
}

.login-input:focus {
  border-color: var(--gold);
  outline: none;
}

.login-input::placeholder {
  color: var(--text-dim);
}

.avatar-picker-label {
  text-align: left;
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 4px;
}

.avatar-picker {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-top: 6px;
}

.avatar-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  aspect-ratio: 1;
  font-size: 20px;
  border-radius: 8px;
  border: 1px solid rgba(201, 160, 76, 0.2);
  background: rgba(52, 40, 28, 0.5);
  cursor: pointer;
  transition: all 0.15s;
}

.avatar-option.selected {
  border-color: var(--gold);
  background: rgba(201, 160, 76, 0.2);
  box-shadow: 0 0 8px rgba(201, 160, 76, 0.4);
}

.avatar-picker-modal {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin: 12px 0;
}

.login-hint {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 16px;
}

/* ===== 个人中心 ===== */
#profile-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
  padding-bottom: 40px;
}

.profile-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.3);
  border-radius: 12px;
  margin-bottom: 16px;
}

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: rgba(201, 160, 76, 0.15);
  border: 2px solid var(--gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  cursor: pointer;
  flex-shrink: 0;
}

.profile-info {
  flex: 1;
}

.profile-name {
  font-size: 18px;
  font-weight: bold;
  color: var(--text-bright);
}

.profile-level {
  font-size: 12px;
  color: var(--gold);
  margin-top: 2px;
}

.profile-lingshi {
  font-size: 13px;
  color: var(--gold-light);
  margin-top: 4px;
}

.profile-section {
  margin-bottom: 16px;
}

.profile-section h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 8px;
}

.profile-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: rgba(52, 40, 28, 0.65);
  border: 1px solid rgba(201, 160, 76, 0.15);
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  transition: all 0.15s;
}

.profile-row:active {
  border-color: var(--gold);
}

.profile-row-label {
  font-size: 13px;
  color: var(--text-main);
  white-space: nowrap;
}

.profile-row-value {
  flex: 1;
  text-align: right;
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-row-arrow {
  color: var(--text-dim);
  font-size: 18px;
}

.profile-row.logout-row {
  border-color: rgba(255, 90, 74, 0.3);
}

.profile-row.logout-row .profile-row-label {
  color: var(--red);
}

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

.profile-stat-box {
  background: rgba(52, 40, 28, 0.65);
  border: 1px solid rgba(201, 160, 76, 0.15);
  border-radius: 10px;
  padding: 12px 8px;
  text-align: center;
}

.profile-stat-num {
  font-size: 20px;
  font-weight: bold;
  color: var(--gold-light);
}

.profile-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ===== 物流追踪 ===== */
#logistics-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

.logistics-card {
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.22);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 12px;
}

.logistics-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.logistics-item-icon {
  font-size: 28px;
}

.logistics-item-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-bright);
}

.logistics-order-id {
  font-size: 11px;
  color: var(--text-dim);
}

.logistics-status-badge {
  margin-left: auto;
  font-size: 11px;
  padding: 3px 8px;
  border: 1px solid;
  border-radius: 4px;
  white-space: nowrap;
}

.logistics-address {
  font-size: 12px;
  color: var(--text-dim);
  padding: 8px 10px;
  background: rgba(26, 20, 14, 0.5);
  border-radius: 8px;
  margin-bottom: 10px;
  line-height: 1.6;
}

.logistics-timeline {
  padding-left: 4px;
}

.logistics-timeline-item {
  display: flex;
  gap: 10px;
  padding-bottom: 12px;
  position: relative;
}

.logistics-timeline-item:not(:last-child)::after {
  content: '';
  position: absolute;
  left: 14px;
  top: 28px;
  bottom: 0;
  width: 2px;
  background: rgba(201, 160, 76, 0.2);
}

.logistics-timeline-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  background: rgba(26, 20, 14, 0.6);
  flex-shrink: 0;
  z-index: 1;
}

.logistics-timeline-item.active .logistics-timeline-dot {
  background: var(--gold);
}

.logistics-timeline-status {
  font-size: 13px;
  color: var(--gold-light);
  font-weight: bold;
}

.logistics-timeline-desc {
  font-size: 12px;
  color: var(--text-main);
  margin-top: 2px;
}

.logistics-timeline-time {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* ===== 充值 ===== */
#recharge-content {
  flex: 1;
  padding: 12px 16px;
  overflow-y: auto;
}

.recharge-balance {
  text-align: center;
  padding: 20px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.3);
  border-radius: 12px;
  margin-bottom: 16px;
}

.recharge-balance-label {
  font-size: 13px;
  color: var(--text-dim);
}

.recharge-balance-num {
  font-size: 32px;
  font-weight: bold;
  color: var(--gold);
  margin-top: 4px;
}

.recharge-packages {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.recharge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 10px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
}

.recharge-card:active {
  transform: scale(0.96);
  border-color: var(--gold);
}

.recharge-card-icon {
  font-size: 32px;
  margin-bottom: 6px;
}

.recharge-card-info {
  text-align: center;
}

.recharge-card-name {
  font-size: 13px;
  color: var(--text-bright);
  font-weight: bold;
}

.recharge-card-lingshi {
  font-size: 16px;
  color: var(--gold);
  margin-top: 4px;
}

.recharge-bonus {
  font-size: 12px;
  color: var(--green);
}

.recharge-card-price {
  margin-top: 8px;
  font-size: 18px;
  font-weight: bold;
  color: var(--fire-orange);
}

.recharge-hint {
  margin-top: 16px;
  padding: 12px;
  background: rgba(26, 20, 14, 0.5);
  border-radius: 8px;
}

.recharge-hint p {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.recharge-history {
  margin-top: 16px;
}

.recharge-history h3 {
  color: var(--gold);
  font-size: 14px;
  margin-bottom: 8px;
}

.recharge-history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(52, 40, 28, 0.5);
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 12px;
}

.recharge-history-time {
  color: var(--text-dim);
}

.recharge-confirm {
  text-align: center;
  margin: 16px 0;
}

.recharge-confirm-icon {
  font-size: 40px;
}

.recharge-confirm-name {
  font-size: 16px;
  color: var(--text-bright);
  margin-top: 4px;
}

.recharge-confirm-price {
  font-size: 28px;
  font-weight: bold;
  color: var(--fire-orange);
  margin-top: 4px;
}

.recharge-confirm-lingshi {
  font-size: 14px;
  color: var(--gold);
  margin-top: 4px;
}

.recharge-pay-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
}

/* ===== 商城完整页面 ===== */
.shop-tabs {
  display: flex;
  gap: 0;
  background: rgba(38, 30, 20, 0.8);
  border-bottom: 1px solid rgba(201, 160, 76, 0.3);
}

.shop-tab {
  flex: 1;
  padding: 10px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.shop-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: bold;
}

.shop-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px 6px;
  background: rgba(38, 30, 20, 0.6);
}
.shop-mode-tab {
  flex: 1;
  padding: 9px 4px;
  background: rgba(52, 40, 28, 0.6);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
}
.shop-mode-tab.active {
  background: linear-gradient(135deg, rgba(201,160,76,0.9), rgba(176,128,200,0.9));
  color: #fff;
  border-color: var(--gold);
  font-weight: bold;
}

.market-tab {
  flex: 1;
  padding: 10px 4px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-dim);
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}
.market-tab.active {
  color: var(--gold);
  border-bottom-color: var(--gold);
  font-weight: bold;
}

#shop-sub-section,
#market-sub-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}
#marketplace-content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  padding-bottom: 40px;
}

.shop-lingshi-display {
  margin-left: auto;
  color: var(--gold);
  font-size: 13px;
  font-weight: bold;
}

#shop-content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  padding-bottom: 40px;
}

.shop-full-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.2);
  border-radius: 12px;
  margin-bottom: 8px;
}

.shop-full-card.equipped {
  border-color: var(--green);
  background: rgba(68, 221, 136, 0.08);
}

.shop-full-icon {
  font-size: 32px;
  flex-shrink: 0;
}

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

.shop-full-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-bright);
}

.shop-full-desc {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 2px;
}

.shop-full-price {
  font-size: 13px;
  color: var(--gold);
  margin-top: 2px;
}

.shop-owned {
  font-size: 11px;
  color: var(--green);
}

.shop-equipped-tag {
  font-size: 11px;
  color: var(--green);
  padding: 4px 10px;
  border: 1px solid var(--green);
  border-radius: 6px;
  white-space: nowrap;
}

.btn-small.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ===== 物品处理动作按钮 ===== */
.item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.2s;
  text-align: left;
  width: 100%;
}

.action-btn:active {
  transform: scale(0.97);
  border-color: var(--gold);
}

.action-icon {
  font-size: 28px;
  flex-shrink: 0;
}

.action-name {
  font-size: 15px;
  font-weight: bold;
  color: var(--text-bright);
}

.action-desc {
  font-size: 11px;
  color: var(--text-dim);
  display: block;
  margin-top: 2px;
}

.sell-btn { border-color: rgba(201, 160, 76, 0.4); }
.mail-btn { border-color: rgba(68, 221, 136, 0.3); }
.gift-btn { border-color: rgba(176, 128, 200, 0.3); }
.store-btn { border-color: rgba(102, 204, 255, 0.3); }
.exchange-btn { border-color: rgba(255, 136, 51, 0.3); }

.action-hint {
  text-align: center;
  font-size: 12px;
  color: var(--gold);
  margin-top: 12px;
  margin-bottom: 4px;
}

/* 售卖弹窗 */
.sell-item-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin: 12px 0;
}

.sell-hint {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 8px;
}

.sell-price-row {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}

.price-quick {
  flex: 1;
  padding: 6px 4px;
  background: rgba(52, 40, 28, 0.7);
  border: 1px solid rgba(201, 160, 76, 0.25);
  border-radius: 6px;
  color: var(--gold);
  font-size: 11px;
  cursor: pointer;
}

.price-quick:active {
  border-color: var(--gold);
  background: rgba(201, 160, 76, 0.15);
}

.sell-tip {
  font-size: 11px;
  color: var(--text-dim);
  margin-top: 8px;
  text-align: center;
}

/* 赠与码展示 */
.gift-code-box, .gift-link-box {
  background: rgba(52, 40, 28, 0.7);
  border: 1px solid rgba(201, 160, 76, 0.3);
  border-radius: 10px;
  padding: 12px;
  margin: 8px 0;
  text-align: center;
}

.gift-code-label {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 4px;
}

.gift-code-value {
  font-size: 28px;
  font-weight: bold;
  color: var(--gold);
  letter-spacing: 8px;
  margin: 4px 0 8px;
  font-family: monospace;
}

.gift-link-value {
  font-size: 10px;
  color: var(--gold-light);
  word-break: break-all;
  margin: 4px 0 8px;
  line-height: 1.4;
}

/* ===== 坊市界面 ===== */
#marketplace-content {
  flex: 1;
  padding: 10px 12px;
  overflow-y: auto;
  padding-bottom: 40px;
}

.marketplace-tabs {
  display: flex;
  gap: 0;
  background: rgba(38, 30, 20, 0.8);
  border-bottom: 1px solid rgba(201, 160, 76, 0.3);
}

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

.market-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 12px 10px;
  background: rgba(52, 40, 28, 0.75);
  border: 1px solid rgba(201, 160, 76, 0.2);
  border-radius: 12px;
}

.market-card-icon {
  font-size: 32px;
  flex-shrink: 0;
}

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

.market-card-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-bright);
}

.market-card-meta {
  display: flex;
  gap: 8px;
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  flex-wrap: wrap;
}

.market-card-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.market-card-price {
  font-size: 15px;
  font-weight: bold;
  color: var(--gold);
}

.market-card-img { font-size: 40px; line-height: 1; margin-bottom: 6px; }
.market-card-body { width: 100%; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.market-card-desc { font-size: 11px; color: var(--text-dim); line-height: 1.4; word-break: break-word; max-width: 100%; }
.market-card-seller { font-size: 10px; color: var(--text-dim); }

.gift-claim-row {
  display: flex;
  gap: 8px;
}

.gift-claim-row input {
  flex: 1;
}

.gift-claim-row button {
  flex-shrink: 0;
}

.floating-gift-btn {
  position: absolute;
  right: 14px;
  top: 58%;
  z-index: 60;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #c9a04c, #b080c8);
  color: #fff;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4);
  cursor: pointer;
  animation: gift-float 2.4s ease-in-out infinite;
}
.floating-gift-btn .floating-gift-icon { font-size: 22px; line-height: 1; }
.floating-gift-btn .floating-gift-label { font-size: 11px; margin-top: 2px; font-weight: bold; }
.floating-gift-btn:active { transform: scale(0.92); }
@keyframes gift-float {
  0%, 100% { transform: translateY(-50%); }
  50% { transform: translateY(calc(-50% - 6px)); }
}
.gift-claim-modal { text-align: center; }
.gift-claim-modal h3 { color: var(--purple); margin-bottom: 6px; }
.gift-claim-modal p { font-size: 12px; color: var(--text-dim); margin-bottom: 12px; }
.gift-claim-modal .gift-claim-row { margin-top: 4px; }

/* 背包物品长按提示 */
.inv-item {
  position: relative;
  -webkit-user-select: none;
  user-select: none;
}

.inv-item:active {
  background: rgba(201, 160, 76, 0.15);
}

/* ===== 背包-采集工具区 ===== */
.inv-tool-list { display:grid; grid-template-columns:1fr 1fr; gap:8px; }
.inv-tool { display:flex; flex-direction:column; align-items:center; gap:6px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,215,0,0.25); border-radius:10px; padding:8px 6px; text-align:center; }
.inv-tool-icon { font-size:26px; }
.inv-tool-info { flex:1; min-width:0; width:100%; }
.inv-tool-name { font-size:12px; color:var(--text-main); }
.inv-tool-lv { font-size:10px; color:var(--text-dim); }
.inv-tool-dur { font-size:10px; color:var(--text-dim); margin-top:3px; }
.inv-tool-full { font-size:11px; color:var(--text-dim); }
.inv-tool .btn-small { width:100%; }
/* 碎片区 */
.inv-frag-grid { display:grid; grid-template-columns:repeat(auto-fill, minmax(72px,1fr)); gap:8px; }
.inv-frag { display:flex; flex-direction:column; align-items:center; gap:2px; background:rgba(255,255,255,0.04); border:1px solid rgba(255,215,0,0.18); border-radius:8px; padding:6px 4px; }
.inv-frag-icon { font-size:22px; }
.inv-frag-name { font-size:10px; color:var(--text-dim); text-align:center; line-height:1.2; }

/* ===== 炸炉预警-邀请好友助力 ===== */
.assist-btn { background: linear-gradient(135deg,#ff9966,#ff5e62); color:#fff; }
.assist-friends { display:flex; flex-wrap:wrap; gap:8px; justify-content:center; margin:10px 0; }
.assist-friend-chip { display:inline-flex; align-items:center; gap:4px; padding:6px 10px; border-radius:20px; border:1px solid rgba(255,215,0,0.4); background:rgba(255,255,255,0.05); color:var(--text-main); cursor:pointer; font-size:12px; }
.assist-friend-chip.assisted { opacity:0.5; border-color:#00ff88; text-decoration:line-through; }
.assist-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; margin-top:6px; }
.btn-tiny { padding:3px 8px; margin-left:6px; border-radius:10px; border:1px solid rgba(255,215,0,0.4); background:rgba(255,255,255,0.06); color:var(--text-main); font-size:10px; cursor:pointer; }
.empty-hint { font-size:12px; color:var(--text-dim); text-align:center; padding:8px 0; }
