:root {
  --bg-top: #EAF4FB;
  --bg-bottom: #C9DEEE;
  --bg-gradient: linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
  --card: rgba(255, 255, 255, 0.55);
  --card-strong: rgba(255, 255, 255, 0.75);
  --card-border: rgba(255, 255, 255, 0.35);
  --shadow: 0 8px 32px rgba(96, 126, 150, 0.2);
  --text-primary: #3A4754;
  --text-secondary: #6E8296;
  --text-faint: #A5B8C9;
  --accent: #7FA8C9;
  --accent-soft: #C9DEEE;
  --accent-deep: #5C8AA8;
  --sage: #A8B5A0;
  --sage-soft: #DCE4D5;
  --mist: #9FB4C7;
  --mist-soft: #DCE5EE;
  --butter: #D9B26B;
  --butter-soft: #F0E2C4;
  --danger: #C77E7E;
  --warn: #D8A657;
  --good: #7FA07F;
  --danger-soft: #F3DEDC;
  --warn-soft: #F5E8CE;
  --good-soft: #DCE9DC;
  --radius-lg: 24px;
  --radius-md: 12px;
  --radius-sm: 6px;
  --transition: all 0.3s ease-in-out;
  --font-size: 16px;
}

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

html, body { width: 100%; height: 100%; overflow: hidden; }

body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", sans-serif;
  font-size: var(--font-size);
  color: var(--text-primary);
  background: var(--bg-gradient);
  -webkit-font-smoothing: antialiased;
}

#app { width: 100%; height: 100%; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: rgba(150, 135, 120, 0.35); border-radius: 3px; }
::-webkit-scrollbar-track { background: transparent; }

button {
  font-family: inherit;
  border: none;
  cursor: pointer;
  color: inherit;
  transition: var(--transition);
}
button:active { filter: brightness(0.82); }

input, textarea, select {
  font-family: inherit;
  color: var(--text-primary);
  background: rgba(255,255,255,0.6);
  border: 1px solid rgba(150,170,190,0.35);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  outline: none;
  transition: var(--transition);
}
input:focus, textarea:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(127,168,201,0.15);
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-soft), var(--accent));
  padding: 0;
  border: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--accent);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
}

.font-kai { font-family: "Kaiti SC", "STKaiti", "KaiTi", serif; }
.font-song { font-family: "Songti SC", "SimSun", serif; }

/* ===== 通用遮罩与弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.6);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
}
.modal-overlay.no-close { cursor: default; }
.modal-card {
  width: min(92vw, 540px);
  max-height: 86vh;
  display: flex; flex-direction: column;
  background: var(--card-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  animation: modalPop 0.35s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(127,168,201,0.2);
}
.modal-header h2 {
  font-size: 18px; font-weight: 600;
  letter-spacing: 2px;
}
.modal-close {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: rgba(0,0,0,0.05);
  font-size: 14px; color: var(--text-secondary);
  display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: rgba(0,0,0,0.1); }
.modal-x-float {
  position: absolute; top: 10px; right: 10px; z-index: 5;
  background: rgba(0,0,0,0.08); font-size: 16px;
}
.modal-card { position: relative; }
.modal-body { padding: 16px 20px; overflow-y: auto; overflow-x: hidden; flex: 1; }
.modal-footer {
  padding: 12px 20px;
  display: flex; gap: 12px; justify-content: flex-end;
  border-top: 1px solid rgba(127,168,201,0.2);
}

/* ===== 按钮 ===== */
.btn {
  height: 44px; padding: 0 20px;
  border-radius: var(--radius-md);
  font-size: 15px;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  background: rgba(255,255,255,0.65);
  border: 1px solid var(--card-border);
  color: var(--text-primary);
  box-shadow: 0 2px 8px rgba(100,120,140,0.1);
  --press: rgba(127,168,201,0.12);
}
.btn:active {
  transform: scale(0.97);
  box-shadow: inset 0 0 0 100px var(--press);
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff;
  border: none;
  box-shadow: 0 4px 16px rgba(127,168,201,0.35);
  --press: rgba(255,255,255,0.22);
}
.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border: none;
  --press: rgba(255,255,255,0.22);
}
.btn-ghost {
  background: transparent;
  border: 1px solid rgba(127,168,201,0.4);
  color: var(--accent-deep);
  box-shadow: none;
  --press: rgba(127,168,201,0.12);
}
.btn-sm { height: 34px; padding: 0 14px; font-size: 13px; border-radius: 10px; }
.btn-lg { height: 52px; width: 100%; font-size: 16px; border-radius: var(--radius-md); }

/* ===== 标签 ===== */
.tag {
  display: inline-flex; align-items: center;
  padding: 2px 10px;
  font-size: 12px;
  border-radius: var(--radius-sm);
  background: rgba(127,168,201,0.12);
  color: var(--accent-deep);
  letter-spacing: 1px;
}

/* ===== 进度条 ===== */
.bar {
  height: 8px; border-radius: 4px;
  background: rgba(0,0,0,0.07);
  overflow: hidden;
  position: relative;
}
.bar-fill {
  height: 100%; border-radius: 4px;
  transition: width 0.4s ease-in-out;
}

