/* 四海梦境研究社 · 全局样式
 * 可换图资源通过 CSS 变量注入（见 js/main.js）
 */

@font-face {
  font-family: "江城解星体";
  src: url("../Resource/Fonts/江城解星体.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 暂定色号，后续可在本处统一替换 */
  --color-bg: #f6f4f1;
  --color-cyan: #1a5f6b;
  --color-cyan-muted: #4a8089;
  --color-pink: #a83258;
  --color-pink-soft: rgba(168, 50, 88, 0.82);
  --color-line: rgba(26, 95, 107, 0.16);
  --color-surface: rgba(26, 95, 107, 0.04);

  --color-text: var(--color-cyan);
  --color-text-muted: var(--color-cyan-muted);
  --color-accent: var(--color-pink);
  --color-accent-soft: var(--color-pink-soft);

  --font-display: "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-brand: "江城解星体", var(--font-display);

  --nav-h: 4.25rem;
  --page-pad: clamp(1.25rem, 4vw, 3.5rem);
  --reading: 720px;
  --section-min: min(100vh, 56rem);

  --img-logo: url("../Resource/Pictures/Logo/Circle_Logo.png");

  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

.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;
}

/* ---------- 全站白色背景 ---------- */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: var(--color-bg);
}

.page-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- 顶部导航 ---------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  padding: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.site-header__inner {
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  min-width: 0;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

/* 首页顶栏：整页宽，左右只留页边距 */
body:not(.subpage) .site-header__inner {
  width: 100%;
  padding: 0 var(--page-pad);
  box-sizing: border-box;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.brand__logo {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  background: var(--img-logo) center / cover no-repeat;
  /* 实际用 <img>；此处作兜底 */
  flex-shrink: 0;
}

.brand__logo-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.brand__name {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.12rem;
  min-width: 0;
  font-family: var(--font-brand);
  font-size: clamp(0.95rem, 1.6vw, 1.125rem);
  font-weight: normal;
  letter-spacing: 0.08em;
  line-height: 1.15;
  text-align: left;
}

.brand__name-line {
  display: block;
  max-width: 100%;
  font-family: inherit;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand__name-line--top {
  color: #e4007f;
}

.brand__name-line--bottom {
  color: var(--color-cyan);
}

.nav-toggle {
  display: grid;
  width: 2.5rem;
  height: 2.5rem;
  place-items: center;
  border: 1px solid var(--color-line);
  border-radius: 0.35rem;
  margin-left: auto;
}

.nav-toggle__bars {
  display: block;
  width: 1.1rem;
  height: 1px;
  background: var(--color-cyan);
  box-shadow: 0 -5px 0 var(--color-cyan), 0 5px 0 var(--color-cyan);
}

.site-nav {
  position: fixed;
  top: var(--nav-h);
  left: auto;
  right: var(--page-pad);
  width: max-content;
  max-width: calc(100vw - 2 * var(--page-pad));
  z-index: 90;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
  transform: translateY(-120%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.35s var(--ease-out), opacity 0.35s var(--ease-out);
}

.site-nav.is-open {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.site-nav__list {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0.5rem 1.25rem 1rem;
}

.site-nav__link {
  position: relative;
  display: block;
  font-size: 0.9375rem;
  letter-spacing: 0.06em;
  color: var(--color-cyan-muted);
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--color-line);
  white-space: nowrap;
  transition: color 0.25s var(--ease-out);
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--color-pink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s var(--ease-out);
}

.site-nav__link:hover,
.site-nav__link.is-active {
  color: var(--color-pink);
}

.site-nav__link:hover::after,
.site-nav__link.is-active::after {
  transform: scaleX(1);
}

/* ---------- 主内容 ---------- */
.main {
  flex: 1;
}

.hero {
  position: relative;
  margin-top: var(--nav-h);
}

/* 首页：顶栏和主视觉之间的滚动信息栏。条纹斜向上 45 度，和文字各自从右向左滚动 */
.home-ticker {
  --ticker-bg: #1a5f6b;
  --ticker-stripe: #f6f4f1;
  --ticker-text: #f6f4f1;
  --ticker-stripe-w: 12px;
  --ticker-period: 40px;
  --ticker-shift: -56px;
  --ticker-span: 80px;
  --ticker-stripe-duration: 1.4s;
  position: relative;
  margin-top: var(--nav-h);
  height: 1.375rem;
  overflow: hidden;
  background: var(--ticker-bg);
  color: var(--ticker-text);
}

.home-ticker[hidden] {
  display: none;
}

.home-ticker:not([hidden]) + .hero {
  margin-top: 0;
}

.home-ticker__stripes {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: calc(100% + var(--ticker-span));
  background-image: repeating-linear-gradient(
    135deg,
    var(--ticker-stripe) 0,
    var(--ticker-stripe) var(--ticker-stripe-w),
    transparent var(--ticker-stripe-w),
    transparent var(--ticker-period)
  );
  animation: home-ticker-stripes var(--ticker-stripe-duration) linear infinite;
  pointer-events: none;
}

.home-ticker.is-stripe-still .home-ticker__stripes {
  animation: none;
}

@keyframes home-ticker-stripes {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(var(--ticker-shift), 0, 0); }
}

.home-ticker__viewport {
  position: relative;
  z-index: 1;
  height: 100%;
  overflow: hidden;
}

.home-ticker__track {
  display: flex;
  width: max-content;
  height: 100%;
  animation: home-ticker-text linear infinite;
}

.home-ticker__track.is-still {
  animation: none;
}

.home-ticker__item {
  flex: 0 0 auto;
  min-width: 100vw;
  padding-right: 3rem;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 0.95rem;
  letter-spacing: 0.06em;
  line-height: 1.375rem;
  white-space: nowrap;
}

@keyframes home-ticker-text {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.hero__visual {
  position: relative;
  display: flex;
  justify-content: center;
}

.hero__bg {
  position: relative;
  z-index: 0;
  width: 100%;
  background-color: var(--color-bg);
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.hero__bg-picture {
  display: contents;
}

/* 手机主视觉：整页宽，高度按原图比例 */
.hero__bg-img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  object-position: center top;
  display: block;
}

.hero__inner {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  margin: 0 auto;
  text-align: center;
}

.hero__center-logo {
  display: block;
  width: min(520px, 88%);
  height: auto;
  margin: 0 auto 1rem;
  opacity: 0;
  transform: translateY(1.25rem);
  animation: rise-in 0.9s var(--ease-out) 0.15s forwards;
}

.hero__tagline {
  font-family: var(--font-brand);
  margin: 0;
  max-width: 28em;
  margin-inline: auto;
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--color-cyan-muted);
  letter-spacing: 0.04em;
  text-align: center;
  opacity: 0;
  transform: translateY(1rem);
  animation: rise-in 0.9s var(--ease-out) 0.35s forwards;
}

.hero__intro {
  width: 100%;
  box-sizing: border-box;
  margin: 0 auto;
  padding: clamp(1.5rem, 4vh, 2.5rem) var(--page-pad) clamp(2rem, 5vh, 3rem);
  background: var(--color-bg);
  text-align: center;
}

.hero__intro-p {
  width: max-content;
  max-width: 100%;
  margin: 0 auto 0.5rem;
  padding: 0.35rem 0.9rem;
  box-sizing: border-box;
  font-family: var(--font-body);
  font-size: 0.9875rem;
  line-height: 1.85;
  color: var(--color-text);
  text-indent: 0;
  letter-spacing: 0.02em;
  text-align: center;
  white-space: nowrap;
  border-radius: 0.75rem;
}

@media (max-width: 1100px) {
  .hero__intro-p {
    white-space: normal;
  }
}

@media (max-width: 768px) {
  .hero__intro-p {
    width: 100%;
    text-align: justify;
    text-indent: 2em;
  }
}

.hero__intro-p strong {
  font-weight: 700;
}

.hero__intro-p:last-child {
  margin-bottom: 0;
}

@keyframes rise-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ---------- 内容分区（骨架占位） ---------- */
.section {
  min-height: var(--section-min);
  padding: clamp(2.5rem, 6vh, 4rem) 0;
  scroll-margin-top: var(--nav-h);
}

.section__inner {
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  margin: -2.5rem auto 0;
  padding: 2.5rem 1.5rem 1.5rem;
  background: var(--section-content-bg, transparent);
  color: var(--section-content-fg, var(--heading-bar-fg, var(--color-text)));
  box-sizing: border-box;
}

.section__inner .works-card__title,
.section__inner .works-card__note,
.section__inner .news-item__title,
.section__inner .news-item__date,
.section__inner .news-more-btn,
.section__inner .social-list,
.section__inner .social-list__link {
  color: inherit;
}

.section__inner .social-list__link:hover,
.section__inner .news-more-btn:hover {
  color: inherit;
  opacity: 0.75;
}

.section__heading-bar {
  position: relative;
  width: 100%;
  margin: 0 0 2.5rem;
  padding: 0;
  overflow: visible;
  background: transparent;
  color: var(--heading-bar-fg, #f6f4f1);
}

/* 底色条：阅读栏宽，与标题文字同高并上下居中 */
.section__heading-bar::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  height: 100%;
  transform: translate(-50%, -50%);
  background: var(--heading-bar-bg, #1a5f6b);
  border-top-right-radius: 2rem;
  z-index: 0;
  pointer-events: none;
}

/* 纹理铺在色块上：按色块宽度等比显示，取图案垂直正中，右 50% 到左 0% 渐隐 */
.section__heading-bar::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  height: 100%;
  transform: translate(-50%, -50%);
  border-top-right-radius: 2rem;
  z-index: 0;
  pointer-events: none;
  background-image: url("../Resource/Pictures/Background/background_spread_2.webp");
  background-repeat: no-repeat;
  background-size: 100% auto;
  background-position: center center;
  -webkit-mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
  mask-image: linear-gradient(to left, rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0));
}

.section__heading-bar-inner {
  position: relative;
  z-index: 1;
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  margin: 0 auto;
}

.section__heading {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: clamp(0.75rem, 2vw, 1.25rem);
  margin: 0;
}

.section__heading--text-only {
  grid-template-columns: 1fr;
}

.section__chibi-slot {
  position: relative;
  align-self: stretch;
  justify-content: center;
}

/* 小人叠在色块之上，高度为文字高度的 150% 并居中，不参与撑开色块 */
.section__chibi {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 2;
  width: auto;
  height: auto;
  max-width: none;
  object-fit: contain;
  object-position: center center;
  display: block;
  pointer-events: none;
}

.section__heading-copy {
  align-self: start;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.section__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.35rem);
  font-weight: 600;
  letter-spacing: 0.14em;
  margin: 0 0 -0.25rem;
  color: inherit;
}

.section__lead {
  margin: 0;
  max-width: 36em;
  color: inherit;
  opacity: 0.92;
  font-size: 0.9875rem;
}

.section__placeholder {
  min-height: 12rem;
  border: 1px dashed var(--color-line);
  display: grid;
  place-items: center;
  padding: 2rem;
  color: var(--color-cyan-muted);
  letter-spacing: 0.08em;
  font-size: 0.875rem;
  background: var(--color-surface);
}

.social-list {
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  font-size: 1rem;
  color: var(--color-text);
  letter-spacing: 0.03em;
  line-height: 1.6;
  word-break: break-all;
}

.social-list__item {
  background: #f6f4f1;
  padding: 0.35rem 0.55rem;
}

.social-list__link {
  color: var(--color-cyan);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.social-list__link:hover {
  color: var(--color-pink);
}

.section.is-visible .section__heading-bar,
.section.is-visible .section__placeholder,
.section.is-visible .works-carousel,
.section.is-visible .archive-entry,
.section.is-visible .news-list, /* 近期新闻：列表滚入视野后的入场 */
.section.is-visible .news-more-wrap, /* 近期新闻：「更多」按钮稍晚入场 */
.section.is-visible .social-list {
  animation: rise-in 0.75s var(--ease-out) both;
}

.section.is-visible .section__heading-bar {
  animation-delay: 0.08s;
}

.section.is-visible .section__placeholder,
.section.is-visible .works-carousel,
.section.is-visible .archive-entry,
.section.is-visible .news-list, /* 近期新闻列表比标题条晚一点出现 */
.section.is-visible .social-list {
  animation-delay: 0.16s;
}

/* 近期新闻：「更多」比列表再晚一拍 */
.section.is-visible .news-more-wrap {
  animation-delay: 0.24s;
}

.section--works,
.section--archive,
.section--news, /* 近期新闻：高度随内容，不撑满一屏 */
.section--social {
  min-height: auto;
}

/* 社交媒体到页脚的空白，补成与版块之间相同的一段 */
.section--social {
  margin-bottom: clamp(2.5rem, 6vh, 4rem);
}

/* ---------- 官方作品轮播 ---------- */
.works-carousel {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.5rem;
}

.works-carousel__btn {
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--color-line);
  border-radius: 50%;
  color: var(--color-cyan-muted);
  font-size: 1.35rem;
  line-height: 1;
  display: grid;
  place-items: center;
  background: #f6f4f1;
  transition: color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), background 0.25s var(--ease-out);
  flex-shrink: 0;
}

