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

:root {
  --mint: #b4fde1;
  --blue: #add8e6;
  --ink: #172620;
  --paper: #f7fffb;
  --paper-2: #eaf6ff;
  --edge: 3px solid var(--ink);
}

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

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

body {
  margin: 0;
  font-family: 'Karla', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.74;
  color: var(--ink);
  overflow-x: hidden;
  background:
    radial-gradient(circle at 10% 6%, rgba(180, 253, 225, 0.9), transparent 56%),
    radial-gradient(circle at 90% 3%, rgba(173, 216, 230, 0.85), transparent 52%),
    linear-gradient(172deg, #f2fffa 0%, #eaf7ff 54%, #f5fffb 100%);
  background-attachment: fixed;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

h1, h2, h3, dt {
  font-family: 'Playfair Display SC', 'Karla', 'Songti SC', serif;
  line-height: 1.24;
  letter-spacing: 0.015em;
}

:focus-visible { outline: 3px solid #1f6f52; outline-offset: 3px; }

[id] { scroll-margin-top: 136px; }

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: linear-gradient(100deg, var(--mint), var(--blue));
  border-bottom: 4px solid var(--ink);
  box-shadow: 0 6px 0 rgba(23, 38, 32, 0.1);
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: var(--edge);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset -2px -3px 0 rgba(23, 38, 32, 0.14), 3px 4px 0 rgba(23, 38, 32, 0.18);
}

.brand img { width: 30px; height: 30px; }
.brand span { font-family: 'Playfair Display SC', serif; font-size: 20px; font-weight: 700; }

.burger {
  width: 52px;
  height: 46px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  border: var(--edge);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset -2px -3px 0 rgba(23, 38, 32, 0.14), 3px 4px 0 rgba(23, 38, 32, 0.18);
  cursor: pointer;
  transition: transform 0.2s ease-out;
}

.burger:active { transform: translateY(2px); }

.burger span {
  display: block;
  width: 22px;
  height: 3px;
  border-radius: 3px;
  background: var(--ink);
  transition: transform 0.2s ease-out, opacity 0.2s ease-out;
}

.burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* 全屏菜单 */
.menu {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 26px 20px;
  background: radial-gradient(circle at 40% 30%, rgba(180, 253, 225, 0.98), rgba(173, 216, 230, 0.98));
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease-out, visibility 0.22s;
}

.menu.open { opacity: 1; visibility: visible; }

.menu-nav { width: 100%; max-width: 520px; }
.menu-nav ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }

.menu-nav a {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 12px 18px;
  font-size: 19px;
  font-weight: 600;
  border: var(--edge);
  border-radius: 18px;
  background: var(--paper);
  box-shadow: inset -2px -3px 0 rgba(23, 38, 32, 0.12), 4px 5px 0 rgba(23, 38, 32, 0.18);
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease-out;
}

.menu-nav a:hover { transform: translateY(-2px); background: #ffffff; text-decoration: none; }

.menu-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 48px;
  height: 48px;
  font-size: 24px;
  line-height: 1;
  border: var(--edge);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: inset -2px -3px 0 rgba(23, 38, 32, 0.14), 3px 4px 0 rgba(23, 38, 32, 0.18);
  cursor: pointer;
}

/* 锚点条 */
.anchors {
  position: sticky;
  top: 70px;
  z-index: 30;
  padding: 6px 10px;
  background: rgba(247, 255, 251, 0.95);
  border-bottom: var(--edge);
}

.anchors ol {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}

.anchors a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 15px;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 600;
  border: var(--edge);
  border-radius: 999px;
  background: #ffffff;
  box-shadow: inset -2px -2px 0 rgba(23, 38, 32, 0.1), 2px 3px 0 rgba(23, 38, 32, 0.14);
}

.anchors a:hover { background: var(--mint); text-decoration: none; }

/* 头图 */
.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: center;
  min-height: 45vh;
  padding: 28px 18px 32px;
  border-bottom: 4px solid var(--ink);
  background-image: radial-gradient(rgba(23, 38, 32, 0.15) 1.6px, transparent 1.7px);
  background-size: 18px 18px;
}

.hero h1 {
  margin: 0;
  font-size: clamp(30px, 7.4vw, 54px);
  text-shadow: 2px 3px 0 rgba(180, 253, 225, 0.95);
}

