@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;600&family=Noto+Sans+KR:wght@400;500;700&display=swap');

:root {
  --bg: #0f0f0f;
  --surface: #1a1a1a;
  --surface2: #222;
  --border: #2e2e2e;
  --text: #e8e8e0;
  --muted: #888;
  --accent1: #7ee8a2;
  --accent2: #f9c74f;
  --accent3: #90e0ef;
  --accent4: #f4a261;
  --accent5: #c77dff;
  --mono: 'IBM Plex Mono', monospace;
  --sans: 'Noto Sans KR', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.6;
  padding: 24px 20px;
}

/* 헤더 */
header {
  padding-left: 14px;
  margin-bottom: 28px;
}

header h1 {
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.5px;
}

header p {
  color: var(--muted);
  font-size: 11px;
  font-family: var(--mono);
  margin-top: 4px;
}

/* 그리드 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

/* 카드 */
.card {
  background: var(--surface);
  border: 0.5px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  break-inside: avoid;
}

.card.wide { grid-column: 1 / -1; }

.card-title {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 0.5px solid var(--border);
}

.card-title.green  { color: var(--accent1); }
.card-title.amber  { color: var(--accent2); }
.card-title.cyan   { color: var(--accent3); }
.card-title.orange { color: var(--accent4); }
.card-title.purple { color: var(--accent5); }

/* 테이블 */
table { width: 100%; border-collapse: collapse; font-size: 12px; }

th {
  color: var(--muted);
  font-weight: 500;
  text-align: left;
  padding: 5px 8px;
  border-bottom: 0.5px solid var(--border);
  font-size: 11px;
}

td {
  padding: 5px 8px;
  border-bottom: 0.5px solid #1e1e1e;
  vertical-align: top;
}

tr:last-child td { border-bottom: none; }

/* 태그 */
.tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px;
  font-weight: 600;
}

.tag.g { background: #1a3a25; color: var(--accent1); }
.tag.a { background: #3a2e10; color: var(--accent2); }
.tag.c { background: #0e2e38; color: var(--accent3); }
.tag.o { background: #3a2010; color: var(--accent4); }
.tag.p { background: #2a1a40; color: var(--accent5); }

/* 코드 */
code {
  font-family: var(--mono);
  font-size: 11px;
  background: var(--surface2);
  padding: 1px 5px;
  border-radius: 3px;
  color: var(--accent3);
}

/* 수식 블록 */
.formula {
  background: var(--surface2);
  border-left: 2px solid var(--accent2);
  padding: 8px 12px;
  border-radius: 0 4px 4px 0;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--accent2);
  margin: 8px 0;
}

/* 노트 */
.note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  padding-left: 8px;
  border-left: 2px solid var(--border);
}

/* 행 */
.row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 5px 0;
  border-bottom: 0.5px solid #1e1e1e;
  font-size: 12px;
  gap: 8px;
}

.row:last-child { border-bottom: none; }
.row .key { color: var(--muted); min-width: 100px; font-size: 11px; }
.row .val { text-align: right; color: var(--text); }

/* 유틸 */
.highlight { color: var(--accent1); font-weight: 500; }
.dim { color: var(--muted); }

/* 2컬럼 레이아웃 */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* 미니 카드 */
.mini-card {
  background: var(--surface2);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 12px;
}

.mini-card .mc-title {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  margin-bottom: 4px;
}

/* 스텝 리스트 */
.steps { counter-reset: step; list-style: none; }

.steps li {
  counter-increment: step;
  display: flex;
  gap: 10px;
  padding: 5px 0;
  font-size: 12px;
  border-bottom: 0.5px solid #1e1e1e;
  align-items: flex-start;
}

.steps li:last-child { border-bottom: none; }

.steps li::before {
  content: counter(step);
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

/* 푸터 */
footer {
  margin-top: 24px;
  text-align: center;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--border);
}

/* 자세히 보기 버튼 공통 */
.detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--mono);
  font-size: 12px;
  background: var(--surface);
  padding: 10px 20px;
  border-radius: 8px;
  text-decoration: none;
  margin-top: 20px;
  border: 0.5px solid;
}
