/* ========================================
   陶瓷制作 - 系列教程风格样式
   www.taoyijiao.cn
   ======================================== */

/* CSS 变量定义 */
:root {
  --accent-color: #8B4513;
  --accent-light: #D2691E;
  --accent-dark: #5D3A1A;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --bg-primary: #FAF8F5;
  --bg-secondary: #F5F0EB;
  --bg-card: #FFFFFF;
  --border-color: #E8E0D8;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --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;
}

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

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

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

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

ul {
  list-style: none;
}

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

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

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

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

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

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

.logo span {
  color: var(--accent-light);
}

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

.nav a {
  color: var(--text-primary);
  font-weight: 500;
  transition: color 0.2s;
}

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

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

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

/* 面包屑 */
.breadcrumb {
  padding: 16px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

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

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

.breadcrumb span {
  margin: 0 8px;
  color: var(--text-muted);
}

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

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

.footer-brand .logo {
  margin-bottom: 16px;
  display: inline-block;
}

.footer-brand p {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.8;
}

.footer-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.footer-links li {
  margin-bottom: 12px;
}

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

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

.footer-bottom {
  border-top: 1px solid var(--border-color);
  padding-top: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ========================================
   首页组件
   ======================================== */

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

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

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

.hero-stats {
  display: flex;
  justify-content: center;
  gap: 48px;
}

.stat-item {
  text-align: center;
}

.stat-number {
  font-size: 32px;
  font-weight: 700;
  color: var(--accent-color);
}

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

/* 区块标题 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.section-title {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
}

.section-more {
  font-size: 14px;
  color: var(--accent-color);
}

/* 系列卡片网格 */
.section {
  padding: 48px 0;
}

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

.series-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.3s, transform 0.3s;
  border: 1px solid var(--border-color);
}

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

.series-card.featured {
  grid-column: span 2;
  display: flex;
}

.series-card.featured .series-cover {
  width: 50%;
  min-height: 240px;
}

.series-card.featured .series-content {
  width: 50%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

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

.series-content {
  padding: 20px;
}

.series-tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--accent-color);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
}

.series-name {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.series-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.6;
}

.series-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.series-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;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

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

.article-thumb {
  width: 120px;
  height: 80px;
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 32px;
}

.article-info {
  flex: 1;
}

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

.article-summary {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 三栏内容区 */
.content-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.content-column h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--accent-color);
}

.link-list li {
  margin-bottom: 12px;
}

.link-list a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-primary);
  font-size: 14px;
}

.link-list a::before {
  content: "•";
  color: var(--accent-color);
}

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

/* ========================================
   分类页组件
   ======================================== */

.series-header {
  background: var(--bg-card);
  padding: 48px 0;
  border-bottom: 1px solid var(--border-color);
}

.series-header-inner {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 40px;
  align-items: start;
}

.series-cover-large {
  width: 100%;
  height: 200px;
  background: linear-gradient(135deg, var(--accent-light) 0%, var(--accent-color) 100%);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 64px;
}

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

.series-info .meta {
  display: flex;
  gap: 24px;
  color: var(--text-secondary);
  font-size: 14px;
  margin-bottom: 20px;
}

.series-info .description {
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 24px;
}

.series-progress-bar {
  background: var(--bg-secondary);
  height: 8px;
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 8px;
}

.series-progress-fill {
  background: var(--accent-color);
  height: 100%;
  border-radius: 4px;
}

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

/* 课程列表 */
.parts-list {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.part-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  transition: background 0.2s;
}

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

.part-item:hover {
  background: var(--bg-secondary);
}

.part-item.completed .part-number {
  background: var(--accent-color);
  color: white;
}

.part-number {
  width: 40px;
  height: 40px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  margin-right: 16px;
  flex-shrink: 0;
}

.part-content {
  flex: 1;
}

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

.part-meta {
  font-size: 13px;
  color: var(--text-muted);
}

