:root {
  color-scheme: light;
  --bg: #ffffff;
  --bg-soft: #f7faff;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --text: #141b2d;
  --muted: #667085;
  --line: rgba(15, 23, 42, 0.09);
  --line-strong: rgba(15, 23, 42, 0.15);
  --blue: #0b67ff;
  --cyan: #36d6ff;
  --green: #14b87a;
  --purple: #6f42ff;
  --danger: #c03744;
  --shadow: 0 18px 44px rgba(20, 34, 80, 0.1);
  --shadow-strong: 0 28px 80px rgba(20, 34, 80, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(11, 103, 255, 0.1), transparent 27%),
    radial-gradient(circle at 90% 15%, rgba(54, 214, 255, 0.1), transparent 22%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 44%, #ffffff 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

img {
  display: block;
  max-width: 100%;
}

.container {
  width: min(calc(100% - 40px), 1200px);
  margin: 0 auto;
}

.gradient-text {
  background: linear-gradient(135deg, var(--blue), var(--purple) 52%, var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.scroll-progress {
  position: fixed;
  inset: 0 auto auto 0;
  width: 100%;
  height: 3px;
  transform: scaleX(var(--scroll-progress, 0));
  transform-origin: left center;
  background: linear-gradient(90deg, var(--blue), var(--purple), var(--cyan));
  z-index: 10;
}

.navbar,
.appbar {
  position: sticky;
  top: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.navbar-inner,
.appbar {
  min-height: 86px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}

.appbar {
  padding: 0 24px;
}

.brand,
.nav-actions,
.appbar-actions,
.hero-actions,
.hero-note,
.toolbar-actions,
.action-row {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand {
  gap: 12px;
  font-weight: 800;
}

.brand-logo {
  width: auto;
  height: 36px;
  max-width: 160px;
  object-fit: contain;
}

.brand-text {
  color: #213049;
}

.nav-actions {
  color: #425066;
  font-weight: 600;
}

.button,
.icon-btn,
.tab {
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 44px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease, background-color 0.18s ease;
}

.button.primary {
  border-color: transparent;
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 16px 34px rgba(11, 103, 255, 0.2);
}

.button.secondary,
.button.ghost,
.icon-btn,
.tab {
  background: #fff;
  color: #425066;
}

.button.compact {
  min-height: 38px;
  padding: 0 12px;
}

.button.full {
  width: 100%;
}

.button:hover,
.icon-btn:hover,
.tab:hover {
  transform: translateY(-1px);
  border-color: rgba(11, 103, 255, 0.22);
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
}

.icon-btn {
  width: 48px;
  padding: 0;
  font-weight: 800;
}

.icon-btn.active,
.tab.active {
  color: #fff;
  border-color: transparent;
  background: #0b67ff;
}

.hero {
  min-height: calc(100vh - 86px);
  display: flex;
  align-items: center;
  padding: 38px 0 46px;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(420px, 1.05fr);
  align-items: center;
  gap: 42px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  display: grid;
  gap: 4px;
  font-size: 3.35rem;
  line-height: 1;
  letter-spacing: 0;
}

.hero p,
.section-head p,
.workflow p,
.feature-card p,
.placeholder-box p {
  color: var(--muted);
  line-height: 1.85;
}

.hero-copy > p:not(.eyebrow) {
  max-width: 760px;
  margin: 24px 0 0;
  font-size: 1.06rem;
}

.hero-actions {
  margin-top: 30px;
  flex-wrap: wrap;
}

.hero-note {
  margin-top: 24px;
  flex-wrap: wrap;
  color: #52607a;
}

.hero-note span::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--blue);
}

.hero-stage {
  position: relative;
  min-height: 520px;
  perspective: 1100px;
}

.media-frame {
  position: absolute;
  border: 1px solid rgba(11, 103, 255, 0.12);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(242, 248, 255, 0.85)),
    repeating-linear-gradient(90deg, rgba(11, 103, 255, 0.12) 0 1px, transparent 1px 34px);
  box-shadow: var(--shadow-strong);
  transform-style: preserve-3d;
}

.frame-a {
  inset: 34px 44px 86px 12px;
  transform: rotateY(-18deg) rotateX(6deg);
}

.frame-b {
  inset: 90px 10px 46px 160px;
  transform: translateZ(80px) rotateY(-12deg);
  background:
    linear-gradient(135deg, rgba(11, 103, 255, 0.88), rgba(54, 214, 255, 0.72)),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.2) 0 2px, transparent 2px 28px);
}

.frame-c {
  inset: 250px 190px 0 74px;
  transform: translateZ(130px) rotateY(8deg);
}

.section {
  padding: 96px 0;
}

.section.alt {
  background: linear-gradient(180deg, #f8fbff, #ffffff);
}

.section-head {
  max-width: 780px;
  margin: 0 auto 46px;
  text-align: center;
}

.section-head h1,
.section-head h2,
.workflow h2 {
  margin: 0;
  font-size: 3rem;
}

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

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

.feature-card,
.panel,
.viewer-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.feature-card {
  padding: 28px;
}

.feature-card span {
  width: 50px;
  height: 50px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--blue);
  font-weight: 800;
  background: linear-gradient(135deg, rgba(11, 103, 255, 0.1), rgba(54, 214, 255, 0.16));
}

.feature-card h3 {
  margin: 22px 0 0;
}

.muted-card {
  background: rgba(247, 250, 255, 0.85);
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(360px, 1.1fr);
  gap: 38px;
  align-items: center;
}

.workflow-list {
  display: grid;
  gap: 14px;
}

.workflow-list div,
.resource-strip article,
.status-card,
.placeholder-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
}

.workflow-list div {
  min-height: 68px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  gap: 16px;
}

.workflow-list strong {
  color: var(--blue);
}

.footer {
  padding: 30px 0 44px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  color: var(--muted);
}

.player-body {
  background: #f6f9ff;
}

.studio {
  width: min(calc(100% - 32px), 1440px);
  margin: 24px auto 38px;
  display: grid;
  grid-template-columns: 420px minmax(0, 1fr);
  gap: 20px;
}

.panel,
.viewer-panel {
  padding: 22px;
}

.panel-head h1,
.panel-head h2,
.viewer-toolbar h2 {
  margin: 0;
}

.panel-head.small {
  margin-bottom: 14px;
}

.tabs {
  margin: 20px 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.media-mode-switch {
  margin: 0 0 14px;
  padding: 4px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7faff;
}

.mode-chip {
  min-height: 38px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #52607a;
  cursor: pointer;
  font-weight: 800;
}

.mode-chip.active {
  color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 10px 22px rgba(11, 103, 255, 0.16);
}

.tab-page {
  display: none;
}

.tab-page.active {
  display: grid;
  gap: 14px;
}

.upload-drop {
  min-height: 166px;
  padding: 22px;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(11, 103, 255, 0.24);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f4f8ff);
  position: relative;
  cursor: pointer;
}

.upload-drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.upload-drop small,
.resource-meta,
.panel-head.small p,
.status-card small,
.resource-strip span {
  color: var(--muted);
}

.field,
.form-grid {
  display: grid;
  gap: 8px;
}

.field span {
  font-weight: 700;
  color: #33405a;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(11, 103, 255, 0.16);
  border-color: rgba(11, 103, 255, 0.38);
}

.field-row.tight {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.divider {
  height: 1px;
  background: var(--line);
  margin: 22px 0;
}

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

.action-row {
  margin-top: 18px;
}

.action-row .button {
  flex: 1;
}

#convert-document {
  margin-top: 10px;
}

.status-card {
  margin-top: 14px;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.status-card.error {
  border-color: rgba(192, 55, 68, 0.28);
  color: var(--danger);
}

.status-card.success {
  border-color: rgba(20, 184, 122, 0.3);
}

.status-card a {
  color: var(--blue);
  font-weight: 700;
  word-break: break-all;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.placeholder-box {
  padding: 18px;
}

.viewer-panel {
  min-height: calc(100vh - 134px);
  display: grid;
  grid-template-rows: auto minmax(360px, 1fr) auto;
  gap: 16px;
}

.viewer-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.viewer {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(248, 251, 255, 0.95), rgba(255, 255, 255, 0.95)),
    repeating-linear-gradient(90deg, rgba(11, 103, 255, 0.08) 0 1px, transparent 1px 36px);
  display: grid;
  place-items: center;
  min-height: 420px;
}

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

.empty-state {
  display: grid;
  gap: 8px;
  text-align: center;
}

.viewer img,
.viewer video,
.viewer canvas,
.viewer iframe {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 260px);
  object-fit: contain;
  border: 0;
  background: #05070c;
}

