/* ==========================================================================
   恒峰指南 · 共享站点样式 /assets/site.css
   ========================================================================== */

:root {
  --ink-900: #0B1F1A;
  --forest-700: #123E33;
  --forest-500: #1E6B56;
  --sand-100: #F4EAD8;
  --sand-300: #DFCFB0;
  --amber-500: #F2A03D;
  --amber-600: #C9761F;
  --slate-500: #5E7182;
  --slate-200: #D5DEE6;
  --paper-50: #FBF8F2;
  --white: #FFFFFF;

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

  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
  --radius-pill: 999px;

  --header-h: 76px;
  --header-h-sm: 60px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --shadow-lift: 0 14px 34px -22px rgba(11, 31, 26, .55);
  --hairline: rgba(18, 62, 51, .16);
}

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

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

body {
  margin: 0;
  background: var(--paper-50);
  color: var(--ink-900);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6 { margin: 0; line-height: 1.2; letter-spacing: -0.02em; font-weight: 800; }
p { margin: 0; }
a { color: var(--forest-500); }

/* ---------- 中文排版 ---------- */
h1 { font-size: clamp(2.2rem, 5vw, 4.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h3 { font-size: 1.35rem; }
h4 { font-size: 1.06rem; letter-spacing: 0; }

strong, b { font-weight: 700; }
small { font-size: .84rem; color: var(--slate-500); }

/* ---------- 可访问性 ---------- */
:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 3px;
  border-radius: 4px;
}

.hf-visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.hf-skip {
  position: absolute;
  left: 16px;
  top: -80px;
  z-index: 200;
  padding: 12px 22px;
  border-radius: var(--radius-pill);
  background: var(--amber-500);
  color: var(--ink-900);
  font-weight: 700;
  text-decoration: none;
  transition: top .2s var(--ease);
}
.hf-skip:focus { top: 12px; }

/* ---------- 布局容器 ---------- */
.hf-container {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
}

#main-content {
  display: block;
  padding-top: var(--header-h);
}

.hf-hero {
  margin-top: calc(-1 * var(--header-h));
}

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

.hf-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(18px, 2.6vw, 32px);
}
.hf-grid > * { grid-column: span 12; }

.hf-grid--auto {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  gap: clamp(18px, 2.6vw, 32px);
}

/* ---------- 头部 ---------- */
.hf-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: var(--forest-700);
  color: var(--white);
  border-bottom: 1px solid rgba(244, 234, 216, .14);
  transition: background .22s var(--ease), border-color .22s var(--ease);
}

.hf-header[data-overlay="true"] {
  background: linear-gradient(to bottom, rgba(11, 31, 26, .74), rgba(11, 31, 26, 0));
  border-bottom-color: transparent;
}

.hf-header__bar { position: relative; }

.hf-header__inner {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.6vw, 36px);
  min-height: var(--header-h);
  transition: min-height .22s var(--ease);
}

.hf-header[data-scrolled="true"] .hf-header__inner { min-height: var(--header-h-sm); }

/* 品牌 */
.hf-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex: none;
  color: inherit;
  text-decoration: none;
}

.hf-brand__mark {
  position: relative;
  width: 30px;
  height: 30px;
  flex: none;
  border-radius: 9px;
  background: var(--amber-500);
  box-shadow: inset 0 0 0 1px rgba(11, 31, 26, .2);
}
.hf-brand__mark::before,
.hf-brand__mark::after {
  content: "";
  position: absolute;
  background: var(--forest-700);
  border-radius: 1px;
}
.hf-brand__mark::before { left: 7px; right: 15px; top: 9px; height: 2px; }
.hf-brand__mark::after { left: 7px; right: 11px; bottom: 9px; height: 2px; }

.hf-brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.hf-brand__name { font-weight: 800; font-size: 1.06rem; letter-spacing: -.01em; }
.hf-brand__line {
  margin-top: 3px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .72rem;
  letter-spacing: .08em;
  color: rgba(244, 234, 216, .72);
}

