/* ══════════════════════════════════════════════════════════════
   styles.css — SQLD 학습 도우미 전체 스타일
   ══════════════════════════════════════════════════════════════ */

/* ── CSS 변수 (색상/공통 값) ── */
:root {
  --bg: #0c0f1a;
  --surface: #161a2b;
  --surface2: #1e2340;
  --border: #2a3055;
  --accent: #0d9488;
  --accent2: #0ea5e9;
  --correct: #22c55e;
  --wrong: #ef4444;
  --warn: #f59e0b;
  --text: #e8eaf6;
  --text2: #9ca3c4;
  --radius: 14px;
}

/* ── 리셋 & 기본 ── */
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
  font-family: 'Pretendard', -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── 헤더 ── */
.header {
  background: linear-gradient(135deg, var(--surface), var(--surface2));
  border-bottom: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header h1 {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: -.02em;
}
.header p { font-size: .78rem; color: var(--text2); margin-top: 2px; }

/* ── 탭 네비게이션 ── */
.tab-nav {
  display: flex;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
}
.tab-btn {
  flex: 1;
  min-width: 80px;
  padding: 14px 6px;
  background: none;
  border: none;
  color: var(--text2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  position: relative;
  transition: color .2s;
  font-family: inherit;
}
.tab-btn.active { color: var(--accent); }
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 20%;
  right: 20%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 3px 3px 0 0;
}
.tab-btn span { display: block; font-size: 1.1rem; margin-bottom: 2px; }

/* ── 컨텐츠 컨테이너 & 패널 ── */
.container { max-width: 680px; margin: 0 auto; padding: 20px 16px 100px; }
.panel { display: none; }
.panel.active { display: block; }

/* ── 점수/진행 바 ── */
.score-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}
.score-bar .label { font-size: .8rem; color: var(--text2); }
.score-bar .value { font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.score-bar .sub { font-size: .75rem; color: var(--text2); margin-top: 2px; }
.progress-wrap {
  background: var(--surface);
  border-radius: 8px;
  height: 6px;
  margin-bottom: 20px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
  border-radius: 8px;
  transition: width .4s ease;
}

/* ── 퀴즈 카드 ── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 20px;
  margin-bottom: 16px;
  animation: fadeUp .35s ease;
}
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 카드 태그 ── */
.card-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.tag-fill { background: var(--accent); color: #fff; }
.tag-ox { background: var(--accent2); color: #fff; }
.tag-exam { background: var(--warn); color: #1a1a1a; }

/* ── 괄호넣기 입력 ── */
.card-q {
  font-size: .95rem;
  font-weight: 600;
  line-height: 1.65;
  margin-bottom: 16px;
  word-break: keep-all;
}
.blank-input {
  display: inline-block;
  border: 2px dashed var(--border);
  border-radius: 8px;
  padding: 4px 12px;
  min-width: 120px;
  font-size: .9rem;
  background: var(--surface2);
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: border-color .2s;
}
.blank-input:focus { border-color: var(--accent); }
.blank-input.correct { border-color: var(--correct); background: rgba(34,197,94,.1); }
.blank-input.wrong { border-color: var(--wrong); background: rgba(239,68,68,.1); }

/* ── OX 버튼 ── */
.ox-group { display: flex; gap: 12px; }
.ox-btn {
  flex: 1;
  padding: 16px;
  border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 1.5rem;
  font-weight: 800;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}
.ox-btn:hover { border-color: var(--accent); transform: scale(1.02); }
.ox-btn.selected-correct { border-color: var(--correct); background: rgba(34,197,94,.15); color: var(--correct); }
.ox-btn.selected-wrong { border-color: var(--wrong); background: rgba(239,68,68,.15); color: var(--wrong); }
.ox-btn.show-answer { border-color: var(--correct); background: rgba(34,197,94,.08); }

/* ── 객관식 선택지 ── */
.choice-list { display: flex; flex-direction: column; gap: 8px; }
.choice-btn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .85rem;
  cursor: pointer;
  text-align: left;
  transition: all .2s;
  font-family: inherit;
  line-height: 1.5;
  word-break: keep-all;
}
.choice-btn:hover { border-color: var(--accent); }
.choice-btn .num {
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .75rem;
  font-weight: 700;
}
.choice-btn.selected-correct { border-color: var(--correct); background: rgba(34,197,94,.12); }
.choice-btn.selected-correct .num { background: var(--correct); color: #fff; }
.choice-btn.selected-wrong { border-color: var(--wrong); background: rgba(239,68,68,.12); }
.choice-btn.selected-wrong .num { background: var(--wrong); color: #fff; }
.choice-btn.show-answer { border-color: var(--correct); }
.choice-btn.show-answer .num { background: var(--correct); color: #fff; }

/* ── 해설 영역 ── */
.explanation {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(13,148,136,.08);
  border-left: 3px solid var(--accent);
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.6;
  display: none;
  word-break: keep-all;
}
.explanation.show { display: block; }

/* ── 버튼 공통 ── */
.btn-row { display: flex; gap: 10px; margin-top: 16px; }
.btn {
  flex: 1;
  padding: 13px;
  border-radius: 10px;
  border: none;
  font-size: .85rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: all .15s;
}
.btn-primary {
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  color: #fff;
}
.btn-primary:hover { opacity: .9; transform: translateY(-1px); }
.btn-secondary {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-secondary:hover { border-color: var(--accent); }

/* ── 결과 모달 ── */
.result-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.result-overlay.show { display: flex; }
.result-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 36px 28px;
  text-align: center;
  max-width: 380px;
  width: 100%;
  animation: fadeUp .3s ease;
}
.result-card .emoji { font-size: 3rem; margin-bottom: 12px; }
.result-card h2 { font-size: 1.3rem; margin-bottom: 8px; }
.result-card .score-big {
  font-size: 2.8rem;
  font-weight: 900;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 12px 0;
}
.result-card p { color: var(--text2); font-size: .85rem; margin-bottom: 20px; }

/* ── 개념 정리 ── */
.concept-section { margin-top: 32px; }
.concept-title {
  font-size: 1.1rem;
  font-weight: 800;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
}
.concept-group { margin-bottom: 20px; }
.concept-group-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 10px;
  padding: 6px 12px;
  background: rgba(13,148,136,.08);
  border-radius: 8px;
  display: inline-block;
}
.concept-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 10px;
}
.concept-card dt { font-size: .85rem; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.concept-card dd { font-size: .8rem; color: var(--text2); line-height: 1.55; margin-bottom: 8px; }
.concept-card dd:last-child { margin-bottom: 0; }
.concept-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .78rem;
  margin: 8px 0;
}
.concept-table th {
  background: var(--surface2);
  color: var(--accent);
  padding: 8px 10px;
  text-align: left;
  border: 1px solid var(--border);
  font-weight: 700;
}
.concept-table td { padding: 8px 10px; border: 1px solid var(--border); color: var(--text2); line-height: 1.4; }
.toggle-concepts {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  margin-top: 24px;
  transition: all .2s;
}
.toggle-concepts:hover { border-color: var(--accent); }
.concepts-wrap { display: none; }
.concepts-wrap.show { display: block; }

/* ── 관리자 섹션 ── */
.admin-section { margin-bottom: 28px; }
.admin-section-title {
  font-size: .95rem;
  font-weight: 800;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.admin-tabs { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
.admin-tab {
  padding: 8px 16px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text2);
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all .2s;
}
.admin-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ── 폼 요소 ── */
.form-group { margin-bottom: 14px; }
.form-label { display: block; font-size: .78rem; font-weight: 700; color: var(--text2); margin-bottom: 5px; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 11px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .85rem;
  font-family: inherit;
  outline: none;
  transition: border-color .2s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
.form-textarea { min-height: 70px; resize: vertical; }
.form-select { appearance: none; cursor: pointer; }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }
.form-hint { font-size: .72rem; color: var(--text2); margin-top: 3px; opacity: .7; }
.radio-group { display: flex; gap: 12px; margin-top: 4px; }
.radio-label { display: flex; align-items: center; gap: 6px; font-size: .82rem; color: var(--text2); cursor: pointer; }
.radio-label input { accent-color: var(--accent); }

/* ── 관리자 목록 아이템 ── */
.item-list { margin-top: 16px; }
.item-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color .3s, box-shadow .3s;
}
.item-card .item-body { flex: 1; min-width: 0; }
.item-card .item-q { font-size: .82rem; font-weight: 600; line-height: 1.5; word-break: break-word; }
.item-card .item-meta { font-size: .7rem; color: var(--text2); margin-top: 4px; }
.item-card .item-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ── 저장 후 하이라이트 애니메이션 ── */
@keyframes highlightPulse {
  0%, 100% { border-color: var(--border); box-shadow: none; }
  50% { border-color: var(--correct); box-shadow: 0 0 0 3px rgba(34,197,94,.2); }
}
.item-highlight { animation: highlightPulse 0.8s ease 2; }

/* ── 아이콘 버튼 ── */
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: all .15s;
  font-family: inherit;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.danger:hover { border-color: var(--wrong); color: var(--wrong); }
.pub-toggle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  transition: all .15s;
}
.pub-toggle.is-pub { border-color: var(--correct); background: rgba(34,197,94,.12); }
.pub-toggle:hover { transform: scale(1.1); }

/* ── 뱃지 ── */
.badge {
  display: inline-block;
  font-size: .65rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  margin-right: 6px;
}
.badge-fill { background: var(--accent); color: #fff; }
.badge-ox { background: var(--accent2); color: #fff; }
.badge-exam { background: var(--warn); color: #1a1a1a; }
.badge-concept { background: var(--correct); color: #fff; }
.badge-user { background: #e74694; color: #fff; }
.tag-user {
  background: #e74694;
  color: #fff;
  font-size: .6rem;
  padding: 2px 7px;
  border-radius: 10px;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: 700;
}

/* ── 이미지 업로드 ── */
.img-upload-buttons {
  display: flex;
  gap: 8px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.img-upload-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color .2s;
}
.img-upload-btn:hover { border-color: var(--accent); }
.img-preview { margin-top: 10px; position: relative; display: inline-block; max-width: 100%; }
.img-preview img { max-width: 100%; max-height: 200px; border-radius: 8px; border: 1px solid var(--border); }
.img-preview .img-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--wrong);
  color: #fff;
  border: none;
  font-size: .75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}
.quiz-img { max-width: 100%; border-radius: 10px; margin-bottom: 14px; border: 1px solid var(--border); }
.item-thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; border: 1px solid var(--border); flex-shrink: 0; }

/* ── 빈 상태 & 토스트 ── */
.empty-state { text-align: center; padding: 40px 20px; color: var(--text2); font-size: .85rem; }
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--correct);
  color: #fff;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: .82rem;
  font-weight: 700;
  z-index: 300;
  animation: fadeUp .3s ease;
  font-family: inherit;
}

/* ── 통계 그리드 ── */
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 20px; }
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  text-align: center;
}
.stat-card .stat-num { font-size: 1.6rem; font-weight: 900; color: var(--accent); }
.stat-card .stat-label { font-size: .72rem; color: var(--text2); margin-top: 2px; }

/* ── 로그인 화면 ── */
.login-overlay {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.login-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 28px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  animation: fadeUp .4s ease;
}
.login-card h2 {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent2));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  margin-bottom: 4px;
}
.login-card .login-sub { font-size: .78rem; color: var(--text2); margin-bottom: 24px; }
.login-grid { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 16px; }
.login-btn {
  padding: 14px 20px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
  display: flex;
  align-items: center;
  gap: 10px;
}
.login-btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.login-btn .login-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  font-weight: 800;
  flex-shrink: 0;
}
.login-btn .login-name { text-align: left; }
.login-btn .login-name small { display: block; font-size: .68rem; color: var(--text2); font-weight: 400; margin-top: 1px; }

