/* ======================
   小红书封面生成器 - 样式表
   ====================== */

/* CSS 变量 - 设计系统 */
:root {
  /* 主色调 */
  --primary-color: #ff2442;
  --primary-dark: #e01d2d;
  --primary-light: #ff6b76;
  
  /* 辅助色 */
  --secondary-color: #667eea;
  --secondary-dark: #5a6dec;
  --secondary-light: #8a9eff;
  
  /* 中性色 */
  --text-primary: #212529;
  --text-secondary: #6c757d;
  --text-light: #adb5bd;
  --text-lighter: #ced4da;
  
  /* 背景色 */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f1f3f5;
  --gradient-light: linear-gradient(135deg, #f5f7fa 0%, #e8ecf3 100%);
  --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  
  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 6px 16px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 8px 24px rgba(0, 0, 0, 0.16);
  
  /* 圆角 */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 50px;
  
  /* 间距 */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-xxl: 48px;
  --spacing-xxxl: 64px;
  
  /* 字体 */
  --font-primary: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

/* ======================
   全局样式
   ====================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-primary);
  background: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-lg);
}

/* ======================
   导航栏 - 渐变透明背景
   ====================== */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.9) 0%,
    rgba(255, 255, 255, 0.85) 100%
  );
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

header.scrolled {
  background: linear-gradient(
    to right,
    rgba(255, 255, 255, 0.95) 0%,
    rgba(255, 255, 255, 0.9) 100%
  );
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  max-width: 1200px;
  margin: 0 auto;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
}

.nav-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
}

.nav-links a:hover {
  color: var(--primary-color);
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
  transition: width 0.3s ease;
}

.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  background: var(--primary-color);
  color: white;
  text-align: center;
  padding: 0.75rem 2rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  white-space: nowrap;
  display: inline-block;
  min-width: 100px;
  margin-left: var(--spacing-lg);
}

.nav-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 36, 66, 0.4);
  background: var(--primary-dark);
  color: white;
  text-align: center;
}

/* ======================
   英雄区
   ====================== */
.hero {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem;
  overflow: hidden;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 800px;
}

.hero-title {
  font-size: 3.5rem;
  font-weight: 700;
  color: white;
  margin-bottom: 1rem;
  animation: fadeInUp 1s ease;
}

.hero-subtitle {
  font-size: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 1.5rem;
  animation: fadeInUp 1s ease 0.2s;
}

.hero-stats {
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 2rem;
  animation: fadeInUp 1s ease 0.4s;
}

.hero-stats .highlight {
  color: #ffd700;
  font-weight: 600;
  font-size: 1.2rem;
}

.hero-buttons {
  display: flex;
  gap: 1rem;
  justify-content: center;
  animation: fadeInUp 1s ease 0.6s;
}

.hero-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  z-index: 1;
  opacity: 0.1;
}

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

/* ======================
   按钮样式
   ====================== */
.btn {
  padding: 0.75rem 2rem;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  border: none;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 36, 66, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(255, 36, 66, 0.4);
}

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

.btn-secondary:hover {
  border-color: var(--text-secondary);
  background: var(--bg-secondary);
}

.btn-outline {
  background: transparent;
  color: white;
  border: 2px solid white;
}

.btn-outline:hover {
  background: white;
  color: var(--primary-color);
}

.btn-icon {
  font-size: 1.2rem;
}

/* ======================
   生成器区域
   ====================== */
.generator-section {
  padding: var(--spacing-xxxl) 0;
  background: var(--bg-primary);
}

.generator-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: var(--spacing-xl);
  align-items: start;
}

@media (max-width: 968px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
}

/* ======================
   左侧控制面板
   ====================== */
.control-panel {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
}

.control-panel h2 {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--bg-tertiary);
}

.control-group {
  margin-bottom: var(--spacing-xl);
}

.control-label {
  display: block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
  font-size: 1rem;
}

