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

:root {
  --cream: #f5e6c8;
  --amber: #d4a574;
  --ink: #262117;
  --ink-soft: #4c4133;
  --line: rgba(38, 33, 23, 0.16);
  --glass: rgba(255, 249, 235, 0.55);
  --radius: 18px;
  --font-head: Fredoka, Nunito, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-body: Nunito, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  overflow-x: hidden;
  background:
    radial-gradient(62vw 46vh at 6% -4%, rgba(212, 165, 116, 0.5), transparent 62%),
    radial-gradient(54vw 40vh at 102% 14%, rgba(255, 238, 200, 0.85), transparent 60%),
    linear-gradient(180deg, #f8ecd4 0%, #f1e2c4 52%, #e8d5b2 100%);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  mix-blend-mode: screen;
  animation: leak 15s ease-in-out infinite alternate;
  background:
    radial-gradient(40vw 32vh at 84% 8%, rgba(255, 214, 150, 0.55), transparent 70%),
    radial-gradient(32vw 28vh at 10% 80%, rgba(212, 165, 116, 0.36), transparent 72%);
}

@keyframes leak {
  from { opacity: 0.5; }
  to { opacity: 1; }
}

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

a { color: #8a5a22; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* 顶栏 */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem clamp(0.6rem, 3vw, 1.6rem);
  background: linear-gradient(180deg, rgba(251, 241, 222, 0.94), rgba(245, 230, 200, 0.74));
  backdrop-filter: blur(10px) saturate(1.15);
  border-bottom: 1px solid var(--line);
}

.topbar::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 3px;
  background: repeating-linear-gradient(90deg, rgba(38, 33, 23, 0.22) 0 8px, transparent 8px 16px);
  opacity: 0.5;
}

.group { position: relative; justify-self: start; }
.group--end { justify-self: end; }

.group summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 44px;
  padding: 0.5rem 0.95rem;
  list-style: none;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 252, 244, 0.62);
  transition: background 0.2s ease, border-color 0.2s ease;
}

.group summary::-webkit-details-marker { display: none; }

.group summary::after {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg) translateY(-2px);
}

.group[open] summary { background: rgba(212, 165, 116, 0.45); border-color: var(--amber); }

.group summary:hover { border-color: var(--amber); }

.group menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  left: 0;
  z-index: 25;
  min-width: 220px;
  max-width: 78vw;
  margin: 0;
  padding: 0.45rem;
  list-style: none;
  display: grid;
  gap: 0.1rem;
  background: rgba(252, 245, 231, 0.97);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 22px 44px -26px rgba(38, 33, 23, 0.75);
}

.group--end menu { left: auto; right: 0; }

.group menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  border-radius: 12px;
  color: var(--ink-soft);
  font-size: 0.97rem;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease;
}

.group menu a:hover { background: rgba(212, 165, 116, 0.35); color: var(--ink); }

/* 品牌 */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 44px;
  padding: 0.25rem 0.4rem;
  font-family: var(--font-head);
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-decoration: none;
}

.brand-name { font-size: 1.06rem; }

.mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 50%;
  border: 1px solid rgba(38, 33, 23, 0.32);
  background: linear-gradient(150deg, #e3bb8d, #b98450);
  color: #2a2116;
  font-size: 1rem;
  font-weight: 700;
}

img.mark { object-fit: cover; }

/* 主体框架 */
.shell {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 0 auto;
  padding: 0.9rem clamp(0.7rem, 3vw, 1.5rem) 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.9rem;
}

/* 侧栏 */
.rail {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--glass);
  backdrop-filter: blur(9px) saturate(1.1);
  scrollbar-width: thin;
}

.rail small,
.rail-title { display: none; }

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 0.45rem 0.85rem;
  white-space: nowrap;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 246, 0.6);
}

.rail-list a:hover { background: rgba(212, 165, 116, 0.3); color: var(--ink); }

main { min-width: 0; }
.wrap { margin: 0; min-width: 0; }
.stage { margin: 0; }

