/* ============================================================
   艾力的项目 —— 「工程纸 · 墨与朱印」
   冷白纸底 / 点阵网格 / 衬线大排版 / 朱砂红点缀 / 细噪点印刷感
   全站 0 卡片盒子，行式列表，克制的两段动效
   ============================================================ */
:root {
  --paper: #fbfbfa;
  --paper-2: #f1f1ec;
  --ink: #16161a;
  --ink-2: #3c3c44;
  --muted: #6e6e76;
  --faint: #9d9da6;
  --line: #e6e6de;
  --accent: #c2410c;
  --accent-deep: #9a3412;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "SimSun", serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
    "MiSans", "Noto Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, Menlo, monospace;
  --ug: "Noto Naskh Arabic", "UKIJ Tuz Tom", "Mercedes", "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .rv { opacity: 1 !important; transform: none !important; filter: none !important; }
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 细噪点：整站印刷感，把「生成图」的塑料感压下去 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="160" height="160"><filter id="n"><feTurbulence type="fractalNoise" baseFrequency="0.9" numOctaves="2"/><feColorMatrix type="saturate" values="0"/></filter><rect width="160" height="160" filter="url(%23n)"/></svg>');
  background-size: 160px 160px;
}

::selection { background: rgba(194, 65, 12, 0.14); }
a { color: inherit; text-decoration: none; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }
.ug, [lang="ug"] { unicode-bidi: isolate; font-family: var(--ug); }

.container { max-width: 960px; margin: 0 auto; padding: 0 28px; }

/* ---------- 页头 ---------- */
header {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.brand { font-family: var(--serif); font-size: 17px; font-weight: 700; letter-spacing: 0.01em; }
.nav nav { display: flex; gap: 24px; }
.nav nav a {
  position: relative; font-size: 14px; color: var(--muted);
  padding: 4px 0; transition: color 0.18s;
}
.nav nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 1.5px;
  background: var(--accent); transform: scaleX(0); transform-origin: left;
  transition: transform 0.22s var(--ease);
}
.nav nav a:hover { color: var(--ink); }
.nav nav a:hover::after, .nav nav a.active::after { transform: scaleX(1); }
.nav nav a.active { color: var(--ink); font-weight: 500; }

/* ---------- 首屏（工程纸点阵 + 超大维吾尔文签名） ---------- */
.hero {
  position: relative;
  padding: 88px 0 72px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}
