:root {
  --bg: #0b1736;        /* 深蓝 */
  --bg-elev: #0f2052;
  --text: #e8eefc;      /* 近白 */
  --muted: #a8b3d1;
  --brand: #c9a227;     /* 金色 */
  --accent: #2f6df6;    /* 蓝色点缀 */
  --danger: #ff6b6b;
}

:root.theme-dark {
  --bg: #040810;
  --bg-elev: #0a1224;
  --text: #c8d4ec;
  --muted: #8fa0c3;
  --brand: #b8941f;
  --accent: #2a5be7;
  --danger: #ff6b6b;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background: radial-gradient(1200px 800px at 80% -10%, #16306c 0%, var(--bg) 60%);
  color: var(--text);
  touch-action: manipulation; /* 减少双击缩放干扰 */
}

/* 全屏时的专注内容居中放大 */
.is-fullscreen .container { max-width: 1200px; }
.is-fullscreen #screen-focus .timer { margin-top: 8vh; }
.is-fullscreen #screen-focus .time-remaining { font-size: 96px; }
.is-fullscreen #screen-focus .progress { height: 12px; }

/* 纯净模式：隐藏控制，仅显示时间和进度 */
.pure-mode .focus-header, .pure-mode .audio-wrap, .pure-mode .timer-meta { opacity: 0; pointer-events: none; height: 0; overflow: hidden; }
.pure-mode .timer { margin-top: 12vh; }

