/* 简历页样式。版式来自 claude.ai 上的「Pairwise Blog 重设计 · 简历」画板 */
:root {
  --background-rgb: 255, 255, 255;
  --foreground-rgb: 10, 14, 25;
  --card-rgb: 255, 255, 255;
  --muted-bg-rgb: 243, 245, 246;
  --muted-foreground-rgb: 108, 110, 117;
  --primary-rgb: 0, 184, 184;
  --toast-background-rgb: 35, 38, 48;
  --window-border-rgb: 230, 231, 232;
  --canvas: #e9ecef;
  --card-elevated-shadow: 0 12px 32px -14px rgba(var(--foreground-rgb), .28);
  /* 小猫（pet.js / pet-ai.js）读的旧变量名 */
  --bg: rgb(var(--background-rgb));
  --ink-rgb: var(--foreground-rgb);
  --text: rgb(40, 44, 54);
  --faint: rgb(169, 171, 174);
  --brand-2: #0b8f8f;
}
:root[data-theme="dark"] {
  --background-rgb: 10, 14, 25;
  --foreground-rgb: 255, 255, 255;
  --card-rgb: 35, 38, 48;
  --muted-bg-rgb: 26, 30, 40;
  --muted-foreground-rgb: 157, 159, 163;
  --primary-rgb: 0, 240, 196;
  --toast-background-rgb: 54, 58, 71;
  --window-border-rgb: 44, 48, 57;
  --canvas: #03040a;
  --bg: #07090f;
  --text: #c3c9d4;
  --faint: #4a5160;
  --brand-2: #5eead4;
}
:root {
  --rise-rgb: 0, 173, 162;
  --fall-rgb: 255, 58, 117;
  --warning-rgb: 255, 151, 40;
  --background: rgb(var(--background-rgb));
  --foreground: rgb(var(--foreground-rgb));
  --card: rgb(var(--card-rgb));
  --muted-bg: rgb(var(--muted-bg-rgb));
  --muted-foreground: rgb(var(--muted-foreground-rgb));
  --primary: rgb(var(--primary-rgb));
  --rise: rgb(var(--rise-rgb));
  --fall: rgb(var(--fall-rgb));
  --warning: rgb(var(--warning-rgb));
  --toast-background: rgb(var(--toast-background-rgb));
  --window-border: rgb(var(--window-border-rgb));
  --chart-violet: #5a74ff;
  --chart-blue: #0cb6ff;
  --chart-orange: #ff7128;
  --chart-green: #35c15c;
  --chart-pink: #ec54b8;
  --fs-l1: .875rem;
  --fs-s2: .9375rem;
  --ease-fast: .15s ease;
  --strong: var(--foreground);
  --muted: var(--muted-foreground);
  --line: rgba(var(--foreground-rgb), .08);
  --line-hi: rgba(var(--foreground-rgb), .14);
  --brand: #00b8b8;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "PingFang SC", "Heiti SC", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
}

