/* ==========================================================================
   通宝官网 · 共享样式 /assets/site.css
   ========================================================================== */

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

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

body,
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }

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

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

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

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

kbd { font-family: inherit; }

:root {
  --paper: #F6F1E7;
  --ink: #12211C;
  --bronze: #2E6B5E;
  --bronze-mist: #9CBCB1;
  --gold: #C8973F;
  --gold-light: #E8CFA0;
  --jade: #4A5450;
  --rust: #6B4A2F;
  --paper-shadow: #E6DECE;
  --seal: #A6462F;
  --rule: rgba(107, 74, 47, 0.2);
  --rule-strong: rgba(107, 74, 47, 0.34);

  --serif: "Songti SC", "Source Han Serif SC", "Noto Serif CJK SC", "STSong", Georgia, serif;
  --sans: "PingFang SC", "Source Han Sans SC", "Noto Sans CJK SC", "Microsoft YaHei", system-ui, -apple-system, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 5vw, 64px);
  --head-h: 66px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

h1 { font-size: clamp(2.4rem, 5vw, 4rem); }

h2 { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }

h3 { font-size: clamp(1.1rem, 1.8vw, 1.35rem); }

p { text-wrap: pretty; }

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

:focus-visible {
  outline: 2px solid var(--bronze);
  outline-offset: 3px;
}

#main-content { scroll-margin-top: 84px; }

@media (min-width: 900px) {
  #main-content { scroll-margin-top: 160px; }
}

/* ---------- 跳转链接 ---------- */

.tb-skip {
  position: absolute;
  left: 50%;
  top: 0;
  z-index: 120;
  transform: translate(-50%, -130%);
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1.2rem;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  border-radius: 2px;
  transition: transform 0.2s var(--ease);
}

.tb-skip:focus,
.tb-skip:focus-visible {
  transform: translate(-50%, 8px);
  outline: 2px solid var(--gold);
  outline-offset: 2px;
}

/* ---------- 通用容器与正文 ---------- */

.tb-container {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.tb-prose { max-width: 68ch; }

.tb-prose p + p { margin-top: 1.05em; }

.tb-prose h2, .tb-prose h3 { margin-top: 1.8em; margin-bottom: 0.5em; }

.tb-mark {
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 0.26em;
}

.tb-eyebrow {
  font-family: var(--serif);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  text-transform: uppercase;
  color: var(--bronze);
}

/* ---------- 刊头 ---------- */

.tb-masthead {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(246, 241, 231, 0.94);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.tb-progress {
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: rgba(107, 74, 47, 0.12);
  overflow: hidden;
}

.tb-progress__bar {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--bronze), var(--gold));
}

.tb-masthead__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  width: 100%;
  max-width: var(--wrap);
  min-height: var(--head-h);
  margin-inline: auto;
  padding: clamp(14px, 2.2vw, 22px) var(--gutter) clamp(10px, 1.4vw, 16px);
  transition: padding 0.3s var(--ease), gap 0.3s var(--ease);
}

.tb-masthead__eyebrow {
  max-height: 2em;
  overflow: hidden;
  font-family: var(--serif);
  font-size: 0.7rem;
  letter-spacing: 0.36em;
  text-indent: 0.36em;
  text-transform: uppercase;
  color: var(--jade);
  transition: opacity 0.25s var(--ease), max-height 0.3s var(--ease);
}

.tb-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  padding: 0.1em 0.2em;
}

.tb-brand__seal {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--paper);
  background: var(--seal);
  border-radius: 2px;
}

.tb-brand__seal--light {
  background: var(--gold);
  color: var(--ink);
}

.tb-brand__word {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  line-height: 1.1;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  transition: font-size 0.3s var(--ease), letter-spacing 0.3s var(--ease);
}

.tb-brand__tagline {
  font-family: var(--serif);
  font-size: 0.86rem;
  letter-spacing: 0.22em;
  color: var(--bronze);
  white-space: nowrap;
  transition: opacity 0.2s var(--ease);
}

/* ---------- 导航 ---------- */

.tb-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.tb-nav__label { display: none; }

.tb-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px clamp(14px, 2.6vw, 34px);
}

