/* ===== 华体服务 · 共享基座 /assets/site.css ===== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
}

body { margin: 0; }

h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }

ul[class],
ol[class] {
  margin: 0;
  padding: 0;
  list-style: none;
}

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

a { color: inherit; }

button {
  font: inherit;
  color: inherit;
  margin: 0;
}

main { display: block; }

:focus-visible {
  outline: 2px solid #C8102E;
  outline-offset: 2px;
  border-radius: 1px;
}

/* --- variables --- */
:root {
  --ink: #0A1F44;
  --ink-soft: #16294D;
  --red: #C8102E;
  --red-deep: #8E0B20;
  --sand: #F4E9DA;
  --paper: #FBF6EE;
  --teal: #00A896;
  --teal-ink: #00796B;
  --slate: #42526B;
  --line: #C9BBA8;
  --amber: #D9A441;
  --glass: rgba(255, 255, 255, 0.58);
  --glass-edge: rgba(10, 31, 68, 0.12);

  --shell-w: 1180px;
  --pad: clamp(1.1rem, 3.2vw, 2.6rem);
  --radius: 2px;

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

  --ease: cubic-bezier(0.2, 0.7, 0.3, 1);
  --shadow-1: 0 1px 0 rgba(10, 31, 68, 0.06), 0 18px 40px -30px rgba(10, 31, 68, 0.55);
}

/* --- base typography --- */
body {
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--sand);
  background-image:
    linear-gradient(to right, rgba(201, 187, 168, 0.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(201, 187, 168, 0.16) 1px, transparent 1px);
  background-size: 96px 96px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  font-weight: 900;
  line-height: 1.22;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

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

/* --- utilities --- */
.shell {
  width: 100%;
  max-width: var(--shell-w);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  font-variant-numeric: tabular-nums;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  color: var(--slate);
  text-transform: uppercase;
}

.eyebrow::before {
  content: "";
  width: 0.62rem;
  height: 0.62rem;
  background: var(--red);
  flex: none;
}

.stack > * + * { margin-top: 1rem; }

.prose {
  max-width: 68ch;
  line-height: 1.85;
}

.prose > * + * { margin-top: 1.1em; }

/* --- layout primitives --- */
.section { padding-block: clamp(2.6rem, 7vw, 5rem); }

.section__head {
  display: grid;
  gap: 0.55rem;
  margin-bottom: clamp(1.2rem, 3vw, 2rem);
}

.section__title {
  font-size: clamp(1.4rem, 3vw, 2.05rem);
  font-weight: 900;
}

.section__note {
  max-width: 62ch;
  font-size: 0.94rem;
  color: var(--slate);
}

.grid { display: grid; gap: clamp(1rem, 2.4vw, 1.8rem); }

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

.grid--cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (min-width: 960px) {
  .grid--split { grid-template-columns: minmax(0, 3fr) minmax(0, 7fr); }
}

/* --- buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.72rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.btn--primary {
  background: var(--red);
  color: #FFFFFF;
  border-color: var(--red);
}

.btn--primary:hover { background: var(--red-deep); border-color: var(--red-deep); }

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

.btn--ghost:hover { background: var(--ink); color: var(--paper); }

.btn--sm { padding: 0.48rem 0.82rem; font-size: 0.82rem; }

/* --- tag --- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  padding: 0.14rem 0.5rem;
  border: 1px solid currentColor;
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  line-height: 1.6;
}

.tag--red { color: var(--red); }

.tag--teal {
  color: var(--teal-ink);
  border-color: rgba(0, 168, 150, 0.55);
  background: rgba(0, 168, 150, 0.1);
}

/* --- breadcrumb --- */
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  color: var(--slate);
}

.breadcrumb a {
  text-decoration: none;
  border-bottom: 1px solid transparent;
}

.breadcrumb a:hover { border-bottom-color: var(--red); }

.breadcrumb__sep { color: var(--line); }

/* --- card / surface --- */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: clamp(1.05rem, 2.2vw, 1.6rem);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card::before {
  content: "";
  position: absolute;
  left: -1px;
  top: -1px;
  width: 3.2rem;
  height: 3px;
  background: var(--red);
}

.card__title { font-size: 1.05rem; font-weight: 800; }

.card__meta {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.12em;
  color: var(--slate);
}

.surface {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: clamp(1.05rem, 2.4vw, 1.8rem);
}

.surface--glass {
  background: var(--glass);
  border-color: rgba(255, 255, 255, 0.7);
  box-shadow: var(--shadow-1);
  -webkit-backdrop-filter: blur(12px) saturate(1.1);
  backdrop-filter: blur(12px) saturate(1.1);
}

