/* ============================================================
   8游戏攻略 · /assets/site.css
   共享外壳：左侧轨道导航 + 暖纸主区 + 深墨蓝页脚
   ============================================================ */

/* ---------- 1. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; }
body, h1, h2, h3, h4, h5, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul[class], ol[class] { list-style: none; padding: 0; }
img, svg, video { max-width: 100%; display: block; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }

/* ---------- 2. 变量 ---------- */
:root {
  --ink: #0B1220;
  --ink-deep: #12161C;
  --paper: #F3EBDD;
  --jade: #149C8C;
  --jade-deep: #0C6B62;
  --gold: #F2A33A;
  --gold-pale: #FFE0B0;
  --coral: #E5533D;
  --mist: #D7EDE8;
  --steel: #8FA6A3;

  --rail-w: 244px;
  --bd: 3px;
  --shadow: 6px 6px 0 var(--ink-deep);

  --font-display: "Source Han Sans SC", "Noto Sans SC", "Alibaba PuHuiTi",
    "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: "Source Han Sans SC", "Noto Sans SC", system-ui,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace,
    SFMono-Regular, Menlo, Consolas, monospace;

  --grid-line: rgba(11, 18, 32, 0.05);
  --hair: rgba(243, 235, 221, 0.22);
}

/* ---------- 3. 基础排版 ---------- */
body {
  font-family: var(--font-body);
  font-size: clamp(1rem, 0.95rem + 0.22vw, 1.0625rem);
  line-height: 1.72;
  color: var(--ink-deep);
  min-height: 100vh;
  background-color: var(--paper);
  background-image:
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px),
    linear-gradient(0deg, var(--grid-line) 1px, transparent 1px);
  background-size: 34px 34px;
  background-position: -1px -1px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.16;
  letter-spacing: -0.012em;
  color: var(--ink-deep);
}
h1 { font-size: clamp(2.1rem, 4.4vw, 3.2rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2.2rem); }
h3 { font-size: clamp(1.1rem, 1.7vw, 1.36rem); }
h4 { font-size: 1.02rem; }
p { max-width: 72ch; }
p + p { margin-top: 0.7em; }
strong { font-weight: 800; }
small { font-size: 0.8rem; }

a { color: var(--jade-deep); text-underline-offset: 3px; }
a:hover { color: var(--ink-deep); }

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

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

:target { scroll-margin-top: 96px; }

/* ---------- 4. skip link ---------- */
.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 200;
  display: inline-block;
  padding: 0.55rem 1rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.92rem;
  text-decoration: none;
  color: var(--ink-deep);
  background: var(--gold);
  border: var(--bd) solid var(--ink-deep);
  box-shadow: 4px 4px 0 var(--jade);
  transform: translateY(-180%);
  transition: transform 0.18s ease;
}
.skip-link:focus,
.skip-link:focus-visible { transform: translateY(0); color: var(--ink-deep); }

/* ---------- 5. 侧边轨道 header ---------- */
.site-header {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  width: var(--rail-w);
  z-index: 90;
  color: var(--paper);
  background-color: var(--ink);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(20, 156, 140, 0.14) 0 2px,
    transparent 2px 15px
  );
  border-right: var(--bd) solid var(--ink-deep);
}

.rail-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.1rem 0.95rem 1.05rem;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--jade) transparent;
}

/* 品牌 */
.brand {
  display: flex;
  align-items: center;
  gap: 0.68rem;
  text-decoration: none;
  color: var(--paper);
}
.brand:hover { color: var(--paper); }

.brand-mark {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  padding: 4px;
  background: var(--jade);
  box-shadow: 3px 3px 0 var(--gold);
}
.brand-mark i { display: block; background: rgba(11, 18, 32, 0.88); }
.brand-mark i:nth-child(1),
.brand-mark i:nth-child(5),
.brand-mark i:nth-child(9) { background: var(--gold); }
.brand-mark i:nth-child(3),
.brand-mark i:nth-child(7) { background: rgba(11, 18, 32, 0.42); }

