:root {
  color-scheme: dark;
  --ink: #f7fbff;
  --muted: #9aa8b7;
  --dim: #657386;
  --line: rgba(255, 255, 255, 0.13);
  --panel: rgba(9, 16, 28, 0.72);
  --panel-strong: rgba(13, 22, 38, 0.92);
  --field: rgba(255, 255, 255, 0.07);
  --accent: #1d9bff;
  --accent-2: #52d7ff;
  --success: #44d7a8;
  --danger: #ff705f;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 50% -12%, rgba(36, 143, 255, 0.42), transparent 34%),
    radial-gradient(circle at 8% 18%, rgba(82, 215, 255, 0.18), transparent 28%),
    linear-gradient(180deg, #060b14 0%, #0a1322 48%, #05070d 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

body::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
  content: "";
  background:
    linear-gradient(115deg, transparent 0%, rgba(255, 255, 255, 0.06) 42%, transparent 56%),
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  mask-image: linear-gradient(to bottom, black, transparent 82%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--ink);
  cursor: pointer;
  transition:
    border-color 160ms ease,
    background 160ms ease,
    transform 160ms ease,
    opacity 160ms ease;
}

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

button.primary {
  border-color: rgba(82, 215, 255, 0.48);
  background: linear-gradient(135deg, var(--accent), #1568ff);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 36px rgba(29, 155, 255, 0.28);
}

button:hover:not(:disabled),
button.active {
  border-color: rgba(82, 215, 255, 0.62);
  background: rgba(29, 155, 255, 0.14);
  transform: translateY(-1px);
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--field);
  color: var(--ink);
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 10px 12px;
}

textarea {
  min-height: 108px;
  padding: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(82, 215, 255, 0.48);
  box-shadow: 0 0 0 3px rgba(82, 215, 255, 0.1);
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: clamp(26px, 4vw, 44px);
  line-height: 1.05;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  letter-spacing: 0;
}

.review-shell {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 16px;
  overflow-x: hidden;
}

.hero,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
}

.hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 104px;
  padding: 14px 22px;
  overflow: hidden;
}

.hero::after {
  width: 230px;
  height: 100px;
  flex: 0 0 auto;
  border-radius: 999px;
  content: "";
  background: radial-gradient(circle, rgba(82, 215, 255, 0.28), transparent 68%);
  filter: blur(2px);
}

.swc-brand {
  display: grid;
  gap: 6px;
  width: min(430px, 66vw);
}

.swc-mark {
  width: fit-content;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 8vw, 86px);
  font-weight: 900;
  line-height: 0.82;
  letter-spacing: 0;
  background:
    linear-gradient(180deg, #fff4a4 0%, #d99a1d 42%, #8f5b00 54%, #ffd667 78%, #b27405 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35),
    0 0 22px rgba(255, 199, 67, 0.34),
    0 12px 28px rgba(0, 0, 0, 0.38);
}

.swc-subtitle {
  display: grid;
  grid-template-columns: 42px auto 42px;
  gap: 12px;
  align-items: center;
  width: fit-content;
  color: #ffe87a;
  font-size: clamp(12px, 1.8vw, 18px);
  font-weight: 800;
  letter-spacing: 0.24em;
  text-shadow: 0 0 18px rgba(255, 214, 103, 0.26);
}