.works-carousel__btn:hover {
  color: var(--color-pink);
  border-color: var(--color-pink-soft);
  background: #f6f4f1;
}

.works-carousel__viewport {
  overflow-x: auto;
  overflow-y: visible;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(168, 50, 88, 0.35) transparent;
  padding-block: 0.65rem;
  margin-block: -0.65rem;
  container-type: inline-size;
}

.works-carousel__viewport:focus-visible {
  outline: 1px solid var(--color-pink-soft);
  outline-offset: 4px;
}

.works-carousel__track {
  display: flex;
  align-items: flex-start;
  gap: clamp(1rem, 2.5vw, 1.5rem);
  padding: 0.75rem 0.5rem 0.85rem;
}

.works-card {
  flex: 0 0 100cqi;
  width: 100cqi;
  max-width: none;
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  scroll-snap-align: start;
  background: #f6f4f1;
  padding: 0.7rem 0.7rem 0.85rem;
}

.works-card__cover-link {
  display: block;
  border-radius: 0.35rem;
  overflow: hidden;
  border: 1px solid var(--color-line);
  transition: border-color 0.3s var(--ease-out), box-shadow 0.35s var(--ease-out);
}

.works-card__cover-link:hover {
  border-color: var(--color-pink-soft);
  box-shadow: 0 14px 28px rgba(26, 95, 107, 0.16);
  z-index: 2;
}

