/* =============================================
   天幕 TianMu - 天文理论页面样式
   ============================================= */

/* ===== 知识体系树 ===== */
.knowledge-tree {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.knowledge-branch {
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.knowledge-branch-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-lg);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.knowledge-branch-header:hover {
  background: rgba(79, 195, 247, 0.03);
}

.knowledge-branch-icon {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(79, 195, 247, 0.1);
  border-radius: var(--radius-md);
  color: var(--color-primary);
  flex-shrink: 0;
}

.knowledge-branch-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  flex: 1;
}

.knowledge-branch-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg-dark);
  border-radius: 100px;
}

.knowledge-branch-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: transform var(--transition-normal);
}

.knowledge-branch.expanded .knowledge-branch-toggle {
  transform: rotate(180deg);
}

.knowledge-branch-content {
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-slow);
}

.knowledge-branch.expanded .knowledge-branch-content {
  max-height: 2000px;
}

.knowledge-leaf-list {
  padding: 0 var(--space-lg) var(--space-lg);
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-sm);
}

.knowledge-leaf {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.9rem;
  transition: all var(--transition-fast);
}

.knowledge-leaf:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(79, 195, 247, 0.05);
}

.knowledge-leaf-dot {
  width: 6px;
  height: 6px;
  background: var(--color-primary);
  border-radius: 50%;
  flex-shrink: 0;
}

/* ===== 公式展示 ===== */
.formula-box {
  background: var(--color-bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin: var(--space-lg) 0;
  text-align: center;
  overflow-x: auto;
}

.formula-text {
  font-family: var(--font-mono);
  font-size: 1.1rem;
  color: var(--color-nebula-cyan);
  white-space: nowrap;
}

.formula-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: var(--space-sm);
}

/* ===== 概念卡片 ===== */
.concept-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.concept-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  transition: all var(--transition-normal);
}

.concept-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.concept-number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  opacity: 0.3;
  line-height: 1;
  margin-bottom: var(--space-sm);
}

.concept-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.concept-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ===== 人物卡片 ===== */
.scientist-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-lg);
}

.scientist-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all var(--transition-normal);
  text-align: center;
}

.scientist-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}

.scientist-avatar {
  width: 80px;
  height: 80px;
  margin: var(--space-xl) auto var(--space-md);
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  color: white;
}

.scientist-name {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 2px;
}

.scientist-era {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: var(--space-sm);
}

.scientist-contribution {
  color: var(--text-secondary);
  font-size: 0.85rem;
  line-height: 1.6;
  padding: 0 var(--space-lg) var(--space-xl);
}

/* ===== 时间轴（历史） ===== */
.history-timeline {
  position: relative;
  padding-left: 60px;
}

.history-timeline::before {
  content: '';
  position: absolute;
  left: 19px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, var(--color-primary), var(--color-accent), var(--color-nebula-amber));
}

.history-item {
  position: relative;
  padding-bottom: var(--space-2xl);
}

.history-item:last-child {
  padding-bottom: 0;
}

.history-year {
  position: absolute;
  left: -60px;
  top: 0;
  width: 50px;
  text-align: right;
  font-family: var(--font-display);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-primary);
}

.history-dot {
  position: absolute;
  left: -46px;
  top: 4px;
  width: 14px;
  height: 14px;
  background: var(--color-bg-deep);
  border: 2px solid var(--color-primary);
  border-radius: 50%;
}

.history-content {
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.history-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--space-sm);
}

.history-desc {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .concept-grid { grid-template-columns: repeat(2, 1fr); }
  .scientist-grid { grid-template-columns: repeat(2, 1fr); }
  .knowledge-leaf-list { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .concept-grid { grid-template-columns: 1fr; }
  .scientist-grid { grid-template-columns: 1fr; }
  .history-timeline { padding-left: 50px; }
  .history-year { left: -50px; width: 40px; font-size: 0.8rem; }
  .history-dot { left: -38px; }
}


/* =============================================
   天幕 TianMu - 天文术语区域样式
   ============================================= */

/* ===== 术语区域整体 ===== */
.terms-section {
  padding: var(--space-3xl) 0;
}

/* ===== 术语搜索栏 ===== */
.terms-search-bar {
  display: flex;
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
  flex-wrap: wrap;
  align-items: center;
}

.terms-search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 260px;
  max-width: 480px;
}

.terms-search-input-wrap svg {
  position: absolute;
  left: var(--space-md);
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.terms-search-input {
  width: 100%;
  padding: var(--space-sm) var(--space-md) var(--space-sm) 44px;
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 0.95rem;
  transition: all var(--transition-fast);
}

.terms-search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 195, 247, 0.1);
}

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

.terms-search-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== A~Z 字母导航 ===== */
.terms-alpha-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

.terms-alpha-btn {
  min-width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--space-sm);
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-fast);
  font-family: var(--font-mono);
}

.terms-alpha-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: rgba(79, 195, 247, 0.05);
}

.terms-alpha-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

.terms-alpha-btn.disabled {
  opacity: 0.3;
  cursor: not-allowed;
  pointer-events: none;
}

/* ===== 类型筛选标签 ===== */
.terms-type-filter {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-lg);
  border-bottom: 1px solid var(--border-subtle);
}

