:root {
  --bg: #eef2f7;
  --shell: #0d1424;
  --shell-soft: #172033;
  --panel: #ffffff;
  --panel-tint: #f8fafc;
  --panel-warm: #fffdf9;
  --ink: #151f32;
  --muted: #667085;
  --soft: #98a2b3;
  --line: #dce3ee;
  --line-strong: #c7d2e1;
  --accent: #0f766e;
  --accent-strong: #0a5d57;
  --accent-soft: #e4f5f2;
  --indigo: #3157d5;
  --indigo-soft: #eef3ff;
  --gold: #ad7417;
  --gold-soft: #fff6df;
  --coral: #c64f45;
  --coral-soft: #fff0ed;
  --danger: #c93232;
  --shadow-sm: 0 1px 2px rgba(18, 27, 43, 0.08);
  --shadow-md: 0 10px 28px rgba(18, 27, 43, 0.12);
  --shadow-lg: 0 28px 70px rgba(18, 27, 43, 0.18);
  --radius: 8px;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-width: 1180px;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(13, 20, 36, 0.05), transparent 210px),
    linear-gradient(180deg, #f6f8fb 0%, #eef2f7 48%, #f7f9fc 100%);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

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

button {
  border: 0;
}

button,
a,
input,
textarea,
select {
  transition:
    border-color 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-thumb {
  border: 3px solid transparent;
  border-radius: 999px;
  background: rgba(102, 112, 133, 0.38);
  background-clip: padding-box;
}

::-webkit-scrollbar-track {
  background: transparent;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-rows: 64px 1fr;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.18), transparent 36%),
    linear-gradient(180deg, #131c2f 0%, #0d1424 100%);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 12px 28px rgba(13, 20, 36, 0.22);
  z-index: 5;
}

.brand {
  min-width: 200px;
  display: flex;
  align-items: center;
  gap: 11px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.24), transparent 42%),
    linear-gradient(135deg, #0f766e 0%, #3157d5 100%);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.28);
  font-size: 13px;
  font-weight: 850;
}

.brand-title {
  color: #f8fafc;
  font-size: 16px;
  font-weight: 820;
  letter-spacing: 0;
}

.course-title-field {
  width: min(440px, 31vw);
  height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #fff;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  outline: none;
}

.course-title-field:hover {
  background: rgba(255, 255, 255, 0.11);
}

.course-title-field:focus {
  border-color: rgba(45, 212, 191, 0.72);
  box-shadow:
    0 0 0 3px rgba(45, 212, 191, 0.16),
    inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.top-actions,
.toolbar,
.row-actions,
.component-actions,
.preview-actions,
.modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.main-grid {
  min-height: calc(100vh - 64px);
  display: grid;
  grid-template-columns: 300px minmax(760px, 1fr) 336px;
}

.sidebar,
.inspector {
  overflow: auto;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96)),
    var(--panel);
  border-right: 1px solid var(--line);
}

.inspector {
  border-right: 0;
  border-left: 1px solid var(--line);
}

.side-section {
  padding: 17px 16px;
  border-bottom: 1px solid rgba(220, 227, 238, 0.86);
}

.section-title {
  margin: 0 0 12px;
  color: #475467;
  font-size: 11px;
  font-weight: 820;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.editor {
  min-width: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #edf2f8;
}

.toolbar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94), rgba(248, 250, 252, 0.94)),
    #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  z-index: 2;
}

.toolbar {
  flex-wrap: wrap;
}

.stage-wrap {
  min-height: 0;
  overflow: auto;
  display: grid;
  place-items: start center;
  padding: 34px 34px 54px;
  background:
    linear-gradient(rgba(199, 210, 225, 0.26) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199, 210, 225, 0.26) 1px, transparent 1px),
    linear-gradient(180deg, #eef3f8 0%, #e8edf5 100%);
  background-size:
    24px 24px,
    24px 24px,
    auto;
}

