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

:root {
  --purple: #56228b;
  --brown: #8b4513;
  --ink: #1f1726;
  --paper: #f7f1e7;
  --paper-2: #efe5d5;
  --violet-soft: #ebe0f6;
  --brown-soft: #f2e6d6;
  --r-lg: 24px;
  --r-md: 15px;
  --r-sm: 4px;
  --shadow: 0 18px 40px -30px rgba(31, 23, 38, 0.55);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-bottom: 104px;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  margin: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  font-family: 'Lato', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(58% 38% at 90% 2%, rgba(86, 34, 139, 0.12), transparent 72%),
    radial-gradient(52% 34% at 2% 66%, rgba(139, 69, 19, 0.11), transparent 72%),
    repeating-linear-gradient(94deg, rgba(31, 23, 38, 0.024) 0 1px, transparent 1px 9px);
  background-attachment: fixed;
}

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

a {
  color: var(--purple);
}

::selection {
  background: rgba(86, 34, 139, 0.22);
}

/* 主视觉 */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 45vh;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  text-align: right;
  padding: clamp(22px, 4vw, 48px);
  color: #fdf8f2;
  background: linear-gradient(158deg, #3b1a60 0%, #56228b 52%, #7a4420 100%);
  border-radius: var(--r-lg) var(--r-lg) 66px 66px;
  box-shadow: var(--shadow);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(31, 23, 38, 0.26), rgba(31, 23, 38, 0.54) 52%, rgba(31, 23, 38, 0.86));
}

.hero-art {
  position: absolute;
  inset: 0;
  z-index: -2;
  overflow: hidden;
}

.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}

.hero-img.lead {
  animation: breathe 26s ease-in-out infinite alternate;
}

.hero-art.cycling .hero-img {
  opacity: 0;
  animation: cycle 21s linear infinite;
}

.hero-art.cycling .hero-img.lead {
  opacity: 1;
  animation-delay: 0s;
}

.hero-art.cycling .hero-img:nth-child(2) {
  animation-delay: 7s;
}

.hero-art.cycling .hero-img:nth-child(3) {
  animation-delay: 14s;
}

@keyframes breathe {
  from { transform: scale(1.02); }
  to { transform: scale(1.1); }
}

@keyframes cycle {
  0% { opacity: 0; }
  4% { opacity: 1; }
  29% { opacity: 1; }
  35% { opacity: 0; }
  100% { opacity: 0; }
}

.hero-ghost {
  position: absolute;
  right: 0;
  bottom: -0.12em;
  z-index: 1;
  max-width: 100%;
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-size: clamp(64px, 16vw, 190px);
  font-weight: 600;
  line-height: 0.78;
  letter-spacing: 0.04em;
  color: rgba(253, 248, 242, 0.14);
  pointer-events: none;
  user-select: none;
  white-space: nowrap;
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 640px;
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  font-size: 16px;
  letter-spacing: 0.3em;
  color: #e7d4f7;
}

.hero h1 {
  margin: 0 0 20px;
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-weight: 600;
  font-size: clamp(27px, 6vw, 52px);
  line-height: 1.14;
  letter-spacing: 0.01em;
  overflow-wrap: break-word;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: var(--r-md) var(--r-sm) var(--r-md) var(--r-sm);
  background: rgba(253, 248, 242, 0.95);
  color: var(--purple);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.hero-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -16px rgba(0, 0, 0, 0.65);
}

/* 底部固定条 */
.dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  background: rgba(31, 23, 38, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.11);
  scrollbar-width: thin;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.dock ul {
  list-style: none;
  width: max-content;
  max-width: none;
  margin: 0 auto;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.dock li {
  flex: none;
}

.dock a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 11px;
  border-radius: 14px;
  color: #ece1f6;
  font-size: 16px;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.2s ease, color 0.2s ease;
}

.dock a:hover {
  background: rgba(255, 255, 255, 0.13);
  color: #fff;
}

