/* =========================================================
   1号站娱乐馆 — 共享站点样式
   路径：/assets/site.css
   结构：变量 → reset → 排版 → 工具类 → 跳过链接 → 页头
        → 页脚 → 按钮 → 面包屑 → 网格 → 组件 → 图片容器
        → 返回顶部 → 响应式 → 无障碍偏好
   ========================================================= */

/* ---------- 1. 变量 ---------- */
:root {
  --ink: #0A1018;
  --ink-deep: #080D14;
  --ink-soft: #0C131C;
  --panel: #141C26;
  --line: #243040;
  --line-soft: #1B2534;
  --text: #C8D4DF;
  --muted: #8496A6;
  --ice: #5FC6E8;
  --pine: #3FA383;
  --amber: #E8A33D;
  --paper: #F2F7FA;

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

  --gutter: clamp(16px, 3.2vw, 28px);
  --maxw: 1240px;
  --ease: cubic-bezier(.2, .6, .3, 1);
}

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

html,
body { margin: 0; padding: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  background: var(--ink);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 .6em;
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.24;
  letter-spacing: .02em;
  color: var(--paper);
}

h1 { font-size: 40px; }
h2 { font-size: 28px; }
h3 { font-size: 20px; }
h4 { font-size: 17px; }

p { margin: 0 0 1em; }

a { color: inherit; text-decoration: none; }

ul, ol { margin: 0; padding: 0; }

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

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

figure { margin: 0; }

::selection {
  background: var(--ice);
  color: #06121A;
}

/* ---------- 3. 工具类 ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: .04em;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.rule {
  height: 1px;
  margin: 0;
  border: 0;
  background: var(--line);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 1px;
  background: var(--amber);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px 28px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}

.section-head h2 { margin: 0; }

/* ---------- 4. 跳过链接 ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  padding: 12px 20px;
  background: var(--amber);
  color: #0A1018;
  font-size: 14px;
  letter-spacing: .04em;
}

.skip-link:focus,
.skip-link:focus-visible {
  left: 10px;
  top: 10px;
  outline: 2px solid var(--paper);
  outline-offset: 2px;
}

/* ---------- 5. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(10, 16, 24, .88);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transition: background .22s var(--ease), border-color .22s var(--ease);
}

.site-header.is-stuck {
  background: rgba(8, 13, 20, .96);
  border-bottom-color: var(--line-soft);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px var(--gutter);
  transition: padding .22s var(--ease);
}

.site-header.is-stuck .header-inner { padding-top: 9px; padding-bottom: 9px; }

/* 左侧署名 */
.brand-block {
  display: flex;
  align-items: baseline;
  gap: 14px;
  min-width: 0;
  flex-shrink: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
}

.brand-index {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  line-height: 1.3;
  letter-spacing: .12em;
  padding: 2px 6px;
  color: var(--amber);
  border: 1px solid var(--amber);
}

.brand-name {
  font-family: var(--font-head);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--paper);
  white-space: nowrap;
}

.chapter-tag {
  display: inline-block;
  padding-left: 13px;
  border-left: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--muted);
  white-space: nowrap;
}

/* 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font-size: 14px;
  letter-spacing: .06em;
  transition: border-color .16s var(--ease), color .16s var(--ease);
}

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

.nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 16px;
  height: 12px;
}

.nav-toggle__bars i {
  display: block;
  width: 100%;
  height: 1px;
  background: var(--amber);
  transition: transform .2s var(--ease);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars i:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* 一级栏目 */
.nav-block {
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-item { position: relative; }

.nav-link {
  position: relative;
  display: block;
  padding: 9px 13px;
  font-size: 15px;
  letter-spacing: .03em;
  color: var(--text);
  border: 1px solid transparent;
  transition: color .16s var(--ease), border-color .16s var(--ease), background .16s var(--ease);
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 13px;
  right: 13px;
  bottom: 4px;
  height: 1px;
  background: var(--ice);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .2s var(--ease);
}

.nav-item:hover .nav-link::after,
.nav-item:focus-within .nav-link::after { transform: scaleX(1); }

.nav-link:hover { color: var(--paper); }

.nav-link[aria-current="page"] {
  color: var(--ice);
  border-color: var(--line);
  background: var(--panel);
}

.nav-link[aria-current="page"]::after { transform: scaleX(1); background: var(--amber); }

.nav-meta {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 20;
  width: 208px;
  padding: 10px 12px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-top: 1px solid var(--ice);
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-5px);
  transition: opacity .16s var(--ease), transform .16s var(--ease), visibility .16s;
}

