/* ==========================================================================
   基础样式 · 江西财经大学海南高等研究院
   - CSS 变量与设计令牌
   - 排版、容器、按钮、卡片等通用组件
   - 无障碍与动效偏好
   ========================================================================== */

/* ---------- 设计令牌 ---------- */
:root {
  /* 品牌色 */
  --brand: #0b5cab;
  --brand-dark: #083f78;
  --brand-deep: #052a50;
  --brand-soft: #edf5fe;
  --accent: #6aa9dd;
  --accent-light: #cfe6fb;

  /* 中性色 */
  --ink: #10233d;
  --text: #2f3d50;
  --muted: #5b6b7f;
  --line: #e2e8f0;
  --bg: #f3f7fc;
  --bg-cool: #eef5fd;
  --white: #fff;

  /* 阴影与圆角 */
  --shadow-sm: 0 4px 16px rgba(20, 28, 45, 0.06);
  --shadow-md: 0 16px 44px rgba(20, 28, 45, 0.1);
  --shadow-lg: 0 30px 80px rgba(12, 18, 32, 0.22);
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;

  /* 尺寸与动效 */
  --container: 1320px;
  --header-h: 84px;
  --ease: cubic-bezier(0.22, 0.68, 0.22, 1);
}

/* ---------- 重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}

/* 带栏目标签的内页：为固定头部与吸顶栏目标签预留滚动空间 */
html:has(.subnav-bar) {
  scroll-padding-top: calc(var(--header-h) + 92px);
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    "Source Han Sans SC", "Noto Sans CJK SC", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  color: var(--text);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

main {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6,
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 600;
  line-height: 1.35;
  color: var(--ink);
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s var(--ease);
}

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

img {
  height: auto;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

::selection {
  background: var(--brand);
  color: var(--white);
}

:focus-visible {
  outline: 3px solid rgba(11, 92, 171, 0.55);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 隐藏但可被读屏识别 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  top: -80px;
  left: 16px;
  z-index: 3000;
  padding: 12px 20px;
  border-radius: 0 0 8px 8px;
  background: var(--brand);
  color: var(--white);
  font-size: 14px;
  font-weight: 600;
  transition: top 0.2s var(--ease);
}

.skip-link:focus {
  top: 0;
  color: var(--white);
}

/* ---------- 布局 ---------- */
.container {
  width: min(100% - 48px, var(--container));
  margin-inline: auto;
}

.container--narrow {
  width: min(100% - 48px, 1120px);
  margin-inline: auto;
}

.section {
  padding: clamp(56px, 7vw, 96px) 0;
}

/* ---------- 标题体系 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.26em;
  line-height: 1.4;
  text-transform: uppercase;
  color: var(--brand);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: currentColor;
}

.eyebrow--light {
  color: var(--accent-light);
}

.section-title {
  margin-top: 12px;
  font-family: "Songti SC", "STSong", "Source Han Serif SC", "Noto Serif CJK SC",
    "SimSun", serif;
  font-size: clamp(28px, 3.1vw, 42px);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}

.section-title--light {
  color: var(--white);
}

.section-title::after {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-top: 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
}

.section-title--light::after {
  background: linear-gradient(90deg, var(--accent), transparent);
}

.section-en {
  margin-top: 6px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.section-desc {
  max-width: 62ch;
  margin-top: 14px;
  color: var(--muted);
  font-size: 16px;
}

.text-center {
  text-align: center;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  transition:
    background 0.22s var(--ease),
    color 0.22s var(--ease),
    border-color 0.22s var(--ease),
    transform 0.22s var(--ease),
    box-shadow 0.22s var(--ease);
}

.btn svg {
  width: 17px;
  height: 17px;
  transition: transform 0.22s var(--ease);
}

.btn:hover svg {
  transform: translateX(3px);
}

.btn--primary {
  background: linear-gradient(135deg, #0b5cab 0%, #1a7fd4 100%);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(11, 92, 171, 0.28);
}

.btn--primary:hover {
  background: var(--brand-dark);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(11, 92, 171, 0.3);
}

.btn--ghost {
  border-color: rgba(255, 255, 255, 0.55);
  color: var(--white);
  backdrop-filter: blur(4px);
}

.btn--ghost:hover {
  background: var(--white);
  border-color: var(--white);
  color: var(--brand);
  transform: translateY(-2px);
}

.btn--light {
  background: var(--white);
  color: var(--brand);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.15);
}

.btn--light:hover {
  background: var(--white);
  color: var(--brand-dark);
  transform: translateY(-2px);
}

.btn--outline {
  border-color: var(--line);
  color: var(--text);
  background: var(--white);
}

.btn--outline:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: translateY(-2px);
}

.link-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--brand);
  white-space: nowrap;
}

.link-more svg {
  width: 16px;
  height: 16px;
  transition: transform 0.2s var(--ease);
}

.link-more:hover {
  color: var(--brand-dark);
}

.link-more:hover svg {
  transform: translateX(4px);
}

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

.link-more--light:hover {
  color: var(--white);
}

/* ---------- 轮播控件 ---------- */
.swiper-btn {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    border-color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.swiper-btn svg {
  width: 18px;
  height: 18px;
}

.swiper-btn:hover {
  background: var(--brand);
  border-color: var(--brand);
  color: var(--white);
  transform: translateY(-1px);
}

.swiper-btn[disabled] {
  opacity: 0.4;
  cursor: default;
}

.swiper-controls {
  display: flex;
  gap: 10px;
}

/* Swiper 分页器统一外观 */
.swiper-pagination-bullet {
  width: 8px;
  height: 8px;
  margin: 0 5px !important;
  background: rgba(255, 255, 255, 0.55);
  opacity: 1;
  transition:
    width 0.25s var(--ease),
    background 0.25s var(--ease);
}

.swiper-pagination-bullet-active {
  background: var(--accent-light);
}

/* ---------- 卡片 ---------- */
.news-card {
  position: relative;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 16px;
  background: var(--white);
  box-shadow: 0 8px 26px rgba(6, 29, 56, 0.07);
  transition:
    transform 0.25s var(--ease),
    box-shadow 0.25s var(--ease);
}

.news-card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 2;
  height: 3px;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease);
}

.news-card:hover::before {
  transform: scaleX(1);
}

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

.news-card__link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.news-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: var(--bg);
}

