/* ==========================================================================
   轻量指南 · 共享样式表 /assets/site.css
   靛青 + 潮汐蓝 + 沙砾米 + 信号橙 · 非对称编辑部索引版式
   ========================================================================== */

/* 1. 重置 ----------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

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

body { margin: 0; }

h1, h2, h3, h4, h5, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
table { border-collapse: collapse; width: 100%; }

/* 2. 变量 ----------------------------------------------------------------- */
:root {
  --ink: #103A5C;
  --tide: #2E7FA8;
  --shallow: #9FC4D8;
  --sand: #EFE6D6;
  --paper: #F8F5EF;
  --signal: #D9551F;
  --signal-deep: #B84417;
  --text: #33424F;
  --line: #C9D6DE;
  --glass: #FFFFFF99;
  --glass-strong: rgba(248, 245, 239, 0.82);

  --font-display: "Noto Sans SC", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, -apple-system, sans-serif;
  --font-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --font-mono: "JetBrains Mono", "SFMono-Regular", Menlo, Consolas, "Liberation Mono", monospace;

  --fs-12: 0.75rem;
  --fs-14: 0.875rem;
  --fs-16: 1rem;
  --fs-20: 1.25rem;
  --fs-28: 1.75rem;
  --fs-40: 2.5rem;
  --fs-64: 4rem;
  --fs-96: 6rem;

  --gutter: clamp(1.25rem, 4vw, 3.5rem);
  --gap: clamp(1rem, 2.5vw, 1.75rem);
  --content-max: 1180px;
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --rail-min: 60px;
}

/* 3. 基础层 --------------------------------------------------------------- */
body {
  background-color: var(--paper);
  color: var(--text);
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 400;
  line-height: 1.85;
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: var(--fs-20); letter-spacing: -0.01em; }
h4 { font-size: var(--fs-16); letter-spacing: 0; }

p { line-height: 1.85; }

::selection {
  background: var(--signal);
  color: #fff;
}

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

#main-content { scroll-margin-top: 140px; }

/* 4. 工具类 --------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: var(--content-max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

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

.skip-link {
  position: fixed;
  top: -90px;
  left: 0;
  z-index: 200;
  padding: 0.7rem 1.2rem;
  background: var(--signal);
  color: #fff;
  font-size: var(--fs-14);
  font-weight: 700;
  letter-spacing: 0.04em;
  transition: top 0.16s var(--ease);
}
.skip-link:focus { top: 0; }

.rule {
  height: 1px;
  border: 0;
  background: var(--line);
}

.grid {
  display: grid;
  gap: var(--gap);
}
.grid--12 { grid-template-columns: repeat(12, minmax(0, 1fr)); }
.grid--split { grid-template-columns: minmax(0, 7fr) minmax(0, 3fr); }
.grid--halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--thirds { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.prose {
  max-width: 34em;
}
.prose p + p { margin-top: 1em; }
.prose a {
  color: var(--tide);
  border-bottom: 1px solid var(--shallow);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease);
}
.prose a:hover,
.prose a:focus-visible {
  color: var(--ink);
  border-bottom-color: var(--tide);
}

.meta {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--tide);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--tide);
}
.eyebrow::before {
  content: "";
  width: 18px;
  height: 1px;
  background: var(--signal);
  flex: 0 0 auto;
}

.display-num {
  display: block;
  font-family: var(--font-serif);
  font-weight: 700;
  font-size: clamp(3.5rem, 9vw, 6rem);
  line-height: 0.82;
  letter-spacing: -0.04em;
  color: var(--shallow);
  font-variant-numeric: tabular-nums;
}

/* 5. 标签 / 按钮 / 卡片 / 媒体 -------------------------------------------- */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  padding: 0.28em 0.6em;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--glass);
  color: var(--tide);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
}
.tag--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}
.tag--sand {
  background: var(--sand);
  border-color: transparent;
  color: var(--ink);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  padding: 0.9em 1.4em;
  border: 1px solid var(--ink);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-display);
  font-size: var(--fs-16);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.02em;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease), color 0.18s var(--ease), transform 0.18s var(--ease);
}
.btn:hover,
.btn:focus-visible {
  background: var(--tide);
  border-color: var(--tide);
  transform: translateY(-1px);
}
.btn--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: #fff;
}
.btn--signal:hover,
.btn--signal:focus-visible {
  background: var(--signal-deep);
  border-color: var(--signal-deep);
}
.btn--ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  background: transparent;
  border-color: var(--tide);
  color: var(--tide);
}

