:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --ink: #16202b;
  --ink-soft: #3d4c5c;
  --muted: #6b7d8f;
  --line: #e3eaf2;
  --sky: #2f8fd8;
  --sky-deep: #1e6fa8;
  --sky-soft: #e8f4fd;
  --gold: #f0a13c;
  --gold-soft: #fdf2e2;
  --radius: 22px;
  --shadow-sm: 0 2px 8px rgba(22, 32, 43, .05);
  --shadow-md: 0 14px 40px -18px rgba(22, 32, 43, .28);
  --shadow-lg: 0 28px 70px -30px rgba(30, 111, 168, .45);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

#projects, #about { scroll-margin-top: 86px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: saturate(180%) blur(14px);
  background: rgba(245, 248, 251, .78);
  border-bottom: 1px solid transparent;
  transition: border-color .3s ease;
}
.topbar.scrolled { border-bottom-color: var(--line); }

.topbar-inner {
  max-width: 980px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  letter-spacing: .02em;
}
.brand img {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}
.brand span { font-size: 15px; }

.nav {
  margin-left: auto;
  display: flex;
  gap: 6px;
}
.nav a {
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  color: var(--muted);
  text-decoration: none;
  transition: background .2s ease, color .2s ease;
}
.nav a:hover { background: var(--sky-soft); color: var(--sky-deep); }

/* ---------- 容器 ---------- */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 首屏 ---------- */
.hero {
  padding: 74px 0 40px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -120px 0 auto 50%;
  width: 620px;
  height: 620px;
  transform: translateX(-50%);
  background: radial-gradient(circle, rgba(47, 143, 216, .16), rgba(47, 143, 216, 0) 62%);
  pointer-events: none;
}

