/* 香水调香 - 样式文件 */
/* 主色调: #20c997 */

/* ===== CSS 变量 ===== */
:root {
  --accent-color: #20c997;
  --accent-dark: #1ba87e;
  --accent-light: #e6f9f3;
  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-muted: #8b9aa8;
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --border-color: #e9ecef;
  --shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-hover: 0 4px 16px rgba(0, 0, 0, 0.12);
  --radius: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
}

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

a:hover {
  color: var(--accent-dark);
}

img {
  max-width: 100%;
  height: auto;
}

/* ===== 布局容器 ===== */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* ===== 页头 ===== */
.header {
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-height);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-color), var(--accent-dark));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
}

.nav {
  display: flex;
  gap: 32px;
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.nav a:hover,
.nav a.active {
  color: var(--accent-color);
  border-bottom-color: var(--accent-color);
}

.search-box {
  display: flex;
  align-items: center;
  background: var(--bg-secondary);
  border-radius: 20px;
  padding: 8px 16px;
  gap: 8px;
}

.search-box input {
  border: none;
  background: none;
  outline: none;
  width: 160px;
  font-size: 14px;
}

.search-box input::placeholder {
  color: var(--text-muted);
}

/* ===== Hero 区域 ===== */
.hero {
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--bg-primary) 100%);
  padding: 60px 0;
  text-align: center;
}

.hero h1 {
  font-size: 40px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text-primary);
}

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

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
}

/* ===== 按钮 ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
}

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

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

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

.btn-secondary:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
}

/* ===== 统计卡片 ===== */
.stats-section {
  padding: 40px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  text-align: center;
  box-shadow: var(--shadow);
}

.stat-number {
  font-size: 36px;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.stat-label {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===== 内容区域标题 ===== */
.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 24px;
  background: var(--accent-color);
  border-radius: 2px;
}

/* ===== 进度条 ===== */
.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-color), var(--accent-dark));
  border-radius: 4px;
  transition: width 0.3s;
}

.progress-text {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

/* ===== 课程卡片 ===== */
.course-section {
  padding: 40px 0;
}

.course-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 20px;
}

.course-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.course-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 4px;
}

.course-meta {
  font-size: 14px;
  color: var(--text-secondary);
}

.course-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

.status-progress {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.status-completed {
  background: #d4edda;
  color: #155724;
}

.status-pending {
  background: var(--bg-secondary);
  color: var(--text-muted);
}

.course-progress {
  margin-top: 16px;
}

/* ===== 课程列表 ===== */
.course-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.course-item {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}

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

.course-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-color);
  font-size: 20px;
  flex-shrink: 0;
}

.course-info {
  flex: 1;
}

.course-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 4px;
}

.course-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===== 文章列表 ===== */
.articles-section {
  padding: 40px 0;
  background: var(--bg-primary);
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.article-list {
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.article-list h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-item:last-child {
  border-bottom: none;
}

.article-item a {
  color: var(--text-primary);
  font-size: 14px;
  display: block;
  line-height: 1.5;
}

.article-item a:hover {
  color: var(--accent-color);
}

.article-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 面包屑 ===== */
.breadcrumb {
  padding: 16px 0;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb ol {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--accent-color);
}

.breadcrumb .separator {
  color: var(--text-muted);
}

.breadcrumb .current {
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== 分类页头部 ===== */
.category-header {
  padding: 40px 0;
  background: var(--bg-primary);
  text-align: center;
}

.category-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.category-header p {
  color: var(--text-secondary);
  max-width: 600px;
  margin: 0 auto 24px;
}

/* ===== 筛选标签 ===== */
.filter-tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 8px 20px;
  border-radius: 20px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid var(--border-color);
  background: white;
  color: var(--text-secondary);
}

.filter-tab:hover,
.filter-tab.active {
  background: var(--accent-color);
  border-color: var(--accent-color);
  color: white;
}

/* ===== 课程网格 ===== */
.courses-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
  padding: 40px 0;
}

.course-box {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.course-box:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.course-cover {
  height: 160px;
  background: linear-gradient(135deg, var(--accent-light), var(--accent-color));
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 48px;
}

.course-body {
  padding: 20px;
}

.course-body h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.course-body p {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.course-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.course-level {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 12px;
  background: var(--accent-light);
  color: var(--accent-dark);
}

/* ===== 文章页 ===== */
.article-container {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 20px;
}

.article-header {
  text-align: center;
  margin-bottom: 40px;
}

.article-header h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
  line-height: 1.3;
}

.article-meta-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 20px;
  color: var(--text-secondary);
  font-size: 14px;
}

.article-meta-bar span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-content {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow);
}

.article-content h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 32px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 24px 0 12px;
}

.article-content p {
  margin-bottom: 16px;
  color: var(--text-secondary);
  line-height: 1.8;
}

.article-content ul,
.article-content ol {
  margin-bottom: 16px;
  padding-left: 24px;
}

.article-content li {
  margin-bottom: 8px;
  color: var(--text-secondary);
}

.chapter-nav {
  background: var(--accent-light);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}

.chapter-nav h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--accent-dark);
}

.chapter-nav ol {
  list-style: none;
  padding: 0;
}

.chapter-nav li {
  padding: 8px 0;
  border-bottom: 1px solid rgba(32, 201, 151, 0.2);
  display: flex;
  align-items: center;
  gap: 8px;
}

.chapter-nav li:last-child {
  border-bottom: none;
}

.chapter-nav .chapter-num {
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.chapter-nav .chapter-current {
  font-weight: 600;
  color: var(--text-primary);
}

/* ===== 笔记区域 ===== */
.notes-section {
  margin-top: 40px;
  padding-top: 40px;
  border-top: 1px solid var(--border-color);
}

.notes-section h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 20px;
}

.note-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  border-left: 3px solid var(--accent-color);
}

.note-item p {
  font-size: 14px;
  color: var(--text-secondary);
  margin: 0;
}

/* ===== 相关推荐 ===== */
.related-section {
  padding: 40px 0;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.related-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
  text-align: center;
}

.related-icon {
  width: 60px;
  height: 60px;
  background: var(--accent-light);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: var(--accent-color);
  font-size: 24px;
}

.related-card h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.related-card p {
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== 404 页面 ===== */
.error-page {
  min-height: calc(100vh - var(--header-height) - 200px);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
}

.error-content {
  max-width: 500px;
}

.error-code {
  font-size: 120px;
  font-weight: 700;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 20px;
  opacity: 0.8;
}

.error-content h1 {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-content p {
  color: var(--text-secondary);
  margin-bottom: 32px;
}

/* ===== 页脚 ===== */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 40px 0 20px;
  margin-top: 60px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.6;
}

.footer-col h4 {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col li {
  margin-bottom: 10px;
}

.footer-col a {
  color: rgba(255, 255, 255, 0.7);
  font-size: 14px;
}

.footer-col a:hover {
  color: var(--accent-color);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
}

/* ===== 响应式设计 ===== */
@media (max-width: 992px) {
  .articles-grid {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .related-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .header .container {
    flex-wrap: wrap;
    height: auto;
    padding: 12px 20px;
  }

  .nav {
    order: 3;
    width: 100%;
    gap: 20px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
  }

  .hero h1 {
    font-size: 28px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .courses-grid {
    grid-template-columns: 1fr;
  }

  .article-content {
    padding: 24px;
  }

  .article-header h1 {
    font-size: 24px;
  }

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

  .related-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 480px) {
  .hero-actions {
    flex-direction: column;
  }

  .filter-tabs {
    flex-direction: column;
    align-items: center;
  }

  .filter-tab {
    width: 100%;
    max-width: 200px;
  }
}
