/* ============================================================
   joeanwu.com · 样式表
   想改配色：直接改下面 :root 里的变量（--accent 是主色）
   想改字号/宽度：改 --maxw / --radius
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

:root {
  --bg: #0b0d10;
  --bg-soft: #11151a;
  --panel: rgba(255,255,255,.035);
  --line: rgba(255,255,255,.09);
  --fg: #e9eef4;
  --muted: #92a0ae;
  --accent: #7c5cff;
  --accent-2: #22d3a6;
  --radius: 16px;
  --maxw: 1000px;
  --pad: 24px;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "JetBrains Mono", Consolas, "Liberation Mono", monospace;
}

[data-theme="light"] {
  --bg: #f7f8fa;
  --bg-soft: #ffffff;
  --panel: rgba(255,255,255,.72);
  --line: rgba(12,16,22,.10);
  --fg: #10151b;
  --muted: #5b6876;
  --accent: #5b3df5;
  --accent-2: #0e9c78;
}

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* 背景光晕 */
body::before {
  content: "";
  position: fixed;
  inset: -20% -10% auto -10%;
  height: 70vh;
  background:
    radial-gradient(40% 50% at 20% 20%, color-mix(in oklab, var(--accent) 26%, transparent), transparent 70%),
    radial-gradient(36% 46% at 78% 8%, color-mix(in oklab, var(--accent-2) 18%, transparent), transparent 70%);
  filter: blur(10px);
  opacity: .55;
  pointer-events: none;
  z-index: 0;
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--pad); padding-right: var(--pad); position: relative; z-index: 1; }

a { color: inherit; text-decoration: none; }

.skip {
  position: absolute; left: -9999px; top: 12px;
  background: var(--accent); color: #fff; padding: 10px 16px; border-radius: 10px; z-index: 99;
}
.skip:focus { left: 16px; }

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: saturate(160%) blur(14px);
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; gap: 20px; height: 62px; }

.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 700; letter-spacing: .01em; }
.brand .dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 14px color-mix(in oklab, var(--accent) 70%, transparent);
}

.nav {
  margin-left: auto; display: flex; gap: 22px; font-size: 14px; color: var(--muted);
  overflow-x: auto; scrollbar-width: none; -ms-overflow-style: none; flex-shrink: 1;
}
.nav::-webkit-scrollbar { display: none; }
.nav a { flex: 0 0 auto; }
.nav a { position: relative; padding: 4px 0; transition: color .18s ease; }
.nav a:hover { color: var(--fg); }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 1.5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: right .22s ease;
}
.nav a:hover::after { right: 0; }

.theme-btn {
  border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  display: grid; place-items: center; font-size: 14px; transition: border-color .18s, transform .18s;
}
.theme-btn:hover { border-color: color-mix(in oklab, var(--accent) 60%, var(--line)); transform: translateY(-1px); }

/* ---------- Hero ---------- */
.hero { padding-block: 96px 84px; }
.hero .eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 12.5px; letter-spacing: .04em;
  color: var(--muted); border: 1px solid var(--line); border-radius: 999px;
  padding: 5px 12px; background: var(--panel);
}
.hero .eyebrow .pulse {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent-2) 60%, transparent);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in oklab, var(--accent-2) 55%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.hero h1 {
  margin: 26px 0 0;
  font-size: clamp(38px, 7vw, 66px);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 800;
}
.hero h1 .grad {
  background: linear-gradient(100deg, var(--accent), var(--accent-2) 70%, var(--fg));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .tagline {
  margin: 20px 0 0; font-family: var(--mono); font-size: clamp(15px, 2vw, 18px);
  color: var(--fg); opacity: .92;
}
.hero .intro { margin: 16px 0 0; max-width: 60ch; color: var(--muted); font-size: 16.5px; }

.cta-row { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 11px 20px; border-radius: 999px; font-size: 14.5px; font-weight: 600;
  border: 1px solid var(--line); background: var(--panel); color: var(--fg);
  transition: transform .16s ease, border-color .16s ease, background .16s ease;
}
.btn:hover { transform: translateY(-2px); border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); }
.btn.primary {
  background: linear-gradient(135deg, var(--accent), color-mix(in oklab, var(--accent) 55%, var(--accent-2)));
  border-color: transparent; color: #fff;
  box-shadow: 0 10px 30px -12px color-mix(in oklab, var(--accent) 75%, transparent);
}
.btn .arw { transition: transform .18s ease; }
.btn:hover .arw { transform: translateX(3px); }

