/* ============================================================
   无影·有踪 — Style System V3.2 MOBILE-FIRST
   Full mobile optimization, refined typography & colors,
   transition backgrounds with images
   ============================================================ */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
:root {
    --bg-deepest: #0C1220; --bg-dark: #111827; --bg-card: #1a2332;
    --bg-glass: rgba(20,30,52,0.82); --bg-glass-heavy: rgba(12,18,32,0.90);
    --accent-cyan: #22d3ee; --accent-blue: #3b82f6; --accent-red: #ef4444;
    --accent-amber: #f59e0b; --accent-green: #10b981; --accent-purple: #a78bfa; --accent-pink: #f472b6;
    --text-primary: #e8ecf2; --text-secondary: #94a3b8; --text-dim: #64748b; --text-highlight: #f8fafc;
    --border-subtle: rgba(255,255,255,0.08); --border-glow: rgba(34,211,238,0.3);
    --font-serif: 'Noto Serif SC','SimSun','Songti SC',serif;
    --font-sans: 'Noto Sans SC','PingFang SC','Microsoft YaHei',sans-serif;
    --max-w: 100%; --pad: 16px;
    --ease-out-expo: cubic-bezier(0.16,1,0.3,1);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

/* ★ Mobile-first base */
html { font-size: 15px; -webkit-text-size-adjust: 100%; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* ★ iOS Safari: prevent keyboard zoom on input focus (font-size >= 16px) */
input, select, textarea { font-size: 16px !important; }
body {
    font-family: var(--font-sans); background: var(--bg-deepest); color: var(--text-primary);
    min-height: 100vh; min-height: 100dvh; overflow: hidden;
    -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
    touch-action: manipulation; user-select: none; -webkit-user-select: none;
}
img { max-width: 100%; height: auto; display: block; }
button { font-family: var(--font-sans); -webkit-tap-highlight-color: transparent; }

/* ★ 全局噪点纹理 */
.noise-overlay {
    position: fixed; inset: 0; z-index: 9999; pointer-events: none;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 200px 200px;
    opacity: 0.035;
    mix-blend-mode: overlay;
}

.screen {
    position: fixed; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    opacity: 0; pointer-events: none; transition: opacity 0.5s var(--ease-out-expo); z-index: 1;
}
.screen.active { opacity: 1; pointer-events: auto; z-index: 10; }

/* ============================================================ SPLASH ============================================================ */
#splash-screen { background: var(--bg-deepest); overflow: hidden; }
.splash-bg-image { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.3; z-index: 0; }
.splash-bg-grid {
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(34,211,238,0.025) 1px,transparent 1px),linear-gradient(90deg,rgba(34,211,238,0.025) 1px,transparent 1px);
    background-size: 36px 36px; animation: gridDrift 25s linear infinite; z-index: 1;
}
@keyframes gridDrift { to { transform: translate(36px,36px); } }
.splash-content { position: relative; text-align: center; padding: 0 24px; z-index: 2; width: 100%; max-width: 420px; }
.splash-emblem { font-size: 3rem; margin-bottom: 0.8rem; animation: emblemPulse 3s ease-in-out infinite; filter: drop-shadow(0 0 16px rgba(34,211,238,0.35)); }
@keyframes emblemPulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.05); } }

/* ★ Mobile-optimized title */
.splash-title {
    font-family: var(--font-serif); font-size: 2.4rem; font-weight: 900;
    letter-spacing: 0.12em; margin-bottom: 0.3rem;
    color: var(--text-highlight);
    text-shadow: 0 0 24px rgba(34,211,238,0.3), 0 0 50px rgba(34,211,238,0.12);
    animation: titleGlow 4s ease-in-out infinite;
}
@keyframes titleGlow { 0%,100% { text-shadow: 0 0 24px rgba(34,211,238,0.3); } 50% { text-shadow: 0 0 36px rgba(34,211,238,0.5), 0 0 70px rgba(34,211,238,0.2); } }
.title-char { display: inline-block; animation: charReveal 0.8s var(--ease-out-expo) calc(var(--i)*0.1s) both; }
@keyframes charReveal { from { opacity: 0; transform: translateY(24px) scale(0.85); } to { opacity: 1; transform: translateY(0) scale(1); } }
.title-dot { display: inline-block; color: var(--accent-cyan); margin: 0 0.08em; animation: charReveal 0.8s var(--ease-out-expo) 0.15s both; }
.splash-subtitle { font-size: 0.7rem; font-weight: 300; letter-spacing: 0.45em; color: var(--text-dim); text-transform: uppercase; margin-bottom: 1.2rem; }
.splash-tagline { font-family: var(--font-serif); font-size: 0.95rem; color: var(--text-secondary); letter-spacing: 0.08em; margin-bottom: 2rem; opacity: 0; animation: fadeInUp 0.8s var(--ease-out-expo) 0.5s both; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.splash-hint { font-size: 0.68rem; color: var(--text-dim); margin-top: 1rem; letter-spacing: 0.05em; }
.splash-settings-btn {
    position: absolute; top: max(12px, var(--safe-top)); right: 12px; z-index: 5;
    width: 38px; height: 38px; border-radius: 50%;
    background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle);
    font-size: 0.9rem; cursor: pointer; color: var(--text-secondary);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease;
}
.splash-settings-btn:active { background: rgba(34,211,238,0.12); border-color: var(--accent-cyan); }
.splash-scan-line { position: absolute; left: 0; right: 0; height: 2px; background: linear-gradient(90deg,transparent,var(--accent-cyan),transparent); opacity: 0.12; animation: scanDown 6s linear infinite; z-index: 3; }
@keyframes scanDown { 0% { top: -2px; } 100% { top: 100%; } }

/* ★ Equal-width buttons with mobile touch targets */
.splash-buttons { display: flex; flex-direction: column; align-items: center; gap: 10px; width: 100%; }
.splash-btn {
    position: relative; display: flex; align-items: center; justify-content: center; flex-direction: column;
    width: 100%; max-width: 260px; min-height: 48px; padding: 13px 0;
    font-family: var(--font-sans); font-size: 0.92rem; font-weight: 700; letter-spacing: 0.1em;
    border: none; border-radius: 14px; cursor: pointer; overflow: hidden;
    transition: all 0.25s var(--ease-out-expo);
}
.splash-btn:active { transform: scale(0.96); }
.splash-btn-primary { color: #fff; background: linear-gradient(135deg,#2563eb,var(--accent-cyan)); box-shadow: 0 4px 20px rgba(34,211,238,0.2); }
.splash-btn-secondary { color: var(--accent-cyan); background: rgba(34,211,238,0.06); border: 1.5px solid rgba(34,211,238,0.35) !important; }
.splash-btn-tertiary { color: var(--text-secondary); background: rgba(255,255,255,0.03); border: 1.5px solid var(--border-subtle) !important; }
.splash-btn-tertiary:active { border-color: var(--accent-amber) !important; color: var(--accent-amber); }
.btn-continue-hint { font-size: 0.58rem; color: var(--text-dim); font-weight: 400; letter-spacing: 0; margin-top: 1px; }
.btn-shine { position: absolute; top: -50%; left: -50%; width: 200%; height: 200%; background: linear-gradient(120deg,transparent 30%,rgba(255,255,255,0.1) 50%,transparent 70%); animation: shine 3.5s ease-in-out infinite; }
@keyframes shine { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
.pulse-glow { animation: pulseGlow 2.5s ease-in-out infinite; }
@keyframes pulseGlow { 0%,100% { box-shadow: 0 4px 20px rgba(34,211,238,0.2); } 50% { box-shadow: 0 4px 35px rgba(34,211,238,0.4); } }

/* Shared primary button */
.btn-primary {
    position: relative; display: inline-flex; align-items: center; justify-content: center;
    padding: 14px 44px; min-height: 48px;
    font-family: var(--font-sans); font-size: 1rem; font-weight: 700; letter-spacing: 0.12em;
    color: #fff; background: linear-gradient(135deg,#2563eb,var(--accent-cyan)); border: none; border-radius: 50px;
    cursor: pointer; overflow: hidden; transition: transform 0.25s var(--ease-out-expo); box-shadow: 0 4px 20px rgba(34,211,238,0.2);
}
.btn-primary:active { transform: scale(0.96); }
.btn-primary:disabled { opacity: 0.35; cursor: not-allowed; }

/* ============================================================ PROFILE ============================================================ */
#profile-screen { background: var(--bg-deepest); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; }
.profile-content { position: relative; z-index: 2; width: 100%; max-width: 400px; padding: calc(20px + var(--safe-top)) 20px 24px; text-align: center; display: flex; flex-direction: column; justify-content: center; min-height: 100vh; min-height: 100dvh; box-sizing: border-box; }
.profile-header { margin-bottom: 0.6rem; }
.profile-icon { display: none; }
.profile-title { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 900; color: var(--text-highlight); margin-bottom: 0.15rem; }
.profile-subtitle { font-size: 0.6rem; letter-spacing: 0.35em; color: var(--text-dim); text-transform: uppercase; }

.profile-preview {
    width: 200px; height: 260px; margin: 0 auto 0.8rem; border-radius: 18px; overflow: hidden;
    border: 2.5px solid rgba(34,211,238,0.22); box-shadow: 0 10px 40px rgba(0,0,0,0.55), 0 0 20px rgba(34,211,238,0.08);
    transition: border-color 0.4s ease;
}
.profile-preview img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s var(--ease-out-expo); }

.profile-form { display: flex; flex-direction: column; gap: 12px; }
.form-group { text-align: left; }
.form-label { font-size: 0.75rem; font-weight: 700; color: var(--accent-cyan); letter-spacing: 0.08em; margin-bottom: 5px; display: block; }
.form-input {
    width: 100%; padding: 12px 14px; font-family: var(--font-sans); font-size: 1rem; color: var(--text-primary);
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; outline: none;
    transition: border-color 0.3s ease; -webkit-appearance: none;
}
.form-input:focus { border-color: var(--accent-cyan); box-shadow: 0 0 10px rgba(34,211,238,0.1); }
.form-input::placeholder { color: var(--text-dim); }
.gender-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-card { padding: 20px 14px; background: var(--bg-card); border: 2px solid var(--border-subtle); border-radius: 14px; text-align: center; cursor: pointer; transition: all 0.25s var(--ease-out-expo); min-height: 70px; }
.gender-card.selected { border-color: var(--accent-cyan); background: rgba(34,211,238,0.06); }
.gender-icon { font-size: 2.6rem; margin-bottom: 6px; }
.gender-label { font-size: 0.92rem; font-weight: 700; color: var(--text-primary); }

/* ============================================================ CHAR INTRO ============================================================ */
#char-intro-screen { background: var(--bg-deepest); }
.char-intro-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.12; z-index: 0; }
.char-intro-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom,rgba(5,8,16,0.75),rgba(5,8,16,0.25) 35%,rgba(5,8,16,0.8) 75%,var(--bg-deepest)); z-index: 1; }
.char-intro-content { position: relative; z-index: 2; width: 100%; max-width: 400px; text-align: center; padding: 0 20px calc(80px + var(--safe-bottom)); animation: fadeInUp 0.5s var(--ease-out-expo); }
.char-intro-portrait { width: 220px; height: 290px; margin: 0 auto 0.8rem; border-radius: 18px; overflow: hidden; border: 2.5px solid rgba(34,211,238,0.22); box-shadow: 0 12px 45px rgba(0,0,0,0.6), 0 0 20px rgba(34,211,238,0.06); }
.char-intro-portrait img { width: 100%; height: 100%; object-fit: cover; }
.char-intro-name { font-family: var(--font-serif); font-size: 1.4rem; font-weight: 900; color: var(--text-highlight); margin-bottom: 0.15rem; letter-spacing: 0.05em; }
.char-intro-role { font-size: 0.75rem; color: var(--accent-cyan); letter-spacing: 0.12em; margin-bottom: 0.6rem; }
.char-intro-desc { font-size: 0.82rem; line-height: 1.75; color: var(--text-secondary); text-align: center; padding: 12px 14px; background: var(--bg-glass); border: 1px solid var(--border-subtle); border-radius: 12px; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.char-intro-next { position: absolute; bottom: max(30px, calc(12px + var(--safe-bottom))); left: 50%; transform: translateX(-50%); z-index: 5; padding: 12px 32px; min-height: 46px; font-family: var(--font-sans); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-primary); background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.25); border-radius: 50px; cursor: pointer; transition: all 0.25s ease; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.char-intro-next:active { background: rgba(34,211,238,0.18); transform: translateX(-50%) scale(0.96); }

