/* 攀岩网站样式 - www.yingdipanyan.cn */

:root {
  --primary-color: #2c5530;
  --secondary-color: #4a7c59;
  --accent-color: #e07a5f;
  --bg-color: #f8f9fa;
  --card-bg: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #666666;
  --text-light: #999999;
  --border-color: #e5e5e5;
  --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;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-color);
}

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

a:hover {
  color: var(--primary-color);
}

ul {
  list-style: none;
}

/* Header */
.header {
  background: var(--card-bg);
  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 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--primary-color);
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.1rem;
}

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

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

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

/* Hero Section */
.hero {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 80px 20px;
  text-align: center;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 16px;
}

.hero-desc {
  font-size: 1.1rem;
  opacity: 0.9;
  max-width: 600px;
  margin: 0 auto 32px;
}

.hero-search {
  max-width: 560px;
  margin: 0 auto;
  display: flex;
  gap: 0;
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.hero-search input {
  flex: 1;
  padding: 16px 20px;
  border: none;
  font-size: 1rem;
  outline: none;
}

.hero-search button {
  padding: 16px 28px;
  background: var(--accent-color);
  color: white;
  border: none;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.hero-search button:hover {
  background: #c96a52;
}

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

/* Section Title */
.section-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

/* Quick Links */
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 48px;
}

.quick-link {
  padding: 10px 20px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  font-size: 0.9rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

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

/* Category Grid */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 48px;
}

.category-card {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: all 0.2s;
  border: 1px solid var(--border-color);
}

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

.category-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.category-icon {
  width: 48px;
  height: 48px;
  background: var(--bg-color);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.category-info h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.category-info span {
  font-size: 0.85rem;
  color: var(--text-light);
}

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

.category-list li a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  color: var(--text-secondary);
  font-size: 0.9rem;
  border-bottom: 1px dashed var(--border-color);
}

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

.category-list li a:hover {
  color: var(--primary-color);
}

.category-list .count {
  background: var(--bg-color);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Stats Bar */
.stats-bar {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 20px 32px;
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-bottom: 48px;
  box-shadow: var(--shadow);
  flex-wrap: wrap;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--primary-color);
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-light);
}

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

.article-section {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
}

.article-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--bg-color);
}

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

.article-list li a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
}

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

.article-list li a:hover {
  color: var(--primary-color);
}

/* Breadcrumb */
.breadcrumb {
  background: var(--card-bg);
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}

.breadcrumb-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-light);
}

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

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

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

/* Page Header */
.page-header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: white;
  padding: 48px 20px;
  text-align: center;
}

.page-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-header p {
  opacity: 0.9;
}

/* Tree Structure */
.tree-container {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 32px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.tree-node {
  margin-bottom: 8px;
}

.tree-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s;
}

.tree-header:hover {
  background: #e9ecef;
}

.tree-toggle {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  font-size: 0.8rem;
}

.tree-title {
  flex: 1;
  font-weight: 600;
  color: var(--text-primary);
}

.tree-count {
  font-size: 0.85rem;
  color: var(--text-light);
}

.tree-children {
  margin-left: 28px;
  margin-top: 8px;
  padding-left: 16px;
  border-left: 2px solid var(--border-color);
}

.tree-child {
  padding: 8px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tree-child a {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.tree-child a:hover {
  color: var(--primary-color);
}

/* Page List */
.page-list {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.page-list h2 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.page-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.page-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--bg-color);
  border-radius: var(--radius);
  transition: background 0.2s;
}

.page-item:hover {
  background: #e9ecef;
}

.page-item-icon {
  width: 32px;
  height: 32px;
  background: white;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

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

.page-item-title {
  font-size: 0.9rem;
  color: var(--text-primary);
  font-weight: 500;
}

.page-item-url {
  font-size: 0.75rem;
  color: var(--text-light);
}

.page-item-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

/* Article Detail */
.article-detail {
  background: var(--card-bg);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 32px;
  box-shadow: var(--shadow);
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.85rem;
  color: var(--text-light);
}

.article-meta span {
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text-primary);
}

.article-content h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin: 32px 0 16px;
  color: var(--primary-color);
}

.article-content h3 {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--text-primary);
}

.article-content p {
  margin-bottom: 16px;
}

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

.article-content li {
  margin-bottom: 8px;
}

.article-content ul li {
  list-style-type: disc;
}

.article-content ol li {
  list-style-type: decimal;
}

.article-content strong {
  color: var(--primary-color);
}

/* Info Panel */
.info-panel {
  background: var(--bg-color);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
}

.info-panel h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.info-panel ul {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.info-panel li {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Related Links */
.related-links {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--border-color);
}

.related-links h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.related-links ul {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.related-links li a {
  padding: 8px 16px;
  background: var(--bg-color);
  border-radius: 20px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  transition: all 0.2s;
}

.related-links li a:hover {
  background: var(--secondary-color);
  color: white;
}

/* 404 Page */
.error-page {
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 60px 20px;
}

.error-code {
  font-size: 8rem;
  font-weight: 700;
  color: var(--primary-color);
  line-height: 1;
  margin-bottom: 16px;
  opacity: 0.8;
}

.error-title {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 12px;
}

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

.error-actions {
  display: flex;
  gap: 16px;
}

.btn {
  padding: 12px 28px;
  border-radius: var(--radius);
  font-weight: 600;
  font-size: 0.95rem;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
}

.btn-primary {
  background: var(--primary-color);
  color: white;
}

.btn-primary:hover {
  background: var(--secondary-color);
  color: white;
}

.btn-secondary {
  background: var(--bg-color);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: var(--border-color);
  color: var(--text-primary);
}

/* Footer */
.footer {
  background: var(--text-primary);
  color: white;
  padding: 48px 20px 24px;
  margin-top: 48px;
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}

.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

.footer-brand {
  max-width: 300px;
}

.footer-brand .logo {
  color: white;
  margin-bottom: 16px;
}

.footer-brand p {
  font-size: 0.9rem;
  opacity: 0.7;
  line-height: 1.6;
}

.footer-column h4 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

.footer-column ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.footer-column a:hover {
  color: white;
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid rgba(255,255,255,0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.85rem;
  opacity: 0.6;
}

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

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

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

  .hero {
    padding: 60px 20px;
  }

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

  .hero-search {
    flex-direction: column;
    border-radius: var(--radius);
  }

  .hero-search button {
    width: 100%;
  }

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

  .stats-bar {
    gap: 24px;
  }

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

  .page-items {
    grid-template-columns: 1fr;
  }

  .article-detail {
    padding: 24px;
  }

  .footer-top {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .error-code {
    font-size: 5rem;
  }
}

@media (max-width: 480px) {
  .quick-links {
    gap: 8px;
  }

  .quick-link {
    padding: 8px 14px;
    font-size: 0.85rem;
  }

  .tree-container {
    padding: 20px;
  }

  .tree-children {
    margin-left: 16px;
    padding-left: 12px;
  }
}
