/* =========================================
   THETA@BJTU - 北京交通大学人工智能安全实验室
   样式表 - 仿 Nielsen Lab 风格
   ========================================= */

/* --- CSS 变量（亮色模式） --- */
:root {
  /* 主色调 */
  --primary: #1a5276;
  --primary-dark: #0e2f44;
  --primary-light: #2980b9;
  --accent: #e74c3c;
  --accent-light: #f1948a;

  /* 背景 */
  --bg-dark: #1a1a2e;
  --bg-navbar: #16213e;
  --bg-body: #f8f9fa;
  --bg-card: #ffffff;
  --bg-card-hover: #f0f4f8;

  /* 文字 */
  --text-primary: #2c3e50;
  --text-secondary: #555555;
  --text-light: #ffffff;
  --text-muted: #888888;

  /* 边框 */
  --border-color: #e0e0e0;
  --border-light: #eef2f7;

  /* 阴影 */
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.12);

  /* 圆角 */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* 间距 */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 3rem;

  /* 字体 */
  --font-sans: 'Helvetica Neue', 'PingFang SC', 'Microsoft YaHei', Arial, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;

  /* 过渡 */
  --transition: all 0.3s ease;
}

/* --- 暗色模式 --- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-dark: #0a0a1a;
    --bg-navbar: #0f1a2e;
    --bg-body: #1a1a2e;
    --bg-card: #16213e;
    --bg-card-hover: #1c2a4a;
    --text-primary: #e8e8e8;
    --text-secondary: #b0b0b0;
    --text-muted: #777777;
    --border-color: #2a3a5c;
    --border-light: #1e2d4a;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.5);
  }
}

/* --- 全局基础 --- */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text-primary);
  background-color: var(--bg-body);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

/* --- 可访问性: Skip-to-content --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  z-index: 10000;
  padding: 8px 16px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 4px 0;
}
.skip-link:focus {
  top: 0;
  color: #fff;
  text-decoration: none;
}

/* --- 可访问性: Focus 指示器 --- */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* --- 可访问性: 减少动画偏好 --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .gallery-scroll {
    scroll-behavior: auto !important;
  }
}

img {
  max-width: 100%;
  height: auto;
  width: auto;
}

/* --- 环境照片墙 - 统一尺寸 --- */
.env-gallery {
  display: flex;
  flex-wrap: wrap;
}
.env-gallery [class*="col-"] {
  display: flex;
}
.env-gallery [class*="col-"] img {
  width: 100% !important;
  height: 200px !important;
  object-fit: cover !important;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* --- 团建照片墙 - 滚动播放 --- */
.gallery-wrap {
  position: relative;
  margin-bottom: var(--spacing-lg);
  display: flex;
  align-items: center;
  gap: 8px;
}
.gallery-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  white-space: nowrap;
  scroll-behavior: smooth;
  padding: 4px 0;
  flex: 1;
  -webkit-overflow-scrolling: touch;
}
.gallery-scroll::-webkit-scrollbar {
  height: 6px;
}
.gallery-scroll::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}
.gallery-scroll::-webkit-scrollbar-track {
  background: transparent;
}
.gallery-item {
  display: inline-block;
  width: 220px;
  height: 180px;
  margin-right: 8px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  vertical-align: top;
}
.gallery-item:last-child {
  margin-right: 0;
}
.gallery-item:hover {
  transform: scale(1.03);
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.gallery-item .gallery-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-btn {
  flex: 0 0 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 2;
  padding: 0;
}
.gallery-btn:hover {
  background: var(--primary-light);
  color: #fff;
  border-color: var(--primary-light);
}
.gallery-counter {
  text-align: center;
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: -12px;
  margin-bottom: var(--spacing-md);
}

/* --- 团队成员照片 - 统一尺寸 --- */

/* --- 团队成员照片 - 统一尺寸 --- */
.team-photo {
  width: 120px !important;
  height: 120px !important;
  object-fit: cover !important;
  border-radius: 50%;
  flex-shrink: 0;
  max-width: none !important;
}

/* --- 团队成员卡片网格 --- */
.team-card-grid .team-list-item {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-md);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  height: 100%;
}
.team-card-grid .team-list-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.team-card-grid .team-list-info {
  text-align: center;
}
.team-card-grid .team-list-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}
.team-card-grid .team-list-role {
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 500;
}
.team-card-grid .team-list-detail {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-top: var(--spacing-sm);
}
.team-card-grid [class*="col-"] {
  display: flex;
}