.works-card__cover {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  /* 图片随外框一起缩放，不做单独放大 */
  transform: none;
}

.works-card__title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  column-gap: 0.36rem;
  align-items: baseline;
  margin: 0.75rem 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 1000;
  letter-spacing: 0.06em;
  line-height: 1.4;
  color: var(--color-cyan);
}

.works-card__id {
  justify-self: start;
  padding: 0 0.32em;
  font-size: 75%;
  font-weight: inherit;
  letter-spacing: 0.06em;
  line-height: inherit;
  color: #a83258;
  background: #f6f4f1;
  border: 1px solid #a83258;
}

.works-card__name {
  min-width: 0;
  overflow-wrap: break-word;
}

.works-card__note {
  margin: 0;
  font-size: 1rem;
  color: var(--color-cyan-muted);
  letter-spacing: 0.03em;
  line-height: 1.5;
  text-align: center;
}

.works-card__note--1 {
  margin-top: 0.15rem;
}

.works-card__note--2 {
  margin-top: 0.1rem;
}

@media (max-width: 640px) {
  .works-carousel {
    grid-template-columns: 1fr;
  }

  .works-carousel__btn {
    display: none;
  }
}

/* ---------- 公式资料入口 ---------- */
.archive-entry {
  display: block;
  width: 100%;
  border: 1px solid var(--color-line);
  border-radius: 0.35rem;
  overflow: hidden;
  background: var(--color-surface);
  transition: transform 0.3s var(--ease-out), border-color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

.archive-entry:hover {
  transform: translateY(-3px);
  border-color: var(--color-pink-soft);
  box-shadow: 0 10px 28px rgba(26, 95, 107, 0.1);
}

.archive-entry__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* ---------- 近期新闻列表 ---------- */
/* 列表容器：首页和完整列表页共用，条目纵向排列 */
.news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--color-line);
  border-radius: 0.35rem;
  overflow: hidden;
  background: var(--color-surface);
}

