:root {
  --header-h: 60px;
  --dock-h: 72px;
  --bg: #100f12;
  --bg-soft: #18171c;
  --card: #1e1c22;
  --text: #f6f3f4;
  --muted: #c4bcc2;
  --pink: #ff4d78;
  --orange: #ff8a3d;
  --line: rgba(255, 255, 255, 0.1);
  --max: 1120px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
  color-scheme: dark;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-padding-top: calc(var(--header-h) + var(--dock-h) + 12px);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 10% -10%, rgba(255, 77, 120, 0.18), transparent 55%),
    radial-gradient(900px 420px at 100% 0%, rgba(255, 138, 61, 0.12), transparent 50%),
    var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 16px;
  line-height: 1.85;
}

img {
  max-width: 100%;
  height: auto;
}

a {
  color: #ffd0dc;
}

a:hover {
  color: #fff;
}

.skip {
  position: absolute;
  left: 12px;
  top: -40px;
  background: #fff;
  color: #111;
  padding: 8px 12px;
  z-index: 100;
}

.skip:focus {
  top: 8px;
}

.wrap {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--header-h);
  display: flex;
  align-items: center;
  background: rgba(16, 15, 18, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(var(--max), calc(100% - 28px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  min-width: 0;
}

.brand img {
  width: 84px;
  height: 44px;
  border-radius: 6px;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand strong {
  display: block;
  font-size: 16px;
  letter-spacing: 0.04em;
}

.brand small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  background: #241f24;
  color: var(--text);
  border-radius: 10px;
  min-height: 40px;
  padding: 0 12px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 15px;
}

.site-nav a[aria-current="page"],
.site-nav a:hover {
  background: linear-gradient(90deg, var(--pink), var(--orange));
  color: #fff;
}

.site-ads {
  position: sticky;
  top: var(--header-h);
  z-index: 40;
  background: #fff7fa;
  border-bottom: 1px solid rgba(255, 77, 120, 0.18);
  box-shadow: var(--shadow);
}

.site-ads:empty {
  display: none;
}

main {
  padding: 18px 0 48px;
}

.crumb {
  color: var(--muted);
  font-size: 14px;
  margin: 4px 0 14px;
}

.crumb a {
  color: #ffd0dc;
  text-decoration: none;
}

.pair {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 7fr);
  gap: 18px 28px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.pair figure {
  margin: 0;
  background: #09090c;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.pair img {
  display: block;
  width: 100%;
  height: 340px;
  object-fit: contain;
  background: #09090c;
}

.pair.cover img {
  object-fit: cover;
  object-position: center top;
}

.pair figcaption {
  padding: 8px 10px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

h1, h2, h3 {
  line-height: 1.35;
  margin: 0 0 10px;
}

h1 {
  font-size: 1.7rem;
}

h2 {
  font-size: 1.35rem;
  margin-top: 8px;
}

h3 {
  font-size: 1.08rem;
}

.kicker {
  display: inline-block;
  margin-bottom: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(255, 77, 120, 0.16);
  color: #ffd0dc;
  font-size: 13px;
}

p {
  margin: 0 0 12px;
}

.toc,
.card,
.note,
.faq,
.table-wrap {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 18px;
  margin: 16px 0;
}

.toc ol {
  margin: 8px 0 0;
  padding-left: 20px;
}

.toc a {
  text-decoration: none;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  text-decoration: none;
  color: #fff;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  font-weight: 700;
}

.btn.ghost {
  background: transparent;
  border: 1px solid var(--line);
  margin-left: 8px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 10px 8px;
  vertical-align: top;
}

th {
  color: #ffd0dc;
}

.faq details {
  border-top: 1px solid var(--line);
  padding: 8px 0;
}

.faq details:first-of-type {
  border-top: 0;
}

.faq summary {
  cursor: pointer;
  font-weight: 700;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: #141318;
  padding: 28px 0 36px;
  color: var(--muted);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--text);
  text-decoration: none;
}

.wordmark {
  width: 180px;
  margin: 8px 0 12px;
}

.error-code {
  font-size: 3rem;
  margin: 0;
  background: linear-gradient(90deg, var(--pink), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@media (max-width: 800px) {
  .nav-toggle {
    display: inline-flex;
    align-items: center;
  }

  .site-header {
    position: sticky;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: #16141a;
    border-bottom: 1px solid var(--line);
    padding: 8px 14px 12px;
    z-index: 60;
  }

  .site-nav.is-open {
    display: flex;
  }

  .pair {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .pair img {
    height: 220px;
  }

  h1 {
    font-size: 1.4rem;
  }

  .btn.ghost {
    margin-left: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
