:root {
  --bg-page: #f5efe8;
  --bg-shell: #fffbf7;
  --bg-card: #ffffff;
  --text-main: #1f2937;
  --text-sub: #6b7280;
  --text-muted: #9ca3af;
  --border: #efe6dc;
  --primary: #ff5a5f;
  --primary-dark: #e14348;
  --primary-soft: #fff0f0;
  --super: #f59e0b;
  --super-soft: #fffbeb;
  --super-border: #fcd34d;
  --like: #10b981;
  --like-soft: #ecfdf5;
  --skip: #6b7280;
  --skip-soft: #f3f4f6;
  --boy: #3b82f6;
  --girl: #ec4899;
  --shadow-sm: 0 2px 8px rgba(31, 41, 55, 0.06);
  --shadow-md: 0 10px 28px rgba(31, 41, 55, 0.1);
  --shadow-lg: 0 18px 40px rgba(31, 41, 55, 0.14);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg-page);
  color: var(--text-main);
  overscroll-behavior-y: contain;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

.hidden {
  display: none !important;
}

/* 移动端优先容器：桌面端居中模拟手机宽度 */
.app-shell {
  width: 100%;
  max-width: 440px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg-shell);
  display: flex;
  flex-direction: column;
  position: relative;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.06);
}

/* 顶部导航栏（适配 iOS 刘海/灵动岛安全区） */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(255, 251, 247, 0.92);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
}

.room-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.3;
}

.pill-room {
  background: #f3ece4;
  color: #7c5c3e;
}

.pill-sync {
  background: var(--like-soft);
  color: #047857;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.btn-icon-text {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn-icon-text:active {
  transform: scale(0.95);
}

.btn-role {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: none;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: var(--boy);
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-role.role-girl {
  background: var(--girl);
}

.btn-role:active {
  transform: scale(0.95);
}

/* 主区域 */
.main-content {
  flex: 1;
  padding: 16px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

.view {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* ==================== 筛选页 ==================== */
.hero-card {
  background: linear-gradient(135deg, #ff6b6b 0%, #ff8e53 100%);
  color: #fff;
  padding: 20px;
  border-radius: var(--radius-lg);
  margin-bottom: 18px;
  box-shadow: 0 10px 24px rgba(255, 90, 95, 0.24);
}

.hero-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 800;
}

.hero-sub {
  margin: 0;
  font-size: 13px;
  opacity: 0.94;
}

.filter-group {
  margin-bottom: 16px;
}

.filter-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
  padding-left: 2px;
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  padding: 9px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.16s ease;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(255, 90, 95, 0.28);
}

.chip:active {
  transform: scale(0.96);
}

.toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  box-shadow: var(--shadow-sm);
}

.toggle-title {
  font-size: 15px;
  font-weight: 700;
}

.toggle-desc {
  font-size: 12px;
  color: var(--text-sub);
  margin-top: 3px;
}

/* 开关样式 */
.switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  inset: 0;
  cursor: pointer;
  background: #d1d5db;
  border-radius: 999px;
  transition: 0.2s;
}

.slider::before {
  content: "";
  position: absolute;
  height: 22px;
  width: 22px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.16);
  transition: 0.2s;
}

.switch input:checked + .slider {
  background: var(--primary);
}

.switch input:checked + .slider::before {
  transform: translateX(20px);
}

.start-panel {
  margin-top: 6px;
  margin-bottom: 18px;
}

.match-count-hint {
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 10px;
}

/* 通用按钮 */
.btn-primary {
  border: none;
  background: linear-gradient(135deg, #ff5a5f 0%, #ff7b54 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  padding: 12px 18px;
  border-radius: 14px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(255, 90, 95, 0.28);
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.btn-primary:active {
  transform: scale(0.97);
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn-lg {
  width: 100%;
  padding: 15px 20px;
  font-size: 17px;
  border-radius: 16px;
}

.btn-full {
  width: 100%;
}

.btn-secondary {
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-main);
  font-size: 14px;
  font-weight: 700;
  padding: 10px 14px;
  border-radius: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn-secondary:active {
  transform: scale(0.97);
}

.btn-sm {
  padding: 7px 12px;
  font-size: 13px;
}

.btn-text-muted {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 600;
  padding: 4px 6px;
  cursor: pointer;
}

/* 店铺池折叠区 */
.shop-pool-details {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
}

.shop-pool-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
}

.shop-pool-summary::-webkit-details-marker {
  display: none;
}

.shop-pool-list {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pool-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  background: #fdf9f5;
  border-radius: 12px;
  border: 1px solid #f2e8dc;
}

.pool-item-name {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 3px;
}

.pool-item-note {
  font-size: 12px;
  color: var(--text-sub);
}

.pool-item-tags {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 6px;
  background: #f3ece4;
  color: #6b4f35;
}

.tag-recent {
  background: #fee2e2;
  color: #b91c1c;
}

/* ==================== 滑卡页 ==================== */
.swipe-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
}

.progress-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.partner-progress {
  background: #fff7ed;
  border-color: #fed7aa;
  color: #9a3412;
}

.dot-live {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.22);
}

