/* ============================================================
   简 · 个人官网 MVP
   设计方向：极简编辑风打底 + AI 分身对话面板做唯一记忆点
   ============================================================ */

:root {
  /* 色板 —— 浅色（编辑风） */
  --bg:        #F7F5F0;
  --bg-elev:   #FFFFFF;
  --ink:       #14110E;
  --ink-2:     #6B6560;
  --ink-3:     #6E6862;   /* 对比度 5.05:1 —— 原 #9C948C 仅 2.74:1，未达 WCAG AA */
  --line:      #E5E0D8;
  --line-2:    #EFEAE2;
  --accent:    #B45309;
  --accent-soft: #F5E9DC;
  /* 强调色按钮上的前景色：浅色主题用白（5.02:1），深色主题必须在 dark 块里改深色 */
  --on-accent: #FFFFFF;
  /* 强调色当作文字压在 --accent-soft 软底上时用的深色变体：
     浅色下 --accent 压软底仅 4.20:1 未达 4.5；此值 5.23:1。
     深色下无需降，沿用 --accent 即可（6.23:1），故 dark 块覆盖回来。 */
  --accent-on-soft: #9A4A0B;

  /* AI 分身（唯一高对比记忆点） */
  --ai-bg:      #0F1115;
  --ai-bubble-ai:#171A20;
  --ai-bubble-me:#1E2A3A;
  --ai-ink:     #E8EAED;
  --ai-ink-2:   #8A9099;
  --ai-line:    #252A33;
  --ai-accent:  #6E8BFF;
  --ai-on-accent: #14110E;  /* #6E8BFF 上白字仅 3.09:1，深色字 6.09:1 */
  --ai-ok:      #3DD6A0;

  /* 字体 */
  --f-serif: "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  --f-sans:  "HarmonyOS Sans SC", "PingFang SC", -apple-system, "Helvetica Neue", Arial, sans-serif;
  --f-mono:  "JetBrains Mono", "SF Mono", ui-monospace, Menlo, monospace;

  /* 排版 */
  --measure: 68ch;
  --r-sm: 6px;
  --r-md: 12px;
  --r-lg: 18px;

  /* 动效 */
  --t-fast: 160ms;
  --t-mid: 260ms;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);

  --shadow-1: 0 1px 2px rgba(20,17,14,.05), 0 8px 24px -12px rgba(20,17,14,.10);
  --shadow-2: 0 2px 6px rgba(20,17,14,.06), 0 24px 60px -24px rgba(20,17,14,.18);

  /* 语义 token（C-17）：遮罩与 AI 气泡上的前景色不再写死色值 */
  /* 命令面板遮罩：浅色主题用暖黑，与 --ink 同族 */
  --overlay: rgba(20, 17, 14, .42);
  /* AI 气泡内的强调文字色：与 --ai-ink 同族，保证深浅都够亮 */
  --on-ai-bubble: #FFFFFF;
  /* AI 气泡内代码块的浅色底纹 */
  --on-ai-bubble-mute: rgba(255, 255, 255, .07);
}

[data-theme="dark"] {
  --bg:      #121110;
  --bg-elev: #1A1816;
  --ink:     #F2EFEA;
  --ink-2:   #A8A19A;
  --ink-3:   #8F8880;   /* 对比度 5.39:1 —— 原 #7A736C 仅 4.04:1 */
  --line:    #2A2724;
  --line-2:  #221F1C;
  --accent:  #E0913A;
  --accent-soft: #2A2117;
  /* 深色主题强调色是亮橙 #E0913A，白字仅 2.54:1；改深色字 7.42:1 */
  --on-accent: #14110E;
  /* 深色下 --accent 压软底已有 6.23:1，不必降 */
  --accent-on-soft: #E0913A;
  --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
  --shadow-2: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px -24px rgba(0,0,0,.7);
  /* 深色主题：遮罩用纯黑压暗更有效；AI 气泡在深底上仍是深色，
     强调文字维持白色以保持与浅色主题一致的层级 */
  --overlay: rgba(0, 0, 0, .42);
  --on-ai-bubble: #FFFFFF;
  --on-ai-bubble-mute: rgba(255, 255, 255, .07);
}

/* 无 JS 兜底：系统偏好暗色时跟随。
   JS 可用时 theme-init.js（子页）/ app.js（首页）会把 data-theme 设为
   具体的 light/dark，本块只命中 data-theme="auto"（即无 JS 状态），不冲突。
   注意：本块与上方 [data-theme="dark"] 的 token 必须保持一致，改一处同步另一处。
   test/run.js 的 nojs-dark 套件会校验两块色值一致。 */
