/* ============================================================
   NORTH 28 · 共享站点样式
   技术蓝图式网格 / 矿物纸感 / 紧凑命令栏
   ============================================================ */

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

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

body, h1, h2, h3, h4, 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; }

a { color: inherit; }

:root {
  /* 品牌色 */
  --maple: #B5232C;
  --maple-deep: #8A1620;
  --ink: #1D242B;
  --slate: #3C4E5A;
  --haze: #8496A2;
  --line: #CBD4DA;
  --paper: #F6F3EC;
  --sand: #E9E2D5;
  --amber: #C08A2E;
  --amber-deep: #A9761F;
  --moss: #5F7355;
  --clay: #A2603F;
  --night: #10161C;

  /* 字体 */
  --sans: 'Noto Sans SC', system-ui, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  --serif: 'Noto Serif SC', 'Songti SC', 'Source Han Serif SC', 'SimSun', serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Consolas, 'Courier New', monospace;

  /* 栅格与节奏 */
  --shell: 1200px;
  --gutter: 24px;
  --ease: cubic-bezier(.2, .7, .3, 1);
  --t: 200ms;
}

html { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    linear-gradient(to right, rgba(60, 78, 90, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(60, 78, 90, .07) 1px, transparent 1px);
  background-size: 96px 96px;
  background-position: center top;
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -.02em;
  color: var(--ink);
}

p { max-width: 38em; }

[id] { scroll-margin-top: 110px; }

#main-content {
  display: block;
  position: relative;
  z-index: 1;
}

/* ---------- 焦点 ---------- */

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

/* ---------- 跳转链 ---------- */

.skip-link {
  position: fixed;
  left: 16px;
  top: -72px;
  z-index: 300;
  padding: 10px 18px;
  font-size: 14px;
  font-weight: 600;
  color: var(--paper);
  background: var(--ink);
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  transition: top var(--t) var(--ease);
}

.skip-link:focus { top: 0; }

/* ---------- 容器与通用件 ---------- */

.container {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--haze);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--slate);
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 2px 10px 2px 10px;
  text-decoration: none;
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.tag:hover { border-color: var(--clay); color: var(--maple); }
.tag[data-selected] { background: var(--maple); border-color: var(--maple); color: #fff; }

/* ---------- 图容器基础规则（供页面放置图片或线框占位） ---------- */

.figure {
  position: relative;
  margin: 0;
  background: var(--sand);
  border: 1px solid var(--line);
  border-radius: 2px 14px 2px 14px;
  overflow: hidden;
}

.figure__media {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.figure__caption {
  padding: 10px 14px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
  color: var(--slate);
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.figure__placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 10;
  padding: 20px;
  text-align: center;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .1em;
  color: var(--haze);
  background-image:
    linear-gradient(to right, rgba(60, 78, 90, .09) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(60, 78, 90, .09) 1px, transparent 1px);
  background-size: 24px 24px;
}

.figure--square .figure__media,
.figure--square .figure__placeholder { aspect-ratio: 1 / 1; }

.figure--tall .figure__media,
.figure--tall .figure__placeholder { aspect-ratio: 4 / 5; }

.figure--wide .figure__media,
.figure--wide .figure__placeholder { aspect-ratio: 21 / 9; }

/* ---------- 按钮 ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 10px 16px;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: 3px;
  cursor: pointer;
  transition: background-color 160ms var(--ease), color 160ms var(--ease),
              border-color 160ms var(--ease), transform 160ms var(--ease);
}

.btn:hover { transform: translateY(-2px); }

.btn--amber { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.btn--amber:hover { background: var(--amber-deep); border-color: var(--amber-deep); }

.btn--maple { background: var(--maple); border-color: var(--maple); color: #fff; }
.btn--maple:hover { background: var(--maple-deep); border-color: var(--maple-deep); }

.btn--ghost { background: transparent; border-color: var(--line); color: var(--slate); }
.btn--ghost:hover { color: var(--ink); border-color: var(--slate); background: rgba(233, 226, 213, .75); }

.btn--sm { padding: 7px 12px; font-size: 12.5px; border-radius: 2px 8px 2px 8px; }

.btn__icon {
  flex: 0 0 auto;
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}

/* ============================================================
   页头 · 紧凑命令栏
   ============================================================ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(246, 243, 236, .97);
  border-bottom: 1px solid var(--line);
}

.scroll-meter {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--maple);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms var(--ease);
}

.scroll-meter[data-active] { opacity: 1; }

.site-header__inner {
  display: flex;
  align-items: center;
  gap: 26px;
  width: 100%;
  max-width: var(--shell);
  min-height: 64px;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* 品牌 */

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--ink);
  text-decoration: none;
}

.brand__mark {
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  fill: none;
  stroke: var(--maple);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
  transition: transform var(--t) var(--ease);
}

.brand:hover .brand__mark { transform: rotate(-8deg); }

.brand__text { display: flex; flex-direction: column; line-height: 1.05; }

.brand__name { font-size: 16.5px; font-weight: 800; letter-spacing: -.01em; }

.brand__latin {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .22em;
  color: var(--haze);
}