.tb-nav__list a {
  display: inline-block;
  padding: 0.28em 0;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  background-image: linear-gradient(var(--bronze), var(--bronze));
  background-repeat: no-repeat;
  background-size: 0 2px;
  background-position: 50% 100%;
  transition: background-size 0.22s var(--ease), color 0.22s var(--ease);
}

.tb-nav__list a:hover,
.tb-nav__list a:focus-visible {
  color: var(--bronze);
  background-size: 100% 2px;
}

.tb-nav__list a[aria-current="page"] {
  color: var(--bronze);
  font-weight: 600;
  background-size: 100% 2px;
}

.tb-nav__foot { display: none; }

/* ---------- 刊头右侧短入口 ---------- */

.tb-masthead__actions {
  position: absolute;
  top: clamp(14px, 2.2vw, 22px);
  right: var(--gutter);
  display: flex;
  align-items: center;
  gap: 16px;
}

.tb-shortlink {
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  color: var(--jade);
  padding-bottom: 2px;
  background-image: linear-gradient(var(--bronze), var(--bronze));
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 100%;
  transition: background-size 0.2s var(--ease), color 0.2s var(--ease);
}

.tb-shortlink:hover,
.tb-shortlink:focus-visible {
  color: var(--bronze);
  background-size: 100% 1px;
}

/* ---------- 按钮 ---------- */

.tb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.68em 1.5em;
  font-family: var(--sans);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.4;
  border: 1px solid transparent;
  border-radius: 2px;
  cursor: pointer;
  text-align: center;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease),
    border-color 0.2s var(--ease);
}

.tb-btn--gold {
  background: var(--gold);
  color: #1B1409;
}

.tb-btn--gold:hover,
.tb-btn--gold:focus-visible {
  background: #B9862F;
}

.tb-btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--rule-strong);
}

.tb-btn--ghost:hover,
.tb-btn--ghost:focus-visible {
  color: var(--bronze);
  border-color: var(--bronze);
  background: rgba(46, 107, 94, 0.07);
}

.tb-btn--sm {
  padding: 0.5em 1.15em;
  font-size: 0.84rem;
}

.tb-btn:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* ---------- 移动导航开关 ---------- */

.tb-nav-toggle {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 0.45rem 0.2rem;
  font-size: 0.84rem;
  letter-spacing: 0.14em;
  color: var(--ink);
  cursor: pointer;
}

.tb-nav-toggle__bars {
  position: relative;
  display: block;
  width: 22px;
  height: 12px;
}

.tb-nav-toggle__bars span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ink);
  transition: transform 0.25s var(--ease), opacity 0.2s var(--ease);
}

.tb-nav-toggle__bars span:first-child { top: 0; }

.tb-nav-toggle__bars span:last-child { bottom: 0; }

.tb-masthead[data-open] .tb-nav-toggle__bars span:first-child {
  transform: translateY(5.25px) rotate(45deg);
}

.tb-masthead[data-open] .tb-nav-toggle__bars span:last-child {
  transform: translateY(-5.25px) rotate(-45deg);
}

/* ---------- 桌面收窄态 ---------- */

@media (min-width: 900px) {
  .tb-masthead.is-tight .tb-masthead__inner {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: clamp(18px, 3vw, 44px);
    padding-block: 10px;
  }

  .tb-masthead.is-tight .tb-masthead__eyebrow {
    opacity: 0;
    max-height: 0;
  }

  .tb-masthead.is-tight .tb-brand__word {
    font-size: 1.35rem;
    letter-spacing: 0.1em;
  }

  .tb-masthead.is-tight .tb-brand__tagline {
    opacity: 0;
    width: 0;
    overflow: hidden;
  }

  .tb-masthead.is-tight .tb-nav {
    width: auto;
    flex: 1 1 auto;
  }

  .tb-masthead.is-tight .tb-nav__list {
    justify-content: flex-end;
    gap: clamp(12px, 2vw, 24px);
  }

  .tb-masthead.is-tight .tb-nav__list a { font-size: 0.86rem; }

  .tb-masthead.is-tight .tb-masthead__actions {
    position: static;
    flex: none;
  }
}

/* ---------- 移动端刊头与抽屉 ---------- */

