/* ============================================
   哥哥AI - 主样式表
   基于云雾AI中转站设计风格改造
   ============================================ */

/* ----- CSS 变量（浅色主题） ----- */
:root {
  --primary: #0084ff;
  --primary-light: #59b0ff;
  --primary-dark: #0068cc;
  --primary-gradient: linear-gradient(180deg, #59b0ff, #2e8bff);
  --secondary: #6366f1;
  --secondary-light: #818cf8;
  --accent: #14b8a6;

  --bg-primary: #ffffff;
  --bg-secondary: #f8faff;
  --bg-tertiary: #f0f4ff;
  --bg-card: #ffffff;
  --bg-hover: #f0f4ff;

  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-tertiary: #94a3b8;
  --text-inverse: #ffffff;

  --border-color: #e2e8f0;
  --border-light: #f1f5f9;

  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -4px rgba(15, 23, 42, 0.08), 0 1px 4px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 8px 32px -8px rgba(15, 23, 42, 0.12), 0 4px 16px -6px rgba(15, 23, 42, 0.06);
  --shadow-xl: 0 20px 60px -12px rgba(15, 23, 42, 0.15);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --navbar-height: 64px;
  --sidebar-width: 280px;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-mono: 'SF Mono', 'Fira Code', 'Consolas', monospace;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ----- 深色主题 ----- */
[data-theme="dark"] {
  --primary: #60a5fa;
  --primary-light: #93bbfd;
  --primary-dark: #3b82f6;
  --primary-gradient: linear-gradient(180deg, #60a5fa, #3b82f6);
  --secondary: #818cf8;
  --secondary-light: #a5b4fc;
  --accent: #2dd4bf;

  --bg-primary: #0b0f1a;
  --bg-secondary: #101622;
  --bg-tertiary: #1a2235;
  --bg-card: #131b2a;
  --bg-hover: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-tertiary: #64748b;
  --text-inverse: #0f172a;

  --border-color: #1e293b;
  --border-light: #1a2235;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 16px -4px rgba(0, 0, 0, 0.3), 0 1px 4px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 8px 32px -8px rgba(0, 0, 0, 0.4), 0 4px 16px -6px rgba(0, 0, 0, 0.2);
  --shadow-xl: 0 20px 60px -12px rgba(0, 0, 0, 0.5);
}

/* ----- 全局样式 ----- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

a {
  color: var(--primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; }
svg { vertical-align: middle; }

/* ----- 滚动条 ----- */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-tertiary); }

/* ----- 导航栏 ----- */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--navbar-height);
  z-index: 1000;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(170%) blur(36px);
  -webkit-backdrop-filter: saturate(170%) blur(36px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.6);
  transition: background var(--transition-slow), border-color var(--transition-slow);
}

[data-theme="dark"] .navbar {
  background: rgba(11, 15, 26, 0.85);
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
}

.nav-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 40px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 20px;
  transition: opacity var(--transition-fast);
}
.nav-logo:hover { opacity: 0.85; color: var(--text-primary); }

.logo-icon { flex-shrink: 0; display: flex; }

.nav-links {
  display: flex;
  gap: 4px;
}

.nav-link {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
}
.nav-link:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}
.nav-link.active {
  color: var(--primary);
  background: rgba(0, 132, 255, 0.08);
}