.nav-item:hover .nav-meta,
.nav-item:focus-within .nav-meta {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.site-header.is-stuck .nav-meta { display: none; }

.nav-num {
  display: inline-block;
  margin-right: 8px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: .1em;
  color: var(--amber);
}

/* 滚动进度 */
.scroll-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 2px;
  background: var(--amber);
  transform: scaleX(0);
  transform-origin: 0 50%;
  pointer-events: none;
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  background: var(--ink-deep);
  border-top: 1px solid var(--line);
  margin-top: 88px;
}

.footer-inner {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px var(--gutter) 30px;
}

.footer-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.footer-sign {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.footer-brand {
  margin: 0;
  font-family: var(--font-head);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--paper);
}

.footer-note {
  margin: 0;
  max-width: 40ch;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}

.footer-cta { flex-shrink: 0; }

.footer-nav { margin-top: 26px; }

.footer-index {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.footer-index li {
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.footer-link {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 15px 18px;
  font-size: 15px;
  color: var(--text);
  transition: background .16s var(--ease), color .16s var(--ease);
}

.footer-link:hover {
  background: var(--panel);
  color: var(--paper);
}

.footer-idx {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--amber);
}

.footer-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 24px;
  font-size: 13px;
  color: var(--muted);
}

.footer-meta p { margin: 0; }

.footer-contact {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
}

.footer-contact .mono { color: var(--text); }

.footer-sep { color: var(--line); }

.footer-copy { letter-spacing: .04em; }

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--paper);
  font-family: var(--font-body);
  font-size: 15px;
  letter-spacing: .03em;
  text-align: center;
  transition: background .16s var(--ease), border-color .16s var(--ease), color .16s var(--ease);
}

.btn:hover,
.btn:focus-visible {
  background: var(--panel);
  border-color: var(--ice);
  color: var(--paper);
}

.btn--primary {
  background: var(--ice);
  border-color: var(--ice);
  color: #06121A;
  font-weight: 500;
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--paper);
  border-color: var(--paper);
  color: #06121A;
}

.btn--ghost {
  border-color: var(--line);
  color: var(--text);
}

.btn-idx {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--amber);
}

.btn--primary .btn-idx { color: #06121A; opacity: .72; }

/* ---------- 8. 面包屑 ---------- */
.breadcrumb {
  padding-top: 22px;
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--line);
}

.breadcrumb a { color: var(--muted); transition: color .16s var(--ease); }
.breadcrumb a:hover { color: var(--ice); }
.breadcrumb [aria-current="page"] { color: var(--text); }

/* ---------- 9. 容器与网格 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gutter);
}

.col-3 { grid-column: span 3; }
.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-6 { grid-column: span 6; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-9 { grid-column: span 9; }
.col-12 { grid-column: span 12; }

/* ---------- 10. 正文与面板 ---------- */
.prose {
  max-width: 68ch;
  color: var(--text);
}

.prose h2 { margin-top: 1.6em; }
.prose h3 { margin-top: 1.4em; }

.prose a {
  color: var(--ice);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.prose a:hover { color: var(--paper); }

.prose ul,
.prose ol {
  margin: 0 0 1.2em;
  padding-left: 1.3em;
}

.prose li { margin-bottom: .4em; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 22px;
}

.panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 18px;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.panel-title {
  margin: 0;
  font-family: var(--font-head);
  font-size: 18px;
  letter-spacing: .04em;
  color: var(--paper);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 3px 9px;
  border: 1px solid var(--line);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--muted);
  white-space: nowrap;
}

