/* ============ 天气宇宙收集册 · 移动优先 ============ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
:root {
  --pink-bg1: #fde7ec;
  --pink-bg2: #f9d2da;
  --ink: #5c2436;
  --ink2: #96566c;
  --accent: #d4526e;
  --accent-deep: #b93a5b;
  --white: rgba(255,255,255,.88);
}
html { font-size: 16px; }
body {
  font-family: system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(160deg, var(--pink-bg1), var(--pink-bg2)) fixed;
  color: var(--ink);
  min-height: 100vh;
}

/* 顶栏 / 底栏 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  padding: calc(env(safe-area-inset-top) + 12px) 16px 10px;
  background: rgba(253,231,236,.85); backdrop-filter: blur(10px);
  text-align: center;
}
.topbar .title { font-weight: 700; font-size: 17px; color: var(--accent-deep); letter-spacing: 1px; }
.topbar .title span { font-weight: 400; font-size: 13px; color: var(--ink2); margin-left: 4px; }

main { max-width: 520px; margin: 0 auto; padding: 12px 12px calc(env(safe-area-inset-bottom) + 88px); }

.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 10;
  display: flex; max-width: 520px; margin: 0 auto;
  background: rgba(255,255,255,.92); backdrop-filter: blur(12px);
  border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(185,58,91,.12);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; border: 0; background: none; padding: 9px 0 7px;
  font-size: 12px; color: var(--ink2); display: flex; flex-direction: column; gap: 2px; align-items: center;
}
.tab i { font-style: normal; font-size: 19px; filter: grayscale(.4); }
.tab.on { color: var(--accent-deep); font-weight: 600; }
.tab.on i { filter: none; }

/* 面板 */
.panel {
  background: var(--white); border-radius: 16px; padding: 16px;
  margin-bottom: 12px; box-shadow: 0 2px 12px rgba(185,58,91,.07);
}
.panel h3 { font-size: 16px; color: var(--accent-deep); margin-bottom: 8px; }
.panel h3 small { font-weight: 400; color: var(--ink2); font-size: 12px; margin-left: 4px; }
.hint { font-size: 12px; color: var(--ink2); line-height: 1.7; margin: 4px 0; }

