/* ═══ 마이크 테스트 — style.css ═══ */

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel2: #f8f9fc;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #4f46e5;
  --accent-soft: rgba(79,70,229,.10);
  --ok: #10b981;
  --warn: #f59e0b;
  --bad: #ef4444;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 16px rgba(0,0,0,.06);
}

* { box-sizing: border-box; }
body { margin-top: 70px; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif; }

.mic-app { max-width: 100%; padding: 0 0 60px; }

/* ── 헤더 ── */
.top { padding: 24px 0 20px; }
.brand { display: flex; align-items: center; gap: 16px; }
.brand h1 { margin: 0 0 4px; font-size: 26px; font-weight: 800; }
.brand .sub { margin: 0; color: var(--muted); font-size: 15px; }

/* ── 공통 패널 ── */
.mic-panel, .mic-tester, .mic-gear-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow);
}

/* ══ 메인 테스트 영역 ══ */
.mic-tester {
  padding: 24px;
  margin-bottom: 16px;
}

/* 파형 캔버스 */
.mic-viz-wrap {
  position: relative;
  width: 100%;
  height: 160px;
  background: #111827;
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 14px;
}
.waveform-canvas {
  width: 100%;
  height: 100%;
  display: block;
}
.mic-no-signal {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #6b7280;
}
.mic-idle-icon { font-size: 36px; opacity: .5; }
.mic-no-signal p { margin: 0; font-size: 13px; }

/* 볼륨 미터 */
.mic-meter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.mic-meter-label { font-size: 13px; color: var(--muted); font-weight: 600; white-space: nowrap; width: 30px; }
.mic-meter-bar {
  flex: 1;
  height: 10px;
  background: #e5e7eb;
  border-radius: 999px;
  overflow: hidden;
  position: relative;
}
.mic-meter-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #10b981, #f59e0b 60%, #ef4444 85%);
  border-radius: 999px;
  transition: width .05s linear;
}
.mic-db {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
  width: 60px;
  text-align: right;
}

/* 컨트롤 (시작버튼 + 상태) */
.mic-ctrl-row {
  display: flex;
  align-items: center;
  gap: 16px;
}
.mic-start-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
}
.mic-start-btn:hover { background: #4338ca; }
.mic-start-btn:active { transform: scale(.97); }
.mic-start-btn.running { background: #ef4444; }
.mic-start-btn.running:hover { background: #dc2626; }

.mic-status-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--muted);
  font-weight: 600;
}
.mic-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #d1d5db;
  flex-shrink: 0;
}
.mic-dot.active {
  background: var(--ok);
  box-shadow: 0 0 0 3px rgba(16,185,129,.25);
  animation: mic-pulse 1.2s ease-in-out infinite;
}
.mic-dot.error { background: var(--bad); }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16,185,129,.25); }
  50%       { box-shadow: 0 0 0 6px rgba(16,185,129,.10); }
}

/* ══ 기기전환 + 기술정보 2컬럼 ══ */
.mic-info-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 16px;
  margin-bottom: 16px;
}
.mic-panel { padding: 20px; }
.mic-panel-head { margin-bottom: 16px; }
.mic-panel-head h3 { margin: 0 0 4px; font-size: 17px; font-weight: 800; }
.mic-panel-head p  { margin: 0; font-size: 12px; color: var(--muted); }

/* 기기 목록 */
.device-list { margin-bottom: 14px; min-height: 60px; }
.no-device-msg { margin: 0; color: var(--muted); font-size: 14px; }
.device-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  font-size: 14px;
}
.device-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.device-item.selected { border-color: var(--accent); background: var(--accent-soft); }
.device-item input[type="radio"] { accent-color: var(--accent); flex-shrink: 0; }
.device-name { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mic-refresh-btn {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  transition: border-color .15s;
}
.mic-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }

/* 기술 정보 패널 */
.tech-placeholder {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 16px;
}
.tech-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-bottom: 16px;
}
.tech-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line);
}
.tech-table td:first-child { color: var(--muted); font-weight: 600; width: 120px; }
.tech-table td:last-child  { font-weight: 700; }
.tech-id { font-family: monospace; font-size: 11px; }

/* 추천 마이크 (기술정보 패널 내부) */
.rec-mics { border-top: 1px solid var(--line); padding-top: 14px; }
.rec-mics-title {
  font-size: 13px;
  font-weight: 700;
  color: #92400e;
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 12px;
}
.rec-mic-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rec-mic-item:last-child { border-bottom: none; }
.rec-mic-thumb {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.rec-mic-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rec-mic-emoji { font-size: 28px; width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.rec-mic-name { font-size: 13px; font-weight: 600; margin: 0 0 6px; line-height: 1.4; }
.rec-mic-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.rec-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--panel2);
  border: 1px solid var(--line);
  color: var(--muted);
}
.rec-tag--best { background: #fef3c7; border-color: #fde68a; color: #92400e; }
.rec-tag--rgb  { background: #ede9fe; border-color: #c4b5fd; color: #5b21b6; }
.rec-tag-text  { font-size: 11px; color: var(--muted); }

/* ══ 추천 장비 섹션 ══ */
.mic-gear-section {
  padding: 28px 24px;
  margin-bottom: 16px;
  text-align: center;
}
.mic-gear-section h2 { margin: 0 0 6px; font-size: 22px; font-weight: 800; }
.gear-sub { margin: 0 0 24px; font-size: 14px; color: var(--muted); }
.gear-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  text-align: left;
}
.gear-card {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel);
}
.gear-sponsored {
  position: absolute;
  top: 10px;
  right: 12px;
  font-size: 10px;
  font-weight: 600;
  color: var(--muted);
  background: var(--panel2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 6px;
}
.gear-img-wrap {
  width: 80px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--panel2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
}
.gear-img-wrap img { width: 100%; height: 100%; object-fit: cover; }
.gear-emoji { font-size: 36px; }
.gear-body { flex: 1; min-width: 0; padding-right: 48px; }
.gear-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.gear-shop-btn {
  display: inline-block;
  padding: 6px 14px;
  background: var(--accent-soft);
  color: var(--accent);
  border: 1px solid rgba(79,70,229,.25);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s;
}
.gear-shop-btn:hover { background: var(--accent); color: #fff; }

/* ══ 가이드 섹션 ══ */
.guide-section.mic-guide {
  background: rgba(246,248,255,.6);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 32px 36px;
}
.mic-guide-block { margin-bottom: 28px; }
.mic-guide-block:last-child { margin-bottom: 0; }
.mic-guide-block h2 { font-size: 20px; font-weight: 800; margin: 0 0 10px; }
.mic-guide-block h3 { font-size: 16px; font-weight: 700; margin: 20px 0 8px; }
.mic-guide-block p  { font-size: 14px; line-height: 1.7; color: #374151; margin: 0 0 12px; }
.mic-guide-sub { color: var(--muted) !important; font-size: 13px !important; }
.mic-steps {
  padding-left: 20px;
  margin: 0;
}
.mic-steps li {
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 8px;
}
.mic-steps li em { color: var(--accent); font-style: normal; }
.mic-terms {
  padding-left: 20px;
  margin: 0;
}
.mic-terms li {
  font-size: 14px;
  line-height: 1.7;
  color: #374151;
  margin-bottom: 10px;
}
.mic-guide-hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}

/* ── 반응형 ── */
@media (max-width: 768px) {
  .mic-info-row {
    grid-template-columns: 1fr;
  }
  .gear-grid {
    grid-template-columns: 1fr;
  }
  .guide-section.mic-guide {
    padding: 20px 16px;
  }
}
