/* ===== AI HUB · GLASS TECH UI ===== */

:root {
  --bg-base: #0a0e1a;
  --bg-deep: #060912;

  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-bg-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-bright: rgba(255, 255, 255, 0.15);

  --accent-1: #818cf8;
  --accent-2: #c084fc;
  --accent-3: #06b6d4;
  --accent-4: #3b82f6;
  --accent-glow: rgba(129, 140, 248, 0.3);

  --grad-primary: linear-gradient(135deg, #818cf8, #c084fc);
  --grad-secondary: linear-gradient(135deg, #06b6d4, #3b82f4);
  --grad-accent: linear-gradient(135deg, #818cf8, #06b6d4);
  --grad-rainbow: linear-gradient(135deg, #818cf8, #c084fc, #06b6d4);

  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-dim: #64748b;
  --text-bright: #f1f5f9;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 8px 32px rgba(99, 102, 241, 0.15);

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;

  --font-display: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--grad-primary);
  border-radius: 3px;
  opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover { background: var(--grad-rainbow); }

/* ===== 基础 ===== */
body {
  font-family: var(--font-body);
  background: var(--bg-base);
  color: var(--text-primary);
  overflow: hidden;
  height: 100vh;
  position: relative;
}

/* ===== 极光背景 ===== */
.aurora-bg {
  position: fixed; inset: 0; z-index: -2; overflow: hidden;
  background: var(--bg-deep);
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.5;
  animation: orbFloat 20s ease-in-out infinite;
}

.orb-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #818cf8, transparent 70%);
  top: -100px; left: -100px;
  animation-delay: 0s;
}
.orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #c084fc, transparent 70%);
  bottom: -150px; right: -100px;
  animation-delay: -5s;
}
.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 40%; left: 50%;
  animation-delay: -10s;
  opacity: 0.3;
}
.orb-4 {
  width: 350px; height: 350px;
  background: radial-gradient(circle, #3b82f6, transparent 70%);
  top: 60%; left: 20%;
  animation-delay: -15s;
  opacity: 0.25;
}

@keyframes orbFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(50px, -30px) scale(1.1); }
  50% { transform: translate(-30px, 50px) scale(0.95); }
  75% { transform: translate(30px, 30px) scale(1.05); }
}

.noise-overlay {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0.015;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* ===== 玻璃拟态 ===== */
.glass {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
}

.glass-panel {
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255,255,255,0.05);
}

.glass-panel-sm {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border: 1px solid var(--glass-border);
}

.glass-card {
  background: var(--glass-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}

.glass-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
}

.glass-btn {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  transition: all 0.25s ease;
}

.glass-btn:hover {
  background: var(--glass-bg-hover);
  border-color: var(--glass-border-bright);
}

/* ===== 顶栏 ===== */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; padding: 0 24px;
  border-bottom: 1px solid var(--glass-border);
  position: relative; z-index: 100;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.2);
}

.logo { display: flex; align-items: center; gap: 12px; }
.logo-mark {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  animation: logoFloat 4s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.logo-text { display: flex; flex-direction: column; }
.logo-title {
  font-family: var(--font-display);
  font-weight: 700; font-size: 18px;
  background: var(--grad-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.logo-subtitle {
  font-size: 11px; color: var(--text-dim);
  letter-spacing: 1px;
}

/* ===== Tab ===== */
.tabs { display: flex; gap: 6px; }
.tab {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 18px;
  font-family: var(--font-body); font-weight: 500; font-size: 14px;
  color: var(--text-secondary);
  background: transparent; border: 1px solid transparent;
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.3s ease;
  position: relative;
}
.tab-icon { width: 16px; height: 16px; }
.tab:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}
.tab.active {
  color: var(--text-bright);
  background: var(--glass-bg);
  border-color: var(--glass-border-bright);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255,255,255,0.06);
}
.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px; left: 20%; right: 20%; height: 2px;
  background: var(--grad-primary);
  border-radius: 2px;
  box-shadow: 0 0 8px var(--accent-glow);
}

