﻿/* ========================================
   时空见证 ChronoWitness - 多主题系统
   6种高级色调: 蓝、紫、橘、红、绿、青
   ======================================== */

/* ===== CSS Variables ===== */
:root {
  /* 通用变量（非色调相关） */
  --text-primary: #E8F0FF;
  --text-secondary: #A8B8D8;
  --text-muted: #6B7BB0;
  --success: #64FFDA;
  --warning: #FFD54F;
  --danger: #FF5252;
  --info: #40C4FF;

  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* 过渡 */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* 字体 */
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', sans-serif;

  /* 阴影（通用） */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.55);

  /* 默认 = 蓝色主题（通过JS设置） */
}

/* ===== 6种主题色调 ===== */

/* 1. 星海蓝（默认） — 深邃科技蓝 */
.theme-blue {
  --bg-deep: #0D1442;
  --bg-mid: #1A237E;
  --bg-light: #283593;
  --accent-pink: #3B82F6;
  --accent-pink-light: #60A5FA;
  --accent-gold: #06B6D4;
  --accent-gold-light: #67E8F9;
  --accent-purple: #60A5FA;
  --grad-primary: linear-gradient(135deg, #3B82F6 0%, #06B6D4 100%);
  --grad-bg: linear-gradient(180deg, #0D1442 0%, #1A237E 50%, #0D1442 100%);
  --grad-card: linear-gradient(145deg, rgba(40, 53, 147, 0.5) 0%, rgba(26, 35, 126, 0.7) 100%);
  --grad-glow: radial-gradient(circle, rgba(59, 130, 246, 0.18) 0%, transparent 70%);
  --grad-portal: conic-gradient(from 0deg, #3B82F6, #06B6D4, #60A5FA, #3B82F6);
  --shadow-glow-pink: 0 0 20px rgba(59, 130, 246, 0.35);
  --shadow-glow-gold: 0 0 20px rgba(6, 182, 212, 0.35);
  --theme-name: '蓝';
}

/* 2. 星海紫（原有） — 神秘紫色 */
.theme-purple {
  --bg-deep: #1A0A2E;
  --bg-mid: #2D1B4E;
  --bg-light: #4A2C6E;
  --accent-pink: #9D4EDD;
  --accent-pink-light: #C77DFF;
  --accent-gold: #00B4D8;
  --accent-gold-light: #48CAE4;
  --accent-purple: #C77DFF;
  --grad-primary: linear-gradient(135deg, #9D4EDD 0%, #00B4D8 100%);
  --grad-bg: linear-gradient(180deg, #1A0A2E 0%, #2D1B4E 50%, #1A0A2E 100%);
  --grad-card: linear-gradient(145deg, rgba(74, 44, 110, 0.5) 0%, rgba(45, 27, 78, 0.7) 100%);
  --grad-glow: radial-gradient(circle, rgba(157, 78, 221, 0.18) 0%, transparent 70%);
  --grad-portal: conic-gradient(from 0deg, #9D4EDD, #00B4D8, #C77DFF, #9D4EDD);
  --shadow-glow-pink: 0 0 20px rgba(157, 78, 221, 0.35);
  --shadow-glow-gold: 0 0 20px rgba(0, 180, 216, 0.35);
  --theme-name: '紫';
}

/* 3. 熔岩橘 — 暖调高级橘（参考小米海湾蓝的暖色系） */
.theme-orange {
  --bg-deep: #1A0E05;
  --bg-mid: #3D1F0A;
  --bg-light: #5C2E0F;
  --accent-pink: #F97316;
  --accent-pink-light: #FB923C;
  --accent-gold: #FBBF24;
  --accent-gold-light: #FCD34D;
  --accent-purple: #FB923C;
  --grad-primary: linear-gradient(135deg, #F97316 0%, #FBBF24 100%);
  --grad-bg: linear-gradient(180deg, #1A0E05 0%, #3D1F0A 50%, #1A0E05 100%);
  --grad-card: linear-gradient(145deg, rgba(92, 46, 15, 0.5) 0%, rgba(61, 31, 10, 0.7) 100%);
  --grad-glow: radial-gradient(circle, rgba(249, 115, 22, 0.18) 0%, transparent 70%);
  --grad-portal: conic-gradient(from 0deg, #F97316, #FBBF24, #FB923C, #F97316);
  --shadow-glow-pink: 0 0 20px rgba(249, 115, 22, 0.35);
  --shadow-glow-gold: 0 0 20px rgba(251, 191, 36, 0.35);
  --theme-name: '橘';
}

/* 4. 烈焰红 — 深红高级感 */
.theme-red {
  --bg-deep: #1A0505;
  --bg-mid: #3D0A0A;
  --bg-light: #5C1212;
  --accent-pink: #EF4444;
  --accent-pink-light: #F87171;
  --accent-gold: #F59E0B;
  --accent-gold-light: #FBBF24;
  --accent-purple: #F87171;
  --grad-primary: linear-gradient(135deg, #EF4444 0%, #F59E0B 100%);
  --grad-bg: linear-gradient(180deg, #1A0505 0%, #3D0A0A 50%, #1A0505 100%);
  --grad-card: linear-gradient(145deg, rgba(92, 18, 18, 0.5) 0%, rgba(61, 10, 10, 0.7) 100%);
  --grad-glow: radial-gradient(circle, rgba(239, 68, 68, 0.18) 0%, transparent 70%);
  --grad-portal: conic-gradient(from 0deg, #EF4444, #F59E0B, #F87171, #EF4444);
  --shadow-glow-pink: 0 0 20px rgba(239, 68, 68, 0.35);
  --shadow-glow-gold: 0 0 20px rgba(245, 158, 11, 0.35);
  --theme-name: '红';
}

/* 5. 翡翠绿 — 自然高级绿（参考小米翡翠绿） */
.theme-green {
  --bg-deep: #051A0E;
  --bg-mid: #0A3D1F;
  --bg-light: #0F5C2E;
  --accent-pink: #10B981;
  --accent-pink-light: #34D399;
  --accent-gold: #84CC16;
  --accent-gold-light: #A3E635;
  --accent-purple: #34D399;
  --grad-primary: linear-gradient(135deg, #10B981 0%, #84CC16 100%);
  --grad-bg: linear-gradient(180deg, #051A0E 0%, #0A3D1F 50%, #051A0E 100%);
  --grad-card: linear-gradient(145deg, rgba(15, 92, 46, 0.5) 0%, rgba(10, 61, 31, 0.7) 100%);
  --grad-glow: radial-gradient(circle, rgba(16, 185, 129, 0.18) 0%, transparent 70%);
  --grad-portal: conic-gradient(from 0deg, #10B981, #84CC16, #34D399, #10B981);
  --shadow-glow-pink: 0 0 20px rgba(16, 185, 129, 0.35);
  --shadow-glow-gold: 0 0 20px rgba(132, 204, 22, 0.35);
  --theme-name: '绿';
}

/* 6. 海湾青 — 冷调高级青（参考小米海湾蓝） */
.theme-cyan {
  --bg-deep: #051A1A;
  --bg-mid: #0A3D3D;
  --bg-light: #0F5C5C;
  --accent-pink: #06B6D4;
  --accent-pink-light: #22D3EE;
  --accent-gold: #2DD4BF;
  --accent-gold-light: #5EEAD4;
  --accent-purple: #22D3EE;
  --grad-primary: linear-gradient(135deg, #06B6D4 0%, #2DD4BF 100%);
  --grad-bg: linear-gradient(180deg, #051A1A 0%, #0A3D3D 50%, #051A1A 100%);
  --grad-card: linear-gradient(145deg, rgba(15, 92, 92, 0.5) 0%, rgba(10, 61, 61, 0.7) 100%);
  --grad-glow: radial-gradient(circle, rgba(6, 182, 212, 0.18) 0%, transparent 70%);
  --grad-portal: conic-gradient(from 0deg, #06B6D4, #2DD4BF, #22D3EE, #06B6D4);
  --shadow-glow-pink: 0 0 20px rgba(6, 182, 212, 0.35);
  --shadow-glow-gold: 0 0 20px rgba(45, 212, 191, 0.35);
  --theme-name: '青';
}

/* ===== Reset & Base ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  line-height: 1.6;
  transition: background 0.6s ease, color 0.6s ease;
}

/* 星空背景 */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--grad-bg);
  z-index: -2;
}

body::after {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(232, 240, 255, 0.5), transparent),
    radial-gradient(1px 1px at 60% 70%, rgba(0, 188, 212, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 50% 50%, rgba(124, 77, 255, 0.4), transparent),
    radial-gradient(1px 1px at 80% 10%, rgba(232, 240, 255, 0.5), transparent),
    radial-gradient(2px 2px at 90% 60%, rgba(0, 188, 212, 0.3), transparent),
    radial-gradient(1px 1px at 33% 80%, rgba(232, 240, 255, 0.4), transparent),
    radial-gradient(1.5px 1.5px at 15% 90%, rgba(124, 77, 255, 0.3), transparent);
  background-size: 200% 200%;
  animation: starfield 60s linear infinite;
  z-index: -1;
  pointer-events: none;
}

@keyframes starfield {
  0% { background-position: 0% 0%; }
  100% { background-position: 200% 200%; }
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  line-height: 1.3;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }

a {
  color: var(--accent-pink);
  text-decoration: none;
  cursor: pointer;
  transition: color var(--transition-fast);
}

a:hover { color: var(--accent-pink-light); }

/* ===== Layout ===== */
#app {
  min-height: 100vh;
  position: relative;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

.container-narrow {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}

.screen {
  display: none;
  animation: fadeInUp 0.4s ease;
}

.screen.active {
  display: block;
}

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

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

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

/* ===== Navbar ===== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 20, 66, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 77, 255, 0.2);
  padding: 12px 0;
}

.navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.navbar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 1.3rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-logo-img {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  object-fit: cover;
  filter: drop-shadow(0 0 8px var(--accent-pink));
  animation: logo-spin 6s linear infinite;
  transition: filter 0.6s ease;
}

@keyframes logo-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.navbar-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.navbar-link {
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  transition: color var(--transition-fast);
}

.navbar-link:hover { color: var(--text-primary); }

.navbar-user {
  display: flex;
  align-items: center;
  gap: 12px;
}

.navbar-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--bg-deep);
  cursor: pointer;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border: none;
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-normal);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: var(--grad-primary);
  color: var(--bg-deep);
  box-shadow: var(--shadow-glow-pink);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124, 77, 255, 0.5);
}

.btn-secondary {
  background: rgba(124, 77, 255, 0.15);
  color: var(--text-primary);
  border: 1px solid rgba(124, 77, 255, 0.3);
}

.btn-secondary:hover {
  background: color-mix(in srgb, var(--accent-pink) 25%, transparent);
  border-color: var(--accent-pink);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(124, 77, 255, 0.2);
}

.btn-ghost:hover {
  color: var(--text-primary);
  border-color: var(--accent-pink);
}

.btn-danger {
  background: rgba(232, 122, 122, 0.15);
  color: var(--danger);
  border: 1px solid rgba(232, 122, 122, 0.3);
}

.btn-danger:hover {
  background: rgba(232, 122, 122, 0.25);
}

.btn-sm {
  padding: 8px 18px;
  font-size: 0.85rem;
}

.btn-lg {
  padding: 16px 36px;
  font-size: 1.1rem;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-icon {
  padding: 10px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

/* ===== Cards ===== */
.card {
  background: var(--grad-card);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
}

.card:hover {
  border-color: rgba(124, 77, 255, 0.3);
  box-shadow: var(--shadow-lg);
}

.card-glow {
  position: relative;
  overflow: hidden;
}

.card-glow::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: var(--grad-glow);
  opacity: 0;
  transition: opacity var(--transition-slow);
  pointer-events: none;
}

.card-glow:hover::before { opacity: 1; }

/* ===== Forms ===== */
.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 12px 16px;
  background: rgba(13, 20, 66, 0.6);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--accent-pink);
  box-shadow: 0 0 0 3px rgba(124, 77, 255, 0.15);
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: none;
  overflow: hidden;
  min-height: 100px;
  field-sizing: content;
}

.form-select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23C484B0' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

.form-select option {
  background: var(--bg-mid);
  color: var(--text-primary);
}

.form-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.form-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 6px;
}

/* Radio & Checkbox */
.radio-group,
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.radio-item,
.checkbox-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: rgba(13, 20, 66, 0.4);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.radio-item:hover,
.checkbox-item:hover {
  border-color: rgba(124, 77, 255, 0.3);
  background: rgba(13, 20, 66, 0.6);
}

.radio-item input,
.checkbox-item input {
  accent-color: var(--accent-pink);
  width: 18px;
  height: 18px;
}

.radio-item.selected,
.checkbox-item.selected {
  border-color: var(--accent-pink);
  background: rgba(124, 77, 255, 0.1);
  box-shadow: var(--shadow-glow-pink);
}

/* Range Slider */
.range-slider {
  -webkit-appearance: none;
  width: 100%;
  height: 6px;
  background: rgba(124, 77, 255, 0.2);
  border-radius: var(--radius-full);
  outline: none;
}

.range-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  background: var(--grad-primary);
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow-glow-pink);
  transition: transform var(--transition-fast);
}

.range-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.range-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  background: var(--accent-pink);
  border-radius: 50%;
  cursor: pointer;
  border: none;
  box-shadow: var(--shadow-glow-pink);
}

.range-value {
  display: inline-block;
  min-width: 50px;
  text-align: center;
  font-weight: 700;
  color: var(--accent-gold);
  font-size: 1.1rem;
}

/* ===== Landing Page ===== */
.hero {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: center;
  width: 100%;
}

.hero-text h1 {
  font-size: 3.5rem;
  line-height: 1.2;
  margin-bottom: 20px;
}

.hero-text h1 .gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-text p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 500px;
}

.hero-cta {
  display: flex;
  gap: 16px;
  margin-bottom: 40px;
}

.hero-stats {
  display: flex;
  gap: 32px;
}

.hero-stat {
  text-align: left;
}

.hero-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent-gold);
}

.hero-stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hero-image {
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.hero-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: var(--radius-xl);
}

.hero-image::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--accent-pink) 0%, transparent 50%, var(--accent-gold) 100%);
  opacity: 0.15;
  pointer-events: none;
  transition: background 0.6s ease;
}

/* Features Section */
.features-section {
  padding: 80px 0;
}

.section-title {
  text-align: center;
  margin-bottom: 48px;
}

.section-title h2 {
  font-size: 2.2rem;
  margin-bottom: 12px;
}

.section-title h2 .gradient-text {
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.section-title p {
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}

.feature-card {
  text-align: center;
  padding: 32px 24px;
}

.feature-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 20px;
  border-radius: var(--radius-lg);
  background: rgba(124, 77, 255, 0.1);
  border: 1px solid rgba(124, 77, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}

.feature-card h3 {
  margin-bottom: 10px;
  font-size: 1.2rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Process Section */
.process-section {
  padding: 80px 0;
}

.process-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 800px;
  margin: 0 auto;
}

.process-step {
  display: flex;
  gap: 24px;
  position: relative;
  padding-bottom: 40px;
}

.process-step:last-child { padding-bottom: 0; }

.process-step::before {
  content: '';
  position: absolute;
  left: 23px;
  top: 48px;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-pink), transparent);
}

.process-step:last-child::before { display: none; }

.process-num {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: var(--bg-deep);
  flex-shrink: 0;
  z-index: 1;
}

.process-content h4 {
  margin-bottom: 6px;
  color: var(--accent-gold);
}

.process-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* ===== Auth Pages ===== */
.auth-page {
  min-height: calc(100vh - 70px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 0;
}

.auth-card {
  max-width: 440px;
  width: 100%;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 8px;
}

.auth-card .auth-subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.auth-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 28px;
  background: rgba(13, 20, 66, 0.4);
  border-radius: var(--radius-full);
  padding: 4px;
}

.auth-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  border-radius: var(--radius-full);
  cursor: pointer;
  font-weight: 600;
  color: var(--text-muted);
  transition: all var(--transition-fast);
  font-size: 0.9rem;
}

.auth-tab.active {
  background: var(--grad-primary);
  color: var(--bg-deep);
}

.auth-divider {
  text-align: center;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 35%;
  height: 1px;
  background: rgba(124, 77, 255, 0.15);
}

.auth-divider::before { left: 0; }
.auth-divider::after { right: 0; }

/* ===== Dashboard ===== */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.dashboard-header h2 {
  font-size: 1.8rem;
}

.dashboard-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}

