/* ============================================
   AIMusic666 - 全局样式
   大自然风：浅蓝/浅绿/米白渐变
   ============================================ */

:root {
  --primary: #4a9b8e;
  --primary-light: #6dbfb0;
  --primary-dark: #357a6e;
  --secondary: #7bc4a0;
  --accent: #a8d8b0;
  --bg-main: #f5f9f7;
  --bg-card: #ffffff;
  --bg-gradient: linear-gradient(135deg, #e8f5f0 0%, #e0f0f8 50%, #f0f5e8 100%);
  --text-primary: #2c4a3e;
  --text-secondary: #5a7a70;
  --text-muted: #8aaa9e;
  --border: #d0e8e0;
  --shadow: 0 4px 20px rgba(74, 155, 142, 0.12);
  --shadow-hover: 0 8px 32px rgba(74, 155, 142, 0.22);
  --radius: 14px;
  --radius-sm: 8px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'PingFang SC', 'Microsoft YaHei', 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font);
  background: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* ============ 滚动条 ============ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #f0f5f2; }
::-webkit-scrollbar-thumb { background: var(--primary-light); border-radius: 3px; }

/* ============ 导航栏 ============ */
.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 2px 12px rgba(74, 155, 142, 0.08);
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-dark);
  letter-spacing: -0.3px;
}

.navbar-brand .logo-icon {
  width: 36px;
  height: 36px;
  background: var(--bg-gradient);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  border: 1px solid var(--border);
}

.navbar-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  list-style: none;
}

.navbar-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  white-space: nowrap;
}

.navbar-nav a:hover,
.navbar-nav a.active {
  color: var(--primary);
  background: rgba(74, 155, 142, 0.1);
}

.navbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-primary);
  font-size: 1.4rem;
}

/* ============ 按钮 ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: white;
  box-shadow: 0 4px 14px rgba(74, 155, 142, 0.35);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(74, 155, 142, 0.45);
}

.btn-primary:active { transform: translateY(0); }

.btn-secondary {
  background: white;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

.btn-secondary:hover {
  background: rgba(74, 155, 142, 0.06);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}

.btn-ghost:hover {
  background: var(--bg-main);
  color: var(--text-primary);
}

.btn-sm { padding: 6px 14px; font-size: 0.82rem; }
.btn-lg { padding: 14px 32px; font-size: 1rem; border-radius: var(--radius); }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

.btn-loading {
  position: relative;
  pointer-events: none;
}

.btn-loading::after {
  content: '';
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-left: 6px;
}

/* ============ 卡片 ============ */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: var(--transition);
  overflow: hidden;
}

.card:hover { box-shadow: var(--shadow-hover); }

.card-body { padding: 24px; }
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, rgba(74,155,142,0.04), rgba(123,196,160,0.04));
}

.card-title {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ============ 表单 ============ */
.form-group { margin-bottom: 18px; }

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

.form-control {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-family: var(--font);
  color: var(--text-primary);
  background: white;
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(74, 155, 142, 0.12);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

.form-select {
  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 d='M1 1l5 5 5-5' stroke='%235a7a70' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
  cursor: pointer;
}

/* ============ 进度条 ============ */
.progress-wrap {
  background: #e8f0ec;
  border-radius: 100px;
  overflow: hidden;
  height: 8px;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  border-radius: 100px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0; left: -100%;
  width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
  animation: shimmer 1.5s infinite;
}

.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ============ 状态提示 ============ */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 16px;
}

.alert-info { background: #e8f4f8; color: #2a6a8a; border: 1px solid #b8dff0; }
.alert-success { background: #e8f5ee; color: #2a6a4a; border: 1px solid #b0dfc0; }
.alert-warning { background: #fef8e8; color: #7a5a10; border: 1px solid #f0dfa0; }
.alert-error { background: #fef0ee; color: #8a2a2a; border: 1px solid #f0c0b8; }

/* ============ 标签页 ============ */
.tabs {
  display: flex;
  gap: 4px;
  background: #eef5f2;
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab-btn {
  flex: 1;
  padding: 8px 16px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.tab-btn.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(74,155,142,0.15);
}

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ============ 上传区域 ============ */
.upload-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  background: linear-gradient(135deg, rgba(74,155,142,0.02), rgba(123,196,160,0.02));
}

.upload-zone:hover,
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(74, 155, 142, 0.05);
}

.upload-zone .upload-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: 0.6;
}

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

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

/* ============ 音频播放器 ============ */
.audio-player {
  background: linear-gradient(135deg, #e8f5f0, #e0f0f8);
  border-radius: var(--radius);
  padding: 16px 20px;
  border: 1px solid var(--border);
}

.audio-player-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.audio-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.audio-controls audio {
  flex: 1;
  height: 36px;
  border-radius: 20px;
}

/* ============ 视频播放器 ============ */
.video-player-wrap {
  background: #1a2a24;
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 16/9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-player-wrap video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.video-placeholder {
  color: rgba(255,255,255,0.3);
  text-align: center;
  font-size: 0.9rem;
}

.video-placeholder .icon { font-size: 3rem; margin-bottom: 10px; }

/* ============ 结果卡片 ============ */
.result-card {
  background: linear-gradient(135deg, #f0faf5, #e8f5f8);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-top: 20px;
}

.result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 14px;
}

/* ============ 分镜预览 ============ */
.storyboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.storyboard-item {
  background: white;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  font-size: 0.8rem;
}

.storyboard-thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, #e0f0e8, #d8eaf5);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 1.5rem;
}

.storyboard-desc {
  padding: 8px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* ============ 步骤指示器 ============ */
.steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 28px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.step {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e0ece8;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.step.active .step-num {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(74,155,142,0.4);
}

.step.done .step-num {
  background: var(--secondary);
  color: white;
}

.step-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.step.active .step-label { color: var(--primary); font-weight: 500; }
.step.done .step-label { color: var(--secondary); }

.step-line {
  flex: 1;
  height: 2px;
  background: #e0ece8;
  min-width: 20px;
  max-width: 60px;
}

.step-line.done { background: var(--secondary); }

/* ============ 页面 Banner ============ */
.page-banner {
  background: var(--bg-gradient);
  padding: 48px 24px;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.page-banner h1 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.page-banner p {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
}

/* ============ 主内容区 ============ */
.main-content {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.content-grid.wide { grid-template-columns: 1.4fr 1fr; }
.content-grid.single { grid-template-columns: 1fr; max-width: 720px; margin: 0 auto; }

/* ============ 首页 Banner ============ */
.hero {
  background: var(--bg-gradient);
  padding: 80px 24px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(74,155,142,0.08) 0%, transparent 70%);
  pointer-events: none;
}

.hero::after {
  content: '';
  position: absolute;
  top: -30%;
  right: -10%;
  width: 50%;
  height: 180%;
  background: radial-gradient(ellipse, rgba(123,196,160,0.07) 0%, transparent 70%);
  pointer-events: none;
}

.hero-content { position: relative; z-index: 1; }

.hero h1 {
  font-size: 2.6rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.2;
  margin-bottom: 16px;
  letter-spacing: -1px;
}

.hero h1 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  font-size: 1.1rem;
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 32px;
  line-height: 1.7;
}

.hero-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 36px;
}

.hero-flow-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 100px;
  padding: 6px 16px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  box-shadow: 0 2px 8px rgba(74,155,142,0.08);
}

.hero-flow-arrow {
  color: var(--primary-light);
  font-size: 1rem;
}

/* ============ 功能卡片网格 ============ */
.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 48px 24px;
}

.feature-card {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 28px 24px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
  display: block;
  position: relative;
  overflow: hidden;
}

.feature-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--primary-light);
}

.feature-card:hover::before { transform: scaleX(1); }

.feature-icon {
  font-size: 2.2rem;
  margin-bottom: 14px;
  display: block;
}

.feature-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feature-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.feature-tag {
  display: inline-block;
  margin-top: 12px;
  padding: 3px 10px;
  background: rgba(74,155,142,0.1);
  color: var(--primary);
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ============ 页脚 ============ */
footer {
  background: white;
  border-top: 1px solid var(--border);
  padding: 28px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
}

footer a { color: var(--primary); text-decoration: none; }
footer a:hover { text-decoration: underline; }

/* ============ 登录页 ============ */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  padding: 24px;
}

.auth-card {
  background: white;
  border-radius: 20px;
  padding: 40px;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 20px 60px rgba(74,155,142,0.15);
  border: 1px solid var(--border);
}

.auth-logo {
  text-align: center;
  margin-bottom: 28px;
}

.auth-logo .logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary-dark);
}