/* ===== 顶栏右侧 ===== */
.topbar-right { display: flex; align-items: center; gap: 16px; }
.status-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px;
  font-size: 12px; color: var(--text-secondary);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 8px rgba(16, 185, 129, 0.6);
  animation: statusPulse 2s ease-in-out infinite;
}
@keyframes statusPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  cursor: pointer;
}
.icon-btn:hover {
  color: var(--accent-1);
  box-shadow: var(--shadow-sm);
}
.icon-btn svg { width: 18px; height: 18px; }

/* ===== 页面布局 ===== */
.page { display: none; height: calc(100vh - 60px); }
.page.active { display: flex; }

/* ===== 侧边栏 ===== */
.sidebar, .gen-sidebar {
  width: 250px; flex-shrink: 0;
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
  border-radius: 0;
}

.sidebar-header {
  display: flex; align-items: center; gap: 8px;
  padding: 18px 20px;
  font-family: var(--font-display); font-weight: 600; font-size: 13px;
  color: var(--text-secondary);
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--glass-border);
}
.header-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--grad-primary);
  box-shadow: 0 0 6px var(--accent-glow);
}

/* 模型分组 */
.model-groups { padding: 10px 8px; }
.model-group { margin-bottom: 4px; }

.group-header {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; cursor: pointer;
  font-weight: 500; font-size: 14px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  transition: all 0.2s ease;
}
.group-header:hover {
  background: var(--glass-bg);
  color: var(--text-bright);
}
.group-icon {
  font-size: 16px;
  filter: drop-shadow(0 0 4px var(--accent-glow));
}
.group-name { flex: 1; }
.group-arrow {
  font-size: 10px; color: var(--text-dim);
  transition: all 0.3s ease;
}
.model-group.expanded .group-arrow {
  transform: rotate(90deg);
}
.model-group.expanded .group-header {
  color: var(--text-bright);
  background: var(--glass-bg);
}

.group-models { display: none; padding: 4px 0; }
.model-group.expanded .group-models { display: block; }

.model-item {
  padding: 8px 12px 8px 38px;
  font-size: 13px; font-weight: 400;
  color: var(--text-secondary);
  cursor: pointer; transition: all 0.2s ease;
  border-radius: var(--radius-sm);
  margin: 2px 4px;
  position: relative;
}
.model-item::before {
  content: '';
  position: absolute; left: 20px; top: 50%;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-dim);
  transform: translateY(-50%);
  transition: all 0.2s ease;
}
.model-item:hover {
  color: var(--text-primary);
  background: var(--glass-bg);
}
.model-item:hover::before {
  background: var(--accent-1);
  box-shadow: 0 0 6px var(--accent-glow);
}
.model-item.selected {
  color: var(--text-bright);
  background: var(--glass-bg-hover);
  box-shadow: inset 2px 0 0 var(--accent-1);
}
.model-item.selected::before {
  background: var(--accent-1);
  box-shadow: 0 0 8px var(--accent-glow);
  width: 6px; height: 6px;
}

/* ===== 聊天主区域 ===== */
.chat-main { flex: 1; display: flex; flex-direction: column; overflow: hidden; }

.chat-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  margin: 12px 16px 0;
  border-radius: var(--radius-sm);
}
.current-model-wrap { display: flex; align-items: center; gap: 10px; }
.model-label {
  font-size: 12px; color: var(--text-dim);
  font-weight: 500;
}
.model-display {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  color: var(--accent-1);
  padding: 4px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
}

.btn-sm {
  display: flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
  padding: 7px 14px;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer; transition: all 0.2s ease;
}
.btn-sm:hover {
  color: var(--text-bright);
  box-shadow: var(--shadow-sm);
}

/* 消息区域 */
.messages { flex: 1; overflow-y: auto; padding: 20px 16px; }