.viewer iframe {
  min-height: 620px;
  background: #fff;
}

.viewer.course-page-player {
  display: grid;
  place-items: center;
}

.viewer.course-page-player canvas {
  display: block;
  width: 100%;
  height: 100%;
  background: #fff;
  object-fit: contain;
}

.course-player-loading {
  position: absolute;
  z-index: 2;
  padding: 10px 14px;
  border-radius: 4px;
  background: rgba(4, 9, 20, 0.76);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.course-page-counter {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  min-width: 58px;
  padding: 6px 10px;
  border-radius: 4px;
  background: rgba(4, 9, 20, 0.76);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.fullscreen-player .viewer.course-page-player canvas {
  object-fit: fill;
}

.viewer.three-d-player {
  border-color: rgba(11, 103, 255, 0.26);
  background:
    linear-gradient(135deg, rgba(5, 8, 18, 0.96), rgba(14, 31, 66, 0.94)),
    repeating-linear-gradient(90deg, rgba(54, 214, 255, 0.18) 0 1px, transparent 1px 18px);
}

.player-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 2;
  min-height: 32px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(5, 9, 20, 0.62);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  backdrop-filter: blur(10px);
}

.viewer.stereo img,
.viewer.stereo video {
  filter: none;
  transform: none;
  box-shadow: none;
}

.viewer.layout-sbs img,
.viewer.layout-sbs video {
  object-fit: contain;
}

.viewer.layout-tb img,
.viewer.layout-tb video {
  object-fit: contain;
}

.viewer.layout-row img,
.viewer.layout-row video,
.viewer.layout-column img,
.viewer.layout-column video {
  image-rendering: auto;
}

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

.resource-strip article {
  padding: 14px 16px;
  display: grid;
  gap: 6px;
}

.resource-strip strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1100px) {
  .hero-grid,
  .workflow,
  .studio {
    grid-template-columns: 1fr;
  }

  .hero-stage {
    min-height: 380px;
  }

  .hero h1 {
    font-size: 3.2rem;
  }

  .section-head h1,
  .section-head h2,
  .workflow h2 {
    font-size: 2.55rem;
  }

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

@media (max-width: 720px) {
  .container,
  .studio {
    width: min(calc(100% - 24px), 1200px);
  }

  .navbar-inner,
  .appbar,
  .footer-inner,
  .viewer-toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-actions,
  .appbar-actions,
  .hero-actions,
  .action-row {
    width: 100%;
    flex-wrap: wrap;
  }

  .button,
  .action-row .button {
    width: 100%;
  }

  .hero {
    min-height: auto;
  }

  .hero h1 {
    font-size: 3.1rem;
  }

  .feature-grid,
  .feature-grid.three,
  .form-grid,
  .resource-strip,
  .field-row.tight {
    grid-template-columns: 1fr;
  }
}

.workbench-body {
  min-height: 100vh;
  background: #f4f7fb;
  color: #172033;
}

.workbench-topbar {
  height: 72px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.workbench-brand,
.workbench-actions,
.resource-actions,
.player-drawer-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.workbench-brand img {
  width: auto;
  height: 40px;
}

.workbench-brand strong {
  color: #2563eb;
  font-size: 22px;
}

.workbench-shell {
  display: grid;
  grid-template-columns: 316px minmax(0, 1fr);
  min-height: calc(100vh - 72px);
}

.workbench-sidebar {
  padding: 26px 16px;
  background: linear-gradient(180deg, #ffffff, #f7fbff);
  border-right: 1px solid rgba(15, 23, 42, 0.08);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.side-menu {
  width: 100%;
  min-height: 62px;
  padding: 0 22px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #172033;
  text-align: left;
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
}

.side-menu.active {
  color: #fff;
  background: #2f6df0;
}

.storage-panel {
  margin-top: auto;
  padding: 18px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #f8fbff;
  color: #64748b;
}

.storage-panel strong {
  color: #172033;
}

.workbench-main {
  padding: 28px 32px 46px;
}

.resource-head {
  min-height: 112px;
  padding: 24px 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 16px 44px rgba(15, 23, 42, 0.06);
}

.resource-head h1 {
  margin: 0;
  font-size: 28px;
}

.resource-head p {
  margin: 8px 0 0;
  color: #64748b;
}

.resource-grid {
  margin-top: 18px;
  display: grid;
  grid-template-columns: repeat(4, minmax(240px, 1fr));
  gap: 20px;
}

.resource-card {
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.resource-card.upload-running {
  border-color: rgba(47, 109, 240, 0.24);
}

.resource-card.upload-failed {
  border-color: rgba(209, 67, 67, 0.32);
}

.workspace-entry {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: 220px;
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.workspace-entry strong {
  color: #172033;
  font-size: 22px;
}

.workspace-entry span {
  color: #64748b;
  font-size: 15px;
  line-height: 1.7;
}

.workspace-entry .button {
  align-self: end;
  width: 100%;
  margin-top: auto;
}

.card-preview {
  width: 100%;
  aspect-ratio: 16 / 10;
  padding: 0;
  border: 0;
  display: grid;
  place-items: center;
  background: #edf3fa;
  cursor: pointer;
}

.card-preview img,
.card-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.course-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(47, 109, 240, 0.95), rgba(54, 214, 255, 0.82)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.18) 0 1px, transparent 1px 32px);
  color: #fff;
}

.video-preview {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(17, 24, 39, 0.92), rgba(47, 109, 240, 0.78)),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.16) 0 2px, transparent 2px 22px);
  color: #fff;
}

.course-preview strong {
  font-size: 54px;
}

.video-preview strong {
  font-size: 30px;
  letter-spacing: 0;
}

.video-preview span {
  align-self: start;
  margin-top: -24px;
  font-size: 13px;
  opacity: 0.82;
}

.upload-preview {
  cursor: default;
}

.upload-preview-inner {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  color: #172033;
  background:
    linear-gradient(135deg, rgba(47, 109, 240, 0.1), rgba(54, 214, 255, 0.12)),
    #f8fbff;
}

.upload-preview-inner strong {
  font-size: 34px;
}

.upload-preview-inner span {
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

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

.card-body h3 {
  margin: 0;
  overflow: hidden;
  color: #172033;
  font-size: 19px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-card-status {
  margin-top: 14px;
  display: grid;
  gap: 8px;
}

.upload-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.upload-card-meta b,
.upload-card-meta em {
  font-size: 12px;
  line-height: 1.35;
}

.upload-card-meta b {
  color: #2f6df0;
}

.upload-failed .upload-card-meta b,
.upload-card-status small {
  color: #d14343;
}

.upload-card-meta em {
  color: #64748b;
  font-style: normal;
  white-space: nowrap;
}

.upload-card-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 109, 240, 0.12);
}

.upload-card-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6df0, #36d6ff);
}

.upload-failed .upload-card-progress i {
  background: #d14343;
}

.upload-card-status small {
  font-size: 12px;
  line-height: 1.45;
}

.card-body p,
.card-body span {
  display: block;
  margin-top: 8px;
  color: #64748b;
}

.empty-library {
  min-height: 260px;
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  gap: 8px;
  text-align: center;
  border: 1px dashed rgba(47, 109, 240, 0.28);
  border-radius: 8px;
  background: #fff;
  color: #64748b;
}

.empty-library strong {
  color: #172033;
  font-size: 22px;
}

.player-drawer {
  width: min(calc(100% - 64px), 1360px);
  margin: 0 auto 42px;
  padding: 22px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 54px rgba(15, 23, 42, 0.1);
}

.player-open {
  overflow: hidden;
}

.fullscreen-player {
  position: fixed;
  inset: 0;
  z-index: 25;
  padding: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  background: #030712;
}

.fullscreen-player.hidden {
  display: none !important;
}

