@charset "UTF-8";
/* ==========================================================================
   thehorizon.cn 视觉系统
   --------------------------------------------------------------------------
   配套页面：design/index.html（浏览器直接打开即可预览）
   对应主题：../thehorizon-child/ — theme.json 中保存同一套色板与字号
   标记约定：<span class="todo">【待填：…】</span> 表示需要补真实内容

   目录
   1. 设计令牌      2. 基础样式      3. 顶栏
   4. 首屏雪山带    5. 章节导轨      6. 区块与行
   7. 空状态        8. 联系与页脚    9. 响应式与动效
   ========================================================================== */

/* ---------- 1. 设计令牌 ---------- */
:root {
  /* 色板：主色取自首页雪山照片的深蓝 */
  --ink:           #071B2C;  /* 首屏遮罩、页脚最深底 */
  --blue:          #0F2A43;  /* 主色：深色区块底 */
  --blue-mid:      #1E4B6E;  /* 深底上的分隔线与次级面 */
  --accent:        #5BC0BE;  /* 强调色：只用于深底、聚焦环、当前项标尺 */
  --accent-deep:   #186F78;  /* 强调色在浅底上的可读版本（5.7:1） */

  --paper:         #FBFCFD;  /* 页面底色，冷白 */
  --paper-alt:     #EFF4F8;  /* 交替区块底色 */
  --rule:          #D6E0E8;  /* 浅底发丝线 */

  --text:          #14202B;
  --muted:         #5D7183;
  --on-dark:       #E8EEF4;
  --on-dark-muted: #9DB2C4;

  /* 字族：一种正文字族 + 一种等宽字族。
     等宽只用于编号、日期、标签这类元信息，不承担标题层级。 */
  --font-sans: "PingFang SC", "Hiragino Sans GB", "Noto Sans SC",
               "Source Han Sans SC", "Microsoft YaHei", system-ui,
               -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  /* 字号：正文 17px 起，1.25 倍级差 */
  --t-xs:   0.8125rem;
  --t-sm:   0.9375rem;
  --t-base: 1.0625rem;
  --t-lg:   1.3125rem;
  --t-xl:   1.75rem;
  --t-2xl:  2.25rem;
  --t-hero: clamp(2.5rem, 6.5vw, 4.5rem);

  /* 版式 */
  --rail:     136px;
  --header-h: 58px;
  --gap-sec:  clamp(3.5rem, 7vw, 6rem);
  --measure:  68ch;
  --focus:    2px;
}

/* ---------- 2. 基础样式 ---------- */
*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background-color: var(--ink);
  background-image:
    linear-gradient(180deg, rgba(7, 27, 44, 0.38), rgba(7, 27, 44, 0.72)),
    url("images/charles-scroll-background.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--t-base);
  line-height: 1.75;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.02em; line-height: 1.25; }
p  { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; }

a { color: var(--accent-deep); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 2px; }

:focus-visible {
  outline: var(--focus) solid var(--accent-deep);
  outline-offset: 3px;
  border-radius: 1px;
}
.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;
}
.site-head :focus-visible,
.hero :focus-visible,
.site-foot :focus-visible { outline-color: var(--accent); }

/* 版心容器：所有横向对齐都基于它 */
.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: clamp(20px, 4vw, 40px);
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 50;
  padding: 10px 16px;
  background: var(--blue);
  color: var(--on-dark);
}
.skip:focus { left: 12px; top: 12px; }

/* 待填标记：虚线 + 冷青底，在页面上不可能被忽略 */
.todo {
  color: var(--accent-deep);
  background: rgba(91, 192, 190, 0.14);
  border-bottom: 1px dashed rgba(24, 111, 120, 0.5);
  padding: 0 0.2em;
}

/* 稿件说明条：只存在于设计稿，不进 WordPress 主题 */
.draft-note {
  background: var(--blue);
  color: var(--on-dark-muted);
  font-size: var(--t-sm);
}
.draft-note .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  align-items: center;
  padding-block: 12px;
}
.draft-note strong { color: var(--on-dark); font-weight: 600; }
.draft-note code {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--accent);
}

