/* ============================================================
   天博克罗地亚 · 全站共享样式 /assets/site.css
   暖纸底 + 亚得里亚深蓝 + 棋盘红 + 亮金，印刷档案系统
   ============================================================ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

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

ul, ol { padding: 0; list-style: none; }

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

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

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

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

/* ---------- 2. 变量 ---------- */
:root {
  --navy: #0B2B5B;
  --navy-deep: #123A72;
  --red: #D42B32;
  --gold: #F5B417;
  --paper: #F6EFE1;
  --paper-2: #EBE0C9;
  --ink: #14161A;
  --muted: #55688A;
  --white: #FFFFFF;

  --hair: rgba(11, 43, 91, 0.18);
  --hair-light: rgba(255, 255, 255, 0.18);

  --s1: 8px;
  --s2: 16px;
  --s3: 24px;
  --s4: 40px;
  --s5: 64px;
  --s6: 96px;

  --w-wide: 1180px;
  --w-text: 36em;

  --font-head: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: var(--font-head);
  --font-mono: "IBM Plex Mono", "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --shadow-card: 0 2px 0 rgba(11, 43, 91, 0.08), 0 14px 26px -20px rgba(11, 43, 91, 0.6);

  --checker-lg: 8px;
  --checker-sm: 8px;
}

/* ---------- 3. 基础排版 ---------- */
body {
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  text-rendering: optimizeLegibility;
}

@media (min-width: 768px) {
  body { font-size: 17px; }
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-head);
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--navy);
}

h1 { font-size: clamp(28px, 6vw, 44px); }
h2 { font-size: clamp(24px, 4.4vw, 34px); }
h3 { font-size: clamp(19px, 2.6vw, 24px); }
h4 { font-size: clamp(16px, 2vw, 19px); }

p { text-wrap: pretty; }

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

/* ---------- 4. 焦点与可访问性 ---------- */
:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.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;
}

.skip-link {
  position: fixed;
  left: 50%;
  top: 0;
  z-index: 300;
  transform: translate(-50%, -160%);
  padding: 10px 20px;
  background: var(--gold);
  color: var(--ink);
  font-weight: 900;
  letter-spacing: 0.06em;
  border: 2px solid var(--ink);
  transition: transform 0.16s ease-out;
}

.skip-link:focus {
  transform: translate(-50%, 0);
}

#main-content { display: block; }
#main-content:focus { outline: none; }

.page-main { display: block; }

/* ---------- 5. 容器与栅格 ---------- */
.container {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding-inline: 20px;
}

@media (min-width: 768px) {
  .container { padding-inline: 32px; }
}

@media (min-width: 1200px) {
  .container { padding-inline: 40px; }
}

.grid {
  display: grid;
  gap: var(--s3);
}

.grid--split { grid-template-columns: 1fr; }

@media (min-width: 900px) {
  .grid--split {
    grid-template-columns: 7fr 5fr;
    gap: var(--s4);
  }
}

.grid--cards { grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid--cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1024px) {
  .grid--cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- 6. 通用文本组件 ---------- */
.prose {
  max-width: var(--w-text);
}

.prose > * + * { margin-top: var(--s2); }

.prose h2,
.prose h3 {
  margin-top: var(--s5);
}

.prose ul {
  display: grid;
  gap: 10px;
}

.prose ul li {
  position: relative;
  padding-left: 22px;
}

.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.72em;
  width: 8px;
  height: 8px;
  background: var(--red);
}

.prose a {
  color: var(--navy-deep);
  font-weight: 700;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
  transition: color 0.16s ease-out;
}

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

.lede {
  font-size: clamp(17px, 2.4vw, 20px);
  line-height: 1.7;
  color: var(--navy-deep);
  max-width: var(--w-text);
}

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.section-label {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumbs {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--gold);
}

.breadcrumbs a {
  transition: color 0.16s ease-out;
}

