/* ==========================================
   拆盲盒式旅行 — 本地原型样式
   手机优先 · 移动端适配 · 无外部依赖
   ========================================== */

:root {
  --bg: #faf9f6;
  --card-bg: #ffffff;
  --text: #1a1a1a;
  --text-secondary: #6b6b6b;
  --text-hint: #9a9a9a;
  --accent: #ff6b35;
  --accent-dim: #ff8c5a;
  --accent-bg: #fff3ed;
  --green: #2d9c5e;
  --green-bg: #edf7f1;
  --blue: #3b82f6;
  --blue-bg: #eff6ff;
  --red: #e53e3e;
  --red-bg: #fef2f2;
  --border: #e8e5df;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.10);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
}

/* 手机容器 */
.app-container {
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow-x: hidden;
}

/* 屏幕切换 */
.screen {
  display: none;
  min-height: 100vh;
  padding-bottom: 40px;
}
.screen.active { display: block; }

/* ========== 导航栏 ========== */
.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.nav-title {
  font-size: 17px;
  font-weight: 600;
}
.nav-spacer { width: 48px; }
.btn-back, .btn-dashboard {
  background: none;
  border: none;
  font-size: 15px;
  color: var(--accent);
  cursor: pointer;
  padding: 6px 10px;
  border-radius: 8px;
}
.btn-back:active, .btn-dashboard:active { background: var(--accent-bg); }

/* ========== 首页 ========== */
.home-hero {
  text-align: center;
  padding: 48px 24px 24px;
}
.logo-icon {
  font-size: 64px;
  margin-bottom: 12px;
  animation: float 3s ease-in-out infinite;
}
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.app-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 1px;
  margin-bottom: 6px;
}
.app-tagline {
  font-size: 15px;
  color: var(--text-secondary);
}