/* 单条新闻，底部分隔线。首页近期新闻每条用纯白底 */
.news-item {
  border-bottom: 1px solid var(--color-line);
}

.section--news .news-item {
  background: #f6f4f1;
}

/* 最后一条去掉底线，避免和容器边框叠成双线 */
.news-item:last-child {
  border-bottom: 0;
}

/* 整行链接：左缩略图，右标题和日期 */
.news-item__link {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.85rem 1rem;
  transition: background 0.25s var(--ease-out);
}

/* 鼠标悬停时给整行一层淡底 */
.news-item__link:hover {
  background: rgba(168, 50, 88, 0.05);
}

/* 左侧缩略图，固定正方形并裁切 */
.news-item__thumb {
  width: 4.5rem;
  height: 4.5rem;
  object-fit: cover;
  border-radius: 0.25rem;
  border: 1px solid var(--color-line);
}

/* 右侧文字区：标题在上，日期在下 */
.news-item__body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

/* 标题最多两行，超出省略 */
.news-item__title {
  font-size: 0.9375rem;
  letter-spacing: 0.03em;
  line-height: 1.45;
  color: var(--color-cyan);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 标题下方的日期 */
.news-item__date {
  font-size: 0.75rem;
  color: var(--color-cyan-muted);
  letter-spacing: 0.04em;
}

/* 「更多」按钮的居中外层，只在首页使用 */
.news-more-wrap {
  margin-top: 1.25rem;
  text-align: center;
}

/* 「更多」按钮外观，打开完整新闻列表页 */
.news-more-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 6.5rem;
  padding: 0.6rem 1.5rem;
  border: 1px solid var(--color-pink-soft);
  color: var(--color-pink);
  letter-spacing: 0.12em;
  font-size: 0.875rem;
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out);
}

