/* ==========================================================================
   微乐指南 · 本地坐标服务中枢
   assets/site.css — reset / tokens / 框架头尾 / 通用组件
   ========================================================================== */

/* ---------- 1. Reset ---------- */
*,
*::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, li, figure, blockquote, dl, dd { margin: 0; }

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

a { color: inherit; text-decoration: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

img, svg, video { display: block; max-width: 100%; }
table { border-collapse: collapse; }

/* ---------- 2. Tokens ---------- */
:root {
  --sand: #F4E9D8;
  --cream: #FFF9EF;
  --ink: #1B2A41;
  --brown: #2A211B;
  --orange: #FF6B35;
  --orange-deep: #D94E1F;
  --celadon: #3E8E7E;
  --celadon-light: #E6F1ED;
  --celadon-soft: #8FD3C2;
  --fog: #B9B1A5;
  --night: #0E1724;

  --rule: 1.5px;
  --rule-heavy: 3px;

  --frame-side: 96px;
  --entry-side: 248px;

  --font-display: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-body: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", "JetBrains Mono", Menlo, Consolas, "Courier New", monospace;

  --gutter: clamp(16px, 4vw, 64px);
  --step: clamp(24px, 5vw, 72px);

  --scroll-progress: 0%;
}

/* ---------- 3. Base / 中文排版 ---------- */
body {
  font-family: var(--font-body);
  font-size: clamp(16px, 1.02vw, 17px);
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--sand);
  background-image:
    linear-gradient(to right, rgba(27, 42, 65, .045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 42, 65, .045) 1px, transparent 1px);
  background-size: 88px 88px;
  background-position: -1px -1px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.14;
  letter-spacing: -.02em;
  color: var(--brown);
  text-wrap: balance;
}

p { text-wrap: pretty; }

strong { font-weight: 700; color: var(--brown); }

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

/* ---------- 4. Skip link ---------- */
.skip-link {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  transform: translateY(-140%);
  padding: 12px 22px;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .1em;
  border: var(--rule) solid var(--ink);
  transition: transform .18s ease;
}
.skip-link:focus { transform: translateY(0); }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--sand);
  border-bottom: var(--rule-heavy) solid var(--ink);
}

/* 5.1 坐标状态条 */
.coord-bar {
  position: relative;
  background: var(--ink);
  color: var(--sand);
  overflow: hidden;
}
.coord-bar::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: var(--scroll-progress, 0%);
  background: linear-gradient(90deg, var(--orange), var(--celadon-soft));
  transition: width .12s linear;
}
.coord-bar__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 26px;
  padding: 9px clamp(14px, 3vw, 32px);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .12em;
}
.coord-bar__item {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  white-space: nowrap;
}
.coord-bar__key {
  font-size: 10px;
  letter-spacing: .2em;
  color: var(--fog);
}
.coord-bar__val { color: var(--cream); }
.coord-bar__val--mono { font-variant-numeric: tabular-nums; }

.coord-bar__status {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--celadon-soft);
  font-size: 11px;
  letter-spacing: .14em;
  white-space: nowrap;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--celadon-soft);
  box-shadow: 0 0 0 0 rgba(143, 211, 194, .6);
  animation: coord-pulse 2.6s ease-out infinite;
}
@keyframes coord-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(143, 211, 194, .55); }
  70%  { box-shadow: 0 0 0 9px rgba(143, 211, 194, 0); }
  100% { box-shadow: 0 0 0 0 rgba(143, 211, 194, 0); }
}

/* 5.2 框架梁 */
.frame {
  display: grid;
  grid-template-columns: var(--frame-side) minmax(0, 1fr) var(--entry-side);
  grid-template-areas: "brand nav entries";
  align-items: stretch;
  background: var(--sand);
}

/* 5.3 竖排品牌列 */
.frame-brand {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 18px 8px;
  background: var(--ink);
  color: var(--sand);
  border-right: var(--rule) solid var(--ink);
  transition: background-color .2s ease;
}
.frame-brand:hover { background: var(--night); }
.frame-brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  background: var(--orange);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  border-radius: 2px;
}
.frame-brand__text {
  writing-mode: vertical-rl;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .34em;
  color: var(--cream);
}