@media (prefers-color-scheme: dark) {
  html[data-theme="auto"] {
    --bg:      #121110;
    --bg-elev: #1A1816;
    --ink:     #F2EFEA;
    --ink-2:   #A8A19A;
    --ink-3:   #8F8880;
    --line:    #2A2724;
    --line-2:  #221F1C;
    --accent:  #E0913A;
    --accent-soft: #2A2117;
    --on-accent: #14110E;
    --accent-on-soft: #E0913A;
    --overlay: rgba(0, 0, 0, .42);
    --on-ai-bubble: #FFFFFF;
    --on-ai-bubble-mute: rgba(255, 255, 255, .07);
    --shadow-1: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -12px rgba(0,0,0,.5);
    --shadow-2: 0 2px 6px rgba(0,0,0,.4), 0 24px 60px -24px rgba(0,0,0,.7);
  }
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease);
}

h1, h2, h3 { font-family: var(--f-serif); font-weight: 700; letter-spacing: -0.01em; margin: 0; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
em { font-style: normal; }
.mono { font-family: var(--f-mono); font-size: .88em; letter-spacing: .02em; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 28px; }

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

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

/* ---------- 阅读进度 ---------- */
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 60; pointer-events: none; }
.progress span {
  display: block; height: 100%; width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--ai-accent));
  transition: width 80ms linear;
}

/* ---------- 导航 ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.6) blur(14px);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav.scrolled { border-bottom-color: var(--line); }

.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 28px;
  height: 64px; display: flex; align-items: center; gap: 24px;
}

.brand { display: inline-flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand-mark {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--ink); color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--f-serif); font-size: 15px; line-height: 1;
  transition: transform var(--t-fast) var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-6deg); }
.brand-text {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; color: var(--ink-2);
}
.brand-text .dot { color: var(--accent); }

.nav-links { display: flex; gap: 4px; margin-left: auto; }
.nav-links a {
  padding: 7px 11px; border-radius: var(--r-sm);
  font-size: 14.5px; color: var(--ink-2);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.nav-links a:hover { color: var(--ink); background: var(--line-2); }
.nav-links a.active { color: var(--accent); }

.nav-tools { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink-2);
  transition: all var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--ink); border-color: var(--ink-3); background: var(--line-2); }

.kbtn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 34px; padding: 0 8px 0 12px;
  background: transparent; border: 1px solid var(--line); border-radius: var(--r-sm);
  font-size: 13.5px; color: var(--ink-2);
  transition: all var(--t-fast) var(--ease);
}
.kbtn:hover { color: var(--ink); border-color: var(--ink-3); }
kbd {
  font-family: var(--f-mono); font-size: 11px; line-height: 1;
  padding: 4px 5px; border-radius: 4px;
  background: var(--line-2); color: var(--ink-2);
  border: 1px solid var(--line);
}

/* ---------- HERO ---------- */
.hero { padding: 88px 28px 72px; }
.hero-grid {
  display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 64px; align-items: start;
}

.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em;
  color: var(--ink-2); margin-bottom: 26px;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--accent); flex-shrink: 0;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 55%, transparent);
  animation: pulse 2.4s var(--ease) infinite;
}
@keyframes pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  70%  { box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
  100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 0%, transparent); }
}

.hero h1 {
  font-size: clamp(2.15rem, 5.2vw, 3.9rem);
  line-height: 1.14; letter-spacing: -0.025em;
  margin-bottom: 26px;
  text-wrap: balance;
}
.br-m { display: none; }
.hero h1 em {
  color: var(--accent);
  border-bottom: 2px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding-bottom: 2px;
  white-space: nowrap;
}

.hero-lede {
  max-width: 56ch; font-size: 17.5px; line-height: 1.78; color: var(--ink-2);
}
.hero-lede strong { color: var(--ink); font-weight: 600; }

.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }

.btn {
  display: inline-flex; align-items: center; gap: 9px;
  height: 46px; padding: 0 22px;
  border-radius: var(--r-sm); border: 1px solid transparent;
  font-size: 15px; font-weight: 500;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { transform: translateY(-1px); box-shadow: var(--shadow-1); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: var(--line);
}
.btn-ghost:hover { border-color: var(--ink-3); background: var(--bg-elev); }
.btn-ghost svg { transition: transform var(--t-fast) var(--ease); }
.btn-ghost:hover svg { transform: translateX(3px); }

.hero-note {
  margin-top: 22px; font-size: 13.5px; color: var(--ink-3);
  display: flex; align-items: center; gap: 7px;
}
.hero-note::before { content: ""; width: 14px; height: 1px; background: var(--ink-3); }

/* 状态卡 */
.status-card {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 22px 22px 17px;
  box-shadow: var(--shadow-1);
  position: sticky; top: 88px;
}
.status-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 13px; margin-bottom: 15px;
  border-bottom: 1px dashed var(--line);
}
.status-label {
  font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em;
  color: var(--accent); font-weight: 600;
}
.status-time { font-family: var(--f-mono); font-size: 13px; color: var(--ink-2); font-variant-numeric: tabular-nums; }