.stage {
  position: relative;
  width: min(100%, 1120px);
  aspect-ratio: 16 / 9;
  min-height: 630px;
  padding: 46px 54px;
  overflow: visible;
  border: 1px solid rgba(151, 161, 180, 0.38);
  border-radius: 8px;
  background: #fff;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 28px 70px rgba(18, 27, 43, 0.18),
    0 0 0 12px rgba(255, 255, 255, 0.36);
}

.stage.pdf-stage {
  width: min(100%, 1180px);
  min-height: auto;
  aspect-ratio: var(--page-aspect, 0.707);
  padding: 0;
  background: #fff;
}

.preview-page.pdf-stage {
  width: min(100%, 760px);
  aspect-ratio: var(--page-aspect, 0.707);
  padding: 0;
  background: #fff;
}

.pdf-preview-shell .preview-page.pdf-stage {
  width: 100%;
  max-width: none;
  max-height: none;
  border-radius: 0;
  box-shadow: none;
}

.stage::before {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  border-radius: inherit;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.7);
}

.stage.theme-plain {
  background:
    linear-gradient(90deg, rgba(15, 118, 110, 0.1), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.stage.theme-lecture {
  background:
    linear-gradient(135deg, rgba(49, 87, 213, 0.1), transparent 42%),
    linear-gradient(0deg, rgba(173, 116, 23, 0.09), transparent 38%),
    #fff;
}

.stage.theme-assessment {
  background:
    linear-gradient(90deg, rgba(198, 79, 69, 0.1), transparent 34%),
    linear-gradient(180deg, rgba(15, 118, 110, 0.08), transparent 42%),
    #fff;
}

.page-meta-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: start;
  margin-bottom: 25px;
}

.compact-page-meta {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6;
  display: block;
  margin: 0;
}

.compact-page-meta > div:first-child {
  display: none;
}

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

.page-eyebrow::before {
  width: 18px;
  height: 3px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}

.page-title-input {
  width: 100%;
  border: 0;
  color: var(--ink);
  background: transparent;
  font-size: 32px;
  font-weight: 850;
  letter-spacing: 0;
  line-height: 1.18;
  outline: none;
}

.page-title-input:focus {
  color: #0b5d57;
}

.page-counter {
  min-width: 48px;
  padding: 7px 11px;
  border: 1px solid rgba(199, 210, 225, 0.88);
  border-radius: 999px;
  color: #475467;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: var(--shadow-sm);
  font-size: 12px;
  font-weight: 760;
  text-align: center;
}

.page-list {
  display: grid;
  gap: 9px;
}

.page-row {
  position: relative;
  width: 100%;
  min-height: 54px;
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 11px;
  align-items: center;
  padding: 10px 11px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow-sm);
  text-align: left;
  cursor: pointer;
}

.page-row::before {
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: transparent;
  content: "";
}

.page-row:hover {
  border-color: #c9d5e5;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(18, 27, 43, 0.09);
}

.page-row.active {
  border-color: rgba(15, 118, 110, 0.46);
  background: linear-gradient(90deg, var(--accent-soft), #fff);
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.14);
}

.page-row.active::before {
  background: var(--accent);
}

.page-index {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(220, 227, 238, 0.86);
  border-radius: 8px;
  background: #eef2f7;
  color: #475467;
  font-size: 12px;
  font-weight: 850;
}

.page-row.active .page-index {
  border-color: rgba(15, 118, 110, 0.22);
  color: var(--accent);
  background: #fff;
}