/* ---------- 区块 ---------- */
section.block { padding-block: 62px; border-top: 1px solid var(--line); }
section.block:first-of-type { border-top: 0; }

.sec-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 30px; }
.sec-head h2 {
  margin: 0; font-size: clamp(22px, 3vw, 28px); letter-spacing: -.015em; font-weight: 750;
}
.sec-head .idx { font-family: var(--mono); font-size: 12.5px; color: var(--muted); letter-spacing: .08em; }
.sec-head .rule { flex: 1; height: 1px; background: var(--line); }

/* ---------- 项目卡片 ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; }

.card {
  position: relative; display: flex; flex-direction: column; gap: 12px;
  padding: 22px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--panel);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
  overflow: hidden;
}
.card::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(135deg, color-mix(in oklab, var(--accent) 12%, transparent), transparent 45%);
  opacity: 0; transition: opacity .25s ease; pointer-events: none;
}
.card:hover { transform: translateY(-4px); border-color: color-mix(in oklab, var(--accent) 45%, var(--line)); box-shadow: 0 18px 40px -24px rgba(0,0,0,.55); }
.card:hover::after { opacity: 1; }

.card .thumb { margin: -22px -22px 4px; }
.card .thumb img {
  display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border-bottom: 1px solid var(--line);
}
.card .top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.card .year { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: .06em; }
.card .go { font-size: 15px; color: var(--muted); transition: color .18s, transform .18s; }
.card:hover .go { color: var(--accent); transform: translate(2px, -2px); }
.card h3 { margin: 0; font-size: 18px; letter-spacing: -.01em; }
.card p { margin: 0; color: var(--muted); font-size: 14.8px; }
.tags { display: flex; flex-wrap: wrap; gap: 7px; margin-top: auto; padding-top: 6px; }
.tag {
  font-family: var(--mono); font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); background: color-mix(in oklab, var(--fg) 4%, transparent);
}

/* ---------- 技能 ---------- */
.skill-row {
  display: grid; grid-template-columns: 150px 1fr; gap: 18px; align-items: start;
  padding: 16px 0; border-bottom: 1px dashed var(--line);
}
.skill-row:last-child { border-bottom: 0; }
.skill-row .k { font-family: var(--mono); font-size: 13px; color: var(--muted); padding-top: 3px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font-size: 13.5px; padding: 5px 12px; border-radius: 9px;
  border: 1px solid var(--line); background: var(--panel);
  transition: border-color .18s ease, color .18s ease;
}
.chip:hover { border-color: color-mix(in oklab, var(--accent-2) 55%, var(--line)); }

/* ---------- 文章列表 ---------- */
.post-list { display: flex; flex-direction: column; }
.post-item {
  display: grid; grid-template-columns: 110px 1fr auto; gap: 18px; align-items: baseline;
  padding: 18px 8px; border-bottom: 1px solid var(--line);
  transition: background .18s ease, padding-left .18s ease;
}
.post-item:last-child { border-bottom: 0; }
.post-item:hover { background: color-mix(in oklab, var(--fg) 4%, transparent); padding-left: 14px; }
.post-item .date { font-family: var(--mono); font-size: 12.5px; color: var(--muted); }
.post-item .t { font-size: 16.5px; font-weight: 600; letter-spacing: -.01em; }
.post-item .s { color: var(--muted); font-size: 14px; font-weight: 400; margin-top: 4px; }
.post-item .arw { color: var(--muted); transition: transform .18s ease, color .18s ease; }
.post-item:hover .arw { color: var(--accent); transform: translateX(3px); }

/* ---------- 关于 ---------- */
.prose p { color: var(--muted); max-width: 66ch; margin: 0 0 14px; }
.prose strong { color: var(--fg); font-weight: 650; }

