/* ========== 浅蓝色系主题 ========== */
:root {
  --orange-50:  #F0F8FF;
  --orange-100: #E3F2FD;
  --orange-200: #BBDEFB;
  --orange-300: #90CAF9;
  --orange-400: #64B5F6;
  --orange-500: #42A5F5;
  --orange-600: #1E88E5;
  --orange-700: #1565C0;
  --orange-800: #0D47A1;
  --brown-50:   #F5F9FF;
  --brown-100:  #E8F0FE;
  --brown-200:  #90A4AE;
  --brown-800:  #263238;
  --brown-900:  #102027;
  --pr-color:   #E8A820;
  --pr-bg:      #FFF8E8;
  --pr-border:  #F0D060;
  --r-color:    #6B8EC8;
  --r-bg:       #F0F4FA;
  --r-border:   #B0C8E8;
  --sr-color:   #C878D0;
  --sr-bg:      #FAF0FC;
  --sr-border:  #E0B8E8;
  --ssr-color:  #E060A0;
  --ssr-bg:     #FFF0F8;
  --ssr-border: #F0C0D8;
  --ur-color:   #B07CC8;
  --ur-bg:      #F8F0FC;
  --ur-border:  #D8B8E8;
  --hr-color:   #8AB860;
  --hr-bg:      #F2F8EC;
  --hr-border:  #C0DCA0;
  --sp-color:   #50B8B0;
  --sp-bg:      #ECFAF8;
  --sp-border:  #A8E0DC;
  --ex-color:   #D07850;
  --ex-bg:      #FFF2EC;
  --ex-border:  #F0C8B0;
  --white:      #FFFFFF;
  --danger:     #E05555;
  --safe-bottom: env(safe-area-inset-bottom, 16px);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  background: var(--orange-50); color: var(--brown-900);
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none; user-select: none;
}

.app { display: flex; flex-direction: column; height: 100%; max-width: 480px; margin: 0 auto; position: relative; }