.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
  display: block;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.3rem;
  line-height: 1.12;
  letter-spacing: 0.03em;
  color: #FFFFFF;
}
.brand-sub {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--jade);
}

/* 移动按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.68rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
  color: var(--ink);
  background: var(--jade);
  border: var(--bd) solid var(--ink-deep);
  box-shadow: 3px 3px 0 var(--gold);
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}
.nav-toggle:hover { background: var(--gold); }
.nav-toggle:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--gold); }
.nav-toggle[aria-expanded="true"] {
  background: var(--gold);
  box-shadow: 3px 3px 0 var(--coral);
}
.nav-toggle-bars { display: grid; gap: 3px; width: 16px; }
.nav-toggle-bars i { display: block; height: 3px; background: currentColor; }
.nav-toggle-label { line-height: 1; letter-spacing: 0.06em; }

/* 导航 */
.site-nav { min-width: 0; }
.nav-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.68rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.97rem;
  line-height: 1.3;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: #E9E3D7;
  border: 2px solid transparent;
  transition: background 0.16s ease, color 0.16s ease,
    border-color 0.16s ease, transform 0.16s ease;
}
.nav-link::after {
  content: "›";
  font-family: var(--font-mono);
  font-size: 0.86rem;
  opacity: 0.45;
}
.nav-link:hover {
  background: rgba(20, 156, 140, 0.2);
  border-color: rgba(20, 156, 140, 0.55);
  color: #FFFFFF;
}
.nav-link[aria-current="page"],
.nav-link[aria-current="page"]:hover {
  background: var(--jade);
  border-color: var(--ink-deep);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--gold);
}
.nav-link[aria-current="page"]::after { opacity: 0.85; }

/* 轨道底部 */
.rail-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding-top: 0.9rem;
  border-top: 2px dashed var(--hair);
}
.rail-cta {
  display: block;
  text-align: center;
  padding: 0.58rem 0.8rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.94rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  color: var(--ink);
  background: var(--gold);
  border: var(--bd) solid var(--ink-deep);
  box-shadow: 4px 4px 0 var(--jade);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.rail-cta:hover {
  color: var(--ink);
  transform: translate(-1px, -2px);
  box-shadow: 6px 6px 0 var(--jade);
}
.rail-status {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #9FB3B0;
  max-width: none;
}
.status-dot {
  flex: none;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral);
  box-shadow: 0 0 0 3px rgba(229, 83, 61, 0.22);
  animation: dot-breathe 3s ease-in-out infinite;
}
@keyframes dot-breathe {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.42; transform: scale(0.8); }
}

/* ---------- 6. 主内容外壳 ---------- */
.site-main {
  display: block;
  padding: clamp(1.2rem, 3vw, 2.4rem) clamp(1rem, 3vw, 2.6rem)
    clamp(2rem, 4vw, 3rem);
}
.wrap {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
}

/* ---------- 7. footer ---------- */
.site-footer {
  margin-top: clamp(1.6rem, 4vw, 3.2rem);
  padding: clamp(1.8rem, 4vw, 3rem) clamp(1rem, 3vw, 2.6rem) 1.1rem;
  color: #E9E3D7;
  background-color: var(--ink);
  background-image: repeating-linear-gradient(
    135deg,
    rgba(20, 156, 140, 0.12) 0 2px,
    transparent 2px 17px
  );
  border-top: var(--bd) solid var(--gold);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.4fr 1fr;
  gap: clamp(1.1rem, 2.6vw, 2.2rem);
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  min-width: 0;
}
.footer-mark {
  width: 38px;
  height: 38px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 3px;
  padding: 4px;
  background: var(--jade);
  box-shadow: 3px 3px 0 var(--gold);
}
.footer-mark i { display: block; background: var(--ink); }
.footer-mark i:nth-child(1),
.footer-mark i:nth-child(4) { background: var(--gold); }

