/* style.css — 보조배터리 기내반입 판정기 전체 스타일
   모바일 우선 · 라이트/다크 지원 · 외부 폰트 없음 */

:root {
  --bg: #f5f7fa;
  --surface: #ffffff;
  --surface-2: #f0f3f7;
  --text: #1a2230;
  --text-soft: #51607a;
  --border: #dde3ec;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --ok: #16a34a;
  --ok-bg: #e7f6ec;
  --warn: #d97706;
  --warn-bg: #fdf3e3;
  --no: #dc2626;
  --no-bg: #fdeaea;
  --info: #2563eb;
  --shadow: 0 1px 3px rgba(20, 30, 50, 0.08), 0 6px 24px rgba(20, 30, 50, 0.06);
  --radius: 14px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; color-scheme: light; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "Noto Sans KR", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

a { color: var(--brand); }
a:hover { color: var(--brand-dark); }

img { max-width: 100%; }

/* ---------- 레이아웃 ---------- */
.container {
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 0 18px;
}

/* ---------- 헤더 ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  flex-wrap: wrap;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.08rem;
  color: var(--text);
  text-decoration: none;
  letter-spacing: -0.01em;
}
.brand .logo { font-size: 1.3rem; }
.site-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.site-nav a {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 0.92rem;
  color: var(--text-soft);
  text-decoration: none;
}
.site-nav a:hover,
.site-nav a[aria-current="page"] {
  background: var(--surface-2);
  color: var(--text);
}

/* ---------- 히어로 ---------- */
.hero {
  padding: 26px 0 8px;
  text-align: center;
}
.hero h1 {
  font-size: 1.65rem;
  line-height: 1.35;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.hero p {
  margin: 0;
  color: var(--text-soft);
  font-size: 1rem;
}

/* ---------- 카드 / 도구 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 18px 0;
}

.tool { margin-top: 18px; }

.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }

.field label.field-label,
.field > label {
  display: block;
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 6px;
}
.field .hint {
  font-weight: 400;
  font-size: 0.82rem;
  color: var(--text-soft);
  margin-left: 4px;
}

input[type="number"],
input[type="text"],
select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  color: var(--text);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  appearance: none;
  -webkit-appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2351607a' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 480px) {
  .row { grid-template-columns: 1fr; }
}

/* 전압 빠른 선택 */
.presets {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.presets button {
  flex: 1 1 auto;
  min-width: 64px;
  padding: 8px 10px;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-soft);
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
}
.presets button:hover { border-color: var(--brand); color: var(--text); }
.presets button.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

/* 토글 */
.toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.toggle input { width: 18px; height: 18px; accent-color: var(--brand); }
.toggle span { font-size: 0.95rem; font-weight: 600; }

/* ---------- 결과 카드 ---------- */
.result {
  margin-top: 18px;
  padding: 18px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  background: var(--surface-2);
}
.result--empty { text-align: center; }
.result-hint { margin: 6px 0; color: var(--text-soft); }
.result--ok { border-color: var(--ok); background: var(--ok-bg); }
.result--approval { border-color: var(--warn); background: var(--warn-bg); }
.result--no { border-color: var(--no); background: var(--no-bg); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.05rem;
  color: #fff;
}
.badge-icon { font-size: 1.15rem; }
.badge--ok { background: var(--ok); }
.badge--approval { background: var(--warn); }
.badge--no { background: var(--no); }

.result-headline {
  font-size: 1.25rem;
  font-weight: 800;
  margin: 14px 0 4px;
  letter-spacing: -0.01em;
}

.result-meta {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 10px 0 14px;
  padding-bottom: 14px;
  border-bottom: 1px dashed var(--border);
}
.result-wh { font-size: 1.1rem; font-weight: 700; }
.result-wh-num { font-size: 1.9rem; }
.result-basis { color: var(--text-soft); font-size: 0.86rem; }

.result-list {
  list-style: none;
  padding: 0;
  margin: 0 0 14px;
}
.result-list li {
  position: relative;
  padding: 7px 0 7px 26px;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.result-list li:last-child { border-bottom: none; }
.result-list li::before {
  position: absolute;
  left: 0;
  top: 7px;
}
.li-ok::before { content: "✔"; color: var(--ok); }
.li-warn::before { content: "⚠"; color: var(--warn); }
.li-info::before { content: "ℹ"; color: var(--info); }
.result-list .warn { color: var(--no); font-weight: 700; }

.result-notes {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 0.92rem;
}
.result-notes p { margin: 6px 0 0; color: var(--text-soft); }
.result-source { font-size: 0.82rem; }
.result-disclaimer {
  font-size: 0.84rem;
  color: var(--text-soft);
  margin: 6px 0 0;
}

/* ---------- 광고 슬롯 ---------- */
.ad-slot {
  /* 애드센스 승인 전에는 숨깁니다. 승인 후 광고 코드를 넣고 display:none → flex 로 바꾸세요. */
  display: none;
  margin: 22px 0;
  padding: 14px;
  min-height: 90px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 10px;
  color: var(--text-soft);
  font-size: 0.8rem;
  background: var(--surface-2);
}

/* ---------- 본문 콘텐츠 ---------- */
.content { margin: 28px 0; }
.content h2 {
  font-size: 1.35rem;
  margin: 48px 0 14px;
  letter-spacing: -0.02em;
  scroll-margin-top: 70px;
}
.content h3 {
  font-size: 1.08rem;
  margin: 28px 0 8px;
}
.content p { margin: 0 0 12px; }
.content ul, .content ol { margin: 0 0 14px; padding-left: 22px; }
.content li { margin-bottom: 6px; }

.callout {
  border-left: 4px solid var(--brand);
  background: var(--surface);
  border-radius: 0 10px 10px 0;
  padding: 12px 16px;
  margin: 14px 0;
}
.callout.warn { border-left-color: var(--no); }

/* 표 */
.table-wrap { overflow-x: auto; margin: 14px 0; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
  min-width: 460px;
}
th, td {
  text-align: left;
  padding: 10px 12px;
  border: 1px solid var(--border);
  vertical-align: top;
}
thead th { background: var(--surface-2); font-weight: 700; }
tbody tr:nth-child(even) td { background: var(--surface); }
.tag {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.tag-ok { background: var(--ok-bg); color: var(--ok); }
.tag-warn { background: var(--warn-bg); color: var(--warn); }
.tag-no { background: var(--no-bg); color: var(--no); }

/* FAQ */
.faq details {
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 10px;
  background: var(--surface);
  overflow: hidden;
}
.faq summary {
  padding: 14px 16px;
  font-weight: 700;
  cursor: pointer;
  list-style: none;
  position: relative;
  padding-right: 40px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.3rem;
  color: var(--text-soft);
}
.faq details[open] summary::after { content: "−"; }
.faq .faq-body { padding: 0 16px 14px; color: var(--text-soft); }

/* ---------- 푸터 ---------- */
.site-footer {
  margin-top: 36px;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 24px 0 32px;
  font-size: 0.88rem;
}
.site-footer .footer-nav {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.site-footer .footer-nav a { color: var(--text-soft); text-decoration: none; }
.site-footer .footer-nav a:hover { color: var(--brand); text-decoration: underline; }
.site-footer .disclaimer { color: var(--text-soft); margin: 0; }

/* 보조 페이지 본문 */
.page { margin: 24px 0; }
.page h1 { font-size: 1.5rem; letter-spacing: -0.02em; margin: 0 0 8px; }
.page h2 { font-size: 1.18rem; margin: 40px 0 10px; scroll-margin-top: 70px; }
.page p { margin: 0 0 12px; }
.page ul, .page ol { margin: 0 0 16px; padding-left: 22px; }
.page li { margin-bottom: 6px; }
.page .updated { color: var(--text-soft); font-size: 0.85rem; }

.skip-link {
  position: absolute;
  left: -9999px;
}
.skip-link:focus {
  left: 12px;
  top: 12px;
  z-index: 100;
  background: var(--brand);
  color: #fff;
  padding: 8px 14px;
  border-radius: 8px;
}