[data-theme="dark"] .nav-link.active {
  background: rgba(96, 165, 250, 0.12);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ----- 主题切换 ----- */
.theme-toggle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.theme-toggle:hover {
  background: var(--border-color);
  color: var(--text-primary);
}
.theme-toggle .sun-icon { display: block; }
.theme-toggle .moon-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .moon-icon { display: block; }

/* ----- 按钮 ----- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-sans);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-decoration: none;
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary-gradient);
  color: #fff;
  border: none;
  box-shadow: 0 2px 8px rgba(0, 132, 255, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 4px 16px rgba(0, 132, 255, 0.4);
  transform: translateY(-1px);
  color: #fff;
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover {
  background: rgba(0, 132, 255, 0.06);
  color: var(--primary-dark);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: none;
}
.btn-ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.btn-text {
  background: transparent;
  color: var(--primary);
  border: none;
  padding: 4px 8px;
  font-weight: 500;
}
.btn-text:hover { background: rgba(0, 132, 255, 0.06); }

.btn-sm { padding: 6px 14px; font-size: 13px; }
.btn-lg { padding: 14px 28px; font-size: 16px; border-radius: var(--radius-md); }
.btn-block { width: 100%; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ----- 按钮加载状态 ----- */
.btn-loader {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

/* ----- 用户区域 ----- */
.auth-area { display: flex; gap: 8px; }
.user-area {
  display: flex;
  align-items: center;
  gap: 12px;
}
.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.hidden { display: none !important; }

/* ----- 主内容 ----- */
.main-content {
  padding-top: var(--navbar-height);
  min-height: 100vh;
}

.page { display: none; }
.page.active { display: block; animation: pageIn 0.4s ease; }

@keyframes pageIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ----- 页面头部 ----- */
.page-header {
  text-align: center;
  padding: 48px 24px 32px;
}
.page-header h1 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 8px;
  background: var(--primary-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.page-header p {
  color: var(--text-secondary);
  font-size: 16px;
}

/* ----- Hero 区域 ----- */
.hero-section {
  position: relative;
  min-height: calc(100vh - var(--navbar-height));
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 30% 40%, rgba(0, 132, 255, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 60%, rgba(99, 102, 241, 0.07) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 0%, rgba(20, 184, 166, 0.05) 0%, transparent 45%);
  pointer-events: none;
}

[data-theme="dark"] .hero-bg {
  background:
    radial-gradient(ellipse at 30% 40%, rgba(96, 165, 250, 0.1) 0%, transparent 55%),
    radial-gradient(ellipse at 70% 60%, rgba(129, 140, 248, 0.08) 0%, transparent 55%),
    radial-gradient(ellipse at 50% 0%, rgba(45, 212, 191, 0.06) 0%, transparent 45%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 800px;
  width: 100%;
  margin: 0 auto;
  display: flex;
  justify-content: center;
}

.hero-content {
  text-align: center;
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  background: linear-gradient(135deg, rgba(0, 132, 255, 0.1), rgba(99, 102, 241, 0.1));
  color: var(--primary);
  margin-bottom: 28px;
  letter-spacing: 0.5px;
  border: 1px solid rgba(0, 132, 255, 0.15);
  backdrop-filter: blur(4px);
  animation: badgePulse 3s ease-in-out infinite;
}

@keyframes badgePulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0, 132, 255, 0); }
  50% { box-shadow: 0 0 0 6px rgba(0, 132, 255, 0.08); }
}

[data-theme="dark"] .hero-badge {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.15), rgba(129, 140, 248, 0.15));
  border-color: rgba(96, 165, 250, 0.2);
}

.hero-title {
  font-size: clamp(40px, 7vw, 72px);
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 24px;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 18px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-actions .btn-primary {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0, 132, 255, 0.35);
  transition: all var(--transition-normal);
}

.hero-actions .btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 132, 255, 0.45);
}

.hero-actions .btn-outline {
  padding: 16px 36px;
  font-size: 16px;
  border-radius: var(--radius-md);
  border-width: 2px;
  transition: all var(--transition-normal);
}

.hero-actions .btn-outline:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(0, 132, 255, 0.15);
  background: rgba(0, 132, 255, 0.06);
}

/* ----- Section 通用 ----- */
.section-header {
  text-align: center;
  padding: 0 24px 48px;
}
.section-header h2 {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 12px;
}
.section-header p {
  color: var(--text-secondary);
  font-size: 16px;
  max-width: 480px;
  margin: 0 auto;
}

/* ----- 模型展示 ----- */
.models-section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
}

.models-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 800px;
  margin: 0 auto;
}

.model-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 36px;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: default;
}
.model-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(0, 132, 255, 0.2);
}

.model-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
  padding: 8px;
  border-radius: var(--radius-md);
  background: var(--bg-tertiary);
}
.model-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.model-card h3 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 12px;
}
.model-card p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.model-tags {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}

.tag {
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
}

/* ----- 特性展示 ----- */
.features-section {
  padding: 80px 24px;
  background: var(--bg-secondary);
  transition: background var(--transition-slow);
}

.features-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 28px;
  transition: all var(--transition-normal);
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 0;
  transition: all var(--transition-normal);
  text-align: left;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  width: 100%;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(0,132,255,0.05), rgba(99,102,241,0.05));
}
.feature-icon img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.feature-card .card-content {
  padding: 20px 24px 24px;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin: 0;
}

/* 服务保障卡片 - 小图标紧凑样式 */
.service-card .service-icon {
  height: auto;
  padding: 24px 24px 0;
  background: transparent;
  justify-content: flex-start;
}
.service-card .service-icon img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
.service-card h3 {
  font-size: 15px;
  margin-bottom: 10px;
}
.service-card p {
  font-size: 12px;
  line-height: 1.6;
}

