/* =============================================
   精密印字实验室 (PrecisionTypographyLab)
   视觉定律 — 物理常量
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=EB+Garamond:ital,wght@0,400;0,600;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ----- 全局变量（物理定律） ----- */
:root {
  /* 材质 */
  --paper:         #F4F1EB;
  --ink:           #1A1A18;
  --oil:           #D98A2C;
  --mechanism:     #3E3C38;

  /* 派生色 */
  --paper-warm:    #F0ECE4;
  --paper-noise:   rgba(0,0,0,0.018);
  --ink-faded:     #5A5A56;
  --oil-glow:      rgba(217,138,44,0.12);
  --mechanism-light: #6B6963;
  --mechanism-faint: #C8C5BC;

  /* 排印 */
  --font-body:     'EB Garamond', 'Source Han Serif SC', 'Noto Serif SC', Georgia, serif;
  --font-ui:       'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-code:     'JetBrains Mono', 'Fira Code', 'Cascadia Code', monospace;

  --line-height:   1.7;
  --letter-spacing-body: 0.01em;
  --letter-spacing-ui:   0.02em;

  /* 尺寸 */
  --max-width:     960px;
  --border-w:      1px;
  --card-offset:   3px;

  /* 时序 */
  --ease-print:    cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ----- 噪点纹理（纸基） ----- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    repeating-conic-gradient(var(--paper-noise) 0% 25%, transparent 0% 50%)
      0 0 / 2px 2px;
  pointer-events: none;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: var(--line-height);
  letter-spacing: var(--letter-spacing-body);
  margin: 0;
  padding: 2rem 1rem;
  min-height: 100vh;
}

/* ----- 通用排版 ----- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: 600;
  letter-spacing: var(--letter-spacing-ui);
  color: var(--ink);
  margin: 0 0 0.75rem;
  line-height: 1.35;
}

h1 { font-size: 2.2rem; border-bottom: var(--border-w) solid var(--oil); padding-bottom: 0.4rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }

p  { margin: 0 0 1rem; }
a  { color: var(--ink); text-decoration: underline; text-decoration-color: var(--oil); text-underline-offset: 3px; transition: color 0.2s var(--ease-print); }
a:hover { color: var(--oil); }

/* ----- 工具/代码 ----- */
code, pre, .mono {
  font-family: var(--font-code);
  font-size: 0.875em;
}

code {
  background: var(--mechanism-faint);
  padding: 0.15em 0.4em;
  border-radius: 2px;
}

pre {
  background: var(--mechanism);
  color: var(--paper);
  padding: 1rem;
  overflow-x: auto;
  border-left: 3px solid var(--oil);
}

/* ----- 卡片系统（活版印刷感） ----- */
.card {
  background: var(--paper);
  border: var(--border-w) solid var(--mechanism-faint);
  padding: 1.75rem;
  margin-bottom: 1.5rem;
  position: relative;
  transition: transform 0.25s var(--ease-print), box-shadow 0.25s var(--ease-print);
}

/* 微偏移：活版压印感 */
.card::after {
  content: '';
  position: absolute;
  inset: 0;
  border: var(--border-w) solid transparent;
  transition: all 0.25s var(--ease-print);
  pointer-events: none;
}

.card:hover {
  transform: translate(-2px, -2px);
  box-shadow: var(--card-offset) var(--card-offset) 0 0 var(--mechanism-faint);
}

.card h2 {
  color: var(--ink);
  border-bottom: var(--border-w) solid var(--oil);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
  font-size: 1.3rem;
}

/* ----- 按钮（机械件） ----- */
.btn {
  display: inline-block;
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: var(--letter-spacing-ui);
  text-transform: uppercase;
  text-decoration: none;
  color: var(--paper);
  background: var(--mechanism);
  padding: 0.55rem 1.2rem;
  border: none;
  cursor: pointer;
  transition: background 0.2s var(--ease-print);
}

.btn:hover {
  background: var(--oil);
  color: var(--paper);
  text-decoration: none;
}

/* ----- 英雄区（报馆刊头） ----- */
.hero {
  text-align: center;
  padding: 3rem 1rem 2rem;
  margin-bottom: 2.5rem;
  border-bottom: 2px solid var(--oil);
  position: relative;
}

.hero::before {
  content: '✦';
  display: block;
  font-size: 0.8rem;
  color: var(--oil);
  margin-bottom: 0.5rem;
  opacity: 0.6;
}

.hero-title {
  font-family: var(--font-ui);
  font-weight: 600;
  font-size: 2.4rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink);
  margin-bottom: 0.75rem;
}

.hero-subtitle {
  font-family: var(--font-body);
  font-style: italic;
  color: var(--ink-faded);
  font-size: 1.05rem;
}

.hero-avatar {
  width: 120px;
  height: 120px;
  border-radius: 0;
  object-fit: cover;
  margin-bottom: 1rem;
  border: var(--border-w) solid var(--mechanism-faint);
  filter: grayscale(0.3);
  transition: filter 0.3s var(--ease-print);
}

.hero-avatar:hover {
  filter: grayscale(0);
}

.hero-links {
  display: flex;
  gap: 1.2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.social-button {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-ui);
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: var(--letter-spacing-ui);
  text-decoration: none;
  text-transform: uppercase;
  color: var(--ink);
  border: var(--border-w) solid var(--mechanism-faint);
  padding: 0.4rem 1rem;
  transition: all 0.2s var(--ease-print);
}