.page-name {
  min-width: 0;
  display: block;
  overflow: hidden;
  font-size: 13px;
  font-weight: 760;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-desc {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.template-grid {
  display: grid;
  gap: 9px;
}

.template-btn {
  position: relative;
  width: 100%;
  min-height: 62px;
  padding: 12px 12px 12px 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.template-btn::before {
  position: absolute;
  inset: 12px auto 12px 0;
  width: 3px;
  border-radius: 999px;
  background: var(--indigo);
  content: "";
}

.template-btn:nth-child(2)::before {
  background: var(--gold);
}

.template-btn:nth-child(3)::before {
  background: var(--coral);
}

.template-btn:hover {
  border-color: #c9d5e5;
  background: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(18, 27, 43, 0.1);
}

.template-name {
  display: block;
  font-size: 13px;
  font-weight: 800;
}

.template-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.btn {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: #344054;
  background: #fff;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  font-weight: 700;
  white-space: nowrap;
}

.btn:hover {
  border-color: #c8d3e2;
  background: #fbfdff;
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(18, 27, 43, 0.09);
}

.btn:active {
  transform: translateY(0);
}

.btn.primary {
  border-color: rgba(15, 118, 110, 0.86);
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    var(--accent);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
}

.btn.primary:hover {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent),
    var(--accent-strong);
}

.btn.dark {
  border-color: rgba(255, 255, 255, 0.14);
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.btn.dark:hover {
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.15);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.btn.danger {
  border-color: rgba(201, 50, 50, 0.22);
  color: var(--danger);
  background: #fff;
}

.btn.danger:hover {
  border-color: rgba(201, 50, 50, 0.34);
  background: #fff8f8;
}

.btn.small {
  min-height: 32px;
  padding: 0 11px;
  font-size: 12px;
}

.icon {
  width: 16px;
  height: 16px;
  display: inline-grid;
  place-items: center;
  color: currentColor;
  font-size: 13px;
  font-weight: 850;
  line-height: 1;
}

.component-list {
  display: grid;
  gap: 13px;
}

.pdf-stage .component-list,
.pdf-stage .block,
.pdf-stage .media-box,
.pdf-stage .media-box img {
  width: 100%;
  height: 100%;
}

.pdf-stage .component-list {
  display: block;
}

.pdf-stage .block {
  border-radius: inherit;
}

.pdf-stage .block:hover,
.pdf-stage .block.selected {
  background: transparent;
}

.block {
  position: relative;
  border: 1px solid transparent;
  border-radius: 8px;
  outline: none;
  cursor: pointer;
}

.block:hover {
  border-color: rgba(15, 118, 110, 0.28);
  background: rgba(255, 255, 255, 0.42);
}

.block.selected {
  border-color: rgba(15, 118, 110, 0.72);
  background: rgba(255, 255, 255, 0.56);
  box-shadow:
    0 0 0 3px rgba(15, 118, 110, 0.12),
    0 12px 28px rgba(15, 118, 110, 0.11);
}

.block-toolbar {
  position: absolute;
  top: -14px;
  right: 10px;
  display: none;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(199, 210, 225, 0.92);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 28px rgba(18, 27, 43, 0.16);
  z-index: 4;
}

.block.selected .block-toolbar {
  display: flex;
}

.round-icon {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #475467;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
}

.round-icon:hover {
  color: var(--accent);
  background: var(--accent-soft);
  transform: none;
}

.course-heading {
  margin: 0;
  padding: 10px 12px;
  color: var(--ink);
  font-weight: 860;
  letter-spacing: 0;
  line-height: 1.14;
}

.course-text {
  margin: 0;
  padding: 10px 12px;
  color: #344054;
  line-height: 1.78;
  white-space: pre-wrap;
}

.course-heading[contenteditable="true"]:focus,
.course-text[contenteditable="true"]:focus {
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: 0 0 0 3px rgba(49, 87, 213, 0.1);
  outline: none;
}

.course-divider {
  height: 1px;
  margin: 14px 12px;
  background: linear-gradient(90deg, transparent, #b8c3d3 14%, #d9e0ea 62%, transparent);
}

.media-box {
  margin: 4px 12px;
  overflow: hidden;
  border: 1px solid rgba(199, 210, 225, 0.9);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.full-page-media {
  margin: 0;
  border: 0;
  border-radius: inherit;
  background: #fff;
  box-shadow: none;
}

.media-box img,
.media-box video {
  display: block;
  width: 100%;
  max-height: 310px;
  object-fit: cover;
  background: #e9eef5;
}

.full-page-media img {
  max-height: none;
  object-fit: contain;
}

.media-placeholder {
  min-height: 180px;
  display: grid;
  place-items: center;
  color: var(--muted);
  background:
    linear-gradient(135deg, rgba(49, 87, 213, 0.08), transparent 42%),
    linear-gradient(180deg, #f8fafc, #eef3f8);
  font-weight: 760;
}

.media-caption {
  padding: 10px 13px;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.72);
}

.audio-box {
  margin: 4px 12px;
  padding: 13px;
  border: 1px solid rgba(199, 210, 225, 0.9);
  border-radius: 8px;
  background: #f8fafc;
  box-shadow: var(--shadow-sm);
}

.audio-box audio {
  width: 100%;
}

.quiz-box {
  margin: 4px 12px;
  padding: 17px;
  border: 1px solid rgba(218, 193, 132, 0.82);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent),
    var(--gold-soft);
  box-shadow: var(--shadow-sm);
}

.quiz-box.multi {
  border-color: rgba(160, 177, 232, 0.82);
  border-left-color: var(--indigo);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent),
    var(--indigo-soft);
}

.quiz-box.judge {
  border-color: rgba(231, 173, 168, 0.86);
  border-left-color: var(--coral);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), transparent),
    var(--coral-soft);
}

.quiz-question {
  margin: 0 0 11px;
  color: #1d2939;
  font-weight: 820;
  line-height: 1.5;
}

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

.option-item {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid rgba(16, 24, 40, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.72) inset;
}

.option-mark {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid rgba(199, 210, 225, 0.9);
  border-radius: 999px;
  background: #fff;
  color: #344054;
  font-size: 11px;
  font-weight: 850;
}

.button-block-link {
  margin: 4px 12px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border-radius: 8px;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.14), transparent),
    var(--accent);
  box-shadow: 0 10px 22px rgba(15, 118, 110, 0.22);
  font-weight: 800;
  text-decoration: none;
}