/* 收集进度头部 */
.hero { text-align: center; }
.hero-num b { font-size: 44px; color: var(--accent-deep); font-variant-numeric: tabular-nums; }
.hero-num span { font-size: 18px; color: var(--ink2); }
.hero-num.small b { font-size: 32px; }
.hero-sub { font-size: 12px; color: var(--ink2); margin: 2px 0 10px; }
.hero-bar { height: 10px; background: rgba(185,58,91,.12); border-radius: 5px; overflow: hidden; }
.hero-bar i { display: block; height: 100%; background: linear-gradient(90deg, #e88fb0, var(--accent)); border-radius: 5px; transition: width .4s; }
.schips { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 12px; }
.schip { font-size: 11px; padding: 3px 9px; border-radius: 20px; background: rgba(185,58,91,.08); color: var(--ink2); }
.schip.done { background: #e9f6ef; color: #3f7d5d; font-weight: 600; }
.schip.pr { background: rgba(232,143,176,.18); color: #c05a7f; font-weight: 600; }

/* 筛选 chips */
.filters { display: flex; gap: 8px; margin: 2px 2px 12px; }
.chip {
  border: 1px solid rgba(185,58,91,.25); background: rgba(255,255,255,.7);
  color: var(--ink2); border-radius: 20px; padding: 5px 16px; font-size: 13px;
}
.chip.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }

/* 卡片网格 */
.series-sec { margin-bottom: 16px; }
.series-sec h3 {
  font-size: 14px; color: var(--accent-deep); margin: 0 4px 8px;
  display: flex; align-items: baseline; gap: 6px;
}
.series-sec h3 small { color: var(--ink2); font-weight: 400; font-size: 11px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (min-width: 420px) { .grid { grid-template-columns: repeat(5, 1fr); } }
.card {
  position: relative; border-radius: 12px; overflow: hidden;
  padding: 4px 4px 0; cursor: pointer; transition: transform .1s;
}
.card:active { transform: scale(.94); }
/* 已有：稀有度底色卡框，照片全彩 */
.card.owned {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--rc) 38%, #fff),
    color-mix(in srgb, var(--rc) 14%, #fff));
  border: 1.5px solid color-mix(in srgb, var(--rc) 55%, #fff);
  box-shadow: 0 2px 10px color-mix(in srgb, var(--rc) 30%, transparent);
}
/* 缺失：灰色虚线框，照片保持全彩 */
.card.missing {
  background: #f2edee;
  border: 1.5px dashed #dcc6cd;
}
.card img, .card .ph { width: 100%; aspect-ratio: 5/7; object-fit: cover; border-radius: 8px; }
.card img { display: block; }
.ph, .card .ph {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: linear-gradient(150deg, color-mix(in srgb, var(--rc) 22%, #fff), color-mix(in srgb, var(--rc) 48%, #fff));
}
.card.missing .ph { background: linear-gradient(150deg, color-mix(in srgb, var(--rc) 10%, #fbf8f9), color-mix(in srgb, var(--rc) 26%, #f4eef0)); }
.ph-code { font-weight: 800; font-size: 15px; color: color-mix(in srgb, var(--rc) 80%, #333); letter-spacing: .5px; }
.ph-series { font-size: 10px; color: color-mix(in srgb, var(--rc) 60%, #666); }
.ph.big { border-radius: 12px; }
.ph.big .ph-code { font-size: 30px; }
.ph.big .ph-series { font-size: 14px; }
.card.unrevealed .ph-code::after { content: ' ?'; }
.card .badge {
  position: absolute; top: 8px; right: 8px; background: var(--accent-deep); color: #fff;
  font-size: 10px; font-weight: 700; border-radius: 10px; padding: 2px 6px;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.card .tick {
  position: absolute; top: 8px; left: 8px; width: 16px; height: 16px; border-radius: 50%;
  background: #3f7d5d; color: #fff; font-size: 10px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.25);
}
.card-code { text-align: center; font-size: 11px; font-weight: 700; padding: 4px 0 5px; }
.card.owned .card-code { color: color-mix(in srgb, var(--rc) 75%, #40202c); }
.card.missing .card-code { color: #b8a2aa; }

.empty-tip { text-align: center; color: var(--ink2); font-size: 13px; line-height: 2; padding: 26px 10px; }

/* 按钮 */
.btn {
  display: block; width: 100%; border: 1px solid rgba(185,58,91,.3);
  background: rgba(255,255,255,.8); color: var(--accent-deep);
  border-radius: 12px; padding: 11px; font-size: 15px; margin-top: 10px; text-align: center;
}
.btn.primary { background: linear-gradient(135deg, #e8798f, var(--accent-deep)); color: #fff; border: 0; font-weight: 600; box-shadow: 0 4px 12px rgba(185,58,91,.3); }
.btn.ghost { background: none; border-color: rgba(185,58,91,.2); }
.btn.danger { color: #c0392b; border-color: rgba(192,57,43,.35); }
.btn.small { display: inline-block; width: auto; padding: 6px 14px; font-size: 13px; margin: 0; }
.btn:active { opacity: .8; }
.file-btn { cursor: pointer; }
.link { border: 0; background: none; font-size: 12px; color: var(--accent); }
.link.danger { color: #c0392b; }

/* 导入 */
.steps { margin: 4px 0 12px 20px; font-size: 13px; color: var(--ink2); line-height: 2; }
.queue { margin-top: 12px; }
.qrow { padding: 8px 2px; border-top: 1px dashed rgba(185,58,91,.15); }
.qname { font-size: 12px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qstat { font-size: 12px; color: var(--ink2); margin-top: 2px; }
.qstat.err { color: #c0392b; }
.qbar { height: 5px; background: rgba(185,58,91,.1); border-radius: 3px; margin-top: 5px; overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; transition: width .2s; }

.rrow { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px dashed rgba(185,58,91,.15); }
.rrow.off { opacity: .4; }
.rrow input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); }
.rcode {
  width: 84px; padding: 6px 8px; border: 1.5px solid #ccc; border-radius: 8px;
  font-size: 14px; font-weight: 700; color: var(--ink); background: #fff; text-transform: uppercase;
}
.rseries { font-size: 12px; color: var(--ink2); flex: 1; }
.rqty { display: flex; align-items: center; gap: 8px; }
.rqty button, .stepper button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid rgba(185,58,91,.3);
  background: #fff; color: var(--accent-deep); font-size: 16px; line-height: 1;
}
.rqty b { min-width: 18px; text-align: center; }
.warn { font-size: 15px; }
.addrow { justify-content: flex-start; }

.hrow { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--ink2); padding: 8px 0; border-top: 1px dashed rgba(185,58,91,.15); }

/* 换卡 */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tbtns { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 2px; }
.tgroup { margin-top: 10px; }
.tgroup-h { font-size: 12px; font-weight: 700; color: var(--accent-deep); margin: 10px 2px 6px; }
.tgroup-h small { color: var(--ink2); font-weight: 400; }
.tgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(60px, 1fr)); gap: 7px; }
.tcell {
  position: relative; border-radius: 9px; overflow: hidden; cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--rc) 60%, #fff);
  background: #fff; transition: transform .1s;
}
.tcell:active { transform: scale(.93); }
.tcell img, .tcell .tph { width: 100%; aspect-ratio: 5/7; object-fit: cover; display: block; }
.tph {
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; color: color-mix(in srgb, var(--rc) 80%, #333);
  background: linear-gradient(150deg, color-mix(in srgb, var(--rc) 20%, #fff), color-mix(in srgb, var(--rc) 45%, #fff));
}
.tcode {
  text-align: center; font-size: 10px; font-weight: 700; padding: 2px 0 3px;
  color: color-mix(in srgb, var(--rc) 75%, #40202c); background: #fff;
}
.tsel {
  position: absolute; top: 3px; left: 3px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--rc); color: #fff; font-size: 9px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
}
.tqty {
  position: absolute; top: 3px; right: 3px; background: var(--accent-deep); color: #fff;
  font-size: 9px; font-weight: 700; border-radius: 8px; padding: 1px 5px;
}
.tcell.off { border: 1.5px dashed #e0d2d7; }
.tcell.off img, .tcell.off .tph { opacity: .35; }
.tcell.off .tsel { display: none; }
.tcell.off .tcode { color: #c3aeb6; }

.trade-bar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom) + 66px);
  width: min(496px, calc(100% - 20px));
  display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.96); backdrop-filter: blur(12px);
  border-radius: 14px; padding: 8px 8px 8px 14px;
  box-shadow: 0 6px 24px rgba(185,58,91,.28); z-index: 9;
}
.tb-info { font-size: 12px; color: var(--ink2); flex: 1; }
.tb-info b { color: var(--accent-deep); font-size: 14px; }
.tb-btn {
  border-radius: 10px; padding: 9px 12px; font-size: 13px;
  border: 1px solid rgba(185,58,91,.3); background: #fff; color: var(--accent-deep);
}
.tb-btn.primary {
  background: linear-gradient(135deg, #e8798f, var(--accent-deep));
  color: #fff; border: 0; font-weight: 600;
}
.form-row { display: flex; align-items: center; gap: 8px; margin: 8px 0; }
.form-row label { font-size: 13px; color: var(--ink2); min-width: 62px; }
.form-row input, .form-row textarea {
  flex: 1; padding: 8px 10px; border: 1px solid rgba(185,58,91,.25); border-radius: 10px;
  font-size: 14px; background: #fff; color: var(--ink); width: 100%;
}

/* 更多 */
.mrow { display: flex; justify-content: space-between; font-size: 13px; color: var(--ink2); padding: 6px 2px; border-top: 1px dashed rgba(185,58,91,.12); }
.mrow.hit { color: #3f7d5d; font-weight: 600; }

/* 弹窗 */
#modal {
  position: fixed; inset: 0; background: rgba(92,36,54,.45); z-index: 50;
  display: none; align-items: flex-end; justify-content: center;
}
#modal.show { display: flex; }
.sheet {
  background: linear-gradient(180deg, #fff, #fdeef2); width: 100%; max-width: 520px;
  border-radius: 22px 22px 0 0; padding: 22px 20px calc(env(safe-area-inset-bottom) + 20px);
  text-align: center; max-height: 86vh; overflow-y: auto;
  animation: up .22s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.sheet-card { width: 150px; margin: 0 auto 12px; }
.sheet-card img { width: 100%; border-radius: 12px; box-shadow: 0 6px 18px rgba(185,58,91,.25); }
.sheet h3 { color: var(--accent-deep); margin: 4px 0; }
.stepper { display: flex; align-items: center; justify-content: center; gap: 22px; margin: 14px 0 4px; }
.stepper b { font-size: 26px; min-width: 40px; }
.stepper button { width: 40px; height: 40px; font-size: 20px; }
.share-img { width: 100%; border-radius: 12px; box-shadow: 0 4px 16px rgba(185,58,91,.2); }

/* Toast */
#toast {
  position: fixed; left: 50%; bottom: 110px; transform: translateX(-50%) translateY(10px);
  background: rgba(92,36,54,.92); color: #fff; font-size: 13px;
  padding: 9px 18px; border-radius: 20px; opacity: 0; pointer-events: none;
  transition: all .25s; z-index: 60; max-width: 80vw; text-align: center;
}
#toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