.social-button:hover {
  border-color: var(--oil);
  color: var(--oil);
  text-decoration: none;
}

/* ----- 列表（排版活字） ----- */
.profile-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.profile-list > li {
  padding: 0.6rem 0;
  border-bottom: var(--border-w) solid var(--mechanism-faint);
}

.profile-list > li:last-child {
  border-bottom: none;
}

/* ----- 资源列表 ----- */
.resource-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
}

.resource-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: var(--border-w) solid var(--mechanism-faint);
  transition: border-color 0.2s var(--ease-print);
}

.resource-item:hover {
  border-color: var(--oil);
}

.resource-item i {
  color: var(--oil);
  font-size: 1.6rem;
  margin-top: 0.2rem;
  flex-shrink: 0;
}

.resource-info {
  flex-grow: 1;
}

.resource-info h3 {
  font-family: var(--font-ui);
  font-size: 1rem;
  margin-bottom: 0.3rem;
}

.resource-info p {
  font-size: 0.9rem;
  color: var(--ink-faded);
  margin-bottom: 0.6rem;
}

/* ----- 表格 ----- */
table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-ui);
  font-size: 0.9rem;
}

th, td {
  border: var(--border-w) solid var(--mechanism-faint);
  padding: 0.5rem 0.75rem;
  text-align: left;
}

th {
  font-weight: 600;
  background: var(--mechanism);
  color: var(--paper);
}

tr:hover td {
  background: var(--oil-glow);
}

/* ----- 小本本（摘录框） ----- */
.notebook {
  background: var(--paper-warm);
  border-left: 3px solid var(--oil);
  padding: 1.2rem;
  margin: 1rem 0;
  font-family: var(--font-code);
  font-size: 0.85rem;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ----- 洗照片效果（档案册） ----- */
.photo-card {
  background: var(--paper);
  border: var(--border-w) solid var(--mechanism);
  padding: 0.6rem 0.6rem 0.4rem;
  display: inline-block;
  max-width: 100%;
  margin: 0.5rem 0;
  transition: box-shadow 0.3s var(--ease-print);
}

.photo-card img {
  display: block;
  max-width: 100%;
  height: auto;
  max-height: 280px;
  object-fit: cover;
  border: none;
  filter: grayscale(35%) sepia(15%);
  transition: filter 0.4s var(--ease-print);
}

.photo-card:hover img {
  filter: grayscale(0%) sepia(0%);
}

.photo-card:hover {
  box-shadow: 2px 2px 0 0 var(--mechanism);
}

/* 档案图注 */
.photo-caption {
  font-family: var(--font-ui);
  font-size: 0.72rem;
  font-style: normal;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ink-faded);
  padding-top: 0.3rem;
  margin-top: 0.3rem;
  border-top: var(--border-w) solid var(--oil);
  text-align: center;
}

/* collab 网格（均匀报纸排版） */
.collab-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.2rem;
  margin: 1.5rem 0;
}

.collab-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.collab-grid-item .photo-card {
  width: 100%;
  margin: 0;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0.6rem;
}
.collab-grid-item .photo-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  max-height: none;
  flex-shrink: 0;
}

/* 保留原 .collab 兼容其他 */
.collab {
  margin: 1.5rem 0;
}

.collab h4 {
  font-family: var(--font-ui);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin: 0 0 0.6rem 0;
  color: var(--mechanism-light);
  border-bottom: var(--border-w) solid var(--mechanism-faint);
  padding-bottom: 0.3rem;
  text-align: left;
}

/* 图片基础（无容器时） */
img {
  max-width: 100%;
  height: auto;
  border: var(--border-w) solid var(--mechanism-faint);
}

/* ----- 小本本时间轴（收拢版） ----- */
.notebook {
  background: var(--paper-warm);
  border-left: none;
  padding: 0.8rem 0.8rem 0.8rem 1.8rem;
  margin: 1rem 0;
  font-family: var(--font-code);
  font-size: 0.82rem;
  line-height: 1.7;
  white-space: pre-wrap;
  position: relative;
}

/* 时间轴竖线 */
.notebook::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.8rem;
  bottom: 0.8rem;
  width: 2px;
  background: var(--oil);
  opacity: 0.4;
}

/* 每行时间节点圆点 */
.notebook br {
  display: block;
  content: '';
  margin: 0;
  position: relative;
}

.notebook br::before {
  content: '';
  position: absolute;
  left: -1.3rem;
  top: 0.45rem;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--oil);
  opacity: 0.6;
  transform: translateY(-50%);
}

/* 每行文字向左靠拢 */
.notebook {
  word-spacing: -0.05em;
}

/* ----- 响应式 ----- */
@media (max-width: 768px) {
  body {
    padding: 1rem 0.75rem;
  }
  h1 { font-size: 1.7rem; }
  .hero-title { font-size: 1.6rem; }
  .card { padding: 1.2rem; }
  .hero { padding: 2rem 0.5rem 1.5rem; }
  .collab-grid {
    grid-template-columns: 1fr;
  }
}

/* ----- 辅助：选择高亮（Oil 色） ----- */
::selection {
  background: var(--oil);
  color: var(--paper);
}

/* ----- 网格 ----- */
.card-grid {
  display: grid;
  gap: 1.5rem;
  max-width: var(--max-width);
  margin: 0 auto;
}

.page-content {
  max-width: var(--max-width);
  margin: 0 auto;
}