.stat-icon.pink { background: rgba(124, 77, 255, 0.15); }
.stat-icon.gold { background: rgba(0, 188, 212, 0.15); }
.stat-icon.green { background: rgba(125, 211, 160, 0.15); }
.stat-icon.blue { background: rgba(122, 184, 232, 0.15); }

.stat-info h4 {
  font-size: 1.5rem;
  color: var(--text-primary);
}

.stat-info p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Project Grid */
.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.project-card {
  padding: 0;
  overflow: hidden;
  cursor: pointer;
}

.project-card-header {
  height: 120px;
  background: var(--grad-primary);
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: 16px;
}
}

.project-card-header::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(13, 20, 66, 0.8), transparent);
}

.project-card-header h4 {
  position: relative;
  z-index: 1;
  color: var(--text-primary);
  font-size: 1.1rem;
  flex: 1;
}

.project-delete-btn {
  position: relative;
  z-index: 2;
  transition: all var(--transition-normal);
}
.project-delete-btn:hover {
  opacity: 1 !important;
  color: var(--accent-pink) !important;
  transform: scale(1.2);
}

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

.project-card-body {
  padding: 20px;
}

.project-card-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.project-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.project-status.pending { background: rgba(240, 199, 94, 0.15); color: var(--warning); }
.project-status.in-progress { background: rgba(122, 184, 232, 0.15); color: var(--info); }
.project-status.completed { background: rgba(125, 211, 160, 0.15); color: var(--success); }

