@import url('https://fonts.googleapis.com/css2?family=Fira+Code:wght@400;500;600;700&family=Fira+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #172623;
  --ink-soft: #2b453f;
  --mint: #5cc6b0;
  --sand: #d4c4a8;
  --paper: #f4eee3;
  --paper-2: #ece4d5;
  --clay: #b8825f;
  --olive: #6b7b3c;
  --line: #dbd1bd;
  --muted: #5c6b62;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding-bottom: 108px;
  background: var(--paper);
  color: var(--ink);
  font-family: 'Fira Sans', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.55;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)' opacity='0.26'/%3E%3C/svg%3E");
}

a { color: inherit; }
img { display: block; max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid var(--olive); outline-offset: 3px; }

main { position: relative; z-index: 1; }

/* 头部拼贴 */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  align-items: center;
  gap: 26px;
  min-height: 45vh;
  padding: 38px 22px 46px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 0 0 28px 28px;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 14px;
  background: linear-gradient(90deg, var(--mint), var(--sand) 55%, var(--clay));
  clip-path: polygon(0 62%, 100% 0, 100% 100%, 0 100%);
}

.hero-copy { max-width: 34rem; }

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 5.6vw, 3rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  font-weight: 700;
}

.hero-brand {
  display: inline-block;
  margin: 0 0 14px;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--mint);
}

.hero-brand span {
  padding-bottom: 3px;
  border-bottom: 1px dashed rgba(212, 196, 168, 0.55);
}

.hero-desc {
  margin: 0;
  max-width: 32ch;
  color: #cfd8d0;
  font-size: 1rem;
}

.hero-art {
  position: relative;
  height: 100%;
  min-height: 210px;
  will-change: transform;
}

.ph {
  position: absolute;
  margin: 0;
  overflow: hidden;
  border: 6px solid var(--sand);
  border-radius: 28px;
  background: linear-gradient(135deg, #33544b, #4c7767);
  box-shadow: 0 18px 34px rgba(8, 16, 14, 0.42);
  border-bottom-width: 9px;
  border-bottom-color: var(--mint);
}

.ph-img { width: 100%; height: 100%; object-fit: cover; }

.ph-a {
  left: 0;
  top: 4%;
  width: 60%;
  aspect-ratio: 3 / 4;
  border-radius: 28px 28px 10px 28px;
  transform: rotate(-4deg);
}

.ph-b {
  right: 0;
  bottom: 0;
  width: 54%;
  aspect-ratio: 1 / 1;
  border-radius: 12px 28px 28px 28px;
  transform: rotate(5deg);
  z-index: 2;
}

/* 正文 */
article {
  max-width: 760px;
  margin: 0 auto;
  padding: 42px 22px 64px;
  position: relative;
  z-index: 1;
}

article section { scroll-margin-top: 24px; }

article > section {
  position: relative;
  padding-top: 34px;
  border-top: 2px solid var(--line);
}

article > section + section { margin-top: 36px; }

article > section:first-child {
  padding-top: 0;
  border-top: 0;
}

article > section:not(:first-child)::before {
  content: "";
  position: absolute;
  top: -2px;
  left: 0;
  width: 54px;
  height: 4px;
  background: var(--mint);
}

article h2 {
  margin: 0 0 14px;
  font-size: clamp(1.4rem, 4.4vw, 1.85rem);
  line-height: 1.3;
  letter-spacing: -0.01em;
}

article h2 span {
  background: linear-gradient(transparent 64%, rgba(92, 198, 176, 0.48) 64%);
}

article h3 {
  margin: 26px 0 10px;
  font-size: 1.15rem;
  line-height: 1.4;
  color: var(--ink-soft);
}

article h3 span {
  padding-bottom: 2px;
  border-bottom: 2px solid var(--sand);
}

article p { margin: 0 0 16px; max-width: 66ch; }

article ul, article ol { margin: 0 0 18px; padding-left: 1.35em; max-width: 66ch; }
article li { margin: 0 0 8px; }
article ul li::marker { color: var(--clay); }
article ol li::marker { color: var(--olive); font-family: 'Fira Code', monospace; }

article a {
  text-decoration: underline;
  text-decoration-color: var(--mint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

article a:hover { background: rgba(92, 198, 176, 0.22); }

article strong { color: var(--ink); }

article blockquote {
  margin: 24px 0;
  padding: 16px 20px;
  background: var(--paper-2);
  border-left: 6px solid var(--mint);
  border-radius: 0 28px 28px 0;
  box-shadow: 0 4px 0 var(--sand);
}

article blockquote p:last-child { margin-bottom: 0; }

article img {
  margin: 22px 0;
  border-radius: 28px;
  box-shadow: 0 4px 0 var(--sand);
}

article figure { margin: 22px 0; }
article figcaption { font-size: 0.95rem; color: var(--muted); margin-top: 8px; }

article code {
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 0.95em;
  background: rgba(23, 38, 35, 0.08);
  border-radius: 6px;
  padding: 1px 5px;
}

article pre {
  overflow-x: auto;
  padding: 14px 16px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 16px;
}

article pre code { background: none; padding: 0; color: inherit; }

article table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 0.98rem;
}

article th, article td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  text-align: left;
}

article th { background: var(--paper-2); }

/* 底部固定条 */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  background: rgba(23, 38, 35, 0.97);
  box-shadow: 0 -8px 26px rgba(23, 38, 35, 0.28);
}

