:root {
  --bg: #f3f8f6;
  --surface: #ffffff;
  --surface-soft: #eaf4f1;
  --surface-blue: #edf4f7;
  --ink: #17302e;
  --muted: #617572;
  --line: #d9e7e3;
  --primary: #287d72;
  --primary-dark: #195d56;
  --blue: #3f7188;
  --amber: #b4772a;
  --shadow: 0 22px 60px rgba(29, 70, 65, 0.1);
  --radius: 18px;
  --container: min(1180px, calc(100% - 40px));
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.7;
}
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(rgba(40, 125, 114, 0.035) 1px, transparent 1px), linear-gradient(90deg, rgba(40, 125, 114, 0.035) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
[hidden], .is-hidden { display: none !important; }

.container { width: var(--container); margin-inline: auto; }
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}
.skip-link:focus { transform: translateY(0); }
:focus-visible { outline: 3px solid rgba(40, 125, 114, 0.42); outline-offset: 4px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 max(20px, calc((100vw - 1180px) / 2));
  border-bottom: 1px solid rgba(217, 231, 227, 0.9);
  background: rgba(243, 248, 246, 0.9);
  backdrop-filter: blur(16px);
}
.brand { display: inline-flex; align-items: center; gap: 9px; font-size: 16px; font-weight: 900; letter-spacing: 0.055em; }
.brand-dot { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); box-shadow: 13px 0 0 rgba(63, 113, 136, 0.32); }
.brand-muted { color: var(--primary); }
.site-nav { display: flex; align-items: center; gap: 24px; color: #445c59; font-size: 14px; font-weight: 700; }
.site-nav a { padding: 8px 0; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--primary-dark); }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -2px var(--primary); }
.site-nav .nav-cta { padding: 9px 16px; border: 1px solid var(--primary); border-radius: 999px; color: var(--primary-dark); }
.nav-toggle { display: none; width: 44px; height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.nav-toggle span { display: block; height: 2px; margin: 5px 0; background: var(--ink); }

.hero { padding: 92px 0 70px; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); gap: 70px; align-items: center; }
.eyebrow { margin: 0 0 16px; color: var(--primary); font-size: 13px; font-weight: 900; letter-spacing: 0.14em; text-transform: uppercase; }
.availability { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 20px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.68); color: var(--muted); font-size: 13px; font-weight: 700; }
.availability::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #36a184; box-shadow: 0 0 0 5px rgba(54,161,132,.12); }
h1, h2, h3 { margin-top: 0; line-height: 1.18; letter-spacing: -0.035em; }
.hero h1 { max-width: 780px; margin-bottom: 24px; font-size: clamp(42px, 6vw, 76px); }
.hero h1 span { color: var(--primary); }
.hero-copy { max-width: 700px; margin: 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); }
.hero-actions, .button-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 19px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); font-weight: 800; }
.primary-button { border-color: var(--primary); background: var(--primary); color: #fff; }
.primary-button:hover { background: var(--primary-dark); }
.secondary-button:hover { border-color: var(--primary); color: var(--primary-dark); }
.hero-meta { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 34px; color: var(--muted); font-size: 14px; }
.hero-meta strong { display: block; color: var(--ink); font-size: 20px; }

.terminal-card { overflow: hidden; border: 1px solid #cbded9; border-radius: 22px; background: #18312f; color: #dff1ec; box-shadow: var(--shadow); }
.terminal-head { display: flex; align-items: center; gap: 7px; padding: 15px 18px; border-bottom: 1px solid rgba(255,255,255,.09); color: #91b7ae; font: 12px ui-monospace, SFMono-Regular, Consolas, monospace; }
.terminal-head i { width: 9px; height: 9px; border-radius: 50%; background: #6e9189; }
.terminal-head i:first-child { background: #e48b75; }
.terminal-head i:nth-child(2) { background: #e7be6d; }
.terminal-head i:nth-child(3) { background: #68b995; }
.terminal-head span { margin-left: 8px; }
.terminal-body { padding: 26px; font: 14px/1.85 ui-monospace, SFMono-Regular, Consolas, monospace; }
.terminal-body p { margin: 0; }
.code-key { color: #8bd5c5; }
.code-string { color: #f2c879; }
.code-comment { color: #7fa49c; }
.status-list { display: grid; gap: 12px; margin: 24px 0 0; padding: 22px 0 0; border-top: 1px solid rgba(255,255,255,.1); }
.status-list div { display: flex; justify-content: space-between; gap: 20px; }
.status-list span { color: #8badab; }

.section { padding: 84px 0; }
.section-soft { background: rgba(234, 244, 241, 0.72); border-block: 1px solid var(--line); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 34px; }
.section-heading h2 { max-width: 720px; margin-bottom: 0; font-size: clamp(30px, 4vw, 46px); }
.section-heading > p { max-width: 520px; margin: 0; color: var(--muted); }
.text-link { display: inline-flex; align-items: center; gap: 6px; color: var(--primary-dark); font-weight: 850; }
.text-link:hover { gap: 10px; }

.module-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.module-card { min-height: 190px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.8); transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.module-card:hover { transform: translateY(-3px); border-color: #b9d4cd; box-shadow: 0 16px 34px rgba(29,70,65,.08); }
.module-number { display: flex; align-items: center; justify-content: space-between; margin-bottom: 38px; color: var(--primary); font: 700 12px ui-monospace, Consolas, monospace; }
.module-number span:last-child { color: #9bb0ac; }
.module-card h3 { margin-bottom: 9px; font-size: 20px; }
.module-card p { margin: 0; color: var(--muted); font-size: 14px; }

.skills-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.skill-group { padding: 26px; border-top: 3px solid var(--primary); border-radius: 4px 4px var(--radius) var(--radius); background: var(--surface); box-shadow: 0 12px 30px rgba(29,70,65,.05); }
.skill-group:nth-child(2) { border-color: var(--blue); }
.skill-group:nth-child(3) { border-color: var(--amber); }
.skill-group:nth-child(4) { border-color: #6d7797; }
.skill-group h3 { margin-bottom: 16px; font-size: 18px; }
.skill-group ul { display: grid; gap: 8px; margin: 0; padding: 0; color: var(--muted); list-style: none; font-size: 14px; }
.skill-group li::before { content: "//"; margin-right: 9px; color: #9bb3ae; font-family: monospace; }

.project-grid, .content-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.project-card, .content-card { display: flex; flex-direction: column; min-height: 320px; padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: 0 14px 36px rgba(29,70,65,.05); }
.project-card.featured { grid-column: span 2; background: linear-gradient(140deg, #fff 0%, #eaf5f1 100%); }
.card-topline { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 32px; color: var(--muted); font: 700 12px ui-monospace, Consolas, monospace; text-transform: uppercase; }
.project-card h3, .content-card h2 { margin-bottom: 12px; font-size: 24px; }
.project-card p, .content-card p { margin: 0 0 20px; color: var(--muted); }
.project-card .text-link, .content-card .text-link { margin-top: auto; }
.tag-list { display: flex; flex-wrap: wrap; gap: 7px; margin: 0 0 24px; }
.tag-list span { padding: 5px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-soft); color: #4f6d67; font-size: 12px; font-weight: 750; }

.split-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.panel { padding: 32px; border: 1px solid var(--line); border-radius: 22px; background: var(--surface); }
.panel h3 { font-size: 26px; }
.list-links { display: grid; margin-top: 24px; border-top: 1px solid var(--line); }
.list-links a, .list-links > div { display: grid; grid-template-columns: 100px 1fr auto; gap: 18px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.list-links small { color: var(--primary); font-weight: 800; }
.list-links span { color: var(--muted); }

.contact-strip { display: grid; grid-template-columns: 1fr auto; gap: 30px; align-items: center; padding: 44px; border-radius: 26px; background: var(--ink); color: #eaf7f3; }
.contact-strip h2 { margin-bottom: 12px; font-size: clamp(30px, 4vw, 48px); }
.contact-strip p { margin: 0; color: #aac4be; }
.contact-strip .button { border-color: #8eb1a8; background: #f7fffc; color: var(--ink); }

.page-hero { padding: 76px 0 52px; border-bottom: 1px solid var(--line); }
.page-hero h1 { max-width: 820px; margin-bottom: 18px; font-size: clamp(42px, 6vw, 68px); }
.page-hero p:not(.eyebrow) { max-width: 760px; margin: 0; color: var(--muted); font-size: 18px; }
.compact-hero { padding-block: 66px 44px; }
.content-controls { display: grid; gap: 18px; margin-bottom: 28px; }
.search-box { display: grid; gap: 7px; max-width: 620px; color: var(--muted); font-size: 13px; font-weight: 800; }
.search-box input, .field input, .field textarea, .tool-field input, .tool-field select { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--ink); }
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.section-filter { margin-bottom: 28px; }
.filter-chip { padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; font-size: 13px; font-weight: 800; }
.filter-chip:hover, .filter-chip.is-active { border-color: var(--primary); background: var(--surface-soft); color: var(--primary-dark); }
.result-status { min-height: 24px; margin: 0; color: var(--muted); font-size: 14px; }
.empty-state { padding: 40px; text-align: center; color: var(--muted); }

.article-header { padding: 70px 0 46px; }
.back-link { display: inline-block; margin-bottom: 34px; color: var(--muted); font-size: 14px; font-weight: 750; }
.article-header h1 { max-width: 900px; margin-bottom: 22px; font-size: clamp(38px, 5.4vw, 64px); }
.article-lead { max-width: 780px; color: var(--muted); font-size: 19px; }
.article-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; margin-top: 24px; color: var(--muted); font-size: 14px; }
.article-meta .tag-list { margin: 0; }
.article-header > .button { margin-top: 20px; }
.article-layout { display: grid; grid-template-columns: 220px minmax(0, 760px); gap: 70px; align-items: start; padding-bottom: 100px; }
.article-toc { position: sticky; top: 100px; display: grid; gap: 10px; padding: 20px; border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,.68); }
.article-toc p { margin: 0 0 5px; color: var(--ink); font-weight: 900; }
.article-toc a { color: var(--muted); font-size: 13px; }
.article-toc a:hover { color: var(--primary); }
.prose { min-width: 0; font-size: 17px; }
.prose h2 { margin: 58px 0 18px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 30px; scroll-margin-top: 100px; }
.prose h3 { margin: 34px 0 12px; font-size: 22px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose code { padding: 2px 6px; border-radius: 5px; background: #e6f0ed; color: #1e625a; font: .88em ui-monospace, Consolas, monospace; }
.prose pre { overflow-x: auto; margin: 26px 0; padding: 22px; border-radius: 14px; background: #18312f; color: #dceee9; }
.prose pre code { padding: 0; background: transparent; color: inherit; }
.prose blockquote { margin: 24px 0; padding: 16px 20px; border-left: 4px solid var(--primary); background: var(--surface-soft); color: #405d58; }
.prose a { color: var(--primary-dark); text-decoration: underline; text-underline-offset: 3px; }

.tool-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.tool-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.tool-card h2 { font-size: 22px; }
.tool-card > p { color: var(--muted); }
.tool-form { display: grid; gap: 13px; margin-top: 22px; }
.tool-field { display: grid; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 800; }
.tool-button { min-height: 44px; border: 0; border-radius: 10px; background: var(--primary); color: #fff; cursor: pointer; font-weight: 850; }
.tool-result { min-height: 74px; margin-top: 16px; padding: 14px; border-radius: 11px; background: var(--surface-soft); color: #315c55; font: 13px/1.7 ui-monospace, Consolas, monospace; white-space: pre-line; }
.resource-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.resource-group { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.resource-group h2 { font-size: 21px; }
.resource-group ul { display: grid; gap: 10px; margin: 18px 0 0; padding: 0; list-style: none; }
.resource-group a { color: var(--muted); }
.resource-group a:hover { color: var(--primary-dark); }
.resource-group a::after { content: " ↗"; color: #9bb0ac; }
.timeline { display: grid; gap: 0; max-width: 840px; }
.timeline-item { position: relative; display: grid; grid-template-columns: 120px 1fr; gap: 30px; padding: 0 0 38px 26px; border-left: 1px solid #bcd3cd; }
.timeline-item::before { content: ""; position: absolute; top: 5px; left: -5px; width: 9px; height: 9px; border-radius: 50%; background: var(--primary); }
.timeline-item time { color: var(--primary); font: 750 13px ui-monospace, Consolas, monospace; }
.timeline-item h2 { margin-bottom: 8px; font-size: 21px; }
.timeline-item p { margin: 0; color: var(--muted); }

.site-footer { display: grid; grid-template-columns: 1fr auto; gap: 24px 50px; align-items: start; padding: 52px max(20px, calc((100vw - 1180px) / 2)); border-top: 1px solid var(--line); background: #eaf3f0; }
.footer-brand { margin-bottom: 10px; }
.site-footer p { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 20px; color: #4d6863; font-size: 14px; font-weight: 750; }
.site-footer .copyright { grid-column: 1 / -1; padding-top: 20px; border-top: 1px solid #d5e5e0; }

@media (max-width: 980px) {
  .hero-grid, .split-grid { grid-template-columns: 1fr; }
  .hero-grid { gap: 44px; }
  .terminal-card { max-width: 680px; }
  .module-grid, .skills-grid { grid-template-columns: repeat(2, 1fr); }
  .project-grid, .content-grid, .tool-grid, .resource-grid { grid-template-columns: repeat(2, 1fr); }
  .project-card.featured { grid-column: auto; }
  .article-layout { grid-template-columns: 1fr; gap: 30px; }
  .article-toc { position: static; }
}

@media (max-width: 820px) {
  .site-header { min-height: 64px; }
  .nav-toggle { display: block; }
  .site-nav { position: fixed; top: 64px; left: 16px; right: 16px; display: none; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow); }
  .site-nav.is-open { display: grid; gap: 4px; }
  .site-nav a, .site-nav .nav-cta { padding: 11px 12px; border: 0; border-radius: 9px; box-shadow: none; }
  .site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--surface-soft); }
  .section-heading { align-items: start; flex-direction: column; }
  .contact-strip { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  :root { --container: min(100% - 28px, 1180px); --radius: 15px; }
  .hero { padding: 58px 0 52px; }
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { font-size: 43px; }
  .hero-meta { display: grid; grid-template-columns: repeat(2, 1fr); }
  .section { padding: 62px 0; }
  .section-heading h2 { font-size: 34px; }
  .module-grid, .skills-grid, .project-grid, .content-grid, .tool-grid, .resource-grid { grid-template-columns: 1fr; }
  .module-card { min-height: 160px; }
  .module-number { margin-bottom: 24px; }
  .panel, .contact-strip { padding: 24px; }
  .list-links a, .list-links > div { grid-template-columns: 75px 1fr auto; gap: 10px; }
  .list-links span { display: none; }
  .page-hero { padding: 54px 0 38px; }
  .page-hero h1 { font-size: 42px; }
  .article-header { padding: 48px 0 34px; }
  .article-header h1 { font-size: 38px; }
  .article-meta { align-items: start; flex-direction: column; }
  .timeline-item { grid-template-columns: 1fr; gap: 8px; }
  .site-footer { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