.breadcrumbs a:hover {
  color: var(--red);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.breadcrumbs [aria-current="page"] {
  color: var(--navy);
  font-weight: 700;
}

/* ---------- 8. 按钮 ---------- */
.button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.04em;
  color: var(--navy);
  background: var(--white);
  border: 2px solid var(--navy);
  cursor: pointer;
  transition: transform 0.16s ease-out, background-color 0.16s ease-out,
              color 0.16s ease-out, border-color 0.16s ease-out;
}

.button:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
  transform: translate(-2px, -2px);
}

.button:active { transform: translate(0, 0); }

.button--solid {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
}

.button--solid:hover {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

.button--ghost {
  background: transparent;
  border-color: var(--gold);
  color: var(--navy);
}

.button--ghost:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--ink);
}

/* ---------- 9. 区块标题 ---------- */
.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--s2);
  padding-bottom: var(--s2);
  border-bottom: 3px solid var(--navy);
  margin-bottom: var(--s4);
}

.section-head__title { font-size: clamp(22px, 3.4vw, 32px); }

.section-head__meta {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* ---------- 10. 档案卡与标签 ---------- */
.archive-card {
  position: relative;
  display: block;
  padding: var(--s3);
  background: var(--white);
  border: 1px solid var(--hair);
  border-top: 4px solid var(--red);
  box-shadow: var(--shadow-card);
  transition: transform 0.2s ease-out, box-shadow 0.2s ease-out,
              border-color 0.2s ease-out, border-top-color 0.2s ease-out;
}

.archive-card:hover {
  transform: translate(-2px, -3px);
  border-top-color: var(--gold);
  box-shadow: 0 4px 0 rgba(11, 43, 91, 0.1), 0 22px 34px -22px rgba(11, 43, 91, 0.65);
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--navy);
  background: var(--paper-2);
  border: 1px solid var(--hair);
  transition: transform 0.16s ease-out, background-color 0.16s ease-out,
              color 0.16s ease-out, border-color 0.16s ease-out;
}

.tag-chip:hover,
.tag-chip[aria-pressed="true"] {
  background: var(--red);
  border-color: var(--red);
  color: var(--white);
  transform: translate(2px, 2px);
}

/* ---------- 11. 图片容器（供页面阶段放图） ---------- */
.figure-frame {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  background-color: var(--paper-2);
  border: 1px solid var(--hair);
}

.figure-frame img,
.figure-frame__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.03);
  transition: transform 0.4s ease-out;
}

.figure-frame:hover img,
.figure-frame:hover .figure-frame__img {
  transform: scale(1.03);
}

.figure-frame__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  max-width: 100%;
  padding: 6px 12px;
  background: rgba(11, 43, 91, 0.88);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
}

.figure-frame--wide { aspect-ratio: 16 / 9; }
.figure-frame--tall { aspect-ratio: 4 / 5; }

/* ---------- 12. 棋盘格分隔带 ---------- */
.checker-band {
  height: 8px;
  background-color: var(--white);
  background-image:
    linear-gradient(45deg, var(--red) 25%, transparent 25%, transparent 75%, var(--red) 75%),
    linear-gradient(45deg, var(--red) 25%, transparent 25%, transparent 75%, var(--red) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

/* ---------- 13. 索引对照表 ---------- */
.index-table {
  width: 100%;
  font-size: 15px;
  background: var(--white);
  border: 1px solid var(--hair);
}

.index-table th,
.index-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--hair);
}

.index-table thead th {
  background: var(--navy);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.14em;
  border-bottom: 0;
}

.index-table tbody tr:nth-child(even) {
  background: var(--paper-2);
}

.index-table tbody tr {
  transition: background-color 0.16s ease-out;
}

.index-table tbody tr:hover {
  background: rgba(245, 180, 23, 0.24);
}

.index-table td.mono {
  white-space: nowrap;
}