.welcome-msg {
  text-align: center; padding: 60px 20px;
  animation: welcomeFadeIn 0.6s ease-out;
}
@keyframes welcomeFadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.welcome-icon {
  width: 80px; height: 80px; margin: 0 auto 24px;
  animation: welcomeFloat 5s ease-in-out infinite;
}
@keyframes welcomeFloat {
  0%, 100% { transform: translateY(0) rotate(0); }
  50% { transform: translateY(-8px) rotate(5deg); }
}

.welcome-msg h2 {
  font-family: var(--font-display); font-weight: 700; font-size: 32px;
  background: var(--grad-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}
.welcome-desc {
  font-size: 15px; color: var(--text-secondary);
  max-width: 480px; margin: 0 auto 24px;
  line-height: 1.6;
}
.welcome-hint {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 10px 20px;
  font-size: 13px; color: var(--text-secondary);
  background: rgba(251, 191, 36, 0.08);
  border: 1px solid rgba(251, 191, 36, 0.2);
  border-radius: 12px;
}
.hint-icon {
  width: 18px; height: 18px; border-radius: 50%;
  background: rgba(251, 191, 36, 0.2);
  color: #fbbf24; font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}

/* 消息气泡 */
.message {
  display: flex; gap: 14px; margin-bottom: 20px;
  max-width: 900px; margin-left: auto; margin-right: auto;
  animation: msgSlideIn 0.4s ease-out;
}
@keyframes msgSlideIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.message-avatar {
  width: 38px; height: 38px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; border-radius: 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-sm);
}
.message.user .message-avatar {
  background: linear-gradient(135deg, rgba(192, 132, 252, 0.15), rgba(129, 140, 248, 0.1));
  border-color: rgba(192, 132, 252, 0.3);
}
.message.assistant .message-avatar {
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), rgba(59, 130, 246, 0.1));
  border-color: rgba(6, 182, 212, 0.3);
}

.message-content { flex: 1; min-width: 0; }

.message-role {
  font-size: 12px; font-weight: 600;
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.message.user .message-role { color: var(--accent-2); }
.message.assistant .message-role { color: var(--accent-3); }

.message-text {
  font-size: 15px; line-height: 1.75;
  color: var(--text-primary);
  padding: 14px 18px;
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: 4px 16px 16px 16px;
  box-shadow: var(--shadow-sm);
}
.message.user .message-text {
  border-radius: 16px 4px 16px 16px;
  background: rgba(192, 132, 252, 0.05);
  border-color: rgba(192, 132, 252, 0.15);
}

/* Markdown */
.message-text pre.code-block {
  background: rgba(0, 0, 0, 0.4);
  padding: 14px; margin: 10px 0;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  overflow-x: auto;
}
.message-text pre.code-block code {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px;
  color: #a5b4fc;
}
.message-text code.inline-code {
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 13px;
  background: rgba(129, 140, 248, 0.12);
  color: var(--accent-1);
  padding: 2px 7px; border-radius: 5px;
}
.message-text h2, .message-text h3, .message-text h4 {
  font-family: var(--font-display); color: var(--text-bright);
  margin: 14px 0 8px;
}
.message-text ul { padding-left: 22px; margin: 8px 0; }
.message-text li { margin: 4px 0; }
.message-text strong { color: var(--text-bright); }
.message-text p { margin: 6px 0; }

/* 打字动画 */
.typing-dots { display: inline-flex; gap: 5px; align-items: center; }
.typing-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent-1);
  animation: typingBounce 1.4s infinite ease-in-out;
}
.typing-dots span:nth-child(2) { animation-delay: 0.2s; }
.typing-dots span:nth-child(3) { animation-delay: 0.4s; }
@keyframes typingBounce {
  0%, 80%, 100% { opacity: 0.3; transform: scale(0.7); }
  40% { opacity: 1; transform: scale(1.1); }
}