.team-card-grid .team-list-item {
  min-height: 320px;
  justify-content: space-between;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.3;
  margin-top: 0;
  color: var(--text-primary);
}

h1 { font-size: 2rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p { margin: 0 0 var(--spacing-md) 0; }

/* 容器 */
.container {
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 15px;
}

.main-content {
  min-height: 60vh;
  padding-top: var(--spacing-xl);
  padding-bottom: var(--spacing-xl);
}

/* --- 导航栏 --- */
#header {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.bg-navbar {
  background: var(--bg-navbar) !important;
  border-bottom: 3px solid var(--primary-light);
  padding: 0.5rem 0;
}

.navbar-brand {
  display: flex;
  align-items: center;
  padding: 0;
}

.navbar-brand .logo {
  height: 40px;
  width: auto;
  margin-right: 8px;
}

.navbar-nav .nav-link {
  padding: 0.4rem 0.6rem;
}

.navbar-nav .nav-link a {
  color: #e0e0e0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.navbar-nav .nav-link a:hover {
  color: #ffffff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

.navbar-toggler {
  border-color: rgba(255,255,255,0.3);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba(255,255,255,0.7)' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* --- 页脚 --- */
#footer {
  background: var(--bg-navbar);
  border-top: 3px solid var(--primary-light);
  padding: 0.8rem 0;
  margin-top: var(--spacing-xl);
}

#footer .navbar-nav .nav-link a {
  color: #888888;
  font-size: 12px;
  text-transform: none;
}

#footer .navbar-nav .nav-link a:hover {
  color: #ffffff;
  background: transparent;
}

#footer .visitor-count {
  color: #ffffff;
  font-size: 12px;
}

/* --- 英雄区域（首页） --- */
.hero-section {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--bg-navbar) 100%);
  color: var(--text-light);
  padding: 0;
  margin-bottom: var(--spacing-xl);
  border-radius: var(--radius-lg);
  text-align: center;
}

.hero-overlay {
  background: linear-gradient(135deg, rgba(0, 30, 80, 0.65) 0%, rgba(0, 60, 120, 0.50) 100%);
  padding: calc(var(--spacing-xl) * 1.5) 0;
  border-radius: var(--radius-lg);
}

.hero-section h1 {
  color: #ffffff;
  font-size: 2.2rem;
  margin-bottom: var(--spacing-md);
}

.hero-section p {
  color: #d0d8e8;
  font-size: 1.1rem;
  max-width: 800px;
  margin: 0 auto;
}

/* --- 研究生招生 --- */
.recruitment-section {
  margin-top: var(--spacing-lg);
}

.recruit-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  border-left: 5px solid var(--primary-light);
  transition: box-shadow 0.3s;
}

.recruit-card:hover {
  box-shadow: var(--shadow-md);
}

.recruit-phd {
  border-left-color: #e67e22;
}

.recruit-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: var(--spacing-md);
  flex-wrap: wrap;
}

.recruit-badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  background: var(--primary-light);
}

.recruit-phd .recruit-badge {
  background: #e67e22;
}

.recruit-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
}

.recruit-quota {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

.recruit-quota strong {
  color: #e74c3c;
  font-size: 18px;
  font-weight: 700;
  background: #fde8e8;
  padding: 1px 10px;
  border-radius: 4px;
}

.recruit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.recruit-table thead th {
  background: var(--bg-body);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border-color);
}

