/* 밝고 깔끔한 테마: 흰색/연회색 면, 반투명 상단바, 큰 제목, 알약형 버튼 */
:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-alt: #f5f5f7;
  --surface: #ffffff;
  --surface-2: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --border: #d2d2d7;
  --hairline: rgba(0, 0, 0, .08);
  --accent: #0071e3;
  --accent-hover: #0077ed;
  --accent-soft: #e8f2fd;
  --link: #0066cc;
  --good: #1d8a4e;
  --good-soft: #eaf6ee;
  --bad: #d1372d;
  --bad-soft: #fdeeed;
  /* 사이즈 시뮬레이터 등 여러 기기를 구분하는 색 */
  --c1: #0071e3;
  --c2: #f56300;
  --c3: #1d9a5b;
  --c4: #a445d6;
  --radius: 18px;
  --shadow: 0 2px 12px rgba(0, 0, 0, .06);
  --shadow-hover: 0 8px 28px rgba(0, 0, 0, .10);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Apple SD Gothic Neo", "Pretendard", "Malgun Gothic", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  letter-spacing: -.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
a.card:hover, a.btn:hover, .topbar a:hover { text-decoration: none; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.02em; font-weight: 700; }
h1 { font-size: 2.5rem; }
h2 { font-size: 1.3rem; }

