/* =========================================================
   仲博CN · 共享外壳样式 /assets/site.css
   玻璃浮层 × 实色档案层 · 左右分置导航 · 等宽索引语言
   ========================================================= */

/* ---------- Tokens ---------- */
:root {
  --ink-900: #081521;
  --ink-800: #0E2233;
  --ink-700: #142F45;
  --cyan-400: #33E6D6;
  --amber-500: #FFA23C;
  --indigo-500: #6A5AE0;
  --archive-800: #0B3D3A;
  --wine-700: #6E1F3B;
  --mist-300: #A9B8C6;
  --warm-050: #F5F2EA;

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

  --line: rgba(169, 184, 198, 0.18);
  --line-soft: rgba(169, 184, 198, 0.12);
  --line-cyan: rgba(51, 230, 214, 0.28);

  --radius: 3px;
  --max-w: 1320px;
  --pad-x: clamp(16px, 3vw, 40px);
  --header-h: 64px;
  --ease: ease-out;
}

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

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

body {
  margin: 0;
  background: var(--ink-900);
  color: var(--warm-050);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, p, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input { font: inherit; }
address { font-style: normal; }
[hidden] { display: none !important; }

::selection {
  background: rgba(51, 230, 214, 0.28);
  color: var(--warm-050);
}

/* ---------- Focus ---------- */
:focus-visible {
  outline: 2px solid var(--amber-500);
  outline-offset: 2px;
  border-radius: 2px;
}
:focus:not(:focus-visible) { outline: none; }

/* ---------- Utilities ---------- */
.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  left: var(--pad-x);
  top: -80px;
  z-index: 140;
  padding: 10px 18px;
  background: var(--amber-500);
  color: #201203;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  border-radius: var(--radius);
  transition: top 0.18s var(--ease);
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid var(--warm-050);
  outline-offset: 2px;
}

/* =========================================================
   HEADER
   ========================================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(8, 21, 33, 0.86);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line);
  color: var(--warm-050);
}

.scroll-progress {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--cyan-400), var(--amber-500));
  transition: width 0.12s linear;
  pointer-events: none;
  z-index: 2;
}

.header-inner {
  position: relative;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px var(--pad-x);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 36px);
  min-height: var(--header-h);
}

/* --- Brand --- */
.brand-cluster {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 0 auto;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 3px;
  line-height: 1;
}
.brand-mark {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: 0.02em;
  color: var(--warm-050);
  transition: color 0.2s var(--ease);
}
.brand:hover .brand-mark { color: var(--cyan-400); }
.brand-sub {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.24em;
  color: var(--mist-300);
}

.version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border: 1px solid var(--line-cyan);
  border-radius: 2px;
  background: rgba(51, 230, 214, 0.08);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.version-badge:hover,
.version-badge:focus-visible {
  background: rgba(51, 230, 214, 0.18);
  border-color: var(--cyan-400);
}
.version-badge__dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan-400);
  box-shadow: 0 0 0 3px rgba(51, 230, 214, 0.16);
}
.version-badge__text {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--cyan-400);
}

/* --- Nav --- */
.nav-cluster {
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.6vw, 26px);
  min-width: 0;
}

.site-nav__list {
  display: flex;
  align-items: center;
  gap: clamp(6px, 1.4vw, 22px);
}

.site-nav__link {
  position: relative;
  display: inline-block;
  padding: 7px 2px;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--mist-300);
  white-space: nowrap;
  transition: color 0.18s var(--ease);
}
.site-nav__link::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: var(--cyan-400);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.12s var(--ease);
}
.site-nav__link:hover,
.site-nav__link:focus-visible { color: var(--warm-050); }
.site-nav__link:hover::after { transform: scaleX(1); }
.site-nav__link[aria-current="page"] { color: var(--warm-050); }
.site-nav__link[aria-current="page"]::after { transform: scaleX(1); }