.part-status {
  color: var(--accent-color);
  font-size: 14px;
}

/* ========================================
   文章页组件
   ======================================== */

.article-header {
  background: var(--bg-card);
  padding: 40px 0;
  border-bottom: 1px solid var(--border-color);
}

.article-meta-top {
  text-align: center;
  margin-bottom: 24px;
}

.article-series-tag {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--accent-color);
  padding: 6px 16px;
  border-radius: var(--radius-md);
  font-size: 14px;
  margin-bottom: 16px;
}

.article-main-title {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 12px;
}

.article-part-info {
  color: var(--text-secondary);
  font-size: 14px;
}

/* 文章导航 */
.article-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
}

.nav-prev,
.nav-next {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  transition: background 0.2s;
}

.nav-prev:hover,
.nav-next:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

.nav-prev span,
.nav-next span {
  font-size: 13px;
  color: var(--text-muted);
}

.nav-prev div,
.nav-next div {
  font-weight: 500;
}

.nav-series-list {
  padding: 12px 20px;
  background: var(--accent-color);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 500;
}

.nav-series-list:hover {
  background: var(--accent-dark);
  color: white;
}

/* 文章内容 */
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 0;
}

.article-content {
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
}

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

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

.article-content p {
  margin-bottom: 20px;
}

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

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

.article-content img {
  border-radius: var(--radius-md);
  margin: 24px 0;
}

.article-content blockquote {
  border-left: 4px solid var(--accent-color);
  padding-left: 20px;
  margin: 24px 0;
  color: var(--text-secondary);
  font-style: italic;
}

.article-content code {
  background: var(--bg-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  font-family: monospace;
  font-size: 14px;
}

.article-content pre {
  background: var(--bg-secondary);
  padding: 20px;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 24px 0;
}

/* 系列进度 */
.series-progress-section {
  background: var(--bg-secondary);
  padding: 32px;
  border-radius: var(--radius-lg);
  margin: 40px 0;
}

.series-progress-section h3 {
  font-size: 18px;
  margin-bottom: 16px;
}

/* 更多课程 */
.more-parts {
  margin-top: 48px;
}

.more-parts h3 {
  font-size: 20px;
  margin-bottom: 20px;
}

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

.part-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px;
  transition: box-shadow 0.2s;
}

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

.part-card .part-num {
  font-size: 13px;
  color: var(--accent-color);
  margin-bottom: 8px;
}

.part-card .part-title {
  font-weight: 600;
  margin-bottom: 8px;
}

.part-card .part-date {
  font-size: 13px;
  color: var(--text-muted);
}

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

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

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

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

.error-title {
  font-size: 28px;
  font-weight: 600;
  margin-bottom: 16px;
}

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

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

.btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: all 0.2s;
}

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

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

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

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

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

@media (max-width: 1024px) {
  .series-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .series-card.featured {
    grid-column: span 2;
  }

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

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

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

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

  .search-box {
    display: none;
  }

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

  .hero-stats {
    gap: 24px;
  }

  .stat-number {
    font-size: 24px;
  }

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

  .series-card.featured {
    grid-column: span 1;
    flex-direction: column;
  }

  .series-card.featured .series-cover,
  .series-card.featured .series-content {
    width: 100%;
  }

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

  .series-header-inner {
    grid-template-columns: 1fr;
  }

  .series-cover-large {
    height: 160px;
  }

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

  .article-nav {
    flex-direction: column;
    gap: 12px;
  }

  .nav-prev,
  .nav-next {
    width: 100%;
    justify-content: center;
  }

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

  .error-code {
    font-size: 80px;
  }
}

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

  .hero {
    padding: 40px 0;
  }

  .section {
    padding: 32px 0;
  }

  .article-item {
    flex-direction: column;
  }

  .article-thumb {
    width: 100%;
    height: 120px;
  }

  .part-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .part-number {
    margin-right: 0;
  }
}
