/* ========================================
   瑜伽 - www.yujiafushi.cn
   交互教程风格 - 简洁优雅的瑜伽课程平台
   ======================================== */

/* CSS 变量 */
:root {
  --accent-color: #9c27b0;
  --accent-light: #e1bee7;
  --accent-dark: #7b1fa2;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8f9fa;
  --bg-tertiary: #f0f0f0;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --max-width: 1200px;
  --header-height: 64px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-primary);
}

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

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

ul, ol {
  list-style: none;
}

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

/* ========================================
   布局组件
   ======================================== */

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

.section {
  padding: 60px 0;
}

.section-title {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 32px;
  color: var(--text-primary);
}

/* ========================================
   头部导航
   ======================================== */

.header {
  height: var(--header-height);
  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: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent-color);
}

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

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

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

.search-box {
  position: relative;
}

.search-box input {
  width: 240px;
  padding: 8px 16px 8px 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  transition: all 0.2s;
}

.search-box input:focus {
  outline: none;
  border-color: var(--accent-color);
  width: 280px;
}

.search-box::before {
  content: "🔍";
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
}

/* ========================================
   Hero 区域
   ======================================== */

.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: #fff;
  padding: 80px 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero p {
  font-size: 1.125rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  position: relative;
}

.hero-search input {
  width: 100%;
  padding: 16px 24px;
  border: none;
  border-radius: var(--radius-lg);
  font-size: 1rem;
  box-shadow: var(--shadow-lg);
}

.hero-search input:focus {
  outline: 2px solid var(--accent-light);
}

/* ========================================
   快捷链接
   ======================================== */

.quick-links {
  display: flex;
  justify-content: center;
  gap: 16px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.quick-link {
  padding: 12px 24px;
  background: rgba(255,255,255,0.15);
  color: #fff;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s;
}

.quick-link:hover {
  background: rgba(255,255,255,0.25);
  color: #fff;
}

/* ========================================
   卡片组件
   ======================================== */

.card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.2s;
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
}

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

.card-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.6;
}

/* ========================================
   课程网格
   ======================================== */

.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.course-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: all 0.2s;
}

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

.course-image {
  height: 160px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-color) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
}

.course-content {
  padding: 20px;
}

.course-title {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.course-meta {
  display: flex;
  gap: 16px;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-top: 12px;
}

.course-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ========================================
   文章列表
   ======================================== */

.article-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.article-item {
  display: flex;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all 0.2s;
}

.article-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.article-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.article-info {
  flex: 1;
}

.article-title {
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.article-desc {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================================
   三栏布局
   ======================================== */

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

.column h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-color);
  display: inline-block;
}

.column-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.column-list a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  padding: 4px 0;
  display: block;
  transition: all 0.2s;
}

.column-list a:hover {
  color: var(--accent-color);
  padding-left: 8px;
}

.column-list a::before {
  content: "•";
  margin-right: 8px;
  color: var(--accent-light);
}

/* ========================================
   面包屑导航
   ======================================== */

.breadcrumb {
  padding: 16px 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

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

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

.breadcrumb span {
  margin: 0 8px;
}

/* ========================================
   分类页面
   ======================================== */

.category-header {
  background: var(--bg-secondary);
  padding: 48px 0;
  margin-bottom: 40px;
}

.category-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.category-header p {
  color: var(--text-secondary);
  font-size: 1.0625rem;
}

.module-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 48px;
}

.module-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 24px;
  transition: all 0.2s;
}

.module-item:hover {
  border-color: var(--accent-light);
  box-shadow: var(--shadow-sm);
}

.module-name {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.module-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

/* ========================================
   文章详情页
   ======================================== */

.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 40px;
  padding: 40px 0;
}

.sidebar-left {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-right {
  position: sticky;
  top: 100px;
  height: fit-content;
}

.sidebar-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.toc-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toc-list a {
  color: var(--text-secondary);
  font-size: 0.875rem;
  padding: 4px 0;
  display: block;
  border-left: 2px solid var(--border-color);
  padding-left: 12px;
  transition: all 0.2s;
}

.toc-list a:hover,
.toc-list a.active {
  color: var(--accent-color);
  border-left-color: var(--accent-color);
}

.article-content {
  max-width: 720px;
}

.article-content h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 40px 0 16px;
  color: var(--text-primary);
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 32px 0 12px;
}

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

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

.article-content ul {
  list-style: disc;
}

.article-content ol {
  list-style: decimal;
}

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

.code-block {
  background: #1e1e1e;
  color: #d4d4d4;
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  font-family: "Consolas", "Monaco", monospace;
  font-size: 0.875rem;
  line-height: 1.6;
  margin: 20px 0;
}

.code-block code {
  font-family: inherit;
}

/* ========================================
   参数表格
   ======================================== */

.params-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
}

.params-table th,
.params-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-color);
}

.params-table th {
  font-weight: 600;
  color: var(--text-primary);
  background: var(--bg-secondary);
}

.params-table td {
  color: var(--text-secondary);
}

.param-name {
  font-family: monospace;
  color: var(--accent-color);
  font-size: 0.9375rem;
}

.param-type {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ========================================
   404 页面
   ======================================== */

.error-page {
  min-height: calc(100vh - var(--header-height) - 300px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 24px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--accent-light);
  line-height: 1;
  margin-bottom: 16px;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.error-desc {
  color: var(--text-secondary);
  margin-bottom: 32px;
  max-width: 400px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s;
  border: none;
  cursor: pointer;
  font-size: 1rem;
}

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

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

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

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

/* ========================================
   页脚
   ======================================== */

.footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
  padding: 48px 0 24px;
  margin-top: 80px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-color);
  margin-bottom: 12px;
}

.footer-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.footer-title {
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  color: var(--text-secondary);
  font-size: 0.9375rem;
}

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ========================================
   响应式设计
   ======================================== */

@media (max-width: 1024px) {
  .article-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .sidebar-left,
  .sidebar-right {
    position: static;
    order: 2;
  }

  .article-content {
    order: 1;
    max-width: 100%;
  }

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

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

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

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

  .search-box {
    order: 2;
  }

  .search-box input {
    width: 180px;
  }

  .hero {
    padding: 60px 0;
  }

  .hero h1 {
    font-size: 1.875rem;
  }

  .hero p {
    font-size: 1rem;
  }

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

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

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

  .footer-bottom {
    flex-direction: column;
    gap: 12px;
    text-align: center;
  }

  .error-code {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }

  .section {
    padding: 40px 0;
  }

  .quick-links {
    flex-direction: column;
    align-items: center;
  }

  .quick-link {
    width: 100%;
    max-width: 280px;
    text-align: center;
  }
}
