/* ===========================================================
   抽卡模拟器 · 抽卡网站样式
   =========================================================== */
:root {
  --bg: #f7f4ed;
  --paper: #fffdf8;
  --ink: #1d2735;
  --muted: #77808f;
  --line: #e7e0d4;
  --gold: #c8a24a;
  --gold-light: #e9d5a1;
  --navy: #172131;
  --shadow: 0 18px 50px rgba(28, 36, 50, .08);
  --rc: #8a98a8;
  --rc2: #b9c4d0;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(1100px 600px at 12% -8%, rgba(232, 217, 185, .42), transparent 62%),
    radial-gradient(900px 520px at 92% 4%, rgba(214, 226, 235, .5), transparent 60%),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  overflow-x: clip;
}
button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { font-family: Georgia, "Songti SC", "Noto Serif SC", "STSong", serif; font-weight: 600; }
[hidden] { display: none !important; }

.page-shell { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  display: flex; align-items: center; gap: 22px;
  height: 76px; margin: 0 -24px; padding: 0 24px;
  background: rgba(247, 244, 237, .88);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(212, 202, 183, .6);
}
.brand { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.brand-mark {
  width: 44px; height: 44px; border-radius: 12px; flex-shrink: 0;
  background: var(--navy); color: var(--gold-light);
  border: 1px solid rgba(212, 175, 55, .55);
  display: grid; place-items: center; position: relative;
  box-shadow: 0 6px 18px rgba(23, 33, 49, .22);
}
.brand-mark span { font-family: Georgia, serif; font-size: 16px; letter-spacing: -1px; }
.brand-mark i { position: absolute; right: 5px; bottom: 1px; font-size: 10px; font-style: normal; }
.brand-text b { display: block; font-family: Georgia, "Songti SC", serif; font-size: 18px; letter-spacing: 1px; line-height: 1.1; }
.brand-text small { display: block; font-size: 8px; letter-spacing: 1.4px; color: var(--muted); margin-top: 3px; }
.main-nav { display: flex; align-items: center; gap: 4px; margin-left: 14px; flex: 1; }
.main-nav a {
  padding: 9px 14px; border-radius: 10px; font-size: 13.5px; color: #5d6675;
  white-space: nowrap; transition: .2s;
}
.main-nav a:hover { background: rgba(255, 255, 255, .7); color: var(--ink); }
.main-nav a.active { background: var(--paper); color: var(--navy); box-shadow: 0 3px 12px rgba(30, 40, 55, .08); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.global-pill {
  display: flex; align-items: center; gap: 6px; font-size: 12px; color: #5f6877;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line);
  padding: 8px 12px; border-radius: 999px;
}
.global-pill b, .global-pill #globalDraws { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; }
.global-pill small { font-size: 11px; color: var(--muted); }
.pulse-dot { width: 7px; height: 7px; border-radius: 50%; background: #3ba776; box-shadow: 0 0 0 0 rgba(59, 167, 118, .5); animation: pulse 2.2s infinite; }
.auth-btn {
  background: var(--navy); color: #fff; border: 0; border-radius: 10px;
  padding: 10px 16px; font-size: 13px; transition: .2s;
}
.auth-btn:hover { background: #2a3a52; transform: translateY(-1px); }
.sound-btn {
  width: 34px; height: 34px; flex-shrink: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line);
  border-radius: 10px; font-size: 15px; line-height: 1; transition: .2s; cursor: pointer;
}
.sound-btn:hover { background: #fff; transform: translateY(-1px); }
.sound-btn.on { background: rgba(212, 175, 55, .16); border-color: var(--gold); }
.style-btn {
  height: 34px; flex-shrink: 0; padding: 0 10px;
  background: rgba(255, 255, 255, .7); border: 1px solid var(--line);
  border-radius: 10px; font-size: 11px; font-weight: 700; letter-spacing: .5px;
  color: var(--ink); transition: .2s; cursor: pointer;
}
.style-btn:hover { background: #fff; transform: translateY(-1px); }
.style-btn.on { background: rgba(212, 175, 55, .16); border-color: var(--gold); color: var(--gold); }

/* ---------- Views ---------- */
.view { display: none; padding: 46px 0 70px; min-height: 72vh; animation: fadeUp .35s ease both; }
.view.active { display: block; }
.view-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 26px; flex-wrap: wrap; }
.view-head h1 { font-size: clamp(30px, 4vw, 42px); margin: 6px 0 8px; letter-spacing: -1px; }
.view-head p { color: var(--muted); margin: 0; font-size: 14px; }
.eyebrow { color: var(--gold); font-size: 10px; letter-spacing: 3.2px; font-weight: 700; margin: 0 0 10px; text-transform: uppercase; }

/* ---------- Hero ---------- */
.hero { position: relative; text-align: center; padding: 54px 0 26px; overflow: hidden; }
.hero-glow {
  position: absolute; left: 50%; top: 20px; transform: translateX(-50%);
  width: 620px; height: 260px; background: radial-gradient(ellipse, rgba(212, 175, 55, .16), transparent 70%);
  pointer-events: none; filter: blur(12px);
}
.hero h1 { position: relative; font-size: clamp(52px, 8vw, 88px); letter-spacing: -3px; margin: 0; line-height: 1.05; }
.hero-dot { color: var(--gold); }
.hero-lead { position: relative; font-size: 18px; margin: 16px 0 8px; font-weight: 600; letter-spacing: .5px; }
.hero-sub { position: relative; color: var(--muted); font-size: 13.5px; margin: 0 auto; max-width: 560px; line-height: 1.8; }

.stat-strip {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
  gap: 26px; background: rgba(255, 253, 248, .86); border: 1px solid var(--line);
  border-radius: 18px; padding: 18px 28px; max-width: 860px; margin: 8px auto 0;
  box-shadow: 0 10px 30px rgba(30, 40, 55, .04);
}
.stat-item { display: flex; flex-direction: column; align-items: center; min-width: 100px; }
.stat-item b { font-family: Georgia, serif; font-size: 22px; font-variant-numeric: tabular-nums; }
.stat-item span { font-size: 11px; color: var(--muted); margin-top: 2px; }
.stat-item.highlight b { color: #b08a2d; }
.stat-divider { width: 1px; height: 30px; background: var(--line); }

/* ---------- Series selector ---------- */
.series-bar {
  max-width: 860px; margin: 14px auto 0; padding: 14px 18px;
  background: rgba(255, 253, 248, .78); border: 1px solid var(--line);
  border-radius: 16px; box-shadow: 0 8px 26px rgba(30, 40, 55, .04);
}
.series-bar-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.series-bar-head b { font-size: 12px; letter-spacing: 1px; }
.series-bar-head small { font-size: 10px; color: var(--muted); }
.series-chips { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.series-chip {
  display: inline-flex; align-items: center; gap: 9px; padding: 8px 15px;
  border: 1px solid var(--line); border-radius: 999px; background: #fff;
  cursor: pointer; transition: all .25s ease; color: #4b5565; font-size: 12px;
}
.series-chip:hover { transform: translateY(-2px); border-color: var(--series-color, var(--gold)); }
.series-chip.active {
  color: #2b2418; border-color: var(--series-color, var(--gold));
  background: color-mix(in srgb, var(--series-color, #d4af37) 12%, #fff);
  box-shadow: 0 4px 14px rgba(180, 140, 50, .14);
}
.series-chip .s-icon { font-size: 15px; color: var(--series-color, var(--gold)); }
.series-chip .s-count { font-size: 10px; color: var(--muted); }
.series-select { min-width: 180px; }

/* ---------- Draw stage ---------- */
.draw-zone { position: relative; margin: 42px auto 30px; text-align: center; max-width: 820px; padding: 10px 0 0; }
.series-banner {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 24px;
  padding: 9px 20px; border-radius: 999px; border: 1px solid var(--line);
  background: rgba(255, 253, 248, .85); font-size: 12px; color: #5b6370;
  box-shadow: 0 5px 16px rgba(30, 40, 55, .04);
}
.series-banner .sb-icon { font-size: 18px; color: var(--series-color, var(--gold)); }
.series-banner b { color: #2b2418; font-size: 13px; }
.series-banner small { color: var(--muted); font-size: 10px; }
.draw-zone.has-series .deck-main { border-color: var(--series-color, rgba(212, 175, 55, .42)); }
.orbit { position: absolute; left: 50%; top: 210px; transform: translate(-50%, -50%); border-radius: 50%; pointer-events: none; }
.orbit-1 { width: 540px; height: 540px; border: 1px dashed rgba(200, 162, 74, .28); animation: spin 70s linear infinite; }
.orbit-2 { width: 400px; height: 400px; border: 1px solid rgba(200, 162, 74, .13); animation: spin 48s linear infinite reverse; }
.spark { position: absolute; color: var(--gold); font-size: 18px; opacity: .55; animation: float 5s ease-in-out infinite; }
.spark.s1 { left: 13%; top: 130px; } .spark.s2 { right: 14%; top: 90px; animation-delay: .8s; }
.spark.s3 { right: 20%; bottom: 130px; animation-delay: 1.6s; } .spark.s4 { left: 18%; bottom: 100px; animation-delay: 2.2s; }

.deck-area { position: relative; width: 260px; height: 372px; margin: 0 auto 36px; outline: none; perspective: 1200px; }
.deck-area:focus-visible .deck-main { box-shadow: 0 0 0 4px rgba(200, 162, 74, .5); }
.deck-card {
  position: absolute; inset: 0; border-radius: 18px;
  background: linear-gradient(150deg, #24334a 0%, #111a28 60%, #1b2639 100%);
  border: 2px solid rgba(212, 175, 55, .42);
  box-shadow: 0 26px 55px rgba(16, 24, 38, .3);
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .4s;
  overflow: hidden;
}
.deck-left { transform: translateX(-26px) rotate(-9deg) scale(.96); opacity: .62; }
.deck-right { transform: translateX(26px) rotate(9deg) scale(.96); opacity: .62; }
.deck-area:hover .deck-left { transform: translateX(-48px) rotate(-15deg) scale(.94); }
.deck-area:hover .deck-right { transform: translateX(48px) rotate(15deg) scale(.94); }
.deck-area:hover .deck-main { transform: translateY(-9px) rotate(-1deg); box-shadow: 0 34px 70px rgba(16, 24, 38, .35); }
.deck-main { z-index: 2; }
.deck-pattern {
  position: absolute; inset: 11px; border-radius: 11px;
  border: 1px solid rgba(212, 175, 55, .26);
  background:
    repeating-linear-gradient(45deg, transparent 0 13px, rgba(212, 175, 55, .055) 13px 14px),
    repeating-linear-gradient(-45deg, transparent 0 13px, rgba(212, 175, 55, .045) 13px 14px),
    radial-gradient(circle at 50% 44%, rgba(212, 175, 55, .16), transparent 65%);
}
/* 自定义卡背图片层：铺在内框内，保留外层金边、四角与底部文字 */
.deck-art {
  position: absolute; inset: 11px; border-radius: 11px;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  display: none; z-index: 1;
}
.deck-main.has-art .deck-art { display: block; }
.deck-main.has-art .deck-pattern { background: none; }
.deck-main.has-art .deck-emblem { display: none; }
.deck-main.has-art .deck-caption,
.deck-main.has-art .deck-corner { z-index: 2; }
.reveal-back.has-art .deck-art-reveal { display: block; z-index: 1; }
.reveal-back.has-art .deck-pattern { background: none; }
.reveal-back.has-art .deck-emblem { display: none; }
.reveal-back.has-art .deck-caption { z-index: 2; }
.deck-art::after {
  content: ''; position: absolute; inset: 0; border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(212, 175, 55, .45);
}
.deck-emblem {
  position: absolute; left: 50%; top: 43%; transform: translate(-50%, -50%);
  width: 122px; height: 122px; border-radius: 50%;
  border: 2px solid rgba(212, 175, 55, .8); display: grid; place-items: center;
  box-shadow: 0 0 0 7px rgba(212, 175, 55, .08), inset 0 0 0 5px rgba(212, 175, 55, .08);
}
.deck-emblem span { font-family: Georgia, serif; font-size: 38px; color: var(--gold-light); letter-spacing: -2px; line-height: 1; }
.deck-emblem em { position: absolute; right: 14px; bottom: 14px; font-style: normal; color: var(--gold); font-size: 13px; }
/* 系列自动生成卡面：图标 + 系列名，跟随系列主题色 */
.deck-emblem .ae-icon { font-size: 44px; letter-spacing: 0; text-shadow: 0 4px 18px rgba(0, 0, 0, .35); }
.deck-emblem .ae-name {
  position: absolute; left: 50%; bottom: -30px; transform: translateX(-50%);
  width: 190px; max-width: 190px; text-align: center; white-space: nowrap;
  font-size: 15px; font-weight: 700; letter-spacing: 3px; color: var(--cover-color, var(--gold-light));
  text-shadow: 0 2px 12px rgba(0, 0, 0, .5);
}
.deck-main, .reveal-back { --cover-color: var(--gold-light); }
.deck-card, .reveal-back {
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--cover-color) 12%, transparent), transparent 62%),
    linear-gradient(150deg, #24334a 0%, #111a28 60%, #1b2639 100%);
}
.deck-pattern {
  background:
    repeating-linear-gradient(45deg, transparent 0 13px, color-mix(in srgb, var(--cover-color) 8%, transparent) 13px 14px),
    repeating-linear-gradient(-45deg, transparent 0 13px, color-mix(in srgb, var(--cover-color) 7%, transparent) 13px 14px),
    radial-gradient(circle at 50% 44%, color-mix(in srgb, var(--cover-color) 20%, transparent), transparent 65%);
}
.deck-caption { position: absolute; bottom: 26px; left: 0; right: 0; text-align: center; font-size: 8px; letter-spacing: 2.6px; color: rgba(233, 213, 161, .72); }
.deck-corner { position: absolute; width: 15px; height: 15px; border-color: rgba(212, 175, 55, .6); border-style: solid; }
.deck-corner.tl { left: 16px; top: 16px; border-width: 1px 0 0 1px; }
.deck-corner.tr { right: 16px; top: 16px; border-width: 1px 1px 0 0; }
.deck-corner.bl { left: 16px; bottom: 16px; border-width: 0 0 1px 1px; }
.deck-corner.br { right: 16px; bottom: 16px; border-width: 0 1px 1px 0; }

.shuffle-cards { position: absolute; inset: 0; display: none; pointer-events: none; z-index: 5; }
.shuffle-cards div {
  position: absolute; width: 150px; height: 214px; border-radius: 12px;
  background: linear-gradient(150deg, #24334a, #111a28);
  border: 2px solid rgba(212, 175, 55, .55);
  box-shadow: 0 15px 35px rgba(16, 24, 38, .4);
}
.shuffle-cards div:nth-child(1) { animation: shuffle1 .9s ease-in-out infinite; }
.shuffle-cards div:nth-child(2) { animation: shuffle2 .75s ease-in-out infinite; }
.shuffle-cards div:nth-child(3) { animation: shuffle3 1s ease-in-out infinite; }
.deck-area.shuffling .shuffle-cards { display: block; }
.deck-area.shuffling .deck-card { opacity: .25; }

.draw-controls { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; position: relative; z-index: 3; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: 11px; padding: 12px 22px;
  font-size: 14px; font-weight: 600; transition: transform .18s, box-shadow .18s, background .18s;
  white-space: nowrap;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:active:not(:disabled) { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-lg { min-width: 186px; padding: 15px 26px; font-size: 16px; border-radius: 13px; }
.btn-icon { font-size: 17px; line-height: 1; }
.btn-primary { background: var(--navy); color: #fff; box-shadow: 0 8px 20px rgba(23, 33, 49, .2); }
.btn-primary:hover:not(:disabled) { background: #273a54; box-shadow: 0 12px 26px rgba(23, 33, 49, .26); }
.btn-gold { background: linear-gradient(135deg, #e7cb80, #c8a24a); color: #2c230f; box-shadow: 0 8px 20px rgba(200, 162, 74, .28); }
.btn-gold:hover:not(:disabled) { box-shadow: 0 12px 26px rgba(200, 162, 74, .38); }
.btn-ghost { background: transparent; border-color: rgba(255, 255, 255, .42); color: #fff; }
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, .12); }
.btn-outline { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-outline:hover:not(:disabled) { background: #fff; }
.btn-block { width: 100%; }
.pity-note { color: var(--muted); font-size: 11.5px; margin: 18px 0 10px; }
.pity-note b { color: #a8842f; }
.pity-progress { display: flex; justify-content: center; gap: 22px; flex-wrap: wrap; font-size: 11px; color: var(--muted); position: relative; z-index: 3; }
.pity-track { display: flex; align-items: center; gap: 7px; }
.pity-track .mini-bar { width: 82px; height: 5px; border-radius: 99px; background: #e5ded1; overflow: hidden; }
.pity-track .mini-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #b08a2d, #e5c470); }

/* ---------- Panels ---------- */
.below-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 980px; margin: 34px auto 60px; }
.panel { background: rgba(255, 253, 248, .9); border: 1px solid var(--line); border-radius: 18px; padding: 22px 24px; box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.panel-head h2 { font-size: 18px; margin: 0; }
.panel-head span { font-size: 11px; color: var(--muted); }
.odds-row { display: grid; grid-template-columns: 58px 1fr 44px; align-items: center; gap: 10px; margin: 10px 0; font-size: 12px; }
.odds-row .odds-name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.odds-row .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rc); }
.odds-row .odds-bar { height: 6px; border-radius: 99px; background: #eee8dd; overflow: hidden; }
.odds-row .odds-bar i { display: block; height: 100%; border-radius: inherit; background: var(--rc); }
.odds-row .odds-pct { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.recent-list { display: flex; flex-direction: column; gap: 9px; }
.recent-row { display: flex; align-items: center; gap: 10px; font-size: 12px; padding: 7px 9px; border-radius: 9px; background: rgba(246, 242, 233, .75); }
.recent-row .r-icon { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-size: 16px; background: #fff; border: 1px solid var(--line); flex-shrink: 0; }
.recent-row .r-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-row .r-time { margin-left: auto; color: var(--muted); font-size: 10.5px; white-space: nowrap; }
.rarity-chip { font-size: 10px; padding: 2px 7px; border-radius: 99px; font-weight: 700; color: #fff; background: var(--rc); white-space: nowrap; }
.empty-mini { color: var(--muted); font-size: 12px; padding: 18px 0; text-align: center; }

/* ---------- Rarity themes ---------- */
.rarity-common { --rc: #8a98a8; --rc2: #c3ccd6; }
.rarity-rare { --rc: #3b82f6; --rc2: #9cc4ff; }
.rarity-epic { --rc: #9b59d0; --rc2: #d5b2f0; }
.rarity-legend { --rc: #e8873c; --rc2: #f6c48c; }
.rarity-mythic { --rc: #d4af37; --rc2: #f0dfa8; }

/* ---------- Toolbar / chips ---------- */
.toolbar { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: rgba(255, 255, 255, .75); color: #5d6675; border-radius: 999px; padding: 8px 16px; font-size: 12.5px; transition: .2s; }
.chip:hover { border-color: #cfc4ae; color: var(--ink); }
.chip.active { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.chip.rarity-mythic.active, .chip.rarity-legend.active, .chip.rarity-epic.active, .chip.rarity-rare.active, .chip.rarity-common.active { background: var(--rc); border-color: var(--rc); color: #fff; }
.search-input { border: 1px solid var(--line); background: rgba(255, 255, 255, .8); border-radius: 10px; padding: 9px 14px; font-size: 13px; min-width: 240px; outline: none; }
.search-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 162, 74, .12); }

/* ---------- Card tiles / grids ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(196px, 1fr)); gap: 18px; }
.tile {
  position: relative; border: 1px solid var(--line); background: var(--paper);
  border-radius: 16px; overflow: hidden; cursor: pointer; text-align: left; padding: 0;
  transition: transform .22s, box-shadow .22s;
}
.tile:hover { transform: translateY(-5px); box-shadow: 0 18px 36px rgba(28, 36, 50, .12); }
.tile-art {
  height: 132px; position: relative; display: grid; place-items: center; overflow: hidden;
  background: radial-gradient(circle at 50% 35%, var(--rc2), transparent 68%), linear-gradient(145deg, #2a3547, #16202e);
  border-bottom: 2px solid var(--rc);
}
.tile-art::after { content: ''; position: absolute; inset: 8px; border: 1px solid rgba(255, 255, 255, .13); border-radius: 9px; }
.tile-art .tile-icon { font-size: 50px; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .35)); z-index: 1; }
.tile-rarity { position: absolute; left: 10px; top: 10px; z-index: 2; }
.tile-count { position: absolute; right: 10px; top: 10px; z-index: 2; background: rgba(0, 0, 0, .4); color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 99px; }
.tile-body { padding: 13px 15px 15px; }
.tile-name { font-family: Georgia, "Songti SC", serif; font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.tile-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile-occ { display: inline-block; margin-top: 10px; font-size: 10.5px; color: var(--rc); border: 1px solid var(--rc); border-radius: 99px; padding: 2px 8px; opacity: .9; }
.tile-foot { margin-top: 10px; font-size: 10px; color: #9aa2ad; border-top: 1px dashed var(--line); padding-top: 8px; }

.collection-summary, .codex-progress { font-size: 12px; color: var(--muted); text-align: right; }
.collection-summary b, .codex-progress b { color: var(--ink); font-family: Georgia, serif; font-size: 20px; }
.codex-bar { width: 220px; height: 7px; border-radius: 99px; background: #e8e1d5; margin-top: 8px; overflow: hidden; }
.codex-bar i { display: block; height: 100%; background: linear-gradient(90deg, #b08a2d, #e5c470); border-radius: inherit; }

.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin: 30px 0 10px; flex-wrap: wrap; }
.pager button { border: 1px solid var(--line); background: #fff; border-radius: 8px; padding: 7px 13px; font-size: 12px; color: var(--ink); }
.pager button.active { background: var(--navy); color: #fff; border-color: var(--navy); }
.pager button:disabled { opacity: .4; cursor: not-allowed; }
.empty-state { grid-column: 1 / -1; text-align: center; padding: 70px 20px; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.empty-state .big { font-size: 40px; opacity: .5; display: block; margin-bottom: 12px; }

/* ---------- History ---------- */
.history-list { background: rgba(255, 253, 248, .92); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow); }
.history-row { display: grid; grid-template-columns: 42px minmax(120px, 1fr) 90px 90px 120px; align-items: center; gap: 12px; padding: 13px 20px; border-bottom: 1px solid #f0ebe1; font-size: 13px; }
.history-row:last-child { border-bottom: 0; }
.history-row:hover { background: #fbf8f1; }
.history-row .h-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: #f4efe4; }
.history-row .h-name { font-weight: 600; }
.history-row .h-name small { display: block; color: var(--muted); font-weight: 400; font-size: 10px; }
.history-row .h-time, .history-row .h-type { color: var(--muted); font-size: 11.5px; }

/* ---------- Leaderboard ---------- */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 20px 0 30px; min-height: 220px; }
.podium-item { width: 180px; border-radius: 16px 16px 0 0; padding: 20px 12px 16px; text-align: center; background: linear-gradient(180deg, #fffdf8, #f1ebdf); border: 1px solid var(--line); border-bottom: 0; position: relative; }
.podium-item.first { height: 212px; order: 2; background: linear-gradient(180deg, #fff8e4, #f3e3bb); border-color: #dcc388; }
.podium-item.second { height: 176px; order: 1; }
.podium-item.third { height: 150px; order: 3; }
.podium-item .p-avatar { font-size: 32px; }
.podium-item .p-name { font-weight: 700; margin-top: 8px; font-size: 14px; }
.podium-item .p-score { color: var(--muted); font-size: 11px; margin-top: 4px; }
.podium-item .p-medal { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--navy); color: #fff; font-size: 12px; font-weight: 700; }
.podium-item.first .p-medal { background: linear-gradient(135deg, #e7c46d, #b8902c); }
.rank-list { background: rgba(255, 253, 248, .92); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.rank-row { display: grid; grid-template-columns: 56px 42px 1fr 100px 110px; align-items: center; gap: 10px; padding: 12px 20px; border-bottom: 1px solid #f0ebe1; font-size: 13px; }
.rank-row:last-child { border-bottom: 0; }
.rank-row.me { background: #faf4e4; }
.rank-row .rank-num { font-family: Georgia, serif; font-size: 17px; color: var(--muted); }
.rank-row .rank-num.top { color: #b8902c; font-weight: 700; }
.rank-row .rank-score { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.rank-row .rank-cards { text-align: right; color: var(--muted); font-size: 11.5px; }

/* ---------- Codex ---------- */
.codex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); gap: 12px; }
.codex-tile {
  aspect-ratio: 3 / 4; border-radius: 12px; border: 1px solid var(--line); background: var(--paper);
  overflow: hidden; position: relative; text-align: center; padding: 10px 6px; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between;
  transition: transform .2s, box-shadow .2s;
}
.codex-tile:hover { transform: translateY(-3px); box-shadow: 0 10px 24px rgba(28, 36, 50, .1); }
.codex-tile.unknown { border-style: dashed; background: #f4f1ea; color: var(--muted); }
.codex-art { flex: 1; display: grid; place-items: center; font-size: 34px; width: 100%; }
.codex-tile.unknown .codex-art { filter: grayscale(1); opacity: .28; }
.codex-name { font-family: Georgia, "Songti SC", serif; font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.codex-label { font-size: 9px; margin-top: 4px; }

/* ---------- Card face (reveal / detail) ---------- */
.card-face {
  width: 100%; height: 100%; border-radius: 18px; background: var(--paper);
  border: 2px solid var(--rc); overflow: hidden; position: relative;
  display: flex; flex-direction: column;
  box-shadow: inset 0 0 0 5px rgba(255, 255, 255, .6), 0 20px 50px rgba(10, 15, 25, .32);
}
.card-face::before { content: ''; position: absolute; inset: 0; pointer-events: none; background: linear-gradient(140deg, rgba(255, 255, 255, .5), transparent 42%); }
.card-top { display: flex; justify-content: space-between; align-items: center; padding: 11px 13px 7px; font-size: 9px; font-weight: 700; letter-spacing: 1px; color: var(--rc); position: relative; z-index: 1; }
.rarity-badge { background: var(--rc); color: #fff; padding: 3px 10px; border-radius: 99px; font-size: 10px; letter-spacing: 2px; }
.card-portrait { height: 142px; margin: 0 12px; border-radius: 11px; position: relative; overflow: hidden; border: 1px solid rgba(0, 0, 0, .1); background: radial-gradient(circle at 50% 32%, hsl(var(--hue), 52%, 48%) 0%, hsl(var(--hue), 40%, 25%) 55%, #131c2b 100%); }
.card-portrait::before { content: ''; position: absolute; inset: 7px; border: 1px solid rgba(255, 240, 200, .28); border-radius: 7px; }
.card-portrait .halo { position: absolute; left: 50%; top: -30px; transform: translateX(-50%); width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle, rgba(255, 232, 175, .3), transparent 68%); }
.silhouette { position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%); width: 100px; height: 116px; opacity: .42; }
.silhouette .head { position: absolute; left: 50%; top: 5px; transform: translateX(-50%); width: 50px; height: 50px; border-radius: 50%; background: linear-gradient(180deg, #fff6df, #ddc99c); }
.silhouette .body { position: absolute; left: 50%; bottom: 0; transform: translateX(-50%); width: 104px; height: 76px; border-radius: 50% 50% 0 0 / 60% 60% 0 0; background: linear-gradient(180deg, #fff3d7, #cbb684); }
.portrait-icon { position: absolute; right: 9px; top: 6px; font-size: 34px; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, .4)); }
.portrait-no { position: absolute; left: 12px; bottom: 9px; font-family: Georgia, serif; font-size: 9px; color: rgba(255, 240, 200, .68); letter-spacing: 1px; }
.card-body { padding: 9px 15px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; min-height: 0; position: relative; z-index: 1; }
.card-body h3 { font-size: 23px; margin: 0; line-height: 1.2; letter-spacing: -.5px; }
.card-en { font-size: 9px; letter-spacing: 1.2px; color: var(--muted); text-transform: uppercase; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-meta-line { font-size: 10.5px; color: #5d6675; margin-top: 3px; }
.card-occ { display: inline-block; font-size: 10px; color: var(--rc); border: 1px solid var(--rc); border-radius: 99px; padding: 2px 8px; margin-top: 5px; align-self: flex-start; }
.impact-line { display: flex; align-items: center; gap: 7px; font-size: 9.5px; color: var(--muted); margin-top: 7px; }
.impact-line .bar { flex: 1; height: 5px; background: #ebe5da; border-radius: 99px; overflow: hidden; }
.impact-line .bar i { display: block; height: 100%; background: var(--rc); border-radius: inherit; }
.impact-line b { color: var(--rc); font-variant-numeric: tabular-nums; }
.card-desc { font-size: 10.8px; line-height: 1.55; color: #555f6e; margin: 7px 0 0; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-quote { font-size: 10px; line-height: 1.45; color: #96763a; margin: 7px 0 0; border-left: 2px solid var(--gold); padding-left: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-series-tag {
  display: inline-flex; align-items: center; gap: 4px; margin: 2px 0 6px;
  padding: 3px 8px; border-radius: 999px; font-size: 9px; letter-spacing: .5px;
  color: var(--series-tag, #9a7b2e); background: rgba(200, 162, 74, .1);
  border: 1px solid rgba(200, 162, 74, .22);
}
.card-footline { margin-top: auto; padding-top: 6px; font-size: 8.5px; letter-spacing: 1.5px; color: #b0a89a; text-align: center; }

/* ---------- Modals ---------- */
.modal { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(15, 22, 33, .68); backdrop-filter: blur(7px); -webkit-backdrop-filter: blur(7px); animation: fadeIn .25s ease both; }
.modal-box { position: relative; z-index: 1; background: var(--paper); border-radius: 22px; padding: 34px; width: min(440px, 94vw); max-height: 92vh; overflow: auto; box-shadow: 0 30px 80px rgba(0, 0, 0, .3); animation: popIn .3s ease both; }
.modal-close { position: absolute; right: 16px; top: 12px; border: 0; background: transparent; font-size: 27px; line-height: 1; color: #9aa2ad; z-index: 5; }
.modal-close:hover { color: var(--ink); }
.modal-close.light { color: rgba(255, 255, 255, .75); right: 4px; top: 0; }
.modal-close.light:hover { color: #fff; }
.auth-box { text-align: center; }
.auth-brand { display: flex; justify-content: center; margin-bottom: 14px; }
.auth-box h2 { font-size: 27px; margin: 0 0 6px; }
.modal-sub { color: var(--muted); font-size: 12px; margin: 0 0 20px; }
.auth-tabs { display: flex; background: #f1ede4; border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: transparent; padding: 9px; border-radius: 8px; font-size: 13px; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--ink); font-weight: 700; box-shadow: 0 2px 8px rgba(0, 0, 0, .07); }
#authForm label { display: block; text-align: left; margin-bottom: 13px; }
#authForm label span { display: block; font-size: 11px; color: var(--muted); margin-bottom: 6px; }
#authForm input { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 13px; font-size: 13px; outline: none; background: #fff; }
#authForm input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(200, 162, 74, .14); }
.form-error { color: #c0392b; font-size: 11.5px; min-height: 16px; margin: 0 0 8px; text-align: left; }
.auth-foot { color: var(--muted); font-size: 11px; margin: 16px 0 0; line-height: 1.6; }

/* Reveal modal */
.reveal-wrap { position: relative; z-index: 1; width: min(360px, 92vw); text-align: center; }
.reveal-flip { width: 330px; max-width: 88vw; height: 470px; margin: 0 auto; perspective: 1400px; }
.reveal-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform 1.05s cubic-bezier(.2, .75, .25, 1); }
.reveal-inner.flipped { transform: rotateY(180deg); }
.reveal-back, .reveal-front { position: absolute; inset: 0; border-radius: 18px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; background: linear-gradient(150deg, #24334a, #111a28); border: 2px solid rgba(212, 175, 55, .5); }
.reveal-front { transform: rotateY(180deg); background: transparent; border: 0; }
.reveal-back .deck-emblem { left: 50%; top: 43%; }
.reveal-actions { position: relative; z-index: 3; display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.reveal-banner { width: 100%; margin-bottom: 14px; font-size: 13px; letter-spacing: 2px; font-weight: 700; color: var(--gold-light); text-shadow: 0 2px 12px rgba(0, 0, 0, .6); }
.reveal-banner .new-dot { display: inline-block; background: #d4af37; color: #241d0d; border-radius: 99px; padding: 3px 10px; font-size: 10px; margin-right: 8px; letter-spacing: 1px; }
.rays { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); width: 900px; height: 900px; pointer-events: none; opacity: 0; background: conic-gradient(from 0deg, transparent 0deg 7deg, rgba(255, 226, 160, .18) 7deg 11deg, transparent 11deg 22deg); -webkit-mask-image: radial-gradient(circle, #000 0 40%, transparent 70%); mask-image: radial-gradient(circle, #000 0 40%, transparent 70%); animation: spin 24s linear infinite; transition: opacity .6s; }
.rays.on { opacity: 1; }
.confetti-layer { position: absolute; inset: -60px; pointer-events: none; overflow: hidden; }
.confetti-piece { position: absolute; top: -20px; width: 7px; height: 12px; opacity: .9; animation: confettiFall linear forwards; }

/* Multi draw */
.multi-box { width: min(860px, 96vw); }
.multi-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.multi-head h2 { font-size: 26px; margin: 0; }
.multi-summary { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.mini-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 11px; }
.mini-card { background: none; border: 0; padding: 0; aspect-ratio: 2 / 2.9; perspective: 900px; cursor: pointer; }
.mini-inner { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transition: transform .75s cubic-bezier(.2, .8, .2, 1); transition-delay: var(--delay, 0s); }
.mini-card.flipped .mini-inner { transform: rotateY(180deg); }
.mini-face { position: absolute; inset: 0; border-radius: 10px; backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; }
.mini-back { background: linear-gradient(150deg, #24334a, #111a28); border: 1px solid rgba(212, 175, 55, .45); display: grid; place-items: center; }
.mini-back::after { content: '✦'; font-family: Georgia, serif; color: rgba(233, 213, 161, .6); font-size: 20px; border: 1px solid rgba(212, 175, 55, .45); border-radius: 50%; width: 48px; height: 48px; display: grid; place-items: center; }
.mini-front { transform: rotateY(180deg); background: linear-gradient(170deg, var(--rc2), #fffdf8 55%); border: 2px solid var(--rc); padding: 8px 6px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; }
.mini-front .m-rarity { font-size: 9px; color: #fff; background: var(--rc); border-radius: 99px; padding: 2px 7px; letter-spacing: 1px; }
.mini-front .m-icon { font-size: 30px; filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .2)); }
.mini-front .m-name { font-family: Georgia, "Songti SC", serif; font-size: 11px; font-weight: 700; text-align: center; line-height: 1.25; }
.mini-front .m-occ { font-size: 8px; color: var(--muted); }
.mini-front .m-new { font-size: 8px; color: #a37c20; font-weight: 700; }
.multi-actions { display: flex; justify-content: center; gap: 10px; margin-top: 24px; flex-wrap: wrap; }
.multi-actions .btn-ghost { color: var(--ink); border-color: var(--line); }
.multi-actions .btn-ghost:hover { background: #f5f1e8; }
.detail-wrap { width: 350px; }
.detail-wrap #detailCard { width: 330px; max-width: 88vw; height: 470px; margin: 0 auto; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; z-index: 500; background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 11px; font-size: 13px; box-shadow: 0 12px 30px rgba(0, 0, 0, .28); transition: opacity .25s, transform .25s; max-width: 90vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); padding: 26px 0 40px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--muted); font-size: 11px; }

/* ---------- Animations ---------- */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes popIn { from { opacity: 0; transform: scale(.94) translateY(14px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(59, 167, 118, .55); } 70% { box-shadow: 0 0 0 8px rgba(59, 167, 118, 0); } 100% { box-shadow: 0 0 0 0 rgba(59, 167, 118, 0); } }
@keyframes shuffle1 { 0% { transform: translate(-85px, 40px) rotate(-22deg); } 50% { transform: translate(0, -18px) rotate(6deg); } 100% { transform: translate(-85px, 40px) rotate(-22deg); } }
@keyframes shuffle2 { 0% { transform: translate(0, 0) rotate(0); } 50% { transform: translate(76px, 22px) rotate(20deg); } 100% { transform: translate(0, 0) rotate(0); } }
@keyframes shuffle3 { 0% { transform: translate(80px, -25px) rotate(18deg); } 50% { transform: translate(-40px, 20px) rotate(-12deg); } 100% { transform: translate(80px, -25px) rotate(18deg); } }
@keyframes confettiFall { 0% { transform: translateY(0) rotate(0); opacity: 1; } 100% { transform: translateY(820px) rotate(720deg); opacity: 0; } }
@keyframes orbitSpin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.orbit-1 { animation: orbitSpin 70s linear infinite; }
.orbit-2 { animation: orbitSpin 48s linear infinite reverse; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .main-nav { overflow-x: auto; margin-left: 0; }
  .main-nav a { padding: 8px 10px; font-size: 12.5px; }
  .global-pill { display: none; }
  .below-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .page-shell { padding: 0 14px; }
  /* 顶栏改为两行：上排品牌+操作，下排导航横向滚动 */
  .site-header {
    height: auto; min-height: 108px; margin: 0 -14px; padding: 10px 14px 0;
    gap: 8px; flex-wrap: wrap; align-content: flex-start;
  }
  .brand { flex: 0 0 auto; }
  .brand-text { display: none; }
  .header-actions { margin-left: auto; gap: 8px; }
  .main-nav {
    order: 3; flex: 0 0 100%; width: 100%; margin-left: 0;
    overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch;
    scrollbar-width: none; padding: 4px 0 8px; gap: 2px;
  }
  .main-nav::-webkit-scrollbar { display: none; }
  .main-nav a { flex: 0 0 auto; padding: 8px 12px; font-size: 12.5px; }
  .auth-btn { padding: 8px 11px; font-size: 11px; }
  .sound-btn { width: 30px; height: 30px; font-size: 13px; }
  .style-btn { height: 30px; padding: 0 7px; font-size: 10px; }
  .hero { padding-top: 30px; }
  .hero h1 { font-size: clamp(38px, 11vw, 50px); }
  .hero-lead { font-size: 14px; padding: 0 6px; }
  .hero-sub { font-size: 12px; padding: 0 8px; }
  /* 统计框 2×2 网格，四个数据完整显示 */
  .stat-strip {
    display: grid; grid-template-columns: repeat(2, 1fr);
    gap: 14px 6px; padding: 16px 12px; width: 100%;
  }
  .stat-item { min-width: 0; width: 100%; }
  .stat-item b { font-size: 21px; }
  .stat-divider { display: none; }
  .orbit-1, .orbit-2, .spark { display: none; }
  .draw-zone { margin: 26px auto 24px; }
  .deck-area { width: 208px; height: 298px; margin-bottom: 26px; }
  .deck-emblem { width: 92px; height: 92px; }
  .deck-emblem span { font-size: 30px; }
  .deck-emblem .ae-icon { font-size: 36px; }
  .deck-emblem .ae-name { font-size: 12px; bottom: -26px; width: 170px; }
  .deck-caption { bottom: 22px; font-size: 7px; }
  .draw-controls { gap: 10px; padding: 0 6px; }
  .btn-lg { min-width: 0; flex: 1; padding: 13px 12px; font-size: 14px; }
  .pity-note { font-size: 10.5px; line-height: 1.7; padding: 0 4px; }
  .pity-progress { gap: 12px; }
  .view { padding: 26px 0 50px; }
  .view-head { margin-bottom: 20px; }
  .reveal-flip { width: min(300px, 84vw); height: auto; aspect-ratio: 330 / 470; }
  .mini-grid { grid-template-columns: repeat(2, 1fr); gap: 9px; }
  .below-grid { margin: 26px auto 40px; gap: 14px; }
  .panel { padding: 18px 16px; }
  .history-row { grid-template-columns: 36px 1fr 70px; padding: 12px 14px; gap: 9px; }
  .history-row .h-type, .history-row .h-time { display: none; }
  .podium { gap: 6px; }
  .podium-item { width: 32%; padding: 16px 6px 12px; }
  .podium-item.first { height: 180px; }
  .podium-item.second { height: 152px; }
  .podium-item.third { height: 130px; }
  .rank-row { grid-template-columns: 32px 28px 1fr 70px; padding: 12px 14px; gap: 8px; }
  .rank-row .rank-cards { display: none; }
  .series-bar { margin-top: 14px; padding: 12px 14px; }
  .series-bar-head small { font-size: 9px; }
  .series-chips { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .series-chips::-webkit-scrollbar { display: none; }
  .series-chip { flex: 0 0 auto; padding: 7px 12px; font-size: 11.5px; }
  .series-banner { max-width: 100%; border-radius: 14px; flex-wrap: wrap; text-align: left; }
  .toolbar { gap: 12px; }
  .search-input { width: 100%; min-width: 0; }
  .card-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .codex-grid { grid-template-columns: repeat(3, 1fr); gap: 9px; }
  .site-footer { text-align: center; justify-content: center; padding-bottom: 28px; }

  /* 弹窗移动端适配 */
  .modal { padding: 12px; }
  .modal-box { padding: 24px 20px; border-radius: 18px; width: 100%; max-width: 440px; max-height: 90vh; }
  .modal-close { right: 12px; top: 8px; }
  .auth-box h2 { font-size: 24px; }
  .multi-box { max-width: 100%; }
  .multi-head h2 { font-size: 22px; }
  .reveal-actions { gap: 8px; margin-top: 18px; }
  .reveal-actions .btn { flex: 1; min-width: 0; padding-left: 10px; padding-right: 10px; }
  .detail-wrap { width: 100%; max-width: 360px; }
  .detail-wrap #detailCard { width: min(300px, 84vw); height: auto; aspect-ratio: 330 / 470; }
  .toast { bottom: 20px; font-size: 12px; }

  img.portrait-icon.thumb { width: 44px; height: 44px; }
}

/* ---------- 卡片缩略图 ---------- */
img.portrait-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
img.thumb { display: block; object-fit: cover; }
.thumb-fallback { align-items: center; justify-content: center; }
img.portrait-icon.thumb {
  width: 54px; height: 54px; border-radius: 12px; z-index: 2;
  border: 2px solid rgba(255, 240, 200, .55);
  box-shadow: 0 6px 14px rgba(0, 0, 0, .35);
}
img.tile-icon.thumb { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.tile-art::after { z-index: 2; }
img.m-icon.thumb { width: 42px; height: 42px; border-radius: 11px; border: 1px solid rgba(255, 255, 255, .5); }
img.r-icon.thumb { width: 30px; height: 30px; border-radius: 9px; border: 1px solid var(--line); }
img.h-icon.thumb { width: 36px; height: 36px; border-radius: 10px; }
img.codex-art.thumb { flex: 1; width: 100%; min-height: 0; object-fit: cover; border-radius: 8px; }
.codex-tile.unknown img.codex-art.thumb { filter: grayscale(1) blur(2px); opacity: .28; }
