/* ============================================================
   四季娱乐站 · /assets/site.css
   共享层：reset / 变量 / 中文排版 / 页头 / 页脚 / 基础组件
   ============================================================ */

/* ---------- 1. reset ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
}

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

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

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

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

a {
  color: inherit;
}

/* ---------- 2. 变量 ---------- */
:root {
  /* 色彩：四季骨架 */
  --mist: #FBF9F5;
  --gravel: #EAE3D7;
  --blueprint: #A9BCCB;
  --blueprint-soft: rgba(169, 188, 203, 0.42);
  --ink: #1B2A33;
  --ink-soft: #46585F;
  --spring: #4E8C7A;
  --summer: #D9A14A;
  --autumn: #B4623A;
  --winter: #2F4B72;
  --poplar: #F2C14E;
  --night: #101B2B;

  --season-line: linear-gradient(90deg,
    var(--spring) 0 25%,
    var(--summer) 25% 50%,
    var(--autumn) 50% 75%,
    var(--winter) 75% 100%);

  /* 字体 */
  --font-display: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "SimSun", Georgia, "Times New Roman", serif;
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", "Cascadia Mono", Consolas, "Liberation Mono", monospace;

  /* 尺度 */
  --page-max: 1240px;
  --read-max: 760px;
  --gutter: clamp(18px, 4.6vw, 64px);
  --radius-xl: 34px;
  --radius-lg: 26px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --rule: 1px solid var(--blueprint-soft);
  --shadow-soft: 0 20px 44px -30px rgba(27, 42, 51, 0.42);
}

/* ---------- 3. 中文排版与基础排版 ---------- */
body {
  background: var(--mist);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.82;
  letter-spacing: 0.018em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: 0.012em;
}

h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); }
h2 { font-size: clamp(1.875rem, 3.8vw, 3rem); }
h3 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h4 { font-size: clamp(1.125rem, 1.6vw, 1.25rem); }

p { margin: 0 0 1.1em; }
p:last-child { margin-bottom: 0; }

strong { font-weight: 700; }

.mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
}

.eyebrow {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.22em;
  color: var(--winter);
  text-transform: uppercase;
}

.lead {
  font-size: clamp(1.0625rem, 1.5vw, 1.25rem);
  line-height: 1.78;
  color: var(--ink-soft);
  max-width: 62ch;
}