.paper {
  padding: clamp(1rem, 3vw, 2.2rem);
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    linear-gradient(180deg, rgba(255, 251, 242, 0.84), rgba(252, 242, 224, 0.66));
  box-shadow: 0 34px 64px -44px rgba(38, 33, 23, 0.85);
  backdrop-filter: blur(3px);
}

/* 首屏 */
.hero {
  display: grid;
  gap: 1.3rem;
  align-items: center;
  padding-bottom: 1.5rem;
  border-bottom: 1px dashed var(--line);
}

.hero-copy { text-align: right; }

h1 {
  margin: 0 0 1rem;
  font-family: var(--font-head);
  font-size: clamp(1.85rem, 6vw, 3.05rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: 0.01em;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.6);
}

.badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  margin: 0;
}

.badges a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.4rem 0.9rem;
  font-size: 0.9rem;
  color: #7d5730;
  text-decoration: none;
  border: 1px solid rgba(169, 124, 72, 0.6);
  border-radius: 999px;
  background: rgba(212, 165, 116, 0.2);
  transition: transform 0.2s ease, background 0.2s ease;
}

.badges a:hover { background: rgba(212, 165, 116, 0.4); transform: translateY(-2px); }

.polaroid {
  --rot: -1.6deg;
  position: relative;
  margin: 0;
  padding: 0.7rem 0.7rem 1.9rem;
  background: #fdf8ec;
  border: 1px solid rgba(38, 33, 23, 0.22);
  border-radius: 6px;
  box-shadow: 0 16px 32px -20px rgba(38, 33, 23, 0.9);
  transform: rotate(var(--rot));
}

.polaroid img {
  display: block;
  width: 100%;
  border-radius: 3px;
  filter: sepia(0.28) contrast(1.06) saturate(0.82);
}

.photo-blank {
  display: block;
  aspect-ratio: 4 / 5;
  border-radius: 3px;
  background: linear-gradient(160deg, #ecd6b1, #cdb28b 55%, #8d7148);
}

@keyframes vhs {
  0% { transform: rotate(-1.3deg) skewX(0deg) translateY(0); }
  30% { transform: rotate(-1.3deg) skewX(-1.4deg) translateY(-2px); }
  65% { transform: rotate(-1.3deg) skewX(0.9deg) translateY(-3px); }
  100% { transform: rotate(-0.6deg) skewX(0deg) translateY(-5px); }
}

.polaroid:hover { animation: vhs 0.55s ease-out forwards; }

/* 正文 */
section h2 {
  margin: 0.35rem 0 0.7rem;
  font-family: var(--font-head);
  font-size: clamp(1.32rem, 3.6vw, 1.78rem);
  font-weight: 600;
  line-height: 1.32;
}

section h3 {
  margin: 1.4rem 0 0.55rem;
  font-family: var(--font-head);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.4;
}

section small {
  display: block;
  margin-top: 2rem;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.24em;
  color: #a27e50;
}

section small + h2,
section small + h3 { margin-top: 0.2rem; }

section article { padding-top: 0.1rem; }

section article + article {
  margin-top: 2.4rem;
  border-top: 1px dashed var(--line);
}

section p { margin: 0 0 1rem; }

section a { text-underline-offset: 3px; }

section ul,
section ol { margin: 0 0 1rem; padding-left: 1.25rem; }

section li { margin: 0.35rem 0; }

section blockquote {
  margin: 1.2rem 0;
  padding: 0.85rem 1.1rem;
  border-left: 4px solid var(--amber);
  border-radius: 0 12px 12px 0;
  background: rgba(212, 165, 116, 0.17);
}

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

section img {
  border-radius: 12px;
  filter: sepia(0.2) saturate(0.9);
}

section figure { margin: 1.2rem 0; }

section table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 0.95rem;
}

section th,
section td {
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  text-align: left;
}

section th { background: rgba(212, 165, 116, 0.25); }