.recruit-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.recruit-table tbody tr:hover {
  background: var(--bg-card-hover);
}

.col-rank {
  width: 40px;
}

.col-name {
  width: 100px;
}

.col-gender {
  width: 60px;
}

.recruit-footer {
  margin-top: var(--spacing-sm);
  padding-top: var(--spacing-sm);
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border-light);
}

.recruit-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
}

/* --- 研究⽣招⽣ 响应式 --- */
@media (max-width: 576px) {
  .recruit-table {
    font-size: 12px;
  }
  .recruit-table thead th,
  .recruit-table tbody td {
    padding: 6px 8px;
  }
  .recruit-header {
    gap: 8px;
  }
}

/* --- 学校层次标签 --- */
.col-level {
  width: 120px;
}

.level-cell {
  white-space: nowrap;
}

.level-tag {
  display: inline-block;
  padding: 2px 8px;
  margin: 1px 2px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
}

.level-211 {
  background: #e8f5e9;
  color: #2e7d32;
  border: 1px solid #a5d6a7;
}

.level-985 {
  background: #e3f2fd;
  color: #1565c0;
  border: 1px solid #90caf9;
}

.level-双一流高校 {
  background: #fff3e0;
  color: #e65100;
  border: 1px solid #ffcc80;
}

.level-none {
  color: var(--text-muted);
  font-size: 12px;
}

/* --- 卡片 --- */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.card-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--text-primary);
}

.card-text {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.card-link {
  color: var(--primary-light);
  font-weight: 500;
}

/* --- 页面标题 --- */
.page-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: var(--spacing-xl);
  padding-bottom: var(--spacing-sm);
  border-bottom: 2px solid var(--primary-light);
  color: var(--text-primary);
}

.section-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-sm);
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}

.subsection-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
  color: var(--primary);
}

/* --- 新闻动态 - 卡片网格 --- */
.news-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 0;
}

@media (max-width: 768px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

.news-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
  overflow: hidden;
}

.news-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--accent-light);
  transform: translateY(-4px);
}

.news-card:hover .news-title {
  color: var(--accent);
}

/* 图片区域 — 自动适配：1张全宽，多张2列网格 */
.news-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.news-image-wrap {
  min-width: 0;
  display: flex;
}
.news-image-wrap a {
  display: block;
  width: 100%;
  cursor: zoom-in;
}
.news-image-wrap:only-child {
  grid-column: 1 / -1;
}
/* 2 张图时纵向堆叠（避免比例不同的图并排裁剪不均） */
.news-image-wrap:first-child:nth-last-child(2),
.news-image-wrap:first-child:nth-last-child(2) ~ .news-image-wrap {
  grid-column: 1 / -1;
}

.news-thumb {
  width: 100%;
  height: 200px;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: transform 0.3s ease;
  background: var(--bg-card-hover);
}
.news-image-wrap:not(:only-child) .news-thumb {
  height: 150px;
}

.news-card:hover .news-thumb {
  transform: scale(1.03);
}

/* 无图卡片 - 学术风格占位装饰 */
.news-card.no-image .news-image-placeholder {
  height: 120px;
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, var(--primary-light) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  color: rgba(255,255,255,0.2);
  position: relative;
  overflow: hidden;
}
.news-card.no-image .news-image-placeholder::before {
  content: "📄";
  font-size: 48px;
  opacity: 0.6;
}
.news-card.no-image .news-image-placeholder::after {
  content: "";
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 40%, rgba(255,255,255,0.05) 0%, transparent 60%);
}

