/* =====================================================================
   西南联大教育发展中心 · 党建与工会网站
   style.css — 纯手写 CSS，无框架依赖
   ===================================================================== */

/* ---------------------------------------------------------------------
   1. CSS Reset
   --------------------------------------------------------------------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Microsoft YaHei",
    "PingFang SC", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: #212121;
  background-color: #ffffff;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* 数字与英文使用 Roboto */
.num,
.stats-number,
.date-day,
.en {
  font-family: "Roboto", -apple-system, "Microsoft YaHei", sans-serif;
}

img,
picture,
video,
svg {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

button,
input,
textarea,
select {
  font: inherit;
  color: inherit;
  border: none;
  outline: none;
  background: none;
}

button {
  cursor: pointer;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* ---------------------------------------------------------------------
   2. CSS 变量（设计令牌）
   --------------------------------------------------------------------- */
:root {
  /* 党建红主色 */
  --primary: #c62828;
  --primary-light: #d32f2f;
  --primary-dark: #b71c1c;
  --primary-darker: #8e1414;

  /* 中性色 */
  --dark: #212121;
  --gray-dark: #424242;
  --gray: #757575;
  --gray-light: #e0e0e0;
  --gray-bg: #f5f5f5;
  --white: #ffffff;

  /* 页脚深色 */
  --footer-bg: #16213e;
  --footer-bg-deep: #0f1729;

  /* 阴影 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 2px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.12);
  --shadow-red: 0 6px 20px rgba(198, 40, 40, 0.28);

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

  /* 布局 */
  --container: 1200px;
  --nav-height: 60px;

  /* 过渡 */
  --t-fast: 0.2s ease;
  --t: 0.3s ease;
}

/* ---------------------------------------------------------------------
   3. 布局工具
   --------------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
}

.section {
  padding: 64px 0;
}

.section-gray {
  background: var(--gray-bg);
}

.section-header {
  text-align: center;
  margin-bottom: 40px;
}

.section-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--dark);
  position: relative;
  display: inline-block;
  padding-bottom: 14px;
}

.section-title::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 56px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

.section-subtitle {
  margin-top: 12px;
  font-size: 15px;
  color: var(--gray);
}

.text-primary { color: var(--primary); }
.text-center { text-align: center; }

/* ---------------------------------------------------------------------
   4. 按钮
   --------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 26px;
  font-size: 15px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background var(--t), color var(--t), transform var(--t-fast),
    box-shadow var(--t);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(198, 40, 40, 0.25);
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: var(--shadow-red);
}

.btn-outline {
  background: transparent;
  color: #fff;
  border: 1.5px solid rgba(255, 255, 255, 0.7);
}

.btn-outline:hover {
  background: #fff;
  color: var(--primary);
  border-color: #fff;
}

.btn-lg {
  padding: 13px 34px;
  font-size: 16px;
}

/* ---------------------------------------------------------------------
   5. Header / 导航栏
   --------------------------------------------------------------------- */
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: var(--primary);
  z-index: 1000;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
  transition: box-shadow var(--t);
}

.nav-inner {
  height: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Logo */
.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.nav-logo .logo-mark {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #fff;
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  flex-shrink: 0;
}

.nav-logo .logo-text small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

/* 菜单 */
.nav-menu {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-menu > li > a {
  position: relative;
  display: block;
  padding: 0 16px;
  height: var(--nav-height);
  line-height: var(--nav-height);
  color: rgba(255, 255, 255, 0.92);
  font-size: 15px;
  font-weight: 500;
  transition: color var(--t);
}

.nav-menu > li > a::after {
  content: "";
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 14px;
  height: 2px;
  background: #fff;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t);
}

.nav-menu > li > a:hover,
.nav-menu > li.active > a {
  color: #fff;
}

.nav-menu > li > a:hover::after,
.nav-menu > li.active > a::after {
  transform: scaleX(1);
}

/* 移动端汉堡按钮 */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: #fff;
  transition: transform var(--t), opacity var(--t);
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}
.nav-toggle.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ---------------------------------------------------------------------
   6. 搜索框
   --------------------------------------------------------------------- */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  width: 220px;
  height: 36px;
  padding: 0 40px 0 14px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.95);
  font-size: 14px;
  color: var(--dark);
  transition: width var(--t), box-shadow var(--t);
}

.search-box input::placeholder {
  color: #9e9e9e;
}

.search-box input:focus {
  width: 260px;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.35);
}

.search-box .search-btn {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary);
  transition: background var(--t);
}

.search-box .search-btn:hover {
  background: var(--gray-light);
}