/* ── 사용자 뱃지 (헤더) ── */
.user-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  transition: all .15s;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
}
.user-badge:hover { border-color: var(--accent); }
.user-badge .ub-dot { width: 8px; height: 8px; border-radius: 50%; }

/* ── 실시간 동기화 상태 표시 ── */
.sync-status {
  font-size: .65rem;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 700;
  margin-left: 6px;
}
.sync-status.online { background: rgba(34,197,94,.15); color: var(--correct); }
.sync-status.offline { background: rgba(156,163,196,.1); color: var(--text2); }

/* ── 퀴즈 시작 화면 ── */
.quiz-start-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 28px 20px;
  text-align: center;
}
.quiz-start-title {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 20px;
}
.quiz-start-meta {
  font-size: .8rem;
  color: var(--text2);
  margin: 14px 0 4px;
}
.quiz-start-btn {
  width: 100%;
  margin-top: 16px;
  font-size: 1rem;
  padding: 14px;
}

/* ── 필터 섹션 ── */
.filter-section { margin-bottom: 14px; text-align: left; }
.filter-section-label {
  font-size: .68rem;
  font-weight: 700;
  color: var(--text2);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .06em;
}

/* ── 필터 토글 (2×2 → 1×4) ── */
.filter-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
@media (min-width: 480px) {
  .filter-toggle { grid-template-columns: repeat(5, 1fr); }
}
.filter-btn {
  padding: 10px 6px;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-family: inherit;
}
.filter-btn.active {
  border-color: var(--accent);
  background: rgba(13,148,136,.1);
  color: var(--accent);
}
.filter-count {
  font-size: .75rem;
  font-weight: 800;
  opacity: .8;
}