/* 「更多」按钮悬停 */
.news-more-btn:hover {
  background: rgba(168, 50, 88, 0.08);
  color: #8f2848;
}

/* ---------- 子页面（新闻列表页） ---------- */
.subpage .site-header {
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-line);
}

.subpage__main {
  min-width: 0;
  padding: calc(var(--nav-h) + 2rem) 0 3rem;
}

.subpage__inner {
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  margin: 0 auto;
}

.subpage__back {
  display: inline-block;
  margin-bottom: 1.25rem;
  font-size: 0.875rem;
  color: var(--color-cyan-muted);
  letter-spacing: 0.04em;
}

.subpage__back:hover {
  color: var(--color-pink);
}

/* 未开放页：图案在顶栏和页脚之间上下铺满，宽度随比例，窄屏超出的两侧裁掉 */
body.is-not-open,
body.is-not-open .page-shell {
  height: 100vh;
  overflow: hidden;
}

.not-open {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: var(--nav-h);
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
}

.not-open__img {
  height: 100%;
  width: auto;
  max-width: none;
  object-fit: cover;
  object-position: center center;
}

.subpage__title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, 2.25rem);
  font-weight: 600;
  letter-spacing: 0.12em;
  margin: 0 0 1.75rem;
  color: var(--color-cyan);
}

/* 近期新闻完整列表页：不限制列表高度，全部条目都排开 */
.news-list--full {
  max-height: none;
}

