@charset "UTF-8";
/* genn.work — 全站样式
   浅色、GitHub 风格:浅灰背景、白色内容区、蓝色链接、克制的边框。
   只用一份 CSS,不依赖框架。 */

:root {
  --bg: #f6f8fa;
  --surface: #ffffff;
  --border: #d0d7de;
  --border-soft: #e6e9ee;
  --text: #1f2328;
  --muted: #656d76;
  --link: #0969da;
  --link-hover: #0550ae;
  --accent-soft: #ddf4ff;
  --accent-border: #54aeff;
  --ok-soft: #dafbe1;
  --ok-text: #1a7f37;
  --warn-soft: #fff8c5;
  --warn-text: #9a6700;
  --purple-soft: #fbefff;
  --purple-text: #8250df;
  --shadow: 0 1px 2px rgba(31, 35, 40, 0.06);
  --radius: 8px;
  --radius-lg: 12px;
  --maxw: 1012px;
  --font: "IBM Plex Sans", "IBM Plex Sans JP", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); text-decoration: none; }
a:hover { color: var(--link-hover); text-decoration: underline; }
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-border);
  outline-offset: 2px;
  border-radius: 4px;
}

img, video, iframe { max-width: 100%; }
img { height: auto; }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; font-weight: 600; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); }
h2 { font-size: clamp(1.35rem, 1.1rem + 1vw, 1.75rem); }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
small, .muted { color: var(--muted); }
code, kbd { font-family: var(--mono); font-size: .9em; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 4px; padding: .05em .35em; }
hr { border: 0; border-top: 1px solid var(--border); margin: 2rem 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

/* ---------- 顶部导航 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header .wrap {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 16px;
  min-height: 64px;
  padding-top: 8px;
  padding-bottom: 8px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.brand:hover { text-decoration: none; color: var(--text); }
.brand img { width: 44px; height: 44px; border-radius: 50%; display: block; }
.brand span { font-size: 1.05rem; }

.nav { display: flex; gap: 4px; flex-wrap: wrap; margin-left: auto; }
.nav a {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 6px;
  color: var(--text);
  font-weight: 500;
  font-size: .95rem;
}
.nav a:hover { background: var(--bg); text-decoration: none; }
.nav a[aria-current="page"] { font-weight: 600; box-shadow: inset 0 -2px 0 #fd8c73; }

.lang-switch {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--surface);
}
.lang-switch button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .85rem;
  padding: 5px 9px;
  cursor: pointer;
  border-right: 1px solid var(--border);
}
.lang-switch button:last-child { border-right: 0; }
.lang-switch button:hover { background: var(--bg); color: var(--text); }
.lang-switch button[aria-pressed="true"] { background: var(--accent-soft); color: var(--link-hover); font-weight: 600; }

@media (max-width: 639px) {
  .site-header .wrap { padding-top: 10px; padding-bottom: 10px; }
  .brand span { display: none; }
  .nav { order: 3; width: 100%; margin-left: 0; overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { white-space: nowrap; }
  .lang-switch { margin-left: auto; }
}

/* ---------- 正文 ---------- */
main { flex: 1; padding: 32px 0 48px; }
@media (min-width: 768px) { main { padding: 48px 0 64px; } }

.page-head { margin-bottom: 28px; }
.page-head .lead { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }

.section { margin-bottom: 40px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.section-head h2 { margin: 0; }
.section-head .more { font-size: .95rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}
@media (min-width: 768px) { .card { padding: 24px; } }

.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid.cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid.cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 640px) and (max-width: 899px) { .grid.cols-3 { grid-template-columns: repeat(2, 1fr); } }

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 500;
  font-size: .95rem;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}
