/* ==========================================================================
   HOPOO · /assets/site.css
   共享外壳（头部 / 页脚）+ 基础组件 + 中文排版
   ========================================================================== */

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

/* ---------- 变量 ---------- */
:root {
  --hp-blue: #0E6E8C;
  --hp-blue-deep: #08495E;
  --hp-blue-light: #7FBFD4;
  --hp-yellow: #E8B33C;
  --hp-red: #C0392B;
  --hp-moss: #6E7F55;
  --hp-ink: #3A3F45;
  --hp-sand: #E7E3DA;
  --hp-mist: #F5F4F0;
  --hp-paper: #FBFAF6;
  --hp-line: rgba(58, 63, 69, 0.18);
  --hp-line-soft: rgba(58, 63, 69, 0.1);
  --hp-on-deep: rgba(245, 244, 240, 0.82);
  --hp-maxw: 1280px;
  --hp-gutter: clamp(18px, 4vw, 52px);
  --hp-header-h: 76px;
  --hp-font-sans: "Source Han Sans SC", "Noto Sans SC", "Alibaba PuHuiTi",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system,
    "Segoe UI", Roboto, sans-serif;
  --hp-font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular,
    Menlo, Consolas, "Courier New", monospace;
}

/* ---------- 中文基础排版 ---------- */
body {
  padding-top: var(--hp-header-h);
  font-family: var(--hp-font-sans);
  font-size: clamp(16px, 0.28vw + 15.1px, 17px);
  line-height: 1.75;
  letter-spacing: 0.01em;
  color: var(--hp-ink);
  background: var(--hp-mist);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: var(--hp-ink);
  overflow-wrap: break-word;
}
h1 { font-size: clamp(32px, 5vw, 56px); }
h2 { font-size: clamp(25px, 3.2vw, 40px); }
h3 { font-size: clamp(20px, 1.9vw, 28px); }
h4 { font-size: 20px; }
h5 { font-size: 17px; }

#main-content { display: block; }

:focus-visible {
  outline: 2px solid var(--hp-blue);
  outline-offset: 3px;
  border-radius: 1px;
}

/* ---------- 工具类 ---------- */
.hp-shell {
  width: 100%;
  max-width: var(--hp-maxw);
  margin-inline: auto;
  padding-inline: var(--hp-gutter);
}

.hp-section { padding-block: clamp(38px, 6vw, 88px); }

.hp-band { background: var(--hp-sand); }
.hp-band--deep {
  background: var(--hp-blue-deep);
  color: var(--hp-on-deep);
}
.hp-band--deep h1,
.hp-band--deep h2,
.hp-band--deep h3,
.hp-band--deep h4 { color: var(--hp-paper); }
.hp-band--deep .hp-note { color: rgba(245, 244, 240, 0.62); }
.hp-band--deep .hp-rule { background: rgba(245, 244, 240, 0.2); }

.hp-rule {
  height: 1px;
  background: var(--hp-line);
  margin-block: clamp(22px, 3vw, 40px);
}

.hp-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--hp-blue);
  text-transform: uppercase;
}
.hp-eyebrow::before {
  content: "";
  width: 24px;
  height: 2px;
  background: var(--hp-yellow);
}

.hp-lead {
  max-width: 34em;
  font-size: clamp(17px, 1.2vw, 20px);
  line-height: 1.72;
  color: rgba(58, 63, 69, 0.88);
}
.hp-band--deep .hp-lead { color: rgba(245, 244, 240, 0.86); }

.hp-note {
  font-size: 12.5px;
  line-height: 1.65;
  letter-spacing: 0.14em;
  color: rgba(58, 63, 69, 0.58);
}

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

.hp-prose { max-width: 38em; }
.hp-prose p { max-width: 38em; margin-bottom: 1.1em; }
.hp-prose p:last-child { margin-bottom: 0; }

/* ---------- 网格 ---------- */
.hp-grid { display: grid; gap: clamp(18px, 2.4vw, 34px); }
.hp-grid--7-5 { grid-template-columns: 7fr 5fr; }
.hp-grid--8-4 { grid-template-columns: 8fr 4fr; }
.hp-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hp-grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hp-grid--stack { grid-template-columns: 1fr; }

