/* ===== Reset & Variables ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg-main: #f0f5ff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-brand: linear-gradient(135deg, #1e40af, #2563eb, #3b82f6);
    --bg-input: #f1f5f9;
    --bg-input-focus: #e8eef6;
    --border-subtle: #e2e8f0;
    --border-focus: #3b82f6;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --accent: #2563eb;
    --accent2: #1d4ed8;
    --accent-light: #dbeafe;
    --accent-glow: rgba(37, 99, 235, 0.2);
    --gradient: linear-gradient(135deg, #1d4ed8, #2563eb, #3b82f6);
    --success: #10b981;
    --danger: #ef4444;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Microsoft YaHei', sans-serif;
}

html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* ===== Particles ===== */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 0; overflow: hidden; }
.particle {
    position: absolute; width: 4px; height: 4px;
    background: rgba(37, 99, 235, 0.2); border-radius: 50%;
    animation: float linear infinite;
}
@keyframes float {
    0% { transform: translateY(100vh) scale(0); opacity: 0; }
    10% { opacity: 1; } 90% { opacity: 1; }
    100% { transform: translateY(-10vh) scale(1); opacity: 0; }
}

/* ===== Container ===== */
.container {
    position: relative; z-index: 1; display: flex;
    width: 1060px; max-width: 96vw; min-height: 660px;
    background: var(--bg-card); border-radius: var(--radius-xl);
    border: 1px solid var(--border-subtle);
    box-shadow: 0 20px 60px rgba(37, 99, 235, 0.08), 0 4px 20px rgba(0,0,0,0.04);
    backdrop-filter: blur(20px); overflow: hidden;
}

/* ===== Left Branding (blue panel) ===== */
.branding {
    width: 40%; background: var(--bg-brand);
    padding: 48px 36px; display: flex; flex-direction: column; justify-content: center;
    position: relative; overflow: hidden; color: white;
}
.branding::before {
    content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 60%);
    animation: rotate 20s linear infinite;
}
@keyframes rotate { 100% { transform: rotate(360deg); } }
.brand-content { position: relative; z-index: 1; }
.logo { display: flex; align-items: center; gap: 12px; margin-bottom: 32px; }
.logo-icon { font-size: 32px; }
.logo-text { font-size: 22px; font-weight: 700; color: white; }
.brand-title { font-size: 30px; font-weight: 800; line-height: 1.3; margin-bottom: 16px; color: white; }
.gradient-text { color: #bfdbfe; }
.brand-desc { color: rgba(255,255,255,0.8); font-size: 13px; line-height: 1.7; margin-bottom: 28px; }
.features { display: flex; flex-direction: column; gap: 12px; }
.feature-item {
    display: flex; align-items: center; gap: 10px; font-size: 13px;
    color: rgba(255,255,255,0.85); padding: 10px 14px;
    background: rgba(255,255,255,0.1); border-radius: var(--radius-sm);
    border: 1px solid rgba(255,255,255,0.15); transition: var(--transition);
}
.feature-item:hover { background: rgba(255,255,255,0.18); transform: translateX(4px); }

/* ===== Right Form (white panel) ===== */
.form-panel { flex: 1; padding: 36px 44px; display: flex; flex-direction: column; overflow-y: auto; background: white; }
.progress-bar { margin-bottom: 28px; }
.progress-track { height: 3px; background: #e2e8f0; border-radius: 4px; margin-bottom: 14px; overflow: hidden; }
.progress-fill { height: 100%; width: 33.33%; background: var(--gradient); border-radius: 4px; transition: width 0.6s ease; }
.progress-steps { display: flex; justify-content: space-between; }
.step { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-muted); transition: var(--transition); }
.step.active { color: var(--text-primary); }
.step.completed { color: var(--success); }
.step-dot {
    width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--text-muted);
    display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 600; transition: var(--transition);
}
.step.active .step-dot { border-color: var(--accent); background: var(--accent); color: white; box-shadow: 0 0 12px var(--accent-glow); }
.step.completed .step-dot { border-color: var(--success); background: var(--success); color: white; }

