/* ==========================================================
   9博娱乐会馆 — 共享站点样式 /assets/site.css
   深夜会馆 · 档案索引体系
   ========================================================== */

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

html,
body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, li, dl, dd, dt,
figure, figcaption, blockquote { margin: 0; padding: 0; }

ul, ol { list-style: none; }

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

button, input, select, textarea { font: inherit; color: inherit; }

a { color: inherit; }

table { border-collapse: collapse; width: 100%; }

/* ---------- 2. Tokens ---------- */
:root {
  --void: #0A1230;
  --card: #111B3E;
  --line: #1B2A5A;
  --gold: #C9A227;
  --gold-lift: #E4C76B;
  --neon: #38E1C6;
  --violet: #8B7FD4;
  --paper: #F4F0E6;
  --black: #0E0F14;
  --mist: #6E7BA8;
  --jade: #2E7D6B;
  --clay: #B56A3C;

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

  --shell-w: 1180px;
  --gutter: clamp(1.15rem, 4vw, 2.6rem);
  --radius: 3px;
  --hair: 1px solid var(--line);

  --shadow-1: 0 1px 0 rgba(0, 0, 0, .35), 0 12px 26px -20px rgba(0, 0, 0, .95);
  --shadow-2: 0 6px 0 -4px rgba(0, 0, 0, .4), 0 24px 44px -26px rgba(0, 0, 0, 1);
}

/* ---------- 3. Base ---------- */
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 7.5rem;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--void);
  color: var(--paper);
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .012em;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(880px 520px at 12% -10%, rgba(56, 225, 198, .10), transparent 62%),
    radial-gradient(760px 480px at 94% 2%, rgba(201, 162, 39, .13), transparent 60%),
    radial-gradient(620px 620px at 50% 108%, rgba(139, 127, 212, .10), transparent 62%);
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 700;
  line-height: 1.32;
  letter-spacing: .006em;
  color: var(--paper);
}

h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 900; }
h2 { font-size: clamp(1.5rem, 3vw, 2.25rem); }
h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }
h4 { font-size: 1rem; }

p { margin: 0; }

a {
  color: var(--neon);
  text-decoration: none;
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}

a:hover { color: var(--gold-lift); }

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

::selection { background: rgba(201, 162, 39, .35); color: var(--paper); }

/* ---------- 4. Layout ---------- */
.shell {
  width: min(var(--shell-w), 100% - var(--gutter) * 2);
  margin-inline: auto;
}

.site-main {
  position: relative;
  z-index: 1;
  display: block;
  padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem);
}

.section {
  position: relative;
  padding-block: clamp(2.25rem, 5.5vw, 4rem);
  border-top: var(--hair);
}

.section:first-of-type { border-top: 0; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem 1.75rem;
  margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.section-index {
  font-family: var(--font-mono);
  font-size: clamp(1.5rem, 3.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--gold);
  opacity: .92;
}

.section-title {
  display: flex;
  align-items: baseline;
  gap: .8rem;
  flex-wrap: wrap;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .18em;
  color: var(--mist);
  text-transform: uppercase;
}

.lede {
  font-size: clamp(1rem, 1.6vw, 1.1rem);
  color: #DDD8CB;
  max-width: 62ch;
}

.rule {
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, var(--line) 0%, rgba(27, 42, 90, .25) 70%, transparent 100%);
  margin-block: clamp(1.25rem, 3vw, 2rem);
}

.note {
  border-left: 3px solid var(--gold);
  background: linear-gradient(90deg, rgba(201, 162, 39, .1), rgba(17, 27, 62, .35) 60%);
  padding: .9rem 1.1rem;
  color: #D8D3C6;
  font-size: .93rem;
  line-height: 1.8;
}

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