.fullscreen-player-head {
  min-height: 64px;
  padding: 12px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.fullscreen-player-head p {
  margin: 0 0 3px;
  color: #2563eb;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.fullscreen-player-head h2 {
  margin: 0;
  max-width: 64vw;
  overflow: hidden;
  font-size: 20px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fullscreen-player .viewer {
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  background: #030712;
}

.fullscreen-player .viewer img,
.fullscreen-player .viewer video,
.fullscreen-player .viewer canvas {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: cover;
}

.fullscreen-player .viewer iframe {
  width: 100%;
  height: 100%;
  min-height: 0;
  max-height: none;
}

.player-drawer-head {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.player-drawer-head p {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.player-drawer-head h2 {
  margin: 0;
}

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 20;
  padding: 42px;
  display: grid;
  place-items: center;
  background: rgba(100, 116, 139, 0.62);
  backdrop-filter: blur(8px);
}

.convert-dialog,
.tasks-dialog,
.library-dialog {
  position: relative;
  width: min(100%, 1260px);
  max-height: calc(100vh - 84px);
  overflow: auto;
  padding: 44px;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 28px 70px rgba(15, 23, 42, 0.22);
}

.tasks-dialog,
.library-dialog {
  width: min(100%, 920px);
}

.convert-dialog h2,
.tasks-dialog h2,
.library-dialog h2 {
  margin: 0 0 28px;
  font-size: 38px;
}

.modal-close {
  position: absolute;
  top: 32px;
  right: 36px;
  width: 72px;
  height: 72px;
  border: 0;
  border-radius: 50%;
  background: #eef0f3;
  color: #172033;
  font-size: 42px;
  cursor: pointer;
}

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

.modal-form .field span {
  font-size: 24px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  min-height: 72px;
  border-radius: 14px;
  font-size: 24px;
}

.file-picker-row {
  position: relative;
  min-height: 54px;
  padding: 0 14px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid rgba(15, 23, 42, 0.16);
  border-radius: 10px;
  background: #fff;
}

.file-picker-row input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-picker-row b {
  min-height: 36px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  background: rgba(47, 109, 240, 0.12);
  color: #2f6df0;
  font-size: 17px;
}

.file-picker-row em {
  overflow: hidden;
  color: #64748b;
  font-style: normal;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.modal-form textarea {
  min-height: 160px;
  padding: 18px;
  resize: vertical;
}

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

.modal-actions {
  margin-top: 30px;
  justify-content: flex-end;
}

.modal-actions .button {
  min-width: 150px;
  min-height: 62px;
  font-size: 24px;
  font-weight: 800;
}

.task-list {
  display: grid;
  gap: 14px;
}

.task-row {
  padding: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px 56px auto;
  gap: 16px;
  align-items: center;
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 8px;
  background: #f8fbff;
}

.task-row span {
  display: block;
  margin-top: 6px;
  color: #64748b;
}

.task-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(47, 109, 240, 0.12);
}

.task-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2f6df0, #36d6ff);
}

.task-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.task-action {
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.task-inline-action {
  margin-left: 8px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #2f6df0;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.task-inline-action:hover {
  color: #174fc7;
  text-decoration: underline;
}

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

.library-card {
  min-height: 180px;
  padding: 22px;
  border: 1px solid rgba(47, 109, 240, 0.16);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff, #f6f9ff);
  text-align: left;
  cursor: pointer;
}

.library-card strong {
  display: block;
  color: #172033;
  font-size: 26px;
}

.library-card span {
  display: block;
  margin-top: 16px;
  color: #64748b;
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  max-width: 420px;
  padding: 14px 18px;
  border-radius: 8px;
  background: #172033;
  color: #fff;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.24);
}

.toast.error {
  background: #b42335;
}

.resource-action-dialog {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
  color: #1d2433;
  font-size: 13px;
}

.resource-action-dialog h2 {
  margin: 0 44px 12px 0;
  color: #1d2433;
  font-size: 18px;
  line-height: 1.25;
}

.resource-dialog-desc {
  margin: 0;
  color: #64748b;
  font-size: 13px;
  line-height: 1.5;
}

.resource-dialog-field {
  display: grid;
  gap: 6px;
}

.resource-dialog-field span {
  color: #1d2433;
  font-size: 13px;
  font-weight: 700;
}

.resource-dialog-field input {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  color: #1d2433;
  font-size: 13px;
}

.share-options {
  margin-top: 12px;
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #f8fafc;
}

.share-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #1d2433;
  font-size: 13px;
  font-weight: 700;
}

.share-options input {
  width: 16px;
  height: 16px;
  accent-color: #2f6df0;
}

.share-options input:focus,
.share-options input:focus-visible {
  outline: none;
  box-shadow: none;
}

.share-options label:focus-within {
  color: #2f6df0;
}

.resource-action-dialog .modal-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}

.resource-action-dialog .modal-actions {
  margin-top: 12px;
  gap: 10px;
}

.resource-action-dialog .modal-actions .button {
  min-width: 0;
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.button.danger {
  border-color: #e5484d;
  background: #e5484d;
  color: #fff;
}

.shared-library-tabs {
  display: inline-flex;
  gap: 8px;
  padding: 6px;
  border: 1px solid rgba(47, 109, 240, 0.16);
  border-radius: 10px;
  background: #f6f9ff;
}

.shared-library-tabs button {
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #64748b;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.shared-library-tabs button.active {
  background: #2f6df0;
  color: #fff;
}

.shared-library-filter {
  margin-top: 16px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.shared-library-filter span {
  color: #64748b;
  font-size: 15px;
  font-weight: 800;
}

.shared-library-filter button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid rgba(47, 109, 240, 0.18);
  border-radius: 999px;
  background: #fff;
  color: #475569;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}

.shared-library-filter button:hover {
  border-color: rgba(47, 109, 240, 0.38);
  background: #f6f9ff;
  color: #2f6df0;
}

.shared-library-filter button.active {
  border-color: #2f6df0;
  background: rgba(47, 109, 240, 0.1);
  color: #2f6df0;
}

.shared-resource-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

#library-modal.modal-layer {
  padding: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
}

#library-modal .library-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
  color: #1d2433;
  font-size: 13px;
}

#library-modal .library-dialog h2 {
  margin: 0 44px 12px 0;
  color: #1d2433;
  font-size: 18px;
  line-height: 1.25;
}

#library-modal .modal-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}

#library-modal .shared-library-tabs {
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
}

#library-modal .shared-library-tabs button {
  min-height: 34px;
  padding: 0 14px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
}

#library-modal .shared-library-filter {
  margin-top: 12px;
  gap: 8px;
}

#library-modal .shared-library-filter span {
  font-size: 13px;
  font-weight: 700;
}

#library-modal .shared-library-filter button {
  min-height: 32px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 700;
}

#library-modal .shared-resource-grid {
  margin-top: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

#library-modal .empty-library {
  min-height: 180px;
  padding: 18px;
  gap: 6px;
  border-radius: 8px;
}

#library-modal .empty-library strong {
  font-size: 16px;
}

#library-modal .empty-library span {
  font-size: 13px;
}

#library-modal .resource-card {
  display: block;
  min-height: 0;
}

#library-modal .resource-card .card-preview {
  min-height: 0;
  aspect-ratio: 16 / 10;
}

#library-modal .resource-card .card-body {
  padding: 9px 10px 10px;
}

#library-modal .resource-card .card-body h3 {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
}

#library-modal .resource-card .card-body p,
#library-modal .resource-card .card-body span {
  display: none;
}

@media (max-width: 640px) {
  #library-modal .shared-resource-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 430px) {
  #library-modal .shared-resource-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1200px) {
  .resource-grid {
    grid-template-columns: repeat(2, minmax(220px, 1fr));
  }
}

@media (max-width: 820px) {
  .workbench-topbar,
  .resource-head,
  .player-drawer-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .workbench-shell {
    grid-template-columns: 1fr;
  }

  .workbench-sidebar {
    min-height: auto;
  }

  .resource-grid,
  .modal-form,
  .library-grid,
  .task-row {
    grid-template-columns: 1fr;
  }
}

/* Compact 3D workbench pass, aligned with the model-work user center. */
.workbench-topbar {
  height: 64px;
  padding: 0 24px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.04);
}

.workbench-brand img {
  height: 34px;
}

.workbench-brand strong {
  font-size: 18px;
}

.workbench-actions {
  gap: 10px;
}

.workbench-actions .button,
.resource-actions .button,
.resource-actions label.button,
.player-drawer-actions .button {
  min-height: 40px;
  padding: 0 16px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 700;
}

.workbench-shell {
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
}

.workbench-sidebar {
  padding: 20px 14px;
  gap: 10px;
}

.side-menu {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 6px;
  font-size: 17px;
}

.storage-panel {
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
}

.workbench-main {
  padding: 24px 28px 38px;
}

.resource-head {
  min-height: 80px;
  padding: 18px 22px;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.05);
}

.resource-head h1 {
  font-size: 24px;
}

.resource-head p {
  margin-top: 6px;
  font-size: 14px;
}

.resource-grid {
  margin-top: 16px;
  grid-template-columns: repeat(4, minmax(210px, 1fr));
  gap: 16px;
}

.resource-card {
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.card-body {
  padding: 14px 16px 16px;
}

.card-body h3 {
  font-size: 17px;
}

.card-body p,
.card-body span {
  margin-top: 7px;
  font-size: 13px;
}

.empty-library {
  min-height: 200px;
  border-radius: 8px;
}

.empty-library strong {
  font-size: 18px;
}

.player-drawer {
  padding: 18px;
  border-radius: 8px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.08);
}

