/* Lumjiel · 个人网站 v2 —— 简约大气版
   对标 chendahuang.com 的底层逻辑：白底黑字、灰阶分层、唯一强调色、
   无插画无装饰动效，层级全靠字号/字重/行距/留白。 */

:root {
  --bg: #ffffff;
  --ink: #18181b;
  --dim: #71717a;
  --faint: #a1a1aa;
  --line: #e4e4e7;
  --panel: #fafafa;
  --accent: #2563eb;
  --accent-ink: #ffffff;
  --dark-btn: #18181b;
}
html[data-theme="dark"] {
  --bg: #101012;
  --ink: #f4f4f5;
  --dim: #9d9da8;
  --faint: #6b6b76;
  --line: #26262b;
  --panel: #17171a;
  --accent: #4a8dff;
  --accent-ink: #0b0b0d;
  --dark-btn: #f4f4f5;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 84px; color-scheme: light; }
html[data-theme="dark"] { color-scheme: dark; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; animation: none !important; }
}

::selection { background: var(--accent); color: var(--accent-ink); }

.wrap { max-width: 860px; margin: 0 auto; padding: 0 24px; }

/* ── 顶部胶囊导航 ── */
.nav {
  position: fixed; top: 16px; left: 50%; transform: translateX(-50%);
  z-index: 100;
  display: flex; align-items: center; gap: 2px;
  padding: 6px 10px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, .06);
}
html[data-theme="dark"] .nav { box-shadow: 0 4px 24px rgba(0, 0, 0, .5); }
.nav__link {
  padding: 5px 12px; border-radius: 999px;
  font-size: 14px; color: var(--ink); text-decoration: none;
  white-space: nowrap;
  transition: background .15s;
}
.nav__link:hover { background: var(--panel); }
.nav__sep { width: 1px; height: 16px; background: var(--line); margin: 0 6px; }
.nav__icon {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: 999px;
  color: var(--dim); background: none; border: 0; cursor: pointer;
  transition: color .15s, background .15s;
}
.nav__icon:hover { color: var(--ink); background: var(--panel); }
.icon-sun { display: none; }
html[data-theme="dark"] .icon-sun { display: block; }
html[data-theme="dark"] .icon-moon { display: none; }

/* ── 英雄区 ── */
.hero { max-width: 860px; margin: 0 auto; padding: 150px 24px 0; text-align: center; }
.hero__avatar {
  width: 92px; height: 92px; border-radius: 50%;
  background: var(--panel); border: 1px solid var(--line);
  display: grid; place-items: center; margin: 0 auto 22px;
  cursor: pointer;
  overflow: hidden;
  transition: transform .15s;
}
.hero__avatar img {
  width: 100%; height: 100%; object-fit: cover;
  border-radius: 50%; display: block;
}
.hero__avatar:active { transform: scale(.96); }
.hero__name { font-size: 40px; font-weight: 800; letter-spacing: .5px; line-height: 1.3; cursor: default; }
.hero__bio { margin-top: 14px; display: grid; gap: 2px; }
.hero__bio p { font-size: 15px; color: var(--dim); line-height: 2; }
.hero__bio b { color: var(--ink); font-weight: 600; margin-right: 10px; }
.hero__stats {
  margin-top: 30px;
  display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 34px;
}
.stat {
  display: flex; align-items: baseline; gap: 7px;
  background: none; border: 0; cursor: pointer;
  text-decoration: none; color: var(--ink);
  font: inherit;
  padding: 4px 2px;
}
.stat b { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--dim); }
.stat:hover b { color: var(--accent); }
.hero__cta { margin-top: 30px; display: flex; justify-content: center; gap: 12px; }

.btn {
  display: inline-block; padding: 9px 20px;
  border-radius: 8px; border: 0; cursor: pointer;
  font-size: 15px; font-weight: 500; text-decoration: none;
  font-family: inherit; line-height: 1.6;
  transition: opacity .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); }
.btn--dark { background: var(--dark-btn); color: var(--bg); }
.btn--ghost { background: var(--panel); color: var(--ink); border: 1px solid var(--line); }
.btn:hover { opacity: .88; }