/* 上传区域 */
.upload-area {
  border: 2px dashed var(--text-lighter);
  border-radius: var(--radius-md);
  padding: var(--spacing-xxl);
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.upload-area:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.upload-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-sm);
}

.upload-text {
  color: var(--text-secondary);
  margin-bottom: var(--spacing-xs);
}

/* 模板选择 */
.template-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--spacing-md);
}

.template-btn {
  padding: var(--spacing-md);
  border: 2px solid var(--text-lighter);
  border-radius: var(--radius-md);
  background: var(--bg-primary);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-sm);
}

.template-btn:hover {
  border-color: var(--primary-color);
  background: var(--bg-secondary);
}

.template-btn.active {
  border-color: var(--primary-color);
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: white;
}

.template-icon {
  font-size: 1.5rem;
}

.template-name {
  font-weight: 500;
}

/* 输入框 */
input[type="text"] {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid var(--text-lighter);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: var(--font-primary);
  transition: all 0.3s ease;
}

input[type="text"]:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 36, 66, 0.1);
}

.input-hint {
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: var(--spacing-xs);
}

/* 滤镜控制 */
.filter-controls {
  background: var(--bg-secondary);
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
}

.filter-item {
  margin-bottom: var(--spacing-md);
}

.filter-item label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--spacing-xs);
  font-weight: 500;
  color: var(--text-primary);
}

.filter-item input[type="range"] {
  flex: 1;
  margin-left: var(--spacing-md);
  height: 6px;
  cursor: pointer;
}

.filter-value {
  display: inline-block;
  min-width: 45px;
  text-align: right;
  font-weight: 500;
  color: var(--text-secondary);
}

/* 操作按钮 */
.control-actions {
  display: flex;
  gap: var(--spacing-md);
  padding-top: var(--spacing-lg);
  border-top: 2px solid var(--bg-tertiary);
}

.control-actions .btn {
  flex: 1;
  justify-content: center;
}

/* ======================
   右侧预览区
   ====================== */
.preview-panel {
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-md);
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: varspacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 2px solid var(--bg-tertiary);
}

.preview-header h3 {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
}

.preview-size {
  font-size: 0.875rem;
  color: var(--text-light);
  font-weight: 500;
  background: var(--bg-secondary);
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm);
}

.preview-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  min-height: 600px;
}

.cover-preview {
  position: relative;
  width: 100%;
  max-width: 540px;
  aspect-ratio: 3/4;
  overflow: hidden;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  transition: all 0.3s ease;
}

.cover-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-size: cover;
  background-position: center;
  background-color: #e0e0e0;
  transition: filter 0.3s ease;
}

.cover-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--spacing-xl);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: white;
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 0.6) 100%
  );
  backdrop-filter: blur(10px);
}

.cover-tags {
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: var(--spacing-sm);
  line-height: 1.5;
}

.cover-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

.preview-tip {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-light);
  margin-top: var(--spacing-md);
}

/* ======================
   三种风格
   ====================== */

/* 简约风 - 纯净白色背景 + 大字标题 */
.cover-preview.simple-style .cover-image {
  filter: grayscale(0%) brightness(100%);
}

.cover-preview.simple-style .cover-content {
  background: linear-gradient(
    to top,
    rgba(0, 0, 0, 0.3) 0%,
    rgba(0, 0, 0, 0.5) 100%
  );
}

.cover-preview.simple-style .cover-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-size: 2.2rem;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-align: center;
  padding: 0 var(--spacing-lg);
}

/* 文艺范 - 柔和渐变 + 衬线字体 */
.cover-preview.literary-style .cover-image {
  filter: sepia(0.2) contrast(1.1) saturate(0.9);
}

.cover-preview.literary-style .cover-content {
  background: linear-gradient(
    135deg,
    rgba(255, 182, 193, 0.3) 0%,
    rgba(230, 150, 140, 0.5) 100%
  );
}