.project-card-date {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.project-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.project-card-progress {
  height: 6px;
  background: rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.project-card-progress-bar {
  height: 100%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width var(--transition-slow);
}

/* New Project Card */
.project-card-new {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  border: 2px dashed rgba(124, 77, 255, 0.3);
  background: transparent;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.project-card-new:hover {
  border-color: var(--accent-pink);
  background: rgba(124, 77, 255, 0.05);
}

.project-card-new .plus-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: var(--accent-pink);
  margin-bottom: 12px;
  transition: all var(--transition-normal);
}

.project-card-new:hover .plus-icon {
  transform: scale(1.1);
  background: var(--grad-primary);
  color: var(--bg-deep);
}

/* ===== Wizard ===== */
.wizard-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 0;
}

.wizard-header {
  text-align: center;
  margin-bottom: 32px;
}

.wizard-progress {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 24px;
  flex-wrap: wrap;
}

.wizard-phase {
  display: flex;
  align-items: center;
  gap: 8px;
}

.wizard-phase-dot {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.15);
  border: 2px solid rgba(124, 77, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: all var(--transition-normal);
  cursor: pointer;
}

.wizard-phase-dot.active {
  background: var(--grad-primary);
  border-color: var(--accent-pink);
  color: var(--bg-deep);
  box-shadow: var(--shadow-glow-pink);
}

.wizard-phase-dot.completed {
  background: rgba(125, 211, 160, 0.2);
  border-color: var(--success);
  color: var(--success);
}

.wizard-phase-line {
  width: 40px;
  height: 2px;
  background: rgba(124, 77, 255, 0.2);
  margin: 0 4px;
}

.wizard-phase-line.completed {
  background: var(--success);
}

.wizard-phase-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 6px;
}

.wizard-phase-label.active {
  color: var(--accent-pink);
}

.wizard-step-title {
  font-size: 1.5rem;
  margin-bottom: 8px;
  text-align: center;
}

.wizard-step-desc {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 32px;
  font-size: 0.95rem;
}

.wizard-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid rgba(124, 77, 255, 0.1);
}

/* Gate Confirmation */
.gate-banner {
  background: rgba(0, 188, 212, 0.08);
  border: 1px solid rgba(0, 188, 212, 0.2);
  border-radius: var(--radius-lg);
  padding: 16px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.gate-banner-icon {
  font-size: 1.5rem;
}

.gate-banner-text {
  flex: 1;
}

.gate-banner-text strong {
  color: var(--accent-gold);
}

.gate-banner-text p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

/* Loading Spinner */
.loading-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 20, 66, 0.9);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  flex-direction: column;
  gap: 20px;
}

.loading-overlay.active {
  display: flex;
}