/* ---------- 5. Grid ---------- */
.grid {
  display: grid;
  gap: clamp(1rem, 2.4vw, 1.6rem);
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

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

/* ---------- 6. Skip link ---------- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 90;
  padding: .6rem 1.05rem;
  background: var(--gold);
  color: var(--black);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: 2px;
  box-shadow: var(--shadow-2);
  transition: top .2s ease;
}

.skip-link:focus { top: .7rem; color: var(--black); }

/* ---------- 7. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, rgba(10, 18, 48, .98) 0%, rgba(10, 18, 48, .9) 100%);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(8px);
}

.header-upper { position: relative; }

.header-upper-inner {
  display: flex;
  align-items: center;
  gap: clamp(.9rem, 2.4vw, 2rem);
  padding-block: .85rem;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  flex: 0 0 auto;
  text-decoration: none;
  color: var(--paper);
}

.brand-glyph {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--gold);
  border: 1px solid var(--gold);
  background: linear-gradient(145deg, rgba(201, 162, 39, .2), rgba(201, 162, 39, .02));
  border-radius: 2px;
  transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.brand-mark:hover .brand-glyph {
  background: rgba(201, 162, 39, .3);
  color: var(--gold-lift);
  transform: translateY(-1px);
}

.brand-text {
  display: flex;
  flex-direction: column;
  gap: .08rem;
  min-width: 0;
}

.brand-name {
  font-family: var(--font-serif);
  font-size: 1.16rem;
  font-weight: 700;
  letter-spacing: .05em;
  color: var(--paper);
  line-height: 1.3;
}

.brand-sub {
  font-size: .7rem;
  letter-spacing: .06em;
  color: var(--mist);
  line-height: 1.4;
  white-space: nowrap;
}

.header-notes {
  display: flex;
  align-items: center;
  gap: clamp(.75rem, 2vw, 1.5rem);
  margin-inline-start: auto;
  min-width: 0;
}

.header-note {
  font-size: .78rem;
  letter-spacing: .05em;
  color: var(--mist);
  white-space: nowrap;
}

.vault-entry {
  display: inline-flex;
  flex-direction: column;
  gap: .06rem;
  padding: .48rem .85rem;
  border: 1px solid rgba(201, 162, 39, .6);
  border-left: 3px solid var(--gold);
  background: linear-gradient(120deg, rgba(201, 162, 39, .16), rgba(17, 27, 62, .7));
  border-radius: 2px;
  text-decoration: none;
  color: var(--paper);
  box-shadow: var(--shadow-1);
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease, background-color .2s ease;
}

.vault-entry:hover,
.vault-entry:focus-visible {
  transform: translateY(-2px);
  border-color: var(--gold-lift);
  box-shadow: var(--shadow-2);
  color: var(--paper);
}

.vault-entry-label {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .16em;
  color: var(--gold-lift);
  text-transform: uppercase;
}

.vault-entry-text {
  font-size: .78rem;
  color: #DDD8CB;
  white-space: nowrap;
}

/* nav toggle */
.nav-toggle {
  display: none;
  align-items: center;
  gap: .55rem;
  padding: .55rem .8rem;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--paper);
  font-size: .84rem;
  letter-spacing: .06em;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color .2s ease, background-color .2s ease;
}

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

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

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

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

.site-header[data-open] .nav-toggle-bars { background: transparent; }
.site-header[data-open] .nav-toggle-bars::before { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle-bars::after { transform: translateY(-5px) rotate(-45deg); }

/* lower nav strip */
.primary-nav {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 27, 62, .6), rgba(17, 27, 62, .22));
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 clamp(.6rem, 2.6vw, 2.2rem);
}

.nav-item { position: relative; }

.nav-item + .nav-item { padding-left: clamp(.6rem, 2.6vw, 2.2rem); }

.nav-item + .nav-item::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 14px;
  background: var(--line);
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: .45rem;
  padding: .82rem .15rem;
  font-size: .95rem;
  letter-spacing: .04em;
  color: var(--paper);
  text-decoration: none;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: .5rem;
  height: 2px;
  background: var(--neon);
  transition: right .26s ease;
}

.nav-link:hover::after,
.nav-link:focus-visible::after { right: 0; }

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

.nav-index {
  font-family: var(--font-mono);
  font-size: .68rem;
  letter-spacing: .04em;
  color: var(--mist);
  transition: color .2s ease;
}

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

.nav-link[aria-current="page"] { color: var(--neon); }
.nav-link[aria-current="page"] .nav-index { color: var(--gold); }
.nav-link[aria-current="page"]::after { right: 0; background: var(--gold); }

/* ---------- 8. Footer ---------- */
.site-footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(17, 27, 62, .8), rgba(7, 13, 36, .98) 46%), var(--void);
}