/* ============================================================ TRANSITION ============================================================ */
#transition-screen { background: var(--bg-deepest); overflow: hidden; }
.transition-bg-image { position: absolute; inset: -10%; background-size: cover; background-position: center; opacity: 0; z-index: 0; transition: opacity 0.8s ease; animation: kenBurns 8s ease-in-out infinite alternate; }
@keyframes kenBurns { 0% { transform: scale(1) translate(0,0); } 100% { transform: scale(1.08) translate(-2%, -1%); } }
.transition-bg { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%,rgba(34,211,238,0.04),transparent 60%); z-index: 1; }
.transition-scan { position: absolute; left: 0; right: 0; height: 80px; background: linear-gradient(transparent,rgba(34,211,238,0.05),transparent); animation: scanDown 4s linear infinite; z-index: 2; }
.transition-content { text-align: center; z-index: 3; padding: 0 24px; }
.transition-chapter { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.35em; text-transform: uppercase; color: var(--accent-cyan); margin-bottom: 0.8rem; opacity: 0; animation: fadeInUp 0.7s var(--ease-out-expo) 0.2s both; }
.transition-title { font-family: var(--font-serif); font-size: 1.8rem; font-weight: 900; color: var(--text-highlight); letter-spacing: 0.08em; margin-bottom: 1.2rem; opacity: 0; animation: fadeInUp 0.7s var(--ease-out-expo) 0.45s both; text-shadow: 0 2px 20px rgba(0,0,0,0.5); }
.transition-time { font-size: 0.85rem; color: var(--accent-amber); font-weight: 500; opacity: 0; animation: fadeInUp 0.7s var(--ease-out-expo) 0.7s both; }

/* ============================================================ GAME SCREEN ============================================================ */
#game-screen { justify-content: flex-start; background: var(--bg-deepest); overflow: hidden; }
.scene-bg { position: absolute; inset: 0; background-size: cover; background-position: center top; opacity: 0; transition: opacity 1s ease; z-index: 0; }
.scene-bg.active { opacity: 0.2; }
.scene-bg-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom,rgba(5,8,16,0.55) 0%,rgba(5,8,16,0.35) 15%,rgba(5,8,16,0.65) 45%,rgba(5,8,16,0.92) 75%,var(--bg-deepest) 100%); z-index: 1; }

