/* ============================================================
   personal-site — 遥测仪表美学
   深蓝黑底 / 琥珀读数 / 等宽字体 / 面板卡片
   ============================================================ */

:root {
  --bg: #0b0e14;
  --bg-2: #0e121b;
  --panel: #121824;
  --panel-2: #161d2b;
  --line: #1f2a3d;
  --line-soft: #182131;
  --text: #e8ecf3;
  --dim: #8a93a6;
  --faint: #5a6478;
  --accent: #e8a33d;      /* 琥珀：读数、强调 */
  --green: #34d399;       /* 在线状态 */
  --red: #f87171;
  --blue: #60a5fa;
  --mono: "JetBrains Mono", "IBM Plex Mono", "SFMono-Regular", Consolas, ui-monospace, monospace;
  --body: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", -apple-system, sans-serif;
  --radius: 10px;
  --maxw: 1080px;
  --shadow: 0 8px 30px rgba(0, 0, 0, 0.35);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* 背景网格微纹理（遥测纸面感） */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 44px 44px;
  opacity: 0.25;
  z-index: 0;
}

/* ---------- 布局 ---------- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; position: relative; z-index: 1; }
section { padding: 72px 0; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(12px);
  background: rgba(11, 14, 20, 0.82);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap {
  display: flex; align-items: center; justify-content: space-between;
  height: 60px;
}
.brand {
  font-family: var(--mono);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.02em;
  color: var(--text);
  text-decoration: none;
}
.brand .blink { color: var(--accent); animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
nav { display: flex; gap: 28px; }
nav a {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--dim);
  text-decoration: none;
  letter-spacing: 0.03em;
  transition: color 0.15s;
}
nav a:hover { color: var(--accent); }
nav a.on { color: var(--text); }

/* ---------- Hero ---------- */
.hero { padding: 100px 0 64px; }
.eyebrow {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 0.08em;
  margin-bottom: 18px;
}
.eyebrow::before { content: "// "; color: var(--faint); }
h1 {
  font-size: clamp(34px, 6vw, 58px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin-bottom: 16px;
}
h1 .hl { color: var(--accent); }
.sub {
  font-size: 17px;
  color: var(--dim);
  max-width: 620px;
  margin-bottom: 40px;
}

/* 状态卡：签名元素 */
.status-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  max-width: 620px;
  font-family: var(--mono);
  font-size: 13.5px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}
.status-card::before {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 60%, rgba(232, 163, 61, 0.06));
  pointer-events: none;
}
.sc-head {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--faint);
  font-size: 12px;
  letter-spacing: 0.08em;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 12px;
}
.sc-dot {
  display: inline-block; width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--green);
  margin-right: 8px;
  box-shadow: 0 0 8px var(--green);
  animation: pulse 2s infinite;
}
@keyframes pulse { 50% { opacity: 0.5; } }
.sc-row {
  display: flex; justify-content: space-between;
  padding: 5px 0;
}
.sc-key { color: var(--faint); }
.sc-val { color: var(--text); }
.sc-val.accent { color: var(--accent); font-weight: 700; }
.sc-foot {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--faint);
  font-size: 12px;
  display: flex; align-items: center; gap: 8px;
}
.sc-foot .cursor { color: var(--accent); animation: blink 1s steps(1) infinite; }

/* ---------- 区块标题 ---------- */
.sec-head {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 36px;
}
.sec-title { font-size: 24px; font-weight: 700; }
.sec-tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--faint);
  letter-spacing: 0.06em;
}

