/* 车载香氛 - 系列教程风格样式表 */
/* 主色调: #4caf50 (绿色) */

:root {
  --accent-color: #4caf50;
  --accent-light: #81c784;
  --accent-dark: #388e3c;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-white: #fff;
  --bg-light: #f8f9fa;
  --bg-gray: #f0f2f5;
  --border-color: #e0e0e0;
  --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", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text-primary);
  background: var(--bg-light);
}

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

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

/* ===== Header ===== */
.header {
  background: var(--bg-white);
  box-shadow: var(--shadow);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 20px;
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

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

.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-light);
  border-radius: 20px;
  padding: 6px 16px;
  width: 200px;
}

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

.search-box button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--text-muted);
}

/* ===== Main Container ===== */
.main {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 20px;
}

/* ===== Hero Section ===== */
.hero {
  background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-dark) 100%);
  border-radius: var(--radius-lg);
  padding: 60px 40px;
  color: var(--bg-white);
  margin-bottom: 40px;
  text-align: center;
}

.hero h1 {
  font-size: 36px;
  margin-bottom: 16px;
}

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

/* ===== Section Title ===== */
.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;
}

/* ===== Card Grid ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 40px;
}

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

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

.card-image {
  height: 160px;
  background: var(--bg-gray);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 48px;
}

.card-body {
  padding: 20px;
}

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

.card-meta {
  font-size: 14px;
  color: var(--text-muted);
  display: flex;
  gap: 16px;
}

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

/* ===== Series Card (Large) ===== */
.series-featured {
  background: var(--bg-white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 32px;
  margin-bottom: 40px;
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: center;
}

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

.series-info h2 {
  font-size: 28px;
  margin-bottom: 12px;
}

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

.series-stats {
  display: flex;
  gap: 24px;
  font-size: 14px;
  color: var(--text-muted);
}

.series-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ===== Article List ===== */
.article-list {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 40px;
}

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

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

.article-item:hover {
  background: var(--bg-light);
}

.article-item.completed::before {
  content: "✓";
  width: 24px;
  height: 24px;
  background: var(--accent-color);
  color: var(--bg-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.article-item:not(.completed)::before {
  content: attr(data-index);
  width: 24px;
  height: 24px;
  background: var(--bg-gray);
  color: var(--text-secondary);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}

.article-content {
  flex: 1;
}

.article-content h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 4px;
}

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

.article-date {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ===== Breadcrumb ===== */
.breadcrumb {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 12px 20px;
  margin-bottom: 24px;
  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);
}

/* ===== Article Content ===== */
.article-header {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.article-header h1 {
  font-size: 28px;
  margin-bottom: 12px;
}

.article-header .meta {
  color: var(--text-muted);
  font-size: 14px;
}

.article-body {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 40px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}

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

.article-body h3 {
  font-size: 20px;
  margin: 24px 0 12px;
  color: var(--accent-dark);
}

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

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

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

.article-body img {
  max-width: 100%;
  border-radius: var(--radius);
  margin: 24px 0;
}

.featured-image {
  width: 100%;
  height: 300px;
  background: var(--bg-gray);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 64px;
  margin-bottom: 24px;
}

/* ===== Navigation ===== */
.part-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-light);
  border-radius: var(--radius);
  padding: 16px 24px;
  margin-bottom: 24px;
}

.part-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-secondary);
  font-weight: 500;
}

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

.part-nav .current {
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Progress ===== */
.progress-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

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

/* ===== Sidebar Lists ===== */
.sidebar-section {
  background: var(--bg-white);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

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

.sidebar-list {
  list-style: none;
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-list li:last-child {
  border-bottom: none;
}

.sidebar-list a {
  color: var(--text-secondary);
  display: block;
  transition: color 0.2s, padding-left 0.2s;
}

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

/* ===== Three Column Layout ===== */
.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 40px;
}

/* ===== 404 Page ===== */
.error-page {
  text-align: center;
  padding: 80px 20px;
}

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

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

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

.btn {
  display: inline-block;
  padding: 12px 32px;
  background: var(--accent-color);
  color: var(--bg-white);
  border-radius: var(--radius);
  font-weight: 500;
  transition: background 0.2s;
}

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

/* ===== Footer ===== */
.footer {
  background: var(--bg-white);
  border-top: 1px solid var(--border-color);
  padding: 40px 20px;
  margin-top: 60px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}

.footer-brand p {
  color: var(--text-secondary);
  margin-top: 12px;
  font-size: 14px;
}

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

.footer-links {
  list-style: none;
}

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

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

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

.footer-bottom {
  max-width: var(--max-width);
  margin: 40px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--border-color);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* ===== Two Column Layout (Article Page) ===== */
.two-col {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .two-col {
    grid-template-columns: 1fr;
  }

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

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

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

  .nav {
    order: 3;
    width: 100%;
    gap: 16px;
    margin-top: 12px;
    overflow-x: auto;
  }

  .search-box {
    width: 150px;
  }

  .hero {
    padding: 40px 20px;
  }

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

  .series-featured {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .series-cover {
    width: 150px;
    height: 150px;
    margin: 0 auto;
  }

  .article-body {
    padding: 24px;
  }

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

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

@media (max-width: 480px) {
  .part-nav {
    flex-direction: column;
    gap: 12px;
  }

  .series-stats {
    flex-wrap: wrap;
    justify-content: center;
  }
}