.settings-btn {
    position: absolute; top: max(8px, var(--safe-top)); right: 10px; z-index: 15;
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(0,0,0,0.35); border: 1px solid var(--border-subtle); font-size: 0.75rem;
    cursor: pointer; color: var(--text-secondary); display: flex; align-items: center; justify-content: center;
    transition: all 0.25s ease; backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.settings-btn:active { background: rgba(34,211,238,0.12); }

/* ★ Redesigned Stat Panel — mobile compact */
/* ★ Dim3: Thick glass top-highlight */
.stats-panel {
    position: relative; width: 100%;
    display: grid; grid-template-columns: 1fr 1fr; gap: 4px;
    padding: 6px 10px 8px; padding-top: max(6px, var(--safe-top));
    background: var(--bg-glass-heavy); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-subtle); z-index: 20;
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.08);
}
.stat-item {
    display: flex; align-items: center; gap: 6px; padding: 5px 7px;
    background: rgba(255,255,255,0.015); border-radius: 8px;
    border: 1px solid rgba(255,255,255,0.025); position: relative;
}
.stat-icon-ring { width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.7rem; flex-shrink: 0; }
.stat-icon-ring.time  { background: rgba(245,158,11,0.1); border: 1.5px solid rgba(245,158,11,0.2); }
.stat-icon-ring.panic { background: rgba(239,68,68,0.1); border: 1.5px solid rgba(239,68,68,0.2); }
.stat-icon-ring.alert { background: rgba(245,158,11,0.1); border: 1.5px solid rgba(245,158,11,0.2); }
.stat-icon-ring.truth { background: rgba(59,130,246,0.1); border: 1.5px solid rgba(59,130,246,0.2); }
.stat-info { flex: 1; min-width: 0; }
.stat-label-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.stat-name { font-size: 0.72rem; color: var(--text-secondary); font-weight: 600; letter-spacing: 0.03em; }
.stat-value { font-size: 0.88rem; font-weight: 800; color: var(--text-highlight); font-variant-numeric: tabular-nums; transition: transform 0.3s ease; display: inline-block; }
.stat-value.changed { animation: statPop 0.4s var(--ease-out-expo); }
@keyframes statPop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.stat-bar-track { width: 100%; height: 3px; background: rgba(255,255,255,0.05); border-radius: 2px; overflow: hidden; }
.stat-bar-fill { height: 100%; border-radius: 2px; transition: width 0.7s var(--ease-out-expo), background 0.5s ease; }
[data-stat="time"]  .stat-bar-fill { background: linear-gradient(90deg,var(--accent-amber),#fcd34d); }
[data-stat="panic"] .stat-bar-fill { background: linear-gradient(90deg,#dc2626,#f87171); }
[data-stat="alert"] .stat-bar-fill { background: linear-gradient(90deg,var(--accent-amber),var(--accent-red)); }
[data-stat="truth"] .stat-bar-fill { background: linear-gradient(90deg,var(--accent-blue),var(--accent-cyan)); }

.stat-delta { position: absolute; top: -2px; left: 50%; transform: translateX(-50%); font-size: 0.7rem; font-weight: 900; white-space: nowrap; pointer-events: none; z-index: 5; opacity: 0; text-shadow: 0 1px 6px currentColor; }
.stat-delta.show { animation: deltaFloat 2s var(--ease-out-expo) forwards; }
/* ★ Dim4: RPG-style upward float */
@keyframes deltaFloat { 0% { opacity: 0; transform: translateX(-50%) translateY(5px); } 15% { opacity: 1; transform: translateX(-50%) translateY(0); } 60% { opacity: 1; } 100% { opacity: 0; transform: translateX(-50%) translateY(-22px); } }
.stat-delta.good { color: var(--accent-green); } .stat-delta.bad { color: var(--accent-red); } .stat-delta.warn { color: var(--accent-amber); } .stat-delta.info { color: var(--accent-cyan); }

/* ★ Dim5: Critical pulse animation for danger states */
.stat-item.critical-pulse { animation: criticalPulse 0.8s ease-in-out infinite; }
@keyframes criticalPulse {
    0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
    25% { box-shadow: 0 0 12px 2px rgba(239,68,68,0.35), inset 0 0 8px rgba(239,68,68,0.1); }
    50% { box-shadow: 0 0 6px 1px rgba(245,158,11,0.2); }
    75% { box-shadow: 0 0 14px 3px rgba(239,68,68,0.4), inset 0 0 10px rgba(239,68,68,0.12); }
}
.stat-item.critical-pulse .stat-value { animation: critValFlicker 0.8s ease-in-out infinite; }
@keyframes critValFlicker { 0%,100% { color: var(--accent-red); } 50% { color: #fca5a5; } }

/* ★ 线索 FAB 悬浮按钮 */
/* ★ Settings FAB */
.settings-fab {
    position: absolute; bottom: calc(78px + var(--safe-bottom)); right: 14px; z-index: 25;
    width: 40px; height: 40px; border-radius: 50%;
    background: var(--bg-glass-heavy); border: 1.5px solid rgba(255,255,255,0.1);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 0.95rem; color: rgba(255,255,255,0.5);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
    transition: all 0.25s ease;
}
.settings-fab:active { transform: scale(0.92); border-color: var(--accent-cyan); color: var(--accent-cyan); }
.settings-fab-panel {
    position: absolute; bottom: calc(124px + var(--safe-bottom)); right: 14px; z-index: 26;
    background: var(--bg-glass-heavy); border: 1px solid rgba(34,211,238,0.15);
    border-radius: 12px; padding: 6px;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
    display: flex; flex-direction: column; gap: 4px;
    animation: fadeInUp 0.2s ease;
}
.settings-fab-option {
    padding: 10px 16px; border: none; border-radius: 8px;
    background: transparent; color: var(--text-primary);
    font-family: var(--font-sans); font-size: 0.78rem; font-weight: 600;
    text-align: left; cursor: pointer; white-space: nowrap;
    transition: background 0.2s ease;
}
.settings-fab-option:active { background: rgba(34,211,238,0.12); }

.clue-fab {
    position: absolute; bottom: calc(20px + var(--safe-bottom)); right: 14px; z-index: 25;
    width: 48px; height: 48px; border-radius: 50%;
    background: var(--bg-glass-heavy); border: 1.5px solid rgba(34,211,238,0.15);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.1rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4), inset 0 1px 1px rgba(255,255,255,0.08);
    transition: all 0.25s ease;
}
.clue-fab:active { transform: scale(0.92); border-color: var(--accent-cyan); }
.clue-fab-icon { pointer-events: none; }
.clue-fab-badge {
    position: absolute; top: -3px; right: -3px;
    min-width: 18px; height: 18px; border-radius: 10px;
    background: var(--accent-cyan); color: var(--bg-deepest);
    font-size: 0.6rem; font-weight: 900; display: flex; align-items: center; justify-content: center;
    padding: 0 4px; box-shadow: 0 2px 8px rgba(34,211,238,0.3);
}
/* FAB 收到线索时的脉冲 */
.clue-fab.pulse { animation: fabPulse 0.5s ease; }
@keyframes fabPulse {
    0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,211,238,0.4); }
    50% { transform: scale(1.15); box-shadow: 0 0 20px 6px rgba(34,211,238,0.2); }
    100% { transform: scale(1); box-shadow: 0 4px 20px rgba(0,0,0,0.4); }
}

/* ★ 线索 Bottom Sheet */
.clue-sheet-mask {
    position: fixed; inset: 0; z-index: 50;
    background: rgba(0,0,0,0.4);
    animation: overlayFadeIn 0.2s ease;
}
.clue-sheet {
    position: absolute; bottom: 0; left: 0; right: 0; z-index: 51;
    max-height: 60vh; background: rgba(10,15,28,0.96);
    border-top: 1px solid rgba(34,211,238,0.1);
    border-radius: 20px 20px 0 0;
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    transform: translateY(100%);
    transition: transform 0.4s var(--ease-out-expo);
    display: flex; flex-direction: column;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.5);
}
.clue-sheet.open { transform: translateY(0); }
.clue-sheet-handle {
    width: 36px; height: 4px; border-radius: 3px;
    background: rgba(255,255,255,0.15); margin: 10px auto 0; flex-shrink: 0;
}
.clue-sheet-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 12px 18px 8px; font-size: 0.85rem; font-weight: 700;
    color: var(--text-highlight); letter-spacing: 0.03em; flex-shrink: 0;
}
.clue-sheet-close {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.06); border: 1px solid var(--border-subtle);
    color: var(--text-secondary); font-size: 0.7rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.clue-sheet-list {
    flex: 1; overflow-y: auto; padding: 4px 14px calc(16px + var(--safe-bottom));
    -webkit-overflow-scrolling: touch;
}
.clue-item { padding: 8px 10px; margin-bottom: 6px; background: rgba(34,211,238,0.04); border-left: 3px solid var(--accent-cyan); border-radius: 0 8px 8px 0; font-size: 0.75rem; color: var(--text-secondary); line-height: 1.6; animation: clueSlideIn 0.4s var(--ease-out-expo); }
.clue-item .clue-name { font-weight: 700; color: var(--accent-cyan); display: block; margin-bottom: 1px; font-size: 0.78rem; }
@keyframes clueSlideIn { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }

/* ★ 线索飞入动画 */
.clue-toast-flying {
    transition: transform 0.6s cubic-bezier(0.2, 0.9, 0.3, 1.2), opacity 0.6s ease, width 0.6s ease, height 0.6s ease;
}

/* Clue Toast */
.clue-toast { position: absolute; top: 100px; left: 50%; transform: translateX(-50%); z-index: 50; pointer-events: none; width: calc(100% - 40px); max-width: 360px; }
.clue-toast-card { display: flex; align-items: center; gap: 8px; padding: 10px 14px; background: rgba(34,211,238,0.1); border: 1.5px solid rgba(34,211,238,0.25); border-radius: 12px; backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 6px 24px rgba(0,0,0,0.4); animation: toastIn 0.4s var(--ease-out-expo),toastOut 0.4s ease 2.5s forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
.clue-toast-icon { font-size: 1.1rem; } .clue-toast-text { font-size: 0.78rem; font-weight: 700; color: var(--accent-cyan); }

/* Intel Flash Card */
.intel-flash { position: absolute; left: 50%; transform: translateX(-50%); top: 105px; width: calc(100% - 24px); max-width: 380px; z-index: 30; pointer-events: none; }
.intel-card { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 11px; background: rgba(15,21,37,0.93); border: 1px solid rgba(239,68,68,0.25); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); box-shadow: 0 3px 24px rgba(0,0,0,0.55); animation: intelSlideIn 0.4s var(--ease-out-expo),intelFadeOut 0.4s ease 2s forwards; position: relative; overflow: hidden; }
@keyframes intelSlideIn { from { opacity: 0; transform: translateY(-16px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes intelFadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-8px); } }
.intel-card::before { content: 'CLASSIFIED'; position: absolute; top: 50%; left: 50%; transform: translate(-50%,-50%) rotate(-15deg); font-size: 2rem; font-weight: 900; letter-spacing: 0.2em; color: rgba(239,68,68,0.04); pointer-events: none; }
.intel-avatar { width: 42px; height: 42px; border-radius: 50%; background: var(--bg-dark); border: 2px solid rgba(239,68,68,0.25); display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; overflow: hidden; }
.intel-avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.intel-info { flex: 1; } .intel-name { font-family: var(--font-serif); font-size: 0.95rem; font-weight: 900; color: var(--text-highlight); margin-bottom: 1px; } .intel-title { font-size: 0.65rem; color: var(--accent-red); letter-spacing: 0.08em; font-weight: 600; }
.intel-badge { font-size: 0.5rem; padding: 2px 7px; border-radius: 3px; background: rgba(239,68,68,0.12); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.18); font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; animation: badgePulse 0.5s ease 0.3s both; }
@keyframes badgePulse { 0% { opacity: 0; transform: scale(0.8); } 50% { transform: scale(1.08); } 100% { opacity: 1; transform: scale(1); } }

