:root {
  --bg: #0c0608;
  --bg-2: #160b10;
  --card: #1a0e14;
  --line: rgba(255, 120, 170, 0.12);
  --ink: #f7e9ee;
  --ink-2: #c9adb8;
  --ink-3: #8a6c78;
  --hot: #ff3d7f;
  --hot-2: #ff7a59;
  --serif: "Noto Serif CJK SC", "Songti SC", "STSong", "SimSun", serif;
  /* Web font loaded for the logo only (subset to its characters in build.mjs) */
  --logo: "Noto Serif SC", var(--serif);
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
html.gated { overflow: hidden; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); line-height: 1.7; font-size: 16px; overflow-x: clip; }
a { color: inherit; text-decoration: none; }
h1, h2 { margin: 0; }

/* Top bar + category chips */
.bar { position: sticky; top: 0; z-index: 30; background: rgba(12, 6, 8, 0.86); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top, 0px); }
.bar__row { max-width: 64rem; margin: 0 auto; display: flex; align-items: center; gap: 0.6rem; padding: 0.6rem 1rem 0.4rem; }
/* Logo: the gold figure (public/logo.webp), the name, and the slogan underneath */
.logo { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.logo__mark { flex: none; display: block; width: 30px; height: 64px; filter: brightness(1.25) drop-shadow(0 0 6px rgba(255, 190, 90, 0.35)); }
.logo__text { display: flex; flex-direction: column; min-width: 0; }
.logo__name { font: 900 21px/1.1 var(--logo); letter-spacing: 0.12em; white-space: nowrap;
  background: linear-gradient(120deg, #fff 10%, #ffc2d6 55%, var(--hot)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.logo__tag { margin-top: 3px; font: 500 10.5px/1.2 var(--logo); letter-spacing: 0.32em; color: var(--ink-2); white-space: nowrap; }
@media (max-width: 359px) { .logo__tag { display: none; } }
.age { font-size: 10px; font-weight: 700; padding: 0.05rem 0.45rem; border-radius: 4px; background: var(--hot); color: #fff; }
.bar__row .btn { margin-left: auto; }
/* One row of chips, no sideways scroll: extra chips wrap out of sight; 全部分类 opens the full grouped panel */
.bar__cats { max-width: 64rem; margin: 0 auto; display: flex; align-items: flex-start; gap: 0.4rem; padding: 0.3rem 1rem 0.65rem; }
.chips { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; gap: 0.4rem; height: 33px; overflow: hidden; }
.chips a, .cats__panel a { flex: none; font-size: 14px; line-height: 1.5; padding: 0.3rem 0.85rem; border-radius: 999px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.chips a.on, .cats__panel a.on { background: var(--hot); border-color: var(--hot); color: #fff; font-weight: 600; }
.cats { flex: none; }
.cats summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 0.25rem; height: 33px; padding: 0 0.8rem; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: #fff; background: rgba(255, 61, 127, 0.18); border: 1px solid rgba(255, 61, 127, 0.45); white-space: nowrap; }
.cats summary::-webkit-details-marker { display: none; }
.cats summary::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.15s ease; }
.cats[open] summary::after { transform: translateY(1px) rotate(225deg); }
.cats__panel { position: absolute; left: 0; right: 0; top: 100%; max-height: 72vh; overflow-y: auto; padding: 0.4rem max(1rem, calc((100% - 62rem) / 2)) 1.1rem;
  background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 24px 40px -12px rgba(0, 0, 0, 0.8); }
.cats__h { margin: 0.8rem 0 0.45rem; font-size: 12px; letter-spacing: 0.12em; color: var(--ink-3); }
.cats__row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

.wrap { max-width: 64rem; margin: 0 auto; padding: 0 1rem 7rem; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; padding: 0 1.6rem; border: 0; border-radius: 999px; cursor: pointer;
  font: 700 16px var(--sans); letter-spacing: 0.04em; color: #fff;
  background: linear-gradient(110deg, var(--hot-2), var(--hot) 55%, #d6246a); box-shadow: 0 10px 28px -10px rgba(255, 61, 127, 0.8); transition: transform 0.15s ease; }
.btn:active { transform: scale(0.97); }
.btn--sm { min-height: 34px; padding: 0 1rem; font-size: 14px; box-shadow: none; }
.btn--block { display: flex; width: 100%; }

/* Poster: photo, or tinted gradient + big glyph */
.poster { position: relative; overflow: hidden; width: 100%; aspect-ratio: 3 / 4; border-radius: 14px; isolation: isolate;
  background:
    radial-gradient(120% 80% at 80% 10%, hsl(var(--h) 90% 62% / 0.9), transparent 60%),
    radial-gradient(90% 70% at 10% 100%, hsl(calc(var(--h) + 30) 85% 45% / 0.8), transparent 65%),
    linear-gradient(160deg, hsl(var(--h) 60% 22%), #0c0608 90%); }
.poster::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(180deg, transparent 45%, rgba(8, 3, 5, 0.85)); }
.poster img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.poster__glyph { position: absolute; right: -0.08em; bottom: -0.18em; font: 900 clamp(110px, 30vw, 200px)/1 var(--serif); color: rgba(255, 255, 255, 0.2);
  text-shadow: 0 0 50px hsl(var(--h) 100% 70% / 0.7); white-space: nowrap; }
.poster__cat { position: absolute; left: 0.6rem; top: 0.6rem; z-index: 2; font-size: 12px; font-weight: 700; padding: 0.1rem 0.55rem; border-radius: 6px;
  background: rgba(0, 0, 0, 0.45); color: #fff; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }

/* Topic page story */
.story { padding-top: 1rem; }
.poster--hero { aspect-ratio: 16 / 10; border-radius: 20px; }
.poster--hero .poster__glyph { font-size: clamp(190px, 52vw, 360px); }
.poster--hero .poster__cat { font-size: 14px; }
.story__head { position: relative; z-index: 2; margin: -4.5rem 0.25rem 0; padding: 0 0.5rem; }
.story__cat { margin: 0 0 0.4rem; font-size: 13px; color: #ff9cbc; letter-spacing: 0.02em; }
.story h1, .intro h1 { font: 800 clamp(30px, 8vw, 50px)/1.25 var(--serif); letter-spacing: 0.01em; text-shadow: 0 4px 30px rgba(0, 0, 0, 0.6); }
.story__long { margin: 0.6rem 0 0; font-size: 15px; color: var(--ink-2); }

.scene { margin: 1.75rem 0 0; padding: 1.25rem 1.1rem; border-left: 2px solid var(--hot); background: linear-gradient(90deg, rgba(255, 61, 127, 0.07), transparent 70%); border-radius: 0 14px 14px 0; }
.ln { margin: 0 0 0.85rem; font: 400 17px/1.9 var(--serif); color: var(--ink-2); opacity: 0; transform: translateY(8px); animation: ln 0.7s ease forwards; animation-delay: calc(min(var(--i), 14) * 0.22s + 0.2s); }
.ln:last-child { margin-bottom: 0; color: var(--ink); font-weight: 700; }
.ln.say { color: #ffd2e0; font-weight: 600; }
@keyframes ln { to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .ln { animation: none; opacity: 1; transform: none; } }

.hook { margin: 1.5rem 0 0; padding: 1.25rem; border-radius: 18px; text-align: center; background: var(--bg-2); border: 1px solid var(--line); }
.hook p { margin: 0.9rem 0 1rem; font: 700 18px/1.5 var(--serif); }
.wave { display: flex; align-items: center; justify-content: center; gap: 3px; height: 34px; }
.wave i { width: 3px; border-radius: 2px; background: linear-gradient(var(--hot-2), var(--hot)); animation: wv 1.2s ease-in-out infinite; }
.wave i:nth-child(4n+1) { height: 30%; animation-delay: -0.2s; }
.wave i:nth-child(4n+2) { height: 80%; animation-delay: -0.5s; }
.wave i:nth-child(4n+3) { height: 50%; animation-delay: -0.9s; }
.wave i:nth-child(4n) { height: 95%; animation-delay: -0.3s; }
@keyframes wv { 50% { transform: scaleY(0.35); } }
@media (prefers-reduced-motion: reduce) { .wave i { animation: none; } }

.tags { list-style: none; padding: 0; margin: 1.25rem 0 0; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags li { font-size: 13px; padding: 0.2rem 0.7rem; border-radius: 6px; background: rgba(255, 61, 127, 0.12); color: #ff9cbc; }

/* Sections */
.sec { margin-top: 2rem; }
.sec__h { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 0.8rem; font: 700 19px var(--serif); }
.sec__h a { font: 400 13px var(--sans); color: var(--ink-3); }

.steps { list-style: none; counter-reset: s; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.steps li { counter-increment: s; padding: 0.8rem 0.7rem; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.steps li::before { content: "0" counter(s); display: block; font: 800 18px var(--serif); color: var(--hot); }
.steps b { display: block; font-size: 15px; }
.steps span { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-3); }

.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 0.85rem 0; font-weight: 600; display: flex; justify-content: space-between; gap: 1rem; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--hot); font-weight: 400; }
.faq details[open] summary::after { content: "–"; }
.faq p { margin: 0 0 0.9rem; font-size: 15px; color: var(--ink-2); }

/* Card grid */
.grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.75rem; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .grid--hub { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.card { display: flex; flex-direction: column; height: 100%; min-width: 0; }
.card .poster { transition: transform 0.2s ease; }
.card:hover .poster, .card:active .poster { transform: scale(0.98); }
.card__tl { margin-top: 0.5rem; font-size: 11px; line-height: 1.5; color: #ff9cbc; }
.card__title { margin-top: 0.15rem; font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card__hook { margin-top: 0.2rem; font: 13px/1.5 var(--serif); color: var(--ink-3);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }

/* Hub intro */
.intro { padding: 1.75rem 0.25rem 1.25rem; }
.intro__sub { margin: 0.6rem 0 0; color: var(--ink-2); }

/* Sticky bottom CTA */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(180deg, rgba(12, 6, 8, 0), rgba(12, 6, 8, 0.94) 40%); }
.dock .btn { max-width: 28rem; margin: 0 auto; }

.foot { max-width: 64rem; margin: 0 auto; padding: 1.5rem 1rem 8rem; font-size: 12px; color: var(--ink-3); border-top: 1px solid var(--line); }
.foot a { text-decoration: underline; }

/* Age gate */
.gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 1.25rem; background: rgba(8, 3, 5, 0.95); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); }
.gate[hidden] { display: none; }
.gate__card { max-width: 22rem; text-align: center; padding: 2rem 1.5rem; border-radius: 22px; background: var(--bg-2); border: 1px solid var(--line); }
.gate__badge { display: inline-block; margin: 0 0 0.8rem; padding: 0.15rem 0.7rem; border-radius: 6px; background: var(--hot); color: #fff; font-weight: 800; }
.gate h2 { margin: 0 0 0.6rem; font: 700 22px var(--serif); }
.gate p { margin: 0 0 1.25rem; font-size: 14px; color: var(--ink-2); }
.gate__row { display: flex; flex-direction: column; gap: 0.8rem; align-items: center; }
.gate__no { font-size: 13px; color: var(--ink-3); }

/* Breadcrumbs, tag links, keyword cloud */
.crumbs { padding: 0.9rem 0.25rem 0; font-size: 12px; color: var(--ink-3); }
.crumbs a { color: var(--ink-2); }
.tags a { color: inherit; }
.cloud { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0; }
.cloud a, .cloud span { font-size: 13px; padding: 0.2rem 0.65rem; border-radius: 6px; background: var(--card); border: 1px solid var(--line); color: var(--ink-2); }
.cloud a:active { border-color: var(--hot); color: #fff; }
