/* =========================================================
   爱赢CN 官方主站 · 共享样式 /assets/site.css
   暖纸 × 深靛蓝 × 暖金 × 高亮青绿 · 索引卡语言
   ========================================================= */

:root {
  --indigo: #16255C;
  --midnight: #0D1220;
  --gold: #D9A340;
  --gold-deep: #A8782A;
  --teal: #0FB5A5;
  --teal-deep: #0A7F76;
  --paper: #F5F0E6;
  --paper-2: #E6DECE;
  --paper-3: #EDE8DE;
  --archive: #9A9384;
  --ink: #14161C;
  --body: #3B4149;
  --white: #FFFFFF;

  --header-h: 68px;
  --wrap: 1180px;
  --hard: 6px 6px 0 var(--ink);
  --soft: 3px 3px 0 var(--ink);
  --ease: cubic-bezier(.2, .7, .2, 1);

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-sans: "PingFang SC", "Noto Sans SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, "Courier New", monospace;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -.01em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(30px, 5.2vw, 56px); }
h2 { font-size: clamp(26px, 3.6vw, 40px); }
h3 { font-size: clamp(20px, 2.4vw, 26px); }
h4 { font-size: 18px; font-family: var(--font-sans); font-weight: 700; letter-spacing: .01em; }

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

a { color: var(--teal-deep); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }

strong, b { color: var(--ink); font-weight: 700; }

ul, ol { margin: 0 0 1.1em; padding-left: 1.25em; }
li { margin-bottom: .3em; }

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

button { font: inherit; }

code, kbd, samp { font-family: var(--font-mono); font-size: .92em; }

hr { border: 0; border-top: 2px solid var(--ink); margin: 32px 0; }

main { display: block; }

::selection { background: var(--gold); color: var(--midnight); }

:focus-visible { outline: 2px solid var(--teal); outline-offset: 3px; }
.site-footer :focus-visible { outline-color: var(--gold); }

/* ---------- 跳过链接 ---------- */
.skip-link {
  position: absolute;
  top: -72px;
  left: 12px;
  z-index: 200;
  padding: 10px 16px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  color: var(--midnight);
  background: var(--gold);
  border: 2px solid var(--ink);
  text-decoration: none;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

/* =========================================================
   页头
   ========================================================= */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  color: var(--ink);
  background: rgba(245, 240, 230, .9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(20, 22, 28, .12);
  transition: background-color .3s var(--ease), color .3s var(--ease),
              border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.site-header[data-scrolled="true"] {
  color: var(--paper);
  background: var(--indigo);
  border-bottom-color: var(--gold);
  box-shadow: 0 10px 26px rgba(13, 18, 32, .2);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 18px;
  width: 100%;
  max-width: var(--wrap);
  min-height: var(--header-h);
  margin: 0 auto;
  padding: 0 24px;
}

/* 品牌 */
.brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  color: inherit;
  line-height: 1.1;
  text-decoration: none;
}
.brand-mark {
  font-family: var(--font-sans);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: .02em;
}
.brand-sub {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .26em;
  opacity: .62;
}

/* 导航（移动优先：折叠面板） */
.nav-rail {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 0;
  overflow: hidden;
  visibility: hidden;
  opacity: 0;
  background: var(--indigo);
  border-top: 2px solid var(--gold);
  transition: max-height .32s var(--ease), opacity .24s var(--ease), visibility .24s var(--ease);
}
.nav-rail[data-open="true"] {
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
  visibility: visible;
  opacity: 1;
}

.nav { display: flex; align-items: center; width: 100%; }

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  margin: 0;
  padding: 10px 24px 22px;
  list-style: none;
}
.nav-item { margin: 0; scroll-snap-align: center; }

.nav-link {
  display: block;
  padding: 12px 4px;
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 600;
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(245, 240, 230, .14);
  transition: color .2s var(--ease), border-color .2s var(--ease);
}
.nav-link:hover { color: var(--gold); }
.nav-link[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }

/* 右侧操作区 */
.header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

/* 汉堡按钮 */
.nav-toggle {
  position: relative;
  display: inline-flex;
  width: 46px;
  height: 42px;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 2px solid currentColor;
  cursor: pointer;
}
.nav-toggle-bar {
  position: absolute;
  left: 12px;
  right: 12px;
  height: 2px;
  background: currentColor;
  transition: transform .22s var(--ease);
}
.nav-toggle-bar:first-of-type { top: 15px; }
.nav-toggle-bar:last-of-type { top: 25px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-of-type { transform: translateY(5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-of-type { transform: translateY(-5px) rotate(-45deg); }

/* 阅读进度 */
.scroll-progress {
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--teal));
  transform: scaleX(0);
  transform-origin: 0 50%;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--ink);
  background: transparent;
  border: 2px solid currentColor;
  border-radius: 0;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.btn-cta {
  color: var(--midnight);
  background: var(--gold);
  border-color: var(--ink);
  box-shadow: var(--soft);
}
.btn-cta:hover { background: var(--teal); }
.btn-cta:active { box-shadow: 1px 1px 0 var(--ink); transform: translate(2px, 2px); }
.btn-ghost { color: var(--paper); border-color: var(--paper); }
.btn-ghost:hover { color: var(--indigo); background: var(--paper); }

/* ---------- 桌面临界点 ---------- */
@media (min-width: 901px) {
  .header-actions { margin-left: 0; }
  .nav-toggle { display: none; }

  .nav-rail {
    position: static;
    flex: 1 1 auto;
    min-width: 0;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    visibility: visible;
    opacity: 1;
    background: transparent;
    border-top: 0;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    overscroll-behavior-x: contain;
  }
  .nav-rail::-webkit-scrollbar { display: none; }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: 26px;
    width: auto;
    min-width: max-content;
    padding: 0 6px;
  }
  .nav-link {
    display: inline-block;
    padding: 6px 0;
    font-size: 15px;
    color: inherit;
    border-bottom: 2px solid transparent;
  }
  .site-header:not([data-scrolled="true"]) .nav-link:hover { color: var(--ink); border-bottom-color: var(--teal-deep); }
  .site-header:not([data-scrolled="true"]) .nav-link[aria-current="page"] { color: var(--gold-deep); border-bottom-color: var(--gold-deep); }
  .site-header[data-scrolled="true"] .nav-link:hover { color: var(--paper); border-bottom-color: var(--teal); }
  .site-header[data-scrolled="true"] .nav-link[aria-current="page"] { color: var(--gold); border-bottom-color: var(--gold); }
}

@media (max-width: 420px) {
  .btn-cta { padding: 9px 12px; font-size: 13px; }
  .nav-toggle { width: 42px; height: 40px; }
  .nav-toggle-bar:first-of-type { top: 14px; }
  .nav-toggle-bar:last-of-type { top: 24px; }
}

/* =========================================================
   页脚
   ========================================================= */
.site-footer {
  position: relative;
  margin-top: 0;
  color: rgba(245, 240, 230, .78);
  background: var(--midnight);
  border-top: 4px solid var(--gold);
  font-size: 15px;
  line-height: 1.7;
}

.footer-inner {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 48px 24px 6px;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  padding-bottom: 22px;
  border-bottom: 2px solid rgba(217, 163, 64, .45);
}
.footer-mark {
  font-family: var(--font-sans);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: .02em;
  color: var(--paper);
}
.footer-tagline {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  color: var(--teal);
}
.footer-note {
  flex: 1 1 240px;
  margin: 0;
  font-size: 14px;
  line-height: 1.65;
  color: rgba(245, 240, 230, .6);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: 34px 0 30px;
}
@media (min-width: 640px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: repeat(4, 1fr); gap: 32px; } }

