/* ========================================
   台风安全岛 — 共享样式
   暗色暴风雨主题 · 玻璃态卡片 · 微动效
   ======================================== */

/* ----- CSS 自定义属性 (主题色) ----- */
:root {
  --color-bg-start: #0a1628;
  --color-bg-mid: #0f1f3d;
  --color-bg-end: #1a1040;
  --color-card-bg: rgba(255, 255, 255, 0.06);
  --color-card-border: rgba(255, 255, 255, 0.12);
  --color-card-hover: rgba(255, 255, 255, 0.10);
  --color-primary: #5b9bd5;
  --color-primary-glow: rgba(91, 155, 213, 0.4);
  --color-accent: #f0a050;
  --color-accent-glow: rgba(240, 160, 80, 0.4);
  --color-success: #4caf84;
  --color-danger: #e0556a;
  --color-text: #d8dce6;
  --color-text-dim: #8899aa;
  --color-text-bright: #f0f4ff;
  --color-gradient-title-1: #e8f0ff;
  --color-gradient-title-2: #7eb8da;
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px var(--color-primary-glow);
  --transition-fast: 0.2s ease;
  --transition-smooth: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --font-stack: -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --nav-height: 64px;
}

/* ----- 基础重置 ----- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-stack);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding-top: var(--nav-height);
  position: relative;
  background:
    /* ===== 云层 ===== */
    /* 大朵云 1 — 左上显眼位置 */
    radial-gradient(ellipse 60% 25% at 18% 12%, rgba(170, 195, 225, 0.07) 0%, transparent 100%),
    radial-gradient(ellipse 40% 20% at 22% 10%, rgba(200, 215, 240, 0.05) 0%, transparent 100%),
    /* 大朵云 2 — 右上 */
    radial-gradient(ellipse 50% 22% at 82% 8%, rgba(160, 185, 220, 0.06) 0%, transparent 100%),
    radial-gradient(ellipse 35% 18% at 78% 12%, rgba(190, 210, 235, 0.04) 0%, transparent 100%),
    /* 大朵云 3 — 中间偏左 */
    radial-gradient(ellipse 45% 18% at 30% 38%, rgba(175, 200, 230, 0.05) 0%, transparent 100%),
    /* 大朵云 4 — 中间偏右 */
    radial-gradient(ellipse 55% 20% at 70% 45%, rgba(165, 190, 220, 0.04) 0%, transparent 100%),
    /* 云 5 — 底部左侧 */
    radial-gradient(ellipse 40% 15% at 25% 75%, rgba(180, 200, 225, 0.05) 0%, transparent 100%),
    /* 云 6 — 底部右侧 */
    radial-gradient(ellipse 50% 18% at 75% 80%, rgba(170, 190, 220, 0.04) 0%, transparent 100%),

    /* ===== 乌云暗影压顶 ===== */
    /* 顶部厚重暗云 */
    radial-gradient(ellipse 120% 28% at 50% 0%, rgba(3, 8, 22, 0.8) 0%, transparent 100%),
    /* 左上方暗云 */
    radial-gradient(ellipse 50% 35% at 0% 12%, rgba(5, 12, 30, 0.7) 0%, transparent 100%),
    /* 右上方暗云 */
    radial-gradient(ellipse 45% 30% at 100% 8%, rgba(8, 6, 28, 0.6) 0%, transparent 100%),
    /* 底部压暗 */
    radial-gradient(ellipse 100% 20% at 50% 100%, rgba(2, 6, 18, 0.75) 0%, transparent 100%),
    /* 左下 */
    radial-gradient(ellipse 40% 18% at 0% 100%, rgba(4, 6, 22, 0.55) 0%, transparent 100%),
    /* 右下 */
    radial-gradient(ellipse 40% 18% at 100% 100%, rgba(6, 4, 22, 0.5) 0%, transparent 100%),

    /* ===== 基础天空渐变 ===== */
    linear-gradient(160deg,
      var(--color-bg-start) 0%,
      var(--color-bg-mid) 40%,
      var(--color-bg-end) 100%);
  background-attachment: fixed;
}

/* ----- 语义化布局 ----- */
header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
}

