:root {
  --bg: #f4f1ea;
  --paper: #fffdf8;
  --ink: #1c1916;
  --muted: #6b635a;
  --line: #e6dfd2;
  --accent: #8b2e1f;
  --strong: #2f5d3a;
  --strong-bg: #e7f0e8;
  --weak: #8a6a22;
  --weak-bg: #f6eed8;
  --empty: #9a9288;
  --shadow: 0 10px 40px rgba(40, 28, 16, 0.06);
  --radius: 18px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Source Han Serif SC", "Noto Serif SC", "Songti SC", "SimSun", Georgia, serif;
  background: radial-gradient(1200px 500px at 10% -10%, #f8efe3 0%, transparent 50%), var(--bg);
  color: var(--ink);
  min-height: 100vh;
}

.wrap { max-width: 1120px; margin: 0 auto; padding: 36px 20px 80px; }
.brand {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--accent); margin: 0 0 8px;
}
header h1 { font-size: clamp(28px, 5vw, 44px); font-weight: 600; letter-spacing: 0.03em; margin: 0 0 10px; }
.tagline { color: var(--muted); margin: 0 0 28px; font-size: 16px; line-height: 1.65; max-width: 40em; }

.search-wrap { position: relative; }
.search {
  display: flex; gap: 8px; background: var(--paper);
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 8px 8px 20px; box-shadow: var(--shadow);
}
.search input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 18px; }
.search button {
  border: 0; background: var(--accent); color: #fff;
  border-radius: 999px; padding: 10px 16px; font: inherit; cursor: pointer;
}
.search button.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.search button:hover { filter: brightness(1.06); }

