/* 웹툰지지 스타일 */
:root {
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f1f2f7;
  --text: #16171d;
  --muted: #6b6f7e;
  --line: #e4e5ee;
  --brand: #5b4cf0;
  --brand-2: #8b5cf6;
  --brand-ink: #ffffff;
  --brand-soft: #efedff;
  --adult: #e5484d;
  --adult-soft: #fdecec;
  --shadow: 0 1px 2px rgba(20, 20, 40, .04), 0 8px 24px rgba(20, 20, 40, .06);
  --radius: 18px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1015;
    --surface: #181a22;
    --surface-2: #20232d;
    --text: #eef0f5;
    --muted: #9ba0b0;
    --line: #2a2d39;
    --brand: #8b7dff;
    --brand-2: #b28cff;
    --brand-ink: #0f0d24;
    --brand-soft: #25224a;
    --adult: #f2555a;
    --adult-soft: #3a1c1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Pretendard Variable", Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}
a { color: inherit; }
button { font: inherit; }
.container { max-width: 1040px; margin: 0 auto; padding: 0 16px; }

/* ───── 상단 바 ───── */
.topbar {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.topbar .container { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 800; font-size: 19px; letter-spacing: -.02em; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff;
  font-size: 13px; font-weight: 900; letter-spacing: -.04em;
}
.topnav { display: flex; gap: 4px; }
.topnav a { text-decoration: none; font-size: 14px; font-weight: 600; color: var(--muted); padding: 8px 12px; border-radius: 10px; }
.topnav a:hover { color: var(--text); background: var(--surface-2); }

/* ───── 히어로 ───── */
.hero { padding-top: 56px; padding-bottom: 28px; text-align: center; }
.hero .eyebrow {
  display: inline-block; font-size: 13px; font-weight: 700; color: var(--brand);
  background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
}
.hero h1 { font-size: clamp(30px, 5.4vw, 48px); line-height: 1.2; letter-spacing: -.035em; margin: 0 0 14px; }
.hero h1 em { font-style: normal; background: linear-gradient(135deg, var(--brand), var(--brand-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: clamp(15px, 2.2vw, 18px); margin: 0 auto 26px; max-width: 560px; }
.hero-cta { display: inline-flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.stats { display: flex; justify-content: center; gap: 28px; margin-top: 30px; flex-wrap: wrap; }
.stats div { text-align: center; }
.stats b { display: block; font-size: 22px; letter-spacing: -.02em; }
.stats span { font-size: 13px; color: var(--muted); }

/* ───── 공통 섹션 ───── */
section { scroll-margin-top: 72px; }
.section { padding-top: 28px; padding-bottom: 28px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.section-head h2 { font-size: 24px; letter-spacing: -.03em; margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

/* ───── 추천 찾기 ───── */
.finder { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; }
.stepper { display: flex; gap: 8px; margin-bottom: 26px; list-style: none; padding: 0; }
.stepper li { flex: 1; font-size: 13px; font-weight: 700; color: var(--muted); }
.stepper li::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line); margin-bottom: 8px; transition: background .2s; }
.stepper li.on { color: var(--text); }
.stepper li.on::before { background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

.panel h2 { margin: 0 0 4px; font-size: 22px; letter-spacing: -.03em; }
.panel .hint { margin: 0 0 20px; color: var(--muted); font-size: 14px; }
.group-title { font-weight: 700; font-size: 14px; color: var(--muted); margin: 22px 0 10px; }
.group-title:first-child { margin-top: 0; }

.options { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.opt {
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  border-radius: 14px; padding: 13px 14px; text-align: left; cursor: pointer;
  transition: border-color .15s, background .15s, transform .1s;
}
.opt:hover { border-color: var(--brand); }
.opt:active { transform: scale(.98); }
.opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.opt b { display: block; font-size: 15px; }
.opt small { color: var(--muted); font-size: 12px; }
.opt.selected b::after { content: " ✓"; color: var(--brand); }

.platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.pf {
  display: inline-flex; align-items: center; gap: 7px; border: 1.5px solid var(--line); background: var(--surface);
  color: var(--text); border-radius: 999px; padding: 9px 15px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.pf i { width: 10px; height: 10px; border-radius: 50%; background: var(--pf); }
.pf small { color: var(--muted); font-weight: 500; font-size: 12px; }
.pf.on { border-color: var(--brand); background: var(--brand-soft); }

.adult-toggle {
  display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 14px;
  border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px;
  background: var(--surface); color: var(--text); text-align: left; cursor: pointer;
}
.adult-toggle b { display: block; font-size: 14px; }
.adult-toggle small { color: var(--muted); font-size: 12px; }
.adult-toggle .switch { flex-shrink: 0; width: 42px; height: 24px; border-radius: 12px; background: var(--line); position: relative; transition: background .15s; }
.adult-toggle .switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.adult-toggle.on { border-color: var(--adult); background: var(--adult-soft); }
.adult-toggle.on .switch { background: var(--adult); }
.adult-toggle.on .switch::after { transform: translateX(18px); }
.badge-adult { display: inline-block; background: var(--adult); color: #fff; border-radius: 6px; padding: 1px 6px; font-size: 11px; font-weight: 800; margin-left: 6px; vertical-align: 3px; }

.nav { display: flex; justify-content: space-between; gap: 10px; margin-top: 26px; }
.btn {
  border: 0; border-radius: 12px; padding: 13px 22px; font-weight: 700; cursor: pointer; text-decoration: none;
  background: var(--surface-2); color: var(--text); display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--brand) 30%, transparent); }
.btn.lg { padding: 15px 26px; font-size: 16px; border-radius: 14px; }
.btn:disabled { opacity: .4; cursor: not-allowed; box-shadow: none; }

.notice { background: var(--brand-soft); border-radius: 12px; padding: 11px 14px; font-size: 14px; margin-bottom: 16px; }

/* ───── 결과 ───── */
.sortbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.sortbar .count { font-size: 14px; color: var(--muted); }
.sortbar .count b { color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); border-radius: 12px; padding: 3px; }
.seg button { border: 0; background: transparent; color: var(--muted); font-size: 14px; font-weight: 700; padding: 7px 15px; border-radius: 9px; cursor: pointer; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.picked { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 18px; }
.tier { font-size: 13px; font-weight: 800; color: var(--brand); margin: 14px 2px 2px; }
.tier:first-child { margin-top: 0; }
.results { display: flex; flex-direction: column; gap: 10px; }
.card {
  display: flex; gap: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 14px; text-decoration: none; position: relative; transition: border-color .15s, box-shadow .15s, transform .15s;
}
.card:hover { border-color: color-mix(in srgb, var(--brand) 50%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.rank {
  position: absolute; top: 8px; left: 8px; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px;
  background: rgba(15, 15, 30, .78); color: #fff; font-weight: 800; font-size: 14px;
  display: grid; place-items: center; z-index: 1; backdrop-filter: blur(4px);
}
.card:nth-child(-n+4) .rank { background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.thumb { width: 112px; flex-shrink: 0; align-self: flex-start; aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb .fallback {
  width: 100%; height: 100%; display: grid; place-items: center; text-align: center; padding: 8px;
  font-weight: 800; font-size: 13px; color: #fff; background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.info { min-width: 0; flex: 1; }
.info h3 { margin: 0 0 2px; font-size: 17px; letter-spacing: -.02em; }
.pf-badge { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 700; color: var(--muted); }
.pf-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--pf); }
.meta { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.synopsis { font-size: 14px; margin: 0 0 9px; color: color-mix(in srgb, var(--text) 82%, var(--muted)); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 12px; background: var(--surface-2); border-radius: 999px; padding: 3px 10px; }
.chip.hit { background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.go { font-size: 13px; font-weight: 700; color: var(--brand); margin-top: 9px; display: inline-block; }
.btn.more { width: 100%; margin-top: 14px; }
.end { text-align: center; color: var(--muted); font-size: 13px; margin: 18px 0 0; }

/* ───── 인기 웹툰 ───── */
.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button { border: 1px solid var(--line); background: var(--surface); color: var(--muted); border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 700; cursor: pointer; }
.tabs button.on { background: var(--text); border-color: var(--text); color: var(--bg); }
.poster-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 14px; }
.poster { text-decoration: none; display: block; }
.poster .cover { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: var(--shadow); }
.poster .cover img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .25s; }
.poster:hover .cover img { transform: scale(1.04); }
.poster .num { position: absolute; left: 8px; bottom: 6px; color: #fff; font-size: 26px; font-weight: 900; font-style: italic; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.poster b { display: block; font-size: 14px; margin-top: 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.poster small { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); }
.poster small::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--pf); }

/* ───── 추천 방식 · FAQ ───── */
.how { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.how article { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.how .n { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-weight: 800; margin-bottom: 12px; }
.how h3 { margin: 0 0 6px; font-size: 16px; }
.how p { margin: 0; font-size: 14px; color: var(--muted); }
.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 18px; margin-bottom: 8px; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 10px; }
.faq summary::after { content: "+"; color: var(--muted); font-weight: 400; font-size: 20px; line-height: 1; }
.faq details[open] summary::after { content: "−"; }
.faq details p { margin: 10px 0 0; color: var(--muted); font-size: 14px; }

footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 28px 0 40px; font-size: 13px; color: var(--muted); }
footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
footer p { margin: 0 0 4px; }

@media (max-width: 640px) {
  .topnav { display: none; }
  .hero { padding-top: 36px; padding-bottom: 16px; }
  .finder { padding: 18px; border-radius: 18px; }
  .options { grid-template-columns: 1fr 1fr; }
  .thumb { width: 86px; }
  .synopsis { display: none; }
  .poster-grid { grid-template-columns: repeat(3, 1fr); gap: 12px 10px; }
  .poster .num { font-size: 20px; }
  .stepper li { font-size: 12px; }
}

/* ───── 테마별 추천 페이지 · 링크 ───── */
.seo-group { margin-bottom: 18px; }
.seo-group h3 { font-size: 15px; margin: 0 0 10px; }
.link-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.link-chips a {
  text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 13px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
}
.link-chips a:hover { border-color: var(--brand); color: var(--brand); }
.section-head p a { color: var(--brand); font-weight: 700; text-decoration: none; }

.seo-page { padding-top: 20px; padding-bottom: 20px; }
.breadcrumb { font-size: 13px; color: var(--muted); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
.page-hero { background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); padding: 28px; margin-bottom: 18px; }
.page-hero h1 { font-size: clamp(24px, 4.4vw, 34px); letter-spacing: -.03em; line-height: 1.25; margin: 0 0 12px; }
.page-hero p { color: var(--muted); margin: 0 0 12px; }
.page-hero p b { color: var(--text); }
.page-hero .updated { font-size: 13px; margin-bottom: 18px; }
.rank-list { list-style: none; padding: 0; margin: 0; }
.rank-list .card:hover { transform: none; }
.item-title { margin: 0 0 2px; font-size: 17px; letter-spacing: -.02em; }
.item-title a { text-decoration: none; }
.item-title a:hover { color: var(--brand); }
.go { text-decoration: none; }
.related { margin-top: 28px; }
.related h2 { font-size: 20px; letter-spacing: -.02em; margin: 0 0 12px; }
@media (max-width: 640px) {
  .page-hero { padding: 20px; border-radius: 18px; }
}