.feature-card h3 {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 8px;
}
.feature-card p {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* ----- CTA 区域 ----- */
.cta-section {
  padding: 100px 24px;
  text-align: center;
  background: linear-gradient(135deg, rgba(0, 132, 255, 0.03), rgba(99, 102, 241, 0.03));
}

[data-theme="dark"] .cta-section {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.05), rgba(129, 140, 248, 0.05));
}

.cta-content {
  max-width: 560px;
  margin: 0 auto;
}
.cta-content h2 {
  font-size: 36px;
  font-weight: 800;
  margin-bottom: 16px;
}
.cta-content p {
  font-size: 16px;
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ----- 生成页面布局 ----- */
.generate-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  align-items: start;
}

.generate-sidebar {
  position: sticky;
  top: calc(var(--navbar-height) + 24px);
}

/* ----- 卡片 ----- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  margin-bottom: 16px;
}

.card-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 15px;
  font-weight: 700;
}

.card-body { padding: 20px; }

/* ----- 表单 ----- */
.form-group { margin-bottom: 16px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.form-input, .form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  transition: all var(--transition-fast);
  outline: none;
}
.form-input:focus, .form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 132, 255, 0.1);
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-hint {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-tertiary);
}

.form-error {
  padding: 10px 14px;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.2);
  border-radius: var(--radius-sm);
  color: #dc2626;
  font-size: 13px;
  margin-bottom: 12px;
}

.form-footer {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-secondary);
}
.form-footer a {
  font-weight: 600;
}

/* ----- 模型选择器 ----- */
.model-selector {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.grok-image-selector {
  grid-template-columns: 1fr 1fr 1fr;
}

/* ----- 尺寸选择器 ----- */
.size-selector {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 6px;
}

.size-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}
.size-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 132, 255, 0.04);
}
.size-option.active {
  border-color: var(--primary);
  background: rgba(0, 132, 255, 0.08);
  color: var(--primary);
}

.video-option {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 6px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
  width: 100%;
}
.video-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 132, 255, 0.04);
}
.video-option.active {
  border-color: var(--primary);
  background: rgba(0, 132, 255, 0.08);
  color: var(--primary);
}
.video-ratio-selector,
.video-resolution-selector,
.video-duration-selector {
  display: flex;
  gap: 6px;
}

.model-option {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}
.model-option:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 132, 255, 0.04);
}
.model-option.active {
  border-color: var(--primary);
  background: rgba(0, 132, 255, 0.08);
  color: var(--primary);
}

/* ----- 提示词建议 ----- */
.prompt-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.suggestion-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-sans);
}
.suggestion-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: rgba(0, 132, 255, 0.04);
}

/* ----- 结果区域 ----- */
.result-card { min-height: 400px; }
.result-area {
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
}

.result-placeholder {
  text-align: center;
  color: var(--text-tertiary);
}
.result-placeholder svg { margin-bottom: 12px; opacity: 0.4; }
.result-placeholder p { font-size: 14px; }

.result-image {
  max-width: 100%;
  max-height: 500px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

.result-video {
  width: 100%;
  max-height: 500px;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ----- 历史记录 ----- */
.history-grid {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.history-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.history-item {
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 1;
  border: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}
.history-item:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-md);
}
.history-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.history-item .history-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px;
  background: linear-gradient(transparent, rgba(0,0,0,0.6));
  color: #fff;
  font-size: 11px;
  opacity: 0;
  transition: opacity var(--transition-fast);
}
.history-item:hover .history-overlay { opacity: 1; }

/* 生成中/失败状态样式 */
.history-item.status-processing {
  cursor: default;
  position: relative;
}
.history-item.status-processing::after {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: inherit;
  border: 2px solid var(--primary);
  animation: processing-pulse 1.5s ease-in-out infinite;
  pointer-events: none;
}
@keyframes processing-pulse {
  0%, 100% { border-color: var(--primary); box-shadow: 0 0 6px rgba(0,132,255,0.2); }
  50% { border-color: var(--primary-light); box-shadow: 0 0 12px rgba(0,132,255,0.4); }
}

.history-item.status-failed {
  cursor: default;
  opacity: 0.75;
}
.history-item.status-failed::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(239, 68, 68, 0.04);
  border: 1px solid rgba(239, 68, 68, 0.25);
  border-radius: inherit;
  pointer-events: none;
}

.history-overlay.processing,
.history-overlay.failed {
  opacity: 1 !important;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: rgba(0,0,0,0.55);
  top: 0;
  padding: 12px;
}