.site-footer::before {
  content: "";
  display: block;
  height: 3px;
  background: linear-gradient(
    90deg,
    var(--gold) 0 14%,
    var(--clay) 14% 20%,
    var(--jade) 20% 26%,
    var(--violet) 26% 32%,
    rgba(56, 225, 198, .85) 32% 38%,
    transparent 38%
  );
  opacity: .85;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1.3fr;
  gap: clamp(1.6rem, 4vw, 3.2rem);
  padding-block: clamp(2.4rem, 6vw, 3.8rem) 2rem;
}

.footer-brand {
  font-family: var(--font-serif);
  font-size: clamp(1.3rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: .08em;
  color: var(--gold-lift);
  margin-bottom: .7rem;
}

.footer-tagline {
  font-size: .92rem;
  line-height: 1.85;
  color: #CFCABE;
  max-width: 34ch;
}

.footer-meta {
  margin-top: 1rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .08em;
  color: var(--mist);
}

.footer-heading {
  display: flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .18em;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: .95rem;
}

.footer-heading::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--line);
}

.footer-list a {
  display: block;
  padding: .48rem 0;
  font-size: .9rem;
  color: #D6D1C4;
  text-decoration: none;
  border-bottom: 1px dashed rgba(27, 42, 90, .95);
  transition: color .2s ease, padding-left .2s ease, border-color .2s ease;
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--neon);
  padding-left: .35rem;
  border-color: rgba(56, 225, 198, .45);
}

.footer-records li {
  padding: .42rem 0;
  font-family: var(--font-mono);
  font-size: .8rem;
  line-height: 1.75;
  color: var(--mist);
  word-break: break-word;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .6rem 1.5rem;
  padding-block: 1.15rem 1.6rem;
  border-top: 1px solid rgba(27, 42, 90, .75);
}

.footer-copy,
.footer-note {
  font-size: .76rem;
  letter-spacing: .05em;
  color: var(--mist);
}

/* ---------- 9. Breadcrumb ---------- */
.breadcrumb {
  margin-bottom: clamp(1.1rem, 3vw, 1.8rem);
  font-family: var(--font-mono);
  font-size: .76rem;
  letter-spacing: .08em;
  color: var(--mist);
}

.breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .5rem;
}

.breadcrumb li + li::before {
  content: "/";
  margin-right: .5rem;
  color: rgba(110, 123, 168, .7);
}

.breadcrumb a {
  color: var(--neon);
  text-decoration: none;
  border-bottom: 1px solid rgba(56, 225, 198, .35);
}

.breadcrumb a:hover { color: var(--gold-lift); border-color: var(--gold); }

.breadcrumb [aria-current="page"] { color: var(--paper); }

/* ---------- 10. Buttons & tags ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .72rem 1.35rem;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: .9rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
}

.btn--gold {
  background: var(--gold);
  color: var(--black);
  border-color: var(--gold);
  box-shadow: var(--shadow-1);
}

.btn--gold:hover,
.btn--gold:focus-visible {
  background: var(--gold-lift);
  border-color: var(--gold-lift);
  color: var(--black);
  transform: translateY(-2px);
  box-shadow: var(--shadow-2);
}

.btn--ghost {
  background: transparent;
  color: var(--paper);
  border-color: rgba(201, 162, 39, .55);
}

.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--neon);
  color: var(--neon);
  transform: translateY(-2px);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .18rem .62rem;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .1em;
  border: 1px solid var(--violet);
  color: var(--violet);
  border-radius: 2px;
  background: rgba(139, 127, 212, .1);
  white-space: nowrap;
}

.tag--gold { border-color: var(--gold); color: var(--gold-lift); background: rgba(201, 162, 39, .12); }
.tag--jade { border-color: var(--jade); color: #6FC9B2; background: rgba(46, 125, 107, .16); }
.tag--clay { border-color: var(--clay); color: #E0A179; background: rgba(181, 106, 60, .14); }
.tag--neon { border-color: var(--neon); color: var(--neon); background: rgba(56, 225, 198, .1); }

/* ---------- 11. Card / entry ---------- */
.card {
  position: relative;
  padding: clamp(1.1rem, 2.4vw, 1.6rem);
  background: linear-gradient(160deg, rgba(17, 27, 62, .95), rgba(13, 21, 48, .92));
  border: var(--hair);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.card::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 46px;
  height: 46px;
  background: linear-gradient(225deg, rgba(201, 162, 39, .8), rgba(201, 162, 39, 0) 72%);
  pointer-events: none;
}