/* Scroll / Scene */
.game-scroll-content {
    position: relative; width: 100%; flex: 1; overflow-y: auto; overflow-x: hidden;
    -webkit-overflow-scrolling: touch; z-index: 10;
    /* ★ 边缘消散 */
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 4%, black 96%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, black 4%, black 96%, transparent 100%);
}
.game-scroll-content::-webkit-scrollbar { width: 2px; } .game-scroll-content::-webkit-scrollbar-track { background: transparent; } .game-scroll-content::-webkit-scrollbar-thumb { background: rgba(34,211,238,0.3); border-radius: 2px; }
.scene-visual { width: 100%; margin-bottom: 0; }
.scene-image-wrap { position: relative; width: 100%; overflow: hidden; background: var(--bg-card); border-bottom: 1px solid var(--border-subtle); }
.scene-image-wrap img { display: block; width: 100%; height: auto; max-height: 50vw; object-fit: cover; animation: sceneReveal 0.8s var(--ease-out-expo); }
.scene-image-wrap video { display: block; width: 100%; max-height: 50vw; object-fit: cover; }
.scene-image-wrap::after { content: ''; position: absolute; bottom: 0; left: 0; right: 0; height: 50px; background: linear-gradient(transparent,var(--bg-deepest)); pointer-events: none; }
@keyframes sceneReveal { from { opacity: 0; transform: scale(1.04); } to { opacity: 1; transform: scale(1); } }
.scene-image-placeholder { width: 100%; aspect-ratio: 16/9; background: var(--bg-card); border: 1.5px dashed rgba(255,255,255,0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-dim); font-size: 0.75rem; }
.scene-image-placeholder .placeholder-icon { font-size: 1.6rem; opacity: 0.4; } .scene-image-placeholder .placeholder-label { font-size: 0.65rem; opacity: 0.5; }
.scene-visual-caption { padding: 6px 14px; font-size: 0.68rem; color: var(--text-dim); text-align: center; font-style: italic; letter-spacing: 0.03em; }

/* Narrative */
.narrative-area { width: 100%; padding: 12px 14px 0; }
.chapter-header { text-align: center; margin-bottom: 1rem; padding-bottom: 0.8rem; border-bottom: 1px solid var(--border-subtle); }
.chapter-header .ch-label { font-size: 0.65rem; letter-spacing: 0.25em; color: var(--accent-cyan); text-transform: uppercase; display: block; margin-bottom: 0.2rem; font-weight: 600; }
.chapter-header .ch-title { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 900; color: var(--text-highlight); letter-spacing: 0.05em; }

/* ★ Dialogue — Mobile-optimized font sizes */
.dialogue-container { display: flex; flex-direction: column; gap: 12px; padding-bottom: 10px; }
.dialogue-entry { display: flex; gap: 8px; animation: msgAppear 0.5s var(--ease-out-expo); }
@keyframes msgAppear { from { opacity: 0; transform: translateY(16px) scale(0.97); } to { opacity: 1; transform: translateY(0) scale(1); } }
.dialogue-entry.narrator { flex-direction: column; }
/* ★ 旁白：电影字幕式沉浸留白 */
.dialogue-entry.narrator .dialogue-text {
    background: transparent; border-left: none; border: none; padding: 0;
    font-family: var(--font-serif); font-size: 0.88rem; line-height: 2;
    color: var(--text-secondary); font-weight: 500; letter-spacing: 0.08em; text-align: center;
    border-radius: 0; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none;
    margin: 6px 8px;
}
.dialogue-entry.character { flex-direction: row; align-items: flex-start; }
.dialogue-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: var(--bg-card);
    border: 1.5px solid var(--border-subtle); display: flex; align-items: center; justify-content: center;
    font-size: 1rem; flex-shrink: 0; overflow: hidden; cursor: pointer;
    transition: border-color 0.25s ease;
}
.dialogue-avatar:active { border-color: var(--accent-cyan); }
.dialogue-avatar img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; border-radius: 50%; }
.dialogue-avatar.first-meet { animation: firstMeetGlow 1.2s ease-out; }
@keyframes firstMeetGlow { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,0.45); } 50% { box-shadow: 0 0 16px 3px rgba(239,68,68,0.25); } 100% { box-shadow: none; } }
.dialogue-bubble { flex: 1; min-width: 0; }
.dialogue-name { font-size: 0.7rem; font-weight: 700; margin-bottom: 2px; letter-spacing: 0.04em; }
.dialogue-name.shenlan { color: var(--accent-pink); } .dialogue-name.zhoujing { color: #60a5fa; } .dialogue-name.linxu { color: #34d399; } .dialogue-name.player { color: var(--accent-cyan); } .dialogue-name.superior { color: var(--accent-amber); }
/* ★ 连续发言气泡合并 */
.dialogue-entry.consecutive { margin-top: -4px; }
.dialogue-entry.consecutive .dialogue-avatar { visibility: hidden; width: 40px; height: 0; margin: 0; }
.dialogue-entry.consecutive .dialogue-name { display: none; }
/* ★ Dim3: Glass highlight + asymmetric bubbles */
.dialogue-text {
    background: var(--bg-glass); padding: 8px 11px; border-radius: 10px;
    font-size: 0.86rem; line-height: 1.7; color: var(--text-primary);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
}
/* ★ Dim3: Asymmetric bubble for character speech — tail points left */
.dialogue-entry.character .dialogue-text {
    border-radius: 3px 12px 12px 12px;
}
/* ★ 主角气泡靠右 — 类似微信聊天布局 */
.dialogue-entry.character.player-side { flex-direction: row-reverse; }
.dialogue-entry.character.player-side .dialogue-text {
    border-radius: 12px 3px 12px 12px;
    background: rgba(34,211,238,0.06); border-color: rgba(34,211,238,0.12);
}
.dialogue-entry.character.player-side .dialogue-bubble { text-align: right; }
.dialogue-entry.character.player-side .dialogue-name { text-align: right; }
.dialogue-entry.system-msg { justify-content: center; }
/* ★ Dim3: CRT glitch text-shadow on system messages */
.dialogue-entry.system-msg .dialogue-text {
    background: linear-gradient(135deg,rgba(239,68,68,0.08),rgba(245,158,11,0.08));
    border: 1px solid rgba(239,68,68,0.18); border-radius: 8px; text-align: center;
    font-size: 0.8rem; font-weight: 700; color: var(--accent-amber); padding: 9px 16px;
    text-shadow: 1px 0 rgba(239,68,68,0.35), -1px 0 rgba(34,211,238,0.25);
    animation: msgAppear 0.45s var(--ease-out-expo), systemFloat 3s ease-in-out infinite;
}
@keyframes systemFloat { 0%,100% { opacity: 1; transform: translateY(0); } 50% { opacity: 0.95; transform: translateY(-3px); } }
.clue-gained { display: flex; align-items: center; gap: 7px; padding: 9px 12px; background: linear-gradient(135deg,rgba(34,211,238,0.06),rgba(59,130,246,0.06)); border: 1px solid rgba(34,211,238,0.15); border-radius: 8px; animation: clueFlash 0.5s ease; margin: 3px 0; }
.clue-gained::before { content: '🔍'; font-size: 1rem; }
.clue-gained .clue-label { font-size: 0.78rem; color: var(--accent-cyan); font-weight: 700; }
@keyframes clueFlash { 0%,100% { border-color: rgba(34,211,238,0.15); } 50% { border-color: rgba(34,211,238,0.5); box-shadow: 0 0 12px rgba(34,211,238,0.1); } }
.inline-illustration { width: 100%; border-radius: 10px; overflow: hidden; margin: 5px 0; border: 1px solid var(--border-subtle); box-shadow: 0 3px 16px rgba(0,0,0,0.25); animation: sceneReveal 0.6s var(--ease-out-expo); }
.inline-illustration img { display: block; width: 100%; height: auto; max-height: 38vh; object-fit: cover; }
.inline-illustration video { display: block; width: 100%; max-height: 38vh; object-fit: cover; }
.inline-illustration .illust-caption { padding: 5px 10px; font-size: 0.65rem; color: var(--text-dim); text-align: center; background: var(--bg-card); }
.inline-illustration-placeholder { width: 100%; aspect-ratio: 16/9; border-radius: 10px; margin: 5px 0; background: var(--bg-card); border: 1.5px dashed rgba(255,255,255,0.06); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; color: var(--text-dim); }
.inline-illustration-placeholder .placeholder-icon { font-size: 1.5rem; opacity: 0.35; } .inline-illustration-placeholder .placeholder-label { font-size: 0.65rem; opacity: 0.5; }

/* ★ Choices — Mobile touch-friendly + Dim1: selected/dimmed states */
.choices-area { width: 100%; padding: 10px 14px calc(20px + var(--safe-bottom)); display: flex; flex-direction: column; gap: 8px; }
.choice-btn {
    position: relative; width: 100%; padding: 13px 14px; min-height: 52px;
    background: var(--bg-glass); border: 1.5px solid var(--border-subtle); border-radius: 12px;
    text-align: left; cursor: pointer;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1); overflow: hidden;
    animation: choiceFadeIn 0.4s var(--ease-out-expo) calc(var(--ci)*0.08s) both;
    backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
    box-shadow: inset 0 1px 1px rgba(255,255,255,0.1);
}
@keyframes choiceFadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.choice-btn:active:not(.disabled):not(.selected):not(.dimmed) { transform: scale(0.97); border-color: var(--accent-cyan); background: rgba(34,211,238,0.08); box-shadow: 0 0 24px rgba(34,211,238,0.1); }
.choice-btn.disabled { opacity: 0.3; cursor: not-allowed; filter: grayscale(0.7); }
/* ★ Dim1: Selected — cyber glow border + inner light */
.choice-btn.selected {
    border-color: var(--accent-cyan);
    background: rgba(34,211,238,0.06);
    box-shadow: inset 0 0 20px rgba(34,211,238,0.08), 0 0 18px rgba(34,211,238,0.12), inset 0 1px 1px rgba(255,255,255,0.15);
    transform: scale(1.01);
    pointer-events: none;
}
.choice-btn.selected .choice-glow { animation: choiceProcessing 0.6s ease forwards; }
@keyframes choiceProcessing { 0% { left: -100%; opacity: 1; } 100% { left: 100%; opacity: 0; } }
.choice-btn.selected .choice-label { color: #5eead4; text-shadow: 0 0 6px rgba(34,211,238,0.4); }
/* ★ Dim1: Dimmed — fade + grayscale + untouchable */
.choice-btn.dimmed {
    opacity: 0.25; filter: grayscale(0.6) brightness(0.7);
    pointer-events: none; transform: scale(0.98);
}
.choice-label { font-size: 0.7rem; font-weight: 700; color: var(--accent-cyan); margin-bottom: 3px; letter-spacing: 0.04em; }
.choice-text { font-size: 0.88rem; color: var(--text-primary); line-height: 1.6; }
.choice-btn .choice-glow { position: absolute; top: 0; left: -100%; width: 100%; height: 100%; background: linear-gradient(90deg,transparent,rgba(34,211,238,0.04),transparent); pointer-events: none; animation: choiceShimmer 2.5s ease-in-out 1s 1; }
@keyframes choiceShimmer { 0% { left: -100%; } 100% { left: 100%; } }

.continue-area { width: 100%; padding: 10px 14px calc(20px + var(--safe-bottom)); text-align: center; }
.btn-continue-game { display: inline-flex; align-items: center; gap: 5px; padding: 12px 32px; min-height: 46px; font-family: var(--font-sans); font-size: 0.88rem; font-weight: 700; letter-spacing: 0.08em; color: var(--text-primary); background: rgba(34,211,238,0.08); border: 1px solid rgba(34,211,238,0.25); border-radius: 50px; cursor: pointer; transition: all 0.25s ease; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.btn-continue-game:active { background: rgba(34,211,238,0.18); transform: scale(0.96); }
.continue-arrow { animation: arrowBounce 1s ease-in-out infinite; }
@keyframes arrowBounce { 0%,100% { transform: translateX(0); } 50% { transform: translateX(4px); } }

/* ============================================================ CHAR PROFILE OVERLAY ============================================================ */
.char-profile-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.7); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); z-index: 200; display: flex; align-items: center; justify-content: center; animation: overlayFadeIn 0.25s ease; padding: 20px; }
@keyframes overlayFadeIn { from { opacity: 0; } to { opacity: 1; } }
.char-profile-card { width: 100%; max-width: 340px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 18px; overflow: hidden; animation: cardSlideUp 0.35s var(--ease-out-expo); position: relative; }
@keyframes cardSlideUp { from { opacity: 0; transform: translateY(30px) scale(0.96); } to { opacity: 1; transform: translateY(0) scale(1); } }
.char-profile-portrait { width: 100%; aspect-ratio: 3/4; max-height: 55vh; background: var(--bg-dark); overflow: hidden; display: flex; align-items: center; justify-content: center; }
.char-profile-portrait img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.char-profile-portrait-placeholder { width: 100%; aspect-ratio: 3/4; max-height: 55vh; background: var(--bg-dark); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--text-dim); }
.char-profile-portrait-placeholder .placeholder-icon { font-size: 3rem; opacity: 0.25; }
.char-profile-info { padding: 14px 16px; }
.char-profile-name { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 900; color: var(--text-highlight); margin-bottom: 3px; }
.char-profile-title { font-size: 0.7rem; color: var(--accent-cyan); letter-spacing: 0.08em; margin-bottom: 8px; }
.char-profile-desc { font-size: 0.82rem; line-height: 1.75; color: var(--text-secondary); }
.char-profile-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; background: rgba(0,0,0,0.5); border: 1px solid rgba(255,255,255,0.08); border-radius: 50%; color: var(--text-primary); font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.char-profile-close:active { background: rgba(239,68,68,0.35); }