.dock a.is-on {
  background: var(--purple);
  color: #fff;
}

.dock .ico {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50% 50% 50% 15%;
  background: var(--brown);
}

.dock a:hover .ico,
.dock a.is-on .ico {
  background: #eac9a6;
}

.dock-brand a {
  padding: 0 14px;
  color: #fff;
}

.dock-brand .mark,
.f-logo .mark {
  height: 26px;
  width: auto;
  display: block;
}

.brand-txt {
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-size: 17px;
  letter-spacing: 0.12em;
  color: #fff;
}

/* 版心与侧栏 */
.wrap {
  max-width: 1168px;
  margin: 0 auto;
  padding: clamp(16px, 2.6vw, 34px) clamp(15px, 4vw, 36px) 0;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(20px, 3vw, 40px);
  align-items: start;
}

.stage {
  min-width: 0;
  max-width: 100%;
}

.toc {
  position: sticky;
  top: 22px;
  min-width: 0;
}

.toc h2 {
  margin: 0 0 10px;
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.28em;
  color: var(--brown);
}

.toc nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.toc nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 8px 12px;
  border-radius: var(--r-md) var(--r-sm) var(--r-md) var(--r-sm);
  background: rgba(255, 255, 255, 0.62);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.4;
  text-decoration: none;
  box-shadow: 0 1px 0 rgba(31, 23, 38, 0.06);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.toc nav a:hover {
  background: var(--violet-soft);
  color: var(--purple);
  transform: translateX(2px);
}

.toc nav a.is-on {
  background: var(--purple);
  color: #fff;
}

/* 正文 */
.prose {
  margin-top: 22px;
  min-width: 0;
  max-width: 100%;
  overflow-wrap: break-word;
  word-break: break-word;
}

.prose > div {
  background: #fffdf8;
  padding: clamp(18px, 3.2vw, 34px);
  margin: 0 0 22px;
  min-width: 0;
  max-width: 100%;
  border-radius: var(--r-md) var(--r-sm) var(--r-md) var(--r-sm);
  box-shadow: var(--shadow);
  scroll-margin-top: 16px;
  scroll-margin-bottom: 104px;
  overflow-wrap: break-word;
}

.prose > div:nth-child(even) {
  background: var(--brown-soft);
  border-radius: var(--r-sm) var(--r-lg) var(--r-sm) var(--r-lg);
  box-shadow: none;
}

.prose > div > *:first-child {
  margin-top: 0;
}

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

.prose p {
  margin: 0 0 1.05em;
  max-width: 70ch;
}

.prose h2 {
  margin: 0.2em 0 0.6em;
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-weight: 600;
  font-size: clamp(21px, 3.4vw, 29px);
  line-height: 1.3;
  color: var(--purple);
  overflow-wrap: break-word;
}

.prose h2 > span {
  padding-bottom: 3px;
  background: linear-gradient(transparent 72%, rgba(86, 34, 139, 0.2) 72%);
}

.prose h3 {
  margin: 1.5em 0 0.5em;
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-weight: 600;
  font-size: clamp(19px, 2.6vw, 23px);
  line-height: 1.35;
  color: var(--brown);
  overflow-wrap: break-word;
}

.prose h3 > span {
  padding-bottom: 2px;
  background: linear-gradient(transparent 76%, rgba(139, 69, 19, 0.22) 76%);
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
  max-width: 70ch;
}

.prose li {
  margin: 0.35em 0;
  overflow-wrap: break-word;
}

.prose li::marker {
  color: var(--brown);
}

.prose blockquote {
  margin: 1.2em 0;
  padding: 16px 20px;
  max-width: 100%;
  background: var(--violet-soft);
  border-radius: var(--r-md) var(--r-sm) var(--r-md) var(--r-sm);
  color: #3a2550;
  overflow-wrap: break-word;
}

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

.prose img,
.prose video,
.prose iframe {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 22px 0;
  border-radius: 12px;
}