.footer-name {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.5rem;
  line-height: 1.2;
  letter-spacing: 0.03em;
  color: #FFFFFF;
  max-width: none;
}
.footer-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--jade);
  max-width: none;
}
.footer-cta {
  display: inline-block;
  margin-top: 0.3rem;
  padding: 0.44rem 0.95rem;
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-decoration: none;
  color: var(--ink);
  background: var(--gold);
  border: var(--bd) solid var(--ink-deep);
  box-shadow: 4px 4px 0 var(--jade);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}
.footer-cta:hover {
  color: var(--ink);
  transform: translate(-1px, -2px);
  box-shadow: 6px 6px 0 var(--jade);
}

.footer-col { min-width: 0; }
.footer-title {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--jade);
  margin: 0 0 0.72rem;
}
.footer-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.42rem;
  font-size: 0.93rem;
  line-height: 1.52;
}
.footer-list a {
  color: #E9E3D7;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.16s ease, border-color 0.16s ease;
}
.footer-list a:hover {
  color: var(--gold);
  border-bottom-color: var(--gold);
}
.footer-mono {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #C9D6D3;
  word-break: break-word;
}
.footer-note {
  margin-top: 0.65rem;
  max-width: 30ch;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--steel);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.4rem 1.2rem;
  width: 100%;
  max-width: 1180px;
  margin: clamp(1.4rem, 3vw, 2rem) auto 0;
  padding-top: 0.9rem;
  border-top: 2px dashed var(--hair);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--steel);
}
.footer-legal,
.footer-updated { margin: 0; max-width: none; }

/* ---------- 8. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  padding: 0.55rem 1.05rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.94rem;
  line-height: 1.4;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--ink-deep);
  background: var(--paper);
  border: var(--bd) solid var(--ink-deep);
  box-shadow: 4px 4px 0 var(--ink-deep);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}
.btn:hover {
  color: var(--ink-deep);
  transform: translate(-1px, -2px);
  box-shadow: 6px 6px 0 var(--ink-deep);
}
.btn:active {
  transform: translate(2px, 2px);
  box-shadow: 2px 2px 0 var(--ink-deep);
}
.btn--gold { background: var(--gold); }
.btn--jade { background: var(--jade); color: var(--ink); }
.btn--jade:hover { color: var(--ink); }
.btn--coral { background: var(--coral); color: #FFFFFF; }
.btn--coral:hover { color: #FFFFFF; }

.stamp {
  display: inline-block;
  padding: 0.16rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.5;
  white-space: nowrap;
  color: var(--ink-deep);
  background: var(--gold);
  border: 2px solid var(--ink-deep);
}
.stamp--jade { background: var(--jade); color: var(--ink); }
.stamp--coral { background: var(--coral); color: #FFFFFF; border-color: var(--ink-deep); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.14rem 0.48rem;
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--jade-deep);
  background: var(--mist);
  border: 2px solid var(--jade-deep);
}
.tag--gold {
  color: #7A4300;
  background: var(--gold-pale);
  border-color: #A25C00;
}
.tag--coral {
  color: #8E1F0E;
  background: #FFD9D2;
  border-color: #B7331C;
}

.section-band {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.5rem 1rem;
  padding-bottom: 0.55rem;
  border-bottom: var(--bd) solid var(--ink-deep);
}
.section-band h2,
.section-band h3 { margin: 0; }
.section-band .stamp { margin-left: auto; }

.arc-card {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1rem 1.05rem 1.1rem;
  background: var(--paper);
  border: var(--bd) solid var(--ink-deep);
  box-shadow: var(--shadow);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}
.arc-card:hover,
.arc-card:focus-within {
  transform: translateY(-2px);
  box-shadow: 8px 8px 0 var(--ink-deep);
}
.arc-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.12rem;
  line-height: 1.32;
  letter-spacing: -0.01em;
  margin: 0;
}
.arc-title a { color: inherit; text-decoration: none; }
.arc-title a:hover { color: var(--jade-deep); }
.arc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #5D6F6C;
}
.arc-desc {
  font-size: 0.92rem;
  line-height: 1.65;
  color: #3B4644;
  max-width: none;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.5rem;
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: #5D6F6C;
}
.breadcrumb li { display: flex; align-items: center; gap: 0.5rem; min-width: 0; }
.breadcrumb li + li::before { content: "/"; color: var(--steel); }
.breadcrumb a { color: var(--jade-deep); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--ink-deep); }

.media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--mist);
  border: var(--bd) solid var(--ink-deep);
}
.media img,
.media svg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media--wide { aspect-ratio: 16 / 7; }
.media--square { aspect-ratio: 1 / 1; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(0.8rem, 1.6vw, 1.4rem);
}

.rule {
  height: var(--bd);
  border: 0;
  margin: 0;
  background: var(--ink-deep);
}

/* 主题筛选 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}
.filter-btn {
  padding: 0.32rem 0.78rem;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--ink-deep);
  background: var(--paper);
  border: 2px solid var(--ink-deep);
  transition: background 0.16s ease, color 0.16s ease,
    box-shadow 0.16s ease, transform 0.16s ease;
}
.filter-btn:hover { background: var(--gold-pale); }
.filter-btn[aria-pressed="true"] {
  background: var(--jade);
  color: var(--ink);
  box-shadow: 3px 3px 0 var(--ink-deep);
}
.filter-count {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--jade-deep);
}

[data-tags] { transition: opacity 0.16s ease, transform 0.16s ease; }
[data-tags].is-hidden { display: none !important; }

/* 显现动效 */
.js [data-reveal] { opacity: 0; transform: translateY(14px); }
.js [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
  transition: opacity 0.42s ease, transform 0.42s ease;
}