.status-list { display: grid; gap: 12px; }
.status-list li { display: flex; gap: 14px; align-items: baseline; font-size: 14px; }
.status-list .k {
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ink-3);
  width: 62px; flex-shrink: 0; letter-spacing: .04em;
}
.status-list .v { color: var(--ink); line-height: 1.6; }

.status-note {
  margin-top: 16px; padding-top: 13px; border-top: 1px dashed var(--line);
  font-size: 12.5px; line-height: 1.6; color: var(--ink-3);
}

/* ---------- 通用 section ---------- */
.section { padding: 76px 28px; }
.section + .section { border-top: 1px solid var(--line-2); }

.sec-head { margin-bottom: 44px; max-width: 62ch; }
.sec-index {
  font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em;
  color: var(--accent); margin-bottom: 14px;
}
.sec-head h2 {
  font-size: clamp(1.6rem, 3.4vw, 2.35rem);
  line-height: 1.24; letter-spacing: -0.02em; margin-bottom: 12px;
}
.sec-sub { color: var(--ink-2); font-size: 16px; max-width: 56ch; }
.sec-sub strong { color: var(--ink); font-weight: 600; }

/* ---------- 作品 ---------- */
.works-grid {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.work {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 24px 22px 20px;
  display: flex; flex-direction: column;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease);
}
.work:hover {
  transform: translateY(-3px);
  border-color: var(--ink-3);
  box-shadow: var(--shadow-2);
}
.work-top {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.work-no {
  font-family: var(--f-mono); font-size: 12px; color: var(--ink-3); letter-spacing: .08em;
}
.work-tag {
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-on-soft);
  font-weight: 500; letter-spacing: .02em;
}
.work h3 { font-size: 1.16rem; line-height: 1.4; margin-bottom: 11px; }
.work > p:not(.work-metric) { font-size: 14.5px; line-height: 1.72; color: var(--ink-2); margin-bottom: 18px; }

.work-metric {
  font-family: var(--f-mono); font-size: 12.5px; color: var(--ink-2);
  padding: 7px 0; border-top: 1px dashed var(--line);
  display: flex; align-items: baseline; gap: 2px;
}
.work-metric:first-of-type { margin-top: auto; }
.work-metric .num {
  font-family: var(--f-serif); font-size: 1.5rem; font-weight: 700;
  color: var(--ink); letter-spacing: -0.02em;
  margin-right: 7px; font-variant-numeric: tabular-nums;
}
.work-link {
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-2);
  font-size: 13.5px; color: var(--accent); font-weight: 500;
  transition: gap var(--t-fast) var(--ease);
}
.work-link:hover { text-decoration: underline; text-underline-offset: 3px; }


/* ---------- 待填占位（禁止以假数字出现） ---------- */
.ph {
  font-style: italic;
  color: var(--ink-3);
  font-weight: 400;
  font-family: var(--f-sans);
  letter-spacing: 0;
}
.ph-note {
  font-style: italic;
  color: var(--ink-3);
}
.work-metric .ph { font-size: 13px; }

/* ---------- 视点：按访客身份切换自我介绍 ---------- */
.lens {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--bg-elev);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}
.lens-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 12px 12px 0;
  border-bottom: 1px solid var(--line-2);
}
.lens-tabs button {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  padding: 8px 15px;
  font-family: inherit; font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  position: relative; top: 1px;
  transition: all var(--t-fast) var(--ease);
}
.lens-tabs button:hover { color: var(--ink); background: var(--line-2); }
.lens-tabs button[aria-selected="true"] {
  color: var(--ink);
  font-weight: 600;
  background: var(--bg-elev);
  border-color: var(--line-2);
  border-bottom-color: var(--bg-elev);
}
.lens-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.lens-panel { padding: 22px 22px 4px; }
.lens-panel:focus-visible { outline: 2px solid var(--accent); outline-offset: -4px; }
.lens-intro {
  font-size: 15.5px; line-height: 1.82;
  color: var(--ink);
  max-width: var(--measure);
}
.lens-pick {
  margin-top: 12px;
  font-size: 13.5px; color: var(--ink-2);
}
.lens-pick a { color: var(--accent); }
.lens-mock {
  padding: 0 22px 18px;
  margin-top: 12px;
  font-size: 12px; line-height: 1.6; color: var(--ink-3);
}

/* ---------- 按身份下载简历 ---------- */
.resume-pick { display: grid; gap: 8px; }
.resume-label { font-size: 12.5px; color: var(--ink-3); font-family: var(--f-mono); }
.resume-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: stretch; }
.resume-select {
  height: 44px; padding: 0 32px 0 13px;
  font-family: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='13' height='13'%3E%3Cpath d='M6 9l6 6 6-6' fill='none' stroke='%236B6560' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  transition: border-color var(--t-fast) var(--ease);
}
.resume-select:hover { border-color: var(--ink-3); }
.resume-select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.resume-note { font-size: 12px; color: var(--ink-3); }