/* 纯净模式浮动退出按钮（移动端兜底） */
.pure-exit {
  position: fixed;
  right: 16px;
  bottom: 16px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.pure-mode .pure-exit { opacity: 0.6; pointer-events: auto; }
.pure-mode .pure-exit:hover { opacity: 1; }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.brand__icon { width: 28px; height: 28px; }
.brand__title { font-size: 20px; font-weight: 700; letter-spacing: 0.4px; }

.screen { display: none; }
.screen.active { display: block; }

.card {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 16px;
  margin: 16px 0;
  backdrop-filter: blur(6px);
}

/* 登机牌样式 */
.ticket {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 12px 1fr;
  gap: 0;
  background: rgba(255,255,255,0.06);
  border: 1px dashed rgba(255,255,255,0.18);
  border-radius: 16px;
  overflow: hidden;
}
.ticket__left, .ticket__right { padding: 16px; }
.ticket__right { display: flex; flex-direction: column; }
.ticket__route { font-size: 24px; font-weight: 800; margin-bottom: 12px; letter-spacing: 1px; }
.ticket__row { display: flex; justify-content: space-between; margin-top: 8px; }
.ticket__row .label { color: var(--muted); }
.ticket__sep { background-image: linear-gradient(transparent 40%, rgba(255,255,255,0.25) 40% 60%, transparent 60%); background-size: 100% 16px; }
.ticket__flight { font-weight: 700; margin-bottom: 12px; }
.ticket__cta { margin-top: auto; padding-top: 12px; }

/* 撕票动画 */
.tear { animation: tear 700ms ease both; }
@keyframes tear {
  0% { transform: translateX(0) rotate(0deg); opacity: 1; }
  40% { transform: translateX(6px) rotate(-1deg); }
  60% { transform: translateX(-8px) rotate(1deg); }
  100% { transform: translateX(120%) rotate(6deg); opacity: 0; }
}
.flight-card .flight-route {
  font-size: 18px; font-weight: 700; margin-bottom: 8px;
}
.flight-card .flight-meta { color: var(--muted); display: flex; gap: 12px; flex-wrap: wrap; }

/* 首屏引导 */
.hero { display: grid; gap: 8px; }
.hero__title { margin: 0; font-size: 20px; font-weight: 800; }
.hero__desc { margin: 0; color: var(--muted); }
.steps { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.step { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.step__index { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 999px; background: rgba(255,255,255,0.12); color: var(--text); font-size: 12px; }

.options { display: grid; gap: 12px; }
.options--durations { grid-template-columns: repeat(3, minmax(0,1fr)); }
.options--seats { grid-template-columns: repeat(3, minmax(0,1fr)); }

.chip {
  padding: 12px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.1);
  background: linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  color: var(--text);
  cursor: pointer;
}
.chip.is-selected { outline: 2px solid var(--accent); }
.chip.is-recommended { border-color: var(--brand); box-shadow: 0 0 0 2px rgba(201,162,39,0.25) inset; }

.seat {
  padding: 14px;
  text-align: left;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
}
.seat.is-selected { outline: 2px solid var(--accent); }
.seat__title { font-weight: 700; }
.seat__desc { display: block; color: var(--muted); font-size: 12px; margin-top: 4px; }

.actions { margin-top: 12px; display: flex; justify-content: flex-end; }
.btn {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  cursor: pointer;
}
.btn[disabled] { opacity: 0.4; cursor: not-allowed; }
.btn--primary { background: linear-gradient(180deg, #2a5be7, #1840a9); border-color: #2a5be7; }
.btn--ghost { background: transparent; border-color: rgba(255,255,255,0.2); }

.focus-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; margin-bottom: 24px; }
.focus-title { font-weight: 700; justify-self: center; }
.focus-header .btn:first-child { justify-self: start; }
.actions-right { display: flex; gap: 8px; justify-self: end; }

.timer { margin-top: 20px; }
.time-remaining { font-size: 56px; font-variant-numeric: tabular-nums; letter-spacing: 1px; text-align: center; transition: font-size 0.2s ease; }
.progress { height: 10px; background: rgba(255,255,255,0.1); border-radius: 999px; overflow: visible; margin-top: 16px; }
.progress__bar { height: 100%; background: linear-gradient(90deg, var(--brand), #ffd166); width: 0%; transition: width 0.3s ease; }
.progress { position: relative; }
.plane { position: absolute; left: 0%; top: -22px; transform: translateX(-50%); pointer-events: none; will-change: transform, left; transition: left 0.25s cubic-bezier(.22,.61,.36,1); z-index: 1; }
.plane__wrap { position: relative; }
.plane__icon { width: 28px; height: 28px; filter: drop-shadow(0 2px 3px rgba(0,0,0,0.6)) drop-shadow(0 0 6px rgba(255, 209, 102, 0.4)); animation: planeFloat 2.2s ease-in-out infinite; transform: rotate(var(--plane-rotate, 0deg)); transition: transform 0.3s ease; }
/* 尾流：向左的金色渐变条 */
.plane__wrap::before { content: ""; position: absolute; left: -56px; top: 50%; transform: translateY(-50%); width: 48px; height: 6px; background: linear-gradient(90deg, rgba(201,162,39,0.45), rgba(201,162,39,0)); filter: blur(6px); border-radius: 999px; opacity: var(--wake-alpha, 0.45); }
/* 全屏/纯净尺寸更大、尾流更长 */
.is-fullscreen #screen-focus .plane__icon, .pure-mode #screen-focus .plane__icon { width: 40px; height: 40px; }
.is-fullscreen #screen-focus .plane__wrap::before, .pure-mode #screen-focus .plane__wrap::before { width: 64px; left: -72px; filter: blur(8px); }
@keyframes planeFloat { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .plane__icon { animation: none; } .plane { transition: none; } }
.progress-meta { text-align: right; color: var(--muted); margin-top: 6px; font-size: 12px; }
.timer-meta { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 12px; }

.audio-wrap { margin: 4px 0 8px; }
.audio-wrap.is-collapsed { height: 0; overflow: hidden; }
.audio-panel { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; padding: 8px 0 12px; align-items: center; }
.audio-panel label { color: var(--muted); font-size: 12px; display: flex; gap: 8px; align-items: center; }
.audio-panel input[type="range"] { width: 100%; }

/* 地图折叠容器 */
.map-wrap { margin: 8px 0 12px; border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; overflow: hidden; }
.map-wrap.is-collapsed { height: 0; border-width: 0; }
.map-container { width: 100%; height: 38vh; background: rgba(255,255,255,0.04); }
.is-fullscreen #screen-focus .map-container { height: 42vh; }
.pure-mode .map-wrap { display: none; }

/* 纯净模式提示 */
.pure-hint { display: none; text-align: center; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.pure-mode .pure-hint { display: block; }

.custom-duration { margin-top: 10px; }
.custom-duration input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: var(--text);
  outline: none;
}
.custom-duration input.input-invalid { border-color: var(--danger); }

/* 推荐时长显示优化 */
.recommend {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 12px;
  padding: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 8px;
}

.route-type {
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 6px;
}

.route-time {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.route-desc {
  font-size: 12px;
  color: var(--muted);
  font-style: italic;
}

/* 解锁进度显示 */
.unlock-progress {
  margin-top: 16px;
  padding: 12px 16px;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.2);
  border-radius: 10px;
}

.unlock-progress h3 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: var(--brand);
  display: flex;
  align-items: center;
  gap: 6px;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--brand), #ffd166);
  border-radius: 3px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 12px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
}

/* 层级标签 */
.tier-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 6px;
  border-radius: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.tier-badge.tier1 { background: rgba(74, 222, 128, 0.2); color: #4ade80; }
.tier-badge.tier2 { background: rgba(59, 130, 246, 0.2); color: #3b82f6; }  
.tier-badge.tier3 { background: rgba(139, 92, 246, 0.2); color: #8b5cf6; }

/* 新解锁标签 */
.new-unlock-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: linear-gradient(45deg, #ff6b6b, #ffd93d);
  color: white;
  font-size: 8px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  animation: new-badge-pulse 1.5s ease-in-out infinite;
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  z-index: 10;
}

@keyframes new-badge-pulse {
  0%, 100% { 
    transform: scale(1);
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.4);
  }
  50% { 
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.8);
  }
}

/* 解锁通知 */
.unlock-notification {
  position: fixed;
  top: 20px;
  right: 20px;
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.95) 0%, rgba(59, 130, 246, 0.95) 100%);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 20px;
  min-width: 300px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  z-index: 9999;
  transform: translateX(100%) scale(0.8);
  opacity: 0;
  transition: all 0.3s ease-out;
}

.unlock-notification.show {
  transform: translateX(0) scale(1);
  opacity: 1;
}

.unlock-notification-content {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  position: relative;
}

.unlock-icon {
  font-size: 36px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: unlock-pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}

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

.unlock-text {
  flex: 1;
  min-width: 0;
}

.unlock-text h3 {
  margin: 0 0 8px 0;
  font-size: 16px;
  font-weight: 700;
  color: white;
}

.unlock-text p {
  margin: 0 0 4px 0;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
}

.unlock-text p:last-child {
  margin-bottom: 0;
}

.unlock-desc {
  font-style: italic;
  color: rgba(255, 255, 255, 0.7) !important;
}

.unlock-count {
  font-weight: 600;
  color: rgba(255, 255, 100, 0.9) !important;
  font-size: 13px !important;
}

.unlock-close {
  position: absolute;
  top: -8px;
  right: -8px;
  width: 24px;
  height: 24px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: white;
  border-radius: 50%;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  line-height: 1;
}

.unlock-close:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* 家庭机场显示 */
.home-airport-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 12px;
}

.airport-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.airport-info .airport__code {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
}

.airport-info .airport__city {
  color: var(--text);
}

.btn--small {
  padding: 6px 12px;
  font-size: 12px;
}

/* 机场选项样式 */
.options--airports {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.airport {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.015));
  border: 1px solid rgba(255,255,255,0.08);
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative; /* 为NEW标签定位 */
}