/* 输入区域 */
.input-area {
  display: flex; align-items: flex-end; gap: 12px;
  padding: 14px 20px;
  margin: 8px 16px 16px;
  border-radius: var(--radius);
}
.input-area textarea {
  flex: 1; resize: none;
  background: transparent;
  border: none;
  color: var(--text-bright);
  font-family: var(--font-body); font-size: 15px;
  padding: 10px 0; outline: none;
  min-height: 24px; max-height: 200px;
  line-height: 1.5;
}
.input-area textarea::placeholder { color: var(--text-dim); }

.send-btn {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding: 10px 22px;
  background: var(--grad-primary);
  border: none;
  color: #fff;
  cursor: pointer; transition: all 0.3s ease;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(129, 140, 248, 0.3);
  white-space: nowrap;
}
.send-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(129, 140, 248, 0.4);
}
.send-btn:active { transform: translateY(0); }
.send-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.send-btn svg { width: 16px; height: 16px; }

/* ===== 生成页面 ===== */
.gen-container { display: flex; width: 100%; height: 100%; }
.gen-main { flex: 1; overflow-y: auto; padding: 28px 36px; }

.gen-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 28px;
}
.page-title {
  font-family: var(--font-display); font-weight: 700; font-size: 28px;
  background: var(--grad-rainbow);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}
.page-subtitle {
  font-size: 14px; color: var(--text-dim);
}

.current-model-tag {
  font-family: var(--font-display); font-weight: 500; font-size: 13px;
  color: var(--accent-2);
  padding: 6px 16px;
  background: rgba(192, 132, 252, 0.08);
  border: 1px solid rgba(192, 132, 252, 0.2);
  border-radius: 20px;
  transition: all 0.3s ease;
}

/* 表单 */
.gen-form {
  max-width: 760px;
  padding: 28px;
  margin-bottom: 20px;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.form-row { margin-bottom: 20px; }
.form-row label {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 8px; letter-spacing: 0.3px;
}
.form-row-inline { display: flex; gap: 16px; margin-bottom: 20px; }
.form-item { flex: 1; }
.form-item label {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 13px; color: var(--text-secondary);
  margin-bottom: 8px;
}

textarea, select, input[type="text"] {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--glass-border);
  color: var(--text-bright);
  font-family: var(--font-body); font-size: 15px;
  padding: 12px 16px; outline: none;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
}
textarea::placeholder, input::placeholder { color: var(--text-dim); }
textarea:focus, select:focus, input:focus {
  border-color: var(--accent-1);
  background: rgba(0, 0, 0, 0.3);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.12);
}
select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  cursor: pointer;
  padding-right: 36px;
}
select option { background: var(--bg-base); color: var(--text-bright); }

/* 生成按钮 */
.gen-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  font-family: var(--font-display); font-weight: 600; font-size: 15px;
  padding: 14px 32px; width: 100%;
  background: var(--grad-primary);
  border: none;
  color: #fff;
  cursor: pointer; transition: all 0.3s ease;
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 20px rgba(129, 140, 248, 0.25);
  position: relative; overflow: hidden;
}
.gen-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2), transparent);
  opacity: 0;
  transition: opacity 0.3s ease;
}
.gen-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(129, 140, 248, 0.4);
}
.gen-btn:hover::before { opacity: 1; }
.gen-btn:active { transform: translateY(0); }
.gen-btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }
.gen-btn svg { width: 18px; height: 18px; }

/* 进度条 */
.progress-container {
  display: flex; align-items: center; gap: 14px;
  margin: 16px 0; max-width: 760px;
  padding: 14px 20px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
}
.progress-bar {
  flex: 1; height: 6px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}
.progress-fill {
  height: 100%; width: 0%;
  background: var(--grad-rainbow);
  border-radius: 3px;
  box-shadow: 0 0 12px var(--accent-glow);
  transition: width 0.4s ease-out;
  position: relative;
}
.progress-fill::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: progressShine 1.8s linear infinite;
}
@keyframes progressShine {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}
.progress-text {
  font-size: 13px; color: var(--accent-1);
  white-space: nowrap; min-width: 100px;
  font-weight: 500;
}

