@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.min.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Pretendard Variable', -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f0f2f5;
  color: #1a1a2e;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 24px;
}

/* ── 헤더 ── */
header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 40px;
}

header img { width: 44px; height: 44px; object-fit: contain; }
header h1 { font-size: 22px; font-weight: 700; }
header .subtitle { font-size: 13px; color: #6b7280; margin-top: 1px; }

/* ── 섹션 ── */
.section {
  margin-bottom: 40px;
}

.section-title {
  font-size: 15px;
  font-weight: 700;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
  padding-bottom: 8px;
  border-bottom: 1px solid #e5e7eb;
}

/* ── 3분류 카드 ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.cat-card {
  border-radius: 14px;
  padding: 24px;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.cat-card.nearby { background: linear-gradient(135deg, #4e79a7, #3a5f8a); }
.cat-card.remote { background: linear-gradient(135deg, #e15759, #c24345); }
.cat-card.other  { background: linear-gradient(135deg, #76b7b2, #5a9994); }

.cat-card .cat-label {
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.cat-card .cat-pct {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.1;
}

.cat-card .cat-detail {
  font-size: 12px;
  opacity: 0.8;
  margin-top: 8px;
  line-height: 1.5;
}

.cat-card .cat-change {
  font-size: 13px;
  margin-top: 6px;
  font-weight: 600;
}

/* ── 차트 카드 ── */
.charts-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 16px;
}

.charts-row.single {
  grid-template-columns: 1fr;
}

.chart-card {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.chart-card.wide {
  width: 100%;
}

.chart-card h3 {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
  margin-bottom: 14px;
}

.chart-wrapper {
  position: relative;
  width: 100%;
}

/* ── KPI ── */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.kpi-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.kpi-card .kpi-label {
  font-size: 12px;
  color: #9ca3af;
  margin-bottom: 2px;
  font-weight: 500;
}

.kpi-card .kpi-value {
  font-size: 28px;
  font-weight: 700;
  color: #1a1a2e;
}

.kpi-card .kpi-sub {
  font-size: 12px;
  color: #9ca3af;
  margin-top: 2px;
}

.kpi-change { font-size: 13px; font-weight: 600; }
.kpi-change.positive { color: #059669; }
.kpi-change.negative { color: #dc2626; }

/* ── 테이블 ── */
.table-card {
  background: #fff;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.data-table th,
.data-table td {
  padding: 9px 10px;
  text-align: right;
  border-bottom: 1px solid #f3f4f6;
  white-space: nowrap;
}

.data-table th {
  font-weight: 600;
  color: #9ca3af;
  font-size: 11px;
  position: sticky;
  top: 0;
  background: #fff;
}

.data-table th.group-nearby { color: #4e79a7; border-bottom: 2px solid #4e79a7; }
.data-table th.group-remote { color: #e15759; border-bottom: 2px solid #e15759; }
.data-table th.group-other  { color: #76b7b2; border-bottom: 2px solid #76b7b2; }

.data-table th:first-child,
.data-table td:first-child {
  text-align: left;
  font-weight: 600;
}

.data-table tr:hover td { background: #fafbfc; }

.data-table tr:last-child td {
  font-weight: 700;
  border-top: 2px solid #e5e7eb;
  border-bottom: none;
}

.data-table .sep {
  border-left: 2px solid #e5e7eb;
}

/* ── 푸터 ── */
footer {
  text-align: center;
  padding: 24px 0 8px;
  font-size: 11px;
  color: #c0c4cc;
}

/* ── 로딩 ── */
.loading {
  text-align: center;
  padding: 100px 20px;
  color: #9ca3af;
  font-size: 15px;
}

.loading .spinner {
  display: inline-block;
  width: 28px;
  height: 28px;
  border: 3px solid #e5e7eb;
  border-top-color: #4e79a7;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── 반응형 ── */
@media (max-width: 768px) {
  .category-grid { grid-template-columns: 1fr; }
  .charts-row { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr; }
  .cat-card .cat-pct { font-size: 32px; }
  .container { padding: 20px 14px; }
  header h1 { font-size: 18px; }
}
