:root {
  color-scheme: dark;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  background: #141016;
  color: #fbf5f3;
  --accent: #ffa39b;
  --accent-strong: #ff8887;
  --muted: #c2b6c2;
  --quiet: #ab9eae;
  --border: #ffffff20;
  --surface: #201922;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 0; }
a { color: inherit; text-decoration: none; }
input, button, select { font: inherit; }
button, select { cursor: pointer; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.sr-only { width: 1px; height: 1px; position: absolute; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.shell { width: min(1170px, calc(100% - 80px)); margin-inline: auto; }
.skip-link { position: absolute; top: 4px; left: 6px; z-index: 20; translate: 0 -160%; padding: .65rem 1rem; background: var(--accent); color: #201521; }
.skip-link:focus { translate: 0; }
.site-header { border-bottom: 1px solid var(--border); }
.header-inner { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.header-inner nav { display: flex; align-items: center; gap: clamp(10px, 2.5vw, 25px); }
.browse-nav { color: var(--muted); display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; font-weight: 650; }
.browse-nav:hover { color: var(--accent); }
.language-menu { position: relative; z-index: 3; font-size: .9rem; }
.language-menu summary { display: flex; align-items: center; gap: 11px; min-height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: #f8eaf1; font-weight: 650; cursor: pointer; list-style: none; white-space: nowrap; }
.language-menu summary::-webkit-details-marker { display: none; }
.language-menu summary:hover, .language-menu[open] summary { border-color: var(--accent); }
.language-chevron { width: 7px; height: 7px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); rotate: 45deg; translate: 0 -2px; }
.language-menu[open] .language-chevron { rotate: 225deg; translate: 0 2px; }
.language-options { position: absolute; inset-block-start: calc(100% + 7px); inset-inline-end: 0; margin: 0; padding: 4px; min-inline-size: 11rem; list-style: none; border: 1px solid var(--border); border-radius: 10px; background: #221a24; box-shadow: 0 10px 28px #0008; }
.language-options li + li { margin-top: 2px; }
.language-switch, .language-current { display: flex; align-items: center; justify-content: space-between; gap: 11px; min-height: 44px; padding: 6px 10px; border-radius: 6px; white-space: nowrap; }
.language-switch:hover { background: #372837; }
.language-options small { color: var(--muted); font-size: .78rem; }
.language-current { color: var(--accent); background: #392735; font-weight: 650; }
.language-selected { width: 6px; height: 10px; margin-inline-end: 3px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -1px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.38rem; letter-spacing: -.06em; }
.brand-accent { color: var(--accent); }
.brand-mark { width: 31px; height: 31px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-strong); color: #302030; }
.search-icon { display: inline-block; width: 13px; height: 13px; border: 2px solid currentColor; border-radius: 50%; position: relative; flex: 0 0 auto; }
.search-icon::after { content: ""; width: 6px; height: 2px; border-radius: 1px; background: currentColor; position: absolute; top: 9px; left: 8px; transform: rotate(45deg); transform-origin: left; }

.finder-hero {
  position: relative;
  display: grid;
  align-items: center;
  min-height: 472px;
  margin-block: 25px 40px;
  border: 1px solid #ffffff1b;
  border-radius: 24px;
  overflow: hidden;
  isolation: isolate;
  background: radial-gradient(ellipse at 88% 34%, #693b4a, #2b1b2e 62%, #201721);
}
.hero-art { position: absolute; z-index: -2; inset: 0 0 0 auto; width: 69%; height: 100%; object-fit: cover; object-position: 64% 46%; }
.finder-hero::after { position: absolute; z-index: -1; inset: 0; content: ""; background: linear-gradient(90deg, #241823 16%, #241823f3 35%, #24182392 55%, #24182338 72%, transparent 100%), linear-gradient(0deg, #241823a0, transparent 39%); }
.finder-content { padding: clamp(28px, 5vw, 65px); max-width: 750px; width: 100%; }
.finder-content h1, .story-heading h1 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: clamp(3.25rem, 6.25vw, 6rem); font-weight: 400; letter-spacing: -.065em; line-height: .98; text-wrap: balance; }
html:lang(zh) .finder-content h1, html:lang(zh) .story-heading h1 { font-family: "Songti SC", "Noto Serif CJK SC", SimSun, Georgia, serif; letter-spacing: -.04em; line-height: 1.12; }
html:lang(zh) .finder-content h1 { font-size: clamp(2.5rem, 5.9vw, 5.45rem); }
.finder-content > p { max-width: 40ch; color: #e3d7df; font-size: clamp(1rem, 1.5vw, 1.15rem); line-height: 1.55; margin: 20px 0 24px; }
.search-form { margin: 0; max-width: 610px; }
.search-box { display: flex; align-items: center; min-height: 60px; gap: 10px; padding: 6px 7px 6px 17px; background: #18131bdd; border: 1px solid #a88a9a; border-radius: 12px; }
.search-box:focus-within { border-color: var(--accent); }
.search-box > .search-icon { color: #c7afbf; }
.search-box input { flex: 1 1 0; min-width: 0; height: 44px; outline: none; background: transparent; color: white; border: 0; padding-left: 4px; }
.search-box input::placeholder { color: #c3b1bf; }
.primary, .secondary { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; padding: .65rem 1rem; border-radius: 8px; border: 1px solid transparent; font-weight: 750; font-size: .95rem; text-align: center; }
.primary { background: var(--accent-strong); color: #23141e; }
.primary:hover { background: #ffa6a3; }
.secondary { background: #302433; border-color: var(--border); color: #fff; }
.secondary:hover { background: #442d43; }
.examples { margin-top: 14px; display: flex; align-items: center; flex-wrap: wrap; gap: 6px 11px; color: #dbc5d4; font-size: .875rem; }
.examples > span { font-weight: 750; color: #f5dce8; }
.example { border: 0; padding: 6px 0; background: transparent; color: inherit; text-align: left; text-decoration: underline; text-decoration-color: #b28b9d; text-underline-offset: 4px; }
.example:hover { color: #fff; }

.browse { scroll-margin-top: 18px; padding-bottom: 54px; }
.browse-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
.browse-heading h2, .guide h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-weight: 400; font-size: clamp(1.8rem, 3vw, 2.9rem); letter-spacing: -.04em; line-height: 1.03; }
.browse-heading p { margin: 5px 0 0; font-size: .9rem; color: var(--muted); }
.platform-filter select { appearance: none; min-height: 43px; color: #f9f1f8; font-size: .9rem; border: 1px solid var(--border); background: var(--surface); padding: .55rem 2rem .55rem .8rem; border-radius: 9px; }
.platform-filter { position: relative; }
.platform-filter::after { content: ""; position: absolute; pointer-events: none; right: .8rem; top: 44%; width: 6px; height: 6px; border-right: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent); rotate: 45deg; }
.theme-filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.theme-filters button, .guide-tags a, .guide-tags span { display: inline-flex; align-items: center; min-height: 38px; padding: .42rem .78rem; border: 1px solid var(--border); border-radius: 24px; background: #1d1720; color: #dbcedb; font-size: .88rem; }
.theme-filters button:hover, .guide-tags a:hover { border-color: #f8c0c0; color: #fff; }
.theme-filters button[aria-pressed="true"] { background: #4b293e; color: #fff1f2; border-color: #b87386; }

.drama-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.drama-card, .story-heading { --story-color: #f0a1ba; --story-glow: #412638; }
.theme-hidden-identity { --story-color: #e8b68f; --story-glow: #3f2b27; }
.theme-revenge { --story-color: #ff9b9e; --story-glow: #492532; }
.theme-rebirth-revenge { --story-color: #f1a193; --story-glow: #442c33; }
.theme-werewolves { --story-color: #cbc0ff; --story-glow: #2d2548; }
.theme-ai-animation { --story-color: #d7b6f9; --story-glow: #32294b; }
.theme-second-chance { --story-color: #aacfe2; --story-glow: #20313b; }
.theme-family-secrets { --story-color: #e6c98b; --story-glow: #3b3029; }
.drama-card { overflow: hidden; border-radius: 13px; border: 1px solid var(--border); background: linear-gradient(140deg, var(--story-glow), var(--surface) 68%); transition: border-color .18s; }
.drama-card:hover, .drama-card:focus-within { border-color: var(--story-color); }
.drama-card a { display: flex; flex-direction: column; align-items: start; height: 100%; padding: 17px 18px; }
.drama-card a:focus-visible { outline-offset: -4px; }
.card-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; color: var(--story-color); font-size: .85rem; }
.card-meta .platform { color: #f2e7ef; font-weight: 750; }
.drama-card h3 { font-size: clamp(1.18rem, 2vw, 1.5rem); margin: .7rem 0 .4rem; letter-spacing: -.035em; line-height: 1.16; overflow-wrap: anywhere; }
.card-original { color: var(--muted); font-size: .85rem; line-height: 1.35; margin: 0 0 .55rem; overflow-wrap: anywhere; }
.drama-card p { color: #d9cbd8; margin: 0 0 .9rem; font-size: 1rem; line-height: 1.48; }
.card-action { margin-top: auto; color: var(--story-color); font-size: .9rem; font-weight: 750; }
.drama-card a:hover .card-action { text-decoration: underline; text-underline-offset: 4px; }
.empty { border: 1px solid var(--border); border-radius: 14px; background: var(--surface); padding: 24px; }
.empty h3 { margin: 0 0 8px; }
.empty p { margin: 0 0 16px; color: var(--muted); }

.guide { padding-block: 25px 54px; }
.breadcrumbs { display: flex; align-items: center; flex-wrap: wrap; gap: .65rem; margin-bottom: 17px; font-size: .9rem; color: var(--muted); }
.breadcrumbs a:hover { color: var(--accent); }
.guide-columns { display: grid; grid-template-columns: minmax(0, 1fr) minmax(270px, .43fr); gap: 24px; align-items: start; }
.story-heading { position: relative; padding: clamp(20px, 4vw, 48px); background: radial-gradient(ellipse at 100% 3%, var(--story-glow), #201922 73%); border: 1px solid var(--border); border-radius: 20px; }
.story-heading h1 { font-size: clamp(2.65rem, 5.1vw, 5rem); margin-top: 17px; overflow-wrap: break-word; }
.guide-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.guide-tags a { min-height: 34px; color: var(--story-color); background: #241c28; }
.guide-tags span { min-height: 34px; color: var(--muted); border-color: transparent; }
.aliases { font-size: .9rem; color: var(--muted); margin: 10px 0 0; }
.guide-summary { max-width: 63ch; font-size: clamp(1.03rem, 1.7vw, 1.2rem); color: #efe1ed; line-height: 1.6; margin: 19px 0 0; }
.plot { padding: 24px 0 5px; }
.plot h2, .where h2 { font-size: clamp(1.55rem, 2.7vw, 2.1rem); }
.plot ul { margin: 11px 0 0; padding-left: 1.15rem; color: var(--muted); line-height: 1.55; }
.plot li { margin-bottom: .45rem; }
.where { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; }
.where dl { margin: 17px 0 19px; }
.where dl > div { display: grid; gap: 4px; border-bottom: 1px solid var(--border); padding: .65rem 0; }
.where dl > div:first-child { padding-top: 0; }
.where dt { font-size: .86rem; color: var(--muted); }
.where dd { font-weight: 650; margin: 0; line-height: 1.35; }
.official-link { width: 100%; }
.official-desktop { margin-top: 14px; }
.official-mobile { display: none; }
.edition-note h3 { font-size: 1.1rem; margin: 0 0 .45rem; }
.edition-note p { color: var(--muted); font-size: .95rem; margin: 0 0 .65rem; }
.edition-note a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.not-found .primary { margin-top: 18px; }
.related { padding-top: 33px; }
.related h2 { margin-bottom: 16px; }
.collections { padding-bottom: 30px; }
.collections h2 { font-size: 1.28rem; margin: 0 0 12px; }
.collections .guide-tags a { color: var(--muted); }

.site-footer { border-top: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 14px; padding-block: 22px; color: var(--muted); font-size: .9rem; }
.site-footer a { font-weight: 800; color: #f5e8f3; }

@media (max-width: 920px) {
  .shell { width: calc(100% - 52px); }
  .drama-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .guide-columns { gap: 16px; }
}
@media (max-width: 660px) {
  .shell { width: calc(100% - 32px); }
  .header-inner { min-height: 59px; }
  .brand { font-size: 1.24rem; }
  .brand-mark { width: 28px; height: 28px; }
  .browse-nav { font-size: .88rem; }
  .finder-hero { min-height: 0; margin-block: 14px 28px; border-radius: 17px; align-items: end; }
  .hero-art { width: 100%; height: 78%; object-position: 64% 28%; }
  .finder-hero::after { background: linear-gradient(0deg, #251923 7%, #251923 34%, #251923b5 58%, #25192328 100%), linear-gradient(90deg, #2519235a, transparent 80%); }
  .finder-content { padding: 134px 16px 22px; }
  .finder-content h1 { font-size: clamp(2.7rem, 10vw, 4.05rem); }
  html:lang(zh) .finder-content h1 { font-size: clamp(2rem, 10vw, 4.05rem); }
  .finder-content > p { margin: 14px 0 15px; }
  .desktop-break { display: none; }
  html:lang(zh) .desktop-break { display: initial; }
  .search-box { min-height: 54px; padding: 5px 5px 5px 10px; gap: 5px; }
  .search-box input, .search-box .primary { font-size: 1rem; }
  .search-box .primary { padding-inline: .6rem; }
  .search-box .search-icon { display: none; }
  .examples { gap: 1px 10px; margin-top: 11px; }
  .examples > span { flex-basis: 100%; }
  .example { min-height: 34px; }
  .browse { padding-bottom: 35px; }
  .browse-heading { align-items: end; margin-bottom: 14px; }
  .theme-filters { gap: 7px; margin-bottom: 15px; }
  .theme-filters button { min-height: 40px; }
  .drama-grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .drama-card a { padding: 15px; }
  .guide { padding-block: 17px 34px; }
  .guide-columns { display: flex; flex-direction: column; }
  .guide-story, .where { width: 100%; }
  .guide-story { display: contents; }
  .story-heading { order: 0; width: 100%; padding: 19px; }
  .where { order: 1; padding: 17px; }
  .plot { order: 2; padding-top: 8px; }
  .official-desktop { display: none; }
  .official-mobile { display: inline-flex; width: auto; margin-top: 15px; }
  .guide-summary { margin-top: 13px; }
  .related { padding-top: 24px; }
}
@media (max-width: 365px) {
  .header-inner .browse-nav { display: none; }
}
@media (max-width: 350px) {
  .brand { gap: 6px; }
  .header-inner { gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