/* 상단바: 반투명 + 블러 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: center; gap: 40px; flex-wrap: wrap;
  height: 48px; padding: 0 22px;
  background: rgba(255, 255, 255, .8);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
}
.logo { font-weight: 600; font-size: .95rem; color: var(--text); }
.topbar nav { display: flex; gap: 28px; }
.topbar nav a { color: var(--text); opacity: .8; font-size: .82rem; transition: opacity .2s; }
.topbar nav a:hover { opacity: 1; }
.topbar nav a.active { opacity: 1; font-weight: 600; }
.badge {
  display: inline-block; min-width: 16px; padding: 0 5px; border-radius: 8px;
  background: var(--accent); color: #fff; font-size: .68rem; line-height: 16px; text-align: center; vertical-align: 1px;
}

main { max-width: 1080px; margin: 0 auto; padding: 48px 22px 64px; min-height: 70vh; }
.footer {
  background: var(--bg-alt); color: var(--muted); font-size: .75rem; text-align: center;
  padding: 20px 22px; border-top: 1px solid var(--hairline);
}

/* 공통 컴포넌트 */
.card {
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
  border: 1px solid var(--hairline);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 18px; border-radius: 980px; border: 1px solid var(--accent);
  background: transparent; color: var(--accent); font: inherit; font-size: .9rem; cursor: pointer;
  transition: background .2s, color .2s;
}
.btn:hover { background: var(--accent-soft); }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-hover); }
.btn.small { padding: 4px 12px; font-size: .8rem; }
.btn.on { background: var(--accent); color: #fff; }
.muted { color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.spacer { flex: 1; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin: 64px 0 20px; }
.section-title h2 { font-size: 1.8rem; margin: 0; }
.page-head { margin-bottom: 32px; }
.page-head p { color: var(--muted); font-size: 1.1rem; margin: 0; }

input, select, textarea {
  font: inherit; font-size: .95rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 12px; padding: 10px 14px; width: 100%;
  transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(0, 113, 227, .15); }
input[type="range"] { padding: 0; border: none; accent-color: var(--accent); }
input[type="range"]:focus { box-shadow: none; }
input[type="checkbox"] { width: auto; accent-color: var(--accent); }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: 4px; }

/* 홈 */
.hero { text-align: center; padding: 40px 0 8px; }
.hero h1 { font-size: 3.5rem; letter-spacing: -.03em; margin-bottom: 12px; }
.hero p { color: var(--muted); font-size: 1.35rem; margin: 0 auto; max-width: 620px; }
.hero .row { justify-content: center; margin-top: 28px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.stat { text-align: center; background: var(--bg-alt); box-shadow: none; border: none; }
.stat .num { font-size: 2rem; font-weight: 700; letter-spacing: -.02em; }
.stat .lbl { color: var(--muted); font-size: .85rem; }

/* 카드 그리드 */
.toolbar { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 10px; margin-bottom: 28px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
.phone-card, .tool-card { color: var(--text); transition: transform .25s, box-shadow .25s; }
.phone-card:hover, .tool-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.phone-card { display: flex; flex-direction: column; gap: 12px; position: relative; }

/* 기기 사진 */
.phone-img { height: 180px; display: flex; align-items: center; justify-content: center; margin: -4px 0 4px; }
.phone-img img { max-height: 100%; max-width: 100%; object-fit: contain; }
.phone-img.empty-img { background: var(--bg-alt); border-radius: 12px; font-size: 2.4rem; opacity: .5; }
.phone-img.large { height: 420px; background: var(--bg-alt); border-radius: var(--radius); padding: 32px; margin: 0; }
.phone-img.small { height: 120px; justify-content: flex-start; margin-bottom: 8px; }
.detail-photo { position: sticky; top: 72px; }
.credit { font-size: .78rem; margin: 10px 4px 0; }
.status-badge {
  position: absolute; top: 16px; left: 16px; background: var(--accent); color: #fff;
  font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 980px;
}
.status-badge.inline { position: static; vertical-align: middle; font-size: .8rem; }
.phone-card .brand { font-size: .75rem; color: var(--muted); font-weight: 600; letter-spacing: .02em; }
.phone-card .model { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.phone-card .mini-specs { font-size: .85rem; color: var(--muted); margin: 0; padding: 0; list-style: none; line-height: 1.6; }
.phone-card .foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-weight: 600; }
.empty { text-align: center; color: var(--muted); padding: 60px 0; }
.tool-card { display: flex; gap: 16px; align-items: flex-start; }
.tool-card .icon { font-size: 2rem; line-height: 1; }
.tool-card .title { font-weight: 600; font-size: 1.05rem; }
.tool-card .desc { color: var(--muted); font-size: .9rem; }

/* 상세 */
.detail-head { display: flex; gap: 16px; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; margin-bottom: 32px; }
.detail-head h1 { margin-bottom: 4px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1.3fr; gap: 24px; align-items: start; }
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 4px; border-bottom: 1px solid var(--hairline); vertical-align: top; font-size: .95rem; }
.spec-table th { width: 34%; color: var(--muted); font-weight: 400; }
.spec-table tr.group td { padding-top: 22px; font-weight: 600; font-size: .8rem; color: var(--text); border-bottom: 1px solid var(--border); }
.summary { font-size: 1.05rem; margin-bottom: 18px; }
.proscons { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.proscons ul { margin: 0; padding-left: 18px; font-size: .92rem; }
.pros, .cons { border-radius: 14px; padding: 14px 16px; }
.pros { background: var(--good-soft); }
.cons { background: var(--bad-soft); }
.pros h3 { color: var(--good); font-size: .9rem; }
.cons h3 { color: var(--bad); font-size: .9rem; }
.sources { margin: 12px 0 0; padding-left: 18px; font-size: .85rem; }
.tag { display: inline-block; font-size: .78rem; padding: 3px 10px; border-radius: 980px; margin: 2px 4px 2px 0; }
.tag.good { background: var(--good-soft); color: var(--good); }
.tag.bad { background: var(--bad-soft); color: var(--bad); }

/* 비교 */
.compare-wrap { overflow-x: auto; padding: 8px 24px; }
.compare-table { border-collapse: collapse; min-width: 100%; }
.compare-table th, .compare-table td { padding: 12px; border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; min-width: 180px; font-size: .95rem; }
.compare-table thead td { border-bottom: 1px solid var(--border); }
.compare-table th:first-child { min-width: 100px; color: var(--muted); font-weight: 400; position: sticky; left: 0; background: var(--surface); }
.compare-table td.best { color: var(--good); font-weight: 600; }

/* 사이즈 시뮬레이터 */
.sim-layout { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: 24px; align-items: start; }
.sim-controls { display: flex; flex-direction: column; gap: 22px; background: var(--bg-alt); box-shadow: none; border: none; }
.sim-controls h2 { font-size: .95rem; margin-bottom: 10px; }
.pick-list { display: flex; flex-direction: column; gap: 2px; max-height: 300px; overflow-y: auto; }
.pick-list label { display: flex; gap: 8px; align-items: center; color: var(--text); font-size: .9rem; margin: 0; padding: 6px 8px; border-radius: 8px; cursor: pointer; }
.pick-list label:hover { background: var(--surface); }
.swatch { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.seg { display: flex; background: #e8e8ed; border-radius: 10px; padding: 2px; }
.seg button { flex: 1; border: none; background: transparent; color: var(--text); font: inherit; font-size: .85rem; padding: 6px; border-radius: 8px; cursor: pointer; }
.seg button.on { background: var(--surface); box-shadow: 0 1px 4px rgba(0, 0, 0, .12); font-weight: 600; }
.custom-row { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.custom-row input:first-child { grid-column: 1 / -1; }
.stage { overflow: auto; min-height: 420px; display: flex; align-items: flex-end; justify-content: center; padding: 24px; }
.stage svg { display: block; overflow: visible; }
.calib-card { margin: 16px auto; border: 2px dashed var(--accent); border-radius: 4%; display: flex; align-items: center; justify-content: center; color: var(--accent); font-size: .85rem; text-align: center; }
.dim-table { width: 100%; border-collapse: collapse; font-size: .9rem; margin-top: 20px; }
.dim-table th, .dim-table td { padding: 8px; border-bottom: 1px solid var(--hairline); text-align: right; }
.dim-table th { color: var(--muted); font-weight: 400; white-space: nowrap; }
.dim-table td { white-space: nowrap; }
.dim-table th:first-child, .dim-table td:first-child { text-align: left; }
.dim-table .diff { color: var(--muted); font-size: .8rem; }

.toast {
  position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
  background: rgba(29, 29, 31, .92); color: #fff; padding: 10px 20px; border-radius: 980px; font-size: .9rem; z-index: 100;
}

@media (max-width: 860px) {
  .sim-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  main { padding: 32px 16px 48px; }
  .topbar { justify-content: space-between; gap: 12px; padding: 0 16px; }
  .topbar nav { gap: 16px; }
  .toolbar { grid-template-columns: 1fr 1fr; }
  .toolbar input { grid-column: 1 / -1; }
  .detail-grid, .proscons { grid-template-columns: 1fr; }
  .detail-photo { position: static; }
  .phone-img.large { height: 300px; }
  h1 { font-size: 2rem; }
  .hero h1 { font-size: 2.4rem; }
  .hero p { font-size: 1.1rem; }
  .section-title { margin-top: 48px; }
  .section-title h2 { font-size: 1.4rem; }
}