.avatar-ring {
  position: relative;
  display: inline-block;
  margin-bottom: 26px;
  animation: float 6s ease-in-out infinite;
}
.avatar-ring::after {
  content: "";
  position: absolute;
  inset: -12px;
  border-radius: 50%;
  border: 1.5px dashed rgba(47, 143, 216, .45);
  animation: spin 26s linear infinite;
}
.avatar {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 4px solid #fff;
  box-shadow: 0 18px 44px -18px rgba(30, 111, 168, .55);
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

h1.title {
  margin: 0 0 14px;
  font-size: clamp(30px, 5.4vw, 46px);
  line-height: 1.25;
  letter-spacing: .04em;
  font-weight: 800;
  background: linear-gradient(120deg, var(--ink) 30%, var(--sky-deep) 78%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.tagline {
  margin: 0 auto;
  max-width: 520px;
  color: var(--muted);
  font-size: 16px;
}

.hero-meta {
  margin-top: 26px;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-soft);
  box-shadow: var(--shadow-sm);
}
.dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #3ec28f;
  box-shadow: 0 0 0 3px rgba(62, 194, 143, .18);
}

/* ---------- 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 46px 0 20px;
}
.section-head h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: .06em;
}
.section-head .count {
  font-size: 13px;
  color: var(--muted);
}

/* ---------- 项目卡片 ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-bottom: 12px;
}

.card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease, border-color .35s ease;
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: #cfe2f3;
}

.cover {
  height: 152px;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
}
.cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(255, 255, 255, .35) 1px, transparent 1px);
  background-size: 16px 16px;
  opacity: .5;
}
.cover.yunnan { background: linear-gradient(135deg, #d9eefb 0%, #eaf6ee 55%, #fdf3e3 100%); }
.cover.yuepai { background: linear-gradient(135deg, #fdecef 0%, #efe9fb 52%, #e6f3fc 100%); }
.cover .glyph {
  position: relative;
  z-index: 1;
  font-size: 52px;
  filter: drop-shadow(0 10px 18px rgba(22, 32, 43, .16));
  transition: transform .4s cubic-bezier(.2, .7, .3, 1);
}
.card:hover .cover .glyph { transform: scale(1.08) rotate(-4deg); }

.card-body {
  padding: 20px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
}
.card-body h3 {
  margin: 0;
  font-size: 18px;
  letter-spacing: .02em;
}
.card-body p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  flex: 1;
}

.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--sky-soft);
  color: var(--sky-deep);
}
.tag.gold { background: var(--gold-soft); color: #b9771b; }

.go {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--sky-deep);
  margin-top: 2px;
}
.go svg { transition: transform .3s ease; }
.card:hover .go svg { transform: translateX(4px); }

/* ---------- 关于 ---------- */
.about {
  margin: 54px 0 0;
  padding: 28px 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.about h2 { margin: 0 0 10px; font-size: 18px; letter-spacing: .04em; }
.about p { margin: 0; color: var(--muted); font-size: 15px; }

/* ---------- 工作看板入口 ---------- */
.board {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  margin-top: 22px;
  padding: 26px 28px;
  background: linear-gradient(120deg, #ffffff 0%, #fbfdff 60%, #f4faf6 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease, border-color .35s ease;
}
.board:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cfe2f3; }

.board-text h3 { margin: 8px 0 8px; font-size: 18px; letter-spacing: .02em; }
.board-text p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.board-kicker {
  font-size: 11px;
  letter-spacing: .18em;
  color: var(--sky-deep);
  background: var(--sky-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.board-tree {
  display: grid;
  gap: 6px;
  padding: 16px 18px;
  background: #0f1b26;
  border-radius: 16px;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12.5px;
  color: #cfe0ef;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .04);
}
.board-tree .t-root { color: #ffffff; font-weight: 600; }
.board-tree .t-l1 { padding-left: 14px; position: relative; display: flex; gap: 8px; align-items: baseline; }
.board-tree .t-l1::before { content: "├─"; position: absolute; left: 0; color: #4f6d86; }
.board-tree .t-l1:last-child::before { content: "└─"; }
.board-tree .t-l1 i { font-style: normal; color: #7f9db5; font-size: 11.5px; }
.board-tree .t-l1 b { margin-left: auto; color: #f0a13c; font-weight: 500; font-size: 11px; }

@media (max-width: 760px) {
  .board { grid-template-columns: 1fr; padding: 22px; gap: 18px; }
}

/* ---------- 页脚 ---------- */
footer {
  margin-top: 64px;
  padding: 30px 0 44px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}
footer .sep { opacity: .5; margin: 0 8px; }

/* ---------- 项目详情页 ---------- */
.detail-hero {
  padding: 34px 0 8px;
}
.back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 16px 8px 12px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 13.5px;
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, color .2s ease, border-color .2s ease;
}
.back:hover { transform: translateX(-3px); color: var(--sky-deep); border-color: #cfe2f3; }

.detail-title {
  margin: 26px 0 12px;
  font-size: clamp(26px, 4.4vw, 38px);
  line-height: 1.3;
  letter-spacing: .02em;
  font-weight: 800;
}
.detail-sub {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 16px;
  max-width: 640px;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 8px;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow-sm);
}
.panel h4 {
  margin: 0 0 14px;
  font-size: 15px;
  letter-spacing: .08em;
  color: var(--muted);
  font-weight: 700;
}
.panel p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15px; }
.panel p:last-child { margin-bottom: 0; }

.features { margin: 0; padding: 0; list-style: none; display: grid; gap: 12px; }
.features li {
  display: flex;
  gap: 10px;
  font-size: 14.5px;
  color: var(--ink-soft);
  line-height: 1.6;
}
.features li::before {
  content: "";
  flex: 0 0 18px;
  height: 18px;
  margin-top: 3px;
  border-radius: 50%;
  background: var(--sky-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 6.2l2.2 2.2 4.6-4.8' fill='none' stroke='%232f8fd8' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/12px no-repeat;
}

.meta-list { display: grid; gap: 14px; margin: 0; }
.meta-list div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; color: var(--ink); font-weight: 600; text-align: right; }

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .25s ease, box-shadow .25s ease, background .25s ease;
}
.btn-primary {
  background: linear-gradient(135deg, var(--sky) 0%, var(--sky-deep) 100%);
  color: #fff;
  box-shadow: var(--shadow-lg);
}
.btn-primary:hover { transform: translateY(-2px); }
.btn-ghost {
  background: var(--surface);
  color: var(--ink-soft);
  border: 1px solid var(--line);
}
.btn-ghost:hover { border-color: #cfe2f3; color: var(--sky-deep); }

.next-project {
  margin-top: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 20px 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform .25s ease, box-shadow .25s ease;
}
.next-project:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.next-project .np-label { font-size: 12px; color: var(--muted); letter-spacing: .1em; }
.next-project .np-title { font-size: 16px; font-weight: 700; margin-top: 2px; }
.next-project .np-arrow { font-size: 20px; color: var(--sky); }

/* ---------- 进场动画 ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  animation: reveal .7s cubic-bezier(.2, .7, .3, 1) forwards;
}
@keyframes reveal {
  to { opacity: 1; transform: translateY(0); }
}
.d1 { animation-delay: .05s; }
.d2 { animation-delay: .14s; }
.d3 { animation-delay: .23s; }
.d4 { animation-delay: .32s; }

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  .hero { padding: 46px 0 28px; }
  .avatar { width: 118px; height: 118px; }
  .cards { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .wrap { padding: 0 18px; }
  .panel { padding: 22px; }
  .about { padding: 24px; }
  .nav a { padding: 7px 11px; }
  .brand span { display: none; }
}

/* ---------- 日志入口 ---------- */
.log-strip {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  margin-top: 22px;
  padding: 26px 28px;
  background: linear-gradient(120deg, #ffffff 0%, #fbfdff 55%, #fdfaf4 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  transition: transform .35s cubic-bezier(.2, .7, .3, 1), box-shadow .35s ease, border-color .35s ease;
}
.log-strip:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: #cfe2f3; }

.ls-kicker {
  font-size: 11px;
  letter-spacing: .18em;
  color: #b9771b;
  background: var(--gold-soft);
  padding: 3px 10px;
  border-radius: 999px;
}
.ls-text h3 { margin: 9px 0 8px; font-size: 18px; letter-spacing: .02em; }
.ls-text p { margin: 0 0 10px; color: var(--muted); font-size: 14px; line-height: 1.7; }

.ls-heat {
  display: grid;
  grid-template-columns: repeat(26, minmax(0, 1fr));
  gap: 3px;
}
.ls-heat i { display: block; aspect-ratio: 1 / 1; border-radius: 2px; background: #eef2f7; }

@media (max-width: 760px) {
  .log-strip { grid-template-columns: 1fr; padding: 22px; gap: 18px; }
  .ls-heat { grid-template-columns: repeat(26, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  /* 关掉动效时必须让内容直接可见，否则 .reveal 的 opacity:0 会让整页空白 */
  .reveal { opacity: 1 !important; transform: none !important; }
  * { animation: none !important; transition: none !important; }
}