.footer-col { min-width: 0; }
.footer-title {
  margin: 0 0 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  color: var(--gold);
}

.footer-list {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.footer-list li { margin: 0; }
.footer-list a {
  color: rgba(245, 240, 230, .84);
  text-decoration: none;
  border-bottom: 1px dashed rgba(245, 240, 230, .26);
  padding-bottom: 1px;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.footer-list a:hover { color: var(--teal); border-bottom-color: var(--teal); border-bottom-style: solid; }

.footer-text {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.7;
  color: rgba(245, 240, 230, .7);
}
.footer-text:last-child { margin-bottom: 0; }
.footer-text strong { display: block; font-weight: 600; color: var(--paper); font-size: 15px; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 28px;
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 18px 24px 28px;
  border-top: 1px solid rgba(245, 240, 230, .16);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: rgba(245, 240, 230, .52);
}
.footer-meta { margin: 0; }

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 70;
  padding: 10px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--midnight);
  background: var(--gold);
  border: 2px solid var(--ink);
  box-shadow: var(--soft);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s var(--ease);
}
.to-top.is-on { opacity: 1; visibility: visible; transform: translateY(0); }

/* =========================================================
   页面骨架
   ========================================================= */
#main-content { display: block; padding-top: var(--header-h); }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: 24px;
}