.loading-spinner {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: 3px solid rgba(124, 77, 255, 0.2);
  border-top-color: var(--accent-pink);
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.loading-subtext {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ===== Validation Report ===== */
.validation-report {
  margin-top: 16px;
}

.validation-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(13, 20, 66, 0.4);
  border-radius: var(--radius-md);
  margin-bottom: 10px;
  border-left: 3px solid transparent;
}

.validation-item.verified { border-left-color: var(--success); }
.validation-item.warning { border-left-color: var(--warning); }
.validation-item.fiction { border-left-color: var(--info); }

.validation-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

.validation-content {
  flex: 1;
}

.validation-content strong {
  display: block;
  margin-bottom: 4px;
}

.validation-content p {
  font-size: 0.85rem;
  color: var(--text-secondary);
}

.validation-badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 0.7rem;
  font-weight: 600;
  margin-left: 8px;
}

.validation-badge.verified { background: rgba(125, 211, 160, 0.15); color: var(--success); }
.validation-badge.warning { background: rgba(240, 199, 94, 0.15); color: var(--warning); }
.validation-badge.fiction { background: rgba(122, 184, 232, 0.15); color: var(--info); }

/* ===== Character Upload ===== */
.character-upload-area {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 24px;
}

.character-slot {
  text-align: center;
}

.character-upload-box {
  width: 180px;
  height: 220px;
  margin: 0 auto 12px;
  border: 2px dashed rgba(124, 77, 255, 0.3);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  background: rgba(13, 20, 66, 0.3);
  overflow: hidden;
  position: relative;
}

.character-upload-box:hover {
  border-color: var(--accent-pink);
  background: rgba(124, 77, 255, 0.05);
}

.character-upload-box.has-image {
  border-style: solid;
  border-color: var(--accent-pink);
}

.character-upload-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.character-upload-placeholder {
  text-align: center;
  color: var(--text-muted);
}

.character-upload-placeholder .icon {
  font-size: 2rem;
  margin-bottom: 8px;
}

.character-upload-placeholder p {
  font-size: 0.85rem;
}

.ai-analysis-result {
  background: rgba(13, 20, 66, 0.5);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-top: 20px;
}

.ai-analysis-result h4 {
  color: var(--accent-gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.analysis-section {
  margin-bottom: 16px;
}

.analysis-section-title {
  font-size: 0.85rem;
  color: var(--accent-pink);
  margin-bottom: 8px;
  font-weight: 600;
}

.analysis-section ul {
  list-style: none;
  padding-left: 0;
}

.analysis-section li {
  padding: 4px 0;
  font-size: 0.9rem;
  color: var(--text-secondary);
  padding-left: 20px;
  position: relative;
}

.analysis-section li::before {
  content: '•';
  color: var(--accent-pink);
  position: absolute;
  left: 8px;
}

/* ===== Story Display ===== */
.story-display {
  background: rgba(13, 20, 66, 0.4);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-height: 500px;
  overflow-y: auto;
  margin-bottom: 16px;
}

.story-display::-webkit-scrollbar {
  width: 6px;
}

.story-display::-webkit-scrollbar-track {
  background: rgba(13, 20, 66, 0.3);
  border-radius: var(--radius-full);
}

.story-display::-webkit-scrollbar-thumb {
  background: rgba(124, 77, 255, 0.3);
  border-radius: var(--radius-full);
}

.story-chapter {
  margin-bottom: 24px;
}

.story-chapter-title {
  color: var(--accent-gold);
  font-size: 1.1rem;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid rgba(0, 188, 212, 0.15);
}

.story-chapter p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.8;
}

/* ===== Consistency Plan Table ===== */
.consistency-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin-bottom: 16px;
}

.consistency-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(124, 77, 255, 0.1);
  color: var(--accent-pink);
  font-size: 0.85rem;
  font-weight: 600;
  border-bottom: 1px solid rgba(124, 77, 255, 0.2);
}

.consistency-table th:first-child { border-radius: var(--radius-md) 0 0 0; }
.consistency-table th:last-child { border-radius: 0 var(--radius-md) 0 0; }

.consistency-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(124, 77, 255, 0.08);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.consistency-table tr:last-child td { border-bottom: none; }
.consistency-table tr:last-child td:first-child { border-radius: 0 0 0 var(--radius-md); }
.consistency-table tr:last-child td:last-child { border-radius: 0 0 var(--radius-md) 0; }

/* Color Palette Display */
.color-palette {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.color-swatch {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 2px solid rgba(232, 240, 255, 0.2);
  cursor: pointer;
  position: relative;
}

.color-swatch:hover {
  transform: scale(1.15);
  border-color: var(--text-primary);
}

/* ===== Prompt Display ===== */
.prompt-block {
  background: rgba(13, 20, 66, 0.5);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-bottom: 12px;
  font-family: 'Consolas', 'Monaco', monospace;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.prompt-block .prompt-label {
  color: var(--accent-pink);
  font-weight: 600;
  margin-bottom: 6px;
  font-family: var(--font-sans);
}

/* Self-check List */
.checklist {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 16px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(13, 20, 66, 0.3);
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
}

.checklist-item .check-icon {
  color: var(--success);
  font-size: 1rem;
}

.checklist-item.fail .check-icon {
  color: var(--danger);
}

/* ===== Model Comparison ===== */
.model-comparison {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-bottom: 24px;
}

.model-card {
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-normal);
  border: 2px solid transparent;
}

.model-card:hover {
  transform: translateY(-4px);
}

.model-card.selected {
  border-color: var(--accent-pink);
  box-shadow: var(--shadow-glow-pink);
}

.model-card-image {
  width: 100%;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 12px;
  background: rgba(13, 20, 66, 0.5);
}

.model-card-image img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.model-card-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 77, 255, 0.1), rgba(0, 188, 212, 0.1));
  color: var(--text-muted);
  font-size: 0.85rem;
}

.model-card-name {
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 4px;
}

.model-card-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.model-select-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--grad-primary);
  color: var(--bg-deep);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
}

.model-card.selected .model-select-badge {
  display: flex;
}

