/* ============================================================
   利记指南 · 全站共享样式 /assets/site.css
   1 变量与复位 · 2 基础排版 · 3 布局容器 · 4 头部
   5 页脚 · 6 通用组件 · 7 动效与无障碍
   ============================================================ */

/* ---------- 1. 变量与复位 ---------- */
:root {
  --navy: #0B2E4F;
  --ink: #071C33;
  --green: #0F5A4A;
  --green-soft: #DCEBE4;
  --orange: #FF6A2A;
  --orange-soft: #FFE1D2;
  --sand: #F3F1EC;
  --paper: #FFFFFF;
  --slate: #5A6672;
  --line: #D8DDE2;
  --ok: #2E8B6F;
  --text: #1D3448;

  --shell: 1180px;
  --gutter: clamp(18px, 4vw, 48px);
  --stack: 18px;

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

  --cut-sm: polygon(0 0, calc(100% - 8px) 0, 100% 8px, 100% 100%, 0 100%);
  --cut-md: polygon(0 0, calc(100% - 18px) 0, 100% 18px, 100% 100%, 0 100%);
}

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

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

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

ul, ol { list-style: none; }
img, svg, video { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4 { font-family: var(--sans); color: var(--navy); font-weight: 900; line-height: 1.2; letter-spacing: -0.01em; }

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

/* ---------- 2. 基础排版 ---------- */
body {
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  background: var(--sand);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 2.6vw, 2.05rem); font-weight: 800; }
h3 { font-size: 1.18rem; font-weight: 800; }
h4 { font-size: 1rem; font-weight: 800; letter-spacing: 0.01em; }

p { max-width: 68ch; }
strong { font-weight: 800; color: var(--navy); }

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

.lead {
  font-size: clamp(1.02rem, 1.35vw, 1.16rem);
  line-height: 1.85;
  color: var(--slate);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--green);
}

.eyebrow::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--orange);
}

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

/* ---------- 3. 布局容器 ---------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: clamp(32px, 5vw, 72px); }
.section--paper { background: var(--paper); }
.section--navy { background: var(--navy); color: #DCE8F2; }
.section--navy h2, .section--navy h3 { color: #FFFFFF; }

.grid { display: grid; gap: clamp(16px, 2.4vw, 32px); }
.grid--split { grid-template-columns: minmax(0, 1fr); }
.grid--cards { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

@media (min-width: 900px) {
  .grid--split { grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.5fr); align-items: start; }
  .grid--offset > :nth-child(even) { margin-top: 32px; }
  .grid--offset-sm > :nth-child(even) { margin-top: 16px; }
}

.stack > * + * { margin-top: var(--stack); }
.stack-lg > * + * { margin-top: clamp(24px, 3vw, 40px); }

.band {
  height: clamp(24px, 3vw, 48px);
  background: var(--navy);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
}
.band--green { background: var(--green); }
.band--gradient { background: linear-gradient(90deg, var(--navy) 0%, var(--green) 58%, var(--orange) 100%); }

/* ---------- 4. 头部 ---------- */
.skip-link {
  position: absolute;
  left: 16px;
  top: -90px;
  z-index: 999;
  display: inline-block;
  padding: 12px 20px;
  background: var(--orange);
  color: var(--ink);
  font-weight: 800;
  font-size: 14px;
  clip-path: var(--cut-sm);
  transition: top 0.18s ease;
}
.skip-link:focus { top: 12px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--navy);
  box-shadow: 0 1px 0 rgba(7, 28, 51, 0.35), 0 10px 26px rgba(7, 28, 51, 0.14);
}

.header-rail {
  background: var(--ink);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.rail-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 34px;
}

.rail-index,
.rail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: #8FA6B8;
}

.rail-tag {
  color: var(--orange);
  border: 1px solid rgba(255, 106, 42, 0.45);
  padding: 1px 7px;
  font-size: 10.5px;
}

.dot {
  width: 6px;
  height: 6px;
  flex: none;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(46, 139, 111, 0.22);
}

.header-bar { background: var(--navy); }

.bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 70px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  min-width: 0;
  padding-block: 8px;
  color: #FFFFFF;
}

.brand-mark {
  position: relative;
  flex: none;
  width: 34px;
  height: 34px;
  background: var(--orange);
  clip-path: var(--cut-sm);
}
.brand-mark::before,
.brand-mark::after {
  content: "";
  position: absolute;
  left: 8px;
  height: 4px;
  background: var(--ink);
}
.brand-mark::before { top: 10px; width: 18px; }
.brand-mark::after { top: 19px; width: 11px; }

.brand-text { display: block; min-width: 0; }

.brand-name {
  display: block;
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.05em;
  line-height: 1.2;
  color: #FFFFFF;
}

.brand-line {
  display: block;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  color: #8FA6B8;
  white-space: nowrap;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 10px 12px 12px;
  color: #CFDDE8;
  transition: color 0.18s ease, background-color 0.18s ease;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 5px;
  height: 2px;
  background: var(--orange);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform 0.2s ease;
}
.nav-num {
  font-size: 10.5px;
  color: #7E97AB;
  transition: color 0.18s ease;
}
.nav-text { font-size: 14.5px; font-weight: 600; }