/* 卡片内容体 */
.news-body {
  padding: 14px 16px 16px;
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

/* 新闻标题 */
.news-title {
  font-size: 14px;
  color: var(--text-primary);
  transition: color 0.3s;
  flex: 1 1 100%;
  min-width: 0;
  margin: 2px 0;
}

/* 日期标签特殊样式 */
.tag-date {
  color: var(--text-muted);
  font-weight: 600;
}

/* 摘要文字 */
.news-summary {
  flex: 1 1 100%;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 2px 0 0 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 新闻标签 */
.news-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  color: #c0392b;
}

/* 阅读全文链接 */
.news-readmore {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary-light);
  margin-top: 4px;
  transition: all 0.2s;
  flex: 1 1 100%;
}

.news-readmore:hover {
  color: var(--accent);
  text-decoration: none;
  transform: translateX(4px);
}

/* 查看更多按钮 */
.btn-more {
  display: inline-block;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 30px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(26, 82, 118, 0.25);
}

.btn-more:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(26, 82, 118, 0.35);
  color: #fff;
  text-decoration: none;
}

/* 年份筛选按钮 */
.news-tag, .btn-year {
  user-select: none;
}

/* --- 论文列表 --- */
.papers-list {
  list-style: none;
  padding: 0;
}

.papers-item {
  padding: var(--spacing-md) 0;
  border-bottom: 1px solid var(--border-light);
  line-height: 1.7;
}

.papers-item:last-child {
  border-bottom: none;
}

.paper-authors {
  font-size: 13px;
  color: var(--text-secondary);
}

.paper-title {
  font-weight: 600;
  color: var(--text-primary);
}