/* ===== Image Generation & Version ===== */
.image-workspace {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

.image-canvas {
  background: rgba(13, 20, 66, 0.4);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.image-display {
  width: 100%;
  aspect-ratio: 4/3;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  position: relative;
  background: rgba(13, 20, 66, 0.5);
}

.image-display img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-tools {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.image-tool-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 20px;
  background: rgba(124, 77, 255, 0.1);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.image-tool-btn:hover {
  background: rgba(124, 77, 255, 0.2);
  color: var(--text-primary);
}

.image-tool-btn .tool-icon {
  font-size: 1.3rem;
}

/* Version History Sidebar */
.version-sidebar {
  background: rgba(13, 20, 66, 0.4);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.version-sidebar h4 {
  margin-bottom: 16px;
  color: var(--accent-gold);
  font-size: 1rem;
}

.version-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.version-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(13, 20, 66, 0.3);
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.version-item:hover {
  border-color: rgba(124, 77, 255, 0.2);
}

.version-item.current {
  border-color: var(--accent-pink);
  background: rgba(124, 77, 255, 0.1);
}

.version-thumb {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: rgba(124, 77, 255, 0.1);
}

.version-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.version-info {
  flex: 1;
  min-width: 0;
}

.version-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.version-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.version-actions {
  display: flex;
  gap: 4px;
}

.version-action-btn {
  padding: 4px 8px;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  background: rgba(124, 77, 255, 0.1);
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.version-action-btn:hover {
  background: rgba(124, 77, 255, 0.2);
  color: var(--text-primary);
}

/* Page Navigation */
.page-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding: 12px 0;
}

.page-nav-info {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.page-nav-buttons {
  display: flex;
  gap: 8px;
}

/* Inpaint Mode */
.inpaint-overlay {
  position: absolute;
  inset: 0;
  cursor: crosshair;
  display: none;
}

.inpaint-overlay.active {
  display: block;
}

.inpaint-selection {
  position: absolute;
  border: 2px dashed var(--accent-gold);
  background: rgba(0, 188, 212, 0.1);
  border-radius: var(--radius-sm);
}

.inpaint-prompt-box {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 80%;
  display: flex;
  gap: 8px;
  background: rgba(13, 20, 66, 0.95);
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124, 77, 255, 0.3);
}

/* ===== Music Selection ===== */
.music-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.music-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: rgba(13, 20, 66, 0.4);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.music-item:hover {
  border-color: rgba(124, 77, 255, 0.3);
  background: rgba(13, 20, 66, 0.6);
}

.music-item.selected {
  border-color: var(--accent-pink);
  background: rgba(124, 77, 255, 0.1);
}

.music-play-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--grad-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  color: var(--bg-deep);
  cursor: pointer;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.music-play-btn:hover {
  transform: scale(1.1);
}

.music-info {
  flex: 1;
  min-width: 0;
}

.music-name {
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}

.music-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.music-duration {
  font-size: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

.music-waveform {
  display: flex;
  align-items: center;
  gap: 2px;
  height: 24px;
  flex-shrink: 0;
}

.music-waveform-bar {
  width: 3px;
  background: var(--accent-pink);
  border-radius: var(--radius-full);
  opacity: 0.3;
  transition: opacity var(--transition-fast);
}

.music-item.playing .music-waveform-bar {
  opacity: 1;
  animation: wave 0.5s ease-in-out infinite alternate;
}

.music-item.playing .music-waveform-bar:nth-child(1) { animation-delay: 0s; height: 40%; }
.music-item.playing .music-waveform-bar:nth-child(2) { animation-delay: 0.1s; height: 70%; }
.music-item.playing .music-waveform-bar:nth-child(3) { animation-delay: 0.2s; height: 50%; }
.music-item.playing .music-waveform-bar:nth-child(4) { animation-delay: 0.15s; height: 90%; }
.music-item.playing .music-waveform-bar:nth-child(5) { animation-delay: 0.25s; height: 60%; }

@keyframes wave {
  to { transform: scaleY(0.5); }
}

/* ===== Picture Book Reader ===== */
.reader-container {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg-deep);
}

/* Fullscreen mode styles */
#screen-reader:fullscreen {
  width: 100vw;
  height: 100vh;
  overflow-y: auto;
}
#screen-reader:fullscreen .reader-container {
  min-height: 100vh;
}
#screen-reader:fullscreen .reader-body {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}
#screen-reader:-webkit-full-screen {
  width: 100vw;
  height: 100vh;
}
#screen-reader:-webkit-full-screen .reader-body {
  max-width: 500px;
  margin: 0 auto;
  width: 100%;
}

.reader-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: rgba(13, 20, 66, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(124, 77, 255, 0.15);
}

.reader-title {
  font-size: 1.1rem;
  font-weight: 700;
}

.reader-controls {
  display: flex;
  gap: 8px;
}

.reader-control-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.1);
  border: 1px solid rgba(124, 77, 255, 0.2);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

.reader-control-btn:hover {
  background: rgba(124, 77, 255, 0.2);
  color: var(--text-primary);
}

.reader-control-btn.active {
  background: var(--grad-primary);
  color: var(--bg-deep);
}

.reader-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  position: relative;
  overflow-y: auto;
}

.book-page {
  max-width: 450px;
  width: 100%;
  aspect-ratio: 9/16;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  box-shadow: var(--shadow-lg);
  background: var(--bg-mid);
}

.book-page-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.book-page-text {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 24px;
  background: linear-gradient(to top, rgba(13, 20, 66, 0.97) 0%, rgba(13, 20, 66, 0.85) 60%, transparent 100%);
}

.book-page-chapter {
  font-size: 0.8rem;
  color: var(--accent-gold);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.book-page-narration {
  font-size: 1.05rem;
  color: var(--text-primary);
  line-height: 1.8;
}

.reader-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 24px;
  padding: 16px;
}

.reader-nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.15);
  border: 1px solid rgba(124, 77, 255, 0.3);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  transition: all var(--transition-fast);
}

.reader-nav-btn:hover {
  background: var(--grad-primary);
  color: var(--bg-deep);
}

.reader-nav-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.reader-progress {
  display: flex;
  gap: 4px;
  align-items: center;
}

.reader-progress-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(124, 77, 255, 0.2);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.reader-progress-dot.active {
  width: 24px;
  border-radius: var(--radius-full);
  background: var(--grad-primary);
}

/* Chapter Navigation */
.chapter-nav {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 50;
}

.chapter-nav-item {
  padding: 8px 14px;
  background: rgba(13, 20, 66, 0.8);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  backdrop-filter: blur(10px);
}

.chapter-nav-item:hover {
  color: var(--text-primary);
  border-color: var(--accent-pink);
}

.chapter-nav-item.active {
  background: var(--grad-primary);
  color: var(--bg-deep);
  border-color: transparent;
}

/* ===== Admin Dashboard ===== */
.admin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-chart-card {
  padding: 24px;
  margin-bottom: 20px;
}

.admin-chart-card h4 {
  margin-bottom: 20px;
  font-size: 1.1rem;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  height: 200px;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(124, 77, 255, 0.1);
}

.chart-bar-group {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  height: 100%;
  justify-content: flex-end;
}

.chart-bar {
  width: 100%;
  max-width: 40px;
  background: var(--grad-primary);
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: height var(--transition-slow);
  position: relative;
  min-height: 4px;
}

.chart-bar:hover {
  filter: brightness(1.2);
}

.chart-bar-value {
  position: absolute;
  top: -20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  color: var(--accent-gold);
  font-weight: 600;
}

.chart-bar-label {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* User Table */
.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.admin-table th {
  text-align: left;
  padding: 12px 16px;
  background: rgba(124, 77, 255, 0.1);
  color: var(--accent-pink);
  font-size: 0.85rem;
  font-weight: 600;
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(124, 77, 255, 0.08);
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.admin-table tr:hover td {
  background: rgba(124, 77, 255, 0.05);
}

/* ===== Toast Notifications ===== */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: rgba(26, 35, 126, 0.95);
  backdrop-filter: blur(20px);
  border: 1px solid rgba(124, 77, 255, 0.2);
  color: var(--text-primary);
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-lg);
  animation: slideInRight 0.3s ease;
  max-width: 360px;
}

