:root {
  color-scheme: light;
  --surface-canvas: #f6f7f3;
  --surface-panel: #fbfaf6;
  --surface-sidebar: #202720;
  --surface-sidebar-active: #2d3a31;
  --surface-subtle: #eef2ec;
  --surface-muted: #e8ede6;
  --border-subtle: #d8ddd4;
  --border-strong: #c9d0c4;
  --text-primary: #26312a;
  --text-strong: #162018;
  --text-muted: #69746c;
  --text-inverse: #f3f6ef;
  --accent: #a855f7;
  --accent-strong: #8f5cf0;
  --accent-soft: #efe7fb;
  --success: #21855b;
  --success-soft: #e4f3ea;
  --info: #2a6f86;
  --info-soft: #e0f0f4;
  --warning: #b67619;
  --warning-soft: #f8ecd2;
  --danger: #bd3e38;
  --danger-soft: #f6e4e2;
  --shadow-soft: 0 18px 42px rgba(24, 32, 24, 0.08);
  --shadow-medium: 0 24px 56px rgba(24, 32, 24, 0.12);
  --radius-lg: 12px;
  --radius-md: 10px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #f6f7f3 0%, #edf1ec 100%);
  color: var(--text-primary);
  font-family: "Geist", "Inter", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

img,
video,
audio,
iframe {
  max-width: 100%;
}

.page-shell {
  min-height: 100vh;
}

.page-shell--app {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-height: 100vh;
  padding: 28px 18px 24px;
  background: linear-gradient(180deg, #252d26 0%, #202720 100%);
  border-right: 1px solid rgba(255, 255, 255, 0.11);
}

.sidebar__brand {
  width: 100%;
}

.sidebar-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.sidebar-brand__wordmark {
  color: #fff;
  font-family: "Anton", "Geist", sans-serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.4px;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-nav {
  width: 100%;
}

.sidebar-nav__list {
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar-nav__link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #c8c1d2;
  text-decoration: none;
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.sidebar-nav__link:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-nav__link.is-active {
  border-radius: 9999px;
  background: var(--accent-strong);
  color: #fff;
  box-shadow: 0 10px 24px rgba(143, 92, 240, 0.24);
}

.sidebar-nav__icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: none;
}

.sidebar-nav__icon svg {
  display: block;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sidebar-nav__label {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1;
  white-space: nowrap;
}

.sidebar-nav__link.is-active .sidebar-nav__label {
  font-weight: 700;
}

.sidebar-spacer {
  flex: 1;
  min-height: 24px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 20px;
  color: rgba(243, 246, 239, 0.58);
  font-family: "Inter", sans-serif;
  font-size: 11px;
  font-weight: 600;
}

.workspace {
  min-width: 0;
  background: linear-gradient(180deg, #f6f7f3 0%, #eef1ec 100%);
}

.workspace__content {
  width: 100%;
  min-height: 100vh;
  padding: 20px clamp(20px, 4.5vw, 96px) 32px;
}

.hero-grid,
.two-column {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(320px, 0.84fr);
  gap: 16px;
  align-items: start;
}

.panel,
.feature-card,
.work-card,
.empty-card,
.state-card {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-panel);
  box-shadow: var(--shadow-soft);
}

.panel {
  padding: 18px;
}

.panel--flat {
  box-shadow: none;
  background: transparent;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.page-title {
  margin: 0;
  color: var(--text-strong);
  font-family: "Anton", "Geist", "Noto Sans SC", sans-serif;
  font-size: clamp(30px, 4.6vw, 50px);
  font-weight: 400;
  line-height: 0.96;
  letter-spacing: 0;
}

.page-subtitle {
  max-width: 720px;
  margin: 16px 0 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.7;
}

.action-row,
.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 18px;
}

.form-stack {
  display: grid;
  gap: 16px;
}

.field-label {
  display: grid;
  gap: 8px;
  color: var(--text-primary);
  font-weight: 700;
}

.text-input,
.text-area {
  width: 100%;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

.text-input {
  min-height: 46px;
  padding: 0 14px;
}

.text-area {
  min-height: 152px;
  padding: 14px 16px;
  resize: vertical;
  line-height: 1.7;
}

.text-input:focus,
.text-area:focus {
  border-color: rgba(168, 85, 247, 0.56);
  box-shadow: 0 0 0 4px rgba(168, 85, 247, 0.12);
}

.tag-groups {
  display: grid;
  gap: 16px;
}

.tag-group {
  display: grid;
  gap: 10px;
}

.tag-group-title {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-chip {
  border: 1px solid var(--border-subtle);
  border-radius: 9999px;
  background: #fff;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px 12px;
  transition: transform 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, color 0.16s ease;
}

.tag-chip:hover {
  transform: translateY(-1px);
}

.tag-chip.is-selected {
  border-color: rgba(168, 85, 247, 0.36);
  background: rgba(168, 85, 247, 0.12);
  color: var(--accent-strong);
}

.ghost-button,
.primary-button,
.secondary-button,
.danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 9999px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

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

.primary-button {
  background: linear-gradient(180deg, #a855f7 0%, #8f5cf0 100%);
  color: #fff;
  box-shadow: 0 14px 24px rgba(143, 92, 240, 0.22);
}

.secondary-button {
  border: 1px solid var(--border-subtle);
  background: var(--surface-panel);
  color: var(--text-primary);
}

.ghost-button {
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-primary);
}

.danger-button {
  background: rgba(189, 62, 56, 0.12);
  color: var(--danger);
}

button:disabled,
.is-disabled {
  cursor: not-allowed;
  opacity: 0.54;
  transform: none;
}

.status-badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 700;
}

.status-badge--neutral {
  background: rgba(38, 49, 42, 0.08);
  color: var(--text-muted);
}

.status-badge--running {
  background: rgba(42, 111, 134, 0.14);
  color: var(--info);
}

.status-badge--ready,
.status-badge--success {
  background: rgba(33, 133, 91, 0.14);
  color: var(--success);
}

.status-badge--warn {
  background: rgba(182, 118, 25, 0.14);
  color: var(--warning);
}

.status-badge--error {
  background: rgba(189, 62, 56, 0.14);
  color: var(--danger);
}

.state-card,
.empty-card {
  padding: 18px;
}

.state-card--loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
}

.state-card--error {
  border-color: rgba(189, 62, 56, 0.22);
  background: rgba(189, 62, 56, 0.08);
  color: var(--danger);
}

.empty-card {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
}

.empty-card strong {
  color: var(--text-primary);
}

.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(38, 49, 42, 0.16);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.qr-box {
  min-height: 320px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(38, 49, 42, 0.2);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.74);
  overflow: hidden;
}

.qr-box iframe {
  max-width: 100%;
}

.work-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 16px;
}

.work-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  text-align: left;
  cursor: pointer;
}

.work-card h3 {
  margin: 0;
  color: var(--text-strong);
  font-size: 19px;
  line-height: 1.2;
}

.work-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.65;
}