@media (max-width: 899px) {
  .tb-masthead__inner {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px var(--gutter);
    min-height: var(--head-h);
  }

  .tb-masthead__eyebrow { display: none; }

  .tb-brand__word { font-size: 1.5rem; letter-spacing: 0.1em; }

  .tb-brand__tagline { display: none; }

  .tb-masthead__actions { display: none; }

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

  .tb-nav {
    position: fixed;
    top: var(--head-h);
    left: 0;
    right: 0;
    z-index: 99;
    align-items: stretch;
    padding: 18px var(--gutter) 26px;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: 0 22px 34px -28px rgba(18, 33, 28, 0.55);
    max-height: calc(100dvh - var(--head-h));
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: opacity 0.24s var(--ease), transform 0.24s var(--ease),
      visibility 0.24s linear;
  }

  .tb-masthead[data-open] .tb-nav {
    opacity: 1;
    visibility: visible;
    transform: none;
  }

  .tb-nav__label {
    display: block;
    margin-bottom: 10px;
    font-family: var(--serif);
    font-size: 0.7rem;
    letter-spacing: 0.32em;
    color: var(--bronze);
  }

  .tb-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .tb-nav__list li + li { border-top: 1px solid var(--rule); }

  .tb-nav__list a {
    display: block;
    padding: 14px 2px;
    font-family: var(--serif);
    font-size: 1.05rem;
    letter-spacing: 0.06em;
    background-position: 0 100%;
  }

  .tb-nav__list a[aria-current="page"] {
    background-size: 34px 2px;
    background-position: 0 calc(100% - 8px);
  }

  .tb-nav__foot {
    display: flex;
    gap: 12px;
    margin-top: 22px;
  }

  .tb-nav__foot .tb-btn { flex: 1 1 0; }
}

/* ---------- 章节与版面基础组件 ---------- */

.tb-section { padding-block: clamp(48px, 7vw, 96px); }

.tb-section--paper-alt { background: var(--paper-shadow); }

.tb-section--mist { background: rgba(156, 188, 177, 0.22); }

.tb-section--ink {
  background: var(--ink);
  color: var(--paper);
}

.tb-section--ink .tb-section__num,
.tb-section--ink .tb-eyebrow { color: var(--bronze-mist); }

.tb-section--ink .tb-section__head { border-top-color: rgba(246, 241, 231, 0.2); }

.tb-section__head {
  display: flex;
  align-items: baseline;
  gap: clamp(14px, 2vw, 28px);
  padding-top: 18px;
  margin-bottom: clamp(24px, 3vw, 40px);
  border-top: 1px solid var(--rule);
}

.tb-section__num {
  flex: none;
  font-family: var(--serif);
  font-size: 0.78rem;
  letter-spacing: 0.28em;
  color: var(--bronze);
  white-space: nowrap;
}

.tb-section__title { font-size: clamp(1.5rem, 2.6vw, 2.1rem); }

.tb-stat {
  display: block;
  font-family: var(--serif);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1;
  letter-spacing: -0.01em;
}

.tb-stat__label {
  display: block;
  margin-top: 0.65em;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--jade);
}

.tb-tag {
  display: inline-block;
  padding: 0.28em 0.8em;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  background: var(--gold-light);
  color: #3A2B12;
  border-radius: 2px;
}

.tb-tag--line {
  background: transparent;
  border: 1px solid var(--rule-strong);
  color: var(--bronze);
}

.tb-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  color: var(--jade);
}

.tb-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6em;
}

.tb-breadcrumb a { color: var(--bronze); }

.tb-breadcrumb a:hover,
.tb-breadcrumb a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

.tb-breadcrumb li + li::before {
  content: "/";
  margin-right: 0.6em;
  color: rgba(107, 74, 47, 0.45);
}

.tb-coin-rule {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-block: clamp(28px, 4vw, 48px);
}

.tb-coin-rule::before,
.tb-coin-rule::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: var(--rule);
}

.tb-coin-rule span {
  position: relative;
  display: block;
  flex: none;
  width: 13px;
  height: 13px;
  border: 1px solid var(--rust);
  border-radius: 50%;
}

