/* ============================================================
   leisure-yizhao.com.cn — 共享样式
   /assets/site.css
   ============================================================ */

*,
*::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, figcaption, blockquote,
dl, dt, dd, fieldset, legend {
  margin: 0;
  padding: 0;
}

ul, ol { 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; border-spacing: 0; }

/* ---------- 变量 ---------- */
:root {
  --ink: #0A1A2A;
  --panel: #102438;
  --line: #24405C;
  --paper: #F1EBE2;
  --signal: #FF7A29;
  --haze: #FFD8BC;
  --on-amber: #101820;
  --violet: #7C5CFF;
  --teal: #1FC7A6;
  --muted: #A8B7C6;
  --text: #F5F7FA;

  --font-head: 'Noto Sans SC', 'Source Han Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-body: 'HarmonyOS Sans SC', 'MiSans', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Roboto Mono', ui-monospace, 'Cascadia Mono', Consolas, monospace;

  --topbar: 56px;
  --rail: 88px;
  --rail-open: 240px;
  --maxw: 1180px;
  --ease: cubic-bezier(0.2, 0, 0, 1);
}

/* ---------- 中文排版基座 ---------- */
html { font-size: 16px; }

body {
  background-color: var(--ink);
  background-image:
    linear-gradient(to right, rgba(36, 64, 92, 0.16) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 64, 92, 0.16) 1px, transparent 1px);
  background-size: 64px 64px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.75;
  padding-top: var(--topbar);
  padding-left: var(--rail);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.22;
  color: var(--text);
}

h1 { font-size: 40px; line-height: 48px; font-weight: 900; }
h2 { font-size: 26px; line-height: 32px; }
h3 { font-size: 19px; line-height: 26px; font-weight: 700; }
h4 { font-size: 16px; line-height: 24px; font-weight: 700; }

p { font-size: 16px; line-height: 28px; }

code, kbd, samp, .mono, .num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}

::selection { background: var(--signal); color: var(--on-amber); }

/* ---------- 焦点 ---------- */
:focus-visible {
  outline: 3px solid var(--signal);
  outline-offset: 2px;
}

/* ---------- 跳至主内容 ---------- */
.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  z-index: 200;
  display: inline-block;
  padding: 10px 18px;
  background: var(--signal);
  color: var(--on-amber);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 14px;
  transform: translateY(-120%);
  transition: transform 120ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
  outline-offset: 0;
}

/* ============================================================
   顶部细条
   ============================================================ */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--topbar);
  z-index: 100;
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.hdr-inner {
  height: var(--topbar);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 0 20px 0 24px;
}

.hdr-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  white-space: nowrap;
}

.hdr-mark {
  display: block;
  width: 22px;
  height: 3px;
  flex: 0 0 22px;
  background: var(--signal);
}

.hdr-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 16px;
  letter-spacing: 0.02em;
  color: var(--text);
}

.hdr-note {
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  padding-left: 12px;
  border-left: 1px solid var(--line);
  letter-spacing: 0.02em;
}

.hdr-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.hdr-index {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--violet);
}

.hdr-cta {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 14px;
  background: var(--signal);
  color: var(--on-amber);
  font-family: var(--font-head);
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.hdr-cta:hover { background: var(--haze); }

/* 移动目录按钮 */
.nav-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.04em;
  transition: border-color 120ms var(--ease), color 120ms var(--ease);
}

.nav-toggle:hover { border-color: var(--signal); color: var(--signal); }

.nav-toggle-icon {
  display: block;
  width: 14px;
  height: 9px;
  border-top: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
}

.nav-toggle[aria-expanded="true"] {
  border-color: var(--signal);
  color: var(--signal);
}

/* 滚动进度 */
.scroll-meter {
  position: absolute;
  left: 0;
  bottom: 0;
  display: block;
  width: 100%;
  height: 2px;
  background: var(--signal);
  transform: scaleX(0);
  transform-origin: 0 50%;
  will-change: transform;
}

/* ============================================================
   侧边轨道导航
   ============================================================ */
.rail {
  position: fixed;
  top: var(--topbar);
  left: 0;
  bottom: 0;
  width: var(--rail);
  z-index: 90;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--panel);
  border-right: 1px solid var(--line);
  padding: 14px 0 14px;
  overflow: hidden;
  transition: width 180ms var(--ease), background 180ms var(--ease);
}