/* ---------- 能力矩阵 ---------- */
.matrix {
  border: 1px solid var(--line); border-radius: var(--r-md);
  overflow: hidden; background: var(--bg-elev);
}
.matrix-row {
  display: grid; grid-template-columns: 1fr 1.5fr .6fr;
  gap: 24px; padding: 17px 22px; align-items: center;
}
.matrix-row + .matrix-row { border-top: 1px solid var(--line-2); }
.matrix-head {
  background: var(--line-2);
  font-family: var(--f-mono); font-size: 11.5px; letter-spacing: .1em;
  color: var(--ink-3); padding-top: 12px; padding-bottom: 12px;
}
.matrix .m-q { font-weight: 600; font-size: 15px; }
.matrix .m-a { color: var(--ink-2); font-size: 14.5px; }
.matrix .m-e { font-size: 13.5px; text-align: right; }
.matrix .m-e a { color: var(--accent); }
.matrix .m-e a:hover { text-decoration: underline; text-underline-offset: 3px; }
.matrix-row:not(.matrix-head):hover { background: var(--line-2); }

/* ---------- AI 分身 ---------- */
.twin-panel {
  background: var(--ai-bg);
  border-radius: var(--r-lg);
  border: 1px solid var(--ai-line);
  overflow: hidden;
  box-shadow: var(--shadow-2);
  color: var(--ai-ink);
}
.twin-head {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 17px 20px;
  border-bottom: 1px solid var(--ai-line);
  background: linear-gradient(180deg, color-mix(in srgb, var(--ai-accent) 7%, transparent), transparent);
}
.twin-id { display: flex; align-items: center; gap: 12px; }
.twin-avatar {
  width: 34px; height: 34px; border-radius: 9px; flex-shrink: 0;
  display: grid; place-items: center;
  background: color-mix(in srgb, var(--ai-accent) 16%, transparent);
  color: var(--ai-accent);
  border: 1px solid color-mix(in srgb, var(--ai-accent) 26%, transparent);
}
.twin-id strong { display: block; font-size: 14.5px; font-weight: 600; line-height: 1.4; }
.twin-sub { display: block; font-size: 12px; color: var(--ai-ink-2); line-height: 1.5; }

.twin-head-right { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.twin-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--f-mono); font-size: 11.5px; color: var(--ai-ok);
}
.twin-status .live-dot { background: var(--ai-ok); animation: pulse 2.4s var(--ease) infinite; }
.twin-reset {
  background: transparent; border: 1px solid var(--ai-line);
  border-radius: 5px; padding: 4px 10px;
  font-size: 12px; color: var(--ai-ink-2);
  transition: all var(--t-fast) var(--ease);
}
.twin-reset:hover { color: var(--ai-ink); border-color: var(--ai-ink-2); }

.twin-log {
  padding: 22px 20px 6px;
  max-height: 420px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--ai-line) transparent;
}
.twin-log::-webkit-scrollbar { width: 7px; }
.twin-log::-webkit-scrollbar-thumb { background: var(--ai-line); border-radius: 4px; }

.msg { display: flex; gap: 10px; max-width: 88%; animation: msgIn 200ms var(--ease) both; }
@keyframes msgIn {
  from { opacity: 0; transform: translateY(7px); }
  to   { opacity: 1; transform: translateY(0); }
}
.msg-ai { align-self: flex-start; }
.msg-me { align-self: flex-end; flex-direction: row-reverse; }
.msg-body {
  padding: 11px 15px; border-radius: 13px;
  font-size: 14.5px; line-height: 1.72;
  border: 1px solid var(--ai-line);
}
.msg-ai .msg-body { background: var(--ai-bubble-ai); border-top-left-radius: 4px; }
.msg-me .msg-body {
  background: var(--ai-bubble-me);
  border-color: color-mix(in srgb, var(--ai-accent) 24%, transparent);
  border-top-right-radius: 4px;
}
.msg-body p + p { margin-top: 9px; }
.msg-body strong { color: var(--on-ai-bubble); font-weight: 600; }
.msg-body code {
  font-family: var(--f-mono); font-size: .88em;
  background: var(--on-ai-bubble-mute); padding: 1px 5px; border-radius: 4px;
}
.msg-body ul { list-style: none; display: grid; gap: 5px; }
.msg-body ul li { padding-left: 14px; position: relative; }
.msg-body ul li::before {
  content: ""; position: absolute; left: 2px; top: .72em;
  width: 4px; height: 4px; border-radius: 50%; background: var(--ai-accent);
}

/* 打字指示 */
.typing { display: inline-flex; gap: 4px; align-items: center; padding: 4px 0; }
.typing i {
  width: 5px; height: 5px; border-radius: 50%; background: var(--ai-ink-2);
  animation: blink 1.2s var(--ease) infinite;
}
.typing i:nth-child(2) { animation-delay: .16s; }
.typing i:nth-child(3) { animation-delay: .32s; }
@keyframes blink { 0%,60%,100% { opacity: .25; transform: translateY(0); } 30% { opacity: 1; transform: translateY(-2px); } }