/* --- figure / image container --- */
.figure {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: rgba(10, 31, 68, 0.06);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.figure__img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background-image:
    linear-gradient(135deg, rgba(10, 31, 68, 0.16), rgba(201, 187, 168, 0.3)),
    repeating-linear-gradient(45deg, rgba(10, 31, 68, 0.07) 0 2px, transparent 2px 14px);
}

.figure--wide .figure__img { aspect-ratio: 21 / 9; }

.figure--tall .figure__img { aspect-ratio: 4 / 5; }

.figure--glass::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 46%;
  background: linear-gradient(to top, rgba(10, 31, 68, 0.58), rgba(10, 31, 68, 0));
  pointer-events: none;
}

/* --- toc --- */
.toc { --toc-accent: var(--red); }

.toc__list { display: grid; gap: 0.1rem; }

.toc__link {
  display: block;
  padding: 0.42rem 0 0.42rem 0.85rem;
  border-left: 2px solid var(--line);
  font-size: 0.86rem;
  color: var(--slate);
  text-decoration: none;
  transition: color 0.2s var(--ease), border-color 0.2s var(--ease), background-color 0.2s var(--ease);
}

.toc__link:hover {
  color: var(--ink);
  border-left-color: var(--ink);
  background: rgba(10, 31, 68, 0.04);
}

.toc__link[aria-current="true"] {
  color: var(--ink);
  font-weight: 700;
  border-left-color: var(--toc-accent);
  background: rgba(200, 16, 46, 0.07);
}

/* --- skip link --- */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -5rem;
  z-index: 200;
  padding: 0.62rem 1.05rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top 0.18s var(--ease);
}

.skip-link:focus { top: 0.8rem; }

/* ===== 页头：档案刻度框架 ===== */
.frame-head {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(251, 246, 238, 0.94);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.frame-head__meter {
  height: 5px;
  background-color: var(--ink);
  background-image: repeating-linear-gradient(90deg, var(--red) 0 18px, transparent 18px 72px);
}

.frame-head__inner {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.62rem;
  margin-right: auto;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  position: relative;
  width: 28px;
  height: 28px;
  flex: none;
  background: var(--ink);
}

.brand__mark::before {
  content: "";
  position: absolute;
  top: 5px;
  right: 5px;
  width: 9px;
  height: 9px;
  background: var(--red);
}

.brand__mark::after {
  content: "";
  position: absolute;
  left: 5px;
  bottom: 6px;
  width: 12px;
  height: 3px;
  background: var(--paper);
}

.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand__name {
  font-size: 1.06rem;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.brand__tag {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  color: var(--slate);
}

@media (max-width: 399px) {
  .brand__tag { display: none; }
}

/* --- 移动菜单按钮 --- */
.nav-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.58rem;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}

.nav-toggle__bars {
  display: grid;
  gap: 4px;
  width: 18px;
  flex: none;
}

.nav-toggle__bars span {
  display: block;
  height: 2px;
  background: var(--ink);
  transition: transform 0.2s var(--ease), background-color 0.2s var(--ease);
}

.nav-toggle__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
}

.nav-toggle[aria-expanded="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__label { color: var(--paper); }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span { background: var(--paper); }

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:first-child {
  transform: translateY(3px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:last-child {
  transform: translateY(-3px) rotate(-45deg);
}

/* --- 导航（移动优先：下拉分区条） --- */
.site-nav {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  display: none;
  padding: 0.35rem 0 0.95rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-top: 0;
  box-shadow: var(--shadow-1);
  max-height: 78vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.site-nav[data-open] { display: block; }

.site-nav__list { display: grid; }

.site-nav__item { border-bottom: 1px solid rgba(201, 187, 168, 0.62); }

.site-nav__link {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.82rem 1.1rem;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.18s var(--ease), color 0.18s var(--ease);
}

.site-nav__num {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.08em;
  color: var(--red);
  flex: none;
}

.site-nav__link:hover { background: rgba(10, 31, 68, 0.06); }

.site-nav__link[aria-current="page"] {
  background: var(--red);
  color: #FFFFFF;
}

.site-nav__link[aria-current="page"] .site-nav__num { color: rgba(255, 255, 255, 0.78); }

.site-nav__cta { margin: 0.9rem 0 0 1.1rem; }

@media (min-width: 1024px) {
  .nav-toggle { display: none; }

  .site-nav {
    position: static;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0;
    border: 0;
    background: transparent;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }

  .site-nav__list {
    display: flex;
    align-items: stretch;
    border-left: 1px solid var(--line);
  }

  .site-nav__item {
    border-bottom: 0;
    border-right: 1px solid var(--line);
  }

  .site-nav__link {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.18rem;
    padding: 0.34rem 0.78rem;
    font-size: 0.86rem;
  }

  .site-nav__num { font-size: 0.6rem; letter-spacing: 0.16em; }

  .site-nav__link:hover { background: rgba(10, 31, 68, 0.06); }

  .site-nav__link[aria-current="page"] { background: var(--red); color: #FFFFFF; }

  .site-nav__cta { margin: 0 0 0 0.7rem; }
}

/* --- 阅读进度 --- */
.read-meter {
  height: 2px;
  background: rgba(10, 31, 68, 0.1);
}

.read-meter__fill {
  display: block;
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--red), var(--amber));
  transition: width 0.12s linear;
}

/* ===== 页脚：合订档案 ===== */
.site-foot {
  margin-top: clamp(3rem, 8vw, 6rem);
  background: var(--ink);
  color: var(--paper);
  border-top: 3px solid var(--red);
}

.site-foot :focus-visible { outline-color: var(--amber); }

/* 本地入口横条 */
.foot-local {
  background: var(--sand);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.foot-local__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 1.2rem;
  padding-block: 0.95rem;
}

.foot-local__label {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  color: var(--red);
  flex: none;
}

.foot-local__note {
  flex: 1 1 260px;
  font-size: 0.84rem;
  color: var(--slate);
}

.foot-local__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding-bottom: 2px;
  border-bottom: 2px solid var(--red);
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  flex: none;
}

.foot-local__link:hover { color: var(--red); }

/* 合订区 */
.foot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 3vw, 2.4rem);
  padding-block: clamp(2.2rem, 5vw, 3.4rem);
}

