/* 仿生智慧飞行实验室 · 全站样式
   唯一真源：纯静态站，无构建步骤。修改后直接推 main 生效。 */

:root {
  --navy: #1a1a2e;        /* 顶栏 / 标题 / 强调线 */
  --ink: #333;            /* 正文 */
  --muted: #666;          /* 次要文字 */
  --faint: #888;          /* 日期、英文小字 */
  --line: #eee;           /* 分隔线 */
  --bg-soft: #f8f9fa;     /* 卡片 / 页脚底色 */
  --link: #1d4e89;        /* 正文内链接 */
  --measure: 46rem;       /* 正文行长上限（中文约 46 字/行） */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  color: var(--ink);
  background: #fff;
}

main {
  min-height: 60vh; /* 短页面时避免页脚上跳 */
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Top bar */
.topbar {
  background: var(--navy);
  color: #fff;
  padding: 1rem 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.topbar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
}

.topbar nav {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.topbar nav a {
  color: #ccc;
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}

.topbar nav a:hover {
  color: #fff;
}

/* Hero（仅首页） */
.hero {
  padding: 3rem 0 2rem;
  border-bottom: 1px solid var(--line);
}

.hero h1 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
  color: var(--navy);
}

.subtitle {
  font-size: 1.1rem;
  color: #555;
  margin-bottom: 0.3rem;
}

.subtitle-en {
  font-size: 0.9rem;
  color: var(--faint);
}

/* 子页页标题（取代原先的行内 style） */
.page-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--navy);
  padding: 2rem 0 0.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 2px solid var(--navy);
}

/* Sections（首页） */
.projects-section, .notes-section {
  padding: 2rem 0;
}

.projects-section h2, .notes-section h2 {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--navy);
  color: var(--navy);
}

/* Project cards */
.project-card {
  background: var(--bg-soft);
  border-left: 4px solid var(--navy);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.2rem;
  border-radius: 4px;
}

.project-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.3rem;
  color: var(--navy);
}

.project-card .status {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.project-card p {
  margin-bottom: 0.5rem;
}

.project-card .en {
  font-size: 0.85rem;
  color: #777;
  font-style: italic;
}

/* Note items */
.note-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--line);
}

.note-item .date {
  font-size: 0.85rem;
  color: var(--faint);
  margin-right: 0.8rem;
}

.note-item a {
  color: var(--navy);
  font-weight: 600;
  text-decoration: none;
}

.note-item a:hover {
  text-decoration: underline;
}

.note-item p {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #555;
}

/* 列表页尾部的 "All notes →" 一类链接 */
.more-link {
  margin-top: 1.2rem;
  font-size: 0.9rem;
}

.more-link a {
  color: var(--link);
}

/* News items（News 页：日期 + 照片 + 中文正文 + 英文一句） */
.news-item {
  display: flex;
  align-items: flex-start;
  gap: 1.5rem;
  padding: 1.6rem 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 96px; /* 锦点跳转后不被 sticky 顶栏遮住 */
}

.news-item:last-child {
  border-bottom: 0;
}

.news-photo {
  flex: 0 0 320px;
  display: block;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  background: var(--bg-soft);
  line-height: 0;
}

.news-photo img {
  width: 320px;
  height: 200px;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.news-photo:hover img {
  transform: scale(1.03);
}

.news-body {
  flex: 1 1 auto;
  min-width: 0;
}

.news-date {
  font-size: 0.85rem;
  color: var(--faint);
  margin-bottom: 0.35rem;
  font-variant-numeric: tabular-nums;
}

.news-title {
  font-size: 1.15rem;
  line-height: 1.45;
  color: var(--navy);
  margin-bottom: 0.6rem;
}

.news-body p {
  margin-bottom: 0.6rem;
  line-height: 1.8;
}

.news-body .en {
  font-size: 0.88rem;
  color: #777;
  font-style: italic;
  margin-bottom: 0;
}

/* 条目作者行（经验总结类条目必须署名） */
.news-byline {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0;
}

.news-title a {
  color: var(--navy);
  text-decoration: none;
}

.news-title a:hover {
  color: var(--link);
  text-decoration: underline;
}

/* 文章页署名行 */
.post-meta {
  font-size: 0.9rem;
  color: var(--muted);
  padding-bottom: 1rem;
  margin-bottom: 1.8rem !important;
  border-bottom: 1px solid var(--line);
}

.post-meta .post-author {
  color: var(--navy);
  font-weight: 600;
}

.post-meta a {
  color: var(--link);
}

/* GFM 任务清单（博客原文里的 - [ ] 写法） */
.post-body ul.task-list {
  list-style: none;
  margin-left: 0.2rem;
}

.post-body li.task-list-item {
  padding-left: 0.1rem;
}

.post-body .task-list-item-checkbox {
  margin: 0 0.5rem 0 0;
  vertical-align: -2px;
}

/* Post body（新闻/研究笔记正文排版）
   注意：* 复位把所有块级间距清零，故 .post-body 内每个元素都需显式给间距。 */
.post-main {
  padding: 2rem 0;
}

.post-body {
  max-width: var(--measure);
}

.post-body h1 {
  font-size: 1.75rem;
  line-height: 1.35;
  color: var(--navy);
  margin-bottom: 1.2rem;
}

.post-body h2 {
  font-size: 1.3rem;
  color: var(--navy);
  margin: 2.2rem 0 0.9rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--line);
}