.swipe-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 390px;
  position: relative;
}

.card-stack {
  position: relative;
  width: 100%;
  height: 360px;
  max-width: 360px;
  touch-action: none;
  user-select: none;
}

.swipe-card {
  position: absolute;
  inset: 0;
  background: var(--bg-card);
  border-radius: 26px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-lg);
  padding: 24px 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  will-change: transform, opacity;
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.25s ease;
}

.swipe-card.dragging {
  transition: none;
  cursor: grabbing;
}

.swipe-card.behind-1 {
  transform: scale(0.95) translateY(14px);
  opacity: 0.85;
  pointer-events: none;
}

.swipe-card.behind-2 {
  transform: scale(0.9) translateY(26px);
  opacity: 0.55;
  pointer-events: none;
}

.card-top-decor {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.card-tag {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: #fff3eb;
  color: #c2410c;
}

.card-tag.mode-takeout {
  background: #eff6ff;
  color: #1d4ed8;
}

.card-index {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
}

.card-center {
  text-align: center;
  padding: 10px 0;
}

.card-emoji {
  font-size: 64px;
  line-height: 1;
  margin-bottom: 14px;
  filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.08));
}

.card-name {
  margin: 0 0 10px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
}

.card-note {
  margin: 0;
  font-size: 15px;
  line-height: 1.55;
  color: var(--text-sub);
  background: #fdf9f5;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px dashed #eadccf;
}

.card-footer-meta {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
}

/* 滑动印章反馈 */
.swipe-stamp {
  position: absolute;
  top: 28px;
  padding: 6px 14px;
  border-radius: 10px;
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 1px;
  border: 3px solid currentColor;
  opacity: 0;
  pointer-events: none;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
}

.stamp-like {
  left: 20px;
  color: var(--like);
  transform: rotate(-14deg);
}

.stamp-skip {
  right: 20px;
  color: var(--skip);
  transform: rotate(14deg);
}

.stamp-super {
  left: 50%;
  top: auto;
  bottom: 26px;
  color: var(--super);
  transform: translateX(-50%);
}

.swipe-gesture-tip {
  margin-top: 24px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 底部 3 个大按钮 */
.swipe-actions {
  display: grid;
  grid-template-columns: 1fr 1.15fr 1fr;
  gap: 12px;
  margin-top: 16px;
}

.action-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 13px 8px;
  border-radius: 18px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, box-shadow 0.15s ease;
}

.action-btn:active {
  transform: scale(0.94);
}

.action-icon {
  font-size: 22px;
  line-height: 1;
}

.action-label {
  font-size: 12px;
  font-weight: 700;
}

.btn-skip {
  color: var(--skip);
}

.btn-super {
  background: var(--super-soft);
  border-color: var(--super-border);
  color: #b45309;
  box-shadow: 0 6px 16px rgba(245, 158, 11, 0.18);
}

.btn-like {
  background: var(--primary-soft);
  border-color: #fecdd3;
  color: var(--primary-dark);
}

/* 等待对方完成卡片 */
.waiting-card {
  margin-top: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 20px;
  text-align: center;
  box-shadow: var(--shadow-md);
}

.waiting-emoji {
  font-size: 52px;
  margin-bottom: 10px;
  animation: pulse 1.8s infinite ease-in-out;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

.waiting-title {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 800;
}

.waiting-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-sub);
}

.waiting-progress-box {
  background: #fdf9f5;
  border-radius: 14px;
  padding: 14px;
  border: 1px solid var(--border);
}