.auth-logo .logo-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-tabs {
  display: flex;
  background: #eef5f2;
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px;
  border: none;
  background: transparent;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font);
}

.auth-tab.active {
  background: white;
  color: var(--primary);
  box-shadow: 0 2px 8px rgba(74,155,142,0.15);
}

.sms-group {
  display: flex;
  gap: 10px;
}

.sms-group .form-control { flex: 1; }

.btn-sms {
  white-space: nowrap;
  padding: 10px 14px;
  font-size: 0.82rem;
  min-width: 100px;
}

/* ============ 用户中心 ============ */
.user-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

.user-sidebar {
  background: white;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 80px;
}

.user-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--bg-gradient);
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin: 0 auto 12px;
}

.user-name {
  text-align: center;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.user-email {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.sidebar-nav { list-style: none; }

.sidebar-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: var(--transition);
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
  background: rgba(74,155,142,0.08);
  color: var(--primary);
}

.history-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.history-table th {
  text-align: left;
  padding: 10px 14px;
  background: #f5faf7;
  color: var(--text-secondary);
  font-weight: 500;
  border-bottom: 1px solid var(--border);
}

.history-table td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0f5f2;
  color: var(--text-primary);
}

.history-table tr:hover td { background: #fafdf9; }

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 500;
}

.status-done { background: #e8f5ee; color: #2a6a4a; }
.status-processing { background: #fff8e8; color: #7a5a10; }
.status-failed { background: #fef0ee; color: #8a2a2a; }

/* ============ 动画 ============ */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes shimmer {
  to { left: 100%; }
}

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

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

.fade-in { animation: fadeIn 0.4s ease forwards; }

.loading-dots::after {
  content: '...';
  animation: pulse 1.2s infinite;
}

/* ============ 响应式 ============ */
@media (max-width: 900px) {
  .features-grid { grid-template-columns: repeat(2, 1fr); }
  .content-grid, .content-grid.wide { grid-template-columns: 1fr; }
  .user-layout { grid-template-columns: 1fr; }
  .user-sidebar { position: static; }
  .hero h1 { font-size: 1.9rem; }
}

@media (max-width: 640px) {
  .navbar-nav { display: none; }
  .navbar-nav.open {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 64px;
    left: 0; right: 0;
    background: white;
    border-bottom: 1px solid var(--border);
    padding: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    z-index: 999;
  }
  .navbar-toggle { display: flex; }
  .features-grid { grid-template-columns: 1fr; }
  .hero { padding: 48px 20px 40px; }
  .hero h1 { font-size: 1.6rem; }
  .hero p { font-size: 0.95rem; }
  .main-content { padding: 20px 16px; }
  .page-banner { padding: 32px 16px; }
  .page-banner h1 { font-size: 1.5rem; }
  .auth-card { padding: 28px 20px; }
  .storyboard-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ============ 工具类 ============ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.w-full { width: 100%; }
