/*
 * 新前台视觉：基于 MIT 开源 Bentofolio 的深色 Bento 信息架构重新设计，
 * 融合 Magic UI Portfolio 的滚动揭示和交互反馈。无外部字体、图片或运行时依赖。
 */
:root {
  color-scheme: dark;
  --bg: #0b0d0f;
  --bg-elevated: #101315;
  --card: #171b1d;
  --card-2: #202628;
  --card-soft: #292f30;
  --ink: #f2efe8;
  --muted: #98a19e;
  --muted-2: #67706d;
  --line: rgba(255,255,255,.11);
  --line-strong: rgba(255,255,255,.2);
  --lime: #c9ff4a;
  --lime-ink: #172000;
  --peach: #efcbbd;
  --peach-ink: #2e1d18;
  --violet: #a99cff;
  --violet-ink: #1b1634;
  --cyan: #87e8e5;
  --danger: #ff8d7f;
  --success: #a9ed63;
  --shadow: 0 28px 80px rgba(0,0,0,.28);
  --radius: 30px;
  --page: 1440px;
  --header-height: 88px;
  --ease: cubic-bezier(.2,.75,.2,1);
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9e9e3;
  --bg-elevated: #f4f3ed;
  --card: #f7f6f0;
  --card-2: #d9ded8;
  --card-soft: #cbd2cc;
  --ink: #151817;
  --muted: #626a67;
  --muted-2: #8e9692;
  --line: rgba(18,24,21,.12);
  --line-strong: rgba(18,24,21,.22);
  --shadow: 0 24px 70px rgba(27,34,30,.12);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scrollbar-color: var(--muted-2) var(--bg); }
body {
  min-width: 320px;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 2%, color-mix(in srgb, var(--violet) 9%, transparent), transparent 28rem),
    radial-gradient(circle at 92% 24%, color-mix(in srgb, var(--lime) 6%, transparent), transparent 32rem),
    var(--bg);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  transition: color .35s ease, background-color .35s ease;
}
body.menu-open, body.dialog-open { overflow: hidden; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
button { color: inherit; }
[hidden] { display: none !important; }
::selection { color: var(--lime-ink); background: var(--lime); }
:focus-visible { outline: 2px solid var(--lime); outline-offset: 4px; }

/* 顶部进度与环境光 */
.scroll-progress { position: fixed; z-index: 100; inset: 0 0 auto; height: 2px; pointer-events: none; }
.scroll-progress span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: var(--lime); }
.page-glow {
  position: fixed; z-index: -1; width: 42rem; height: 42rem; left: 50%; top: -28rem;
  transform: translateX(-50%); border-radius: 50%; pointer-events: none;
  background: color-mix(in srgb, var(--lime) 7%, transparent); filter: blur(90px);
}