/* ---------- 3. 顶栏 ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  /* 吸顶栏减负：模糊半径 12px → 6px，底色加深补回可读性。
     position: sticky 配 backdrop-filter 在快速滚动时最容易出现渲染错位。 */
  background: rgba(251, 252, 253, 0.94);
  -webkit-backdrop-filter: saturate(150%) blur(6px);
  backdrop-filter: saturate(150%) blur(6px);
  border-bottom: 1px solid var(--rule);
}
.site-head .wrap {
  position: relative;
  height: 100%;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
}
.brand {
  grid-column: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-weight: 650;
  letter-spacing: -0.03em;
  color: var(--text);
  font-size: var(--t-lg);
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  object-fit: cover;
}
.brand:hover { text-decoration: none; color: var(--accent-deep); }

.head-links {
  grid-column: 2;
  justify-self: center;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--t-sm);
  white-space: nowrap;
}
.head-links a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--muted);
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.head-links a:hover {
  color: var(--text);
  background: rgba(7, 27, 44, 0.05);
  text-decoration: none;
}
.head-links a[aria-current],
.head-links .is-primary {
  color: var(--accent-deep);
  background: rgba(7, 27, 44, 0.08);
  font-weight: 600;
}

/* ---------- 4. 首屏雪山带 ---------- */
/* 首屏占满一屏：整屏高度扣掉吸顶导航的高度，进来第一眼就是整幅雪山。
   用 svh（小视口高度）而不是 vh，避免移动端地址栏收起/展开时高度跳变；
   前一行 vh 是不支持 svh 时的回退。 */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: flex;
  align-items: center;
  background-color: var(--blue);
  /* 两层：上层是照片，下层是"没有照片"时的天光。
     下层用竖直的天光衰减（冷蓝 → 深蓝 → 墨蓝），照片加载不出来时
     首屏仍然是一条完整的地平线，是一个设计好的状态，不是坏了的样子。 */
  background-image:
    url("images/charles-mountains.jpg"),
    linear-gradient(180deg, var(--blue-mid) 0%, var(--blue) 38%, var(--ink) 100%);
  background-size: cover;
  /* 照片是 4:3，首屏横带约 3.13:1，只能看到照片 43% 的高度，所以纵向位置很关键。
     55% 这一档：上方是亮天光 #4672BA，下方是深山体 #213A64，明暗跨度最大，
     名字压在深的那一头。照片最下方 10% 那条横贯全宽的亮带（云海或雪原）
     在 100% 处才会进画面，但那里正好是名字的位置，会被遮罩压掉，所以不取。 */
  background-position: center 55%;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
              rgba(7, 27, 44, 0.30) 0%,
              rgba(7, 27, 44, 0.52) 52%,
              rgba(7, 27, 44, 0.88) 100%);
}
.hero .wrap {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  padding-block: clamp(32px, 5vw, 56px);
}
.hero-content {
  width: min(100%, 720px);
  margin-inline: auto;
  text-align: center;
  transform-style: preserve-3d;
  transform-origin: center center;
  will-change: transform;
  transition: transform 80ms linear;
}

.hero-name {
  font-size: var(--t-hero);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.98;
  color: #FFFFFF;
  margin-bottom: 18px;
}
.hero-role {
  font-size: var(--t-lg);
  color: var(--on-dark);
  margin-bottom: 20px;
}
.hero-role .sep { color: var(--blue-mid); padding-inline: 6px; }

/* 三个内容方向：用发丝线分隔的横向词条，不是彩色标签 */
.hero-dirs {
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0 clamp(14px, 3vw, 30px);
  font-size: var(--t-sm);
  color: var(--on-dark-muted);
}
.hero-dirs li { display: flex; align-items: center; gap: 8px; list-style: none; }
.hero-dirs li + li::before {
  content: "";
  width: 1px;
  height: 14px;
  background: var(--blue-mid);
}
.hero-dirs a {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  color: inherit;
  transition: color 180ms ease, background-color 180ms ease, transform 180ms ease;
}
.hero-dirs a:hover {
  transform: translateY(-1px);
  color: var(--on-dark);
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
}

/* 地平线：压在照片下缘的一根发丝线，左侧一小段冷青刻度。
   它是首屏唯一的动效，一次性画开。 */
.hero-line {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: rgba(232, 238, 244, 0.28);
  transform-origin: left center;
}
.hero-line::before {
  content: "";
  position: absolute;
  left: 0;
  top: -1px;
  width: clamp(72px, 14vw, 168px);
  height: 3px;
  background: var(--accent);
}

/* ---------- 5. 章节导轨 ---------- */
main { padding-block: var(--gap-sec) 0; }
main > .wrap {
  display: block;
}

