/* ============================================================
 * 故宫·數字典藏 H5 —— 玄墨鎏金 v3（三页结构 + 认知增强）
 * ============================================================ */
@property --a { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

:root {
  --red-deep: #3d0f0a;
  --red: #7e261b;
  --red-bright: #a4342a;
  --gold: #d4af37;
  --gold-light: #f5d06f;
  --gold-pale: #f9e8b0;
  --gold-dim: #9a7b2d;
  --ink: #2a1512;
  --bg: #120806;
  --bg-card: #1f110c;
  --bg-card2: #2a1710;
  --text: #f3e5c8;
  --text-dim: #a8906d;
  --line: rgba(212, 175, 55, .25);
  --line-soft: rgba(212, 175, 55, .12);
  --n: #93a1ad;
  --r: #6db1e8;
  --sr: #c49aee;
  --ssr: #f0b429;
  --green: #7ee0a3;
  --shadow: 0 10px 30px rgba(0, 0, 0, .45);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;
  color: var(--text);
  max-width: 480px;
  margin: 0 auto;
  position: relative;
  overflow-x: hidden;
  background:
    radial-gradient(600px 320px at 50% -80px, rgba(212, 175, 55, .09), transparent 65%),
    radial-gradient(500px 300px at 108% 108%, rgba(126, 38, 27, .22), transparent 60%),
    radial-gradient(400px 260px at -10% 90%, rgba(126, 38, 27, .14), transparent 60%),
    #120806;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    repeating-linear-gradient(45deg, rgba(255, 255, 255, .012) 0 2px, transparent 2px 6px),
    repeating-linear-gradient(-45deg, rgba(0, 0, 0, .06) 0 2px, transparent 2px 6px);
}
main, .topbar, .tabbar, .modal { position: relative; z-index: 1; }

/* ============ 顶栏 ============ */
.topbar {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 16px;
  background: linear-gradient(180deg, rgba(30, 14, 10, .97), rgba(22, 10, 7, .94));
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim) 20%, var(--gold-light) 50%, var(--gold-dim) 80%, transparent);
  opacity: .5;
}
.topbar-left { display: flex; flex-direction: column; gap: 2px; }
.topbar-title {
  font-size: 17px; font-weight: 700; letter-spacing: 3px;
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%, #9a7b2d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.topbar-sub { font-size: 8px; letter-spacing: 2.5px; color: var(--text-dim); font-family: "Georgia", serif; }
.gold-badge {
  display: flex; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 700;
  background: linear-gradient(135deg, rgba(212, 175, 55, .16), rgba(212, 175, 55, .05));
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06), 0 2px 10px rgba(0, 0, 0, .3);
  border-radius: 22px; padding: 6px 14px 6px 9px;
}
.gold-badge span { color: var(--gold-pale); font-variant-numeric: tabular-nums; }
.gold-badge small { font-size: 10px; color: var(--text-dim); font-weight: 400; }
.gold-coin {
  width: 17px; height: 17px; border-radius: 50%; font-style: normal;
  background: radial-gradient(circle at 32% 28%, #f9e8b0, #d4af37 55%, #8a6508);
  border: 1px solid rgba(255, 255, 255, .35);
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5), inset 0 -1px 2px rgba(0, 0, 0, .35);
  position: relative;
}
.gold-coin::after {
  content: '金'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 9px; color: #4a3005; font-weight: 700; font-style: normal;
}

/* ============ 页面容器 ============ */
main { padding-bottom: 86px; }
.page { display: none; animation: fadeIn .3s ease; }
.page.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.page-title {
  font-size: 19px; text-align: center; margin: 18px 0 6px;
  letter-spacing: 6px; text-indent: 6px; color: var(--gold-pale);
  display: flex; align-items: center; justify-content: center; gap: 12px;
  font-weight: 700;
}
.page-title::before, .page-title::after {
  content: ''; width: 44px; height: 5px;
  background-repeat: no-repeat; background-size: 100% 100%;
}
.page-title::before { background-image: linear-gradient(90deg, transparent, var(--gold-dim)); clip-path: polygon(0 45%, 92% 45%, 100% 50%, 92% 55%, 0 55%); }
.page-title::after { background-image: linear-gradient(270deg, transparent, var(--gold-dim)); clip-path: polygon(8% 45%, 100% 45%, 100% 55%, 8% 55%, 0 50%); }
.page-desc { font-size: 11.5px; text-align: center; color: var(--text-dim); margin-bottom: 14px; letter-spacing: 1px; }

/* ============ 底部导航（3 Tab） ============ */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 50;
  display: flex;
  background: linear-gradient(0deg, rgba(16, 7, 5, .97), rgba(28, 13, 9, .93));
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  padding: 7px 0 calc(7px + env(safe-area-inset-bottom));
}
.tab {
  flex: 1; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  color: #7a6a55; font-family: inherit; font-size: 10.5px; letter-spacing: 1px;
  transition: color .2s;
}
.tab i { font-style: normal; font-size: 21px; filter: grayscale(.75) brightness(.8); transition: .25s; }
.tab.active { color: var(--gold-light); }
.tab.active i { filter: none; transform: translateY(-1px) scale(1.08); }
.tab.active::after {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-light); box-shadow: 0 0 8px 1px rgba(245, 208, 111, .7);
}