/* 近期新闻详情页：标题、日期、正文、插图。样式只由本文件决定 */
.news-article {
  min-width: 0;
  max-width: 100%;
}

.news-article__title,
.news-article__text {
  overflow-wrap: anywhere;
}

.news-article__title {
  font-family: "Noto Serif SC", "Songti SC", "STSong", serif;
  font-size: clamp(1.5rem, 3.2vw, 2rem);
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: 0.06em;
  text-align: left;
  color: #1a5f6b;
  background-color: rgba(26, 95, 107, 0.16);
  border: none;
  border-radius: 0;
  margin: 0 0 0.85rem;
  padding: 0.7rem 0.9rem;
}

.news-article__date {
  display: block;
  width: fit-content;
  margin: 0 auto 1.5rem;
  text-align: center;
  padding: 0.2rem 0.45rem;
  color: #4a8089;
  background-color: rgba(74, 128, 137, 0.16);
  border: none;
  border-radius: 0;
  letter-spacing: 0.04em;
}

.news-article__text {
  font-family: var(--font-body);
  color: var(--color-text);
  line-height: 1.9;
  font-size: 1rem;
}

.news-article__img {
  width: 100%;
  height: auto;
  margin: 1.25rem 0 0;
  border: 1px solid var(--color-line);
  border-radius: 0;
}

/* ---------- 页脚 ---------- */
.site-footer {
  margin-top: auto;
  padding: 2rem 0 2.5rem;
  border-top: none;
  background: var(--color-text);
}

.site-footer__inner {
  width: min(var(--reading), calc(100% - 2 * var(--page-pad)));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: #f6f4f1;
  letter-spacing: 0.04em;
}