.card:hover,
.card:focus-within {
  transform: translateY(-3px);
  border-color: rgba(201, 162, 39, .55);
  box-shadow: var(--shadow-2);
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  margin-bottom: .7rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--paper);
  line-height: 1.45;
}

.card-body {
  font-size: .93rem;
  line-height: 1.85;
  color: #D3CEC2;
}

.card-foot {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px dashed rgba(27, 42, 90, .95);
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--mist);
}

.entry-list {
  display: grid;
  gap: .1rem;
}

.entry {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .5rem .9rem;
  padding: .78rem .2rem;
  border-bottom: 1px dashed rgba(27, 42, 90, .9);
  font-size: .93rem;
  line-height: 1.8;
  color: #D6D1C4;
  transition: background-color .2s ease, padding-left .2s ease;
}

.entry:hover {
  background: linear-gradient(90deg, rgba(56, 225, 198, .07), transparent 70%);
  padding-left: .55rem;
}

.entry strong {
  font-family: var(--font-mono);
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--gold-lift);
  font-weight: 700;
}

/* ---------- 12. Index tree ---------- */
.index-tree {
  border: var(--hair);
  background: rgba(17, 27, 62, .5);
  border-radius: var(--radius);
  padding: .7rem;
}

.index-link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: .6rem;
  padding: .6rem .75rem;
  font-size: .88rem;
  color: #CFCABE;
  text-decoration: none;
  border-left: 2px solid transparent;
  border-radius: 2px;
  transition: color .2s ease, background-color .2s ease, border-color .2s ease;
}

.index-link::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--line);
  transform: rotate(45deg);
  transition: background-color .2s ease;
}

.index-link:hover {
  color: var(--neon);
  background: rgba(56, 225, 198, .07);
}

.index-link:hover::before { background: var(--neon); }

.index-link[aria-current] {
  color: var(--neon);
  border-left-color: var(--gold);
  background: rgba(201, 162, 39, .1);
}

.index-link[aria-current]::before { background: var(--gold); }

/* ---------- 13. Accordion ---------- */
.accordion {
  border-top: var(--hair);
}

.accordion-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  padding: 1rem .2rem;
  background: transparent;
  border: 0;
  border-bottom: var(--hair);
  text-align: left;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--paper);
  cursor: pointer;
  transition: color .2s ease, padding-left .2s ease;
}

.accordion-trigger::after {
  content: "+";
  flex: none;
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1;
  color: var(--gold);
  transition: transform .22s ease, color .22s ease;
}

.accordion-trigger:hover,
.accordion-trigger:focus-visible { color: var(--neon); padding-left: .5rem; }

.accordion-trigger[aria-expanded="true"] { color: var(--neon); }
.accordion-trigger[aria-expanded="true"]::after { content: "−"; color: var(--neon); }

.accordion-panel {
  padding: .95rem .2rem 1.25rem;
  border-bottom: var(--hair);
  font-size: .93rem;
  line-height: 1.9;
  color: #D3CEC2;
}

.accordion-panel[hidden] { display: none; }

/* ---------- 14. Data list ---------- */
.data-list { border-top: var(--hair); }

.data-row {
  display: grid;
  grid-template-columns: minmax(9rem, 30%) 1fr;
  gap: .5rem 1.25rem;
  padding: .8rem .2rem;
  border-bottom: var(--hair);
  font-size: .92rem;
  line-height: 1.8;
}

.data-row dt {
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .08em;
  color: var(--gold-lift);
}

.data-row dd { color: #D6D1C4; }

/* ---------- 15. Copy button ---------- */
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .3rem .68rem;
  font-family: var(--font-mono);
  font-size: .74rem;
  letter-spacing: .06em;
  color: var(--neon);
  background: rgba(56, 225, 198, .08);
  border: 1px solid rgba(56, 225, 198, .45);
  border-radius: 2px;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}