* { box-sizing: border-box; }
html { background: var(--canvas); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
body { margin: 0; font-family: var(--sans); color: var(--foreground); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .45); }
.mono { font-family: var(--mono); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 动态背景：hero-bg 组件（与笔记站共用 /notes/hero-bg.js）。组件注入的样式只铺首屏，这里改成固定铺满视口；打印时组件自己会隐藏 */
body > hero-bg { position: fixed; inset: 0; height: 100vh; max-height: none; z-index: -1; -webkit-mask-image: none; mask-image: none; }

/* ---------- 动效 ---------- */
@keyframes pwNav { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: none; } }
@keyframes pwChar { from { opacity: 0; transform: translateY(.35em) scale(.96); filter: blur(10px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pwRise { from { opacity: 0; transform: translateY(22px) scale(.97); filter: blur(4px); } to { opacity: 1; transform: none; filter: none; } }
@keyframes pwFadeUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pwFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pwLine { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes pwPing { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes pwDotPop { 0% { opacity: 0; transform: scale(0) translateY(-40px); } 60% { opacity: 1; transform: scale(1.4); } 100% { opacity: 1; transform: none; } }
@keyframes pwDraw { to { stroke-dashoffset: 0; } }
@keyframes pwChipIn { from { opacity: 0; transform: translateY(8px) scale(.8); } to { opacity: 1; transform: none; } }
@keyframes pwPopIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: none; } }
@keyframes pwBoing { 0% { transform: scale(1); } 30% { transform: scale(1.2) rotate(-4deg); } 55% { transform: scale(.92) rotate(2deg); } 75% { transform: scale(1.06); } 100% { transform: none; } }
@keyframes pwSpot { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes pwSpin { to { transform: rotate(360deg); } }
@keyframes pwBlink { 50% { opacity: .25; } }
@keyframes pwFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes pwBounce { 0%, 100% { transform: none; } 30% { transform: translateY(-16px); } 55% { transform: none; } 75% { transform: translateY(-6px); } }

.nav { animation: pwNav .6s cubic-bezier(.2,.8,.2,1) both; }
.ch { display: inline-block; animation: pwChar .7s cubic-bezier(.2,.8,.2,1) both; }
.ch.dot-pop { animation: pwDotPop .9s cubic-bezier(.2,.9,.3,1.4) both; color: var(--primary); }
.rise { animation: pwRise .7s cubic-bezier(.2,.8,.2,1) both; }
.pop { animation: pwPopIn .5s cubic-bezier(.2,.9,.3,1.6) both; }
/* 章节滚进视口前先停在第一帧；没有 JS 时不加 .js，内容照常显示 */
/* 首屏不走模糊：0.8 秒时截图、爬虫抓到的要是清晰的字（配合 index.html 里压短的 delay） */
.hero .rise { animation-name: pwFadeUp; animation-duration: .45s; }
.hero .ch:not(.dot-pop) { animation-name: pwFadeUp; animation-duration: .5s; }
.hero .ch.dot-pop { animation-duration: .5s; }
.js .sec:not(.in) :is(.rise, .pop, .proj, .sec-line, .draw svg *) { animation-play-state: paused; }

/* ---------- 顶部导航 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: rgba(var(--background-rgb), .72); backdrop-filter: blur(20px) saturate(1.8); -webkit-backdrop-filter: blur(20px) saturate(1.8); border-bottom: 1px solid rgba(var(--foreground-rgb), .06); }
.topbar-in { max-width: 1200px; margin: 0 auto; height: 68px; padding: 0 24px; display: flex; align-items: center; gap: 8px; }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; text-decoration: none; font-size: 19px; font-weight: 700; letter-spacing: -.01em; }
.brand img { width: 36px; height: 36px; border-radius: 9px; }
.links { display: flex; gap: 4px; margin-right: 8px; }
.navl { height: 36px; padding: 0 16px; border-radius: 999px; border: 1px solid transparent; font-size: var(--fs-s2); color: var(--muted-foreground); display: inline-flex; align-items: center; text-decoration: none; transition: background var(--ease-fast), color var(--ease-fast), border-color var(--ease-fast); }
.navl:hover { color: var(--foreground); background: rgba(var(--foreground-rgb), .05); }
.navl[aria-current="page"] { color: var(--foreground); font-weight: 600; border-color: rgba(var(--primary-rgb), .55); background: rgba(var(--primary-rgb), .08); }
.circ { width: 40px; height: 40px; flex-shrink: 0; border-radius: 50%; border: 1px solid rgba(var(--foreground-rgb), .1); background: rgba(var(--card-rgb), .8); display: grid; place-items: center; transition: transform .3s cubic-bezier(.2,.9,.3,1.5), box-shadow var(--ease-fast); }
.circ:hover { transform: translateY(-1px); box-shadow: 0 6px 16px -8px rgba(var(--foreground-rgb), .35); }
.circ:active { transform: scale(.9); }
.circ .ai { font: 700 13px/1 var(--mono); }
:root[data-theme="dark"] .ic-sun, :root:not([data-theme="dark"]) .ic-moon { display: none; }
.progress { position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--primary); transform-origin: left; transform: scaleX(0); }

/* ---------- 主体与章节 ---------- */
.main { position: relative; max-width: 1120px; margin: 0 auto; padding: 64px 24px 140px; }
.sec { scroll-margin-top: 96px; }
.sec + .sec { margin-top: 112px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; }
.sec-head h2 { margin: 0; font-size: 1.5rem; line-height: 1.625rem; font-weight: 700; }
.sec-num { font-size: 12px; color: var(--muted-foreground); }
.sec-line { flex: 1 1 40px; height: 1px; align-self: center; background: var(--window-border); transform-origin: left; animation: pwLine 1s cubic-bezier(.2,.8,.2,1) .15s both; }
.sec-body { margin-top: 24px; }

/* 名片 */
.hero { min-height: 520px; display: flex; flex-direction: column; justify-content: center; }
.hero + .sec { margin-top: 64px; }
.tag { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px 0 10px; border-radius: 999px; border: 1px solid rgba(var(--foreground-rgb), .08); background: rgba(var(--card-rgb), .7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 12px; }
.tag .mono { letter-spacing: .08em; }
.live { position: relative; width: 8px; height: 8px; }
.live::before, .live::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--primary); }
.live::before { animation: pwPing 1.8s cubic-bezier(0,0,.2,1) infinite; }
.name { margin: 18px 0 0; font-size: 120px; line-height: .95; font-weight: 700; letter-spacing: -.05em; }
.name .wv { display: inline-block; cursor: default; transition: transform .4s cubic-bezier(.2,.9,.3,1.8), color .2s ease; }
.name .wv:hover { transform: translateY(-16px) rotate(-6deg); color: var(--primary); }
.slogan { position: relative; z-index: 0; margin: 24px 0 0; font-size: 30px; line-height: 1.3; font-weight: 600; letter-spacing: -.015em; }
.hl { position: relative; display: inline-block; }
.hl::after { content: ""; position: absolute; left: -2px; right: -2px; bottom: .1em; height: .26em; background: rgba(var(--primary-rgb), .32); border-radius: 4px; z-index: -1; transform-origin: left; animation: pwLine .7s cubic-bezier(.2,.8,.2,1) 1.1s both; }
.cta { margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px; }
.pill { height: 36px; padding: 0 16px; border-radius: 999px; border: 0; font-size: var(--fs-l1); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; text-decoration: none; transition: transform .25s cubic-bezier(.2,.9,.3,1.4), background var(--ease-fast); }
.pill:hover { transform: translateY(-1px); }
.pill:active { transform: scale(.95); }
.pill.dark { background: var(--foreground); color: var(--background); }
.pill.ghost { background: rgba(var(--foreground-rgb), .06); color: var(--foreground); }
.pill.ghost:hover { background: rgba(var(--foreground-rgb), .1); }
.pill.sm { height: 34px; }

/* 卡片：光泽跟随指针 + 轻微 3D 倾斜（倾斜角由 resume.js 写进 --rx / --ry） */
.bento { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.exp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 20px; }
.exp-years { justify-content: center; }
.exp-num { font-size: 56px; line-height: 1; font-weight: 700; letter-spacing: -.02em; }
.exp-num .mono { margin-right: 6px; color: var(--primary); }
.exp-list { margin: 0; padding-left: 1.2em; font-size: var(--fs-s2); line-height: 1.75; color: var(--muted-foreground); }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.card { position: relative; height: 100%; border-radius: 24px; border: 1px solid rgba(var(--foreground-rgb), .08); background: var(--card); padding: 26px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; text-decoration: none; --rx: 0deg; --ry: 0deg; --mx: 50%; --my: 50%; transform: perspective(900px) rotateX(var(--rx)) rotateY(var(--ry)); box-shadow: 0 1px 2px rgba(var(--foreground-rgb), .04), 0 8px 24px -16px rgba(var(--foreground-rgb), .18); transition: transform .5s cubic-bezier(.2,.9,.3,1), box-shadow .4s ease, border-color .3s ease; }
.card::before { content: ""; position: absolute; inset: 0; pointer-events: none; background: radial-gradient(420px circle at var(--mx) var(--my), rgba(var(--primary-rgb), .12), transparent 60%); opacity: 0; transition: opacity .3s ease; }
.card:hover { box-shadow: var(--card-elevated-shadow), 0 30px 60px -30px rgba(var(--foreground-rgb), .3); border-color: rgba(var(--primary-rgb), .35); transition: transform .12s linear, box-shadow .4s ease, border-color .3s ease; }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card-top { display: flex; justify-content: space-between; align-items: flex-start; }
.card-title { font-size: 22px; line-height: 1.3; font-weight: 700; }
.card-desc { font-size: var(--fs-s2); line-height: 1.75; color: var(--muted-foreground); flex-grow: 1; }
.card .meta { font-size: 12px; color: var(--muted-foreground); }
.tile { flex-shrink: 0; border-radius: 22%; display: grid; place-items: center; color: #fff; font-weight: 700; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.1), inset 0 1px 0 rgba(255,255,255,.35), 0 6px 14px -6px rgba(var(--foreground-rgb), .35); transition: transform .5s cubic-bezier(.2,.9,.3,1.4); }
.card:hover .tile, .proj:hover .tile { transform: rotate(-6deg) scale(1.06); }
.draw svg * { stroke-dasharray: 80; stroke-dashoffset: 80; animation: pwDraw 1.2s cubic-bezier(.4,0,.2,1) .4s forwards; }
.go { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-l1); font-weight: 600; transition: gap .3s cubic-bezier(.2,.9,.3,1.4); }
.card:hover .go { gap: 10px; }

/* 项目筛选 */
.seg { position: relative; display: flex; padding: 3px; border-radius: 999px; background: rgba(var(--foreground-rgb), .06); }
.seg button { position: relative; z-index: 1; width: 104px; height: 32px; border: 0; border-radius: 999px; background: transparent; font-size: var(--fs-l1); color: var(--muted-foreground); transition: color .25s ease; }
.seg button[aria-pressed="true"] { color: var(--foreground); font-weight: 600; }
.seg button .mono { font-size: 11px; opacity: .6; }
.seg-ind { position: absolute; left: 3px; top: 3px; width: 104px; height: 32px; border-radius: 999px; background: var(--card); box-shadow: 0 1px 3px rgba(var(--foreground-rgb), .15), 0 0 0 .5px rgba(var(--foreground-rgb), .08); transition: transform .45s cubic-bezier(.3,1.3,.4,1); }

/* 项目手风琴 */
.projs { display: flex; flex-direction: column; gap: 12px; }
.proj { border-radius: 20px; border: 1px solid rgba(var(--foreground-rgb), .08); background: var(--card); animation: pwRise .55s cubic-bezier(.2,.8,.2,1) both; transition: box-shadow .35s ease, border-color .3s ease, transform .35s cubic-bezier(.2,.9,.3,1.3); }
.proj:hover { box-shadow: var(--card-elevated-shadow); transform: translateY(-2px); }
.proj.open { border-color: rgba(var(--primary-rgb), .45); box-shadow: var(--card-elevated-shadow); }
.proj[hidden] { display: none; }
.proj-head { width: 100%; display: flex; align-items: center; gap: 18px; padding: 18px 22px; border: 0; background: transparent; text-align: left; border-radius: 20px; }
.proj-head:active .tile { transform: scale(.92); }
.proj-title { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.proj-name { font-size: 19px; font-weight: 700; }
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(var(--foreground-rgb), .06); color: var(--muted-foreground); }
.proj-desc { display: block; margin-top: 4px; font-size: var(--fs-s2); line-height: 1.6; color: var(--muted-foreground); }
.proj-ai { display: block; margin-top: 6px; font-size: var(--fs-l1); line-height: 1.6; color: var(--foreground); }
.proj-ai b { display: inline-block; margin-right: 8px; padding: 0 6px; border-radius: 6px; font-size: 11px; font-weight: 600; line-height: 18px; color: var(--primary); background: rgba(var(--primary-rgb), .1); border: 1px solid rgba(var(--primary-rgb), .22); }
.try { flex-shrink: 0; font-size: 12px; color: var(--muted-foreground); opacity: 0; transform: translateX(6px); transition: opacity .2s ease, transform .25s ease; }
.proj:hover .try, .proj.open .try { opacity: 1; transform: none; }
.chev { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: rgba(var(--foreground-rgb), .05); transition: transform .45s cubic-bezier(.3,1.4,.4,1), background .2s ease; }
.proj.open .chev { transform: rotate(180deg); background: rgba(var(--primary-rgb), .16); }
.proj-body { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .45s cubic-bezier(.2,.9,.3,1), opacity .3s ease; }
.proj.open .proj-body { grid-template-rows: 1fr; opacity: 1; }
.proj-clip { overflow: hidden; }
.proj-inner { padding: 2px 22px 22px 92px; display: flex; flex-direction: column; gap: 16px; }
.parts-label { font-size: 12px; font-weight: 600; color: var(--muted-foreground); margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: var(--fs-l1); padding: 6px 12px; border-radius: 10px; background: rgba(var(--primary-rgb), .1); border: 1px solid rgba(var(--primary-rgb), .22); }
.proj.open .chip { animation: pwChipIn .45s cubic-bezier(.2,.9,.3,1.5) both; }
.proj.open .chip:nth-child(2) { animation-delay: .06s; }
.proj.open .chip:nth-child(3) { animation-delay: .12s; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.proj.open .acts { animation: pwRise .45s cubic-bezier(.2,.8,.2,1) .2s both; }

/* 技术栈 */
.stack { display: flex; flex-wrap: wrap; gap: 10px; }
.stack-chip { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid rgba(var(--foreground-rgb), .08); background: var(--card); font-size: var(--fs-s2); font-weight: 500; transition: transform .3s cubic-bezier(.2,.9,.3,1.6), box-shadow .3s ease, border-color .2s ease; }
.stack-chip:hover { transform: translateY(-3px) scale(1.04); box-shadow: var(--card-elevated-shadow); border-color: rgba(var(--primary-rgb), .4); }
.stack-chip:active { transform: scale(.92); }
.stack-chip.boing { animation: pwBoing .6s cubic-bezier(.3,.7,.4,1.4); }
.sdot { width: 8px; height: 8px; border-radius: 50%; transition: transform .3s cubic-bezier(.2,.9,.3,1.8); }
.stack-chip:hover .sdot { transform: scale(1.6); }

/* ---------- 项目在线演示（共用部件） ---------- */
.demo { position: relative; border-radius: 14px; border: 1px solid rgba(var(--foreground-rgb), .1); background: var(--card); overflow: hidden; box-shadow: 0 14px 34px -20px rgba(var(--foreground-rgb), .35); }
.proj.open .demo { animation: pwRise .5s cubic-bezier(.2,.8,.2,1) .08s both; }
.demo-bar { height: 30px; display: flex; align-items: center; gap: 6px; padding: 0 12px; background: rgba(var(--foreground-rgb), .03); border-bottom: 1px solid rgba(var(--foreground-rgb), .07); font-size: 11px; color: var(--muted-foreground); }
.demo-bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(var(--foreground-rgb), .15); }
.demo-title { margin-left: 8px; font-weight: 500; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.demo-badge { margin-left: auto; flex-shrink: 0; display: inline-flex; align-items: center; gap: 6px; font-size: 11px; padding: 2px 8px; border-radius: 999px; background: rgba(var(--foreground-rgb), .06); color: var(--foreground); }
.live-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rise); animation: pwBlink 1s ease-in-out infinite; }
.demo-foot { display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 12px; border-top: 1px solid rgba(var(--foreground-rgb), .07); font-size: 11px; color: var(--muted-foreground); }
.dm-btn { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid rgba(var(--foreground-rgb), .12); background: var(--card); font-size: 12px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex-shrink: 0; transition: background-color .15s ease, transform .1s ease; }
.dm-btn:hover { background: var(--muted-bg); }
.dm-btn:active { transform: scale(.97); }
.dm-btn[aria-pressed="true"] { background: rgba(var(--warning-rgb), .14); border-color: rgba(var(--warning-rgb), .5); }
.dm-btn[aria-pressed="true"] svg { color: var(--warning); fill: currentColor; }
.dm-btn.wide { width: 100%; }
.dm-btn:disabled { opacity: .45; cursor: default; }
.spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid rgba(var(--foreground-rgb), .15); border-top-color: var(--foreground); animation: pwSpin .7s linear infinite; }
.switch { position: relative; width: 42px; height: 26px; flex-shrink: 0; border-radius: 999px; border: 0; padding: 0; background: rgba(var(--foreground-rgb), .16); transition: background .25s ease; }
.switch.on { background: var(--primary); }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.2); transition: transform .3s cubic-bezier(.2,.9,.3,1.3); }
.switch.on::after { transform: translateX(16px); }

