/* ============================================================
   美高指南 · 共享站点样式 /assets/site.css
   蓝图索引手册：细线网格 + 蓝青渐变 + 暖沙纸面 + 珊瑚动作色
   ============================================================ */

/* ---------- 1. reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body, h1, h2, h3, h4, h5, p, ul, ol, li, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; 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; }
::selection { background: #2EC5CE; color: #101C3D; }

/* ---------- 2. tokens ---------- */
:root {
  --paper: #F7FAFC;
  --ink: #101C3D;
  --indigo: #1F3A8A;
  --cyan: #2EC5CE;
  --sand: #F4E3C1;
  --coral: #FF6B4A;
  --steel: #5B7198;
  --sky: #DDF6F7;
  --coral-ink: #B33A22;
  --ok: #0F7C75;

  --grad: linear-gradient(100deg, #1F3A8A 0%, #2EC5CE 100%);
  --grad-soft: linear-gradient(100deg, rgba(31, 58, 138, .12), rgba(46, 197, 206, .18));
  --line: rgba(31, 58, 138, .16);
  --line-soft: rgba(31, 58, 138, .09);
  --line-strong: rgba(31, 58, 138, .38);

  --wrap: 1280px;
  --gutter: clamp(18px, 4vw, 44px);
  --cut: 12px;

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

  --ease: cubic-bezier(.22, .61, .36, 1);
}

/* ---------- 3. base ---------- */
body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.85;
  letter-spacing: .012em;
  color: var(--ink);
  background-color: var(--paper);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 蓝图坐标网格 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(31, 58, 138, .055) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(31, 58, 138, .045) 1px, transparent 1px);
  background-size: 88px 88px, 88px 88px;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .85), rgba(0, 0, 0, .18));
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .85), rgba(0, 0, 0, .18));
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -.012em;
  color: var(--ink);
}
h1 { font-size: clamp(2.15rem, 4.8vw, 4.25rem); line-height: 1.04; }
h2 { font-size: clamp(1.55rem, 2.6vw, 2.35rem); }
h3 { font-size: clamp(1.12rem, 1.6vw, 1.5rem); }
h4 { font-size: 1.0625rem; }

strong, b { font-weight: 700; }