/* ============================================================
   14. 页头
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: var(--navy);
  color: var(--white);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.18);
}

.site-header::before {
  content: "";
  display: block;
  height: 6px;
  background-color: var(--white);
  background-image:
    linear-gradient(45deg, var(--red) 25%, transparent 25%, transparent 75%, var(--red) 75%),
    linear-gradient(45deg, var(--red) 25%, transparent 25%, transparent 75%, var(--red) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
}

.site-header__bar {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding: var(--s2) 20px var(--s1);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--s2);
}

.site-header__badge {
  grid-column: 1;
  justify-self: start;
  padding: 4px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
  border: 1px solid rgba(245, 180, 23, 0.5);
  white-space: nowrap;
}

.masthead {
  grid-column: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.masthead__name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(22px, 4.6vw, 38px);
  line-height: 1.08;
  letter-spacing: 0.06em;
  color: var(--white);
  transition: color 0.16s ease-out;
}

.masthead:hover .masthead__name { color: var(--gold); }

.masthead__tagline {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: rgba(255, 255, 255, 0.68);
}

/* 移动按钮 */
.nav-toggle {
  grid-column: 3;
  justify-self: end;
  display: none;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.42);
  transition: border-color 0.16s ease-out, color 0.16s ease-out;
}

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

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: background-color 0.2s ease-out;
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: currentColor;
  transition: transform 0.2s ease-out;
}

.nav-toggle__bars::before { top: -6px; }
.nav-toggle__bars::after { top: 6px; }

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

/* 导航 */
.site-nav {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding: 0 20px var(--s2);
  display: flex;
  align-items: center;
  gap: var(--s3);
}

.site-nav__edge {
  flex: 1 1 auto;
  min-width: 24px;
  height: 8px;
  background-color: var(--white);
  background-image:
    linear-gradient(45deg, var(--red) 25%, transparent 25%, transparent 75%, var(--red) 75%),
    linear-gradient(45deg, var(--red) 25%, transparent 25%, transparent 75%, var(--red) 75%);
  background-size: 8px 8px;
  background-position: 0 0, 4px 4px;
  opacity: 0.9;
}

.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.6vw, 32px);
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.16s ease-out;
}

.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: var(--gold);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease-out, background-color 0.16s ease-out;
}

.site-nav__link:hover { color: var(--white); }
.site-nav__link:hover::after { transform: scaleX(1); }

.site-nav__link[aria-current="page"] { color: var(--white); }

.site-nav__link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--red);
}

.site-nav__link[aria-current="page"]::before {
  content: "";
  position: absolute;
  left: -12px;
  top: 50%;
  width: 6px;
  height: 6px;
  background: var(--gold);
  transform: translateY(-50%);
}

/* 阅读进度刻度 */
.scroll-meter {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 120;
  height: 4px;
  background: rgba(11, 43, 91, 0.14);
  pointer-events: none;
}

.scroll-meter__fill {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--gold));
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.1s linear;
}

/* ============================================================
   15. 页脚
   ============================================================ */
.site-footer {
  margin-top: var(--s6);
  background: var(--navy);
  color: rgba(255, 255, 255, 0.86);
}

.site-footer__inner {
  width: 100%;
  max-width: var(--w-wide);
  margin-inline: auto;
  padding: var(--s5) 20px var(--s3);
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--s4);
}

@media (min-width: 900px) {
  .site-footer__inner {
    grid-template-columns: 1.05fr 2fr;
    gap: var(--s5);
    padding-inline: 32px;
  }
}

.footer-brand__name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: 0.06em;
  color: var(--white);
}

.footer-brand__tagline {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(255, 255, 255, 0.58);
}

.footer-brand__note {
  margin-top: var(--s2);
  max-width: 34em;
  font-size: 14px;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.72);
}

.footer-cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--s3);
}