.work-card .meta {
  color: var(--text-muted);
}

.work-card.is-selected {
  border-color: rgba(143, 92, 240, 0.38);
  box-shadow: 0 16px 40px rgba(143, 92, 240, 0.12);
}

.audio-player {
  width: 100%;
  margin-top: 12px;
}

.lyrics-box {
  max-height: 420px;
  overflow: auto;
  padding: 18px;
  border-radius: var(--radius-md);
  background: rgba(38, 49, 42, 0.05);
  color: var(--text-primary);
  line-height: 1.8;
  white-space: pre-wrap;
}

.meta,
.form-hint {
  color: var(--text-muted);
  font-size: 12px;
}

.stage-list {
  display: grid;
  gap: 12px;
  margin: 26px 0;
}

.stage-item {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: start;
  color: var(--text-muted);
}

.stage-dot {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: 50%;
  background: var(--surface-panel);
}

.stage-item.is-active,
.stage-item.is-done {
  color: var(--text-primary);
}

.stage-item.is-done .stage-dot,
.stage-item.is-active .stage-dot {
  border-color: rgba(143, 92, 240, 0.42);
  background: rgba(143, 92, 240, 0.12);
}

.panel .action-row,
.panel .button-row {
  margin-top: 16px;
}

.panel h2,
.work-card h3,
.empty-card strong {
  font-family: "Geist", "Inter", "Noto Sans SC", sans-serif;
}

.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 140px;
  padding: 20px 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(20, 24, 21, 0.92), rgba(20, 24, 21, 0.72)),
    url('/assets/create-header.png') center/cover no-repeat;
  box-shadow: 0 18px 40px rgba(24, 32, 24, 0.16);
  color: #fff;
}

