:root {
  --bg: #f7f8fa;
  --surface: #ffffff;
  --ink: #14181f;
  --ink-2: #4a5361;
  --ink-3: #7b8594;
  --line: #e3e7ed;
  --brand: #0b2545;
  --accent: #1d6fd8;
  --accent-soft: #e8f1fd;
  --warn: #b4530a;
  --warn-soft: #fff4e5;
  --ok: #18794e;
  --radius: 14px;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0c1118;
    --surface: #131a24;
    --ink: #e8ecf2;
    --ink-2: #b3bcc9;
    --ink-3: #8691a1;
    --line: #243042;
    --brand: #9cc3ff;
    --accent: #5aa2ff;
    --accent-soft: #15253c;
    --warn: #ffb35c;
    --warn-soft: #2d2113;
    --ok: #4cc38a;
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font); line-height: 1.7; word-break: keep-all; overflow-wrap: anywhere; }
a { color: var(--accent); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 20px; }

/* 헤더 */
.site-header { position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 60px; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; white-space: nowrap; }
.brand-mark { width: 22px; height: 22px; border-radius: 7px; background: linear-gradient(135deg, #1d6fd8, #39c0c8); }
.nav { display: flex; gap: 18px; font-size: 15px; }
.nav a { color: var(--ink-2); text-decoration: none; white-space: nowrap; }
.nav a:hover { color: var(--ink); }

/* 홈 */
.hero { padding: 72px 0 48px; }
.eyebrow { margin: 0 0 10px; font-size: 13px; font-weight: 700; letter-spacing: 0.08em; color: var(--accent); }
.hero h1 { margin: 0; font-size: clamp(30px, 5.2vw, 52px); line-height: 1.25; letter-spacing: -0.035em; max-width: 820px; }
.hero-sub { margin: 18px 0 0; font-size: clamp(16px, 2.2vw, 19px); color: var(--ink-2); max-width: 680px; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }
.btn { display: inline-flex; align-items: center; height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 600; font-size: 15px; cursor: pointer; font-family: inherit; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.section-title { font-size: 20px; margin: 16px 0 18px; letter-spacing: -0.02em; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding-bottom: 72px; }
.card { display: flex; flex-direction: column; gap: 6px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); }
.card-no { font-size: 13px; font-weight: 800; color: var(--ink-3); }
.card-label { font-size: 13px; font-weight: 700; color: var(--accent); }
.card h3 { margin: 4px 0 2px; font-size: 20px; line-height: 1.4; letter-spacing: -0.025em; }
.card p { margin: 0; font-size: 15px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.card-meta { margin-top: auto; padding-top: 10px; font-size: 13px; color: var(--ink-3); }

/* 글 */
.article-wrap { max-width: 760px; padding-top: 48px; padding-bottom: 56px; }
.article h1 { margin: 0; font-size: clamp(28px, 4.6vw, 42px); line-height: 1.3; letter-spacing: -0.035em; }
.meta { margin: 14px 0 0; color: var(--ink-3); font-size: 14px; }
.meta a { color: var(--ink-3); }
.toc { margin: 28px 0 8px; padding: 18px 22px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.toc p { margin: 0 0 6px; font-weight: 700; font-size: 14px; color: var(--ink-2); }
.toc ol { margin: 0; padding-left: 20px; font-size: 15px; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--accent); }
.prose { font-size: 18px; line-height: 1.9; }
.prose p { margin: 0 0 1.25em; }
.prose h2 { margin: 2.2em 0 0.7em; font-size: 25px; line-height: 1.4; letter-spacing: -0.03em; scroll-margin-top: 80px; }
.prose h3 { margin: 1.8em 0 0.5em; font-size: 20px; line-height: 1.45; letter-spacing: -0.02em; scroll-margin-top: 80px; }
.prose h4 { margin: 1.5em 0 0.4em; font-size: 18px; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.25em; }
.prose li { margin: 0.3em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.4em 0; }
.prose .signature { margin-top: 2em; font-weight: 700; color: var(--ink-2); }
.all-essay { padding-top: 24px; scroll-margin-top: 70px; }
.all-essay > h2 { margin: 0; font-size: clamp(24px, 4vw, 32px); line-height: 1.35; letter-spacing: -0.03em; }
.all-essay .prose h3 { font-size: 23px; margin-top: 2em; }
.all-essay .prose h4 { font-size: 19px; }
.all-sep { border: 0; border-top: 2px solid var(--line); margin: 56px 0 24px; }

/* 공유 */
.share { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.share-btn { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; text-decoration: none; white-space: nowrap; }
.share-btn:hover { border-color: var(--accent); color: var(--accent); }
.share-native { display: none; background: var(--accent); border-color: var(--accent); color: #fff; }
.share-native:hover { color: #fff; }
.has-native .share-native { display: inline-flex; }
.share-edit { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.share-end { margin-top: 40px; padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.share-end p { margin: 0; font-weight: 700; }
.share-end .share { margin-top: 14px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 32px; }
.pager a { display: block; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700; line-height: 1.45; }
.pager a span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-3); margin-bottom: 4px; }
.pager-next { text-align: right; }

/* 푸터 */
.site-footer { border-top: 1px solid var(--line); padding: 32px 0 48px; color: var(--ink-3); font-size: 14px; }
.site-footer p { margin: 0 0 8px; }
.foot-brand { font-weight: 700; color: var(--ink-2); }
.foot-note { max-width: 720px; }
.foot-links a { color: var(--ink-3); }

.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px); background: #14181f; color: #fff; padding: 12px 18px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: .2s; z-index: 50; max-width: calc(100% - 32px); text-align: center; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 에디터 */
.ed { max-width: 1240px; padding-top: 32px; padding-bottom: 64px; }
.ed h1 { margin: 0; font-size: clamp(26px, 4vw, 34px); letter-spacing: -0.03em; }
.ed-sub { margin: 8px 0 24px; color: var(--ink-2); }
.ed-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 20px; align-items: start; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel + .panel { margin-top: 20px; }
.panel h2 { margin: 0 0 14px; font-size: 17px; letter-spacing: -0.02em; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > span { font-size: 13px; font-weight: 700; color: var(--ink-2); }
.field input[type=text], .field select, .field textarea { font: 15px var(--font); color: var(--ink); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; }
.field textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
.platforms { display: flex; flex-wrap: wrap; gap: 8px; }
.platforms button, .seg button { height: 38px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); font: 600 14px var(--font); cursor: pointer; }
.platforms button[aria-pressed=true], .seg button[aria-pressed=true] { background: var(--accent); border-color: var(--accent); color: #fff; }
.seg { display: flex; flex-wrap: wrap; gap: 8px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 14px; color: var(--ink-2); }
.checks label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.blocks { max-height: 520px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.blk { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: 14px; align-items: start; }
.blk:last-child { border-bottom: 0; }
.blk input { margin-top: 4px; }
.blk-text { color: var(--ink-2); line-height: 1.55; }
.blk-h .blk-text { font-weight: 800; color: var(--ink); }
.blk-off .blk-text { opacity: .45; }
.blk-tag { font-size: 11px; font-weight: 700; color: var(--ink-3); margin-right: 6px; }
.blk-card { font: 600 12px var(--font); padding: 4px 8px; border-radius: 6px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-3); cursor: pointer; white-space: nowrap; }
.blk-card:hover { color: var(--accent); border-color: var(--accent); }
.mini-btns { display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.mini-btns button { font: 600 13px var(--font); padding: 6px 10px; border-radius: 8px; border: 1px solid var(--line); background: var(--bg); color: var(--ink-2); cursor: pointer; }
.out-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.out-head h2 { margin: 0; }
.count { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.count.over { color: var(--warn); }
.post { border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 12px; background: var(--bg); }
.post textarea { width: 100%; min-height: 140px; border: 0; background: transparent; color: var(--ink); font: 15px/1.65 var(--font); resize: vertical; outline: none; }
.post-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 6px; }
.post-foot .btns { display: flex; gap: 6px; flex-wrap: wrap; }
.btn-sm { font: 600 13px var(--font); padding: 7px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-decoration: none; }
.btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.note { font-size: 13px; color: var(--ink-3); margin: 8px 0 0; }
.warn { background: var(--warn-soft); color: var(--warn); border-radius: 10px; padding: 10px 12px; font-size: 13px; margin-bottom: 12px; }
.rich-preview { border: 1px dashed var(--line); border-radius: 10px; padding: 14px 16px; max-height: 420px; overflow: auto; font-size: 15px; line-height: 1.75; }
.rich-preview h2 { font-size: 19px; margin: 1.2em 0 .4em; }
.rich-preview h3 { font-size: 17px; margin: 1em 0 .3em; }
.cardlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.cardlist figure { margin: 0; }
.cardlist canvas { width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); display: block; }
.cardlist figcaption { display: flex; gap: 6px; margin-top: 6px; }
.empty { color: var(--ink-3); font-size: 14px; }

@media (max-width: 900px) {
  .ed-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .wrap { padding: 0 16px; }
  .nav { gap: 12px; font-size: 14px; }
  .brand { font-size: 15px; }
  .hero { padding: 48px 0 32px; }
  .prose { font-size: 17px; }
  .prose h2 { font-size: 22px; }
  .pager { grid-template-columns: 1fr; }
  .pager-next { text-align: left; }
  .cards { grid-template-columns: 1fr; }
}
@media (max-width: 380px) {
  .nav a:first-child { display: none; }
}
@media print {
  .site-header, .share, .share-end, .pager, .site-footer, .toc { display: none; }
  body { background: #fff; color: #000; }
}