.cover-preview.literary-style .cover-tags {
  font-family: Georgia, serif;
  font-style: italic;
  color: rgba(255, 255, 255, 0.9);
  font-size: 0.95rem;
}

.cover-preview.literary-style .cover-title {
  font-family: Georgia, serif;
  font-style: italic;
  font-weight: 600;
  font-size: 1.8rem;
  text-align: center;
  letter-spacing: 0.3px;
  padding: 0 var(--spacing-lg);
}

/* 活泼感 - 鲜艳配色 + 圆润边框 */
.cover-preview.lively-style .cover-image {
  filter: saturate(1.1) contrast(1.05);
  border: 4px solid white;
}

.cover-preview.lively-style .cover-content {
  background: linear-gradient(
    135deg,
    rgba(255, 107, 107, 0.6) 0%,
    rgba(255, 193, 7, 0.6) 100%
  );
  border-radius: 0 0 12px 12px;
  padding: var(--spacing-lg);
}

.cover-preview.lively-style .cover-tags {
  font-weight: 600;
  color: #fff;
  font-size: 0.9rem;
}

.cover-preview.lively-style .cover-title {
  font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  text-align: center;
  padding: 0 var(--spacing-lg);
  text-shadow: 0 3px 8px rgba(0, 0, 0, 0.7);
}

/* ======================
   功能特色
   ====================== */
.features {
  padding: var(--spacing-xxxl) 0;
  background: var(--bg-primary);
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-primary);
  margin-bottom: var(--spacing-xl);
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-xl);
  text-align: center;
  transition: all 0.3s ease;
}

.feature-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.feature-icon {
  font-size: 3rem;
  margin-bottom: var(--spacing-md);
}

.feature-card h3 {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

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

/* ======================
   使用教程
   ====================== */
.howto {
  padding: var(--spacing-xxxl) 0;
  background: var(--bg-secondary);
}

.steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--spacing-xl);
  justify-content: center;
  margin-bottom: var(--spacing-xxl);
}

.step {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  text-align: center;
  padding: var(--spacing-lg);
  background: var(--bg-primary);
  border-radius: var(--radius-lg);
  transition: all 0.3s ease;
}

.step:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.step-number {
  width: 50px;
  height: 50px;
  background: var(--gradient-primary);
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  margin: 0 auto var(--spacing-md);
}

.step h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--spacing-sm);
}

.step p {
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.95rem;
}

.step-download {
  flex: 1;
  min-width: 200px;
  max-width: 250px;
  text-align: center;
  background: var(--gradient-primary);
  border-radius: var(--radius-lg);
  padding: var(--spacing-lg);
  color: white;
  transition: all 0.3s ease;
}

.step-download:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* ======================
   页脚
   ====================== */
footer {
  background: var(--bg-primary);
  padding: var(--spacing-xxl) 0;
  border-top: 2px solid var(--bg-tertiary);
}

footer p {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: var(--spacing-sm);
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: var(--spacing-lg);
  margin-top: var(--spacing-lg);
}

.footer-links a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-links a:hover {
  color: var(--primary-color);
}

/* ======================
   响应式设计
   ====================== */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2.5rem;
  }
  
  .hero-subtitle {
    font-size: 1.2rem;
  }
  
  .hero-buttons {
    flex-direction: column;
  }
  
  .nav-links {
    flex-direction: column;
    gap: 1rem;
  }
  
  .nav-cta {
    width: 100%;
    margin-left: 0;
  }
  
  .nav-cta:hover {
    margin-left: 0;
  }
  
  .template-options {
    grid-template-columns: 1fr;
  }
  
  .step {
    min-width: 100%;
  }
  
  .step-download {
    min-width: 100%;
  }
  
  .features-grid {
    grid-template-columns: 1fr;
  }
  
  .generator-layout {
    gap: var(--spacing-lg);
  }
  
  .preview-panel {
    padding: var(--spacing-lg);
  }
  
  .filter-controls {
    padding: var(--spacing-md);
  }
}