/* ============================================
   AI短剧剧本打磨器 - 全局样式
   设计语言：电影工业 × AI科技
   ============================================ */

:root {
  --bg-primary: #0a0a0f;
  --bg-secondary: #13131a;
  --bg-tertiary: #1c1c26;
  --bg-card: #17171f;
  --border-color: #2a2a35;
  --border-hover: #3d3d4d;
  
  --text-primary: #f5f5f7;
  --text-secondary: #a8a8b3;
  --text-muted: #6b6b7a;
  
  --accent-gold: #ffb800;
  --accent-red: #ff4757;
  --accent-purple: #9c5fff;
  --accent-cyan: #00d4ff;
  --accent-green: #2ed573;
  
  --gradient-hero: linear-gradient(135deg, #ff4757 0%, #9c5fff 50%, #00d4ff 100%);
  --gradient-gold: linear-gradient(135deg, #ffb800 0%, #ff4757 100%);
  --gradient-card: linear-gradient(135deg, rgba(156,95,255,0.08) 0%, rgba(0,212,255,0.04) 100%);
  
  --shadow-glow: 0 0 30px rgba(156, 95, 255, 0.15);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  
  --font-sans: 'Inter', 'PingFang SC', 'Microsoft YaHei', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

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

html, body {
  font-family: var(--font-sans);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 背景装饰 - 电影感光晕 */
body::before {
  content: '';
  position: fixed;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(156,95,255,0.15) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}
body::after {
  content: '';
  position: fixed;
  bottom: -20%;
  left: -10%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,71,87,0.1) 0%, transparent 60%);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--accent-cyan); text-decoration: none; transition: opacity 0.2s; }
a:hover { opacity: 0.8; }

/* ============ 顶部导航 ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 15, 0.85);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
}
.nav-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gradient-hero);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.nav-brand-text .brand-name {
  background: var(--gradient-hero);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav-brand-text .brand-sub {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
}
.nav-menu { display: flex; gap: 4px; align-items: center; }
.nav-link {
  padding: 8px 16px;
  border-radius: 8px;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}
.nav-link:hover { background: var(--bg-tertiary); color: var(--text-primary); opacity: 1; }
.nav-link.active {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}
.nav-cta {
  padding: 8px 18px;
  background: var(--gradient-hero);
  color: white;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  margin-left: 12px;
}
.nav-cta:hover { opacity: 0.9; transform: translateY(-1px); }

/* AI状态指示器 */
.ai-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 12px;
  margin-right: 12px;
}
.ai-status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 8px var(--accent-green);
}
.ai-status.offline .ai-status-dot { background: var(--text-muted); box-shadow: none; }
.ai-status.offline { color: var(--text-muted); }

/* ============ 通用布局 ============ */
.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px;
  position: relative;
  z-index: 1;
}

.page-header {
  margin-bottom: 32px;
}
.page-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
}
.page-subtitle {
  color: var(--text-secondary);
  font-size: 16px;
}

/* ============ 卡片 ============ */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  transition: all 0.3s;
}
.card:hover {
  border-color: var(--border-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}
.card-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-desc {
  color: var(--text-secondary);
  font-size: 14px;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  background: var(--bg-tertiary);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn:hover { border-color: var(--border-hover); background: var(--bg-card); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--gradient-hero);
  border-color: transparent;
  color: white;
  font-weight: 600;
}
.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-gold {
  background: var(--gradient-gold);
  border-color: transparent;
  color: #000;
  font-weight: 600;
}

.btn-ghost { background: transparent; }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 14px 28px; font-size: 16px; }

/* ============ 表单 ============ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.form-label .required { color: var(--accent-red); }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: all 0.2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(156, 95, 255, 0.15);
}
.form-textarea {
  min-height: 120px;
  resize: vertical;
  font-family: var(--font-mono);
  line-height: 1.7;
}
.form-hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ============ 徽章 ============ */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.badge-gold { background: rgba(255,184,0,0.15); color: var(--accent-gold); border: 1px solid rgba(255,184,0,0.3); }
.badge-red { background: rgba(255,71,87,0.15); color: var(--accent-red); }
.badge-purple { background: rgba(156,95,255,0.15); color: var(--accent-purple); }
.badge-cyan { background: rgba(0,212,255,0.15); color: var(--accent-cyan); }
.badge-green { background: rgba(46,213,115,0.15); color: var(--accent-green); }
.badge-gray { background: var(--bg-tertiary); color: var(--text-secondary); }

/* ============ 动画 ============ */
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
@keyframes slideIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-pulse { animation: pulse 1.5s ease-in-out infinite; }
.animate-slide-in { animation: slideIn 0.4s ease-out; }

.loading-shimmer {
  background: linear-gradient(90deg, var(--bg-tertiary) 0%, var(--bg-card) 50%, var(--bg-tertiary) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* ============ 提示 Toast ============ */
.toast-container {
  position: fixed;
  top: 80px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--accent-cyan);
  border-radius: 10px;
  box-shadow: var(--shadow-card);
  animation: slideIn 0.3s ease-out;
  min-width: 280px;
  font-size: 14px;
}
.toast.success { border-left-color: var(--accent-green); }
.toast.error { border-left-color: var(--accent-red); }
.toast.warning { border-left-color: var(--accent-gold); }

/* ============ 响应式 ============ */
@media (max-width: 768px) {
  .nav-menu { display: none; }
  .container { padding: 20px 16px; }
  .page-title { font-size: 24px; }
}

/* 滚动条美化 */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-secondary); }
::-webkit-scrollbar-thumb { background: var(--border-hover); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
