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

:root {
  --ink: #171f26;
  --ink-soft: #3b4956;
  --muted: #5f7180;
  --bg-a: #e7f0f8;
  --bg-b: #f8eef3;
  --hi: rgba(255, 255, 255, 0.95);
  --lo: rgba(23, 31, 38, 0.16);
  --r: 14px;
  --raise: -6px -6px 16px var(--hi), 6px 6px 18px var(--lo);
  --raise-sm: -4px -4px 10px var(--hi), 4px 4px 10px var(--lo);
  --sunk: inset -4px -4px 9px var(--hi), inset 4px 4px 9px var(--lo);
  --serif: "EB Garamond", "Crimson Text", Georgia, "Songti SC", "Noto Serif CJK SC", serif;
}

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

body {
  margin: 0;
  padding: 0 0 6.5rem;
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.8;
  color: var(--ink);
  background: linear-gradient(168deg, var(--bg-a) 0%, var(--bg-b) 52%, #edf2f7 100%);
  background-attachment: fixed;
  overflow-x: hidden;
}

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

a {
  color: #1e3c50;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid #2b4a60;
  outline-offset: 3px;
}

h1,
h2,
h3,
h4 {
  font-family: var(--serif);
  line-height: 1.25;
  letter-spacing: 0.01em;
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
}

.wrap {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2.4rem);
}

/* ---------- 首屏 ---------- */
.hero {
  min-height: 100svh;
  display: grid;
  gap: clamp(1.4rem, 4vw, 3rem);
  align-items: center;
  padding: clamp(2rem, 7vw, 3.4rem) 0 clamp(2rem, 6vw, 3rem);
}

.hero-art {
  margin: 0;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--raise);
  background: linear-gradient(150deg, #f2f8fc, #e6edf4);
}

.hero-img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

.hero-copy {
  text-align: right;
  min-width: 0;
}

.hero-copy h1 {
  font-size: clamp(2.1rem, 7.2vw, 3.6rem);
  font-weight: 600;
  margin-bottom: 0.5em;
}

.hero-copy .lead {
  font-size: 1.06rem;
  color: var(--muted);
  max-width: 40ch;
  margin: 0 0 0 auto;
  line-height: 1.9;
}

/* ---------- 正文 + 右侧栏 ---------- */
.col {
  display: grid;
  gap: clamp(1.4rem, 3vw, 2.4rem);
  padding-bottom: 2rem;
}

.prose {
  min-width: 0;
  overflow-wrap: break-word;
}