.card {
  position: relative;
  padding: clamp(1.1rem, 2.4vw, 1.65rem);
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--paper);
  transition: border-color 0.16s var(--ease), background 0.16s var(--ease);
}
.card:hover,
.card:focus-within {
  border-color: var(--tide);
}
.card--sand {
  background: var(--sand);
  border-color: transparent;
}
.card--sand:hover,
.card--sand:focus-within {
  border-color: var(--tide);
}
.card__corner {
  position: absolute;
  top: -1px;
  right: -1px;
  padding: 0.22rem 0.55rem;
  border-radius: 0 2px 0 2px;
  background: var(--signal);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.6;
  transition: transform 0.16s var(--ease);
}
.card:hover .card__corner,
.card:focus-within .card__corner {
  transform: translateY(-2px);
}

.glass {
  background: var(--glass);
  border: 1px solid rgba(255, 255, 255, 0.6);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
}

/* 媒体容器基础规则：页面阶段放入 <img> 或内联 SVG 占位 */
.media {
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 10;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--sand);
}
.media > img,
.media > svg,
.media > picture > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.media--square { aspect-ratio: 1 / 1; }
.media--wide { aspect-ratio: 21 / 9; }
.media--tall { aspect-ratio: 3 / 4; }
.media__frame {
  position: absolute;
  inset: 8px;
  border: 1px solid rgba(16, 58, 92, 0.18);
  pointer-events: none;
}
.media__tag {
  position: absolute;
  left: 0;
  bottom: 0;
  padding: 0.28rem 0.6rem;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.1em;
}
.media__caption {
  margin-top: 0.6rem;
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  color: var(--tide);
}

/* 6. 头部 ----------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: var(--ink);
  box-shadow: 0 1px 0 rgba(16, 58, 92, 0.12);
}

.header-rail {
  background: var(--ink);
  color: var(--paper);
}

.header-rail__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: var(--rail-min);
  padding-block: 0.55rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: 0 0 auto;
}
.brand__mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 2px;
  background: var(--signal);
  color: #fff;
  font-family: var(--font-serif);
  font-size: 18px;
  font-weight: 700;
  line-height: 1;
}
.brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand__name {
  color: var(--paper);
  font-size: 1.0625rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}
.brand__tag {
  color: var(--shallow);
  font-family: var(--font-mono);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.22em;
}

.rail-meta {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-width: 0;
}
.rail-link {
  color: rgba(248, 245, 239, 0.72);
  font-family: var(--font-mono);
  font-size: var(--fs-12);
  letter-spacing: 0.06em;
  white-space: nowrap;
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.rail-link:hover,
.rail-link:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--shallow);
}

.rail-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 0 0 auto;
}

.issue-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.32rem 0.7rem 0.32rem 0.55rem;
  border-radius: 2px;
  background: var(--signal);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.5;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.16);
  transition: background 0.16s var(--ease), transform 0.16s var(--ease);
}
.issue-chip:hover,
.issue-chip:focus-visible {
  background: var(--signal-deep);
  transform: translateY(-1px);
}
.issue-chip__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  flex: 0 0 auto;
}
.issue-chip__num { opacity: 0.86; }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.42rem 0.7rem;
  border: 1px solid rgba(159, 196, 216, 0.45);
  border-radius: 2px;
  color: var(--paper);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--shallow);
  background: rgba(159, 196, 216, 0.12);
}
.nav-toggle__bars {
  position: relative;
  display: block;
  width: 16px;
  height: 10px;
}
.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: currentColor;
  transition: top 0.2s var(--ease), transform 0.2s var(--ease);
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars::after { top: 8px; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before {
  top: 4px;
  transform: rotate(45deg);
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after {
  top: 4px;
  transform: rotate(-45deg);
}

.header-nav {
  background: var(--glass-strong);
  border-top: 1px solid rgba(159, 196, 216, 0.35);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  backdrop-filter: blur(14px) saturate(1.4);
}

.header-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

.site-nav { min-width: 0; }

.nav-list {
  display: flex;
  align-items: stretch;
  flex-wrap: wrap;
}
.nav-list__item { display: flex; }

.nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.95rem 1.05rem;
  color: var(--ink);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: color 0.18s var(--ease);
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 1.05rem;
  right: 1.05rem;
  bottom: 0.5rem;
  height: 2px;
  background: var(--tide);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.18s var(--ease), background 0.18s var(--ease);
}
.nav-link:hover,
.nav-link:focus-visible { color: var(--tide); }
.nav-link:hover::after,
.nav-link:focus-visible::after { transform: scaleX(1); }
.nav-link[aria-current="page"] {
  color: var(--ink);
  font-weight: 800;
}
.nav-link[aria-current="page"]::after {
  transform: scaleX(1);
  background: var(--signal);
}

.nav-aside {
  flex: 0 0 auto;
  color: var(--tide);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.14em;
  opacity: 0.72;
  white-space: nowrap;
}

/* 7. 页脚 ----------------------------------------------------------------- */
.site-footer {
  margin-top: clamp(4rem, 10vw, 7rem);
  background: var(--ink);
  color: rgba(248, 245, 239, 0.78);
  border-top: 1px solid rgba(159, 196, 216, 0.4);
}

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(0, 1fr));
  gap: clamp(1.75rem, 4vw, 3rem);
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.footer-brand__name {
  color: var(--paper);
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.2;
}
.footer-brand__desc {
  margin-top: 0.7rem;
  max-width: 22em;
  font-size: var(--fs-14);
  line-height: 1.7;
  color: rgba(248, 245, 239, 0.6);
}
.footer-brand__issue {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1.25rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  color: var(--shallow);
}
.footer-brand__num {
  padding: 0.18rem 0.45rem;
  border: 1px solid rgba(159, 196, 216, 0.45);
  border-radius: 2px;
  color: var(--paper);
}

