*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.6; font-size: 15px; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 헤더 */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 30; }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 56px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 800; font-size: 19px; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 24px; height: 24px; border-radius: 6px; background: var(--primary); position: relative; }
.logo-mark::after { content: ''; position: absolute; left: 5px; top: 11px; width: 15px; height: 2px; background: #fff; transform: rotate(-42deg); }
.header-nav { display: flex; align-items: center; gap: 18px; }
.header-nav > a { color: var(--text-2); font-weight: 700; }
.theme-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.theme-switch button { background: transparent; border: 0; padding: 5px 12px; font-size: 13px; cursor: pointer; color: var(--text-2); }
.theme-switch button[aria-pressed='true'] { background: var(--primary); color: var(--primary-ink); font-weight: 700; }

/* 목록 화면 */
.list-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 24px; padding: 22px 0 40px; align-items: start; }
.filter-toggle { display: none; }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 14px 14px; position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow: auto; }
.f-group { border-bottom: 1px solid var(--line); padding: 10px 0; }
.f-group:last-of-type { border-bottom: 0; }
.f-group > summary { font-weight: 800; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; padding: 2px 0; }
.f-group > summary::-webkit-details-marker { display: none; }
.f-group > summary::after { content: '▾'; color: var(--muted); }
.f-group[open] > summary::after { content: '▴'; }
.f-body { padding-top: 8px; }
.f-search { width: 100%; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); margin-bottom: 6px; }
.f-scroll { max-height: 230px; overflow: auto; }
.f-check { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; font-size: 14px; }
.f-check .n { margin-left: auto; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.f-range { display: flex; align-items: center; gap: 6px; }
.f-range input[type='number'] { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.f-unit { display: flex; gap: 14px; margin-bottom: 6px; }
.f-sort select { width: 100%; padding: 7px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.f-reset { width: 100%; margin-top: 10px; padding: 8px; border: 1px solid var(--line); background: transparent; border-radius: 6px; cursor: pointer; color: var(--text-2); }
.f-reset:hover { background: var(--hover); }

.toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 8px; }
.search { flex: 1 1 260px; max-width: 420px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.toolbar-right { display: flex; gap: 10px; align-items: center; }
.size-select { font-size: 13px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.size-select select { padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); }
.col-picker { position: relative; }
.col-picker > button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); cursor: pointer; font-weight: 700; }
.col-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; box-shadow: 0 8px 24px rgba(0, 0, 0, .14); min-width: 190px; }
.col-menu[hidden] { display: none; }
.result-count { margin: 4px 0 8px; color: var(--muted); font-size: 13px; }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.rod-table, .model-table, .cmp-table, .spec-table { width: 100%; border-collapse: collapse; }
.rod-table th, .rod-table td, .model-table th, .model-table td { padding: 9px 12px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); font-size: 14px; }
.rod-table thead th, .model-table thead th { background: var(--surface-2); color: var(--text-2); font-size: 12px; letter-spacing: .03em; text-transform: uppercase; }
.rod-table tbody tr:hover, .model-table tbody tr:hover { background: var(--hover); }
.rod-table td a { color: var(--text); font-weight: 700; }
.rod-table td a:hover { color: var(--primary); }
.rod-table .c-check { width: 38px; padding-right: 0; }
.rod-table input[type='checkbox'] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }
.rod-table input[type='checkbox']:disabled { cursor: not-allowed; opacity: .4; }
.rod-table tr.is-selected { background: var(--hover); }
.empty-row td { text-align: center; color: var(--muted); padding: 40px; white-space: normal; }

.pager { display: flex; gap: 4px; flex-wrap: wrap; justify-content: center; margin: 18px 0 8px; }
.pager button { min-width: 36px; padding: 6px 10px; border: 1px solid var(--line); background: var(--surface); border-radius: 6px; cursor: pointer; }
.pager button[aria-current='page'] { background: var(--primary); color: var(--primary-ink); border-color: var(--primary); font-weight: 800; }
.pager button:disabled { opacity: .45; cursor: default; }
.compare-bar { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 10px; color: var(--text-2); font-size: 14px; }
.compare-bar button, .cmp-close button { padding: 9px 22px; border: 0; border-radius: 8px; background: var(--primary); color: var(--primary-ink); font-weight: 800; cursor: pointer; }
.compare-bar button:disabled { opacity: .4; cursor: not-allowed; }