/* 浅色背景下的搜索框变体 */
.search-box--light input {
  background: var(--gray-bg);
  border: 1px solid var(--gray-light);
}
.search-box--light .search-btn {
  color: var(--gray);
}

/* ---------------------------------------------------------------------
   7. Hero 区域
   --------------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 400px;
  margin-top: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #424242 0%, #212121 100%);
  color: #fff;
  overflow: hidden;
}

/* 首页红色 Hero 变体 */
.hero.hero-red {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-darker) 50%, #8e1414 100%);
}

/* 党旗红微光叠加，增强主题感 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
      ellipse at 30% 40%,
      rgba(198, 40, 40, 0.35) 0%,
      transparent 55%
    ),
    radial-gradient(
      ellipse at 75% 70%,
      rgba(211, 47, 47, 0.2) 0%,
      transparent 50%
    );
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
  padding: 0 20px;
}

.hero h1 {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 2px;
  margin-bottom: 18px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.hero .hero-subtitle {
  font-size: 16px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 32px;
  letter-spacing: 1px;
}

/* Hero 段落文字 */
.hero p {
  font-size: 15px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 12px;
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.hero p:last-of-type {
  margin-bottom: 32px;
}

.hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* 面包屑（hero 下方或内页） */
.breadcrumb {
  background: var(--gray-bg);
  border-bottom: 1px solid var(--gray-light);
  padding: 14px 0;
  font-size: 14px;
  color: var(--gray);
}

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

.breadcrumb .sep {
  margin: 0 8px;
  color: #bdbdbd;
}

.breadcrumb .current {
  color: var(--dark);
}

/* ---------------------------------------------------------------------
   8. 卡片网格（功能/服务）
   --------------------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  box-shadow: var(--shadow-md);
  transition: transform var(--t), box-shadow var(--t);
  border: 1px solid #f0f0f0;
}

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

.card-icon {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  border-radius: 50%;
  border: 2px solid var(--primary);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fdf3f3;
  transition: background var(--t), color var(--t), transform var(--t);
  font-size: 28px;
}

.card-icon i,
.card-icon svg {
  font-size: 28px;
  width: 28px;
  height: 28px;
}

.card:hover .card-icon {
  background: var(--primary);
  color: #fff;
  transform: rotate(8deg) scale(1.05);
}

.card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--dark);
  margin-bottom: 10px;
}

.card p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.7;
  margin-bottom: 16px;
}

.card-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 500;
  color: var(--primary);
  transition: gap var(--t), color var(--t);
}

.card-link:hover {
  color: var(--primary-dark);
  gap: 8px;
}

/* ---------------------------------------------------------------------
   9. 新闻列表
   --------------------------------------------------------------------- */
.news-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.news-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform var(--t), box-shadow var(--t);
  display: flex;
  flex-direction: column;
}

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

.news-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: var(--gray-bg);
}

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

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

/* 红色日期 badge */
.news-date {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: 6px 12px;
  text-align: center;
  line-height: 1.1;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.news-date .date-day {
  display: block;
  font-size: 18px;
  font-weight: 700;
}

.news-date .date-month {
  display: block;
  font-size: 11px;
  opacity: 0.9;
}

.news-body {
  padding: 18px 20px 22px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.news-tag {
  display: inline-block;
  align-self: flex-start;
  font-size: 12px;
  color: var(--primary);
  background: #fdecea;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  margin-bottom: 10px;
}

.news-card h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
  line-height: 1.5;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--t);
}

.news-card:hover h3 {
  color: var(--primary);
}

.news-card p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
  flex: 1;
}

.news-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: #9e9e9e;
  border-top: 1px solid #f0f0f0;
  padding-top: 12px;
}

.news-meta a {
  color: var(--primary);
  font-weight: 500;
  transition: color var(--t);
}

.news-meta a:hover {
  color: var(--primary-dark);
}

/* 新闻列表（带缩略图横向排列）变体 */
.news-list-rows {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.news-row {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 20px;
  background: #fff;
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t), box-shadow var(--t);
}

.news-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.news-row .news-thumb {
  border-radius: var(--radius-sm);
  aspect-ratio: 3 / 2;
}

.news-row h3 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--dark);
  transition: color var(--t);
}

.news-row:hover h3 {
  color: var(--primary);
}

.news-row p {
  font-size: 14px;
  color: var(--gray);
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 选项卡 */
.tabs {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 22px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  color: var(--gray-dark);
  background: var(--gray-bg);
  transition: background var(--t), color var(--t);
}

.tab:hover {
  color: var(--primary);
}

.tab.active {
  background: var(--primary);
  color: #fff;
}

/* 查看更多 */
.view-more {
  text-align: center;
  margin-top: 44px;
}

.view-more a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 30px;
  border: 1.5px solid var(--primary);
  color: var(--primary);
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--t), color var(--t), gap var(--t);
}

