/* ===== 在线调音器 ===== */
.tuner-card {
  background: #fff;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  padding: 24px;
  text-align: center;
}

/* --- 工具栏 --- */
.tuner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 16px;
  align-items: center;
  justify-content: center;
  margin-bottom: 8px;
}

.tuner-field {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--gray-600);
}

.tuner-field select {
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 8px;
  background: var(--gray-50);
  color: var(--gray-800);
  font-size: 0.9rem;
  cursor: pointer;
}

.tuner-field select:focus {
  outline: none;
  border-color: var(--primary);
}

.tuner-field[hidden] {
  display: none;
}

.tuner-btn {
  padding: 9px 26px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.15s;
}

.tuner-btn:hover {
  background: var(--primary-hover);
}

.tuner-btn.running {
  background: var(--gray-500);
}

/* --- 状态提示 --- */
.tuner-status {
  min-height: 1.6em;
  margin: 4px 0 10px;
  font-size: 0.88rem;
  color: var(--gray-500);
}

.tuner-status.error {
  color: #dc2626;
  font-weight: 600;
}

/* --- 表盘 --- */
.meter {
  position: relative;
  width: min(360px, 100%);
  height: 150px;
  margin: 0 auto;
  overflow: hidden;
}

.meter-pointer {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 3px;
  height: calc(100% - 26px);
  margin-left: -1.5px;
  background: var(--primary);
  border-radius: 2px;
  transform-origin: bottom center;
  transform: rotate(0deg);
  transition: transform 0.18s ease-out;
}

.meter-dot {
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--primary);
  border-radius: 50%;
}

.meter.in-tune .meter-dot,
.meter.in-tune .meter-pointer {
  background: var(--secondary);
}

.meter-scale {
  position: absolute;
  left: 50%;
  bottom: 10px;
  width: 1px;
  height: calc(100% - 26px);
  margin-left: -0.5px;
  border-top: 9px solid var(--gray-300);
  transform-origin: bottom center;
}

.meter-scale-strong {
  width: 2px;
  margin-left: -1px;
  border-top-width: 16px;
  border-top-color: var(--gray-500);
}

.meter-label {
  position: absolute;
  bottom: 22px;
  font-size: 0.75rem;
  color: var(--gray-400);
}

.meter-label-left { left: 12px; }
.meter-label-right { right: 12px; }

.meter-label-center {
  left: 50%;
  bottom: auto;
  top: 0;
  transform: translateX(-50%);
  color: var(--secondary);
  font-weight: 600;
  background: #fff;
  padding: 0 8px;
  border-radius: 999px;
  line-height: 1.4;
  z-index: 1;
}

/* --- 音名显示 --- */
.note-display {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 36px;
  margin: 10px 0 6px;
}

.note-main {
  font-size: 72px;
  line-height: 1.1;
  font-weight: 700;
  color: var(--gray-800);
  min-width: 150px;
}

.note-main.in-tune {
  color: var(--secondary);
}

.note-main .note-accidental {
  font-size: 0.45em;
  vertical-align: 0.55em;
}

.note-main .note-octave {
  font-size: 0.35em;
  vertical-align: -0.5em;
  font-weight: 400;
  color: var(--gray-500);
}

.note-main .note-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: #eef2ff;
  color: var(--primary);
  font-size: 0.24em;
  font-weight: 600;
  vertical-align: 0.9em;
}

.note-placeholder {
  color: var(--gray-200);
}

.note-sub {
  text-align: left;
  font-size: 0.95rem;
  color: var(--gray-500);
}

.freq-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  line-height: 1.9;
}

.freq-row[hidden] {
  display: none;
}

.freq-row b {
  min-width: 76px;
  font-variant-numeric: tabular-nums;
  color: var(--gray-800);
  font-size: 1.05rem;
}

.freq-row .unit {
  font-size: 0.78rem;
  color: var(--gray-400);
}

/* --- 音符条 --- */
.notes-strip {
  margin-top: 8px;
}

.notes-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 4px;
  scrollbar-width: thin;
  -webkit-mask-image: linear-gradient(to right, transparent, #fff 6%, #fff 94%, transparent);
  mask-image: linear-gradient(to right, transparent, #fff 6%, #fff 94%, transparent);
}

.notes-list::-webkit-scrollbar {
  height: 6px;
}

.note-chip {
  flex: 0 0 auto;
  min-width: 62px;
  padding: 8px 12px;
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  background: var(--gray-50);
  color: var(--gray-700);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.12s;
}

.note-chip small {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--gray-400);
}

.note-chip:hover {
  border-color: var(--primary);
}

/* 古筝绿/红标记弦（唱名 5） */
.note-chip.marker {
  position: relative;
  border-color: var(--secondary);
}

.note-chip.marker small {
  color: var(--secondary);
}

.note-chip.marker::before {
  content: '●';
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 0.5rem;
  color: var(--secondary);
}

.note-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.note-chip.active::before {
  color: rgba(255, 255, 255, 0.85);
}

.note-chip.active small {
  color: rgba(255, 255, 255, 0.75);
}

.notes-hint {
  font-size: 0.78rem;
  color: var(--gray-400);
  margin-top: 2px;
}

/* --- 频谱条 --- */
.frequency-bars {
  display: block;
  width: 100%;
  height: 90px;
  margin-top: 12px;
  border-radius: 8px;
  background: var(--gray-900);
}

/* --- 使用说明 / FAQ --- */
.steps p {
  margin-bottom: 10px;
  color: var(--gray-600);
  line-height: 1.8;
}

.steps p:last-child {
  margin-bottom: 0;
}

.steps strong {
  color: var(--gray-800);
}

/* --- 移动端 --- */
@media (max-width: 640px) {
  .tuner-card {
    padding: 16px 12px;
  }

  .note-main {
    font-size: 56px;
    min-width: 110px;
  }

  .freq-row b {
    min-width: 62px;
  }

  .meter {
    height: 120px;
  }
}