/* 命令栏导航 */

.cmd-nav { margin-left: 4px; }

.cmd-nav__list { display: flex; align-items: center; }

.cmd-nav__link {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 9px 11px 11px;
  font-size: 14px;
  font-weight: 500;
  color: var(--slate);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 160ms var(--ease), border-color 160ms var(--ease),
              background-color 160ms var(--ease);
}

.cmd-nav__link:hover { color: var(--ink); background: var(--sand); }

.cmd-nav__idx {
  font-family: var(--mono);
  font-size: 9.5px;
  font-weight: 500;
  letter-spacing: .06em;
  color: var(--haze);
  transition: color 160ms var(--ease);
}

.cmd-nav__link[aria-current="page"] {
  color: var(--ink);
  font-weight: 700;
  border-bottom-color: var(--maple);
}

.cmd-nav__link[aria-current="page"] .cmd-nav__idx { color: var(--maple); }

/* 动作区 */

.site-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.collection-trigger { position: relative; }

/* 移动导航按钮 */

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--ink);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 160ms var(--ease), background-color 160ms var(--ease);
}

.nav-toggle:hover { border-color: var(--slate); background: var(--sand); }

.nav-toggle__bars {
  position: relative;
  display: block;
  width: 18px;
  height: 1.6px;
  background: currentColor;
  border-radius: 1px;
  transition: background-color 160ms var(--ease);
}

.nav-toggle__bars::before,
.nav-toggle__bars::after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 1.6px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 200ms var(--ease), opacity 160ms var(--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-header__trail {
  border-top: 1px solid var(--line);
  background: rgba(233, 226, 213, .55);
}

.crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 5px var(--gutter);
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--haze);
}

.crumb li { display: inline-flex; align-items: center; }

.crumb li + li::before {
  content: "›";
  margin: 0 8px;
  font-family: var(--sans);
  font-size: 12px;
  color: var(--line);
}

.crumb a { color: var(--slate); text-decoration: none; }
.crumb a:hover { color: var(--maple); }

.crumb__current { color: var(--ink); }

/* ============================================================
   收藏 / 索引面板
   ============================================================ */

.collection-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}

.collection-overlay[hidden] { display: none; }

.collection-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 22, 28, .55);
  cursor: pointer;
}

.collection-dialog {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(440px, 100%);
  height: 100%;
  padding: 22px var(--gutter) 28px;
  overflow-y: auto;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: -28px 0 60px rgba(16, 22, 28, .22);
}

.collection-dialog__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.collection-dialog__title {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .01em;
  color: var(--ink);
}

.collection-dialog__sub {
  margin-top: 5px;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .06em;
  color: var(--haze);
  max-width: none;
}

.collection-dialog__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  font-size: 19px;
  line-height: 1;
  color: var(--slate);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 3px;
  cursor: pointer;
  transition: border-color 160ms var(--ease), color 160ms var(--ease), background-color 160ms var(--ease);
}

.collection-dialog__close:hover { color: var(--ink); border-color: var(--slate); background: var(--sand); }

.collection-search { margin: 16px 0 8px; }

.collection-search__input {
  width: 100%;
  padding: 10px 12px;
  font-family: var(--sans);
  font-size: 14px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 3px;
  transition: border-color 160ms var(--ease);
}

.collection-search__input:focus { border-color: var(--amber); outline: none; }
.collection-search__input:focus-visible { outline: 2px solid var(--amber); outline-offset: 1px; }

.collection-list { display: grid; gap: 2px; margin-top: 6px; }

.collection-list__link {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 11px 10px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--ink);
  text-decoration: none;
  border-radius: 3px;
  transition: background-color 150ms var(--ease), color 150ms var(--ease);
}

.collection-list__link:hover { background: var(--sand); }
.collection-list__link[hidden] { display: none; }

.collection-list__idx {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .08em;
  color: var(--maple);
}

.collection-list__text { flex: 1 1 auto; }

.collection-list__meta {
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--haze);
}

.collection-empty {
  margin-top: 14px;
  padding: 14px;
  font-size: 13px;
  color: var(--haze);
  text-align: center;
  border: 1px dashed var(--line);
  border-radius: 3px;
  max-width: none;
}

.collection-empty[hidden] { display: none; }

.collection-note {
  margin-top: auto;
  padding-top: 18px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--haze);
  border-top: 1px solid var(--line);
  max-width: none;
}

@keyframes sheet-in {
  from { transform: translateX(24px); opacity: .5; }
  to   { transform: translateX(0);   opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ============================================================
   页脚
   ============================================================ */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 96px;
  font-size: 14px;
  color: #C8D1D8;
  background: var(--night);
}

.site-footer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 60px var(--gutter) 0;
}

.footer-top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 30px;
  border-bottom: 1px solid rgba(203, 212, 218, .18);
}

.footer-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #F6F3EC;
  text-decoration: none;
}