.player-drawer-head {
  margin-bottom: 12px;
}

.player-drawer-head h2 {
  font-size: 22px;
}

.modal-layer {
  padding: 32px;
  background: rgba(100, 116, 139, 0.54);
}

.convert-dialog,
.tasks-dialog,
.library-dialog {
  padding: 30px 36px 28px;
  border-radius: 14px;
  box-shadow: 0 22px 54px rgba(15, 23, 42, 0.2);
}

.convert-dialog {
  width: min(100%, 920px);
}

.tasks-dialog,
.library-dialog {
  width: min(100%, 760px);
}

.convert-dialog h2,
.tasks-dialog h2,
.library-dialog h2 {
  margin-bottom: 18px;
  font-size: 26px;
}

.modal-close {
  top: 24px;
  right: 30px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(100, 116, 139, 0.24);
  border-radius: 8px;
  background: #fff;
  font-size: 30px;
}

.modal-form {
  gap: 14px 20px;
}

.modal-form .field span {
  font-size: 16px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  min-height: 46px;
  border-radius: 8px;
  font-size: 15px;
}

.modal-form textarea {
  min-height: 88px;
  padding: 12px 14px;
}

.modal-actions {
  margin-top: 18px;
}

.modal-actions .button {
  min-width: 118px;
  min-height: 46px;
  border-radius: 8px;
  font-size: 16px;
}

.task-row {
  padding: 14px;
  grid-template-columns: minmax(0, 1fr) 180px 48px;
  border-radius: 8px;
}

.task-row strong {
  font-size: 15px;
}

.task-row span,
.task-row em {
  font-size: 13px;
}

.library-grid {
  gap: 14px;
}

.library-card {
  min-height: 132px;
  padding: 18px;
  border-radius: 8px;
}

.library-card strong {
  font-size: 20px;
}

.library-card span {
  margin-top: 10px;
  font-size: 14px;
}

.viewer {
  min-height: 360px;
}

/* Final compact workbench pass and raw SBS fullscreen playback. */
.workbench-topbar {
  height: 60px;
  padding: 0 22px;
}

.workbench-brand img {
  height: 32px;
}

.workbench-brand strong {
  font-size: 17px;
}

.workbench-actions .button,
.resource-actions .button,
.resource-actions label.button,
.player-drawer-actions .button {
  min-height: 36px;
  padding: 0 14px;
  font-size: 13px;
}

.workbench-shell {
  grid-template-columns: 240px minmax(0, 1fr);
  min-height: calc(100vh - 60px);
}

.workbench-sidebar {
  padding: 18px 12px;
}

.side-menu {
  min-height: 44px;
  padding: 0 16px;
  font-size: 16px;
}

.storage-panel {
  padding: 12px 14px;
  font-size: 13px;
}

.workbench-main {
  padding: 22px 26px 34px;
}

.resource-head {
  min-height: 72px;
  padding: 16px 20px;
}

.resource-head h1 {
  font-size: 22px;
}

.resource-head p {
  margin-top: 4px;
  font-size: 13px;
}

.resource-grid {
  margin-top: 14px;
  grid-template-columns: repeat(4, minmax(200px, 1fr));
  gap: 14px;
}

.resource-card {
  border-radius: 7px;
}

.card-body {
  padding: 12px 14px;
}

.card-body h3 {
  font-size: 16px;
}

.card-body p,
.card-body span {
  margin-top: 6px;
  font-size: 12px;
}

.modal-layer {
  padding: 24px;
}

.convert-dialog,
.tasks-dialog,
.library-dialog {
  padding: 24px 30px;
  border-radius: 12px;
}

.convert-dialog {
  width: min(100%, 820px);
}

.tasks-dialog,
.library-dialog {
  width: min(100%, 700px);
}

.convert-dialog h2,
.tasks-dialog h2,
.library-dialog h2 {
  margin-bottom: 14px;
  font-size: 24px;
}

.modal-close {
  top: 22px;
  right: 26px;
  width: 40px;
  height: 40px;
  font-size: 26px;
}

.modal-form {
  gap: 12px 16px;
}

.modal-form .field span {
  font-size: 15px;
}

.modal-form input,
.modal-form select,
.modal-form textarea {
  min-height: 40px;
  font-size: 14px;
}

.modal-form textarea {
  min-height: 78px;
}

.file-picker-row {
  min-height: 44px;
}

.file-picker-row b {
  min-height: 30px;
  padding: 0 14px;
  font-size: 14px;
}

.file-picker-row span {
  font-size: 14px;
}

.modal-actions .button {
  min-width: 104px;
  min-height: 42px;
  font-size: 15px;
}

.fullscreen-player .viewer:fullscreen {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
  border: 0;
  border-radius: 0;
  background: #000;
}

.fullscreen-player .viewer:fullscreen .player-badge {
  display: none;
}

.fullscreen-player .viewer:fullscreen video::-webkit-media-controls {
  display: none !important;
}

.viewer.stereo img,
.viewer.stereo video,
.viewer.stereo canvas {
  filter: none;
  transform: none;
  box-shadow: none;
}

.fullscreen-player .viewer img,
.fullscreen-player .viewer video,
.fullscreen-player .viewer canvas {
  width: 100%;
  height: 100%;
  object-fit: fill;
  background: #000;
}

body.player-open .fullscreen-player {
  grid-template-rows: minmax(0, 1fr);
  background: #000;
}

body.player-open .fullscreen-player-head {
  display: none;
}

body.player-open .fullscreen-player .viewer {
  width: 100vw;
  height: 100vh;
  min-height: 100vh;
}

body.player-open .player-badge {
  display: none;
}

body.player-open .course-page-counter {
  display: none;
}

/* User-center aligned navigation, cards and action ordering. */
.workbench-topbar {
  height: 56px;
  padding: 0 18px;
  box-shadow: none;
}

.workbench-brand {
  gap: 12px;
}

.workbench-brand img {
  height: 28px;
}

.workbench-brand strong {
  color: #2563eb;
  font-size: 16px;
  font-weight: 800;
}

.workbench-actions {
  gap: 10px;
}

.user-avatar {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 3px solid #e4f1ff;
  border-radius: 50%;
  background: linear-gradient(135deg, #43b3ff, #2563eb);
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.2);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
}

.workbench-shell {
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - 56px);
}

.workbench-sidebar {
  padding: 20px 8px 12px;
  gap: 4px;
  background: #fff;
}

.side-menu {
  min-height: 58px;
  padding: 0 18px;
  border-radius: 6px;
  color: #020b1d;
  font-size: 22px;
  font-weight: 500;
}

.side-menu.active {
  background: #2f6df0;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(47, 109, 240, 0.18);
}

.storage-panel {
  margin-top: auto;
  padding: 18px 22px 16px;
  gap: 12px;
  border-color: #dbe4f1;
  border-radius: 10px;
  background: #f8fbff;
  color: #64748b;
  font-size: 16px;
}

.storage-panel strong {
  color: #020b1d;
  font-size: 18px;
  font-weight: 800;
}

.storage-panel span {
  color: #64748b;
  font-size: 16px;
  line-height: 1.35;
}

.storage-panel::after {
  content: "";
  width: 100%;
  height: 10px;
  display: block;
  border-radius: 999px;
  background:
    linear-gradient(90deg, #2f6df0 0 var(--storage-used, 1%), transparent var(--storage-used, 1%)),
    #e8eef7;
}

.workbench-main {
  padding: 20px 24px 32px;
}

.resource-head {
  min-height: 82px;
  padding: 18px 22px;
}

.resource-actions {
  gap: 10px;
}

.ai-header-actions {
  display: flex;
  gap: 10px;
  align-items: center;
}

.ai-header-actions.hidden {
  display: none;
}

.resource-actions .button,
.resource-actions label.button {
  min-width: 118px;
  min-height: 40px;
  justify-content: center;
  border-radius: 5px;
  font-size: 15px;
}

.resource-actions .button.primary {
  background: #2f6df0;
  border-color: #2f6df0;
  color: #fff;
}

.resource-actions label.button.secondary {
  background: #fff;
  border-color: #d8e2f0;
  color: #172033;
}

.resource-grid {
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  gap: 16px;
}

.resource-card {
  position: relative;
  border-color: #dfe7f1;
  border-radius: 7px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.card-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  min-height: 0;
  overflow: hidden;
  background: #eef3f8;
}

.card-preview img,
.card-preview video {
  position: absolute;
  inset: 0;
}

.ai-image-preview {
  position: fixed;
  inset: 0;
  z-index: 32;
  padding: 32px;
  display: grid;
  place-items: center;
  background: rgba(3, 7, 18, 0.74);
}

.ai-image-preview.hidden {
  display: none !important;
}

.ai-image-preview-close {
  position: fixed;
  top: 28px;
  right: 28px;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.48);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  backdrop-filter: blur(8px);
  cursor: pointer;
}