/* 5.4 导航梁 */
.frame-nav {
  grid-area: nav;
  display: flex;
  align-items: center;
  padding: 0 clamp(10px, 1.6vw, 24px);
}
.frame-nav__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
  width: 100%;
}
.frame-nav__link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 11px 15px;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .01em;
  color: var(--ink);
  border: var(--rule) solid transparent;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.frame-nav__link:hover {
  background: var(--cream);
  border-color: var(--ink);
  color: var(--brown);
}
.frame-nav__link[aria-current="page"] {
  background: var(--ink);
  color: var(--sand);
  border-color: var(--ink);
}
.frame-nav__link[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 15px;
  right: 15px;
  bottom: 6px;
  height: 2px;
  background: var(--orange);
}

/* 5.5 双入口列 */
.frame-entries {
  grid-area: entries;
  display: grid;
  grid-auto-rows: 1fr;
  border-left: var(--rule) solid var(--ink);
}
.entry {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  padding: 12px 40px 12px 22px;
  border-bottom: var(--rule) solid var(--ink);
  transition: background-color .2s ease, color .2s ease;
}
.entry:last-child { border-bottom: 0; }
.entry::after {
  content: "→";
  position: absolute;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 15px;
  opacity: 0;
  transition: opacity .2s ease, transform .2s ease;
}
.entry:hover::after,
.entry:focus-visible::after {
  opacity: 1;
  transform: translateY(-50%) translateX(3px);
}
.entry__key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  opacity: .72;
}
.entry__label {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .02em;
}
.entry--pc {
  background: var(--orange);
  color: var(--ink);
}
.entry--pc:hover { background: var(--orange-deep); }
.entry--crowd {
  background: var(--celadon-light);
  color: var(--ink);
  box-shadow: inset 5px 0 0 var(--celadon);
}
.entry--crowd:hover {
  background: var(--celadon);
  color: var(--cream);
}
.entry--crowd:hover .entry__key { opacity: .85; }

/* 5.6 移动导航按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 18px;
  background: var(--ink);
  color: var(--sand);
  border-left: var(--rule) solid var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .18em;
  transition: background-color .18s ease;
}
.nav-toggle:hover { background: var(--night); }
.nav-toggle__bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
  width: 18px;
}
.nav-toggle__bar {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--orange);
  transition: transform .2s ease, opacity .2s ease;
}
.site-header[data-open] .nav-toggle__bar:nth-child(1) { transform: translateY(5px) rotate(45deg); }
.site-header[data-open] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open] .nav-toggle__bar:nth-child(3) { transform: translateY(-5px) rotate(-45deg); }
.nav-toggle__label { font-weight: 500; }

/* ---------- 6. Footer ---------- */
.site-footer {
  margin-top: var(--step);
  background: var(--night);
  color: var(--sand);
  border-top: 6px solid var(--orange);
}

.footer-grid {
  width: min(1240px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.1fr .95fr 1.15fr;
  gap: clamp(24px, 4vw, 56px);
  padding: clamp(38px, 6vw, 76px) 0 clamp(28px, 4vw, 48px);
}

.footer-title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--fog);
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(244, 233, 216, .22);
}

.footer-brand__mark {
  font-family: var(--font-display);
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.1;
  color: var(--cream);
}
.footer-brand__line {
  margin-top: 14px;
  max-width: 34ch;
  font-size: 14.5px;
  line-height: 1.8;
  color: rgba(244, 233, 216, .78);
}
.footer-brand__coord { margin-top: 18px; color: var(--celadon-soft); }
.coord-mono {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
}

