:root {
  --ink: #24231f;
  --muted: #7b766c;
  --paper: #f4f0e8;
  --panel: #fffdf8;
  --line: #d9d1c4;
  --red: #b7473f;
  --amber: #b97a27;
  --blue: #356b91;
  --green: #5d765b;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(50, 45, 37, .035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(50, 45, 37, .035) 1px, transparent 1px),
    var(--paper);
  background-size: 28px 28px;
  font-family: "Microsoft YaHei", "Noto Sans SC", sans-serif;
}
main { max-width: 1500px; margin: 0 auto; padding: 28px 36px 46px; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 6px 0 24px; border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: grid; place-items: center; width: 48px; height: 48px; color: white; background: var(--ink); border-radius: 6px; font: 30px Georgia, serif; }
h1 { margin: 0; font: 600 26px/1.2 "Microsoft YaHei", sans-serif; letter-spacing: 0; }
.brand p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.status-pill { border: 1px solid var(--line); background: rgba(255,255,255,.55); padding: 8px 12px; font-size: 12px; color: var(--muted); }
.status-pill span { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--green); margin-right: 7px; }
.workspace { display: grid; grid-template-columns: 310px minmax(0, 1fr); gap: 24px; margin-top: 24px; }
.upload-panel, .results-panel { background: var(--panel); border: 1px solid var(--line); }
.upload-panel { padding: 22px; align-self: start; }
.section-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.section-heading span { font: 12px "Consolas", monospace; color: var(--muted); }
.section-heading h2 { font-size: 17px; margin: 0; font-weight: 600; }
.section-heading em { margin-left: auto; color: var(--muted); font-size: 12px; font-style: normal; }
.dropzone { display: flex; flex-direction: column; gap: 7px; padding: 18px; margin-bottom: 12px; border: 1px dashed #b9ae9e; background: #faf7f0; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone:hover, .dropzone.has-file { border-color: var(--ink); background: #f5efe3; }
.file-icon { align-self: flex-start; padding: 3px 6px; color: white; background: var(--ink); font: 11px "Consolas", monospace; }
.dropzone strong { font-size: 14px; }
.dropzone small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
button { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 7px; padding: 13px 16px; border: 0; border-radius: 3px; color: white; background: var(--ink); font-family: inherit; font-weight: 600; cursor: pointer; }
button:disabled { opacity: .55; cursor: wait; }
button b { font-size: 19px; font-weight: 400; }
.hint { margin: 14px 0 0; color: var(--muted); font-size: 11px; line-height: 1.6; }
.results-panel { padding: 22px 24px 24px; min-width: 0; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); margin-bottom: 18px; }
.metrics article { padding: 16px 18px; border-right: 1px solid var(--line); }
.metrics article:last-child { border-right: 0; }
.metrics p { margin: 0; color: var(--muted); font-size: 12px; }
.metrics strong { display: block; margin: 4px 0 0; font: 30px "Consolas", monospace; }
.metrics small { color: #9e978c; font: 9px "Consolas", monospace; letter-spacing: .08em; }
.audio-panel { display: block; border: 1px solid var(--line); background: #f7f3ea; padding: 14px 16px 16px; margin-bottom: 18px; }
.audio-panel[hidden] { display: none; }
.audio-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.audio-mark { display: grid; place-items: center; width: 30px; height: 30px; color: white; background: var(--green); border-radius: 50%; font-size: 12px; }
.audio-head h2 { margin: 0; font-size: 14px; }
.audio-head small { display: block; margin-top: 1px; color: var(--muted); font-size: 11px; overflow-wrap: anywhere; }
.audio-panel audio { width: 100%; height: 38px; display: block; }
.audio-tip { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.5; }
.feedback-frame { min-height: 330px; display: grid; place-items: center; border: 1px solid var(--line); background: #f7f3ea; overflow: hidden; }
.feedback-frame img { width: 100%; display: block; }
.empty-state { width: 78%; text-align: center; color: var(--muted); font-size: 13px; }
.staff-lines { position: relative; height: 54px; margin: 0 auto 22px; }
.staff-lines i { display: block; height: 1px; margin: 12px 0; background: #cfc6b9; }
.staff-lines::before { content: "♪"; position: absolute; left: 12%; top: 2px; color: var(--ink); font: 35px Georgia, serif; }
.event-list { margin-top: 18px; border-top: 1px solid var(--line); }
.list-head, .event-row { display: grid; grid-template-columns: 90px 95px 150px minmax(0, 1fr); gap: 12px; align-items: center; }
.list-head { padding: 11px 8px; color: var(--muted); font-size: 11px; border-bottom: 1px solid var(--line); }
.event-row { padding: 12px 8px; border-bottom: 1px solid #e9e3d9; font-size: 13px; cursor: pointer; transition: background .15s; }
.event-row:hover { background: #f3ecdf; }
.event-row time { font-family: "Consolas", monospace; }
.event-type { display: inline-flex; width: fit-content; padding: 3px 7px; color: white; font-size: 11px; border-radius: 2px; }
.event-type.wrong_note { background: var(--red); }
.event-type.missing_note { background: var(--amber); }
.event-type.extra_note { background: var(--blue); }
.empty-row { padding: 34px 8px; text-align: center; color: #9e978c; font-size: 12px; }
@media (max-width: 900px) {
  main { padding: 18px 16px 32px; }
  .workspace { grid-template-columns: 1fr; }
  .metrics { grid-template-columns: repeat(2, 1fr); }
  .metrics article:nth-child(2) { border-right: 0; }
  .metrics article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .list-head, .event-row { grid-template-columns: 72px 86px minmax(0, 1fr); }
  .list-head span:last-child, .event-row span:last-child { display: none; }
}
