/* ============================================================
   AYX主页 · 共享样式 /assets/site.css
   墨海底盘 + 暖纸阅读层 + 青橙版本状态 + 等高线秩序纹理
   ============================================================ */

/* ---------- 1. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, p, ul, ol, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

/* ---------- 2. 设计变量 ---------- */
:root {
  --ink: #0B1622;
  --ink-2: #122536;
  --paper: #F2EBDD;
  --white: #FBF7EF;
  --cyan: #4FF0D0;
  --orange: #FF8A3D;
  --steel: #8FA3B3;
  --graphite: #1A232B;
  --contour: #2C4A5A;
  --alert: #FF5D5D;
  --teal-ink: #0E7F72;

  --font-title: "Archivo Narrow", "Oswald", "Noto Sans SC", "Source Han Sans SC", sans-serif;
  --font-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, monospace;

  --max: 1240px;
  --gutter: clamp(18px, 4vw, 32px);
  --line: rgba(143, 163, 179, 0.22);
  --line-soft: rgba(143, 163, 179, 0.12);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --z-header: 50;
}

/* ---------- 3. 基础排版 ---------- */
body {
  background: var(--ink);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.72;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-title);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 0.5em;
}
h1 { font-size: clamp(34px, 5.4vw, 64px); }
h2 { font-size: clamp(24px, 3.4vw, 38px); }
h3 { font-size: clamp(18px, 2.2vw, 23px); }
h4 { font-size: clamp(16px, 1.8vw, 18px); }

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

strong { font-weight: 700; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(11, 22, 34, 0.6);
}

.on-paper :focus-visible,
.on-white :focus-visible {
  outline-color: var(--teal-ink);
  box-shadow: 0 0 0 5px rgba(242, 235, 221, 0.7);
}

/* ---------- 4. 跳转链接 ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  transform: translateY(-180%);
  background: var(--cyan);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 11px 18px;
  text-decoration: none;
  border-radius: 2px;
  transition: transform 0.2s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 5. 布局工具 ---------- */
.container {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(36px, 5.5vw, 80px); }
.section-tight { padding-block: clamp(24px, 3.5vw, 48px); }

.grid { display: grid; gap: clamp(14px, 2vw, 22px); }
.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)); }

/* ---------- 6. 文字层 ---------- */
.on-paper { background: var(--paper); color: var(--graphite); }
.on-white { background: var(--white); color: var(--graphite); }

.eyebrow {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--cyan);
  margin-bottom: 16px;
}
.eyebrow::before {
  content: "";
  display: block;
  width: 26px;
  height: 1px;
  background: currentColor;
  flex: none;
}
.on-paper .eyebrow,
.on-white .eyebrow { color: var(--teal-ink); }

.meta-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--steel);
}
.on-paper .meta-mono,
.on-white .meta-mono { color: rgba(26, 35, 43, 0.62); }

.prose { max-width: 72ch; }
.prose p { font-size: 1.0625rem; line-height: 1.85; }
.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.3em; }
.prose ul, .prose ol {
  display: flex;
  flex-direction: column;
  gap: 0.5em;
  padding-left: 1.3em;
  margin-bottom: 1.2em;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose ul li::marker { color: var(--teal-ink); }
.prose a { color: var(--teal-ink); text-underline-offset: 3px; }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  background: transparent;
  color: var(--white);
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
              border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-primary {
  background: var(--cyan);
  border-color: var(--cyan);
  color: var(--ink);
}
.btn-primary:hover {
  background: transparent;
  color: var(--cyan);
}

.btn-ghost {
  border-color: var(--line);
  color: var(--white);
}
.btn-ghost:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.btn-sm { padding: 8px 13px; font-size: 11.5px; }

.on-paper .btn-primary,
.on-white .btn-primary { background: var(--teal-ink); border-color: var(--teal-ink); color: var(--white); }
.on-paper .btn-primary:hover,
.on-white .btn-primary:hover { background: transparent; color: var(--teal-ink); }

/* ---------- 8. 标签 ---------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 2px;
  white-space: nowrap;
}
.tag-new { color: var(--cyan); border-color: rgba(79, 240, 208, 0.5); background: rgba(79, 240, 208, 0.08); }
.tag-old { color: var(--orange); border-color: rgba(255, 138, 61, 0.5); background: rgba(255, 138, 61, 0.08); }
.tag-warn { color: var(--alert); border-color: rgba(255, 93, 93, 0.5); background: rgba(255, 93, 93, 0.08); }
.tag-mute { color: var(--steel); border-color: var(--line); background: transparent; }

.on-paper .tag-new, .on-white .tag-new { color: var(--teal-ink); border-color: rgba(14, 127, 114, 0.45); background: rgba(14, 127, 114, 0.07); }
.on-paper .tag-old, .on-white .tag-old { color: #B4551A; border-color: rgba(180, 85, 26, 0.45); background: rgba(180, 85, 26, 0.07); }
.on-paper .tag-mute, .on-white .tag-mute { color: rgba(26, 35, 43, 0.6); border-color: rgba(26, 35, 43, 0.22); }

/* ---------- 9. 图片容器 ---------- */
.figure { margin: 0; display: flex; flex-direction: column; gap: 9px; }
.figure-media {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--contour);
  border-radius: 2px;
  background-color: var(--ink-2);
  background-image:
    repeating-linear-gradient(0deg, rgba(44, 74, 90, 0.55) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(44, 74, 90, 0.55) 0 1px, transparent 1px 32px);
}
.figure-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.figure-media::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 0 1px rgba(79, 240, 208, 0.14);
  pointer-events: none;
}
.figure-cap {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  line-height: 1.6;
  color: var(--steel);
}
.on-paper .figure-cap,
.on-white .figure-cap { color: rgba(26, 35, 43, 0.62); }