.footer-nav__list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px 18px;
  font-size: 14.5px;
}
.footer-nav__list a {
  display: inline-block;
  color: var(--sand);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.footer-nav__list a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

.footer-contact__line {
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(244, 233, 216, .9);
  margin-bottom: 8px;
  word-break: break-word;
}
.footer-contact__line--mono {
  font-family: var(--font-mono);
  font-size: 14px;
  letter-spacing: .06em;
  color: var(--cream);
}
.footer-contact__note {
  margin: 14px 0 20px;
  font-size: 12.5px;
  line-height: 1.8;
  color: rgba(244, 233, 216, .6);
}

.footer-bottom {
  border-top: 1px solid rgba(244, 233, 216, .18);
}
.footer-bottom__inner {
  width: min(1240px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 26px;
  padding: 18px 0 26px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .06em;
  color: var(--fog);
}
.footer-bottom__legal { color: rgba(244, 233, 216, .8); }
.footer-bottom__version { color: var(--celadon-soft); }
.footer-bottom__copy { margin-left: auto; }
.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.footer-bottom__links a {
  color: var(--sand);
  border-bottom: 1px solid transparent;
  transition: color .18s ease, border-color .18s ease;
}
.footer-bottom__links a:hover {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* 返回顶部 */
.back-top {
  position: fixed;
  right: clamp(14px, 3vw, 34px);
  bottom: clamp(14px, 3vw, 34px);
  z-index: 90;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 15px;
  background: var(--ink);
  color: var(--sand);
  border: var(--rule) solid var(--sand);
  box-shadow: 4px 4px 0 var(--orange);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: .14em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity .22s ease, visibility .22s ease, transform .22s ease, background-color .18s ease;
}
.back-top.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-top:hover { background: var(--orange); color: var(--ink); }
.back-top__arrow { font-size: 14px; line-height: 1; }

/* ---------- 7. 通用布局 ---------- */
.container {
  width: min(1240px, calc(100% - var(--gutter) * 2));
  margin-inline: auto;
}

.grid {
  display: grid;
  gap: clamp(16px, 2.4vw, 32px);
}
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* 面包屑 */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 16px 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--brown);
}
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs li + li::before {
  content: "/";
  color: var(--fog);
}
.breadcrumbs a {
  color: var(--orange-deep);
  border-bottom: 1px solid transparent;
  transition: border-color .16s ease;
}
.breadcrumbs a:hover { border-bottom-color: var(--orange-deep); }

/* 长文 */
.prose {
  max-width: 68ch;
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--brown);
}
.prose > * + * { margin-top: 1.05em; }
.prose h2 {
  font-size: clamp(24px, 2.6vw, 34px);
  margin-top: 1.9em;
}
.prose h3 {
  font-size: clamp(20px, 2vw, 26px);
  margin-top: 1.6em;
}
.prose ul, .prose ol {
  padding-left: 1.35em;
  list-style: disc;
}
.prose ol { list-style: decimal; }
.prose li + li { margin-top: .35em; }
.prose a {
  color: var(--orange-deep);
  border-bottom: 1px solid currentColor;
}

/* ---------- 8. 组件 ---------- */
.index-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: var(--orange-deep);
}
.index-label::before {
  content: "";
  width: 22px;
  height: 2px;
  background: var(--orange);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border: var(--rule) solid var(--ink);
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .14em;
}
.tag--open {
  background: var(--celadon-light);
  border-color: var(--celadon);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px 26px;
  background: var(--cream);
  color: var(--ink);
  border: var(--rule) solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease, color .16s ease;
}
.btn:hover {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
  background: var(--orange);
}
.btn:active {
  transform: translate(5px, 5px);
  box-shadow: 0 0 0 var(--ink);
}
.btn--solid { background: var(--orange); }
.btn--solid:hover { background: var(--orange-deep); }
.btn--ghost {
  background: transparent;
  color: var(--cream);
  border-color: var(--sand);
  box-shadow: 5px 5px 0 var(--orange);
}
.btn--ghost:hover {
  background: var(--cream);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--orange);
}