/* --- Tools --- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-toggle {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--mist-300);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
  color: var(--cyan-400);
  border-color: var(--line-cyan);
  background: rgba(51, 230, 214, 0.08);
}
.search-toggle__icon {
  position: relative;
  width: 12px; height: 12px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
  flex: 0 0 auto;
}
.search-toggle__icon::after {
  content: "";
  position: absolute;
  right: -4px; bottom: -3px;
  width: 6px; height: 1.5px;
  background: currentColor;
  transform: rotate(45deg);
}
.search-toggle__label { font-family: var(--font-mono); }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 16px;
  border: 1px solid transparent;
  border-radius: 2px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.05em;
  white-space: nowrap;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), border-color 0.2s var(--ease);
}
.btn--cta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--amber-500);
  border-color: var(--amber-500);
  background: transparent;
}
.btn--cta:hover,
.btn--cta:focus-visible {
  background: var(--amber-500);
  color: #201203;
  border-color: var(--amber-500);
}
.btn--ghost {
  color: var(--warm-050);
  border-color: var(--line);
  background: transparent;
}
.btn--ghost:hover,
.btn--ghost:focus-visible {
  border-color: var(--cyan-400);
  color: var(--cyan-400);
  background: rgba(51, 230, 214, 0.08);
}

/* --- Nav toggle (mobile) --- */
.nav-toggle {
  display: none;
  width: 40px; height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: border-color 0.18s var(--ease);
}
.nav-toggle:hover { border-color: var(--line-cyan); }
.nav-toggle__bar {
  display: block;
  width: 16px; height: 2px;
  background: var(--warm-050);
  transition: transform 0.18s var(--ease), opacity 0.18s var(--ease);
}
.site-header[data-open="true"] .nav-toggle { border-color: var(--cyan-400); }
.site-header[data-open="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.site-header[data-open="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-header[data-open="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* --- Search panel --- */
.search-panel {
  display: none;
  position: absolute;
  top: 100%;
  right: var(--pad-x);
  width: min(430px, calc(100vw - 32px));
  margin-top: 10px;
  padding: 16px;
  background: rgba(14, 34, 51, 0.97);
  border: 1px solid var(--line-cyan);
  border-radius: var(--radius);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.52);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  z-index: 120;
}
.search-panel[data-open="true"] {
  display: block;
  animation: panel-in 0.2s var(--ease);
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}
.search-panel__label {
  display: block;
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--mist-300);
}
.search-panel__input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--ink-700);
  border-radius: 2px;
  background: var(--ink-900);
  color: var(--warm-050);
  font-size: 14px;
}
.search-panel__input::placeholder { color: rgba(169, 184, 198, 0.7); }
.search-panel__input:focus {
  outline: none;
  border-color: var(--cyan-400);
  box-shadow: 0 0 0 2px rgba(51, 230, 214, 0.2);
}
.search-results {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 268px;
  overflow-y: auto;
}
.search-results__item {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 8px 10px;
  border-left: 2px solid transparent;
  border-radius: 2px;
  transition: background 0.18s var(--ease), border-color 0.18s var(--ease);
}
.search-results__item:hover,
.search-results__item:focus-visible {
  background: rgba(51, 230, 214, 0.1);
  border-left-color: var(--cyan-400);
}
.search-results__label {
  font-size: 14px;
  color: var(--warm-050);
}
.search-results__hint {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.02em;
  color: var(--mist-300);
}
.search-panel__empty {
  margin-top: 10px;
  font-size: 12px;
  color: var(--mist-300);
}

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--ink-900);
  color: var(--mist-300);
  border-top: 1px solid var(--line);
}

.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: clamp(40px, 5vw, 68px) var(--pad-x) clamp(28px, 3vw, 44px);
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.3fr;
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}

.footer-col { min-width: 0; }

.footer-brand { display: flex; flex-direction: column; gap: 14px; }

.brand--footer { gap: 4px; }
.brand--footer .brand-mark { font-size: 17px; }
.brand--footer .brand-sub { letter-spacing: 0.22em; }

.footer-tagline {
  font-size: 13px;
  line-height: 1.7;
  color: var(--mist-300);
  max-width: 26em;
}
.footer-version {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--mist-300);
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.footer-version .mono { color: var(--cyan-400); font-size: 12px; }

.footer-col__title {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--warm-050);
  padding-bottom: 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line-soft);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-link {
  font-size: 13.5px;
  color: var(--mist-300);
  transition: color 0.18s var(--ease), padding-left 0.18s var(--ease);
}
.footer-link:hover,
.footer-link:focus-visible {
  color: var(--cyan-400);
  padding-left: 4px;
}

.footer-contact {
  display: flex;
  flex-direction: column;
  gap: 10px;
  font-size: 13px;
  line-height: 1.65;
}
.footer-contact__row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
}
.footer-contact__key {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: var(--cyan-400);
  min-width: 34px;
  flex: 0 0 auto;
}
.footer-contact .mono { color: var(--warm-050); font-size: 12.5px; }

.footer-legal {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px var(--pad-x) 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  border-top: 1px solid var(--line-soft);
}
.footer-legal__line {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  line-height: 1.9;
  color: rgba(169, 184, 198, 0.82);
}
.footer-legal__link {
  color: var(--mist-300);
  border-bottom: 1px solid rgba(169, 184, 198, 0.3);
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease);
}
.footer-legal__link:hover,
.footer-legal__link:focus-visible {
  color: var(--cyan-400);
  border-bottom-color: var(--cyan-400);
}