/* ============================================================ SETTINGS ============================================================ */
.settings-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(5px); -webkit-backdrop-filter: blur(5px); z-index: 250; display: flex; align-items: center; justify-content: center; animation: overlayFadeIn 0.25s ease; padding: 20px; }
.settings-panel { width: 100%; max-width: 360px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 18px; overflow: hidden; animation: cardSlideUp 0.35s var(--ease-out-expo); }
.settings-header { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; border-bottom: 1px solid var(--border-subtle); }
.settings-header h3 { font-family: var(--font-serif); font-size: 1rem; color: var(--text-highlight); }
.settings-close { width: 26px; height: 26px; background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle); border-radius: 50%; color: var(--text-primary); font-size: 0.75rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.settings-close:active { background: rgba(239,68,68,0.3); }
.settings-body { padding: 14px 18px; display: flex; flex-direction: column; gap: 16px; }
.setting-label { font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); margin-bottom: 6px; display: block; }
.setting-row { display: flex; align-items: center; gap: 10px; }
.speed-options { display: flex; gap: 6px; }
.speed-btn { padding: 6px 16px; min-height: 34px; font-size: 0.78rem; font-weight: 700; color: var(--text-secondary); background: var(--bg-dark); border: 1px solid var(--border-subtle); border-radius: 7px; cursor: pointer; transition: all 0.2s ease; font-family: var(--font-sans); }
.speed-btn.active { color: var(--accent-cyan); border-color: var(--accent-cyan); background: rgba(34,211,238,0.06); }
.toggle-switch { position: relative; display: inline-block; width: 42px; height: 22px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; inset: 0; background: var(--bg-dark); border: 1px solid var(--border-subtle); border-radius: 22px; cursor: pointer; transition: all 0.3s ease; }
.toggle-slider::before { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; background: var(--text-dim); border-radius: 50%; transition: all 0.3s ease; }
.toggle-switch input:checked + .toggle-slider { background: rgba(34,211,238,0.18); border-color: var(--accent-cyan); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--accent-cyan); }
.volume-slider { flex: 1; -webkit-appearance: none; appearance: none; height: 3px; background: var(--bg-dark); border-radius: 2px; outline: none; }
.volume-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: var(--accent-cyan); cursor: pointer; border: 2px solid var(--bg-card); box-shadow: 0 0 6px rgba(34,211,238,0.25); }
.setting-divider { border: none; border-top: 1px solid var(--border-subtle); margin: 2px 0; }
.settings-actions { display: flex; gap: 7px; }
.btn-settings-save { flex: 1; padding: 10px; min-height: 40px; font-size: 0.8rem; font-weight: 700; color: var(--accent-cyan); background: rgba(34,211,238,0.06); border: 1px solid rgba(34,211,238,0.18); border-radius: 10px; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s ease; }
.btn-settings-save:active { background: rgba(34,211,238,0.14); }
.btn-settings-reset { flex: 1; padding: 10px; min-height: 40px; font-size: 0.8rem; font-weight: 700; color: var(--text-secondary); background: rgba(255,255,255,0.02); border: 1px solid var(--border-subtle); border-radius: 10px; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s ease; }
.btn-settings-reset:active { border-color: var(--accent-amber); color: var(--accent-amber); }

/* ============================================================ ENDING ============================================================ */
#ending-screen { background: var(--bg-deepest); overflow-y: auto; -webkit-overflow-scrolling: touch; }
.ending-bg-image { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: 0.18; z-index: 0; }
.ending-bg { position: absolute; inset: 0; background: radial-gradient(ellipse at 50% 30%,rgba(34,211,238,0.03),transparent 55%); z-index: 1; }
.ending-content { position: relative; text-align: center; padding: 36px 18px calc(36px + var(--safe-bottom)); max-width: 400px; z-index: 2; }
.ending-illustration { width: 100%; border-radius: 14px; overflow: hidden; margin-bottom: 1.2rem; border: 1px solid var(--border-subtle); box-shadow: 0 6px 24px rgba(0,0,0,0.4); animation: fadeInUp 0.5s var(--ease-out-expo) 0.2s both; }
.ending-illustration img { display: block; width: 100%; height: auto; max-height: 45vh; object-fit: cover; }
.ending-illustration-placeholder { width: 100%; aspect-ratio: 16/9; background: var(--bg-card); border: 1.5px dashed rgba(255,255,255,0.06); border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-dim); animation: fadeInUp 0.5s var(--ease-out-expo) 0.2s both; }
.ending-illustration-placeholder .placeholder-icon { font-size: 2rem; opacity: 0.25; }
.ending-tag { display: inline-block; padding: 3px 14px; border-radius: 18px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.12em; margin-bottom: 0.8rem; animation: fadeInUp 0.5s var(--ease-out-expo) 0.3s both; }
.ending-tag.perfect { background: rgba(16,185,129,0.15); color: var(--accent-green); border: 1px solid rgba(16,185,129,0.25); }
.ending-tag.normal { background: rgba(245,158,11,0.15); color: var(--accent-amber); border: 1px solid rgba(245,158,11,0.25); }
.ending-tag.bad { background: rgba(239,68,68,0.15); color: var(--accent-red); border: 1px solid rgba(239,68,68,0.25); }
.ending-tag.dead { background: rgba(127,29,29,0.25); color: #fca5a5; border: 1px solid rgba(239,68,68,0.35); }
.ending-title { font-family: var(--font-serif); font-size: 1.6rem; font-weight: 900; color: var(--text-highlight); margin-bottom: 1.2rem; letter-spacing: 0.05em; animation: fadeInUp 0.5s var(--ease-out-expo) 0.45s both; }
.ending-narrative { font-family: var(--font-serif); font-size: 0.88rem; line-height: 2; color: var(--text-secondary); margin-bottom: 1.5rem; text-align: left; animation: fadeInUp 0.5s var(--ease-out-expo) 0.6s both; }
.ending-stats { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; margin-bottom: 1.5rem; animation: fadeInUp 0.5s var(--ease-out-expo) 0.75s both; }
.ending-stat-card { background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 10px; text-align: center; }
.ending-stat-card .es-icon { font-size: 1.1rem; margin-bottom: 3px; } .ending-stat-card .es-label { font-size: 0.65rem; color: var(--text-dim); display: block; } .ending-stat-card .es-value { font-size: 1rem; font-weight: 800; color: var(--text-highlight); }
.ending-achievements { margin-bottom: 1.2rem; animation: fadeInUp 0.5s var(--ease-out-expo) 0.85s both; }
.ending-ach-title { font-size: 0.78rem; color: var(--accent-amber); font-weight: 700; letter-spacing: 0.08em; margin-bottom: 8px; }
.ending-ach-item { display: flex; align-items: center; gap: 8px; padding: 9px 12px; background: rgba(245,158,11,0.06); border: 1px solid rgba(245,158,11,0.15); border-radius: 10px; margin-bottom: 5px; animation: achUnlock 0.5s var(--ease-out-expo); }
@keyframes achUnlock { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; transform: translateX(0); } }
.ending-ach-icon { font-size: 1.3rem; } .ending-ach-info { text-align: left; } .ending-ach-name { font-size: 0.82rem; font-weight: 700; color: var(--accent-amber); } .ending-ach-desc { font-size: 0.65rem; color: var(--text-dim); }