/* ---------- 作品网格 ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}
.work-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.2s, transform 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column; gap: 10px;
  position: relative;
}
.work-card:hover {
  border-color: var(--accent);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.wc-top { display: flex; justify-content: space-between; align-items: center; }
.wc-idx { font-family: var(--mono); font-size: 12px; color: var(--faint); }
.wc-status {
  font-family: var(--mono); font-size: 11px;
  padding: 2px 8px; border-radius: 4px;
  border: 1px solid var(--line);
  color: var(--dim);
}
.wc-status.online { color: var(--green); border-color: var(--green); }
.wc-status.wip { color: var(--accent); border-color: var(--accent); }
.work-card h3 { font-size: 17px; font-weight: 600; }
.work-card p { font-size: 13.5px; color: var(--dim); flex: 1; }
.wc-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.wc-tags span {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--blue);
  background: rgba(96, 165, 250, 0.08);
  padding: 2px 8px;
  border-radius: 4px;
}

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: flex; align-items: baseline; gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--text);
  transition: opacity 0.15s;
}
.post-item:hover { opacity: 0.85; }
.pi-date {
  font-family: var(--mono);
  font-size: 12.5px;
  color: var(--faint);
  flex-shrink: 0;
  min-width: 86px;
}
.pi-title { font-size: 16px; font-weight: 600; }
.pi-title .arrow { color: var(--accent); margin-left: 8px; opacity: 0; transition: opacity 0.15s; }
.post-item:hover .arrow { opacity: 1; }
.pi-desc { font-size: 13px; color: var(--dim); margin-top: 4px; }

/* ---------- 关于 ---------- */
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.about-grid h3 { font-size: 15px; margin-bottom: 12px; font-family: var(--mono); color: var(--accent); }
.about-grid p { font-size: 14.5px; color: var(--dim); margin-bottom: 10px; }
.mono-list { font-family: var(--mono); font-size: 13.5px; color: var(--dim); }
.mono-list li { list-style: none; padding: 7px 0; border-bottom: 1px dashed var(--line-soft); }
.mono-list li::before { content: "▸ "; color: var(--accent); }
.mono-list .k { color: var(--text); }

/* ---------- 页脚 ---------- */
footer { border-top: 1px solid var(--line); padding: 40px 0 56px; }
.foot-row {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 16px;
}
.foot-left { font-family: var(--mono); font-size: 12.5px; color: var(--faint); }
.foot-right { display: flex; gap: 24px; }
.foot-right a {
  font-family: var(--mono); font-size: 13px;
  color: var(--dim); text-decoration: none;
}
.foot-right a:hover { color: var(--accent); }

/* ---------- 文章页 ---------- */
.post-hero { padding: 80px 0 40px; }
.post-hero h1 { font-size: clamp(26px, 4vw, 40px); }
.post-meta {
  font-family: var(--mono); font-size: 13px; color: var(--faint);
  margin-top: 16px; display: flex; gap: 20px; flex-wrap: wrap;
}
.post-body { max-width: 720px; padding-bottom: 72px; }
.post-body h2 { font-size: 21px; margin: 40px 0 14px; }
.post-body h3 { font-size: 17px; margin: 28px 0 10px; }
.post-body p { font-size: 15.5px; color: #c3cad8; margin-bottom: 16px; }
.post-body code {
  font-family: var(--mono); font-size: 13px;
  background: var(--panel-2); border: 1px solid var(--line);
  padding: 2px 7px; border-radius: 5px; color: var(--accent);
}
.post-body pre {
  background: var(--panel-2); border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px; overflow-x: auto;
  margin: 20px 0;
}
.post-body pre code { background: none; border: none; padding: 0; color: #b8c4d8; font-size: 13px; line-height: 1.7; }
.post-body ul, .post-body ol { margin: 0 0 16px 24px; color: #c3cad8; font-size: 15.5px; }
.post-body li { margin-bottom: 6px; }
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 0 4px 18px;
  margin: 20px 0;
  color: var(--dim);
  font-size: 15px;
}
.post-body a { color: var(--blue); }
.back-link {
  display: inline-block;
  font-family: var(--mono); font-size: 13px;
  color: var(--dim); text-decoration: none;
  margin-bottom: 32px;
}
.back-link:hover { color: var(--accent); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  section { padding: 52px 0; }
  .hero { padding: 72px 0 48px; }
  nav { gap: 16px; }
  nav a { font-size: 12.5px; }
  .about-grid { grid-template-columns: 1fr; }
  .post-item { flex-direction: column; gap: 6px; }
  .pi-date { min-width: 0; }
  .foot-row { flex-direction: column; align-items: flex-start; }
}

/* 无障碍：焦点可见 */
a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 减少动画 */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