/* ---------- 10. 顶部外壳 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(11, 22, 34, 0.94);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
  backdrop-filter: blur(12px) saturate(1.2);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.24s var(--ease), box-shadow 0.24s var(--ease);
}

.header-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  background: var(--cyan);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.1s linear;
  pointer-events: none;
}

.masthead-inner {
  max-width: var(--max);
  margin-inline: auto;
  padding: 12px var(--gutter) 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 元信息行 */
.masthead-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 26px;
}
.masthead-kicker {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--steel);
}
.kicker-num { color: var(--cyan); }
.kicker-sep {
  display: block;
  width: 24px;
  height: 1px;
  background: var(--contour);
  flex: none;
}
.kicker-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.masthead-cta { flex: none; }

/* 刊头品牌 */
.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.3em;
  padding-bottom: 12px;
  text-decoration: none;
  color: var(--white);
  font-family: var(--font-title);
  font-size: clamp(26px, 4.6vw, 46px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  transition: font-size 0.24s var(--ease), padding 0.24s var(--ease);
}
.brand-name { white-space: nowrap; }
.brand-slash { color: var(--orange); font-weight: 400; opacity: 0.9; }
.brand-sub {
  font-size: 0.38em;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--steel);
  white-space: nowrap;
}
.brand-edition {
  font-family: var(--font-mono);
  font-size: 0.34em;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  color: var(--ink);
  background: var(--cyan);
  padding: 0.42em 0.5em;
  align-self: center;
}

/* 导航 */
.nav-row {
  display: flex;
  justify-content: center;
  align-items: center;
  border-top: 1px solid var(--line-soft);
}
.nav-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 4px;
}
.nav-list a {
  display: block;
  padding: 10px 14px;
  color: var(--steel);
  text-decoration: none;
  font-size: 13.5px;
  letter-spacing: 0.1em;
  border-bottom: 2px solid transparent;
  border-left: 2px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.nav-list a:hover { color: var(--white); }
.nav-list a[aria-current="page"] {
  color: var(--cyan);
  border-bottom-color: var(--cyan);
}

/* 移动端切换按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  margin: 6px auto;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 2px;
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  cursor: pointer;
  transition: border-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav-toggle:hover { border-color: var(--cyan); color: var(--cyan); }
.nav-toggle-icon {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 16px;
  flex: none;
}
.nav-toggle-icon span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s var(--ease), opacity 0.2s var(--ease);
}
.site-header[data-open="true"] .nav-toggle-icon span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}
.site-header[data-open="true"] .nav-toggle-icon span:nth-child(2) { opacity: 0; }
.site-header[data-open="true"] .nav-toggle-icon span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* 滚动压缩态 */
.site-header.is-compact {
  background: rgba(11, 22, 34, 0.82);
  box-shadow: 0 16px 36px -30px #000000;
}
.site-header.is-compact .masthead-top { display: none; }
.site-header.is-compact .masthead-inner { padding-top: 8px; gap: 4px; }
.site-header.is-compact .brand {
  font-size: clamp(20px, 3vw, 27px);
  padding-bottom: 4px;
}
.site-header.is-compact .nav-list a { padding: 8px 12px; }

/* 面包屑 */
.crumb-bar {
  border-top: 1px solid var(--line-soft);
  background: rgba(18, 37, 54, 0.55);
}
.crumb {
  max-width: var(--max);
  margin-inline: auto;
  padding: 7px var(--gutter);
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--steel);
}
.crumb a {
  color: var(--steel);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
.crumb a:hover { color: var(--cyan); }
.crumb-sep { color: var(--contour); }
.crumb-current { color: var(--white); }

/* ---------- 11. 页脚 ---------- */
.site-footer {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: var(--ink);
  color: var(--white);
  border-top: 1px solid rgba(79, 240, 208, 0.22);
}

.footer-contour {
  position: absolute;
  inset: -12% -8% auto -8%;
  height: 130%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.6;
  background-image:
    repeating-radial-gradient(
      ellipse 70% 60% at 12% 108%,
      transparent 0 34px,
      rgba(44, 74, 90, 0.55) 34px 35px,
      transparent 35px 70px
    ),
    repeating-radial-gradient(
      ellipse 60% 55% at 92% -10%,
      transparent 0 42px,
      rgba(44, 74, 90, 0.4) 42px 43px,
      transparent 43px 86px
    );
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--max);
  margin-inline: auto;
  padding: clamp(34px, 6vw, 64px) var(--gutter) 26px;
}