/* 导航 */
.header-shell { position: sticky; z-index: 50; top: 0; padding: 18px clamp(16px, 3vw, 44px) 0; pointer-events: none; }
.topbar {
  max-width: var(--page); height: var(--header-height); margin: 0 auto; padding: 12px 15px 12px 18px;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  border: 1px solid var(--line); border-radius: 24px;
  background: color-mix(in srgb, var(--bg-elevated) 83%, transparent);
  box-shadow: 0 14px 44px rgba(0,0,0,.12); backdrop-filter: blur(22px) saturate(1.2);
  pointer-events: auto;
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; min-width: 205px; }
.brand-mark {
  width: 48px; aspect-ratio: 1; display: grid; place-items: center; border-radius: 15px;
  color: var(--lime-ink); background: var(--lime); font-size: 13px; font-weight: 900; letter-spacing: -.04em;
  transform: rotate(-4deg); transition: transform .4s var(--ease);
}
.brand:hover .brand-mark { transform: rotate(4deg) scale(1.05); }
.brand-copy { display: flex; flex-direction: column; line-height: 1.2; }
.brand-copy strong { font-size: 15px; letter-spacing: .04em; }
.brand-copy small { color: var(--muted); font: 600 9px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .12em; }
.desktop-nav { display: flex; align-items: center; gap: 6px; }
.desktop-nav a {
  position: relative; color: var(--muted); padding: 10px 15px; border-radius: 12px;
  text-decoration: none; font-size: 13px; font-weight: 650; transition: color .2s, background .2s;
}
.desktop-nav a::after {
  content: ""; position: absolute; left: 50%; bottom: 5px; width: 4px; height: 4px;
  border-radius: 50%; background: var(--lime); opacity: 0; transform: translate(-50%, 3px); transition: .2s;
}
.desktop-nav a:hover, .desktop-nav a.is-active { color: var(--ink); background: color-mix(in srgb, var(--card-2) 70%, transparent); }
.desktop-nav a.is-active::after { opacity: 1; transform: translate(-50%, 0); }
.nav-actions { display: flex; align-items: center; gap: 8px; }
.status-pill {
  display: inline-flex; align-items: center; gap: 8px; color: var(--muted); padding: 10px 13px;
  border: 1px solid var(--line); border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .06em;
}
.status-pill i { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 5px color-mix(in srgb, var(--lime) 12%, transparent); animation: status-pulse 2s infinite; }
.icon-button {
  width: 44px; height: 44px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 14px;
  background: var(--card); cursor: pointer; transition: transform .2s, background .2s, border-color .2s;
}
.icon-button:hover { transform: translateY(-2px); border-color: var(--line-strong); background: var(--card-2); }
.theme-icon { width: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-icon--sun { display: none; }
[data-theme="light"] .theme-icon--moon { display: none; }
[data-theme="light"] .theme-icon--sun { display: block; }
.menu-button { display: none; position: relative; }
.menu-button span { position: absolute; width: 18px; height: 1.5px; background: currentColor; transition: transform .25s var(--ease), top .25s; }
.menu-button span:first-child { top: 18px; }
.menu-button span:last-child { top: 24px; }
.menu-button.is-open span:first-child { top: 21px; transform: rotate(45deg); }
.menu-button.is-open span:last-child { top: 21px; transform: rotate(-45deg); }
.mobile-menu {
  max-width: var(--page); margin: 8px auto 0; padding: 10px; border: 1px solid var(--line); border-radius: 22px;
  background: color-mix(in srgb, var(--bg-elevated) 95%, transparent); box-shadow: var(--shadow); backdrop-filter: blur(22px); pointer-events: auto;
}
.mobile-menu a { display: flex; gap: 18px; padding: 16px; border-bottom: 1px solid var(--line); text-decoration: none; font-size: 18px; font-weight: 700; }
.mobile-menu a:last-child { border: 0; }
.mobile-menu a span { color: var(--lime); font: 600 10px ui-monospace, monospace; }

/* 通用布局与卡片 */
.site-shell { max-width: var(--page); margin: 0 auto; padding: 24px clamp(16px, 3vw, 44px) 0; }
.section-anchor { scroll-margin-top: calc(var(--header-height) + 40px); }
.bento-card, .experience-card, .project-card {
  position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card);
  transform: perspective(1200px) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg));
  transition: transform .45s var(--ease), border-color .3s, box-shadow .35s, background-color .35s;
  isolation: isolate;
}
.interactive-card::after {
  content: ""; position: absolute; z-index: -1; inset: 0; opacity: 0; pointer-events: none;
  background: radial-gradient(420px circle at var(--spot-x, 50%) var(--spot-y, 50%), rgba(255,255,255,.09), transparent 45%);
  transition: opacity .3s;
}
.interactive-card.has-pointer::after { opacity: 1; }
.interactive-card:hover { border-color: var(--line-strong); box-shadow: var(--shadow); }
.card-no { color: var(--muted); font: 650 10px/1 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .13em; }
.content-section { padding-top: clamp(100px, 12vw, 178px); }
.section-header { display: grid; grid-template-columns: 1fr 2fr; align-items: end; gap: 30px; padding: 0 6px 42px; }
.section-header > div { display: flex; align-items: center; gap: 12px; align-self: start; margin-top: 13px; }
.section-header > div > span {
  width: 34px; height: 34px; display: grid; place-items: center; color: var(--lime-ink); background: var(--lime);
  border-radius: 50%; font: 800 10px ui-monospace, monospace;
}
.section-header p { color: var(--muted); font: 650 11px ui-monospace, monospace; letter-spacing: .11em; }
.section-header h2 { max-width: 830px; font-size: clamp(38px, 5.2vw, 78px); line-height: .98; letter-spacing: -.055em; font-weight: 720; }
.section-header h2 em { color: var(--muted); font-family: Georgia, "Times New Roman", serif; font-weight: 400; }