main {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem 3.5rem;
}

footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--color-text-dim);
  font-size: 0.85rem;
  border-top: 1px solid var(--color-card-border);
  margin-top: 2rem;
}

/* ===============================================
   🧭 导航栏 — 固定顶部 · 毛玻璃 · 下划线动画
   =============================================== */
nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0.65rem 1rem;
  background: rgba(10, 22, 40, 0.78);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--color-card-border);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
  min-height: var(--nav-height);
}

nav a {
  position: relative;
  color: var(--color-text-dim);
  text-decoration: none;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  transition: color var(--transition-fast), background var(--transition-fast);
  border: 1px solid transparent;
  white-space: nowrap;
}

/* 下划线动画 — 悬浮时出现 */
nav a::after {
  content: '';
  position: absolute;
  bottom: 2px;
  left: 50%;
  width: 50%;
  height: 2.5px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 2px;
  transform: translateX(-50%) scaleX(0);
  transition: transform var(--transition-smooth);
}

nav a:hover {
  color: var(--color-text-bright);
  background: var(--color-card-hover);
  border-color: transparent;
}

nav a:hover::after {
  transform: translateX(-50%) scaleX(0.7);
}

/* 当前页码 — 高亮 + 下划线常亮 */
nav a.active {
  color: var(--color-text-bright);
  background: rgba(91, 155, 213, 0.12);
  border-color: rgba(91, 155, 213, 0.3);
}

nav a.active::after {
  transform: translateX(-50%) scaleX(0.85);
}

/* ----- 渐变标题 ----- */
.gradient-title {
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(135deg,
      var(--color-gradient-title-1) 0%,
      var(--color-gradient-title-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.3rem;
}

.subtitle {
  color: var(--color-text-dim);
  font-size: 1rem;
  font-weight: 400;
}

/* ===============================================
   🏠 Hero 区 (仅首页)
   =============================================== */
.hero {
  position: relative;
  text-align: center;
  padding: 4rem 1.5rem 2rem;
  overflow: hidden;
  min-height: 380px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.hero-typhoon {
  font-size: 5rem;
  display: inline-block;
  animation: typhoonSpin 3s linear infinite;
  margin-bottom: 0.6rem;
  filter: drop-shadow(0 0 30px rgba(91, 155, 213, 0.5));
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: 3rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg,
      var(--color-gradient-title-1),
      var(--color-gradient-title-2));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 0.6rem;
  position: relative;
  z-index: 1;
}

.hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-text-dim);
  max-width: 520px;
  margin: 0 auto 1.8rem;
  line-height: 1.8;
  position: relative;
  z-index: 1;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
  z-index: 1;
}

.btn-hero {
  padding: 0.85rem 2.4rem;
  font-size: 1.05rem;
  border-radius: 30px;
}

.btn-hero-outline {
  background: transparent;
  border: 2px solid var(--color-primary);
  color: var(--color-primary);
  box-shadow: none;
}