.tb-coin-rule span::after {
  content: "";
  position: absolute;
  inset: 3px;
  background: var(--rust);
  opacity: 0.4;
  border-radius: 1px;
}

/* ---------- 网格 ---------- */

.tb-grid {
  display: grid;
  gap: clamp(20px, 3vw, 40px);
}

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

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

.tb-split {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}

@media (max-width: 899px) {
  .tb-grid--2,
  .tb-grid--3 { grid-template-columns: minmax(0, 1fr); }

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

/* ---------- 图片容器 ---------- */

.tb-figure { margin: 0; }

.tb-figure__frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--paper-shadow);
  border: 1px solid var(--rule);
}

.tb-figure__frame img,
.tb-figure__frame svg,
.tb-figure__frame video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tb-figure--wide .tb-figure__frame { aspect-ratio: 16 / 9; }

.tb-figure--tall .tb-figure__frame { aspect-ratio: 3 / 4; }

.tb-figure--square .tb-figure__frame { aspect-ratio: 1 / 1; }

.tb-figure__caption {
  margin-top: 0.7rem;
  padding-left: 0.8rem;
  border-left: 2px solid var(--bronze-mist);
  font-size: 0.8rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  color: var(--jade);
}

/* ---------- 页脚 ---------- */

.tb-footer {
  position: relative;
  margin-top: clamp(64px, 9vw, 120px);
  background: var(--ink);
  color: var(--paper);
}

.tb-footer::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, var(--bronze), var(--gold), var(--bronze));
}

.tb-footer__inner {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.35fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 76px) var(--gutter) clamp(30px, 4vw, 48px);
}

.tb-footer__col { min-width: 0; }

.tb-footer__col--brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.tb-footer__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--serif);
  font-size: 1.5rem;
  letter-spacing: 0.14em;
  color: var(--paper);
}

.tb-footer__motto {
  margin-top: 16px;
  font-family: var(--serif);
  font-size: 1rem;
  letter-spacing: 0.24em;
  color: var(--gold-light);
}

.tb-footer__place {
  margin-top: 10px;
  font-size: 0.85rem;
  line-height: 1.9;
  color: rgba(246, 241, 231, 0.62);
}

.tb-footer__title {
  margin-bottom: 16px;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--bronze-mist);
}

.tb-footer__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 0.92rem;
  color: rgba(246, 241, 231, 0.82);
}

.tb-footer__list a {
  color: rgba(246, 241, 231, 0.82);
  background-image: linear-gradient(var(--gold-light), var(--gold-light));
  background-repeat: no-repeat;
  background-size: 0 1px;
  background-position: 0 100%;
  transition: background-size 0.22s var(--ease), color 0.22s var(--ease);
}

.tb-footer__list a:hover,
.tb-footer__list a:focus-visible {
  color: var(--paper);
  background-size: 100% 1px;
}

.tb-footer__list a:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 3px;
}

.tb-footer__note {
  margin-top: 14px;
  max-width: 26ch;
  font-size: 0.8rem;
  line-height: 1.8;
  color: rgba(246, 241, 231, 0.55);
}

.tb-footer__icp {
  margin-top: 16px;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  color: rgba(246, 241, 231, 0.5);
}

.tb-footer__base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding: 18px var(--gutter) 26px;
  border-top: 1px solid rgba(246, 241, 231, 0.14);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: rgba(246, 241, 231, 0.55);
}

.tb-footer__save kbd {
  display: inline-block;
  padding: 0.1em 0.45em;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--gold-light);
  border: 1px solid rgba(246, 241, 231, 0.3);
  border-radius: 2px;
}

.tb-footer__copy {
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.08em;
}

@media (max-width: 899px) {
  .tb-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 599px) {
  .tb-footer__inner { grid-template-columns: minmax(0, 1fr); }
  .tb-footer__base { flex-direction: column; align-items: flex-start; }
}

/* ---------- 滚动显现 ---------- */

html.tb-js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.5s var(--ease), transform 0.5s var(--ease);
}

html.tb-js [data-reveal].is-shown {
  opacity: 1;
  transform: none;
}

/* ---------- 减少动态 ---------- */

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

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

  .tb-masthead.is-tight .tb-masthead__eyebrow { display: none; }
}