.prose { max-width: 720px; }

.section { padding-block: clamp(36px, 5.5vw, 64px); }

.band-paper { background: var(--paper); }
.band-alt { background: var(--paper-2); }
.band-indigo { background: var(--indigo); color: rgba(245, 240, 230, .84); }
.band-indigo h1, .band-indigo h2, .band-indigo h3 { color: var(--paper); }
.band-indigo a { color: var(--teal); }
.band-indigo .lead, .band-indigo .index-card-desc { color: rgba(245, 240, 230, .8); }
.band-indigo .section-no { color: var(--gold); border-bottom-color: var(--gold); }
.band-archive {
  background: var(--paper-3);
  color: #55514A;
  border-top: 2px dashed var(--archive);
  border-bottom: 2px dashed var(--archive);
}
.band-archive h1, .band-archive h2, .band-archive h3 { color: #4A463F; }

.section-open {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 12px 16px;
  margin-bottom: 18px;
}
.section-no {
  font-family: var(--font-mono);
  font-size: 13px;
  letter-spacing: .18em;
  color: var(--gold-deep);
  padding-bottom: 2px;
  border-bottom: 2px solid var(--gold);
}

.kicker {
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--teal-deep);
}

.lead {
  max-width: 720px;
  font-size: 19px;
  line-height: 1.75;
  color: var(--body);
}

.tag {
  display: inline-block;
  padding: 3px 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
  color: var(--teal-deep);
  border: 1px solid currentColor;
}
.tag-archive { color: var(--archive); border-style: dashed; }

.rule { border: 0; border-top: 2px solid var(--ink); margin: 32px 0; }
.rule-dash { border-top: 2px dashed var(--archive); }

/* 面包屑 */
.crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 20px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .08em;
  line-height: 1.6;
  color: var(--archive);
}
.crumbs a { color: var(--teal-deep); text-decoration: none; border-bottom: 1px solid currentColor; }
.crumbs a:hover { color: var(--indigo); }
.crumbs-sep { color: var(--archive); }

/* 网格 */
.grid { display: grid; gap: 18px; }
.grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
@media (min-width: 700px) {
  .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(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.split { display: grid; grid-template-columns: 1fr; gap: 28px; }
@media (min-width: 900px) {
  .split { grid-template-columns: 7fr 5fr; gap: 40px; align-items: start; }
  .split-rev { grid-template-columns: 5fr 7fr; }
}

/* 索引卡 */
.index-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px 20px;
  color: var(--body);
  background: var(--white);
  border: 2px solid var(--ink);
  text-decoration: none;
  transition: box-shadow .18s var(--ease), border-color .18s var(--ease);
}
.index-card:hover,
.index-card:focus-visible { box-shadow: var(--soft); border-color: var(--indigo); }
.index-no {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--teal-deep);
}
.index-card-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 20px;
  line-height: 1.3;
  color: var(--ink);
}
.index-card-desc { margin: 0; font-size: 14px; line-height: 1.7; color: var(--body); }

.card {
  padding: 22px;
  background: var(--white);
  border: 2px solid var(--ink);
}
.card-archive {
  color: #4F4B44;
  background: #F2EEE6;
  border: 2px dashed var(--archive);
}
.card-archive .index-no,
.card-archive .kicker { color: var(--archive); }

/* 图片容器（页面阶段放置实拍或图形素材） */
.figure { margin: 0; }
.figure-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 2px solid var(--ink);
  background:
    repeating-linear-gradient(135deg, rgba(22, 37, 92, .07) 0 10px, transparent 10px 20px),
    var(--paper-2);
}
.figure-frame > img,
.figure-frame > picture,
.figure-frame > .figure-media {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}
.figure-wide { aspect-ratio: 21 / 9; }
.figure-square { aspect-ratio: 1 / 1; }
.figure-tall { aspect-ratio: 4 / 5; }
.figure-cap {
  margin: 10px 0 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--archive);
}

/* 滚动显现 */
.js-reveal [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .4s var(--ease), transform .4s var(--ease);
  transition-delay: calc(var(--i, 0) * 60ms);
}
.js-reveal [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .nav-rail, .to-top, .scroll-progress, .skip-link, .btn, .index-card, .nav-link {
    transition-duration: .001ms !important;
  }
  .nav-toggle-bar { transition: none !important; }
}