.footer-col__title {
  margin-bottom: 0.9rem;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid rgba(159, 196, 216, 0.25);
  color: var(--shallow);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  line-height: 1.6;
}

.footer-links {
  display: grid;
  gap: 0.55rem;
}
.footer-links a {
  display: inline-block;
  color: rgba(248, 245, 239, 0.8);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
  background-image: linear-gradient(var(--shallow), var(--shallow));
  background-size: 0% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  transition: color 0.18s var(--ease), background-size 0.18s var(--ease);
}
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--paper);
  background-size: 100% 1px;
}

.footer-addr {
  margin-top: 0.9rem;
  font-size: 0.8125rem;
  line-height: 1.7;
  color: rgba(248, 245, 239, 0.55);
}

.footer-base {
  border-top: 1px solid rgba(159, 196, 216, 0.22);
}
.footer-base__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem 1.5rem;
  padding-block: 1.1rem;
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.08em;
  color: rgba(248, 245, 239, 0.55);
}
.footer-legal {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}
.footer-sep { opacity: 0.5; }
.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 1.1rem;
}
.footer-meta a {
  color: rgba(248, 245, 239, 0.78);
  border-bottom: 1px solid transparent;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-meta a:hover,
.footer-meta a:focus-visible {
  color: var(--paper);
  border-bottom-color: var(--shallow);
}

/* 8. 悬浮索引条 ----------------------------------------------------------- */
.index-float {
  position: fixed;
  right: clamp(0.75rem, 2vw, 1.5rem);
  bottom: clamp(0.75rem, 2vw, 1.5rem);
  z-index: 70;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 0.9rem;
  border: 1px solid rgba(159, 196, 216, 0.4);
  border-radius: 2px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-mono);
  font-size: 0.6875rem;
  letter-spacing: 0.1em;
  line-height: 1.5;
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.22s var(--ease), transform 0.22s var(--ease), visibility 0.22s linear, background 0.18s var(--ease);
}
.index-float[data-visible="true"] {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.index-float:hover,
.index-float:focus-visible {
  background: var(--tide);
  border-color: var(--tide);
}
.index-float__dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--signal);
  flex: 0 0 auto;
}
.index-float__arrow {
  color: var(--shallow);
  font-size: 0.75rem;
}

/* 9. 滚动显现 ------------------------------------------------------------- */
.js [data-reveal] {
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.js [data-reveal][data-revealed="true"] {
  opacity: 1;
}

/* 10. 响应式 -------------------------------------------------------------- */
@media (max-width: 1180px) {
  .rail-link--hours { display: none; }
}

@media (max-width: 1024px) {
  .nav-aside { display: none; }
  .footer-top {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .grid--split,
  .grid--halves,
  .grid--thirds {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 860px) {
  #main-content { scroll-margin-top: 96px; }

  .rail-meta { display: none; }

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

  .header-nav {
    background: var(--paper);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .header-nav__inner {
    display: block;
    padding-inline: 0;
    border-top: 0;
  }

  .nav-list {
    display: none;
    flex-direction: column;
    padding-bottom: 0.4rem;
  }
  .site-nav[data-open="true"] .nav-list { display: flex; }

  .nav-link {
    width: 100%;
    padding: 0.8rem var(--gutter);
    border-top: 1px solid var(--line);
    font-size: 1rem;
  }
  .nav-link::after {
    left: var(--gutter);
    right: auto;
    width: 24px;
    bottom: 0.45rem;
  }
  .nav-link[aria-current="page"] {
    background: var(--sand);
  }

  .index-float__text { display: none; }
  .index-float { padding: 0.6rem 0.75rem; }
}

@media (max-width: 640px) {
  body { font-size: 0.9375rem; }

  .brand__name { font-size: 1rem; letter-spacing: 0.05em; }
  .brand__tag { letter-spacing: 0.16em; }

  .issue-chip__text { display: none; }

  .footer-top {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
  .footer-base__inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  .index-float {
    right: 0.75rem;
    bottom: 0.75rem;
  }
}

@media (max-width: 380px) {
  .nav-toggle__label { display: none; }
}

/* 11. 减少动效 ------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  html { scroll-behavior: auto; }
  .js [data-reveal] {
    opacity: 1;
    transition: none;
  }
  .index-float {
    transform: none;
  }
}