.twin-presets {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding: 14px 20px 0;
}
.twin-presets button {
  background: transparent; border: 1px solid var(--ai-line);
  border-radius: 999px; padding: 6px 13px;
  font-size: 12.5px; color: var(--ai-ink-2);
  transition: all var(--t-fast) var(--ease);
}
.twin-presets button:hover {
  color: var(--ai-ink);
  border-color: color-mix(in srgb, var(--ai-accent) 55%, transparent);
  background: color-mix(in srgb, var(--ai-accent) 10%, transparent);
}
.twin-presets button:disabled { opacity: .4; cursor: default; }

.twin-input {
  display: flex; gap: 9px; padding: 14px 20px 0;
}
.twin-input input {
  flex: 1; height: 46px; padding: 0 15px;
  background: var(--ai-bubble-ai);
  border: 1px solid var(--ai-line); border-radius: 10px;
  color: var(--ai-ink); font-size: 14.5px; font-family: inherit;
  transition: border-color var(--t-fast) var(--ease);
}
.twin-input input::placeholder { color: var(--ai-ink-2); }
.twin-input input:focus { outline: none; border-color: var(--ai-accent); }
.twin-input button {
  width: 46px; height: 46px; flex-shrink: 0;
  display: grid; place-items: center;
  background: var(--ai-accent); color: var(--ai-on-accent);
  border: none; border-radius: 10px;
  transition: all var(--t-fast) var(--ease);
}
.twin-input button:hover { filter: brightness(1.1); }
.twin-input button:disabled { opacity: .45; cursor: default; filter: none; }

.twin-foot {
  padding: 13px 20px 17px;
  font-size: 12px; line-height: 1.6; color: var(--ai-ink-2);
}
.twin-mock { display: block; margin-top: 3px; color: color-mix(in srgb, var(--ai-accent) 80%, var(--ai-ink-2)); }

/* ---------- 写作 ---------- */
/* 写作区：只留栏目说明 + 订阅入口，不再有文章列表。
   原 .writing-list / .w-row / .w-kind / .w-title / .w-meta / .w-pending
   随 5 条选题计划一起删除（2026-11-14 用户裁决）。 */
.writing-sub {
  border-top: 1px solid var(--line);
  padding-top: 26px;
}
.writing-lede {
  font-size: 15.5px; line-height: 1.75; color: var(--ink-2);
  margin: 0 0 20px;
}
.writing-sub-form {
  display: flex; gap: 10px; flex-wrap: wrap;
  max-width: 420px;
}
.writing-sub-form input {
  flex: 1 1 200px; min-width: 0;
  padding: 11px 14px;
  font-family: inherit; font-size: 14px;
  color: var(--ink); background: var(--bg-elev);
  border: 1px solid var(--line); border-radius: var(--r-sm);
}
.writing-sub-form input::placeholder { color: var(--ink-3); }
.writing-sub-form input:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
  border-color: var(--accent);
}
.writing-sub-form button {
  padding: 11px 20px;
  font-family: inherit; font-size: 14px; font-weight: 600;
  color: var(--on-accent); background: var(--accent);
  border: 1px solid var(--accent); border-radius: var(--r-sm);
  cursor: pointer;
  transition: background var(--t-fast) var(--ease);
}
.writing-sub-form button:hover { background: color-mix(in srgb, var(--accent) 88%, var(--ink)); }
.writing-sub-note {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  font-family: var(--f-mono);
}

/* ---------- 联络 ---------- */
.contact-grid {
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: 64px; align-items: start;
}
.contact-h2 {
  font-size: clamp(1.6rem, 3.6vw, 2.5rem);
  line-height: 1.25; letter-spacing: -0.02em; margin: 14px 0 18px;
}
.contact-lede { color: var(--ink-2); font-size: 16px; max-width: 44ch; }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }

.subscribe {
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 24px;
  box-shadow: var(--shadow-1);
}
.subscribe h3 { font-size: 1.1rem; margin-bottom: 9px; }
.subscribe > p { font-size: 14.5px; color: var(--ink-2); line-height: 1.7; }
.subscribe form { display: flex; gap: 8px; margin-top: 18px; }
.subscribe input {
  flex: 1; min-width: 0; height: 44px; padding: 0 13px;
  background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm);
  color: var(--ink); font-size: 14.5px; font-family: inherit;
  transition: border-color var(--t-fast) var(--ease);
}
.subscribe input:focus { outline: none; border-color: var(--accent); }
.subscribe button {
  height: 44px; padding: 0 20px; flex-shrink: 0;
  background: var(--ink); color: var(--bg);
  border: none; border-radius: var(--r-sm);
  font-size: 14.5px; font-weight: 500;
  transition: all var(--t-fast) var(--ease);
}
.subscribe button:hover { opacity: .88; }
.sub-note { margin-top: 11px; font-size: 12.5px; color: var(--ink-3); }