section code {
  padding: 0.1rem 0.35rem;
  border-radius: 6px;
  background: rgba(38, 33, 23, 0.08);
  font-size: 0.92em;
}

section article[id],
section h2[id],
section h3[id] { scroll-margin-top: 92px; }

/* 页脚 */
.foot {
  position: relative;
  z-index: 2;
  max-width: 1180px;
  margin: 2.4rem auto 0;
  padding: 1.6rem clamp(0.7rem, 3vw, 1.5rem) 2.2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 1rem 1.6rem;
  border-top: 1px solid var(--line);
}

.foot-brand { flex: 1 1 220px; min-width: 0; }

.foot-desc {
  margin: 0.55rem 0 0;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--ink-soft);
}

.foot-nav { flex: 1 1 250px; min-width: 0; }

.foot-nav menu {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.9rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 0.92rem;
  color: var(--ink-soft);
  text-decoration: none;
}

.foot-nav a:hover { color: var(--ink); text-decoration: underline; }

.foot-form { flex: 1 1 230px; display: flex; gap: 0.4rem; min-width: 0; }

.foot-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 44px;
  padding: 0.5rem 0.8rem;
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 246, 0.75);
}

.foot-form input:focus-visible,
.foot-form button:focus-visible,
.group summary:focus-visible,
.brand:focus-visible {
  outline: 2px solid #8a5a22;
  outline-offset: 2px;
}

.foot-form button {
  min-height: 44px;
  padding: 0.4rem 1.05rem;
  font: inherit;
  font-weight: 700;
  color: #2a2116;
  cursor: pointer;
  border: 1px solid #a97c48;
  border-radius: 12px;
  background: linear-gradient(180deg, #e0b689, #c6935c);
  transition: filter 0.2s ease;
}

.foot-form button:hover { filter: brightness(1.06); }

.foot-legal {
  flex: 1 0 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
  font-size: 0.86rem;
  color: #7b6b53;
}

.foot-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  color: #7b6b53;
  text-decoration: none;
}

.foot-legal a:hover { color: var(--ink); }

/* 入场 */
.reveal {
  opacity: 0;
  transform: translateY(16px) rotate(var(--rot, 0deg));
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.25, 1);
}

.reveal.in { opacity: 1; transform: rotate(var(--rot, 0deg)); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .polaroid:hover,
  body::after { animation: none; }
}

/* 桌面 */
@media (min-width: 760px) {
  .hero {
    grid-template-columns: 0.88fr 1.12fr;
    gap: 2rem;
    min-height: 66vh;
    align-content: center;
  }
}

@media (min-width: 900px) {
  .shell {
    grid-template-columns: 252px minmax(0, 1fr);
    gap: 2rem;
    padding-top: 1.9rem;
  }

  .rail {
    display: block;
    position: sticky;
    top: 88px;
    align-self: start;
    padding: 1rem 0.9rem;
    overflow: visible;
    border-radius: var(--radius);
    background: var(--glass);
    backdrop-filter: blur(10px) saturate(1.1);
  }

  .rail small {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    color: #a27e50;
  }

  .rail-title {
    display: block;
    margin: 0.15rem 0 0.7rem;
    font-family: var(--font-head);
    font-size: 1.12rem;
    font-weight: 600;
  }

  .rail-list { display: grid; gap: 0.1rem; }

  .rail-list a {
    min-height: 42px;
    padding: 0.5rem 0.6rem;
    border: 0;
    border-left: 2px solid transparent;
    border-radius: 0 12px 12px 0;
    background: none;
    white-space: normal;
    font-size: 0.94rem;
  }

  .rail-list a:hover {
    border-left-color: var(--amber);
    background: rgba(212, 165, 116, 0.26);
  }

  .brand-name { font-size: 1.12rem; }
}

@media (max-width: 420px) {
  body { font-size: 16.5px; }
  .group summary { padding: 0.5rem 0.7rem; font-size: 0.9rem; }
  .paper { border-radius: 20px; }
}

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