.paper-venue {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

.paper-tags {
  display: inline-block;
  font-size: 11px;
  color: var(--primary-light);
  margin-left: 4px;
}

/* --- 论文等级标签 --- */
.ccf-rank {
  font-weight: 600;
  font-size: 12px;
  margin-left: 4px;
}
.ccf-rank-a { color: #c0392b; }
.ccf-rank-b { color: #2980b9; }
.ccf-rank-c { color: #27ae60; }
.ccf-rank-1 { color: #8e44ad; }
.ccf-rank-2 { color: #d35400; }
.ccf-rank-ieee { color: #1a5276; }

/* --- 论文链接徽章 --- */
.paper-link {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 1px 6px;
  margin: 0 2px;
  border-radius: 3px;
  text-decoration: none;
  transition: all 0.2s;
}
a.paper-link { color: #fff; }
a.paper-link[title*="PDF"] { background: #c0392b; }
a.paper-link[title*="DOI"] { background: #2980b9; }
a.paper-link[title*="Code"] { background: #27ae60; }
a.paper-link:hover {
  opacity: 0.85;
  text-decoration: none;
  transform: translateY(-1px);
}

/* --- 一键复制按钮 --- */
.btn-copy-papers {
  display: inline-block;
  margin-left: 12px;
  padding: 2px 10px;
  font-size: 12px;
  color: #666;
  background: #f5f5f5;
  border: 1px solid #ddd;
  border-radius: 4px;
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.2s;
}
.btn-copy-papers:hover {
  background: #e8e8e8;
  color: #333;
}
.btn-copy-papers:active {
  background: #ddd;
}

/* --- 复制提示 Toast --- */
.copy-toast {
  position: fixed;
  bottom: 30px;
  right: 30px;
  padding: 12px 24px;
  background: #333;
  color: #fff;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  animation: toast-fadein 0.3s ease;
}
@keyframes toast-fadein {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- 团队成员卡片 --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--spacing-lg);
  margin-bottom: var(--spacing-xl);
}

.team-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.team-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.team-name {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
}

.team-role {
  font-size: 13px;
  color: var(--primary-light);
  font-weight: 500;
  margin-bottom: var(--spacing-sm);
}

.team-info {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.team-link {
  display: inline-block;
  margin-top: var(--spacing-sm);
  font-size: 13px;
}

/* --- 博客列表 --- */
.blog-list {
  list-style: none;
  padding: 0;
}

.blog-item {
  padding: var(--spacing-lg) 0;
  border-bottom: 1px solid var(--border-light);
}

.blog-item:last-child {
  border-bottom: none;
}

.blog-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
}

.blog-title a {
  color: var(--text-primary);
}

.blog-title a:hover {
  color: var(--primary-light);
}

.blog-meta {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
}

.blog-excerpt {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

.blog-tags {
  margin-top: var(--spacing-sm);
}

.badge-tag {
  display: inline-block;
  background: var(--border-light);
  color: var(--primary);
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 20px;
  margin-right: 4px;
  transition: var(--transition);
}

.badge-tag:hover {
  background: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

/* 博客列表项增强（缩略图 + 左右布局） */
.blog-item-inner {
  display: flex;
  gap: var(--spacing-lg);
  align-items: flex-start;
}

.blog-thumb {
  flex-shrink: 0;
  width: 180px;
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-card-hover);
}

.blog-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.blog-thumb a:hover img {
  transform: scale(1.05);
}

.blog-thumb-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  color: var(--text-muted);
}

.blog-thumb-placeholder a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: var(--text-muted);
}

.blog-item-body {
  flex: 1;
  min-width: 0;
}

@media (max-width: 576px) {
  .blog-item-inner {
    flex-direction: column;
  }
  .blog-thumb {
    width: 100%;
    aspect-ratio: 16 / 8;
  }
}

/* --- 博文详情页 --- */
.post-single {
  background: var(--bg-card);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  box-shadow: var(--shadow-sm);
}

.post-header {
  margin-bottom: var(--spacing-lg);
  padding-bottom: var(--spacing-md);
  border-bottom: 1px solid var(--border-light);
}

.post-title {
  font-size: 1.8rem;
  font-weight: 700;
  margin-bottom: var(--spacing-sm);
}

.post-meta {
  font-size: 14px;
  color: var(--text-muted);
}

.post-reading-time {
  white-space: nowrap;
}

/* 封面特色图 */
.post-featured-image {
  margin-bottom: var(--spacing-lg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.post-featured-image img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 420px;
  object-fit: cover;
}

/* 论文元数据卡片 */
.post-paper-meta {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.paper-meta-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.paper-meta-item {
  padding: var(--spacing-sm) 0;
  border-bottom: 1px solid var(--border-light);
}

.paper-meta-item:last-child {
  border-bottom: none;
}

.paper-meta-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.paper-meta-details {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.paper-meta-details a {
  color: var(--primary);
}

.paper-meta-details a:hover {
  text-decoration: underline;
}

/* 目录 TOC */
.post-toc {
  background: var(--bg-card-hover);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-md) var(--spacing-lg);
  margin-bottom: var(--spacing-lg);
}

.toc-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: var(--spacing-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.toc-list li {
  padding: 3px 0;
}

.toc-list a {
  font-size: 14px;
  color: var(--primary);
  text-decoration: none;
  display: block;
  padding: 2px 0;
  transition: color 0.2s ease;
}

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

/* 正文图片增强——支持 figure + figcaption */
.post-content figure {
  margin: var(--spacing-lg) 0;
  text-align: center;
}

.post-content figure img {
  display: block;
  margin: 0 auto;
}

.post-content figcaption {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: var(--spacing-xs);
  line-height: 1.5;
}

.post-content {
  line-height: 1.8;
  font-size: 15px;
}

.post-content h2 {
  margin-top: var(--spacing-xl);
  margin-bottom: var(--spacing-md);
}

.post-content h3 {
  margin-top: var(--spacing-lg);
  margin-bottom: var(--spacing-md);
}

.post-content p {
  margin-bottom: var(--spacing-md);
}

.post-content ul, .post-content ol {
  margin-bottom: var(--spacing-md);
  padding-left: 1.5rem;
}

.post-content li {
  margin-bottom: var(--spacing-xs);
}

.post-content blockquote {
  border-left: 4px solid var(--primary-light);
  background: var(--bg-card-hover);
  padding: var(--spacing-md) var(--spacing-lg);
  margin: var(--spacing-md) 0;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
}

.post-content code {
  font-family: var(--font-mono);
  background: var(--bg-card-hover);
  padding: 2px 6px;
  border-radius: 3px;
  font-size: 13px;
  color: var(--accent);
}

.post-content pre {
  background: #1e1e2e;
  color: #d4d4d4;
  padding: var(--spacing-lg);
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin-bottom: var(--spacing-lg);
  font-size: 13px;
  line-height: 1.5;
}

.post-content pre code {
  background: transparent;
  padding: 0;
  color: #d4d4d4;
  font-size: 13px;
}

.post-content img {
  border-radius: var(--radius-md);
  margin: var(--spacing-md) 0;
  box-shadow: var(--shadow-sm);
}

.post-content table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: var(--spacing-lg);
}

.post-content th, .post-content td {
  border: 1px solid var(--border-color);
  padding: var(--spacing-sm) var(--spacing-md);
  text-align: left;
}

.post-content th {
  background: var(--bg-card-hover);
  font-weight: 600;
}

/* --- 联系方式 --- */
.contact-section {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-xl);
  margin-top: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
}

.contact-email {
  font-size: 1.1rem;
  color: var(--primary-light);
  font-weight: 600;
}

/* --- 公众号二维码 --- */
.footer-qr-img {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  object-fit: cover;
  opacity: 0.8;
  transition: opacity 0.3s;
  cursor: pointer;
  vertical-align: middle;
}

.footer-qr-img:hover {
  opacity: 1;
}

.contact-qr-img {
  width: 180px;
  height: 180px;
  border: 3px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s, box-shadow 0.3s;
}

.contact-qr-img:hover {
  transform: scale(1.05);
  box-shadow: var(--shadow-md);
}

.wechat-qr-card {
  display: inline-block;
  text-align: center;
}

/* --- 相关链接 --- */
.links-section {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: var(--spacing-lg);
}

.link-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  transition: all 0.3s ease;
}

.link-badge:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  text-decoration: none;
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

/* --- 年份筛选 --- */
.year-filter {
  margin-bottom: var(--spacing-lg);
}

.year-filter .btn-year {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 4px 14px;
  border-radius: 20px;
  margin: 2px 4px;
  font-size: 13px;
  transition: var(--transition);
  cursor: pointer;
}

.year-filter .btn-year:hover,
.year-filter .btn-year.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  text-decoration: none;
}

/* --- 首页特色部分 --- */
.feature-section {
  margin-bottom: var(--spacing-xl);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--spacing-lg);
}

.feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.feature-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.feature-icon {
  font-size: 2rem;
  margin-bottom: var(--spacing-sm);
  color: var(--primary-light);
}

.feature-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
}

.feature-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.6;
}

/* --- 研究成果标签 --- */
.research-area {
  margin-bottom: var(--spacing-xl);
}

.research-area h3 {
  color: var(--primary);
  margin-bottom: var(--spacing-md);
}

/* --- 响应式 --- */
@media (max-width: 768px) {
  .hero-section {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .hero-section h1 {
    font-size: 1.5rem;
  }

  .hero-section p {
    font-size: 0.95rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .team-grid {
    grid-template-columns: 1fr;
  }

  .feature-grid {
    grid-template-columns: 1fr;
  }

  .news-item {
    flex-direction: column;
    gap: var(--spacing-xs);
  }

  .post-single {
    padding: var(--spacing-md);
  }

  .post-title {
    font-size: 1.3rem;
  }

  .navbar-brand span {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .hero-section h1 {
    font-size: 1.2rem;
  }

  .container {
    padding: 0 10px;
  }
}

/* --- 工具栏 --- */
.toolbar {
  margin-bottom: var(--spacing-lg);
  padding: var(--spacing-md);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--spacing-sm);
}

.toolbar label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-right: var(--spacing-sm);
}

/* =========================================
   视频画廊 - Video Gallery
   ========================================= */

/* 视频画廊网格 */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

/* 视频卡片 */
.video-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
}

.video-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-4px);
}

.video-card:active {
  transform: translateY(-2px);
}

/* 视频卡片缩略图容器（16:9） */
.video-card-thumb {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--bg-dark);
  overflow: hidden;
}

.video-card-thumb img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.video-card:hover .video-card-thumb img {
  transform: scale(1.05);
}

/* 播放按钮（居中） */
.video-card-play-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: rgba(0, 0, 0, 0.55);
  border: 3px solid rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 28px;
  transition: all 0.25s ease;
  z-index: 2;
  padding-left: 4px; /* 视觉居中微调 */
}

.video-card:hover .video-card-play-icon {
  background: rgba(231, 76, 60, 0.85);
  border-color: #fff;
  transform: translate(-50%, -50%) scale(1.1);
}

.video-card:active .video-card-play-icon {
  transform: translate(-50%, -50%) scale(1.05);
}

/* 时长标签 */
.video-card-duration {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  z-index: 2;
  letter-spacing: 0.5px;
  backdrop-filter: blur(2px);
}

/* 无缩略图时的占位 */
.video-card-thumb-placeholder {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-light));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
  color: rgba(255, 255, 255, 0.25);
}