/* ── 카테고리 / 수량 칩 ── */
.category-chips, .count-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  padding: 5px 13px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--surface2);
  color: var(--text2);
  font-size: .76rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
  font-family: inherit;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active {
  border-color: var(--accent);
  background: rgba(13,148,136,.15);
  color: var(--accent);
}
.chip-sub {
  font-size: .66rem;
  opacity: .7;
  margin-left: 3px;
}

/* ── 카드 상단 행 (카테고리 태그 + 별 버튼) ── */
.card-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.card-top-row > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
}
.card-top-row .card-tag { margin-bottom: 0; }

/* ── 별 즐겨찾기 버튼 ── */
.star-btn {
  background: none;
  border: none;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform .15s;
  line-height: 1;
  flex-shrink: 0;
  color: var(--text2);
}
.star-btn:hover { transform: scale(1.25); }
.star-btn.starred { color: #f59e0b; }

/* ── 숨기기 버튼 ── */
.hide-btn {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 8px;
  transition: transform .15s, opacity .15s;
  line-height: 1;
  flex-shrink: 0;
  color: var(--text2);
  opacity: 0.5;
}
.hide-btn:hover { transform: scale(1.2); opacity: 1; }
.hide-btn.is-hidden { opacity: 1; color: var(--accent); }

/* ── 퀴즈 중 툴바 ── */
.quiz-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  padding: 0 2px;
}
.quiz-toolbar-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 5px 12px;
  font-size: .75rem;
  color: var(--text2);
  cursor: pointer;
  transition: all .15s;
}
.quiz-toolbar-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.filter-badge {
  font-size: .72rem;
  color: var(--text2);
  background: var(--surface2);
  border-radius: 8px;
  padding: 4px 10px;
}

