/* AdIncome 공통 스타일 — shared/base.css가 원본. 각 사이트 assets/base.css는 scripts/sync-shared.mjs가 복사한 사본이다. 사본을 직접 고치지 말 것. */
:root {
  --accent: #2563eb;
  --accent-soft: #dbeafe;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --border: #e5e7eb;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.04);
  --font: "Pretendard", "Apple SD Gothic Neo", "Malgun Gothic", "맑은 고딕", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --accent: #60a5fa;
    --accent-soft: #1e3a5f;
    --bg: #0f1115;
    --surface: #171a21;
    --text: #e5e7eb;
    --muted: #9ca3af;
    --border: #2a2f3a;
    --good: #4ade80;
    --warn: #fbbf24;
    --bad: #f87171;
    --shadow: none;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  word-break: keep-all;
  overflow-wrap: anywhere;
}
a { color: var(--accent); }
img, svg { max-width: 100%; }
code, kbd, pre { font-family: var(--mono); font-size: .92em; }
code { background: var(--accent-soft); padding: .1em .35em; border-radius: 6px; }
pre { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; }
pre code { background: none; padding: 0; }
kbd { border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 6px; padding: 0 .4em; background: var(--surface); }

/* 머리말·꼬리말 */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.site-header .inner { max-width: 880px; margin: 0 auto; padding: 12px 20px; display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; justify-content: space-between; }
.brand { font-weight: 800; font-size: 1.1rem; color: var(--text); text-decoration: none; }
.brand span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .95rem; }
.site-nav a { color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-footer { margin-top: 48px; border-top: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: .9rem; }
.site-footer .inner { max-width: 880px; margin: 0 auto; padding: 20px; display: flex; flex-wrap: wrap; gap: 8px 18px; }
.site-footer a { color: var(--muted); }

/* 본문 */
.container { max-width: 880px; margin: 0 auto; padding: 20px; }
.hero h1 { font-size: clamp(1.6rem, 4vw, 2.2rem); line-height: 1.3; margin: 12px 0 8px; }
.lead { color: var(--muted); font-size: 1.05rem; margin: 0 0 16px; }
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin: 16px 0; }
.card h2 { margin-top: 0; }
.muted { color: var(--muted); }
.small { font-size: .9rem; }
.notice { border-left: 4px solid var(--accent); background: var(--accent-soft); padding: 10px 14px; border-radius: 8px; margin: 12px 0; }
.notice.warn { border-color: var(--warn); background: color-mix(in srgb, var(--warn) 12%, transparent); }
.article h2 { margin-top: 2em; font-size: 1.35rem; }
.article h3 { margin-top: 1.5em; font-size: 1.1rem; }
.article li { margin: .25em 0; }
.toc { font-size: .95rem; }

/* 폼 */
label { font-weight: 600; display: block; margin: 10px 0 4px; }
input, select, textarea, button { font: inherit; color: inherit; }
input[type="text"], input[type="number"], input[type="time"], input[type="date"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg);
}
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus, button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px; border-radius: 10px; border: 1px solid var(--accent); background: var(--accent); color: #fff; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn.secondary { background: transparent; color: var(--accent); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; flex-wrap: wrap; gap: 12px; }
.row > * { flex: 1 1 180px; }
.dropzone { border: 2px dashed var(--border); border-radius: var(--radius); padding: 28px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.dropzone.drag, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }

/* 결과 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.stat { background: var(--bg); border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; }
.stat .k { color: var(--muted); font-size: .85rem; }
.stat .v { font-size: 1.5rem; font-weight: 800; line-height: 1.3; }
.stat .s { color: var(--muted); font-size: .85rem; }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { border-bottom: 1px solid var(--border); padding: 8px 6px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-weight: 600; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.meter { height: 12px; background: var(--border); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: var(--accent); border-radius: 99px; }

/* 광고 자리: 실제 광고 코드는 승인 뒤에만 넣는다. 본문·버튼과 헷갈리지 않게 '광고' 표시를 붙이고 간격을 둔다. */
.ad-slot { margin: 28px 0; min-height: 100px; border: 1px dashed var(--border); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: .8rem; }
.ad-slot::before { content: "광고"; }
.ad-slot.live::before { content: none; }

@media (max-width: 480px) {
  .container { padding: 14px; }
  .card { padding: 16px; }
  .stat .v { font-size: 1.3rem; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}
