/* AdIncome 공통 스타일 — shared/base.css가 원본. 각 사이트 assets/base.css는 scripts/sync-shared.mjs가 복사한 사본이다. 사본을 직접 고치지 말 것.
   사이트마다 다른 색·무늬·아이콘·둥글기는 site.css 맨 위 THEME 칸(shared/themes.json → scripts/apply-themes.mjs)이 정한다.
   2026-12-06 디자인 개편: 밝은 화면만, 첫 화면 띠, 쓸모 있는 작은 움직임(움직임 줄이기 설정이면 끔). 근거 docs/디자인_조사_2026-12.md */
:root {
  /* 사이트 테마가 덮어쓰는 값(기본값) */
  --accent: #2563eb;
  --accent-2: #1d4ed8;
  --glow: #a78bfa;
  --radius: 14px;
  --btn-radius: 10px;
  --head-weight: 800;
  --header-bg: rgba(255,255,255,.88);
  --header-top: 0px;
  --hero-pattern: none;
  --hero-icon: none;

  /* 사이트 색에서 자동으로 나오는 밝은 색 */
  --accent-soft: color-mix(in srgb, var(--accent) 12%, #ffffff);
  --accent-faint: color-mix(in srgb, var(--accent) 5%, #ffffff);
  --hero-from: color-mix(in srgb, var(--accent) 13%, #ffffff);
  --hero-to: color-mix(in srgb, var(--glow) 20%, #ffffff);
  --bg: color-mix(in srgb, var(--accent) 3%, #ffffff);
  --border: color-mix(in srgb, var(--accent) 12%, #e5e7eb);

  --on-accent: #ffffff;   /* 강조색 바탕 위 글자색(테마 색은 흰 글자 대비 4.5 이상만 씀) */
  --surface: #ffffff;
  --text: #1f2937;
  --text-soft: #374151;
  --muted: #586172;
  --good: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  --shadow: 0 1px 2px rgba(15,23,42,.05), 0 8px 24px color-mix(in srgb, var(--accent) 9%, transparent);
  --shadow-lift: 0 2px 4px rgba(15,23,42,.06), 0 14px 32px color-mix(in srgb, var(--accent) 16%, transparent);
  --ease: cubic-bezier(.2,.8,.2,1);
  --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;   /* 사장님 결정(2026-12-06): 모든 사이트 밝은 화면만 */
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; scroll-behavior: smooth; }
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;
}
::selection { background: var(--accent-soft); color: var(--text); }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .15s, text-decoration-thickness .15s; }
a:hover { text-decoration-thickness: 2px; }
img, svg { max-width: 100%; }
h1, h2, h3 { letter-spacing: -0.015em; }
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 {
  position: sticky; top: 0; z-index: 20;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(1.4) blur(10px); backdrop-filter: saturate(1.4) blur(10px);
  border-top: var(--header-top) solid var(--accent);
  border-bottom: 1px solid var(--border);
}
.site-header .inner { max-width: 880px; margin: 0 auto; padding: 10px 20px; display: flex; flex-wrap: wrap; gap: 6px 20px; align-items: center; justify-content: space-between; }
.brand { display: inline-block; font-weight: var(--head-weight); font-size: 1.08rem; color: var(--text); text-decoration: none; }
.brand::before { content: ""; display: inline-block; vertical-align: -7px; margin-right: 8px; width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft) var(--hero-icon) center / 18px no-repeat; transition: transform .25s var(--ease); }
.brand:hover::before { transform: rotate(-8deg) scale(1.08); }
.brand span { color: var(--accent); }
.site-nav { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: .95rem; }
.site-nav a { position: relative; color: var(--muted); text-decoration: none; padding: 2px 0; transition: color .15s; }
.site-nav a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--accent); }
.site-nav a:hover::after, .site-nav a[aria-current="page"]::after { transform: scaleX(1); }
.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); }
.site-footer a:hover { color: var(--accent); }