/* ===== 选择器 (单选/多选卡片) ===== */
.opt-list { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 7px 16px;
  border-radius: 20px;
  font-size: 13px;
  border: 1px solid rgba(150,170,190,0.4);
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: var(--transition);
  color: var(--text-secondary);
}
.opt:hover { border-color: var(--accent); }
.opt.selected {
  background: linear-gradient(135deg, var(--accent-soft), var(--accent));
  color: #fff;
  border-color: transparent;
  box-shadow: 0 3px 10px rgba(127,168,201,0.3);
}

.bg-card {
  display: flex; flex-direction: column; align-items: center; gap: 5px;
  width: 72px; padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(150,170,190,0.35);
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  transition: var(--transition);
}
.bg-card:hover { border-color: var(--swatch); }
.bg-card.selected {
  border-color: var(--swatch);
  box-shadow: 0 0 0 2px var(--swatch), 0 3px 10px rgba(100,120,140,0.25);
}
.bg-swatch {
  width: 42px; height: 42px; border-radius: 10px;
  background: var(--swatch);
  border: 1px solid rgba(100,120,140,0.25);
}
.bg-name { font-size: 11px; color: var(--text-secondary); text-align: center; line-height: 1.3; }

.swatch-list { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch {
  width: 34px; height: 34px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.8);
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer; position: relative;
  transition: var(--transition);
}
.swatch:hover { transform: scale(1.1); }
.swatch.selected::after {
  content: "✓";
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; font-weight: 700;
  text-shadow: 0 1px 2px rgba(0,0,0,0.4);
}