.view-more a:hover {
  background: var(--primary);
  color: #fff;
  gap: 10px;
}

/* ---------------------------------------------------------------------
   10. 统计条
   --------------------------------------------------------------------- */
.stats-bar {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  padding: 48px 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  text-align: center;
}

.stat-item {
  position: relative;
  padding: 0 16px;
}

.stat-item:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -12px;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 56px;
  background: rgba(255, 255, 255, 0.22);
}

.stats-number {
  font-size: 44px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 1px;
  margin-bottom: 8px;
  display: inline-block;
}

.stats-number .unit {
  font-size: 20px;
  font-weight: 500;
  margin-left: 4px;
  opacity: 0.9;
}

.stat-label {
  font-size: 15px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 1px;
}

/* ---------------------------------------------------------------------
   11. 页脚
   --------------------------------------------------------------------- */
.footer {
  background: var(--footer-bg);
  color: rgba(255, 255, 255, 0.75);
  padding-top: 56px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 40px;
}

.footer-col h4 {
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  position: relative;
}

.footer-col h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 32px;
  height: 2px;
  background: var(--primary);
}

.footer-about .footer-logo {
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.footer-about p {
  font-size: 14px;
  line-height: 1.8;
  margin-bottom: 16px;
}

.footer-contact li,
.footer-links li {
  font-size: 14px;
  line-height: 2;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.footer-contact li svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 6px;
  color: var(--primary-light);
}

.footer-links li a {
  color: rgba(255, 255, 255, 0.7);
  transition: color var(--t), padding-left var(--t);
}

.footer-links li a:hover {
  color: #fff;
  padding-left: 6px;
}

.footer-social {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.footer-social a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  transition: background var(--t), transform var(--t);
}

.footer-social a:hover {
  background: var(--primary);
  transform: translateY(-3px);
}

.footer-social svg {
  width: 18px;
  height: 18px;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.55);
  flex-wrap: wrap;
  gap: 10px;
}

.footer-bottom a:hover {
  color: #fff;
}

/* ---------------------------------------------------------------------
   12. 文章详情页
   --------------------------------------------------------------------- */
.article-page {
  padding: 48px 0 64px;
}

.article-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 40px;
  align-items: start;
}

.article-main {
  max-width: 800px;
}

.article-header {
  border-bottom: 1px solid var(--gray-light);
  padding-bottom: 24px;
  margin-bottom: 28px;
}

.article-title {
  font-size: 30px;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  margin-bottom: 16px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 14px;
  color: var(--gray);
}

.article-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.article-meta svg {
  width: 15px;
  height: 15px;
}

.article-content {
  font-size: 16px;
  line-height: 1.9;
  color: #333;
}

.article-content p {
  margin-bottom: 20px;
}

.article-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 32px 0 16px;
  color: var(--dark);
  padding-left: 12px;
  border-left: 4px solid var(--primary);
}

.article-content h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 24px 0 12px;
  color: var(--dark);
}

.article-content img {
  border-radius: var(--radius);
  margin: 24px 0;
}

.article-content blockquote {
  margin: 24px 0;
  padding: 16px 24px;
  background: #fdf3f3;
  border-left: 4px solid var(--primary);
  color: var(--gray-dark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.article-content ul,
.article-content ol {
  margin: 0 0 20px 4px;
  padding-left: 22px;
}

.article-content ul li {
  list-style: disc;
  margin-bottom: 8px;
}

.article-content ol li {
  list-style: decimal;
  margin-bottom: 8px;
}

/* 文章底部翻页 */
.article-nav {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--gray-light);
  flex-wrap: wrap;
}

.article-nav a {
  font-size: 14px;
  color: var(--gray-dark);
  max-width: 48%;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color var(--t);
}

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

.article-nav .nav-label {
  font-size: 12px;
  color: var(--gray);
  display: block;
  margin-bottom: 2px;
}

/* 侧边栏 */
.sidebar {
  position: sticky;
  top: calc(var(--nav-height) + 24px);
}

.sidebar-widget {
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 24px;
}

.sidebar-widget h3 {
  font-size: 17px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  display: inline-block;
}

.sidebar-list li {
  padding: 10px 0;
  border-bottom: 1px dashed var(--gray-light);
  font-size: 14px;
  line-height: 1.6;
}

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

.sidebar-list li a {
  display: block;
  color: var(--gray-dark);
  transition: color var(--t), padding-left var(--t);
}

.sidebar-list li a:hover {
  color: var(--primary);
  padding-left: 6px;
}

.sidebar-list li .rank {
  display: inline-block;
  width: 20px;
  height: 20px;
  line-height: 20px;
  text-align: center;
  background: var(--gray-light);
  color: var(--gray);
  border-radius: var(--radius-sm);
  font-size: 12px;
  margin-right: 8px;
  font-weight: 600;
}

.sidebar-list li:nth-child(1) .rank,
.sidebar-list li:nth-child(2) .rank,
.sidebar-list li:nth-child(3) .rank {
  background: var(--primary);
  color: #fff;
}

/* ---------------------------------------------------------------------
   13. 分页
   --------------------------------------------------------------------- */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 48px;
}

