:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #dbe2ea;
  --primary: #2563eb;
  --danger: #b91c1c;
  --success: #0f766e;
  --shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}

.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.hero {
  display: flex;
  gap: 20px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 24px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: 34px;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.warning-box {
  min-width: 260px;
  background: #fff8e6;
  border: 1px solid #f5d98b;
  border-radius: 16px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.card {
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

.card h2 {
  margin-top: 0;
}

.hint {
  color: var(--muted);
  margin-top: 10px;
}

.file-list, .results-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.file-item, .result-item {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  background: #fbfdff;
}

.file-item h3, .result-item h3 {
  margin: 0 0 8px;
  font-size: 17px;
}

.file-meta {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.audio-preview {
  width: 100%;
  margin-top: 12px;
}

.settings-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
  align-items: start;
}

label span {
  display: block;
  margin-bottom: 8px;
}

input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  font-size: 15px;
}

input[type="file"] {
  margin-top: 10px;
}

.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 12px;
}

button, .primary-link {
  border: none;
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary, .primary-link {
  background: var(--primary);
  color: #fff;
}

.secondary {
  background: #edf2f7;
  color: var(--text);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.small-btn {
  padding: 8px 12px;
  font-size: 13px;
}

.status-box {
  margin-top: 14px;
  padding: 14px;
  border-radius: 12px;
  background: #f8fafc;
  border: 1px solid var(--line);
  min-height: 48px;
  line-height: 1.6;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.metric {
  background: #f8fafc;
  border-radius: 10px;
  border: 1px solid var(--line);
  padding: 10px;
  font-size: 14px;
}

.tag {
  display: inline-block;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  margin-right: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
}

.tag.good { background: #ecfdf5; color: #065f46; border-color: #a7f3d0; }
.tag.warn { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.tag.bad { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.results-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.result-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.result-links a {
  color: var(--primary);
  text-decoration: none;
}

.result-image {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--line);
  margin-top: 12px;
}

.hidden { display: none !important; }

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 999;
}

.modal-content {
  background: var(--card);
  width: min(960px, 100%);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.player-toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0 6px;
}

.close-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #eef2f7;
  font-size: 24px;
}

@media (max-width: 900px) {
  .hero,
  .settings-grid {
    grid-template-columns: 1fr;
    display: grid;
  }
}