.toast.success { border-color: var(--success); }
.toast.error { border-color: var(--danger); }
.toast.warning { border-color: var(--warning); }
.toast.info { border-color: var(--info); }

.toast-icon {
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* ===== Modal ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 20, 66, 0.85);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9998;
  padding: 24px;
}

.modal-overlay.active {
  display: flex;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--grad-card);
  border: 1px solid rgba(124, 77, 255, 0.2);
  border-radius: var(--radius-xl);
  padding: 32px;
  max-width: 560px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: fadeInUp 0.3s ease;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.modal-header h3 {
  font-size: 1.3rem;
}

.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-body {
  margin-bottom: 24px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

/* ===== Settings Page ===== */
.settings-section {
  margin-bottom: 32px;
}

.settings-section h3 {
  margin-bottom: 16px;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.api-key-guide {
  background: rgba(13, 20, 66, 0.4);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 20px;
}

.api-key-guide h4 {
  color: var(--accent-gold);
  margin-bottom: 12px;
  font-size: 1rem;
}

.api-key-guide ol {
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 2;
}

.api-key-guide a {
  color: var(--accent-pink);
  word-break: break-all;
}

.api-key-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
}

.api-key-status.connected { background: rgba(125, 211, 160, 0.15); color: var(--success); }
.api-key-status.disconnected { background: rgba(240, 199, 94, 0.15); color: var(--warning); }

/* ===== Utility ===== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-gold { color: var(--accent-gold); }
.text-pink { color: var(--accent-pink); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.gap-3 { gap: 24px; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1; }

.hidden { display: none !important; }
.w-full { width: 100%; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-pink { background: rgba(124, 77, 255, 0.15); color: var(--accent-pink); }
.badge-gold { background: rgba(0, 188, 212, 0.15); color: var(--accent-gold); }
.badge-green { background: rgba(125, 211, 160, 0.15); color: var(--success); }
.badge-blue { background: rgba(122, 184, 232, 0.15); color: var(--info); }

/* ===== Splash Screen (Loading Animation) ===== */
.splash-screen {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.8s ease, visibility 0.8s ease;
}

.splash-screen.fade-out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-bg {
  position: absolute;
  inset: 0;
  background: var(--grad-bg);
  transition: background 0.6s ease;
}

.splash-bg::after {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--grad-glow);
  pointer-events: none;
  transition: background 0.6s ease;
}

/* Stars */
.splash-stars {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.splash-star {
  position: absolute;
  background: #E8F0FF;
  border-radius: 50%;
  animation: twinkle var(--twinkle-duration, 3s) ease-in-out infinite;
  animation-delay: var(--twinkle-delay, 0s);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.2; transform: scale(0.8); }
  50% { opacity: 1; transform: scale(1.2); box-shadow: 0 0 6px rgba(232, 240, 255, 0.8); }
}

/* Shooting star */
.splash-shooting-star {
  position: absolute;
  width: 2px;
  height: 2px;
  background: linear-gradient(to right, transparent, #E8F0FF, transparent);
  border-radius: 50%;
  animation: shoot 4s linear infinite;
  animation-delay: var(--shoot-delay, 0s);
  opacity: 0;
}

@keyframes shoot {
  0% { opacity: 0; transform: translate(0, 0) rotate(-35deg); }
  5% { opacity: 1; }
  15% { opacity: 1; box-shadow: 0 0 10px #E8F0FF, -30px 20px 40px rgba(232, 240, 255, 0.3); }
  20% { opacity: 0; }
  100% { opacity: 0; transform: translate(400px, 280px) rotate(-35deg); }
}

/* Content */
.splash-content {
  position: relative;
  z-index: 10;
  text-align: center;
  max-width: 600px;
  padding: 0 24px;
}

/* Dream Bubbles */
.splash-dream-bubbles {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.dream-bubble {
  position: absolute;
  bottom: -120px;
  left: var(--left, 20%);
  width: var(--size, 80px);
  height: var(--size, 80px);
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid rgba(124, 77, 255, 0.4);
  box-shadow: 0 0 20px rgba(124, 77, 255, 0.3),
              inset 0 0 15px rgba(13, 20, 66, 0.3);
  animation: bubbleFloat 6s ease-in-out infinite;
  animation-delay: var(--delay, 0s);
  opacity: 0;
}

.dream-bubble img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@keyframes bubbleFloat {
  0% { bottom: -120px; opacity: 0; transform: scale(0.3) rotate(0deg); }
  10% { opacity: 0.9; transform: scale(1) rotate(5deg); }
  50% { opacity: 0.7; transform: scale(1.05) rotate(-5deg); }
  90% { opacity: 0.3; transform: scale(0.8) rotate(10deg); }
  100% { bottom: 110%; opacity: 0; transform: scale(0.3) rotate(15deg); }
}

/* Moon */
.splash-moon {
  font-size: 3rem;
  position: absolute;
  top: 12%;
  right: 15%;
  filter: drop-shadow(0 0 20px rgba(0, 188, 212, 0.5));
  animation: moonGlow 4s ease-in-out infinite;
}

@keyframes moonGlow {
  0%, 100% { filter: drop-shadow(0 0 15px rgba(0, 188, 212, 0.4)); transform: scale(1); }
  50% { filter: drop-shadow(0 0 30px rgba(0, 188, 212, 0.7)); transform: scale(1.05); }
}

/* Sleeping child */
/* Sleeping child element removed per user request */

/* Title */
.splash-title {
  margin-bottom: 40px;
  animation: titleFadeIn 1.5s ease 0.5s both;
}

@keyframes titleFadeIn {
  0% { opacity: 0; transform: translateY(20px); }
  100% { opacity: 1; transform: translateY(0); }
}

.splash-logo-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 16px;
  animation: logoFloat 3s ease-in-out infinite;
  transition: filter 0.6s ease;
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); filter: drop-shadow(0 0 20px var(--accent-pink)); }
  50% { transform: translateY(-8px); filter: drop-shadow(0 8px 30px var(--accent-gold)); }
}

.splash-title h1 {
  font-size: 2.8rem;
  font-weight: 800;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: 4px;
  animation: titleGlow 3s ease-in-out infinite;
  transition: background 0.6s ease;
}

@keyframes titleGlow {
  0%, 100% { filter: drop-shadow(0 0 10px rgba(124, 77, 255, 0.3)); }
  50% { filter: drop-shadow(0 0 25px rgba(0, 188, 212, 0.5)); }
}

.splash-title p {
  color: var(--text-secondary);
  font-size: 1.1rem;
  letter-spacing: 6px;
  opacity: 0.8;
}

/* Progress Bar */
.splash-progress {
  width: 320px;
  height: 6px;
  background: rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-full);
  overflow: hidden;
  margin: 0 auto 16px;
  position: relative;
}

