:root {
  --bg: #f6f1ea;
  --bg-soft: #faf7f2;
  --paper: #fffdf8;
  --paper-strong: #fffaf2;
  --line: #e8ded2;
  --line-strong: #d7caba;
  --text: #27303d;
  --muted: #6f7b8d;
  --faint: #98a1af;
  --blue: #2f66a5;
  --blue-soft: #e9f0f7;
  --orange: #d9793b;
  --green: #3aa076;
  --shadow: 0 12px 32px rgba(59, 50, 39, 0.07);
  --radius: 8px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 18%, rgba(217, 121, 59, 0.06), transparent 28rem),
    linear-gradient(180deg, var(--bg-soft), var(--bg));
  font-family: var(--sans);
  line-height: 1.65;
  letter-spacing: 0;
}

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

button,
input {
  font: inherit;
}

.container {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
}

.container.narrow {
  width: min(960px, calc(100% - 48px));
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 60px;
  padding: 0 28px;
  border-bottom: 1px solid rgba(232, 222, 210, 0.76);
  background: rgba(250, 247, 242, 0.82);
  backdrop-filter: blur(16px);
}

.brand,
.header-actions,
.nav-links {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand {
  justify-self: start;
  font-weight: 800;
  color: var(--text);
}

.brand-mark,
.brand-dot,
.terminal-token,
.eyebrow,
.text-link,
.article-meta,
.project-index,
.terminal-line {
  color: var(--blue);
  font-family: var(--mono);
}

.nav-links {
  justify-self: center;
}

.nav-links a,
.header-actions a {
  color: var(--muted);
  border-radius: 6px;
  padding: 7px 12px;
  transition: 0.18s ease;
}

.nav-links a:hover,
.header-actions a:hover,
.nav-links a.is-active {
  color: var(--blue);
  background: var(--blue-soft);
}

.header-actions {
  justify-self: end;
  font-size: 14px;
}

.page {
  display: none;
}

.page.is-active {
  display: block;
}

.hero-grid {
  min-height: 760px;
  padding: 140px 0 90px;
  border-bottom: 1px solid var(--line);
  /* 中文注释：首页首屏叠加冷暖柔和渐变，保留工程网格质感。 */
  background-image:
    linear-gradient(rgba(47, 102, 165, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(47, 102, 165, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 18% 18%, rgba(215, 225, 235, 0.68) 0, rgba(215, 225, 235, 0.24) 24rem, transparent 44rem),
    radial-gradient(circle at 52% 34%, rgba(255, 253, 248, 0.92) 0, rgba(255, 253, 248, 0.56) 24rem, transparent 52rem),
    radial-gradient(circle at 82% 82%, rgba(232, 203, 178, 0.48) 0, rgba(232, 203, 178, 0.18) 22rem, transparent 46rem),
    linear-gradient(180deg, #fbf8f2 0%, #f7f1e9 100%);
  background-size: 42px 42px, 42px 42px, auto, auto, auto, auto;
}

.hero-inner {
  max-width: 1080px;
}

.status-line {
  margin: 0 0 24px;
  color: var(--blue);
  font: 700 13px/1.4 var(--mono);
}

.status-line span {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--green);
}

.hero-grid h1 {
  max-width: 1120px;
  margin: 0;
  color: var(--text);
  font-size: clamp(44px, 7vw, 86px);
  font-weight: 850;
  line-height: 0.98;
  white-space: nowrap; /* 中文注释：桌面端强制首页大标题单行显示。 */
}

.terminal-token {
  display: block;
  margin-bottom: 6px;
  font-size: clamp(34px, 5vw, 64px);
  font-weight: 850;
}

.hero-copy,
.page-subtitle,
.section-intro {
  max-width: 720px;
  color: var(--muted);
  font-size: 19px;
}

.tag-row,
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row {
  margin: 34px 0 34px;
}

.tag-row span,
.chip,
.soft-card p span,
.article-tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 253, 248, 0.9);
  color: #536073;
  padding: 3px 10px;
  font: 700 12px/1 var(--mono);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 24px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--text);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.55) inset;
  font-weight: 750;
  transition: 0.18s ease;
}