/* ===== Tab ===== */
.tabs { display: flex; gap: 6px; background: rgba(255,255,255,0.5); padding: 4px; border-radius: var(--radius-md); margin-bottom: 14px; }
.tab {
  flex: 1; padding: 8px 0;
  border-radius: 10px;
  font-size: 13px; text-align: center;
  color: var(--text-secondary);
  cursor: pointer;
}
.tab.active {
  background: #fff;
  color: var(--accent-deep);
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== 通用动画 ===== */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalPop { from { opacity: 0; transform: scale(0.9) translateY(20px); } to { opacity: 1; transform: scale(1) translateY(0); } }
@keyframes floatUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes sparkle { 0%, 100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }
@keyframes typing { from { width: 0; } }

/* ===== 屏幕容器 ===== */
.screen {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  overflow: hidden;
  display: flex; flex-direction: column;
  align-items: center;
  justify-content: center;
}
.content-center { max-width: 540px; width: 100%; margin: 0 auto; }

/* ===== 提示 Toast ===== */
.toast {
  position: fixed; top: 60px; left: 50%;
  transform: translateX(-50%);
  background: rgba(60,54,48,0.92);
  color: #fff; font-size: 14px;
  padding: 10px 22px;
  border-radius: 24px;
  z-index: 9999;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  animation: floatUp 0.3s ease-in-out;
  max-width: 80vw;
  text-align: center;
  pointer-events: none;
}

/* 全局通知条 */
.notif-banner {
  position: fixed; top: 14px; left: 50%; transform: translateX(-50%);
  z-index: 9998;
  background: var(--card-strong);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 10px 18px;
  box-shadow: var(--shadow);
  font-size: 13px;
  max-width: 86vw;
  animation: floatUp 0.3s ease-in-out;
  display: flex; align-items: center; gap: 8px;
}

/* 震动 */
.vibrate { animation: shake 0.4s ease-in-out; }
@keyframes shake { 0%,100%{transform:translateX(0);} 25%{transform:translateX(-3px);} 75%{transform:translateX(3px);} }

.empty-hint {
  text-align: center; color: var(--text-faint);
  font-size: 14px; padding: 40px 20px; letter-spacing: 2px;
}

/* ===== 开场动画 ===== */
.opening-screen { background: linear-gradient(180deg, #EAF4FB 0%, #BBD8F0 55%, #6E96C2 100%); }
.opening-stage { position: relative; width: 100%; height: 100%; overflow: hidden; }
.opening-sky { position: absolute; inset: 0; z-index: 5; background: radial-gradient(ellipse at 50% 20%, rgba(255,255,255,0.5), transparent 60%), radial-gradient(ellipse at 50% 80%, rgba(210,235,255,0.4), transparent 62%); }
.skip-btn {
  position: absolute; right: 18px; bottom: 26px; z-index: 60;
  font-size: 12px; color: #EAF4FB;
  background: rgba(0,0,0,0.25); border: none;
  padding: 6px 14px; border-radius: 16px; cursor: pointer;
}
.skip-btn:active { filter: brightness(0.85); }

/* 星星点点的圆圈组成的星球 */
.planet-wrap {
  position: absolute; left: 50%; top: 44%;
  width: 320px; height: 320px;
  transform: translate(-50%, -50%) scale(0.5);
  opacity: 0;
  transition: all 1.6s cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 20;
}
.planet-wrap.show { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.planet-wrap.burst { transform: translate(-50%, -50%) scale(1.25); opacity: 0.6; }
.planet-dots { position: absolute; inset: 0; }
.planet-dot {
  position: absolute; width: 9px; height: 9px; border-radius: 50%;
  background: rgba(255,255,255,0.92);
  box-shadow: 0 0 10px rgba(255,255,255,0.85);
  opacity: 0;
  animation: dotPop 1.2s ease-in forwards;
}
@keyframes dotPop { 0% { opacity: 0; transform: scale(0.3); } 100% { opacity: 1; transform: scale(1); } }
.planet-glow {
  position: absolute; inset: -25%; border-radius: 50%;
  background: radial-gradient(circle, rgba(190,222,250,0.55), transparent 65%);
  animation: glowBreath 3s ease-in-out infinite;
}
@keyframes glowBreath { 0%,100% { transform: scale(1); opacity: 0.8; } 50% { transform: scale(1.12); opacity: 1; } }

/* 标题 */
.opening-title-wrap {
  position: absolute; left: 0; right: 0; top: 40%;
  z-index: 30;
  text-align: center;
  opacity: 0; transform: translateY(26px);
  transition: all 1.3s cubic-bezier(0.22, 1, 0.36, 1);
}
.opening-title-wrap.show { opacity: 1; transform: translateY(0); }
.opening-title {
  font-size: 52px; letter-spacing: 18px;
  color: #fff;
  text-shadow: 0 4px 30px rgba(40,80,130,0.6);
  animation: titleGlow 3s ease-in-out infinite;
}
.opening-studio { font-size: 15px; letter-spacing: 10px; color: rgba(255,255,255,0.85); margin-top: 18px; text-shadow: 0 2px 12px rgba(40,80,130,0.5); }
@keyframes titleGlow { 0%,100% { text-shadow: 0 4px 24px rgba(60,110,170,0.5); } 50% { text-shadow: 0 4px 44px rgba(140,190,240,0.9); } }

/* 城市剪影 */
.city-silhouette {
  position: absolute; left: 0; right: 0; bottom: 0; height: 34%;
  z-index: 15;
  background:
    linear-gradient(180deg, transparent, rgba(90,120,165,0.5) 12%, rgba(72,100,145,0.92) 30%, rgba(60,85,128,1) 100%);
  clip-path: polygon(0% 100%, 0% 46%, 4% 46%, 4% 34%, 9% 34%, 9% 52%, 13% 52%, 13% 30%, 18% 30%, 18% 48%, 22% 48%, 22% 20%, 27% 20%, 27% 44%, 32% 44%, 32% 30%, 37% 30%, 37% 50%, 42% 50%, 42% 24%, 47% 24%, 47% 40%, 52% 40%, 52% 16%, 57% 16%, 57% 42%, 62% 42%, 62% 28%, 67% 28%, 67% 46%, 72% 46%, 72% 22%, 77% 22%, 77% 40%, 82% 40%, 82% 30%, 87% 30%, 87% 48%, 92% 48%, 92% 26%, 96% 26%, 96% 44%, 100% 44%, 100% 100%);
  opacity: 0;
  transition: opacity 1.6s ease-in;
}
.city-silhouette.show { opacity: 1; }

/* 飞鸟 */
.bird-wrap { position: absolute; left: 0; right: 0; top: 0; height: 45%; z-index: 18; opacity: 0; transition: opacity 1.4s ease-in 0.3s; }
.bird-wrap.show { opacity: 1; }
.bird {
  position: absolute; left: -8%;
  width: 26px; height: 26px;
  animation: birdFly linear infinite;
}
.bird::before, .bird::after {
  content: ""; position: absolute; top: 12px;
  width: 15px; height: 8px;
  border-top: 2px solid rgba(60,90,130,0.85);
  border-radius: 50%;
}
.bird::before { left: 0; transform: rotate(-18deg); }
.bird::after { right: 0; transform: rotate(18deg); }
@keyframes birdFly {
  0% { transform: translateX(-60px) translateY(0); }
  25% { transform: translateX(24vw) translateY(-16px); }
  50% { transform: translateX(52vw) translateY(4px); }
  75% { transform: translateX(76vw) translateY(-10px); }
  100% { transform: translateX(108vw) translateY(0); }
}

/* 云朵 */
.cloud-wrap { position: absolute; left: 0; right: 0; top: 0; height: 40%; z-index: 17; opacity: 0; transition: opacity 1.6s ease-in 0.4s; }
.cloud-wrap.show { opacity: 1; }
.cloud {
  position: absolute; left: -20%;
  width: 120px; height: 40px;
  border-radius: 30px;
  background: rgba(255,255,255,0.82);
  box-shadow: inset -18px 0 20px rgba(210,230,250,0.5);
  animation: cloudDrift linear infinite;
}
.cloud::before {
  content: ""; position: absolute; left: 22px; top: -16px;
  width: 56px; height: 56px; border-radius: 50%;
  background: rgba(255,255,255,0.9);
}
.cloud::after {
  content: ""; position: absolute; right: 26px; top: -10px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255,255,255,0.86);
}
@keyframes cloudDrift {
  0% { transform: translateX(-140px); }
  100% { transform: translateX(120vw); }
}
