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

:root {
  --ink: #12100F;
  --coral: #FF4B3E;
  --cream: #F5EFE6;
  --line: rgba(245, 239, 230, 0.16);
  --glass: rgba(245, 239, 230, 0.055);
  --r: 28px;
  --edge: clamp(16px, 4vw, 34px);
}

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

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

body {
  margin: 0;
  background: var(--ink);
  color: var(--cream);
  font-family: 'Manrope', system-ui, -apple-system, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  font-size: 17px;
  line-height: 1.7;
  letter-spacing: 0.01em;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, .brand, .f-logo, .aside-h {
  font-family: 'Syne', 'Manrope', sans-serif;
  font-weight: 700;
  line-height: 1.14;
  letter-spacing: -0.015em;
  margin: 0;
}

:focus-visible {
  outline: 3px solid var(--coral);
  outline-offset: 3px;
}

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

/* 顶部细条 */
.topbar {
  background: var(--coral);
  color: var(--ink);
  padding: 9px var(--edge);
}

.topbar p {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 页头 */
.site-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px var(--edge);
  background: var(--ink);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 22px;
  color: var(--cream);
}

.brand-img {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--glass);
}

.head-nav {
  flex: 1 1 340px;
  min-width: 0;
}

.head-nav p {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
}

.head-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 14px;
  font-size: 16px;
  color: rgba(245, 239, 230, 0.84);
  border: 1px solid var(--line);
  border-radius: 999px;
  transition: color 0.18s ease, background-color 0.18s ease, border-color 0.18s ease;
}

.head-nav a:hover,
.head-nav a:focus-visible {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--ink);
}

/* 粘性锚点条 */
.anchorbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding: 0 var(--edge);
  background: rgba(18, 16, 15, 0.95);
  backdrop-filter: blur(9px);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.anchorbar::-webkit-scrollbar { display: none; }

.anchorbar p {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 8px 0;
  white-space: nowrap;
}

.anchorbar a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 13px;
  font-size: 16px;
  color: rgba(245, 239, 230, 0.68);
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.anchorbar a:hover,
.anchorbar a:focus-visible {
  background: var(--cream);
  color: var(--ink);
}

/* 首屏 */
.hero {
  position: relative;
  overflow: hidden;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(16px, 2.6vw, 28px);
  text-align: center;
  padding: clamp(44px, 8vw, 88px) var(--edge) clamp(30px, 6vw, 56px);
}

.hero::before {
  content: "";
  position: absolute;
  left: -10%;
  bottom: -18%;
  width: 40vw;
  height: 40vw;
  max-width: 420px;
  max-height: 420px;
  background: var(--coral);
  border-radius: var(--r);
  transform: rotate(14deg);
  pointer-events: none;
}

.hero::after {
  content: "";
  position: absolute;
  right: -7%;
  top: 9%;
  width: 22vw;
  height: 22vw;
  max-width: 240px;
  max-height: 240px;
  border: 2px solid rgba(245, 239, 230, 0.22);
  border-radius: 50%;
  pointer-events: none;
}

.hero > * {
  position: relative;
  z-index: 1;
}

.hero-title {
  font-size: clamp(2rem, 6.6vw, 4.2rem);
  max-width: 20ch;
  text-wrap: balance;
}

.hero-desc {
  margin: 0;
  max-width: 620px;
  font-size: 18px;
  color: rgba(245, 239, 230, 0.76);
}

.hero-media {
  position: relative;
  margin: 0;
  width: 100%;
  max-width: 920px;
  aspect-ratio: 16 / 9;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
}

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

.hero-blank {
  display: block;
  width: 100%;
  height: 100%;
  background: rgba(255, 75, 62, 0.14);
}

.hero-tag {
  position: absolute;
  left: 18px;
  bottom: 18px;
  padding: 9px 18px;
  background: var(--cream);
  color: var(--ink);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  border-radius: 999px;
}

@media (prefers-reduced-motion: no-preference) {
  .hero-tag { animation: bob 6s ease-in-out infinite; }
}

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

/* 正文与侧栏 */
.doc {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 288px;
  align-items: start;
  gap: clamp(24px, 4vw, 56px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 7vw, 80px) var(--edge) clamp(56px, 8vw, 96px);
}

.doc-body { min-width: 0; }

.doc-body > div {
  padding-top: clamp(30px, 5vw, 48px);
  border-top: 1px dashed var(--line);
  scroll-margin-top: 104px;
}

.doc-body > div:first-child {
  padding-top: 0;
  border-top: 0;
}

.doc-body h1 { font-size: clamp(1.7rem, 3.6vw, 2.2rem); }

.doc-body h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.05rem);
  margin: 0 0 0.55em;
}

.doc-body h2::before {
  content: "";
  display: block;
  width: 46px;
  height: 4px;
  margin-bottom: 14px;
  background: var(--coral);
}

.doc-body h3 {
  font-size: 1.25rem;
  margin: 1.7em 0 0.45em;
}