.hf-brand--footer .hf-brand__mark { width: 34px; height: 34px; border-radius: 10px; }
.hf-brand--footer .hf-brand__name { font-size: 1.18rem; }

/* 导航 */
.hf-nav { margin-left: auto; }

.hf-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(2px, 1vw, 14px);
  list-style: none;
}

.hf-nav__item { margin: 0; }

.hf-nav__link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: var(--radius-pill);
  color: rgba(255, 255, 255, .82);
  font-size: .94rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--ease), background .18s var(--ease);
}
.hf-nav__link:hover { color: #fff; background: rgba(244, 234, 216, .14); }

.hf-nav__link[aria-current="page"] {
  color: var(--ink-900);
  background: var(--sand-100);
  font-weight: 700;
}

/* 头部动作 */
.hf-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
  margin-left: clamp(8px, 1.6vw, 22px);
}

/* 移动按钮 */
.hf-nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(244, 234, 216, .34);
  border-radius: 14px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.hf-nav-toggle:hover { border-color: var(--sand-100); background: rgba(244, 234, 216, .12); }

.hf-nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}
.hf-nav-toggle__bars::before,
.hf-nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .2s var(--ease), top .2s var(--ease);
}
.hf-nav-toggle__bars::before { top: -6px; }
.hf-nav-toggle__bars::after { top: 6px; }

.hf-nav-toggle[aria-expanded="true"] .hf-nav-toggle__bars { background: transparent; }
.hf-nav-toggle[aria-expanded="true"] .hf-nav-toggle__bars::before { top: 0; transform: rotate(45deg); }
.hf-nav-toggle[aria-expanded="true"] .hf-nav-toggle__bars::after { top: 0; transform: rotate(-45deg); }

/* 阅读进度 */
.hf-progress {
  position: absolute;
  left: 0;
  bottom: -1px;
  width: 100%;
  height: 3px;
  background: var(--amber-500);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .1s linear;
}

/* ---------- 按钮 ---------- */
.hf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 24px;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: transparent;
  font-family: inherit;
  font-size: .92rem;
  font-weight: 600;
  line-height: 1;
  letter-spacing: .01em;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform .18s var(--ease), background .18s var(--ease), color .18s var(--ease), border-color .18s var(--ease);
}
.hf-btn:hover { transform: translateY(-1px); }
.hf-btn:active { transform: translateY(0); }

.hf-btn--amber { background: var(--amber-500); color: var(--ink-900); }
.hf-btn--amber:hover { background: #F7B159; }

.hf-btn--ghost {
  background: transparent;
  color: var(--sand-100);
  border-color: rgba(244, 234, 216, .38);
}
.hf-btn--ghost:hover { border-color: var(--sand-100); background: rgba(244, 234, 216, .12); }

.hf-btn--line {
  background: var(--white);
  color: var(--ink-900);
  border-color: var(--sand-300);
}
.hf-btn--line:hover { border-color: var(--forest-500); color: var(--forest-700); }

.hf-btn--sm { padding: 10px 18px; font-size: .85rem; }

.hf-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 14px;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--slate-500);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
}

/* ---------- 基础排版组件 ---------- */
.hf-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: .82rem;
  letter-spacing: .16em;
  color: var(--amber-600);
}
.hf-eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: currentColor;
}

.hf-rule {
  height: 1px;
  margin: clamp(32px, 5vw, 56px) 0;
  border: 0;
  background: repeating-linear-gradient(90deg, var(--sand-300) 0 10px, transparent 10px 20px);
}

.hf-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  background: var(--sand-100);
  color: var(--forest-700);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
}

.hf-mono {
  font-family: var(--font-mono);
  font-size: .94em;
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}