.footer-brand__mark {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: var(--maple);
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.footer-brand__name {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: .02em;
}

.footer-brand__desc {
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.7;
  color: #8FA0AC;
  max-width: 34em;
}

.footer-coords {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  color: #6C7C88;
  align-self: center;
  max-width: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 32px;
  padding: 40px 0 48px;
}

.footer-col__title {
  margin-bottom: 14px;
  padding-bottom: 10px;
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #F6F3EC;
  border-bottom: 1px solid rgba(203, 212, 218, .16);
}

.footer-list {
  display: grid;
  gap: 9px;
  font-size: 13.5px;
  color: #A6B3BD;
}

.footer-list a {
  color: #A6B3BD;
  text-decoration: none;
  transition: color 160ms var(--ease);
}

.footer-list a:hover { color: #FFFFFF; }

.footer-list--tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.footer-list .footer-tag {
  display: inline-block;
  padding: 5px 10px;
  font-size: 12.5px;
  color: #A6B3BD;
  text-decoration: none;
  border: 1px solid rgba(203, 212, 218, .26);
  border-radius: 2px 10px 2px 10px;
  transition: color 160ms var(--ease), border-color 160ms var(--ease),
              background-color 160ms var(--ease);
}

.footer-list .footer-tag:hover {
  color: #FFFFFF;
  border-color: var(--amber);
  background: rgba(192, 138, 46, .14);
}

.footer-contact li {
  line-height: 1.75;
  word-break: break-word;
}

.footer-contact__note {
  margin-top: 12px;
  padding-left: 10px;
  font-size: 12.5px;
  line-height: 1.75;
  color: #7E8E9A;
  border-left: 2px solid var(--clay);
  max-width: 30em;
}

.footer-contact__note a {
  color: #C8D1D8;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.footer-contact__note a:hover { color: #FFFFFF; }

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  padding: 18px 0 26px;
  font-size: 12.5px;
  color: #7E8E9A;
  border-top: 1px solid rgba(203, 212, 218, .16);
}

.footer-bottom__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 11.5px;
  letter-spacing: .04em;
}

.footer-bottom__sep { color: rgba(203, 212, 218, .3); }

.footer-bottom__links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-left: auto;
}

.footer-bottom__links a { color: #A6B3BD; text-decoration: none; }
.footer-bottom__links a:hover { color: #FFFFFF; }

.footer-bottom__actions { display: flex; gap: 8px; }

.site-footer .btn--ghost {
  color: #C8D1D8;
  border-color: rgba(203, 212, 218, .28);
}

.site-footer .btn--ghost:hover {
  color: #FFFFFF;
  border-color: var(--amber);
  background: rgba(192, 138, 46, .14);
}

/* ============================================================
   响应式
   ============================================================ */

@media (max-width: 1080px) {
  .site-header__inner { gap: 14px; }
  .cmd-nav__link { padding: 9px 8px 11px; font-size: 13.5px; }
  .cmd-nav__idx { font-size: 9px; }
}

@media (max-width: 960px) {
  :root { --gutter: 18px; }

  [id] { scroll-margin-top: 76px; }

  .site-header__inner {
    min-height: 58px;
    gap: 10px;
  }

  .brand__latin { display: none; }

  .site-header__actions { gap: 6px; }

  .site-header .btn--amber { padding: 9px 13px; font-size: 13px; }

  .collection-trigger { padding: 10px 11px; }
  .collection-trigger .btn__label { display: none; }

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

  .cmd-nav {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    display: none;
    max-height: calc(100vh - 96px);
    overflow-y: auto;
    padding: 6px var(--gutter) 18px;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 18px 32px rgba(16, 22, 28, .1);
  }

  .cmd-nav[data-open] { display: block; }

  .cmd-nav__list {
    flex-direction: column;
    align-items: stretch;
  }

  .cmd-nav__link {
    width: 100%;
    padding: 14px 4px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
  }

  .cmd-nav__link:hover { background: transparent; }

  .cmd-nav__link[aria-current="page"] {
    padding-left: 10px;
    background: rgba(233, 226, 213, .75);
    border-bottom-color: var(--maple);
  }

  .cmd-nav__idx { font-size: 10px; }

  .site-header__trail { display: none; }

  .site-footer { margin-top: 64px; }
  .site-footer__inner { padding-top: 44px; }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px 24px;
    padding: 32px 0 40px;
  }
}

@media (max-width: 640px) {
  .figure__media,
  .figure__placeholder { aspect-ratio: 4 / 3; }
  .figure--wide .figure__media,
  .figure--wide .figure__placeholder { aspect-ratio: 16 / 10; }

  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }

  .footer-bottom__links { margin-left: 0; }
}

@media (max-width: 520px) {
  .footer-grid { grid-template-columns: 1fr; }
  .brand__mark { width: 26px; height: 26px; }
  .brand__name { font-size: 15px; }
  .site-header .btn--amber { padding: 9px 11px; font-size: 12.5px; }
}

@media (prefers-reduced-motion: no-preference) {
  .collection-dialog { animation: sheet-in 220ms var(--ease); }
  .collection-overlay__backdrop { animation: fade-in 200ms var(--ease); }
}

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

  .btn:hover,
  .brand:hover .brand__mark { transform: none; }

  html { scroll-behavior: auto; }
}