.suggest {
  position: absolute; left: 12px; right: 12px; top: calc(100% + 6px);
  background: var(--paper); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow); z-index: 8; overflow: hidden; max-height: 360px; overflow-y: auto;
}
.suggest button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 10px 14px; font: inherit; cursor: pointer;
}
.suggest button:hover, .suggest button.active { background: #f6eee6; }
.suggest small { color: var(--muted); margin-left: 8px; font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px; }

.filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 10px; }
.filters button, .chip {
  border: 1px solid var(--line); background: var(--paper); color: var(--ink);
  border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 14px; cursor: pointer;
}
.filters button.active { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters button .count {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px; opacity: .7; margin-left: 4px;
}
.hint { color: var(--muted); font-size: 13px; margin: 8px 0 8px; }
.storage-warning { color: var(--accent); background: #fff1e8; padding: 10px 14px; border-radius: 10px; }
.storage-warning[hidden], .cover img[hidden] { display: none; }
.toolbar { display: flex; gap: 12px; margin: 0 0 16px; }
.text-btn { all: unset; cursor: pointer; color: var(--accent); font-size: 13px; }
.text-btn:hover { text-decoration: underline; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.current { border-color: var(--accent); background: #f3e4dc; }
.chip.yes { border-color: var(--strong); }
.chip.no { opacity: .45; }

.trail { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0 0 16px; font-size: 13px; color: var(--muted); }
.trail button { all: unset; cursor: pointer; color: var(--accent); }
.trail span { opacity: .5; }

.empty-state, .section-head {
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: var(--radius); padding: 18px 22px; color: var(--muted); margin-bottom: 16px;
}
.section-head { border-style: solid; }
.section-head h2 { margin: 0 0 6px; font-size: 20px; color: var(--ink); }
.section-head p { margin: 0; line-height: 1.6; }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-bottom: 28px;
}

.rec-card {
  display: flex; flex-direction: column;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; overflow: hidden; cursor: pointer;
  text-align: left; font: inherit; color: inherit; padding: 0;
  box-shadow: var(--shadow);
}
.rec-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.rec-body { padding: 12px 14px 14px; }
.rec-cat {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px; letter-spacing: .08em; color: var(--accent); margin-bottom: 4px;
}
.rec-card h3 { margin: 0 0 4px; font-size: 18px; line-height: 1.3; }
.rec-meta { margin: 0 0 8px; color: var(--muted); font-size: 12px; }
.rec-intro {
  margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.cover {
  position: relative; aspect-ratio: 2 / 3; height: auto; min-height: 220px; color: #f8f1e8;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 16px 14px 12px;
  background:
    radial-gradient(120% 80% at 10% 0%, rgba(255,255,255,.16), transparent 55%),
    linear-gradient(160deg, var(--c1) 0%, var(--c2) 100%);
}
.cover-kicker {
  font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px; letter-spacing: .12em; opacity: .8;
}
.cover-title {
  font-size: 26px; line-height: 1.25; font-weight: 600;
  text-shadow: 0 6px 20px rgba(0,0,0,.22);
}
.cover .glyph {
  font-size: 56px; line-height: 1; font-weight: 600; letter-spacing: .02em;
  text-shadow: 0 6px 20px rgba(0,0,0,.18);
}
.cover .row {
  display: flex; justify-content: space-between; align-items: flex-end;
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: 11px; letter-spacing: .06em;
  opacity: .88;
}
.cover.photo { padding: 0; background: #1c1916; overflow: hidden; }
.cover.photo img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover; object-position: top center;
  display: block; animation: coverIn .25s ease;
}
@keyframes coverIn { from { opacity: 0; } to { opacity: 1; } }
.cover.photo .cover-kicker,
.cover.photo .cover-title,
.cover.photo .row { display: none; }
.cover-label {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 8px 10px; font-size: 11px; letter-spacing: .06em;
  font-family: ui-sans-serif, system-ui, sans-serif;
  background: linear-gradient(transparent, rgba(0,0,0,.65));
  color: #f8f1e8;
}
.cover.sm { min-height: 120px; padding: 10px; }
.cover.sm .cover-title { font-size: 16px; }
.cover.lg { min-height: 280px; min-width: 180px; }

.cover.movie { --c1: #7a2a1c; --c2: #c47a4a; }
.cover.tv { --c1: #24364d; --c2: #5b7a93; }
.cover.dongman { --c1: #5a2248; --c2: #b45a7a; }
.cover.cartoon { --c1: #234a32; --c2: #7aa35a; }
.cover.novel { --c1: #4a3426; --c2: #a67c52; }

.seed-hero {
  display: grid; grid-template-columns: 200px 1fr; gap: 20px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 18px;
}
.kicker {
  font-family: ui-sans-serif, system-ui, sans-serif; font-size: 12px;
  letter-spacing: 0.08em; color: var(--accent); margin: 0 0 6px;
}
.seed-hero h2 { margin: 0 0 6px; font-size: 28px; }
.meta { color: var(--muted); margin: 0 0 10px; }
.blurb, .try { margin: 0 0 8px; line-height: 1.7; }
.try { color: var(--muted); font-size: 14px; }
.aka { color: var(--empty); font-size: 13px; margin: 0 0 8px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.actions button {
  border: 1px solid var(--line); background: var(--paper); border-radius: 999px;
  padding: 6px 12px; font: inherit; cursor: pointer;
}
.actions button.picked { background: var(--ink); color: var(--paper); }
.actions button.cross { border-color: var(--accent); color: var(--accent); }

.jump-block { margin-bottom: 22px; }
.jump-block h3 {
  font-size: 15px; font-family: ui-sans-serif, system-ui, sans-serif;
  margin: 0 0 10px; font-weight: 600;
}
.jump-block.here h3 { color: var(--accent); }
.jump-why { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 6px 0 0; }
.badge {
  display: inline-block; font-family: ui-sans-serif, system-ui, sans-serif;
  font-size: 11px; border-radius: 999px; padding: 1px 7px; margin-left: 6px;
}
.badge.strong { background: var(--strong-bg); color: var(--strong); }
.badge.weak { background: var(--weak-bg); color: var(--weak); }
.vacant { color: var(--empty); font-size: 13px; margin: 0; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); padding: 8px 14px;
  border-radius: 999px; font-size: 13px; z-index: 20;
}

footer { margin-top: 48px; color: var(--muted); font-size: 13px; line-height: 1.7; }
footer a { color: var(--accent); }

@media (max-width: 720px) {
  .seed-hero { grid-template-columns: 1fr; }
  .cover.lg { min-height: 220px; max-width: 220px; }
  .search { border-radius: 16px; flex-wrap: wrap; padding: 12px; }
  .search input { min-width: 100%; }
}

/* Community and accessible navigation */
[hidden] { display: none !important; }
body { font-family: system-ui, -apple-system, "Microsoft YaHei", sans-serif; line-height: 1.65; }
h1, h2, .cover-title, .wordmark { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; }
a { color: var(--accent); text-underline-offset: 3px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 8px; padding: 9px 14px; min-height: 42px; }
button:hover { border-color: var(--accent); }
button:disabled { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid #b56735; outline-offset: 3px; }
.search input:focus-visible { outline: 2px solid #b56735; outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 50; background: var(--paper); padding: 10px; }
.skip-link:focus { top: 10px; }
.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; }
.top-nav { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-bottom: 26px; margin-bottom: 32px; border-bottom: 1px solid var(--line); }
.top-nav div { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; }
.top-nav a { text-decoration: none; font-size: 14px; }
.top-nav .wordmark { color: var(--ink); font-size: 26px; font-weight: bold; letter-spacing: .12em; white-space: nowrap; }
.search input { min-width: 0; }
.suggest-option { padding: 12px 16px; cursor: pointer; }
.suggest-option.active, .suggest-option:hover { background: #f6eee6; }
.suggest-option small { display: block; margin-left: 0; }
.rec-card { text-decoration: none; transition: border-color .15s, transform .15s; }
.card-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.cover { min-height: 0; }
.cover-title { overflow-wrap: anywhere; }
.cover > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; }
.cover.photo > img { opacity: 1; }
.rec-intro { font-size: 14px; }
.jump-why { font-size: 14px; line-height: 1.75; }
.recommendation { display: flex; flex-direction: column; min-width: 0; }
.recommendation .rec-card { flex: 1; }
.recommendation > button { align-self: flex-start; margin: 8px 0 0; min-height: 34px; padding: 4px 9px; font-size: 12px; color: var(--muted); }
.taste-summary { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 12px 0 20px; }
.discover-link { display: inline-block; margin: 4px 0 12px; font-weight: 600; }
.tag-picker, .work-tags, .restore-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-picker button, .work-tags a { border: 1px solid var(--line); background: var(--paper); color: var(--ink); border-radius: 999px; padding: 6px 12px; text-decoration: none; }
.tag-picker button.picked { background: var(--ink); color: var(--paper); }
.work-tags { margin: 12px 0; }
.work-tags a { font-size: 13px; }
.more-batch { margin: 0 0 18px; }
.restore-list button { font-size: 13px; }
.section-head { background: none; border: 0; padding: 12px 0 4px; margin-top: 26px; }
.section-head h2 { font-size: 23px; }
.section-head p, .vacant { font-size: 14px; color: var(--muted); }
.collections { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.collections a { display: block; background: #eae3d6; padding: 22px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.collections h3 { margin: 0 0 8px; }
.collections p { color: var(--muted); font-size: 14px; margin: 0; }
.join-note { margin: 36px 0; padding: 24px; border-left: 4px solid var(--accent); background: var(--paper); }
.join-note h2, .join-note h3 { margin-top: 0; }
.seed-hero { align-items: start; }
.seed-hero .meta { margin-top: 14px; font-size: 14px; }
.filter-toggle { display: block; margin: 0 0 18px; }
details { margin: 18px 0; }
summary { cursor: pointer; color: var(--accent); padding: 10px 0; min-height: 42px; }
details .card-grid { margin-top: 16px; }
.discussion { border-top: 1px solid var(--line); margin-top: 36px; padding-top: 16px; scroll-margin-top: 20px; }
.discussion > h2 { font-size: 25px; }
form:not(.search) { background: var(--paper); padding: 20px; border: 1px solid var(--line); border-radius: 12px; margin: 16px 0; }
form:not(.search) label { display: block; margin-bottom: 14px; font-size: 14px; }
form:not(.search) input:not([type=checkbox]), textarea, select { display: block; width: 100%; max-width: 100%; padding: 10px 12px; margin-top: 6px; color: var(--ink); border: 1px solid #c5bbad; background: #fffefa; border-radius: 6px; }
textarea { resize: vertical; min-height: 110px; line-height: 1.8; }
input[type=checkbox] { width: 18px; height: 18px; vertical-align: middle; accent-color: var(--accent); }
form button[type=submit] { background: var(--accent); border-color: var(--accent); color: white; }
.form-message { margin: 10px 0 0; font-size: 14px; color: var(--strong); min-height: 1.5em; }
.form-message.error { color: #a12012; }
.review { padding: 20px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.review h4 { margin: 0 0 8px; }
.review-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; font-size: 13px; color: var(--muted); }
.review-meta b { color: var(--ink); font-size: 15px; }
.review .user-text { white-space: pre-wrap; line-height: 1.85; margin: 12px 0; }
.review details { margin: 6px 0; }
.spoiler { background: #ebe6db; padding: 0 14px; border-radius: 8px; }
.notice { background: #eee5d5; padding: 12px 16px; border-radius: 8px; font-size: 14px; }
.account-grid, .community-steps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.community-steps section { padding: 20px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.community-steps h3 { margin-top: 0; }
.recovery-notice { background: #f5e5c8; border: 2px solid #ac782d; border-radius: 12px; padding: 20px; }
.recovery-notice code { display: block; overflow-wrap: anywhere; margin: 15px 0; user-select: all; }
.recovery-notice button { margin-right: 10px; }
.import-label { display: inline-block; margin: 16px; }
.import-label input { max-width: 240px; }
.toast { display: flex; gap: 14px; align-items: center; border-radius: 12px; max-width: calc(100vw - 28px); width: max-content; }
.toast button { background: transparent; color: white; padding: 4px 12px; }
.policy { max-width: 760px; }
@media (max-width: 900px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 600px) {
  .wrap { padding: 20px 16px 40px; }
  .top-nav { align-items: flex-start; margin-bottom: 24px; padding-bottom: 18px; }
  .top-nav div { justify-content: flex-end; gap: 8px 14px; }
  .top-nav a { font-size: 13px; }
  .top-nav .wordmark { font-size: 24px; }
  header h1 { font-size: 26px; letter-spacing: 0; line-height: 1.45; }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .rec-body { padding: 10px; }
  .rec-card h3 { font-size: 17px; }
  .cover-title { font-size: 24px; }
  .cover .row { flex-wrap: wrap; gap: 4px; }
  .collections, .account-grid, .community-steps { grid-template-columns: 1fr; }
  .seed-hero { padding: 16px; }
  .seed-hero .cover.lg { width: 150px; min-width: 0; min-height: 0; }
  .search input { font-size: 16px; min-width: 100%; flex: 0 0 100%; padding: 8px 0; }
  .search button { flex: 1; }
  .jump-why { font-size: 13px; }
  form:not(.search) { padding: 14px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