/* 본문 */
.container { max-width: 880px; margin: 0 auto; padding: 20px; }
/* 첫 화면 띠: 화면 폭 전체, 사이트 색 그라데이션 + 무늬 + 아이콘 */
.hero {
  position: relative;
  margin: -20px calc(50% - 50vw) 12px;
  padding: 36px max(20px, calc(50vw - 420px)) 30px;
  background: var(--hero-pattern), linear-gradient(135deg, var(--hero-from), var(--hero-to));
  border-bottom: 1px solid var(--border);
}
.hero::before {
  content: ""; display: block; width: 58px; height: 58px; margin-bottom: 12px;
  border-radius: calc(var(--radius) + 2px);
  background: var(--surface) var(--hero-icon) center / 34px no-repeat;
  box-shadow: var(--shadow);
  animation: pop .7s var(--ease) both .1s;
}
.hero h1 { font-size: clamp(1.75rem, 4.6vw, 2.5rem); font-weight: var(--head-weight); line-height: 1.25; margin: 0 0 10px; }
.hero .lead { color: var(--text-soft); max-width: 46em; }
.hero > * { animation: rise .55s var(--ease) both; }
.hero > :nth-child(2) { animation-delay: .06s; }
.hero > :nth-child(3) { animation-delay: .12s; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 6px 8px; margin: 12px 0 0; padding: 0; list-style: none; font-size: .85rem; }
.hero-meta li { background: rgba(255,255,255,.75); border: 1px solid var(--border); border-radius: 999px; padding: 2px 10px; color: var(--text-soft); }
.hero-meta li:first-child { color: var(--good); font-weight: 600; }
.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;
  transition: box-shadow .25s var(--ease), border-color .25s;
}
.card:focus-within { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); box-shadow: var(--shadow-lift); }
.card h2 { margin-top: 0; }
/* 처음 열 때 위쪽 덩어리가 차례로 떠오름 */
.container > .card, .container > section, .container > aside, .container > .article { animation: rise .6s var(--ease) both; }
.container > :nth-child(2) { animation-delay: .08s; }
.container > :nth-child(3) { animation-delay: .16s; }
.container > :nth-child(4) { animation-delay: .24s; }
.container > :nth-child(n+5) { animation-delay: .3s; }
.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); }
/* 글 페이지: 위쪽을 사이트 색으로 옅게 물들임 */
body:has(main.article) { background: linear-gradient(180deg, var(--hero-from) 0, var(--hero-to) 200px, var(--bg) 460px) no-repeat, var(--bg); }
main.article { animation: none; }
main.article > h1 { font-size: clamp(1.6rem, 4vw, 2.1rem); font-weight: var(--head-weight); line-height: 1.3; padding-left: 14px; border-left: 5px solid var(--accent); animation: rise .5s var(--ease) both; }
main.article > h1::before { content: ""; display: block; width: 40px; height: 40px; margin: 0 0 10px; border-radius: 12px; background: var(--accent-soft) var(--hero-icon) center / 24px no-repeat; }
.article h2 { margin-top: 2em; font-size: 1.35rem; font-weight: var(--head-weight); }
.article h2::before { content: ""; display: inline-block; width: 10px; height: 10px; margin-right: 10px; border-radius: 3px; background: linear-gradient(135deg, var(--accent), var(--glow)); vertical-align: .12em; }
.article h3 { margin-top: 1.5em; font-size: 1.1rem; }
.article li { margin: .25em 0; }
.article li::marker { color: var(--accent); }
.toc { font-size: .95rem; }
details { border: 1px solid var(--border); border-radius: calc(var(--radius) - 4px); padding: 4px 14px; margin: 8px 0; background: var(--surface); }
details > summary { cursor: pointer; font-weight: 600; padding: 6px 0; list-style-position: inside; }
details[open] > summary ~ * { animation: rise .35s var(--ease) both; }

