/* ==========================================================================
   大阳城指南 · /assets/site.css
   共享层：重置 / 变量 / 中文排版 / 页头 / 页脚 / 基础组件
   设计依据：目录型内容地图 · 印刷纸张叠层 · 高原日光橙 × 滇池深青
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  --ink: #171512;
  --paper: #F7F4EC;
  --sun: #E4572E;
  --lake: #0E3B3E;
  --lake-mid: #1F6F6B;
  --copper: #B8894B;
  --sand: #E9DFC9;
  --clay: #A63A22;
  --slate: #6B6A62;
  --white: #FFFFFF;

  --shell-w: 1280px;
  --gutter: clamp(18px, 4.2vw, 56px);
  --header-h: 68px;

  --font-display: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Mono", Consolas, monospace;

  --radius: 2px;
  --rule: 1.5px;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --plate-shadow: 0 1px 0 rgba(23, 21, 18, .07), 0 16px 30px -22px rgba(23, 21, 18, .55);
}

/* ---------- 2. 重置与基础 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

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

ul, ol { padding: 0; list-style: none; }

body {
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 0%, rgba(184, 137, 75, .08), transparent 42%),
    radial-gradient(circle at 92% 6%, rgba(228, 87, 46, .06), transparent 38%);
  background-repeat: no-repeat;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: .01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

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

a { color: inherit; }

button { font: inherit; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.28;
  letter-spacing: .02em;
  text-wrap: balance;
}

p, li, dd, figcaption, blockquote { text-wrap: pretty; }

::selection {
  background: var(--sun);
  color: var(--ink);
}

:where(a, button, summary, [tabindex]):focus-visible {
  outline: 3px solid var(--sun);
  outline-offset: 3px;
  border-radius: var(--radius);
}

#main-content { display: block; scroll-margin-top: calc(var(--header-h) + 18px); }

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

.section { padding-block: clamp(38px, 5.4vw, 76px); }

.section--tint {
  background: var(--sand);
  border-block: var(--rule) solid rgba(23, 21, 18, .12);
}

.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)); }

/* ---------- 4. 文字组件 ---------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--lake-mid);
}
.eyebrow::before {
  content: "";
  flex: 0 0 auto;
  width: 24px;
  height: 2px;
  background: var(--sun);
}

.section-title {
  font-size: clamp(24px, 3.2vw, 36px);
  color: var(--ink);
}

.prose {
  max-width: 64ch;
  font-size: 16px;
  line-height: 1.8;
  color: var(--ink);
}
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: clamp(21px, 2.4vw, 27px); margin-top: 1.7em; }
.prose h3 { font-size: clamp(18px, 2vw, 21px); margin-top: 1.5em; }
.prose ul { padding-left: 1.2em; list-style: square; }
.prose li + li { margin-top: .4em; }
.prose a {
  color: var(--lake-mid);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
}
.prose a:hover { color: var(--clay); }
.prose strong { font-weight: 700; color: var(--ink); }
.prose code {
  font-family: var(--font-mono);
  font-size: .88em;
  padding: .1em .4em;
  background: var(--sand);
  border-radius: var(--radius);
}

/* ---------- 5. 按钮 / 标签 / 卡片 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 12px 22px;
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .07em;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s var(--ease), color .18s var(--ease),
              border-color .18s var(--ease), transform .18s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--ink);
}
.btn--primary:hover { background: var(--clay); border-color: var(--clay); color: var(--paper); }

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

.btn--dark {
  background: var(--lake);
  border-color: var(--lake);
  color: var(--paper);
}
.btn--dark:hover { background: var(--lake-mid); border-color: var(--lake-mid); }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: 1px solid var(--copper);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: .1em;
  line-height: 1.7;
  white-space: nowrap;
}
.tag--sun { background: var(--sun); border-color: var(--sun); color: var(--ink); }
.tag--lake { background: var(--lake); border-color: var(--lake); color: var(--paper); }

.panel {
  position: relative;
  background: var(--white);
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  padding: clamp(18px, 2.4vw, 28px);
  box-shadow: var(--plate-shadow);
}

/* ---------- 6. 图片容器基础规则 ---------- */
.media-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--sand);
  border: var(--rule) solid var(--ink);
  border-radius: var(--radius);
  isolation: isolate;
}
.media-frame > img,
.media-frame > svg,
.media-frame > picture,
.media-frame > picture > img,
.media-frame > video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media-frame::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 26px;
  height: 26px;
  background: var(--sun);
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  pointer-events: none;
}
.media-frame--wide { aspect-ratio: 16 / 9; }
.media-frame--square { aspect-ratio: 1 / 1; }
.media-frame--tall { aspect-ratio: 3 / 4; }