.socials {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin-top: 22px; padding-top: 20px;
  border-top: 1px dashed var(--line);
}
.socials a {
  font-size: 13.5px; color: var(--ink-2);
  transition: color var(--t-fast) var(--ease);
}
.socials a:hover { color: var(--accent); }

/* ---------- 页脚 ---------- */
.footer { border-top: 1px solid var(--line); padding-top: 34px; padding-bottom: 54px; }
.footer-inner {
  display: flex; justify-content: space-between; gap: 32px; flex-wrap: wrap;
}
.footer-brand { font-family: var(--f-serif); font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.footer-brand .mono { color: var(--ink-3); font-weight: 400; }
.footer-meta { font-size: 12.5px; color: var(--ink-3); }
.footer-meta a.footer-link {
  color: var(--ink-3);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color var(--t-fast) var(--ease);
}
.footer-meta a.footer-link:hover { color: var(--accent); }
.footer-note {
  font-size: 12.5px; line-height: 1.7; color: var(--ink-3);
  max-width: 40ch; text-align: right;
}

/* ---------- 命令面板 ---------- */
.palette {
  position: fixed; inset: 0; z-index: 100;
  background: var(--overlay);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding-top: 14vh;
  animation: fadeIn 140ms var(--ease);
}
.palette[hidden] { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.palette-box {
  width: min(560px, calc(100vw - 40px));
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-2);
  overflow: hidden;
  animation: popIn 180ms var(--ease);
}
/* 只做位移不做缩放：scale 在部分浏览器会触发文字重绘抖动，
   且与站点"禁缩放弹跳"的动效规范一致。 */
@keyframes popIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.palette-input-wrap {
  display: flex; align-items: center; gap: 11px;
  padding: 15px 16px; border-bottom: 1px solid var(--line);
  color: var(--ink-3);
}
.palette-input-wrap input {
  flex: 1; border: none; background: transparent;
  color: var(--ink); font-size: 15.5px; font-family: inherit;
}
.palette-input-wrap input:focus { outline: none; }

.palette-list { max-height: 46vh; overflow-y: auto; padding: 6px; }
.palette-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  font-size: 14.5px; color: var(--ink-2); cursor: pointer;
}
.palette-list li .p-icon {
  font-family: var(--f-mono); font-size: 11px; color: var(--ink-3);
  width: 42px; flex-shrink: 0;
}
.palette-list li .p-hint { margin-left: auto; font-size: 12px; color: var(--ink-3); font-family: var(--f-mono); }
.palette-list li.on, .palette-list li:hover { background: var(--accent-soft); color: var(--ink); }
.palette-list li.on .p-icon, .palette-list li:hover .p-icon { color: var(--accent); }

/* ---------- 入场动画 ----------
   只在 JS 可用时隐藏初始状态：脚本失败时内容依然可读 */
.reveal { opacity: 1; transform: none; }
.js .reveal {
  opacity: 0; transform: translateY(12px);
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
}
.js .reveal.in { opacity: 1; transform: translateY(0); }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .status-card { position: static; }
  .works-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; gap: 40px; }
  .footer-note { text-align: left; }

  /* 移动端导航：改为一行可横向滑动的标签，而不是整块隐藏 */
  .nav-inner { flex-wrap: wrap; height: auto; padding-top: 9px; padding-bottom: 0; }
  .nav-links {
    order: 3; width: 100%; margin-left: 0;
    overflow-x: auto; overflow-y: hidden;
    padding: 6px 0 8px;
    gap: 2px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { flex-shrink: 0; padding: 5px 10px; font-size: 13.5px; }
  .nav-tools { margin-left: auto; }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .wrap, .nav-inner, .hero, .section { padding-left: 20px; padding-right: 20px; }
  .hero { padding-top: 40px; padding-bottom: 52px; }
  .br-m { display: inline; }
  .hero h1 { font-size: clamp(1.95rem, 8.4vw, 2.6rem); line-height: 1.2; }
  .hero h1 em { white-space: normal; }
  .section { padding-top: 56px; padding-bottom: 56px; }
  .sec-head { margin-bottom: 32px; }
  .nav-inner { gap: 10px; }
  .brand-text { display: none; }
  .hero-cta .btn { flex: 1 1 100%; justify-content: center; }
  .matrix-row {
    grid-template-columns: 1fr; gap: 7px;
    padding: 15px 17px;
  }
  .matrix-head { display: none; }
  .matrix .m-e { text-align: left; margin-top: 3px; }
  .writing-sub-form { flex-direction: column; }
  .writing-sub-form button { width: 100%; }
  .twin-log { max-height: 340px; padding: 18px 15px 4px; }
  .twin-head { padding: 14px 15px; }
  .twin-presets, .twin-input, .twin-foot { padding-left: 15px; padding-right: 15px; }
  .msg { max-width: 94%; }
  .status-card { padding: 18px 17px 15px; }
  .subscribe { padding: 20px 18px; }
  .subscribe form { flex-direction: column; }
  .subscribe button { width: 100%; }
  .footer-inner { flex-direction: column; gap: 20px; }

}