.box-cards {
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.box-card {
  display: flex;
  align-items: center;
  background: var(--card-bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.2s;
  gap: 12px;
}
.box-card:active {
  transform: scale(0.98);
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.card-icon { font-size: 32px; flex-shrink: 0; }
.card-body { flex: 1; }
.card-title { font-size: 16px; font-weight: 600; margin-bottom: 2px; }
.card-detail { font-size: 13px; color: var(--text-secondary); }
.card-price { font-size: 13px; color: var(--accent); font-weight: 500; margin-top: 2px; }
.card-surprise {
  font-size: 11px;
  color: var(--text-hint);
  text-align: right;
  line-height: 1.4;
}
.card-arrow {
  font-size: 18px;
  color: var(--text-hint);
  flex-shrink: 0;
}

.home-notice {
  margin: 20px 18px;
  padding: 12px 16px;
  background: var(--accent-bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ========== 偏好选择页 ========== */
.prefs-content {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.pref-section { }
.pref-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 10px;
}
.pref-label .hint {
  font-weight: 400;
  color: var(--text-hint);
  font-size: 12px;
}

/* 分段选择器 */
.segmented {
  display: flex;
  background: #eae7e0;
  border-radius: var(--radius-sm);
  padding: 3px;
}
.seg-btn {
  flex: 1;
  padding: 10px 0;
  border: none;
  background: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 8px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.2s;
}
.seg-btn.active {
  background: var(--card-bg);
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* Stepper */
.stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
}
.stepper-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
}
.stepper-btn:active { background: #f5f5f5; }
.stepper-value { font-size: 22px; font-weight: 700; min-width: 24px; text-align: center; }
.stepper-unit { font-size: 14px; color: var(--text-secondary); }

/* 标签组 */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.chip {
  padding: 10px 16px;
  border: 1.5px solid var(--border);
  border-radius: 22px;
  background: var(--card-bg);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--text);
}
.chip:active { transform: scale(0.96); }
.chip.active {
  background: var(--accent-bg);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
.chip-exclude.active {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}

/* 开盒按钮 */
.btn-open {
  width: 100%;
  padding: 16px;
  font-size: 18px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  margin-top: 8px;
}
.btn-open:active {
  transform: scale(0.97);
  opacity: 0.9;
}
.btn-open:disabled {
  background: #ccc;
  cursor: not-allowed;
}
.validation-msg {
  font-size: 13px;
  color: var(--red);
  text-align: center;
  min-height: 20px;
}

/* ========== 开盒动画 ========== */
.reveal-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 40px 20px;
}
.reveal-box {
  font-size: 80px;
  animation: shake 0.5s ease-in-out infinite;
}
.reveal-box-inner {
  animation: glow 1.5s ease-in-out infinite;
}
@keyframes shake {
  0%,100% { transform: rotate(0deg) scale(1); }
  25% { transform: rotate(-5deg) scale(1.05); }
  50% { transform: rotate(0deg) scale(1.1); }
  75% { transform: rotate(5deg) scale(1.05); }
}
@keyframes glow {
  0%,100% { filter: drop-shadow(0 0 8px rgba(255,107,53,0.4)); }
  50% { filter: drop-shadow(0 0 20px rgba(255,107,53,0.8)); }
}
.reveal-text {
  margin-top: 24px;
  font-size: 16px;
  color: var(--text-secondary);
}
.reveal-dots {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}
.reveal-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-dim);
  animation: dotPulse 1.4s ease-in-out infinite;
}
.reveal-dots .dot:nth-child(2) { animation-delay: 0.2s; }
.reveal-dots .dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes dotPulse {
  0%,80%,100% { transform: scale(0.6); opacity: 0.5; }
  40% { transform: scale(1); opacity: 1; }
}

/* ========== 行程卡片 ========== */
.trip-content {
  padding: 16px 18px;
}
.trip-header {
  text-align: center;
  padding: 20px 0 16px;
}
.trip-city {
  font-size: 26px;
  font-weight: 700;
}
.trip-destination {
  font-size: 15px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.trip-level-badge {
  display: inline-block;
  margin-top: 10px;
  padding: 4px 14px;
  background: var(--accent-bg);
  color: var(--accent);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
}

.trip-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.trip-card h3 {
  font-size: 14px;
  color: var(--accent);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.trip-card .activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #f5f5f5;
}
.trip-card .activity-item:last-child { border-bottom: none; }
.activity-icon { font-size: 20px; flex-shrink: 0; }
.activity-info { }
.activity-title { font-size: 14px; font-weight: 500; }
.activity-desc { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }

.cost-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cost-item {
  flex: 1;
  min-width: 70px;
  background: #faf9f6;
  border-radius: var(--radius-sm);
  padding: 10px;
  text-align: center;
}
.cost-item .cost-name { font-size: 11px; color: var(--text-hint); }
.cost-item .cost-amount { font-size: 15px; font-weight: 700; color: var(--accent); }
.cost-total {
  width: 100%;
  text-align: right;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-top: 4px;
}

.reasons-list {
  list-style: none;
  padding: 0;
}
.reasons-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 6px;
}
.reasons-list li::before {
  content: "💡";
  flex-shrink: 0;
}

.accommodation-info, .transport-info {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}

.data-disclaimer {
  font-size: 11px;
  color: var(--text-hint);
  text-align: center;
  padding: 10px;
  font-style: italic;
}

/* ========== 操作按钮 ========== */
.trip-actions {
  display: flex;
  gap: 12px;
  padding: 0 18px 16px;
}
.btn-save, .btn-reroll {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid var(--border);
  transition: all 0.2s;
}
.btn-save {
  background: var(--card-bg);
  color: var(--text);
}
.btn-save.saved {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red);
}
.btn-reroll {
  background: var(--card-bg);
  color: var(--blue);
  border-color: var(--blue);
}
.btn-save:active, .btn-reroll:active { transform: scale(0.97); }

/* ========== 反馈区 ========== */
.feedback-section {
  margin: 0 18px 20px;
  padding: 20px;
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.feedback-title {
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  margin-bottom: 14px;
}
.star-rating {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 14px;
}
.star {
  font-size: 32px;
  cursor: pointer;
  color: #ddd;
  transition: color 0.15s;
  user-select: none;
}
.star.active, .star:hover { color: #f5a623; }
.star:hover ~ .star { color: #ddd; }

.would-go {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}
.go-btn {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.go-btn.active {
  background: var(--blue-bg);
  border-color: var(--blue);
  font-weight: 600;
}
.go-btn:active { transform: scale(0.96); }

.feedback-text {
  width: 100%;
  padding: 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font);
  resize: vertical;
  margin-bottom: 12px;
}
.feedback-text:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-submit-feedback {
  width: 100%;
  padding: 12px;
  font-size: 15px;
  font-weight: 600;
  background: var(--green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.btn-submit-feedback:active { opacity: 0.85; }
.btn-submit-feedback:disabled { background: #ccc; cursor: not-allowed; }

/* ========== 数据看板 ========== */
.dashboard-content {
  padding: 18px;
}
.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 18px;
  text-align: center;
  box-shadow: var(--shadow);
}
.stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--accent);
}
.stat-label {
  font-size: 12px;
  color: var(--text-hint);
  margin-top: 4px;
}

.dashboard-section {
  margin-bottom: 20px;
}
.dashboard-section h3 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
}
.empty-hint {
  font-size: 13px;
  color: var(--text-hint);
  padding: 16px;
  text-align: center;
}

.recent-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.recent-item {
  background: var(--card-bg);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  border: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.recent-item .ri-city { font-weight: 600; }
.recent-item .ri-level { color: var(--text-hint); font-size: 12px; }
.recent-item .ri-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--green-bg);
  color: var(--green);
}

.city-bars { display: flex; flex-direction: column; gap: 8px; }
.city-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
}
.city-bar-label { width: 40px; text-align: right; font-weight: 500; }
.city-bar-track {
  flex: 1;
  height: 22px;
  background: #f0f0f0;
  border-radius: 6px;
  overflow: hidden;
}
.city-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 6px;
  transition: width 0.3s;
  min-width: 2px;
}
.city-bar-count { width: 28px; color: var(--text-hint); font-size: 12px; }

