/* ==========================================================
   周也·昼夜抽抽乐 —— 昼夜紫主题样式
   昼：明亮紫罗兰  夜：深邃靛紫
   ========================================================== */
:root {
  --violet-50:  #F5F3FF;
  --violet-100: #EDE9FE;
  --violet-200: #DDD6FE;
  --violet-300: #C4B5FD;
  --violet-400: #A78BFA;
  --violet-500: #8B5CF6;
  --violet-600: #7C3AED;
  --violet-700: #6D28D9;
  --violet-800: #5B21B6;
  --violet-900: #4C1D95;
  --night-700:  #3730A3;
  --night-800:  #312E81;
  --night-900:  #1E1B4B;
  --gold-300:   #FCD34D;
  --gold-400:   #FBBF24;
  --mint-400:   #34D399;
  --mint-500:   #10B981;
  --pink-400:   #F472B6;
  --bg-base:    #F4F1FA;
  --text-main:  #241B3A;
  --text-sub:   #6B6386;
  --card-bg:    #FFFFFF;
  --shadow:     0 4px 20px rgba(76,29,149,0.08);
  --shadow-lg:  0 8px 30px rgba(76,29,149,0.14);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  background: var(--bg-base); color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 14px; line-height: 1.5;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
img { max-width: 100%; }

.app { max-width: 560px; margin: 0 auto; min-height: 100vh; position: relative; }

/* ===== Header：昼夜渐变品牌头 ===== */
.header {
  background: linear-gradient(135deg, var(--violet-500) 0%, var(--violet-700) 45%, var(--night-800) 100%);
  padding: 22px 16px 26px;
  padding-top: max(22px, env(safe-area-inset-top));
  border-radius: 0 0 24px 24px;
  margin: 0 12px 14px;
  margin-top: 8px;
  box-shadow: var(--shadow-lg);
  position: relative; overflow: hidden;
}
.header::before { /* 昼·光晕 */
  content: ''; position: absolute; top: -40%; right: -18%;
  width: 210px; height: 210px; background: rgba(255,255,255,0.09);
  border-radius: 50%; pointer-events: none;
}
.header::after { /* 夜·月影 */
  content: '🌙'; position: absolute; bottom: 10px; left: 14px;
  font-size: 22px; opacity: 0.5; pointer-events: none;
}
.header-title { text-align: center; width: 100%; color: #fff; }
.header-title h1 { font-size: 22px; font-weight: 800; letter-spacing: 1px; text-shadow: 0 2px 8px rgba(30,27,75,0.35); }
.header-subtitle { font-size: 12px; opacity: 0.78; margin-top: 5px; letter-spacing: 2px; }
.header-btns { position: absolute; top: 16px; right: 16px; }
.header-btn {
  background: rgba(255,255,255,0.2); backdrop-filter: blur(8px);
  color: #fff; border: 1px solid rgba(255,255,255,0.32);
  border-radius: 20px; padding: 5px 12px; font-size: 11px; font-weight: 600;
  max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ===== 内容区 ===== */
.content { padding: 0 12px 110px; }
.tab-page { display: none; }
.tab-page.active { display: block; animation: fadeInUp 0.35s ease-out; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }

.panel {
  background: var(--card-bg); border-radius: 16px; box-shadow: var(--shadow);
  padding: 14px; margin-bottom: 14px; border: 1px solid var(--violet-100);
}
.panel-title {
  background: var(--violet-50); border-radius: 12px;
  padding: 10px 14px; margin: -14px -14px 14px;
  width: calc(100% + 28px); border-bottom: 1px solid var(--violet-100);
  font-weight: 700; color: var(--violet-700);
  display: flex; align-items: center; gap: 8px; font-size: 14px;
}
.panel-title .title-bar { display: none; }
.panel-title::before {
  content: ''; width: 4px; height: 18px;
  background: linear-gradient(180deg, var(--violet-500), var(--night-800));
  border-radius: 2px; flex: none;
}
.panel-sub { font-size: 11px; color: var(--text-sub); font-weight: 400; }

/* ===== 底部导航：悬浮胶囊 ===== */
.tab-bar {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; justify-content: center; align-items: center;
  min-width: 280px; max-width: 92%;
  background: rgba(255,255,255,0.94);
  backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(139,92,246,0.18);
  border-radius: 28px;
  box-shadow: 0 8px 32px rgba(76,29,149,0.18), 0 2px 8px rgba(0,0,0,0.05);
  padding: 6px 12px; gap: 6px; z-index: 100;
}
.tab-item {
  flex: none; padding: 8px 16px; border-radius: 20px;
  font-size: 11px; font-weight: 700; color: var(--text-sub);
  display: flex; align-items: center; gap: 4px;
  transition: all 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.tab-item .tab-icon { font-size: 17px; }
.tab-item.active {
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.35);
  transform: translateY(-2px);
}

/* ===== 图鉴子导航 / 跳转条 ===== */
.coll-sub-nav { display: flex; gap: 8px; margin: 2px 0 10px; }
.coll-sub-btn {
  flex: 1; padding: 10px 0; font-size: 14px; font-weight: 600;
  border-radius: 14px; transition: all 0.25s;
  background: var(--violet-50); color: var(--violet-700);
  border: 1px solid var(--violet-100);
}
.coll-sub-btn.active {
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  color: #fff; border-color: transparent;
  box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}
.coll-jump-bar {
  position: sticky; top: 0; z-index: 50;
  display: flex; gap: 6px; padding: 8px 2px; margin-bottom: 6px;
  background: rgba(244,241,250,0.92); backdrop-filter: blur(8px);
  overflow-x: auto; scrollbar-width: none;
}
.coll-jump-bar::-webkit-scrollbar { display: none; }
.coll-jump-item {
  padding: 6px 14px; font-size: 13px; font-weight: 600;
  border-radius: 20px; white-space: nowrap; transition: all 0.2s;
  background: var(--violet-50); color: var(--violet-600); border: 1px solid var(--violet-100);
}
.coll-jump-item:hover, .coll-jump-item:active { background: var(--violet-500); color: #fff; border-color: var(--violet-500); }

/* ===== 总览 Hero ===== */
#overviewPanel {
  background: linear-gradient(135deg, var(--violet-600) 0%, var(--violet-700) 50%, var(--night-800) 100%);
  color: #fff; border: none; position: relative; overflow: hidden;
}
#overviewPanel::after {
  content: ''; position: absolute; top: -30%; right: -12%;
  width: 160px; height: 160px; background: rgba(255,255,255,0.07);
  border-radius: 50%; pointer-events: none;
}
#overviewPanel .panel-title { background: transparent; color: #fff; border: none; }
#overviewPanel .panel-title::before { background: linear-gradient(180deg, #fff, var(--violet-300)); }
.overview-btn {
  margin-left: auto; background: rgba(255,255,255,0.18); color: #fff;
  border: 1px solid rgba(255,255,255,0.3); border-radius: 16px;
  padding: 4px 12px; font-size: 11px; font-weight: 600; z-index: 1;
}
.overview-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ov-card {
  background: rgba(0,0,0,0.16); backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 14px; padding: 12px 14px;
}
.ov-label { font-size: 12px; color: rgba(255,255,255,0.82); font-weight: 600; }
.ov-num { font-size: 24px; font-weight: 800; color: #fff; line-height: 1.25; }
.ov-num.gold { color: var(--gold-300); }
.ov-slash { font-size: 14px; font-weight: 600; color: rgba(255,255,255,0.6); }
.ov-bar-wrap { height: 6px; background: rgba(255,255,255,0.25); border-radius: 3px; margin: 6px 0 4px; overflow: hidden; }
.ov-bar { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--gold-300), var(--gold-400)); transition: width 0.5s ease; }
.ov-bar.reward { background: linear-gradient(90deg, var(--violet-300), var(--pink-400)); }
.ov-pct { font-size: 11px; color: rgba(255,255,255,0.9); font-weight: 700; }
.ov-note { font-size: 10px; color: rgba(255,255,255,0.6); margin-top: 2px; }

/* ===== 满赠进度 ===== */
.bn-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.bn-cell {
  background: var(--card-bg); border-radius: 16px; padding: 14px;
  box-shadow: var(--shadow); border: 1px solid var(--violet-100);
}
.bn-cell-head { display: flex; justify-content: space-between; align-items: center; color: var(--violet-700); font-weight: 700; margin-bottom: 6px; }
.bn-detail-btn { font-size: 11px; color: var(--violet-500); background: var(--violet-50); border: 1px solid var(--violet-200); border-radius: 12px; padding: 2px 10px; }
.bn-cell-sub { font-size: 12px; color: var(--text-sub); margin-bottom: 12px; }
.bn-next-head { display: flex; justify-content: space-between; font-size: 12px; font-weight: 700; color: var(--text-main); }
.bn-next-draws { color: var(--violet-600); }
.bn-next-reward { font-size: 13px; font-weight: 600; color: var(--text-main); margin: 4px 0; }
.bn-bar-wrap { height: 8px; background: var(--violet-100); border-radius: 4px; overflow: hidden; margin: 6px 0; }
.bn-bar { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--violet-400), var(--violet-600)); transition: width 0.5s ease; }
.bn-next-foot { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-sub); }
.bn-note { font-size: 11px; color: var(--text-sub); text-align: center; margin-top: 12px; }