.media-caption {
  margin-top: 10px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .07em;
  color: var(--slate);
}

/* ---------- 7. 面包屑 ---------- */
.breadcrumbs { padding-block: 18px 0; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--slate);
}
.breadcrumbs li { display: flex; align-items: center; }
.breadcrumbs li + li::before {
  content: "/";
  margin-inline: 10px;
  color: var(--copper);
}
.breadcrumbs a {
  color: var(--slate);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--ease), border-color .18s var(--ease);
}
.breadcrumbs a:hover { color: var(--ink); border-bottom-color: var(--copper); }
.breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 500; }

/* ---------- 8. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--lake);
  background-image:
    repeating-linear-gradient(-45deg, rgba(184, 137, 75, .10) 0 1px, transparent 1px 11px);
  color: var(--paper);
  box-shadow: 0 1px 0 rgba(247, 244, 236, .16), 0 16px 30px -24px rgba(23, 21, 18, .85);
  isolation: isolate;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -72px;
  z-index: 120;
  padding: 10px 18px;
  background: var(--sun);
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  text-decoration: none;
  border-radius: var(--radius);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 12px; }

.header-bar {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
  min-height: var(--header-h);
}

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  flex: 0 0 auto;
  padding-block: 6px;
  text-decoration: none;
  color: inherit;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  background: var(--sun);
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  border-radius: var(--radius);
  clip-path: polygon(0 0, 100% 0, 100% 74%, 74% 100%, 0 100%);
  transition: transform .28s var(--ease);
}
.brand:hover .brand-mark { transform: translateY(-2px) rotate(-4deg); }
.brand-text { display: flex; flex-direction: column; line-height: 1.16; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: .14em;
  color: var(--paper);
}
.brand-tag {
  margin-top: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .14em;
  color: rgba(247, 244, 236, .58);
}

/* 导航 */
.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  min-width: 0;
}
.nav-list {
  display: flex;
  align-items: center;
  gap: 2px;
}
.nav-link {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--radius);
  color: rgba(247, 244, 236, .78);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .05em;
  line-height: 1.5;
  text-decoration: none;
  white-space: nowrap;
  transition: color .18s var(--ease), background-color .18s var(--ease);
}
.nav-index {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--copper);
  transition: color .18s var(--ease);
}
.nav-label { display: inline-block; }
.nav-link:hover,
.nav-link:focus-visible {
  color: var(--paper);
  background: rgba(247, 244, 236, .09);
}
.nav-link:hover .nav-index { color: var(--sun); }

.nav-link[aria-current="page"] {
  background: var(--sun);
  color: var(--ink);
  font-weight: 700;
}
.nav-link[aria-current="page"] .nav-index { color: rgba(23, 21, 18, .62); }
.nav-link[aria-current="page"]:hover { background: var(--sun); color: var(--ink); }
.nav-link[aria-current="page"]:hover .nav-index { color: rgba(23, 21, 18, .62); }