/* ============================================================ ACHIEVEMENT — FIXED TOPBAR ============================================================ */
#achievement-screen { background: var(--bg-deepest); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
#clue-gallery-screen { background: var(--bg-deepest); overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; }
.achievement-content { position: relative; z-index: 2; width: 100%; max-width: 420px; padding: 0; display: flex; flex-direction: column; min-height: 100%; }
.achievement-topbar {
    position: sticky; top: 0; z-index: 10;
    padding: 14px 14px 10px; text-align: center;
    background: var(--bg-deepest); border-bottom: 1px solid var(--border-subtle);
}
.back-btn { position: absolute; left: 14px; top: 14px; padding: 7px 14px; min-height: 36px; font-size: 0.82rem; font-weight: 700; color: var(--text-secondary); background: rgba(255,255,255,0.04); border: 1px solid var(--border-subtle); border-radius: 8px; cursor: pointer; font-family: var(--font-sans); transition: all 0.2s ease; z-index: 5; }
.back-btn:active { border-color: var(--accent-cyan); color: var(--accent-cyan); background: rgba(34,211,238,0.06); }
.achievement-title { font-family: var(--font-serif); font-size: 1.2rem; font-weight: 900; color: var(--text-highlight); }
.achievement-subtitle { font-size: 0.72rem; color: var(--text-dim); margin-top: 3px; }
.achievement-sections, .clue-gallery-sections, .case-gallery-sections { padding: 0 14px calc(30px + var(--safe-bottom)); flex: 1; overflow-y: auto; }
/* ★ Case Gallery Cards */
.case-gallery-grid { display: flex; flex-direction: column; gap: 8px; }
.case-gallery-card {
    display: flex; align-items: center; gap: 12px; padding: 14px;
    background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 14px;
    cursor: pointer; transition: all 0.25s ease;
}
.case-gallery-card.unlocked { border-color: rgba(34,211,238,0.15); }
.case-gallery-card.unlocked:active { border-color: var(--accent-cyan); background: rgba(34,211,238,0.06); transform: scale(0.98); }
.case-gallery-card.locked { opacity: 0.35; cursor: default; filter: grayscale(0.3); }
.case-gallery-thumb {
    width: 50px; height: 50px; border-radius: 10px; overflow: hidden; flex-shrink: 0;
    background: var(--bg-dark); display: flex; align-items: center; justify-content: center;
}
.case-gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.case-gallery-thumb .lock-icon { font-size: 1.3rem; opacity: 0.4; }
.case-gallery-info { flex: 1; min-width: 0; }
.case-gallery-name { font-size: 0.82rem; font-weight: 700; color: var(--text-highlight); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: 2px; }
.case-gallery-card.locked .case-gallery-name { color: var(--text-dim); }
.case-gallery-status { font-size: 0.6rem; color: var(--accent-cyan); letter-spacing: 0.05em; }
.case-gallery-card.locked .case-gallery-status { color: var(--text-dim); }
.ach-section { margin-top: 16px; }
.ach-section-title { font-size: 0.72rem; font-weight: 700; color: var(--accent-cyan); letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 8px; padding-bottom: 5px; border-bottom: 1px solid rgba(34,211,238,0.08); display: flex; align-items: center; gap: 5px; }
.ach-section-title::before { content: ''; width: 3px; height: 12px; border-radius: 2px; background: var(--accent-cyan); flex-shrink: 0; }
.ach-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.ach-card { display: flex; flex-direction: column; align-items: center; padding: 14px 8px; background: var(--bg-card); border: 1px solid var(--border-subtle); border-radius: 12px; text-align: center; transition: all 0.25s ease; }
.ach-card.locked { opacity: 0.3; filter: grayscale(0.4); }
.ach-card.unlocked { border-color: rgba(245,158,11,0.18); }
.ach-card .ach-icon { font-size: 1.6rem; margin-bottom: 5px; } .ach-card.locked .ach-icon { font-size: 1.3rem; }
.ach-card .ach-name { font-size: 0.78rem; font-weight: 700; color: var(--text-highlight); margin-bottom: 2px; }
.ach-card .ach-desc { font-size: 0.62rem; color: var(--text-dim); line-height: 1.4; }
.ach-card.unlocked .ach-name { color: var(--accent-amber); }
.ach-card.locked .ach-name { color: var(--text-dim); }

/* ============================================================ ★ Dim2: ENCRYPTED COMMS TERMINAL (重构来电界面) ============================================================ */
.call-overlay {
    position: fixed; inset: 0; z-index: 300;
    background: rgba(6,10,22,0.82);
    backdrop-filter: blur(25px); -webkit-backdrop-filter: blur(25px);
    display: flex; align-items: stretch; justify-content: center;
    animation: overlayFadeIn 0.4s ease;
}
/* Scanline overlay */
.call-ios-bg {
    position: absolute; inset: 0; z-index: 0;
    background:
        repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,255,180,0.015) 2px, rgba(0,255,180,0.015) 4px),
        linear-gradient(160deg, #0c1829 0%, #142744 35%, #0f1f38 65%, #0a1525 100%);
}
.call-ios-bg::after {
    content: ''; position: absolute; inset: 0;
    background: radial-gradient(ellipse at 50% 30%, rgba(34,211,238,0.04) 0%, transparent 60%);
}

.call-ios-content {
    position: relative; z-index: 1; width: 100%; max-width: 400px;
    display: flex; flex-direction: column; align-items: center;
    padding: max(50px, var(--safe-top)) 24px max(30px, var(--safe-bottom));
}

