/* ── 위시버튼 포털 테마 ─────────────────────────
   흰 배경 · 산세리프 · 상용 정보 포털 구조
   ─────────────────────────────────────────── */
:root {
  --primary: #7b5cff;
  --accent: #2a1d5e;
  --gold: #f5c518;
  --bg: #ffffff;
  --bg2: #f5f6f8;
  --bg3: #eef0f4;
  --text: #191f2b;
  --text2: #4b5563;
  --muted: #8a92a3;
  --line: #e6e8ee;
  --card: #ffffff;
  --r: 12px;
  --r-sm: 8px;
  --sh: 0 2px 6px rgba(20, 27, 45, .05), 0 10px 24px -14px rgba(20, 27, 45, .18);
  --font: 'Pretendard Variable', Pretendard, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); color: var(--text); background: var(--bg); font-size: 16px; line-height: 1.7; word-break: keep-all; letter-spacing: -0.005em; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
.ic { display: inline-block; margin-right: 6px; }
h1, h2, h3, h4 { letter-spacing: -0.02em; }

/* 썸네일 */
.thumb { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; background: var(--bg3); border-radius: var(--r-sm); overflow: hidden; }
.thumb.svg svg { width: 100%; height: 100%; display: block; }
.thumb.sm { width: 72px; min-width: 72px; aspect-ratio: 4 / 3; border-radius: 6px; }
.thumb.lg { border-radius: var(--r); }

