/* ---------- Design Tokens ---------- */
:root {
  --primary: #1565c0;
  --primary-deep: #0d47a1;
  --primary-mid: #1976d2;
  --accent: #ff9800;
  --accent-soft: #ffb74d;
  --ink: #1a1a2e;
  --ink-soft: #4a5568;
  --ink-mute: #8b9db5;
  --surface: #ffffff;
  --surface-2: #f0f4fa;
  --hairline: rgba(21, 101, 192, 0.08);
  --shadow-diffuse:
    0 2px 8px rgba(9, 33, 61, 0.06), 0 8px 32px rgba(3, 24, 48, 0.28);
  --shadow-lift:
    0 4px 16px rgba(21, 101, 192, 0.1), 0 16px 48px rgba(21, 101, 192, 0.14);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-fast: 160ms;
  --dur-med: 280ms;
  --dur-slow: 500ms;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
html,
body {
  width: 100%;
  font-family:
    "Plus Jakarta Sans", "Source Sans 3", "Microsoft YaHei", "微软雅黑",
    sans-serif;
  font-size: 16px;
}
body {
  background: var(--surface-2);
  color: var(--ink);
  overflow-x: hidden;
  overflow-y: scroll;
  max-width: 1920px;
  margin: 0 auto;
  line-height: 1.6;
}
.container {
  width: 100%;
  min-height: 100%;
}

/* ---------- 内容区底部背景图 ---------- */
.content-wrap {
  position: relative;
  width: 100%;
  z-index: 0;
  overflow: hidden;
}
.bottom-bg {
  position: absolute;
  left: 50%;
  bottom: -8%;
  width: 110%;
  max-width: none;
  height: auto;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: -1;
}
.top-bg {
  position: absolute;
  top: 0;
  right: 0;
  width: 110%;
  max-width: none;
  height: auto;
  transform: translateX(50%);
  pointer-events: none;
  z-index: -1;
}
.mid-bg {
  position: absolute;
  left: 0;
  top: 50%;
  width: 110%;
  max-width: none;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
  z-index: -1;
}
img {
  display: block;
  vertical-align: top;
}
a {
  color: inherit;
  text-decoration: none;
}

/* ============== 顶部装饰条 ============== */
.top-bar {
  height: 0.6rem;
}

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.hero-img {
  display: block;
  width: 100%;
  height: auto;
  transform: scale(1.05);
  transition: transform 6s var(--ease-out);
}
.hero.in-view .hero-img {
  transform: scale(1);
}

/* ============================================================
   SECTION SHELL
   ============================================================ */
.section {
  width: 100%;
  padding: clamp(3rem, 7vw, 6rem) 0 clamp(3rem, 6vw, 5rem);
  position: relative;
}
.section-inner {
  width: 82%;
  max-width: 1240px;
  margin: 0 auto;
}

/* ---------- Section Title ---------- */
.section-title {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  position: relative;
}
.section-title img {
  display: inline-block;
  max-width: 100%;
  height: auto;
}

/* ============================================================
   GRID UTILITIES
   ============================================================ */
.grid {
  display: grid;
}
ul.grid,
ul.alt-row,
ul.global-grid {
  list-style: none;
}
.grid-2 {
  grid-template-columns: repeat(2, 1fr);
  gap: 1.8rem;
}
.grid-3 {
  grid-template-columns: repeat(3, 1fr);
  gap: 1.8rem;
}
.grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 1.8rem;
}

/* ============================================================
   ALT CARDS  (INNOVATION & LINKAGE / CHINA-AFRICA HUB)
   ============================================================ */
.alt-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.2%;
}
.alt-card {
  overflow: hidden;
  border-radius: 0.2rem;
  box-shadow: var(--shadow-diffuse);
  transition:
    transform var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}