.panel {
  background: var(--cream);
  border: var(--rule) solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
  padding: clamp(18px, 2.4vw, 30px);
}
.panel--ink {
  background: var(--ink);
  color: var(--sand);
  border-color: var(--ink);
  box-shadow: 6px 6px 0 var(--orange);
}
.panel--ink h2,
.panel--ink h3 { color: var(--cream); }

/* 图片容器 */
.media {
  position: relative;
  overflow: hidden;
  background: var(--celadon-light);
  border: var(--rule) solid var(--ink);
  box-shadow: 8px 8px 0 var(--ink);
}
.media > img,
.media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--wide { aspect-ratio: 21 / 9; }
.media--landscape { aspect-ratio: 16 / 10; }
.media--portrait { aspect-ratio: 3 / 4; }
.media--square { aspect-ratio: 1 / 1; }
.media--placeholder::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(27, 42, 65, .09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(27, 42, 65, .09) 1px, transparent 1px);
  background-size: 28px 28px;
}
.media__caption {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 6px 11px;
  background: var(--ink);
  color: var(--sand);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .1em;
}

/* ---------- 9. 响应式 ---------- */
@media (max-width: 1240px) {
  .frame-nav__link {
    font-size: 14px;
    padding: 10px 10px;
  }
  .frame-nav__link[aria-current="page"]::after { left: 10px; right: 10px; }
}

@media (max-width: 1000px) {
  :root {
    --frame-side: auto;
    --entry-side: auto;
  }

  .site-header {
    position: static;
    border-bottom-width: 2px;
  }

  .coord-bar__inner {
    gap: 2px 16px;
    padding: 8px 16px;
    font-size: 10.5px;
  }
  .coord-bar__key { font-size: 9.5px; }
  .coord-bar__status { margin-left: 0; }

  .frame {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand toggle"
      "nav nav";
  }

  .frame-brand {
    flex-direction: row;
    justify-content: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-right: 0;
    border-bottom: var(--rule) solid var(--ink);
  }
  .frame-brand__text {
    writing-mode: horizontal-tb;
    font-size: 16px;
    letter-spacing: .18em;
  }
  .frame-brand__mark { width: 30px; height: 30px; font-size: 11px; }

  .nav-toggle {
    display: inline-flex;
    min-height: 54px;
    border-bottom: var(--rule) solid var(--ink);
  }

  .frame-nav {
    display: none;
    padding: 0;
    border-bottom: var(--rule) solid var(--ink);
  }
  .site-header[data-open] .frame-nav { display: block; }

  .frame-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .frame-nav__link {
    padding: 15px 18px;
    font-size: 16px;
    border: 0;
    border-bottom: 1px solid rgba(27, 42, 65, .14);
  }
  .frame-nav__link:hover { background: var(--cream); border-color: transparent; border-bottom-color: var(--ink); }
  .frame-nav__link[aria-current="page"] { border-bottom: 1px solid var(--ink); }
  .frame-nav__link[aria-current="page"]::after { left: 18px; right: auto; width: 26px; bottom: 11px; }

  .frame-entries {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 70;
    grid-auto-rows: 1fr;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: none;
    border-left: 0;
    border-top: var(--rule-heavy) solid var(--ink);
  }
  .entry {
    border-bottom: 0;
    border-right: var(--rule) solid var(--ink);
    padding: 11px 34px 11px 16px;
  }
  .entry:last-child { border-right: 0; }
  .entry__label { font-size: 15.5px; }
  .entry::after { opacity: .55; right: 12px; }

  body { padding-bottom: 76px; }

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

  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
  .footer-bottom__copy { margin-left: 0; }
  .back-top { bottom: 86px; }
}

@media (max-width: 620px) {
  .footer-grid { grid-template-columns: 1fr; }
  .footer-nav__list { grid-template-columns: 1fr; }
  .footer-bottom__inner { font-size: 11px; }
  .coord-bar__item:nth-child(3) { display: none; }
}

/* ---------- 10. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .pulse-dot { animation: none; box-shadow: 0 0 0 3px rgba(143, 211, 194, .28); }
  .coord-bar::after { transition: none; }
}
