/* ==========================================================================
   /assets/site.css — 365平台站 共享外壳与通用组件
   ========================================================================== */

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

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

body { margin: 0; }

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

button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

a { color: inherit; }

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

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

:where(h1, h2, h3, h4) { line-height: 1.15; }

[id] { scroll-margin-top: 96px; }

/* ---------- 2. 变量 ---------- */
:root {
  --deep: #052A3B;
  --aurora: #1FE0C0;
  --aurora-ink: #0B7D6C;
  --orange: #FF7A3D;
  --sand: #E7C27A;
  --ink: #07141D;
  --mist: #F3F8F7;
  --rock: #5E6E75;
  --volt: #2D9CFF;
  --meadow: #7BAA8B;
  --paper: #F7EEDC;

  --font-sans: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei",
    system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-serif: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "Source Han Serif CN",
    Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", "SF Mono", ui-monospace, SFMono-Regular, Menlo, Consolas,
    "Liberation Mono", monospace;

  --border-thick: 3px;
  --shadow-hard: 7px 7px 0 rgba(7, 20, 29, 0.14);
  --shadow-hard-lg: 11px 11px 0 rgba(7, 20, 29, 0.2);
  --maxw: 1320px;
  --pad-x: clamp(16px, 3vw, 32px);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-sans);
  font-size: clamp(16px, 0.45vw + 15px, 17px);
  line-height: 1.75;
  color: var(--ink);
  background: var(--mist);
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3 { letter-spacing: -0.015em; }

::selection { background: var(--aurora); color: var(--ink); }

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

.skip-link {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--aurora);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  transform: translateY(-220%);
  transition: transform 0.2s var(--ease);
}

.skip-link:focus { transform: translateY(0); }

/* ---------- 4. 页头：框架式边线导航 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--deep);
  color: var(--mist);
  border-bottom: var(--border-thick) solid var(--aurora);
  transition: box-shadow 0.25s var(--ease);
}

.site-header::before {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--aurora) 0 16%,
    var(--sand) 16% 23%,
    var(--orange) 23% 30%,
    rgba(31, 224, 192, 0.22) 30% 100%
  );
}

.site-header.is-stuck {
  box-shadow: 0 10px 0 rgba(7, 20, 29, 0.22), 0 18px 34px rgba(7, 20, 29, 0.28);
}

.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -3px;
  height: 3px;
  width: 0;
  z-index: 2;
  background: linear-gradient(90deg, var(--aurora), var(--sand) 55%, var(--orange));
  pointer-events: none;
}

.frame-bar {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: clamp(12px, 2vw, 28px);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--mist);
  padding-block: 8px;
}

.brand-mark {
  position: relative;
  display: block;
  width: 36px;
  height: 36px;
  border: 2px solid var(--aurora);
  border-radius: 50%;
  flex: 0 0 auto;
  transition: border-color 0.2s var(--ease);
}

.brand-mark::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px dashed rgba(31, 224, 192, 0.55);
  border-radius: 50%;
}

.brand-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--orange);
  transform: translate(-50%, -50%);
}

.brand:hover .brand-mark { border-color: var(--sand); }

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

.brand-name {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.16rem;
  letter-spacing: -0.01em;
  color: var(--mist);
}

.brand-sub {
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(31, 224, 192, 0.78);
  margin-top: 3px;
  white-space: nowrap;
}

/* 导航 */
.site-nav { margin-left: auto; }

.nav-list { display: flex; align-items: stretch; gap: 2px; }

.nav-list a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 13px;
  font-size: 0.94rem;
  font-weight: 500;
  text-decoration: none;
  color: rgba(243, 248, 247, 0.86);
  border-bottom: 2px solid transparent;
  transition: color 0.16s var(--ease), background-color 0.16s var(--ease),
    border-color 0.16s var(--ease);
}

.nav-idx {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: rgba(31, 224, 192, 0.62);
  transition: color 0.16s var(--ease);
}

.nav-list a:hover {
  color: var(--aurora);
  background: rgba(31, 224, 192, 0.1);
}

.nav-list a:hover .nav-idx { color: var(--sand); }

.nav-list a[aria-current="page"] {
  color: var(--aurora);
  background: rgba(31, 224, 192, 0.12);
  border-bottom-color: var(--aurora);
}

.nav-list a[aria-current="page"] .nav-idx { color: var(--sand); }