.rail {
  position: sticky;
  top: calc(var(--header-h) + 32px);
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  border-radius: 10px;
  background: rgba(251, 252, 253, 0.78);
  box-shadow: 0 14px 38px rgba(7, 27, 44, 0.18);
  -webkit-backdrop-filter: blur(16px) saturate(135%);
  backdrop-filter: blur(16px) saturate(135%);
}
.rail-title {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--muted);
  letter-spacing: 0.02em;
  margin-bottom: 14px;
}
.rail ol { list-style: none; }
.rail a {
  display: block;
  padding: 7px 0 7px 12px;
  border-left: 1px solid var(--rule);
  font-size: var(--t-sm);
  color: var(--muted);
  line-height: 1.4;
}
.rail a:hover { color: var(--accent-deep); text-decoration: none; border-left-color: var(--muted); }
.rail a[aria-current="true"] {
  color: var(--text);
  font-weight: 550;
  border-left: 2px solid var(--accent-deep);
  padding-left: 11px;
}

.col {
  width: 100%;
  max-width: 860px;
  min-width: 0;
  margin-inline: auto;
}

/* ---------- 6. 区块与行 ---------- */
.sec {
  margin-bottom: clamp(28px, 5vw, 54px);
  padding: clamp(24px, 4vw, 42px);
  scroll-margin-top: calc(var(--header-h) + 24px);
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 12px;
  /* 这里原本有 backdrop-filter: blur(18px) saturate(135%)。
     快速滚动时整块会短暂显得变宽 —— 那是 backdrop-filter 的合成层在滚动中
     用旧的边界重新栅格化造成的。去掉滤镜、把底色加深来补回可读性，
     视觉几乎一致，但不再有那一层要逐帧重算的模糊。 */
  background: rgba(251, 252, 253, 0.93);
  box-shadow: 0 18px 50px rgba(7, 27, 44, 0.18);
  transition: transform 240ms ease, border-color 240ms ease,
              box-shadow 240ms ease, background-color 240ms ease;
}

@media (hover: hover) and (pointer: fine) {
  .sec:hover {
    transform: translateY(-5px);
    border-color: rgba(91, 192, 190, 0.76);
    background: rgba(251, 252, 253, 0.91);
    box-shadow:
      0 26px 70px rgba(7, 27, 44, 0.28),
      0 0 0 1px rgba(91, 192, 190, 0.16);
  }
}

/* 区块标题：发丝线在上，等宽编号挂左侧，标题左对齐。
   编号只出现一次——导轨里只放名字，避免同一信息说两遍。 */
.sec-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule);
  margin-bottom: clamp(20px, 3vw, 32px);
}
.sec-head .idx {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  font-weight: 500;
  color: var(--accent-deep);
  flex: none;
}
.sec-head h2 { font-size: var(--t-xl); }
.sec-head .note { margin-left: auto; font-size: var(--t-sm); color: var(--muted); }

.lede { font-size: var(--t-lg); line-height: 1.62; color: var(--text); }
.muted { color: var(--muted); }
.small { font-size: var(--t-sm); }

/* 事实表：标签 / 取值两列，靠发丝线成行，不用卡片包裹 */
.facts { margin-top: 8px; }
.facts div {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid var(--rule);
  font-size: var(--t-sm);
}
.facts dt, .facts .k { color: var(--muted); }

/* 项目 / 文章 / 生活：统一的"行"结构，靠发丝线分隔而不是浮动卡片 */
.rows { list-style: none; }
.row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px 24px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
}
.rows .row:last-child { border-bottom: 1px solid var(--rule); }
.row h3 { font-size: var(--t-lg); font-weight: 600; grid-column: 1; }
.row .meta {
  grid-column: 2;
  grid-row: 1;
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--muted);
  white-space: nowrap;
  padding-top: 5px;
}
.row p { grid-column: 1 / -1; margin: 0; font-size: var(--t-sm); color: var(--muted); }
.row ul.stack {
  grid-column: 1 / -1;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-size: var(--t-sm);
  color: var(--muted);
}
.row ul.stack li { display: flex; align-items: baseline; gap: 7px; }
.row ul.stack li::before {
  content: "";
  width: 5px;
  height: 5px;
  flex: none;
  background: var(--rule);
  transform: translateY(-2px);
}

