:root {
  color-scheme: dark;
  font-family: "Segoe UI", "Microsoft YaHei UI", sans-serif;
  font-size: 13px;
  line-height: 1.5;
  background: #121212;
  color: #e8e5df;
}

* { box-sizing: border-box; }
body { margin: 0; background: #121212; }
main { width: min(940px, calc(100% - 32px)); margin: 28px auto; }
header { margin-bottom: 20px; }
h1 { margin: 5px 0 10px; font-size: 27px; }
h2 { margin: 0; }
header p, .section-heading p, #currentDetail { color: #b2b0aa; }
.eyebrow { color: #b2b0aa; font-weight: 600; letter-spacing: .08em; }
.workbench-link {
  display: inline-block;
  margin-top: 4px;
  padding: 10px 15px;
  border: 1px solid #a99067;
  border-radius: 7px;
  color: #e8e5df;
  background: #171717;
  font-weight: 600;
  text-decoration: none;
}
.workbench-link:hover { border-color: #b2b0aa; }

.current-card, .panel, .advanced, .result {
  border: 1px solid #2b2b29;
  background: #181818;
  border-radius: 8px;
  box-shadow: none;
}
.current-card {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 18px;
  padding: 18px;
  margin-bottom: 20px;
}
.current-card.pass { border-color: #a99067; }
.current-card.fail { border-color: #ef756f; }
.status-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: #e2ddd2;
  color: #171717;
  font-size: 26px;
  font-weight: 900;
}
.current-card.fail .status-mark { background: #ef756f; color: #280806; }
.status-label { margin: 0 0 5px; color: #b2b0aa; font-weight: 600; }
#currentDetail { margin: 7px 0 0; }

.panel { padding: 18px; }
.bailian-settings, #bailianSettingsForm { display: grid; gap: 8px; }
.bailian-settings { margin-bottom: 20px; }
.bailian-settings p { margin: 0; overflow-wrap: anywhere; }
.bailian-settings a { color: #e8e5df; }
.bailian-settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.section-heading { margin-bottom: 18px; }
.section-heading p { margin: 7px 0 0; }
.profile-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.profile-card {
  position: relative;
  display: grid;
  gap: 7px;
  min-height: 106px;
  padding: 15px;
  text-align: left;
  color: #e8e5df;
  background: #171717;
  border: 1px solid #2b2b29;
  border-radius: 8px;
  cursor: pointer;
}
.profile-card:hover { border-color: #b2b0aa; }
.profile-card.selected {
  border: 2px solid #a99067;
  background: #171717;
  box-shadow: none;
}
.profile-name { font-size: 18px; font-weight: 600; }
.profile-description { color: #b2b0aa; line-height: 1.45; }
.recommended-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  color: #171717;
  background: #e2ddd2;
  font-size: 12px;
  font-weight: 600;
}
.actions { display: flex; align-items: center; gap: 14px; margin-top: 20px; }
.primary-button {
  min-width: 180px;
  border: 0;
  border-radius: 7px;
  padding: 10px 16px;
  color: #171717;
  background: #e2ddd2;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.primary-button:disabled { opacity: .55; cursor: wait; }
#busyText { color: #b2b0aa; }

.advanced { margin-top: 18px; padding: 0; overflow: hidden; }
.advanced > summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 18px 22px;
  cursor: pointer;
  font-weight: 600;
}
.advanced > summary small { color: #b2b0aa; font-weight: 500; }
.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  padding: 4px 22px 22px;
  border-top: 1px solid #2b2b29;
}
.advanced-note {
  margin-top: 18px;
  padding: 14px 16px;
  border-radius: 7px;
  color: #e8e5df;
  background: #171717;
}
.advanced-note p { margin: 5px 0 0; color: #b2b0aa; }
.field { display: grid; gap: 8px; padding-top: 18px; }
.wide { grid-column: 1 / -1; }
label { font-weight: 700; }
small { color: #b2b0aa; }
input, select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #2b2b29;
  border-radius: 8px;
  color: #e8e5df;
  background: #171717;
}
.advanced-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}
.secondary-button {
  border: 1px solid #a99067;
  border-radius: 7px;
  padding: 9px 13px;
  color: #e8e5df;
  background: #171717;
  font-weight: 600;
  cursor: pointer;
}
.secondary-button:disabled { opacity: .55; cursor: wait; }

.result { margin-top: 18px; padding: 18px; }
.result.pass { border-color: #a99067; }
.result.fail { border-color: #ef756f; }
.technical-details { margin-top: 14px; color: #b2b0aa; }
.technical-details summary { cursor: pointer; }
dl { display: grid; grid-template-columns: 180px 1fr; gap: 8px 18px; }
dt { color: #b2b0aa; }
dd { margin: 0; overflow-wrap: anywhere; }
.error { color: #ff9d98; white-space: pre-wrap; }

.final-video-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.final-video-panel {
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid #2b2b29;
  border-radius: 8px;
  background: #171717;
}
.final-video-panel figcaption {
  margin-bottom: 10px;
  color: #e8e5df;
  font-weight: 600;
}
.final-video-panel video {
  display: block;
  width: 100%;
  max-height: 70vh;
  border-radius: 8px;
  background: #000;
}

@media (max-width: 700px) {
  .profile-grid, .advanced-grid { grid-template-columns: 1fr; }
  .final-video-comparison { grid-template-columns: 1fr; }
  .wide { grid-column: auto; }
  .profile-card { min-height: 110px; }
  .advanced > summary { align-items: flex-start; flex-direction: column; }
  dl { grid-template-columns: 1fr; }
}

button, input, select { font: inherit; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible { outline: 2px solid #a99067; outline-offset: 2px; }
.current-card.pass, .result.pass { border-color: #70644f; }
.profile-card:hover { border-color: #70644f; }
.status-label, .eyebrow { color: #c7b99c; }
.profile-card.selected { background: #24221e; }
.status-mark, .recommended-badge { background: #e2ddd2; color: #171717; }
