:root {
  --bg: #f7f8fa;
  --panel: #ffffff;
  --muted: #6b7280;
  --text: #111827;
  --accent: #2563eb;
  --accent-2: #22c55e;
  --ok: #16a34a;
  --warn: #f59e0b;
  --danger: #ef4444;
  --bubble-me: #e8f0ff;
  --bubble-you: #f3f4f6;
  --shadow: 0 8px 24px rgba(0,0,0,.08);
  --radius: 14px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
}

#app { min-height: 100dvh; display: flex; flex-direction: column; }

.app-header {
  position: sticky; top: 0; z-index: 5;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(17,24,39,.08);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 12px 16px; }
.brand-logo { width: 36px; height: 36px; object-fit: contain; border-radius: 8px; box-shadow: var(--shadow); }
.brand-title { font-weight: 700; letter-spacing: .2px; }
.brand-sub { font-size: 12px; color: var(--muted); }

.screen { display: none; padding: 16px; max-width: 780px; width: 100%; margin: 0 auto; }
.screen.active { display: block; }

.home-hero { text-align: center; margin: 24px 0 12px; }
.hero-sub { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
.progress-wrap { display:flex; align-items:center; gap:10px; justify-content:center; }
.trophy{font-size:18px}
.progress-bar{position:relative; width:240px; height:12px; border-radius:999px; background:#eef2f7; border:1px solid rgba(17,24,39,.08); overflow:hidden}
.progress-bar span{position:absolute; inset:0 0 0 0; width:0; background:linear-gradient(90deg,var(--accent),var(--accent-2));}
.progress-text{color:var(--muted); font-size:12px}

.level-grid { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
@media (min-width: 640px) { .level-grid { grid-template-columns: 1fr 1fr; } }
.level-card {
  text-align: left; padding: 16px; border-radius: var(--radius);
  background: #ffffff;
  border: 1px solid rgba(17,24,39,.08);
  color: var(--text); cursor: pointer; transition: .2s transform ease, .2s border-color ease, .2s box-shadow ease;
}
.level-card:hover { transform: translateY(-2px); border-color: rgba(17,24,39,.16); box-shadow: var(--shadow); }
.level-card.fancy{ position:relative; display:grid; grid-template-rows:auto auto auto; gap:6px }
.badge{ position:absolute; left:10px; top:10px; width:22px; height:22px; border-radius:6px; background:#eef2f7; border:1px solid rgba(17,24,39,.12); display:grid; place-items:center; font-size:12px; }
.level-cover{ width:100%; height:132px; object-fit:contain; background:#f3f4f6; border-radius:10px; border:1px solid rgba(17,24,39,.08) }
.level-name{ font-weight:700 }
.level-meta{ color:var(--muted); font-size:12px }

.play-header { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; margin-bottom: 8px; }
.btn-link {
  background: transparent; color: var(--muted); border: none; padding: 8px 10px; border-radius: 8px; cursor: pointer;
}
.btn-link:hover { color: var(--text); }
.play-title { text-align: center; color: var(--muted); font-size: 14px; }
.wallet { font-size: 13px; color: var(--muted); }

.timeline { display: grid; grid-auto-flow: column; gap: 6px; align-items: center; justify-content: start; margin: 6px 0 10px; overflow-x: auto; padding-bottom: 4px; }
.tl-item { width: 16px; height: 6px; border-radius: 4px; background: rgba(17,24,39,.08); flex: 0 0 auto; border: 1px solid rgba(17,24,39,.08); }
.tl-item.active { background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-color: rgba(255,255,255,.18); }

.steps { display: grid; gap: 10px; }
.step-card { background: var(--panel); border: 1px solid rgba(17,24,39,.08); border-left: 6px solid #c7d2fe; border-radius: var(--radius); padding: 12px; box-shadow: var(--shadow); }
.step-card .step-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.step-card .step-meta { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }
.tag { font-size: 11px; padding: 2px 6px; border-radius: 999px; border: 1px solid rgba(17,24,39,.12); background: #f3f4f6; color: var(--text); }
.tag.sys { background: #eef2ff; border-color: #c7d2fe; }
.tag.warn { background: rgba(255,204,0,.1); border-color: rgba(255,204,0,.35); color: #ffd34d; }
.tag.danger { background: rgba(255,59,48,.12); border-color: rgba(255,59,48,.45); color: #ff6b61; }
.amount { font-size: 12px; padding: 2px 6px; border-radius: 6px; }
.amount.credit { background: #ecfdf5; border: 1px solid #bbf7d0; color: #16a34a; }
.amount.debit { background: #fef2f2; border: 1px solid #fecaca; color: #dc2626; }
.step-card .step-body { color: var(--text); font-size: 14px; line-height: 1.5; }

.choice-bar { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 12px 0 4px; }
.choice-btn { padding: 12px; border-radius: 10px; border: 1px solid rgba(17,24,39,.12);
  background: #ffffff; color: var(--text); cursor: pointer; text-align: center; transition: .2s ease;
}
.choice-btn:hover { background: #f9fafb; }

.footer-cta { display: flex; justify-content: center; margin-top: 6px; }
.btn-primary { padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(17,24,39,.08);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: white; cursor: pointer; box-shadow: var(--shadow);
}
.btn-secondary { padding: 12px 16px; border-radius: 10px; border: 1px solid rgba(17,24,39,.12); background: #ffffff; color: var(--text); cursor: pointer; }

.result-card, .report-card {
  background: var(--panel); border: 1px solid rgba(17,24,39,.08); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; max-width: 640px; margin: 24px auto 0;
}
.ip-hero { width: 64px; height: 64px; object-fit: contain; border-radius: 12px; box-shadow: var(--shadow); margin-bottom: 8px; }
.ip-hero.small { width: 48px; height: 48px; }
.result-summary { color: var(--muted); }
.result-actions, .report-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.report-list { margin: 10px 0 16px; color: var(--muted); }

/* 呼小鹰提醒 */
.assist-toast { position: fixed; inset: 0; display: none; align-items: flex-start; justify-content: center; padding: 16px; z-index: 50; }
.assist-toast.show { display: flex; }
.assist-card { display: flex; gap: 10px; align-items: center; max-width: 720px; width: 100%;
  background: #ffffff; border: 1px solid rgba(17,24,39,.12); border-left: 6px solid var(--warn);
  padding: 10px 12px; border-radius: 12px; box-shadow: var(--shadow); animation: slideIn .24s ease;
}
.assist-card.danger { border-left-color: var(--danger); background: #fff5f5; }
.assist-avatar { width: 36px; height: 36px; border-radius: 8px; object-fit: contain; }
.assist-title { font-weight: 700; margin-bottom: 2px; }
.assist-desc { color: var(--muted); font-size: 14px; }

@keyframes slideIn { from { transform: translateY(-12px); opacity: .0; } to { transform: translateY(0); opacity: 1; } }
@keyframes typing { from { width: 0; } to { width: 100%; } }

/* Typing indicator */
.typing { display: inline-flex; gap: 4px; align-items: center; color: var(--muted); font-size: 12px; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); opacity: .5; animation: blink 1s infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 0%, 80%, 100% { opacity: .2 } 40% { opacity: 1 } }

/* Intro */
.intro-wrap{ display:grid; gap:12px; justify-items:center; margin-top:28px }
.chapter-title{ font-size:18px; color:#cbd3e6 }
.chapter-name{ font-size:28px; font-weight:800 }
.collect-line{ color:var(--muted) }
.intro-start{ width:72px; height:72px; border-radius:999px; border:2px solid rgba(255,255,255,.2); background:transparent; color:var(--text); font-size:28px; cursor:pointer }
.intro-tip{ color:var(--muted) }

/* Scene */
.btn-home{ position:fixed; left:12px; top:64px; z-index:2; background:#ffffff; border:1px solid rgba(17,24,39,.12); color:var(--text); padding:6px 8px; border-radius:8px }
.collect-float{ position:fixed; left:12px; top:110px; z-index:2; color:var(--muted); }
.scene-stage{ position:relative; height:62dvh; border-radius:16px; overflow:hidden; border:1px solid rgba(17,24,39,.08); box-shadow:var(--shadow); background:linear-gradient(180deg,#ffffff,#f7f8fa); }
.scene-bg{ position:absolute; inset:0; background:radial-gradient(600px 300px at 80% -10%, #dbeafe 0%, transparent 60%); opacity:.6 }
.scene-char{ position:absolute; left:50%; bottom:12px; transform:translateX(-50%); width:160px; height:160px; object-fit:contain; filter:drop-shadow(0 12px 24px rgba(0,0,0,.1)); }
.speech{ position:absolute; left:50%; transform:translateX(-50%); top:10%; display:grid; justify-items:center; }
.speech .bubble{ background:#ffffff; color:#374151; padding:10px 12px; border-radius:12px; min-width:200px; max-width:80%; box-shadow: var(--shadow); border:1px solid rgba(17,24,39,.08) }
.speech-list{ position:absolute; top:8px; left:10px; right:10px; display:grid; gap:10px; max-height:48dvh; overflow:auto; padding:6px }
.speech-item{ display:flex; }
.speech-item.you{ justify-content:flex-start }
.speech-item.me{ justify-content:flex-end }
.speech-item .bubble{ background:#ffffff; color:#374151; max-width:78%; border:1px solid rgba(17,24,39,.08) }
.speech-item.me .bubble{ background:#e8f0ff }
.speech.assist .assist-face{ width:36px; height:36px; border-radius:8px; margin-bottom:6px }
.speech.assist .bubble{ background:#fff7ed; border-color:#fed7aa }
.speech .bubble.warn{ background:#fff7ed; border-color:#fed7aa }
.choices{ display:grid; gap:10px; margin:10px 0 }
.choices .choice{ background:#ffffff; border:1px solid rgba(17,24,39,.12); border-radius:12px; padding:12px; text-align:left }
.scene-next{ display:flex; justify-content:center }