.button:hover {
  border-color: var(--blue);
  transform: translateY(-1px);
}

.button-primary {
  border-color: var(--blue);
  background: var(--blue);
  color: #fffdf8;
  box-shadow: 0 10px 22px rgba(47, 102, 165, 0.18);
}

.text-link {
  font-weight: 800;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 22px;
  margin: 86px 0 0;
  padding: 0;
}

.metric-strip div {
  min-width: 0;
}

.metric-strip dt,
.metric-strip span {
  color: var(--muted);
  font: 700 13px/1.6 var(--mono);
}

.metric-strip dd {
  margin: 5px 0 0;
  color: var(--text);
  font: 850 25px/1.2 var(--mono);
}

.section-block {
  padding: 86px 0;
}

.section-divider {
  border-top: 1px solid var(--line);
}

.eyebrow {
  margin: 0 0 8px;
  font-weight: 800;
  font-size: 13px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h2,
.page-title {
  margin: 0;
  color: var(--text);
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.08;
  font-weight: 850;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 34px;
}

.stack-grid,
.card-grid,
.category-grid,
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.stack-grid {
  margin-top: 34px;
}

.stack-grid .soft-card:nth-child(4),
.stack-grid .soft-card:nth-child(5) {
  grid-column: span 1;
}

.soft-card,
.article-card,
.project-card,
.category-card,
.terminal-card,
.contact-panel,
.note-card,
.project-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: var(--shadow);
}

.soft-card {
  min-height: 112px;
  padding: 22px;
}

.soft-card h3,
.category-card h3 {
  margin: 0 0 14px;
  color: var(--blue);
  font: 750 15px/1.4 var(--mono);
}

.soft-card p,
.category-card p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.article-card {
  display: flex;
  min-height: 210px;
  flex-direction: column;
  justify-content: space-between;
  padding: 26px;
  transition: 0.18s ease;
}

.article-card:hover,
.project-card:hover,
.project-row:hover,
.note-card:hover,
.category-card:hover {
  border-color: rgba(47, 102, 165, 0.45);
  transform: translateY(-2px);
}

.article-meta {
  margin-bottom: 12px;
  font-size: 13px;
  font-weight: 800;
}

.article-card h3,
.project-card h3,
.article-item h2,
.project-row h2,
.note-card h2 {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  line-height: 1.28;
}

.article-card p,
.project-card p,
.article-item p,
.project-row p,
.note-card p {
  color: var(--muted);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.project-card {
  position: relative;
  min-height: 214px;
  padding: 28px;
  overflow: hidden;
}

.project-card::after {
  content: attr(data-index);
  position: absolute;
  top: 0;
  right: 0;
  width: 38px;
  height: 34px;
  border-left: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  display: grid;
  place-items: center;
  font: 800 12px/1 var(--mono);
}

.category-card {
  display: flex;
  gap: 18px;
  align-items: center;
  padding: 22px;
  transition: 0.18s ease;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border-radius: 7px;
  background: var(--blue-soft);
  color: var(--blue);
  font: 900 18px/1 var(--mono);
}

.category-card h3 {
  margin-bottom: 2px;
  color: var(--text);
  font-family: var(--sans);
  font-size: 18px;
}

.category-card p {
  color: var(--muted);
}

.page:not(.page-home) {
  padding: 72px 0 110px;
}

.page-title {
  margin-bottom: 12px;
}

.article-tools {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin: 42px 0 50px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 300px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.chip {
  cursor: pointer;
  min-height: 32px;
  background: var(--paper);
}

.chip.is-active {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue);
}

.article-list {
  border-top: 1px solid var(--line);
}

.article-item {
  display: block;
  padding: 28px 0;
  border-bottom: 1px solid var(--line);
}

.article-item h2 {
  margin-bottom: 8px;
}

.article-detail {
  max-width: 820px;
}

.back-link {
  display: inline-flex;
  margin-bottom: 26px;
  color: var(--blue);
  font: 800 14px/1 var(--mono);
}

.detail-shell {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
  padding: clamp(24px, 4vw, 48px);
}

.detail-shell h1 {
  margin: 12px 0 18px;
  font-size: clamp(34px, 5vw, 50px);
  line-height: 1.12;
}

.detail-shell h2 {
  margin-top: 34px;
  font-size: 25px;
}

.detail-shell p,
.detail-shell li {
  color: #536073;
}

.detail-shell pre {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f0eee9;
  padding: 20px;
  color: #334155;
  font: 13px/1.7 var(--mono);
}

.detail-shell code {
  font-family: var(--mono);
}

.project-list,
.note-list {
  display: grid;
  gap: 18px;
  margin-top: 58px;
}

.project-row {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 28px;
  padding: 34px;
  transition: 0.18s ease;
}

.project-index {
  font-size: 34px;
  font-weight: 900;
}

.project-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font: 800 13px/1.4 var(--mono);
}

