:root {
  --bg: #08121a;
  --bg-2: #0e1b25;
  --panel: rgba(9, 25, 35, 0.88);
  --panel-strong: #102736;
  --line: rgba(150, 203, 219, 0.16);
  --text: #eef7fb;
  --muted: #9db7c4;
  --brand: #29c2b1;
  --brand-2: #f4a261;
  --ok: #4ade80;
  --warn: #fbbf24;
  --danger: #f87171;
  --shadow: 0 16px 50px rgba(0, 0, 0, 0.32);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --max-width: 1180px;
  --tap: 48px;
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(41, 194, 177, 0.24), transparent 34%),
    radial-gradient(circle at top right, rgba(244, 162, 97, 0.22), transparent 28%),
    linear-gradient(160deg, #071019 0%, #0b1620 48%, #0c1f28 100%);
  color: var(--text);
}

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

button {
  border: 0;
  background: none;
  color: inherit;
  padding: 0;
}

button:focus,
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(41, 194, 177, 0.85);
  outline-offset: 2px;
}

.app-root {
  min-height: 100vh;
  position: relative;
}

.app-shell {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px 24px;
}

.topbar {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: linear-gradient(180deg, rgba(11, 25, 36, 0.98), rgba(11, 25, 36, 0.82));
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 52px;
  height: 52px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(255, 255, 255, 0.35), transparent 36%),
    linear-gradient(160deg, #34d399, #14b8a6 56%, #0f766e);
  color: #fff;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.brand-text {
  min-width: 0;
}

.brand-title {
  margin: 0;
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.15;
  letter-spacing: 0.02em;
}

.brand-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 18, 26, 0.72);
  color: var(--text);
  white-space: nowrap;
}

.pill strong {
  font-weight: 700;
}

.banner {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(251, 191, 36, 0.26);
  background: linear-gradient(90deg, rgba(67, 46, 10, 0.9), rgba(33, 26, 6, 0.86));
  color: #ffe7a8;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.banner strong {
  display: block;
  margin-bottom: 4px;
}

.banner button {
  min-height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.card {
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(13, 29, 41, 0.96), rgba(8, 19, 28, 0.94));
  box-shadow: var(--shadow);
}

.card-pad {
  padding: 18px;
}

.summary-card {
  grid-column: span 4;
  position: relative;
  overflow: hidden;
  min-height: 162px;
}

.summary-card::after {
  content: "";
  position: absolute;
  inset: auto -20px -40px auto;
  width: 130px;
  height: 130px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(41, 194, 177, 0.22), transparent 65%);
  pointer-events: none;
}