.waiting-progress-header {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-track {
  height: 10px;
  background: #efe6dc;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff7b54, #ff5a5f);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.local-sim-box {
  margin-top: 18px;
  padding: 14px;
  background: #f0fdf4;
  border: 1px dashed #86efac;
  border-radius: 14px;
  text-align: left;
}

.local-sim-title {
  font-size: 13px;
  font-weight: 800;
  color: #166534;
  margin-bottom: 4px;
}

.local-sim-desc {
  margin: 0 0 12px;
  font-size: 12px;
  color: #15803d;
  line-height: 1.45;
}

.local-sim-btns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.local-sim-btns button {
  font-size: 12px;
  padding: 10px 8px;
}

/* ==================== 结果页 ==================== */
.final-banner {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: 0 10px 24px rgba(16, 185, 129, 0.28);
}

.final-banner-tag {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.22);
  padding: 3px 10px;
  border-radius: 999px;
  margin-bottom: 6px;
}

.final-banner-name {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}

.final-banner-meta {
  font-size: 12px;
  opacity: 0.92;
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.result-title {
  margin: 0 0 4px;
  font-size: 20px;
  font-weight: 800;
}

.result-subtitle {
  margin: 0;
  font-size: 13px;
  color: var(--text-sub);
}

.result-toolbar {
  margin-bottom: 14px;
}

.result-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 15px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
}

.result-card.is-super {
  background: linear-gradient(180deg, #fffdf5 0%, #ffffff 100%);
  border-color: var(--super-border);
  box-shadow: 0 6px 18px rgba(245, 158, 11, 0.14);
}

.result-card.roulette-active {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 95, 0.25);
  transform: scale(1.02);
}

.result-card.roulette-winner {
  border-color: var(--primary);
  background: #fff5f5;
  box-shadow: 0 10px 26px rgba(255, 90, 95, 0.25);
  transform: scale(1.02);
}

.result-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.result-shop-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 800;
}

.badge-super {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fef3c7;
  color: #b45309;
  border: 1px solid #fcd34d;
  flex-shrink: 0;
}

.badge-match {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  background: #ffe4e6;
  color: #be123c;
  flex-shrink: 0;
}

.result-shop-note {
  font-size: 13px;
  color: var(--text-sub);
  margin-bottom: 10px;
  line-height: 1.45;
}

.result-card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.votes-reveal {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
}

.vote-chip {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f3f4f6;
  color: var(--text-main);
}

.btn-eat-this {
  border: none;
  background: var(--text-main);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.15s ease;
}

.btn-eat-this:active {
  transform: scale(0.95);
}

.btn-eat-this.decided {
  background: var(--like);
}

/* 无匹配兜底 */
.empty-state {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 18px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.empty-emoji {
  font-size: 48px;
  margin-bottom: 8px;
}

.empty-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 800;
}

.empty-desc {
  margin: 0 0 16px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.rescue-list {
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

/* ==================== 弹窗 ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(17, 24, 39, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.modal-card {
  width: 100%;
  max-width: 396px;
  max-height: 90dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 20px 18px;
  box-shadow: var(--shadow-lg);
  animation: modalPop 0.2s ease-out;
}

@keyframes modalPop {
  from { opacity: 0; transform: translateY(14px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.role-modal-card {
  text-align: center;
}

.role-modal-emoji {
  font-size: 44px;
  margin-bottom: 8px;
}

.modal-title {
  margin: 0 0 6px;
  font-size: 19px;
  font-weight: 800;
}

.modal-desc {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.5;
}

.role-choice-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.role-choice-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px;
  border-radius: 18px;
  border: 2px solid var(--border);
  background: #fdf9f5;
  cursor: pointer;
  transition: transform 0.14s ease, border-color 0.15s ease;
}

.role-choice-btn:active {
  transform: scale(0.96);
}

.role-choice-btn.boy:hover {
  border-color: var(--boy);
  background: #eff6ff;
}

.role-choice-btn.girl:hover {
  border-color: var(--girl);
  background: #fdf2f8;
}

.role-choice-icon {
  font-size: 38px;
}

.role-choice-text {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-main);
}

/* 添加新店表单 */
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.btn-close {
  border: none;
  background: #f3f4f6;
  color: var(--text-sub);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 15px;
  cursor: pointer;
}

.add-shop-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.req {
  color: var(--primary);
}

.form-field input[type="text"],
.form-field textarea {
  width: 100%;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-main);
  background: #fdfbf9;
  outline: none;
}

.form-field input[type="text"]:focus,
.form-field textarea:focus {
  border-color: var(--primary);
  background: #fff;
}

.radio-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill {
  position: relative;
  cursor: pointer;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.radio-pill span {
  display: inline-block;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.radio-pill input:checked + span {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-dark);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 4px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 200;
  background: rgba(17, 24, 39, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}


/* ==================== 板块切换 Tab（正餐 / 饮料） ==================== */
.module-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 16px 4px;
  background: var(--bg-shell);
}

.module-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text-sub);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.18s ease;
}