/* 区块内的次级小标题：用于"在做的事""在学的主题"这类分组 */
.subhead {
  font-family: var(--font-mono);
  font-size: var(--t-xs);
  color: var(--muted);
  margin: clamp(28px, 4vw, 40px) 0 4px;
}

/* ---------- 7. 空状态 ---------- */
/* 没有内容的栏目如实说明，并给出下一步动作，不摆假数据 */
.empty {
  border: 1px dashed var(--rule);
  border-radius: 2px;
  padding: clamp(22px, 3vw, 30px);
  background: rgba(239, 244, 247, 0.58);
}
.empty h3 { font-size: var(--t-base); font-weight: 600; margin-bottom: 8px; }
.empty p { margin: 0 0 14px; font-size: var(--t-sm); color: var(--muted); }
.empty p:last-child { margin-bottom: 0; }

/* 首页文章文件夹筛选：先选择文件夹，再看该文件夹最近五篇。 */
.home-article-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 24px;
}
.home-filter-item {
  appearance: none;
  border: 1px solid rgba(7, 27, 44, 0.13);
  border-radius: 999px;
  padding: 9px 16px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--muted);
  font: 600 var(--t-sm)/1.3 var(--font-sans);
  cursor: pointer;
  transition: color 180ms ease, background-color 180ms ease,
              border-color 180ms ease, transform 180ms ease,
              box-shadow 180ms ease;
}
.home-filter-item:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 192, 190, 0.72);
  color: var(--text);
  box-shadow: 0 8px 18px rgba(7, 27, 44, 0.10);
}
.home-filter-item.is-active {
  border-color: var(--accent-deep);
  background: var(--accent-deep);
  color: #fff;
  box-shadow: 0 8px 18px rgba(24, 111, 120, 0.22);
}
.home-filter-item:focus-visible { outline-offset: 2px; }