/* ===== Form Steps ===== */
.form-step { display: none; flex-direction: column; gap: 20px; flex: 1; animation: fadeIn 0.4s ease; }
.form-step.active { display: flex; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.form-title { font-size: 22px; font-weight: 700; color: var(--text-primary); }
.form-subtitle { font-size: 13px; color: var(--text-secondary); margin-top: -12px; }
.form-group { display: flex; flex-direction: column; gap: 8px; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; }

/* ===== Fake Input ===== */
.fake-input {
    width: 100%; padding: 12px 16px; min-height: 46px;
    background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); display: flex; align-items: center;
    font-size: 15px; color: var(--text-primary); user-select: none;
}
.fake-placeholder { color: var(--text-muted); font-size: 14px; }
.typed-text { font-family: var(--font); letter-spacing: 0.5px; }
.cursor-blink { animation: blink 1s step-end infinite; color: var(--accent); font-weight: 300; margin-left: 1px; }
@keyframes blink { 50% { opacity: 0; } }

/* ===== Hints ===== */
.input-hint {
    display: flex; align-items: flex-start; gap: 8px; padding: 8px 12px;
    background: var(--accent-light); border: 1px solid #bfdbfe;
    border-radius: var(--radius-sm); font-size: 12px; color: var(--accent); line-height: 1.5;
    animation: fadeIn 0.3s ease;
}
.hint-icon { font-size: 14px; flex-shrink: 0; }