.alt-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.alt-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lift);
}
.alt-card:active {
  transform: translateY(-2px) scale(0.99);
}
.alt-img {
  width: 100%;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  position: relative;
}
.alt-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.alt-card:hover .alt-img img {
  transform: scale(1.06);
}
.alt-text {
  width: 100%;
  aspect-ratio: 3 / 2;
  background: var(--primary-mid);
  color: #fff;
  padding: 1.6rem 1.6rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  text-align: left;
  position: relative;
  overflow: hidden;
}
/* subtle inner glow */
.alt-text::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse at 20% 80%,
    rgba(255, 255, 255, 0.06) 0%,
    transparent 60%
  );
  pointer-events: none;
}
.alt-text .title {
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.45;
  color: #fff;
  position: relative;
  z-index: 1;
}

/* ============================================================
   GLOBAL OUTREACH  —  20% / 60% / 20%
   ============================================================ */
.global-grid {
  display: grid;
  grid-template-columns: 22% 56% 22%;
  grid-template-rows: 1fr 1fr;
  gap: 1.2%;
}
.global-card {
  overflow: hidden;
  border-radius: 0.2rem;
  box-shadow: var(--shadow-diffuse);
  transition:
    transform var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
}
.global-card > a {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.global-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lift);
}
.global-card:active {
  transform: translateY(-1px) scale(0.99);
}
.global-card.horizontal > a {
  flex-direction: row;
}
.global-card.col-1 {
  grid-column: 1;
  grid-row: 1 / 3;
}
.global-card.col-2a {
  grid-column: 2;
  grid-row: 1;
}
.global-card.col-2b {
  grid-column: 2;
  grid-row: 2;
}
.global-card.col-3 {
  grid-column: 3;
  grid-row: 1 / 3;
}
.global-grid .alt-img,
.global-grid .alt-text {
  flex: 1 1 50%;
  min-width: 0;
  aspect-ratio: auto;
}
.global-grid .alt-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform var(--dur-slow) var(--ease-out);
}
.global-card:hover .alt-img img {
  transform: scale(1.05);
}
.global-grid .alt-text .title {
  font-size: 1.2rem;
}

/* ============================================================
   TEXT CARDS  (OPEN HUNAN)
   ============================================================ */
.text-card {
  padding: 2rem 2.2rem 2.6rem;
  position: relative;
  transition:
    transform var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
  overflow: hidden;
}
.text-card > a {
  display: block;
  height: 100%;
}
.text-card .line {
  position: absolute;
  top: 1.6rem;
  left: 2.2rem;
  right: 2.2rem;
  height: 2px;
  background: #9ac9d8;
  display: block;
}
.text-card::before {
  content: "";
  position: absolute;
  left: 2.2rem;
  top: 1.42rem;
  width: 4.5rem;
  height: 0.3rem;
  background: var(--primary-mid);
  border-radius: 0.15rem;
  z-index: 2;
  transition: width var(--dur-med) var(--ease-out);
}
.text-card:hover::before {
  width: 6rem;
}
/* fold corner */
.text-card--fold {
  background: var(--surface);
  border: 1px solid var(--hairline);
  clip-path: polygon(
    0 0,
    100% 0,
    100% calc(100% - 2.8rem),
    calc(100% - 2.8rem) 100%,
    0 100%
  );
}
.text-card--fold::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 2.8rem;
  height: 2.8rem;
  background: linear-gradient(135deg, #90caf9 0%, #64b5f6 100%);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  pointer-events: none;
  z-index: 3;
  transition: transform var(--dur-med) var(--ease-out);
  transform-origin: bottom right;
}

.text-card:active {
  transform: translateY(-2px) scale(0.99);
}