/* ---------- 按钮 ---------- */
.hp-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.03em;
  line-height: 1.2;
  text-align: center;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}
.hp-btn--primary {
  background: var(--hp-blue);
  border-color: var(--hp-blue);
  color: #fff;
}
.hp-btn--primary:hover { background: var(--hp-blue-deep); border-color: var(--hp-blue-deep); }
.hp-btn--ghost {
  background: transparent;
  border-color: var(--hp-blue);
  color: var(--hp-blue-deep);
}
.hp-btn--ghost:hover { background: var(--hp-blue); color: #fff; }
.hp-btn--sand {
  background: var(--hp-paper);
  border-color: var(--hp-line);
  color: var(--hp-blue-deep);
}
.hp-btn--sand:hover { border-color: var(--hp-blue); color: var(--hp-blue); }

/* ---------- 纸张卡片 ---------- */
.hp-card {
  position: relative;
  background: var(--hp-paper);
  border: 1px solid var(--hp-line);
  padding: clamp(18px, 2.2vw, 30px);
}
.hp-card--stack { box-shadow: 8px 8px 0 0 var(--hp-sand); }
.hp-band--deep .hp-card--stack { box-shadow: 8px 8px 0 0 rgba(0, 0, 0, 0.22); }
.hp-card__title { font-size: 19px; font-weight: 800; line-height: 1.4; }
.hp-card__meta {
  margin-top: 10px;
  font-family: var(--hp-font-mono);
  font-size: 13px;
  letter-spacing: 0.04em;
  color: rgba(58, 63, 69, 0.6);
}

/* ---------- 标签 ---------- */
.hp-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border: 1px solid var(--hp-line);
  background: var(--hp-paper);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--hp-ink);
}
.hp-chip--blue { background: rgba(127, 191, 212, 0.18); border-color: rgba(14, 110, 140, 0.4); color: var(--hp-blue-deep); }
.hp-chip--amber { background: rgba(232, 179, 60, 0.2); border-color: rgba(232, 179, 60, 0.65); color: #6b4c0c; }
.hp-chip--moss { background: rgba(110, 127, 85, 0.16); border-color: rgba(110, 127, 85, 0.5); color: #46532f; }

/* ---------- 面包屑 ---------- */
.hp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  letter-spacing: 0.03em;
  color: rgba(58, 63, 69, 0.66);
}
.hp-breadcrumb a:hover { color: var(--hp-blue); text-decoration: underline; }
.hp-breadcrumb__sep { color: var(--hp-blue-light); }

/* ---------- 图片容器基础规则 ---------- */
.hp-media {
  position: relative;
  overflow: hidden;
  background: var(--hp-sand);
  border: 1px solid var(--hp-line);
}
.hp-media img,
.hp-media video,
.hp-media picture { width: 100%; height: 100%; object-fit: cover; }
.hp-media--wide { aspect-ratio: 16 / 9; }
.hp-media--band { aspect-ratio: 21 / 9; }
.hp-media--card { aspect-ratio: 4 / 3; }
.hp-media--tall { aspect-ratio: 3 / 4; }
.hp-media__caption {
  margin-top: 10px;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: rgba(58, 63, 69, 0.58);
}

/* ---------- 主题筛选 ---------- */
.hp-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.hp-filter {
  padding: 7px 16px;
  border: 1px solid var(--hp-line);
  background: var(--hp-paper);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--hp-blue-deep);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.hp-filter:hover { border-color: var(--hp-blue); }
.hp-filter[aria-pressed="true"] {
  background: var(--hp-yellow);
  border-color: var(--hp-yellow);
  color: #46330a;
}
[data-filter-item][hidden] { display: none; }

/* ---------- 章节索引 ---------- */
.hp-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.hp-toc__link {
  padding-bottom: 3px;
  border-bottom: 2px solid transparent;
  font-size: 14px;
  font-weight: 600;
  color: rgba(58, 63, 69, 0.7);
  transition: color 0.2s ease, border-color 0.2s ease;
}
.hp-toc__link:hover { color: var(--hp-blue); }
.hp-toc__link.is-current { color: var(--hp-blue); border-bottom-color: var(--hp-blue); }

/* ---------- 进入视口显现 ---------- */
.hp-js [data-reveal] {
  opacity: 0;
  transform: translateY(12px);
}
.hp-js [data-reveal].is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ==========================================================================
   头部
   ========================================================================== */
.hp-skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 300;
  padding: 13px 20px;
  background: var(--hp-blue-deep);
  color: var(--hp-paper);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.06em;
}
.hp-skip:focus { left: 12px; top: 12px; }