/* Header */
.header {
  background: linear-gradient(135deg, var(--orange-600), var(--orange-500));
  padding: 16px 20px; padding-top: max(16px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  color: white; flex-shrink: 0; box-shadow: 0 2px 12px rgba(30,136,229,0.25); z-index: 10;
}
.header h1 { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.header-title { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
.header-title h1 { font-size: 17px; }
.header-subtitle { font-size: 11px; font-weight: 500; opacity: 0.85; }
.header-btns { display: flex; gap: 6px; }
.header-btn {
  padding: 6px 12px; border: none; border-radius: 8px; font-size: 12px; font-weight: 700;
  cursor: pointer; font-family: inherit; color: var(--orange-700);
  background: rgba(255,255,255,0.92); box-shadow: 0 2px 6px rgba(0,0,0,0.08); transition: all 0.12s;
}
.header-btn:active { transform: scale(0.92); background: var(--white); }
.header-btn.danger { color: var(--danger); }

.btn {
  padding: 10px 16px; border: none; border-radius: 12px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.15s; font-family: inherit; display: flex; align-items: center; justify-content: center; gap: 4px;
}
.btn:active { transform: scale(0.95); }
.btn-primary { background: linear-gradient(135deg, var(--orange-500),var(--orange-600)); color: white; box-shadow: 0 3px 12px rgba(30,136,229,0.3); }
.btn-outline { background: var(--white); color: var(--orange-600); border: 2px solid var(--orange-300); }
.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-white { color: white; border-color: rgba(255,255,255,0.4); }

/* 单卡池区：页签 + 计数 + 卡牌网格 */
.pool-section {
  background: var(--white); border-radius: 16px; padding: 4px 14px 16px;
  margin-bottom: 12px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
/* Pool Bar: 池子页签(左) + 分组切换图标(右) */
.pool-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  border-bottom: 1px solid var(--orange-100); margin-bottom: 12px;
}
.pool-tabs { display: flex; gap: 4px; }
.pool-tab {
  padding: 12px 4px; margin-right: 16px; border: none; background: transparent;
  font-size: 15px; font-weight: 600; color: var(--brown-200); cursor: pointer;
  position: relative; transition: color 0.2s; font-family: inherit;
}
.pool-tab:last-child { margin-right: 0; }
.pool-tab.active { color: var(--orange-600); }
.pool-tab.active::after {
  content: ''; position: absolute; left: 4px; right: 4px; bottom: -1px; height: 3px;
  background: var(--orange-500); border-radius: 3px 3px 0 0;
}

/* 分组切换图标 + 下拉 */
.group-menu { position: relative; }
.group-icon-btn {
  display: flex; align-items: center; gap: 5px; padding: 6px 10px;
  border: 1.5px solid var(--orange-300); background: var(--white); border-radius: 9px;
  font-size: 12px; font-weight: 700; color: var(--orange-600); cursor: pointer;
  font-family: inherit; transition: all 0.15s; box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}
.group-icon-btn:active { transform: scale(0.94); background: var(--orange-50); }
.group-icon-svg { display: block; }
.group-dropdown {
  position: absolute; top: calc(100% + 4px); right: 0; min-width: 150px;
  background: var(--white); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,0.15);
  padding: 6px; z-index: 20; display: none; opacity: 0; transform: translateY(-4px);
  transition: opacity 0.15s, transform 0.15s;
}
.group-dropdown.show { display: block; opacity: 1; transform: translateY(0); }
.group-option {
  padding: 10px 12px; border-radius: 8px; font-size: 13px; font-weight: 600;
  color: var(--brown-800); cursor: pointer; transition: background 0.12s;
}
.group-option:active { background: var(--orange-50); }
.group-option.active { background: var(--orange-50); color: var(--orange-600); }

/* Main Content */
.content { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 80px; }
.tab-page { display: none; padding: 8px 16px 0; }
.tab-page.active { display: block; }

/* 录入页子页签 */
.sub-tabs {
  display: flex; background: var(--white); margin-bottom: 14px; border-radius: 12px;
  padding: 3px; box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.sub-tab {
  flex: 1; padding: 10px; border: none; border-radius: 9px; font-size: 13px; font-weight: 600;
  cursor: pointer; transition: all 0.2s; background: transparent; color: var(--brown-800); font-family: inherit;
}
.sub-tab.active { background: linear-gradient(135deg, var(--orange-500),var(--orange-600)); color: white; box-shadow: 0 2px 8px rgba(30,136,229,0.3); }
.sub-page { display: none; }
.sub-page.active { display: block; }

/* Stats Row (横向滚动) */
.stats-row { display: flex; gap: 8px; margin-bottom: 14px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
.stats-row::-webkit-scrollbar { height: 0; }
.stats-row .stat-card { flex: 0 0 auto; min-width: 72px; }
.stat-card {
  background: var(--white); border-radius: 14px; padding: 12px 8px; text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.stat-card .num { font-size: 24px; font-weight: 800; }
.stat-card .num.orange { color: var(--orange-600); }
.stat-card .num.r-num { color: var(--r-color); }
.stat-card .num.pr-num { color: var(--pr-color); }
.stat-card .num.sr-num { color: var(--sr-color); }
.stat-card .num.ssr-num { color: var(--ssr-color); }
.stat-card .num.ur-num { color: var(--ur-color); }
.stat-card .num.hr-num { color: var(--hr-color); }
.stat-card .num.sp-num { color: var(--sp-color); }
.stat-card .num.ex-num { color: var(--ex-color); }
.stat-card .lbl { font-size: 11px; color: var(--brown-200); margin-top: 2px; line-height: 1.3; word-break: keep-all; }
.stat-collect { min-width: 88px; }
.collect-slash { font-size: 13px; font-weight: 600; color: var(--brown-200); }
.collect-bar { height: 4px; background: var(--orange-100); border-radius: 2px; overflow: hidden; margin-top: 5px; }
.collect-bar-fill { height: 100%; background: linear-gradient(90deg, var(--orange-400), var(--orange-600)); border-radius: 2px; transition: width 0.4s; }

/* 通用面板 */
.panel {
  background: var(--white); border-radius: 16px; padding: 14px 16px; margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.panel-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.title-bar { width: 4px; height: 16px; background: var(--orange-500); border-radius: 2px; align-self: center; display: inline-block; }
.overview-btn { margin-left: auto; padding: 5px 12px; border: 1.5px solid var(--orange-300); background: var(--white); color: var(--orange-600); font-size: 12px; font-weight: 700; border-radius: 8px; cursor: pointer; font-family: inherit; }
.overview-btn:active { transform: scale(0.94); }

/* 总览弹窗 */
.overview-tabs { display: flex; background: var(--orange-100); border-radius: 10px; padding: 3px; margin-bottom: 14px; }
.overview-tab { flex: 1; padding: 9px; border: none; border-radius: 8px; font-size: 13px; font-weight: 700; cursor: pointer; background: transparent; color: var(--brown-800); font-family: inherit; transition: all 0.2s; }
.overview-tab.active { background: var(--white); color: var(--orange-600); box-shadow: 0 1px 4px rgba(0,0,0,0.08); }
.ov-count { font-size: 12px; color: var(--brown-200); margin-bottom: 10px; font-weight: 600; }
.ov-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ov-card-cell { text-align: center; }
.ov-card-img-wrap { width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: var(--orange-50); margin-bottom: 4px; }
.ov-card-img-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ov-card-name { font-size: 11px; font-weight: 700; color: var(--brown-900); line-height: 1.2; word-break: keep-all; }
.ov-card-sub { font-size: 9px; color: var(--brown-200); margin-top: 1px; }
.panel-sub { font-size: 11px; font-weight: 500; color: var(--brown-200); }

/* 总统计 */
.overview-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.overview-grid .ov-card:first-child { grid-column: 1 / -1; }
.ov-card { background: var(--orange-50); border-radius: 12px; padding: 12px; min-width: 0; }
.ov-label { font-size: 11px; color: var(--brown-200); margin-bottom: 4px; }
.ov-num { font-size: 26px; font-weight: 800; color: var(--brown-900); line-height: 1.1; }
.ov-num.orange { color: var(--orange-600); }
.ov-slash { font-size: 14px; font-weight: 600; color: var(--brown-200); }
.ov-bar-wrap { height: 6px; background: var(--orange-100); border-radius: 3px; overflow: hidden; margin-top: 6px; }
@media (max-width: 380px) {
  .overview-grid { gap: 6px; }
  .ov-card { padding: 10px 8px; }
  .ov-num { font-size: 22px; }
  .ov-slash { font-size: 12px; }
  .ov-label { font-size: 10px; }
  .ov-note { font-size: 8px; }
}
.ov-bar { height: 100%; background: linear-gradient(90deg, var(--orange-400),var(--orange-600)); border-radius: 3px; transition: width 0.5s; }
.ov-bar.reward { background: linear-gradient(90deg, var(--pr-color), var(--sp-color)); }
.ov-pct { font-size: 10px; color: var(--brown-200); margin-top: 3px; text-align: right; }
.ov-note { font-size: 9px; color: var(--brown-200); margin-top: 4px; opacity: 0.7; }

/* 满赠档位行（个人 / 全员共用） */
.ms-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ms-row:last-child { margin-bottom: 0; }
.ms-label { font-size: 12px; color: var(--brown-800); min-width: 44px; font-weight: 600; }
.ms-bar-wrap { flex: 1; height: 8px; background: var(--orange-100); border-radius: 4px; overflow: hidden; }
.ms-bar-fill { height: 100%; background: linear-gradient(90deg, var(--orange-400),var(--orange-600)); border-radius: 4px; transition: width 0.5s; }
.ms-bar-fill.done { background: linear-gradient(90deg, var(--pr-color), var(--orange-500)); }
.ms-reward { font-size: 11px; color: var(--orange-600); font-weight: 600; min-width: 78px; }
.ms-row.done .ms-reward { color: #4CAF50; }
.ms-count { font-size: 10px; color: var(--brown-200); min-width: 64px; text-align: right; }
.ms-hint { font-size: 11px; color: var(--danger); margin-bottom: 8px; }

/* 满赠同行卡片（个人 + 全员） */
.bn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bn-cell { background: var(--orange-50); border-radius: 12px; padding: 10px; min-width: 0; }
.bn-cell-head { display: flex; justify-content: space-between; align-items: center; font-size: 13px; font-weight: 700; margin-bottom: 2px; }
@media (max-width: 380px) {
  .bn-grid { gap: 6px; }
  .bn-cell { padding: 8px 6px; }
  .bn-cell-head { font-size: 12px; }
  .bn-cell-sub { font-size: 9px; }
  .bn-next-label { font-size: 9px; }
  .bn-next-draws { font-size: 12px; }
  .bn-next-reward { font-size: 11px; }
}
.bn-detail-btn {
  border: none; background: var(--white); color: var(--orange-600); font-size: 11px; font-weight: 700;
  padding: 3px 9px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.bn-detail-btn:active { transform: scale(0.92); }
.bn-cell-sub { font-size: 10px; color: var(--brown-200); margin-bottom: 8px; }
.bn-note { font-size: 9px; color: var(--brown-200); opacity: 0.7; margin-top: 10px; text-align: right; }
.bn-note-sub { margin-top: 2px; opacity: 0.55; }
.bn-next { font-size: 12px; }
.bn-next.done { text-align: center; padding: 6px 0; }
.bn-next-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 3px; }
.bn-next-label { font-size: 10px; color: var(--brown-200); }
.bn-next-draws { font-size: 14px; font-weight: 800; color: var(--orange-600); }
.bn-next-reward { font-size: 12px; font-weight: 600; color: var(--brown-800); margin-bottom: 5px; }
.bn-next.done .bn-next-reward { color: #4CAF50; }
.bn-bar-wrap { height: 6px; background: var(--orange-100); border-radius: 3px; overflow: hidden; margin-bottom: 4px; }
.bn-bar { height: 100%; background: linear-gradient(90deg, var(--orange-400),var(--orange-600)); border-radius: 3px; transition: width 0.5s; }
.bn-next-foot { display: flex; justify-content: space-between; font-size: 10px; color: var(--brown-200); }

/* 满赠详情弹窗 */
.bonus-modal-title { font-size: 17px; font-weight: 800; text-align: center; margin-bottom: 12px; }
.bm-sub { font-size: 11px; color: var(--brown-200); text-align: center; margin-bottom: 12px; }
.notice-body { font-size: 13px; color: var(--brown-800); line-height: 1.7; }
.notice-body p { margin-bottom: 8px; }
.notice-body ul { margin: 6px 0 8px 18px; }
.notice-body li { margin-bottom: 4px; }
.notice-body strong { color: var(--orange-600); }
.notice-update { margin-top: 14px; padding: 12px; background: var(--orange-50); border-radius: 10px; border-left: 3px solid var(--orange-500); }
.notice-update-head { font-size: 13px; font-weight: 700; color: var(--brown-900); margin-bottom: 6px; }
.notice-update-ver { font-size: 11px; font-weight: 600; color: var(--orange-600); margin-left: 4px; }
.notice-update-list { margin: 0 0 0 18px; padding: 0; }
.notice-update-list li { font-size: 12px; color: var(--brown-800); line-height: 1.6; margin-bottom: 3px; }
.confirm-body { font-size: 14px; color: var(--brown-800); line-height: 1.7; margin-bottom: 16px; text-align: center; }
.confirm-actions { display: flex; gap: 10px; }

/* 奖励卡池 */
.reward-group { margin-bottom: 14px; }
.reward-group:last-child { margin-bottom: 0; }
.reward-group-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 13px; font-weight: 700; margin-bottom: 8px; }
.reward-group-sub { font-size: 11px; font-weight: 600; color: var(--orange-600); }
.reward-grid { display: grid; grid-template-columns: repeat(4, 1fr); grid-auto-rows: 1fr; gap: 8px; }
@media (max-width: 380px) {
  .reward-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  .reward-name { font-size: 10px; }
  .reward-tier { font-size: 8px; }
  .reward-ph { font-size: 18px; }
}
.reward-cell {
  background: var(--orange-50); border-radius: 10px; padding: 8px 4px; text-align: center;
  border: 2px solid transparent; transition: all 0.15s; cursor: pointer;
  display: flex; flex-direction: column; justify-content: space-between; height: 100%;
}
.reward-cell .reward-name { min-height: 2.2em; display: flex; align-items: center; justify-content: center; }
.reward-cell .reward-tier { min-height: 1.2em; }
.reward-cell:active { transform: scale(0.93); }
.reward-cell.unlocked.rw-personal { background: var(--pr-bg); border-color: var(--pr-border); }
.reward-cell.unlocked.rw-global { background: var(--sp-bg); border-color: var(--sp-border); }
.reward-cell.unlocked.rw-limited { background: #E8F8E8; border-color: #8AB860; }
.reward-cell.unlocked.rw-promo { background: var(--orange-100); border-color: var(--orange-400); }
.reward-ph-wrap { width: 100%; aspect-ratio: 1; border-radius: 8px; margin-bottom: 4px; overflow: hidden; position: relative; display: flex; align-items: center; justify-content: center; background: var(--orange-100); }
.reward-ph-wrap img { width: 100%; height: 100%; object-fit: cover; display: block; }
.reward-ph-wrap img.locked-img { opacity: 0.4; }
.reward-ph.locked-emoji { position: absolute; font-size: 24px; filter: drop-shadow(0 1px 2px rgba(0,0,0,0.4)); }
.reward-ph { font-size: 22px; }
.reward-name { font-size: 11px; font-weight: 700; color: var(--brown-900); line-height: 1.2; word-break: keep-all; }
.reward-tier { font-size: 9px; color: var(--brown-200); margin-top: 3px; }
.reward-cell.unlocked .reward-tier { color: #4CAF50; font-weight: 600; }
.reward-confirm-btn {
  border: 1.5px solid var(--orange-300); background: var(--white); color: var(--orange-600);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 8px; cursor: pointer; font-family: inherit;
}
.reward-confirm-btn.done { background: #EEF8EE; color: #4CAF50; border-color: #8AB860; }
.reward-confirm-btn:active { transform: scale(0.92); }

/* 额外奖励确认弹窗 */
.extra-opts { display: flex; flex-direction: column; gap: 8px; }
.extra-opt {
  display: flex; align-items: center; gap: 10px; padding: 12px; border: 2px solid var(--orange-200);
  border-radius: 12px; cursor: pointer; background: var(--white); transition: all 0.15s;
}
.extra-opt:active { transform: scale(0.98); }
.extra-opt input { width: 18px; height: 18px; accent-color: var(--orange-500); flex-shrink: 0; }
.extra-opt:has(input:checked) { border-color: var(--orange-500); background: var(--orange-50); }
.extra-opt-main { flex: 1; }
.extra-opt-label { font-size: 14px; font-weight: 600; color: var(--brown-900); }
.extra-opt-sub { font-size: 11px; color: var(--brown-200); margin-top: 2px; }
.extra-field { margin-bottom: 12px; }
.extra-field-label { display: block; font-size: 12px; color: var(--brown-200); margin-bottom: 6px; }
.extra-date {
  width: 100%; padding: 10px; border: 1.5px solid var(--orange-200); border-radius: 10px;
  font-size: 14px; font-family: inherit; background: var(--white); color: var(--brown-900);
}
.import-textarea {
  width: 100%; min-height: 160px; padding: 10px; border: 1.5px solid var(--orange-200); border-radius: 10px;
  font-size: 12px; font-family: ui-monospace, Menlo, monospace; background: var(--white); color: var(--brown-900);
  resize: vertical; -webkit-user-select: text; user-select: text;
}
.import-textarea:focus { outline: none; border-color: var(--orange-500); }

/* Collection */
.rarity-section { margin-bottom: 18px; }
.rarity-title { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
.rarity-title .group-count { margin-left: auto; font-size: 11px; font-weight: 600; color: var(--brown-200); background: var(--orange-50); padding: 2px 8px; border-radius: 8px; }
.rarity-title .group-count.all { color: #4CAF50; background: #EEF8EE; }
.rarity-title.r-title { color: #5070A0; }
.rarity-title.pr-title { color: #B08018; }
.rarity-title.sr-title { color: #A060B0; }
.rarity-title.ssr-title { color: #D04080; }
.rarity-title.ur-title { color: #8048A0; }
.rarity-title.hr-title { color: #5A9038; }
.rarity-title.sp-title { color: #2E9088; }
.rarity-title.ex-title { color: #B06038; }
.rarity-title.type-title { color: var(--orange-700); }
.card-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }

/* 录入页：横向滚动的卡片网格 */
.entry-grid { display: flex; gap: 8px; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 6px; }
.entry-grid::-webkit-scrollbar { height: 0; }
.entry-grid .entry-cell { flex: 0 0 auto; width: 100px; }
.card-cell {
  background: var(--white); border-radius: 12px; padding: 6px; text-align: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04); position: relative; transition: transform 0.15s; cursor: pointer;
}
.card-cell:active { transform: scale(0.93); }
.card-cell .placeholder {
  width: 100%; aspect-ratio: 0.72; border-radius: 8px; margin-bottom: 4px;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: white; position: relative; overflow: hidden;
}
.card-cell.r .placeholder { background: linear-gradient(135deg, #B0C8E8, #6B8EC8); }
.card-cell.pr .placeholder { background: linear-gradient(135deg, #F0D060, #D4A820); }
.card-cell.sr .placeholder { background: linear-gradient(135deg, #E0B8E8, #C878D0); }
.card-cell.ssr .placeholder { background: linear-gradient(135deg, #F0C0D8, #E060A0); }
.card-cell.ur .placeholder { background: linear-gradient(135deg, #D8B8E8, #B07CC8); }
.card-cell.hr .placeholder { background: linear-gradient(135deg, #C0DCA0, #8AB860); }
.card-cell.sp .placeholder { background: linear-gradient(135deg, #A8E0DC, #50B8B0); }
.card-cell.ex .placeholder { background: linear-gradient(135deg, #F0C8B0, #D07850); }
.card-cell .placeholder img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.card-cell .cid { display: none; }
.card-cell .cname { font-size: 10px; color: var(--brown-200); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 稀有度彩标：卡号以彩色标签贴在图片左下角 */
.card-cell.r   { --rbg: rgba(107,142,200,0.92); }
.card-cell.pr  { --rbg: rgba(212,168,32,0.92); }
.card-cell.sr  { --rbg: rgba(200,120,208,0.92); }
.card-cell.ssr { --rbg: rgba(224,96,160,0.92); }
.card-cell.ur  { --rbg: rgba(176,124,200,0.92); }
.card-cell.hr  { --rbg: rgba(138,184,96,0.92); }
.card-cell.sp  { --rbg: rgba(80,184,176,0.92); }
.card-cell.ex  { --rbg: rgba(208,120,80,0.92); }
.card-cell .placeholder::after {
  content: attr(data-cid); position: absolute; left: 4px; bottom: 4px;
  background: var(--rbg); color: white; font-size: 10px; font-weight: 700;
  padding: 1px 6px; border-radius: 5px; text-transform: uppercase; line-height: 1.4;
  z-index: 2; letter-spacing: 0.3px;
}
.card-cell .badge {
  position: absolute; top: -4px; right: -4px; background: var(--danger); color: white;
  min-width: 20px; height: 20px; border-radius: 50%; font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 6px rgba(224,85,85,0.4);
  padding: 0 4px;
}
.card-cell.zero .badge { background: var(--brown-100); color: var(--brown-200); box-shadow: none; }
.card-cell.zero { opacity: 0.4; }

/* 录入页：页签 + 卡片网格 容器 */
.entry-section {
  background: var(--white); border-radius: 16px; padding: 4px 14px 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* 一键消除按钮栏 */
.purge-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.purge-quick { background: var(--white); border: 1.5px dashed var(--orange-300); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.purge-quick-title { font-size: 13px; font-weight: 700; color: var(--orange-600); margin-bottom: 8px; }
.purge-quick-row { display: flex; align-items: center; gap: 8px; }
.purge-quick-label { font-size: 13px; font-weight: 600; color: var(--brown-800); }
.purge-quick-input { width: 56px; padding: 6px 8px; border: 1.5px solid var(--orange-200); border-radius: 8px; font-size: 16px; font-weight: 700; text-align: center; color: var(--brown-900); font-family: inherit; }
.purge-quick-input:focus { outline: none; border-color: var(--orange-500); }
.purge-quick-apply { margin-left: auto; padding: 8px 20px; border: none; border-radius: 8px; background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); color: white; font-size: 13px; font-weight: 700; cursor: pointer; font-family: inherit; }
.purge-quick-apply:active { transform: scale(0.94); }
.purge-btn {
  flex: 1; padding: 10px; border: 1.5px solid var(--orange-300); background: var(--white);
  color: var(--orange-600); font-size: 12px; font-weight: 700; border-radius: 10px;
  cursor: pointer; font-family: inherit; transition: all 0.15s;
}
.purge-btn:active { transform: scale(0.97); }
.purge-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.purge-btn.primary { background: linear-gradient(135deg, var(--orange-500), var(--orange-600)); color: white; border-color: transparent; position: relative; }
.purge-btn.primary:disabled { background: var(--orange-200); color: white; }
.purge-badge { display: inline-block; margin-left: 4px; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; vertical-align: middle; }
.purge-badge:empty { display: none; }
.purge-badge.up { background: rgba(76,175,80,0.25); color: #fff; }
.purge-badge.down { background: rgba(224,85,85,0.3); color: #fff; }

/* 保留角标 */
.keep-badge {
  position: absolute; top: 3px; right: 3px; background: #4CAF50; color: white;
  font-size: 9px; font-weight: 700; padding: 2px 5px; border-radius: 4px;
  z-index: 3; box-shadow: 0 1px 4px rgba(76,175,80,0.5); line-height: 1.2;
  white-space: nowrap;
}
.entry-pool-bar { margin-bottom: 10px; }

/* 录入页卡片加减控件 */
.entry-cell.zero { opacity: 0.55; }
.entry-ctrl { display: flex; align-items: center; justify-content: center; gap: 2px; margin-top: 4px; }
.entry-over-hint { display: none; font-size: 9px; color: var(--danger); font-weight: 600; margin-top: 2px; text-align: center; line-height: 1.2; }
.entry-btn {
  width: 28px; height: 28px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--orange-100); color: var(--orange-600); font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; transition: background 0.12s; font-family: inherit; flex-shrink: 0;
  line-height: 1; padding: 0; position: relative;
}
.entry-btn:active { background: var(--orange-200); }
.entry-input {
  width: 28px; height: 28px; text-align: center; font-size: 14px; font-weight: 800;
  color: var(--brown-900); border: 1.5px solid var(--orange-200); border-radius: 6px;
  background: var(--white); font-family: inherit; -webkit-user-select: text; user-select: text;
  padding: 0; flex-shrink: 0;
}
.entry-input:focus { outline: none; border-color: var(--orange-500); }

/* 详情弹窗持有数 */
.modal-count-line { font-size: 14px; color: var(--brown-200); margin-top: 6px; }
.modal-count-line span { font-size: 22px; font-weight: 800; color: var(--orange-600); }

/* Screenshot Upload */
.upload-zone {
  background: var(--white); border: 2.5px dashed var(--orange-300); border-radius: 20px;
  padding: 40px 20px; text-align: center; cursor: pointer; transition: all 0.2s; margin-bottom: 14px;
}
.upload-zone:active { background: var(--orange-50); border-color: var(--orange-500); }
.upload-zone .icon { font-size: 48px; margin-bottom: 10px; }
.upload-zone .text { font-size: 15px; color: var(--brown-800); font-weight: 500; }
.upload-zone .hint { font-size: 12px; color: var(--brown-200); margin-top: 6px; }
.upload-preview { background: var(--white); border-radius: 16px; padding: 12px; margin-bottom: 14px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); display: none; }
.upload-preview.show { display: block; }
.preview-carousel { position: relative; margin-bottom: 12px; }
.preview-carousel #previewImg { width: 100%; border-radius: 10px; display: block; }
.preview-nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px;
  border: none; border-radius: 50%; background: rgba(0,0,0,0.45); color: white; font-size: 22px;
  cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2;
  font-family: inherit; line-height: 1;
}
.preview-nav:active { background: rgba(0,0,0,0.65); }
.preview-nav.prev { left: 8px; }
.preview-nav.next { right: 8px; }
.preview-index { position: absolute; bottom: 8px; right: 8px; background: rgba(0,0,0,0.5); color: white; font-size: 11px; padding: 2px 8px; border-radius: 8px; }
.ocr-result { background: var(--orange-50); border-radius: 12px; padding: 12px; margin-bottom: 8px; }
.ocr-title { font-size: 13px; color: var(--brown-800); margin-bottom: 8px; font-weight: 600; }
.ocr-loading { text-align: center; padding: 16px; display: none; }
@keyframes pulse { 0%,100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.15); opacity: 1; } }
.ocr-pool-label { font-size: 13px; font-weight: 700; color: var(--orange-600); margin-bottom: 10px; }
.ocr-warn-chip { display: inline-block; margin: 0 4px 4px 0; padding: 4px 10px; font-size: 11px; font-weight: 700; color: var(--danger); background: rgba(224,85,85,0.1); border: 1px solid rgba(224,85,85,0.3); border-radius: 8px; cursor: pointer; }
.ocr-warn-chip:active { transform: scale(0.93); }
.img-edit-cell { display: flex; align-items: center; gap: 8px; padding: 8px 10px; background: var(--orange-50); border-radius: 10px; margin-bottom: 6px; }
.img-edit-preview { margin-bottom: 12px; }
.img-edit-preview img { width: 100%; border-radius: 10px; max-height: 40vh; object-fit: contain; }
.img-edit-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 10px; }
.img-edit-id { font-size: 14px; font-weight: 800; color: var(--brown-900); min-width: 40px; text-transform: uppercase; }
.img-edit-name { font-size: 12px; color: var(--brown-200); flex: 1; }
.img-edit-cnt { min-width: 20px; text-align: center; font-size: 16px; font-weight: 800; color: var(--orange-600); }
.img-edit-select { flex: 1; min-width: 0; font-size: 13px; font-weight: 700; color: var(--brown-900); background: #fff; border: 1px solid var(--orange-200); border-radius: 8px; padding: 6px 8px; font-family: inherit; }
.img-edit-select:focus { outline: none; border-color: var(--orange-600); }
.img-edit-add { background: rgba(255,255,255,0.5); border: 1px dashed var(--orange-200); }
.ocr-group-title { font-size: 11px; font-weight: 600; color: var(--brown-200); margin: 10px 0 6px; }
.ocr-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-bottom: 4px; }
.ocr-cell {
  background: var(--white); border: 1.5px solid var(--orange-200); border-radius: 8px;
  padding: 6px 4px; text-align: center; cursor: pointer; transition: all 0.12s;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.ocr-cell:active { transform: scale(0.93); }
.ocr-cell.has { border-color: var(--orange-400); background: var(--orange-50); cursor: default; }
.ocr-cell-id { font-size: 12px; font-weight: 800; color: var(--brown-900); text-transform: uppercase; }
.ocr-cell:not(.has) .ocr-cell-id { color: var(--brown-200); }
.ocr-cell-ctrl { display: flex; align-items: center; gap: 4px; }
.ocr-adj-btn {
  width: 22px; height: 22px; border: none; border-radius: 6px; cursor: pointer;
  background: var(--orange-100); color: var(--orange-600); font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
}
.ocr-adj-btn:active { transform: scale(0.85); background: var(--orange-200); }
.ocr-cell-cnt { min-width: 16px; text-align: center; font-size: 14px; font-weight: 800; color: var(--orange-600); }
.btn-row { display: flex; gap: 10px; }

/* History */
.history-item { background: var(--white); border-radius: 14px; padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 6px rgba(0,0,0,0.03); }
.purge-item { border: 1.5px solid var(--orange-300); }
.purge-json { font-size: 10px; color: var(--brown-200); background: var(--orange-50); border-radius: 8px; padding: 8px 10px; margin: 8px 0; word-break: break-all; line-height: 1.5; font-family: ui-monospace, Menlo, monospace; max-height: 80px; overflow: hidden; }
.purge-actions { display: flex; gap: 8px; margin-top: 4px; }
.purge-actions .btn { flex: 1; }
.purge-view-pool { font-size: 14px; font-weight: 700; color: var(--orange-600); margin: 12px 0 6px; }
.purge-view-type { font-size: 11px; font-weight: 600; color: var(--brown-200); margin: 8px 0 4px; }
.purge-view-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.purge-view-cell { position: relative; border-radius: 8px; overflow: hidden; }
.purge-view-img { width: 100%; aspect-ratio: 0.72; border-radius: 6px; overflow: hidden; }
.purge-view-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.purge-view-cnt { position: absolute; bottom: 2px; right: 2px; background: rgba(0,0,0,0.6); color: white; font-size: 11px; font-weight: 700; padding: 1px 6px; border-radius: 4px; }
.purge-view-name { font-size: 10px; font-weight: 700; color: var(--brown-900); margin-top: 3px; text-align: center; line-height: 1.2; word-break: keep-all; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 380px) { .purge-view-grid { grid-template-columns: repeat(3, 1fr); } }
.history-header { display: flex; justify-content: space-between; margin-bottom: 8px; }
.history-pool { font-size: 13px; font-weight: 600; color: var(--orange-600); }
.history-time { font-size: 12px; color: var(--brown-200); }
.history-cards { display: flex; flex-wrap: wrap; gap: 6px; }
.history-chip {
  border-radius: 8px; padding: 3px 8px; font-size: 12px; font-weight: 600;
  background: var(--orange-50); color: var(--brown-800); text-transform: uppercase;
}
.history-chip.chip-up { border: 1.5px solid #4CAF50; }
.history-chip.chip-down { border: 1.5px solid var(--danger); }
.history-chip.chip-r { background: var(--r-bg); color: #406090; }
.history-chip.chip-pr { background: var(--pr-bg); color: #8A6010; }
.history-chip.chip-sr { background: var(--sr-bg); color: #804890; }
.history-chip.chip-ssr { background: var(--ssr-bg); color: #C04070; }
.history-chip.chip-ur { background: var(--ur-bg); color: #603880; }
.history-chip.chip-hr { background: var(--hr-bg); color: #407028; }
.history-chip.chip-sp { background: var(--sp-bg); color: #1E7068; }
.history-chip.chip-ex { background: var(--ex-bg); color: #A04830; }

/* Modal */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
}
.modal-sheet {
  background: var(--white); border-radius: 24px 24px 0 0; width: 100%; max-width: 480px;
  max-height: 80vh; overflow-y: auto; padding: 20px; animation: slideUp 0.3s cubic-bezier(0.4,0,0.2,1);
  position: relative;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-handle { width: 36px; height: 5px; background: var(--orange-200); border-radius: 3px; margin: 0 auto 30px; }
.modal-close {
  position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: none;
  border-radius: 50%; background: var(--orange-100); color: var(--orange-600); font-size: 15px;
  font-weight: 700; cursor: pointer; display: flex; align-items: center; justify-content: center;
  z-index: 5; font-family: inherit;
}
.modal-close:active { background: var(--orange-200); transform: scale(0.9); }
.modal-card-preview { display: flex; justify-content: center; align-items: center; gap: 8px; margin-bottom: 16px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.modal-nav {
  flex: 0 0 auto; width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(255,255,255,0.9); color: var(--orange-600); font-size: 22px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-family: inherit;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12); z-index: 2;
}
.modal-nav:active { transform: scale(0.88); }
.modal-face {
  flex: 0 0 auto; max-width: 260px; border-radius: 12px; display: flex; align-items: center;
  justify-content: center; font-size: 24px; font-weight: 800; color: white; position: relative; overflow: hidden;
  min-height: 80px; min-width: 80px;
}
.modal-face img { position: static; width: 100%; height: auto; max-height: 60vh; object-fit: contain; display: block; }
.modal-face img.locked-img { opacity: 0.4; }
#modalFrontPH.locked-emoji-ph { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 48px; filter: drop-shadow(0 2px 4px rgba(0,0,0,0.4)); }
.modal-face.front.r-face { background: linear-gradient(135deg, #B0C8E8, #6B8EC8); }
.modal-face.front.pr-face { background: linear-gradient(135deg, #F0D060, #D4A820); }
.modal-face.front.sr-face { background: linear-gradient(135deg, #E0B8E8, #C878D0); }
.modal-face.front.ssr-face { background: linear-gradient(135deg, #F0C0D8, #E060A0); }
.modal-face.front.ur-face { background: linear-gradient(135deg, #D8B8E8, #B07CC8); }
.modal-face.front.hr-face { background: linear-gradient(135deg, #C0DCA0, #8AB860); }
.modal-face.front.sp-face { background: linear-gradient(135deg, #A8E0DC, #50B8B0); }
.modal-face.front.ex-face { background: linear-gradient(135deg, #F0C8B0, #D07850); }
.modal-face.front.reward-face { background: linear-gradient(135deg, var(--orange-400), var(--orange-600)); }
.modal-info { text-align: center; margin-bottom: 16px; }
.modal-info .modal-cid { font-size: 30px; font-weight: 800; color: var(--brown-900); text-transform: uppercase; }
.modal-info .modal-name { font-size: 18px; font-weight: 600; color: var(--brown-800); margin: 4px 0; }
.modal-info .modal-rarity { font-size: 13px; }


/* Bottom Tab Bar */
.tab-bar {
  position: absolute; bottom: 0; left: 0; right: 0; background: var(--white);
  display: flex; padding: 8px 8px calc(8px + var(--safe-bottom));
  border-top: 1px solid var(--orange-100); box-shadow: 0 -2px 12px rgba(0,0,0,0.04); z-index: 10;
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px;
  border: none; background: transparent; cursor: pointer; border-radius: 10px;
  transition: all 0.2s; font-family: inherit; color: var(--brown-200); font-size: 10px; font-weight: 600;
}
.tab-item.active { color: var(--orange-600); }
.tab-item .tab-icon { font-size: 20px; }

/* Toast */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--brown-900); color: white; padding: 12px 24px; border-radius: 12px;
  font-size: 14px; font-weight: 600; z-index: 200; opacity: 0; transition: opacity 0.3s;
  pointer-events: none; box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; }

#screenshotInput { display: none; }
.content::-webkit-scrollbar { width: 0; }

/* 悬浮抽奖入口（可拖动） */
.float-draw {
  position: fixed; right: 14px; top: calc(64px + env(safe-area-inset-top));
  z-index: 50; display: flex; flex-direction: column; align-items: center; gap: 3px;
  text-decoration: none; -webkit-tap-highlight-color: transparent;
  touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none;
}
.float-draw:active { cursor: grabbing; }
.float-draw-circle {
  width: 56px; height: 56px; border-radius: 50%;
  background: url('./images/float-entry.jpg') center/cover no-repeat;
  box-shadow: 0 4px 14px rgba(30,136,229,0.45); border: 2px solid var(--white);
  animation: floatPulse 2.4s ease-in-out infinite;
}
.float-draw-close {
  position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--white); background: var(--orange-600); color: white; font-size: 11px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 2;
  box-shadow: 0 2px 6px rgba(30,136,229,0.5); padding: 0; line-height: 1;
}
.float-draw-close:active { transform: scale(0.85); background: var(--orange-700); }
.float-draw-text {
  font-size: 11px; font-weight: 700; color: var(--white);
  background: linear-gradient(135deg, var(--orange-500), var(--orange-600));
  padding: 3px 10px; border-radius: 10px; box-shadow: 0 2px 8px rgba(30,136,229,0.4);
  white-space: nowrap; letter-spacing: 0.5px;
}
.float-draw:active .float-draw-circle { transform: scale(0.9); }
@keyframes floatPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 14px rgba(30,136,229,0.45); }
  50% { transform: scale(1.08); box-shadow: 0 6px 20px rgba(30,136,229,0.6); }
}

/* 小屏手机适配（≤380px） */
@media (max-width: 380px) {
  .tab-page { padding: 8px 10px 0; }
  .card-grid { gap: 6px; }
  .card-cell { padding: 4px; }
  .card-cell .cid { font-size: 10px; }
  .card-cell .cname { font-size: 9px; }
  .entry-grid .entry-cell { width: 88px; }
  .ocr-grid { grid-template-columns: repeat(3, 1fr); gap: 4px; }
  .panel { padding: 12px 10px; }
  .pool-section { padding: 4px 10px 12px; }
  .header h1 { font-size: 15px; }
  .header-subtitle { font-size: 10px; }
  .header-btn { padding: 5px 9px; font-size: 11px; }
}

/* ==================== 多账号：账号切换器 / 账号管理 ==================== */
.account-switcher {
  display: flex; align-items: center; gap: 3px;
  background: linear-gradient(135deg, var(--orange-100), var(--orange-200));
  color: var(--orange-700); max-width: 38vw;
}
.account-switcher #accountSwitcherLabel {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 30vw;
}
.account-switcher .caret { font-size: 10px; opacity: 0.7; }

.acc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 12px 12px; border-radius: 12px; margin-bottom: 8px;
  background: var(--orange-50); border: 2px solid transparent; transition: all 0.12s;
}
.acc-row:active { transform: scale(0.98); }
.acc-row.active { border-color: var(--orange-400); background: rgba(255,237,224,0.9); }
.acc-name { font-size: 14px; font-weight: 700; color: var(--brown-900); cursor: pointer; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-sub { font-size: 11px; color: var(--brown-200); }
.acc-actions { display: flex; gap: 4px; flex-shrink: 0; }
.acc-mini {
  width: 30px; height: 30px; border: none; border-radius: 8px; cursor: pointer;
  background: var(--white); color: var(--orange-600); font-size: 13px;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.acc-mini:active { transform: scale(0.9); }
.acc-mini:disabled { opacity: 0.3; cursor: not-allowed; }
.acc-mini.danger { color: var(--danger); }

/* 合并视图：满赠面板提示 */
.bn-merged-note {
  text-align: center; font-size: 12px; color: var(--brown-200);
  padding: 18px 10px; line-height: 1.6;
}

/* 合并视图：录入页置灰禁用 */
.entry-cell-merged { opacity: 0.55; }
.entry-cell-merged .entry-btn { cursor: not-allowed; }
.entry-cell-merged .entry-input { color: var(--brown-200); }

/* prompt 输入框（复用 import-textarea 样式，补宽度）*/
#promptModal .import-textarea { width: 100%; box-sizing: border-box; }
#promptModal .confirm-actions { margin-top: 6px; }

/* 窄屏：header 多了切换器按钮，压缩间距 */
@media (max-width: 380px) {
  .header-btns { gap: 4px; }
  .account-switcher { max-width: 30vw; }
  .account-switcher #accountSwitcherLabel { max-width: 22vw; }
}

/* 5 tab 紧凑 */
.tab-item { font-size: 9px; padding: 6px 1px; }
.tab-item .tab-icon { font-size: 18px; }

/* FAQ */
.faq-block { margin-bottom: 12px; }
.faq-block h3 { font-size: 15px; color: var(--brown-900); margin: 0 0 10px 0; }
.faq-text { font-size: 13px; line-height: 1.7; color: var(--brown-800); }
.faq-text p { margin-bottom: 6px; }
.faq-text ul { margin: 6px 0 6px 18px; }
.faq-notice-img { margin-bottom: 10px; border-radius: 8px; overflow: hidden; }
.faq-notice-img img { width: 100%; height: auto; display: block; }
.faq-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.faq-actions .btn { flex: 1; min-width: 80px; }

/* FAQ slider */
.faq-slider-wrap { position: relative; overflow: hidden; border-radius: 12px; }
.faq-slider { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.faq-slider::-webkit-scrollbar { display: none; }
.faq-slide { flex: 0 0 100%; scroll-snap-align: start; }
.faq-slide img { width: 100%; height: auto; display: block; border-radius: 12px; }
.faq-slider-dots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.faq-slider-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--orange-200); }
.faq-slider-dots span.active { background: var(--orange-600); }

/* Exchange UI */
.exchange-intro { padding: 10px 14px; font-size: 13px; color: var(--brown-800); line-height: 1.6; }
.exchange-intro-title { font-weight: 700; color: var(--brown-900); margin: 10px 0 6px; }
.exchange-intro ul { margin: 0 0 10px 18px; }
.exchange-note { font-size: 12px; color: var(--brown-200); margin-top: 8px; }
.exchange-comp-wrap { display: flex; gap: 12px; justify-content: center; margin-top: 10px; }
.exchange-comp-item { text-align: center; }
.exchange-comp-item img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; display: block; margin: 0 auto 4px; background: #f0f0f0; }
.exchange-comp-item span { font-size: 11px; color: var(--brown-600); }
.exchange-empty { text-align: center; padding: 30px 14px; color: var(--brown-200); }
.exchange-prenote { font-size: 12px; color: var(--brown-600); margin-top: 10px; padding: 10px 12px; background: var(--orange-50); border: 1px solid var(--orange-200); border-radius: 10px; line-height: 1.7; }
.exchange-prenote strong { color: var(--brown-900); }

/* ===== 文本识别（录入 tab 子页签）===== */
.text-parse-panel { padding: 14px; margin-bottom: 14px; }
.text-parse-label { font-weight: 600; color: var(--brown-800); display: block; margin-bottom: 6px; }
.text-parse-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid var(--orange-200);
  border-radius: 10px;
  padding: 10px;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  color: var(--brown-900);
  background: #fff;
  font-family: inherit;
}
.text-parse-input:focus { outline: none; border-color: var(--orange-400); }
.text-parse-actions { display: flex; gap: 8px; margin-top: 10px; }
.text-parse-actions .btn { flex: 1; }
.text-parse-result { margin-top: 12px; }
.ocr-guide { margin-top: 14px; padding: 14px; background: var(--orange-50); border-radius: 12px; font-size: 12px; color: var(--brown-200); line-height: 1.8; }
.ocr-guide-title { font-weight: 600; color: var(--brown-800); margin-bottom: 4px; }
.ocr-guide ul { margin: 0; padding-left: 18px; }
.exchange-empty-icon { font-size: 40px; margin-bottom: 10px; }
.exchange-empty-title { font-size: 15px; font-weight: 600; color: var(--brown-800); margin-bottom: 6px; }
.exchange-group-title { font-size: 13px; font-weight: 700; color: var(--brown-900); padding: 10px 14px 4px; }
.exchange-list { padding: 0 14px 14px; }
.exchange-card { background: var(--white); border: 1px solid var(--orange-100); border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.exchange-card-head { display: flex; gap: 10px; margin-bottom: 10px; }
.exchange-thumb-wrap { position: relative; width: 56px; height: 56px; flex-shrink: 0; border-radius: 8px; overflow: hidden; background: var(--orange-50); }
.exchange-thumb-wrap img { width: 100%; height: 100%; object-fit: cover; }
.exchange-count-badge { position: absolute; right: 2px; bottom: 2px; background: var(--orange-600); color: #fff; font-size: 10px; padding: 1px 5px; border-radius: 10px; }
.exchange-src-meta { flex: 1; min-width: 0; }
.exchange-src-top { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }
.exchange-rarity { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 6px; background: var(--orange-100); color: var(--orange-700); }
.exchange-src-name { font-size: 14px; font-weight: 600; color: var(--brown-900); }
.exchange-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.exchange-chip { font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--brown-100); color: var(--brown-800); }
.exchange-chip.accent { background: var(--orange-100); color: var(--orange-700); }
.exchange-rule { margin-bottom: 8px; }
.exchange-rule-label { font-size: 12px; color: var(--brown-800); margin-bottom: 4px; }
.exchange-rule select { width: 100%; padding: 8px 10px; border-radius: 8px; border: 1px solid var(--orange-200); background: var(--orange-50); color: var(--brown-900); font-size: 13px; }
.exchange-target-row { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.exchange-target-thumb { width: 40px; height: 40px; border-radius: 6px; overflow: hidden; background: var(--orange-50); flex-shrink: 0; }
.exchange-target-thumb img { width: 100%; height: 100%; object-fit: cover; }
.exchange-target-name { font-size: 12px; color: var(--brown-700); }

/* ===== 非酋预选角标（收藏图鉴 / 奖励区）===== */
.preselect-tag {
  position: absolute; top: 4px; left: 4px; z-index: 4;
  background: var(--orange-500, #ff7a45); color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 9px; line-height: 1.5; letter-spacing: 0.5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25); pointer-events: none;
}
.card-cell.preselected { outline: 2px solid var(--orange-400, #ff9a6b); outline-offset: -2px; }
.card-cell.preselected .placeholder { box-shadow: 0 0 0 2px var(--orange-300, #ffc3a8); }

.reward-preselect-tag {
  position: absolute; top: 4px; left: 4px; z-index: 4;
  background: var(--orange-500, #ff7a45); color: #fff; font-size: 9px; font-weight: 700;
  padding: 1px 6px; border-radius: 9px; line-height: 1.5; letter-spacing: 0.5px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.25); pointer-events: none;
}
.reward-cell.preselected { box-shadow: 0 0 0 2px var(--orange-400, #ff9a6b); }

/* ===== 非酋兑换：A柜 动态动作 UI ===== */
.exchange-add-row { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0 4px; }
.exchange-add-btn {
  flex: 1 1 auto; min-width: 92px; font-size: 10px; padding: 5px 4px;
  border: 1px dashed var(--orange-300, #ffc3a8); background: var(--orange-50, #fff6f0);
  color: var(--orange-600, #e8590c); border-radius: 8px; cursor: pointer; font-family: inherit; font-weight: 600;
}
.exchange-add-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.exchange-add-btn:not(:disabled):active { transform: scale(0.96); background: var(--orange-100, #ffe8db); }
.exchange-del-btn {
  display: block; margin-top: 5px; font-size: 10px; padding: 3px 10px;
  border: 1px solid var(--brown-200, #e7d9c8); background: #fff; color: var(--brown-400, #a08a72);
  border-radius: 8px; cursor: pointer; font-family: inherit;
}
.exchange-del-btn:active { transform: scale(0.96); }
.exchange-comp-sel { display: block; margin-top: 5px; width: 100%; }

/* ===== 非酋兑换计数块 ===== */
.exchange-summary { display: flex; gap: 12px; padding: 12px 14px; margin-bottom: 10px; }
.exchange-summary-item { flex: 1; text-align: center; }
.exchange-summary-num { display: block; font-size: 24px; font-weight: 700; color: var(--orange-600); }
.exchange-summary-lbl { display: block; font-size: 12px; color: var(--brown-200); margin-top: 2px; }
