
/* ============================================
   第一次世界大战知识图谱 — 军绿色主题
   作者：知乔 & Claude Code
   ============================================ */

:root {
  --primary: #4A5D23;
  --primary-dark: #2C3E14;
  --primary-light: #6B7F3A;
  --primary-lighter: #8FA64D;
  --accent: #C5A55A;
  --accent-light: #D4BC7E;
  --accent-dark: #A68B3C;
  --bg: #F5F3EE;
  --bg-warm: #EDE9E0;
  --bg-card: #FFFFFF;
  --text: #2C2C2C;
  --text2: #666666;
  --text3: #999999;
  --border: #E0DDD6;
  --border-light: #EDE9E0;
  --sidebar-bg: #2C3E14;
  --sidebar-text: #E8E4D9;
  --sidebar-hover: #3A5019;
  --sidebar-active: #4A5D23;
  --sidebar-divider: rgba(255,255,255,0.12);
  --tag-cause: #8B6914;
  --tag-battle: #8B0000;
  --tag-person: #2E5A88;
  --tag-country: #4A5D23;
  --tag-treaty: #6B3A7D;
  --tag-tech: #5A5A5A;
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --font-serif: Georgia, 'Noto Serif SC', 'SimSun', serif;
  --font-mono: 'Menlo', 'Consolas', monospace;
  --font-display: Georgia, 'Noto Serif SC', serif;
  --sidebar-width: 280px;
  --content-max-width: 780px;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);
  --transition: 0.2s ease;
}

/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.7;
}

a { color: var(--primary); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--primary-light); }

/* ============================================
   Layout
   ============================================ */

.layout {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */

.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: var(--sidebar-text);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  overflow-y: auto;
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease;
}

.sidebar-header {
  padding: 24px 20px 16px;
  border-bottom: 1px solid var(--sidebar-divider);
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sidebar-text);
  text-decoration: none;
}

.sidebar-logo:hover { color: #fff; }

.logo-icon {
  font-size: 28px;
  line-height: 1;
}

.logo-text {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.sidebar-subtitle {
  font-size: 12px;
  color: rgba(255,255,255,0.5);
  margin-top: 6px;
  padding-left: 38px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
  overflow-y: auto;
}

.nav-item {
  display: block;
  padding: 7px 20px 7px 24px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  text-decoration: none;
  transition: all var(--transition);
  border-left: 3px solid transparent;
  opacity: 0.85;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
  opacity: 1;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
  border-left-color: var(--accent);
  opacity: 1;
  font-weight: 600;
}

.nav-home {
  font-weight: 600;
  padding: 10px 20px 10px 24px;
  margin-bottom: 4px;
}

.nav-group-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  padding: 16px 20px 6px 24px;
  font-weight: 700;
}

.nav-group {
  margin-bottom: 4px;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--sidebar-divider);
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.sidebar-date { margin-top: 4px; }

.sidebar-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  background: var(--primary-dark);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 20px;
  cursor: pointer;
}

/* ============================================
   Main Content
   ============================================ */

.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  min-height: 100vh;
}

.content-wrapper {
  max-width: var(--content-max-width);
  margin: 0 auto;
  padding: 48px 40px 80px;
}

/* ============================================
   Article Pages
   ============================================ */

.article-header {
  margin-bottom: 36px;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--border);
}

.type-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.article-title {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.article-date {
  font-size: 14px;
  color: var(--text2);
}

.article-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.tag {
  display: inline-block;
  padding: 2px 10px;
  background: var(--bg-warm);
  border-radius: 12px;
  font-size: 12px;
  color: var(--text2);
}

/* Article Body */
.article-body h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin: 36px 0 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
  color: var(--primary-dark);
}

.article-body h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 28px 0 12px;
  color: var(--primary);
}

.article-body h4 {
  font-size: 17px;
  font-weight: 600;
  margin: 24px 0 10px;
}

.article-body p {
  margin-bottom: 16px;
  font-size: 15.5px;
  line-height: 1.8;
}

.article-body ul, .article-body ol {
  margin: 12px 0 16px 24px;
}

.article-body li {
  margin-bottom: 6px;
  font-size: 15px;
  line-height: 1.7;
}

.article-body pre {
  background: #1a1a1a;
  color: #e8e8e8;
  padding: 16px 20px;
  border-radius: var(--radius);
  overflow-x: auto;
  margin: 16px 0;
  font-size: 13.5px;
  line-height: 1.6;
}

