/* ==========================================
   研究页面样式 — 酉阳杂俎学术子页面
   ========================================== */

/* Page Header */
.page-header {
  padding: 180px 0 80px;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--border);
}

.page-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url('../images/ink011222.jpg') center center / cover no-repeat;
  opacity: 0.35;
  mix-blend-mode: multiply;
  pointer-events: none;
  z-index: 0;
}

.page-header .container {
  position: relative;
  z-index: 1;
}

.page-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.72rem;
  color: var(--accent);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  margin-bottom: 20px;
}

.page-title {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 900;
  margin-bottom: 24px;
  letter-spacing: 0.08em;
}

.page-desc {
  font-family: 'Noto Sans SC', sans-serif;
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 640px;
  margin: 0 auto;
  font-weight: 300;
  line-height: 1.8;
}

/* Research Content Layout */
.research-content .container {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 60px;
  padding-top: 60px;
  padding-bottom: 100px;
}

/* TOC Sidebar */
.toc-sidebar {
  position: relative;
}

.toc-sticky {
  position: sticky;
  top: 120px;
}

.toc-sidebar h3 {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.15em;
  margin-bottom: 24px;
  font-weight: 500;
  font-family: 'Noto Sans SC', sans-serif;
}

.toc-sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0 0 40px;
}

.toc-sidebar li {
  margin-bottom: 6px;
}

.toc-sidebar a {
  display: block;
  padding: 8px 12px;
  color: var(--text-dim);
  text-decoration: none;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.85rem;
  border-radius: 2px;
  transition: all var(--transition-fast);
  border-left: 2px solid transparent;
}

.toc-sidebar a:hover {
  color: var(--text);
  background: rgba(184,168,152,0.04);
  border-left-color: var(--accent);
}

/* Ref Stats */
.ref-stats {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

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

.ref-num {
  display: block;
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 8px;
}

.ref-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* Research Body */
.research-body section {
  margin-bottom: 80px;
  scroll-margin-top: 100px;
}

.research-body h2 {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
}

.research-body h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 36px 0 18px;
  color: var(--text);
}

.research-body p {
  color: var(--text-muted);
  font-size: 0.98rem;
  line-height: 2;
  margin-bottom: 18px;
}

.research-body ul,
.research-body ol {
  margin-bottom: 20px;
  padding-left: 24px;
  color: var(--text-muted);
  line-height: 2;
}

.research-body li {
  margin-bottom: 8px;
}

.research-body strong {
  color: var(--text);
  font-weight: 600;
}

/* Data Tables */
.data-table-wrap {
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.88rem;
}

.data-table thead {
  background: var(--bg-elevated);
}

.data-table th {
  padding: 14px 18px;
  text-align: left;
  color: var(--text);
  font-weight: 500;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table td {
  padding: 12px 18px;
  color: var(--text-muted);
  border-bottom: 1px solid rgba(92,78,64,0.3);
  line-height: 1.6;
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background: rgba(184,168,152,0.02);
}

.data-table.compact td,
.data-table.compact th {
  padding: 10px 14px;
  text-align: center;
}

.data-table.compact td:first-child,
.data-table.compact th:first-child {
  text-align: left;
}

/* Tag Dot */
.tag-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
  vertical-align: middle;
}

/* Reference List */
.ref-list {
  list-style: none;
  padding: 0;
}

.ref-list li {
  padding: 14px 18px;
  border-bottom: 1px solid rgba(92,78,64,0.2);
  font-size: 0.92rem;
  color: var(--text-muted);
  transition: background var(--transition-fast);
}

.ref-list li:hover {
  background: rgba(184,168,152,0.03);
}

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

/* Stats Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin: 36px 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 28px 20px;
  text-align: center;
  transition: all var(--transition-fast);
}

.stat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(184,168,152,0.1);
}

.stat-number {
  display: block;
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 10px;
}

.stat-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  letter-spacing: 0.05em;
}

/* Charts */
.chart-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  margin: 28px 0;
}

.bar-chart {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.bar-chart.horizontal {
  flex-direction: column;
}

.bar-item {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bar-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.85rem;
  color: var(--text-muted);
  min-width: 100px;
  text-align: right;
  white-space: nowrap;
}

.bar-track {
  flex: 1;
  height: 28px;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--accent);
  opacity: 0.7;
  transition: width 1s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  position: relative;
}

.bar-fill::after {
  content: '';
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--accent-hover);
}

.bar-value {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.8rem;
  color: var(--text-dim);
  min-width: 40px;
}

/* Heatmap */
.heatmap-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  padding: 32px;
  margin: 28px 0;
  overflow-x: auto;
}

.heatmap {
  display: grid;
  gap: 4px;
}

.heatmap-row {
  display: grid;
  grid-template-columns: 140px repeat(5, 1fr);
  gap: 4px;
  align-items: center;
}

.heatmap-label {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: right;
  padding-right: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.heatmap-header {
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.75rem;
  color: var(--text-dim);
  text-align: center;
  padding: 8px 0;
}

.heatmap-cell {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Noto Sans SC', sans-serif;
  font-size: 0.8rem;
  color: var(--text);
  border-radius: 2px;
  transition: transform var(--transition-fast);
}

.heatmap-cell:hover {
  transform: scale(1.1);
  z-index: 2;
  box-shadow: var(--shadow-sm);
}

/* Responsive */
@media (max-width: 900px) {
  .research-content .container {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .toc-sidebar {
    display: none;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-header {
    padding: 140px 0 60px;
  }
}

@media (max-width: 640px) {
  .stats-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  .stat-card {
    padding: 20px 14px;
  }
  .stat-number {
    font-size: 1.8rem;
  }
  .chart-wrap {
    padding: 20px;
  }
  .bar-label {
    min-width: 60px;
    font-size: 0.75rem;
  }
}

/* Nav active state */
.nav-link.active {
  color: var(--text);
}
.nav-link.active::after {
  width: 100%;
  left: 0;
}