.nav-link:hover { color: #FFFFFF; background: rgba(255, 255, 255, 0.06); }
.nav-link:hover::after { transform: scaleX(1); }
.nav-link:hover .nav-num { color: var(--orange); }

.nav-link[aria-current="page"] {
  color: #FFFFFF;
  background: rgba(255, 106, 42, 0.14);
}
.nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] .nav-num { color: var(--orange); }

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 14px;
  padding: 11px 18px;
  background: var(--orange);
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.02em;
  clip-path: var(--cut-sm);
  transition: background-color 0.18s ease, transform 0.18s ease;
}
.nav-cta::after {
  content: "→";
  font-family: var(--mono);
  font-size: 13px;
}
.nav-cta:hover { background: #FF874F; transform: translateY(-1px); }
.nav-cta:focus-visible { outline: 2px solid #FFFFFF; outline-offset: -5px; }

.nav-toggle { display: none; }

.scroll-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(255, 255, 255, 0.10);
  pointer-events: none;
}
.scroll-progress span {
  display: block;
  height: 100%;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: linear-gradient(90deg, var(--green) 0%, var(--orange) 100%);
}

@media (max-width: 940px) {
  html { scroll-padding-top: 100px; }

  .header-rail { display: none; }

  .bar-inner {
    flex-wrap: wrap;
    gap: 10px 14px;
    min-height: 62px;
    padding-block: 10px;
  }

  .brand-line { display: none; }

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 9px 14px;
    border: 1px solid rgba(255, 255, 255, 0.24);
    color: #FFFFFF;
    font-family: var(--mono);
    font-size: 11.5px;
    letter-spacing: 0.14em;
    clip-path: var(--cut-sm);
  }
  .nav-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }

  .nav-toggle-bars {
    position: relative;
    display: block;
    width: 18px;
    height: 2px;
    background: #FFFFFF;
    transition: background-color 0.18s ease;
  }
  .nav-toggle-bars::before,
  .nav-toggle-bars::after {
    content: "";
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: #FFFFFF;
    transition: transform 0.2s ease;
  }
  .nav-toggle-bars::before { top: -6px; }
  .nav-toggle-bars::after { top: 6px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
    margin-top: 4px;
    padding-bottom: 14px;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
  }
  .site-nav[data-open] { display: flex; }

  .nav-list { flex-direction: column; align-items: stretch; gap: 0; width: 100%; }

  .nav-link {
    justify-content: flex-start;
    padding: 13px 4px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }
  .nav-link::after { left: 4px; right: auto; width: 30px; bottom: 8px; }
  .nav-text { font-size: 15px; }

  .nav-cta {
    justify-content: center;
    margin: 16px 0 0;
    padding: 13px 18px;
  }
}

/* ---------- 5. 页脚 ---------- */
.site-footer {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #C7D6E2;
  padding-top: clamp(40px, 6vw, 76px);
}
.site-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(
    115deg,
    rgba(255, 255, 255, 0.035) 0 1px,
    transparent 1px 24px
  );
  pointer-events: none;
}

.footer-inner {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(30px, 4vw, 64px);
}

.footer-mark {
  position: relative;
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 16px;
  background: linear-gradient(135deg, var(--green) 0%, var(--navy) 100%);
  clip-path: var(--cut-sm);
}
.footer-mark::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  width: 18px;
  height: 2px;
  background: var(--orange);
}

.footer-title {
  font-size: clamp(22px, 2.4vw, 27px);
  font-weight: 900;
  letter-spacing: 0.04em;
  color: #FFFFFF;
  line-height: 1.25;
  max-width: none;
}

.footer-tagline {
  margin-top: 10px;
  max-width: 24em;
  font-size: 14.5px;
  line-height: 1.7;
  color: #9FB4C4;
}

.footer-index {
  margin-top: 18px;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--orange);
}

.footer-groups {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(24px, 3vw, 40px);
}

.footer-col-title {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #FFFFFF;
}
.footer-col-title .mono { font-size: 11px; color: var(--orange); }

.footer-links li + li { margin-top: 10px; }
.footer-links a {
  display: inline-block;
  font-size: 14.5px;
  color: #C7D6E2;
  padding-bottom: 2px;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.footer-links a:hover,
.footer-links a:focus-visible { color: #FFFFFF; border-bottom-color: var(--orange); }

.footer-contact li + li { margin-top: 12px; }
.contact-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.65;
}
.contact-label {
  flex: none;
  min-width: 42px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--ok);
}
.contact-value { color: #B7C8D6; word-break: break-word; }

.footer-bottom {
  margin-top: clamp(30px, 4vw, 56px);
  padding-block: 22px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  display: grid;
  gap: 14px;
}

.footer-bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 26px;
}