/* 移动菜单按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  margin-left: auto;
  padding: 10px 14px;
  border: 2px solid rgba(243, 248, 247, 0.42);
  color: var(--mist);
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.nav-toggle:hover { border-color: var(--aurora); color: var(--aurora); }

.nav-toggle-bars {
  position: relative;
  display: block;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: background-color 0.18s var(--ease);
}

.nav-toggle-bars::before,
.nav-toggle-bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 20px;
  height: 2px;
  background: currentColor;
  transition: transform 0.22s var(--ease);
}

.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }

.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- 5. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(56px, 9vw, 120px);
  background: var(--ink);
  color: rgba(243, 248, 247, 0.76);
  border-top: var(--border-thick) solid var(--aurora);
  font-size: 0.94rem;
}

.site-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 6px;
  background: repeating-linear-gradient(
    90deg,
    var(--aurora) 0 30px,
    transparent 30px 60px
  );
  opacity: 0.32;
  pointer-events: none;
}

.footer-inner {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: clamp(38px, 6vw, 74px) var(--pad-x) clamp(28px, 4vw, 44px);
  display: grid;
  grid-template-columns: minmax(240px, 1.4fr) minmax(240px, 1fr) minmax(220px, 1fr);
  gap: clamp(26px, 4vw, 56px);
  align-items: start;
}

.footer-brand { min-width: 0; }

.footer-wordmark {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.65rem, 3vw, 2.35rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--mist);
}

.footer-mono {
  margin-top: 12px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sand);
}

.footer-desc {
  margin-top: 16px;
  max-width: 34ch;
  color: rgba(243, 248, 247, 0.66);
  font-size: 0.92rem;
}

.footer-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.footer-col { min-width: 0; }

.footer-heading {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--aurora);
}

.footer-list li + li { margin-top: 9px; }

.footer-list a {
  display: inline-block;
  text-decoration: none;
  color: rgba(243, 248, 247, 0.82);
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--aurora);
  border-bottom-color: var(--aurora);
}

.footer-meta { min-width: 0; }

.footer-contact {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px 14px;
  font-size: 0.9rem;
}

.footer-contact dt {
  padding-top: 0.35em;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: var(--sand);
}

.footer-contact dd {
  color: rgba(243, 248, 247, 0.86);
  overflow-wrap: anywhere;
}

.footer-base {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding: 18px var(--pad-x) 30px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  border-top: 1px solid rgba(243, 248, 247, 0.14);
  font-size: 0.8rem;
  color: rgba(243, 248, 247, 0.58);
}

.footer-legal {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: rgba(231, 194, 122, 0.92);
}

.footer-copy { margin-right: auto; min-width: 0; }

.back-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  padding: 9px 16px;
  border: 2px solid var(--aurora);
  color: var(--aurora);
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s var(--ease), visibility 0.22s var(--ease),
    background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.back-top.is-visible { opacity: 1; visibility: visible; }

.back-top:hover,
.back-top:focus-visible {
  background: var(--aurora);
  color: var(--ink);
}

/* ---------- 6. 通用布局与组件 ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--pad-x);
}

.section { padding-block: clamp(40px, 6vw, 88px); }

.prose {
  max-width: 68ch;
  line-height: 1.78;
}

.prose p + p { margin-top: 1em; }

.prose a {
  color: var(--deep);
  text-decoration: none;
  border-bottom: 2px solid var(--aurora);
}

.prose a:hover { border-bottom-color: var(--orange); }

.mono {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--rock);
}

.serif {
  font-family: var(--font-serif);
  font-weight: 700;
  letter-spacing: -0.015em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rock);
}

/* 横向主题带 */
.band {
  position: relative;
  padding: clamp(18px, 3vw, 30px) 0;
  background: var(--ink);
  color: var(--mist);
  border-top: var(--border-thick) solid var(--aurora);
  border-bottom: var(--border-thick) solid var(--aurora);
}

.band__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: clamp(10px, 2vw, 26px);
}

.band__idx {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.2em;
  color: var(--sand);
}

.band__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(1.3rem, 2.6vw, 2rem);
  letter-spacing: -0.02em;
}

.band__lead {
  margin-left: auto;
  max-width: 46ch;
  font-size: 0.94rem;
  color: rgba(243, 248, 247, 0.72);
}

.band--aurora {
  background: var(--aurora);
  color: var(--ink);
  border-color: var(--ink);
}
.band--aurora .band__idx { color: var(--deep); }
.band--aurora .band__lead { color: rgba(7, 20, 29, 0.72); }

.band--orange {
  background: var(--orange);
  color: var(--ink);
  border-color: var(--ink);
}
.band--orange .band__idx { color: var(--deep); }
.band--orange .band__lead { color: rgba(7, 20, 29, 0.74); }

.band--sand {
  background: var(--sand);
  color: var(--ink);
  border-color: var(--ink);
}
.band--sand .band__idx { color: var(--deep); }
.band--sand .band__lead { color: rgba(7, 20, 29, 0.72); }

.band--deep {
  background: var(--deep);
  border-color: var(--sand);
}
.band--deep .band__idx { color: var(--aurora); }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 13px 24px;
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--ink);
  background: var(--orange);
  border: var(--border-thick) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  transition: transform 0.16s var(--ease), box-shadow 0.16s var(--ease),
    background-color 0.16s var(--ease);
}