/* ============ 通用面板（金角饰） ============ */
.panel {
  position: relative;
  background: linear-gradient(165deg, #241310, #1b0d09);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, .04);
}
.panel::before, .panel::after {
  content: ''; position: absolute; width: 12px; height: 12px; pointer-events: none;
  border-color: var(--gold-dim); border-style: solid; opacity: .8;
}
.panel::before { top: 5px; left: 5px; border-width: 1px 0 0 1px; border-radius: 2px 0 0 0; }
.panel::after { bottom: 5px; right: 5px; border-width: 0 1px 1px 0; border-radius: 0 0 2px 0; }

/* ============ 顶部宫殿条幅（太和殿中轴线全景实拍图） ============ */
.palace-banner {
  position: relative; height: 112px; overflow: hidden;
  background:
    linear-gradient(180deg, rgba(18, 8, 6, .08) 0%, rgba(18, 8, 6, .18) 62%, rgba(18, 8, 6, .92) 100%),
    radial-gradient(ellipse 70% 100% at 50% 100%, rgba(240, 180, 41, .18), transparent 70%),
    url('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=panoramic%20view%20of%20Forbidden%20City%20Hall%20of%20Supreme%20Harmony%20along%20central%20axis%2C%20golden%20glazed%20roofs%2C%20vermilion%20red%20walls%2C%20dramatic%20sunset%20sky%20with%20clouds%2C%20professional%20architectural%20photography%2C%20wide%20composition&image_size=landscape_16_9') center 42% / cover no-repeat,
    linear-gradient(180deg, #1c0d12 0%, #4a1c1e 60%, #6d2118 100%);
  border-bottom: 2px solid #caa64a;
}
.palace-banner::after {
  content: ''; position: absolute; left: 4%; right: 4%; bottom: -3px; height: 7px;
  background:
    linear-gradient(180deg, #caa64a, #8a6508 50%, #5c4305);
  box-shadow: 0 2px 6px rgba(0, 0, 0, .5);
}

/* ============ 价值播报条（新增） ============ */
.ticker-wrap {
  display: flex; align-items: center; gap: 10px;
  margin: 12px 16px 0;
  padding: 8px 12px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(212, 175, 55, .12), rgba(212, 175, 55, .03));
  border-color: rgba(212, 175, 55, .3);
}
.ticker-label {
  flex-shrink: 0;
  font-size: 10px; font-weight: 700; letter-spacing: 2px;
  padding: 3px 10px;
  background: linear-gradient(135deg, #c0392b, #8e2318);
  border-radius: 10px; color: #ffe9d2;
  box-shadow: 0 0 8px rgba(192, 57, 43, .35);
  animation: tagPulse 2s ease-in-out infinite;
}
@keyframes tagPulse { 50% { box-shadow: 0 0 14px rgba(192, 57, 43, .55); } }
.ticker-track {
  flex: 1; overflow: hidden;
  mask-image: linear-gradient(90deg, transparent, #000 5%, #000 95%, transparent);
}
.ticker {
  display: inline-flex; white-space: nowrap; gap: 18px;
  will-change: transform;
}
.tk-item {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11.5px; color: var(--text-dim); letter-spacing: .5px;
}
.tk-item i {
  font-style: normal; font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
  padding: 1px 7px; border-radius: 5px;
}
.tk-item.ssr { color: var(--gold-pale); }
.tk-item.ssr i { background: linear-gradient(135deg, var(--ssr), #b8860b); color: #3a2405; }
.tk-item.normal i { background: rgba(212, 175, 55, .15); color: var(--gold); border: 1px solid var(--line-soft); }

/* ============ 景点页 ============ */
.spot-list { padding: 0 16px; }
.spot-item {
  display: flex; gap: 13px; align-items: center;
  margin-bottom: 12px; cursor: pointer; padding: 11px;
  transition: .15s;
}
.spot-item:active { background: #2a1710; }
.spot-thumb {
  width: 88px; aspect-ratio: 4/2.5; border-radius: 9px; flex-shrink: 0;
  background: linear-gradient(135deg, #5c1f18, #3a120c);
  background-size: cover; background-position: center;
  border: 1px solid var(--line);
  box-shadow: 0 4px 12px rgba(0, 0, 0, .4);
  position: relative;
}
.spot-thumb::after {
  content: ''; position: absolute; inset: 0; border-radius: 8px;
  background: linear-gradient(180deg, transparent 55%, rgba(18, 8, 6, .55));
}
.spot-info { flex: 1; min-width: 0; }
.spot-name-row { display: flex; align-items: center; gap: 7px; }
.spot-name-row b { font-size: 15.5px; color: var(--gold-pale); letter-spacing: 1.5px; }
.spot-era { font-size: 9.5px; color: var(--gold); border: 1px solid var(--line); border-radius: 9px; padding: 1.5px 7px; letter-spacing: 1px; }
.spot-brief { font-size: 10.5px; color: var(--text-dim); margin-top: 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spot-progress-row { display: flex; align-items: center; gap: 9px; margin-top: 7px; }
.spot-progress-row .progress-bar { flex: 1; height: 4.5px; }
.spot-progress-row span { font-size: 10.5px; color: var(--gold-light); font-variant-numeric: tabular-nums; }
.spot-lock-badge {
  font-size: 9.5px; color: var(--green); border: 1px solid rgba(126, 224, 163, .4);
  background: rgba(40, 90, 60, .18);
  border-radius: 9px; padding: 2.5px 7px; flex-shrink: 0; letter-spacing: 1px;
}

/* ============ 抽卡/合成/规则 操作区 ============ */
.dex-actions { padding: 14px 16px 0; }
.progress-bar {
  height: 7px; border-radius: 4px; overflow: hidden;
  background: rgba(0, 0, 0, .5); border: 1px solid rgba(212, 175, 55, .14);
}
.progress-bar i {
  display: block; height: 100%; width: 0; border-radius: 4px;
  background: linear-gradient(90deg, #8a6508, #d4af37 40%, #f5d06f 50%, #d4af37 60%, #8a6508);
  background-size: 200% 100%;
  transition: width .6s cubic-bezier(.22, .8, .36, 1);
}

/* 每日免费抽（背景：描金龙纹礼盒插画，左深右浅遮罩保文字可读） */
.btn-free {
  position: relative; overflow: hidden;
  width: 100%; border: none; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; gap: 15px; text-align: left;
  background:
    linear-gradient(90deg, rgba(46, 12, 8, .92) 0%, rgba(46, 12, 8, .78) 42%, rgba(46, 12, 8, .18) 100%),
    url('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=ornate%20imperial%20Chinese%20gift%20box%20with%20golden%20dragon%20embroidery%20on%20crimson%20silk%2C%20palace%20lanterns%20glowing%20in%20background%2C%20red%20and%20gold%20palette%2C%20warm%20light%2C%20elegant%20product%20illustration%2C%20wide%20banner%20composition&image_size=landscape_16_9') center / cover no-repeat,
    linear-gradient(135deg, #a83a2c 0%, #8c2b20 55%, #6d1d13 100%);
  border: 1px solid rgba(245, 208, 111, .5);
  box-shadow: 0 6px 22px rgba(164, 52, 42, .4), inset 0 1px 0 rgba(255, 255, 255, .14);
  border-radius: 16px; padding: 16px 18px; margin-bottom: 12px;
  transition: transform .15s;
}
.btn-free::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -70%; width: 45%;
  background: linear-gradient(105deg, transparent, rgba(255, 240, 200, .22), transparent);
  transform: skewX(-18deg); animation: sweep 3.2s ease-in-out infinite;
}
@keyframes sweep { 0%, 55% { left: -70%; } 100% { left: 160%; } }
.btn-free:active { transform: scale(.975); }
.btn-free.locked { filter: saturate(.35) brightness(.72); }
.btn-free.locked::after { animation: none; opacity: 0; }
.btn-free-text { display: flex; flex-direction: column; gap: 3px; position: relative; z-index: 1; }
.btn-free-text b { color: var(--gold-pale); font-size: 16.5px; letter-spacing: 2px; }
.btn-free-text small { color: rgba(243, 229, 200, .72); font-size: 10.5px; letter-spacing: .5px; }

/* SSR 合成台 */
.btn-craft {
  position: relative; overflow: hidden;
  width: 100%; font-family: inherit; cursor: pointer;
  background:
    radial-gradient(ellipse 70% 150% at 25% 0%, rgba(196, 154, 238, .22), transparent 55%),
    linear-gradient(135deg, #6b3fa0, #472a6e 70%);
  color: #f0e6ff; border: 1px solid rgba(196, 154, 238, .55);
  box-shadow: 0 6px 20px rgba(75, 42, 110, .45), inset 0 1px 0 rgba(255, 255, 255, .12);
  border-radius: 13px; padding: 13px; font-size: 15px; letter-spacing: 3px; margin-bottom: 11px;
}
.btn-craft::after {
  content: ''; position: absolute; top: -20%; bottom: -20%; left: -70%; width: 40%;
  background: linear-gradient(105deg, transparent, rgba(240, 230, 255, .2), transparent);
  transform: skewX(-18deg); animation: sweep 3.6s ease-in-out infinite;
}
.btn-craft:active { filter: brightness(1.18); }

/* 单抽/十连（背景：红金锦盒 / 十连金匣插画，文字居左同免费抽） */
.box-group { display: flex; gap: 11px; margin-bottom: 4px; }
.btn-box {
  position: relative; overflow: hidden;
  flex: 1; font-family: inherit; cursor: pointer; text-align: left;
  background:
    linear-gradient(90deg, rgba(40, 12, 8, .94) 0%, rgba(40, 12, 8, .82) 52%, rgba(40, 12, 8, .10) 100%),
    url('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=single%20exquisite%20crimson%20and%20gold%20Chinese%20gift%20box%20with%20golden%20ribbon%2C%20dark%20red%20lacquer%20background%2C%20glowing%20edges%2C%20elegant%20product%20illustration%2C%20wide%20banner%20composition&image_size=landscape_16_9') center / cover no-repeat,
    linear-gradient(135deg, #a83a2c, #77241a 75%);
  color: var(--text); border: 1px solid rgba(245, 208, 111, .45);
  box-shadow: 0 5px 16px rgba(120, 30, 20, .4), inset 0 1px 0 rgba(255, 255, 255, .1);
  border-radius: 13px; padding: 12px 14px; font-size: 15px; line-height: 1.35; letter-spacing: 2px;
}
.btn-box small { font-size: 10px; color: var(--gold-pale); letter-spacing: .5px; }
.btn-box-ten {
  background:
    linear-gradient(90deg, rgba(46, 26, 4, .94) 0%, rgba(46, 26, 4, .82) 52%, rgba(46, 26, 4, .10) 100%),
    url('https://trae-api-cn.mchost.guru/api/ide/v1/text_to_image?prompt=row%20of%20ten%20luxurious%20golden%20Chinese%20treasure%20chests%20glowing%20with%20light%2C%20crimson%20red%20background%2C%20festive%20and%20premium%2C%20elegant%20product%20illustration%2C%20wide%20banner%20composition&image_size=landscape_16_9') center / cover no-repeat,
    linear-gradient(135deg, #c99b2a, #8a6508 75%);
  border-color: rgba(245, 208, 111, .75);
}
.btn-box-ten small { color: #fff3d0; }
.btn-box:active { filter: brightness(1.18); }

/* 查看规则 */
.btn-rule {
  display: block; margin: 4px auto 0;
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  font-family: inherit; cursor: pointer;
  border-radius: 10px; padding: 10px 20px; font-size: 12px; letter-spacing: 2px;
  transition: .15s;
}
.btn-rule:active { background: rgba(212, 175, 55, .08); color: var(--gold-light); }

/* ============ 图鉴页 ============ */
.dex-progress { padding: 4px 18px 0; display: flex; align-items: center; gap: 11px; font-size: 12.5px; color: var(--text-dim); letter-spacing: 1px; }
.dex-progress b { color: var(--gold-light); font-size: 14px; font-variant-numeric: tabular-nums; }
.dex-progress .progress-bar { flex: 1; }

.rarity-tabs { display: flex; gap: 8px; padding: 14px 16px 12px; }
.rarity-tab {
  flex: 1; font-family: inherit; cursor: pointer;
  background: linear-gradient(165deg, #241310, #1b0d09);
  color: #8a7a60; border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 9px 0 7px;
  font-size: 13.5px; font-weight: 700; letter-spacing: 1px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  transition: .2s;
}
.rarity-tab span { font-size: 9.5px; font-weight: 400; letter-spacing: .5px; }
.rarity-tab.ssr.active { color: var(--ssr); border-color: rgba(240, 180, 41, .65); background: linear-gradient(165deg, rgba(240, 180, 41, .14), rgba(240, 180, 41, .03)); box-shadow: 0 0 14px rgba(240, 180, 41, .18); }
.rarity-tab.sr.active  { color: var(--sr);  border-color: rgba(196, 154, 238, .6); background: linear-gradient(165deg, rgba(196, 154, 238, .13), rgba(196, 154, 238, .03)); box-shadow: 0 0 14px rgba(196, 154, 238, .16); }
.rarity-tab.r.active   { color: var(--r);   border-color: rgba(109, 177, 232, .6); background: linear-gradient(165deg, rgba(109, 177, 232, .12), rgba(109, 177, 232, .03)); box-shadow: 0 0 14px rgba(109, 177, 232, .15); }
.rarity-tab.n.active   { color: var(--n);   border-color: rgba(147, 161, 173, .55); background: linear-gradient(165deg, rgba(147, 161, 173, .1), rgba(147, 161, 173, .02)); }

.card-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 11px; padding: 0 14px 18px; }
.card-cell {
  position: relative; overflow: hidden;
  border-radius: 13px; cursor: pointer;
  background: linear-gradient(165deg, #241310, #1a0c08);
  border: 1px solid rgba(212, 175, 55, .18);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .38);
  transition: transform .15s;
}
.card-cell:active { transform: scale(.965); }
.card-cell[data-rarity="SSR"] { border-color: rgba(240, 180, 41, .55); box-shadow: 0 6px 20px rgba(0, 0, 0, .4), 0 0 18px rgba(240, 180, 41, .13); }
.card-cell[data-rarity="SSR"]::after {
  content: ''; position: absolute; inset: -1px; border-radius: 14px; padding: 1.5px;
  background: conic-gradient(from var(--a), transparent 8%, rgba(245, 208, 111, .95) 16%, transparent 26%, transparent 58%, rgba(245, 208, 111, .55) 66%, transparent 76%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin 4.5s linear infinite; pointer-events: none;
}
@keyframes spin { to { --a: 360deg; } }
.card-cell[data-rarity="SR"] { border-color: rgba(196, 154, 238, .4); box-shadow: 0 6px 18px rgba(0, 0, 0, .38), 0 0 14px rgba(196, 154, 238, .1); }

.card-img { position: relative; aspect-ratio: 3/5; overflow: hidden; background: #140908; }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-img::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20, 9, 8, .12) 40%, rgba(20, 9, 8, .55));
  pointer-events: none;
}
.card-cell.locked .card-img img { filter: grayscale(1) brightness(.32); }
.card-cell.locked .card-img::before {
  content: '未 收 藏'; position: absolute; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: 5px; text-indent: 5px;
  color: rgba(212, 175, 55, .4);
}
.card-new {
  position: absolute; top: 7px; left: 7px; z-index: 3;
  font-size: 9.5px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(135deg, #c0392b, #8e2318); color: #ffe9d2;
  padding: 2px 8px; border-radius: 7px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
  animation: pulse 1.6s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(1.08); } }
.card-rarity-tag {
  position: absolute; top: 7px; right: 7px; z-index: 3;
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 1.5px 8px; border-radius: 7px;
  font-family: Georgia, serif;
  backdrop-filter: blur(2px);
}
.card-rarity-tag.SSR { background: linear-gradient(135deg, #f0b429, #b8860b); color: #38230a; box-shadow: 0 0 10px rgba(240, 180, 41, .5); }
.card-rarity-tag.SR  { background: linear-gradient(135deg, #9a6ec4, #6d3f96); color: #f6efff; box-shadow: 0 0 8px rgba(196, 154, 238, .4); }
.card-rarity-tag.R   { background: linear-gradient(135deg, #4d86bd, #2d5d8e); color: #eef6ff; }
.card-rarity-tag.N   { background: linear-gradient(135deg, #7c8894, #55606b); color: #f2f4f6; }
.card-count-tag {
  position: absolute; bottom: 7px; right: 7px; z-index: 3;
  font-size: 10px; font-weight: 700;
  background: rgba(12, 5, 4, .68); color: var(--gold-pale);
  border: 1px solid rgba(212, 175, 55, .35);
  border-radius: 8px; padding: 1.5px 8px; font-variant-numeric: tabular-nums;
}
.card-info { padding: 9px 11px 11px; position: relative; }
.card-info::before {
  content: ''; position: absolute; top: 0; left: 11px; right: 11px; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 175, 55, .25), transparent);
}
.card-name { font-size: 13px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .5px; }
.card-cell.locked .card-name { color: #7a6a55; }
.card-desc-mini {
  font-size: 10px; color: var(--text-dim); margin-top: 4px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* ============ 交易页 ============ */
.trade-tabs { display: flex; gap: 9px; padding: 10px 16px 13px; }
.trade-tab {
  flex: 1; font-family: inherit; cursor: pointer;
  background: linear-gradient(165deg, #241310, #1b0d09);
  color: #8a7a60; border: 1px solid var(--line-soft);
  border-radius: 11px; padding: 10px 0; font-size: 12.5px; letter-spacing: 1px;
  transition: .2s;
}
.trade-tab.active {
  color: var(--gold-pale); border-color: rgba(212, 175, 55, .6);
  background: linear-gradient(165deg, rgba(212, 175, 55, .14), rgba(212, 175, 55, .03));
  box-shadow: 0 0 12px rgba(212, 175, 55, .12);
}
.trade-panel { display: none; padding: 0 16px; }
.trade-panel.active { display: block; animation: fadeIn .25s ease; }
.trade-tip { font-size: 10.5px; color: var(--text-dim); text-align: center; margin-bottom: 11px; letter-spacing: 1px; }

/* 三步引导 */
.trade-guide {
  padding: 14px 16px 14px 16px;
  margin-bottom: 14px;
  position: relative;
}
.trade-guide h4 { font-size: 13px; color: var(--gold-pale); margin-bottom: 10px; letter-spacing: 2px; }
.trade-guide ol { padding: 0; list-style: none; }
.trade-guide li {
  display: flex; align-items: center; gap: 10px;
  font-size: 12.5px; color: var(--text); margin-bottom: 8px; letter-spacing: .5px;
}
.trade-guide li:last-child { margin-bottom: 0; }
.trade-guide li span {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, #c99b2a, #8a6508);
  color: #fff; font-weight: 700; font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .4);
}
.tg-close {
  position: absolute; top: 8px; right: 8px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0, 0, 0, .4); color: var(--text-dim);
  border: 1px solid var(--line); cursor: pointer; font-size: 11px;
}

.market-item, .mine-item, .sell-item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px; margin-bottom: 11px;
}
.market-thumb {
  width: 56px; height: 43px; border-radius: 8px; object-fit: cover; flex-shrink: 0;
  border: 1px solid var(--line); background: #140908;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}
.market-info { flex: 1; min-width: 0; }
.market-name { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .5px; }
.market-seller { font-size: 10px; color: var(--text-dim); margin-top: 3px; letter-spacing: .5px; }
.market-price { font-size: 14.5px; font-weight: 700; color: var(--gold-pale); flex-shrink: 0; font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.btn-buy {
  font-family: inherit; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #c99b2a, #8a6508);
  color: #fff8e6; border: 1px solid rgba(245, 208, 111, .5);
  border-radius: 9px; padding: 8px 15px; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .2);
}
.btn-buy:active { filter: brightness(1.18); }
.btn-buy.own, .btn-buy:disabled { background: #38302a; color: #87796a; border-color: rgba(212, 175, 55, .12); box-shadow: none; }
.btn-sell {
  font-family: inherit; cursor: pointer; flex-shrink: 0;
  background: none; border: 1px solid rgba(212, 175, 55, .55); color: var(--gold-pale);
  border-radius: 9px; padding: 8px 15px; font-size: 12px; font-weight: 700; letter-spacing: 2px;
}
.btn-sell:active { background: rgba(212, 175, 55, .12); }
.mine-status { font-size: 10px; margin-top: 3px; letter-spacing: .5px; }
.mine-status.pending { color: var(--text-dim); }
.mine-status.sold { color: var(--green); }
.empty-tip { text-align: center; color: #7a6a55; font-size: 12px; padding: 46px 0; letter-spacing: 2px; }

/* ============ 模态框 ============ */
.modal {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(8, 3, 2, .8); backdrop-filter: blur(5px);
  align-items: flex-end; justify-content: center;
}
.modal.open { display: flex; animation: fadeIn .2s ease; }
.modal-body {
  position: relative; width: 100%; max-width: 480px;
  max-height: 86vh; overflow-y: auto;
  background:
    radial-gradient(ellipse 90% 30% at 50% 0%, rgba(212, 175, 55, .07), transparent 60%),
    linear-gradient(180deg, #291410, #170a07);
  border: 1px solid var(--line); border-bottom: none;
  border-radius: 20px 20px 0 0;
  padding: 20px 18px calc(22px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 50px rgba(0, 0, 0, .6);
  animation: slideUp .28s cubic-bezier(.22, .8, .36, 1);
}
.modal-body::before {
  content: ''; position: sticky; display: block; top: 0;
  width: 38px; height: 4px; border-radius: 3px;
  background: rgba(212, 175, 55, .35);
  margin: -8px auto 14px;
}
@keyframes slideUp { from { transform: translateY(60px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(0, 0, 0, .45); color: var(--text-dim);
  border: 1px solid var(--line); cursor: pointer; font-size: 13px;
}
.modal-close:active { background: rgba(212, 175, 55, .15); }

.btn-main {
  position: relative; overflow: hidden;
  width: 100%; font-family: inherit; cursor: pointer;
  background: linear-gradient(135deg, #c99b2a, #8a6508 80%);
  color: #fff8e6; border: 1px solid rgba(245, 208, 111, .55);
  box-shadow: 0 5px 16px rgba(138, 101, 8, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
  border-radius: 12px; padding: 13px;
  font-size: 14px; font-weight: 700; letter-spacing: 3px;
}
.btn-main:active { filter: brightness(1.18); }
.btn-main:disabled { background: #33291f; color: #7d6e5c; border-color: rgba(212, 175, 55, .1); box-shadow: none; cursor: not-allowed; }
.btn-ghost {
  flex: 1; font-family: inherit; cursor: pointer;
  background: none; border: 1px solid var(--line); color: var(--text-dim);
  border-radius: 12px; padding: 13px; font-size: 14px; letter-spacing: 2px;
}

/* ============ 景点详情 ============ */
.spot-detail h3 { font-size: 20px; color: var(--gold-pale); margin: 12px 0 5px; letter-spacing: 3px; }
.spot-img {
  aspect-ratio: 4/2.5; border-radius: 13px; background-size: cover; background-position: center;
  background-color: #5c1f18; border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.spot-meta { font-size: 10.5px; color: var(--gold); margin-bottom: 9px; letter-spacing: 1.5px; }
.spot-desc { font-size: 12.5px; line-height: 2; color: var(--text); margin-bottom: 12px; text-align: justify; }
.spot-checkin {
  background: linear-gradient(135deg, rgba(126, 224, 163, .09), rgba(126, 224, 163, .03));
  border: 1px dashed rgba(126, 224, 163, .45);
  border-radius: 12px; padding: 11px 13px; margin-bottom: 13px;
  display: flex; align-items: center; gap: 11px;
}
.spot-checkin .sc-text { flex: 1; }
.spot-checkin .sc-title { font-size: 13px; color: var(--green); letter-spacing: 1px; }
.spot-checkin .sc-hint { font-size: 10px; color: var(--text-dim); margin-top: 4px; line-height: 1.6; }
.btn-checkin {
  font-family: inherit; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #2e7d4f, #1c5735);
  color: #eafff2; border: 1px solid rgba(126, 224, 163, .5);
  border-radius: 10px; padding: 10px 16px; font-size: 12.5px; font-weight: 700; letter-spacing: 2px;
  box-shadow: 0 4px 12px rgba(30, 87, 53, .4), inset 0 1px 0 rgba(255, 255, 255, .15);
}
.btn-checkin:disabled { background: #33291f; color: #7d6e5c; border-color: rgba(212, 175, 55, .1); box-shadow: none; }
.spot-detail h4 { font-size: 13px; color: var(--gold); margin: 6px 0 9px; letter-spacing: 2px; display: flex; align-items: center; gap: 8px; }
.spot-detail h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212, 175, 55, .3), transparent); }
.spot-cards { display: flex; gap: 9px; overflow-x: auto; padding-bottom: 5px; }
.spot-cards .sc-cell { flex-shrink: 0; width: 88px; cursor: pointer; }
.spot-cards .sc-cell img {
  width: 88px; aspect-ratio: 3/5; object-fit: cover; border-radius: 9px;
  border: 1px solid var(--line); display: block; background: #140908;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .4);
}
.sc-cell.locked img { filter: grayscale(1) brightness(.32); }
.sc-cell p { font-size: 9px; color: #7a6a55; margin-top: 5px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; letter-spacing: .5px; }
.sc-cell.unlocked p { color: var(--text); }

/* ============ 卡片详情 ============ */
.card-detail { text-align: center; }
.cd-img { position: relative; margin: 8px auto 0; width: 212px; }
.cd-img img {
  width: 212px; border-radius: 14px; display: block;
  border: 2px solid rgba(212, 175, 55, .55);
  box-shadow: 0 10px 34px rgba(0, 0, 0, .55), 0 0 26px rgba(212, 175, 55, .12);
}
.card-detail.locked .cd-img img { filter: grayscale(1) brightness(.32); box-shadow: 0 10px 30px rgba(0, 0, 0, .5); }
.cd-rarity {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  font-size: 12px; font-weight: 700; letter-spacing: 2px;
  padding: 3px 16px; border-radius: 11px;
  font-family: Georgia, serif;
  box-shadow: 0 3px 10px rgba(0, 0, 0, .5);
}
.cd-rarity.SSR { background: linear-gradient(135deg, #f0b429, #b8860b); color: #38230a; }
.cd-rarity.SR  { background: linear-gradient(135deg, #9a6ec4, #6d3f96); color: #f6efff; }
.cd-rarity.R   { background: linear-gradient(135deg, #4d86bd, #2d5d8e); color: #eef6ff; }
.cd-rarity.N   { background: linear-gradient(135deg, #7c8894, #55606b); color: #f2f4f6; }
.card-detail h3 { font-size: 17.5px; margin: 14px 0 7px; color: var(--gold-pale); letter-spacing: 2px; }
.cd-obtain { font-size: 10.5px; color: var(--gold); margin-bottom: 9px; letter-spacing: 1px; }
.cd-desc { font-size: 12.5px; color: var(--text); line-height: 2; padding: 0 10px; margin-bottom: 9px; text-align: justify; }
.cd-count { font-size: 12px; color: var(--text-dim); margin-bottom: 13px; letter-spacing: 1px; }
.cd-count b { color: var(--gold-light); }

/* ===== 价值栏 ===== */
.cd-value {
  margin: 4px 0 12px; padding: 12px 14px;
  background: linear-gradient(165deg, rgba(212, 175, 55, .08), rgba(212, 175, 55, .02));
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  text-align: left;
}
.cd-value.ssr {
  background: linear-gradient(135deg, rgba(240, 180, 41, .16), rgba(240, 180, 41, .03));
  border-color: rgba(240, 180, 41, .5);
  box-shadow: 0 0 16px rgba(240, 180, 41, .12);
}
.cv-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; font-size: 12.5px;
}
.cv-row + .cv-row { border-top: 1px dashed rgba(212, 175, 55, .12); }
.cv-label { color: var(--text-dim); letter-spacing: 1px; }
.cv-row b { color: var(--gold-pale); font-size: 14px; font-variant-numeric: tabular-nums; }
.cv-row b .trend { font-size: 11px; margin-left: 4px; font-style: normal; padding: 1px 6px; border-radius: 6px; letter-spacing: .5px; }
.cv-row b .trend.up { background: rgba(126, 224, 163, .15); color: var(--green); }
.cv-row b .trend.down { background: rgba(224, 138, 138, .15); color: #e08a8a; }
.cv-row b .trend.flat { background: rgba(168, 144, 109, .12); color: var(--text-dim); }
.cv-row b.up { color: var(--green); }
.cv-row b.down { color: #e08a8a; }
.cv-row b.cv-ssr {
  font-size: 18px;
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%, #9a7b2d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  letter-spacing: .5px;
}
.cv-tip { font-size: 10.5px; color: var(--text-dim); margin-top: 8px; line-height: 1.6; letter-spacing: .5px; text-align: center; }

/* ===== SSR 典藏权益 ===== */
#cdSsrRights {
  margin: 0 0 12px; padding: 14px 16px;
  background: linear-gradient(135deg, rgba(240, 180, 41, .12), rgba(240, 180, 41, .02));
  border: 1px solid rgba(240, 180, 41, .45);
  border-radius: 13px;
  text-align: left;
  box-shadow: 0 0 18px rgba(240, 180, 41, .1);
}
#cdSsrRights h4 {
  text-align: center; font-size: 13px;
  color: #f9e8b0; letter-spacing: 4px; margin-bottom: 11px;
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%, #9a7b2d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.rights-list { margin-bottom: 11px; }
.rl-item {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 6px 0; font-size: 12px; color: var(--text);
  letter-spacing: .5px; line-height: 1.6;
  border-bottom: 1px dashed rgba(212, 175, 55, .1);
}
.rl-item:last-child { border-bottom: none; }
.rl-ic { font-style: normal; flex-shrink: 0; font-size: 16px; }
.rl-item.valuation b {
  font-size: 14px; color: var(--gold-pale);
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.btn-claim {
  width: 100%; font-family: inherit; cursor: pointer;
  background: linear-gradient(135deg, #c99b2a, #8a6508 80%);
  color: #fff8e6; border: 1px solid rgba(245, 208, 111, .55);
  box-shadow: 0 5px 16px rgba(138, 101, 8, .4), inset 0 1px 0 rgba(255, 255, 255, .22);
  border-radius: 11px; padding: 11px;
  font-size: 13.5px; font-weight: 700; letter-spacing: 3px;
  animation: claimPulse 2s ease-in-out infinite;
}
@keyframes claimPulse { 50% { box-shadow: 0 5px 22px rgba(240, 180, 41, .55), inset 0 1px 0 rgba(255, 255, 255, .22); } }
.btn-claim.claimed { background: linear-gradient(165deg, #2a1710, #1e0f0a); color: var(--green); border-color: rgba(126, 224, 163, .4); animation: none; }
.claim-tip { font-size: 10.5px; color: var(--text-dim); text-align: center; margin-top: 8px; letter-spacing: .5px; }

/* ===== 获取攻略 ===== */
#cdGuide {
  margin: 0 0 12px; padding: 13px 14px;
  background: linear-gradient(165deg, rgba(126, 38, 27, .12), rgba(126, 38, 27, .02));
  border: 1px solid rgba(212, 175, 55, .2);
  border-radius: 12px;
  text-align: left;
}
#cdGuide h4 {
  font-size: 12.5px; color: var(--gold-pale); margin-bottom: 9px; letter-spacing: 2px;
  display: flex; align-items: center; gap: 8px;
}
#cdGuide h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212, 175, 55, .3), transparent); }
.og-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 7px 0; font-size: 12px; color: var(--text);
  border-bottom: 1px dashed rgba(212, 175, 55, .1);
}
.og-row:last-child { border-bottom: none; }
.og-rate { font-style: normal; font-size: 10.5px; color: var(--gold); margin-left: 6px; letter-spacing: .5px; }
.og-go {
  font-family: inherit; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #c99b2a, #8a6508);
  color: #fff8e6; border: 1px solid rgba(245, 208, 111, .45);
  border-radius: 8px; padding: 6px 11px; font-size: 11px; font-weight: 700; letter-spacing: 1.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3);
}
.og-go:disabled { background: #38302a; color: #87796a; border-color: rgba(212, 175, 55, .12); }
.og-go:active:not(:disabled) { filter: brightness(1.18); }

/* 操作按钮 */
.cd-actions { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 4px; }
.btn-card-op {
  font-family: inherit; cursor: pointer;
  background: linear-gradient(165deg, #2a1710, #1e0f0a);
  border: 1px solid var(--line);
  color: var(--text); border-radius: 11px; padding: 11px 4px; font-size: 11px; letter-spacing: 1px;
  transition: .15s;
}
.btn-card-op:active { background: #33201a; }
.btn-card-op:disabled { color: #5e5245; border-color: rgba(212, 175, 55, .08); }
.btn-card-op.recyclable { border-color: rgba(126, 224, 163, .45); color: var(--green); }
.btn-card-op.sellable { border-color: rgba(212, 175, 55, .55); color: var(--gold-light); }

/* ============ SSR 详情页主操作：鎏金开炉 ============ */
.cd-ssr-craft { padding: 14px 13px 12px; margin-top: 4px; }
.btn-ssr-craft {
  width: 100%; font-family: inherit; cursor: pointer;
  background: linear-gradient(135deg, #c99b2a 0%, #8a6508 80%);
  color: #fff8e6; border: 1px solid rgba(245, 208, 111, .65);
  box-shadow: 0 5px 18px rgba(138, 101, 8, .5), inset 0 1px 0 rgba(255, 255, 255, .22);
  border-radius: 12px; padding: 13px;
  font-size: 14.5px; font-weight: 700; letter-spacing: 4px; text-indent: 4px;
  position: relative; overflow: hidden;
  animation: ssrCraftGlow 2.2s ease-in-out infinite;
}
.btn-ssr-craft:active { filter: brightness(1.18); }
.btn-ssr-craft:disabled {
  background: #2b1c15; color: #6e5c48; border-color: rgba(212, 175, 55, .1);
  box-shadow: none; cursor: not-allowed; animation: none;
}
.btn-ssr-craft.done {
  background: linear-gradient(135deg, rgba(126, 224, 163, .18), rgba(126, 224, 163, .05));
  border-color: rgba(126, 224, 163, .55); color: var(--green); animation: none;
}
@keyframes ssrCraftGlow {
  50% { box-shadow: 0 5px 24px rgba(240, 180, 41, .55), inset 0 1px 0 rgba(255, 255, 255, .28); }
}
.csc-progress {
  position: relative; height: 14px; border-radius: 7px; margin: 11px 0 7px;
  background: rgba(0, 0, 0, .45); border: 1px solid var(--line-soft); overflow: hidden;
}
.csc-progress i {
  display: block; height: 100%;
  background: linear-gradient(90deg, #c99b2a, #f5d06f 50%, #c99b2a);
  background-size: 200% 100%;
  box-shadow: 0 0 8px rgba(240, 180, 41, .5);
  transition: width .4s ease;
  animation: cscShine 2.5s linear infinite;
}
@keyframes cscShine { to { background-position: -200% 0; } }
.csc-progress span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 9.5px; letter-spacing: 1.5px; color: var(--gold-pale);
  text-shadow: 0 1px 2px rgba(0, 0, 0, .7);
}
.csc-hint {
  font-size: 10.5px; color: var(--text-dim); letter-spacing: 1px; line-height: 1.7;
  text-align: center; margin-top: 2px;
}

/* ============ 鎏金开炉（SSR 合成仪式） ============ */
.craft-header { text-align: center; margin-bottom: 15px; }
.craft-header h3 {
  font-size: 21px; letter-spacing: 7px; text-indent: 7px;
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%, #9a7b2d);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.craft-header p { font-size: 9.5px; color: var(--text-dim); letter-spacing: 2.5px; margin-top: 4px; }

/* ① 选方药签 */
.recipe-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.recipe-tab {
  flex: 1; position: relative; font-family: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 4px 9px; border-radius: 11px;
  background: linear-gradient(180deg, rgba(42, 23, 16, .8), rgba(24, 12, 9, .9));
  border: 1px solid var(--line-soft);
  transition: border-color .25s, box-shadow .25s, transform .15s;
}
.recipe-tab img {
  width: 44px; aspect-ratio: 3/5; object-fit: cover; border-radius: 5px;
  border: 1px solid rgba(240, 180, 41, .3);
  filter: saturate(.55) brightness(.75);
  transition: filter .25s, box-shadow .25s;
}
.recipe-tab .rt-name { font-size: 11.5px; color: var(--text); letter-spacing: 1px; }
.recipe-tab .rt-price { font-size: 9px; color: var(--text-dim); letter-spacing: .5px; }
.recipe-tab.active {
  border-color: rgba(240, 180, 41, .65);
  box-shadow: 0 0 18px rgba(240, 180, 41, .22), inset 0 1px 0 rgba(255, 255, 255, .05);
  transform: translateY(-2px);
}
.recipe-tab.active img { filter: none; box-shadow: 0 0 14px rgba(240, 180, 41, .35); }
.recipe-tab.active .rt-name { color: var(--gold-pale); }
.recipe-tab .rt-done {
  position: absolute; top: -6px; right: -4px; font-style: normal;
  font-size: 8.5px; color: #38230a; letter-spacing: 1px;
  background: linear-gradient(135deg, #f0b429, #b8860b);
  border-radius: 7px; padding: 2px 5px;
  box-shadow: 0 0 8px rgba(240, 180, 41, .5);
}

/* ② 炼成法阵 */
.forge-stage { position: relative; padding: 4px 0 2px; }
.forge-circle {
  position: relative; width: 218px; height: 218px; margin: 0 auto 14px;
}
.forge-circle .ring {
  position: absolute; border-radius: 50%;
  transform: translate(-50%, -50%); left: 50%; top: 50%;
}
.ring.outer {
  width: 218px; height: 218px;
  border: 1px solid rgba(212, 175, 55, .4);
  box-shadow: 0 0 24px rgba(212, 175, 55, .1), inset 0 0 24px rgba(212, 175, 55, .07);
  animation: forgeSpin 70s linear infinite;
}
.ring.mid {
  width: 172px; height: 172px;
  border: 1px dashed rgba(212, 175, 55, .45);
  animation: forgeSpin 45s linear infinite reverse;
}
.ring.inner {
  width: 126px; height: 126px;
  border: 3px double rgba(212, 175, 55, .35);
  animation: forgeSpin 60s linear infinite;
}
@keyframes forgeSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }

.bagua { position: absolute; inset: 0; animation: forgeSpin2 90s linear infinite; }
@keyframes forgeSpin2 { to { transform: rotate(360deg); } }
.bagua b {
  position: absolute; left: 50%; top: 50%; margin: -8px;
  font-size: 15px; font-weight: 400; color: var(--gold-dim); opacity: .85;
  transform: rotate(var(--r)) translateY(-97px) rotate(calc(var(--r) * -1));
}

.forge-core {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(circle at 50% 42%, rgba(240, 180, 41, .22), rgba(24, 12, 9, .96) 68%);
  border: 1px solid rgba(240, 180, 41, .5);
  box-shadow: 0 0 26px rgba(240, 180, 41, .14), inset 0 0 18px rgba(240, 180, 41, .1);
  transition: box-shadow .4s;
}
.forge-core span { font-size: 34px; filter: drop-shadow(0 0 8px rgba(240, 180, 41, .5)); }
/* 未开炉：太极居中聚灵（八卦环抱太极），缓转待发 */
.forge-stage:not(.ready) .forge-core span {
  font-size: 44px; line-height: 1;
  background: linear-gradient(160deg, var(--gold-pale), var(--gold-light) 48%, var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: taijiSpin 18s linear infinite;
}
@keyframes taijiSpin { to { transform: rotate(360deg); } }
.forge-stage.ready .forge-core {
  box-shadow: 0 0 34px rgba(240, 180, 41, .38), inset 0 0 24px rgba(240, 180, 41, .22);
  animation: corePulse 2.2s ease-in-out infinite;
}
@keyframes corePulse {
  50% { box-shadow: 0 0 46px rgba(240, 180, 41, .55), inset 0 0 30px rgba(240, 180, 41, .3); }
}

/* 蓄力时法阵加速 */
.forge-stage.charging .ring.outer { animation-duration: 3.5s; }
.forge-stage.charging .ring.mid   { animation-duration: 2.2s; }
.forge-stage.charging .ring.inner { animation-duration: 2.8s; }
.forge-stage.charging .bagua      { animation-duration: 4s; }
.forge-stage.charging .forge-core { animation: corePulse .5s ease-in-out infinite; }

/* 材料槽 */
.slot-row { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; }
.slot {
  flex: 1; max-width: 96px; text-align: center;
  padding: 9px 4px 8px; border-radius: 10px;
  background: linear-gradient(180deg, rgba(42, 23, 16, .55), rgba(24, 12, 9, .75));
  border: 1px solid var(--line-soft);
  transition: border-color .3s, box-shadow .3s;
}
.slot i { font-size: 17px; font-style: normal; display: block; margin-bottom: 3px; filter: grayscale(1) brightness(.6); transition: filter .3s; }
.slot b { display: block; font-size: 10px; color: var(--text-dim); letter-spacing: 1px; font-weight: 400; }
.slot b em { display: block; font-style: normal; font-size: 11.5px; color: var(--text); margin-top: 2px; letter-spacing: .5px; }
.slot span { display: block; font-size: 9px; color: var(--text-dim); margin-top: 4px; letter-spacing: .5px; }
.slot.ok { border-color: rgba(240, 180, 41, .5); box-shadow: 0 0 12px rgba(240, 180, 41, .14); }
.slot.ok i { filter: none; }
.slot.ok b em { color: var(--gold-pale); }
.slot.ok span { color: var(--green); }

/* ③ 注灵开炉按钮 */
.charge-zone { margin-top: 2px; }
.btn-charge {
  position: relative; overflow: hidden; width: 100%;
  font-family: inherit; cursor: pointer; user-select: none; -webkit-user-select: none; touch-action: none;
  background: linear-gradient(135deg, #6e1f16, #431009);
  color: var(--gold-pale); border: 1px solid rgba(240, 180, 41, .5);
  box-shadow: 0 5px 18px rgba(110, 31, 22, .5), inset 0 1px 0 rgba(255, 255, 255, .1);
  border-radius: 13px; padding: 15px;
  font-size: 14.5px; font-weight: 700; letter-spacing: 4px; text-indent: 4px;
  transition: filter .2s;
}
.btn-charge:disabled {
  background: #2b1c15; color: #6e5c48; border-color: rgba(212, 175, 55, .1); box-shadow: none; cursor: not-allowed;
}
.btn-charge .charge-fill {
  position: absolute; left: 0; top: 0; bottom: 0; width: 0;
  background: linear-gradient(90deg, rgba(240, 180, 41, .28), rgba(240, 180, 41, .55));
  box-shadow: 0 0 14px rgba(240, 180, 41, .5);
}
.btn-charge .charge-text { position: relative; z-index: 1; }
.btn-charge.charging { animation: chargeShake .12s linear infinite; filter: brightness(1.15); }
@keyframes chargeShake { 25% { transform: translateX(.6px); } 75% { transform: translateX(-.6px); } }
.charge-hint {
  text-align: center; font-size: 10.5px; color: var(--text-dim);
  letter-spacing: 1px; margin-top: 9px; line-height: 1.8; min-height: 19px;
}

/* ============ 铸成庆典 ============ */
.modal.ceremony { align-items: center; }
.modal.ceremony .ceremony-stage {
  position: relative; width: 100%; max-width: 480px; height: 100%;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 30px 26px calc(30px + env(safe-area-inset-bottom));
  overflow: hidden;
  background:
    radial-gradient(ellipse 90% 50% at 50% 46%, rgba(240, 180, 41, .1), transparent 65%),
    linear-gradient(180deg, #1c0d08, #0d0503);
}
.c-rays {
  position: absolute; left: 50%; top: 46%; width: 640px; height: 640px;
  margin: -320px 0 0 -320px; border-radius: 50%;
  background: repeating-conic-gradient(rgba(240, 180, 41, .07) 0 6deg, transparent 6deg 18deg);
  animation: raysSpin 26s linear infinite;
  opacity: 0;
}
.ceremony-stage.play .c-rays { animation: raysSpin 26s linear infinite, raysIn 1.2s ease .1s forwards; }
@keyframes raysSpin { to { transform: rotate(360deg); } }
@keyframes raysIn { to { opacity: 1; } }

.c-sparks { position: absolute; inset: 0; pointer-events: none; }
.c-sparks i {
  position: absolute; bottom: -12px; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-light);
  box-shadow: 0 0 8px 2px rgba(240, 180, 41, .55);
  opacity: 0;
}
.ceremony-stage.play .c-sparks i { animation: sparkRise 2.8s ease-in .3s infinite; }
@keyframes sparkRise {
  0%   { transform: translateY(0) translateX(0); opacity: 0; }
  12%  { opacity: 1; }
  100% { transform: translateY(-78vh) translateX(var(--dx, 0)); opacity: 0; }
}

.c-card { position: relative; width: 172px; margin-bottom: 20px; perspective: 900px; }
.c-card-inner {
  position: relative; border-radius: 12px; overflow: hidden;
  border: 1.5px solid rgba(240, 180, 41, .8);
  box-shadow: 0 0 34px rgba(240, 180, 41, .4), 0 14px 40px rgba(0, 0, 0, .6);
  transform-style: preserve-3d;
  opacity: 0;
}
.ceremony-stage.play .c-card-inner { animation: cardReveal 1s cubic-bezier(.2, .75, .3, 1.1) .25s forwards; }
@keyframes cardReveal {
  0%   { transform: rotateY(94deg) scale(.55); opacity: 0; }
  60%  { opacity: 1; }
  100% { transform: rotateY(0) scale(1); opacity: 1; }
}
.c-card-inner img { display: block; width: 100%; aspect-ratio: 3/5; object-fit: cover; }
.c-card-tag {
  position: absolute; top: 8px; right: 8px;
  font-size: 9px; letter-spacing: 1px; color: #38230a;
  background: linear-gradient(135deg, #f0b429, #b8860b);
  border-radius: 5px; padding: 2px 6px;
  box-shadow: 0 0 10px rgba(240, 180, 41, .5);
}
.c-seal {
  position: absolute; right: -13px; bottom: -11px; z-index: 2;
  width: 48px; height: 48px; display: flex; align-items: center; justify-content: center;
  font-style: normal; font-size: 13px; font-weight: 700; letter-spacing: 2px; text-indent: 2px;
  color: #ffefe3; writing-mode: vertical-rl;
  background: linear-gradient(160deg, #a4342a, #6e1f16);
  border: 2px solid rgba(249, 232, 176, .85); border-radius: 8px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .55);
  opacity: 0;
}
.ceremony-stage.play .c-seal { animation: sealStamp .4s cubic-bezier(.3, 1.6, .5, 1) 1.35s forwards; }
@keyframes sealStamp {
  0% { opacity: 0; transform: scale(2.4) rotate(-16deg); }
  100% { opacity: 1; transform: scale(1) rotate(-8deg); }
}

.c-name {
  font-size: 19px; letter-spacing: 4px; color: var(--gold-pale); margin-bottom: 8px;
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
  opacity: 0;
}
.ceremony-stage.play .c-name { animation: fadeUp .5s ease 1.7s forwards; }
.c-quote {
  max-width: 300px; font-size: 11px; line-height: 2; color: var(--text-dim);
  text-align: center; letter-spacing: 1px; margin-bottom: 12px; opacity: 0;
}
.ceremony-stage.play .c-quote { animation: fadeUp .5s ease 1.85s forwards; }
.c-value {
  font-size: 12px; color: var(--text); text-align: center; letter-spacing: 1px;
  line-height: 2; margin-bottom: 22px; opacity: 0;
}
.ceremony-stage.play .c-value { animation: fadeUp .5s ease 2s forwards; }
.c-value b { color: var(--gold-light); font-size: 14px; }
.c-value i { font-style: normal; color: var(--text-dim); font-size: 10.5px; }
.ceremony-stage .btn-main { max-width: 240px; opacity: 0; }
.ceremony-stage.play .btn-main { animation: fadeUp .5s ease 2.2s forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ============ 开盒 ============ */
.box-body { text-align: center; }
.box-body h3 { font-size: 17px; color: var(--gold-pale); margin-bottom: 15px; letter-spacing: 4px; }
.box-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-bottom: 15px; }
.box-grid.single { grid-template-columns: repeat(1, minmax(0, 190px)); justify-content: center; }
.box-card {
  position: relative; border-radius: 11px; overflow: hidden;
  border: 1px solid var(--line-soft); background: #140908;
  animation: flipIn .55s cubic-bezier(.22, .8, .36, 1) both;
}
@keyframes flipIn {
  0% { transform: rotateY(90deg) scale(.75); opacity: 0; }
  100% { transform: none; opacity: 1; }
}
.box-card > div { position: relative; }
.box-card img { width: 100%; aspect-ratio: 3/5; object-fit: cover; display: block; }
.box-card .br-tag { position: absolute; top: 5px; right: 5px; }
.box-card.new-card::after {
  content: 'NEW'; position: absolute; top: 5px; left: 5px;
  font-size: 9px; font-weight: 700; letter-spacing: 1px;
  background: linear-gradient(135deg, #c0392b, #8e2318); color: #ffe9d2;
  border-radius: 6px; padding: 1px 6px; box-shadow: 0 2px 8px rgba(0, 0, 0, .5);
}
.box-card.ssr-card { border-color: rgba(240, 180, 41, .8); box-shadow: 0 0 20px rgba(240, 180, 41, .35); }
.box-card.sr-card  { border-color: rgba(196, 154, 238, .7); box-shadow: 0 0 16px rgba(196, 154, 238, .3); }
.box-summary { font-size: 12px; color: var(--text-dim); margin-bottom: 13px; letter-spacing: .5px; }
.box-summary b { color: var(--gold-light); }
.box-actions { display: flex; flex-direction: column; gap: 9px; }

/* ============ 回收 / 出售 ============ */
.recycle-body h3, .sell-body h3 { font-size: 16px; color: var(--gold-pale); margin-bottom: 11px; text-align: center; letter-spacing: 3px; }
.recycle-cardname { font-size: 13px; text-align: center; margin-bottom: 14px; letter-spacing: 1px; }
.recycle-ctrl { display: flex; align-items: center; justify-content: center; gap: 22px; margin-bottom: 13px; }
.rc-btn {
  width: 42px; height: 42px; border-radius: 50%; font-size: 20px;
  background: linear-gradient(165deg, #2a1710, #1e0f0a);
  color: var(--gold-light); border: 1px solid var(--line);
  cursor: pointer; font-family: inherit;
}
.rc-btn:active { background: #33201a; transform: scale(.92); }
.rc-num { font-size: 23px; font-weight: 700; color: var(--text); min-width: 44px; text-align: center; font-variant-numeric: tabular-nums; }
.recycle-calc { font-size: 12px; color: var(--text-dim); text-align: center; margin-bottom: 15px; line-height: 1.9; letter-spacing: .5px; }
.recycle-calc b { color: var(--gold-light); font-size: 13.5px; }
.recycle-calc .hit { color: var(--green); font-style: normal; margin-left: 6px; }
.recycle-calc .warn { color: #e08a8a; font-style: normal; margin-left: 6px; }

/* 出售定价锚点 */
.sell-anchor { padding: 11px 14px; margin-bottom: 14px; }
.sa-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 4px 0; font-size: 12.5px;
}
.sa-row + .sa-row { border-top: 1px dashed rgba(212, 175, 55, .1); }
.sa-row span { color: var(--text-dim); letter-spacing: 1px; }
.sa-row b { color: var(--gold-pale); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.sa-row b.hl {
  background: linear-gradient(165deg, #f9e8b0, #f5d06f 40%, #d4af37 70%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

.sell-price-row { display: flex; align-items: center; gap: 9px; margin-bottom: 13px; }
.sell-price-row label { font-size: 13px; flex-shrink: 0; letter-spacing: 1px; }
.sell-price-row input {
  flex: 1; font-family: inherit; font-size: 17px; color: var(--gold-pale);
  background: rgba(0, 0, 0, .4); border: 1px solid var(--line);
  border-radius: 11px; padding: 11px 13px; outline: none;
  font-variant-numeric: tabular-nums;
}
.sell-price-row input:focus { border-color: rgba(212, 175, 55, .55); }
.sell-quick {
  font-family: inherit; cursor: pointer; flex-shrink: 0;
  background: linear-gradient(135deg, #c99b2a, #8a6508);
  color: #fff8e6; border: 1px solid rgba(245, 208, 111, .45);
  border-radius: 11px; padding: 11px 14px; font-size: 12px; font-weight: 700; letter-spacing: 2px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}
.sell-quick:active { filter: brightness(1.18); }

/* ============ 规则弹层 ============ */
.rule-body h3 { font-size: 16px; color: var(--gold-pale); text-align: center; margin-bottom: 14px; letter-spacing: 4px; }
.rules { padding: 0 2px 4px; }
.rule-block { padding: 13px 14px; margin-bottom: 11px; }
.rule-block h4 { font-size: 14px; color: var(--gold-pale); margin-bottom: 9px; letter-spacing: 2px; display: flex; align-items: center; gap: 8px; }
.rule-block h4::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, rgba(212, 175, 55, .3), transparent); }
.rule-block p { font-size: 12px; color: var(--text); line-height: 1.9; margin-bottom: 6px; }
.rule-block ul { padding-left: 16px; }
.rule-block li { font-size: 12px; line-height: 2; color: var(--text); }
.rule-block table { width: 100%; border-collapse: collapse; font-size: 11px; margin: 8px 0; }
.rule-block th { color: var(--gold); border-bottom: 1px solid var(--line); padding: 5px 4px; text-align: left; font-size: 11px; letter-spacing: 1px; white-space: nowrap; }
.rule-block td { padding: 5px 4px; border-bottom: 1px solid rgba(212, 175, 55, .08); color: var(--text); line-height: 1.55; }
.rule-block tr:last-child td { border-bottom: none; }
.rule-note { font-size: 10.5px; color: var(--text-dim); line-height: 1.8; }

/* ============ 确认框 ============ */
.confirm-body { text-align: center; }
.confirm-body p { font-size: 14px; line-height: 2; margin-bottom: 18px; white-space: pre-line; letter-spacing: .5px; }
.confirm-actions { display: flex; gap: 11px; }
.confirm-actions .btn-main { flex: 1; }
.confirm-actions .btn-ghost { flex: 1; }

/* ============ Toast ============ */
.toast {
  position: fixed; left: 50%; bottom: 104px;
  transform: translateX(-50%) translateY(20px);
  background: linear-gradient(165deg, #2b1611, #1c0d09);
  color: var(--gold-pale);
  border: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .55);
  border-radius: 12px;
  padding: 11px 20px; font-size: 13px; z-index: 200;
  opacity: 0; pointer-events: none; transition: .28s ease;
  max-width: 82%; text-align: center; letter-spacing: 1px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 3px; height: 3px; }
::-webkit-scrollbar-thumb { background: rgba(212, 175, 55, .4); border-radius: 2px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 景点列表 ⇄ 地图 切换 ============ */
.spot-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 16px; margin-bottom: 12px;
}
.spot-count { font-size: 11px; color: var(--text-dim); letter-spacing: 1px; }
.spot-count b { color: var(--gold-light); font-size: 13px; }
.view-toggle {
  display: flex; gap: 3px; padding: 3px;
  background: rgba(18, 8, 6, .92);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}
.vt-btn {
  border: 1px solid transparent; background: none; cursor: pointer; font-family: inherit;
  font-size: 11px; letter-spacing: 1px; color: var(--text-dim);
  padding: 5px 12px; border-radius: 14px; transition: all .2s;
}
.vt-btn.active {
  color: var(--gold-pale);
  background: linear-gradient(135deg, #a83a2c, #6d1d13);
  border-color: rgba(245, 208, 111, .4);
  box-shadow: 0 2px 8px rgba(164, 52, 42, .4);
}

/* ============ 景点地图（Leaflet + 高德瓦片） ============ */
/* z-index:0 建立独立层叠上下文，避免 Leaflet 内部控件浮到模态框之上 */
.spot-map-wrap {
  position: relative; z-index: 0;
  margin: 0 16px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #1a0e0a;
}
/* 手机端限高：地图 + 上方信息 ≈ 一屏，抽卡操作条保持首屏可见可点 */
#spotMap { height: 46vh; min-height: 300px; max-height: 520px; }
.map-hint {
  padding: 7px 12px; text-align: center;
  font-size: 10.5px; color: var(--text-dim); letter-spacing: 1px;
  background: rgba(18, 8, 6, .92);
  border-top: 1px solid var(--line-soft);
}
.map-loading, .map-error {
  position: absolute; inset: 0; z-index: 500;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: rgba(18, 8, 6, .94); color: var(--text-dim);
  font-size: 13px; letter-spacing: 1px;
}
.map-error b { color: var(--gold-pale); font-size: 15px; }
.map-error span { font-size: 11px; }
.map-error .btn-main { margin-top: 6px; }

/* Leaflet 主题化（玄墨鎏金） */
.leaflet-container { font-family: inherit; background: #1a0e0a; }
.leaflet-control-attribution {
  background: rgba(18, 8, 6, .78) !important;
  color: var(--text-dim) !important;
  font-size: 9px !important;
}
.leaflet-control-attribution a { color: var(--gold) !important; }
.leaflet-bar {
  border: 1px solid var(--line) !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .5) !important;
}
.leaflet-bar a {
  background: linear-gradient(165deg, #241310, #1b0d09) !important;
  color: var(--gold-pale) !important;
  border-bottom: 1px solid var(--line-soft) !important;
}
.leaflet-bar a:hover { background: #2a1710 !important; }

/* 地图标记：缩略图 + 名称 */
.sm-icon { background: none; border: none; }
.sm-marker { display: flex; flex-direction: column; align-items: center; cursor: pointer; }
.sm-thumb {
  position: relative; width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, #5c1f18, #3a120c) center / cover no-repeat;
  border: 2px solid var(--gold-light);
  box-shadow: 0 3px 10px rgba(0, 0, 0, .55), 0 0 12px rgba(212, 175, 55, .3);
  transition: transform .15s;
}
.sm-marker:hover .sm-thumb { transform: scale(1.15); }
.sm-sr {
  position: absolute; top: -5px; right: -10px;
  font-style: normal; font-size: 8.5px; font-weight: 700; letter-spacing: .5px;
  padding: 1.5px 5px; border-radius: 8px;
  background: linear-gradient(135deg, var(--ssr), #b8860b);
  color: #3a2405;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .5);
}
.sm-name {
  margin-top: 4px; font-size: 10.5px; letter-spacing: 1px; color: var(--gold-pale);
  background: rgba(18, 8, 6, .85);
  border: 1px solid var(--line-soft);
  border-radius: 10px; padding: 2px 8px; white-space: nowrap;
}