.ai-image-preview img {
  max-width: calc(100vw - 64px);
  max-height: calc(100vh - 64px);
  display: block;
  object-fit: contain;
  border-radius: 4px;
}

.card-body {
  position: relative;
  min-height: 104px;
  padding: 13px 42px 12px 14px;
}

.card-body h3 {
  font-size: 16px;
  font-weight: 800;
}

.card-body p,
.card-body span {
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.25;
}

.card-actions {
  position: absolute;
  right: 12px;
  bottom: 11px;
  z-index: 3;
}

.card-actions summary {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #172033;
  font-size: 18px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 1px;
  cursor: pointer;
  list-style: none;
}

.card-actions summary::-webkit-details-marker {
  display: none;
}

.card-actions summary:hover {
  background: #eef4ff;
  color: #2f6df0;
}

.card-action-menu {
  position: absolute;
  right: -8px;
  bottom: 34px;
  width: 104px;
  padding: 12px 0;
  display: grid;
  gap: 2px;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 10px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.14);
}

.card-action-menu button {
  min-height: 32px;
  padding: 0 20px;
  border: 0;
  background: transparent;
  color: #172033;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.card-action-menu button:hover {
  background: #f4f7fb;
}

.card-action-menu .danger {
  color: #e5484d;
}

.user-menu {
  position: relative;
}

.user-menu-trigger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid rgba(47, 112, 237, 0.14);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
  cursor: pointer;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  width: 176px;
  padding: 6px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.16);
}

.user-menu-info {
  display: grid;
  gap: 3px;
  padding: 8px 10px 10px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
}

.user-menu-info strong {
  min-width: 0;
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-menu-info span {
  color: #6b7688;
  font-size: 12px;
}

.user-menu-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #1d2433;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  text-align: left;
}

.user-menu-item:hover {
  background: rgba(47, 112, 237, 0.08);
  color: #2f70ed;
}

.side-menu[data-section="credits"],
.side-menu[data-section="profile"] {
  display: none;
}

.account-modal {
  z-index: 35;
  padding: 18px;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
}

.account-dialog {
  position: relative;
  width: min(720px, calc(100vw - 28px));
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
}

.account-dialog .modal-close {
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}

.account-dialog-head {
  margin: 0 44px 14px 0;
}

.account-dialog-head h2 {
  margin: 0 0 4px;
  color: #1d2433;
  font-size: 18px;
  line-height: 1.25;
}

.account-dialog-head p {
  margin: 0;
  color: #6b7688;
  font-size: 13px;
}

.account-modal .account-view {
  gap: 12px;
}

.account-modal .summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

.account-modal .summary-card,
.account-modal .content-panel {
  box-shadow: none;
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.account-modal .summary-card {
  min-height: 78px;
  padding: 12px;
}

.account-modal .summary-card span,
.account-modal .section-title p {
  font-size: 12px;
}

.account-modal .summary-card strong {
  font-size: 22px;
}

.account-modal .summary-card .summary-text {
  font-size: 15px;
}

.account-modal .content-panel {
  padding: 14px;
}

.account-modal .section-title {
  gap: 10px;
  margin-bottom: 12px;
}

.account-modal .section-title h2 {
  margin-bottom: 3px;
  font-size: 16px;
}

.account-view {
  display: grid;
  gap: 18px;
}

.summary-grid,
.profile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

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

.summary-card,
.content-panel {
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(18, 32, 56, 0.08);
}

.summary-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 18px 20px;
}

.summary-card span {
  color: #6b7688;
  font-size: 14px;
}

.summary-card strong {
  color: #1d2433;
  font-size: 28px;
  line-height: 1.1;
}

.summary-card .summary-text {
  font-size: 18px;
}

.content-panel {
  padding: 22px;
}

.section-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.section-title h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.section-title p {
  margin: 0;
  color: #6b7688;
  font-size: 14px;
}

.record-title-row {
  align-items: center;
}

.record-search input,
.form-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #fff;
  color: #1d2433;
  font: inherit;
}

.record-search input {
  min-width: 240px;
  padding: 0 12px;
}

.credit-summary-text {
  margin: 0;
  color: #1d2433;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.5;
}

.credit-rules-panel {
  display: grid;
  gap: 12px;
}

.credit-rule-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.credit-rule-card {
  display: grid;
  min-height: 88px;
  gap: 6px;
  padding: 12px;
  border: 1px solid #e4eaf2;
  border-radius: 8px;
  background: #f8fafc;
}

.credit-rule-card span,
.credit-rule-card em {
  color: #667287;
  font-size: 13px;
  font-style: normal;
}

.credit-rule-card strong {
  color: #162033;
  font-size: 24px;
  line-height: 1;
}

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

.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 72px;
  padding: 14px 16px;
  border: 1px solid #e7ebf1;
  border-radius: 8px;
  background: #fff;
}

.record-copy,
.record-line {
  display: grid;
  gap: 4px;
}

.record-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.muted {
  color: #6b7688;
  font-size: 13px;
}

.record-amount {
  font-size: 18px;
  font-weight: 800;
}

.record-amount.plus {
  color: #169b62;
}

.record-amount.minus {
  color: #d14343;
}

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

.form-field {
  display: grid;
  gap: 8px;
  font-weight: 700;
}

.form-field input {
  padding: 0 12px;
  font-weight: 400;
}

.feedback {
  min-height: 20px;
  color: #169b62;
  font-size: 13px;
}

.feedback.error {
  color: #d14343;
}

.login-layer {
  display: grid;
  place-items: center;
}

.login-card {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 300px minmax(300px, 1fr);
  width: min(720px, calc(100vw - 32px));
  min-height: 360px;
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.22);
}

