/* ============================================================
   通宝中心 · 共享样式 /assets/site.css
   编辑部版式 · 铜绿与鎏金 · 档案册气质
   ============================================================ */

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

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

body, h1, h2, h3, h4, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img, svg { max-width: 100%; display: block; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- 变量 ---------- */
:root {
  --tb-patina-900: #123A33;
  --tb-patina-600: #2E7A69;
  --tb-patina-200: #A9D6C9;
  --tb-patina-050: #E9F3EF;
  --tb-gilt-500:   #C9A227;
  --tb-gilt-100:   #F3E4B4;
  --tb-indigo-900: #16224A;
  --tb-indigo-500: #3A4E86;
  --tb-orange-500: #E0752F;
  --tb-orange-050: #FDEFE4;
  --tb-paper-000:  #FBF8F1;
  --tb-ink-800:    #23262B;
  --tb-line-300:   #D8D2C4;
  --tb-card-000:   #FFFFFF;

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

  --tb-max: 1220px;
  --tb-gutter: clamp(16px, 4vw, 40px);
  --tb-radius-lg: 26px;
  --tb-radius-md: 14px;
  --tb-radius-sm: 8px;
  --tb-shadow: 0 20px 44px -34px rgba(18, 58, 51, 0.78);
  --tb-progress: 0;
}

/* ---------- 基础排版 ---------- */
body {
  background-color: var(--tb-paper-000);
  background-image:
    radial-gradient(circle at 88% 4%, rgba(169, 214, 201, 0.34), transparent 42%),
    radial-gradient(circle at 2% 62%, rgba(243, 228, 180, 0.34), transparent 38%);
  background-attachment: fixed;
  color: var(--tb-ink-800);
  font-family: var(--tb-font-sans);
  font-size: 16.5px;
  line-height: 1.75;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--tb-font-serif);
  color: var(--tb-indigo-900);
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0.02em;
}
h1 { font-size: clamp(30px, 5vw, 56px); font-weight: 900; }
h2 { font-size: clamp(22px, 3.2vw, 32px); }
h3 { font-size: clamp(17px, 2.1vw, 22px); }

strong { color: var(--tb-indigo-900); font-weight: 600; }

:focus-visible {
  outline: 2px solid var(--tb-orange-500);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- 容器与节奏 ---------- */
.tb-container {
  width: 100%;
  max-width: var(--tb-max);
  margin-inline: auto;
  padding-inline: var(--tb-gutter);
}

.tb-section { padding-block: clamp(40px, 6.5vw, 88px); }

.tb-mono {
  font-family: var(--tb-font-mono);
  font-size: 0.9em;
  letter-spacing: 0.06em;
}

.tb-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--tb-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--tb-patina-600);
}
.tb-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--tb-gilt-500);
}

.tb-prose { max-width: 68ch; }
.tb-prose p { margin-bottom: 1.1em; }
.tb-prose h2 { margin: 1.8em 0 0.6em; }
.tb-prose h3 { margin: 1.4em 0 0.5em; }
.tb-prose ul { margin: 0 0 1.2em; }
.tb-prose ul li {
  position: relative;
  padding-left: 22px;
  margin-bottom: 0.5em;
}
.tb-prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 10px;
  height: 2px;
  background: var(--tb-gilt-500);
}
.tb-prose a {
  color: var(--tb-indigo-500);
  text-decoration: underline;
  text-decoration-color: var(--tb-patina-200);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}
.tb-prose a:hover { color: var(--tb-patina-600); }

.tb-note {
  font-size: 13.5px;
  line-height: 1.72;
  letter-spacing: 0.02em;
  color: var(--tb-indigo-500);
}
.tb-note__label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--tb-font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tb-patina-600);
}

/* ---------- 网格 ---------- */
.tb-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: clamp(16px, 2.4vw, 28px);
}
.tb-col-3  { grid-column: span 3; }
.tb-col-4  { grid-column: span 4; }
.tb-col-5  { grid-column: span 5; }
.tb-col-6  { grid-column: span 6; }
.tb-col-7  { grid-column: span 7; }
.tb-col-8  { grid-column: span 8; }
.tb-col-12 { grid-column: span 12; }

@media (max-width: 960px) {
  .tb-col-3, .tb-col-4, .tb-col-5 { grid-column: span 6; }
  .tb-col-6, .tb-col-7, .tb-col-8 { grid-column: span 12; }
}
@media (max-width: 640px) {
  .tb-col-3, .tb-col-4, .tb-col-5, .tb-col-6 { grid-column: span 12; }
}