/* ── Top: Encrypted channel label ── */
.call-ios-header { text-align: center; margin-bottom: auto; }
.call-ios-label {
    font-family: 'Courier New', 'SF Mono', monospace;
    font-size: 0.65rem; letter-spacing: 0.3em; color: var(--accent-green);
    text-transform: uppercase; margin-bottom: 8px;
    animation: glitchLabel 3s steps(2, end) infinite;
}
@keyframes glitchLabel {
    0%,92%,100% { text-shadow: none; } 93% { text-shadow: 2px 0 #ef4444, -2px 0 #22d3ee; }
    95% { text-shadow: -1px 0 #22d3ee, 1px 0 #ef4444; } 97% { text-shadow: none; }
}
.call-ios-name {
    font-family: var(--font-serif); font-size: 2rem; font-weight: 900;
    color: #fff; letter-spacing: 0.06em; margin-bottom: 4px;
    text-shadow: 0 0 20px rgba(34,211,238,0.2);
}
.call-ios-subtitle {
    font-family: 'Courier New', monospace;
    font-size: 0.62rem; color: rgba(16,185,129,0.5); letter-spacing: 0.15em;
}

/* ── Middle: Radar pulse avatar ── */
.call-ios-avatar-area { flex: 1; display: flex; align-items: center; justify-content: center; margin: 20px 0; }
.call-ios-avatar {
    width: 120px; height: 120px; border-radius: 50%;
    background: radial-gradient(circle, rgba(34,211,238,0.06) 0%, transparent 70%);
    border: 1.5px solid rgba(34,211,238,0.15);
    display: flex; align-items: center; justify-content: center;
    font-size: 3rem; position: relative;
}
/* ★ Radar pulse rings */
.call-ios-avatar::before, .call-ios-avatar::after {
    content: ''; position: absolute; inset: -15px; border-radius: 50%;
    border: 1px solid rgba(34,211,238,0.12);
    animation: radarPulse 2.5s cubic-bezier(0, 0.5, 0.5, 1) infinite;
}
.call-ios-avatar::after { inset: -30px; animation-delay: 0.8s; }
@keyframes radarPulse {
    0% { transform: scale(0.7); opacity: 1; border-color: rgba(34,211,238,0.25); }
    100% { transform: scale(1.4); opacity: 0; border-color: rgba(34,211,238,0); }
}

/* ── Bottom: Actions ── */
.call-ios-actions {
    width: 100%; display: flex; flex-direction: column; align-items: center; gap: 24px;
    margin-top: auto;
}

/* ★ Dim2: Slide track — glitch/hacker style */
.call-slide-area { width: 100%; -webkit-user-select: none; user-select: none; }
.call-slide-track {
    position: relative; width: 100%; height: 56px;
    background: rgba(34,211,238,0.03);
    border: 1.5px solid rgba(34,211,238,0.1);
    border-radius: 50px; display: flex; align-items: center;
    box-shadow: inset 0 0 20px rgba(34,211,238,0.03);
}
.call-slide-thumb {
    position: absolute; left: 3px; top: 3px;
    width: 50px; height: 50px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(34,211,238,0.15), rgba(16,185,129,0.2));
    border: 1.5px solid rgba(34,211,238,0.4);
    display: flex; align-items: center; justify-content: center;
    cursor: grab; touch-action: none; z-index: 5;
    box-shadow: 0 0 16px rgba(34,211,238,0.2), inset 0 0 8px rgba(34,211,238,0.1);
    animation: termSlideHint 2.5s ease-in-out infinite;
    -webkit-user-select: none; user-select: none;
}
.call-thumb-icon {
    font-size: 1.1rem;
    filter: drop-shadow(0 0 4px rgba(34,211,238,0.5));
}
@keyframes termSlideHint {
    0%,100% { transform: translateX(0); box-shadow: 0 0 12px rgba(34,211,238,0.15); }
    50% { transform: translateX(16px); box-shadow: 0 0 24px rgba(34,211,238,0.3); }
}
.call-slide-text {
    width: 100%; text-align: center;
    font-family: 'Courier New', monospace; font-size: 0.72rem;
    color: rgba(34,211,238,0.3); font-weight: 600; letter-spacing: 0.15em;
    pointer-events: none;
}

/* ★ Terminal-style button row */
.call-ios-btn-row { display: flex; justify-content: center; gap: 60px; width: 100%; }
.call-ios-btn-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.call-ios-btn-label {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem; color: rgba(255,255,255,0.35); letter-spacing: 0.1em; text-transform: uppercase;
}
.call-ios-decline, .call-ios-accept {
    width: 60px; height: 60px; border-radius: 50%;
    border: 1.5px solid transparent; cursor: pointer; font-size: 1.3rem;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s ease; position: relative; z-index: 5;
}
.call-ios-decline {
    background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.25);
    color: #ef4444; box-shadow: 0 0 16px rgba(239,68,68,0.1);
}
.call-ios-decline:active { transform: scale(0.9); box-shadow: 0 0 24px rgba(239,68,68,0.3); }
.call-ios-accept {
    background: rgba(16,185,129,0.08); border-color: rgba(16,185,129,0.3);
    color: #10b981; box-shadow: 0 0 16px rgba(16,185,129,0.1);
}
.call-ios-accept:active { transform: scale(0.9); box-shadow: 0 0 24px rgba(16,185,129,0.3); }

/* ============================================================ ★ 通话中界面 (iOS/Android 风格重構) ============================================================ */
.call-active-overlay {
    position: fixed; inset: 0; z-index: 310;
    background: linear-gradient(180deg, #070B14 0%, #0d1a30 40%, #0a1525 70%, #070B14 100%);
    display: flex; align-items: stretch; justify-content: center;
    animation: overlayFadeIn 0.3s ease;
}
.call-active-layout {
    width: 100%; max-width: 400px;
    display: flex; flex-direction: column; align-items: center;
    padding: max(50px, var(--safe-top)) 24px max(30px, var(--safe-bottom));
}
/* 顶部状态 */
.call-active-header { text-align: center; margin-bottom: 8px; }
.call-active-status {
    font-family: 'Courier New', monospace;
    font-size: 0.72rem; letter-spacing: 0.15em; color: var(--accent-green);
    display: flex; align-items: center; justify-content: center; gap: 8px;
    margin-bottom: 4px;
}
.call-dot {
    width: 8px; height: 8px; border-radius: 50%; background: var(--accent-green);
    display: inline-block; animation: callDot 1s ease-in-out infinite;
}
@keyframes callDot { 0%,100% { opacity: 1; } 50% { opacity: 0.2; } }
.call-active-timer {
    font-size: 2.8rem; font-weight: 200; color: #fff;
    font-variant-numeric: tabular-nums; letter-spacing: 0.08em;
    font-family: 'Noto Sans SC', sans-serif;
}
/* 中部头像 */
.call-active-center {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 8px;
}
.call-active-avatar {
    width: 110px; height: 110px; border-radius: 50%;
    background: radial-gradient(circle, rgba(34,211,238,0.06) 0%, transparent 70%);
    border: 1.5px solid rgba(255,255,255,0.1);
    display: flex; align-items: center; justify-content: center;
    font-size: 2.8rem; position: relative;
}
.call-avatar-ring {
    position: absolute; inset: -8px; border-radius: 50%;
    border: 1px solid rgba(16,185,129,0.15);
    animation: callRingSlow 3s ease-in-out infinite;
}
@keyframes callRingSlow {
    0%,100% { transform: scale(1); opacity: 0.6; } 50% { transform: scale(1.08); opacity: 1; }
}
.call-active-name {
    font-family: var(--font-serif); font-size: 1.5rem; font-weight: 900;
    color: #fff; letter-spacing: 0.06em;
}
.call-active-dept {
    font-family: 'Courier New', monospace;
    font-size: 0.6rem; color: rgba(255,255,255,0.25); letter-spacing: 0.2em;
}
/* 字幕区 */
.call-active-subtitle-area {
    width: 100%; min-height: 80px; max-height: 120px;
    padding: 14px 16px;
    background: rgba(255,255,255,0.025); border: 1px solid rgba(255,255,255,0.04);
    border-radius: 14px; margin: 16px 0;
    overflow-y: auto;
}
.call-active-subtitle {
    font-size: 0.88rem; line-height: 1.8; color: rgba(255,255,255,0.8);
    text-align: left; font-family: var(--font-sans);
}
/* 底部按钮栏 */
.call-active-actions {
    display: flex; justify-content: center; align-items: flex-start; gap: 40px;
    width: 100%; margin-top: auto; padding-top: 16px;
}
.call-action-item {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.call-action-btn {
    width: 56px; height: 56px; border-radius: 50%; border: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.3rem; cursor: pointer;
    transition: all 0.2s ease;
}
.call-btn-speaker {
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.12); position: relative;
}
.call-btn-speaker::after { content: ''; display: block; width: 10px; height: 10px; border-right: 2.5px solid rgba(255,255,255,0.5); border-top: 2.5px solid rgba(255,255,255,0.5); border-bottom: 2.5px solid rgba(255,255,255,0.5); border-left: none; border-radius: 0 50% 50% 0; }
.call-btn-speaker::before { content: ''; position: absolute; left: 18px; width: 8px; height: 12px; background: rgba(255,255,255,0.5); border-radius: 2px; }
.call-btn-muted {
    background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
    border: 1px solid rgba(255,255,255,0.12); position: relative;
}
.call-btn-muted::after { content: ''; display: block; width: 16px; height: 16px; border: 2px solid rgba(255,255,255,0.4); border-radius: 50%; }
.call-btn-muted::before { content: ''; position: absolute; width: 22px; height: 2px; background: rgba(255,255,255,0.5); transform: rotate(45deg); }
.call-btn-hangup {
    background: linear-gradient(135deg, #ef4444, #dc2626); color: #fff;
    box-shadow: 0 4px 20px rgba(239,68,68,0.35);
    border: none; position: relative;
}
.call-btn-hangup::after { content: ''; display: block; width: 26px; height: 3px; background: #fff; border-radius: 2px; transform: rotate(135deg); }
.call-btn-hangup:active { transform: scale(0.9); }
.call-action-label {
    font-size: 0.6rem; color: rgba(255,255,255,0.35); letter-spacing: 0.05em;
}

/* ============================================================ CASE STUDY OVERLAY ============================================================ */
/* ============================================================ CASE READER — 内置案例学习阅读器 ============================================================ */
.case-study-overlay {
    position: fixed; inset: 0; z-index: 250;
    background: rgba(5,8,16,0.92);
    backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
    display: flex; align-items: center; justify-content: center;
    animation: overlayFadeIn 0.35s ease; padding: 20px;
}
/* ── 选择卡片 ── */
.case-study-card {
    width: 100%; max-width: 340px; padding: 28px 24px;
    background: linear-gradient(145deg, rgba(15,25,50,0.95), rgba(10,18,35,0.98));
    border: 1.5px solid rgba(34,211,238,0.12);
    border-radius: 20px; text-align: center;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 30px rgba(34,211,238,0.04);
}
.case-study-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.12em; color: var(--accent-amber);
    background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.15);
    border-radius: 20px; padding: 5px 14px; margin-bottom: 14px;
}
.case-study-title {
    font-family: var(--font-serif); font-size: 1.3rem; font-weight: 900;
    color: var(--text-highlight); margin-bottom: 10px;
}
.case-study-desc {
    font-size: 0.82rem; line-height: 1.7; color: var(--text-secondary);
    margin-bottom: 22px;
}
.case-study-link-btn {
    display: block; width: 100%; padding: 14px; margin-bottom: 12px;
    font-family: var(--font-sans); font-size: 0.92rem; font-weight: 700;
    letter-spacing: 0.06em; color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(59,130,246,0.25);
    transition: all 0.25s ease; text-align: center;
}
.case-study-link-btn:active { transform: scale(0.97); }
.case-auto-hint {
    font-size: 0.72rem; font-weight: 400; opacity: 0.7;
}
.case-study-skip-btn {
    padding: 10px 20px; font-family: var(--font-sans);
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.05em;
    color: var(--text-dim); background: transparent;
    border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
    cursor: pointer; transition: all 0.2s ease;
}
.case-study-skip-btn:active { color: var(--text-primary); border-color: rgba(255,255,255,0.15); }
.case-reader {
    width: 100%; height: 100%; max-width: 480px;
    display: flex; flex-direction: column;
    background: var(--bg-deepest);
}
.case-reader-scroll {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.case-reader-image {
    width: 100%; aspect-ratio: 16/9; overflow: hidden;
    background: rgba(15,25,50,0.8);
}
.case-reader-image img {
    width: 100%; height: 100%; object-fit: cover;
    display: block;
}
.case-reader-body {
    padding: 20px 18px 30px;
}
.case-reader-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 700;
    letter-spacing: 0.12em; color: var(--accent-amber);
    background: rgba(245,158,11,0.08); border: 1px solid rgba(245,158,11,0.15);
    border-radius: 20px; padding: 5px 14px; margin-bottom: 14px;
}
.case-reader-title {
    font-family: var(--font-serif); font-size: 1.35rem; font-weight: 900;
    color: var(--text-highlight); margin: 0 0 20px; line-height: 1.4;
}
.case-section {
    margin-bottom: 22px;
}
.case-section-subtitle {
    font-family: var(--font-serif); font-size: 0.95rem; font-weight: 800;
    color: var(--accent-cyan); margin: 0 0 10px;
    padding-left: 12px;
    border-left: 3px solid var(--accent-cyan);
    line-height: 1.4;
}
.case-section-content {
    font-size: 0.86rem; line-height: 1.9; color: var(--text-secondary);
    margin: 0; text-align: justify;
}
.case-reader-footer {
    padding: 12px 18px calc(14px + var(--safe-bottom));
    border-top: 1px solid var(--border-subtle);
    background: var(--bg-deepest);
}
.case-reader-close {
    display: block; width: 100%; padding: 14px;
    font-family: var(--font-sans); font-size: 0.92rem; font-weight: 700;
    letter-spacing: 0.06em; text-align: center; cursor: pointer;
    border: none; border-radius: 12px; transition: all 0.3s ease;
}
.case-reader-close:disabled {
    color: var(--text-dim);
    background: rgba(255,255,255,0.04);
    cursor: not-allowed;
}
.case-reader-close:not(:disabled) {
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 4px 16px rgba(59,130,246,0.25);
}
.case-reader-close:not(:disabled):active {
    transform: scale(0.97);
}
#case-countdown {
    display: inline-block; min-width: 1.2em;
    font-variant-numeric: tabular-nums;
    color: var(--accent-cyan); font-weight: 900;
}

