/* 手碟谱解析页。配色全部走 shell 变量，四套主题和白天/夜间自动跟随。 */

.handpan-parse-page,
.handpan-parse-page *,
.handpan-parse-page *::before,
.handpan-parse-page *::after {
  box-sizing: border-box;
}

.handpan-parse-page :where(button, a, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--shell-accent);
  outline-offset: 3px;
}

.handpan-parse-page [hidden] {
  display: none !important;
}

.hp-shell {
  width: 100%;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.hp-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 18px;
  margin: 0;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: var(--shell-panel);
}

.hp-hero h1 {
  margin: 0;
  font-size: clamp(25px, 3vw, 32px);
  line-height: 1.2;
}

.hp-hero .shell-intro-eyebrow {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--shell-accent);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: .08em;
}

.hp-hero .shell-intro-description {
  margin: 0;
  color: var(--shell-muted);
  font-size: 14px;
  line-height: 1.75;
}

.hp-hero-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.hp-card {
  padding: 18px;
  border: 1px solid var(--shell-line);
  border-radius: 12px;
  background: var(--shell-panel);
}

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

.hp-card-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 650;
}

.hp-hint {
  color: var(--shell-muted);
  font-size: 12px;
  line-height: 1.6;
}

.hp-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 7px 13px;
  border: 1px solid var(--shell-line-strong);
  border-radius: 8px;
  background: var(--shell-panel-strong);
  color: var(--shell-text);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s ease, border-color .15s ease, color .15s ease;
}

.hp-btn:hover { border-color: var(--shell-accent); color: var(--shell-accent); }
.hp-btn:disabled { opacity: .45; cursor: default; border-color: var(--shell-line); color: var(--shell-muted); }
.hp-btn-primary { background: var(--shell-accent-soft); border-color: var(--shell-accent-border); color: var(--shell-accent); }
.hp-btn-primary:hover { background: var(--shell-accent-soft); border-color: var(--shell-accent); }

.hp-drop {
  display: grid;
  gap: 6px;
  justify-items: center;
  padding: 28px 18px;
  border: 1.5px dashed var(--shell-line-strong);
  border-radius: 10px;
  background: var(--shell-panel-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease;
}

.hp-drop:hover,
.hp-drop:focus-visible { border-color: var(--shell-accent); }
.hp-drop.is-over { border-color: var(--shell-accent); background: var(--shell-accent-soft); }
.hp-drop-ico { font-size: 26px; color: var(--shell-muted); }
.hp-drop-title { margin: 0; font-size: 14px; font-weight: 600; }
.hp-drop-sub { margin: 0; color: var(--shell-muted); font-size: 12px; line-height: 1.6; }

.hp-file {
  margin: 6px 0 0;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--shell-accent-soft);
  color: var(--shell-accent);
  font-size: 12px;
  word-break: break-all;
}

.hp-controls {
  display: flex;
  gap: 12px;
  align-items: end;
  flex-wrap: wrap;
  margin-top: 14px;
}

.hp-field { display: grid; gap: 5px; min-width: 220px; }
.hp-field-label { color: var(--shell-muted); font-size: 12px; }

.hp-field select {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--shell-line-strong);
  border-radius: 8px;
  background: var(--shell-panel-strong);
  color: var(--shell-text);
  font: inherit;
  font-size: 13px;
}

.hp-run { margin-left: auto; }

.hp-msg {
  margin: 10px 0 0;
  min-height: 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--shell-muted);
}

.hp-msg.is-bad { color: var(--shell-danger, #e08b7a); }
.hp-msg.is-ok { color: var(--shell-accent); }

.hp-verdict {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--shell-line);
  background: var(--shell-panel-strong);
  font-size: 12px;
  font-weight: 600;
}

.hp-verdict[data-level="ok"] { color: #6fae86; border-color: #6fae8655; }
.hp-verdict[data-level="warn"] { color: #d5a05c; border-color: #d5a05c55; }
.hp-verdict[data-level="bad"] { color: #d9827a; border-color: #d9827a55; }

.hp-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.hp-stat {
  padding: 9px 11px;
  border: 1px solid var(--shell-line);
  border-radius: 9px;
  background: var(--shell-panel-soft);
}

.hp-stat dt { margin: 0; color: var(--shell-muted); font-size: 11px; }
.hp-stat dd { margin: 3px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.hp-stat dd small { font-size: 11px; font-weight: 400; color: var(--shell-muted); }

.hp-warn {
  margin: 0 0 12px;
  padding: 8px 11px;
  border-left: 2px solid #d5a05c;
  border-radius: 0 8px 8px 0;
  background: var(--shell-panel-soft);
  color: var(--shell-muted);
  font-size: 12px;
  line-height: 1.7;
}

.hp-copyrow {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.hp-text {
  width: 100%;
  min-height: 150px;
  max-height: 300px;
  padding: 12px;
  border: 1px solid var(--shell-line-strong);
  border-radius: 10px;
  background: var(--shell-panel-soft);
  color: var(--shell-text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
  line-height: 1.65;
  resize: vertical;
  word-break: break-all;
}

.hp-details {
  margin-top: 14px;
  border-top: 1px solid var(--shell-line);
  padding-top: 10px;
}

.hp-details summary {
  cursor: pointer;
  color: var(--shell-muted);
  font-size: 12.5px;
  list-style: none;
}

.hp-details summary::-webkit-details-marker { display: none; }
.hp-details summary::before { content: "▸ "; }
.hp-details[open] summary::before { content: "▾ "; }
.hp-details > *:not(summary) { margin-top: 10px; }

.hp-score {
  max-height: 280px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--shell-line);
  border-radius: 10px;
  background: var(--shell-panel-soft);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11.5px;
  line-height: 1.6;
  white-space: pre;
}

.hp-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px 16px;
  margin: 0;
  font-size: 12.5px;
}

.hp-meta div { display: flex; gap: 8px; justify-content: space-between; border-bottom: 1px dashed var(--shell-line); padding-bottom: 4px; }
.hp-meta dt { color: var(--shell-muted); }
.hp-meta dd { margin: 0; font-variant-numeric: tabular-nums; word-break: break-all; text-align: right; }

.hp-notes ol { margin: 0 0 10px; padding-left: 20px; font-size: 13px; line-height: 1.9; color: var(--shell-text); }
.hp-notes code {
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--shell-panel-strong);
  font-size: 11.5px;
}

@media (max-width: 760px) {
  .hp-hero { grid-template-columns: minmax(0, 1fr); }
  .hp-run { margin-left: 0; width: 100%; justify-content: center; }
  .hp-field { width: 100%; }
  .hp-card { padding: 14px; }
  .hp-text { font-size: 11.5px; }
}