.module-tab.active[data-tab="meal"] {
  background: linear-gradient(135deg, #ff5a5f 0%, #ff7b54 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(255, 90, 95, 0.24);
}

.module-tab.active[data-tab="drink"] {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 16px rgba(139, 92, 246, 0.24);
}

.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.8);
}

/* 饮料模式视觉区分 */
.hero-card.drink-theme {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 10px 24px rgba(139, 92, 246, 0.24);
}

.app-shell.theme-drink .chip.active {
  background: #8b5cf6;
  border-color: #8b5cf6;
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.28);
}

.app-shell.theme-drink .switch input:checked + .slider {
  background: #8b5cf6;
}

.app-shell.theme-drink .btn-primary {
  background: linear-gradient(135deg, #8b5cf6 0%, #ec4899 100%);
  box-shadow: 0 8px 20px rgba(139, 92, 246, 0.26);
}

/* ==================== 饮料凑单点单卡 ==================== */
.order-card-box {
  background: #faf5ff;
  border: 1px solid #e9d5ff;
  border-radius: 12px;
  padding: 10px 11px;
  margin-bottom: 10px;
}

.order-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.order-card-title {
  font-size: 12px;
  font-weight: 800;
  color: #6b21a8;
}

.btn-edit-pref {
  border: 1px solid #d8b4fe;
  background: #fff;
  color: #7e22ce;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.order-pref-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.order-pref-col {
  background: #fff;
  border: 1px solid #f3e8ff;
  border-radius: 10px;
  padding: 8px 9px;
}

.order-pref-who {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 3px;
}

.order-pref-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.35;
  word-break: break-word;
}

.order-pref-edit {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.order-pref-edit input {
  width: 100%;
  border: 1px solid #d8b4fe;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
  font-family: inherit;
  background: #fff;
}

.order-pref-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.btn-xs {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 8px;
}

/* 滑卡上的饮料默认常点预览 */
.card-drink-prefs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  text-align: left;
}

.card-drink-pref-pill {
  background: #faf5ff;
  border: 1px solid #f3e8ff;
  border-radius: 10px;
  padding: 6px 8px;
  font-size: 11px;
  line-height: 1.35;
  color: #581c87;
}

/* ==================== 加店弹窗模式切换 & 批量粘贴解析 ==================== */
.modal-mode-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  background: #f3ece4;
  border-radius: 12px;
  margin-bottom: 14px;
}

.modal-mode-tab {
  border: none;
  background: transparent;
  color: var(--text-sub);
  font-size: 13px;
  font-weight: 700;
  padding: 8px 10px;
  border-radius: 9px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.modal-mode-tab.active {
  background: #fff;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
}

.pref-input-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 2px;
}

.paste-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.paste-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.paste-summary-text {
  font-size: 12px;
  color: var(--text-sub);
  flex: 1;
}

.paste-preview-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 230px;
  overflow-y: auto;
  padding-right: 2px;
}

.paste-card {
  background: #fdf9f5;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 11px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.paste-card-head {
  display: flex;
  align-items: center;
  gap: 6px;
}

.paste-card-name {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 8px;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  color: var(--text-main);
}

.btn-remove-paste {
  border: none;
  background: #fee2e2;
  color: #b91c1c;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  font-size: 12px;
  cursor: pointer;
  flex-shrink: 0;
}

.paste-card-selects {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.paste-select {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 6px;
  font-size: 12px;
  font-weight: 600;
  background: #fff;
  color: var(--text-main);
}

.paste-card-note {
  font-size: 11px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
