/*
Theme Name: sd-b9 珊瑚甜寵
Theme URI: https://example.com/
Author: SD Network
Description: 珊瑚粉白甜寵風：心形與圓點裝飾、置中大標題首屏、詳情頁選集為一排圓形按鈕。
Version: 1.0.0
Requires at least: 6.4
Requires PHP: 8.1
Text Domain: sd-b9
*/

/* ==========================================================================
   sd-b9 珊瑚甜寵 · 珊瑚粉白 / 心形與圓點 / 置中首屏 / 圓形選集
   tokens → base → header → hero → cards → detail → footer
   ========================================================================== */

:root {
  --bg: #fff7f4;
  --card: #ffffff;
  --line: #ffd6d6;
  --ink: #4a2530;
  --muted: #84565f;
  --accent: #ff6f7d;
  --accent-2: #ffb199;
  --accent-soft: rgba(255, 111, 125, .14);
  --accent-ink: #bf2f47;
  --on-accent: #3b0f1a;
  --radius: 28px;
  --r-card: var(--radius);
  --btn-r: 999px;
  --wrap: 1160px;
  --font: "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", "Heiti TC", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-display: "Hiragino Maru Gothic ProN", "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", system-ui, sans-serif;
  --heart: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.5-9.3C1 8 3 4.5 6.5 4.5c2 0 3.7 1.1 5.5 3 1.8-1.9 3.5-3 5.5-3C21 4.5 23 8 21.5 11.7 19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E");
}

/* ---------- shared base (variables driven; each theme overrides below) ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 400 16px/1.75 var(--font); overflow-x: clip;
  overflow-wrap: anywhere; word-break: normal; line-break: strict;
  -webkit-font-smoothing: antialiased;
}
body.sd-no-scroll { overflow: hidden; }
img, video, svg { max-width: 100%; }
img { display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only, .screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 12px; top: -80px; z-index: 999; padding: 10px 18px; background: var(--ink); color: var(--bg); }
.skip:focus { top: 12px; }
.b9-wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 22px; }
[hidden] { display: none !important; }

/* ---------- breadcrumbs ---------- */
.sd-crumbs { padding: 22px 0 6px; font-size: 14px; color: var(--muted); }
.sd-crumbs__list { display: flex; flex-wrap: wrap; gap: 4px 0; }
.sd-crumbs li + li::before { content: "›"; margin: 0 9px; opacity: .6; }
.sd-crumbs a:hover { color: var(--accent-ink); }
.sd-crumbs [aria-current="page"] { color: var(--ink); font-weight: 600; }

/* ---------- buttons / pills / notes ---------- */
.b9-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 0 22px;
  border: 1px solid var(--line); border-radius: var(--btn-r, 999px); background: var(--card); color: var(--ink);
  font-weight: 700; font-size: 15px; line-height: 1.2; transition: background .2s, color .2s, border-color .2s, transform .2s;
}
.b9-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.b9-btn--primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.b9-btn--primary:hover { color: var(--on-accent); filter: brightness(1.06); }
.b9-pill {
  display: inline-flex; align-items: center; min-height: 32px; padding: 2px 14px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent-ink); font-size: 13px; font-weight: 600; line-height: 1.4;
}
a.b9-pill:hover { background: var(--accent); color: var(--on-accent); }
.b9-note { padding: 14px 18px; border: 1px dashed var(--line); color: var(--muted); font-size: 14px; }
.sd-btn {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 22px; border-radius: var(--btn-r, 999px);
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}