.btn:hover { transform: translate(-2px, -2px); box-shadow: 8px 8px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }

.btn--aurora { background: var(--aurora); }

.btn--ghost {
  background: transparent;
  color: var(--mist);
  border-color: var(--mist);
  box-shadow: 5px 5px 0 rgba(243, 248, 247, 0.3);
}

.btn--ghost:hover { box-shadow: 8px 8px 0 rgba(243, 248, 247, 0.34); }

/* 面包屑 */
.breadcrumb {
  padding-block: 16px;
  font-size: 0.82rem;
  color: var(--rock);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }

.breadcrumb li + li::before {
  content: "/";
  font-family: var(--font-mono);
  color: var(--sand);
}

.breadcrumb a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.16s var(--ease), border-color 0.16s var(--ease);
}

.breadcrumb a:hover { color: var(--deep); border-bottom-color: var(--aurora); }

/* 网格 */
.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 28px);
  grid-template-columns: minmax(0, 1fr);
}

.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 章节卡 */
.card {
  position: relative;
  min-width: 0;
  padding: clamp(18px, 2.4vw, 28px);
  background: var(--mist);
  border: var(--border-thick) solid var(--ink);
  box-shadow: var(--shadow-hard);
  transition: box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
}

.card:hover { border-color: var(--aurora); box-shadow: var(--shadow-hard-lg); }

.card__idx {
  display: block;
  margin-bottom: 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  color: var(--orange);
}

.card__title {
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: 1.24rem;
  letter-spacing: -0.01em;
  margin-bottom: 10px;
}

.card__text { font-size: 0.94rem; color: var(--rock); }

/* 标签 */
.tag {
  display: inline-block;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  line-height: 1.5;
  border: 2px solid currentColor;
  white-space: nowrap;
}

.tag--aurora { color: var(--aurora-ink); }
.tag--orange { color: #B53E12; }
.tag--sand { color: #8A6A1F; }
.tag--stone { color: var(--rock); }

/* 图片容器（页面阶段放入 <img>） */
.media {
  position: relative;
  overflow: hidden;
  background: var(--deep);
  border: var(--border-thick) solid var(--ink);
  box-shadow: 8px 8px 0 rgba(7, 20, 29, 0.16);
}

.media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(90deg, rgba(31, 224, 192, 0.12) 1px, transparent 1px),
    linear-gradient(0deg, rgba(31, 224, 192, 0.12) 1px, transparent 1px);
  background-size: 48px 48px;
  mix-blend-mode: screen;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3 { aspect-ratio: 4 / 3; }
.media--1x1 { aspect-ratio: 1 / 1; }
.media--tall { aspect-ratio: 3 / 4; }

.media__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 1;
  padding: 7px 12px;
  background: var(--ink);
  color: var(--aurora);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
}

/* 显现动画 */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

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

/* ---------- 7. 响应式 ---------- */
@media (max-width: 1080px) {
  .nav-idx { display: none; }
  .nav-list a { padding: 12px 11px; }
}

@media (max-width: 940px) {
  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    margin-left: 0;
    padding: 12px var(--pad-x) 20px;
    background: var(--ink);
    border-bottom: var(--border-thick) solid var(--aurora);
    box-shadow: 0 16px 30px rgba(7, 20, 29, 0.4);
    max-height: calc(100vh - 90px);
    overflow-y: auto;
  }

  .site-nav[data-open] { display: block; }

  .nav-list { flex-direction: column; gap: 0; }

  .nav-list li + li { border-top: 1px solid rgba(243, 248, 247, 0.12); }

  .nav-list a {
    gap: 12px;
    padding: 15px 6px;
    border-bottom: 0;
    border-left: 3px solid transparent;
    font-size: 1rem;
  }

  .nav-idx { display: inline; font-size: 0.7rem; }

  .nav-list a[aria-current="page"] {
    border-left-color: var(--aurora);
    border-bottom-color: transparent;
    background: rgba(31, 224, 192, 0.1);
  }

  .nav-toggle { display: inline-flex; }

  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
  .footer-meta { grid-column: 1 / -1; }
}

@media (max-width: 820px) {
  .grid--2,
  .grid--3 { grid-template-columns: minmax(0, 1fr); }
  .band__lead { margin-left: 0; max-width: none; }
}

@media (max-width: 620px) {
  .frame-bar { min-height: 68px; }
  .brand-sub { font-size: 0.56rem; letter-spacing: 0.1em; }
  .brand-name { font-size: 1.05rem; }
  .brand-mark { width: 30px; height: 30px; }

  .footer-inner { grid-template-columns: minmax(0, 1fr); }
  .footer-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-base { flex-direction: column; align-items: flex-start; }
  .footer-copy { margin-right: 0; }
  .back-top { margin-left: 0; }
}

/* ---------- 8. 减少动态偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

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

  .btn:hover,
  .btn:active {
    transform: none;
  }
}