.login-visual {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  background:
    radial-gradient(circle at 58% 36%, rgba(103, 232, 249, 0.42), rgba(103, 232, 249, 0) 34%),
    radial-gradient(circle at 30% 70%, rgba(52, 211, 153, 0.28), rgba(52, 211, 153, 0) 30%),
    linear-gradient(145deg, #102045 0%, #1f3f7a 54%, #119bd4 100%);
}

.login-visual::before {
  content: "";
  position: absolute;
  inset: 34px 22px 30px;
  border: 1px solid rgba(226, 245, 255, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(rgba(226, 245, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(226, 245, 255, 0.1) 1px, transparent 1px);
  background-size: 26px 26px;
  transform: perspective(420px) rotateX(62deg) rotateZ(-18deg);
  transform-origin: center bottom;
}

.login-model-scene {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  perspective: 760px;
}

.login-model {
  position: relative;
  width: 118px;
  height: 118px;
  transform: rotateX(58deg) rotateZ(42deg);
  transform-style: preserve-3d;
}

.login-model-core,
.login-model-face,
.login-model-ring,
.login-model-node {
  position: absolute;
  display: block;
}

.login-model-core {
  inset: 12px;
  border-radius: 24px;
  background: linear-gradient(145deg, #f8fcff, #50d5ff 52%, #0e6ccf);
  box-shadow:
    0 18px 30px rgba(8, 18, 45, 0.38),
    inset 0 1px 10px rgba(255, 255, 255, 0.76);
  transform: translateZ(42px);
}

.login-model-face {
  width: 94px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(93, 241, 206, 0.94), rgba(48, 136, 255, 0.78));
  box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.42);
}

.login-model-face.face-a {
  left: 12px;
  bottom: 8px;
  transform: rotateX(90deg) translateZ(-44px);
}

.login-model-face.face-b {
  top: 36px;
  left: -30px;
  transform: rotateY(90deg) translateZ(44px);
}

.login-model-face.face-c {
  top: 36px;
  right: -30px;
  background: linear-gradient(135deg, rgba(155, 232, 255, 0.88), rgba(25, 96, 210, 0.82));
  transform: rotateY(90deg) translateZ(-44px);
}

.login-model-ring {
  left: 50%;
  top: 50%;
  border: 2px solid rgba(177, 241, 255, 0.62);
  border-radius: 50%;
  transform: translate(-50%, -50%) rotateX(74deg) rotateZ(-16deg);
}

.login-model-ring.ring-a {
  width: 210px;
  height: 210px;
}

.login-model-ring.ring-b {
  width: 152px;
  height: 152px;
  border-color: rgba(93, 241, 206, 0.66);
  transform: translate(-50%, -50%) rotateX(74deg) rotateZ(24deg);
}

.login-model-node {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #d9fbff;
  box-shadow: 0 0 18px rgba(125, 249, 255, 0.9);
}

.login-model-node.node-a {
  left: 72px;
  top: 98px;
}

.login-model-node.node-b {
  right: 58px;
  top: 126px;
}

.login-model-node.node-c {
  left: 110px;
  bottom: 86px;
}

.login-form {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  padding: 38px 42px;
  background: #fff;
}

.login-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.login-head h2 {
  margin: 0;
  color: #38a8f4;
  font-size: 34px;
  font-weight: 800;
}

.login-field {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: center;
  border-bottom: 1px solid rgba(148, 163, 184, 0.26);
}

.login-field-icon {
  color: #cbd5e1;
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.login-field input {
  width: 100%;
  height: 46px;
  border: 0;
  outline: none;
  color: #1d2433;
  font: inherit;
  font-size: 15px;
}

.login-feedback {
  min-height: 20px;
  color: #dc2626;
  font-size: 13px;
  line-height: 1.5;
}

.login-feedback.info {
  color: #6b7688;
}

.login-submit {
  height: 48px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(90deg, #2ea7f4, #20c6ef);
  color: #fff;
  font: inherit;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 22px rgba(14, 165, 233, 0.28);
}

.login-submit:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

@media (max-width: 980px) {
  .summary-grid,
  .profile-grid,
  .workspace-entry-row-primary,
  .workspace-entry-row-ai {
    grid-template-columns: 1fr;
  }

  .login-card {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 180px;
  }
}

/* Match aigc3dmodel model-work scale. */
.workbench-body {
  background: #f5f7fb;
  color: #1d2433;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.workbench-topbar {
  height: 58px;
  padding: 0 20px 0 24px;
}

.workbench-brand {
  gap: 10px;
}

.workbench-brand img {
  height: 30px;
  max-width: 142px;
}

.workbench-brand strong {
  font-size: 18px;
}

.user-avatar {
  width: 24px;
  height: 24px;
  border: 0;
  font-size: 12px;
}

.workbench-shell {
  grid-template-columns: 238px minmax(0, 1fr);
  min-height: calc(100vh - 58px);
}

.workbench-sidebar {
  padding: 18px 12px 16px;
  gap: 8px;
}

.side-menu {
  min-height: 46px;
  padding: 0 16px;
  border-radius: 8px;
  color: #202735;
  font-size: 16px;
  font-weight: 400;
}

.side-menu:hover {
  background: #f6f9ff;
}

.side-menu.active {
  background: #2f70ed;
  font-weight: 400;
  box-shadow: 0 12px 24px rgba(47, 112, 237, 0.22);
}

.side-menu[data-section="workspace"] {
  display: none;
}

.side-menu.has-icon {
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-menu-icon {
  position: relative;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #7a8aa3;
  opacity: 0.82;
  transition: color 0.18s ease, opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease;
}

.side-menu:hover .side-menu-icon {
  color: #2f6df0;
  opacity: 1;
}

.side-menu.active .side-menu-icon {
  color: #fff;
  opacity: 1;
  filter: drop-shadow(0 3px 6px rgba(10, 38, 102, 0.18));
  transform: scale(1.04);
}

.side-menu-icon-image {
  border: 1.5px solid currentColor;
  border-radius: 5px;
}

.side-menu-icon-image::before {
  content: "";
  position: absolute;
  width: 4px;
  height: 4px;
  top: 4px;
  right: 4px;
  border-radius: 50%;
  background: currentColor;
}

.side-menu-icon-image::after {
  content: "";
  position: absolute;
  left: 3px;
  right: 3px;
  bottom: 3px;
  height: 7px;
  background: currentColor;
  clip-path: polygon(0 100%, 36% 38%, 54% 62%, 74% 26%, 100% 100%);
}

.side-menu-icon-video {
  border: 1.5px solid currentColor;
  border-radius: 5px;
}

.side-menu-icon-video::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 4px;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 7px solid currentColor;
}

.side-menu-icon-video::after {
  content: "";
  position: absolute;
  inset: 3px auto 3px 3px;
  width: 1.5px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 11px 0 0 currentColor;
}

.side-menu-icon-course {
  border: 1.5px solid currentColor;
  border-radius: 4px;
  transform: perspective(80px) rotateY(-7deg);
}

.side-menu-icon-course::before {
  content: "";
  position: absolute;
  left: 5px;
  top: -1.5px;
  bottom: -1.5px;
  width: 1.5px;
  background: currentColor;
}

.side-menu-icon-course::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 5px;
  width: 6px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.side-menu-icon-ai {
  border: 1.5px solid currentColor;
  border-radius: 6px;
}

.side-menu-icon-ai::before {
  content: "";
  position: absolute;
  inset: 4px;
  border: 1.5px solid currentColor;
  border-radius: 50%;
}

.side-menu-icon-ai::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 2.5px;
  height: 2.5px;
  border-radius: 50%;
  background: currentColor;
  transform: translate(-50%, -50%);
  box-shadow:
    -7px 0 0 currentColor,
    7px 0 0 currentColor,
    0 -7px 0 currentColor,
    0 7px 0 currentColor;
}

.storage-panel {
  padding: 12px;
  gap: 8px;
  border-color: #e7ebf1;
  border-radius: 8px;
  font-size: 13px;
}

.storage-panel strong,
.storage-panel span {
  font-size: 13px;
}

.storage-panel strong {
  color: #1d2433;
}

.storage-panel span {
  color: #6b7688;
}

.storage-panel::after {
  height: 10px;
}

.workbench-main {
  padding: 20px 24px 30px;
}

.resource-head {
  min-height: 82px;
  margin-bottom: 14px;
  padding: 16px 20px;
}

.resource-head h1 {
  margin-bottom: 4px;
  font-size: 22px;
}

.resource-head p {
  font-size: 13px;
}

.resource-grid {
  margin-top: 0;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.workspace-entry-row {
  grid-column: 1 / -1;
  display: grid;
  gap: 16px;
}

.workspace-entry-row-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.workspace-entry-row-ai {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.resource-card {
  overflow: visible;
  border: 0;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(18, 32, 56, 0.08);
}

.card-preview {
  border-radius: 8px 8px 0 0;
}

.card-body {
  min-height: auto;
  padding: 12px 40px 14px 13px;
}

.card-body h3 {
  font-size: 16px;
}

.card-body p,
.card-body span {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.45;
}

.card-actions {
  right: 13px;
  bottom: 12px;
}

.card-actions summary {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  font-size: 18px;
  font-weight: 800;
}

.card-actions summary:hover {
  background: transparent;
  color: #2f70ed;
}

.card-action-menu {
  right: 0;
  bottom: calc(100% + 6px);
  width: auto;
  min-width: 82px;
  padding: 5px;
  border-color: #e7ebf1;
  border-radius: 8px;
  box-shadow: 0 18px 36px rgba(15, 23, 42, 0.16);
}

.card-action-menu button {
  min-height: 28px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: 12px;
}

/* 3D conversion modal aligned with aigc3dmodel model-preview modal scale. */
#convert-modal.modal-layer {
  padding: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
}

#convert-modal .convert-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
  color: #1d2433;
  font-size: 13px;
}

#convert-modal .convert-dialog h2 {
  margin: 0 44px 12px 0;
  font-size: 18px;
  line-height: 1.25;
}

#convert-modal .modal-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}

#convert-modal .modal-form {
  gap: 12px;
}

#convert-modal .modal-form .field:has(#convert-mode),
#convert-modal .modal-form .field:has(#convert-prompt),
#convert-modal .modal-form .field:has(#convert-layout),
#convert-modal .modal-form .field:has(#depth-model),
#convert-modal .modal-form .field:has(#convert-divergence),
#convert-modal .modal-form .field:has(#convert-convergence) {
  display: none;
}

#convert-modal .modal-form .field:has(#convert-file) {
  order: 2;
}

#convert-modal .modal-form .field:has(#convert-type) {
  order: 1;
}

#convert-modal .modal-form .field:has(#convert-output-format) {
  order: 3;
}

#convert-modal .modal-form .field:has(#convert-quality) {
  order: 4;
}

#convert-modal .modal-form .field:has(#image-size) {
  order: 4;
}

#convert-modal .modal-form .field:has(#image-operation),
#convert-modal .modal-form .field:has(#image-provider),
#convert-modal .modal-form .field:has(#image-model),
#convert-modal .modal-form .field:has(#image-size) {
  display: none;
}