.btn:hover { background: var(--bg); text-decoration: none; color: var(--text); border-color: #afb8c1; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: #1f883d; border-color: rgba(31, 35, 40, .15); color: #fff; }
.btn.primary:hover { background: #1a7f37; color: #fff; }
.btn.small { padding: 4px 10px; font-size: .85rem; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* 标签 */
.tag {
  display: inline-block;
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.6;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid transparent;
  vertical-align: middle;
  white-space: nowrap;
}
.tag.ok { background: var(--ok-soft); color: var(--ok-text); }
.tag.warn { background: var(--warn-soft); color: var(--warn-text); }
.tag.info { background: var(--accent-soft); color: var(--link-hover); }
.tag.purple { background: var(--purple-soft); color: var(--purple-text); }
.tag.neutral { background: var(--bg); color: var(--muted); border-color: var(--border); }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }

/* ---------- 首页 ---------- */
.hero {
  display: grid;
  gap: 24px;
  align-items: center;
  grid-template-columns: 1fr;
  margin-bottom: 44px;
}
@media (min-width: 768px) { .hero { grid-template-columns: 180px 1fr; gap: 36px; } }
.hero-logo { display: flex; justify-content: flex-start; }
.hero-logo img { width: 128px; height: 128px; }
@media (min-width: 768px) { .hero-logo img { width: 160px; height: 160px; } }
.hero h1 { margin-bottom: .35em; }
.hero .intro { font-size: 1.1rem; max-width: 62ch; }
.hero .btn-row { margin-top: 18px; }

.project-card { display: flex; flex-direction: column; gap: 8px; height: 100%; }
.project-card h3 { margin: 0; }
.project-card h3 a { color: var(--text); }
.project-card .desc { color: var(--muted); font-size: .95rem; flex: 1; }
.project-card .links { display: flex; gap: 14px; flex-wrap: wrap; font-size: .9rem; }
.project-card .tech { font-size: .8rem; color: var(--muted); font-family: var(--mono); }

.entry-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .entry-list { grid-template-columns: repeat(3, 1fr); } }
.entry-list a.card { display: block; color: var(--text); transition: border-color .12s ease, box-shadow .12s ease; }
.entry-list a.card:hover { text-decoration: none; border-color: var(--accent-border); box-shadow: 0 2px 8px rgba(31, 35, 40, .08); }
.entry-list h3 { margin-bottom: 4px; color: var(--link); }
.entry-list p { color: var(--muted); font-size: .95rem; }

/* ---------- About:标签页 ---------- */
.tabs { border-bottom: 1px solid var(--border); display: flex; gap: 4px; margin-bottom: 20px; overflow-x: auto; }
.tabs [role="tab"] {
  appearance: none;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: .95rem;
  color: var(--muted);
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
}
.tabs [role="tab"]:hover { color: var(--text); background: rgba(175, 184, 193, .15); border-radius: 6px 6px 0 0; }
.tabs [role="tab"][aria-selected="true"] { color: var(--text); font-weight: 600; border-bottom-color: #fd8c73; }
[role="tabpanel"][hidden] { display: none; }

.profile { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .profile { grid-template-columns: 200px 1fr; gap: 28px; } }
.profile figure { margin: 0; }
.profile figure img { width: 100%; max-width: 200px; border-radius: var(--radius); border: 1px solid var(--border); display: block; }
.profile figcaption { font-size: .85rem; color: var(--muted); margin-top: 6px; font-style: italic; }
.profile .name { font-size: 1.25rem; font-weight: 600; margin-bottom: .25em; }
.profile ruby rt { font-size: .6em; color: var(--muted); }

.archive-note {
  background: var(--warn-soft);
  border: 1px solid rgba(154, 103, 0, .25);
  color: #4d3800;
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: .9rem;
  margin-bottom: 18px;
}
.archive-body h2 { font-size: 1.5rem; }
.archive-body .cta { display: inline-block; margin-top: 12px; font-size: 1.2rem; font-weight: 600; }

dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; font-size: .95rem; }
dl.facts dt { color: var(--muted); }
dl.facts dd { margin: 0; }

/* ---------- Work:Labor 时间线 ---------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 8px; bottom: 8px; width: 2px; background: var(--border); }
.timeline li { position: relative; padding: 0 0 22px 40px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline .dot {
  position: absolute; left: 0; top: 4px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--border);
  display: grid; place-items: center;
  font-size: .75rem; font-weight: 700; color: var(--muted);
}
.timeline li.current .dot { border-color: #1f883d; color: var(--ok-text); }
.timeline li.next .dot { border-style: dashed; border-color: var(--accent-border); color: var(--link); }
.timeline h3 { margin: 0 0 2px; font-size: 1.05rem; }
.timeline p { margin: 0; color: var(--muted); font-size: .95rem; }
.timeline li.next .card { background: var(--accent-soft); border-color: var(--accent-border); }
.timeline li.next p { color: var(--text); }

/* ---------- Work:项目 ---------- */
.project { scroll-margin-top: 90px; margin-bottom: 28px; }
.project-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 6px; }
.project-head h3 { margin: 0; font-size: 1.35rem; }
.project-head .repo { font-size: .9rem; font-family: var(--mono); }
.project-grid { display: grid; gap: 20px; grid-template-columns: 1fr; margin-top: 16px; }
@media (min-width: 860px) { .project-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); } }
.project-grid h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 14px 0 4px; }
.project-grid h4:first-child { margin-top: 0; }
.project-grid ul { margin: 0 0 .5em 1.2em; padding: 0; }
.project-grid li { margin-bottom: .25em; }
.media-stack { display: grid; gap: 12px; }
.media-stack figure { margin: 0; }
.media-stack img { width: 100%; border: 1px solid var(--border); border-radius: 6px; background: #fff; display: block; }
.media-stack figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.fine { font-size: .82rem; color: var(--muted); }

/* ---------- Demo 盒子 ---------- */
.demo {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  padding: 16px;
  margin-top: 16px;
}
.demo-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.demo-head strong { font-size: .95rem; }
.demo p.note { font-size: .82rem; color: var(--muted); margin: 10px 0 0; }
.demo label { font-size: .9rem; display: block; margin-bottom: 6px; }
.demo input[type="range"] { width: 100%; max-width: 420px; display: block; }
.demo-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }

/* Usage Monitor 模拟:输入框光晕 */
.halo-stage { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 24px 16px 34px; margin: 8px 0 12px; }
.halo-stage.dark { background: #2b2b2b; border-color: #444; }
.composer {
  --halo: #22c55e;
  --fill: 100%;
  position: relative;
  display: flex; align-items: center; gap: 10px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--border);
  padding: 10px 10px 10px 16px;
  max-width: 560px;
  margin: 0 auto;
  box-shadow: 0 0 0 1px var(--halo), 0 0 18px 2px var(--halo);
  transition: box-shadow .4s ease;
}
.halo-stage.dark .composer { background: #3a3a3a; border-color: #555; color: #eee; }
.composer .text { flex: 1; color: var(--muted); font-size: .95rem; }
.halo-stage.dark .composer .text { color: #bbb; }
.composer .send {
  width: 36px; height: 36px; border-radius: 10px; border: 0;
  background: conic-gradient(var(--halo) var(--fill), #e5e7eb 0);
  display: grid; place-items: center; padding: 0; cursor: default;
  transition: background .4s ease;
}
.composer .send::before { content: "↑"; width: 28px; height: 28px; border-radius: 7px; background: #1f2328; color: #fff; display: grid; place-items: center; font-weight: 700; }
.composer .meta { position: absolute; left: 16px; bottom: -24px; font-size: .75rem; color: var(--muted); font-family: var(--mono); }
.halo-stage.dark .composer .meta { color: #aaa; }

/* Commute Calibrator 模拟 */
.calib { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .calib { grid-template-columns: 1fr 1fr; } }
.calib .panel { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.calib .big { font-size: 1.6rem; font-weight: 600; font-family: var(--mono); }
.calib .samples { display: flex; flex-wrap: wrap; gap: 6px; min-height: 28px; margin: 8px 0; }
.calib .samples span { font-family: var(--mono); font-size: .85rem; background: var(--bg); border: 1px solid var(--border-soft); border-radius: 4px; padding: 1px 6px; }
.calib .proposal { border-color: var(--accent-border); background: var(--accent-soft); }
.calib .proposal[hidden] { display: none; }

/* ---------- Hobby ---------- */
.hobby-item { margin-bottom: 20px; scroll-margin-top: 90px; }
.hobby-item h3 { margin-bottom: 4px; }
.hobby-item .meta { font-size: .85rem; color: var(--muted); margin-bottom: 10px; }
.embed {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #eaeef2;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  margin: 12px 0;
}
.embed.tall { aspect-ratio: auto; height: 600px; }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed .facade {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  text-align: center; padding: 16px;
  color: var(--muted); font-size: .9rem;
}
.embed .facade strong { color: var(--text); font-size: 1rem; }
.embed .facade .fine { max-width: 36ch; }

/* ---------- Contact ---------- */
.contact-list { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .contact-list { grid-template-columns: repeat(3, 1fr); } }
.contact-item { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.contact-item img { width: 56px; height: 56px; object-fit: contain; }
.contact-item h3 { margin: 4px 0 0; font-size: 1rem; }
.contact-item .value { font-family: var(--mono); font-size: .95rem; word-break: break-all; }
dialog.qr { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; max-width: min(92vw, 360px); }
dialog.qr::backdrop { background: rgba(31, 35, 40, .45); }
dialog.qr img { width: 100%; border-radius: 6px; display: block; }
dialog.qr .btn { margin-top: 12px; }

/* ---------- 页脚 ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); padding: 20px 0 28px; font-size: .9rem; color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 20px; align-items: center; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--link); }

/* ---------- 首页:欢迎页(原版结构,GitHub 404 风格) ---------- */
body.welcome { background: #f1f1f1; color: #24292f; }
.welcome-main {
  flex: 1;
  min-height: 100vh;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 16px;
  text-align: center;
}
.welcome a { color: #666666; }
.welcome a:hover { color: #4a77a8; }

/* Hello World:从左到右 CRT → 印刷衬线 → 现代无衬线 → 未来极简 */
.hello {
  margin: 0 0 36px;
  font-size: clamp(52px, 10vw, 104px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0;
  color: #24292f;
  text-shadow: 0 1px 0 #ffffff;
  white-space: nowrap;
}
.h-crt { font-family: "VT323", ui-monospace, monospace; font-size: 1.24em; letter-spacing: 0.02em;
  text-shadow: 0 0 2px rgba(36, 41, 47, 0.35), 0 0 12px rgba(36, 41, 47, 0.18); }
.h-serif { font-family: "Playfair Display", Georgia, serif; font-weight: 500; letter-spacing: -0.01em; }
.h-sans { font-family: "Space Grotesk", "IBM Plex Sans", sans-serif; font-weight: 500; letter-spacing: -0.04em; }
.h-future { font-family: "Michroma", "IBM Plex Sans", sans-serif; font-size: 0.7em; letter-spacing: 0.08em; color: #3d4450; margin-left: 0.04em; }

.welcome-text { margin: 0 0 6px; color: #666666; font-size: 16px; }

/* 语言:三个文字浮在 logo 下半圈外侧(坐标按 96px logo 计算) */
.lang-ring { position: relative; width: 232px; height: 154px; margin-top: 26px; flex: 0 0 auto; }
.ring-arc { position: absolute; left: 0; top: 0; overflow: visible; }
.ring-logo { position: absolute; left: 68px; top: 2px; width: 96px; height: 96px; }
.ring-lang {
  position: absolute; width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  display: flex; align-items: center; justify-content: center;
  font: inherit; font-size: 17px; line-height: 1; color: #707070; cursor: pointer;
  animation: gw-float 4.5s ease-in-out infinite;
}
.ring-lang:hover { color: #24292f; }
.ring-lang .mark { padding-bottom: 3px; border-bottom: 1px solid transparent; text-shadow: 0 1px 0 #ffffff; }
.ring-lang small { font-size: 0.58em; margin-left: 1px; position: relative; top: 0.3em; }
.ring-lang[aria-pressed="true"] { color: #24292f; }
.ring-lang[aria-pressed="true"] .mark { border-bottom-color: #7d9cc4; }
.ring-en { left: 24.5px; top: 71.5px; animation-delay: 0s; }
.ring-zh { left: 94px; top: 110px; animation-delay: 1.3s; }
.ring-ja { left: 163.5px; top: 71.5px; animation-delay: 2.6s; }
@keyframes gw-float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

.welcome-nav { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 0 4px; margin-top: 12px; font-size: 15px; font-weight: 300; }
.welcome-nav a { padding: 12px 8px; }
.welcome-nav span { color: #bbbbbb; }