.hf-prose {
  max-width: 38em;
  line-height: 1.75;
}
.hf-prose p { margin-bottom: 1.15em; }
.hf-prose p:last-child { margin-bottom: 0; }
.hf-prose h2 { margin: 1.6em 0 .6em; }
.hf-prose h3 { margin: 1.4em 0 .5em; }
.hf-prose ul { list-style: none; margin: 0 0 1.2em; padding: 0; }
.hf-prose ul li {
  position: relative;
  padding-left: 20px;
  margin-bottom: .5em;
}
.hf-prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 8px;
  height: 2px;
  background: var(--amber-500);
}
.hf-prose a {
  color: var(--forest-500);
  text-decoration: none;
  border-bottom: 1px solid var(--sand-300);
}
.hf-prose a:hover { border-bottom-color: var(--forest-500); }

/* ---------- 面包屑 ---------- */
.hf-breadcrumb {
  padding: 18px 0 4px;
  font-size: .84rem;
  color: var(--slate-500);
}
.hf-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  list-style: none;
}
.hf-breadcrumb li { display: inline-flex; align-items: center; gap: 8px; }
.hf-breadcrumb li + li::before { content: "/"; color: var(--sand-300); }
.hf-breadcrumb a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.hf-breadcrumb a:hover { color: var(--forest-500); border-bottom-color: var(--forest-500); }
.hf-breadcrumb [aria-current="page"] { color: var(--ink-900); font-weight: 600; }

/* ---------- 卡片与评分刻度 ---------- */
.hf-card {
  padding: clamp(20px, 2.8vw, 30px);
  background: var(--white);
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-lg);
  transition: transform .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.hf-card:hover {
  transform: translateY(-2px);
  border-color: var(--forest-500);
  box-shadow: var(--shadow-lift);
}

.hf-score {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
}
.hf-score__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--forest-700);
  letter-spacing: .02em;
  font-variant-numeric: tabular-nums;
}
.hf-score__track {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 3px;
  background: var(--slate-200);
  overflow: hidden;
}
.hf-score__fill {
  position: absolute;
  inset: 0 auto 0 0;
  border-radius: 3px;
  background: var(--amber-500);
}

/* ---------- 图片容器 ---------- */
.hf-figure { margin: 0; }

.hf-figure__frame {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--sand-100);
  border: 1px solid var(--sand-300);
  aspect-ratio: 16 / 10;
}
.hf-figure__frame img,
.hf-figure__frame > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.hf-figure--tall .hf-figure__frame { aspect-ratio: 3 / 4; }
.hf-figure--wide .hf-figure__frame { aspect-ratio: 21 / 9; }

.hf-figure__frame[data-placeholder]::after {
  content: attr(data-placeholder);
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 16px;
  color: var(--slate-500);
  font-size: .82rem;
  letter-spacing: .08em;
  text-align: center;
  background:
    repeating-linear-gradient(135deg, rgba(223, 207, 176, .55) 0 2px, transparent 2px 12px);
}

.hf-figure__caption {
  margin-top: 12px;
  font-size: .82rem;
  line-height: 1.6;
  color: var(--slate-500);
  font-family: var(--font-serif);
  font-style: italic;
}

/* ---------- 章节索引胶囊 ---------- */
.hf-index {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.hf-index__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 16px;
  border: 1px solid var(--sand-300);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .78);
  color: var(--slate-500);
  font-size: .82rem;
  text-decoration: none;
  transition: color .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease);
}
.hf-index__link:hover { border-color: var(--forest-500); color: var(--forest-700); }
.hf-index__link[aria-current="true"] {
  background: var(--forest-700);
  border-color: var(--forest-700);
  color: var(--sand-100);
}

.hf-index--rail {
  position: fixed;
  right: 24px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 60;
}

/* ---------- 页脚 ---------- */
.hf-footer {
  margin-top: clamp(56px, 8vw, 104px);
  background: var(--forest-700);
  color: var(--sand-100);
}

.hf-footer::before {
  content: "";
  display: block;
  height: 6px;
  background: repeating-linear-gradient(90deg, var(--amber-500) 0 14px, rgba(244, 234, 216, .18) 14px 28px);
  opacity: .55;
}