.airport:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.15);
}

.airport.is-selected {
  outline: 2px solid var(--accent);
  background: rgba(47,109,246,0.1);
}

.airport.is-locked {
  opacity: 0.4;
  cursor: not-allowed;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  position: relative;
}

.airport.is-locked:hover {
  background: rgba(255,255,255,0.02);
  border-color: rgba(255,255,255,0.05);
}

.airport.is-locked::after {
  content: "🔒";
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 14px;
  opacity: 0.7;
}

.airport.is-newly-unlocked {
  animation: unlock-glow 2s ease-out;
  box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
}

@keyframes unlock-glow {
  0% { 
    transform: scale(1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.6);
  }
  50% { 
    transform: scale(1.02);
    box-shadow: 0 0 30px rgba(139, 92, 246, 0.8);
  }
  100% { 
    transform: scale(1);
    box-shadow: 0 0 20px rgba(139, 92, 246, 0.3);
  }
}

.airport__code {
  font-size: 16px;
  font-weight: 700;
  color: var(--brand);
  margin-bottom: 2px;
}

.airport__city {
  font-size: 14px;
  color: var(--muted);
}

@media (max-width: 640px) {
  .options--durations, .options--seats { grid-template-columns: 1fr; }
  .options--airports { grid-template-columns: 1fr; }
  .time-remaining { font-size: 44px; }
  .audio-panel { grid-template-columns: 1fr; }
  .home-airport-display { flex-direction: column; gap: 8px; }
  .airport-info { flex-direction: column; align-items: flex-start; gap: 4px; }
}

/* 完成页面 */
.complete { text-align: center; margin-top: 24px; }
.celebrate { font-size: 56px; animation: pop 900ms ease both; }
@keyframes pop { 0% {transform: scale(0.8); opacity: 0;} 50% {transform: scale(1.08);} 100% {transform: scale(1); opacity: 1;} }
.complete__title { margin: 8px 0 16px; font-weight: 800; }
.stats { display: grid; gap: 8px; max-width: 420px; margin: 0 auto 16px; }
.stat { display: flex; justify-content: space-between; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08); border-radius: 12px; padding: 10px 12px; }
.stat .label { color: var(--muted); }
.actions--center { justify-content: center; }


