/* ============================================
   FACENANO · 知识库样式表
   ============================================ */

/* ── Library Hero ── */
.lib-hero {
  position: relative;
  height: 80vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: var(--bg-primary);
}

.lib-hero-canvas {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.lib-hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-primary) 70%);
  z-index: 2;
}

.lib-hero-content {
  position: relative;
  z-index: 3;
  text-align: center;
  max-width: 800px;
  padding: 0 24px;
}

.lib-hero-content .hero-badge {
  margin-bottom: 32px;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

.lib-hero-content .hero-title {
  font-size: clamp(3rem, 8vw, 5.5rem);
  font-weight: 900;
  letter-spacing: 0.08em;
  margin-bottom: 16px;
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

.lib-hero-content .hero-subtitle {
  font-family: var(--font-body);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  color: var(--text-secondary);
  letter-spacing: 0.3em;
  margin-bottom: 24px;
  animation: fadeInUp 0.8s ease-out 0.6s both;
}

.lib-hero-content .hero-desc {
  font-size: 1.125rem;
  color: var(--text-muted);
  line-height: 1.8;
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease-out 0.8s both;
}

.lib-hero .hero-scroll {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  animation: fadeInUp 0.8s ease-out 1.2s both;
}

/* ── Search Section ── */
.search-section {
  background: var(--bg-secondary);
}

.search-box {
  max-width: 800px;
  margin: 0 auto;
}

.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 0 20px;
  transition: all var(--transition-fast);
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 20px rgba(0, 240, 255, 0.1);
}

.search-input-wrapper svg {
  color: var(--text-muted);
  flex-shrink: 0;
}

.search-input-wrapper input {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  padding: 18px 16px;
  outline: none;
}

.search-input-wrapper input::placeholder {
  color: var(--text-muted);
}

.search-shortcut {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  background: var(--bg-tertiary);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.search-filters {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
  flex-wrap: wrap;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 100px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-display);
  font-size: 0.875rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.filter-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.filter-btn.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.search-results {
  margin-top: 24px;
  display: none;
}

.search-results.active {
  display: block;
}

.search-result-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
  transition: all var(--transition-fast);
}

.search-result-item:hover {
  border-color: var(--border-glow);
  transform: translateX(4px);
}

.result-type {
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 10px;
  border-radius: 100px;
  flex-shrink: 0;
  margin-top: 2px;
}

.result-type.term { background: rgba(0, 240, 255, 0.1); color: var(--accent-cyan); }
.result-type.species { background: rgba(0, 255, 136, 0.1); color: var(--accent-green); }
.result-type.concept { background: rgba(184, 41, 221, 0.1); color: var(--accent-purple); }
.result-type.literature { background: rgba(255, 170, 0, 0.1); color: var(--accent-amber); }

.result-content h4 {
  font-size: 1rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.result-content p {
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ── Encyclopedia Section ── */
.encyclopedia-section {
  background: var(--bg-primary);
}

.encyclo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.encyclo-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 36px 28px;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}

.encyclo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-green));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.encyclo-card:hover {
  transform: translateY(-6px);
  border-color: var(--border-glow);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
}

.encyclo-card:hover::before {
  opacity: 1;
}

.encyclo-icon {
  width: 80px;
  height: 80px;
  margin-bottom: 20px;
}

.encyclo-icon canvas {
  width: 100%;
  height: 100%;
}

.encyclo-card h3 {
  font-size: 1.375rem;
  margin-bottom: 4px;
}

.encyclo-latin {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  font-style: italic;
  margin-bottom: 12px;
}

.encyclo-desc {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.7;
  margin-bottom: 20px;
}

.encyclo-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.encyclo-size {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ── Terms Section ── */
.terms-section {
  background: var(--bg-secondary);
}

.terms-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 32px;
  flex-wrap: wrap;
  gap: 16px;
}

.terms-letters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.letter-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.letter-btn:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.letter-btn.active {
  background: rgba(0, 240, 255, 0.1);
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.letter-btn.empty {
  opacity: 0.3;
  cursor: default;
  pointer-events: none;
}

.terms-count {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  color: var(--text-muted);
}

.terms-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.term-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 24px;
  transition: all var(--transition-fast);
}

.term-item:hover {
  border-color: var(--border-glow);
  transform: translateX(4px);
}

.term-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
  gap: 12px;
}

.term-header h4 {
  font-size: 1.0625rem;
  color: var(--text-primary);
}

.term-en {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  font-style: italic;
  flex-shrink: 0;
}

.term-def {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
}

.term-category {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  padding: 3px 10px;
  background: var(--bg-secondary);
  border-radius: 100px;
}

/* ── Research Section ── */
.research-section {
  background: var(--bg-primary);
}