.hp-header {
  position: fixed;
  inset-block-start: 0;
  inset-inline: 0;
  z-index: 120;
  height: var(--hp-header-h);
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}
.hp-header[data-scrolled] {
  background: var(--hp-sand);
  border-bottom-color: rgba(58, 63, 69, 0.16);
  box-shadow: 0 1px 0 rgba(58, 63, 69, 0.05);
}
.hp-header[data-open] { background: var(--hp-sand); }

.hp-header__inner {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.2vw, 36px);
  height: 100%;
}

.hp-brand {
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  gap: 3px;
  color: var(--hp-blue-deep);
}
.hp-brand__mark {
  font-size: 26px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.16em;
}
.hp-brand__tag {
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.22em;
  color: rgba(58, 63, 69, 0.6);
}

.hp-nav { margin-inline-start: auto; }
.hp-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
}
.hp-nav__item { display: block; }
.hp-nav__link {
  position: relative;
  display: inline-block;
  padding: 6px 2px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: rgba(58, 63, 69, 0.84);
  transition: color 0.2s ease;
}
.hp-nav__link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--hp-blue);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.2s ease;
}
.hp-nav__link:hover { color: var(--hp-blue); }
.hp-nav__link:hover::after { transform: scaleX(1); }
.hp-nav__link[aria-current="page"] { color: var(--hp-blue); }
.hp-nav__link[aria-current="page"]::after { transform: scaleX(1); }

.hp-header__cta { flex: 0 0 auto; }

.hp-nav-toggle {
  display: none;
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(58, 63, 69, 0.28);
  background: var(--hp-paper);
}
.hp-nav-toggle:hover { border-color: var(--hp-blue); }
.hp-nav-toggle__box {
  position: relative;
  display: block;
  width: 20px;
  height: 14px;
  margin: 0 auto;
}
.hp-nav-toggle__box span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--hp-blue-deep);
  transition: transform 0.22s ease, opacity 0.22s ease;
}
.hp-nav-toggle__box span:nth-child(1) { top: 0; }
.hp-nav-toggle__box span:nth-child(2) { top: 6px; }
.hp-nav-toggle__box span:nth-child(3) { top: 12px; }
.hp-header[data-open] .hp-nav-toggle__box span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hp-header[data-open] .hp-nav-toggle__box span:nth-child(2) { opacity: 0; }
.hp-header[data-open] .hp-nav-toggle__box span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.hp-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  overflow: hidden;
  pointer-events: none;
}
.hp-progress__bar {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--hp-blue) 0%, var(--hp-blue) 62%, var(--hp-yellow) 100%);
  transform: scaleX(0);
  transform-origin: left center;
}

/* ==========================================================================
   页脚
   ========================================================================== */
.hp-footer {
  margin-top: clamp(40px, 6vw, 88px);
  background: var(--hp-blue-deep);
  color: var(--hp-on-deep);
  border-top: 4px solid var(--hp-blue);
  padding-top: clamp(40px, 5.6vw, 76px);
}

.hp-footer__top {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: clamp(28px, 4vw, 62px);
}

.hp-footer__brand { max-width: 34em; }
.hp-footer__mark {
  font-size: clamp(26px, 2.6vw, 32px);
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.18em;
  color: var(--hp-paper);
}
.hp-footer__tag {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.22em;
  color: var(--hp-blue-light);
}
.hp-footer__blurb {
  margin-top: 18px;
  font-size: 14.5px;
  line-height: 1.85;
  color: rgba(245, 244, 240, 0.72);
}