/* ---------- player (shared contract) ---------- */
.sd-player { background: #000; }
.sd-player video { display: block; width: 100%; aspect-ratio: 9 / 16; max-height: 78vh; object-fit: contain; background: #000; }
.sd-embed { aspect-ratio: 9 / 16; max-height: 78vh; background: #000; }
.sd-embed iframe { display: block; width: 100%; height: 100%; border: 0; }
.sd-player__fallback { padding: 20px; color: #cbd5e1; font-size: 14px; }
.sd-callout { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; padding: 22px; background: var(--card); color: var(--ink); }
.sd-callout__body { flex: 1 1 220px; }
.sd-callout__title { font-weight: 800; margin-bottom: 4px; }
.sd-callout__desc { color: var(--muted); font-size: 14px; }

/* ---------- pagination ---------- */
.sd-pagination { margin: 38px 0 6px; }
.sd-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.sd-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 16px;
  border-radius: var(--btn-r, 999px); background: var(--card); border: 1px solid var(--line); color: var(--muted); font-weight: 700;
}
.sd-pagination a.page-numbers:hover { background: var(--accent-soft); color: var(--accent-ink); }
.sd-pagination .current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.sd-pagination .dots { background: none; border-color: transparent; }

/* ---------- page head / filters / chips / empty ---------- */
.b9-pagehead { padding: 22px 0 18px; }
.b9-pagehead h1 { font: 800 clamp(28px, 4.4vw, 44px)/1.2 var(--font-display, var(--font)); letter-spacing: .01em; }
.b9-pagehead p { margin-top: 8px; color: var(--muted); }
.b9-filter { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin: 4px 0 26px; }
.b9-filter__row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.b9-filter__label { flex: none; min-width: 3em; color: var(--muted); font-size: 14px; font-weight: 700; }
.b9-filter__list { display: flex; gap: 6px; min-width: 0; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.b9-filter__list::-webkit-scrollbar { display: none; }
.b9-filter__list a {
  flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--btn-r, 999px);
  font-size: 14px; color: var(--muted); border: 1px solid transparent; white-space: nowrap;
}
.b9-filter__list a:hover { color: var(--accent-ink); border-color: var(--line); }
.b9-filter__list a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.b9-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.b9-chip {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 1px solid var(--line);
  border-radius: var(--btn-r, 999px); background: var(--card); font-size: 14px; font-weight: 600;
}
.b9-chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.b9-empty { padding: 56px 0; text-align: center; color: var(--muted); }
.b9-empty__title { margin-bottom: 8px; color: var(--ink); font-size: 20px; font-weight: 800; }
.b9-empty .b9-chips { justify-content: center; margin-top: 18px; }

/* ---------- search results / forms ---------- */
.b9-sf { display: flex; align-items: stretch; gap: 8px; width: 100%; }
.b9-sf input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 18px; border: 1px solid var(--line);
  border-radius: var(--btn-r, 999px); background: var(--card); outline: none;
}
.b9-sf input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.b9-sf button {
  flex: none; min-height: 48px; padding: 0 24px; border: 0; border-radius: var(--btn-r, 999px);
  background: var(--accent); color: var(--on-accent); font-weight: 700;
}
.b9-searchbar { max-width: 640px; margin: 4px 0 26px; }
.b9-results { display: grid; gap: 12px; }
.b9-result {
  display: flex; gap: 16px; align-items: flex-start; padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--r-card, 14px); transition: border-color .2s, transform .2s;
}
.b9-result:hover { border-color: var(--accent); }
.b9-result__img { flex: none; width: 76px; height: auto; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 8px; }
.b9-result__body { display: grid; gap: 4px; min-width: 0; }
.b9-result__t { font-weight: 800; font-size: 17px; line-height: 1.4; }
.b9-result__m { color: var(--muted); font-size: 13px; }
.b9-result__x { color: var(--muted); font-size: 14px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- article / prose / 404 ---------- */
.b9-article { max-width: 780px; }
.b9-prose { font-size: 17px; line-height: 1.95; }
.b9-prose > * + * { margin-top: 1.1em; }
.b9-prose h2, .b9-prose h3 { margin-top: 1.8em; font-weight: 800; line-height: 1.35; }
.b9-prose a { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
.b9-prose ul { list-style: disc; padding-left: 1.4em; }
.b9-prose ol { list-style: decimal; padding-left: 1.4em; }
.b9-prose img { height: auto; border-radius: 10px; }
.b9-pages { margin-top: 20px; color: var(--muted); }
.b9-notfound { padding: 56px 0 30px; text-align: center; }
.b9-notfound__code { font: 900 clamp(72px, 16vw, 150px)/1 var(--font-display, var(--font)); color: var(--accent); }
.b9-notfound h1 { margin-top: 6px; font-size: clamp(24px, 4vw, 34px); font-weight: 800; }
.b9-notfound__desc { max-width: 520px; margin: 12px auto 22px; color: var(--muted); }
.b9-notfound__search { max-width: 520px; margin: 0 auto 20px; }
.b9-notfound__actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }

/* ---------- blocks / facts / faq ---------- */
.b9-block { margin-top: 44px; }
.b9-block > h2, .b9-sec h2 { font: 800 clamp(21px, 3vw, 28px)/1.3 var(--font-display, var(--font)); }
.b9-block > h2 small, .b9-sec h2 small { margin-left: 8px; color: var(--muted); font-size: 14px; font-weight: 500; }
.b9-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-top: 14px; }
.b9-fact { padding: 14px 16px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card, 14px); }
.b9-fact dt { color: var(--muted); font-size: 13px; }
.b9-fact dd { margin-top: 2px; font-weight: 700; }
.b9-fact--wide { grid-column: 1 / -1; }
.b9-faq details { margin-top: 10px; background: var(--card); border: 1px solid var(--line); border-radius: var(--r-card, 14px); }
.b9-faq summary { min-height: 48px; padding: 12px 18px; font-weight: 700; cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.b9-faq summary::-webkit-details-marker { display: none; }
.b9-faq summary::after { content: "+"; flex: none; color: var(--accent-ink); font-size: 22px; line-height: 1; }
.b9-faq details[open] summary::after { content: "−"; }
.b9-faq details p { padding: 0 18px 16px; color: var(--muted); }

/* ---------- watch (episode page) ---------- */
.b9-watch { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding-top: 10px; }
.b9-watch__main, .b9-watch__eps { min-width: 0; }
.b9-watch__head h1 { font: 800 clamp(22px, 3.4vw, 34px)/1.3 var(--font-display, var(--font)); }
.b9-watch__head p { margin-top: 4px; color: var(--muted); font-size: 14px; }
.b9-player { max-width: 420px; width: 100%; margin: 0 auto; overflow: hidden; border-radius: var(--r-card, 14px); background: #000; }
.b9-pn { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.b9-block__link { margin-top: 14px; font-weight: 700; color: var(--accent-ink); }

/* ---------- search panel / overlay / drawer (ids bound by app.js) ---------- */
.b9-search {
  position: fixed; inset: 0; z-index: 90; display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px; background: rgba(10, 10, 20, .55); opacity: 0; visibility: hidden; transition: opacity .2s, visibility .2s;
}
.b9-search.is-open { opacity: 1; visibility: visible; }
.b9-search__box { width: min(640px, 100%); padding: 22px; background: var(--card); color: var(--ink); border-radius: var(--r-card, 14px); }
.b9-search__hint { margin: 16px 0 8px; color: var(--muted); font-size: 13px; font-weight: 700; }
.b9-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.b9-tags a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--btn-r, 999px); background: var(--accent-soft); color: var(--accent-ink); font-size: 14px; font-weight: 600; }
.b9-overlay { position: fixed; inset: 0; z-index: 94; background: rgba(10, 10, 20, .55); opacity: 0; transition: opacity .25s; }
.b9-overlay.is-open { opacity: 1; }
.b9-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 96; width: min(86vw, 340px); padding: 64px 22px 28px; overflow-y: auto;
  background: var(--card); color: var(--ink); transform: translateX(104%); visibility: hidden; transition: transform .28s, visibility .28s;
}
.b9-drawer.is-open { transform: none; visibility: visible; }
.b9-drawer__close { position: absolute; top: 10px; right: 10px; width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; }
.b9-drawer__list a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); font-weight: 700; }
.b9-drawer__list a[aria-current="page"] { color: var(--accent-ink); }