.pagination a,
.pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--gray-dark);
  background: #fff;
  border: 1px solid var(--gray-light);
  transition: all var(--t-fast);
}

.pagination a:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.pagination .current {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.pagination .ellipsis {
  border: none;
  background: transparent;
}

/* ---------------------------------------------------------------------
   14. 动画
   --------------------------------------------------------------------- */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.6s ease both;
}

/* 滚动入场（配合 JS 添加 .in-view） */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.in-view {
  opacity: 1;
  transform: translateY(0);
}

/* 卡片网格逐项延迟 */
.card-grid .card:nth-child(1) { animation: fadeInUp 0.6s ease 0.05s both; }
.card-grid .card:nth-child(2) { animation: fadeInUp 0.6s ease 0.15s both; }
.card-grid .card:nth-child(3) { animation: fadeInUp 0.6s ease 0.25s both; }
.card-grid .card:nth-child(4) { animation: fadeInUp 0.6s ease 0.35s both; }

.news-grid .news-card:nth-child(1) { animation: fadeInUp 0.6s ease 0.05s both; }
.news-grid .news-card:nth-child(2) { animation: fadeInUp 0.6s ease 0.18s both; }
.news-grid .news-card:nth-child(3) { animation: fadeInUp 0.6s ease 0.31s both; }

/* 尊重用户减少动画偏好 */
@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;
  }
}

/* ---------------------------------------------------------------------
   15. 响应式
   --------------------------------------------------------------------- */

/* 平板 */
@media (max-width: 992px) {
  .section { padding: 48px 0; }

  .hero h1 { font-size: 36px; }
  .hero { min-height: 340px; }

  .card-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }

  .article-layout {
    grid-template-columns: 1fr;
  }
  .sidebar {
    position: static;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
  .footer-about {
    grid-column: 1 / -1;
  }
}

/* 移动端 */
@media (max-width: 768px) {
  :root { --nav-height: 56px; }

  .section { padding: 40px 0; }
  .section-title { font-size: 24px; }

  /* 导航菜单收起 */
  .nav-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--primary);
    padding: 8px 0 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    transform: translateY(-150%);
    transition: transform var(--t);
    max-height: calc(100vh - var(--nav-height));
    overflow-y: auto;
  }

  .nav-menu.open { transform: translateY(0); }

  .nav-menu > li > a {
    height: 48px;
    line-height: 48px;
    padding: 0 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-menu > li > a::after { display: none; }

  .nav-menu .search-box {
    padding: 12px 20px 4px;
  }
  .nav-menu .search-box input { width: 100%; }
  .nav-menu .search-box input:focus { width: 100%; }

  /* 顶部搜索框默认隐藏（收入菜单） */
  .nav-inner > .search-box { display: none; }

  .hero { min-height: 300px; }
  .hero h1 { font-size: 28px; letter-spacing: 1px; }
  .hero .hero-subtitle { font-size: 14px; }
  .hero-actions .btn { flex: 1; min-width: 140px; }

  .card-grid { grid-template-columns: 1fr; gap: 16px; }
  .card { padding: 26px 20px; }

  .news-grid { grid-template-columns: 1fr; gap: 20px; }

  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 32px 16px; }
  .stat-item:not(:last-child)::after { display: none; }
  .stats-number { font-size: 34px; }

  .news-row {
    grid-template-columns: 120px 1fr;
    gap: 14px;
    padding: 12px;
  }
  .news-row h3 { font-size: 16px; }
  .news-row p { font-size: 13px; }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .article-title { font-size: 22px; }
  .article-content { font-size: 15px; }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}

/* 超小屏 */
@media (max-width: 420px) {
  .hero h1 { font-size: 24px; }
  .stats-grid { grid-template-columns: 1fr; }
  .stats-number { font-size: 30px; }
}
