/* 车载香氛 - 系列教程风格样式表 */
/* CSS 变量定义 */
:root {
  --accent-color: #4caf50;
  --accent-light: #81c784;
  --accent-dark: #388e3c;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f5f5f5;
  --bg-dark: #263238;
  --border-color: #e0e0e0;
  --shadow-sm: 0 2px 4px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 8px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 16px rgba(0,0,0,0.1);
  --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 {
  text-decoration: none;
  color: var(--accent-color);
  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 20px;
}

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

.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);
}

.logo span {
  color: var(--text-primary);
}

.nav {
  display: flex;
  gap: 2rem;
}

.nav a {
  color: var(--text-secondary);
  font-weight: 500;
  padding: 0.5rem 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: var(--radius-md);
  padding: 0.5rem 1rem;
  gap: 0.5rem;
}

.search-box input {
  border: none;
  background: transparent;
  outline: none;
  width: 180px;
  font-size: 0.9rem;
}

.search-box button {
  border: none;
  background: var(--accent-color);
  color: white;
  padding: 0.4rem 1rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--accent-dark);
}

/* 面包屑导航 */
.breadcrumb {
  background: var(--bg-secondary);
  padding: 1rem 0;
  font-size: 0.9rem;
}

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

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

.breadcrumb .separator {
  margin: 0 0.5rem;
  color: var(--text-muted);
}

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

/* Hero 区域 */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  color: white;
  padding: 4rem 0;
  text-align: center;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 1rem;
}

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

/* 区块标题 */
.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

/* 系列卡片 */
.series-card {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  transition: box-shadow 0.2s, transform 0.2s;
}

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

.series-card .series-title {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.series-card .series-desc {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 1rem;
  line-height: 1.5;
}

.series-card .series-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.series-card .series-meta .count {
  background: var(--accent-light);
  color: white;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-weight: 500;
}

.series-card .series-meta .status {
  color: var(--accent-color);
  font-weight: 500;
}

/* 系列网格 */
.series-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* 文章列表 */
.article-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.article-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: box-shadow 0.2s;
}

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

.article-item .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: 0.8rem;
}

.article-item .article-info {
  flex: 1;
}

.article-item .article-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

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

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

.article-item .article-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* 系列部分列表 */
.part-list {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.part-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.5rem;
  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-item .part-number {
  width: 32px;
  height: 32px;
  background: var(--bg-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 600;
  flex-shrink: 0;
}

.part-item .part-info {
  flex: 1;
}

.part-item .part-title {
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.part-item .part-date {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.part-item .part-check {
  color: var(--accent-color);
  font-weight: bold;
}

/* 进度指示器 */
.progress-indicator {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin: 1.5rem 0;
}

.progress-bar {
  height: 8px;
  background: var(--border-color);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.5rem;
}

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

.progress-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  text-align: center;
}

/* 上下篇导航 */
.prev-next {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin: 2rem 0;
  padding: 1.5rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-lg);
}

.prev-next a {
  display: flex;
  flex-direction: column;
  padding: 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  flex: 1;
  border: 1px solid var(--border-color);
  transition: box-shadow 0.2s;
}

.prev-next a:hover {
  box-shadow: var(--shadow-sm);
}

.prev-next .next {
  text-align: right;
  align-items: flex-end;
}

.prev-next .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.prev-next .title {
  font-weight: 600;
  color: var(--text-primary);
}

/* 系列目录 */
.series-toc {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.series-toc h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.series-toc ul {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.series-toc li a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.series-toc li a:hover {
  background: var(--bg-primary);
  color: var(--accent-color);
}

.series-toc li.current a {
  background: var(--accent-color);
  color: white;
}

/* 内容区域 */
.content-section {
  padding: 3rem 0;
}

.content-section.alt {
  background: var(--bg-secondary);
}

/* 文章正文 */
.article-content {
  background: var(--bg-primary);
  padding: 2rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
}

.article-content h1 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.5rem;
  margin: 2rem 0 1rem;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border-color);
}

.article-content h3 {
  font-size: 1.25rem;
  margin: 1.5rem 0 0.75rem;
  color: var(--text-primary);
}

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

.article-content ul,
.article-content ol {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

.article-content ul li {
  list-style: disc;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.article-content img {
  margin: 1.5rem 0;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

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

.article-content code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: var(--radius-sm);
  font-family: 'Monaco', 'Consolas', monospace;
  font-size: 0.9em;
}

.article-content pre {
  background: var(--bg-dark);
  color: white;
  padding: 1rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1.5rem 0;
}

.article-content pre code {
  background: transparent;
  padding: 0;
}

/* 三栏布局 */
.three-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.column h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
}

.column ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.column li a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.column li a::before {
  content: '•';
  color: var(--accent-color);
}

/* 页脚 */
.footer {
  background: var(--bg-dark);
  color: white;
  padding: 3rem 0 2rem;
  margin-top: 4rem;
}

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

.footer-brand .logo {
  margin-bottom: 1rem;
}

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

.footer-column h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
  color: white;
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-column a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
}

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

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

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

.error-content h1 {
  font-size: 8rem;
  color: var(--accent-color);
  line-height: 1;
  margin-bottom: 1rem;
}

.error-content h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.error-content p {
  color: var(--text-secondary);
  margin-bottom: 2rem;
  font-size: 1.1rem;
}

.btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background: var(--accent-color);
  color: white;
  border-radius: var(--radius-md);
  font-weight: 500;
  transition: background 0.2s;
}

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

/* 分类页头部 */
.category-header {
  background: var(--bg-secondary);
  padding: 3rem 0;
  text-align: center;
}

.category-header h1 {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.category-header .category-meta {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
}

.category-header .category-cover {
  max-width: 600px;
  margin: 0 auto;
  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: 1.5rem;
}

.category-header .category-desc {
  max-width: 600px;
  margin: 1.5rem auto 0;
  color: var(--text-secondary);
  line-height: 1.6;
}

/* 推荐文章横向列表 */
.related-horizontal {
  background: var(--bg-secondary);
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  margin-bottom: 2rem;
}

.related-horizontal h4 {
  font-size: 1rem;
  margin-bottom: 1rem;
}

.related-horizontal ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.related-horizontal li a {
  color: var(--text-secondary);
  padding: 0.5rem 1rem;
  background: var(--bg-primary);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
  border: 1px solid var(--border-color);
}

.related-horizontal li a:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
}

/* 两栏布局 */
.two-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

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

@media (max-width: 768px) {
  .nav {
    display: none;
  }

  .search-box {
    display: none;
  }

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

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

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

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

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

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

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

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

  .prev-next {
    flex-direction: column;
  }

  .prev-next .next {
    text-align: left;
    align-items: flex-start;
  }

  .article-content {
    padding: 1.5rem;
  }

  .article-content h1 {
    font-size: 1.5rem;
  }

  .article-content h2 {
    font-size: 1.25rem;
  }

  .error-content h1 {
    font-size: 5rem;
  }

  .error-content h2 {
    font-size: 1.5rem;
  }
}

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

  .content-section {
    padding: 2rem 0;
  }

  .section-title {
    font-size: 1.25rem;
  }
}