.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(13, 15, 15, 0.12), rgba(13, 15, 15, 0));
  pointer-events: none;
}

.page-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  min-height: 100px;
}

.page-hero__copy {
  display: grid;
  gap: 6px;
  max-width: 720px;
}

.page-hero__eyebrow {
  margin: 0;
  color: #d9c5ff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.page-hero__title {
  margin: 0;
  color: #fff;
  font-family: "Anton", "Geist", sans-serif;
  font-size: clamp(30px, 4vw, 40px);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0.2px;
  text-transform: uppercase;
}

.page-hero__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.6;
}

.page-hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.page-hero__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 9999px;
  background: var(--accent);
  color: #fff;
  box-shadow: 0 10px 24px rgba(168, 85, 247, 0.28);
  text-decoration: none;
  cursor: pointer;
}

.page-hero__button--ghost {
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}

.page-hero__button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-card {
  padding: 18px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  background: var(--surface-panel);
  box-shadow: var(--shadow-soft);
}

.section-stack {
  display: grid;
  gap: 16px;
}

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

.section-title-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.section-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-title {
  margin: 0;
  color: var(--text-strong);
  font-family: "Anton", "Geist", sans-serif;
  font-size: 24px;
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: 0.2px;
}

.section-counter {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
}

.mode-pill-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border-radius: 9999px;
  background: var(--surface-muted);
}

.mode-pill,
.mode-pill-active {
  display: grid;
  place-items: center;
  min-height: 60px;
  border-radius: 9999px;
  text-align: center;
}

.mode-pill-active {
  background: #262a33;
  color: #fff;
}

.mode-pill {
  background: transparent;
  color: var(--text-strong);
}

.mode-pill__text {
  font-family: "Geist", "Inter", sans-serif;
  font-size: 15px;
  font-weight: 850;
}

.text-card {
  display: grid;
  gap: 8px;
  min-height: 86px;
  padding: 16px;
  border-radius: 12px;
  background: #e7e5e8;
}

.text-card--dark {
  background: #262a33;
  color: #fff;
}

.text-card__title {
  margin: 0;
  color: var(--text-strong);
  font-size: 16px;
  line-height: 1.45;
}

.text-card__hint {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
}

.progress-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  border-radius: 12px;
  background: #e7e5e8;
}

.progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 9999px;
  background: #fff;
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.player-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border-radius: 12px;
  background: #262a33;
  color: #fff;
}

.player-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.player-play {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 9999px;
  background: var(--accent);
}

.player-play svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.player-copy {
  display: grid;
  gap: 3px;
  width: 220px;
}

.player-title {
  margin: 0;
  font-size: 14px;
  font-weight: 850;
}

.player-meta {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.waveform {
  height: 8px;
  overflow: hidden;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.2);
}

.waveform__fill {
  height: 100%;
  width: 48%;
  border-radius: inherit;
  background: var(--accent);
}

.primary-button--light {
  background: #fff;
  color: var(--text-strong);
}

.button-icon {
  display: inline-flex;
}

.button-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toast-region {
  position: fixed;
  left: 50%;
  bottom: 46px;
  z-index: 20;
  transform: translateX(-50%);
}

.toast {
  padding: 12px 16px;
  border-radius: 9999px;
  background: #202720;
  color: #fff;
  box-shadow: 0 14px 40px rgba(33, 26, 19, 0.22);
}

.toast--error {
  background: var(--danger);
}

.toast--success {
  background: var(--success);
}

.toast--info {
  background: var(--surface-sidebar);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1180px) {
  .page-shell--app {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

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

  .sidebar {
    min-height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  }

  .workspace__content {
    padding-inline: 16px;
  }

  .hero-grid,
  .two-column {
    grid-template-columns: 1fr;
  }

  .page-hero__content {
    flex-direction: column;
    align-items: start;
  }

}

@media (max-width: 640px) {
  .sidebar-nav__list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sidebar-nav__link {
    justify-content: center;
  }

  .sidebar-nav__label {
    white-space: normal;
  }

  .page-title {
    font-size: clamp(28px, 11vw, 40px);
  }

  .page-hero {
    padding: 18px;
  }

  .section-head,
  .page-hero__content {
    flex-direction: column;
    align-items: start;
  }

  .player-row {
    align-items: start;
    flex-wrap: wrap;
  }
}
