/* ============================================================
   龙8电子主页 · /assets/site.css
   共享外壳：reset / 变量 / 中文排版 / 头部 / 页脚 / 基础组件
   ============================================================ */

/* ---------- 1. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body, h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }
hr { border: 0; }
[hidden] { display: none !important; }

/* ---------- 2. 变量 ---------- */
:root {
  --deep-red: #7A121C;
  --pomegranate: #A61B29;
  --edge: #4E0C14;
  --gold: #D4A03C;
  --gold-light: #F2D48A;
  --blue: #1B3A6B;
  --jade: #1F7A6B;
  --cream: #F6F0E4;
  --paper: #FFFFFF;
  --ink: #2A1E1C;
  --taupe: #6B5A52;

  --f-head: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --f-body: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --f-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", Georgia, serif;
  --f-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --maxw: 1280px;
  --gutter: clamp(16px, 4vw, 40px);
  --r: 4px;
  --shadow-1: 0 1px 0 var(--edge), 0 8px 20px rgba(42, 30, 28, .12);
  --shadow-2: 0 18px 40px rgba(42, 30, 28, .22);
  --dur: 180ms;
  --ease: ease-out;
}

/* ---------- 3. 基础排版 ---------- */
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  overflow-x: hidden;
}
h1, h2, h3, h4 {
  font-family: var(--f-head);
  font-weight: 900;
  line-height: 1.18;
  letter-spacing: -.01em;
  color: var(--ink);
}
h1 { font-size: clamp(32px, 6vw, 56px); }
h2 { font-size: clamp(25px, 3.4vw, 40px); }
h3 { font-size: 20px; }
strong { font-weight: 700; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
#main-content:focus { outline: none; }

.wrap {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
}
.section { padding: clamp(40px, 7vw, 80px) 0; }
.prose { font-size: 16px; line-height: 1.75; }
.prose > p { max-width: 38em; }
.prose p + p { margin-top: 1em; }
.prose h2 { font-size: clamp(25px, 3vw, 32px); margin: 1.6em 0 .6em; }
.prose h3 { font-size: 20px; margin: 1.4em 0 .5em; }
.prose ul { list-style: disc; padding-left: 1.3em; max-width: 38em; }
.prose li + li { margin-top: .35em; }
.prose a { color: var(--blue); border-bottom: 1px solid rgba(27, 58, 107, .45); }
.prose a:hover { background: rgba(212, 160, 60, .22); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px;
  padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---------- 4. skip link ---------- */
.skip-link {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 10px 16px;
  background: var(--gold-light); color: var(--edge);
  font-family: var(--f-mono); font-size: 14px; font-weight: 700;
  border: 2px solid var(--edge); border-radius: var(--r);
  transform: translateY(-160%);
  transition: transform var(--dur) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

/* ---------- 5. 头部 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: var(--cream);
  border-bottom: 1px solid rgba(78, 12, 20, .18);
}
.scroll-progress {
  position: absolute; top: 0; left: 0; height: 2px; width: 0;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
  z-index: 4;
}

/* 上层信息条 */
.topline {
  background: var(--deep-red);
  color: var(--gold-light);
  font-family: var(--f-mono);
  font-size: 12px;
  letter-spacing: .04em;
}
.topline__inner {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
  padding: 8px 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 18px;
}
.topline__brand { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topline__mark { font-weight: 700; color: var(--gold-light); }
.topline__note { color: rgba(242, 212, 138, .72); }
.topline__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.topline__entry {
  display: inline-flex; align-items: center;
  padding: 3px 12px;
  border: 1px solid rgba(242, 212, 138, .6);
  border-radius: 999px;
  color: var(--gold-light);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.topline__entry:hover { background: var(--gold-light); color: var(--edge); }
.meta-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: var(--r);
  background: rgba(0, 0, 0, .22);
}
.meta-chip__key { color: rgba(242, 212, 138, .7); }
.meta-chip__val { color: var(--gold-light); font-weight: 700; }
@keyframes stampFlash {
  from { background: var(--gold-light); color: var(--edge); }
  to { background: transparent; color: var(--gold-light); }
}
.meta-chip__val.is-flash { animation: stampFlash 320ms var(--ease); }

/* 下层栏目条 */
.navbar {
  background-color: var(--cream);
  background-image: repeating-linear-gradient(90deg, rgba(212, 160, 60, .85) 0 2px, transparent 2px 11px);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 100% 1px;
}
.navbar__inner {
  width: min(100% - (var(--gutter) * 2), var(--maxw));
  margin-inline: auto;
  padding: 8px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.brand { display: inline-flex; align-items: center; gap: 12px; }
.brand__glyph {
  position: relative; flex: none;
  width: 34px; height: 34px;
  background: linear-gradient(135deg, var(--pomegranate), var(--deep-red));
  clip-path: polygon(32% 0, 100% 0, 100% 68%, 68% 100%, 0 100%, 0 32%);
}
.brand__glyph::after {
  content: ""; position: absolute; inset: 9px;
  border: 1px solid var(--gold);
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__text strong {
  font-family: var(--f-head); font-weight: 900; font-size: 20px; letter-spacing: -.01em;
}
.brand__text span {
  font-family: var(--f-mono); font-size: 12px; color: var(--taupe); letter-spacing: .06em;
}
.nav { display: flex; align-items: center; gap: 6px; }
.nav__list { display: flex; align-items: center; gap: 2px; }
.nav__list a {
  position: relative; display: block;
  padding: 14px 14px;
  font-weight: 700; font-size: 16px; color: var(--ink);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.nav__list a::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 8px; height: 2px;
  background: var(--gold);
  transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur) var(--ease);
}
.nav__list a:hover { color: var(--deep-red); }
.nav__list a:hover::after { transform: scaleX(1); }
.nav__list a[aria-current="page"] {
  background: var(--deep-red); color: var(--gold-light); border-radius: var(--r);
}
.nav__list a[aria-current="page"]::after { transform: scaleX(1); }
.nav__search {
  display: inline-flex; align-items: center; gap: 8px;
  margin-left: 8px; padding: 9px 16px;
  border: 1px solid var(--gold); border-radius: 999px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em;
  color: var(--deep-red); background: rgba(212, 160, 60, .14);
  transition: background-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.nav__search::before {
  content: ""; width: 9px; height: 9px; border: 2px solid currentColor; border-radius: 999px;
}
.nav__search:hover { background: var(--gold-light); transform: translateY(-2px); }

/* 移动端导航按钮 */
.nav-toggle {
  display: none;
  align-items: center; gap: 8px;
  padding: 9px 14px;
  border: 1px solid var(--deep-red); border-radius: var(--r);
  color: var(--deep-red);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em;
}
.nav-toggle__bars { position: relative; display: block; width: 20px; height: 2px; background: currentColor; }
.nav-toggle__bars::before, .nav-toggle__bars::after {
  content: ""; position: absolute; left: 0; width: 20px; height: 2px; background: currentColor;
}
.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] { background: var(--deep-red); color: var(--gold-light); border-color: var(--deep-red); }

@media (max-width: 900px) {
  .navbar__inner { flex-wrap: wrap; }
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    order: 3;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding-top: 10px;
    border-top: 1px solid rgba(212, 160, 60, .6);
  }
  .nav[data-open] { display: flex; }
  .nav__list { flex-direction: column; align-items: stretch; }
  .nav__list a {
    padding: 14px 10px;
    border-bottom: 1px solid rgba(42, 30, 28, .12);
  }
  .nav__list a::after { display: none; }
  .nav__list a[aria-current="page"] {
    background: rgba(122, 18, 28, .08);
    color: var(--deep-red);
    box-shadow: inset 4px 0 0 var(--pomegranate);
  }
  .nav__search { margin: 14px 0 4px; align-self: flex-start; }
}

/* ---------- 6. 页脚 ---------- */
.site-footer {
  background: var(--deep-red);
  color: rgba(242, 212, 138, .88);
  margin-top: clamp(40px, 8vw, 96px);
}
.footer__band {
  height: 8px;
  background: linear-gradient(90deg, var(--edge), var(--pomegranate) 42%, var(--gold) 100%);
  border-top: 1px solid var(--gold);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 26px 32px;
  padding: clamp(30px, 5vw, 52px) 0 clamp(22px, 3vw, 32px);
}
.footer__col { min-width: 0; }
.footer__title {
  font-family: var(--f-mono);
  font-size: 12px; font-weight: 700; letter-spacing: .16em;
  color: var(--gold);
  padding-bottom: 8px; margin-bottom: 12px;
  border-bottom: 1px solid rgba(212, 160, 60, .45);
}
.footer__links { display: grid; gap: 8px; }
.footer__links a {
  display: inline-block;
  color: var(--gold-light); font-size: 16px;
  border-bottom: 1px solid transparent;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.footer__links a:hover { color: var(--paper); border-bottom-color: var(--gold-light); }
.footer__hint {
  margin-top: 12px;
  font-size: 14px; line-height: 1.6;
  color: rgba(242, 212, 138, .66);
  max-width: 30ch;
}
.footer__brand {
  font-family: var(--f-head); font-weight: 900; font-size: 20px;
  color: var(--paper); letter-spacing: -.01em;
}
.footer__brand span {
  display: inline-block; margin-left: 6px;
  font-family: var(--f-mono); font-size: 12px; font-weight: 400;
  letter-spacing: .1em; color: var(--gold);
  border: 1px solid rgba(212, 160, 60, .6); border-radius: 999px;
  padding: 2px 10px; vertical-align: middle;
}
.footer__rule { background: var(--gold); opacity: .55; }
.footer__record {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 22px;
  padding: 18px 0 30px;
}
.footer__meta {
  font-family: var(--f-mono);
  font-size: 12px; letter-spacing: .04em;
  color: rgba(242, 212, 138, .74);
}
.copy-chip {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 4px 12px;
  border: 1px dashed rgba(242, 212, 138, .55);
  border-radius: 999px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--gold-light);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.copy-chip::before {
  content: ""; width: 8px; height: 8px;
  border: 1px solid currentColor; border-radius: 1px;
}
.copy-chip:hover { background: rgba(242, 212, 138, .16); }
.copy-chip.is-done { background: var(--gold-light); color: var(--edge); border-style: solid; }

@media (min-width: 620px) {
  .footer__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 1000px) {
  .footer__grid { grid-template-columns: 1.3fr 1fr 1fr 1.1fr; gap: 34px; }
  .footer__record { justify-content: flex-start; }
}

/* ---------- 7. 章节头 / 色带 / 收尾线 ---------- */
.section-head {
  position: relative;
  display: grid; gap: 6px;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(212, 160, 60, .6);
  transition: background-color var(--dur) var(--ease);
}
.section-head::before {
  content: ""; position: absolute; left: 0; bottom: -2px;
  width: 68px; height: 3px; background: var(--gold);
}
.section-head__index {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em;
  color: var(--pomegranate);
}
.section-head__title { font-size: clamp(25px, 3.2vw, 40px); font-weight: 900; }
.section-head__note { color: var(--taupe); font-size: 16px; max-width: 58ch; }
.section-head.is-target { background: linear-gradient(90deg, rgba(212, 160, 60, .22), transparent 72%); }
.section-head.is-target .section-head__title { color: var(--deep-red); }

.theme-band {
  position: relative;
  overflow: hidden;
  background: var(--deep-red);
  color: var(--gold-light);
  padding: clamp(26px, 4vw, 42px) 0;
}
.theme-band::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: repeating-linear-gradient(115deg, rgba(242, 212, 138, .12) 0 2px, transparent 2px 26px);
}
.theme-band:nth-of-type(even) { background: var(--edge); }
.theme-band__inner {
  position: relative;
  display: grid; gap: 14px;
}
.theme-band__title {
  font-size: clamp(20px, 2.6vw, 32px); font-weight: 900; letter-spacing: -.01em;
  color: var(--gold-light);
}
.theme-band__meta {
  display: flex; flex-wrap: wrap; gap: 10px 20px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  color: rgba(242, 212, 138, .78);
}
@media (min-width: 860px) {
  .theme-band__inner { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 32px; }
}
.hairline { height: 1px; background: var(--gold); opacity: .6; }

/* ---------- 8. 叠压卡片 ---------- */
.stack-cards { display: grid; gap: 18px; }
.stack-card {
  position: relative;
  padding: 22px;
  background: var(--paper);
  border: 1px solid rgba(78, 12, 20, .25);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.stack-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.stack-card--cut::after {
  content: ""; position: absolute; right: 0; bottom: 0;
  width: 24px; height: 24px;
  background: linear-gradient(135deg, transparent 50%, var(--gold) 50%);
}
@media (min-width: 820px) {
  .stack-cards { grid-template-columns: repeat(12, 1fr); gap: 0; align-items: start; }
  .stack-card { grid-column: 1 / span 7; grid-row: 1; }
  .stack-card:nth-child(2) {
    grid-column: 6 / span 7; grid-row: 1;
    margin-top: 64px; z-index: 2;
    box-shadow: var(--shadow-2);
  }
}

/* ---------- 9. 专题研究板 ---------- */
.plate {
  display: grid;
  background: var(--paper);
  border: 1px solid rgba(78, 12, 20, .28);
  border-radius: var(--r);
  overflow: hidden;
}
.plate__summary {
  padding: 20px 22px;
  font-size: 17px; line-height: 1.7;
  border-left: 4px solid var(--pomegranate);
}
.plate__boundary {
  padding: 14px 22px;
  background: var(--cream);
  color: var(--taupe);
  font-size: 14px; line-height: 1.7;
  border-top: 1px dashed rgba(78, 12, 20, .3);
}
.plate__label {
  display: block; margin-bottom: 4px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em;
  color: var(--pomegranate);
}
.plate__terms {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  padding: 18px 22px;
}
.plate__term {
  padding: 10px 12px;
  border: 1px solid rgba(31, 122, 107, .45);
  border-radius: var(--r);
  background: rgba(31, 122, 107, .07);
  font-size: 14px; line-height: 1.6;
}
.plate__term b { display: block; color: var(--jade); font-weight: 700; }
.plate__further {
  padding: 14px 22px;
  border-top: 1px solid rgba(212, 160, 60, .6);
  background: linear-gradient(90deg, rgba(212, 160, 60, .16), transparent 80%);
  font-size: 14px;
}
.plate__further a { color: var(--blue); border-bottom: 1px solid rgba(27, 58, 107, .4); }

/* ---------- 10. 通用按钮 / 标签 / 面包屑 ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px;
  border: 1px solid transparent; border-radius: var(--r);
  font-family: var(--f-head); font-weight: 700; font-size: 16px;
  background: var(--pomegranate); color: var(--paper);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease), background-color var(--dur) var(--ease);
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(122, 18, 28, .3); background: var(--deep-red); }
.btn--gold { background: var(--gold); color: var(--edge); }
.btn--gold:hover { background: var(--gold-light); box-shadow: 0 8px 18px rgba(212, 160, 60, .34); }
.btn--ghost { background: transparent; color: var(--deep-red); border-color: var(--deep-red); }
.btn--ghost:hover { background: rgba(122, 18, 28, .08); box-shadow: none; }
.btn--on-dark { background: var(--gold-light); color: var(--edge); }
.btn--on-dark:hover { background: var(--paper); box-shadow: 0 8px 18px rgba(0, 0, 0, .28); }
.btn--sm { padding: 8px 14px; font-size: 14px; }

.tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border: 1px solid currentColor; border-radius: 999px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--blue); background: rgba(27, 58, 107, .08);
}
.tag--gold { color: #8A6212; background: rgba(212, 160, 60, .18); }
.tag--jade { color: var(--jade); background: rgba(31, 122, 107, .1); }
.tag--red { color: var(--pomegranate); background: rgba(166, 27, 41, .1); }

.breadcrumb {
  padding: 14px 0;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .04em;
  color: var(--taupe);
}
.breadcrumb__list { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.breadcrumb__list li { display: inline-flex; align-items: center; gap: 6px; }
.breadcrumb__list li + li::before { content: "/"; color: var(--gold); }
.breadcrumb a { color: var(--blue); border-bottom: 1px solid rgba(27, 58, 107, .35); }
.breadcrumb a:hover { background: rgba(212, 160, 60, .22); }

/* ---------- 11. 网格与图片容器 ---------- */
.grid-2 { display: grid; gap: 22px; }
.grid-asym { display: grid; gap: 22px; }
@media (min-width: 768px) { .grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 900px) { .grid-asym { grid-template-columns: 1.35fr .85fr; gap: 30px; } }

.media-frame {
  position: relative;
  display: block; overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(212, 160, 60, .55);
  border-radius: var(--r);
  background: linear-gradient(135deg, var(--deep-red), var(--edge) 70%);
}
.media-frame::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    repeating-linear-gradient(90deg, rgba(242, 212, 138, .16) 0 1px, transparent 1px 30px),
    repeating-linear-gradient(0deg, rgba(27, 58, 107, .22) 0 1px, transparent 1px 30px);
}
.media-frame > img { width: 100%; height: 100%; object-fit: cover; }
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 3 / 4; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame__label {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  padding: 3px 10px;
  background: rgba(42, 30, 28, .78); color: var(--gold-light);
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  border-radius: 999px;
}
.media-frame__caption {
  position: absolute; left: 0; right: 0; bottom: 0; z-index: 2;
  padding: 10px 14px;
  background: linear-gradient(180deg, transparent, rgba(42, 30, 28, .86));
  color: var(--gold-light);
  font-size: 14px; line-height: 1.5;
}

/* ---------- 12. 显现 / 筛选状态 ---------- */
[data-reveal] {
  opacity: 0; transform: translateY(8px);
  transition: opacity 320ms var(--ease), transform 320ms var(--ease);
}
[data-reveal].is-in { opacity: 1; transform: none; }

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.filter-bar [data-filter] {
  padding: 7px 14px;
  border: 1px solid rgba(78, 12, 20, .3); border-radius: 999px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--taupe);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
}
.filter-bar [data-filter]:hover { background: rgba(212, 160, 60, .2); color: var(--ink); }
.filter-bar [data-filter].is-active {
  background: var(--deep-red); border-color: var(--deep-red); color: var(--gold-light);
}

/* ---------- 13. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  [data-reveal] { opacity: 1; transform: none; }
  .stack-card:hover, .btn:hover, .nav__search:hover { transform: none; }
}