/* 版本状态 */
.nav-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding-left: 13px;
  border-left: 1px solid rgba(247, 244, 236, .2);
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .05em;
  color: rgba(247, 244, 236, .58);
  white-space: nowrap;
}
.nav-status-dot {
  width: 6px;
  height: 6px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--sun);
  box-shadow: 0 0 0 3px rgba(228, 87, 46, .22);
  animation: status-pulse 2.6s ease-in-out infinite;
}
@keyframes status-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .3; }
}

/* 汉堡按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 9px;
  margin-left: auto;
  padding: 9px 13px;
  background: transparent;
  border: 1.5px solid rgba(247, 244, 236, .38);
  border-radius: var(--radius);
  color: var(--paper);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .14em;
  cursor: pointer;
  transition: border-color .18s var(--ease), background-color .18s var(--ease);
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--sun);
  background: rgba(228, 87, 46, .16);
}
.nav-toggle-bars {
  display: inline-flex;
  flex-direction: column;
  gap: 4px;
  width: 16px;
}
.nav-toggle-bars span {
  display: block;
  height: 2px;
  background: currentColor;
  transition: transform .22s var(--ease);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }
.nav-toggle-label { display: inline-block; }

/* 滚动进度刻线 */
.site-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  pointer-events: none;
}
.site-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--sun);
  transition: width .12s linear;
}

/* ---------- 9. 页脚 ---------- */
.site-footer {
  position: relative;
  margin-top: clamp(60px, 8vw, 110px);
  background: var(--lake);
  color: rgba(247, 244, 236, .82);
  border-top: 3px solid var(--sun);
  overflow: hidden;
}
.site-footer::before {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: clamp(140px, 24vw, 380px);
  height: 190px;
  background-image: repeating-linear-gradient(-45deg, rgba(184, 137, 75, .18) 0 1px, transparent 1px 9px);
  pointer-events: none;
}

.footer-shell {
  position: relative;
  z-index: 1;
  padding-block: clamp(46px, 6.4vw, 82px) 0;
}

.footer-kicker {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--copper);
}
.footer-kicker::before {
  content: "";
  flex: 0 0 auto;
  width: 32px;
  height: 2px;
  background: var(--copper);
}

.footer-line {
  max-width: 22em;
  font-family: var(--font-display);
  font-size: clamp(22px, 3.4vw, 40px);
  font-weight: 900;
  line-height: 1.36;
  letter-spacing: .03em;
  color: var(--paper);
}

.footer-rule {
  position: relative;
  height: 1px;
  margin-block: clamp(28px, 4vw, 46px);
  background: rgba(247, 244, 236, .18);
}
.footer-rule::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: 96px;
  height: 3px;
  background: var(--sun);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1.6fr;
  gap: clamp(24px, 3.4vw, 52px);
  align-items: start;
}

.footer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .2em;
  color: var(--copper);
}
.footer-title::after {
  content: "";
  flex: 1 1 auto;
  height: 1px;
  background: rgba(247, 244, 236, .16);
}

.footer-list { display: flex; flex-direction: column; }
.footer-list a {
  display: inline-flex;
  align-items: center;
  padding-block: 7px;
  color: rgba(247, 244, 236, .76);
  font-size: 15px;
  letter-spacing: .04em;
  text-decoration: none;
  transition: color .18s var(--ease);
}
.footer-list a::before {
  content: "";
  flex: 0 0 auto;
  width: 0;
  height: 1px;
  margin-right: 0;
  background: var(--sun);
  transition: width .2s var(--ease), margin-right .2s var(--ease);
}
.footer-list a:hover,
.footer-list a:focus-visible { color: var(--paper); }
.footer-list a:hover::before,
.footer-list a:focus-visible::before { width: 14px; margin-right: 10px; }

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-style: normal;
}
.footer-contact-item { display: flex; flex-direction: column; gap: 3px; }
.footer-contact-key {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: .18em;
  color: rgba(247, 244, 236, .48);
}
.footer-contact-value {
  font-size: 15px;
  line-height: 1.6;
  color: var(--paper);
  word-break: break-word;
}
.footer-contact-note {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed rgba(247, 244, 236, .22);
  max-width: 36em;
  font-size: 13px;
  line-height: 1.75;
  color: rgba(247, 244, 236, .58);
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 28px;
  margin-top: clamp(32px, 4.4vw, 58px);
  padding-block: 22px 30px;
  border-top: 1px solid rgba(247, 244, 236, .16);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 500;
  letter-spacing: .07em;
  color: rgba(247, 244, 236, .52);
}
.footer-copy { color: rgba(247, 244, 236, .7); }
.footer-icp { color: var(--copper); }