/* ===== Wheel (昵称) ===== */
.wheel-indicator {
    display: flex; align-items: center; gap: 16px; margin-top: 8px;
    padding: 14px 18px; background: var(--accent-light);
    border: 1px solid #bfdbfe; border-radius: var(--radius-md);
}
.wheel-letter {
    font-size: 44px; font-weight: 800; color: var(--accent);
    width: 56px; text-align: center; user-select: none; transition: transform 0.1s ease;
}
.wheel-letter.up { animation: scrollUp 0.12s ease; }
.wheel-letter.down { animation: scrollDown 0.12s ease; }
@keyframes scrollUp { 0% { transform: translateY(8px); opacity: .5; } 100% { transform: translateY(0); opacity: 1; } }
@keyframes scrollDown { 0% { transform: translateY(-8px); opacity: .5; } 100% { transform: translateY(0); opacity: 1; } }
.wheel-nav { display: flex; flex-direction: column; gap: 4px; }
.arrow-btn {
    padding: 6px 14px; border: none; border-radius: var(--radius-sm);
    background: var(--accent-light); color: var(--accent);
    font-size: 16px; font-weight: 700; cursor: pointer;
    font-family: var(--font); transition: var(--transition);
    user-select: none; line-height: 1; text-align: center;
}
.arrow-btn:hover { background: var(--accent); color: white; }
.arrow-btn:active { transform: scale(0.9); background: var(--accent); color: white; }
.wheel-actions { margin-left: auto; display: flex; gap: 8px; }
.wheel-confirm, .wheel-delete {
    padding: 7px 16px; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: var(--font); cursor: pointer; transition: var(--transition);
}
.wheel-confirm { background: var(--accent); color: white; }
.wheel-confirm:hover { background: var(--accent2); }
.wheel-delete { background: #fee2e2; color: #ef4444; }
.wheel-delete:hover { background: #fecaca; }
.char-count { font-size: 12px; color: var(--text-muted); }

/* ===== Virtual Keyboard ===== */
.virtual-keyboard {
    display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px;
    padding: 12px; background: #f8fafc;
    border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
}
.vk-key {
    padding: 8px 0; min-width: 32px; text-align: center;
    background: white; border: 1px solid var(--border-subtle);
    border-radius: 6px; color: var(--text-primary); font-size: 13px;
    font-family: var(--font); cursor: pointer; transition: all 0.15s ease;
    user-select: none; box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.vk-key:hover { background: var(--accent); border-color: var(--accent); color: white; transform: scale(1.1); box-shadow: 0 4px 12px var(--accent-glow); }
.vk-key:active { transform: scale(0.95); }
.vk-key.special { background: var(--accent-light); color: var(--accent); min-width: 56px; font-size: 12px; border-color: #bfdbfe; }
.vk-key.special:hover { background: var(--accent); color: white; border-color: var(--accent); }

/* ===== Password Spinner ===== */
.password-strength { display: flex; align-items: center; gap: 12px; }
.strength-bar { flex: 1; height: 4px; background: #e2e8f0; border-radius: 4px; overflow: hidden; }
.strength-fill { height: 100%; width: 0; border-radius: 4px; transition: all 0.5s ease; }
.strength-text { font-size: 12px; font-weight: 600; white-space: nowrap; }
.spinner-wrapper {
    display: flex; align-items: center; gap: 16px; margin-top: 8px;
    padding: 14px 18px; background: var(--accent-light);
    border: 1px solid #bfdbfe; border-radius: var(--radius-md);
}
.spinner-display {
    font-size: 40px; font-weight: 800; color: var(--accent);
    width: 56px; text-align: center; user-select: none;
}
.spinner-display.spinning { animation: spinChar 0.08s steps(1) infinite; }
@keyframes spinChar { 50% { opacity: 0.5; } }
.spinner-controls { display: flex; flex-direction: column; gap: 6px; margin-left: auto; }
.btn-spin, .btn-spin-del {
    padding: 8px 18px; border: none; border-radius: var(--radius-sm);
    font-size: 13px; font-weight: 600; font-family: var(--font); cursor: pointer; transition: var(--transition);
}
.btn-spin { background: var(--gradient); color: white; }
.btn-spin:hover { transform: scale(1.03); box-shadow: 0 4px 15px var(--accent-glow); }
.btn-spin:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-spin-del { background: #fee2e2; color: #ef4444; }
.btn-spin-del:hover { background: #fecaca; }

/* ===== Phone Digits ===== */
.phone-digits-wrapper { display: flex; align-items: center; gap: 10px; }
.phone-prefix-tag {
    padding: 8px 12px; background: var(--bg-input);
    border: 1px solid var(--border-subtle); border-radius: var(--radius-sm);
    font-size: 14px; color: var(--text-secondary); font-weight: 500; white-space: nowrap;
}
.phone-digits { display: flex; gap: 4px; flex-wrap: wrap; }
.digit-col { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.digit-btn {
    width: 30px; height: 20px; border: none; border-radius: 4px;
    background: var(--accent-light); color: var(--accent);
    font-size: 12px; font-family: var(--font); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
}
.digit-btn:hover { background: var(--accent); color: white; }
.digit-value {
    width: 30px; height: 32px; display: flex; align-items: center; justify-content: center;
    background: white; border: 1px solid var(--border-subtle); border-radius: 6px;
    font-size: 16px; font-weight: 700; color: var(--text-primary); user-select: none;
}

/* ===== Confirm Password (char tiles) ===== */
.confirm-chars {
    display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px;
    padding: 14px; background: #f8fafc;
    border: 1px solid var(--border-subtle); border-radius: var(--radius-md);
    min-height: 50px; align-items: center;
}
.confirm-empty { font-size: 13px; color: var(--text-muted); margin: 0; }
.confirm-tile {
    padding: 10px 16px; background: white; border: 2px solid var(--border-subtle);
    border-radius: var(--radius-sm); font-size: 16px; font-weight: 700;
    color: var(--text-primary); cursor: pointer; font-family: 'Courier New', monospace;
    transition: all 0.15s ease; user-select: none; box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.confirm-tile:hover { border-color: var(--accent); color: var(--accent); transform: scale(1.08); box-shadow: 0 4px 12px var(--accent-glow); }
.confirm-tile.used { opacity: 0.3; pointer-events: none; border-color: var(--success); background: #f0fdf4; }
.btn-confirm-reset {
    margin-top: 6px; padding: 6px 14px; background: var(--accent-light); color: var(--accent);
    border: 1px solid #bfdbfe; border-radius: var(--radius-sm); font-size: 12px;
    font-family: var(--font); cursor: pointer; transition: var(--transition);
}
.btn-confirm-reset:hover { background: var(--accent); color: white; }

/* ===== Gender ===== */
.gender-options { display: flex; gap: 12px; }
.gender-btn {
    flex: 1; padding: 12px; background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); color: var(--text-primary); font-size: 14px;
    font-family: var(--font); cursor: pointer; transition: all 0.2s ease;
}
.gender-btn:hover { background: var(--accent-light); border-color: var(--accent); }
.gender-btn.selected { background: var(--accent-light); border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* ===== Captcha Slider ===== */
.captcha-slider-wrapper { display: flex; flex-direction: column; gap: 12px; }
.captcha-target {
    padding: 14px 20px; background: var(--bg-input); border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); font-size: 14px; color: var(--text-secondary); text-align: center;
}
.captcha-target-num {
    font-size: 28px; font-weight: 800; color: var(--accent);
    margin-left: 8px; font-family: 'Courier New', monospace; letter-spacing: 4px;
}
.slider-container { display: flex; align-items: center; gap: 10px; }
.slider-label { font-size: 12px; color: var(--text-muted); font-weight: 600; white-space: nowrap; font-family: 'Courier New', monospace; }
.captcha-range {
    flex: 1; -webkit-appearance: none; appearance: none;
    height: 6px; background: #e2e8f0; border-radius: 4px; outline: none;
}
.captcha-range::-webkit-slider-thumb {
    -webkit-appearance: none; width: 22px; height: 22px; border-radius: 50%;
    background: var(--gradient); cursor: pointer; box-shadow: 0 2px 8px var(--accent-glow);
    transition: transform 0.15s ease;
}
.captcha-range::-webkit-slider-thumb:hover { transform: scale(1.2); }
.captcha-range::-moz-range-thumb {
    width: 22px; height: 22px; border-radius: 50%; border: none;
    background: var(--gradient); cursor: pointer;
}
.slider-value-display { text-align: center; font-size: 14px; color: var(--text-secondary); }
.slider-value {
    font-size: 22px; font-weight: 700; color: var(--accent);
    font-family: 'Courier New', monospace; margin-left: 4px;
}

/* ===== Terms ===== */
.terms-wrapper { position: relative; min-height: 36px; }
.checkbox-container { display: flex; align-items: center; gap: 10px; cursor: pointer; transition: all 0.15s ease; position: relative; }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.checkbox-container label { font-size: 13px; color: var(--text-secondary); cursor: pointer; text-transform: none; font-weight: 400; }
.checkbox-container label a { color: var(--accent); text-decoration: none; }

/* ===== Buttons ===== */
.btn-primary, .btn-secondary, .btn-submit {
    padding: 13px 24px; border: none; border-radius: var(--radius-md);
    font-size: 15px; font-weight: 600; font-family: var(--font); cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px; transition: var(--transition);
}
.btn-primary { background: var(--gradient); color: white; box-shadow: 0 4px 15px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(37,99,235,0.3); }
.btn-secondary { background: var(--bg-input); color: var(--text-secondary); border: 1px solid var(--border-subtle); }
.btn-secondary:hover { background: var(--accent-light); color: var(--accent); }
.btn-submit { background: linear-gradient(135deg, #10b981, #059669); color: white; box-shadow: 0 4px 15px rgba(16,185,129,0.3); transition: all 0.1s ease; }
.btn-group { display: flex; gap: 12px; margin-top: auto; }
.btn-group .btn-primary, .btn-group .btn-submit { flex: 1; }
.btn-arrow { font-size: 16px; }
.submit-wrapper { flex: 1; position: relative; }
.submit-wrapper .btn-submit { width: 100%; position: relative; transition: all 0.15s ease; }

/* ===== Final Reveal ===== */
.final-reveal { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 20px 0; flex: 1; position: relative; }
.confetti-container { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.confetti { position: absolute; width: 10px; height: 10px; opacity: 0; animation: confettiFall 3s ease-in-out forwards; }
@keyframes confettiFall { 0% { transform: translateY(-100px) rotate(0deg); opacity: 1; } 100% { transform: translateY(500px) rotate(720deg); opacity: 0; } }
.reveal-emoji { font-size: 64px; margin-bottom: 12px; animation: bounceIn 0.8s cubic-bezier(0.68,-0.55,0.27,1.55); }
@keyframes bounceIn { 0% { transform: scale(0); } 50% { transform: scale(1.2); } 100% { transform: scale(1); } }
.reveal-title {
    font-size: 34px; font-weight: 800;
    background: linear-gradient(135deg, #f59e0b, #ef4444, #ec4899, #3b82f6, #2563eb);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    margin-bottom: 10px; animation: fadeIn 0.6s ease 0.2s both;
}
.reveal-subtitle { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 28px; animation: fadeIn 0.6s ease 0.4s both; }
.reveal-stats { display: flex; gap: 28px; margin-bottom: 20px; animation: fadeIn 0.6s ease 0.6s both; }
.stat-number { font-size: 28px; font-weight: 800; color: var(--accent); }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
.reveal-note { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; line-height: 1.8; animation: fadeIn 0.6s ease 0.8s both; }
.btn-replay { animation: fadeIn 0.6s ease 1s both; }

/* ===== Shake & Toast ===== */
@keyframes shake { 0%,100%{transform:translateX(0)} 10%,30%,50%,70%,90%{transform:translateX(-4px)} 20%,40%,60%,80%{transform:translateX(4px)} }
.shake { animation: shake 0.5s ease; }
.toast {
    position: fixed; top: 24px; right: 24px; padding: 12px 20px;
    background: white; border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md); color: var(--text-primary);
    font-size: 14px; font-family: var(--font); z-index: 1000;
    display: flex; align-items: center; gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.08);
    animation: slideIn 0.4s ease, slideOut 0.4s ease 2.6s forwards;
}
@keyframes slideIn { from { transform: translateX(120%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideOut { from { transform: translateX(0); opacity: 1; } to { transform: translateX(120%); opacity: 0; } }

/* ===== Responsive ===== */
@media (max-width: 768px) {
    body { overflow: auto; align-items: flex-start; padding: 8px 0; }
    .container { flex-direction: column; min-height: auto; max-height: none; }
    .branding { width: 100%; padding: 20px; }
    .brand-title { font-size: 22px; }
    .brand-desc { font-size: 12px; margin-bottom: 16px; }
    .features { display: none; }
    .form-panel { padding: 16px; overflow-y: visible; }
    .form-title { font-size: 18px; }
    .form-subtitle { font-size: 12px; }
    .wheel-indicator { flex-wrap: wrap; gap: 10px; padding: 12px; }
    .wheel-letter { font-size: 36px; width: 48px; }
    .wheel-nav { flex-direction: row; gap: 6px; }
    .arrow-btn { padding: 12px 24px; font-size: 22px; }
    .wheel-actions { width: 100%; justify-content: center; }
    .virtual-keyboard { gap: 4px; padding: 8px; }
    .vk-key { min-width: 28px; font-size: 12px; padding: 7px 0; }
    .spinner-wrapper { flex-wrap: wrap; gap: 10px; padding: 12px; }
    .spinner-display { font-size: 32px; width: 48px; }
    .spinner-controls { flex-direction: row; margin-left: 0; width: 100%; }
    .btn-spin, .btn-spin-del { flex: 1; padding: 10px 12px; font-size: 12px; }
    .confirm-chars { gap: 6px; padding: 10px; }
    .confirm-tile { padding: 8px 12px; font-size: 14px; }
    .gender-options { flex-wrap: wrap; gap: 8px; position: relative; min-height: 50px; }
    .gender-btn { flex: none; width: calc(33% - 6px); padding: 10px; font-size: 13px; }
    .captcha-target-num { font-size: 22px; }
    .slider-value { font-size: 18px; }
    .checkbox-container label { font-size: 12px; }
    .btn-primary, .btn-secondary, .btn-submit { padding: 11px 16px; font-size: 14px; }
    .toast { top: 12px; right: 12px; left: 12px; font-size: 13px; padding: 10px 14px; }
    .reveal-stats { gap: 16px; flex-wrap: wrap; justify-content: center; }
    .stat-number { font-size: 22px; }
}
