:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: #0f1218;
  --panel-2: #141924;
  --line: rgba(255, 255, 255, 0.16);
  --line-strong: rgba(255, 255, 255, 0.28);
  --text: #f5f7fa;
  --muted: #a8b0bc;
  --ok: #51d48c;
  --error: #ff7f7f;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: "Manrope", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(900px 420px at 10% 0%, rgba(255, 255, 255, 0.06), transparent 55%),
    radial-gradient(1200px 700px at 90% 12%, rgba(255, 255, 255, 0.05), transparent 60%),
    var(--bg);
}

.studio-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 16px;
}

.studio-topbar {
  width: min(1120px, 100%);
  margin: 0 auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(10, 12, 18, 0.92);
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 14px;
}

.studio-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 800;
}

.studio-brand img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.studio-nav {
  display: inline-flex;
  gap: 8px;
}

.studio-nav a {
  height: 36px;
  min-width: 88px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #111621;
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.93rem;
}

.studio-nav a.active,
.studio-nav a:hover {
  color: var(--text);
  border-color: var(--line-strong);
}

.studio-topbar-actions {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.studio-link-btn,
.studio-btn {
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101521;
  color: var(--text);
  text-decoration: none;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 700;
  cursor: pointer;
}

.studio-link-btn:hover,
.studio-btn:hover {
  border-color: var(--line-strong);
}

.studio-btn {
  background: #ffffff;
  color: #0b0e13;
  border-color: #ffffff;
}

.studio-btn:hover {
  background: #ececec;
}

.studio-btn.ghost {
  background: #101521;
  color: var(--text);
  border-color: var(--line);
}

.studio-main {
  width: min(1120px, 100%);
  margin: 14px auto 0;
}

.studio-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(11, 14, 20, 0.94);
  padding: 16px;
}

.studio-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.studio-panel-head h1 {
  margin: 0;
  font-size: clamp(1.25rem, 2.4vw, 1.8rem);
}

.studio-panel-head p {
  margin: 8px 0 0;
  color: var(--muted);
}

.studio-dropzone {
  margin-top: 14px;
  min-height: 150px;
  border: 2px dashed rgba(255, 255, 255, 0.24);
  border-radius: 14px;
  background: #111725;
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  cursor: pointer;
}

.studio-dropzone.dragover {
  border-color: #ffffff;
  background: #151d2d;
}

.studio-dropzone input {
  display: none;
}

.studio-dropzone i {
  font-size: 1.9rem;
}

.studio-dropzone span {
  color: var(--muted);
}

.studio-upload-summary {
  margin-top: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101521;
}

.studio-upload-summary-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--muted);
}

.studio-progress {
  margin-top: 8px;
  height: 8px;
  border-radius: 999px;
  background: #1a2231;
  overflow: hidden;
}

.studio-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ffffff, #a3bdf0);
}

.studio-upload-actions {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-upload-list {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.studio-upload-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101623;
  padding: 10px;
}

.studio-upload-item.done {
  border-color: rgba(81, 212, 140, 0.55);
}

.studio-upload-item.failed {
  border-color: rgba(255, 127, 127, 0.65);
}

.studio-upload-item-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.studio-upload-name {
  font-weight: 700;
  word-break: break-word;
}

.studio-upload-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.84rem;
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.studio-upload-item .studio-progress {
  margin-top: 8px;
}

.studio-archive-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.studio-archive-actions input {
  width: min(320px, 48vw);
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #101521;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.studio-archive-actions input:focus {
  border-color: var(--line-strong);
}

.studio-empty {
  margin-top: 12px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 18px;
  color: var(--muted);
}

.studio-files-grid {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.studio-file-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #101623;
  padding: 12px;
}

.studio-file-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.studio-file-name {
  font-weight: 700;
  word-break: break-word;
}

.studio-file-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.studio-file-actions {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.studio-file-actions button,
.studio-file-actions a {
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  text-decoration: none;
  padding: 0 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  cursor: pointer;
}

.studio-file-actions .danger {
  border-color: rgba(255, 127, 127, 0.6);
  color: #ffc8c8;
}

.studio-toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  max-width: 340px;
  z-index: 9999;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: #0f141f;
  color: var(--text);
  padding: 10px 12px;
}

.studio-toast.error {
  border-color: rgba(255, 127, 127, 0.7);
  background: #2d1419;
}

@media (max-width: 920px) {
  .studio-topbar {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .studio-topbar-actions {
    margin-left: 0;
    justify-content: flex-start;
  }

  .studio-panel-head {
    flex-direction: column;
  }

  .studio-archive-actions {
    width: 100%;
  }

  .studio-archive-actions input {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .studio-shell {
    padding: 10px;
  }

  .studio-nav {
    width: 100%;
  }

  .studio-nav a {
    flex: 1;
  }

  .studio-topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .studio-link-btn {
    width: 100%;
  }
}