/* ===== 卡池切换 ===== */
.pool-bar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.pool-tabs { display: flex; gap: 4px; background: var(--violet-50); border-radius: 14px; padding: 4px; flex: 1; }
.pool-tab {
  flex: 1; padding: 9px 0; font-size: 13px; font-weight: 700; text-align: center;
  border-radius: 12px; color: var(--text-sub); transition: all 0.25s;
}
.pool-tab.active {
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.3);
}
.group-menu { position: relative; }
.group-icon-btn {
  display: flex; align-items: center; gap: 4px;
  background: var(--violet-50); border: 1px solid var(--violet-200);
  color: var(--violet-600); border-radius: 12px; padding: 8px 10px; font-size: 11px; font-weight: 700;
}
.group-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; border: 1px solid var(--violet-200); border-radius: 12px;
  box-shadow: var(--shadow-lg); z-index: 60; overflow: hidden; min-width: 140px;
}
.group-dropdown.open { display: block; }
.group-option { padding: 10px 14px; font-size: 12px; font-weight: 600; color: var(--text-sub); }
.group-option.active { color: var(--violet-600); background: var(--violet-50); }

/* ===== 统计行 ===== */
.stats-row {
  display: flex; gap: 8px; padding: 4px 0 10px;
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none;
}
.stats-row::-webkit-scrollbar { display: none; }
.stat-card {
  background: var(--card-bg); border-radius: 14px; padding: 8px 14px;
  box-shadow: var(--shadow); border: 1px solid var(--violet-100);
  min-width: 72px; flex-shrink: 0; text-align: center;
}
.stat-card .num { font-size: 18px; font-weight: 800; color: var(--violet-600); line-height: 1.2; }
.stat-card .num.gold { color: var(--gold-400); }
.stat-card .lbl { font-size: 10px; color: var(--text-sub); margin-top: 2px; }
.collect-slash { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.collect-bar { height: 4px; background: var(--violet-100); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.collect-bar-fill { height: 100%; background: linear-gradient(90deg, var(--violet-400), var(--violet-600)); border-radius: 2px; }

/* ===== 卡牌网格 ===== */
.rarity-section { margin-bottom: 16px; }
.rarity-title {
  font-size: 14px; font-weight: 700; color: var(--violet-700);
  margin: 10px 2px 8px; display: flex; align-items: center; gap: 6px;
}
.rarity-title .group-count { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.card-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.card-cell {
  background: var(--card-bg); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--violet-100);
  box-shadow: 0 2px 8px rgba(76,29,149,0.06);
  transition: all 0.2s cubic-bezier(0.34,1.56,0.64,1);
  position: relative; cursor: pointer; text-align: center; padding-bottom: 8px;
}
.card-cell:active { transform: scale(0.96); }
.card-cell:not(.zero) { border-color: var(--violet-300); box-shadow: 0 4px 16px rgba(139,92,246,0.16); }
.placeholder {
  aspect-ratio: 3/4; display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 800; color: rgba(255,255,255,0.92);
  letter-spacing: 1px; position: relative; overflow: hidden;
}
.placeholder img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
/* 稀有度占位渐变（无图时也好看） */
.placeholder.rar-r   { background: linear-gradient(150deg, var(--violet-300), var(--violet-500)); }
.placeholder.rar-sr  { background: linear-gradient(150deg, var(--violet-500), var(--violet-700)); }
.placeholder.rar-ssr { background: linear-gradient(150deg, var(--violet-700), var(--night-800)); }
.placeholder.rar-ur  { background: linear-gradient(150deg, var(--night-800), #6D28D9 55%, var(--gold-400)); }
.placeholder.rar-ex  { background: linear-gradient(150deg, var(--gold-400), var(--pink-400) 60%, var(--violet-600)); }
.card-cell.zero .placeholder { filter: grayscale(0.55) brightness(1.08); }
.card-cell.zero .placeholder::after {
  content: '未拥有'; position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.85);
  background: rgba(30,27,75,0.4); padding: 1px 8px; border-radius: 8px; letter-spacing: 2px;
}
.cid { font-size: 11px; font-weight: 800; color: var(--violet-700); margin-top: 6px; }
.cname { font-size: 10px; color: var(--text-sub); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.badge {
  position: absolute; top: 6px; right: 6px; min-width: 20px; height: 20px;
  border-radius: 10px; padding: 0 5px;
  background: rgba(30,27,75,0.62); backdrop-filter: blur(4px);
  color: #fff; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.card-cell.zero .badge { background: rgba(30,27,75,0.35); }
.prenote-badge {
  position: absolute; top: 6px; left: 6px;
  background: linear-gradient(135deg, var(--gold-400), var(--pink-400));
  color: #fff; font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 8px;
}

/* ===== 奖励解锁 ===== */
.reward-group { padding: 0 2px 6px; }
.reward-group-head {
  font-size: 14px; font-weight: 700; color: var(--violet-700);
  margin: 10px 0 8px; display: flex; align-items: center; gap: 6px;
}
.reward-group-sub { font-size: 11px; color: var(--text-sub); font-weight: 600; }
.reward-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.reward-cell {
  background: var(--card-bg); border-radius: 14px; overflow: hidden;
  border: 1px solid var(--violet-100); text-align: center; padding-bottom: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); position: relative;
}
.reward-cell.unlocked { border-color: var(--mint-400); box-shadow: 0 4px 12px rgba(16,185,129,0.14); }
.reward-ph-wrap {
  aspect-ratio: 3/4; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(150deg, var(--violet-200), var(--violet-400));
  font-size: 16px; font-weight: 800; color: #fff;
}
.reward-ph-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.reward-cell.locked .reward-ph-wrap { filter: grayscale(0.5); }
.locked-emoji { position: absolute; bottom: 6px; right: 6px; font-size: 16px; filter: drop-shadow(0 1px 3px rgba(0,0,0,0.4)); }
.unlocked-emoji { position: absolute; bottom: 6px; right: 6px; font-size: 16px; }
.reward-name { font-size: 11px; font-weight: 700; margin-top: 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 4px; }
.reward-tier { font-size: 10px; color: var(--text-sub); margin-top: 1px; }

/* ===== 录入页 ===== */
.sub-tip { text-align: center; font-size: 13px; color: var(--text-sub); margin-bottom: 12px; }
.sub-tabs { display: flex; background: var(--violet-50); border-radius: 14px; padding: 4px; gap: 4px; margin-bottom: 12px; }
.sub-tab {
  flex: 1; padding: 9px 0; font-size: 12px; font-weight: 700; text-align: center;
  border-radius: 12px; color: var(--text-sub); transition: all 0.25s;
}
.sub-tab.active {
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.25);
}
.sub-page { display: none; }
.sub-page.active { display: block; animation: fadeInUp 0.3s ease-out; }
.entry-pool-bar { margin-bottom: 8px; }

.entry-group-title { font-size: 13px; font-weight: 700; color: var(--violet-700); margin: 12px 2px 8px; }
.entry-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.entry-row {
  background: var(--card-bg); border: 1px solid var(--violet-100); border-radius: 12px;
  padding: 8px 10px; display: flex; align-items: center; justify-content: space-between; gap: 6px;
}
.entry-name { font-size: 12px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.entry-name small { display: block; font-size: 10px; color: var(--text-sub); font-weight: 400; }
.entry-ctrl { display: flex; align-items: center; gap: 6px; flex: none; }
.entry-btn {
  width: 26px; height: 26px; border-radius: 8px; font-size: 15px; font-weight: 700;
  background: var(--violet-50); color: var(--violet-600); border: 1px solid var(--violet-200);
  display: flex; align-items: center; justify-content: center;
}
.entry-btn:active { transform: scale(0.9); }
.entry-num { min-width: 24px; text-align: center; font-weight: 800; font-size: 14px; color: var(--violet-700); }

/* 上传 / OCR */
.upload-zone {
  border: 2px dashed var(--violet-300); border-radius: 16px; background: var(--violet-50);
  padding: 34px 16px; text-align: center; cursor: pointer; transition: all 0.2s;
}
.upload-zone:active { transform: scale(0.98); border-color: var(--violet-500); }
.upload-zone .icon { font-size: 34px; }
.upload-zone .text { font-size: 14px; font-weight: 700; color: var(--violet-700); margin-top: 6px; }
.upload-zone .hint { font-size: 11px; color: var(--text-sub); margin-top: 4px; }
.upload-preview { background: var(--card-bg); border: 1px solid var(--violet-100); border-radius: 16px; padding: 12px; margin-top: 12px; box-shadow: var(--shadow); }
.preview-carousel { position: relative; border-radius: 12px; overflow: hidden; background: var(--night-900); }
.preview-carousel img { width: 100%; max-height: 260px; object-fit: contain; display: block; }
.preview-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 30px; height: 30px; border-radius: 50%;
  background: rgba(255,255,255,0.18); color: #fff; font-size: 18px;
  display: flex; align-items: center; justify-content: center;
}
.preview-nav.prev { left: 8px; } .preview-nav.next { right: 8px; }
.preview-index { position: absolute; bottom: 6px; right: 8px; font-size: 11px; color: #fff; background: rgba(0,0,0,0.4); padding: 1px 8px; border-radius: 8px; }
.ocr-result { margin-top: 12px; }
.ocr-title { font-size: 13px; font-weight: 700; color: var(--text-main); margin-bottom: 8px; }
.ocr-loading { text-align: center; padding: 18px 0; }
.ocr-loading-icon { font-size: 28px; animation: pulse 1s infinite; }
.ocr-loading-text { font-size: 13px; color: var(--text-sub); margin-top: 6px; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.ocr-toolbar { display: flex; gap: 6px; margin-bottom: 8px; }
.ocr-nums { display: flex; flex-wrap: wrap; gap: 8px; }
.ocr-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--violet-50); border: 1px solid var(--violet-200); border-radius: 12px;
  padding: 6px 8px; transition: all 0.2s;
}
.ocr-chip.off { opacity: 0.42; }
.ocr-chip .chip-name { font-size: 12px; font-weight: 700; color: var(--violet-700); max-width: 72px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ocr-chip .chip-btn { width: 22px; height: 22px; border-radius: 7px; background: #fff; border: 1px solid var(--violet-200); color: var(--violet-600); font-weight: 700; font-size: 13px; }
.ocr-chip .chip-num { min-width: 18px; text-align: center; font-weight: 800; font-size: 13px; }
.ocr-chip .chip-remove { color: #EF4444; border-color: #FECACA; }
.warn-line { font-size: 11px; color: #B45309; background: #FEF3C7; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.ok-line { font-size: 11px; color: #047857; background: #D1FAE5; border-radius: 8px; padding: 6px 10px; margin-bottom: 6px; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.btn-row .btn { flex: 1; }
.ocr-guide { margin-top: 14px; padding: 14px; background: var(--violet-50); border-radius: 12px; font-size: 12px; color: var(--text-sub); line-height: 1.8; border: 1px solid var(--violet-100); }
.ocr-guide-title { font-weight: 700; color: var(--violet-700); margin-bottom: 4px; }
.ocr-guide ul { padding-left: 18px; }

/* 文本识别 */
.text-parse-panel { background: var(--card-bg); border-radius: 16px; }
.text-parse-label { font-size: 12px; font-weight: 700; color: var(--violet-700); display: block; margin-bottom: 6px; }
.text-parse-input {
  width: 100%; border: 1px solid var(--violet-200); background: var(--violet-50);
  border-radius: 12px; padding: 10px 12px; font-size: 13px; font-family: inherit;
  color: var(--text-main); resize: vertical; outline: none;
}
.text-parse-input:focus { border-color: var(--violet-400); box-shadow: 0 0 0 3px rgba(139,92,246,0.12); }
.text-parse-actions { display: flex; gap: 8px; margin-top: 10px; }
.text-parse-actions .btn { flex: 1; }
.text-parse-result { margin-top: 12px; background: var(--card-bg); border: 1px solid var(--violet-100); border-radius: 16px; padding: 12px; box-shadow: var(--shadow); }

/* ===== 按钮 ===== */
.btn {
  border-radius: 12px; padding: 11px 16px; font-size: 13px; font-weight: 700;
  transition: all 0.2s; display: inline-flex; align-items: center; justify-content: center; gap: 4px;
}
.btn:active { transform: scale(0.97); }
.btn-sm { padding: 6px 12px; font-size: 11px; border-radius: 10px; }
.btn-primary {
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700));
  color: #fff; box-shadow: 0 4px 12px rgba(124,58,237,0.28);
}
.btn-outline { background: #fff; border: 1px solid var(--violet-300); color: var(--violet-600); }
.btn-danger { background: #fff; border: 1px solid #FCA5A5; color: #DC2626; }
.faq-actions { display: flex; gap: 8px; }
.faq-actions .btn { flex: 1; }

/* ===== 记录列表 ===== */
.history-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.history-title { font-weight: 700; font-size: 16px; }
.history-actions { display: flex; gap: 8px; }
.history-item {
  background: var(--card-bg); border: 1px solid var(--violet-100); border-radius: 14px;
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
}
.history-item-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.history-time { font-size: 11px; color: var(--text-sub); }
.history-src { font-size: 10px; font-weight: 700; color: var(--violet-600); background: var(--violet-50); border: 1px solid var(--violet-200); border-radius: 8px; padding: 2px 8px; }
.history-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.history-chip { font-size: 11px; font-weight: 600; background: var(--violet-50); color: var(--violet-700); border-radius: 8px; padding: 3px 8px; }
.history-empty { text-align: center; padding: 40px; color: var(--text-sub); }

/* ===== 非酋兑换 ===== */
.exchange-intro { font-size: 13px; color: var(--text-main); }
.exchange-intro-title { font-weight: 700; color: var(--violet-700); margin: 8px 0 4px; }
.exchange-intro ul { padding-left: 18px; color: var(--text-sub); line-height: 1.9; }
.exchange-prenote { font-size: 12px; color: var(--text-sub); margin: 10px 0; line-height: 1.7; }
.exchange-note { font-size: 12px; color: #B45309; background: #FEF3C7; border-radius: 10px; padding: 10px 12px; line-height: 1.7; }
.exchange-empty { text-align: center; padding: 28px 16px; }
.exchange-empty-icon { font-size: 32px; }
.exchange-empty-title { font-weight: 700; margin: 8px 0 4px; color: var(--text-main); }
.exchange-empty p { font-size: 12px; color: var(--text-sub); }
.exchange-card {
  background: var(--card-bg); border: 1px solid var(--violet-100); border-radius: 14px;
  padding: 12px; margin-bottom: 10px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px;
}
.exchange-card-thumb {
  width: 52px; height: 66px; border-radius: 8px; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #fff; position: relative; overflow: hidden;
}
.exchange-card-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.exchange-card-info { flex: 1; min-width: 0; }
.exchange-card-name { font-size: 13px; font-weight: 700; }
.exchange-card-meta { font-size: 11px; color: var(--text-sub); margin-top: 2px; }
.exchange-card-btns { display: flex; flex-direction: column; gap: 6px; flex: none; }

/* ===== 更多页 ===== */
.faq-text { font-size: 13px; color: var(--text-main); }
.shop-title { font-size: 16px; font-weight: 800; color: var(--violet-700); margin-bottom: 10px; }
.biz-block { background: var(--violet-50); border: 1px solid var(--violet-100); border-radius: 12px; padding: 10px 12px; margin-bottom: 8px; }
.biz-head { font-weight: 700; color: var(--violet-700); margin-bottom: 4px; }
.biz-key { display: inline-block; min-width: 66px; color: var(--text-sub); font-size: 12px; }
.data-notice {
  display: flex; gap: 8px; align-items: flex-start;
  background: linear-gradient(135deg, #FEF3C7, #FDE68A);
  border-radius: 12px; padding: 12px; font-size: 12px; margin-bottom: 10px;
}
.data-notice-icon { font-size: 16px; }
.data-card { background: var(--violet-50); border-radius: 12px; border: 1px solid var(--violet-100); padding: 12px; margin-bottom: 8px; }
.data-card-title { font-weight: 700; color: var(--violet-700); margin-bottom: 6px; }
.data-card-item { display: flex; gap: 8px; align-items: flex-start; font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.data-tag { flex: none; font-size: 10px; font-weight: 700; color: #fff; border-radius: 6px; padding: 2px 8px; }
.data-tag-export { background: linear-gradient(135deg, var(--violet-500), var(--violet-700)); }
.data-tag-import { background: linear-gradient(135deg, var(--mint-500), var(--mint-400)); }
.data-warn { font-size: 12px; color: #B45309; margin-top: 8px; }
.faq-qa { margin-bottom: 10px; }
.faq-q { font-weight: 700; color: var(--violet-700); }
.faq-a { font-size: 12px; color: var(--text-sub); margin-top: 2px; line-height: 1.7; }

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 150;
  background: rgba(30,27,75,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
}
.modal-sheet {
  background: #fff; width: 100%; max-width: 560px;
  border-radius: 24px 24px 0 0; padding: 18px 16px calc(20px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto; position: relative;
  animation: sheetUp 0.28s cubic-bezier(0.34,1.3,0.64,1);
}
@keyframes sheetUp { from { transform: translateY(60px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-handle { width: 40px; height: 4px; background: var(--violet-200); border-radius: 2px; margin: 0 auto 14px; }
.modal-close {
  position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--violet-50); color: var(--text-sub); font-size: 14px; z-index: 2;
}
.modal-card-preview { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 12px; }
.modal-nav {
  width: 34px; height: 34px; border-radius: 50%; flex: none;
  background: var(--violet-50); border: 1px solid var(--violet-200);
  color: var(--violet-600); font-size: 20px;
}
.modal-face {
  width: 200px; aspect-ratio: 3/4; border-radius: 16px; overflow: hidden; position: relative;
  display: flex; align-items: center; justify-content: center;
  font-size: 30px; font-weight: 800; color: rgba(255,255,255,0.95);
  background: linear-gradient(150deg, var(--violet-400), var(--night-800));
  box-shadow: var(--shadow-lg);
}
.modal-face img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.modal-info { text-align: center; }
.modal-cid { font-size: 18px; font-weight: 800; color: var(--violet-700); }
.modal-name { font-size: 13px; color: var(--text-sub); margin-top: 2px; }
.modal-rarity {
  display: inline-block; margin-top: 6px; font-size: 11px; font-weight: 700;
  color: #fff; background: linear-gradient(135deg, var(--violet-500), var(--night-800));
  border-radius: 10px; padding: 3px 12px;
}
.modal-count-line { margin-top: 8px; font-size: 13px; color: var(--text-main); }
.modal-count-line span { font-weight: 800; color: var(--violet-600); font-size: 16px; }
.bonus-modal-title { font-size: 16px; font-weight: 800; color: var(--violet-700); text-align: center; margin-bottom: 12px; }
.bonus-tier-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 12px; border-radius: 12px; margin-bottom: 6px;
  background: var(--violet-50); border: 1px solid var(--violet-100); font-size: 13px;
}
.bonus-tier-row.done { background: #ECFDF5; border-color: #A7F3D0; }
.bonus-tier-req { font-weight: 700; }
.bonus-tier-reward { color: var(--text-sub); font-size: 12px; }
.bonus-tier-state { font-size: 12px; font-weight: 700; }
.confirm-body { font-size: 13px; color: var(--text-main); line-height: 1.8; text-align: center; padding: 4px 0 12px; }
.confirm-actions { display: flex; gap: 8px; }
.confirm-actions .btn { flex: 1; }
.import-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.import-tabs .sub-tab { background: var(--violet-50); }
.import-textarea {
  width: 100%; border: 1px solid var(--violet-200); background: var(--violet-50);
  border-radius: 12px; padding: 10px 12px; font-size: 12px; font-family: inherit;
  min-height: 120px; resize: vertical; outline: none;
}
.overview-tabs { display: flex; gap: 8px; margin-bottom: 12px; }
.overview-tab {
  flex: 1; padding: 9px 0; border-radius: 12px; font-size: 13px; font-weight: 700;
  background: var(--violet-50); color: var(--text-sub);
}
.overview-tab.active { background: linear-gradient(135deg, var(--violet-500), var(--violet-700)); color: #fff; }
.ov-list-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.ov-mini {
  border-radius: 10px; overflow: hidden; text-align: center;
  border: 1px solid var(--violet-100); background: var(--card-bg); padding-bottom: 4px;
}
.ov-mini .placeholder { font-size: 12px; aspect-ratio: 1/1; }
.ov-mini-name { font-size: 9px; color: var(--text-sub); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0 2px; }
.ov-group-title { font-size: 12px; font-weight: 700; color: var(--violet-700); margin: 12px 0 6px; }
.account-row {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-radius: 12px; margin-bottom: 6px;
  background: var(--violet-50); border: 1px solid var(--violet-100);
}
.account-row.active { border-color: var(--violet-400); background: var(--violet-100); }
.account-name { flex: 1; font-weight: 700; font-size: 13px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-meta { font-size: 11px; color: var(--text-sub); font-weight: 400; }
.account-btn { font-size: 11px; color: var(--violet-600); background: #fff; border: 1px solid var(--violet-200); border-radius: 8px; padding: 4px 10px; flex: none; }
.account-btn.danger { color: #DC2626; border-color: #FECACA; }
.exchange-modal-card {
  display: flex; align-items: center; gap: 10px; padding: 10px;
  border: 1px solid var(--violet-100); border-radius: 12px; margin-bottom: 8px; cursor: pointer;
}
.exchange-modal-card.selected { border-color: var(--violet-500); background: var(--violet-50); }
.exchange-modal-thumb { width: 40px; height: 52px; border-radius: 6px; flex: none; position: relative; overflow: hidden; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 800; font-size: 11px; }
.exchange-modal-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

/* ===== Toast ===== */
.toast {
  position: fixed; bottom: 96px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: rgba(30,27,75,0.88); color: #fff; font-size: 13px; font-weight: 600;
  padding: 10px 20px; border-radius: 22px; z-index: 300;
  opacity: 0; pointer-events: none; transition: all 0.3s; max-width: 86%; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== 桌面端微调 ===== */
@media (min-width: 560px) {
  .card-grid, .reward-grid { grid-template-columns: repeat(4, 1fr); }
  .entry-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== 悬浮入口：去微店抽卡 ===== */
.float-draw {
  position: fixed; z-index: 120;
  right: max(16px, calc((100% - 560px) / 2 + 16px));
  bottom: 96px;
  display: flex; align-items: center; gap: 10px;
  padding: 5px 15px 5px 6px;
  border-radius: 30px;
  background: linear-gradient(135deg, var(--violet-500), var(--violet-700) 60%, var(--night-800));
  box-shadow: 0 6px 18px rgba(76,29,149,0.35), 0 0 0 1px rgba(196,181,253,0.3), 0 0 22px rgba(139,92,246,0.25);
  color: #fff; cursor: pointer; user-select: none; touch-action: none;
  font-family: inherit; border: none; text-align: left;
  transition: transform 0.2s;
}
.float-draw:active { transform: scale(0.95); }
.float-draw-circle {
  width: 40px; height: 40px; border-radius: 50%; flex: none;
  background: rgba(255,255,255,0.22);
  border: 1px solid rgba(255,255,255,0.35);
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
}
.float-draw-text { display: flex; flex-direction: column; line-height: 1.25; }
.float-draw-text b { font-size: 13px; font-weight: 800; }
.float-draw-text small { font-size: 10px; opacity: 0.78; font-weight: 600; }
.float-draw-close {
  position: absolute; top: -6px; left: -6px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--violet-800); color: #fff; font-size: 11px; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid rgba(255,255,255,0.55); cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.28);
}
.float-draw.hidden { display: none; }

/* ===== 老版本 iOS Safari（< 15）不支持 aspect-ratio 时的兜底高度 =====
   避免卡牌/奖励占位图在旧手机上塌陷成一条线（新版浏览器仍走 aspect-ratio） */
@supports not (aspect-ratio: 1/1) {
  .placeholder,
  .reward-ph-wrap { height: 120px; }
  .modal-face { height: 266px; }
}