/* ---------- 9. 响应式 ---------- */
@media (min-width: 901px) {
  body { padding-left: var(--rail-w); }
}

@media (max-width: 1100px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  :root { --rail-w: 100%; }
  body { padding-left: 0; }
  html { scroll-padding-top: 96px; }

  .site-header {
    position: sticky;
    top: 0;
    bottom: auto;
    left: auto;
    width: 100%;
    z-index: 100;
    border-right: 0;
    border-bottom: var(--bd) solid var(--gold);
  }
  .rail-inner {
    height: auto;
    overflow: visible;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem 0.75rem;
    padding: 0.55rem 0.9rem 0.7rem;
  }
  .brand { margin-right: auto; }
  .brand-mark { width: 34px; height: 34px; padding: 3px; gap: 2px; }
  .brand-name { font-size: 1.12rem; }
  .brand-sub { font-size: 0.56rem; letter-spacing: 0.22em; }

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

  .site-nav {
    order: 3;
    flex-basis: 100%;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    opacity: 0;
    transition: max-height 0.28s ease, opacity 0.2s ease;
  }
  .site-nav[data-open] {
    max-height: 78vh;
    overflow-y: auto;
    visibility: visible;
    opacity: 1;
    padding-top: 0.35rem;
  }
  .nav-link {
    padding: 0.62rem 0.7rem;
    font-size: 1rem;
    border-color: rgba(243, 235, 221, 0.18);
  }
  .nav-list { gap: 5px; }

  .rail-foot {
    order: 4;
    flex-basis: 100%;
    display: none;
    margin-top: 0;
    padding-top: 0.7rem;
  }
  .site-header[data-nav-open] .rail-foot {
    display: flex;
    padding-bottom: 0.15rem;
  }
  .rail-cta { text-align: center; }

  .site-main {
    padding: 1.1rem clamp(0.9rem, 3vw, 1.6rem) 2rem;
  }
  .site-footer { margin-top: 2rem; }
  .grid-12 { gap: 0.9rem; }
}

@media (max-width: 640px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-base { flex-direction: column; align-items: flex-start; }
  .section-band { align-items: center; }
  .section-band .stamp { margin-left: 0; }
  h1 { font-size: clamp(1.8rem, 7vw, 2.4rem); }
}

/* ---------- 10. 动效偏好 ---------- */
@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;
  }
  .status-dot { animation: none; }
  .js [data-reveal] { opacity: 1 !important; transform: none !important; }
}

@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