/* ---------- 4. 布局工具 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.stack { display: flex; flex-direction: column; gap: clamp(12px, 1.6vw, 20px); }

.grid { display: grid; gap: clamp(18px, 2.6vw, 32px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--main { grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); align-items: start; }

.site-main {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: block;
}

.page-shell { padding-block: clamp(30px, 5vw, 72px); }

/* ---------- 5. 文字组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--steel);
}
.eyebrow::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--grad);
  flex: none;
}

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

.lede {
  font-size: clamp(16px, 1.3vw, 18.5px);
  line-height: 1.9;
  color: #2A3A5C;
  max-width: 34em;
}

.prose { max-width: 38em; }
.prose p + p { margin-top: 1em; }
.prose h2, .prose h3 { margin-top: 1.8em; margin-bottom: .6em; }
.prose ul, .prose ol { margin-top: .8em; display: flex; flex-direction: column; gap: .55em; }
.prose li { padding-left: 1.5em; position: relative; }
.prose li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .78em;
  width: 8px;
  height: 2px;
  background: var(--cyan);
}

.rule {
  height: 1px;
  border: 0;
  background: var(--line);
  margin-block: clamp(24px, 3vw, 40px);
  position: relative;
}
.rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 72px;
  height: 3px;
  background: var(--grad);
}

/* ---------- 6. 头部 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(247, 250, 252, .95);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

.skip-link {
  position: absolute;
  top: -120px;
  left: 16px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--ink);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 0 0 6px 6px;
  transition: top .2s var(--ease);
}
.skip-link:focus,
.skip-link:focus-visible { top: 0; color: #FFFFFF; }

.header-tape {
  background: linear-gradient(90deg, rgba(31, 58, 138, .10), rgba(46, 197, 206, .18));
  border-bottom: 1px solid var(--line-soft);
}
.header-tape__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-block: 5px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--indigo);
  white-space: nowrap;
  overflow: hidden;
}
.header-tape__dots { color: var(--coral-ink); letter-spacing: .2em; }

.masthead__inner {
  display: flex;
  align-items: center;
  gap: clamp(14px, 3vw, 28px);
  padding-block: 13px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.brand__mark {
  position: relative;
  flex: none;
  width: 44px;
  height: 44px;
  background: var(--grad);
  clip-path: polygon(0 0, 100% 0, 100% 68%, 68% 100%, 0 100%);
}
.brand__mark::before,
.brand__mark::after {
  content: "";
  position: absolute;
  background: rgba(247, 250, 252, .94);
}
.brand__mark::before { top: 8px; bottom: 8px; left: 50%; width: 2px; transform: translateX(-1px); }
.brand__mark::after { left: 8px; right: 8px; top: 50%; height: 2px; transform: translateY(-1px); }

.brand__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.brand__name {
  font-family: var(--font-head);
  font-weight: 800;
  font-size: clamp(19px, 2.1vw, 25px);
  line-height: 1.1;
  letter-spacing: .07em;
  color: var(--indigo);
}
.brand__line {
  font-size: 12px;
  line-height: 1.4;
  letter-spacing: .04em;
  color: var(--steel);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.masthead__actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: auto;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  align-items: center;
  gap: 10px;
  padding: 9px 14px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, .7);
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--indigo);
  transition: background-color .18s var(--ease), border-color .18s var(--ease);
}
.nav-toggle:hover { background: var(--sky); border-color: var(--indigo); }
.nav-toggle__bars { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.nav-toggle__bars span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--indigo);
  transition: transform .22s var(--ease), opacity .16s var(--ease);
}
.nav-toggle__label { line-height: 1; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.site-nav {
  border-top: 1px solid var(--line-soft);
  background: linear-gradient(180deg, rgba(221, 246, 247, .55), rgba(247, 250, 252, 0));
}
.site-nav__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2px clamp(6px, 2.4vw, 30px);
}
.site-nav__link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  padding: 12px 2px 11px;
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--indigo);
  border-bottom: 2px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.site-nav__index {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  color: var(--steel);
  transition: color .18s var(--ease);
}
.site-nav__link:hover { color: var(--coral-ink); border-bottom-color: var(--coral); }
.site-nav__link:hover .site-nav__index { color: var(--coral-ink); }
.site-nav__link[aria-current="page"] { color: var(--ink); border-bottom-color: var(--indigo); }
.site-nav__link[aria-current="page"] .site-nav__index { color: var(--indigo); }
.site-nav__actions { display: none; }

.header-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background: rgba(31, 58, 138, .07);
  pointer-events: none;
  z-index: 2;
}
.header-progress__bar {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: 0 50%;
  transition: transform .16s linear;
}

/* ---------- 7. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  font-family: var(--font-head);
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: .04em;
  border: 1px solid transparent;
  border-radius: 2px;
  transition: transform .18s var(--ease), background-color .18s var(--ease),
              color .18s var(--ease), border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:active { transform: translateY(1px); }
.btn--action {
  padding: 12px 22px;
  background: var(--coral);
  color: var(--ink);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
}
.btn--action:hover { background: #FF8163; box-shadow: 0 8px 20px rgba(255, 107, 74, .32); }
.btn--ghost {
  background: transparent;
  color: var(--indigo);
  border-color: var(--line-strong);
}
.btn--ghost:hover { background: rgba(221, 246, 247, .85); border-color: var(--indigo); color: var(--ink); }
.btn--block { width: 100%; }

/* ---------- 8. 页脚 ---------- */
.site-footer {
  position: relative;
  z-index: 2;
  margin-top: auto;
  background: var(--ink);
  color: #DDE7F6;
  font-size: 15px;
}
.footer-tape { height: 5px; background: var(--grad); }