.article-body code {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.article-body p code {
  background: var(--bg-warm);
  padding: 2px 6px;
  border-radius: 3px;
  color: var(--primary-dark);
}

.article-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

.article-body blockquote {
  border-left: 4px solid var(--accent);
  padding: 12px 20px;
  margin: 16px 0;
  background: var(--bg-warm);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--text2);
}

/* Wikilinks */
.wikilink {
  color: var(--primary);
  text-decoration: none;
  border-bottom: 1px dashed var(--primary-light);
  transition: all var(--transition);
}

.wikilink:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: rgba(197, 165, 90, 0.08);
}

.wikilink-broken {
  color: var(--text3);
  border-bottom: 1px dashed var(--border);
  cursor: help;
}

/* ============================================
   Homepage
   ============================================ */

.hero {
  text-align: center;
  padding: 48px 0 40px;
  margin-bottom: 40px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  border-radius: var(--radius-lg);
  color: #fff;
}

.hero-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-display);
  font-size: 42px;
  font-weight: 700;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.hero-subtitle {
  font-size: 20px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 24px;
  letter-spacing: 4px;
}

.hero-desc {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255,255,255,0.8);
  max-width: 520px;
  margin: 0 auto;
}

.section-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  color: var(--primary-dark);
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--accent);
}

/* Stats */
.stats-section {
  margin-bottom: 48px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  transition: transform var(--transition), box-shadow var(--transition);
}

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

.stat-card.stat-total {
  background: var(--primary-dark);
  color: #fff;
}

.stat-card.stat-total .stat-label { color: rgba(255,255,255,0.7); }

.stat-num {
  display: block;
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.stat-total .stat-num { color: var(--accent); }

.stat-label {
  display: block;
  font-size: 13px;
  color: var(--text2);
  margin-top: 6px;
}

/* Nav Cards */
.nav-section {
  margin-bottom: 48px;
}

.nav-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.nav-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 24px 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: var(--text);
  transition: all var(--transition);
}

.nav-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
  color: var(--primary);
}

.nav-card-icon {
  font-size: 32px;
  margin-bottom: 10px;
}

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

.nav-card-count {
  font-size: 13px;
  color: var(--text3);
}

/* About */
.about-section {
  margin-bottom: 48px;
}

.about-content {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 24px 28px;
  border: 1px solid var(--border-light);
  box-shadow: var(--shadow-sm);
}

.about-content p {
  margin-bottom: 12px;
  font-size: 15px;
  line-height: 1.8;
  color: var(--text2);
}

.about-content .highlight {
  color: var(--primary);
  font-weight: 600;
}

.about-authors {
  color: var(--accent-dark) !important;
  font-weight: 600;
  margin-top: 16px !important;
}

/* ============================================
   Index Pages
   ============================================ */

.index-page h1 {
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--primary-dark);
}

.index-desc {
  font-size: 15px;
  color: var(--text2);
  margin-bottom: 32px;
}

.index-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.index-table th {
  background: var(--primary-dark);
  color: #fff;
  padding: 12px 16px;
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.index-table td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-light);
  font-size: 14px;
}

.index-table tr:hover td {
  background: rgba(74, 93, 35, 0.04);
}

.index-table a {
  color: var(--primary);
  font-weight: 500;
}

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

/* ============================================
   Changelog
   ============================================ */

.changelog h2 {
  font-size: 20px;
  margin: 32px 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.version {
  background: var(--accent);
  color: #fff;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
}

.changelog-date {
  font-size: 14px;
  color: var(--text3);
  font-weight: 400;
}

.change-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.change-list li {
  padding: 8px 0 8px 20px;
  position: relative;
  font-size: 14.5px;
  line-height: 1.6;
}

.change-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 14px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
}

.change-type {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  margin-right: 8px;
  letter-spacing: 0.3px;
}

.change-type.feat { background: #d4edda; color: #155724; }
.change-type.fix { background: #f8d7da; color: #721c24; }
.change-type.plan { background: #d1ecf1; color: #0c5460; }

/* ============================================
   Responsive
   ============================================ */

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }

  .sidebar-open .sidebar {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: block;
  }

  .main-content {
    margin-left: 0;
  }

  .content-wrapper {
    padding: 24px 20px 60px;
  }

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

  .article-title {
    font-size: 24px;
  }

  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .nav-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* ============================================
   Scrollbar
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(0,0,0,0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(0,0,0,0.25);
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.15);
}

/* ============================================
   Print
   ============================================ */

@media print {
  .sidebar, .sidebar-toggle { display: none !important; }
  .main-content { margin-left: 0; }
}