/* MarketDeck */
.md-grid { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 250px; }
.md-list { border-right: 1px solid rgba(var(--foreground-rgb), .07); padding: 6px; }
.md-head, .md-row { display: grid; grid-template-columns: minmax(0, 1fr) 70px 64px; align-items: center; gap: 8px; }
.md-head { padding: 4px 8px 6px; font-size: 11px; color: var(--muted-foreground); }
.md-head span:nth-child(n+2) { text-align: right; }
.md-row { width: 100%; padding: 7px 8px; border: 0; border-radius: 8px; background: transparent; text-align: left; transition: background-color .15s ease; }
.md-row:hover { background: rgba(var(--foreground-rgb), .04); }
.md-row[aria-pressed="true"] { background: rgba(var(--primary-rgb), .13); }
.md-sym { display: block; font: 600 12px/1.4 var(--mono); }
.md-co { display: block; font-size: 11px; color: var(--muted-foreground); }
.md-px { font: 12px var(--mono); text-align: right; }
.chg { justify-self: end; font: 600 11px var(--mono); padding: 2px 6px; border-radius: 5px; transition: background-color .3s ease; }
.chg.up { background: rgba(var(--rise-rgb), .18); }
.chg.dn { background: rgba(var(--fall-rgb), .16); }
.md-main { padding: 16px 18px; }
.md-sub { font-size: 13px; color: var(--muted-foreground); }
.md-price { font-size: 28px; font-weight: 600; letter-spacing: -.02em; }
.md-chart { width: 100%; height: 150px; margin-top: 10px; display: block; }
.md-foot { display: flex; justify-content: space-between; margin-top: 6px; font-size: 11px; color: var(--muted-foreground); }