.btn-reset {
  width: 100%;
  padding: 14px;
  border: 1.5px dashed var(--red);
  background: var(--red-bg);
  color: var(--red);
  border-radius: var(--radius-sm);
  font-size: 14px;
  cursor: pointer;
  margin-top: 10px;
}
.btn-reset:active { opacity: 0.7; }

/* ========== 分步揭晓 ========== */
.reveal-steps {
  padding: 0 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding-top: 24px;
}
.step-counter {
  font-size: 12px;
  color: var(--text-hint);
  letter-spacing: 1px;
}
.step-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 32px 24px;
  width: 100%;
  text-align: center;
  box-shadow: var(--shadow-lg);
  animation: stepIn 0.45s ease-out;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 2px solid transparent;
  transition: border-color 0.3s;
}
.step-card.revealed {
  border-color: var(--accent);
}
@keyframes stepIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.step-icon {
  font-size: 48px;
  animation: popIn 0.4s ease-out;
}
@keyframes popIn {
  from { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.2); }
  to { transform: scale(1); opacity: 1; }
}
.step-label {
  font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 2px;
}
.step-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
}
.step-detail {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  max-width: 280px;
}
.btn-reveal-next {
  width: 100%;
  max-width: 300px;
  padding: 16px;
  font-size: 17px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-dim));
  color: #fff;
  border: none;
  border-radius: 28px;
  cursor: pointer;
  letter-spacing: 1px;
  transition: all 0.2s;
  animation: pulse 2s ease-in-out infinite;
}
.btn-reveal-next:active {
  transform: scale(0.96);
}
.btn-reveal-next.final {
  background: linear-gradient(135deg, var(--green), #3cb371);
  animation: none;
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,107,53,0.4); }
  50% { box-shadow: 0 0 0 12px rgba(255,107,53,0); }
}
.cost-highlight {
  font-size: 36px;
  font-weight: 800;
  color: var(--accent);
}
.disclaimer-inline {
  font-size: 11px;
  color: var(--text-hint);
  font-style: italic;
  margin-top: 8px;
}

/* ========== Toast ========== */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: #fff;
  padding: 10px 24px;
  border-radius: 20px;
  font-size: 14px;
  z-index: 100;
  animation: toastIn 0.3s ease;
  pointer-events: none;
}
.toast.fadeout { animation: toastOut 0.3s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(20px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(20px); } }
