:root {
  color-scheme: light;
  --ink: #17201c;
  --muted: #68736e;
  --line: #d9e0dc;
  --paper: #f5f7f4;
  --panel: #ffffff;
  --green: #1f7a52;
  --green-dark: #155f40;
  --blue: #1f5f8f;
  --red: #bd3f32;
  --amber: #9b691f;
  --soft: #eef3f0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--paper);
  color: var(--ink);
  font-family: "Microsoft YaHei", "Segoe UI", sans-serif;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 40px;
}

.access-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.access-panel {
  width: min(460px, 100%);
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.access-form {
  margin-top: 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.request-panel,
.status-card,
.lane,
.admin-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.request-panel {
  padding: 24px;
}

.title-block {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: 34px;
  line-height: 1.15;
}

h2 {
  margin-bottom: 8px;
}

.warm-hint {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
}

.request-form {
  display: grid;
  grid-template-columns: 1.35fr 1fr 0.9fr;
  gap: 14px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  font: inherit;
  font-weight: 600;
  outline: none;
}

input::placeholder {
  color: #9aa39f;
  font-weight: 500;
}

input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 143, 0.14);
}

.wide {
  grid-column: span 2;
}

button {
  align-self: end;
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  padding: 0 18px;
  background: var(--green);
  color: white;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

button:hover {
  background: var(--green-dark);
}

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

button.secondary {
  background: #f7f9f8;
  color: var(--blue);
  border: 1px solid var(--line);
}

button.secondary:hover {
  background: #edf4f8;
}

button.danger {
  color: var(--red);
}

button.mini {
  min-height: 32px;
  padding: 0 10px;
  font-size: 13px;
}

.message {
  min-height: 20px;
  margin: 14px 0 0;
  color: var(--blue);
  font-weight: 700;
}

.message.ok {
  color: var(--green);
}

.message.error {
  color: var(--red);
}

.message.muted {
  color: var(--muted);
}

.status-strip {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 16px;
}

.status-card {
  min-height: 92px;
  padding: 16px;
  display: grid;
  align-content: center;
  gap: 5px;
}

.status-card span,
.status-card small {
  color: var(--muted);
  font-weight: 700;
}

.status-card strong {
  font-size: 25px;
  line-height: 1.1;
}

.board {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1.25fr 0.85fr;
  gap: 16px;
}

.lane {
  min-height: 360px;
  padding: 18px;
}

.lane-title {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}

.lane-title h2 {
  margin: 0;
  font-size: 20px;
  margin-right: auto;
}

.lane-title span {
  min-width: 30px;
  text-align: center;
  border-radius: 999px;
  background: var(--soft);
  padding: 4px 9px;
  color: var(--muted);
  font-weight: 900;
}

.song-list {
  display: grid;
  gap: 10px;
}

.song {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.song.playing {
  border-color: rgba(31, 122, 82, 0.4);
  background: #f7fbf8;
}

.song-number {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--soft);
  color: var(--muted);
  font-weight: 900;
}

.song.playing .song-number {
  background: var(--green);
  color: #fff;
}

.song-body {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.song strong {
  display: block;
  overflow-wrap: anywhere;
}

.song small {
  color: var(--muted);
  line-height: 1.45;
}

.status {
  color: var(--amber);
  font-weight: 900;
  white-space: nowrap;
}

.status.playing {
  color: var(--green);
}

.status.failed,
.status.canceled {
  color: var(--red);
}

.song-actions {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.song-actions button {
  min-height: 36px;
  padding: 0 13px;
}

.empty {
  padding: 22px 0;
  color: var(--muted);
  font-weight: 700;
}

.admin-panel {
  margin-top: 16px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(260px, 1fr);
  gap: 16px;
  align-items: end;
}

.admin-copy h2,
.admin-copy p {
  margin-bottom: 0;
}

.admin-copy p:last-child {
  color: var(--muted);
  font-weight: 800;
}

.admin-login {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-tools {
  display: grid;
  gap: 14px;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.admin-create {
  display: grid;
  grid-template-columns: minmax(160px, 1.3fr) minmax(120px, 0.9fr) minmax(120px, 0.8fr) minmax(140px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .title-block,
  .request-form,
  .status-strip,
  .board,
  .admin-panel,
  .admin-login,
  .access-form,
  .admin-create {
    grid-template-columns: 1fr;
    display: grid;
  }

  .title-block {
    align-items: start;
  }

  .wide {
    grid-column: auto;
  }

  button {
    width: 100%;
  }

  .song {
    grid-template-columns: 30px minmax(0, 1fr) auto;
  }

  .song-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  .song-actions button,
  .admin-actions button {
    flex: 1;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 10px;
  }

  .request-panel,
  .lane,
  .admin-panel {
    padding: 14px;
  }

  h1 {
    font-size: 28px;
  }

  .status-card strong {
    font-size: 22px;
  }
}