.summary-label {
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.summary-value {
  margin: 12px 0 8px;
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 800;
  line-height: 1.05;
}

.summary-desc {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  font-size: 14px;
}

.layout {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.nav-panel {
  position: sticky;
  top: 14px;
  height: fit-content;
  padding: 14px;
}

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

.nav-item {
  min-height: 48px;
  padding: 0 14px;
  border-radius: 16px;
  border: 1px solid transparent;
  background: rgba(9, 24, 34, 0.65);
  color: var(--text);
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.nav-item.active {
  border-color: rgba(41, 194, 177, 0.42);
  background: linear-gradient(90deg, rgba(41, 194, 177, 0.16), rgba(244, 162, 97, 0.1));
}

.nav-count {
  color: var(--muted);
  font-size: 12px;
}

.content-panel {
  min-width: 0;
}

.section {
  display: none;
}

.section.active {
  display: block;
  animation: fadeIn 180ms ease-out;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

.section-title {
  margin: 0;
  font-size: 22px;
}

.section-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 14px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.btn {
  min-height: var(--tap);
  padding: 0 16px;
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  background: linear-gradient(135deg, #29c2b1, #0ea5a8);
  color: #041017;
  font-weight: 700;
}

.btn-ghost {
  background: rgba(12, 26, 37, 0.96);
  color: var(--text);
  border-color: var(--line);
}

.btn-danger {
  background: rgba(127, 29, 29, 0.82);
  color: #fff;
  border-color: rgba(248, 113, 113, 0.22);
}

.btn-soft {
  background: rgba(41, 194, 177, 0.12);
  color: #c9fff8;
  border-color: rgba(41, 194, 177, 0.2);
}

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

.stack {
  display: grid;
  gap: 14px;
}

.list {
  display: grid;
  gap: 12px;
}

.task-card,
.sound-card,
.status-card,
.panel-box {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(8, 21, 31, 0.92);
}

.task-card {
  padding: 16px;
}

.task-top,
.sound-top,
.status-top,
.panel-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.task-title,
.sound-name,
.status-name {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.task-meta,
.sound-meta,
.status-meta,
.panel-desc {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.chip {
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: #d8f3f0;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chip.ok {
  background: rgba(74, 222, 128, 0.14);
  color: #bdfcd0;
}

.chip.warn {
  background: rgba(251, 191, 36, 0.16);
  color: #ffe8a1;
}

.chip.bad {
  background: rgba(248, 113, 113, 0.16);
  color: #ffb1b1;
}

.task-actions,
.sound-actions,
.status-actions,
.panel-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 14px;
}

.task-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
}

.switch {
  position: relative;
  width: 52px;
  height: 30px;
  flex: 0 0 auto;
}

.switch input {
  appearance: none;
  width: 100%;
  height: 100%;
  margin: 0;
  border-radius: 999px;
  background: #31424d;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 140ms ease;
}

.switch input::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #f0fbff;
  transform: translateY(-50%);
  transition: transform 140ms ease;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.switch input:checked {
  background: linear-gradient(135deg, #29c2b1, #22c55e);
}

.switch input:checked::before {
  transform: translate(22px, -50%);
}

.mini-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

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

.field {
  min-width: 0;
}

.field.full {
  grid-column: 1 / -1;
}

.field label {
  display: block;
  margin-bottom: 8px;
  color: #d9eef6;
  font-size: 14px;
}

.input,
.select,
.textarea {
  width: 100%;
  min-height: 48px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(8, 18, 26, 0.96);
  color: var(--text);
  padding: 0 14px;
}

.textarea {
  min-height: 88px;
  padding: 12px 14px;
  resize: vertical;
}

.help-text {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.radio-row,
.check-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.radio-pill,
.check-pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 22, 31, 0.88);
  gap: 8px;
  cursor: pointer;
}

.radio-pill input,
.check-pill input {
  accent-color: #29c2b1;
}

.radio-pill.active,
.check-pill.active {
  border-color: rgba(41, 194, 177, 0.5);
  background: rgba(41, 194, 177, 0.12);
}

.empty-state {
  padding: 24px;
  border-radius: var(--radius-lg);
  border: 1px dashed rgba(157, 183, 196, 0.28);
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
}

.footer-note {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(1, 8, 13, 0.68);
  display: grid;
  place-items: end center;
  z-index: 50;
  padding: 16px;
}

.modal {
  width: min(100%, 760px);
  max-height: 92vh;
  overflow: auto;
  border-radius: 26px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(9, 24, 34, 0.98), rgba(8, 18, 27, 0.98));
  box-shadow: 0 24px 72px rgba(0, 0, 0, 0.52);
}

.modal-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 18px 18px 0;
}

.modal-body {
  padding: 16px 18px 18px;
}

.modal-close {
  min-width: 42px;
  min-height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.toast-stack {
  position: fixed;
  right: 14px;
  bottom: 14px;
  z-index: 60;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 220px;
  max-width: min(92vw, 360px);
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(6, 16, 24, 0.96);
  box-shadow: var(--shadow);
}

.toast strong {
  display: block;
  margin-bottom: 4px;
}

.toast p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 13px;
}

.playback-bar {
  position: sticky;
  bottom: 0;
  margin-top: 16px;
  border-radius: 20px;
  border: 1px solid rgba(41, 194, 177, 0.28);
  background: linear-gradient(90deg, rgba(11, 31, 37, 0.98), rgba(12, 24, 35, 0.96));
  padding: 14px 16px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  box-shadow: var(--shadow);
}

.playback-label {
  color: var(--muted);
  font-size: 12px;
}

.playback-title {
  margin: 4px 0 0;
  font-size: 16px;
  font-weight: 700;
}

.playback-status {
  color: #cffcf7;
  font-size: 13px;
}

.playback-bar .btn {
  min-width: 96px;
}

.fab {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.38);
  z-index: 40;
  font-size: 30px;
  line-height: 1;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  letter-spacing: 0.02em;
}

@media (max-width: 980px) {
  .layout {
    grid-template-columns: 1fr;
  }

  .nav-panel {
    position: static;
  }

  .summary-card {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .topbar,
  .section-head,
  .task-top,
  .sound-top,
  .status-top,
  .panel-top,
  .playback-bar,
  .banner {
    grid-template-columns: 1fr;
    display: grid;
  }

  .topbar-actions,
  .toolbar {
    justify-content: flex-start;
  }

  .summary-card {
    grid-column: span 12;
  }

  .grid-2,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .modal-mask {
    align-items: end;
  }

  .toast-stack {
    left: 14px;
    right: 14px;
  }
}