.prose figure {
  margin: 22px 0;
  max-width: 100%;
}

.prose pre {
  margin: 1.2em 0;
  padding: 14px 16px;
  max-width: 100%;
  overflow-x: auto;
  border-radius: var(--r-md) var(--r-sm) var(--r-md) var(--r-sm);
  background: var(--paper-2);
  font-size: 15.5px;
}

.prose table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
}

.prose td,
.prose th {
  padding: 8px 12px;
  text-align: left;
  border-bottom: 1px solid rgba(31, 23, 38, 0.12);
}

.prose time {
  display: inline-block;
  font-size: 16px;
  color: var(--brown);
  font-variant-numeric: tabular-nums;
}

.prose code {
  padding: 1px 5px;
  border-radius: var(--r-sm);
  background: var(--paper-2);
  font-size: 15.5px;
  overflow-wrap: break-word;
}

.prose a:hover {
  color: var(--brown);
}

/* 页脚 */
.foot {
  margin-top: 60px;
  padding: clamp(30px, 5vw, 56px) clamp(16px, 4vw, 48px) 116px;
  background: linear-gradient(180deg, #2b2136, #1f1726 62%);
  color: #e7dcef;
  border-radius: 70px 70px 0 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.5fr;
  gap: clamp(18px, 3vw, 34px);
  align-items: start;
}

.foot > * {
  min-width: 0;
}

.foot h2 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #f1e6fa;
}

.foot h2 > span {
  padding-bottom: 3px;
  background: linear-gradient(transparent 76%, rgba(226, 199, 168, 0.55) 76%);
}

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

.foot a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 2px;
  color: #ddcde9;
  font-size: 16px;
  text-decoration: none;
  transition: color 0.2s ease;
}

.foot a:hover {
  color: #fff;
}

.f-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-family: 'EB Garamond', 'Songti SC', Georgia, serif;
  font-size: 19px;
  color: #fff;
  text-decoration: none;
}

.sub-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 4px;
  max-width: 100%;
}

.sub-form input {
  flex: 1 1 8em;
  min-width: 0;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: var(--r-sm);
  background: #f7f1e8;
  color: var(--ink);
  font-family: inherit;
  font-size: 16px;
}

.sub-form input:focus-visible {
  outline: 2px solid #e2c7a8;
  outline-offset: 2px;
}

.sub-form button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--r-sm);
  background: var(--brown);
  color: #fff8f0;
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.sub-form button:hover {
  background: #a4551a;
  transform: translateY(-1px);
}

.f-bottom {
  grid-column: 1 / -1;
  margin-top: 6px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.13);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-size: 16px;
  color: #bdaecb;
  text-align: center;
}

.f-bottom p {
  margin: 0;
}

/* 断点 */
@media (max-width: 900px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .toc {
    position: static;
  }

  .toc h2 {
    margin-bottom: 6px;
  }

  .toc nav ul {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 6px;
    scrollbar-width: thin;
  }

  .toc nav a {
    white-space: nowrap;
    background: #fff;
  }

  .toc nav a:hover {
    transform: none;
  }

  .hero {
    min-height: 42vh;
    border-radius: var(--r-lg) var(--r-lg) 44px 44px;
  }

  .foot {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border-radius: 44px 44px 0 0;
  }
}

@media (max-width: 620px) {
  .foot {
    grid-template-columns: minmax(0, 1fr);
    padding-bottom: 108px;
  }

  .f-brand { order: 1; }
  .f-nav { order: 2; }
  .f-contact { order: 3; }
  .f-sub { order: 4; }

  .hero {
    padding: 20px;
    min-height: 44vh;
  }

  .hero-ghost {
    font-size: 62px;
  }

  .dock ul {
    width: max-content;
    margin: 0;
    padding: 6px 10px;
  }

  .dock a {
    padding: 0 10px;
    gap: 6px;
  }
}

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

  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

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