.splash-progress::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(232, 240, 255, 0.1), transparent);
  animation: progressShimmer 2s linear infinite;
}

@keyframes progressShimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.splash-progress-bar {
  height: 100%;
  width: 0%;
  background: var(--grad-primary);
  border-radius: var(--radius-full);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-glow-gold);
  position: relative;
  z-index: 1;
}

.splash-progress-text {
  color: var(--text-muted);
  font-size: 0.85rem;
  letter-spacing: 2px;
  min-height: 1.2em;
  transition: opacity 0.3s ease;
}

/* Enter Button */
.splash-enter-btn {
  margin-top: 24px;
  padding: 12px 40px;
  background: var(--grad-primary);
  color: var(--bg-deep);
  border: none;
  border-radius: var(--radius-full);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: 2px;
  box-shadow: 0 4px 20px rgba(124, 77, 255, 0.4);
  animation: btnPulse 2s ease-in-out infinite;
  transition: transform 0.2s ease;
}

.splash-enter-btn:hover {
  transform: scale(1.05);
}

@keyframes btnPulse {
  0%, 100% { box-shadow: 0 4px 20px rgba(124, 77, 255, 0.4); }
  50% { box-shadow: 0 4px 30px rgba(0, 188, 212, 0.6); }
}

.splash-enter-btn.hidden {
  display: none;
}

/* ===== Empty Dashboard State ===== */
.empty-dashboard {
  text-align: center;
  padding: 60px 24px;
  max-width: 600px;
  margin: 0 auto;
}

.empty-dashboard-icon {
  font-size: 4rem;
  margin-bottom: 20px;
  animation: floatGentle 3s ease-in-out infinite;
  display: inline-block;
}

@keyframes floatGentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