.text-card-title {
  margin-top: 1.6rem;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  line-height: 1.55;
  text-align: left;
}
/* blue highlight card */
.text-card--blue {
  background: #a7e8fe;
  border-color: rgba(21, 101, 192, 0.12);
}
.text-card--blue::before {
  background: var(--primary);
}
.text-card--blue.text-card--fold::after {
  background: linear-gradient(135deg, #e8f4fd 0%, #bbdefb 100%);
}
.text-card--blue .text-card-title {
  color: var(--primary-deep);
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: linear-gradient(180deg, var(--primary-mid), var(--primary-deep));
  color: #fff;
  padding: 2.8rem 0;
  position: relative;
}
.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
}
.copyright {
  width: 82%;
  max-width: 1240px;
  margin: 0 auto;
  text-align: center;
  font-size: 0.82rem;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.55);
}

/* ============================================================
   BACK TO TOP
   ============================================================ */
#backToTop {
  position: fixed;
  right: 2rem;
  bottom: 2.5rem;
  width: 3.2rem;
  height: 3.2rem;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.3rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(21, 101, 192, 0.35);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition:
    opacity var(--dur-med) var(--ease-out),
    transform var(--dur-med) var(--ease-out),
    background var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out);
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: center;
}
#backToTop.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
#backToTop:hover {
  background: var(--accent);
  box-shadow: 0 6px 24px rgba(255, 152, 0, 0.35);
  transform: translateY(-3px);
}
#backToTop:active {
  transform: translateY(-1px) scale(0.94);
}

/* ============================================================
   RESPONSIVE — 1024px
   ============================================================ */
@media screen and (max-width: 1024px) {
  .section-inner,
  .copyright {
    width: 90%;
  }
  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .alt-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5%;
  }
  .global-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 1.5%;
  }
  .global-card.col-1 {
    grid-column: 1;
    grid-row: 1;
  }
  .global-card.col-2a {
    grid-column: 2;
    grid-row: 1;
  }
  .global-card.col-2b {
    grid-column: 1;
    grid-row: 2;
  }
  .global-card.col-3 {
    grid-column: 2;
    grid-row: 2;
  }
  .global-card.horizontal > a {
    flex-direction: column;
  }
  .global-grid .alt-img,
  .global-grid .alt-text {
    flex: none;
  }
}

/* ============================================================
   RESPONSIVE — 768px
   ============================================================ */
@media screen and (max-width: 768px) {
  .section {
    padding: 3rem 0 2.5rem;
  }
  .grid-3,
  .grid-2 {
    grid-template-columns: 1fr;
  }
  .alt-row {
    grid-template-columns: 1fr;
  }
  /* 移动端所有卡片统一为「上图下字」 */
  .alt-card .alt-img,
  .global-card .alt-img {
    order: 1;
  }
  .alt-card .alt-text,
  .global-card .alt-text {
    order: 2;
  }
  .global-grid {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
  }
  .global-card.col-1,
  .global-card.col-2a,
  .global-card.col-2b,
  .global-card.col-3 {
    grid-column: 1;
    grid-row: auto;
  }
  .alt-text {
    aspect-ratio: auto;
    min-height: 7rem;
  }
  .text-card {
    padding: 1.6rem 1.6rem 2rem;
  }
  .text-card .line {
    left: 1.6rem;
    right: 1.6rem;
    top: 1.3rem;
  }
  .text-card::before {
    left: 1.6rem;
    top: 1.16rem;
  }
  .bottom-bg {
    bottom: -2%;
  }
}

/* ============================================================
   RESPONSIVE — 480px
   ============================================================ */
@media screen and (max-width: 480px) {
  .section-inner,
  .copyright {
    width: 92%;
  }
  .hero-text {
    width: 92%;
  }
  .text-card {
    padding: 1.4rem 1.4rem 1.8rem;
  }
  .text-card .line {
    left: 1.4rem;
    right: 1.4rem;
  }
  .text-card::before {
    left: 1.4rem;
  }
  #backToTop {
    right: 1rem;
    bottom: 1.5rem;
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.1rem;
  }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .reveal,
  .reveal-stagger > * {
    opacity: 1 !important;
    transform: none !important;
  }
}