/* 点阵纸背景，向下淡出 */
.hero::before {
  content: "";
  position: absolute; inset: 0;
  background-image: radial-gradient(var(--line) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
  mask-image: linear-gradient(to bottom, #000 0%, transparent 88%);
}
/* 超大维吾尔文 —— 整站的视觉签名 */
.hero-mark {
  position: absolute; right: -14px; top: 18px; z-index: 0;
  font-family: var(--ug); direction: rtl;
  font-size: clamp(130px, 23vw, 330px);
  line-height: 1;
  color: var(--ink);
  opacity: 0.1;
  pointer-events: none; user-select: none;
  white-space: nowrap;
}
.hero-inner { position: relative; z-index: 1; max-width: 780px; }
.hero .ug-line {
  font-family: var(--ug); direction: rtl;
  font-size: 17px; color: var(--muted);
  margin-bottom: 22px; letter-spacing: 0.02em;
}
.hero h1 {
  font-family: var(--serif);
  font-size: clamp(40px, 6vw, 72px);
  font-weight: 700;
  line-height: 1.12;
  letter-spacing: -0.022em;
  color: var(--ink);
  text-wrap: balance;
  margin-bottom: 22px;
}
.hero .intro {
  font-size: 17px; color: var(--ink-2);
  max-width: 34em;
  margin-bottom: 36px;
}
.hero-links { display: flex; gap: 30px; flex-wrap: wrap; }
.hero-links a {
  font-size: 14.5px; color: var(--ink-2);
  border-bottom: 1px solid var(--line);
  padding-bottom: 3px;
  transition: color 0.18s, border-color 0.18s;
}
.hero-links a:hover { color: var(--accent); border-color: currentColor; }
.hero-links a .arr { display: inline-block; margin-left: 3px; font-size: 12.5px; transition: transform 0.2s var(--ease); }
.hero-links a:hover .arr { transform: translate(2px, -2px); }

/* 首屏揭示序列（一次性编排） */
@keyframes heroRise {
  from { opacity: 0; transform: translateY(16px); filter: blur(6px); }
  to { opacity: 1; transform: none; filter: none; }
}
.hero-anim { animation: heroRise 0.6s var(--ease) both; }
.ha-1 { animation-delay: 0.08s; } .ha-2 { animation-delay: 0.16s; }
.ha-3 { animation-delay: 0.24s; } .ha-4 { animation-delay: 0.32s; }

/* 滚动渐显（克制：只用于区块标题与主块） */
.rv {
  opacity: 0;
  transform: translateY(18px);
  filter: blur(5px);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease), filter 0.55s var(--ease);
}
.rv.in { opacity: 1; transform: none; filter: none; }

/* ---------- 区块 ---------- */
section { padding: 56px 0 24px; }
.sec-head { display: flex; align-items: baseline; gap: 16px; margin-bottom: 12px; }
.sec-label { font-family: var(--serif); font-size: 20px; font-weight: 700; letter-spacing: 0.005em; color: var(--ink); }
.sec-line { flex: 1; height: 1px; background: var(--line); align-self: center; }
.sec-note, .sec-more {
  font-family: var(--mono); font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums; white-space: nowrap;
}
.sec-more:hover { color: var(--accent); }

/* ---------- 全宽浅灰底（项目模块层级带） ---------- */
.band {
  background: #e8e8e0;
  margin-top: 46px;
  padding: 50px 0 46px;
}
.band .sec-label { font-size: 24px; }
.band .sec-line { background: rgba(22, 22, 26, 0.14); }

/* ---------- 项目卡片（白卡浮于浅灰带上） ---------- */
.project-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.project {
  position: relative;
  display: grid;
  grid-template-columns: 54px minmax(190px, 0.8fr) 1.3fr auto;
  gap: 4px 30px;
  align-items: start;
  background: #fff;
  border: 1px solid rgba(22, 22, 26, 0.14);
  border-radius: 10px;
  padding: 26px 28px;
  transition: border-color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.project:hover {
  border-color: rgba(194, 65, 12, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(22, 22, 26, 0.07);
}
.project .idx {
  font-family: var(--serif);
  font-size: 28px; font-weight: 700; line-height: 1;
  color: var(--faint); padding-top: 2px;
  font-variant-numeric: tabular-nums;
  transition: color 0.18s;
}
.project:hover .idx { color: var(--accent); }
.project .p-name {
  font-family: var(--serif); font-size: 22px; font-weight: 700;
  letter-spacing: -0.012em; line-height: 1.35;
  transition: color 0.18s;
}
.project:hover .p-name { color: var(--accent); }
.project .p-tags { font-size: 12.5px; color: var(--faint); margin-top: 7px; }
.project .p-tags span + span::before { content: " / "; color: var(--line); margin: 0 2px; }
.project .p-desc { font-size: 14.5px; color: var(--muted); line-height: 1.7; padding-top: 3px; max-width: 46ch; }
.project .p-links {
  display: flex; gap: 20px; font-size: 13.5px; padding-top: 7px;
  white-space: nowrap; justify-self: end;
}
.project .p-links a { color: var(--ink-2); border-bottom: 1px solid transparent; transition: color 0.18s, border-color 0.18s; }
.project .p-links a:hover { color: var(--accent); border-color: currentColor; }
.project .p-links .arr { display: inline-block; margin-left: 2px; font-size: 12px; transition: transform 0.2s var(--ease); }
.project .p-links a:hover .arr { transform: translate(2px, -2px); }

/* ---------- 文章列表（行式） ---------- */
.post {
  display: flex; align-items: baseline; gap: 20px;
  padding: 19px 8px;
  border-top: 1px solid var(--line);
  transition: padding-left 0.25s var(--ease);
}
.list .post:last-child { border-bottom: 1px solid var(--line); }
.post:hover { padding-left: 20px; }
.post .p-date {
  flex: none; width: 96px;
  font-family: var(--mono); font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.post .p-title {
  font-family: var(--serif); font-size: 16.5px; font-weight: 600;
  color: var(--ink); letter-spacing: -0.005em;
  transition: color 0.18s;
}
.post:hover .p-title { color: var(--accent); }
.post .p-summary {
  font-size: 13px; color: var(--faint);
  margin-left: auto; text-align: right; max-width: 38%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

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

/* ---------- 文章页 ---------- */
.article-page { padding: 64px 0 40px; }
.article { max-width: 700px; margin: 0 auto; }
.article-head { margin-bottom: 30px; }
.article-head h1 {
  font-family: var(--serif);
  font-size: clamp(26px, 3.6vw, 34px);
  font-weight: 700; letter-spacing: -0.015em; line-height: 1.3;
  margin-bottom: 14px;
}
.article-head .meta {
  font-family: var(--mono); font-size: 12.5px; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.article .divider { height: 1px; background: var(--line); margin-bottom: 34px; }
.back { margin-top: 46px; padding-top: 22px; border-top: 1px solid var(--line); }
.back a { font-size: 14px; color: var(--muted); transition: color 0.18s; }
.back a:hover { color: var(--accent); }

/* Markdown 正文 */
.markdown { font-size: 16px; line-height: 2; color: var(--ink-2); }
.markdown h1, .markdown h2, .markdown h3, .markdown h4 {
  font-family: var(--serif); color: var(--ink); letter-spacing: -0.01em;
}
.markdown h1 { font-size: 24px; margin: 44px 0 16px; }
.markdown h2 { font-size: 21px; margin: 40px 0 14px; }
.markdown h3 { font-size: 18px; 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: 13px;
  background: var(--paper-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 1.5px 6px;
}
.markdown pre {
  background: #1c1c21; color: #ececec;
  border-radius: 6px; padding: 18px 20px;
  overflow-x: auto; margin: 20px 0;
  font-size: 13px; 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(--accent);
  padding: 2px 0 2px 18px;
  color: var(--muted); margin: 18px 0;
  background: var(--paper-2);
}
.markdown img { max-width: 100%; border-radius: 4px; }
.markdown table { border-collapse: collapse; width: 100%; margin: 20px 0; font-size: 14.5px; table-layout: fixed; }
.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-deep); 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 46px; }
.foot { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; font-size: 13px; color: var(--faint); }
.foot a { color: var(--muted); transition: color 0.18s; }
.foot a:hover { color: var(--accent); }
.icp { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 16px; font-size: 12px; color: var(--faint); flex-wrap: wrap; }
.icp a { color: var(--faint); transition: color 0.18s; }
.icp a:hover { color: var(--accent); }
.icp-sep { color: var(--line); }
.foot .ug-foot {
  display: block; margin-top: 8px;
  font-family: var(--ug); direction: rtl;
  font-size: 12.5px; color: var(--faint); letter-spacing: 0.02em;
}

/* ---------- 404 ---------- */
.notfound { text-align: center; padding: 150px 20px 80px; }
.notfound .code {
  font-family: var(--serif);
  font-size: 84px; font-weight: 700; letter-spacing: -0.03em;
  color: var(--line);
}
.notfound p { color: var(--muted); margin: 8px 0 34px; }
.notfound a {
  font-size: 14.5px; border-bottom: 1px solid var(--line); padding-bottom: 3px;
  color: var(--ink-2); transition: color 0.18s, border-color 0.18s;
}
.notfound a:hover { color: var(--accent); border-color: currentColor; }

/* ============================================================
   响应式 —— 平板 / 手机 / 小屏
   ============================================================ */
@media (max-width: 900px) {
  .project { grid-template-columns: 54px 1fr; gap: 4px 24px; }
  .project .p-desc { grid-column: 2; }
  .project .p-links { grid-column: 2; justify-self: start; padding-top: 8px; }
}

@media (max-width: 720px) {
  .hero { padding: 76px 0 64px; }
  .hero-mark { font-size: clamp(96px, 26vw, 150px); right: -8px; opacity: 0.07; }
  .hero h1 { font-size: clamp(34px, 8.6vw, 48px); }
  .hero .intro { font-size: 15.5px; }
  section { padding: 44px 0 18px; }
  .band { margin-top: 36px; padding: 42px 0 38px; }
  .band .sec-label { font-size: 21px; }
  .project-list { gap: 12px; }
  .project { grid-template-columns: 1fr; gap: 8px; padding: 22px 22px; }
  .project:hover { transform: none; }
  .project .idx { font-size: 24px; padding-top: 0; }
  .project .p-desc { grid-column: auto; }
  .project .p-links { grid-column: auto; justify-self: start; }
  .project .p-name { font-size: 19px; }
  .post .p-summary { display: none; }
  .post .p-date { width: 78px; font-size: 12px; }
  .nav { height: 54px; }
  .nav nav { gap: 18px; }
  .container { padding: 0 20px; }
}

@media (max-width: 420px) {
  .nav nav { gap: 14px; }
  .nav nav a { font-size: 13px; }
  .brand { font-size: 15.5px; }
  .hero-links { gap: 20px; }
  .foot { flex-direction: column; align-items: flex-start; gap: 4px; }
}