.text-link {
  color: var(--winter);
  text-decoration: none;
  border-bottom: 1px solid var(--blueprint);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.text-link:hover { color: var(--autumn); border-color: var(--autumn); }

:focus-visible {
  outline: 2px solid var(--winter);
  outline-offset: 3px;
  border-radius: 8px;
}

.skip-link {
  position: absolute;
  left: 50%;
  top: -70px;
  transform: translateX(-50%);
  z-index: 300;
  padding: 11px 24px;
  background: var(--night);
  color: #fff;
  font-size: 14px;
  letter-spacing: 0.06em;
  text-decoration: none;
  border-radius: 0 0 16px 16px;
  transition: top 0.22s ease;
}
.skip-link:focus { top: 0; }

/* ---------- 4. 布局容器与网格 ---------- */
.container {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container--narrow { max-width: var(--read-max); }

.grid {
  display: grid;
  gap: clamp(18px, 2.4vw, 32px);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* 蓝图网格底纹（章节开头、页脚显影） */
.blueprint-grid {
  background-image:
    linear-gradient(rgba(169, 188, 203, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 188, 203, 0.26) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

.section-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.2em;
  color: var(--winter);
  margin-bottom: 22px;
}
.section-mark::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: repeating-linear-gradient(90deg,
    var(--blueprint) 0 7px, transparent 7px 14px);
}

/* ---------- 5. 通用按钮与胶囊 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 26px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease,
    border-color 0.2s ease, color 0.2s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--poplar);
  color: var(--ink);
  border-color: var(--poplar);
}
.btn--primary:hover { background: #F7CD66; }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--blueprint);
}
.btn--ghost:hover { border-color: var(--winter); color: var(--winter); }

.pill-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--blueprint-soft);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  letter-spacing: 0.06em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.pill:hover { border-color: var(--blueprint); color: var(--ink); }

.pill--spring { color: #2E6355; border-color: rgba(78, 140, 122, 0.42); background: rgba(78, 140, 122, 0.1); }
.pill--summer { color: #8A6116; border-color: rgba(217, 161, 74, 0.48); background: rgba(217, 161, 74, 0.14); }
.pill--autumn { color: #8A4325; border-color: rgba(180, 98, 58, 0.42); background: rgba(180, 98, 58, 0.12); }
.pill--winter { color: #24405F; border-color: rgba(47, 75, 114, 0.4); background: rgba(47, 75, 114, 0.1); }

.pill[aria-pressed="true"],
.pill.is-active {
  background: var(--ink);
  color: var(--mist);
  border-color: var(--ink);
}

/* ---------- 6. 卡片 / 面包屑 / 媒体容器 ---------- */
.card {
  background: #fff;
  border: 1px solid var(--blueprint-soft);
  border-radius: var(--radius-lg);
  padding: clamp(20px, 2.6vw, 34px);
}

.card--gravel {
  background: var(--gravel);
  border-color: transparent;
}

.card--outline {
  background: transparent;
  border-color: var(--blueprint);
}

.breadcrumb {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  margin-bottom: 22px;
}
.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}
.breadcrumb li + li::before {
  content: "/";
  margin-right: 10px;
  color: var(--blueprint);
}
.breadcrumb a {
  color: var(--winter);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.breadcrumb a:hover { border-color: var(--winter); }
.breadcrumb [aria-current="page"] { color: var(--ink); }

/* 图片容器基础规则：页面阶段只需放入 <img> */
.media {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--gravel);
}
.media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media--banner { aspect-ratio: 21 / 8; border-radius: var(--radius-xl); }
.media--wide { aspect-ratio: 21 / 9; }
.media--square { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 4 / 5; }

.media-tag {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: rgba(16, 27, 43, 0.72);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
}

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
}

/* ---------- 7. 显现动画 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-reveal].is-visible {
  opacity: 1;
  transform: none;
}

/* ---------- 8. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(251, 249, 245, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  box-shadow: 0 1px 0 var(--blueprint-soft);
}

.header-shell {
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: clamp(15px, 2.3vw, 26px) var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 18px;
  transition: padding 0.3s ease;
}

.masthead { justify-self: center; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--ink);
}

.brand-glyph {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: linear-gradient(140deg,
    var(--spring) 0%, var(--summer) 38%, var(--autumn) 68%, var(--winter) 100%);
  box-shadow: 0 10px 20px -12px rgba(47, 75, 114, 0.75);
  transition: width 0.25s ease, height 0.25s ease, border-radius 0.25s ease, font-size 0.25s ease;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.16;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  letter-spacing: 0.07em;
  transition: font-size 0.25s ease;
}

.brand-version {
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--winter);
  opacity: 0.74;
}

.masthead-nav { min-width: 0; }
.masthead-nav--left { justify-self: start; }
.masthead-nav--right { justify-self: end; }

.nav-list {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2vw, 28px);
}

.nav-link {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-size: 15px;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--poplar);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease, background 0.3s ease;
}
.nav-link:hover { color: var(--ink); }
.nav-link:hover::after { transform: scaleX(1); }

.nav-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
}
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--season-line);
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  justify-self: end;
  padding: 9px 16px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--blueprint-soft);
  background: transparent;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease;
}
.nav-toggle:hover { border-color: var(--blueprint); background: rgba(169, 188, 203, 0.12); }

.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 3px;
}
.nav-toggle-bars span {
  display: block;
  width: 15px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.25s ease, opacity 0.25s ease;
}
.site-header[data-open] .nav-toggle-bars span:nth-child(1) { transform: translateY(4.5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars span:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle-bars span:nth-child(3) { transform: translateY(-4.5px) rotate(-45deg); }

/* 四季渐变细线 + 阅读进度 */
.season-rule {
  position: relative;
  height: 3px;
  background: var(--season-line);
  opacity: 0.92;
}
.season-rule-fill {
  position: absolute;
  inset: 0;
  background: var(--night);
  opacity: 0.42;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.14s linear;
}

/* 移动抽屉 */
.header-drawer {
  display: none;
  background: var(--mist);
  border-top: 1px solid var(--blueprint-soft);
}
.site-header[data-open] .header-drawer { display: block; }

.drawer-nav {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 6px var(--gutter) 24px;
}

.drawer-list li + li { border-top: 1px dashed rgba(169, 188, 203, 0.55); }

.drawer-list .nav-link {
  display: block;
  padding: 14px 2px;
  font-size: 17px;
  white-space: normal;
}
.drawer-list .nav-link::after { display: none; }
.drawer-list .nav-link:hover { color: var(--winter); }
.drawer-list .nav-link[aria-current="page"] { color: var(--winter); }

/* 收拢态 */
.site-header.is-compact .header-shell { padding-top: 8px; padding-bottom: 8px; }
.site-header.is-compact .brand-glyph {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  font-size: 10px;
}
.site-header.is-compact .brand-name { font-size: 1.02rem; }
.site-header.is-compact .brand-version { display: none; }

/* ---------- 9. 页脚 ---------- */
.site-footer {
  margin-top: clamp(48px, 7vw, 100px);
  color: #D8E3EC;
  background-color: var(--winter);
  background-image:
    linear-gradient(rgba(169, 188, 203, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 188, 203, 0.1) 1px, transparent 1px);
  background-size: 56px 56px, 56px 56px;
  background-position: -1px -1px, -1px -1px;
  padding-top: clamp(46px, 6vw, 86px);
}

.footer-inner {
  max-width: var(--page-max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 56px);
}

.footer-title {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--poplar);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(169, 188, 203, 0.26);
}