/* 首屏 Bento */
.hero-grid { min-height: calc(100svh - var(--header-height) - 66px); display: grid; grid-template-columns: repeat(12, 1fr); grid-template-rows: minmax(290px, 1.35fr) minmax(220px, .82fr) 92px; gap: 14px; }
.hero-card { grid-column: span 8; grid-row: span 2; min-height: 610px; padding: clamp(28px, 4vw, 58px); background: var(--card-2); }
.hero-card::before {
  content: ""; position: absolute; z-index: -2; inset: 0; opacity: .3; pointer-events: none;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px; mask-image: linear-gradient(115deg, #000, transparent 72%);
}
.hero-copy { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; max-width: 770px; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--muted); margin-bottom: 24px; font: 700 11px ui-monospace, monospace; letter-spacing: .12em; }
.eyebrow > span { width: 32px; height: 1px; background: var(--lime); }
.hero-copy h1 { font-size: clamp(48px, 5.75vw, 90px); line-height: .91; letter-spacing: -.065em; font-weight: 760; }
.hero-copy h1 > span { display: block; }
.hero-copy .hero-hello { color: var(--muted); margin-bottom: .2em; font-size: .36em; line-height: 1.2; letter-spacing: -.02em; }
.hero-hello em { font-family: Georgia, "Times New Roman", serif; font-weight: 400; }
.hero-hello b { color: var(--ink); font-style: normal; font-weight: 750; }
.hero-copy mark { color: var(--lime-ink); background: var(--lime); border-radius: .15em; padding: 0 .12em .03em; }
.hero-copy > p { max-width: 630px; color: var(--muted); margin-top: 25px; font-size: clamp(14px, 1.3vw, 18px); line-height: 1.8; }
.hero-actions { display: flex; gap: 10px; margin-top: 28px; }
.button {
  min-height: 48px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 22px;
  border: 1px solid var(--line); border-radius: 14px; text-decoration: none; font-weight: 720; font-size: 13px; cursor: pointer;
  transition: transform .22s var(--ease), background .2s, color .2s, border-color .2s;
}
.button:hover { transform: translateY(-3px); }
.button--primary { color: var(--lime-ink); background: var(--lime); border-color: var(--lime); }
.button--ghost { color: var(--ink); background: color-mix(in srgb, var(--card) 75%, transparent); }
.button--ghost:hover { border-color: var(--line-strong); background: var(--card); }
.button:disabled { opacity: .55; cursor: wait; transform: none; }

.system-orbit { position: absolute; z-index: 0; width: clamp(245px, 26vw, 410px); aspect-ratio: 1; right: -7%; top: -9%; opacity: .82; }
.orbit { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 50%; animation: orbit-spin 18s linear infinite; }
.orbit--two { inset: 17%; animation-direction: reverse; animation-duration: 13s; }
.orbit i { position: absolute; left: 50%; top: -5px; width: 10px; height: 10px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 24px var(--lime); }
.orbit--two i { left: auto; right: 8%; top: 18%; background: var(--violet); box-shadow: 0 0 22px var(--violet); }
.orbit-core {
  position: absolute; inset: 33%; display: grid; place-items: center; border: 1px solid var(--line-strong); border-radius: 50%;
  font-size: clamp(25px, 3vw, 44px); font-weight: 900; letter-spacing: -.08em; background: color-mix(in srgb, var(--card) 82%, transparent); backdrop-filter: blur(8px);
}
.orbit-core span { position: absolute; bottom: 17%; color: var(--muted); font: 700 7px ui-monospace, monospace; letter-spacing: .2em; }
.orbit-label { position: absolute; padding: 7px 9px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; background: var(--card); font-size: 9px; }
.orbit-label--api { left: 4%; top: 41%; }
.orbit-label--db { right: 4%; bottom: 25%; }
.orbit-label--mq { right: 15%; top: 17%; }

.identity-card { grid-column: span 4; padding: 24px; display: flex; flex-direction: column; background: var(--peach); color: var(--peach-ink); }
.identity-card::before { content: ""; position: absolute; inset: 0; opacity: .18; background-image: radial-gradient(var(--peach-ink) .8px, transparent .8px); background-size: 10px 10px; }
.identity-top, .identity-bottom { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; }
.identity-top { font: 750 10px ui-monospace, monospace; letter-spacing: .1em; }
.cross { font-size: 19px; animation: orbit-spin 10s linear infinite; }
.portrait { position: relative; flex: 1; min-height: 185px; display: grid; place-items: center; }
.portrait-grid { position: absolute; width: 76%; aspect-ratio: 1; border: 1px solid rgba(46,29,24,.25); border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 16px, rgba(46,29,24,.08) 17px 18px); }
.portrait-ring { position: absolute; width: 65%; aspect-ratio: 1; border: 1px solid rgba(46,29,24,.35); border-radius: 49% 51% 63% 37% / 42% 58% 42% 58%; animation: portrait-morph 8s ease-in-out infinite, orbit-spin 24s linear infinite; }
.portrait-ring--two { width: 48%; animation-direction: reverse; animation-duration: 10s, 18s; }
.portrait-name { position: relative; z-index: 2; font-size: clamp(46px, 5vw, 76px); font-weight: 900; letter-spacing: -.13em; transform: translateX(-.06em); }
.code-chip { position: absolute; z-index: 3; padding: 7px 9px; border: 1px solid rgba(46,29,24,.25); border-radius: 9px; background: rgba(255,255,255,.25); font: 700 9px ui-monospace, monospace; }
.code-chip--one { left: 7%; bottom: 18%; transform: rotate(-8deg); }
.code-chip--two { right: 9%; top: 20%; transform: rotate(9deg); }
.identity-bottom { padding-top: 15px; border-top: 1px solid rgba(46,29,24,.22); }
.identity-bottom > div { display: flex; flex-direction: column; }
.identity-bottom small { opacity: .58; font: 700 8px ui-monospace, monospace; letter-spacing: .15em; }
.identity-bottom strong { font-size: 14px; }
.identity-arrow { width: 38px; height: 38px; display: grid; place-items: center; border: 1px solid rgba(46,29,24,.25); border-radius: 50%; }