/* Pairdown */
.pd-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 240px; }
.pd-src { border: 0; border-right: 1px solid rgba(var(--foreground-rgb), .07); resize: none; padding: 16px; font-size: 12.5px; line-height: 1.7; background: rgba(var(--foreground-rgb), .02); color: var(--foreground); outline: none; }
.pd-src:focus { background: var(--card); box-shadow: inset 0 0 0 2px rgba(var(--primary-rgb), .35); }
.pd-out { padding: 16px 20px; display: flex; flex-direction: column; gap: 8px; overflow: auto; }
.pd-h1 { font-size: 22px; font-weight: 700; line-height: 1.3; }
.pd-h2 { font-size: 16px; font-weight: 600; margin-top: 4px; }
.pd-p { font-size: 14px; line-height: 1.7; }
.pd-li { position: relative; padding-left: 16px; font-size: 14px; line-height: 1.6; }
.pd-li::before { content: ""; position: absolute; left: 3px; top: .62em; width: 5px; height: 5px; border-radius: 50%; background: var(--foreground); }
.pd-q { padding: 6px 12px; border-radius: 8px; background: var(--muted-bg); font-size: 13px; color: var(--muted-foreground); }
.save-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--rise); transition: background-color .2s; }
.save-dot.busy { background: var(--warning); animation: pwBlink .6s infinite; }