/* ---------- 减少动效 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  /* 必须与 .js .reveal 同特异性（0,2,0），否则被上面那条压住：
     .js .reveal 设了 opacity:0，等滚动加 .in 才显示。减少动效的用户
     本该直接看到内容，不该还要靠滚动触发。 */
  .reveal,
  .js .reveal { opacity: 1; transform: none; }
  .live-dot { animation: none; }
}

/* ---------- 无 JavaScript 时的替代路径（P1-a） ---------- */
.nojs-notice {
  background: var(--accent-soft);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent-on-soft);
  border-radius: var(--r-sm);
  padding: 16px 18px;
  margin-bottom: 18px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink);
}
.nojs-notice p { margin: 0 0 6px; }
.nojs-notice p:last-child { margin-bottom: 0; }
.nojs-notice a { color: var(--accent-on-soft); font-weight: 600; }
.nojs-title { font-weight: 600; }
.nojs-note { font-size: 13px; color: var(--ink-2); }
.nojs-notice-sm {
  margin-top: 14px;
  margin-bottom: 0;
  padding: 12px 15px;
  font-size: 13.5px;
}
.nojs-inline {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 8px;
}
.nojs-inline a { color: var(--accent); }

/* 无 JS 时，依赖脚本的交互控件不应看起来可用：
   变灰、去掉 hover 反馈、并明确说明需要 JavaScript。
   这些控件在无 JS 下点击没有任何反应，视觉上要诚实。 */
html:not(.js) .twin-panel,
html:not(.js) .palette,
html:not(.js) .hero-sub,
html:not(.js) #subForm,
html:not(.js) #writingSubForm {
  opacity: .55;
}
html:not(.js) .twin-panel input,
html:not(.js) .twin-panel button,
html:not(.js) .hero-sub input,
html:not(.js) .hero-sub button,
html:not(.js) #subForm input,
html:not(.js) #subForm button,
html:not(.js) #writingSubForm input,
html:not(.js) #writingSubForm button {
  cursor: not-allowed;
  pointer-events: none;
}
html:not(.js) .kbtn,
html:not(.js) .icon-btn {
  opacity: .5;
  cursor: not-allowed;
  /* 关键：不加 pointer-events:none 时，无 JS 下这四个控件仍然可点，
     点了却毫无反应——正是产品要修的那个症状（"以为坏了"）。
     加上后鼠标点不动；Tab 仍能到达（键盘用户能看到焦点在哪），
     但按下无响应，配合 noscript 文案里的说明就不构成困惑。 */
  pointer-events: none;
}

/* 身份切换 tab 与简历下载按钮同理：都靠 JS 才有行为。
   同样只禁用控件本身，不把父容器变灰——父容器里的 noscript
   替代文案要保持正常可读的对比度。 */
html:not(.js) .lens-tabs button,
html:not(.js) #resumeBtn,
html:not(.js) .resume-select {
  opacity: .5;
  cursor: not-allowed;
  pointer-events: none;
}

/* 无 JS 时正文由 app.js 写入，#lensIntro 会永远停在「正在载入…」，
   看着像加载失败。它下面的 noscript 已经给出招聘者版正文，
   所以这里把这个占位提示藏掉，避免两处文字打架。 */
html:not(.js) #lensIntro { display: none; }

/* ============================================================
   触摸目标 ≥ 44×44 —— 同时满足 WCAG 2.5.8 (AA, 24×24) 与 2.5.5 (AAA, 44×44)
   ------------------------------------------------------------
   两个标准不要混：
     2.5.8 Target Size (Minimum)  = AA 级，阈值 **24×24** CSS px。
     2.5.5 Target Size (Enhanced) = AAA 级，阈值 **44×44** CSS px。
   本段按更严的 44×44 落地，于是两个等级同时达标。

   为什么不放在移动端媒体查询里：
     2.5.8（AA）不限定指针类型——鼠标、触屏、触控笔一视同仁。
     桌面用户点「案例 01」同样只有 19px 高的可点区域，一样不达标。
     2.5.5（AAA）才明确写「仅适用于触摸」。

   原则：不放大字号、不放大图标，只用 min-height / min-width + 内边距
   把可点区域撑到 44px，字号与视觉密度保持原样。
   ============================================================ */
.brand { min-height: 44px; min-width: 44px; }
.nav-links a { min-height: 44px; display: inline-flex; align-items: center; }
.icon-btn { width: 44px; height: 44px; }
.kbtn { height: 44px; }
.lens-tabs button { min-height: 44px; display: inline-flex; align-items: center; }
.twin-reset { min-height: 44px; padding: 4px 12px; }
.twin-presets button { min-height: 44px; padding: 6px 14px; }
.work-detail > summary { min-height: 44px; }