/* 상세 */
.back { margin: 18px 0 6px; font-size: 14px; }
.detail { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; padding: 14px 0 10px; align-items: start; }
.d-brand { margin: 0; font-size: 20px; color: var(--text-2); font-weight: 700; }
.d-series { margin: 2px 0 0; font-size: 26px; font-weight: 700; }
.d-model { margin: 0; font-size: 44px; font-weight: 800; line-height: 1.15; letter-spacing: -.01em; word-break: break-word; }
.d-summary { margin: 10px 0 0; font-size: 17px; color: var(--text-2); }
.d-desc { margin: 16px 0 0; font-size: 14px; line-height: 1.8; color: var(--text-2); max-width: 70ch; }
.ad-slot { width: 300px; min-height: 250px; }
.spec-section, .series-section { margin-top: 32px; }
.spec-section h2, .series-section h2 { font-size: 18px; margin: 0 0 10px; }
.spec-table { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; max-width: 720px; }
.spec-table th, .spec-table td { text-align: left; padding: 10px 16px; border-bottom: 1px solid var(--line); font-size: 14.5px; }
.spec-table tr:last-child th, .spec-table tr:last-child td { border-bottom: 0; }
.spec-table th { width: 170px; color: var(--text-2); font-weight: 700; background: var(--surface-2); }
.series-list { display: flex; flex-direction: column; gap: 6px; }
.series-item { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; }
.series-item > summary { cursor: pointer; padding: 10px 14px; display: flex; gap: 8px; align-items: baseline; list-style: none; }
.series-item > summary::-webkit-details-marker { display: none; }
.series-item > summary::after { content: '▼'; margin-left: auto; font-size: 11px; color: var(--muted); }
.series-item[open] > summary::after { content: '▲'; }
.s-brand { color: var(--text-2); }
.s-sep { color: var(--muted); }
.s-name { font-weight: 800; }
.s-n { color: var(--muted); font-size: 12px; }
.series-models { padding: 0 8px 10px; overflow-x: auto; }
.model-table tr.is-current td { background: var(--hover); font-weight: 700; }
.loading { color: var(--muted); padding: 10px 6px; margin: 0; }

/* 비교 창 */
.popup .site-header, .popup .site-footer { display: none; }
.cmp-title { margin: 24px 0 14px; font-size: 22px; }
.cmp-title small { color: var(--muted); font-weight: 400; font-size: 14px; }
.cmp-table th, .cmp-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; font-size: 14.5px; }
.cmp-table thead th { background: var(--surface-2); }
.cmp-table tbody th { width: 140px; color: var(--text-2); background: var(--surface-2); }
.cmp-close { text-align: center; margin: 18px 0 30px; }
.notice { padding: 60px 0; text-align: center; }

/* 푸터 */
.site-footer { margin-top: 40px; border-top: 1px solid var(--line); background: var(--surface); padding: 22px 0 30px; font-size: 13px; color: var(--muted); }
.footer-nav { display: flex; gap: 18px; flex-wrap: wrap; margin-bottom: 10px; }
.footer-nav a { color: var(--text-2); }
.footer-note, .footer-copy { margin: 4px 0; }

/* 글 (소개·방침·블로그) */
.prose { max-width: 760px; padding: 28px 0; }
.prose h1 { font-size: 28px; margin: 0 0 14px; }
.prose h2 { font-size: 19px; margin: 26px 0 8px; }
.prose p, .prose li { color: var(--text-2); line-height: 1.85; }
.post-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.post-list li { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; }
.post-list a { font-weight: 800; color: var(--text); font-size: 17px; }
.post-list time { color: var(--muted); font-size: 12px; margin-left: 8px; }
.post-body img { max-width: 100%; height: auto; }

@media (max-width: 980px) {
  .list-layout { grid-template-columns: 1fr; }
  .filter-toggle { display: inline-block; padding: 9px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 800; cursor: pointer; justify-self: start; }
  .filters { display: none; position: static; max-height: none; }
  .filters.open { display: block; }
  .detail { grid-template-columns: 1fr; }
  .ad-slot { width: 100%; min-height: 0; }
  .d-model { font-size: 34px; }
}
@media (max-width: 520px) {
  .wrap { padding: 0 14px; }
  .toolbar-right { width: 100%; justify-content: space-between; }
  .spec-table th { width: 120px; }
}

[hidden] { display: none !important; }

.d-desc { white-space: pre-line; }