.research-timeline {
  position: relative;
  max-width: 900px;
  margin: 0 auto;
}

.timeline-line {
  position: absolute;
  left: 24px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent-cyan), var(--accent-green));
  opacity: 0.3;
}

.research-item {
  position: relative;
  padding-left: 64px;
  margin-bottom: 48px;
}

.research-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 16px;
  top: 8px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 3px solid var(--accent-cyan);
  box-shadow: 0 0 12px rgba(0, 240, 255, 0.3);
}

.research-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  transition: all var(--transition-fast);
}

.research-card:hover {
  border-color: var(--border-glow);
  transform: translateX(6px);
}

.research-date {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  color: var(--accent-cyan);
  background: rgba(0, 240, 255, 0.08);
  padding: 6px 14px;
  border-radius: 100px;
  margin-bottom: 16px;
  border: 1px solid rgba(0, 240, 255, 0.15);
}

.research-card h3 {
  font-size: 1.25rem;
  margin-bottom: 14px;
  line-height: 1.4;
}

.research-card > p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.8;
  margin-bottom: 20px;
}

.research-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.research-link {
  font-size: 0.9375rem;
  font-family: var(--font-display);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.research-link:hover {
  gap: 8px;
}

/* ── Reading Section ── */
.reading-section {
  background: var(--bg-secondary);
}

.reading-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
}

.reading-card {
  display: flex;
  gap: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-fast);
}

.reading-card:hover {
  border-color: var(--border-glow);
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.reading-cover {
  width: 120px;
  height: 165px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.reading-cover canvas {
  width: 100%;
  height: 100%;
}

.reading-info {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.reading-info h3 {
  font-size: 1.125rem;
  margin-bottom: 4px;
}

.reading-author {
  font-size: 0.875rem;
  color: var(--accent-cyan);
  margin-bottom: 12px;
  font-style: italic;
}

.reading-desc {
  color: var(--text-secondary);
  font-size: 0.875rem;
  line-height: 1.7;
  flex: 1;
  margin-bottom: 16px;
}

.reading-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.reading-level {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ── Sources Section ── */
.sources-section {
  background: var(--bg-primary);
  padding: 60px 0 100px;
}

.sources-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 32px;
  max-width: 800px;
  margin: 0 auto;
}

.sources-card h3 {
  font-size: 1.125rem;
  margin-bottom: 12px;
  color: var(--text-primary);
}

.sources-card p {
  color: var(--text-secondary);
  font-size: 0.9375rem;
  line-height: 1.8;
}

/* ── Responsive ── */
@media (max-width: 1024px) {
  .encyclo-grid {
    grid-template-columns: repeat(2, 1fr);
  }

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

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

  .reading-card {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .reading-cover {
    width: 140px;
    height: 192px;
  }

  .reading-meta {
    justify-content: center;
  }
}

@media (max-width: 768px) {
  .lib-hero {
    min-height: 500px;
  }

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

  .research-item {
    padding-left: 48px;
  }

  .timeline-line {
    left: 16px;
  }

  .timeline-dot {
    left: 8px;
    width: 16px;
    height: 16px;
  }

  .terms-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-filters {
    justify-content: flex-start;
  }
}

@media (max-width: 480px) {
  .search-input-wrapper {
    padding: 0 14px;
  }

  .search-input-wrapper input {
    padding: 14px 10px;
    font-size: 1rem;
  }

  .search-shortcut {
    display: none;
  }

  .research-card {
    padding: 24px 20px;
  }
}


/* ── Term Item Enhancements ── */
.term-footer {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 10px;
}

.term-subcat {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--accent-green);
  padding: 3px 10px;
  background: rgba(0, 255, 136, 0.08);
  border: 1px solid rgba(0, 255, 136, 0.15);
  border-radius: 100px;
}

.term-badge {
  font-size: 0.6875rem;
  font-family: var(--font-mono);
  padding: 2px 8px;
  border-radius: 100px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.term-badge.fundamental {
  background: rgba(0, 240, 255, 0.1);
  color: var(--accent-cyan);
  border: 1px solid rgba(0, 240, 255, 0.2);
}

.term-badge.core {
  background: rgba(184, 41, 221, 0.1);
  color: var(--accent-purple);
  border: 1px solid rgba(184, 41, 221, 0.2);
}

.term-badge.emerging {
  background: rgba(255, 170, 0, 0.1);
  color: var(--accent-amber);
  border: 1px solid rgba(255, 170, 0, 0.2);
}

/* ── 数据目录说明 ── */
.data-note {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-top: 20px;
  font-size: 0.875rem;
  color: var(--text-secondary);
}

.data-note code {
  font-family: var(--font-mono);
  background: var(--bg-tertiary);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-cyan);
}