/* ---------- 10. 滚动显现与返回顶部 ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .5s var(--ease), transform .5s var(--ease);
}
.js [data-reveal="in"] {
  opacity: 1;
  transform: none;
}

.to-top {
  position: fixed;
  right: clamp(14px, 3vw, 30px);
  bottom: clamp(14px, 3vw, 30px);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 15px;
  background: var(--ink);
  border: 1.5px solid var(--ink);
  border-radius: var(--radius);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity .22s var(--ease), transform .22s var(--ease),
              background-color .18s var(--ease), color .18s var(--ease);
}
.to-top[data-visible="true"] {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}
.to-top:hover {
  background: var(--sun);
  border-color: var(--sun);
  color: var(--ink);
}

/* ---------- 11. 响应式 ---------- */
@media (max-width: 1140px) {
  :root { --header-h: 60px; }

  .nav-toggle { display: inline-flex; }

  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 90;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin-left: 0;
    padding: 12px var(--gutter) 24px;
    background: var(--lake);
    background-image: repeating-linear-gradient(-45deg, rgba(184, 137, 75, .1) 0 1px, transparent 1px 11px);
    border-top: 1px solid rgba(247, 244, 236, .18);
    box-shadow: 0 26px 42px -22px rgba(23, 21, 18, .8);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .site-nav[data-open] {
    display: flex;
    animation: nav-drop .22s var(--ease);
  }
  @keyframes nav-drop {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: none; }
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    width: 100%;
  }
  .nav-list li + li { border-top: 1px solid rgba(247, 244, 236, .1); }

  .nav-link {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 15px 6px;
    border-radius: 0;
    font-size: 16px;
    letter-spacing: .06em;
  }
  .nav-index { min-width: 22px; font-size: 11px; }

  .nav-link[aria-current="page"] {
    background: transparent;
    color: var(--sun);
    box-shadow: inset 3px 0 0 var(--sun);
    padding-left: 14px;
  }
  .nav-link[aria-current="page"] .nav-index { color: var(--sun); }
  .nav-link[aria-current="page"]:hover { background: rgba(228, 87, 46, .1); color: var(--sun); }

  .nav-status {
    margin-left: 0;
    margin-top: 18px;
    padding-left: 0;
    padding-top: 16px;
    border-left: 0;
    border-top: 1px solid rgba(247, 244, 236, .18);
    font-size: 11px;
    line-height: 1.7;
    white-space: normal;
  }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-col--contact { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
  .grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  :root { --header-h: 56px; }

  .brand-mark { width: 34px; height: 34px; font-size: 18px; }
  .brand-name { font-size: 17px; letter-spacing: .1em; }
  .brand-tag { font-size: 9px; letter-spacing: .1em; }
  .nav-toggle { padding: 8px 11px; font-size: 12px; }

  .grid--2,
  .grid--3 { grid-template-columns: 1fr; }

  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-col--contact { grid-column: auto; }
  .footer-base { flex-direction: column; align-items: flex-start; gap: 6px; }
}

@media (max-width: 400px) {
  .brand-tag { display: none; }
}

/* ---------- 12. 动效偏好 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    transition-delay: 0ms !important;
  }

  .js [data-reveal] { opacity: 1; transform: none; }
  .site-progress-bar { transition: none; }
  .to-top { transition: none; }
}