.copy-btn:hover,
.copy-btn:focus-visible {
  background: rgba(56, 225, 198, .18);
  border-color: var(--neon);
}

.copy-btn.is-copied {
  color: var(--black);
  background: var(--gold);
  border-color: var(--gold);
}

/* ---------- 16. Image frames ---------- */
.frame {
  position: relative;
  overflow: hidden;
  border: var(--hair);
  border-radius: var(--radius);
  background: linear-gradient(160deg, var(--card), #0B1331);
  box-shadow: var(--shadow-1);
}

.frame::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(180deg, rgba(10, 18, 48, 0) 52%, rgba(10, 18, 48, .68) 100%);
}

.frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.92) contrast(1.03) brightness(.96);
}

.frame[data-ratio="21x9"] { aspect-ratio: 21 / 9; }
.frame[data-ratio="16x9"] { aspect-ratio: 16 / 9; }
.frame[data-ratio="4x3"] { aspect-ratio: 4 / 3; }
.frame[data-ratio="1x1"] { aspect-ratio: 1 / 1; }
.frame[data-ratio="3x4"] { aspect-ratio: 3 / 4; }

.frame-caption {
  position: absolute;
  left: 0;
  bottom: 0;
  z-index: 2;
  max-width: 100%;
  padding: .5rem .85rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .08em;
  color: var(--paper);
  background: rgba(10, 18, 48, .82);
  border-top: 1px solid var(--line);
  border-right: 1px solid var(--line);
}

.frame-corner {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  width: 38px;
  height: 38px;
  background: linear-gradient(225deg, rgba(201, 162, 39, .9), rgba(201, 162, 39, 0) 72%);
}

/* ---------- 17. Scroll progress (JS 注入) ---------- */
.scroll-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 60;
  height: 2px;
  pointer-events: none;
  transform-origin: 0 50%;
  transform: scaleX(var(--scroll-x, 0));
  background: linear-gradient(90deg, var(--gold), var(--neon));
}

/* ---------- 18. Reveal ---------- */
html[data-reveal-ready] [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s ease, transform .5s ease;
}

html[data-reveal-ready] [data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}

/* ---------- 19. Motion preference ---------- */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  html { scroll-behavior: auto; }

  html[data-reveal-ready] [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .card:hover,
  .card:focus-within,
  .btn:hover,
  .vault-entry:hover { transform: none; }
}

/* ---------- 20. Responsive ---------- */
@media (max-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-col-record { grid-column: 1 / -1; }
}

@media (max-width: 920px) {
  html { scroll-padding-top: 5.2rem; }

  .header-note { display: none; }
  .nav-toggle { display: inline-flex; }

  .primary-nav {
    max-height: 0;
    overflow: hidden;
    border-top-color: transparent;
    transition: max-height .28s ease, border-color .28s ease;
  }

  .site-header[data-open] .primary-nav {
    max-height: 34rem;
    overflow-y: auto;
    border-top-color: var(--line);
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-block: .35rem .7rem;
  }

  .nav-item + .nav-item { padding-left: 0; }

  .nav-item + .nav-item::before {
    left: .15rem;
    right: .15rem;
    top: 0;
    width: auto;
    height: 1px;
    transform: none;
    background: rgba(27, 42, 90, .8);
  }

  .nav-link {
    display: flex;
    width: 100%;
    padding: .85rem .2rem;
    font-size: 1rem;
  }

  .nav-link::after { bottom: .55rem; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }

  .brand-glyph { width: 36px; height: 36px; font-size: 1rem; }
  .brand-name { font-size: 1.02rem; }
  .brand-sub { display: none; }

  .vault-entry { padding: .42rem .62rem; }
  .vault-entry-text { display: none; }

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

  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-col-record { grid-column: auto; }
  .footer-base { flex-direction: column; align-items: flex-start; }

  .data-row { grid-template-columns: minmax(0, 1fr); }
  .data-row dt { margin-bottom: .1rem; }

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

@media (max-width: 420px) {
  .header-upper-inner { flex-wrap: wrap; gap: .7rem; }
  .header-notes { margin-inline-start: 0; }
  .nav-toggle { margin-inline-start: auto; }
  .frame-caption { font-size: .68rem; padding: .4rem .6rem; }
}