.tag--ice { color: var(--ice); border-color: rgba(95, 198, 232, .42); }
.tag--pine { color: var(--pine); border-color: rgba(63, 163, 131, .42); }
.tag--amber { color: var(--amber); border-color: rgba(232, 163, 61, .42); }

.dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  background: var(--pine);
}

.dot--ice { background: var(--ice); }
.dot--amber { background: var(--amber); }

/* ---------- 11. 图片容器 ---------- */
.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--panel);
  border: 1px solid var(--line);
  aspect-ratio: 4 / 3;
}

.media-frame > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.7) contrast(1.06) brightness(.9);
  transition: filter .3s var(--ease), transform .45s var(--ease);
}

.media-frame:hover > img {
  filter: saturate(.86) contrast(1.04) brightness(.98);
  transform: scale(1.02);
}

.media-frame--16x9 { aspect-ratio: 16 / 9; }
.media-frame--3x2 { aspect-ratio: 3 / 2; }
.media-frame--3x4 { aspect-ratio: 3 / 4; }
.media-frame--1x1 { aspect-ratio: 1 / 1; }

.media-frame__idx {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 2;
  padding: 4px 10px;
  background: var(--ink);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  letter-spacing: .1em;
  color: var(--amber);
}

.media-frame figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 10px 13px;
  background: rgba(10, 16, 24, .84);
  border-top: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.6;
  color: var(--text);
}

/* ---------- 12. 返回顶部 ---------- */
.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 32px);
  bottom: clamp(14px, 3vw, 32px);
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 15px;
  background: var(--ink);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  letter-spacing: .06em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s, border-color .2s var(--ease), color .2s var(--ease);
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.to-top:hover,
.to-top:focus-visible {
  border-color: var(--amber);
  color: var(--paper);
}

.to-top__arrow {
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--amber);
  line-height: 1;
}

/* ---------- 13. 焦点可见 ---------- */
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1080px) {
  .nav-link { padding: 9px 10px; font-size: 14px; }
  .brand-name { font-size: 19px; }
}

@media (max-width: 960px) {
  h1 { font-size: 32px; }
  h2 { font-size: 24px; }

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

  .nav-block {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    flex: none;
    justify-content: flex-start;
    padding: 6px var(--gutter) 22px;
    background: var(--ink-soft);
    border-bottom: 1px solid var(--line);
    max-height: calc(100vh - 92px);
    overflow-y: auto;
  }

  .nav-block[data-open] {
    display: block;
    animation: nav-in .18s var(--ease) both;
  }

  @keyframes nav-in {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: none; }
  }

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

  .nav-item { border-bottom: 1px solid var(--line); }
  .nav-item:last-child { border-bottom: 0; }

  .nav-link {
    padding: 15px 2px 8px;
    font-size: 17px;
    border: 0;
    background: none;
  }

  .nav-link::after { display: none; }

  .nav-link[aria-current="page"] {
    color: var(--ice);
    background: none;
    border: 0;
  }

  .nav-meta {
    position: static;
    display: block;
    width: auto;
    margin: 0 0 14px;
    padding: 0 0 0 12px;
    background: transparent;
    border: 0;
    border-left: 1px solid var(--line);
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .chapter-tag { display: none; }

  .footer-head { align-items: flex-start; }
}

@media (max-width: 900px) {
  .grid-12 > [class*="col-"] { grid-column: 1 / -1; }
  .footer-index { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  body { font-size: 15px; line-height: 1.8; }
  html { scroll-padding-top: 84px; }

  h1 { font-size: 26px; }
  h2 { font-size: 21px; }

  .brand-name { font-size: 17px; }
  .brand-index { font-size: 11px; padding: 1px 5px; }

  .footer-inner { padding-top: 40px; }
  .footer-brand { font-size: 22px; }
  .footer-index { grid-template-columns: 1fr; }
  .footer-meta { flex-direction: column; align-items: flex-start; }

  .to-top__text { display: none; }
  .to-top { padding: 10px 13px; }
}

/* ---------- 15. 减弱动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .media-frame:hover > img { transform: none; }
}