.prose > section {
  background: linear-gradient(150deg, #f5fafd, #e9eff5);
  border-radius: var(--r);
  box-shadow: var(--raise);
  padding: clamp(1.2rem, 3.4vw, 2.2rem);
  margin-bottom: 1.4rem;
  scroll-margin-top: 1.4rem;
  animation: rise 0.5s both;
}

.prose > section:last-child {
  margin-bottom: 0;
}

.prose > section:nth-child(2) { animation-delay: 0.05s; }
.prose > section:nth-child(3) { animation-delay: 0.1s; }
.prose > section:nth-child(4) { animation-delay: 0.15s; }
.prose > section:nth-child(5) { animation-delay: 0.2s; }
.prose > section:nth-child(6) { animation-delay: 0.25s; }
.prose > section:nth-child(7) { animation-delay: 0.3s; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.prose small {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.prose h2 {
  font-size: clamp(1.35rem, 3.6vw, 1.65rem);
  font-weight: 600;
  margin-bottom: 0.7em;
}

.prose h3 {
  font-size: 1.18rem;
  font-weight: 600;
  margin-top: 1.7em;
}

.prose p {
  color: var(--ink-soft);
  line-height: 1.88;
}

.prose ul,
.prose ol {
  padding-left: 1.3em;
  margin: 0 0 1em;
}

.prose li {
  margin-bottom: 0.45em;
  color: var(--ink-soft);
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 1em 1.2em;
  border-radius: 12px;
  box-shadow: var(--sunk);
  color: var(--ink-soft);
}

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

.prose img {
  border-radius: 10px;
  box-shadow: var(--raise-sm);
  margin: 1em 0;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 0.96rem;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--raise-sm);
}

.prose th,
.prose td {
  padding: 0.7em 0.85em;
  text-align: left;
  vertical-align: top;
}

.prose th {
  background: linear-gradient(145deg, #f3f9fd, #e6edf4);
  font-weight: 600;
}

.prose td {
  background: rgba(255, 255, 255, 0.42);
}

.prose strong {
  color: var(--ink);
}

/* ---------- 侧栏 ---------- */
.rail {
  background: linear-gradient(150deg, #f3f9fd, #e8eef5);
  border-radius: var(--r);
  box-shadow: var(--raise);
  padding: 1.1rem 1rem 1.2rem;
  align-self: start;
}

.rail-k {
  display: block;
  font-size: 0.74rem;
  letter-spacing: 0.3em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.rail-h {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 0.85rem;
}

.rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 0.35rem 0.75rem;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
  background: linear-gradient(145deg, #f7fbfe, #e9eff5);
  box-shadow: var(--raise-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.rail-list a:hover {
  box-shadow: var(--sunk);
}

.rail-list a[aria-current] {
  box-shadow: var(--sunk);
  color: var(--ink);
}

.rail-list a:active {
  transform: scale(0.97);
}

/* ---------- 页脚 ---------- */
.foot {
  width: min(1120px, 100%);
  margin: 2.6rem auto 0;
  padding: clamp(1.3rem, 4vw, 2.2rem) clamp(1rem, 4vw, 2.4rem) 1.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.3rem;
  align-items: flex-start;
  justify-content: space-between;
  border-radius: 20px 20px 0 0;
  background: linear-gradient(160deg, #eaf2f9, #f7eef3);
  box-shadow: var(--raise);
}

.cta {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 1.1rem 1.3rem;
  border-radius: 16px;
  box-shadow: var(--sunk);
}

.cta-brand {
  font-family: var(--serif);
  font-size: clamp(1.55rem, 5vw, 2.1rem);
  font-weight: 600;
  text-decoration: none;
  color: var(--ink);
}

.cta-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.1rem;
  border-radius: 12px;
  text-decoration: none;
  color: var(--ink-soft);
  box-shadow: var(--raise-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.cta-top:hover {
  box-shadow: var(--sunk);
}

.cta-top:active {
  transform: scale(0.97);
}

.foot-lead {
  flex: 1 1 13rem;
  min-width: 0;
}

.foot-name {
  font-family: var(--serif);
  font-size: 1.05rem;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.foot-mark {
  font-size: 1.2rem;
}

.foot-nav {
  flex: 1 1 16rem;
  min-width: 0;
}

.foot-nav ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.foot-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.8rem;
  border-radius: 10px;
  font-size: 0.95rem;
  text-decoration: none;
  color: var(--ink-soft);
  box-shadow: var(--raise-sm);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.foot-nav a:hover {
  box-shadow: var(--sunk);
}

.foot-nav a:active {
  transform: scale(0.97);
}

.foot-meta {
  flex: 1 1 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.9rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.foot-meta a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.3rem 0.2rem;
  color: var(--ink-soft);
  text-decoration: none;
}

/* ---------- 底部固定条 ---------- */
.dock {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.5rem 0.7rem calc(0.55rem + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  background: linear-gradient(165deg, #eaf2f9, #f7eef3);
  box-shadow: 0 -6px 22px rgba(23, 31, 38, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.dock ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.2rem;
}

.dock a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.35rem 0.62rem;
  border-radius: 10px;
  font-size: 0.95rem;
  color: var(--ink-soft);
  text-decoration: none;
  transition: box-shadow 0.15s ease, transform 0.15s ease, color 0.15s ease;
}

.dock a:hover {
  box-shadow: var(--raise-sm);
}

.dock a[aria-current] {
  box-shadow: var(--sunk);
  color: var(--ink);
}

.dock a:active {
  transform: scale(0.96);
}

.dock-brand {
  font-family: var(--serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--ink);
  padding: 0.2rem 0.8rem;
}

/* ---------- 断点 ---------- */
@media (min-width: 860px) {
  .hero {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  }

  .hero-art {
    order: 0;
  }
}

@media (min-width: 940px) {
  .col {
    grid-template-columns: minmax(0, 1fr) 17rem;
    align-items: start;
  }

  .rail {
    position: sticky;
    top: 1.5rem;
  }
}

@media (max-width: 859px) {
  body {
    padding-bottom: 12.5rem;
  }

  .dock {
    flex-direction: column;
    gap: 0.15rem;
    padding-top: 0.4rem;
  }

  .dock-brand {
    order: -1;
    font-size: 0.98rem;
    min-height: 34px;
    padding: 0.1rem 0.5rem;
  }

  .dock a {
    font-size: 0.92rem;
    min-height: 40px;
    padding: 0.28rem 0.5rem;
  }

  .foot {
    border-radius: 16px 16px 0 0;
  }

  .hero-copy .lead {
    font-size: 1rem;
  }
}

@media (max-width: 420px) {
  .dock {
    padding-left: 0.4rem;
    padding-right: 0.4rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation: none !important;
    transition: none !important;
  }

  .dock a:active,
  .rail-list a:active,
  .cta-top:active {
    transform: none;
  }
}

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