/* ── 通用区块 ── */
.section { max-width: 860px; margin: 0 auto; padding: 96px 24px 0; }
/* 区块进入视口淡入（JS 有 js-reveal 才生效；reduced-motion 下直接显示） */
body.js-reveal .section { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
body.js-reveal .section.in { opacity: 1; transform: none; }
.section__eyebrow { font-size: 13px; color: var(--dim); margin-bottom: 4px; }
.section__title { font-size: 26px; font-weight: 700; line-height: 1.4; }
.section__desc { font-size: 13px; color: var(--faint); margin-top: 8px; }
.muted { color: var(--dim); font-size: 13px; }

/* ── 项目列表 ── */
.projects { list-style: none; margin-top: 36px; display: grid; gap: 4px; }
.project {
  display: flex; gap: 18px; align-items: baseline;
  padding: 13px 10px; border-radius: 10px;
  transition: background .15s;
}
.project:hover { background: var(--panel); }
.project i {
  font-style: normal; flex: 0 0 30px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.project a {
  font-size: 17px; font-weight: 600; color: var(--ink); text-decoration: none;
}
.project a:hover { color: var(--accent); }
.project p { font-size: 14px; color: var(--dim); line-height: 1.75; margin-top: 1px; }
.project--archived i, .project--archived a { color: var(--faint); }
.project--archived a:hover { color: var(--dim); }
.projects__group {
  margin-top: 26px; margin-bottom: 6px;
  font-size: 13px; font-weight: 600; color: var(--faint);
  letter-spacing: 2px;
}
.projects__group:first-of-type { margin-top: 0; }
.projects .projects + .projects__group { border-top: 0; }
.projects__forks { margin-top: 22px; font-size: 13px; color: var(--faint); }
.projects__forks a { color: var(--faint); text-decoration: none; border-bottom: 1px dashed var(--line); }
.projects__forks a:hover { color: var(--dim); }

/* ── 里程碑时间线 ── */
.milestones { list-style: none; margin-top: 36px; display: grid; gap: 0; }
.milestone {
  display: flex; gap: 22px; align-items: baseline;
  padding: 14px 10px; border-radius: 10px;
  position: relative;
}
.milestone:hover { background: var(--panel); }
.milestone time {
  flex: 0 0 88px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 13px; color: var(--faint);
}
.milestone h3 { font-size: 16px; font-weight: 600; display: inline; }
.milestone h3::after { content: "　"; }
.milestone p { font-size: 14px; color: var(--dim); display: inline; }
.milestone--fog h3, .milestone--fog p { color: var(--faint); font-style: italic; }

/* ── 博客在建 ── */
.blog-zero {
  margin-top: 36px; padding: 26px 26px 22px;
  border: 1px dashed var(--line); border-radius: 14px;
  display: flex; gap: 22px; align-items: baseline;
}
.blog-zero b {
  font-size: 52px; font-weight: 800; line-height: 1;
  font-variant-numeric: tabular-nums; cursor: pointer;
}
.blog-zero b:hover { color: var(--accent); }
.blog-zero p { font-size: 15px; color: var(--ink); }
.blog-zero__list { color: var(--dim) !important; }
.blog-zero__note { color: var(--faint) !important; font-size: 13px !important; margin-top: 6px; }

/* ── 关于与联系 ── */
.about { margin-top: 20px; max-width: 640px; }
.about p { font-size: 15px; color: var(--dim); }
.about mark { background: none; color: var(--accent); font-weight: 600; }
.about p + p { margin-top: 10px; }
.contacts { margin-top: 34px; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.contact {
  text-align: left; cursor: pointer;
  padding: 18px 18px 15px; border: 1px solid var(--line); border-radius: 12px;
  background: none; font: inherit; text-decoration: none;
  display: block; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.contact:hover { border-color: var(--accent); background: var(--panel); }
.contact--static { cursor: default; }
.contact--static:hover { border-color: var(--line); background: none; }
.contact h3 { font-size: 16px; font-weight: 600; }
.contact p { font-size: 13px; color: var(--dim); margin-top: 3px; }

/* ── 页脚 ── */
.footer {
  max-width: 860px; margin: 110px auto 0; padding: 26px 24px 44px;
  border-top: 1px solid var(--line);
  font-size: 13px; color: var(--dim);
  display: grid; gap: 2px;
}
.footer a { color: var(--dim); text-decoration: none; }
.footer a:hover { color: var(--accent); }
.footer__ver {
  background: none; border: 0; padding: 0; cursor: pointer;
  font: inherit; color: var(--faint); text-decoration: underline dotted;
}
.footer__ver:hover { color: var(--accent); }
.footer__note { color: var(--faint); font-size: 12px; }

/* ── 邮箱对话框 ── */
.dialog {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(0, 0, 0, .45);
  display: grid; place-items: center; padding: 20px;
}
.dialog[hidden] { display: none; }
.dialog__panel {
  background: var(--bg); border: 1px solid var(--line); border-radius: 16px;
  padding: 26px; width: min(420px, 100%);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .25);
  text-align: center;
}
.dialog__title { font-size: 17px; font-weight: 600; }
.dialog__addr {
  margin: 14px 0 18px; padding: 10px 14px;
  background: var(--panel); border-radius: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 15px; user-select: all;
}
.dialog__btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }

/* body 弹层滚动锁 */
html.modal-open, body.modal-open { overflow: hidden; }

/* ── toast ── */
.toast {
  position: fixed; left: 50%; bottom: 34px; transform: translateX(-50%);
  z-index: 300;
  background: var(--dark-btn); color: var(--bg);
  padding: 9px 18px; border-radius: 999px;
  font-size: 14px; box-shadow: 0 8px 30px rgba(0, 0, 0, .2);
  animation: toast-in .18s ease-out;
}
.toast[hidden] { display: none; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } }

/* ── 文章页 / 文章列表（观测站存档） ── */
.post-nav {
  position: sticky; top: 0; z-index: 90;
  display: flex; align-items: center; gap: 10px;
  max-width: 760px; margin: 0 auto; padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.post-nav a { color: var(--dim); text-decoration: none; }
.post-nav a:hover { color: var(--accent); }
.post-nav span { color: var(--faint); }
.post-nav .js-theme {
  margin-left: auto; background: none; border: 1px solid var(--line);
  border-radius: 999px; width: 30px; height: 30px; cursor: pointer;
  color: var(--dim); font-size: 14px; line-height: 1;
}
.post-nav .js-theme:hover { color: var(--ink); }
.wrap { max-width: 760px; margin: 0 auto; padding: 56px 24px 0; text-align: left; }
.post-wrap { max-width: 760px; margin: 0 auto; padding: 56px 24px 0; }
.post-head { margin-bottom: 36px; }
.post-meta { font-size: 13px; color: var(--dim); display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.cat-badge {
  background: var(--accent); color: var(--accent-ink);
  font-size: 12px; padding: 1px 10px; border-radius: 999px; font-weight: 500;
}
.post-head h1 { font-size: 30px; font-weight: 700; line-height: 1.4; margin-top: 12px; }
.post-tags { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; color: var(--dim); border: 1px solid var(--line); border-radius: 999px; padding: 1px 9px; }
.post-body { font-size: 15.5px; line-height: 1.95; }
.post-body h2 { font-size: 22px; font-weight: 700; margin: 44px 0 14px; padding-top: 8px; }
.post-body h3 { font-size: 18px; font-weight: 600; margin: 30px 0 10px; }
.post-body h4 { font-size: 16px; font-weight: 600; margin: 22px 0 8px; }
.post-body p { margin: 12px 0; }
.post-body ul, .post-body ol { margin: 12px 0; padding-left: 24px; }
.post-body li { margin: 5px 0; }
.post-body a { color: var(--accent); text-decoration: none; }
.post-body a:hover { text-decoration: underline; }
.post-body blockquote {
  margin: 16px 0; padding: 10px 18px;
  border-left: 3px solid var(--accent);
  background: var(--panel); border-radius: 0 8px 8px 0;
  color: var(--dim); font-size: 14.5px;
}
.post-body code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .88em;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}
.post-body pre {
  margin: 18px 0; padding: 16px 18px;
  background: #16181d; border: 1px solid #26282f; border-radius: 10px;
  overflow-x: auto; line-height: 1.7;
}
html[data-theme="dark"] .post-body pre { background: #0b0c10; }
.post-body pre code { background: none; border: 0; padding: 0; color: #d6deeb; font-size: 13.5px; }
.post-body table { border-collapse: collapse; margin: 18px 0; width: 100%; font-size: 14px; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.post-body th { background: var(--panel); font-weight: 600; }
.post-body hr { border: 0; border-top: 1px solid var(--line); margin: 36px 0; }
.post-body img { max-width: 100%; border-radius: 10px; border: 1px solid var(--line); }
.img-missing {
  margin: 16px 0; padding: 14px 18px;
  border: 1px dashed var(--line); border-radius: 10px;
  font-size: 13px; color: var(--faint); background: var(--panel);
}
.img-missing a { color: var(--dim); }
.post-foot { margin: 64px 0 30px; padding-top: 20px; border-top: 1px solid var(--line); }
.post-foot a { color: var(--dim); text-decoration: none; font-size: 14px; }
.post-foot a:hover { color: var(--accent); }
.post-foot p { margin-top: 10px; font-size: 12px; color: var(--faint); }

/* 文章列表 */
.list-group { margin-top: 44px; }
.list-group h2 { font-size: 18px; font-weight: 700; }
.list-group h2 small { font-weight: 400; color: var(--faint); font-size: 13px; margin-left: 8px; }
.post-list { list-style: none; margin-top: 12px; display: grid; gap: 2px; }
.post-list li {
  display: flex; align-items: baseline; gap: 14px;
  padding: 9px 10px; border-radius: 8px;
}
.post-list li:hover { background: var(--panel); }
.post-list time { flex: 0 0 84px; font-family: ui-monospace, Menlo, monospace; font-size: 12.5px; color: var(--faint); }
.post-list a { color: var(--ink); text-decoration: none; font-size: 15px; font-weight: 500; }
.post-list a:hover { color: var(--accent); }
.post-list span { margin-left: auto; font-size: 12px; color: var(--faint); }

/* ── 移动端 ── */
@media (max-width: 640px) {
  .nav { top: 10px; padding: 5px 8px; max-width: calc(100vw - 20px); }
  .nav__link { padding: 5px 9px; font-size: 13px; }
  .hero { padding-top: 120px; }
  .hero__name { font-size: 34px; }
  .hero__bio p { font-size: 14px; }
  .hero__stats { gap: 6px 22px; }
  .stat b { font-size: 21px; }
  .section { padding-top: 76px; }
  .project { gap: 12px; padding: 12px 6px; }
  .project i { flex-basis: 24px; }
  .milestone { gap: 14px; }
  .milestone time { flex-basis: 74px; }
  .blog-zero { flex-direction: column; gap: 10px; padding: 20px; }
  .contacts { grid-template-columns: 1fr; }
  .footer { margin-top: 80px; }
}