.rail-head {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--violet);
  padding: 0 20px 12px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}

.rail-list {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.rail-item { flex: 0 0 auto; }

.rail-link,
.rail-back {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 14px 0 15px;
  white-space: nowrap;
  overflow: hidden;
  border-left: 3px solid transparent;
  color: var(--muted);
  transition: border-color 120ms var(--ease),
              background-color 120ms var(--ease),
              color 120ms var(--ease);
}

.rail-num {
  flex: 0 0 28px;
  width: 28px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  transition: color 120ms var(--ease);
}

.rail-label {
  font-size: 14px;
  line-height: 1;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 120ms var(--ease);
}

.rail-link:hover,
.rail-back:hover {
  background: rgba(255, 122, 41, 0.08);
  border-left-color: var(--signal);
  color: var(--text);
}

.rail-link:hover .rail-num,
.rail-back:hover .rail-num { color: var(--signal); }

.rail-link[aria-current="page"] {
  background: rgba(255, 122, 41, 0.13);
  border-left-color: var(--signal);
  color: var(--text);
}

.rail-link[aria-current="page"] .rail-num { color: var(--signal); }

.rail-link[aria-current="page"] .rail-label {
  font-family: var(--font-head);
  font-weight: 800;
}

.rail-link[aria-current="page"]::after {
  content: "";
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--signal);
}

.rail-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: 10px;
}

.rail-back { color: var(--haze); }
.rail-back .rail-num { color: var(--signal); }

/* 桌面端：悬停 / 键盘聚焦展开 */
@media (min-width: 901px) {
  .rail:hover,
  .rail:focus-within { width: var(--rail-open); }

  .rail:hover .rail-label,
  .rail:focus-within .rail-label { opacity: 1; }

  .rail:hover .rail-head,
  .rail:focus-within .rail-head { opacity: 1; }
}

/* ============================================================
   页脚
   ============================================================ */
.site-footer {
  position: relative;
  margin-top: 96px;
  background: var(--ink);
  border-top: 1px solid var(--line);
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 0;
  width: 120px;
  height: 3px;
  background: var(--signal);
}

.ft-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 56px 32px 28px;
}

.ft-grid {
  display: grid;
  grid-template-columns: 4fr 2fr 2fr 2fr;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.ft-mark {
  display: block;
  width: 28px;
  height: 3px;
  background: var(--signal);
  margin-bottom: 14px;
}

.ft-name {
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 20px;
  line-height: 28px;
  color: var(--text);
}

.ft-desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 22px;
  color: var(--muted);
  max-width: 30em;
}

.ft-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--violet);
  margin-bottom: 14px;
}

.ft-list { display: flex; flex-direction: column; gap: 8px; }

.ft-link {
  font-size: 14px;
  line-height: 22px;
  color: var(--muted);
  border-bottom: 1px solid transparent;
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}

.ft-link:hover {
  color: var(--signal);
  border-bottom-color: var(--signal);
}

.ft-contact {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 2fr 10fr;
  gap: 32px;
  align-items: start;
}

.ft-contact .ft-title { margin-bottom: 0; }

.ft-contact-line {
  font-size: 13px;
  line-height: 22px;
  color: var(--muted);
}

.ft-contact-line + .ft-contact-line { margin-top: 4px; }

.ft-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 24px;
  padding-top: 20px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.ft-icp { color: var(--haze); }
.ft-domain { color: var(--line); }

/* ============================================================
   回到顶部
   ============================================================ */
.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 95;
  height: 36px;
  padding: 0 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 180ms var(--ease),
              transform 180ms var(--ease),
              visibility 180ms var(--ease),
              border-color 120ms var(--ease),
              color 120ms var(--ease);
}

.to-top[data-visible] {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.to-top:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* ============================================================
   通用容器与排版件
   ============================================================ */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 32px;
}

.prose { max-width: 38em; }

.prose p + p { margin-top: 1em; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--signal);
  display: block;
  margin-bottom: 12px;
}

.lede {
  font-size: 17px;
  line-height: 30px;
  color: var(--haze);
  max-width: 38em;
}

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