.hero-art {
  border: 4px solid var(--ink);
  border-radius: 24px;
  overflow: hidden;
  background: linear-gradient(160deg, var(--mint), var(--blue));
  box-shadow: inset -4px -6px 0 rgba(23, 38, 32, 0.1), 8px 10px 0 rgba(23, 38, 32, 0.16);
  animation: bob 5.4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

/* 主体 */
main { padding: 24px 14px 44px; }

.wrap { max-width: 1080px; margin: 0 auto; display: grid; gap: 22px; }

.sheet {
  background: var(--paper);
  border: 4px solid var(--ink);
  border-bottom: 6px solid var(--ink);
  border-radius: 0;
  box-shadow: inset -3px -4px 0 rgba(23, 38, 32, 0.06), 7px 9px 0 rgba(23, 38, 32, 0.13);
  overflow: hidden;
}

.sheet-head {
  padding: 20px 18px 16px;
  background: linear-gradient(120deg, rgba(180, 253, 225, 0.8), rgba(173, 216, 230, 0.6));
  border-bottom: 3px dashed rgba(23, 38, 32, 0.4);
}

.sheet-head h2 { margin: 0; font-size: clamp(22px, 4.2vw, 30px); }
.subtitle { margin: 8px 0 0; font-size: 17px; font-weight: 600; color: #1f4a3a; }

div { padding: 4px 16px 16px; }

div > article {
  padding: 22px 0;
  border-bottom: 5px solid var(--ink);
  border-radius: 0;
}

div > article:last-child { border-bottom: 0; padding-bottom: 6px; }

div h2 {
  position: relative;
  margin: 0 0 12px;
  padding-bottom: 10px;
  font-size: clamp(21px, 3.8vw, 27px);
}

div h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 58px;
  height: 6px;
  border-radius: 4px;
  background: var(--mint);
  border: 2px solid var(--ink);
}

div h3 { margin: 20px 0 8px; font-size: 19px; }
div p { margin: 0 0 14px; }
div ul, div ol { margin: 0 0 14px; padding-left: 22px; }
div li { margin-bottom: 6px; }

div img {
  margin: 16px 0;
  border: 3px solid var(--ink);
  border-radius: 16px;
  box-shadow: 5px 6px 0 rgba(23, 38, 32, 0.14);
}

div blockquote {
  margin: 16px 0;
  padding: 12px 16px;
  border: 3px solid var(--ink);
  border-left-width: 8px;
  background: linear-gradient(120deg, rgba(180, 253, 225, 0.55), rgba(173, 216, 230, 0.45));
}

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

div table { width: 100%; border-collapse: collapse; margin: 16px 0; font-size: 16px; }
div th, div td { border: 2px solid var(--ink); padding: 8px 10px; text-align: left; }
div th { background: var(--blue); }

div a { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* 侧栏 */
.side { display: grid; gap: 16px; }

.side-card {
  padding: 16px;
  background: linear-gradient(150deg, #ffffff, var(--paper-2));
  border: 3px solid var(--ink);
  border-bottom: 6px solid var(--ink);
  border-radius: 0;
  box-shadow: inset -3px -4px 0 rgba(23, 38, 32, 0.07), 6px 7px 0 rgba(23, 38, 32, 0.14);
}

.side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-bottom: 12px;
  border-bottom: var(--edge);
}

.side-mark {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: var(--edge);
  border-radius: 13px;
  background: var(--mint);
  box-shadow: inset -2px -2px 0 rgba(23, 38, 32, 0.15);
  font-family: 'Playfair Display SC', serif;
  font-size: 18px;
  font-weight: 700;
  overflow: hidden;
}

.side-mark img { width: 26px; height: 26px; }
.side-name { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.35; }

.side-nav ol { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 2px; }

.side-nav a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 6px 8px;
  font-size: 16px;
  font-weight: 600;
  border-bottom: 2px solid rgba(23, 38, 32, 0.16);
}

.side-nav a:hover { background: var(--mint); border-bottom-color: var(--ink); text-decoration: none; }

/* 页脚 */
.foot {
  padding: 24px 16px 16px;
  border-top: 4px solid var(--ink);
  background: linear-gradient(180deg, var(--paper-2), #dcf2ff);
}

.foot-grid { max-width: 1080px; margin: 0 auto; display: grid; grid-template-columns: 1fr; gap: 18px; }

.foot dl { margin: 0; }
.foot dt { margin-bottom: 4px; padding-bottom: 6px; font-size: 16px; font-weight: 700; border-bottom: var(--edge); }
.foot dd { margin: 0; }

.foot dd a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 4px 0;
  font-size: 16px;
  font-weight: 600;
}

.copy {
  max-width: 1080px;
  margin: 14px auto 0;
  padding-top: 12px;
  font-size: 16px;
  text-align: center;
  border-top: 2px dashed rgba(23, 38, 32, 0.3);
}

/* 动效 */
.rv { opacity: 0; transform: translateY(16px); }

.rv.in {
  opacity: 1;
  transform: none;
  transition: opacity 0.5s ease-out var(--d, 0s), transform 0.62s cubic-bezier(0.34, 1.56, 0.64, 1) var(--d, 0s);
}

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

/* 断点 */
@media (min-width: 760px) {
  .hero {
    grid-template-columns: 1.08fr 0.92fr;
    gap: 30px;
    padding: 34px 30px 38px;
  }
  main { padding: 28px 20px 48px; }
  div { padding: 6px 22px 20px; }
  .sheet-head { padding: 24px 22px 18px; }
  .foot-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 980px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 268px;
    align-items: start;
    gap: 26px;
  }
  .side { position: sticky; top: 128px; }
  body { font-size: 18px; }
}

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