.news-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s var(--ease);
}

.news-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(4, 22, 44, 0.34), transparent 46%);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}

.news-card:hover .news-card__media::after {
  opacity: 1;
}

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

.news-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 18px 58px 24px 20px;
}

.news-card__title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 3.1em;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.55;
  color: var(--ink);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.news-card__date {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(4, 22, 44, 0.58);
  font-size: 12px;
  color: var(--white);
  backdrop-filter: blur(6px);
  transition:
    background 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.news-card:hover .news-card__date {
  border-color: var(--brand);
  background: var(--brand);
}

.news-card::after {
  content: "↗";
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--brand-soft);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  color: var(--brand);
  transition:
    background 0.2s var(--ease),
    color 0.2s var(--ease),
    transform 0.2s var(--ease);
}

.news-card:hover::after {
  background: var(--brand);
  color: var(--white);
  transform: translate(2px, -2px);
}

/* ---------- 动效 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition:
    opacity 0.7s var(--ease),
    transform 0.7s var(--ease);
}

.reveal.is-visible {
  opacity: 1;
  transform: none;
}

@keyframes float-down {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(8px);
  }
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 工具类 ---------- */
.is-hidden {
  display: none !important;
}

@media (max-width: 768px) {
  .container,
  .container--narrow {
    width: calc(100% - 32px);
  }

  .btn {
    min-height: 44px;
    padding: 0 20px;
  }
}