.project-status::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.project-status.is-progress::before {
  background: var(--orange);
}

.project-points {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.project-points li {
  color: var(--muted);
  margin: 6px 0;
}

.project-points li::before {
  content: "›";
  margin-right: 10px;
  color: var(--blue);
  font-weight: 900;
}

.note-card {
  padding: 28px;
}

.note-card header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--blue);
  font: 750 14px/1.4 var(--mono);
}

.progress-track {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  margin-top: 22px;
}

.progress-bar {
  height: 7px;
  border-radius: 999px;
  background: #ece7df;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--orange));
}

.about-layout {
  max-width: 850px;
}

.terminal-card {
  margin-top: 28px;
  padding: 32px;
}

.terminal-card p {
  color: #536073;
}

.terminal-line {
  margin-top: 0;
}

.info-grid {
  margin: 34px 0 70px;
}

.timeline {
  position: relative;
  display: grid;
  gap: 36px;
  margin-top: 34px;
  padding-left: 34px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 10px;
  bottom: 10px;
  width: 1px;
  background: var(--line-strong);
}

.timeline article {
  position: relative;
}

.timeline article::before {
  content: "";
  position: absolute;
  left: -34px;
  top: 8px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--blue);
}

.timeline span {
  color: var(--muted);
  font: 800 13px/1.4 var(--mono);
}

.timeline h3 {
  margin: 6px 0 3px;
  font-size: 20px;
}

.timeline p {
  margin: 0;
  color: var(--muted);
}

.contact-panel {
  margin-top: 78px;
  padding: 36px;
  border-color: rgba(47, 102, 165, 0.35);
  background: linear-gradient(135deg, rgba(255, 253, 248, 0.96), rgba(246, 241, 234, 0.96));
}

.contact-panel h2 {
  font-size: 30px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 28px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font: 750 13px/1.4 var(--mono);
}

@media (min-width: 901px) {
  .brand {
    grid-column: 1; /* 中文注释：左侧品牌区域。 */
  }

  .nav-links {
    grid-column: 2; /* 中文注释：主导航固定放在中间列，保证页面居中。 */
    justify-self: center;
  }

  .header-actions {
    grid-column: 3; /* 中文注释：联系方式固定放在右侧列。 */
    justify-self: end;
  }
}

@media (max-width: 900px) {
  .site-header {
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 12px 18px;
  }
  
  .hero-grid h1 {
    white-space: normal; /* 中文注释：小屏幕允许标题换行，避免内容溢出。 */
    max-width: 100%;
  }

  .brand,
  .nav-links,
  .header-actions {
    grid-column: 1; /* 中文注释：小屏幕恢复单列布局。 */
    justify-self: center;
  }

  .nav-links {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero-grid {
    min-height: auto;
    padding: 82px 0 64px;
  }

  .metric-strip,
  .stack-grid,
  .card-grid,
  .category-grid,
  .info-grid {
    grid-template-columns: 1fr 1fr;
  }

  .article-tools {
    flex-direction: column;
  }

  .search-box {
    width: 100%;
  }

  .project-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .container,
  .container.narrow {
    width: min(100% - 28px, 1180px);
  }

  .hero-copy,
  .page-subtitle,
  .section-intro {
    font-size: 16px;
  }

  .metric-strip,
  .stack-grid,
  .card-grid,
  .category-grid,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .section-head,
  .site-footer,
  .note-card header {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    padding: 22px 14px;
  }
}