.article-previews {
  display: grid;
  gap: 14px;
  margin-top: clamp(24px, 4vw, 36px);
}
.article-category-group { min-width: 0; }
.article-category-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 12px;
  color: var(--text);
  font-size: var(--t-base);
  font-weight: 650;
}
.article-category-heading::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--rule);
}
.article-category-items { display: grid; gap: 14px; }
.article-preview {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  overflow: hidden;
  min-height: 176px;
  border: 1px solid rgba(7, 27, 44, 0.13);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.66);
  color: var(--text);
  box-shadow: 0 12px 30px rgba(7, 27, 44, 0.07);
  transition: transform 220ms ease, border-color 220ms ease, box-shadow 220ms ease;
}
.article-preview[hidden] { display: none; }
.article-preview:hover {
  transform: translateY(-5px);
  border-color: rgba(91, 192, 190, 0.72);
  box-shadow: 0 22px 46px rgba(7, 27, 44, 0.16);
  text-decoration: none;
}
.article-preview-cover {
  width: 100%;
  height: 100%;
  min-height: 176px;
  object-fit: cover;
  transition: transform 320ms ease;
}
.article-preview:hover .article-preview-cover { transform: scale(1.035); }
.article-preview-content {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 18px 22px;
}
.article-preview-meta {
  display: flex;
  align-items: center;
  /* 不用 space-between：浏览次数是 JS 后插进来的第三个元素，
     用 flex-start + time 的自动左边距，加不加「浏览次数」都保持「分类靠左、日期靠右」 */
  justify-content: flex-start;
  gap: 16px;
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: var(--t-xs);
}
.article-preview-meta > time { margin-left: auto; }
/* 浏览次数：由 /views.js 异步填入，取不到就不显示 */
.article-views { white-space: nowrap; opacity: 0.9; }
.article-preview-category {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(24, 111, 120, 0.10);
  color: var(--accent-deep);
  font-family: var(--font-sans);
  font-weight: 650;
}
.article-preview-content > strong {
  margin-top: 10px;
  font-size: var(--t-lg);
  line-height: 1.25;
}
.article-preview-summary {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: var(--t-sm);
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.article-preview-action {
  margin-top: auto;
  padding-top: 10px;
  color: var(--accent-deep);
  font-size: var(--t-sm);
  font-weight: 650;
}
.home-articles-empty {
  padding: 26px;
  border: 1px dashed rgba(7, 27, 44, 0.2);
  border-radius: 12px;
  color: var(--muted);
  text-align: center;
}
.home-articles-empty[hidden] { display: none; }
.all-articles {
  margin-top: clamp(26px, 4vw, 38px);
  text-align: center;
}
.all-articles a {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: var(--t-sm);
  font-weight: 600;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.all-articles a:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(7, 27, 44, 0.24);
  text-decoration: none;
}

/* 计划中的条目：比正式条目轻，明确标出还没发生 */
.row.is-planned h3 { color: var(--muted); font-weight: 500; }
.row.is-planned .meta { color: var(--accent-deep); }

/* ---------- 8. 联系与页脚 ---------- */
.contact-title h2 { font-size: var(--t-2xl); }
.contact-title::after {
  content: "";
  display: block;
  width: 58px;
  height: 3px;
  margin-top: 16px;
  background: var(--ink);
}
.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(32px, 6vw, 64px);
  margin-top: clamp(34px, 5vw, 52px);
}
.contact-grid h3 { margin-bottom: 22px; font-size: var(--t-lg); }
.contact-form { display: grid; gap: 0; }
.contact-form label { display: block; }
.contact-form input,
.contact-form textarea {
  width: 100%;
  border: 0;
  border-bottom: 1px solid rgba(7, 27, 44, 0.18);
  border-radius: 0;
  padding: 15px 0;
  background: transparent;
  color: var(--text);
  font: inherit;
  outline: 0;
}
.contact-form textarea { min-height: 116px; resize: vertical; }
.contact-form input::placeholder,
.contact-form textarea::placeholder { color: rgba(79, 95, 108, 0.62); }
.contact-form input:focus,
.contact-form textarea:focus { border-bottom-color: var(--ink); }
.contact-form button {
  width: 100%;
  margin-top: 26px;
  border: 0;
  border-radius: 999px;
  padding: 16px 24px;
  background: #050505;
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: transform 180ms ease, box-shadow 180ms ease;
}
.contact-form button:hover { transform: translateY(-2px); box-shadow: 0 12px 24px rgba(7, 27, 44, 0.22); }
.contact-cards { display: grid; gap: 14px; }
.contact-card {
  display: flex;
  align-items: center;
  gap: 15px;
  min-width: 0;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.70);
  box-shadow: 0 12px 30px rgba(7, 27, 44, 0.08);
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}
.contact-copy-button { width: 100%; cursor: pointer; }
.contact-card:hover {
  transform: translateX(4px);
  border-color: rgba(91, 192, 190, 0.62);
  box-shadow: 0 16px 34px rgba(7, 27, 44, 0.15);
  text-decoration: none;
}
.contact-icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 12px;
  background-color: #050505;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 25px;
}
.contact-icon--outlook { background-color: #fff; background-image: url("icons/outlook.svg"); background-size: 34px; }
.contact-icon--github { background-image: url("icons/github.svg"); }
.contact-icon--wechat { background-color: #07c160; background-image: url("icons/wechat.svg"); }
.contact-copy { display: grid; min-width: 0; line-height: 1.35; }
.contact-copy small,
.contact-copy > span { color: var(--muted); font-size: var(--t-xs); }
.contact-copy strong { overflow-wrap: anywhere; font-size: var(--t-sm); }

.site-foot {
  background: var(--ink);
  color: var(--on-dark-muted);
  margin-top: var(--gap-sec);
  padding-block: clamp(36px, 5vw, 52px);
  font-size: var(--t-sm);
}
.site-foot .wrap {
  text-align: center;
}
.site-foot p { margin: 0; }
.site-foot strong { color: var(--on-dark); font-weight: 550; }
.site-foot a {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--on-dark-muted);
  transition: color 180ms ease, background-color 180ms ease;
}
.site-foot a:hover {
  color: var(--on-dark);
  background: rgba(255, 255, 255, 0.09);
  text-decoration: none;
}

/* ---------- 9. 响应式与动效 ---------- */
@media (max-width: 900px) {
  /* 单列：导轨从左侧竖列变成顶栏下方横向吸附条，位置感知不丢 */
  .sec { scroll-margin-top: calc(var(--header-h) + 88px); }
  main > .wrap { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rail {
    position: sticky;
    top: var(--header-h);
    z-index: 10;
    margin-inline: calc(-1 * clamp(20px, 4vw, 40px));
    padding-inline: clamp(20px, 4vw, 40px);
    background: rgba(251, 252, 253, 0.94);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--rule);
  }
  .rail-title { display: none; }
  .rail ol {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-block: 11px;
  }
  .rail ol::-webkit-scrollbar { display: none; }
  .rail a {
    white-space: nowrap;
    padding: 2px 0;
    border-left: 0;
    border-bottom: 2px solid transparent;
  }
  .rail a[aria-current="true"] { border-left: 0; border-bottom-color: var(--accent-deep); padding-left: 0; }
  .col { padding-top: clamp(28px, 6vw, 44px); }
}

@media (max-width: 620px) {
  .sec { padding: 22px 18px; }
  .sec-head { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: baseline; }
  .sec-head .note { grid-column: 2; margin-left: 0; }
  .article-preview { grid-template-columns: minmax(0, 1fr); }
  .article-preview-cover { height: 160px; min-height: 160px; }
  .row { grid-template-columns: minmax(0, 1fr); }
  .row .meta { grid-column: 1; grid-row: auto; padding-top: 0; }
  .row h3 { margin-bottom: 2px; }
  .facts div { grid-template-columns: 76px minmax(0, 1fr); gap: 12px; }
  .hero-role { font-size: var(--t-base); }
  .hero-dirs li + li::before { display: none; }
  .hero-dirs { gap: 6px 18px; }
}

@media (max-width: 760px) {
  :root { --header-h: 96px; }
  .site-head .wrap {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 44px 52px;
    gap: 0;
  }
  .brand { grid-column: 1; grid-row: 1; }
  .head-links {
    grid-column: 1;
    grid-row: 2;
    justify-self: stretch;
    justify-content: center;
    gap: 18px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .head-links::-webkit-scrollbar { display: none; }
  .contact-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .head-links { justify-content: flex-start; }
}

@media (prefers-reduced-motion: reduce) {
  .sec { transition: none; }
  .sec:hover { transform: none; }
  .contact-card:hover,
  .contact-form button:hover { transform: none; }
}

/* 首屏一次性入场：地平线画开 + 文字抬起。整页只有这一处动效。 */
@media (prefers-reduced-motion: no-preference) {
  .hero-line { animation: draw-line 900ms cubic-bezier(0.22, 0.61, 0.36, 1) 120ms both; }
  .hero-name { animation: rise 700ms cubic-bezier(0.22, 0.61, 0.36, 1) 240ms both; }
  .hero-role { animation: rise 700ms cubic-bezier(0.22, 0.61, 0.36, 1) 340ms both; }
  .hero-dirs { animation: rise 700ms cubic-bezier(0.22, 0.61, 0.36, 1) 420ms both; }
}
@keyframes draw-line { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* 项目卡片：沿用文章卡片的横向结构，多一段简介和两个入口按钮 */
.project-preview { min-height: 200px; }
.project-preview .article-preview-summary { -webkit-line-clamp: 3; }
.project-actions {
  position: relative;
  z-index: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: auto;
  padding-top: 16px;
  pointer-events: none;
}
.project-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  /* 两个按钮文案长度不同，靠 min-width 让它们等宽 */
  min-width: 140px;
  border: 1px solid rgba(7, 27, 44, 0.13);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.58);
  color: var(--accent-deep);
  font-size: var(--t-sm);
  font-weight: 650;
  text-decoration: none;
  pointer-events: auto;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease;
}
.project-action:hover {
  transform: translateY(-2px);
  border-color: rgba(91, 192, 190, 0.72);
  text-decoration: none;
}
/* 「在线 Demo」与「代码仓库」同色同尺寸，只是 href 不同 */
.project-action--demo,
.project-action--repo {
  border-color: transparent;
  background: var(--accent-deep);
  color: #fff;
}
.project-action--demo:hover,
.project-action--repo:hover { background: #12565D; color: #fff; }

/* 整卡可点：标题上的链接铺满整张卡片，卡内其他链接靠 z-index 浮在覆盖层之上 */
.article-preview { position: relative; }
.card-link { color: inherit; text-decoration: none; }
/* 必须显式写 :hover —— 全局 a:hover 的优先级 (0,1,1) 高于 .card-link (0,1,0)，
   只写 .card-link 的话鼠标移上去标题会出现下划线。 */
.card-link:hover { text-decoration: none; }
.card-link::after { content: ""; position: absolute; inset: 0; z-index: 1; }
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after {
  outline: 2px solid var(--accent-deep);
  outline-offset: 2px;
  border-radius: 14px;
}

/* 没有封面图时收掉左侧那一栏，卡片变成纯文字 */
.article-preview--no-cover { grid-template-columns: minmax(0, 1fr); }