.footer__inner {
  display: grid;
  grid-template-columns: 1.5fr 1.25fr 1fr;
  gap: clamp(24px, 4vw, 56px);
  padding-block: clamp(36px, 5vw, 66px);
}

.footer__brand { min-width: 0; }
.brand--footer { margin-bottom: 16px; }
.brand--footer .brand__mark { width: 40px; height: 40px; }
.site-footer .brand__name { color: #F7FAFC; font-size: 21px; }

.footer__summary { font-size: 14.5px; line-height: 1.78; color: #B9C7DF; max-width: 34em; }
.footer__trust {
  margin-top: 14px;
  padding-left: 14px;
  border-left: 2px solid var(--cyan);
  font-size: 13px;
  line-height: 1.72;
  color: #9DB0CE;
}

.footer__nav { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 3vw, 32px); }
.footer__col { min-width: 0; }
.footer__col-title {
  margin-bottom: 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--cyan);
}
.footer__list { display: flex; flex-direction: column; gap: 10px; }
.footer__link {
  font-size: 14.5px;
  color: #C7D4E8;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.footer__link:hover { color: #FFFFFF; border-bottom-color: var(--coral); }

.footer__contact {
  min-width: 0;
  padding: 20px 22px 22px;
  border: 1px solid rgba(46, 197, 206, .34);
  background: linear-gradient(160deg, rgba(46, 197, 206, .14), rgba(31, 58, 138, .26));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%);
}
.footer__contact-title {
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--cyan);
}
.footer__contact-line {
  display: flex;
  gap: 10px;
  font-size: 13.5px;
  line-height: 1.72;
  color: #DCE6F5;
  word-break: break-all;
}
.footer__contact-line + .footer__contact-line { margin-top: 8px; }
.footer__label {
  flex: none;
  min-width: 3.4em;
  padding-top: 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
  color: #8EA3C4;
}
.footer__note {
  margin-top: 16px;
  padding: 12px 14px;
  background: var(--sand);
  color: #3A2E14;
  font-size: 12.5px;
  line-height: 1.7;
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%);
}

.footer__meta { border-top: 1px solid rgba(221, 238, 246, .16); background: rgba(0, 0, 0, .18); }
.footer__meta-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 16px;
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .04em;
  color: #8EA3C4;
}
.footer__region { color: #8EA3C4; }
.footer__copy { color: #9DB0CE; }

/* ---------- 9. 通用页面组件 ---------- */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: clamp(20px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .06em;
  color: var(--steel);
}
.breadcrumbs__link { color: var(--steel); border-bottom: 1px solid transparent; }
.breadcrumbs__link:hover { color: var(--coral-ink); border-bottom-color: var(--coral); }
.breadcrumbs__sep { color: rgba(91, 113, 152, .6); }
.breadcrumbs__current { color: var(--indigo); }

.page-head {
  position: relative;
  padding-block: clamp(12px, 2vw, 24px) clamp(26px, 4vw, 50px);
  border-bottom: 1px solid var(--line);
}
.page-head__title { margin-bottom: 18px; max-width: 22em; }
.page-head__lead { font-size: clamp(16px, 1.4vw, 19px); line-height: 1.85; color: #2A3A5C; max-width: 33em; }

.section { padding-block: clamp(32px, 5vw, 72px); border-top: 1px solid var(--line-soft); }
.section:first-of-type { border-top: 0; }
.section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  margin-bottom: clamp(20px, 3vw, 32px);
}
.section__index {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .16em;
  color: var(--indigo);
  position: relative;
  padding-left: 18px;
}
.section__index::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 10px;
  height: 3px;
  background: var(--grad);
}
.section__title { font-size: clamp(1.5rem, 2.4vw, 2.15rem); }
.section__note { font-size: 14px; color: var(--steel); max-width: 34em; }

.panel {
  position: relative;
  padding: clamp(20px, 2.6vw, 32px);
  background: #FFFFFF;
  border: 1px solid var(--line);
  border-radius: 2px;
}
.panel--sand { background: var(--sand); border-color: rgba(176, 146, 84, .38); }
.panel--sky { background: var(--sky); border-color: rgba(46, 197, 206, .42); }
.panel--cut {
  border: 0;
  background: linear-gradient(150deg, rgba(31, 58, 138, .07), rgba(46, 197, 206, .16));
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .08em;
  background: var(--sky);
  color: var(--indigo);
  border-radius: 1px;
}
.tag--coral { background: rgba(255, 107, 74, .16); color: var(--coral-ink); }
.tag--ok { background: rgba(15, 124, 117, .14); color: var(--ok); }

.chapter-index {
  position: sticky;
  top: clamp(96px, 13vh, 128px);
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--line);
}
.chapter-index__link {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 7px 0;
  font-size: 14px;
  color: var(--steel);
  transition: color .18s var(--ease);
}
.chapter-index__link:hover { color: var(--indigo); }
.chapter-index__link[data-active="true"] { color: var(--ink); font-weight: 700; }
.chapter-index__link[data-active="true"]::before {
  content: "";
  position: absolute;
  left: -17px;
  top: 50%;
  width: 9px;
  height: 9px;
  transform: translateY(-50%);
  background: var(--coral);
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}

