/* ============================================================
   艾力的项目 —— 编辑排版风
   暖纸底色 / 细线分隔 / 无卡片盒子 / 字重层级
   ============================================================ */
:root {
  --paper: #faf9f7;
  --paper-2: #f3f1ec;
  --ink: #1c1917;
  --ink-2: #44403c;
  --muted: #6f6a66;
  --faint: #a8a29e;
  --line: #e8e5e0;
  --accent: #9a3412;
  --mono: ui-monospace, "SF Mono", Consolas, Menlo, monospace;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgba(154, 52, 18, 0.14); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.container { max-width: 880px; margin: 0 auto; padding: 0 28px; }
.ug, [lang="ug"] { unicode-bidi: isolate; font-family: "UKIJ Tuz Tom", "Mercedes", "Noto Naskh Arabic", "Segoe UI", sans-serif; }

/* 进场动效（克制） */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.reveal { animation: rise .55s cubic-bezier(.2, .7, .25, 1) both; }
.d1 { animation-delay: .05s } .d2 { animation-delay: .12s } .d3 { animation-delay: .19s }
.d4 { animation-delay: .26s } .d5 { animation-delay: .33s }

/* ---------- 页头 ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 247, 0.88);
  backdrop-filter: blur(14px) saturate(1.4);
  -webkit-backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { font-size: 15px; font-weight: 600; letter-spacing: 0.02em; }
.nav nav { display: flex; gap: 26px; }
.nav nav a {
  position: relative; font-size: 14px; color: var(--muted);
  padding: 4px 0; transition: color .18s;
}
.nav nav a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1.5px;
  background: var(--ink); transform: scaleX(0); transform-origin: left;
  transition: transform .22s cubic-bezier(.2, .7, .25, 1);
}
.nav nav a:hover { color: var(--ink); text-decoration: none; }
.nav nav a:hover::after, .nav nav a.active::after { transform: scaleX(1); }
.nav nav a.active { color: var(--ink); }

/* ---------- 首屏 ---------- */
.hero { padding: 108px 0 76px; }
.hero .overline {
  font-size: 15px; color: var(--faint); margin-bottom: 14px;
}
.hero h1 {
  font-size: clamp(34px, 5.2vw, 54px);
  font-weight: 600; letter-spacing: -0.028em; line-height: 1.18;
  margin-bottom: 20px;
}
.hero .intro { font-size: 17px; color: var(--muted); max-width: 34em; margin-bottom: 34px; }
.hero-links { display: flex; gap: 26px; flex-wrap: wrap; }
.hero-links a {
  font-size: 14.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
  transition: color .18s, border-color .18s;
}
.hero-links a:hover { color: var(--accent); border-color: currentColor; }
.hero-links a .arr { display: inline-block; margin-left: 3px; transition: transform .2s; }
.hero-links a:hover .arr { transform: translate(2px, -2px); }

/* ---------- 区块 ---------- */
section { padding: 44px 0 20px; }
.sec-head { display: flex; align-items: center; gap: 18px; margin-bottom: 26px; }
.sec-label { font-size: 13px; font-weight: 600; letter-spacing: 0.22em; color: var(--ink); }
.sec-line { flex: 1; height: 1px; background: var(--line); }
.sec-count, .sec-more { font-size: 12.5px; color: var(--faint); font-variant-numeric: tabular-nums; }
.sec-more:hover { color: var(--accent); }

/* ---------- 项目列表（行式，非卡片） ---------- */
.list { border-bottom: 1px solid var(--line); }
.project {
  border-top: 1px solid var(--line);
  padding: 26px 6px;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 6px 32px;
  align-items: start;
  transition: background .2s;
}
.project:hover { background: var(--paper-2); }
.project .p-name { font-size: 18px; font-weight: 600; letter-spacing: -0.01em; }
.project .p-tags { font-size: 12.5px; color: var(--faint); margin-top: 5px; }
.project .p-desc { font-size: 15px; color: var(--muted); padding-top: 2px; }
.project .p-links { display: flex; gap: 18px; font-size: 13.5px; padding-top: 4px; white-space: nowrap; }
.project .p-links a { color: var(--ink-2); border-bottom: 1px solid transparent; transition: color .18s; }
.project .p-links a:hover { color: var(--accent); }
.project .p-links .arr { display: inline-block; margin-left: 2px; transition: transform .2s; }
.project .p-links a:hover .arr { transform: translate(2px, -2px); }
@media (max-width: 720px) {
  .project { grid-template-columns: 1fr; gap: 8px; padding: 22px 2px; }
  .project .p-links { padding-top: 2px; }
}

/* ---------- 文章列表（行式） ---------- */
.post {
  display: flex; align-items: baseline; gap: 26px;
  padding: 17px 6px;
  border-top: 1px solid var(--line);
  transition: background .2s;
}
.list .post:last-child { border-bottom: 1px solid var(--line); }
.post:hover { background: var(--paper-2); text-decoration: none; }
.post .p-date {
  flex: none; width: 92px;
  font-size: 13px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.post .p-title { font-size: 15.5px; color: var(--ink); transition: color .18s; }
.post:hover .p-title { color: var(--accent); }
.post .p-summary { font-size: 13.5px; color: var(--faint); margin-left: auto; text-align: right; max-width: 40%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 720px) {
  .post .p-summary { display: none; }
  .post .p-date { width: 78px; font-size: 12px; }
}

/* ---------- 关于 ---------- */
.about { max-width: 620px; }
.about .a-text { font-size: 16px; color: var(--ink-2); white-space: pre-line; line-height: 2; }
.about .hero-links { margin-top: 26px; }

/* ---------- 文章页 ---------- */
.article-page { padding: 64px 0 40px; }
.article { max-width: 700px; margin: 0 auto; }
.article-head { margin-bottom: 34px; }
.article-head h1 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.3; margin-bottom: 12px; }
.article-head .meta { font-size: 13px; color: var(--faint); font-variant-numeric: tabular-nums; }
.article .divider { height: 1px; background: var(--line); margin-bottom: 34px; }
.back { margin-top: 44px; padding-top: 22px; border-top: 1px solid var(--line); }
.back a { font-size: 14px; color: var(--muted); transition: color .18s; }
.back a:hover { color: var(--accent); }

/* Markdown 正文 */
.markdown { font-size: 16px; line-height: 2; color: var(--ink-2); }
.markdown h2 { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink); margin: 40px 0 14px; }
.markdown h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin: 30px 0 10px; }
.markdown p { margin: 14px 0; }
.markdown ul, .markdown ol { margin: 14px 0 14px 22px; }
.markdown li { margin: 6px 0; }
.markdown li::marker { color: var(--faint); }
.markdown code {
  font-family: var(--mono); font-size: 13.5px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 5px; padding: 1px 6px;
}
.markdown pre {
  background: #232019; color: #ece9e4;
  border-radius: 10px; padding: 18px 20px;
  overflow-x: auto; margin: 20px 0;
  font-size: 13.5px; line-height: 1.8;
}
.markdown pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
.markdown blockquote {
  border-left: 2px solid var(--ink); padding: 2px 0 2px 18px;
  color: var(--muted); margin: 18px 0;
}
.markdown img { max-width: 100%; border-radius: 8px; }
.markdown table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 14.5px; }
.markdown th, .markdown td { border: 1px solid var(--line); padding: 8px 14px; text-align: left; }
.markdown th { font-weight: 600; color: var(--ink); background: var(--paper-2); }
.markdown a { color: var(--accent); border-bottom: 1px solid rgba(154, 52, 18, 0.3); }
.markdown a:hover { border-color: currentColor; }
.markdown hr { border: none; height: 1px; background: var(--line); margin: 34px 0; }
.markdown strong { color: var(--ink); font-weight: 600; }

/* ---------- 页脚 ---------- */
footer { margin-top: 56px; border-top: 1px solid var(--line); padding: 30px 0 44px; }
.foot { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; color: var(--faint); }
.foot a { color: var(--muted); transition: color .18s; }
.foot a:hover { color: var(--accent); }
@media (max-width: 560px) { .foot { flex-direction: column; gap: 6px; } }

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 140px 20px; }
.notfound .code { font-size: 72px; font-weight: 600; letter-spacing: -0.04em; color: var(--line); }
.notfound p { color: var(--muted); margin: 6px 0 30px; }
.notfound a {
  font-size: 14.5px; border-bottom: 1px solid var(--line); padding-bottom: 2px;
  color: var(--ink-2); transition: color .18s, border-color .18s;
}
.notfound a:hover { color: var(--accent); border-color: currentColor; }