/* ---------- 跳转链接 ---------- */
.tb-skip {
  position: fixed;
  top: 0;
  left: 50%;
  z-index: 400;
  transform: translate(-50%, -130%);
  padding: 12px 24px;
  border-radius: 0 0 14px 14px;
  background: var(--tb-indigo-900);
  color: var(--tb-paper-000);
  font-size: 14px;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: transform 0.22s ease;
}
.tb-skip:focus { transform: translate(-50%, 0); }

/* ---------- 头部 ---------- */
.tb-header {
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 12px 30px -26px rgba(18, 58, 51, 0.9);
}

.tb-masthead-band {
  position: relative;
  overflow: hidden;
  background: var(--tb-patina-900);
  color: var(--tb-paper-000);
}
.tb-masthead-band::after {
  content: "";
  position: absolute;
  right: -70px;
  bottom: -96px;
  width: 260px;
  height: 190px;
  border-radius: 70px;
  background: linear-gradient(135deg, rgba(201, 162, 39, 0.42), rgba(201, 162, 39, 0));
  transform: rotate(-14deg);
  pointer-events: none;
}
.tb-masthead-band::before {
  content: "";
  position: absolute;
  left: -40px;
  top: -80px;
  width: 180px;
  height: 160px;
  border-radius: 50%;
  background: linear-gradient(160deg, rgba(46, 122, 105, 0.55), rgba(46, 122, 105, 0));
  pointer-events: none;
}

.tb-masthead {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
  padding-block: clamp(12px, 1.9vw, 20px);
  transition: padding-block 0.28s ease;
}

.tb-masthead__side {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.tb-masthead__side--end { justify-content: flex-end; }

.tb-version {
  flex: none;
  padding: 4px 11px;
  border: 1px solid rgba(201, 162, 39, 0.5);
  border-radius: 999px;
  background: rgba(201, 162, 39, 0.16);
  color: var(--tb-gilt-100);
  font-family: var(--tb-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tb-masthead__edition {
  font-family: var(--tb-font-mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--tb-patina-200);
  white-space: nowrap;
}

.tb-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  text-align: center;
}
.tb-brand__link { text-decoration: none; }
.tb-brand__name {
  display: inline-block;
  font-family: var(--tb-font-serif);
  font-weight: 900;
  font-size: clamp(21px, 2.9vw, 31px);
  line-height: 1.1;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  color: var(--tb-paper-000);
  transition: font-size 0.28s ease;
}
.tb-brand__tagline {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: 0.16em;
  color: var(--tb-patina-200);
  white-space: nowrap;
  transition: opacity 0.24s ease;
}

.tb-search,
.tb-nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid rgba(251, 248, 241, 0.34);
  border-radius: 999px;
  color: var(--tb-paper-000);
  font-size: 13.5px;
  letter-spacing: 0.08em;
  white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.tb-search:hover,
.tb-nav-toggle:hover {
  background: rgba(251, 248, 241, 0.12);
  border-color: var(--tb-gilt-500);
}
.tb-search[aria-expanded="true"] {
  background: var(--tb-gilt-500);
  border-color: var(--tb-gilt-500);
  color: var(--tb-indigo-900);
}

.tb-search__icon {
  position: relative;
  display: inline-block;
  width: 14px;
  height: 14px;
  flex: none;
}
.tb-search__icon::before {
  content: "";
  position: absolute;
  inset: 0 4px 4px 0;
  border: 1.6px solid currentColor;
  border-radius: 50%;
}
.tb-search__icon::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 1px;
  width: 6px;
  height: 1.6px;
  background: currentColor;
  transform: rotate(45deg);
  transform-origin: right center;
}

.tb-nav-toggle { display: none; }
.tb-nav-toggle__bars {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 3px;
  width: 16px;
  height: 14px;
  flex: none;
}
.tb-nav-toggle__bars i {
  display: block;
  height: 1.8px;
  border-radius: 2px;
  background: currentColor;
  transition: transform 0.24s ease, opacity 0.24s ease;
}
.tb-nav-toggle[aria-expanded="true"] .tb-nav-toggle__bars i:nth-child(1) { transform: translateY(4.8px) rotate(45deg); }
.tb-nav-toggle[aria-expanded="true"] .tb-nav-toggle__bars i:nth-child(2) { opacity: 0; }
.tb-nav-toggle[aria-expanded="true"] .tb-nav-toggle__bars i:nth-child(3) { transform: translateY(-4.8px) rotate(-45deg); }

/* 收窄态 */
.tb-header.is-condensed .tb-masthead { padding-block: 7px; }
.tb-header.is-condensed .tb-brand__name { font-size: clamp(18px, 2.1vw, 23px); }
.tb-header.is-condensed .tb-brand__tagline { opacity: 0; height: 0; overflow: hidden; }

/* 目录速览层 */
.tb-index {
  background: var(--tb-gilt-100);
  border-bottom: 1px solid var(--tb-line-300);
}
.tb-index__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 26px;
  padding-block: 16px;
}
.tb-index__label {
  font-family: var(--tb-font-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--tb-indigo-900);
}
.tb-index__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.tb-index__link {
  padding-bottom: 2px;
  border-bottom: 1px dashed var(--tb-patina-600);
  color: var(--tb-indigo-900);
  font-size: 14px;
  text-decoration: none;
}
.tb-index__link:hover {
  color: var(--tb-patina-600);
  border-bottom-style: solid;
}