.to-top {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--mist-300);
  border: 1px solid var(--line);
  border-radius: 2px;
  transition: color 0.18s var(--ease), border-color 0.18s var(--ease), background 0.18s var(--ease);
}
.to-top::before {
  content: "";
  width: 0; height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 6px solid currentColor;
}
.to-top:hover,
.to-top:focus-visible {
  color: var(--amber-500);
  border-color: var(--amber-500);
  background: rgba(255, 162, 60, 0.08);
}

/* =========================================================
   SHARED PAGE COMPONENTS
   ========================================================= */
.prose {
  max-width: 68ch;
  font-size: 16px;
  line-height: 1.75;
  color: var(--warm-050);
}
.prose > * + * { margin-top: 1.05em; }
.prose--on-light { color: var(--ink-900); }
.prose--on-light a { color: var(--archive-800); border-bottom: 1px solid currentColor; }

.lede {
  max-width: 62ch;
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.75;
  color: var(--mist-300);
}
.lede--on-light { color: var(--ink-700); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: clamp(10px, 1.6vw, 20px);
  margin-bottom: clamp(16px, 2vw, 30px);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.section-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  font-size: clamp(26px, 3.6vw, 44px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--cyan-400);
  opacity: 0.6;
  flex: 0 0 auto;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--warm-050);
}
.section-title--on-light { color: var(--ink-900); }

.grid {
  display: grid;
  gap: clamp(14px, 2vw, 24px);
}
.grid--bento {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
}
.grid__cell { min-width: 0; }

.breadcrumb { padding-top: 18px; }
.breadcrumb__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
}
.breadcrumb__item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--mist-300);
}
.breadcrumb__item + .breadcrumb__item::before {
  content: "/";
  color: rgba(169, 184, 198, 0.42);
}
.breadcrumb__link {
  color: var(--mist-300);
  transition: color 0.18s var(--ease);
}
.breadcrumb__link:hover,
.breadcrumb__link:focus-visible { color: var(--cyan-400); }
.breadcrumb__current { color: var(--warm-050); }

.media {
  position: relative;
  border: 1px solid var(--ink-700);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--ink-800);
}
.media__frame {
  width: 100%;
  aspect-ratio: 16 / 9;
  background:
    linear-gradient(135deg, var(--ink-800) 0%, var(--ink-900) 100%);
  overflow: hidden;
}
.media__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.media__caption {
  margin-top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--mist-300);
}
.media--wide .media__frame { aspect-ratio: 21 / 9; }
.media--tall .media__frame { aspect-ratio: 4 / 5; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 8px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1.6;
}
.tag--cyan { color: var(--cyan-400); }
.tag--amber { color: var(--amber-500); }
.tag--wine {
  color: #F0C6D4;
  background: var(--wine-700);
  border-color: transparent;
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .brand-sub { letter-spacing: 0.16em; }
  .site-nav__link { font-size: 13.5px; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .search-toggle__label { display: none; }
  .search-toggle { padding: 9px; }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    padding: 6px var(--pad-x) 22px;
    background: rgba(8, 21, 33, 0.98);
    border-bottom: 1px solid var(--line-cyan);
    box-shadow: 0 24px 44px rgba(0, 0, 0, 0.45);
    -webkit-backdrop-filter: blur(18px);
    backdrop-filter: blur(18px);
    max-height: calc(100vh - var(--header-h));
    overflow-y: auto;
  }
  .site-header[data-open="true"] .site-nav {
    display: block;
    animation: panel-in 0.2s var(--ease);
  }
  .site-nav__list {
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }
  .site-nav__link {
    display: block;
    padding: 14px 0;
    font-size: 16px;
    color: var(--warm-050);
    border-bottom: 1px solid var(--line-soft);
  }
  .site-nav__link::after { display: none; }
  .site-nav__link[aria-current="page"] {
    color: var(--cyan-400);
    box-shadow: inset 3px 0 0 var(--cyan-400);
    padding-left: 10px;
  }

  .search-panel {
    left: 16px;
    right: 16px;
    width: auto;
  }

  .footer-inner { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 620px) {
  :root { --header-h: 58px; }
  .brand-mark { font-size: 17px; }
  .brand-sub { font-size: 8px; letter-spacing: 0.14em; }
  .btn--cta { padding: 8px 11px; font-size: 11px; letter-spacing: 0.04em; }
  .version-badge { padding: 4px 7px; }
  .footer-inner { grid-template-columns: 1fr; }
  .footer-legal {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }
  .grid--bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}

/* =========================================================
   MOTION PREFERENCES
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
  .scroll-progress { transition: none; }
  .search-panel[data-open="true"] { animation: none; }
  .site-header[data-open="true"] .site-nav { animation: none; }
}