.hp-footer__cols {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 26px 22px;
}
.hp-footer__col { min-width: 0; }
.hp-footer__title {
  margin-bottom: 14px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--hp-yellow);
}
.hp-footer__list { display: grid; gap: 10px; }
.hp-footer__link {
  display: inline-block;
  font-size: 14.5px;
  line-height: 1.5;
  color: rgba(245, 244, 240, 0.84);
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.hp-footer__link:hover,
.hp-footer__link[aria-current="page"] {
  color: #fff;
  border-bottom-color: var(--hp-blue-light);
}

.hp-footer__contact {
  margin-top: clamp(30px, 4vw, 52px);
  padding-top: clamp(22px, 3vw, 34px);
  border-top: 1px solid rgba(245, 244, 240, 0.18);
}
.hp-contact {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px 26px;
}
.hp-contact__item { min-width: 0; }
.hp-contact__label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  color: var(--hp-blue-light);
}
.hp-contact__value {
  display: block;
  margin-top: 7px;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--hp-paper);
  overflow-wrap: anywhere;
}
.hp-copy {
  margin-top: 11px;
  padding: 5px 13px;
  border: 1px solid rgba(245, 244, 240, 0.4);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: var(--hp-paper);
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.hp-copy:hover { background: var(--hp-blue); border-color: var(--hp-blue); }
.hp-copy[data-copied] {
  background: var(--hp-yellow);
  border-color: var(--hp-yellow);
  color: #46330a;
}

.hp-footer__legal {
  margin-top: clamp(28px, 4vw, 48px);
  padding-block: 18px;
  background: rgba(0, 0, 0, 0.2);
  border-top: 1px solid rgba(245, 244, 240, 0.12);
}
.hp-footer__legal-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 26px;
}
.hp-footer__copy {
  font-size: 13px;
  letter-spacing: 0.03em;
  color: rgba(245, 244, 240, 0.72);
}
.hp-footer__note {
  font-size: 12.5px;
  color: rgba(245, 244, 240, 0.5);
}

/* ==========================================================================
   响应式
   ========================================================================== */
@media (max-width: 1080px) {
  .hp-grid--7-5,
  .hp-grid--8-4 { grid-template-columns: 1fr; }
  .hp-footer__top { grid-template-columns: 1fr; }
  .hp-contact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 900px) {
  :root { --hp-header-h: 64px; }

  .hp-brand__mark { font-size: 22px; }
  .hp-brand__tag { display: none; }

  .hp-nav-toggle { display: block; margin-inline-start: 10px; }
  .hp-header__cta { margin-inline-start: auto; padding: 10px 16px; font-size: 14px; }

  .hp-nav {
    position: fixed;
    top: var(--hp-header-h);
    right: 0;
    bottom: 0;
    left: 0;
    margin-inline-start: 0;
    padding: clamp(18px, 5vw, 36px) var(--hp-gutter) 48px;
    background: var(--hp-mist);
    border-top: 1px solid var(--hp-line);
    overflow-y: auto;
    transform: translateX(100%);
    visibility: hidden;
    transition: transform 0.26s ease, visibility 0.26s ease;
  }
  .hp-header[data-open] .hp-nav {
    transform: translateX(0);
    visibility: visible;
  }
  .hp-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .hp-nav__link {
    display: block;
    padding: 18px 4px;
    font-size: 22px;
    font-weight: 700;
    border-bottom: 1px solid var(--hp-line);
  }
  .hp-nav__link::after { display: none; }
  .hp-nav__link[aria-current="page"] {
    padding-inline-start: 16px;
    border-left: 3px solid var(--hp-blue);
    background: rgba(127, 191, 212, 0.14);
  }
  .hp-nav__link:hover { background: rgba(127, 191, 212, 0.1); }
}

@media (max-width: 640px) {
  .hp-grid--2,
  .hp-grid--3 { grid-template-columns: 1fr; }
  .hp-footer__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hp-contact { grid-template-columns: 1fr; }
  .hp-footer__legal-inner { flex-direction: column; align-items: flex-start; }
  .hp-media--band { aspect-ratio: 16 / 10; }
  .hp-card--stack { box-shadow: 5px 5px 0 0 var(--hp-sand); }
}

@media (max-width: 400px) {
  .hp-header__cta { padding: 9px 12px; font-size: 13px; letter-spacing: 0; }
  .hp-nav-toggle { width: 42px; height: 42px; }
}

/* ---------- 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: 0.001ms !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
  }
  .hp-js [data-reveal] { opacity: 1; transform: none; }
  .hp-progress__bar { transition: none; }
}