.button-block-link:hover {
  transform: translateY(-1px);
}

.field-stack {
  display: grid;
  gap: 13px;
}

.field {
  display: grid;
  gap: 7px;
}

.field label,
.inline-label {
  color: #475467;
  font-size: 12px;
  font-weight: 760;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 38px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
  outline: none;
}

.field textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.55;
}

#blockText,
#quizOptions {
  min-height: 220px;
}

.field input:hover,
.field textarea:hover,
.field select:hover {
  border-color: #c8d3e2;
}

.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(15, 118, 110, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.8) inset;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.check-list {
  display: grid;
  gap: 8px;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #344054;
  font-size: 13px;
}

.check-row input {
  width: 16px;
  height: 16px;
}

.muted-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.empty-panel {
  padding: 18px;
  border: 1px dashed var(--line-strong);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.72);
  text-align: center;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(13, 20, 36, 0.72);
  backdrop-filter: blur(10px);
  z-index: 30;
}

.modal-backdrop.open {
  display: grid;
}

.ui-modal-backdrop,
.import-progress-backdrop {
  z-index: 42;
}

.dialog-card,
.import-progress-card {
  width: min(480px, calc(100vw - 32px));
  padding: 22px;
  border: 1px solid rgba(217, 224, 234, 0.92);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 250, 252, 0.96)),
    #fff;
  box-shadow: 0 28px 80px rgba(13, 20, 36, 0.32);
}

.dialog-card {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 14px;
}

.dialog-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.18), rgba(49, 87, 213, 0.1)),
    #effaf8;
  border: 1px solid rgba(15, 118, 110, 0.16);
}

.dialog-warning .dialog-mark {
  background:
    linear-gradient(135deg, rgba(183, 121, 31, 0.2), rgba(15, 118, 110, 0.08)),
    #fff7e6;
  border-color: rgba(183, 121, 31, 0.22);
}

.dialog-danger .dialog-mark {
  background:
    linear-gradient(135deg, rgba(194, 65, 58, 0.18), rgba(183, 121, 31, 0.08)),
    #fff0ee;
  border-color: rgba(194, 65, 58, 0.22);
}

.dialog-copy h2,
.import-progress-card h2 {
  margin: 0;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.25;
  letter-spacing: 0;
}