.site-footer__copyright {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.site-footer__copy-text {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.site-footer__logo {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.site-footer__copyright p {
  margin: 0;
}

.site-footer a {
  color: #f6f4f1;
}

.site-footer a:hover {
  color: rgba(255, 255, 255, 0.75);
}

@media (max-width: 768px) {
  .site-footer__inner > a {
    flex: 1 0 100%;
    text-align: center;
  }
}

/* 手机上这一层不产生盒子，四个版块仍按原来的顺序上下排列 */
.section-board__pair {
  display: contents;
}

/* 宽于手机导航断点：电脑与 iPad 主视觉铺满页宽，四个版块排成田字 */
@media (min-width: 769px) {
  .hero__bg-picture {
    display: block;
    width: 100%;
  }

  .hero__bg-img {
    width: 100%;
    max-width: 100%;
    max-height: none;
    height: auto;
  }

  .section-board {
    display: flex;
    flex-direction: column;
    gap: clamp(2.5rem, 6vh, 4rem);
    padding: clamp(2.5rem, 6vh, 4rem) var(--page-pad);
  }

  /* 每一行各自对齐：标题行取两边较高的一条，内容行互不影响下一行 */
  .section-board__pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    column-gap: clamp(2.5rem, 6vh, 4rem);
    row-gap: 0;
    align-items: stretch;
  }

  .section-board__pair > .section {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 2;
    min-width: 0;
    margin: 0;
    padding: 0;
  }

  .section-board .section__heading-bar {
    margin: 0;
    align-self: stretch;
  }

  .section-board .section__heading-bar::before,
  .section-board .section__heading-bar::after,
  .section-board .section__heading-bar-inner,
  .section-board .section__inner {
    width: 100%;
  }

  .section-board .section__inner {
    margin-top: 0;
    align-self: stretch;
  }

  /* 近期新闻、社交媒体：标题锁高，内容区各自按内容增高 */
  .section-board .section--news .section__inner,
  .section-board .section--social .section__inner {
    align-self: start;
    height: auto;
  }

  /* 内容行取「公式资料图片」和「作品卡」里更高的一边，两边再拉成同一高度 */
  .section-board .section--archive .section__inner,
  .section-board .section--works .section__inner {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .section-board .section--works .section__inner {
    position: relative;
  }

  .section-board .section--archive .archive-entry {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
  }

  .section-board .section--archive .archive-entry__img {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    aspect-ratio: 16 / 9;
    object-fit: cover;
  }

  .section-board .section--works .works-carousel {
    position: absolute;
    left: 1.5rem;
    right: 1.5rem;
    top: calc(2.5rem + 1px);
    bottom: calc(1.5rem + 1px);
    min-height: 0;
    height: auto;
    align-items: stretch;
    grid-template-columns: minmax(0, 1fr);
    /* 左右让出按钮；上下贴齐公式资料图片边框内的画面 */
    margin: 0;
    padding: 0 3rem;
  }

  .section-board .section--works .works-carousel__btn {
    position: absolute;
    top: 50%;
    /* 轮播层在内容区内边距里，再上移半个内边距差，才落在整块内容区的正中 */
    transform: translateY(calc(-50% - 0.5rem));
    z-index: 2;
  }

  .section-board .section--works .works-carousel__btn--prev {
    left: 0.55rem;
  }

  .section-board .section--works .works-carousel__btn--next {
    right: 0.55rem;
  }

  .section-board .section--works .works-carousel__viewport {
    min-width: 0;
    min-height: 0;
    height: 100%;
    margin: 0;
    padding-block: 0;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    container-type: size;
  }

  .section-board .section--works .works-carousel__viewport::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .section-board .section--works .works-carousel__track {
    height: 100%;
    min-height: 0;
    align-items: stretch;
    padding: 0;
  }

  /* 卡片高度跟公式资料图片对齐；宽度由正方形封面决定，封面左右不再留白 */
  .section-board .section--works .works-card {
    flex: 0 0 auto;
    /* 高度等于视口（即公式资料图片高）；宽度等于正方形封面加左右内边距 */
    width: calc(100cqh - 11.12rem);
    max-width: none;
    min-width: 0;
    align-self: stretch;
    height: 100%;
    min-height: 0;
    justify-content: flex-start;
    overflow: hidden;
  }

  .section-board .section--works .works-card__cover-link {
    position: relative;
    flex: 1 1 auto;
    align-self: stretch;
    width: 100%;
    height: auto;
    min-width: 0;
    min-height: 0;
    aspect-ratio: auto;
    display: block;
    overflow: hidden;
  }

  .section-board .section--works .works-card__cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    aspect-ratio: auto;
    object-fit: cover;
  }

  .section-board .section--works .works-card__title,
  .section-board .section--works .works-card__note {
    flex: 0 0 auto;
    width: 0;
    min-width: 100%;
    max-width: 100%;
    overflow: hidden;
    overflow-wrap: break-word;
    white-space: normal;
  }

  .section-board .section--works .works-card__title {
    height: calc(1.2rem * 1.4 * 4);
  }

  .section-board .section--works .works-card__note {
    height: calc(1rem * 1.5 * 2);
  }

  .section-board .section--works .works-card__note:empty {
    display: none;
    margin: 0;
  }
}

/* 窗口窄到标题（含编号缩进）或描述放不下时先隐藏，封面按卡片高度铺满 */
@media (min-width: 769px) and (max-width: 1859px) {
  .section-board .section--works .works-card {
    width: calc(100cqh - 0.15rem);
  }

  .section-board .section--works .works-card__title,
  .section-board .section--works .works-card__note {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .hero__center-logo,
  .hero__tagline,
  .section.is-visible .section__heading-bar,
  .section.is-visible .section__placeholder,
  .section.is-visible .works-carousel,
  .section.is-visible .archive-entry,
  .section.is-visible .news-list, /* 近期新闻：系统要求减少动效时，列表不再入场 */
  .section.is-visible .news-more-wrap, /* 近期新闻：「更多」同样取消入场 */
  .section.is-visible .social-list {
    animation: none;
    opacity: 1;
    transform: none;
  }

  .home-ticker__stripes,
  .home-ticker__track {
    animation: none;
  }
}