/* 칩 */
.chip { display: inline-block; font-size: .74rem; font-weight: 700; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, #fff); padding: 3px 9px; border-radius: 999px; line-height: 1.4; }
.chip.light { background: rgba(255,255,255,.92); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips a { font-size: .84rem; color: var(--text2); background: var(--bg2); border: 1px solid var(--line); padding: 5px 12px; border-radius: 999px; transition: .15s; }
.chips a:hover { background: #fff; border-color: var(--primary); color: var(--primary); }

/* ── 헤더 ── */
.hd { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.hd-top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 28px; height: 74px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 900; font-size: 1.45rem; letter-spacing: -0.04em; color: var(--accent); white-space: nowrap; }
.logo img { width: 34px; height: 34px; border-radius: 50%; }
.search { display: flex; max-width: 640px; width: 100%; margin: 0 auto; border: 2px solid var(--accent); border-radius: 999px; overflow: hidden; background: #fff; }
.search input { flex: 1; border: 0; outline: 0; padding: 11px 20px; font: inherit; font-size: .95rem; background: transparent; min-width: 0; }
.search button { border: 0; background: var(--accent); color: #fff; padding: 0 20px; font-size: 1.05rem; cursor: pointer; }
.hd-links { display: flex; gap: 16px; font-size: .88rem; color: var(--text2); white-space: nowrap; }
.hd-nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; height: 48px; align-items: center; border-top: 1px solid var(--line); }
.hd-nav::-webkit-scrollbar { display: none; }
.hd-nav a { padding: 7px 13px; border-radius: 999px; font-size: .93rem; font-weight: 600; color: var(--text2); white-space: nowrap; transition: .15s; }
.hd-nav a:hover { background: var(--bg2); color: var(--text); }
.hd-nav a.on { background: var(--accent); color: #fff; }

/* ── 히어로 ── */
.hero { display: grid; grid-template-columns: 1.55fr 1fr; gap: 20px; margin: 22px 0 18px; }
.hero-main { position: relative; display: block; border-radius: var(--r); overflow: hidden; box-shadow: var(--sh); min-height: 380px; }
.hero-main .thumb { height: 100%; aspect-ratio: auto; border-radius: 0; }
.hero-main .thumb.svg { position: absolute; inset: 0; }
.hero-txt { position: absolute; left: 0; right: 0; bottom: 0; padding: 120px 28px 28px; background: linear-gradient(180deg, transparent, rgba(10,14,25,.82)); color: #fff; }
.hero-txt h1 { margin: 10px 0 8px; font-size: clamp(1.3rem, 2.6vw, 1.9rem); line-height: 1.35; font-weight: 800; }
.hero-txt p { margin: 0; opacity: .9; font-size: .95rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side { background: var(--bg2); border-radius: var(--r); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 12px; }
.hero-side h4 { margin: 0 0 4px; font-size: 1rem; }
.rank { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.rank li a { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: .92rem; line-height: 1.45; font-weight: 600; color: var(--text); }
.rank li:last-child a { border-bottom: 0; }
.rank li a:hover { color: var(--primary); }
.rank li a em { display: block; font-style: normal; font-size: .74rem; color: var(--primary); font-weight: 700; margin-bottom: 2px; }
.rank .n { width: 22px; color: var(--gold); font-weight: 900; font-size: 1.05rem; text-align: center; text-shadow: 0 1px 0 rgba(0,0,0,.15); }
.rank li a span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hero-side .chips { margin-top: auto; padding-top: 8px; }

/* 카테고리 스트립 */
.cat-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; margin: 8px 0 8px; }
.cat-strip a { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 8px 12px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); font-size: .88rem; font-weight: 700; color: var(--text); transition: .15s; text-align: center; }
.cat-strip a .ic { font-size: 1.6rem; margin: 0; }
.cat-strip a small { color: var(--muted); font-weight: 500; font-size: .76rem; }
.cat-strip a:hover { border-color: var(--primary); box-shadow: var(--sh); transform: translateY(-2px); }

/* ── 섹션 / 그리드 ── */
.sec { margin: 36px 0 0; }
.sec-hd { display: flex; align-items: baseline; gap: 14px; margin-bottom: 14px; border-bottom: 2px solid var(--text); padding-bottom: 10px; }
.sec-hd h2 { margin: 0; font-size: 1.25rem; font-weight: 800; }
.sec-hd p { margin: 0; color: var(--muted); font-size: .88rem; flex: 1; }
.sec-hd .more { font-size: .88rem; color: var(--text2); font-weight: 600; white-space: nowrap; }
.sec-hd .more:hover { color: var(--primary); }
.grid { display: grid; gap: 18px; }
.g4 { grid-template-columns: repeat(4, 1fr); }
.g3 { grid-template-columns: repeat(3, 1fr); }
.g2 { grid-template-columns: repeat(2, 1fr); }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; transition: .18s; }
.card:hover { box-shadow: var(--sh); transform: translateY(-3px); border-color: #dfe3ea; }
.card-link { display: block; }
.card .thumb { border-radius: 0; }
.card-body { padding: 14px 16px 14px; }
.card h3 { margin: 8px 0 6px; font-size: 1.02rem; line-height: 1.4; font-weight: 700; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.8em; }
.card p { margin: 0; font-size: .86rem; color: var(--text2); line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .meta { margin-top: 10px; display: flex; gap: 10px; font-size: .78rem; color: var(--muted); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--bg2); border-radius: var(--r); }

/* ── 2단 레이아웃 ── */
.two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 36px; padding-top: 24px; padding-bottom: 60px; align-items: start; }
.page-hd { margin: 6px 0 18px; }
.page-hd h1 { margin: 0 0 4px; font-size: 1.6rem; font-weight: 800; }
.page-hd p { margin: 0; color: var(--muted); font-size: .92rem; }
.side { position: sticky; top: 138px; display: flex; flex-direction: column; gap: 18px; }
.box { background: var(--bg2); border-radius: var(--r); padding: 16px 16px 12px; }
.box h4 { margin: 0 0 10px; font-size: .98rem; font-weight: 800; }
.catlist { list-style: none; margin: 0; padding: 0; }
.catlist a { display: flex; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .92rem; font-weight: 600; }
.catlist li:last-child a { border-bottom: 0; }
.catlist a b { margin-left: auto; font-size: .78rem; color: var(--muted); font-weight: 600; background: #fff; border-radius: 999px; padding: 1px 8px; }
.catlist a:hover { color: var(--primary); }

/* ── 글 페이지 ── */
.post { min-width: 0; }
.crumb { font-size: .84rem; color: var(--muted); margin-bottom: 8px; }
.crumb a:hover { color: var(--primary); }
.post h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); line-height: 1.35; font-weight: 800; margin: 0 0 12px; }
.post-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; font-size: .86rem; color: var(--muted); margin-bottom: 16px; }
.lead { font-size: 1.02rem; color: var(--text2); background: var(--bg2); border-left: 4px solid var(--primary); padding: 12px 16px; border-radius: 0 var(--r-sm) var(--r-sm) 0; margin: 0 0 20px; }
.post-cover { margin: 0 0 22px; }
.toc-inline { background: var(--bg2); border-radius: var(--r-sm); padding: 14px 18px; margin: 0 0 26px; font-size: .92rem; }
.toc-inline b { display: block; margin-bottom: 6px; }
.toc-inline ol { margin: 0; padding-left: 20px; columns: 2; column-gap: 24px; }
.toc-inline li { margin: 3px 0; break-inside: avoid; }
.toc-inline a { color: var(--text2); }
.toc-inline a:hover { color: var(--primary); }
.content { font-size: 1.04rem; line-height: 1.85; }
.content h2 { font-size: 1.38rem; font-weight: 800; margin: 44px 0 12px; padding-left: 12px; border-left: 4px solid var(--primary); scroll-margin-top: 140px; }
.content h3 { font-size: 1.12rem; font-weight: 700; margin: 28px 0 8px; scroll-margin-top: 140px; }
.content p { margin: 0 0 16px; }
.content ul, .content ol { padding-left: 22px; margin: 0 0 16px; }
.content li { margin: 4px 0; }
.content strong { font-weight: 700; color: var(--text); background: linear-gradient(transparent 60%, color-mix(in srgb, var(--primary) 18%, #fff) 60%); }
.content blockquote { margin: 18px 0; padding: 12px 16px; background: var(--bg2); border-left: 4px solid var(--accent); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text2); }
.content blockquote p:last-child { margin: 0; }
.content table { border-collapse: collapse; width: 100%; margin: 12px 0 22px; font-size: .92rem; display: block; overflow-x: auto; }
.content th, .content td { border: 1px solid var(--line); padding: 9px 12px; text-align: left; vertical-align: top; line-height: 1.55; }
.content th { background: var(--bg2); font-weight: 700; }
.content tr:nth-child(even) td { background: #fafbfc; }
.content code { background: var(--bg2); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
.content a { color: #1d5bd6; text-decoration: underline; text-underline-offset: 3px; }
.content hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }
.summary-box { background: color-mix(in srgb, var(--primary) 6%, #fff); border: 1px solid color-mix(in srgb, var(--primary) 30%, #fff); border-radius: var(--r); padding: 18px 22px 6px; margin: 40px 0 26px; }
.summary-box h2 { border: 0; padding: 0; margin: 0 0 8px; font-size: 1.15rem; }
.summary-box h2::before { content: "✅ "; }
.faq h2::before { content: "❓ "; }
.faq p { background: var(--bg2); padding: 12px 16px; border-radius: var(--r-sm); margin: 10px 0; }
.faq p strong { background: none; }
.tags { margin-top: 28px; }
.disclaimer { margin-top: 24px; font-size: .84rem; color: var(--muted); border-top: 1px dashed var(--line); padding-top: 14px; }
.share { display: flex; gap: 8px; margin-top: 18px; flex-wrap: wrap; }
.share button, .share a { font: inherit; font-size: .86rem; font-weight: 600; padding: 8px 14px; border: 1px solid var(--line); background: #fff; border-radius: 999px; cursor: pointer; color: var(--text2); }
.share button:hover, .share a:hover { border-color: var(--primary); color: var(--primary); }
.ad-slot { margin: 26px 0; min-height: 90px; display: flex; justify-content: center; }

/* ── 푸터 ── */
.ft { background: var(--bg2); border-top: 1px solid var(--line); margin-top: 60px; padding: 36px 0 30px; color: var(--text2); font-size: .88rem; }
.ft .wrap { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 24px; }
.ft b { display: block; color: var(--text); margin-bottom: 8px; font-size: .95rem; }
.ft-brand p { margin: 0 0 6px; }
.ft-brand .small { font-size: .8rem; color: var(--muted); }
.ft-col a { display: block; padding: 3px 0; }
.ft-col a:hover { color: var(--primary); }
.ft .copy { display: block; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .8rem; color: var(--muted); }
.pagination { display: flex; gap: 6px; justify-content: center; margin: 30px 0 0; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; font-size: .9rem; }
.pagination span.cur { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 반응형 ── */
@media (max-width: 1080px) {
  .g4 { grid-template-columns: repeat(3, 1fr); }
  .cat-strip { grid-template-columns: repeat(4, 1fr); }
  .two { grid-template-columns: 1fr; }
  .side { position: static; }
}
@media (max-width: 860px) {
  .hd-top { grid-template-columns: auto 1fr; height: auto; padding-top: 12px; padding-bottom: 12px; gap: 12px; }
  .hd-links { display: none; }
  .search { max-width: none; }
  .search input { padding: 9px 14px; font-size: .9rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-main { min-height: 260px; }
  .g4, .g3 { grid-template-columns: repeat(2, 1fr); }
  .ft .wrap { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  body { font-size: 15.5px; }
  .g4, .g3, .g2 { grid-template-columns: 1fr; }
  .cat-strip { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .cat-strip a { padding: 10px 4px 8px; font-size: .74rem; }
  .cat-strip a .ic { font-size: 1.3rem; }
  .hero-txt { padding: 80px 16px 16px; }
  .card h3 { min-height: 0; }
  .toc-inline ol { columns: 1; }
  .content { font-size: 1rem; }
}