.swc-subtitle span {
  height: 1px;
  background: linear-gradient(90deg, transparent, #f7d76b);
}

.swc-subtitle span:last-child {
  background: linear-gradient(90deg, #f7d76b, transparent);
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid rgba(82, 215, 255, 0.34);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(82, 215, 255, 0.1);
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
}

.status-pill.muted {
  color: var(--muted);
}

.status-pill.saved {
  border-color: rgba(68, 215, 168, 0.44);
  background: rgba(68, 215, 168, 0.1);
  color: var(--success);
}

.panel {
  padding: 14px;
}

.sync-panel {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.step-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.sync-panel p,
.empty-state,
.selected-header p,
.status-card {
  color: var(--muted);
  line-height: 1.45;
}

.sync-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.api-settings {
  grid-column: 1 / -1;
  border: 1px solid rgba(82, 215, 255, 0.16);
  border-radius: 8px;
  background: rgba(82, 215, 255, 0.06);
  padding: 10px 12px;
}

.api-settings summary {
  color: var(--accent-2);
  cursor: pointer;
  font-weight: 900;
}

.api-settings label {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.status-card {
  grid-column: 1 / -1;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 11px 12px;
}

.review-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.75fr) minmax(520px, 1.25fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.queue-panel,
.scoring-panel {
  min-width: 0;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 11px;
}

.section-heading span {
  color: var(--muted);
  font-weight: 900;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
  margin-bottom: 10px;
}

.recording-list {
  display: grid;
  gap: 8px;
  max-height: calc(100vh - 356px);
  min-height: 260px;
  overflow: auto;
  padding-right: 2px;
}

.recording-card {
  display: grid;
  grid-template-columns: 30px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 76px;
  border-radius: 8px;
  padding: 10px;
  text-align: left;
}

.recording-card.active {
  border-color: rgba(82, 215, 255, 0.62);
  background: rgba(82, 215, 255, 0.13);
}

.recording-status {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.recording-status.done {
  background: linear-gradient(135deg, var(--success), var(--accent-2));
  color: #03151f;
}

.recording-card strong,
.recording-card small,
.recording-card em {
  display: block;
  overflow-wrap: anywhere;
}

.recording-card strong {
  font-size: 15px;
}

.recording-card small,
.recording-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
}

.scoring-panel {
  min-height: 560px;
}

.empty-state {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 18px;
}

.empty-state.small {
  padding: 14px;
}

.selected-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

audio {
  display: block;
  width: 100%;
  margin-bottom: 12px;
}

.score-toolbar {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

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

.score-slider {
  display: grid;
  grid-template-columns: 110px 1fr 42px;
  gap: 10px;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.055);
  padding: 10px;
}

.score-slider span,
.teacher-note span {
  color: var(--ink);
  font-weight: 900;
}

.score-slider output {
  color: var(--accent-2);
  font-weight: 900;
  text-align: right;
}

input[type="range"] {
  min-height: 24px;
  padding: 0;
  accent-color: var(--accent-2);
  background: transparent;
}

.teacher-note {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

@media (max-width: 900px) {
  .review-grid,
  .sync-panel {
    grid-template-columns: 1fr;
  }

  .review-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
  }

  .queue-panel {
    order: 1;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .scoring-panel {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  .sync-actions {
    justify-content: stretch;
  }

  .sync-actions button {
    flex: 1;
  }

  .recording-list {
    display: flex;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    max-height: none;
    min-height: 0;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 2px 2px 8px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .recording-card {
    flex: 0 0 168px;
    width: 168px;
    max-width: 168px;
    grid-template-columns: 1fr;
    align-content: space-between;
    justify-items: start;
    min-height: 112px;
    scroll-snap-align: start;
  }

  .recording-status {
    width: 28px;
    height: 28px;
  }
}

@media (max-width: 640px) {
  .review-shell {
    gap: 8px;
    padding: 8px;
    width: 100%;
    max-width: 100vw;
  }

  .hero {
    min-height: 68px;
    padding: 10px 12px;
  }

  .hero::after {
    display: none;
  }

  .swc-brand {
    gap: 3px;
    width: min(260px, 62vw);
  }

  .swc-mark {
    font-size: 42px;
  }

  .swc-subtitle {
    grid-template-columns: 22px auto 22px;
    gap: 7px;
    font-size: 10px;
  }

  .panel {
    padding: 10px;
  }

  .sync-panel h1 {
    font-size: 24px;
  }

  .sync-panel p,
  .api-settings,
  .status-card {
    font-size: 13px;
  }

  .api-settings:not([open]) {
    padding-block: 8px;
  }

  .status-pill {
    padding: 8px 10px;
    font-size: 12px;
  }

  .sync-actions,
  .filter-row,
  .score-toolbar,
  .score-sliders {
    grid-template-columns: 1fr;
  }

  .score-toolbar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .score-toolbar .primary {
    grid-column: 1 / -1;
    order: -1;
  }

  .scoring-panel {
    min-height: 0;
  }

  .selected-header {
    flex-direction: column;
    gap: 8px;
    margin-bottom: 8px;
  }

  .selected-header h2 {
    font-size: 19px;
  }

  audio {
    margin-bottom: 8px;
  }

  .score-slider {
    min-height: 44px;
    padding: 8px;
  }

  .score-slider {
    grid-template-columns: 96px 1fr 36px;
    gap: 8px;
  }

  textarea {
    min-height: 76px;
  }

  .queue-panel {
    max-height: none;
  }

  .recording-list {
    max-height: none;
  }

  .recording-card {
    flex-basis: 132px;
    width: 132px;
    max-width: 132px;
    min-height: 112px;
    padding: 8px;
  }

  .recording-card strong {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    font-size: 13px;
    line-height: 1.18;
  }

  .recording-card small {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .recording-card small,
  .recording-card em {
    font-size: 11px;
  }
}
