/* 盆栽学堂 - 交互教程风格样式 */
:root {
  --accent-color: #4a7c59;
  --accent-light: #6b9b7a;
  --accent-dark: #2d5a3d;
  --text-primary: #333;
  --text-secondary: #666;
  --text-muted: #999;
  --bg-primary: #fff;
  --bg-secondary: #f8faf8;
  --bg-code: #f5f5f5;
  --border-color: #e0e8e0;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 8px;
  --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-primary);
}

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

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

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

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

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

.logo-icon {
  width: 36px;
  height: 36px;
  background: var(--accent-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 18px;
}

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

.nav a {
  color: var(--text-secondary);
  font-size: 15px;
  font-weight: 500;
}

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

.search-box {
  position: relative;
}

.search-box input {
  width: 240px;
  padding: 8px 16px 8px 36px;
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 14px;
  background: var(--bg-secondary);
  outline: none;
}

.search-box input:focus {
  border-color: var(--accent-color);
}

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

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

/* Hero Section */
.hero {
  text-align: center;
  padding: 60px 20px;
  background: linear-gradient(135deg, var(--bg-secondary) 0%, #e8f5e9 100%);
  border-radius: var(--radius);
  margin-bottom: 48px;
}

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

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

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

.hero-search input {
  width: 100%;
  padding: 16px 24px 16px 48px;
  border: 2px solid var(--border-color);
  border-radius: 32px;
  font-size: 16px;
  background: var(--bg-primary);
  outline: none;
}

.hero-search input:focus {
  border-color: var(--accent-color);
}

.hero-search::before {
  content: "🔍";
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 18px;
}

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

.quick-link {
  padding: 12px 24px;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.quick-link:hover {
  border-color: var(--accent-color);
  color: var(--accent-color);
  box-shadow: var(--shadow);
}

/* Section Title */
.section-title {
  font-size: 24px;
  font-weight: 600;
  margin-bottom: 24px;
  color: var(--text-primary);
}

/* Topic List */
.topic-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 48px;
}

.topic-item {
  display: flex;
  align-items: center;
  padding: 20px 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid transparent;
  transition: all 0.2s;
}

.topic-item:hover {
  border-color: var(--accent-color);
  background: var(--bg-primary);
  box-shadow: var(--shadow);
}

.topic-icon {
  width: 48px;
  height: 48px;
  background: var(--accent-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 24px;
  margin-right: 16px;
  flex-shrink: 0;
}

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

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

.topic-arrow {
  margin-left: auto;
  color: var(--text-muted);
}

/* Article Grid */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}

.article-column h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border-color);
}

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

.article-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 12px;
  border-radius: var(--radius);
  transition: background 0.2s;
}

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

.article-item::before {
  content: "•";
  color: var(--accent-color);
  font-weight: bold;
}

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

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

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--text-secondary);
}

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

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

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

/* Category Header */
.category-header {
  margin-bottom: 32px;
}

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

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

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

.module-card {
  padding: 24px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

.module-card h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

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

/* Class List */
.class-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 48px;
}

.class-card {
  padding: 20px;
  background: var(--bg-secondary);
  border-radius: var(--radius);
  border: 1px solid var(--border-color);
}

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

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

/* Article Layout */
.article-layout {
  display: grid;
  grid-template-columns: 240px 1fr 240px;
  gap: 40px;
}

.sidebar-left {
  position: sticky;
  top: calc(var(--header-height) + 40px);
  height: fit-content;
}

.sidebar-left h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.sidebar-left .module-desc {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 24px;
  line-height: 1.6;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.sidebar-nav a {
  padding: 8px 12px;
  font-size: 14px;
  color: var(--text-secondary);
  border-radius: var(--radius);
}

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

.article-content {
  min-width: 0;
}

.article-content h1 {
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 24px;
}

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

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

.code-block {
  background: var(--bg-code);
  border-radius: var(--radius);
  padding: 20px;
  margin: 20px 0;
  overflow-x: auto;
}

.code-block pre {
  font-family: "SF Mono", Monaco, "Cascadia Code", monospace;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
}

.sidebar-right {
  position: sticky;
  top: calc(var(--header-height) + 40px);
  height: fit-content;
}

.sidebar-right h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

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

.toc a {
  font-size: 14px;
  color: var(--text-secondary);
  padding-left: 12px;
  border-left: 2px solid var(--border-color);
}

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

/* Recommended Section */
.recommended {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border-color);
}

.recommended h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 16px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
}

.tag {
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-radius: 16px;
  font-size: 14px;
  color: var(--text-secondary);
}

.tag:hover {
  background: var(--accent-color);
  color: #fff;
}

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

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

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

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

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

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

/* Footer */
.footer {
  border-top: 1px solid var(--border-color);
  padding: 40px 24px;
  margin-top: 64px;
}

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

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

.footer-links {
  display: flex;
  gap: 24px;
}

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

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

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

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

  .article-content {
    order: 0;
  }
}

@media (max-width: 768px) {
  .header-inner {
    padding: 0 16px;
  }

  .nav {
    display: none;
  }

  .search-box {
    display: none;
  }

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

  .hero p {
    font-size: 16px;
  }

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

  .class-list {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 24px 16px;
  }

  .footer-inner {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
}