.dialog-copy p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
}

.dialog-actions {
  grid-column: 1 / -1;
  justify-content: flex-end;
  margin-top: 8px;
}

.dialog-kicker {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
}

.import-progress-card {
  display: grid;
  gap: 14px;
}

.import-progress-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.import-progress-percent {
  min-width: 54px;
  padding: 6px 10px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 999px;
  color: var(--accent);
  background: rgba(15, 118, 110, 0.08);
  text-align: center;
  font-size: 13px;
  font-weight: 850;
}

.import-progress-bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid rgba(199, 210, 225, 0.84);
  border-radius: 999px;
  background: #edf2f7;
}

.import-progress-fill {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background:
    linear-gradient(90deg, #0f766e, #3157d5);
  transition: width 0.22s ease;
}

.import-progress-title {
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 830;
}

.import-progress-detail {
  margin: -8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.toast-layer {
  position: fixed;
  top: 78px;
  right: 18px;
  z-index: 60;
  display: grid;
  gap: 10px;
  pointer-events: none;
}

.toast {
  min-width: 240px;
  max-width: min(360px, calc(100vw - 36px));
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(217, 224, 234, 0.92);
  border-radius: 8px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 42px rgba(13, 20, 36, 0.18);
  opacity: 0;
  transform: translateY(-8px);
  transition:
    opacity 0.2s ease,
    transform 0.2s ease;
  font-size: 13px;
  font-weight: 760;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.toast-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 118, 110, 0.12);
}

.toast-warning .toast-dot {
  background: var(--warm);
  box-shadow: 0 0 0 4px rgba(183, 121, 31, 0.13);
}

.preview-shell {
  width: min(1120px, 96vw);
  height: min(720px, 92vh);
  display: grid;
  grid-template-rows: 54px 1fr 58px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: #111827;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.38);
}

.preview-shell.pdf-preview-shell {
  width: min(1280px, 96vw);
  height: min(860px, 92vh);
}

.preview-top,
.preview-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 16px;
  color: #fff;
  background: rgba(13, 20, 36, 0.72);
}

.preview-title {
  min-width: 0;
  overflow: hidden;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.preview-canvas {
  min-height: 0;
  display: grid;
  place-items: center;
  padding: 26px;
  background:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(180deg, #101828, #0b1220);
  background-size:
    28px 28px,
    28px 28px,
    auto;
}

.pdf-preview-shell .preview-canvas {
  display: block;
  overflow: auto;
  padding: 0;
  background: #0b1220;
}

.preview-page {
  width: min(100%, 960px);
  aspect-ratio: 16 / 9;
  max-height: 100%;
  overflow: auto;
  padding: 44px 52px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.24);
}

.preview-page .block {
  cursor: default;
}

.preview-page .block:hover,
.preview-page .block.selected {
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.preview-page .block-toolbar {
  display: none;
}

.progress-track {
  width: 220px;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.progress-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2dd4bf, #7dd3fc);
}

.play-answer {
  margin-top: 13px;
  display: flex;
  align-items: center;
  gap: 9px;
}

.play-feedback {
  margin-top: 10px;
  color: #344054;
  font-size: 13px;
  font-weight: 800;
}

.hidden-file {
  display: none;
}

@media (max-width: 980px) {
  body {
    min-width: 0;
  }

  .app-shell {
    grid-template-rows: auto 1fr;
  }

  .main-grid {
    grid-template-columns: 1fr;
  }

  .sidebar,
  .inspector {
    max-height: none;
    border: 0;
  }

  .stage-wrap {
    padding: 16px;
  }

  .stage,
  .preview-page {
    min-height: auto;
    padding: 28px 20px;
  }

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

  .dialog-mark {
    display: none;
  }

  .toast-layer {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
  }

  .toast {
    width: 100%;
    max-width: none;
  }

  .topbar {
    height: auto;
    flex-wrap: wrap;
    padding: 10px 12px;
  }

  .brand,
  .course-title-field {
    width: 100%;
  }

  .course-title-field {
    min-width: 0;
  }
}