#convert-modal.ai-image-mode .modal-form .field:has(#convert-prompt),
#convert-modal.ai-image-mode .modal-form .field:has(#image-size) {
  display: grid;
}

#convert-modal.ai-image-mode .modal-form .field:has(#convert-mode),
#convert-modal.ai-image-mode .modal-form .field:has(#image-operation),
#convert-modal.ai-image-mode .modal-form .field:has(#image-provider),
#convert-modal.ai-image-mode .modal-form .field:has(#image-model),
#convert-modal.ai-image-mode .modal-form .field:has(#convert-quality),
#convert-modal.ai-image-mode .modal-form .field:has(#convert-type),
#convert-modal.ai-image-mode .modal-form .field:has(#convert-layout),
#convert-modal.ai-image-mode .modal-form .field:has(#depth-model),
#convert-modal.ai-image-mode .modal-form .field:has(#convert-divergence),
#convert-modal.ai-image-mode .modal-form .field:has(#convert-convergence) {
  display: none;
}

#convert-modal .modal-form .field {
  gap: 6px;
}

#convert-modal .modal-form .field span {
  color: #1d2433;
  font-size: 13px;
  font-weight: 700;
}

#convert-modal .modal-form input,
#convert-modal .modal-form select,
#convert-modal .modal-form textarea {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  color: #1d2433;
  font-size: 13px;
}

#convert-modal .modal-form textarea {
  min-height: 88px;
  resize: vertical;
}

#convert-modal .file-picker-row {
  min-height: 38px;
  padding: 4px 10px 4px 4px;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.26);
  border-radius: 6px;
  background: #fbfcff;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

#convert-modal .file-picker-row:hover {
  border-color: rgba(37, 99, 235, 0.36);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
}

#convert-modal .file-picker-row b {
  min-height: 28px;
  padding: 0 12px;
  border-radius: 4px;
  background: rgba(37, 99, 235, 0.1);
  color: #1f5fd6;
  font-size: 12px;
  font-weight: 800;
}

#convert-modal .file-picker-row em,
#convert-modal .file-picker-row span {
  color: #6b7688;
  font-size: 12px;
}

#convert-modal .modal-actions {
  margin-top: 0;
  gap: 10px;
}

#convert-modal .modal-actions .button {
  min-width: 0;
  min-height: 40px;
  height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

#convert-modal .modal-actions .button.primary {
  border: 1px solid transparent;
  background: #2f70ed;
  color: #fff;
}

#convert-modal .modal-actions .button.secondary {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: #fff;
  color: #1d2433;
}

#convert-modal .modal-form .field:has(#convert-type),
#convert-modal .modal-form .field:has(#convert-file) {
  grid-column: 1 / -1;
}

#ai-video-modal.modal-layer {
  padding: 24px;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
}

#ai-video-modal .ai-video-dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(820px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
  color: #1d2433;
  font-size: 13px;
}

#ai-video-modal .ai-video-dialog h2 {
  margin: 0 44px 12px 0;
  font-size: 18px;
  line-height: 1.25;
}

#ai-video-modal .modal-close {
  top: 16px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}

#ai-video-modal .modal-form {
  gap: 12px;
}

#ai-video-modal .modal-form .full-span {
  grid-column: 1 / -1;
}

#ai-video-modal .modal-form input,
#ai-video-modal .modal-form select,
#ai-video-modal .modal-form textarea {
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  background: #f8fafc;
  color: #1d2433;
  font-size: 13px;
}

#ai-video-modal .modal-form textarea {
  min-height: 110px;
  resize: vertical;
}

#ai-video-modal .modal-actions {
  margin-top: 16px;
  gap: 10px;
}

#convert-modal .modal-form .field:has(#convert-type) select,
#convert-modal .file-picker-row {
  width: 100%;
  box-sizing: border-box;
}

#convert-modal .modal-actions {
  margin-top: 16px;
  padding-top: 2px;
}

#tasks-modal.modal-layer {
  padding: 20px;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

#tasks-modal .tasks-dialog {
  width: min(560px, calc(100vw - 32px));
  max-height: min(520px, calc(100vh - 32px));
  padding: 18px;
  border-radius: 16px;
  overflow: auto;
}

#tasks-modal .tasks-dialog h2 {
  margin: 0 44px 12px 0;
  font-size: 18px;
  line-height: 1.25;
}

#tasks-modal .modal-close {
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  font-size: 22px;
  line-height: 1;
}

#tasks-modal .task-list {
  gap: 8px;
  max-height: 420px;
  overflow: auto;
}

#tasks-modal .task-row {
  padding: 10px;
  grid-template-columns: minmax(0, 1fr) 140px 36px auto;
  gap: 10px;
  border-radius: 8px;
}

#tasks-modal .task-row strong {
  display: block;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

#tasks-modal .task-row span,
#tasks-modal .task-row em {
  font-size: 12px;
  line-height: 1.35;
}

#tasks-modal .task-row span {
  margin-top: 4px;
}

#tasks-modal .task-progress {
  height: 8px;
}

#credits-modal.account-modal,
#profile-modal.account-modal {
  z-index: 35;
  padding: 20px;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.34);
  backdrop-filter: blur(8px);
}

#credits-modal .account-dialog,
#profile-modal .account-dialog {
  width: min(720px, calc(100vw - 32px));
  max-height: min(720px, calc(100vh - 32px));
  overflow: auto;
  padding: 18px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 28px 64px rgba(15, 23, 42, 0.18);
  color: #1d2433;
}

#credits-modal .modal-close,
#profile-modal .modal-close {
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.14);
  color: #1d2433;
  font-size: 22px;
  line-height: 1;
}

#credits-modal .account-dialog-head,
#profile-modal .account-dialog-head {
  margin: 0 44px 14px 0;
}

#credits-modal .account-dialog-head h2,
#profile-modal .account-dialog-head h2 {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 1.25;
}

#credits-modal .account-dialog-head p,
#profile-modal .account-dialog-head p {
  margin: 0;
  color: #6b7688;
  font-size: 13px;
}

#credits-modal .account-view,
#profile-modal .account-view {
  gap: 12px;
}

#credits-modal .summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

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

#credits-modal .summary-card,
#credits-modal .content-panel,
#profile-modal .content-panel {
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: none;
}

#credits-modal .summary-card {
  min-height: 78px;
  padding: 12px;
}

#credits-modal .summary-card span,
#credits-modal .section-title p,
#profile-modal .section-title p {
  font-size: 12px;
}

#credits-modal .summary-card strong {
  font-size: 22px;
}

#credits-modal .summary-card .summary-text {
  font-size: 15px;
}

#credits-modal .content-panel,
#profile-modal .content-panel {
  padding: 14px;
}

#credits-modal .section-title,
#profile-modal .section-title {
  gap: 10px;
  margin-bottom: 12px;
}

#credits-modal .section-title h2,
#profile-modal .section-title h2 {
  margin-bottom: 3px;
  font-size: 16px;
}

@media (max-width: 760px) {
  #tasks-modal .task-row {
    grid-template-columns: minmax(0, 1fr) 74px;
  }

  #tasks-modal .task-actions {
    grid-column: 1 / -1;
    justify-content: stretch;
  }

  #tasks-modal .task-action {
    flex: 1;
  }

  #credits-modal .summary-grid,
  #credits-modal .credit-rule-list,
  #profile-modal .profile-grid {
    grid-template-columns: 1fr;
  }

  #tasks-modal .task-progress {
    grid-column: 1 / -1;
    order: 3;
  }
}

/* Portal homepage aligned with the 3D model player landing page. */
.portal-home {
  overflow-x: hidden;
  background:
    radial-gradient(circle at top left, rgba(11, 103, 255, 0.08), transparent 28%),
    radial-gradient(circle at bottom right, rgba(54, 214, 255, 0.1), transparent 24%),
    #fff;
}

.page-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at var(--glow-x, 50%) var(--glow-y, 18%), rgba(11, 103, 255, 0.12), transparent 22%),
    radial-gradient(circle at 82% 22%, rgba(54, 214, 255, 0.09), transparent 18%);
}

.portal-home .scroll-progress {
  z-index: 60;
  box-shadow: 0 0 18px rgba(11, 103, 255, 0.28);
}

.portal-home .navbar {
  z-index: 30;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
}

.portal-home .navbar-inner {
  min-height: 88px;
}

.portal-home .brand {
  min-height: 58px;
  gap: 14px;
}

.portal-home .brand-logo {
  height: 38px;
  max-width: 180px;
}