.empty-dashboard h3 {
  font-size: 1.5rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.empty-dashboard p {
  color: var(--text-secondary);
  font-size: 1rem;
  margin-bottom: 28px;
  line-height: 1.8;
}

.empty-dashboard-guide {
  background: rgba(124, 77, 255, 0.06);
  border: 1px solid rgba(124, 77, 255, 0.15);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-top: 24px;
  text-align: left;
}

.empty-dashboard-guide h4 {
  color: var(--accent-gold);
  margin-bottom: 16px;
  font-size: 1rem;
  display: flex;
  align-items: center;
  gap: 8px;
}

.empty-dashboard-guide ol {
  padding-left: 20px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 2.2;
}

.empty-dashboard-guide ol li::marker {
  color: var(--accent-pink);
  font-weight: 700;
}

.empty-dashboard-guide a {
  color: var(--accent-pink);
  cursor: pointer;
  text-decoration: underline;
}

.api-key-alert {
  background: rgba(240, 199, 94, 0.08);
  border: 1px solid rgba(240, 199, 94, 0.25);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.api-key-alert-icon {
  font-size: 2rem;
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.api-key-alert-text {
  flex: 1;
}

.api-key-alert-text h4 {
  color: var(--warning);
  font-size: 1rem;
  margin-bottom: 4px;
}

.api-key-alert-text p {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin: 0;
}

/* Collapsible model config */
.model-config-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-top: 12px;
  user-select: none;
  transition: color 0.2s ease;
}

.model-config-toggle:hover {
  color: var(--accent-pink);
}

.model-config-toggle .arrow {
  transition: transform 0.3s ease;
  display: inline-block;
}

.model-config-toggle.expanded .arrow {
  transform: rotate(90deg);
}

.model-config-fields {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.model-config-fields.expanded {
  max-height: 500px;
}

/* Floating particles */
.particle {
  position: fixed;
  border-radius: 50%;
  pointer-events: none;
  z-index: -1;
  animation: float-up 15s linear infinite;
}

@keyframes float-up {
  0% {
    transform: translateY(100vh) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.6;
    transform: translateY(90vh) scale(1);
  }
  90% {
    opacity: 0.6;
  }
  100% {
    transform: translateY(-10vh) scale(0.5);
    opacity: 0;
  }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .hero-text p { margin: 0 auto 32px; }

  .hero-cta, .hero-stats {
    justify-content: center;
  }

  .character-upload-area {
    grid-template-columns: 1fr;
  }

  .image-workspace {
    grid-template-columns: 1fr;
  }

  .model-comparison {
    grid-template-columns: 1fr;
  }

  .checklist {
    grid-template-columns: 1fr;
  }

  .wizard-progress {
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .chapter-nav {
    display: none;
  }

  .navbar-links {
    gap: 12px;
  }

  .navbar-link {
    font-size: 0.85rem;
  }
}

/* ===== Theme Switcher ===== */
.theme-switcher {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
}

.theme-switcher-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.theme-switcher-btn:hover {
  transform: scale(1.15);
}

.theme-switcher-btn.active {
  border-color: var(--text-primary);
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

.theme-switcher-btn.active::after {
  content: '✓';
  position: absolute;
  color: #fff;
  font-size: 12px;
  text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.theme-color-blue { background: linear-gradient(135deg, #3B82F6, #06B6D4); }
.theme-color-purple { background: linear-gradient(135deg, #7C4DFF, #00BCD4); }
.theme-color-orange { background: linear-gradient(135deg, #F97316, #FBBF24); }
.theme-color-red { background: linear-gradient(135deg, #EF4444, #F59E0B); }
.theme-color-green { background: linear-gradient(135deg, #10B981, #84CC16); }
.theme-color-cyan { background: linear-gradient(135deg, #06B6D4, #2DD4BF); }

.theme-switcher-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-right: 2px;
  white-space: nowrap;
}

/* Portal animation follows theme */
.portal-glow {
  background: var(--grad-portal);
  transition: background 0.6s ease;
}

/* ===== AFP 用量浮层 ===== */
.afp-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9000;
  background: var(--grad-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  min-width: 200px;
  max-width: 320px;
  overflow: hidden;
  transition: all 0.3s ease;
}

.afp-widget:hover {
  border-color: var(--accent-pink);
  box-shadow: var(--shadow-glow-pink);
}

.afp-widget-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  cursor: pointer;
  user-select: none;
}

.afp-widget-icon {
  font-size: 1.4rem;
  line-height: 1;
}

.afp-widget-info {
  flex: 1;
}

.afp-widget-total {
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.afp-widget-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.afp-widget-toggle {
  font-size: 0.7rem;
  color: var(--text-muted);
  transition: transform 0.3s ease;
}

.afp-widget.expanded .afp-widget-toggle {
  transform: rotate(180deg);
}

.afp-widget-body {
  padding: 0 16px 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.afp-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 3px;
  margin: 12px 0 6px;
  overflow: hidden;
}

.afp-bar-fill {
  height: 100%;
  background: var(--grad-primary);
  border-radius: 3px;
  transition: width 0.5s ease;
  box-shadow: var(--shadow-glow-gold);
}

.afp-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.afp-steps {
  max-height: 240px;
  overflow-y: auto;
  margin-bottom: 10px;
}

.afp-step-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  font-size: 0.8rem;
}

.afp-step-item:last-child {
  border-bottom: none;
}

.afp-step-name {
  color: var(--text-secondary);
  flex: 1;
}

.afp-step-detail {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-left: 6px;
}

.afp-step-afp {
  font-weight: 600;
  color: var(--accent-gold-light);
  white-space: nowrap;
}

.afp-step-afp.image {
  color: var(--accent-pink-light);
}

.afp-estimates {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 8px;
  padding: 8px 10px;
  margin-bottom: 10px;
  font-size: 0.72rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.afp-estimates b {
  color: var(--accent-gold-light);
}

.afp-reset-btn {
  width: 100%;
  padding: 6px;
  background: rgba(255, 82, 82, 0.12);
  border: 1px solid rgba(255, 82, 82, 0.3);
  border-radius: 8px;
  color: #ff8a8a;
  font-size: 0.75rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.afp-reset-btn:hover {
  background: rgba(255, 82, 82, 0.2);
}

/* Scrollbar */
.afp-steps::-webkit-scrollbar {
  width: 4px;
}
.afp-steps::-webkit-scrollbar-track {
  background: transparent;
}
.afp-steps::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}

/* ===== 亲子教育调性增强 ===== */
/* 追加区块：仅增强视觉质感，不覆盖结构和功能 */

/* --- 1. 全局字体：圆润字体优先 --- */
:root {
  --font-sans: 'HarmonyOS Sans SC', 'Noto Sans SC', 'PingFang SC', -apple-system, 'Microsoft YaHei', sans-serif;
}

/* --- 2. 全局行高与段落间距 --- */
body {
  line-height: 1.75;
}

p, .form-label, .text-body, .project-card-desc {
  line-height: 1.78;
  letter-spacing: 0.01em;
}

/* --- 3. 标题字重柔化 --- */
h1, h2, h3, .section-title, .wizard-title {
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* --- 4. 按钮圆角加大 + hover微弹 --- */
.btn {
  border-radius: 14px;
}

.btn-primary,
.btn-secondary,
.btn-ghost,
.btn-danger {
  border-radius: 14px;
}

.btn-sm {
  border-radius: 12px;
}

.btn-lg {
  border-radius: 16px;
}

.btn:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.02);
}

.btn:active:not(:disabled) {
  transform: translateY(0) scale(0.98);
  transition-duration: 0.1s;
}

/* --- 5. 卡片暖色柔光阴影 + hover微弹 --- */
.card {
  box-shadow: 0 4px 18px rgba(255, 180, 100, 0.06), 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(255, 180, 100, 0.10), 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* --- 6. 输入框获焦暖色光晕 --- */
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--accent-gold, #FBBF24);
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18), 0 0 12px rgba(251, 191, 36, 0.08);
}

/* --- 7. 步骤指示器/进度条 糖果色渐变 --- */
.wizard-phase-dot.active {
  background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 50%, #A18CD1 100%);
  border-color: rgba(255, 154, 158, 0.6);
  box-shadow: 0 0 14px rgba(255, 154, 158, 0.35);
}

.wizard-phase-dot.completed {
  background: linear-gradient(135deg, #84FAB0 0%, #8FD3F4 100%);
  border-color: rgba(132, 250, 176, 0.5);
}

.wizard-phase-line {
  background: linear-gradient(90deg, rgba(255, 154, 158, 0.3), rgba(161, 140, 209, 0.3));
}

.splash-progress-bar,
.project-card-progress-bar {
  background: linear-gradient(90deg, #FF9A9E, #FECFEF, #A18CD1, #8FD3F4);
  background-size: 200% 100%;
  animation: candyShift 3s ease infinite;
}

@keyframes candyShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* --- 8. 卡片间距与按钮间距增大 --- */
.project-grid {
  gap: 16px;
}

.form-group {
  margin-bottom: 22px;
}

.btn + .btn {
  margin-left: 12px;
}

/* --- 9. 页面过渡动画 --- */
.card,
.form-group,
.wizard-phase-dot {
  animation: fadeSlideIn 0.4s ease both;
}

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

/* 错开动画延迟（最多5个） */
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }
.card:nth-child(4) { animation-delay: 0.20s; }
.card:nth-child(5) { animation-delay: 0.25s; }

/* --- 10. 进度条过渡平滑 --- */
.splash-progress-bar,
.project-card-progress-bar {
  transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- 11. 圆角柔化全局输入和选择器 --- */
.form-input,
.form-select,
.form-textarea {
  border-radius: 14px;
  padding: 13px 18px;
}

/* --- 12. 按钮文字微调（不那么粗） --- */
.btn {
  font-weight: 550;
}

/* ===== /亲子教育调性增强 ===== */

/* ===== 异步任务进度面板 ===== */
.task-progress-overlay {
  position: fixed;
  inset: 0;
  background: rgba(13, 20, 66, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  animation: fadeIn 0.3s ease;
}

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

.task-progress-card {
  background: linear-gradient(135deg, rgba(26, 35, 126, 0.95), rgba(13, 20, 66, 0.98));
  border: 1px solid rgba(124, 77, 255, 0.3);
  border-radius: 20px;
  padding: 40px;
  max-width: 520px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 40px rgba(124, 77, 255, 0.15);
}

.task-progress-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 8px;
}

.task-progress-header h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: #E8F0FF;
  margin: 0;
}

.task-progress-spinner {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 3px solid rgba(124, 77, 255, 0.2);
  border-top-color: #7C4DFF;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

.task-progress-subtitle {
  color: rgba(232, 240, 255, 0.6);
  font-size: 0.85rem;
  margin: 0 0 24px 0;
  line-height: 1.5;
}

.task-progress-bar-container {
  margin-bottom: 16px;
}

.task-progress-bar {
  width: 100%;
  height: 12px;
  background: rgba(13, 20, 66, 0.6);
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid rgba(124, 77, 255, 0.15);
}

.task-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #7C4DFF, #00BCD4);
  border-radius: 6px;
  transition: width 0.5s ease;
  box-shadow: 0 0 12px rgba(124, 77, 255, 0.5);
}

.task-progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 0.85rem;
  color: rgba(232, 240, 255, 0.7);
  font-weight: 600;
}

.task-status-message {
  color: #00BCD4;
  font-size: 0.9rem;
  margin-bottom: 16px;
  min-height: 1.2em;
}

.task-details {
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 24px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-details::-webkit-scrollbar {
  width: 4px;
}

.task-details::-webkit-scrollbar-thumb {
  background: rgba(124, 77, 255, 0.3);
  border-radius: 2px;
}

.task-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 0.82rem;
  background: rgba(13, 20, 66, 0.4);
  animation: slideIn 0.3s ease;
}

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

.task-detail-done { color: #4CAF50; }
.task-detail-fail { color: #f44336; }
.task-detail-active { color: #00BCD4; font-weight: 600; }
.task-detail-pending { color: rgba(232, 240, 255, 0.5); }
.task-detail-skip { color: rgba(232, 240, 255, 0.4); }

.task-progress-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
