/*
 * naixxfl.com 个人主页样式。
 * 颜色数值对照 frontend/src/style.css 的 :root 抄过来（这是独立静态站，引不到那份文件）。
 * 那边的配色已定案（AI记忆文档 2.6），这里跟着它走，不另起一套。
 */
:root {
  --bg0: #0f1117;
  --bg1: #181c24;
  --bg2: #1e2330;
  --bg3: #141820;
  --t1: #dde2ea;
  --t2: #8892a0;
  --t2b: #9aa4b3;
  --gold: #d4af70;
  --line: #313a4b;
  --rowsep: #2b3444;
  --edge: #3a4459;

  --wrap: 720px;
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg0);
  color: var(--t1);
  font: 16px/1.75 var(--font);
  -webkit-font-smoothing: antialiased;
}
/* 顶部一层很淡的金色光晕 —— 与欢迎页卡片同一个语汇 */
body::before {
  content: '';
  position: fixed;
  inset: 0 0 auto 0;
  height: 420px;
  pointer-events: none;
  z-index: -1;
  background: radial-gradient(60% 100% at 50% 0%, rgba(212, 175, 112, .07), transparent 70%);
}

a { color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
main.wrap { flex: 1; }

/* ── 顶栏 ── */
.site-head { position: relative; }
.site-head::before {
  content: '';
  position: absolute;
  inset: 0 0 auto 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .55;
}
.head-row { display: flex; align-items: center; justify-content: space-between; padding-top: 20px; padding-bottom: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 600; font-size: 15px; letter-spacing: .02em; }
.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 1px solid rgba(212, 175, 112, .55);
  color: var(--gold);
  font: 700 14px/1 var(--font);
  background: rgba(212, 175, 112, .06);
}
.nav a { font-size: 14px; color: var(--t2b); text-decoration: none; transition: color .15s; }
.nav a:hover, .nav a[aria-current='page'] { color: var(--gold); }

/* ── 首页 ── */
.intro { padding: 56px 0 44px; }
.intro h1 { margin: 0; font-size: 30px; line-height: 1.3; font-weight: 700; letter-spacing: .01em; }
.lede { margin: 12px 0 0; color: var(--t2b); font-size: 16px; }
.inline-link { color: var(--gold); text-underline-offset: 3px; }

.sec {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  color: var(--t2b);
}
.count { font-weight: 400; letter-spacing: 0; color: var(--t2); font-variant-numeric: tabular-nums; }

.year { margin: 28px 0 4px; font: 600 13px/1 var(--mono); letter-spacing: .06em; color: var(--gold); }

.list { list-style: none; margin: 0; padding: 0; }
.list li { border-bottom: 1px solid var(--rowsep); }
.list li:last-child { border-bottom: 0; }

.item {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 16px;
  padding: 14px 0;
  text-decoration: none;
}
.item time { grid-row: 1 / span 3; padding-top: 3px; font: 13px/1.6 var(--mono); color: var(--t2b); font-variant-numeric: tabular-nums; }
.item .t { font-size: 17px; font-weight: 600; line-height: 1.55; transition: color .15s; }
.item:hover .t { color: var(--gold); }
.item .sum { display: block; margin-top: 4px; font-size: 14px; line-height: 1.7; color: var(--t2); }
.item .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }

.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg2);
  font-size: 12px;
  line-height: 1.7;
  color: var(--t2b);
}

.empty { padding: 40px 0; color: var(--t2b); }

/* ── 笔记页 ── */
.post-head { padding: 40px 0 24px; margin-bottom: 28px; border-bottom: 1px solid var(--line); }
.back { display: inline-block; margin-bottom: 22px; font-size: 14px; color: var(--t2b); text-decoration: none; transition: color .15s; }
.back:hover { color: var(--gold); }
.post-head h1 { margin: 0; font-size: 28px; line-height: 1.4; font-weight: 700; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: 13px; color: var(--t2b); }
.meta time { font-family: var(--mono); font-variant-numeric: tabular-nums; margin-right: 4px; }

.prose { font-size: 16px; line-height: 1.85; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.1em; }
.prose h2 { margin: 2.2em 0 .7em; font-size: 22px; line-height: 1.45; }
.prose h3 { margin: 1.9em 0 .6em; font-size: 18px; line-height: 1.5; }
.prose h4 { margin: 1.6em 0 .5em; font-size: 16px; line-height: 1.5; color: var(--t2b); }
.prose a { color: var(--gold); text-underline-offset: 3px; }
.prose strong { color: #fff; font-weight: 600; }
.prose ul, .prose ol { margin: 0 0 1.1em; padding-left: 1.5em; }
.prose li { margin: .3em 0; }
.prose li::marker { color: var(--t2); }
.prose blockquote {
  margin: 1.4em 0;
  padding: .6em 1.1em;
  border-left: 3px solid var(--gold);
  border-radius: 0 6px 6px 0;
  background: rgba(212, 175, 112, .045);
  color: var(--t2b);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose code { font: .9em/1.6 var(--mono); padding: .12em .4em; border-radius: 4px; background: var(--bg2); }
.prose pre {
  margin: 1.3em 0;
  padding: 14px 16px;
  overflow-x: auto;
  border: 1px solid var(--edge);
  border-radius: 8px;
  background: var(--bg3);
  font: 14px/1.65 var(--mono);
}
.prose pre code { padding: 0; background: none; font: inherit; }
.prose hr { margin: 2.2em 0; border: 0; border-top: 1px solid var(--line); }
.prose img { display: block; max-width: 100%; height: auto; margin: 1.4em auto; border-radius: 8px; }

.post-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 52px 0 12px; padding-top: 22px; border-top: 1px solid var(--line); }
.pn { display: block; min-width: 0; padding: 12px 14px; border-radius: 8px; background: var(--bg1); text-decoration: none; }
.pn.next { text-align: right; }
.pl { display: block; font-size: 12px; color: var(--t2b); }
.pt { display: block; margin-top: 2px; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .15s; }
.pn:hover .pt { color: var(--gold); }

/* ── 页脚（备案号必须是可点击的真链接） ── */
.site-foot { margin-top: 64px; border-top: 1px solid var(--line); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  padding-top: 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  font-size: 13px;
  color: var(--t2b);
}
.foot-row a { text-decoration: none; transition: color .15s; }
.foot-row a:hover { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }

/* ── 手机 ── */
@media (max-width: 600px) {
  .intro { padding: 36px 0 30px; }
  .intro h1 { font-size: 24px; }
  .item { grid-template-columns: 1fr; }
  .item time { grid-row: auto; padding-top: 0; font-size: 12px; }
  .item .t { font-size: 16px; }
  .post-head { padding-top: 28px; }
  .post-head h1 { font-size: 23px; }
  .prose h2 { font-size: 20px; }
  .prose pre { margin-left: -20px; margin-right: -20px; border-radius: 0; border-left: 0; border-right: 0; }
  .post-nav { grid-template-columns: 1fr; margin-top: 40px; }
  .pn.next { text-align: left; }
  .site-foot { margin-top: 48px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