.muted { color: var(--muted); }
.text-amber { color: var(--signal); }
.text-violet { color: var(--violet); }
.text-teal { color: var(--teal); }

/* 网格 */
.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 24px;
}

.col-4 { grid-column: span 4; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-12 { grid-column: span 12; }

/* ============================================================
   按钮
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 1px solid var(--line);
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  transition: background-color 120ms var(--ease),
              border-color 120ms var(--ease),
              color 120ms var(--ease);
}

.btn--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--on-amber);
}

.btn--signal:hover { background: var(--haze); border-color: var(--haze); }

.btn--ghost {
  background: transparent;
  color: var(--text);
}

.btn--ghost:hover {
  border-color: var(--signal);
  color: var(--signal);
}

/* ============================================================
   面包屑
   ============================================================ */
.crumbs {
  padding: 20px 0 0;
}

.crumbs-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.crumbs-item { display: inline-flex; align-items: center; gap: 8px; }

.crumbs-item + .crumbs-item::before {
  content: "/";
  color: var(--line);
}

.crumbs-item a {
  color: var(--muted);
  transition: color 120ms var(--ease);
}

.crumbs-item a:hover { color: var(--signal); }

.crumbs-item [aria-current="page"] { color: var(--haze); }

/* ============================================================
   面板（堆叠画板）
   ============================================================ */
.panel {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 32px;
  transition: border-color 120ms var(--ease), transform 180ms var(--ease);
}

.panel::after {
  content: "";
  position: absolute;
  inset: 8px -8px -8px 8px;
  border: 1px solid var(--line);
  opacity: 0.45;
  pointer-events: none;
}

.panel > * { position: relative; z-index: 1; }

.panel:hover {
  border-color: var(--signal);
  transform: translateY(-2px);
}

.panel:hover .panel-num { color: var(--signal); }

.panel--paper {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--on-amber);
}

.panel--paper h1,
.panel--paper h2,
.panel--paper h3,
.panel--paper h4 { color: var(--on-amber); }

.panel--paper .muted,
.panel--paper p { color: #3C4A57; }

.panel--paper .panel-num { color: #6C7B89; }

.panel--paper::after { border-color: rgba(16, 24, 32, 0.18); }

.panel--paper:hover { border-color: var(--signal); }

.panel--with-marginalia { padding-left: 88px; }

.panel-num {
  position: absolute;
  top: 14px;
  left: 16px;
  z-index: 2;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--muted);
  transition: color 120ms var(--ease);
}

.panel--with-marginalia .panel-num { left: 16px; }

/* 旁注带 */
.marginalia {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 56px;
  border-right: 1px solid var(--line);
  overflow: hidden;
  z-index: 1;
}

.marginalia > span {
  display: block;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  margin: 20px auto 0;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--muted);
  transition: transform 120ms var(--ease), opacity 120ms var(--ease);
}

.panel--paper .marginalia { border-right-color: rgba(16,24,32,.16); }
.panel--paper .marginalia > span { color: #6C7B89; }

.panel:hover .marginalia > span {
  transform: rotate(180deg) translateY(-6px);
  color: var(--signal);
}

/* 章节错位 */
.stagger-r { margin-left: 24px; }
.stagger-l { margin-right: 24px; }

/* ============================================================
   锚点索引
   ============================================================ */
.anchor-index {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-left: 1px solid var(--line);
  padding-left: 0;
}

.anchor-link {
  display: block;
  padding: 8px 14px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-left: 3px solid transparent;
  margin-left: -1px;
  transition: color 120ms var(--ease), border-color 120ms var(--ease);
}

.anchor-link:hover { color: var(--text); border-left-color: var(--violet); }

.anchor-link[aria-current="true"] {
  color: var(--signal);
  border-left-color: var(--signal);
}

/* ============================================================
   标签与状态
   ============================================================ */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 10px;
  background: rgba(255, 216, 188, 0.12);
  border: 1px solid rgba(255, 216, 188, 0.28);
  color: var(--haze);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  white-space: nowrap;
}

.tag--violet {
  background: rgba(124, 92, 255, 0.14);
  border-color: rgba(124, 92, 255, 0.4);
  color: #C4B6FF;
}