/* 旋转加载动画 */
.processing-spinner {
  width: 32px;
  height: 32px;
  position: relative;
  margin-bottom: 2px;
}
.spinner-ring {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.history-status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.history-status-badge.processing {
  background: var(--primary);
  color: #fff;
  animation: badge-pulse 1.5s ease-in-out infinite;
}
.history-status-badge.failed {
  background: #ef4444;
  color: #fff;
}
@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.history-model-name {
  font-size: 10px;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.3px;
}

.history-error-msg {
  font-size: 10px;
  color: #fca5a5;
  text-align: center;
  word-break: break-all;
  max-width: 100%;
  line-height: 1.3;
}

/* 导航栏生成中角标 */
.processing-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--primary);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  margin-left: 4px;
  animation: badge-pulse 1.5s ease-in-out infinite;
  vertical-align: middle;
}

/* ----- 模态框 ----- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 420px;
  padding: 32px;
  position: relative;
  box-shadow: var(--shadow-xl);
  animation: modalIn 0.3s ease;
  border: 1px solid var(--border-color);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.95) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg-hover);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}
.modal-close:hover { background: var(--border-color); color: var(--text-primary); }

.modal-header {
  text-align: center;
  margin-bottom: 28px;
}
.modal-header h2 {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 8px;
}
.modal-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ----- Toast 通知 ----- */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  font-weight: 500;
  animation: toastIn 0.3s ease;
  min-width: 280px;
  max-width: 400px;
}
.toast.success { border-left: 3px solid #22c55e; }
.toast.error { border-left: 3px solid #ef4444; }
.toast.info { border-left: 3px solid var(--primary); }

.toast-icon { flex-shrink: 0; }
.toast.success .toast-icon { color: #22c55e; }
.toast.error .toast-icon { color: #ef4444; }
.toast.info .toast-icon { color: var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ----- 加载动画 ----- */
.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 2500;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
}

.loading-spinner {
  text-align: center;
  color: var(--text-primary);
}
.loading-spinner p {
  margin-top: 16px;
  font-size: 15px;
  font-weight: 600;
}

.spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border-color);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ----- 控制台弹窗 ----- */
.modal-lg {
  max-width: 560px;
}

.console-body {
  padding: 0;
}

.console-balance-card {
  text-align: center;
  padding: 32px 24px;
  background: linear-gradient(135deg, rgba(0,132,255,0.06), rgba(99,102,241,0.06));
  border-bottom: 1px solid var(--border-color);
}

.console-balance-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  font-weight: 500;
}

.console-balance-amount {
  font-size: 36px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.console-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
}

.console-tab {
  flex: 1;
  padding: 14px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition-fast);
  position: relative;
}

.console-tab::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width var(--transition-fast);
  border-radius: 1px;
}

.console-tab.active {
  color: var(--primary);
}

.console-tab.active::after {
  width: 40px;
}

.console-tab:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.console-tab-content {
  display: none;
  max-height: 320px;
  overflow-y: auto;
}

.console-tab-content.active {
  display: block;
}

.console-list {
  padding: 8px 0;
}

.console-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-tertiary);
  font-size: 14px;
}

.console-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  transition: background var(--transition-fast);
}

.console-item:hover {
  background: var(--bg-hover);
}

.console-item-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.console-item-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.recharge-icon {
  background: rgba(34, 197, 94, 0.1);
  color: #22c55e;
}

.consume-icon {
  background: rgba(0, 132, 255, 0.1);
  color: var(--primary);
}

.console-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.console-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.console-item-time {
  font-size: 12px;
  color: var(--text-tertiary);
}

.console-item-amount {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.console-item-amount.positive {
  color: #22c55e;
}

.console-item-amount.negative {
  color: var(--text-secondary);
}

/* ----- 响应式 ----- */
@media (max-width: 1024px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .generate-layout { grid-template-columns: 1fr; }
  .generate-sidebar { position: static; }
  .floating-cards { display: none; }
}

@media (max-width: 768px) {
  .nav-links { display: none; }
  .models-grid { grid-template-columns: 1fr; }
  .features-grid { grid-template-columns: 1fr; }
  .history-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-title { font-size: 32px; }
  .hero-actions { flex-direction: column; align-items: center; }
  .section-header h2 { font-size: 26px; }
  .page-header h1 { font-size: 28px; }
  .modal { margin: 16px; padding: 24px; }
  .hero-inner { text-align: center; }
  .hero-content { text-align: center; margin: 0 auto; }
  .logo-text { display: none; }
  .user-name {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

@media (max-width: 480px) {
  .history-grid { grid-template-columns: 1fr; }
  .model-selector { grid-template-columns: 1fr; }
}