.portal-home .brand-tagline {
  color: #56647e;
  font-size: 0.96rem;
  font-weight: 400;
  line-height: 1.4;
}

.portal-home .nav-actions {
  gap: 14px;
}

.portal-home .nav-link,
.portal-home .button-primary,
.portal-home .button-secondary {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.portal-home .nav-link,
.portal-home .button-secondary {
  color: #425066;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
}

.portal-home .button-primary {
  color: #fff;
  background: linear-gradient(135deg, #0b67ff 0%, #36d6ff 100%);
  background-size: 180% 180%;
  border: 0;
  box-shadow: 0 18px 40px rgba(11, 103, 255, 0.22);
  animation: button-glow 8s ease infinite;
}

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

.portal-home .hero {
  min-height: calc(100vh - 88px);
  padding: 34px 0 32px;
}

.portal-home .hero-grid {
  display: block;
}

.portal-home .hero-copy {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 0 auto;
  padding: 18px 0;
  text-align: center;
  animation: hero-rise 0.9s ease both;
}

.portal-home .hero-title {
  margin: 0;
  font-size: clamp(3.5rem, 6.3vw, 6.2rem);
  line-height: 1.02;
  font-weight: 800;
  background-size: 180% 180%;
  animation: hero-rise 0.9s ease both, title-shift 10s ease infinite;
}

.portal-home .hero-description {
  max-width: 820px;
  margin: 24px auto 0;
  color: #667085;
  font-size: 1.08rem;
  line-height: 2;
}

.portal-home .hero-actions {
  justify-content: center;
  margin-top: 30px;
  gap: 14px;
}

.portal-home .hero-note {
  justify-content: center;
  margin-top: 26px;
  gap: 18px;
  color: #52607a;
  font-size: 0.96rem;
  line-height: 1.4;
}

.portal-home .hero-note span::before {
  content: "";
  width: 4px;
  height: 4px;
  margin-right: 8px;
  display: inline-block;
  border-radius: 50%;
  background: #0b67ff;
  vertical-align: middle;
}

.portal-home .footer-mark {
  gap: 0;
}

.portal-home .scroll-reveal {
  opacity: 0;
  transform: translateY(56px) scale(0.96);
  filter: blur(10px);
  transition:
    opacity 0.75s ease,
    transform 0.75s ease,
    filter 0.75s ease,
    box-shadow 0.28s ease;
  transition-delay: var(--reveal-delay, 0ms);
  will-change: opacity, transform, filter;
}

.portal-home .scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  filter: blur(0);
}

.portal-home .section {
  padding: 100px 0;
}

.portal-home .section-head {
  margin-bottom: 48px;
}

.portal-home .section-head h2,
.portal-home .stat-copy h2,
.portal-home .cta-copy h2 {
  margin: 0;
  font-size: clamp(2.2rem, 4.1vw, 3.4rem);
}

.portal-home .section-head p {
  max-width: 760px;
  margin: 16px auto 0;
  color: #667085;
  font-size: 1.05rem;
  line-height: 1.85;
}

.portal-home .feature-grid,
.portal-home .scene-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.portal-home .feature-card,
.portal-home .scene-card {
  position: relative;
  overflow: hidden;
  padding: 28px;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 16px 40px rgba(20, 34, 80, 0.08);
  transform-style: preserve-3d;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.portal-home .feature-card:hover,
.portal-home .scene-card:hover {
  transform: translateY(-6px);
  border-color: rgba(11, 103, 255, 0.16);
  box-shadow: 0 28px 70px rgba(20, 34, 80, 0.14);
}

.portal-home .feature-card::after,
.portal-home .scene-card::after,
.portal-home .stats-row::after,
.portal-home .cta-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background: radial-gradient(circle at var(--mx, 50%) var(--my, 50%), rgba(255, 255, 255, 0.7), transparent 24%);
  transition: opacity 0.22s ease;
}

.portal-home .feature-card:hover::after,
.portal-home .scene-card:hover::after,
.portal-home .stats-row:hover::after,
.portal-home .cta-panel:hover::after {
  opacity: 1;
}

.portal-home .feature-icon,
.portal-home .scene-icon {
  width: 56px;
  height: 56px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(11, 103, 255, 0.12), rgba(54, 214, 255, 0.18));
  color: #0b67ff;
  font-size: 1.15rem;
  font-weight: 700;
}

.portal-home .feature-card h3,
.portal-home .scene-card h3 {
  margin: 22px 0 0;
  font-size: 1.18rem;
}

.portal-home .feature-card p,
.portal-home .scene-card p {
  margin: 14px 0 0;
  color: #667085;
  line-height: 1.8;
}

.portal-home .stat-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1.08fr);
  gap: 28px;
  align-items: center;
}

.portal-home .stat-copy p {
  margin: 18px 0 0;
  color: #667085;
  font-size: 1.05rem;
  line-height: 1.9;
}

.portal-home .stat-callout,
.portal-home .stats-card {
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 16px 40px rgba(20, 34, 80, 0.08);
  backdrop-filter: blur(18px);
}

.portal-home .stat-callout {
  margin-top: 28px;
  padding: 22px 24px;
  border-radius: 24px;
}

.portal-home .stat-callout span {
  display: block;
  margin-top: 10px;
  color: #667085;
  line-height: 1.75;
}

.portal-home .stats-card {
  padding: 24px;
  border-radius: 30px;
}

.portal-home .stats-list {
  display: grid;
  gap: 14px;
}

.portal-home .stats-row {
  position: relative;
  overflow: hidden;
  min-height: 72px;
  padding: 0 18px;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 18px;
  background: rgba(247, 250, 255, 0.94);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.portal-home .stats-row:hover {
  transform: translateY(-3px);
  border-color: rgba(11, 103, 255, 0.12);
  box-shadow: 0 18px 36px rgba(20, 34, 80, 0.08);
}

.portal-home .stats-row span {
  color: #55637b;
}

.portal-home .stats-row strong {
  text-align: right;
}

.portal-home .cta-section {
  padding: 0 0 110px;
}

.portal-home .cta-panel {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border-radius: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: #fff;
  background: linear-gradient(140deg, rgba(11, 103, 255, 0.96), rgba(54, 214, 255, 0.88)), #0b67ff;
  box-shadow: 0 28px 70px rgba(20, 34, 80, 0.14);
}

.portal-home .cta-panel::before {
  content: "";
  position: absolute;
  inset: -40% auto -40% -20%;
  width: 42%;
  transform: rotate(12deg);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.22), transparent);
  animation: sheen 7s ease-in-out infinite;
  pointer-events: none;
}

.portal-home .cta-copy p {
  max-width: 720px;
  margin: 16px 0 0;
  color: rgba(255, 255, 255, 0.88);
  line-height: 1.8;
}

.portal-home .footer-inner,
.portal-home .footer-brand {
  display: flex;
  align-items: center;
}

.portal-home .footer-inner {
  justify-content: space-between;
  gap: 20px;
}

.portal-home .footer-brand {
  gap: 16px;
}

.portal-home .footer-brand img {
  width: auto;
  height: 34px;
  max-width: 180px;
  object-fit: contain;
}

.portal-home .footer-mark {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.portal-home .footer-mark span,
.portal-home .footer-copy {
  color: #667085;
}

@keyframes hero-rise {
  from {
    opacity: 0;
    transform: translateY(32px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes button-glow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes title-shift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes sheen {
  0% {
    transform: translateX(-120%) rotate(12deg);
  }
  40%,
  100% {
    transform: translateX(280%) rotate(12deg);
  }
}

@media (max-width: 1080px) {
  .portal-home .stat-layout {
    grid-template-columns: 1fr;
  }

  .portal-home .feature-grid,
  .portal-home .scene-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .portal-home .navbar-inner,
  .portal-home .footer-inner,
  .portal-home .cta-panel {
    align-items: flex-start;
    flex-direction: column;
  }

  .portal-home .nav-actions,
  .portal-home .hero-actions,
  .portal-home .nav-link,
  .portal-home .button-primary,
  .portal-home .button-secondary {
    width: 100%;
  }

  .portal-home .feature-grid,
  .portal-home .scene-grid {
    grid-template-columns: 1fr;
  }

  .portal-home .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .portal-home .hero {
    min-height: auto;
    padding: 24px 0 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-home .button-primary,
  .portal-home .hero-copy,
  .portal-home .hero-title,
  .portal-home .scroll-reveal {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }

  .portal-home .cta-panel::before,
  .portal-home .feature-card::after,
  .portal-home .scene-card::after,
  .portal-home .stats-row::after,
  .portal-home .cta-panel::after {
    display: none !important;
  }
}