/* 订阅输入框：桌面端原本就是 44px 高（.subscribe input 的既有规则），
   这里只用 min-height 兜底，不强设 height，避免改变桌面视觉高度。 */
.subscribe input { min-height: 44px; }

/* 社交列表：把 li 与链接的点击区一起撑开（RSS 盒子宽只有 26px） */
.socials li { min-height: 44px; display: flex; align-items: center; }
.socials a { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; }

/* 行内文字链接的点击区扩展。
   为什么不用 padding + 负 margin：能力矩阵在移动端是单列 grid，
   行内链接的 padding 会把自己的 grid 行撑高，整张表的视觉就散了。
   伪元素方案不参与布局流，文字行距与字号完全不变。

   只有这两类需要伪元素：
   - .matrix .m-e a：正文行盒里，行高敏感
   - .lens-pick a：同一段文字里跟其他链接并列
   .socials a 是 inline-flex，伪元素宽度会退化成 auto，
   反而盖在 li 上拦掉本该由 li 接的点击，所以不套。 */
.matrix .m-e a,
.lens-pick a {
  position: relative;
}
.matrix .m-e a::after,
.lens-pick a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: 44px;
  min-width: 44px;
  transform: translateY(-50%);
}

/* 矩阵链接的伪元素没有被 overflow:hidden 裁掉：
   .matrix .m-e a 在 grid cell 里有确定的宽度上下文，伪元素上下各溢出 12.5px
   仍落在 matrix 的内边距范围内，实测真实命中高度 45px。 */
.lens-pick a {
  display: inline-block;
  min-height: 44px;
  padding: 13px 0;
  margin: -13px 0;
  min-width: 44px;
}
.lens-pick a::after {
  display: none;
}

/* 页脚链接：盒子高只有 17px，页脚不是多行网格，用 padding 撑高安全。
   上下等量 padding + 等量负 margin，撑高后行高不变。 */
.footer-meta a.footer-link {
  display: inline-block;
  padding: 4px 0;
  margin: -4px 0;
}

/* 按钮与下拉：块级容器，直接 min-height 即可 */
.hero-cta .btn,
.resume-row .btn { min-height: 44px; }
.resume-select { min-height: 44px; }

/* ---------- 作品详情（页内展开，无跳转） ---------- */
.work-detail {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line-2);
}
.work-detail > summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--accent);
  font-weight: 500;
  border-radius: var(--r-sm);
}
.work-detail > summary::-webkit-details-marker { display: none; }
.work-detail > summary::after {
  content: "→";
  transition: transform var(--t-fast) var(--ease);
  display: inline-block;
}
.work-detail[open] > summary::after { transform: rotate(90deg); }
.work-detail > summary:hover { text-decoration: underline; text-underline-offset: 3px; }
.work-detail > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
.work-detail-body {
  padding-top: 14px;
  font-size: 13.5px;
  line-height: 1.72;
  color: var(--ink-2);
  animation: detailIn var(--t-mid) var(--ease);
}
@keyframes detailIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}
.work-detail-body h4 {
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: none;
  color: var(--ink-3);
  font-weight: 600;
  margin: 14px 0 5px;
}
.work-detail-body h4:first-child { margin-top: 0; }
.work-detail-body p { margin-bottom: 10px; }
.work-detail-body ul { margin: 0 0 10px; padding-left: 18px; }
.work-detail-body li { margin-bottom: 5px; }
.work-detail-body strong { color: var(--ink); font-weight: 600; }
.work-detail-body .work-detail-note {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 12.5px;
  color: var(--ink-3);
  font-style: italic;
}

/* 待填占位：明显区别于真实数字，避免被误读为已确认数据 */
.work-metric .num.tbd {
  font-family: var(--f-sans);
  font-size: .95rem;
  font-weight: 500;
  font-style: italic;
  color: var(--ink-3);
  letter-spacing: 0;
}

/* ---------- Hero 首屏订阅 ---------- */
.hero-sub {
  display: flex;
  gap: 8px;
  margin-top: 20px;
  max-width: 430px;
}
.hero-sub input {
  flex: 1;
  min-width: 0;
  padding: 11px 14px;
  font-size: 14px;
  font-family: var(--f-sans);
  color: var(--ink);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--ease);
}
.hero-sub input::placeholder { color: var(--ink-3); }
.hero-sub input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.hero-sub button {
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 500;
  font-family: var(--f-sans);
  color: var(--on-accent);
  background: var(--accent);
  border: none;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--t-fast) var(--ease);
}
.hero-sub button:hover { opacity: .88; }
.hero-sub button:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.hero-sub-note {
  margin-top: 9px;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 430px;
}

@media (max-width: 640px) {
  .hero-sub { flex-direction: column; max-width: none; }
  .hero-sub button { width: 100%; }
}

/* 待填社交项：不可点击，视觉上明确区别于可用链接 */
.social-tbd {
  color: var(--ink-3);
  font-style: italic;
  cursor: default;
}