.foot-brand__name {
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

.foot-brand__line {
  margin-top: 0.55rem;
  font-size: 0.88rem;
  color: rgba(251, 246, 238, 0.74);
}

.foot-brand__meta {
  margin-top: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--amber);
}

.foot-col__title {
  padding-bottom: 0.55rem;
  margin-bottom: 0.7rem;
  border-bottom: 1px solid rgba(201, 187, 168, 0.3);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--amber);
}

.foot-list { display: grid; gap: 0.1rem; }

.foot-list__link {
  display: inline-block;
  padding: 0.28rem 0;
  font-size: 0.9rem;
  color: rgba(251, 246, 238, 0.84);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}

.foot-list__link:hover {
  color: #FFFFFF;
  border-bottom-color: var(--red);
}

/* 联系台账 */
.foot-ledger {
  padding: 1rem 1.05rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(201, 187, 168, 0.3);
  border-radius: var(--radius);
}

.foot-ledger__title {
  padding-bottom: 0.55rem;
  margin-bottom: 0.45rem;
  border-bottom: 1px dashed rgba(201, 187, 168, 0.32);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  color: var(--amber);
}

.ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.5rem;
  padding: 0.38rem 0;
  border-bottom: 1px dashed rgba(201, 187, 168, 0.22);
  font-size: 0.84rem;
}

.ledger-row:last-child { border-bottom: 0; }

.ledger-row__label {
  flex: none;
  width: 3.6em;
  font-family: var(--font-mono);
  font-size: 0.64rem;
  letter-spacing: 0.12em;
  color: rgba(251, 246, 238, 0.55);
}

.ledger-row__value {
  color: var(--paper);
  word-break: break-word;
}

.copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: auto;
  padding: 0.14rem 0.42rem;
  background: transparent;
  border: 1px solid rgba(201, 187, 168, 0.45);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
  color: var(--paper);
  cursor: pointer;
  transition: background-color 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease);
}

.copy-btn:hover { background: var(--red); border-color: var(--red); }

.copy-btn[data-copied] {
  background: var(--teal);
  border-color: var(--teal);
  color: #04211E;
}

/* 法务行 */
.foot-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem 1.4rem;
  padding-block: 1.05rem 1.6rem;
  border-top: 1px solid rgba(201, 187, 168, 0.3);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  color: rgba(251, 246, 238, 0.6);
}

.foot-legal__meta { margin-right: auto; }

.foot-legal__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
}

.foot-legal__link {
  color: rgba(251, 246, 238, 0.82);
  text-decoration: none;
  border-bottom: 1px solid rgba(201, 187, 168, 0.48);
}

.foot-legal__link:hover {
  color: #FFFFFF;
  border-bottom-color: var(--red);
}

/* 页脚响应式 */
@media (min-width: 720px) {
  .foot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .foot-brand { grid-column: 1 / -1; }
}

@media (min-width: 1024px) {
  .foot-grid {
    grid-template-columns: 1.45fr 0.72fr 0.72fr 0.72fr 1.3fr;
    gap: 1.6rem;
    align-items: start;
  }
  .foot-brand { grid-column: auto; }
}

/* --- 动效与可访问性 --- */
@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;
    scroll-behavior: auto !important;
  }
}