.footer-top { margin-bottom: clamp(26px, 4vw, 46px); }

.footer-wordmark {
  font-family: var(--font-title);
  font-weight: 700;
  font-size: clamp(54px, 15vw, 164px);
  line-height: 0.82;
  letter-spacing: -0.015em;
  color: rgba(143, 163, 179, 0.13);
  -webkit-text-stroke: 1px rgba(79, 240, 208, 0.22);
  user-select: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) repeat(3, minmax(0, 1fr));
  gap: clamp(22px, 3vw, 44px);
  padding-bottom: clamp(26px, 4vw, 42px);
  border-bottom: 1px solid var(--line-soft);
}

.footer-brand { min-width: 0; }
.footer-brand-name {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-family: var(--font-title);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.footer-brand-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
  background: var(--cyan);
  padding: 2px 6px;
}
.footer-brand-desc {
  max-width: 34ch;
  margin-bottom: 18px;
  font-size: 14px;
  line-height: 1.85;
  color: var(--steel);
}

.footer-col { min-width: 0; }
.footer-col-title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel);
}
.footer-links { display: flex; flex-direction: column; gap: 2px; }
.footer-links a {
  display: inline-block;
  padding: 6px 0;
  font-size: 14.5px;
  color: var(--white);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-links a:hover {
  color: var(--cyan);
  border-bottom-color: rgba(79, 240, 208, 0.4);
}

.footer-contact {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: clamp(18px, 3vw, 40px);
  padding: clamp(24px, 3.6vw, 38px) 0;
  border-bottom: 1px solid var(--line-soft);
}
.footer-contact-block { min-width: 0; }
.footer-contact-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--steel);
}
.footer-contact-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-contact-list li {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 14px;
  line-height: 1.65;
}
.footer-contact-key {
  flex: none;
  width: 42px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cyan);
}
.footer-contact-value {
  color: var(--white);
  word-break: break-word;
}
.footer-note {
  margin: 0;
  padding-left: 14px;
  border-left: 2px solid var(--contour);
  font-size: 13px;
  line-height: 1.85;
  color: var(--steel);
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--steel);
}
.footer-copy, .footer-icp { margin: 0; }

/* ---------- 12. 滚动显现 ---------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in {
  opacity: 1;
  transform: none;
}

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

@media (max-width: 899px) {
  .footer-contact { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 859px) {
  .masthead-inner { padding-top: 10px; gap: 8px; }
  .masthead-cta { display: none; }
  .masthead-top { justify-content: flex-start; }
  .brand { padding-bottom: 8px; }
  .nav-toggle { display: inline-flex; align-self: center; }
  .nav-row {
    flex-direction: column;
    align-items: stretch;
    border-top: none;
  }
  .nav {
    display: none;
    width: 100%;
    margin-top: 8px;
    padding-top: 4px;
    border-top: 1px solid var(--line-soft);
  }
  .site-header[data-open="true"] .nav { display: block; }
  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .nav-list a {
    padding: 13px 12px;
    font-size: 14px;
    border-bottom: 1px solid var(--line-soft);
    border-left: 2px solid transparent;
  }
  .nav-list a[aria-current="page"] {
    border-bottom-color: var(--line-soft);
    border-left-color: var(--cyan);
    background: rgba(79, 240, 208, 0.06);
  }
}

@media (max-width: 719px) {
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-wordmark { font-size: clamp(46px, 17vw, 88px); }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 620px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 1100px) {
  body { font-size: 17px; }
}

/* ---------- 14. 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-header,
  .header-progress,
  .brand,
  .masthead-inner,
  .nav-list a,
  .nav-toggle,
  .nav-toggle-icon span,
  .btn,
  .footer-links a,
  .crumb a,
  .skip-link { transition: none; }
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .btn:hover { transform: none; }
}