/* 폼 */
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"], input[type="search"], select, textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: min(var(--btn-radius), 12px);
  background: var(--surface);
  transition: border-color .15s, box-shadow .2s;
}
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); }
textarea { min-height: 160px; resize: vertical; line-height: 1.6; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: var(--accent); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 10px 18px;
  border-radius: var(--btn-radius); border: 1px solid var(--accent);
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: var(--on-accent);
  font-weight: 700; cursor: pointer; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15,23,42,.08), 0 4px 12px color-mix(in srgb, var(--accent) 22%, transparent);
  transition: transform .15s var(--ease), box-shadow .2s var(--ease), filter .15s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(15,23,42,.08), 0 10px 22px color-mix(in srgb, var(--accent) 30%, transparent); filter: saturate(1.1); }
.btn:active { transform: translateY(0) scale(.97); box-shadow: 0 1px 2px rgba(15,23,42,.1); }
.btn.secondary { background: var(--surface); color: var(--accent); box-shadow: none; }
.btn.secondary:hover { background: var(--accent-faint); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.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; background: var(--accent-faint); transition: border-color .15s, background .15s, transform .2s var(--ease); }
.dropzone.drag, .dropzone:hover { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.drag { transform: scale(1.01); }

/* 결과 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 12px 0; }
.stat {
  position: relative; overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); border-radius: min(var(--radius), 14px); padding: 14px 14px 12px;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.stat::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--glow)); }
.stat:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat .k { color: var(--muted); font-size: .85rem; }
.stat .v { font-size: 1.5rem; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
.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; }
tbody tr { transition: background .15s; }
tbody tr:hover { background: var(--accent-faint); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.meter { height: 12px; background: color-mix(in srgb, var(--accent) 10%, #eef0f3); border-radius: 99px; overflow: hidden; }
.meter > span { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--glow)); border-radius: 99px; transition: width .6s var(--ease); }

/* 여러 사이트가 같이 쓰는 도구 화면 조각 (2026-12-06, 사이트별 site.css에서 올림) */
.row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.big { margin: 12px 0; }
.big .v { font-size: 2.2rem; font-weight: 800; line-height: 1.2; color: var(--accent); font-variant-numeric: tabular-nums; }
.small-v, .stat .v.small-v { font-size: 1.15rem; }
tr.past td { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 결과 숫자가 바뀌면 톡 튐(assets/motion.mjs가 .bump를 붙임) */
.bump { animation: bump .45s var(--ease); }

/* 광고 자리: 실제 광고 코드는 승인 뒤에만 넣는다. 본문·버튼과 헷갈리지 않게 '광고' 표시를 붙이고 간격을 둔다. */
.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; background: rgba(255,255,255,.5); }
.ad-slot::before { content: "광고"; }
.ad-slot.live::before { content: none; }

@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes pop { 0% { opacity: 0; transform: scale(.6) rotate(-10deg); } 70% { transform: scale(1.06) rotate(2deg); } 100% { opacity: 1; transform: none; } }
@keyframes bump { 0% { transform: scale(1); } 35% { transform: scale(1.08); color: var(--accent); } 100% { transform: scale(1); } }
.stat .v, .big .v { display: inline-block; transform-origin: left center; }

@media (max-width: 640px) {
  /* 메뉴는 한 줄로, 옆으로 밀어서 봄(고정 머리말이 화면을 덜 가리게) */
  .site-nav { flex-wrap: nowrap; width: 100%; overflow-x: auto; white-space: nowrap; scrollbar-width: none; gap: 14px; padding-bottom: 2px; }
  .site-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 480px) {
  .container { padding: 14px; }
  .hero { margin-top: -14px; padding: 26px 16px 22px; }
  .card { padding: 16px; }
  .stat .v { font-size: 1.3rem; }
}
/* 움직임 줄이기를 켠 사람에게는 움직임을 모두 끈다 */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .site-header, .site-footer, .ad-slot, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
  .hero { margin: 0; padding: 0; background: none; border: 0; }
  .hero::before { display: none; }
}