/* 卡片正文 */
.video-card-body {
  padding: var(--spacing-md);
}

.video-card-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--spacing-xs);
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.video-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.video-card-date {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: var(--spacing-sm);
}

/* 视频 Lightbox 模态框 */
.video-modal .modal-dialog {
  max-width: 900px;
  margin: 30px auto;
}

.video-modal .modal-content {
  background: var(--bg-card);
  border: none;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.video-modal .modal-header {
  border-bottom: 1px solid var(--border-color);
  padding: var(--spacing-md) var(--spacing-lg);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.video-modal .modal-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
}

.video-modal .close {
  font-size: 1.5rem;
  color: var(--text-primary);
  opacity: 0.5;
  transition: opacity 0.2s ease;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.video-modal .close:hover {
  opacity: 1;
}

.video-modal .modal-body {
  padding: 0;
  background: #000;
  line-height: 0;
  position: relative;
}

/* 视频加载中指示器 */
.video-loading-overlay {
  display: none;
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  z-index: 10;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 14px;
  gap: 12px;
  line-height: 1.4;
}

.video-spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgba(255,255,255,0.2);
  border-top-color: #fff;
  border-radius: 50%;
  animation: video-spin 0.8s linear infinite;
}

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

/* 视频加载失败提示 */
.video-error-msg {
  display: none;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.8);
  color: #ff6b6b;
  padding: 16px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 10;
  white-space: nowrap;
  line-height: 1.4;
}

.video-modal video {
  display: block;
  width: 100%;
  height: auto;
  max-height: 75vh;
  background: #000;
  outline: none;
}

.video-modal .modal-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--spacing-sm) var(--spacing-lg);
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
  .video-modal .modal-content {
    background: var(--bg-card);
  }

  .video-modal .modal-header {
    border-bottom-color: var(--border-color);
  }

  .video-modal .modal-footer {
    border-top-color: var(--border-color);
  }
}

/* 响应式 */
@media (max-width: 992px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
  }
}

@media (max-width: 768px) {
  .video-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--spacing-md);
  }

  .video-modal .modal-dialog {
    margin: 10px;
  }

  .video-modal .modal-header {
    padding: var(--spacing-sm) var(--spacing-md);
  }

  .video-modal .modal-title {
    font-size: 1rem;
  }
}

@media (max-width: 480px) {
  .video-grid {
    grid-template-columns: 1fr;
  }

  .video-card-play-icon {
    width: 50px;
    height: 50px;
    font-size: 22px;
  }
}

/* --- 打印样式 --- */
@media print {
  #header, #footer, .giscus {
    display: none;
  }

  .main-content {
    padding: 0;
  }

  a {
    color: var(--text-primary) !important;
  }
}