.terms-type-btn {
  padding: var(--space-xs) var(--space-md);
  background: var(--color-bg-dark);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  color: var(--text-secondary);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.terms-type-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.terms-type-btn.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: var(--text-inverse);
}

.terms-type-btn .type-count {
  margin-left: 4px;
  font-size: 0.75rem;
  opacity: 0.7;
}

/* ===== 术语卡片网格 ===== */
.terms-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-auto-rows: 1fr;
  gap: var(--space-lg);
  align-items: stretch;
}

/* ===== 术语卡片 ===== */
.term-card {
  background: var(--color-bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: all var(--transition-normal);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.term-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  opacity: 0;
  transition: opacity var(--transition-fast);
}

.term-card:hover {
  border-color: var(--border-medium);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

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

.term-card.hidden {
  display: none;
}

/* 术语头部 */
.term-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-sm);
  flex-shrink: 0;
}

.term-zh {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.3;
}

.term-en {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--color-primary);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

.term-type-badge {
  padding: 2px var(--space-sm);
  background: rgba(79, 195, 247, 0.1);
  border: 1px solid rgba(79, 195, 247, 0.2);
  border-radius: 100px;
  color: var(--color-primary);
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}

/* 术语概念 */
.term-concept {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-top: var(--space-sm);
  flex: 1;
}

/* 术语字母分组标题 */
.terms-group-title {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin: var(--space-xl) 0 var(--space-lg);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--border-subtle);
  grid-column: 1 / -1;
}

.terms-group-title:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: none;
  grid-column: 1 / -1;
}

.terms-group-letter {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: var(--radius-md);
  color: white;
  font-family: var(--font-mono);
  font-size: 1.2rem;
  font-weight: 700;
  flex-shrink: 0;
}

.terms-group-label {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.terms-group-count {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: auto;
}


    /* ===== 术语分页样式 ===== */
    .terms-pagination {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: var(--space-xs);
      margin-top: var(--space-xl);
      padding-top: var(--space-lg);
      border-top: 1px solid var(--border-subtle);
      flex-wrap: wrap;
    }

    .terms-page-btn {
      display: inline-flex;
      align-items: center;
      gap: var(--space-xs);
      padding: 8px 14px;
      border: 1px solid var(--border-subtle);
      border-radius: var(--radius-sm);
      background: var(--color-bg-card);
      color: var(--text-primary);
      font-size: 0.875rem;
      font-family: var(--font-body);
      cursor: pointer;
      transition: all 0.2s ease;
      min-width: 36px;
      justify-content: center;
    }

    .terms-page-btn:hover:not(:disabled) {
      border-color: var(--color-primary);
      color: var(--color-primary);
      background: rgba(79, 195, 247, 0.08);
    }

    .terms-page-btn.active {
      background: var(--color-primary);
      border-color: var(--color-primary);
      color: var(--text-inverse);
      font-weight: 600;
    }

    .terms-page-btn:disabled {
      opacity: 0.4;
      cursor: not-allowed;
    }

    .terms-page-ellipsis {
      color: var(--text-tertiary);
      padding: 0 4px;
      font-size: 0.875rem;
      user-select: none;
    }

    .terms-page-info {
      margin-left: var(--space-md);
      color: var(--text-secondary);
      font-size: 0.875rem;
      white-space: nowrap;
    }

    .terms-page-prev svg,
    .terms-page-next svg {
      flex-shrink: 0;
    }

    /* 加载状态 */
    .terms-loading {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: var(--space-3xl) 0;
      color: var(--text-secondary);
    }

    .terms-loading-spinner {
      width: 40px;
      height: 40px;
      border: 3px solid var(--border-subtle);
      border-top-color: var(--color-primary);
      border-radius: 50%;
      animation: terms-spin 0.8s linear infinite;
      margin-bottom: var(--space-md);
    }

    @keyframes terms-spin {
      to { transform: rotate(360deg); }
    }

    /* 响应式分页 */
    @media (max-width: 640px) {
      .terms-pagination {
        gap: 4px;
      }
      .terms-page-btn {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 32px;
      }
      .terms-page-info {
        width: 100%;
        text-align: center;
        margin-left: 0;
        margin-top: var(--space-sm);
      }
      .terms-page-prev,
      .terms-page-next {
        padding: 6px 8px;
      }
      .terms-page-prev span,
      .terms-page-next span {
        display: none;
      }
    }
    
/* 无结果提示 */
.terms-empty {
  text-align: center;
  padding: var(--space-3xl) var(--space-xl);
  color: var(--text-muted);
}

.terms-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.terms-empty p {
  font-size: 1rem;
  margin-bottom: var(--space-sm);
}

.terms-empty .terms-empty-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .terms-grid {
    grid-template-columns: 1fr;
  }

  .terms-alpha-nav {
    gap: 3px;
  }

  .terms-alpha-btn {
    min-width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }
}

@media (max-width: 768px) {
  .terms-search-bar {
    flex-direction: column;
    align-items: stretch;
  }

  .terms-search-input-wrap {
    max-width: none;
  }

  .term-header {
    flex-direction: column;
    gap: var(--space-sm);
  }

  .term-type-badge {
    align-self: flex-start;
  }
}
