:root {
  --ink: #19312c;
  --ink-soft: #435d56;
  --muted: #73847f;
  --pine: #315f52;
  --pine-deep: #23473e;
  --mist: #e8efeb;
  --cloud: #f2f6f3;
  --paper: #fbfcfa;
  --white: #ffffff;
  --line: #d8e1dc;
  --line-strong: #c4d1ca;
  --amber: #d98952;
  --amber-soft: #fbede2;
  --danger: #aa5149;
  --shadow: 0 16px 40px rgba(28, 55, 47, .08);
  --display: "Songti SC", "STSong", "Noto Serif CJK SC", serif;
  --body: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --data: "DIN Alternate", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--cloud);
  font-family: var(--body);
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid rgba(217, 137, 82, .28);
  outline-offset: 2px;
}

.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow {
  margin: 0;
  color: var(--pine);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .18em;
}

/* Login */
.login-shell {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  overflow: hidden;
  background: var(--mist);
}
.login-shell::before,
.login-shell::after {
  content: "";
  position: absolute;
  width: 34vw;
  height: 34vw;
  min-width: 340px;
  min-height: 340px;
  border: 1px solid rgba(49, 95, 82, .16);
  border-radius: 50%;
}
.login-shell::before { top: -19vw; right: -7vw; box-shadow: 0 0 0 52px rgba(255,255,255,.22), 0 0 0 104px rgba(255,255,255,.13); }
.login-shell::after { bottom: -23vw; left: -11vw; box-shadow: 0 0 0 52px rgba(49,95,82,.035), 0 0 0 104px rgba(49,95,82,.025); }
.login-card {
  position: relative;
  z-index: 1;
  width: min(440px, 100%);
  padding: 48px;
  border: 1px solid rgba(49, 95, 82, .15);
  border-radius: 12px 44px 12px 12px;
  background: rgba(251, 252, 250, .94);
  box-shadow: 0 28px 70px rgba(28, 55, 47, .14);
}
.login-card::before {
  content: "";
  display: block;
  width: 64px;
  height: 18px;
  margin-bottom: 30px;
  background: repeating-linear-gradient(90deg, var(--pine) 0 3px, transparent 3px 8px);
  transform: skewY(-8deg);
}
.login-card h1 {
  margin: 10px 0 8px;
  font-family: var(--display);
  font-size: clamp(30px, 5vw, 38px);
  font-weight: 600;
  letter-spacing: .03em;
}
.login-card > .muted { margin: 0 0 28px; }
.login-card label, .dialog-form label {
  display: grid;
  gap: 8px;
  margin-top: 18px;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
}
.login-card input, .dialog-form input, .dialog-form select, .dialog-form textarea {
  width: 100%;
  padding: 12px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  transition: border-color .18s, box-shadow .18s;
}
.login-card input:hover, .dialog-form input:hover, .dialog-form select:hover, .dialog-form textarea:hover { border-color: #9fb2a8; }
.login-card button[type="submit"] {
  width: 100%;
  margin-top: 8px;
  padding: 13px 18px;
  border: 0;
  border-radius: 8px;
  color: #fff;
  background: var(--pine);
  font-weight: 650;
  box-shadow: 0 8px 18px rgba(49, 95, 82, .18);
}
.error { min-height: 18px; color: var(--danger); font-size: 12px; }

/* Application frame */
.app {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
}
aside {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 28px 22px 24px;
  color: var(--ink);
  background: #dfe9e4;
  border-right: 1px solid rgba(49, 95, 82, .12);
}
.brand {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  align-items: start;
  padding: 7px 7px 27px;
  border-bottom: 1px solid rgba(49, 95, 82, .15);
}
.brand-mark {
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border-radius: 50%;
  color: white;
  background: var(--pine);
}
.brand-mark i { width: 2px; border-radius: 2px; background: #fff; }
.brand-mark i:nth-child(1), .brand-mark i:nth-child(5) { height: 8px; opacity: .65; }
.brand-mark i:nth-child(2), .brand-mark i:nth-child(4) { height: 16px; }
.brand-mark i:nth-child(3) { height: 23px; background: #f1b78f; }
.brand span, .brand strong { display: block; }
.brand span { color: var(--pine); font-size: 10px; font-weight: 650; letter-spacing: .16em; }
.brand strong { margin-top: 7px; font-size: 14px; font-weight: 650; line-height: 1.6; }
nav { display: grid; gap: 6px; margin-top: 25px; }
.nav, .ghost {
  border: 0;
  color: var(--ink-soft);
  background: transparent;
  font-weight: 550;
}
.nav {
  position: relative;
  display: grid;
  grid-template-columns: 29px 1fr;
  align-items: center;
  padding: 12px 13px;
  border-radius: 8px;
  text-align: left;
  transition: color .18s, background .18s, transform .18s;
}
.nav::after {
  content: "";
  position: absolute;
  right: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: transparent;
}
.nav-symbol { color: #66847a; font-family: var(--data); font-size: 17px; line-height: 1; }
.nav:hover { color: var(--ink); background: rgba(255, 255, 255, .43); transform: translateX(2px); }
.nav.active { color: white; background: var(--pine); box-shadow: 0 8px 18px rgba(49, 95, 82, .16); }
.nav.active .nav-symbol { color: #f3bd98; }
.nav.active::after { background: #f3bd98; }
.ghost {
  margin-top: auto;
  padding: 11px 13px;
  border: 1px solid rgba(49, 95, 82, .18);
  border-radius: 8px;
  text-align: center;
}
.ghost:hover { border-color: var(--pine); color: var(--pine); background: rgba(255,255,255,.38); }

main {
  min-width: 0;
  width: 100%;
  max-width: 1640px;
  margin: 0 auto;
  padding: 34px clamp(24px, 4vw, 64px) 110px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
header h2 {
  margin: 6px 0 0;
  font-family: var(--display);
  font-size: 30px;
  font-weight: 600;
  letter-spacing: .03em;
}
.header-status { display: flex; align-items: center; gap: 9px; color: var(--muted); font-family: var(--data); font-size: 12px; }
.status-pulse { width: 8px; height: 8px; border: 2px solid #fff; border-radius: 50%; background: #4e8a70; box-shadow: 0 0 0 3px rgba(78,138,112,.15); }

/* Overview thesis */
.welcome-panel {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, .8fr) minmax(540px, 1.2fr);
  gap: 48px;
  align-items: end;
  min-height: 285px;
  margin: 0 0 18px;
  padding: clamp(30px, 4vw, 54px);
  overflow: hidden;
  border: 0;
  border-radius: 10px 42px 10px 10px;
  color: white;
  background: var(--pine-deep);
  box-shadow: var(--shadow);
}
.welcome-panel::after {
  content: "";
  position: absolute;
  top: -80px;
  right: -60px;
  width: 290px;
  height: 290px;
  border: 1px solid rgba(255,255,255,.11);
  border-radius: 50%;
  box-shadow: 0 0 0 46px rgba(255,255,255,.025), 0 0 0 92px rgba(255,255,255,.018);
}
.welcome-copy { position: relative; z-index: 1; }
.welcome-panel .eyebrow { color: #f3bd98; }
.welcome-panel h3 {
  max-width: 520px;
  margin: 13px 0 17px;
  font-family: var(--display);
  font-size: clamp(27px, 3vw, 42px);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: .02em;
}
.welcome-panel .muted { max-width: 580px; margin: 0; color: #b9ccc4; line-height: 1.9; }
.sound-ribbon { position: relative; z-index: 1; }
.sound-wave {
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(7px, 1.2vw, 14px);
  padding: 0 8px 19px;
  border-bottom: 1px solid rgba(255,255,255,.16);
}
.sound-wave i { width: 4px; border-radius: 9px; background: #f1b78f; opacity: .88; }
.sound-wave i:nth-child(1), .sound-wave i:nth-child(11) { height: 14px; }
.sound-wave i:nth-child(2), .sound-wave i:nth-child(10) { height: 30px; }
.sound-wave i:nth-child(3), .sound-wave i:nth-child(9) { height: 50px; }
.sound-wave i:nth-child(4), .sound-wave i:nth-child(8) { height: 28px; }
.sound-wave i:nth-child(5), .sound-wave i:nth-child(7) { height: 68px; }
.sound-wave i:nth-child(6) { height: 84px; background: #fff; }
.flow { display: grid; grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr; align-items: center; gap: 9px; padding-top: 18px; }
.flow span { padding: 0; border-radius: 0; color: #d8e6e0; background: transparent; font-size: 12px; white-space: nowrap; }
.flow small { display: block; margin-bottom: 5px; color: #f1b78f; font-family: var(--data); font-size: 9px; letter-spacing: .12em; }
.flow b { color: rgba(255,255,255,.35); font-weight: 400; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 30px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}
.cards article {
  position: relative;
  padding: 24px 25px 22px;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}
.cards article:last-child { border-right: 0; }
.cards article::before { content: ""; position: absolute; top: 0; left: 25px; width: 30px; height: 3px; background: var(--pine); }
.cards article:last-child::before { background: var(--amber); }
.cards span { display: block; margin: 0 0 12px; color: var(--muted); font-size: 12px; }
.cards strong { display: inline-block; font-family: var(--data); font-size: 34px; font-weight: 600; letter-spacing: -.04em; }
.cards small { margin-left: 9px; color: #8b9a95; font-size: 11px; }

/* Shared content surfaces */
.page { animation: page-in .28s ease-out; }
@keyframes page-in { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.page-toolbar, .section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
}
.page-toolbar { padding: 4px 0 2px; }
.page-toolbar h3, .section-head h3 {
  margin: 0 0 6px;
  font-family: var(--display);
  font-size: 22px;
  font-weight: 600;
}
.page-toolbar p { margin: 0; font-size: 12px; }
.section-head { margin-top: 34px; }
.primary, .secondary, .upload-button {
  min-height: 39px;
  padding: 9px 15px;
  border-radius: 7px;
  font-weight: 600;
  transition: transform .16s, box-shadow .16s, border-color .16s, background .16s;
}
.primary { border: 1px solid var(--pine); color: white; background: var(--pine); box-shadow: 0 7px 15px rgba(49,95,82,.13); }
.primary:hover { background: var(--pine-deep); transform: translateY(-1px); box-shadow: 0 9px 20px rgba(49,95,82,.18); }
.secondary { border: 1px solid var(--line-strong); color: var(--ink); background: var(--white); }
.secondary:hover { border-color: var(--pine); color: var(--pine); }
.upload-button { color: white; background: var(--pine); }
.upload-button input { display: none; }
.park-grid, .list-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(230px, 1fr));
  gap: 14px;
  margin-bottom: 30px;
}
.park-card, .list-card {
  position: relative;
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  box-shadow: none;
}
.park-card::before { content: ""; position: absolute; top: 0; left: 0; width: 4px; height: 100%; background: #89a498; }
.park-card h3, .list-card h3 { margin: 0 0 8px; font-size: 16px; }
.park-card .code {
  display: inline-block;
  margin-top: 15px;
  padding: 5px 8px;
  border-radius: 4px;
  color: var(--pine);
  background: var(--mist);
  font-family: var(--data);
  font-size: 10px;
  letter-spacing: .06em;
}
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
table { width: 100%; border-collapse: collapse; }
th, td { padding: 15px 16px; text-align: left; border-bottom: 1px solid #e3e9e5; font-size: 13px; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #71827c;
  background: #edf2ef;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .04em;
  white-space: nowrap;
}
tbody tr { transition: background .14s; }
tbody tr:hover { background: #f5f8f6; }
tr:last-child td { border-bottom: 0; }
.state-online, .state-approved { color: #3c775e; font-weight: 600; }
.state-offline, .state-draft { color: #a06b3e; font-weight: 600; }
.notice { margin-bottom: 14px; padding: 12px 14px; border: 1px solid #cfddd5; border-radius: 7px; color: var(--pine); background: var(--mist); }
.action { padding: 5px 8px; border: 0; border-radius: 5px; color: var(--pine); background: transparent; font-size: 12px; }
.action:hover { background: var(--mist); }
.action.delete, .date-tag button { color: var(--danger); }
.empty-state, .empty-large {
  grid-column: 1 / -1;
  padding: 56px 28px;
  text-align: center;
  border: 1px dashed #b9c9c1;
  border-radius: 9px;
  color: var(--muted);
  background: rgba(251,252,250,.62);
}
.empty-state h3, .empty-large h3 { margin: 0 0 8px; font-family: var(--display); color: var(--ink); }

/* Playlist cards and scheduling */
.list-grid { align-items: start; }
.list-card { padding: 18px; transition: border-color .18s, box-shadow .18s, transform .18s; }
.list-card:hover { border-color: #b9c9c1; transform: translateY(-2px); box-shadow: 0 12px 26px rgba(28,55,47,.06); }
.list-card.is-expanded { border-color: #9fb4a9; box-shadow: var(--shadow); transform: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.playlist-summary { min-width: 0; flex: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 2px 0; border: 0; text-align: left; color: var(--ink); background: transparent; }
.playlist-summary > span:first-child { min-width: 0; }
.playlist-name { display: block; margin-bottom: 7px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-family: var(--display); font-size: 17px; font-weight: 600; }
.expand-indicator { flex: none; color: var(--pine); font-size: 11px; }
.round-play, .player-main-button {
  display: grid;
  place-items: center;
  flex: none;
  border: 0;
  border-radius: 50%;
  color: white;
  background: var(--pine);
  box-shadow: 0 6px 14px rgba(49,95,82,.18);
}
.round-play { width: 40px; height: 40px; }
.round-play:hover, .player-main-button:hover { background: var(--pine-deep); transform: scale(1.03); }
.card-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 2px; margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--line); }
.playlist-tracks { display: grid; gap: 5px; max-height: 340px; margin: 14px 0 0; padding-top: 13px; overflow: auto; border-top: 1px solid var(--line); }
.track-button { display: flex; align-items: center; gap: 9px; width: 100%; padding: 9px 10px; border: 0; border-radius: 6px; text-align: left; color: var(--ink); background: #f1f5f2; }
.track-button:hover { background: var(--mist); }
.track-button.is-current { color: var(--pine-deep); background: #dbe9e1; box-shadow: inset 3px 0 var(--amber); font-weight: 600; }
.track-number { min-width: 22px; color: var(--muted); font-family: var(--data); }
.track-duration { margin-left: auto; color: var(--muted); font-family: var(--data); font-size: 10px; }
.sort-handle, .row-drag-handle { color: #849891; }
.sort-handle:hover, .row-drag-handle:hover { color: var(--pine); }
.priority-badge { display: inline-block; padding: 4px 8px; border-radius: 4px; color: #8a4f28; background: var(--amber-soft); font-size: 11px; }

/* Release journey */
.release-guide {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
}
.release-guide span { padding: 8px 11px; border-radius: 5px; color: var(--pine); background: var(--mist); font-size: 12px; text-align: center; }
.release-guide b { color: #91a39a; font-weight: 400; }
.target-list { gap: 8px; }
.target-list label { border-radius: 7px; background: #f5f8f6; }
.target-list label:has(input:checked) { border-color: #8fa99c; color: var(--pine); background: var(--mist); }
.playlist-upload { border-radius: 8px !important; color: var(--pine) !important; background: #f2f7f3 !important; }
.playlist-upload:hover { border-color: var(--pine) !important; background: var(--mist) !important; }
.duration-summary { border-radius: 7px; color: var(--pine); background: var(--mist); }
.editor-list { border-radius: 7px; }
.editor-item { background: var(--paper); }
.editor-item:hover { background: #f4f7f5; }
.date-tag { border-radius: 5px; background: var(--mist); }

/* Dialogs and feedback */
dialog {
  width: min(680px, calc(100% - 30px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 10px 28px 10px 10px;
  color: var(--ink);
  background: var(--paper);
  box-shadow: 0 28px 85px rgba(20, 43, 36, .3);
}
dialog::backdrop { background: rgba(19, 40, 34, .62); backdrop-filter: blur(3px); }
.dialog-form { padding: 30px; }
.dialog-head { display: flex; justify-content: space-between; gap: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.dialog-head h2 { margin: 5px 0 0; font-family: var(--display); font-weight: 600; }
.close { width: 36px; height: 36px; border: 0; border-radius: 50%; color: var(--muted); background: var(--mist); font-size: 22px; }
.close:hover { color: white; background: var(--pine); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 9px; margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); }
.field-title { color: var(--ink-soft); font-weight: 600; }
.weekdays label { border-radius: 6px; background: #f5f8f6; }
.weekdays label:has(input:checked) { border-color: #93aa9f; color: var(--pine); background: var(--mist); }
.device-control-buttons { padding: 15px; border-radius: 8px; background: #f1f5f2; }
.danger-control { color: var(--danger); border-color: #e4c8c3; }
.toast { right: 28px; bottom: 26px; padding: 12px 17px; border-radius: 7px; color: #fff; background: var(--pine-deep); box-shadow: 0 12px 30px rgba(20,43,36,.22); }
.bottom-player {
  right: 28px;
  bottom: 22px;
  left: 306px;
  padding: 14px 17px;
  border: 1px solid #b9c9c1;
  border-radius: 10px;
  background: rgba(251,252,250,.97);
  box-shadow: 0 18px 48px rgba(23,49,41,.18);
  backdrop-filter: blur(12px);
}
.player-main-button { width: 44px; height: 44px; }
.progress-row input { accent-color: var(--amber); }

@media (max-width: 1180px) {
  .welcome-panel { grid-template-columns: 1fr; gap: 26px; }
  .sound-wave { justify-content: center; }
  .park-grid, .list-grid { grid-template-columns: repeat(2, minmax(230px, 1fr)); }
}

@media (max-width: 900px) {
  .app { display: block; }
  aside {
    position: relative;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid rgba(49,95,82,.14);
  }
  .brand { max-width: calc(100% - 90px); padding: 3px 3px 15px; border-bottom: 0; }
  nav { display: flex; gap: 6px; margin-top: 12px; padding-bottom: 2px; overflow-x: auto; }
  .nav { flex: none; grid-template-columns: 22px auto; padding: 10px 12px; white-space: nowrap; }
  .nav::after { display: none; }
  .ghost { position: absolute; top: 18px; right: 16px; margin: 0; }
  main { padding: 25px 18px 100px; }
  .bottom-player { right: 14px; bottom: 12px; left: 14px; }
}

@media (max-width: 680px) {
  .login-shell { padding: 18px; }
  .login-card { padding: 34px 24px; border-radius: 10px 30px 10px 10px; }
  header { align-items: flex-end; }
  header h2 { font-size: 25px; }
  .header-status { display: none; }
  .welcome-panel { min-height: 0; padding: 28px 22px; border-radius: 9px 28px 9px 9px; }
  .welcome-panel h3 { font-size: 27px; }
  .sound-wave { height: 65px; transform: scale(.8); }
  .flow { grid-template-columns: 1fr 1fr; gap: 12px; }
  .flow b { display: none; }
  .flow span { padding-bottom: 9px; border-bottom: 1px solid rgba(255,255,255,.12); }
  .cards { grid-template-columns: 1fr 1fr; }
  .cards article:nth-child(2) { border-right: 0; }
  .cards article:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .park-grid, .list-grid { grid-template-columns: 1fr; }
  .page-toolbar, .section-head { align-items: stretch; flex-direction: column; }
  .page-toolbar > button { align-self: flex-start; }
  .release-guide { grid-template-columns: 1fr 1fr; }
  .release-guide b { display: none; }
  .target-list { grid-template-columns: 1fr; }
  .dialog-form { padding: 23px 18px; }
}

@media (max-width: 430px) {
  .brand strong { font-size: 12px; }
  .brand-mark { width: 34px; height: 34px; }
  main { padding-inline: 13px; }
  .cards { grid-template-columns: 1fr; }
  .cards article { border-right: 0; border-bottom: 1px solid var(--line); }
  .cards article:nth-child(3) { border-bottom: 1px solid var(--line); }
  .cards article:last-child { border-bottom: 0; }
  .bottom-player { grid-template-columns: auto 1fr; }
  .bottom-player > .secondary { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