.post-body h3 {
  font-size: 1.05rem;
  color: var(--navy);
  margin: 1.6rem 0 0.6rem;
}

.post-body h4 {
  font-size: 1rem;
  color: var(--navy);
  margin: 1.3rem 0 0.5rem;
}

.post-body p {
  margin: 0 0 1rem;
  line-height: 1.8;
}

.post-body > *:first-child {
  margin-top: 0;
}

.post-body .en {
  font-size: 0.9rem;
  color: var(--faint);
  font-style: italic;
}

.post-body a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.post-body a:hover {
  color: var(--navy);
}

.post-body ul,
.post-body ol {
  margin: 0 0 1rem 1.6rem;
  line-height: 1.8;
}

.post-body li {
  margin-bottom: 0.4rem;
}

.post-body li > ul,
.post-body li > ol {
  margin: 0.4rem 0 0 1.4rem;
}

.post-body hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2rem 0;
}

.post-body blockquote {
  border-left: 3px solid var(--navy);
  background: var(--bg-soft);
  padding: 0.8rem 1.2rem;
  margin: 0 0 1rem;
  color: #4a5568;
}

.post-body blockquote p:last-child {
  margin-bottom: 0;
}

.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
  font-size: 0.88em;
  background: #f1f3f5;
  color: var(--navy);
  padding: 0.1em 0.35em;
  border-radius: 3px;
}

.post-body pre {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1rem 1.2rem;
  margin: 0 0 1rem;
  overflow-x: auto;
  line-height: 1.6;
}

.post-body pre code {
  background: none;
  padding: 0;
  font-size: 0.85rem;
  color: #2d3748;
}

/* 表格：外层 .table-wrap 兜住窄屏横向滚动 */
.table-wrap {
  overflow-x: auto;
  margin: 0 0 1.2rem;
}

.post-body table,
.data-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}

.post-body th,
.post-body td,
.data-table th,
.data-table td {
  border: 1px solid #e2e8f0;
  padding: 0.5rem 0.75rem;
  text-align: left;
  vertical-align: top;
  line-height: 1.6;
}

.post-body th,
.data-table th {
  background: var(--bg-soft);
  color: var(--navy);
  font-weight: 700;
  white-space: nowrap;
}

/* 团队表：姓名列不加粗但保持不折行，两列表单行宽读起来更整齐 */
.data-table td:first-child {
  white-space: nowrap;
}

.post-body img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 0 0 1rem;
}

/* 数学式已改为纯文本 + 上下标，控制行高以免撑开中文正文行 */
.post-body sup,
.post-body sub,
.pub-item sup,
.pub-item sub {
  font-size: 0.72em;
  line-height: 0;
  position: relative;
}

.post-body sup,
.pub-item sup {
  top: -0.45em;
}

.post-body sub,
.pub-item sub {
  top: 0.25em;
}

/* Publications 条目 */
.pub-item {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--line);
}

.pub-item:last-of-type {
  border-bottom: 0;
}

.pub-title {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--navy);
  margin-bottom: 0.3rem;
}

.pub-authors {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.pub-venue {
  font-size: 0.88rem;
  color: #555;
  margin-bottom: 0;
}

.pub-venue a {
  color: var(--link);
}

.pub-note {
  font-size: 0.85rem;
  color: var(--faint);
  margin: 0.8rem 0 0;
}

/* 页面内提示语（Publications / Assets 的说明段） */
.hint {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 1.5rem;
}

.sub-title {
  font-size: 1.1rem;
  color: var(--navy);
  margin: 1.5rem 0 0.8rem;
}

/* Footer */
.footer {
  background: var(--bg-soft);
  padding: 1.5rem 0;
  margin-top: 3rem;
  text-align: center;
  font-size: 0.85rem;
  color: var(--faint);
}

.footer a {
  color: var(--link);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

.footer p + p {
  margin-top: 0.4rem;
}

/* Responsive */
@media (max-width: 600px) {
  .topbar .container {
    flex-direction: column;
    align-items: flex-start;
  }
  .topbar nav {
    gap: 0.8rem;
  }
  .hero h1 {
    font-size: 1.5rem;
  }
  .post-body h1 {
    font-size: 1.4rem;
  }
  .post-body ul,
  .post-body ol {
    margin-left: 1.2rem;
  }
  /* 新闻条目在窄屏上改为上图下文 */
  .news-item {
    flex-direction: column;
    gap: 0.9rem;
  }
  .news-photo {
    flex: none;
    width: 100%;
  }
  .news-photo img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;
  }
}