.footer-list {
  display: grid;
  gap: 11px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #CBD9E4;
  font-size: 14.5px;
  letter-spacing: 0.04em;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.2s ease;
}
.footer-link:hover { color: #fff; transform: translateX(3px); }

.season-dot {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(251, 249, 245, 0.07);
}
.season-dot--spring { background: var(--spring); }
.season-dot--summer { background: var(--summer); }
.season-dot--autumn { background: var(--autumn); }
.season-dot--winter { background: #7FA3CC; }

.footer-meta-list {
  display: grid;
  gap: 14px;
}
.footer-meta-item dt {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: rgba(169, 188, 203, 0.92);
}
.footer-meta-item dd {
  margin-top: 5px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #E6EEF5;
  word-break: break-all;
}

.copy-chip {
  padding: 3px 11px;
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--poplar);
  color: var(--night);
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  cursor: pointer;
  transition: filter 0.2s ease, background-color 0.2s ease;
}
.copy-chip:hover { filter: brightness(1.07); }
.copy-chip.is-copied { background: #fff; }

.footer-bottom {
  margin-top: clamp(34px, 5vw, 66px);
  background: var(--night);
  border-top: 1px solid rgba(169, 188, 203, 0.2);
}

.footer-bottom-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 28px;
  padding-top: 20px;
  padding-bottom: 20px;
}

.footer-bottom-text {
  margin: 0;
  font-size: 12.5px;
  color: rgba(203, 218, 229, 0.78);
  max-width: 72ch;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.legal-links a {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: #CBD9E4;
  text-decoration: none;
  transition: color 0.2s ease;
}
.legal-links a:hover { color: var(--poplar); }

/* ---------- 10. 返回顶部（由共享 JS 注入） ---------- */
.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 30px);
  bottom: clamp(14px, 3vw, 30px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 18px 11px 15px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--blueprint-soft);
  background: rgba(251, 249, 245, 0.95);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  cursor: pointer;
  box-shadow: var(--shadow-soft);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.28s ease, transform 0.28s ease, visibility 0.28s ease;
}
.to-top.is-shown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.to-top-arrow {
  width: 8px;
  height: 8px;
  border-left: 1.5px solid currentColor;
  border-top: 1.5px solid currentColor;
  transform: rotate(45deg) translate(1px, 1px);
}

/* ---------- 11. 响应式 ---------- */
@media (max-width: 1024px) {
  .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  .header-shell { grid-template-columns: 1fr auto 1fr; }
  .masthead-nav { display: none; }
  .nav-toggle { display: inline-flex; }
  .masthead { grid-column: 2; }
  .nav-toggle { grid-column: 3; }
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 32px 28px;
  }
}

@media (min-width: 901px) {
  .header-drawer { display: none !important; }
}

@media (max-width: 640px) {
  body { font-size: 16px; line-height: 1.78; }
  .grid--2,
  .grid--3,
  .grid--4 { grid-template-columns: minmax(0, 1fr); }
  .header-shell { gap: 10px; }
  .brand-glyph { width: 40px; height: 40px; border-radius: 13px; font-size: 12px; }
  .brand-version { font-size: 10px; letter-spacing: 0.1em; }
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-bottom-inner { flex-direction: column; align-items: flex-start; }
  .media--banner { aspect-ratio: 4 / 3; }
}

/* ---------- 12. 降低动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  [data-reveal] { opacity: 1 !important; transform: none !important; }
  .nav-link:hover,
  .footer-link:hover,
  .btn:hover { transform: none; }
}