@media (max-width: 760px) {
  .b9-wrap { padding: 0 16px; }
  .b9-filter__row { align-items: stretch; flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  .skip, .b9-search, .b9-overlay, .b9-drawer { display: none !important; }
}

/* ---------- body: soft polka dots ---------- */
body {
  background-image: radial-gradient(circle at 2px 2px, rgba(255, 111, 125, .15) 1.6px, transparent 2.2px);
  background-size: 24px 24px;
}
.b9-main { min-height: 62vh; }

/* heart helper: any element with .b9-logo__heart / .b9-sec__h / .b9-card__heart is a recolourable heart */
.b9-logo__heart, .b9-sec__h, .b9-card__heart, .b9-hero__deco, .b9-detail__sticker {
  display: inline-block; background: var(--accent);
  -webkit-mask: var(--heart) center / contain no-repeat; mask: var(--heart) center / contain no-repeat;
}

/* ---------- header: centred logo, pill nav underneath ---------- */
.b9-head { position: sticky; top: 0; z-index: 50; background: rgba(255, 247, 244, .94); border-bottom: 2px dotted var(--line); backdrop-filter: blur(8px); }
.b9-head__in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; min-height: 66px; }
.b9-head__side { display: flex; align-items: center; }
.b9-head__side--r { justify-content: flex-end; }
.b9-icon {
  display: inline-grid; place-items: center; width: 44px; height: 44px; border: 2px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--accent-ink); transition: background .2s, transform .2s;
}
.b9-icon:hover { background: var(--accent-soft); transform: rotate(-6deg); }
.b9-logo { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; font: 900 clamp(20px, 3.2vw, 26px)/1.2 var(--font-display); color: var(--accent-ink); }
.b9-logo__heart { width: 18px; height: 18px; }
.b9-logo__heart:last-child { transform: scale(.7); opacity: .6; }
.b9-logo__img { height: 38px; width: auto; }
.b9-nav { display: none; border-top: 1px dotted var(--line); }
.b9-nav__list { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 8px; padding: 8px 22px; }
.b9-nav__list a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px;
  font-weight: 700; font-size: 15px; color: var(--muted); transition: background .2s, color .2s;
}
.b9-nav__list a:hover { background: var(--accent-soft); color: var(--accent-ink); }
.b9-nav__list a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
@media (min-width: 961px) {
  .b9-nav { display: block; }
  .b9-menu-btn { display: none; }
}

