:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --text: #1f2937;
  --text-light: #6b7280;
  --bg: #ffffff;
  --bg-alt: #f9fafb;
  --border: #e5e7eb;
  --section-bg: #f0f9ff;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.site-header {
  background: linear-gradient(135deg, #1e40af 0%, #2563eb 100%);
  color: white;
  padding: 24px 0;
  text-align: center;
}

.site-header .logo {
  font-size: 28px;
  font-weight: 700;
  color: white;
  text-decoration: none;
}

.site-header .tagline {
  margin-top: 6px;
  opacity: 0.9;
  font-size: 14px;
}

/* Main */
main.container {
  padding: 32px 20px;
  min-height: calc(100vh - 200px);
}

/* Search */
.search-box {
  max-width: 600px;
  margin: 0 auto 40px;
}

.search-box input {
  width: 100%;
  padding: 16px 20px;
  font-size: 16px;
  border: 2px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: border-color 0.2s;
}

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

.search-box input::placeholder {
  color: var(--text-light);
}

/* Home sections */
.home-section {
  margin-bottom: 40px;
}

.home-section h2 {
  font-size: 20px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

/* Section grid */
.section-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.section-card {
  background: var(--section-bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.section-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
  transform: translateY(-2px);
}

.section-card .section-code {
  font-size: 12px;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}

.section-card .section-name {
  font-size: 14px;
  font-weight: 500;
}

/* Chapter list */
.chapter-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.chapter-item {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  text-decoration: none;
  color: var(--text);
  transition: all 0.2s;
}

.chapter-item:hover {
  background: var(--section-bg);
  border-color: var(--primary);
}

.chapter-item .chapter-code {
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-right: 8px;
}

.chapter-item .chapter-name {
  font-size: 13px;
}

/* Breadcrumb */
.breadcrumb {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 20px;
}

.breadcrumb a {
  color: var(--primary);
  text-decoration: none;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.breadcrumb .separator {
  margin: 0 6px;
}

/* Detail page */
.detail-page h1 {
  font-size: 24px;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.info-card {
  background: var(--bg-alt);
  border-radius: 8px;
  padding: 16px;
}

.info-card .info-label {
  font-size: 12px;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.info-card .info-value {
  font-size: 14px;
  font-weight: 500;
}

.info-card.highlight {
  background: linear-gradient(135deg, #dbeafe 0%, #eff6ff 100%);
  border: 1px solid #bfdbfe;
}

.info-card.highlight .info-value {
  font-family: 'Courier New', monospace;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-dark);
}

/* Section page */
.section-page h1 {
  font-size: 22px;
  margin-bottom: 8px;
}

.section-page .section-desc {
  color: var(--text-light);
  margin-bottom: 24px;
}

/* Footer */
.site-footer {
  background: var(--bg-alt);
  border-top: 1px solid var(--border);
  padding: 24px 0;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}

.footer-sub {
  margin-top: 4px;
  font-size: 12px;
  opacity: 0.8;
}