/* 主导航 */
.tb-navbar {
  background: var(--tb-paper-000);
  border-bottom: 1px solid var(--tb-line-300);
}
.tb-nav__list {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(8px, 2.4vw, 34px);
}
.tb-nav__link {
  position: relative;
  display: inline-block;
  padding: 14px 4px 16px;
  color: var(--tb-indigo-900);
  font-size: 15px;
  letter-spacing: 0.04em;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.2s ease;
}
.tb-nav__link::after {
  content: "";
  position: absolute;
  left: 50%;
  right: 50%;
  bottom: 8px;
  height: 2px;
  background: var(--tb-gilt-500);
  transition: left 0.26s ease, right 0.26s ease;
}
.tb-nav__link:hover { color: var(--tb-patina-600); }
.tb-nav__link:hover::after { left: 0; right: 0; }
.tb-nav__link[aria-current="page"] {
  color: var(--tb-patina-600);
  font-weight: 600;
}
.tb-nav__link[aria-current="page"]::after { left: 0; right: 0; }

/* 阅读进度 */
.tb-progress {
  height: 3px;
  background: rgba(216, 210, 196, 0.55);
}
.tb-progress__bar {
  display: block;
  height: 100%;
  transform: scaleX(var(--tb-progress));
  transform-origin: left center;
  background: linear-gradient(90deg, var(--tb-patina-600) 0%, var(--tb-gilt-500) 62%, var(--tb-orange-500) 100%);
}

/* ---------- 页脚 ---------- */
.tb-footer {
  margin-top: clamp(48px, 7vw, 96px);
  padding-block: clamp(34px, 5vw, 58px) 20px;
  background: linear-gradient(180deg, var(--tb-patina-050) 0%, var(--tb-patina-200) 100%);
  border-top: 3px solid var(--tb-gilt-500);
  color: var(--tb-ink-800);
}
.tb-footer__grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: clamp(24px, 4vw, 52px);
  padding-bottom: clamp(22px, 3vw, 34px);
}
.tb-footer__col { min-width: 0; }
.tb-footer__title {
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(18, 58, 51, 0.18);
  font-family: var(--tb-font-serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--tb-patina-900);
}
.tb-footer__list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
}
.tb-footer__list a {
  color: var(--tb-indigo-900);
  font-size: 14.5px;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.tb-footer__list a:hover {
  color: var(--tb-patina-900);
  border-bottom-color: var(--tb-gilt-500);
}
.tb-footer__text {
  font-size: 14px;
  line-height: 1.8;
  color: var(--tb-ink-800);
}
.tb-footer__mono {
  font-family: var(--tb-font-mono);
  font-size: 13px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: var(--tb-patina-900);
  word-break: break-all;
}
.tb-footer__note {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--tb-indigo-500);
}
.tb-footer__baseline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(18, 58, 51, 0.18);
}
.tb-footer__baseline .tb-footer__text { font-size: 13.5px; letter-spacing: 0.06em; }
.tb-footer__baseline .tb-footer__mono { opacity: 0.72; }

/* ---------- 按钮 ---------- */
.tb-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-family: var(--tb-font-sans);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}
.tb-btn--primary {
  background: var(--tb-patina-600);
  color: var(--tb-paper-000);
  box-shadow: 0 14px 26px -20px rgba(18, 58, 51, 0.95);
}
.tb-btn--primary:hover { background: var(--tb-patina-900); transform: translateY(-1px); }
.tb-btn--gilt {
  background: var(--tb-gilt-500);
  color: var(--tb-indigo-900);
}
.tb-btn--gilt:hover { background: var(--tb-gilt-100); }
.tb-btn--ghost {
  background: var(--tb-card-000);
  border-color: var(--tb-line-300);
  color: var(--tb-indigo-900);
}
.tb-btn--ghost:hover {
  border-color: var(--tb-patina-600);
  color: var(--tb-patina-600);
}