/* ---------- 联系 ---------- */
.contact { text-align: center; padding-block: 76px 88px; }
.contact h2 { margin: 0 0 12px; font-size: clamp(24px, 4vw, 34px); letter-spacing: -.02em; }
.contact p { margin: 0 auto 26px; color: var(--muted); max-width: 46ch; }
.mail {
  display: inline-block; font-family: var(--mono); font-size: clamp(15px, 2.4vw, 19px);
  padding: 12px 22px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel);
  word-break: break-all;
}
.mail:hover { border-color: color-mix(in oklab, var(--accent) 55%, var(--line)); }

/* ---------- 页脚 ---------- */
footer { border-top: 1px solid var(--line); padding: 26px 0 34px; }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; align-items: center; color: var(--muted); font-size: 13px; }
footer .links { display: flex; gap: 18px; }
footer a:hover { color: var(--fg); }

/* ---------- 文章页 ---------- */
.article { padding-block: 56px 80px; }
.article .back { font-family: var(--mono); font-size: 13px; color: var(--muted); display: inline-block; margin-bottom: 26px; }
.article .back:hover { color: var(--accent); }
.article h1 { margin: 0 0 12px; font-size: clamp(28px, 4.6vw, 42px); line-height: 1.2; letter-spacing: -.02em; }
.article .meta { font-family: var(--mono); font-size: 12.5px; color: var(--muted); margin-bottom: 34px; display: flex; gap: 14px; flex-wrap: wrap; }
.article .body { max-width: 70ch; }
.article .body h2 { margin: 40px 0 12px; font-size: 22px; letter-spacing: -.01em; }
.article .body h3 { margin: 30px 0 10px; font-size: 18px; }
.article .body p { color: var(--muted); margin: 0 0 16px; }
.article .body strong { color: var(--fg); }
.article .body ul, .article .body ol { color: var(--muted); padding-left: 22px; margin: 0 0 16px; }
.article .body li { margin: 6px 0; }
.article .body a { color: var(--accent); border-bottom: 1px solid color-mix(in oklab, var(--accent) 40%, transparent); }
.article .body blockquote {
  margin: 22px 0; padding: 4px 0 4px 18px; border-left: 2px solid var(--accent);
  color: var(--fg); font-style: normal;
}
.article .body code {
  font-family: var(--mono); font-size: .9em; padding: 2px 6px; border-radius: 6px;
  background: color-mix(in oklab, var(--fg) 8%, transparent);
}
.article .body pre {
  background: var(--bg-soft); border: 1px solid var(--line); border-radius: 12px;
  padding: 16px 18px; overflow-x: auto; margin: 0 0 18px;
}
.article .body pre code { background: none; padding: 0; font-size: 13.5px; }
.article .body hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.article .body img { max-width: 100%; border-radius: 12px; border: 1px solid var(--line); }

.pager { margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 16px; font-size: 14px; color: var(--muted); }
.pager a { max-width: 46%; }
.pager a:hover { color: var(--accent); }

/* ---------- 动效 ---------- */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease, transform .6s ease; }
.reveal.in { opacity: 1; transform: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  :root { --pad: 18px; }
  .hero { padding-block: 64px 56px; }
  .topbar .wrap { gap: 10px; }
  .nav { gap: 14px; font-size: 12.5px; }
  .skill-row { grid-template-columns: 1fr; gap: 8px; }
  .post-item { grid-template-columns: 1fr auto; }
  .post-item .date { grid-column: 1 / -1; }
  .pager { flex-direction: column; }
}

@media (max-width: 540px) {
  .topbar .wrap { flex-wrap: wrap; height: auto; padding-block: 10px; row-gap: 4px; }
  .nav {
    order: 3; width: 100%; margin-left: 0; gap: 16px;
    justify-content: space-between; overflow: visible; font-size: 13px;
  }
  .theme-btn { margin-left: auto; }
  .hero { padding-block: 44px 40px; }
  section.block { padding-block: 46px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .eyebrow .pulse { animation: none; }
  * { transition-duration: .01ms !important; }
}
