:root {
  color-scheme: light;
  --background: #f8f9fa;
  --surface: #ffffff;
  --border: #dee2e6;
  --border-dark: #ced4da;
  --text: #212529;
  --muted: #6c757d;
  --accent: #0d6efd;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--background);
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family:
    Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.5;
}

button,
audio {
  font: inherit;
}

button:focus-visible,
audio:focus-visible {
  outline: 3px solid rgba(13, 110, 253, 0.25);
  outline-offset: 2px;
}

.demo-container {
  width: 100%;
  padding: 24px clamp(16px, 2.5vw, 40px) 32px;
}

.page-header,
.demo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.page-header {
  padding: 24px;
}

h1 {
  margin: 0;
  font-size: clamp(1.45rem, 2.4vw, 1.85rem);
  line-height: 1.3;
}

.snr-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.snr-nav button {
  min-width: 62px;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
  font-size: 0.875rem;
}

.snr-nav button:hover {
  background: #f1f3f5;
}

.snr-nav button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.demo-card {
  margin-top: 16px;
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
}

.card-header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.card-header p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.card-header > span {
  flex: 0 0 auto;
  padding: 3px 9px;
  background: var(--background);
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
}

.table-wrap {
  position: relative;
  width: 100%;
  max-height: 72vh;
  overflow: auto;
  overscroll-behavior: contain;
}

table {
  width: 100%;
  min-width: 1740px;
  border-collapse: separate;
  border-spacing: 0;
}

th,
td {
  padding: 10px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: middle;
}

th:last-child,
td:last-child {
  border-right: 0;
}

tbody tr:last-child td {
  border-bottom: 0;
}

thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--background);
  color: #495057;
  font-size: 0.74rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
}

.sample-column,
.sample-meta {
  position: sticky;
  left: 0;
  min-width: 280px;
  max-width: 360px;
  box-shadow: 2px 0 3px rgba(0, 0, 0, 0.08);
}

.sample-column {
  z-index: 5;
  background: var(--background);
}

.sample-meta {
  z-index: 2;
  background: var(--surface);
}

.sample-meta strong {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 0.8rem;
}

.sample-meta p {
  margin: 0;
}

.audio-cell {
  min-width: 235px;
}

.audio-with-mel {
  display: grid;
  gap: 7px;
}

audio {
  width: 220px;
  height: 32px;
}

.mel-thumb-button {
  width: fit-content;
  padding: 0;
  overflow: hidden;
  background: #0b1020;
  border: 1px solid var(--border-dark);
  border-radius: 4px;
  cursor: zoom-in;
}

.mel-thumb {
  display: block;
  width: 220px;
  height: 68px;
  object-fit: fill;
}

.mel-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.72);
}

.mel-modal-panel {
  width: min(960px, 100%);
  padding: 16px;
  background: var(--surface);
  border-radius: 6px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
}

.mel-modal-close {
  display: block;
  margin: 0 0 12px auto;
  padding: 5px 12px;
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 4px;
  color: #495057;
  cursor: pointer;
}

.mel-modal-image {
  display: block;
  width: 100%;
  height: auto;
  background: #0b1020;
}

.mel-modal-panel p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 700px) {
  .demo-container {
    padding: 12px;
  }

  .page-header {
    padding: 18px;
  }

  .card-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }
}