.btn-hero-outline:hover {
  background: var(--color-primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}

/* ----- Hero 台风装饰动画 ----- */
.hero-decoration {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

/* 扩散波纹环 — 像雷达扫描台风 */
.wind-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 180px;
  height: 180px;
  margin: -90px 0 0 -90px;
  border: 2px solid rgba(91, 155, 213, 0.12);
  border-radius: 50%;
  animation: ringExpand 4s ease-out infinite;
}

.wind-ring-2 {
  animation-delay: 1.5s;
  width: 130px;
  height: 130px;
  margin: -65px 0 0 -65px;
  border-color: rgba(240, 160, 80, 0.08);
}

.wind-ring-3 {
  animation-delay: 3s;
  width: 230px;
  height: 230px;
  margin: -115px 0 0 -115px;
  border-color: rgba(76, 175, 132, 0.06);
}

/* 飘动的风粒子 */
.wind-particle {
  position: absolute;
  width: 4px;
  height: 4px;
  background: var(--color-primary);
  border-radius: 50%;
  opacity: 0;
  animation: windFloat 3.5s ease-in-out infinite;
  animation-delay: var(--d, 0s);
  left: var(--x, 50%);
  top: var(--y, 50%);
}

@keyframes typhoonSpin {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

@keyframes ringExpand {
  0%   { transform: scale(0.5); opacity: 0.5; }
  100% { transform: scale(3.5); opacity: 0; }
}

@keyframes windFloat {
  0%   { transform: translate(0, 0) scale(0); opacity: 0; }
  15%  { opacity: 0.6; transform: translate(40px, -25px) scale(1); }
  35%  { opacity: 0.4; transform: translate(80px, -50px) scale(0.8); }
  60%  { opacity: 0.15; transform: translate(130px, -75px) scale(0.4); }
  100% { transform: translate(200px, -120px) scale(0); opacity: 0; }
}

/* ===============================================
   🃏 玻璃态卡片 — 层级区分
   =============================================== */
.card {
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-card);
  transition: transform var(--transition-smooth),
    background var(--transition-fast),
    box-shadow var(--transition-smooth);
  animation: cardFadeIn 0.5s ease both;
}

.card:hover {
  background: var(--color-card-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), var(--shadow-glow);
}

.card h2,
.card h3 {
  color: var(--color-text-bright);
  margin-bottom: 0.6rem;
}

.card p {
  color: var(--color-text-dim);
  font-size: 0.95rem;
}

/* 主要层级卡片 — 更大、更显眼 */
.card-lg {
  padding: 2rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.8rem;
}

.card-lg h2 {
  font-size: 1.35rem;
}

.card-lg p {
  font-size: 1rem;
}

/* 卡片入场动画 (每个卡片依次淡入) */
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:nth-child(4) { animation-delay: 0.24s; }
.card:nth-child(5) { animation-delay: 0.32s; }
.card:nth-child(6) { animation-delay: 0.40s; }
.card:nth-child(7) { animation-delay: 0.48s; }
.card:nth-child(8) { animation-delay: 0.56s; }

.card-lg:nth-child(2) { animation-delay: 0.08s; }
.card-lg:nth-child(3) { animation-delay: 0.16s; }
.card-lg:nth-child(4) { animation-delay: 0.24s; }

@keyframes cardFadeIn {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ----- 按钮 ----- */
.btn {
  display: inline-block;
  padding: 0.7rem 1.8rem;
  border-radius: 25px;
  border: none;
  font-size: 1rem;
  font-weight: 600;
  font-family: var(--font-stack);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  text-align: center;
  color: #fff;
  background: linear-gradient(135deg, var(--color-primary), #3d7ec0);
  box-shadow: 0 4px 14px var(--color-primary-glow);
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px var(--color-primary-glow);
}

.btn:active {
  transform: translateY(0) scale(0.97);
  box-shadow: 0 2px 8px var(--color-primary-glow);
}

.btn-accent {
  background: linear-gradient(135deg, var(--color-accent), #d08030);
  box-shadow: 0 4px 14px var(--color-accent-glow);
}

.btn-accent:hover {
  box-shadow: 0 6px 20px var(--color-accent-glow);
}

.btn-danger {
  background: linear-gradient(135deg, var(--color-danger), #c04050);
}

.btn-small {
  padding: 0.4rem 1.2rem;
  font-size: 0.85rem;
}

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

/* ----- 卡片网格 (首页入口) ----- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2rem;
  margin-top: 2rem;
}

.card-grid .card {
  text-align: center;
  padding: 2rem 1.5rem;
  margin-bottom: 0;
}

.card-grid .card .icon {
  font-size: 3rem;
  margin-bottom: 0.8rem;
  display: block;
}

/* ----- 进度条 ----- */
.progress-bar {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 4px;
  overflow: hidden;
  margin: 0.8rem 0;
}

.progress-bar .fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 4px;
  transition: width var(--transition-smooth);
}

/* ----- 提示/消息框 ----- */
.toast {
  position: fixed;
  top: calc(var(--nav-height) + 0.5rem);
  left: 50%;
  transform: translateX(-50%);
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  font-weight: 600;
  font-size: 0.95rem;
  z-index: 1100;
  animation: toastIn 0.4s ease, toastOut 0.4s ease 2.5s forwards;
  pointer-events: none;
}

.toast-success {
  background: var(--color-success);
  color: #fff;
}

.toast-error {
  background: var(--color-danger);
  color: #fff;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

@keyframes toastOut {
  from { opacity: 1; }
  to   { opacity: 0; transform: translateX(-50%) translateY(-20px); }
}

/* ----- 模态弹层 ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 900;
  animation: fadeIn 0.3s ease;
}

.modal-box {
  background: var(--color-bg-mid);
  border: 1px solid var(--color-card-border);
  border-radius: var(--radius-lg);
  padding: 2rem;
  max-width: 420px;
  width: 90%;
  text-align: center;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
  animation: scaleIn 0.3s ease;
}

.modal-box h3 {
  color: var(--color-text-bright);
  margin-bottom: 0.8rem;
}

.modal-box p {
  color: var(--color-text-dim);
  margin-bottom: 1.2rem;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.9); }
  to   { opacity: 1; transform: scale(1); }
}

/* ----- 安全小屋动画 ----- */
.safe-house {
  text-align: center;
  padding: 2rem;
  animation: houseRise 1s ease forwards;
}

.safe-house .house-icon {
  font-size: 5rem;
  display: block;
  animation: houseGlow 2s ease-in-out infinite;
}

@keyframes houseRise {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes houseGlow {
  0%, 100% { filter: drop-shadow(0 0 8px var(--color-success)); }
  50%      { filter: drop-shadow(0 0 24px var(--color-success)); }
}

/* ----- 彩虹动画 ----- */
.rainbow-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 999;
  pointer-events: none;
  animation: rainbowFade 4s ease forwards;
}

.rainbow-overlay .rainbow-text {
  font-size: 3rem;
  animation: rainbowColors 1.5s linear infinite;
}

.rainbow-overlay .encourage {
  font-size: 1.3rem;
  color: var(--color-text-bright);
  margin-top: 1rem;
}

@keyframes rainbowFade {
  0%   { opacity: 0; }
  20%  { opacity: 1; }
  80%  { opacity: 1; }
  100% { opacity: 0; }
}

@keyframes rainbowColors {
  0%   { color: #ff6b6b; }
  16%  { color: #ffa94d; }
  33%  { color: #ffd43b; }
  50%  { color: #69db7c; }
  66%  { color: #4dabf7; }
  83%  { color: #9775fa; }
  100% { color: #ff6b6b; }
}

/* ----- 答错动画 (小演示) ----- */
.correct-demo {
  background: rgba(76, 175, 132, 0.12);
  border: 1px solid var(--color-success);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-top: 0.8rem;
  animation: demoSlideIn 0.5s ease;
}

.correct-demo .demo-icon {
  font-size: 2rem;
  display: inline-block;
  animation: demoBounce 0.6s ease;
}

@keyframes demoSlideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes demoBounce {
  0%   { transform: scale(0); }
  60%  { transform: scale(1.2); }
  100% { transform: scale(1); }
}

/* ----- 清单物品卡片 ----- */
.checklist-item {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  padding: 0.8rem 1rem;
  margin-bottom: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-card-border);
  background: var(--color-card-bg);
  cursor: pointer;
  transition: all var(--transition-fast);
  user-select: none;
}

.checklist-item:hover {
  background: var(--color-card-hover);
  border-color: var(--color-primary);
}

.checklist-item.selected-good {
  border-color: var(--color-success);
  background: rgba(76, 175, 132, 0.12);
}

.checklist-item.selected-bad {
  border-color: var(--color-danger);
  background: rgba(224, 85, 106, 0.12);
}

.checklist-item .item-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.checklist-item .item-info {
  flex: 1;
}

.checklist-item .item-name {
  font-weight: 600;
  color: var(--color-text-bright);
}

.checklist-item .item-desc {
  font-size: 0.8rem;
  color: var(--color-text-dim);
  margin-top: 0.15rem;
}

/* ----- 分数显示 ----- */
.score-display {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 1rem;
  border-radius: 20px;
  background: var(--color-card-bg);
  border: 1px solid var(--color-card-border);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--color-accent);
}