/* ---------- bottom tab bar (mobile) ---------- */
.b9-tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); z-index: 60;
  display: grid; grid-template-columns: repeat(3, 1fr); background: #fff; border: 2px solid var(--line);
  border-radius: 28px; box-shadow: 0 10px 30px rgba(255, 111, 125, .28);
}
.b9-tabbar a { display: grid; place-items: center; align-content: center; min-height: 56px; gap: 0; font-size: 12px; font-weight: 700; color: var(--muted); }
.b9-tabbar b { font-size: 18px; line-height: 1; }
.b9-tabbar a[aria-current="page"] { color: var(--accent-ink); }
@media (min-width: 761px) { .b9-tabbar { display: none; } }
@media (max-width: 760px) { body { padding-bottom: 84px; } }

/* ---------- hero: everything centred ---------- */
.b9-hero { position: relative; overflow: hidden; padding: clamp(40px, 8vw, 84px) 0 clamp(32px, 6vw, 56px); text-align: center; }
.b9-hero__in { position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; }
.b9-hero__deco { position: absolute; opacity: .5; }
.b9-hero__deco--1 { top: 12%; left: 8%; width: 54px; height: 54px; transform: rotate(-14deg); }
.b9-hero__deco--2 { top: 20%; right: 9%; width: 36px; height: 36px; transform: rotate(16deg); background: var(--accent-2); }
.b9-hero__deco--3 { bottom: 14%; right: 18%; width: 26px; height: 26px; transform: rotate(-8deg); }
.b9-hero__kicker { padding: 6px 18px; border: 2px dashed var(--accent-2); border-radius: 999px; background: #fff; color: var(--accent-ink); font-size: 14px; font-weight: 700; }
.b9-hero h1 { display: grid; gap: 6px; margin-top: 18px; font-family: var(--font-display); }
.b9-hero__brand { font-size: clamp(42px, 9vw, 92px); font-weight: 900; line-height: 1.1; color: var(--accent-ink); letter-spacing: .02em; text-shadow: 3px 3px 0 var(--accent-soft); }
.b9-hero__tag { font-size: clamp(17px, 2.6vw, 26px); font-weight: 700; color: var(--muted); }
.b9-hero__lead { max-width: 540px; margin-top: 16px; color: var(--muted); }
.b9-herosearch { max-width: 560px; margin-top: 24px; }
.b9-herosearch input { border: 2px solid var(--line); }
.b9-hero__quick { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 18px; }
.b9-hero__quick a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 18px; border: 2px dashed var(--line); border-radius: 999px; background: #fff; font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.b9-hero__quick a:hover { background: var(--accent-soft); }

/* ---------- section titles ---------- */
.b9-block { margin-top: clamp(36px, 6vw, 64px); }
.b9-sec { display: flex; flex-direction: column; align-items: center; gap: 2px; margin-bottom: 22px; text-align: center; }
.b9-sec h2 { display: inline-flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; font: 900 clamp(22px, 3.4vw, 32px)/1.3 var(--font-display); color: var(--ink); }
.b9-sec h2 small { margin: 0; font-size: 14px; color: var(--muted); }
.b9-sec__h { width: 20px; height: 20px; }
.b9-sec__h:last-child { background: var(--accent-2); transform: scale(.8); }
.b9-sec__more { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; font-size: 14px; font-weight: 700; color: var(--accent-ink); }

/* ---------- cards ---------- */
.b9-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
@media (min-width: 640px) { .b9-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 30px 20px; } }
@media (min-width: 960px) { .b9-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 34px 24px; } }
.b9-card { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; transition: transform .25s; }
.b9-card:hover { transform: translateY(-5px) rotate(-.8deg); }
.b9-card__media { position: relative; display: block; width: 100%; padding: 6px; background: #fff; border: 2px dashed var(--accent-2); border-radius: var(--radius); box-shadow: 0 12px 28px rgba(255, 111, 125, .18); }
.b9-card__media img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: calc(var(--radius) - 8px); background: var(--accent-soft); }
.b9-card__heart { position: absolute; top: 14px; right: 14px; width: 30px; height: 30px; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .25)); }
.b9-card__badge { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); max-width: calc(100% - 20px); padding: 2px 12px; border-radius: 999px; background: rgba(255, 255, 255, .95); color: var(--accent-ink); font-size: 12px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.b9-card__t { margin-top: 10px; font-weight: 800; font-size: 16px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.b9-card__m { color: var(--muted); font-size: 13px; }

/* mood bubbles */
.b9-bubbles { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.b9-bubble { display: inline-flex; align-items: center; gap: 10px; min-height: 52px; padding: 0 12px 0 24px; border: 2px solid var(--line); border-radius: 999px; background: var(--accent-soft); font-weight: 800; transition: transform .2s; }
.b9-bubble:nth-child(3n+2) { background: rgba(255, 177, 153, .26); }
.b9-bubble:nth-child(3n) { background: rgba(255, 214, 102, .3); }
.b9-bubble:hover { transform: translateY(-3px) scale(1.03); }
.b9-bubble em { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border-radius: 999px; background: #fff; color: var(--accent-ink); font-style: normal; font-size: 13px; }

/* latest: round avatar rows */
.b9-rows { display: grid; gap: 14px; }
@media (min-width: 860px) { .b9-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 22px; } }
.b9-row { display: flex; align-items: center; gap: 14px; padding: 12px 20px 12px 12px; background: #fff; border: 2px dashed var(--line); border-radius: 48px; transition: border-color .2s, transform .2s; }
.b9-row:hover { border-color: var(--accent); transform: translateX(4px); }
.b9-row__img { flex: none; width: 72px; height: 72px; object-fit: cover; border-radius: 50%; border: 3px solid var(--accent-soft); }
.b9-row__body { display: grid; gap: 2px; min-width: 0; flex: 1 1 auto; }
.b9-row__t { font-weight: 800; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.b9-row__m { color: var(--muted); font-size: 13px; }
.b9-row__badge { flex: none; padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 800; }
@media (max-width: 460px) { .b9-row__badge { display: none; } }

/* ---------- list pages ---------- */
.b9-pagehead { text-align: center; padding-top: 14px; }
.b9-pagehead h1 { color: var(--accent-ink); }
.b9-crumbs { text-align: center; }
.b9-crumbs .sd-crumbs__list { justify-content: center; }
.b9-listing .b9-result { border: 2px dashed var(--line); border-radius: 28px; }
.b9-filter__list a[aria-current="page"], .b9-chip:hover { border-radius: 999px; }

/* ---------- detail ---------- */
.b9-detail { display: flex; flex-direction: column; align-items: center; gap: 24px; padding: 18px 0 4px; text-align: center; }
.b9-detail__poster { position: relative; width: min(300px, 74vw); padding: 8px; background: #fff; border: 3px dashed var(--accent-2); border-radius: 999px 999px var(--radius) var(--radius); box-shadow: 0 16px 36px rgba(255, 111, 125, .24); }
.b9-detail__poster img { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; border-radius: 999px 999px calc(var(--radius) - 8px) calc(var(--radius) - 8px); }
.b9-detail__sticker { position: absolute; right: -14px; bottom: 28px; width: 56px; height: 56px; transform: rotate(12deg); filter: drop-shadow(0 4px 6px rgba(191, 47, 71, .35)); }
.b9-detail__info { display: flex; flex-direction: column; align-items: center; gap: 16px; width: 100%; }
.b9-detail h1 { font: 900 clamp(28px, 5vw, 46px)/1.25 var(--font-display); color: var(--accent-ink); }
.b9-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.b9-pill { display: inline-flex; align-items: center; min-height: 32px; padding: 2px 16px; border: 2px solid var(--line); border-radius: 999px; background: #fff; color: var(--accent-ink); font-size: 13px; font-weight: 700; }
a.b9-pill { min-height: 44px; }
a.b9-pill:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.b9-pill--hot { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.b9-syn { max-width: 700px; padding: 20px 26px; background: #fff; border: 2px dotted var(--accent-2); border-radius: 28px; color: var(--muted); line-height: 1.95; text-align: left; }
.b9-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.b9-btn { border-width: 2px; }

/* the circle episode row */
.b9-eps { display: flex; flex-wrap: nowrap; gap: 12px; overflow-x: auto; padding: 8px 4px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; scrollbar-color: var(--accent-2) transparent; }
.b9-eps a, .b9-eps span {
  flex: none; display: inline-grid; place-items: center; width: 52px; height: 52px; border: 2px solid var(--line); border-radius: 50%;
  background: #fff; color: var(--ink); font-size: 16px; font-weight: 800; scroll-snap-align: center; transition: transform .2s, background .2s;
}
.b9-eps a:hover { background: var(--accent-soft); border-color: var(--accent); transform: translateY(-3px); }
.b9-eps .is-current { background: var(--accent); border-color: var(--accent); color: var(--on-accent); box-shadow: 0 6px 14px rgba(255, 111, 125, .4); }
.b9-eps .is-off { opacity: .45; }

.b9-player { border: 6px solid #fff; border-radius: var(--radius); box-shadow: 0 16px 36px rgba(255, 111, 125, .26); }
.b9-fact { text-align: center; border: 2px dashed var(--line); }
.b9-fact--wide { text-align: center; }
.b9-watch__main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.b9-watch__eps .b9-sec { margin-top: 10px; }
.b9-block__link { text-align: center; }
.b9-note { text-align: center; border-radius: 20px; }

/* ---------- search / drawer skin ---------- */
.b9-search { background: rgba(74, 37, 48, .45); }
.b9-search__box { border: 3px dashed var(--accent-2); }
.b9-drawer { background: var(--bg); border-left: 3px dashed var(--accent-2); }
.b9-drawer__list a { border-bottom: 2px dotted var(--line); }

/* ---------- footer: scalloped top ---------- */
.b9-foot { position: relative; margin-top: clamp(56px, 8vw, 96px); padding: 44px 0 36px; background: #ffe6e1; text-align: center; }
.b9-foot::before { content: ""; position: absolute; left: 0; right: 0; top: -13px; height: 14px; background: radial-gradient(circle at 14px 14px, #ffe6e1 13px, transparent 14px) 0 0 / 28px 14px repeat-x; }
.b9-foot__in { display: flex; flex-direction: column; align-items: center; gap: 14px; }
.b9-foot__brand { display: inline-flex; align-items: center; gap: 8px; font: 900 24px/1.3 var(--font-display); color: var(--accent-ink); }
.b9-foot__desc, .b9-foot__note { max-width: 620px; color: var(--muted); font-size: 14px; }
.b9-foot__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; }
.b9-foot__links a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; font-size: 14px; font-weight: 700; color: var(--accent-ink); }
.b9-foot__links a:hover { background: #fff; }
.b9-foot__links--info a { color: var(--muted); }
.b9-foot__menu { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 16px; }
.b9-foot__copy { color: var(--muted); font-size: 13px; }