.hf-footer__inner {
  width: min(1240px, 100% - 48px);
  margin-inline: auto;
  padding: clamp(44px, 6vw, 78px) 0 32px;
}

.hf-footer__top {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) minmax(0, 2fr);
  gap: clamp(28px, 5vw, 64px);
}

.hf-footer__tagline {
  margin-top: 18px;
  max-width: 26em;
  font-size: .92rem;
  line-height: 1.7;
  color: rgba(244, 234, 216, .74);
}

.hf-footer__nav {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 36px);
}

.hf-footer__group-title {
  margin: 0 0 14px;
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
  font-size: .82rem;
  letter-spacing: .16em;
  color: rgba(244, 234, 216, .58);
}

.hf-footer__links {
  display: grid;
  gap: 10px;
  list-style: none;
}
.hf-footer__links a {
  display: inline-block;
  color: rgba(244, 234, 216, .9);
  font-size: .95rem;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.hf-footer__links a:hover {
  color: #fff;
  border-bottom-color: var(--amber-500);
}

.hf-footer__band {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 28px;
  margin-top: clamp(32px, 5vw, 54px);
  padding: clamp(20px, 3vw, 28px);
  border: 1px solid rgba(244, 234, 216, .18);
  border-radius: var(--radius-md);
  background: rgba(11, 31, 26, .38);
}

.hf-footer__band-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
}

.hf-footer__band-text {
  flex: 1 1 260px;
  margin: 0;
  font-size: .9rem;
  line-height: 1.7;
  color: rgba(244, 234, 216, .76);
}

.hf-footer__meta {
  display: grid;
  gap: 8px;
  margin-top: clamp(26px, 4vw, 42px);
  padding-top: 22px;
  border-top: 1px solid rgba(244, 234, 216, .16);
  font-size: .83rem;
  line-height: 1.7;
  color: rgba(244, 234, 216, .64);
}
.hf-footer__meta p { margin: 0; }

body.hf-nav-open { overflow: hidden; }

/* ---------- 平板 ---------- */
@media (max-width: 1180px) {
  .hf-header__inner { gap: 14px; }
  .hf-nav__link { padding: 8px 9px; font-size: .9rem; }
}

@media (max-width: 1000px) {
  .hf-nav-toggle { display: grid; }

  .hf-header__actions { margin-left: auto; }

  .hf-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin: 0;
    padding: 10px 0 24px;
    background: var(--forest-700);
    border-top: 1px solid rgba(244, 234, 216, .18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .2s var(--ease), transform .2s var(--ease), visibility .2s var(--ease);
  }

  .hf-nav[data-open="true"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .hf-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 0 clamp(16px, 5vw, 28px);
  }

  .hf-nav__link {
    display: block;
    padding: 14px 16px;
    border-radius: 14px;
    font-size: 1.02rem;
    border-bottom: 1px solid rgba(244, 234, 216, .12);
  }
  .hf-nav__link[aria-current="page"] { border-bottom-color: transparent; }

  .hf-footer__top { grid-template-columns: 1fr; }
  .hf-index--rail { display: none; }
}

/* ---------- 手机 ---------- */
@media (max-width: 720px) {
  body { font-size: 16px; }
  .hf-container,
  .hf-header__inner,
  .hf-footer__inner { width: min(1240px, 100% - 32px); }

  .hf-brand__line { display: none; }
  .hf-header__cta { display: none; }

  .hf-footer__nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hf-footer__band { flex-direction: column; align-items: flex-start; }
  .hf-footer__meta { font-size: .78rem; }

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

  .hf-prose { max-width: none; }
}

@media (max-width: 420px) {
  .hf-footer__nav { grid-template-columns: 1fr; }
}

/* ---------- 降低动态效果 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .hf-btn:hover { transform: none; }
  .hf-card:hover { transform: none; }
}