/* ── 필터 섹션 힌트 ── */
.filter-section-hint {
  font-size: .6rem;
  font-weight: 400;
  color: var(--text2);
  opacity: .7;
  margin-left: 4px;
  text-transform: none;
  letter-spacing: 0;
}

/* ── 문제수 직접 입력 ── */
.count-input {
  width: 80px;
  padding: 4px 10px;
  border-radius: 20px;
  border: 1.5px dashed var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: .76rem;
  font-family: inherit;
  outline: none;
  transition: border-color .15s;
  -moz-appearance: textfield;
}
.count-input::-webkit-outer-spin-button,
.count-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.count-input:focus { border-color: var(--accent); border-style: solid; }
.count-input::placeholder { color: var(--text2); opacity: .7; }

/* ── 출제빈도 배지 ── */
.freq-badge {
  display: inline-block;
  font-size: .6rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-left: 4px;
  letter-spacing: .02em;
}
.freq-1 { background: rgba(239,68,68,.15); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.freq-2 { background: rgba(245,158,11,.12); color: #f59e0b; border: 1px solid rgba(245,158,11,.3); }
.freq-3 { background: rgba(156,163,196,.1); color: var(--text2); border: 1px solid var(--border); }

/* 시작화면 빈도 칩 강조 */
.freq-chip-1.active { border-color: #ef4444; background: rgba(239,68,68,.12); color: #ef4444; }
.freq-chip-2.active { border-color: #f59e0b; background: rgba(245,158,11,.1); color: #f59e0b; }

/* ── 반응형 ── */
@media (max-width: 480px) {
  .container { padding: 14px 12px 80px; }
  .card { padding: 18px 16px; }
  .card-q { font-size: .9rem; }
  .choice-btn { font-size: .82rem; padding: 12px 14px; }
  .header h1 { font-size: 1.1rem; }
  .form-row { flex-direction: column; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .img-upload-buttons { flex-direction: column; }
}

/* ── 토글 스위치 ── */
.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px;
  transition: background .2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  left: 3px; top: 3px;
  background: #fff; border-radius: 50%;
  transition: transform .2s;
}
.toggle-switch input:checked + .toggle-slider { background: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); }

/* ── 위험 버튼 ── */
.btn-danger {
  background: #ef4444;
  color: #fff;
  border: none;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s;
  font-family: inherit;
}
.btn-danger:hover { background: #dc2626; }
