:root {
  --bg: #eef3f7;
  --bg-accent: #dfe8ee;
  --sidebar: #0d141a;
  --sidebar-soft: #131d25;
  --surface: #ffffff;
  --surface-soft: #f8fbfd;
  --surface-muted: #f2f6f8;
  --line: #d9e2e8;
  --line-strong: #c5d1d9;
  --text: #15202b;
  --muted: #60707d;
  --muted-strong: #42515d;
  --accent: #17b26a;
  --accent-strong: #0f8f54;
  --accent-soft: rgba(23, 178, 106, 0.12);
  --danger: #c24141;
  --shadow-lg: 0 28px 60px rgba(16, 24, 40, 0.08);
  --shadow-md: 0 16px 36px rgba(16, 24, 40, 0.06);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "Noto Sans SC", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(23, 178, 106, 0.08), transparent 22%),
    radial-gradient(circle at bottom right, rgba(56, 189, 248, 0.08), transparent 26%),
    linear-gradient(180deg, #f5f8fb 0%, #eef3f7 100%);
}

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

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 284px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  height: 100vh;
  padding: 1.25rem 1rem;
  color: #f4f8fb;
  background:
    radial-gradient(circle at top right, rgba(23, 178, 106, 0.12), transparent 24%),
    linear-gradient(180deg, #0b1117 0%, #101922 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  padding: 1.1rem 1rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.03));
}

.brand-kicker,
.panel-kicker,
.nav-label {
  font-family: "DM Sans", sans-serif;
}

.brand-kicker,
.panel-kicker {
  margin: 0;
  font-size: 0.82rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #8cf1bf;
}

.brand h1 {
  margin: 0.55rem 0 0;
  font-size: 2rem;
  line-height: 1;
}

.brand-copy {
  margin: 0.9rem 0 0;
  color: rgba(244, 248, 251, 0.72);
  line-height: 1.7;
}

.nav-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  align-items: flex-start;
  width: 100%;
  padding: 0.9rem 0.95rem 0.9rem 1rem;
  border: 1px solid transparent;
  border-radius: 16px;
  color: #f4f8fb;
  background: transparent;
  text-align: left;
  transition: transform 140ms ease, background 140ms ease, border-color 140ms ease;
}

.nav-item::before {
  content: "";
  position: absolute;
  left: 0.2rem;
  top: 0.55rem;
  bottom: 0.55rem;
  width: 3px;
  border-radius: 999px;
  background: transparent;
}

.nav-item:hover,
.nav-item:focus-visible {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  outline: none;
}

.nav-item.active {
  border-color: rgba(140, 241, 191, 0.2);
  background: linear-gradient(180deg, rgba(23, 178, 106, 0.14), rgba(255, 255, 255, 0.04));
}

.nav-item.active::before {
  background: linear-gradient(180deg, #20d07a, #0f8f54);
}

.nav-label {
  font-size: 1rem;
  font-weight: 700;
}

.nav-meta {
  color: rgba(244, 248, 251, 0.6);
  font-size: 0.88rem;
}

.sidebar-note {
  margin-top: auto;
  padding: 1rem;
  border-radius: 18px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.sidebar-note-title {
  margin: 0;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #8cf1bf;
}

.sidebar-note-body {
  margin: 0.65rem 0 0;
  color: rgba(244, 248, 251, 0.72);
  line-height: 1.7;
}

.main-panel {
  padding: 1.5rem;
}

.panel-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 1rem;
  align-items: stretch;
  padding: 1.25rem 1.3rem;
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: var(--radius-xl);
  background:
    linear-gradient(135deg, rgba(23, 178, 106, 0.06), rgba(56, 189, 248, 0.03)),
    rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
}

.panel-header h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.95rem, 3vw, 2.85rem);
  line-height: 1.02;
}

.panel-description {
  display: flex;
  align-items: center;
  margin: 0;
  padding: 0 0 0 1.1rem;
  border-left: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.75;
}

.view-stack {
  margin-top: 1rem;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.workgrid {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(360px, 0.94fr);
  gap: 1rem;
}

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

.surface {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(10px);
}

.surface.muted {
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.94), rgba(242, 246, 248, 0.96));
}

.surface h3,
.result-head h3 {
  margin: 0;
  font-size: 1.22rem;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.grid {
  display: grid;
  gap: 0.85rem;
}

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

.grid.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid.cols-6 {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.field span {
  color: var(--muted);
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  padding: 0.9rem 0.95rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(248, 251, 253, 0.9);
  outline: none;
  transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease;
}

input::placeholder,
textarea::placeholder {
  color: #8b98a3;
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(23, 178, 106, 0.55);
  box-shadow: 0 0 0 4px rgba(23, 178, 106, 0.12);
  background: #ffffff;
}

textarea {
  min-height: 7rem;
  resize: vertical;
}

.toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--muted-strong);
}

.toggle input {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.primary-button,
.secondary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0.84rem 1.2rem;
  font-weight: 700;
  text-decoration: none;
  transition: transform 140ms ease, box-shadow 140ms ease, opacity 140ms ease;
}

.primary-button:hover,
.secondary-button:hover,
.link-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  border: 0;
  color: #ffffff;
  background: linear-gradient(135deg, #17b26a, #0f8f54);
  box-shadow: 0 10px 22px rgba(23, 178, 106, 0.22);
}

.secondary-button,
.link-button {
  color: var(--muted-strong);
  background: #ffffff;
  border: 1px solid var(--line-strong);
}

.result-surface {
  min-height: 100%;
}

.result-head {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.result-head p {
  margin: 0;
  color: var(--muted);
}

.result-box {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 20rem;
  padding: 1rem;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, rgba(248, 251, 253, 0.96), rgba(243, 247, 250, 0.94));
}

.result-box.empty,
.result-box.loading {
  justify-content: center;
}

.result-box.empty {
  color: var(--muted);
}

.result-box.loading {
  color: var(--accent-strong);
}

.result-box.error {
  border-style: solid;
  border-color: rgba(194, 65, 65, 0.24);
  color: var(--danger);
}

.result-box.success {
  border-style: solid;
}

.result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
}

.media-card {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
}

.media-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--surface-muted);
}

.media-card figcaption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  color: var(--muted-strong);
  font-size: 0.9rem;
}

.asset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

audio {
  width: 100%;
}

.lyrics-preview {
  margin: 0;
  padding: 1rem;
  max-height: 21rem;
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.75;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
}

.info-list {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--muted-strong);
  line-height: 1.85;
}

@media (max-width: 1260px) {
  .workgrid,
  .workgrid.single,
  .grid.cols-6,
  .grid.cols-4,
  .grid.cols-3,
  .grid.cols-2,
  .panel-header {
    grid-template-columns: 1fr;
  }

  .panel-description {
    padding-left: 0;
    border-left: 0;
  }
}

@media (max-width: 960px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }
}

@media (max-width: 720px) {
  .sidebar,
  .main-panel {
    padding: 1rem;
  }

  .brand h1 {
    font-size: 1.7rem;
  }

  .surface,
  .panel-header {
    padding: 1rem;
  }
}