.footer-util {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 20px;
}
.footer-util-link {
  font-size: 13px;
  color: #C7D6E2;
  padding-bottom: 1px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.28);
  transition: color 0.18s ease, border-color 0.18s ease;
}
.footer-util-link:hover,
.footer-util-link:focus-visible { color: var(--orange); border-bottom-color: var(--orange); }

.footer-note {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: #8FA6B8;
  max-width: none;
}

.footer-bottom-row--legal { justify-content: flex-start; gap: 10px 26px; }
.footer-legal {
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: #7E97AB;
  max-width: none;
}
.footer-year { display: inline-block; min-width: 4ch; }

@media (min-width: 760px) {
  .footer-top { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr); }
  .footer-groups { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}

@media (min-width: 1040px) {
  .footer-groups { grid-template-columns: minmax(0, 0.85fr) minmax(0, 0.9fr) minmax(0, 1.25fr); }
}

/* 返回顶部 */
.back-to-top {
  position: fixed;
  right: clamp(14px, 3vw, 28px);
  bottom: clamp(14px, 3vw, 28px);
  z-index: 150;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--ink);
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.22);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  clip-path: var(--cut-sm);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease, background-color 0.2s ease;
}
.back-to-top[data-visible] { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { background: var(--orange); color: var(--ink); border-color: var(--orange); }
.back-to-top:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.back-to-top-icon { font-size: 13px; line-height: 1; }

/* ---------- 6. 通用组件 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
  border: 1px solid transparent;
  clip-path: var(--cut-sm);
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.btn--primary { background: var(--orange); color: var(--ink); }
.btn--primary:hover { background: #FF874F; transform: translateY(-1px); }
.btn--ink { background: var(--navy); color: #FFFFFF; }
.btn--ink:hover { background: var(--green); }
.btn--ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn--ghost:hover { background: var(--paper); border-color: var(--navy); }
.btn--primary:focus-visible,
.btn--ink:focus-visible { outline: 2px solid var(--paper); outline-offset: -6px; }
.btn--ghost:focus-visible { outline: 2px solid var(--navy); outline-offset: -6px; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  background: var(--green-soft);
  color: var(--green);
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  clip-path: var(--cut-sm);
}
.tag--orange { background: var(--orange-soft); color: #8A3410; }
.tag--ink { background: var(--navy); color: #FFFFFF; }

.panel {
  position: relative;
  padding: clamp(20px, 2.6vw, 32px);
  background: var(--paper);
  border: 1px solid var(--line);
  clip-path: var(--cut-md);
}
.panel--wash {
  background: linear-gradient(155deg, #FFFFFF 0%, #EDF4F0 52%, var(--green-soft) 100%);
  border-color: #CFE1DA;
}
.panel--ink {
  background: var(--navy);
  border-color: rgba(255, 255, 255, 0.16);
  color: #DCE8F2;
}
.panel--ink h2, .panel--ink h3, .panel--ink h4 { color: #FFFFFF; }

.breadcrumbs { padding-block: 16px; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--slate);
}
.breadcrumbs li + li::before {
  content: "/";
  margin-right: 8px;
  color: var(--line);
}
.breadcrumbs a { color: var(--green); border-bottom: 1px solid transparent; }
.breadcrumbs a:hover, .breadcrumbs a:focus-visible { border-bottom-color: var(--green); }
.breadcrumbs [aria-current="page"] { color: var(--navy); font-weight: 700; }

.media-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  background: linear-gradient(150deg, #FFFFFF 0%, #E8F1EC 55%, var(--green-soft) 100%);
  clip-path: var(--cut-md);
}
.media-frame > img,
.media-frame > svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame-label {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 12px;
  background: var(--navy);
  color: #FFFFFF;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.12em;
}

.index-rail { display: flex; flex-direction: column; gap: 4px; }
.index-rail a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 9px 12px;
  border-left: 2px solid var(--line);
  font-size: 14px;
  color: var(--slate);
  transition: color 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}
.index-rail a:hover {
  color: var(--navy);
  border-left-color: var(--navy);
  background: rgba(11, 46, 79, 0.05);
}
.index-rail a[aria-current] {
  color: var(--navy);
  font-weight: 800;
  border-left-color: var(--orange);
  background: var(--orange-soft);
}
@media (min-width: 1000px) {
  .index-rail { position: sticky; top: 128px; }
}

.chapter {
  padding-block: clamp(28px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

/* ---------- 7. 动效与无障碍 ---------- */
.js-ready [data-reveal] {
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}
.js-ready [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .back-to-top { padding: 9px 12px; }
}

@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;
  }
  .js-ready [data-reveal] { opacity: 1; transform: none; transition: none; }
  .back-to-top { transition: opacity 0.001ms; }
}

@media print {
  .site-header,
  .back-to-top,
  .scroll-progress { display: none !important; }
  body { background: #FFFFFF; color: #000000; font-size: 12pt; }
  .site-footer { background: #FFFFFF; color: #000000; }
  .site-footer::before { display: none; }
  a { text-decoration: underline; }
}