@media (min-width: 768px) {
  .footer-cols { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.footer-col__title {
  margin-bottom: 12px;
  padding-bottom: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--gold);
  border-bottom: 1px solid var(--hair-light);
}

.footer-col__list {
  display: grid;
  gap: 8px;
}

.footer-col__link {
  display: inline-block;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.16s ease-out, padding-left 0.16s ease-out;
}

.footer-col__link:hover {
  color: var(--white);
  padding-left: 6px;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}

.footer-contact {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding-top: var(--s3);
  border-top: 1px solid var(--hair-light);
  font-size: 14px;
}

.footer-contact__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 16px;
}

.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--gold);
}

.footer-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  margin-top: var(--s2);
  padding-top: var(--s2);
  border-top: 1px solid var(--hair-light);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.62);
}

.footer-legal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-legal__links a {
  transition: color 0.16s ease-out;
}

.footer-legal__links a:hover {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============================================================
   16. 滚动显现
   ============================================================ */
.has-js [data-reveal] {
  opacity: 0;
  transform: translateY(14px);
}

.has-js [data-reveal][data-revealed] {
  opacity: 1;
  transform: none;
  transition: opacity 0.38s ease-out, transform 0.38s ease-out;
}

/* ============================================================
   17. 移动端导航抽屉（≤900px）
   ============================================================ */
@media (max-width: 900px) {
  .site-header__bar {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding: 12px 16px 10px;
    gap: 12px;
  }

  .site-header__badge { display: none; }

  .masthead {
    grid-column: 1;
    align-items: flex-start;
    text-align: left;
  }

  .masthead__name { font-size: clamp(20px, 5.6vw, 26px); }

  .masthead__tagline {
    font-size: 10px;
    letter-spacing: 0.12em;
  }

  .nav-toggle {
    display: inline-flex;
    grid-column: 2;
  }

  .site-nav {
    display: block;
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    visibility: hidden;
    transition: max-height 0.28s ease-out, visibility 0.28s ease-out;
  }

  .site-header[data-open] .site-nav {
    max-height: 480px;
    padding-bottom: 20px;
    visibility: visible;
  }

  .site-nav__edge { display: none; }

  .site-nav__list {
    display: grid;
    gap: 0;
    justify-content: stretch;
    border-top: 1px solid var(--hair-light);
  }

  .site-nav__item {
    border-bottom: 1px solid var(--hair-light);
  }

  .site-nav__link {
    display: block;
    padding: 14px 4px 14px 18px;
    font-size: 16px;
    color: rgba(255, 255, 255, 0.88);
  }

  .site-nav__link::after {
    left: 0;
    right: auto;
    top: 50%;
    bottom: auto;
    width: 3px;
    height: 22px;
    transform: translateY(-50%) scaleY(0);
    transform-origin: center;
  }

  .site-nav__link:hover::after {
    transform: translateY(-50%) scaleY(1);
  }

  .site-nav__link[aria-current="page"] {
    color: var(--gold);
  }

  .site-nav__link[aria-current="page"]::after {
    transform: translateY(-50%) scaleY(1);
    background: var(--red);
  }

  .site-nav__link[aria-current="page"]::before { display: none; }
}

/* ============================================================
   18. 平板微调
   ============================================================ */
@media (min-width: 768px) and (max-width: 1023px) {
  .section-head { margin-bottom: var(--s3); }
  .site-footer__inner { padding-top: var(--s5); }
}

/* ============================================================
   19. 降低动效
   ============================================================ */
@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;
    transition-delay: 0s !important;
  }

  .button:hover,
  .archive-card:hover,
  .tag-chip:hover,
  .tag-chip[aria-pressed="true"],
  .figure-frame:hover img,
  .figure-frame:hover .figure-frame__img {
    transform: none;
  }

  .footer-col__link:hover { padding-left: 0; }

  .has-js [data-reveal] {
    opacity: 1;
    transform: none;
  }

  .scroll-meter__fill { transition: none; }
}