/* ===== 图片结果 ===== */
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px; margin-top: 24px;
}
.result-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: var(--shadow-md);
}
.result-card:hover {
  transform: translateY(-6px) scale(1.02);
  border-color: var(--glass-border-bright);
  box-shadow: var(--shadow-lg), 0 0 32px rgba(129, 140, 248, 0.15);
}
.result-card img {
  width: 100%; display: block; cursor: pointer;
  transition: transform 0.4s ease;
}
.result-card:hover img { transform: scale(1.05); }
.result-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}
.model-name {
  font-size: 12px; color: var(--accent-3);
  font-weight: 500;
}
.download-btn {
  display: flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500;
  color: var(--text-primary); text-decoration: none;
  padding: 5px 12px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  transition: all 0.2s ease;
}
.download-btn:hover {
  background: var(--glass-bg-hover);
  color: var(--accent-1);
  border-color: var(--accent-1);
}

/* 图片预览 */
.image-preview-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  animation: fadeIn 0.25s ease;
}
.image-preview-overlay img {
  max-width: 90%; max-height: 90%;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg), 0 0 60px rgba(129, 140, 248, 0.2);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ===== 视频结果 ===== */
.video-result { margin-top: 24px; }
.video-card {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  max-width: 800px;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
}
.video-card:hover {
  border-color: var(--glass-border-bright);
  box-shadow: var(--shadow-lg);
}
.video-card video {
  width: 100%; display: block;
  background: #000;
  border-radius: var(--radius) var(--radius) 0 0;
}
.video-card-footer {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--glass-border);
  background: rgba(0, 0, 0, 0.2);
}

/* 错误消息 */
.error-msg {
  font-size: 14px; color: #f87171;
  padding: 16px 20px; margin: 16px 0;
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.2);
  border-radius: var(--radius-sm);
  max-width: 760px;
}

/* ===== 弹窗 ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal {
  width: 500px; max-width: 90%;
  padding: 0;
  animation: modalSlideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--glass-border);
}
.modal-header h3 {
  font-family: var(--font-display); font-weight: 600; font-size: 18px;
  color: var(--text-bright);
}
.close-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--text-secondary);
  cursor: pointer;
}
.close-btn:hover { color: #f87171; }
.modal-body { padding: 24px; }
.modal-body .form-row label {
  display: block; font-family: var(--font-display); font-weight: 500;
  font-size: 13px; color: var(--text-secondary); margin-bottom: 8px;
}
.modal-body .hint {
  font-size: 12px; color: var(--text-dim); margin-top: 6px;
}
.link {
  color: var(--accent-1); text-decoration: none;
  font-size: 14px;
  transition: color 0.2s ease;
}
.link:hover { color: var(--accent-3); }
.modal-footer {
  display: flex; gap: 12px; justify-content: flex-end;
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
}
.btn-primary, .btn-secondary {
  font-family: var(--font-display); font-weight: 600; font-size: 14px;
  padding: 10px 24px; cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.25s ease;
}
.btn-primary {
  background: var(--grad-primary);
  border: none;
  color: #fff;
  box-shadow: 0 4px 16px rgba(129, 140, 248, 0.25);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(129, 140, 248, 0.35);
}
.btn-secondary {
  color: var(--text-secondary);
}
.btn-secondary:hover { color: var(--text-bright); }

/* ===== 3D 卡片倾斜效果 ===== */
[data-tilt] {
  transform-style: preserve-3d;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
[data-tilt]:hover {
  box-shadow: var(--shadow-lg), 0 0 40px rgba(129, 140, 248, 0.1);
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .sidebar, .gen-sidebar { width: 200px; }
  .logo-text { display: none; }
  .welcome-msg h2 { font-size: 24px; }
  .page-title { font-size: 22px; }
  .gen-main { padding: 20px 16px; }
  .tab span { display: none; }
  .status-badge span:last-child { display: none; }
}