.media-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--sky);
  border: 1px solid var(--line);
}
.media-frame img { width: 100%; height: 100%; object-fit: cover; }
.media-frame__caption {
  position: absolute;
  left: 12px;
  bottom: 12px;
  padding: 5px 10px;
  background: rgba(16, 28, 61, .86);
  color: #EAF2FF;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
}
.media-frame--wide { aspect-ratio: 21 / 9; }
.media-frame--tall { aspect-ratio: 4 / 5; }
.media-frame--plain { background: linear-gradient(150deg, rgba(31, 58, 138, .14), rgba(46, 197, 206, .24)); }

/* ---------- 10. 焦点与动效偏好 ---------- */
:focus-visible {
  outline: 2px solid var(--coral);
  outline-offset: 3px;
  border-radius: 1px;
}
.site-footer :focus-visible { outline-color: var(--cyan); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .header-progress__bar { transition: none; }
}

/* ---------- 11. 响应式 ---------- */
@media (max-width: 1080px) {
  .footer__inner { grid-template-columns: 1fr 1fr; }
  .footer__contact { grid-column: 1 / -1; }
}

@media (max-width: 960px) {
  .grid--3, .grid--main { grid-template-columns: minmax(0, 1fr); }
  .chapter-index { position: static; top: auto; flex-direction: row; flex-wrap: wrap; gap: 4px 18px; padding: 14px 0 0; border-left: 0; border-top: 1px solid var(--line); }
  .chapter-index__link[data-active="true"]::before { left: 0; top: auto; bottom: -2px; width: 100%; height: 2px; transform: none; clip-path: none; }
  .chapter-index__link[data-active="true"] { padding-bottom: 4px; }
}

@media (max-width: 900px) {
  body { font-size: 16.5px; }
  .masthead__actions { display: none; }
  .nav-toggle { display: inline-flex; }
  .brand__line { display: none; }

  .site-nav { display: none; border-top: 1px solid var(--line); }
  .site-nav[data-open="true"] { display: block; }
  .site-nav__list { flex-direction: column; justify-content: flex-start; gap: 0; padding-block: 6px; }
  .site-nav__link {
    width: 100%;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 0;
    font-size: 16px;
    border-bottom: 1px solid var(--line-soft);
  }
  .site-nav__link[aria-current="page"] { border-bottom-color: var(--indigo); }
  .site-nav__actions { display: flex; flex-direction: column; gap: 10px; padding: 16px 0 22px; }
}

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

@media (max-width: 480px) {
  .brand__mark { width: 38px; height: 38px; }
  .brand { gap: 11px; }
  .header-tape__inner { font-size: 10px; letter-spacing: .1em; }
  .footer__nav { grid-template-columns: 1fr; }
  .footer__contact { padding: 18px 16px 20px; }
  .page-head__title { max-width: none; }
}
