:root {
  --primary-color: #1a73e8;
  --primary-hover: #1557b0;
  --text-main: #202124;
  --text-sub: #5f6368;
  --bg-page: #ffffff;
  --bg-light: #f8f9fa;
  --border-color: #dadce0;
  --max-width: 1040px;
}

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

body {
  font-family: 'Noto Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text-main);
  background-color: var(--bg-page);
  line-height: 1.65;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

/* 顶部粘性导航栏 */
.nav-header {
  position: sticky;
  top: 0;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border-color);
  z-index: 100;
  padding: 0.75rem 1.5rem;
}

.nav-container {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  font-family: 'Google Sans', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-brand span {
  color: var(--primary-color);
}

.nav-links {
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary-color);
}

/* 页面内容容器 */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Hero / 论文头部信息区 */
.hero-section {
  padding: 4.5rem 0 2.5rem;
  text-align: center;
}

.paper-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 2.35rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text-main);
  margin-bottom: 1.5rem;
}

.authors-list {
  margin-bottom: 0.8rem;
  font-size: 1.15rem;
  color: var(--text-main);
}

.authors-list a {
  color: var(--text-main);
  text-decoration: none;
  font-weight: 500;
}

.authors-list a:hover {
  color: var(--primary-color);
  text-decoration: underline;
}

.affiliations {
  color: var(--text-sub);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.8rem;
}

.affiliations sup {
  font-weight: 600;
  margin-right: 2px;
}

.conference-tag {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #b31b1b;
  margin-top: 0.4rem;
  margin-bottom: 1.8rem;
}

/* 操作药丸按钮 */
.button-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2rem;
}

.btn-action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 1.25rem;
  background-color: #363636;
  color: #ffffff;
  border-radius: 24px;
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  transition: all 0.2s ease;
}

.btn-action:hover {
  background-color: #000000;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(0,0,0,0.12);
}

/* 分段排版 */
section {
  padding: 3rem 0;
  border-top: 1px solid var(--border-color);
}

.section-title {
  font-family: 'Google Sans', sans-serif;
  font-size: 1.75rem;
  font-weight: 700;
  text-align: center;
  margin-bottom: 1.8rem;
  color: var(--text-main);
}

.section-subtitle {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 1.5rem 0 0.8rem;
  color: #333;
}

.content-block {
  font-size: 1.02rem;
  line-height: 1.8;
  color: #3c4043;
  margin-bottom: 1.5rem;
  text-align: justify;
}

.formula-block {
  text-align: center;
  font-family: 'JetBrains Mono', monospace;
  background: var(--bg-light);
  padding: 0.75rem;
  border-radius: 6px;
}

/* 媒体卡片与图注 */
.media-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  margin: 2rem 0;
  border: 1px solid #eaeaea;
}

.media-wrapper {
  position: relative;
  width: 100%;
  background: #000;
  display: flex;
  justify-content: center;
  align-items: center;
}

.media-wrapper video,
.media-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
}

.caption {
  padding: 1rem 1.2rem;
  background: var(--bg-light);
  font-size: 0.92rem;
  color: var(--text-sub);
  line-height: 1.6;
  border-top: 1px solid #eaeaea;
}

.caption strong {
  color: var(--text-main);
}

/* 使用网格严格锁定：左侧 60% 正文，右侧 40% 图片 */
.two-column-layout {
  display: grid !important;
  grid-template-columns: 45% 50% !important; /* 左60%，右40% 绝不换行 */
  column-gap: 2rem !important;
  align-items: center;
  margin: 2rem 0;
  width: 100%;
  box-sizing: border-box;
}

/* 左侧文字区 */
.two-column-layout .text-column {
  width: 100%;
  min-width: 0;
}

/* 右侧图片卡片区：清除原有 margin，确保填满右侧 40% 轨道 */
.two-column-layout .media-card {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
}

/* 内部图片自适应 */
.two-column-layout .media-card img {
  width: 100%;
  height: auto;
  display: block;
}

/* 多视频网格 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.5rem;
  margin: 1.8rem 0;
}

.video-grid-item {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 8px;
  overflow: hidden;
}

.video-grid-item .title {
  padding: 0.8rem 1rem 0.4rem;
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-main);
}

.video-grid-item .desc {
  padding: 0 1rem 0.8rem;
  font-size: 0.85rem;
  color: var(--text-sub);
}

/* 标签组 */
.tag-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 1.5rem;
}

.tag {
  background: #eef3fc;
  color: var(--primary-color);
  padding: 0.3rem 0.8rem;
  border-radius: 16px;
  font-size: 0.85rem;
  font-weight: 500;
}

/* 结果表格 */
.table-container {
  overflow-x: auto;
  margin: 1.8rem 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  text-align: center;
  background: #fff;
}

th, td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-color);
}

th {
  background-color: var(--bg-light);
  font-weight: 600;
  color: var(--text-main);
}

tr:hover {
  background-color: #fbfbfb;
}

.highlight-row {
  background-color: #f0f7ff;
  font-weight: 600;
}

/* BibTeX 引用代码框 */
.bibtex-box {
  background: #f8f9fa;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 1.2rem;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.88rem;
  color: #374151;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.5;
}

/* 页脚 */
footer {
  padding: 2.5rem 0;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-sub);
  border-top: 1px solid var(--border-color);
  background: var(--bg-light);
}

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

/* 响应式适配 */
@media (max-width: 900px) {
  .two-column-layout {
    flex-direction: column;
    gap: 1.5rem;
  }
  .two-column-layout .media-column-40 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .paper-title {
    font-size: 1.8rem;
  }
  .nav-links {
    display: none;
  }
}

/* 紧凑版 GIF 画廊容器 */
.compact-gallery {
  width: 100%;
  margin: 1.5rem 0;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

/* 顶部统一列标题：左侧 80px，右侧 4 列等宽 */
.gallery-column-headers {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  padding: 0.6rem 0.8rem;
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
  color: var(--text-main);
}

.gallery-column-headers .col-title.highlight {
  color: var(--primary-color);
}

/* 每一行：左侧 80px，右侧 4 列等宽 */
.compact-row {
  display: grid;
  grid-template-columns: 80px 1fr 1fr 1fr 1fr;
  gap: 0.5rem;
  align-items: center;
  padding: 0.4rem 0.8rem;
  border-bottom: 1px solid #f0f0f0;
}

.compact-row:last-child {
  border-bottom: none;
}

.compact-row:hover {
  background-color: #fafbfc;
}

/* 左侧标号 (Initstate X) */
.compact-row .row-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-sub);
  text-align: center;
  background: var(--bg-light);
  padding: 0.25rem 0.4rem;
  border-radius: 4px;
  border: 1px solid #e2e4e7;
}

/* GIF 紧凑视窗 */
.compact-gif-box {
  width: 100%;
  aspect-ratio: 16 / 9; /* 紧凑显示，可按素材比例自适应 */
  background: #000000;
  border-radius: 4px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.compact-gif-box img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 或 contain，按画面完整度需求设定 */
  display: block;
}

/* 移动端/小屏适配 */
@media (max-width: 768px) {
  .gallery-column-headers {
    display: none; /* 移动端隐藏顶部表头 */
  }
  .compact-row {
    grid-template-columns: 1fr; /* 移动端折叠 */
    gap: 0.4rem;
    padding: 0.8rem;
  }
  .compact-row .row-tag {
    margin-bottom: 0.2rem;
    display: inline-block;
  }
}