.doc-body h2 + .subtitle,
.doc-body h3 + .subtitle { margin-top: -0.9em; }

.subtitle {
  margin: 0 0 1.1em;
  font-size: 16px;
  color: rgba(245, 239, 230, 0.6);
}

.doc-body p {
  margin: 0 0 1.05em;
  color: rgba(245, 239, 230, 0.84);
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 1.1em;
  padding-left: 1.25em;
  color: rgba(245, 239, 230, 0.84);
}

.doc-body li { margin: 0.42em 0; }

.doc-body strong { color: var(--cream); }

.doc-body a {
  color: var(--coral);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.doc-body blockquote {
  margin: 1.4em 0;
  padding: 16px 20px;
  border-left: 4px solid var(--coral);
  background: var(--glass);
  border-radius: 0 14px 14px 0;
}

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

.doc-body figure { margin: 1.5em 0; }

.doc-body img { border-radius: 18px; }

.doc-body hr {
  border: 0;
  border-top: 1px dashed var(--line);
  margin: 2em 0;
}

.doc-body table {
  display: block;
  width: 100%;
  overflow-x: auto;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 16px;
}

.doc-body th,
.doc-body td {
  border: 1px solid var(--line);
  padding: 10px 13px;
  text-align: left;
}

.doc-body th {
  background: var(--glass);
  font-family: 'Syne', sans-serif;
  font-weight: 700;
}

/* 侧栏 */
.doc-aside {
  position: sticky;
  top: 78px;
  padding: 22px;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--r);
  backdrop-filter: blur(10px);
}

.aside-h { font-size: 20px; margin: 0 0 6px; }

.aside-list {
  list-style: none;
  display: grid;
  gap: 3px;
  margin: 0;
  padding: 0;
}

.aside-list a {
  display: flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 12px;
  font-size: 16px;
  color: rgba(245, 239, 230, 0.76);
  border-left: 2px solid transparent;
  border-radius: 12px;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.aside-list a:hover,
.aside-list a.act {
  background: rgba(255, 75, 62, 0.18);
  border-left-color: var(--coral);
  color: var(--cream);
}

/* 页脚 */
.site-foot {
  display: grid;
  grid-template-columns: auto minmax(0, 1.5fr) auto;
  align-items: start;
  gap: 26px clamp(20px, 4vw, 44px);
  padding: clamp(34px, 5vw, 58px) var(--edge) 26px;
  background: var(--cream);
  color: var(--ink);
  border-top: 8px solid var(--coral);
}

.f-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-size: 22px;
  color: var(--ink);
}

.f-logo .brand-img {
  background: rgba(18, 16, 15, 0.1);
  border-radius: 6px;
}

.sub-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sub-form input {
  flex: 1 1 170px;
  min-height: 46px;
  padding: 10px 16px;
  font-family: inherit;
  font-size: 16px;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--ink);
  border-radius: 999px;
}

.sub-form input::placeholder { color: rgba(18, 16, 15, 0.55); }

.sub-form button {
  min-height: 46px;
  padding: 10px 22px;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 16px;
  color: var(--cream);
  background: var(--ink);
  border: 2px solid var(--ink);
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.sub-form button:hover,
.sub-form button:focus-visible {
  background: var(--coral);
  border-color: var(--coral);
  color: var(--ink);
}

.f-nav p {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.f-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 7px 13px;
  font-size: 16px;
  color: var(--ink);
  border: 1px solid rgba(18, 16, 15, 0.3);
  border-radius: 999px;
  transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.f-nav a:hover,
.f-nav a:focus-visible {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--cream);
}

.f-legal {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px 20px;
  margin-top: 6px;
  padding-top: 16px;
  border-top: 2px solid rgba(18, 16, 15, 0.22);
}

.f-legal p {
  margin: 0;
  font-size: 16px;
}

.f-top a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* 回到顶部 */
.fab {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 60;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 10px 20px;
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  background: var(--coral);
  border-radius: 999px;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.fab.on {
  opacity: 1;
  transform: none;
  pointer-events: auto;
}

/* 断点 */
@media (max-width: 960px) {
  .doc { grid-template-columns: minmax(0, 1fr); }
  .doc-aside { position: static; order: 2; }
  .site-foot { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .f-nav { order: 3; }
}

@media (max-width: 720px) {
  .head-nav p { justify-content: flex-start; }
  .hero { min-height: 0; padding-top: 44px; }
  .hero::before {
    width: 56vw;
    height: 56vw;
    left: -16%;
    bottom: -10%;
  }
  .hero::after { display: none; }
  .hero-desc { font-size: 17px; }
  .hero-media { aspect-ratio: 4 / 3; }
  .doc-body > div { scroll-margin-top: 96px; }
}

@media (max-width: 400px) {
  .head-nav a,
  .anchorbar a { padding: 8px 11px; }
  .fab { right: 12px; bottom: 12px; }
}

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