.dock-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 1080px;
  margin: 0 auto;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
}

.burger {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 15px;
  border: 1px solid var(--ink-soft);
  border-radius: 999px;
  background: transparent;
  color: var(--sand);
  font: inherit;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.22s ease-out, color 0.22s ease-out;
}

.burger i {
  display: block;
  width: 16px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor, 0 -5px 0 currentColor;
}

.dock.is-open .burger { background: var(--mint); color: var(--ink); border-color: var(--mint); }

.dock-brand {
  margin: 0 auto;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-family: 'Fira Code', ui-monospace, monospace;
  letter-spacing: 0.06em;
  color: var(--sand);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dock-cta {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 17px;
  border-radius: 999px;
  background: var(--mint);
  color: var(--ink);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: transform 0.18s ease-out, background 0.18s ease-out;
}

.dock-cta:hover { background: #7ad6c2; transform: translateY(-2px); }

.dock-menu {
  position: fixed;
  inset: 0;
  z-index: 30;
  padding: 60px 22px 130px;
  overflow-y: auto;
  background: var(--ink);
  color: var(--paper);
  opacity: 0;
  visibility: hidden;
  transform: translateY(14px);
  transition: opacity 0.28s ease-out, transform 0.28s ease-out, visibility 0.28s;
}

.dock.is-open .dock-menu { opacity: 1; visibility: visible; transform: none; }

.dock-title {
  margin: 0 0 16px;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.3em;
  color: var(--mint);
}

.dock-title span { padding-bottom: 3px; border-bottom: 1px dashed var(--ink-soft); }

.dock-menu ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }

.dock-menu a {
  display: flex;
  align-items: center;
  min-height: 54px;
  padding: 4px 2px;
  font-size: 1.3rem;
  line-height: 1.4;
  text-decoration: none;
  border-bottom: 1px solid var(--ink-soft);
  transition: padding-left 0.2s ease-out, color 0.2s ease-out;
}

.dock-menu a:hover { padding-left: 10px; color: var(--mint); }

/* 页脚 */
.foot {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 10px 20px;
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 22px 36px;
  border-top: 3px solid var(--ink);
}

.foot-brand {
  margin: 0;
  font-family: 'Fira Code', ui-monospace, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.foot-copy { color: var(--muted); }

/* 回到顶部 */
.totop {
  position: fixed;
  right: 14px;
  bottom: 92px;
  z-index: 35;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 15px;
  border-radius: 999px;
  background: var(--sand);
  color: var(--ink);
  font-size: 1rem;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(23, 38, 35, 0.2);
  transition: transform 0.18s ease-out;
}

.totop:hover { transform: translateY(-2px); }

@media (max-width: 720px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 34px 20px 42px;
    gap: 22px;
  }

  .hero-art { height: 168px; min-height: 168px; }

  .hero-desc { max-width: none; }

  section { padding: 34px 20px 52px; }
  section > article + article { margin-top: 30px; }

  .foot { grid-template-columns: 1fr; }
  .foot-copy { text-align: left; }

  .dock-menu a { font-size: 1.2rem; }
  .totop { bottom: 88px; }
}

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

button[aria-expanded]{min-width:44px;min-height:44px}