.signal-card { grid-column: span 4; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; background: var(--card); }
.signal-head { display: flex; justify-content: space-between; color: var(--muted); font: 700 9px ui-monospace, monospace; letter-spacing: .1em; }
.signal-label { display: flex; align-items: center; gap: 8px; }
.signal-label i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 12px var(--lime); }
.signal-location { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 0; }
.signal-location strong { font-size: clamp(34px, 3.3vw, 52px); letter-spacing: -.06em; }
.signal-location time { color: var(--lime); font: 700 15px ui-monospace, monospace; }
.mini-stats { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); }
.mini-stats > div { padding-top: 14px; border-right: 1px solid var(--line); }
.mini-stats > div:not(:first-child) { padding-left: 12px; }
.mini-stats > div:last-child { border: 0; }
.mini-stats strong { display: block; font-size: clamp(21px, 2vw, 29px); letter-spacing: -.05em; }
.mini-stats strong span { color: var(--lime); }
.mini-stats small { display: block; color: var(--muted); margin-top: 2px; font-size: 9px; }

.stack-strip { grid-column: span 12; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: 0 25px; background: var(--bg-elevated); }
.stack-title { display: flex; align-items: center; gap: 10px; color: var(--muted); white-space: nowrap; font: 700 9px ui-monospace, monospace; letter-spacing: .13em; }
.stack-title i { width: 6px; height: 6px; border-radius: 50%; background: var(--lime); }
.marquee { min-width: 0; overflow: hidden; mask-image: linear-gradient(90deg, transparent, #000 7%, #000 93%, transparent); }
.marquee-track { width: max-content; display: flex; align-items: center; animation: marquee 28s linear infinite; }
.marquee-track span { display: flex; align-items: center; color: var(--ink); white-space: nowrap; font-size: clamp(16px, 1.7vw, 22px); font-weight: 700; }
.marquee-track span::after { content: "✦"; color: var(--lime); margin: 0 24px; font-size: 10px; }
.stack-end { color: var(--muted); white-space: nowrap; font: 650 9px ui-monospace, monospace; letter-spacing: .08em; }

/* 关于 */
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.about-story { grid-column: span 7; min-height: 500px; padding: clamp(28px, 4vw, 52px); display: flex; flex-direction: column; justify-content: space-between; }
.story-mark { color: var(--lime); height: 70px; font: 110px/.9 Georgia, serif; }
.story-copy { max-width: 730px; margin: 20px 0 auto; }
.story-copy p { font-size: clamp(20px, 2.25vw, 34px); line-height: 1.5; letter-spacing: -.03em; }
.story-copy p + p { color: var(--muted); margin-top: 16px; }
.story-footer { display: flex; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); padding-top: 28px; font: 650 9px ui-monospace, monospace; letter-spacing: .1em; }
.manifesto-card { grid-column: span 5; min-height: 500px; padding: 28px; color: var(--lime-ink); background: var(--lime); }
.manifesto-top { display: flex; justify-content: space-between; font: 800 9px ui-monospace, monospace; letter-spacing: .12em; }
.manifesto-card ol { list-style: none; margin-top: 68px; }
.manifesto-card li { display: grid; grid-template-columns: 32px 1fr; padding: 17px 0; border-top: 1px solid rgba(23,32,0,.2); }
.manifesto-card li > span { font: 700 9px ui-monospace, monospace; }
.manifesto-card strong { font-size: clamp(25px, 2.6vw, 40px); letter-spacing: -.05em; line-height: 1; }
.manifesto-card small { grid-column: 2; opacity: .65; margin-top: 7px; font-size: 11px; }
.radar-card { grid-column: span 12; min-height: 260px; padding: 28px; display: grid; grid-template-columns: 1fr 1.4fr 1fr; align-items: center; background: var(--card-2); }
.radar { position: relative; width: 205px; aspect-ratio: 1; justify-self: center; display: grid; place-items: center; }
.radar-circle { position: absolute; inset: 0; border: 1px solid var(--line-strong); border-radius: 50%; }
.radar-circle--two { inset: 24%; }
.radar-line { position: absolute; width: 50%; height: 1px; left: 50%; top: 50%; transform-origin: left; background: linear-gradient(90deg, var(--lime), transparent); animation: radar-scan 4s linear infinite; }
.radar::before, .radar::after { content: ""; position: absolute; background: var(--line); }
.radar::before { width: 100%; height: 1px; }
.radar::after { width: 1px; height: 100%; }
.radar b { z-index: 2; color: var(--lime); font: 800 10px ui-monospace, monospace; letter-spacing: .1em; }
.radar-dot { position: absolute; width: 7px; height: 7px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 16px var(--lime); }
.radar-dot--one { left: 26%; top: 30%; }
.radar-dot--two { right: 17%; bottom: 32%; animation: status-pulse 1.8s infinite; }
.radar-tags { display: flex; flex-wrap: wrap; gap: 9px; justify-content: flex-end; }
.radar-tags span { color: var(--muted); padding: 10px 13px; border: 1px solid var(--line); border-radius: 999px; font-size: 11px; }

/* 经历 */
.experience-list { display: flex; flex-direction: column; gap: 12px; }
.experience-card {
  min-height: 160px; padding: 28px; display: grid; grid-template-columns: 75px 175px minmax(230px, .8fr) 1.3fr 62px;
  align-items: center; gap: 20px; background: var(--card);
}
.experience-index { color: var(--muted-2); font: 700 11px ui-monospace, monospace; }
.experience-period { color: var(--muted); font: 650 11px ui-monospace, monospace; letter-spacing: .04em; }
.experience-role h3 { font-size: clamp(19px, 2vw, 28px); letter-spacing: -.04em; }
.experience-role p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.experience-role p span { color: var(--lime); }
.experience-role p b { color: var(--ink); }
.experience-desc { color: var(--muted); font-size: 13px; line-height: 1.8; }
.experience-mark { position: relative; width: 52px; aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; }
.experience-mark span { width: 7px; height: 7px; border-radius: 50%; background: var(--lime); }
.experience-mark i { position: absolute; inset: 7px; border: 1px dashed var(--line-strong); border-radius: 50%; animation: orbit-spin 8s linear infinite; }
.experience-card:hover .experience-mark { border-color: var(--lime); }

/* 项目 */
.project-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 14px; }
.project-card { grid-column: span 6; min-height: 620px; display: grid; grid-template-rows: minmax(300px, 1.15fr) 1fr; background: var(--card); }
.project-card--feature { grid-column: span 7; }
.project-card:nth-child(2) { grid-column: span 5; }
.project-card:last-child:nth-child(odd) { grid-column: span 12; min-height: 430px; grid-template-columns: 1.05fr 1fr; grid-template-rows: 1fr; }
.project-visual { min-height: 300px; padding: 18px; border-bottom: 1px solid rgba(0,0,0,.15); color: var(--lime-ink); background: var(--lime); overflow: hidden; }
.project-card--violet .project-visual { color: var(--violet-ink); background: var(--violet); }
.project-card--peach .project-visual { color: var(--peach-ink); background: var(--peach); }
.visual-toolbar { display: flex; align-items: center; gap: 6px; height: 24px; font: 750 8px ui-monospace, monospace; letter-spacing: .1em; }
.visual-toolbar i { width: 6px; height: 6px; border: 1px solid currentColor; border-radius: 50%; }
.visual-toolbar span { margin-left: auto; opacity: .65; }
.visual-stage { position: relative; height: calc(100% - 24px); display: grid; place-items: center; }
.visual-grid { position: absolute; inset: 4% 0 0; opacity: .18; background-image: linear-gradient(currentColor 1px, transparent 1px), linear-gradient(90deg, currentColor 1px, transparent 1px); background-size: 28px 28px; mask-image: radial-gradient(circle, #000, transparent 73%); }
.visual-window {
  position: relative; z-index: 2; width: min(62%, 330px); aspect-ratio: 1.45; padding: 17px; border: 1px solid currentColor; border-radius: 18px;
  background: color-mix(in srgb, white 18%, transparent); box-shadow: 18px 18px 0 color-mix(in srgb, currentColor 14%, transparent); transform: rotate(-3deg);
  transition: transform .55s var(--ease), box-shadow .55s var(--ease);
}
.project-card:hover .visual-window { transform: rotate(2deg) translateY(-6px); box-shadow: -12px 20px 0 color-mix(in srgb, currentColor 14%, transparent); }
.visual-window > span { display: inline-block; width: 7px; height: 7px; margin-right: 4px; border: 1px solid currentColor; border-radius: 50%; }
.visual-code { margin-top: 22px; display: flex; flex-direction: column; gap: 10px; }
.visual-code i { display: block; width: 74%; height: 5px; border-radius: 9px; background: currentColor; opacity: .4; }
.visual-code i:nth-child(2) { width: 48%; margin-left: 13%; opacity: .28; }
.visual-code i:nth-child(3) { width: 62%; margin-left: 13%; opacity: .28; }
.visual-code i:nth-child(4) { width: 35%; opacity: .4; }
.project-glyph { position: absolute; z-index: 3; right: 7%; bottom: 2%; font-size: clamp(75px, 10vw, 150px); font-weight: 900; line-height: 1; letter-spacing: -.14em; opacity: .9; }
.visual-pulse { position: absolute; left: 8%; top: 17%; width: 13px; height: 13px; border: 1px solid currentColor; border-radius: 50%; animation: status-pulse-dark 2.2s infinite; }
.project-copy { padding: clamp(25px, 3vw, 38px); display: flex; flex-direction: column; align-items: flex-start; }
.project-meta-top { width: 100%; display: flex; justify-content: space-between; color: var(--muted); font: 700 9px ui-monospace, monospace; letter-spacing: .12em; }
.project-meta-top span:last-child { color: var(--lime); }
.project-copy h3 { margin-top: 22px; font-size: clamp(28px, 3.3vw, 48px); line-height: 1; letter-spacing: -.055em; }
.project-copy > p { color: var(--muted); margin-top: 15px; font-size: 13px; line-height: 1.8; }
.project-tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 18px; }
.project-tags span { padding: 7px 10px; color: var(--muted); border: 1px solid var(--line); border-radius: 999px; font-size: 9px; }
.project-link { margin-top: auto; padding-top: 24px; display: flex; align-items: center; gap: 10px; text-decoration: none; font-size: 12px; font-weight: 750; }
.project-link i { width: 31px; height: 31px; display: grid; place-items: center; color: var(--lime-ink); background: var(--lime); border-radius: 50%; font-style: normal; transition: transform .25s var(--ease); }
.project-link:hover i { transform: translate(3px, -3px) rotate(8deg); }

/* 联系 */
.contact-section { padding-bottom: 100px; }
.contact-grid { display: grid; grid-template-columns: 7fr 5fr; gap: 14px; }
.contact-links-card { min-height: 520px; padding: clamp(28px, 4vw, 48px); }
.contact-links { margin-top: 75px; }
.contact-links > a, .contact-static { min-height: 100px; display: grid; grid-template-columns: 45px 1fr 40px; align-items: center; gap: 18px; border-top: 1px solid var(--line); text-decoration: none; transition: padding .25s var(--ease), color .2s; }
.contact-links > a:hover { color: var(--lime); padding-left: 8px; }
.contact-index { color: var(--muted-2); font: 700 9px ui-monospace, monospace; }
.contact-label { min-width: 0; display: flex; flex-direction: column; }
.contact-label small { color: var(--muted); font-size: 10px; }
.contact-label strong { overflow: hidden; text-overflow: ellipsis; font-size: clamp(15px, 1.7vw, 22px); }
.contact-links i { width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-style: normal; }
.contact-cta { min-height: 520px; padding: 30px; display: flex; flex-direction: column; justify-content: space-between; color: var(--violet-ink); background: var(--violet); }
.contact-orb { position: relative; width: 200px; aspect-ratio: 1; align-self: flex-end; display: grid; place-items: center; }
.contact-orb::before, .contact-orb i { content: ""; position: absolute; inset: 0; border: 1px solid rgba(27,22,52,.27); border-radius: 50%; }
.contact-orb i:first-child { inset: 18%; border-style: dashed; animation: orbit-spin 12s linear infinite; }
.contact-orb i:nth-child(2) { inset: 34%; background: rgba(255,255,255,.15); }
.contact-orb b { z-index: 2; font: 800 9px ui-monospace, monospace; letter-spacing: .15em; }
.contact-cta-copy { position: relative; }
.contact-cta-copy > span { font: 800 9px ui-monospace, monospace; letter-spacing: .13em; }
.contact-cta h3 { margin-top: 10px; font-size: clamp(50px, 6vw, 84px); line-height: .84; letter-spacing: -.07em; }
.contact-cta h3 em { font-family: Georgia, serif; font-weight: 400; }
.round-button {
  position: absolute; right: 0; bottom: 0; width: 62px; aspect-ratio: 1; display: grid; place-items: center; color: var(--ink);
  border: 0; border-radius: 50%; background: var(--bg); text-decoration: none; font-size: 22px; cursor: pointer; transition: transform .3s var(--ease);
}
.round-button:hover { transform: rotate(12deg) scale(1.07); }

/* 页脚 */
.footer { max-width: var(--page); margin: 0 auto; padding: 28px clamp(22px, 3vw, 50px) 42px; display: flex; justify-content: space-between; gap: 20px; color: var(--muted); border-top: 1px solid var(--line); font: 650 9px ui-monospace, monospace; letter-spacing: .08em; }
.footer > div { display: flex; gap: 28px; }
.footer a { text-decoration: none; transition: color .2s; }
.footer a:hover { color: var(--lime); }

/* 留言弹窗 */
.contact-dialog {
  width: min(760px, calc(100vw - 28px)); max-height: calc(100svh - 28px); margin: auto; padding: 0;
  color: var(--ink); border: 1px solid var(--line-strong); border-radius: 30px; background: var(--bg-elevated); box-shadow: 0 40px 130px rgba(0,0,0,.55); overflow: auto;
}
.contact-dialog::backdrop { background: rgba(3,5,6,.77); backdrop-filter: blur(12px); }
.dialog-shell { padding: clamp(24px, 5vw, 52px); }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; }
.dialog-head span { color: var(--lime); font: 750 9px ui-monospace, monospace; letter-spacing: .14em; }
.dialog-head h2 { margin-top: 7px; font-size: clamp(34px, 5vw, 55px); line-height: 1; letter-spacing: -.055em; }
.dialog-close { width: 43px; height: 43px; border: 1px solid var(--line); border-radius: 50%; background: var(--card); font-size: 24px; cursor: pointer; transition: transform .25s, background .2s; }
.dialog-close:hover { transform: rotate(90deg); background: var(--card-2); }
.dialog-intro { max-width: 510px; color: var(--muted); margin-top: 18px; font-size: 13px; }
.message-form { margin-top: 34px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.message-form label { display: flex; flex-direction: column; gap: 8px; margin-bottom: 15px; }
.message-form label > span { color: var(--muted); font-size: 11px; font-weight: 700; }
.message-form label > span i { color: var(--lime); font-style: normal; }
.message-form input, .message-form textarea {
  width: 100%; color: var(--ink); padding: 14px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  outline: none; font-size: 14px; transition: border-color .2s, box-shadow .2s, background .2s;
}
.message-form textarea { min-height: 150px; resize: vertical; line-height: 1.7; }
.message-form input:focus, .message-form textarea:focus { border-color: var(--lime); box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 10%, transparent); background: var(--card-2); }
.message-form input::placeholder, .message-form textarea::placeholder { color: var(--muted-2); }
.form-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 8px; }
.msg-status { color: var(--muted); font-size: 12px; }
.msg-status--success { color: var(--success); }
.msg-status--error { color: var(--danger); }
.honeypot { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* 渐入 */
.js .reveal { opacity: 0; transform: translateY(34px) scale(.985); }
.js .reveal.is-visible { opacity: 1; transform: perspective(1200px) translateY(0) scale(1) rotateX(var(--tilt-x, 0deg)) rotateY(var(--tilt-y, 0deg)); transition: opacity .7s var(--ease) var(--reveal-delay, 0ms), transform .8s var(--ease) var(--reveal-delay, 0ms), border-color .3s, box-shadow .35s; }

/* 动画 */
@keyframes status-pulse { 0%,100% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--lime) 10%, transparent); } 50% { box-shadow: 0 0 0 8px transparent; } }
@keyframes status-pulse-dark { 0%,100% { box-shadow: 0 0 0 0 currentColor; } 50% { box-shadow: 0 0 0 12px transparent; } }
@keyframes orbit-spin { to { transform: rotate(360deg); } }
@keyframes portrait-morph { 0%,100% { border-radius: 49% 51% 63% 37% / 42% 58% 42% 58%; } 50% { border-radius: 62% 38% 45% 55% / 55% 44% 56% 45%; } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes radar-scan { to { transform: rotate(360deg); } }

/* 平板 */
@media (max-width: 1080px) {
  :root { --header-height: 76px; --radius: 25px; }
  .desktop-nav { display: none; }
  .menu-button { display: grid; }
  .hero-grid { grid-template-rows: minmax(560px, auto) 330px 230px 86px; }
  .hero-card { grid-column: span 12; grid-row: auto; min-height: 560px; }
  .identity-card, .signal-card { grid-column: span 6; }
  .stack-strip { grid-row: auto; }
  .about-story, .manifesto-card { grid-column: span 6; }
  .experience-card { grid-template-columns: 55px 145px minmax(200px, .8fr) 1.2fr 50px; gap: 14px; }
  .project-card, .project-card--feature, .project-card:nth-child(2) { grid-column: span 6; }
  .project-card:last-child:nth-child(odd) { grid-column: span 12; }
}

/* 手机 */
@media (max-width: 760px) {
  :root { --header-height: 68px; --radius: 22px; }
  .header-shell { padding: 10px 10px 0; }
  .topbar { height: var(--header-height); padding: 9px 10px 9px 12px; border-radius: 19px; }
  .brand { min-width: 0; }
  .brand-mark { width: 42px; border-radius: 13px; }
  .brand-copy small, .status-pill { display: none; }
  .icon-button { width: 42px; height: 42px; border-radius: 13px; }
  .site-shell { padding: 13px 10px 0; }
  .hero-grid { min-height: auto; display: flex; flex-direction: column; gap: 10px; }
  .hero-card { min-height: 455px; padding: 24px 20px; }
  .hero-copy { justify-content: flex-end; }
  .hero-copy h1 { font-size: clamp(44px, 13.2vw, 62px); line-height: .94; }
  .hero-copy .hero-hello { font-size: .4em; margin-bottom: .35em; }
  .hero-copy > p { margin-top: 18px; font-size: 13px; line-height: 1.7; }
  .hero-actions { width: 100%; margin-top: 22px; }
  .hero-actions .button { flex: 1; min-height: 45px; padding: 0 12px; gap: 10px; font-size: 12px; }
  .system-orbit { width: 250px; right: -17%; top: -7%; opacity: .65; }
  .identity-card { min-height: 390px; padding: 20px; }
  .portrait { min-height: 250px; }
  .portrait-name { font-size: 70px; }
  .signal-card { min-height: 250px; padding: 20px; }
  .signal-location strong { font-size: 42px; }
  .mini-stats small { font-size: 8px; }
  .stack-strip { min-height: 76px; grid-template-columns: auto 1fr; padding: 0 18px; gap: 13px; }
  .stack-end { display: none; }
  .marquee-track span::after { margin: 0 15px; }
  .content-section { padding-top: 100px; }
  .section-header { display: block; padding: 0 4px 28px; }
  .section-header > div { margin: 0 0 25px; }
  .section-header h2 { font-size: clamp(39px, 11vw, 54px); }
  .about-grid { display: flex; flex-direction: column; gap: 10px; }
  .about-story { min-height: 440px; padding: 25px 21px; }
  .story-mark { height: 55px; font-size: 90px; }
  .story-copy p { font-size: 20px; }
  .manifesto-card { min-height: 450px; padding: 22px; }
  .manifesto-card ol { margin-top: 70px; }
  .manifesto-card strong { font-size: 31px; }
  .radar-card { min-height: 470px; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; }
  .radar { align-self: center; }
  .radar-tags { justify-content: flex-start; }
  .experience-list { gap: 10px; }
  .experience-card { min-height: 275px; padding: 22px; display: grid; grid-template-columns: 42px 1fr 48px; grid-template-rows: auto auto 1fr; align-items: start; gap: 10px 7px; }
  .experience-index { grid-column: 1; grid-row: 1; }
  .experience-period { grid-column: 2; grid-row: 1; }
  .experience-role { grid-column: 1 / 3; grid-row: 2; padding-top: 18px; }
  .experience-desc { grid-column: 1 / 4; grid-row: 3; padding-top: 8px; }
  .experience-mark { grid-column: 3; grid-row: 1 / 3; width: 44px; justify-self: end; }
  .project-grid { display: flex; flex-direction: column; gap: 10px; }
  .project-card, .project-card--feature, .project-card:nth-child(2), .project-card:last-child:nth-child(odd) { min-height: 590px; display: grid; grid-template-columns: 1fr; grid-template-rows: 300px 1fr; }
  .project-copy { padding: 25px 22px; }
  .project-copy h3 { font-size: 34px; }
  .contact-section { padding-bottom: 75px; }
  .contact-grid { display: flex; flex-direction: column; gap: 10px; }
  .contact-links-card { min-height: 440px; padding: 24px 21px; }
  .contact-links { margin-top: 48px; }
  .contact-links > a, .contact-static { min-height: 90px; grid-template-columns: 30px minmax(0,1fr) 34px; gap: 10px; }
  .contact-label strong { font-size: 14px; }
  .contact-cta { min-height: 460px; padding: 22px; }
  .contact-orb { width: 190px; }
  .contact-cta h3 { font-size: 62px; }
  .round-button { width: 55px; }
  .footer { padding: 24px 15px 35px; flex-direction: column; }
  .footer > div { flex-direction: column; gap: 6px; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .dialog-shell { padding: 25px 20px; }
  .dialog-head h2 { font-size: 38px; }
  .form-footer { align-items: stretch; flex-direction: column; }
  .form-footer .button { width: 100%; }
}

@media (max-width: 390px) {
  .hero-copy h1 { font-size: 42px; }
  .hero-actions { flex-direction: column; }
  .identity-card { min-height: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
  .js .reveal { opacity: 1; transform: none; }
}

/* 错误页仍复用此样式 */
.error-page { min-height: 70vh; display: flex; flex-direction: column; justify-content: center; }
.error-page .code { color: var(--lime); font-size: 74px; font-weight: 850; line-height: 1; }
.error-page p { color: var(--muted); margin: 18px 0 28px; }
.error-page a { color: var(--lime); text-decoration: none; }