/* nsh：菜单栏 / 焦点 / Dock */
.ns-desk { position: relative; height: 300px; background: rgba(var(--foreground-rgb), .04); }
.ns-menubar { position: relative; z-index: 3; height: 26px; display: flex; align-items: center; gap: 2px; padding: 0 6px; font-size: 12px; background: rgba(var(--background-rgb), .75); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid rgba(var(--foreground-rgb), .06); }
.ns-msg { padding: 0 8px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-menu { position: relative; }
.ns-mi { height: 20px; padding: 0 8px; border: 0; border-radius: 4px; background: transparent; font-size: 12px; }
.ns-mi:hover, .ns-mi[aria-expanded="true"] { background: rgba(var(--foreground-rgb), .1); }
.ns-drop { position: absolute; left: 0; top: 24px; min-width: 170px; padding: 4px; border-radius: 8px; background: rgba(var(--card-rgb), .92); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border: 1px solid rgba(var(--foreground-rgb), .1); box-shadow: 0 12px 30px -10px rgba(var(--foreground-rgb), .35); display: flex; flex-direction: column; animation: pwSpot .16s ease both; transform-origin: top left; }
.ns-drop[hidden] { display: none; }
.ns-item { display: flex; justify-content: space-between; gap: 16px; height: 24px; padding: 0 8px; border: 0; border-radius: 5px; background: transparent; font-size: 12px; text-align: left; align-items: center; }
.ns-item:hover, .ns-item:focus-visible { background: var(--brand); color: #fff; box-shadow: none; }
.ns-item .mono { opacity: .6; }
.ns-win { position: absolute; left: 50%; top: 48px; width: min(300px, calc(100% - 24px)); transform: translateX(-50%); border-radius: 10px; background: var(--card); border: 1px solid rgba(var(--foreground-rgb), .1); box-shadow: 0 16px 36px -16px rgba(var(--foreground-rgb), .35); overflow: hidden; }
.ns-field { height: 30px; display: flex; align-items: center; padding: 0 10px; border-radius: 7px; border: 1px solid rgba(var(--foreground-rgb), .14); font-size: 12px; color: var(--muted-foreground); transition: box-shadow .2s ease; }
.ns-b { height: 28px; padding: 0 14px; display: inline-flex; align-items: center; border-radius: 7px; border: 1px solid rgba(var(--foreground-rgb), .14); font-size: 12px; transition: box-shadow .2s ease; }
.ns-b.primary { background: var(--foreground); color: var(--background); border-color: var(--foreground); }
.fr { box-shadow: 0 0 0 3px rgba(var(--primary-rgb), .55); }
.kcap { height: 24px; padding: 0 8px; border-radius: 5px; border: 1px solid rgba(var(--foreground-rgb), .18); border-bottom-width: 2px; background: var(--card); font-size: 11px; transition: transform .08s ease; }
.kcap:active { transform: translateY(1px); border-bottom-width: 1px; }
.ns-dock-wrap { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: center; }
.ns-dock { display: flex; align-items: flex-end; gap: 6px; padding: 6px 8px; border-radius: 14px; background: rgba(var(--background-rgb), .6); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid rgba(var(--foreground-rgb), .08); }
.ns-app { position: relative; width: 36px; height: 36px; padding: 0; border: 0; background: transparent; transform-origin: 50% 100%; transition: transform .2s cubic-bezier(.2,.9,.3,1.2), margin .2s ease; }
.ns-app:hover { transform: translateY(-6px) scale(1.3); margin: 0 6px; }
.ns-app:hover + .ns-app, .ns-app:has(+ .ns-app:hover) { transform: translateY(-2px) scale(1.12); margin: 0 3px; }
.ns-ic { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--card); border: 1px solid rgba(var(--foreground-rgb), .1); font-size: 13px; font-weight: 700; box-shadow: 0 2px 6px -2px rgba(var(--foreground-rgb), .25); }
.ns-app.bounce .ns-ic { animation: pwBounce .7s cubic-bezier(.3,.7,.4,1); }
.ns-run { position: absolute; left: 50%; bottom: -5px; width: 4px; height: 4px; margin-left: -2px; border-radius: 50%; background: var(--foreground); opacity: 0; transition: opacity .2s; }
.ns-app.run .ns-run { opacity: .7; }
.ns-tip { position: absolute; left: 50%; bottom: calc(100% + 6px); transform: translateX(-50%) scale(.75); white-space: nowrap; font-size: 10px; padding: 3px 6px; border-radius: 5px; background: var(--toast-background); color: #fff; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.ns-app:hover .ns-tip, .ns-app:focus-visible .ns-tip { opacity: 1; }

/* droidpier */
.dp-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; min-height: 300px; }
.dp-stage { display: grid; place-items: center; background: rgba(var(--foreground-rgb), .04); border-right: 1px solid rgba(var(--foreground-rgb), .07); overflow: hidden; }
.dp-phone { position: relative; width: 130px; height: 240px; border-radius: 20px; border: 5px solid var(--toast-background); background: var(--card); overflow: hidden; box-shadow: 0 18px 36px -18px rgba(var(--foreground-rgb), .5); transition: transform .6s cubic-bezier(.3,1.2,.4,1); }
.dp-status { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px; font-size: 9px; }
.dp-sig { display: inline-block; width: 12px; height: 8px; border-radius: 2px; background: var(--rise); }
.dp-sig.off { background: rgba(var(--foreground-rgb), .2); }
.dp-apps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 10px 14px; }
.dp-apps i { aspect-ratio: 1; border-radius: 8px; background: rgba(var(--foreground-rgb), .12); }
.dp-apps i:nth-child(5) { background: rgba(var(--primary-rgb), .45); }
.dp-cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: rgba(var(--card-rgb), .85); backdrop-filter: blur(4px); font-size: 10px; animation: pwFade .2s ease both; }
.dp-cover[hidden] { display: none; }
.dp-side { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.dp-ctrls { display: flex; gap: 8px; align-items: center; }
.mini-seg { display: flex; padding: 2px; border-radius: 8px; background: rgba(var(--foreground-rgb), .06); }
.mini-seg button { height: 26px; padding: 0 10px; border: 0; border-radius: 6px; background: transparent; font-size: 12px; color: var(--muted-foreground); transition: all .2s ease; }
.mini-seg button[aria-pressed="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px rgba(var(--foreground-rgb), .15); }
.dp-row { display: flex; align-items: center; gap: 10px; }
.dp-log { flex-grow: 1; min-height: 90px; padding: 8px 10px; border-radius: 8px; background: var(--toast-background); color: #e6e7e8; font-size: 10.5px; line-height: 1.7; overflow: hidden; }
.dp-line { animation: pwRise .3s ease both; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-line span { opacity: .55; }

/* pairwise.site：小猫读页面 */
.pwd-grid { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); min-height: 280px; }
.pwd-page { padding: 14px; display: flex; flex-direction: column; gap: 8px; border-right: 1px solid rgba(var(--foreground-rgb), .07); background: rgba(var(--foreground-rgb), .02); }
.pwd-sec { padding: 8px 10px; border-radius: 8px; border: 1px solid transparent; transition: background-color .3s ease, border-color .3s ease; }
.pwd-sec.read { background: rgba(var(--primary-rgb), .12); border-color: rgba(var(--primary-rgb), .45); }
.pwd-label { font-size: 11px; color: var(--muted-foreground); }
.pwd-text { font-size: 12px; line-height: 1.6; }
.pwd-chat { display: flex; flex-direction: column; min-width: 0; }
.pwd-msgs { flex-grow: 1; padding: 12px; display: flex; flex-direction: column; gap: 8px; max-height: 230px; overflow-y: auto; }
.pwd-m { max-width: 100%; padding: 8px 11px; border-radius: 12px; font-size: 12.5px; line-height: 1.6; animation: pwRise .3s ease both; }
.pwd-m.ai { align-self: flex-start; background: rgba(var(--foreground-rgb), .06); }
.pwd-m.me { align-self: flex-end; background: var(--foreground); color: var(--background); }
.caret { display: inline-block; width: 2px; height: 12px; margin-left: 2px; vertical-align: -2px; background: var(--foreground); animation: pwBlink .8s steps(1) infinite; }
.pwd-asks { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; border-top: 1px solid rgba(var(--foreground-rgb), .07); }
.ask { height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid rgba(var(--foreground-rgb), .14); background: var(--card); font-size: 12px; transition: background-color .15s ease; }
.ask:hover { background: var(--muted-bg); }
.ask:disabled { opacity: .45; cursor: default; }
@media (max-width: 900px) {
  .md-grid, .pd-grid, .dp-grid, .pwd-grid { grid-template-columns: minmax(0, 1fr); }
  .md-list, .pd-src, .dp-stage, .pwd-page { border-right: 0; border-bottom: 1px solid rgba(var(--foreground-rgb), .07); }
  .pd-src { min-height: 160px; }
  .dp-stage { min-height: 280px; }
}

/* 页脚与章节 Dock */
.foot { position: relative; border-top: 1px solid var(--window-border); background: rgba(var(--background-rgb), .6); }
.foot-in { max-width: 1120px; margin: 0 auto; padding: 28px 24px 40px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; font-size: var(--fs-l1); color: var(--muted-foreground); }
.dock { position: fixed; left: 50%; bottom: 24px; z-index: 19; display: flex; gap: 2px; padding: 5px; border-radius: 999px; background: rgba(var(--card-rgb), .72); backdrop-filter: blur(24px) saturate(1.8); -webkit-backdrop-filter: blur(24px) saturate(1.8); border: 1px solid rgba(var(--foreground-rgb), .1); box-shadow: 0 16px 40px -16px rgba(var(--foreground-rgb), .4); transform: translate(-50%, 170%); opacity: 0; pointer-events: none; transition: transform .6s cubic-bezier(.3,1.3,.4,1), opacity .3s ease; }
.dock.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.dock a { white-space: nowrap; height: 34px; padding: 0 16px; border-radius: 999px; display: inline-flex; align-items: center; text-decoration: none; font-size: var(--fs-l1); color: var(--muted-foreground); transition: background .3s ease, color .3s ease, transform .2s ease; }
.dock a:hover { color: var(--foreground); background: rgba(var(--foreground-rgb), .06); }
.dock a:active { transform: scale(.93); }
.dock a[aria-current="true"] { background: var(--foreground); color: var(--background); }

#pet-launcher { position: fixed; right: 18px; bottom: 18px; z-index: 21; height: 32px; padding: 0 12px; border: 1px solid var(--line-hi); border-radius: 999px; background: color-mix(in srgb, var(--bg) 80%, transparent); color: var(--muted); font: 500 12px/1 var(--mono); }
#pet-launcher:hover { color: var(--brand-2); border-color: var(--brand); }

/* 明暗切换的圆形扩散：关掉默认的交叉淡入，新画面由脚本用 clip-path 从点击处展开 */
.theme-reveal::view-transition-old(root), .theme-reveal::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

@media (max-width: 900px) {
  .bento, .exp { grid-template-columns: minmax(0, 1fr); }
  .name { font-size: 72px; }
  .slogan { font-size: 24px; }
  .proj-inner { padding-left: 22px; }
  .try { display: none; }
  .seg button, .seg-ind { width: 84px; }
  .dock a { padding: 0 11px; }
}
@media (max-width: 640px) {
  .topbar-in { padding: 0 16px; gap: 6px; }
  .brand span { display: none; }
  .links { margin-right: 0; gap: 0; }
  .navl { padding: 0 7px; font-size: var(--fs-l1); white-space: nowrap; }
  .main { padding: 32px 16px 120px; }
  .hero { min-height: 440px; }
  .proj-head { gap: 14px; padding: 16px; }
  .proj-inner { padding: 2px 16px 16px; }
}
/* 五个导航入口在 360 宽的手机上放得下 */
@media (max-width: 400px) {
  .topbar-in { padding: 0 12px; gap: 4px; }
  .navl { padding: 0 5px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}

/* 打印 / 存为 PDF：去掉导航和演示，项目全部展开，动画停在最后一帧 */
@page { size: A4; margin: 14mm 12mm; }
@media print {
  html, body { background: #fff; }
  /* 打印一律走浅色：要压过 :root[data-theme="dark"] 的优先级 */
  :root, :root[data-theme] { --background-rgb: 255, 255, 255; --foreground-rgb: 10, 14, 25; --card-rgb: 255, 255, 255; --muted-bg-rgb: 243, 245, 246; --muted-foreground-rgb: 108, 110, 117; --primary-rgb: 0, 184, 184; --toast-background-rgb: 35, 38, 48; --window-border-rgb: 230, 231, 232; --canvas: #fff; }
  .draw svg * { stroke-dashoffset: 0; }
  .topbar, .dock, .seg, .demo, .try, .chev, .acts, #pet-launcher, .foot .pill, .cta button { display: none !important; }
  *, *::before, *::after { animation: none !important; transition: none !important; box-shadow: none !important; filter: none !important; backdrop-filter: none !important; }
  .card { transform: none !important; }
  .main { padding: 0; }
  .hero { min-height: 0; }
  .name { font-size: 64px; }
  .sec + .sec, .hero + .sec { margin-top: 36px; }
  .proj[hidden] { display: block; }
  .proj-body { grid-template-rows: 1fr; opacity: 1; }
  .proj, .card { break-inside: avoid; }
}
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