/* ============================================================ RESPONSIVE — larger phones ============================================================ */
@media (min-width: 414px) {
    html { font-size: 15.5px; }
    .stats-panel { gap: 5px; padding: 7px 12px 9px; }
    .stat-icon-ring { width: 30px; height: 30px; }
}
@media (min-width: 768px) {
    html { font-size: 16px; }
    .splash-title { font-size: 3rem; }
    .narrative-area { padding: 16px 20px 0; }
    .choices-area { padding: 12px 20px 30px; }
}
/* ============================================================ SAFE AREAS ============================================================ */
@supports (padding: env(safe-area-inset-bottom)) {
    .choices-area, .continue-area { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }
    .stats-panel { padding-top: max(6px, env(safe-area-inset-top)); }
}

/* ============================================================ AUTH OVERLAY — 登录/注册弹窗 ============================================================ */
.auth-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(5,8,16,0.95);
    backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px; animation: overlayFadeIn 0.35s ease;
}
.auth-card {
    width: 100%; max-width: 360px;
    background: linear-gradient(145deg, rgba(15,25,50,0.95), rgba(10,18,35,0.98));
    border: 1.5px solid rgba(34,211,238,0.12);
    border-radius: 20px; overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 0 40px rgba(34,211,238,0.04);
}
.auth-header {
    text-align: center; padding: 28px 24px 16px;
}
.auth-logo {
    font-size: 2.5rem; margin-bottom: 8px;
    filter: drop-shadow(0 0 12px rgba(34,211,238,0.3));
}
.auth-title {
    font-family: var(--font-serif); font-size: 1.4rem; font-weight: 900;
    color: var(--text-highlight); margin-bottom: 6px;
}
.auth-desc {
    font-size: 0.78rem; color: var(--text-dim); letter-spacing: 0.05em;
}
/* Tab */
.auth-tabs {
    display: flex; border-bottom: 1px solid var(--border-subtle);
}
.auth-tab {
    flex: 1; padding: 12px; font-family: var(--font-sans);
    font-size: 0.88rem; font-weight: 600; text-align: center;
    background: transparent; color: var(--text-dim);
    border: none; cursor: pointer; transition: all 0.25s ease;
    border-bottom: 2px solid transparent;
}
.auth-tab.active {
    color: var(--accent-cyan);
    border-bottom-color: var(--accent-cyan);
}
/* Form */
.auth-form {
    padding: 18px 24px 28px;
}
.auth-field {
    margin-bottom: 16px;
}
.auth-field label {
    display: block; font-size: 0.78rem; font-weight: 600;
    color: var(--text-secondary); margin-bottom: 6px;
    letter-spacing: 0.04em;
}
.auth-optional {
    font-weight: 400; color: var(--text-dim);
}
.auth-field input,
.auth-area-select {
    width: 100%; padding: 12px 14px;
    font-family: var(--font-sans); font-size: 0.88rem;
    color: var(--text-primary); background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px; outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.auth-field input:focus {
    border-color: var(--accent-cyan);
    box-shadow: 0 0 0 3px rgba(34,211,238,0.08);
}
.auth-phone-row {
    display: flex; gap: 8px;
}
.auth-area-select {
    width: 120px; flex-shrink: 0; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
    background-size: 18px; padding-right: 28px;
}
.auth-code-row {
    display: flex; gap: 8px;
}
.auth-code-row input { flex: 1; }
.auth-send-btn {
    flex-shrink: 0; padding: 12px 16px;
    font-family: var(--font-sans); font-size: 0.78rem; font-weight: 700;
    color: var(--accent-cyan); background: rgba(34,211,238,0.06);
    border: 1px solid rgba(34,211,238,0.2); border-radius: 10px;
    cursor: pointer; white-space: nowrap;
    transition: all 0.2s ease;
}
.auth-send-btn:disabled {
    color: var(--text-dim); border-color: rgba(255,255,255,0.06);
    cursor: not-allowed;
}
.auth-submit-btn {
    display: block; width: 100%; padding: 14px; margin-top: 6px;
    font-family: var(--font-sans); font-size: 0.95rem; font-weight: 700;
    color: #fff; background: linear-gradient(135deg, #3b82f6, #2563eb);
    border: none; border-radius: 12px; cursor: pointer;
    box-shadow: 0 4px 16px rgba(59,130,246,0.25);
    transition: all 0.25s ease;
}
.auth-submit-btn:active { transform: scale(0.97); }
.auth-submit-btn:disabled {
    opacity: 0.5; cursor: not-allowed;
}
.auth-error {
    margin-top: 10px; font-size: 0.78rem;
    color: var(--accent-red); text-align: center;
    min-height: 20px;
}

/* ============================================================ SETTINGS SELECT ============================================================ */
.setting-select {
    padding: 8px 32px 8px 12px;
    font-family: var(--font-sans); font-size: 0.82rem;
    color: var(--text-primary); background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08); border-radius: 8px;
    outline: none; cursor: pointer;
    -webkit-appearance: none; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2394a3b8'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 8px center;
    background-size: 16px;
}
.setting-select option {
    background: #0e1525; color: var(--text-primary);
}

/* ============================================================ QUIZ JUMP BUTTON ============================================================ */
.btn-quiz-jump {
    margin-top: 12px;
    background: linear-gradient(135deg, #10b981, #059669) !important;
    box-shadow: 0 4px 16px rgba(16,185,129,0.25);
}

/* ============================================================ SCROLL HINT ============================================================ */
.scroll-hint {
    position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
    z-index: 30; display: flex; flex-direction: column; align-items: center; gap: 2px;
    opacity: 0; pointer-events: none;
    animation: scrollHintFadeIn 0.5s ease 0.3s forwards;
    transition: opacity 0.3s ease;
}
.scroll-hint.hidden { opacity: 0 !important; animation: none; }
.scroll-hint-text {
    font-size: 0.65rem; color: var(--text-dim); letter-spacing: 0.06em;
    background: rgba(0,0,0,0.5); padding: 3px 10px; border-radius: 10px;
    backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.scroll-hint-arrow {
    font-size: 0.9rem; color: var(--accent-cyan); opacity: 0.7;
    animation: scrollHintBounce 1.5s ease-in-out infinite;
}
@keyframes scrollHintFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scrollHintBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(4px); } }