.tag--teal {
  background: rgba(31, 199, 166, 0.12);
  border-color: rgba(31, 199, 166, 0.36);
  color: #7FE6D2;
}

.tag--signal {
  background: var(--signal);
  border-color: var(--signal);
  color: var(--on-amber);
  font-weight: 700;
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  background: var(--teal);
  flex: 0 0 7px;
}

.dot--violet { background: var(--violet); }
.dot--signal { background: var(--signal); }

/* ============================================================
   图像容器
   ============================================================ */
.media {
  position: relative;
  display: block;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  overflow: hidden;
}

.media > img,
.media > svg,
.media > video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.media--16x9 { aspect-ratio: 16 / 9; }
.media--4x3  { aspect-ratio: 4 / 3; }
.media--3x2  { aspect-ratio: 3 / 2; }
.media--1x1  { aspect-ratio: 1 / 1; }
.media--auto { aspect-ratio: auto; }

.media-caption {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  line-height: 18px;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.media-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--panel);
  background-image:
    linear-gradient(to right, rgba(36, 64, 92, 0.4) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(36, 64, 92, 0.4) 1px, transparent 1px);
  background-size: 22px 22px;
  color: var(--line);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.2em;
}

/* ============================================================
   响应式
   ============================================================ */
@media (max-width: 1100px) {
  .ft-grid { grid-template-columns: 3fr 2fr 2fr 2fr; gap: 24px; }
}

@media (max-width: 900px) {
  body {
    padding-left: 0;
    background-size: 48px 48px;
  }

  h1 { font-size: 30px; line-height: 38px; }
  h2 { font-size: 22px; line-height: 30px; }
  h3 { font-size: 17px; line-height: 25px; }

  .hdr-inner { padding: 0 16px; }
  .hdr-note { display: none; }
  .hdr-index { display: none; }
  .nav-toggle { display: inline-flex; }

  .rail {
    top: var(--topbar);
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    padding: 20px 0 24px;
    border-right: 0;
    background: var(--ink);
    overflow-y: auto;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 240ms var(--ease), visibility 240ms var(--ease);
  }

  .rail[data-open] {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
  }

  .rail-head,
  .rail-label { opacity: 1; }

  .rail-head { padding: 0 22px 10px; }

  .rail-link,
  .rail-back {
    height: 54px;
    padding: 0 22px 0 19px;
    border-left-width: 4px;
  }

  .rail-label {
    font-family: var(--font-head);
    font-weight: 700;
    font-size: 16px;
  }

  .rail-num { flex-basis: 34px; width: 34px; }

  .wrap { padding: 0 20px; }

  .grid-12 { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
  .col-4, .col-5, .col-7, .col-8 { grid-column: span 6; }

  .panel { padding: 24px 20px; }
  .panel--with-marginalia { padding-left: 60px; }
  .panel-num { top: 10px; left: 12px; }

  .marginalia { width: 38px; }
  .marginalia > span { font-size: 9px; letter-spacing: 0.16em; margin-top: 14px; }

  .stagger-r { margin-left: 12px; }
  .stagger-l { margin-right: 12px; }

  .ft-inner { padding: 40px 20px 24px; }
  .ft-grid { grid-template-columns: 1fr 1fr; gap: 28px 20px; }
  .ft-brand { grid-column: 1 / -1; }
  .ft-contact { grid-template-columns: 1fr; gap: 12px; padding: 20px 0; }

  .to-top { right: 16px; bottom: 16px; }
}

@media (max-width: 560px) {
  .hdr-name { font-size: 15px; }
  .hdr-cta { height: 30px; padding: 0 10px; font-size: 12px; }
  .nav-toggle-text { display: none; }
  .nav-toggle { padding: 0 10px; }

  .ft-grid { grid-template-columns: 1fr; gap: 24px; }

  .grid-12 { grid-template-columns: 1fr; }
  .col-4, .col-5, .col-7, .col-8, .col-12 { grid-column: span 1; }

  .btn { width: 100%; }
}

/* ---------- 降低动态 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .panel:hover { transform: none; }
  .panel:hover .marginalia > span { transform: rotate(180deg); }
  .to-top { transform: none; }
  .to-top[data-visible] { transform: none; }
}