/* ---------- 卡片 ---------- */
.tb-card {
  padding: clamp(16px, 2vw, 24px);
  border: 1px solid var(--tb-line-300);
  border-radius: var(--tb-radius-md);
  background: var(--tb-card-000);
}
.tb-card--patina {
  background: var(--tb-patina-050);
  border-color: var(--tb-patina-200);
}
.tb-card--gilt {
  background: var(--tb-gilt-100);
  border-color: rgba(201, 162, 39, 0.45);
}
.tb-card--raised { box-shadow: var(--tb-shadow); }
.tb-card__title {
  margin-bottom: 8px;
  font-family: var(--tb-font-serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--tb-indigo-900);
}
.tb-card__meta {
  font-family: var(--tb-font-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  line-height: 1.7;
  color: var(--tb-indigo-500);
}

/* ---------- 状态 ---------- */
.tb-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--tb-font-mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--tb-orange-500);
}
.tb-status::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 50%;
  background: var(--tb-orange-500);
  box-shadow: 0 0 0 4px var(--tb-orange-050);
}

/* ---------- 图片容器 ---------- */
.tb-figure { margin: 0; }
.tb-figure__frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--tb-line-300);
  border-radius: var(--tb-radius-lg);
  background-image: linear-gradient(140deg, var(--tb-patina-200) 0%, var(--tb-patina-050) 100%);
}
.tb-figure__media {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}
.tb-figure--coin .tb-figure__media { aspect-ratio: 1 / 1; }
.tb-figure--tall .tb-figure__media { aspect-ratio: 3 / 4; }
.tb-figure--wide .tb-figure__media { aspect-ratio: 21 / 9; }
.tb-figure__caption {
  margin-top: 10px;
  font-family: var(--tb-font-mono);
  font-size: 12.5px;
  letter-spacing: 0.04em;
  line-height: 1.7;
  color: var(--tb-indigo-500);
}

/* ---------- 面包屑 ---------- */
.tb-breadcrumb {
  font-family: var(--tb-font-mono);
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--tb-indigo-500);
}
.tb-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tb-breadcrumb li { display: inline-flex; align-items: center; }
.tb-breadcrumb li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--tb-line-300);
}
.tb-breadcrumb a {
  color: var(--tb-indigo-500);
  text-decoration: none;
}
.tb-breadcrumb a:hover {
  color: var(--tb-patina-600);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- 显现动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tb-reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.42s ease, transform 0.42s cubic-bezier(0.22, 0.61, 0.36, 1);
    transition-delay: calc(var(--tb-order, 0) * 60ms);
    will-change: opacity, transform;
  }
  .tb-reveal.is-in {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 响应式头部 ---------- */
@media (max-width: 900px) {
  .tb-masthead__edition { display: none; }
  .tb-nav-toggle { display: inline-flex; }

  .tb-navbar { display: none; }
  .tb-navbar[data-open] {
    display: block;
    animation: tb-strip-in 0.22s ease;
  }
  .tb-nav__list {
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 10px;
    overflow-x: auto;
    padding-block: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
  }
  .tb-nav__link {
    padding: 11px 16px;
    border: 1px solid var(--tb-line-300);
    border-radius: 999px;
    background: var(--tb-card-000);
    font-size: 14px;
  }
  .tb-nav__link::after { display: none; }
  .tb-nav__link[aria-current="page"] {
    background: var(--tb-patina-600);
    border-color: var(--tb-patina-600);
    color: var(--tb-paper-000);
  }
  .tb-nav__link:hover { border-color: var(--tb-gilt-500); }

  .tb-footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .tb-search__text { display: none; }
  .tb-search { padding: 9px 11px; }
  .tb-version { display: none; }
  .tb-brand__tagline { font-size: 11px; letter-spacing: 0.1em; }
  .tb-footer__grid { grid-template-columns: 1fr; }
  .tb-footer__baseline { justify-content: flex-start; }
}

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

/* ---------- 无障碍：减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .tb-navbar[data-open] { animation: none; }
  .tb-reveal { opacity: 1; transform: none; }
  .tb-skip { transition: none; }
}
