:root {
  --bg: #f6f7f4;
  --panel: #ffffff;
  --panel-soft: #eef2ec;
  --ink: #17201b;
  --muted: #66716b;
  --line: #dbe1dc;
  --accent: #0e7c66;
  --accent-strong: #095d4c;
  --blue: #315c92;
  --coral: #c7503f;
  --warn: #8a5a11;
  --danger: #b3261e;
  --shadow: 0 18px 60px rgb(23 32 27 / 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
  letter-spacing: 0;
}

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

button {
  cursor: pointer;
}

.boot {
  display: grid;
  min-height: 100dvh;
  place-items: center;
  color: var(--muted);
}

.login-screen {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 440px);
}

.login-brand {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 54px;
  color: white;
  background:
    linear-gradient(135deg, rgb(9 93 76 / 0.92), rgb(18 32 27 / 0.94)),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='1200' height='900' viewBox='0 0 1200 900'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.11' stroke-width='2'%3E%3Cpath d='M0 180h1200M0 360h1200M0 540h1200M0 720h1200M220 0v900M470 0v900M720 0v900M970 0v900'/%3E%3Ccircle cx='260' cy='240' r='120'/%3E%3Ccircle cx='760' cy='590' r='180'/%3E%3Cpath d='M120 700c180-120 310-150 490-80s310 60 480-80'/%3E%3C/g%3E%3C/svg%3E");
  background-size: cover;
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 23px;
}

.mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-strong);
  background: white;
  font-weight: 900;
}

.login-brand h1 {
  max-width: 740px;
  margin: 0 0 22px;
  font-size: clamp(38px, 5vw, 68px);
  line-height: 1.06;
  letter-spacing: 0;
}

.login-brand p {
  max-width: 620px;
  margin: 0;
  color: rgb(255 255 255 / 0.76);
  font-size: 18px;
  line-height: 1.8;
}

.login-panel {
  display: flex;
  align-items: center;
  padding: 44px;
  background: var(--panel);
}

.login-box {
  width: 100%;
}

.login-box h2 {
  margin: 0 0 10px;
  font-size: 26px;
}

.login-box .hint {
  margin: 0 0 30px;
  color: var(--muted);
  line-height: 1.7;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  color: #26352e;
  font-size: 14px;
  font-weight: 700;
}

.input,
.textarea,
.select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: white;
  outline: none;
}

.input,
.select {
  min-height: 42px;
  padding: 0 12px;
}

.textarea {
  min-height: 112px;
  padding: 12px;
  line-height: 1.6;
  resize: vertical;
}

.input:focus,
.textarea:focus,
.select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(14 124 102 / 0.14);
}

.btn {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 14px;
  color: white;
  background: var(--accent);
  font-weight: 800;
  white-space: nowrap;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.btn:hover {
  background: var(--accent-strong);
}

.btn:active {
  transform: translateY(1px);
}

.btn.secondary {
  color: var(--ink);
  border-color: var(--line);
  background: white;
}

.btn.secondary:hover {
  border-color: #aab7af;
  background: #f8faf8;
}

.btn.danger {
  color: white;
  background: var(--danger);
}

.btn.ghost {
  color: var(--accent-strong);
  background: transparent;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.error {
  margin: 12px 0 0;
  color: var(--danger);
  font-weight: 700;
}

.workspace {
  display: grid;
  min-height: 100dvh;
  grid-template-columns: 260px minmax(0, 1fr);
}

.sidebar {
  display: flex;
  flex-direction: column;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.sidebar .wordmark {
  margin-bottom: 26px;
  color: var(--ink);
}

.nav {
  display: grid;
  gap: 8px;
}

.nav button {
  display: flex;
  width: 100%;
  min-height: 42px;
  align-items: center;
  justify-content: space-between;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0 12px;
  color: #314038;
  background: transparent;
  text-align: left;
  font-weight: 800;
}

.nav button.active {
  color: white;
  background: var(--ink);
}

.nav small {
  color: inherit;
  opacity: 0.72;
}

.user-box {
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.user-box strong,
.user-box span {
  display: block;
}

.user-box span {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.main {
  min-width: 0;
  padding: 26px 32px 38px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.topbar h1 {
  margin: 0 0 8px;
  font-size: 30px;
  line-height: 1.22;
}

.topbar p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

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

.course-card {
  display: flex;
  min-height: 246px;
  flex-direction: column;
  padding: 18px;
}

.course-card h3 {
  margin: 14px 0 10px;
  font-size: 20px;
  line-height: 1.35;
}

.course-card p {
  margin: 0 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.course-card .card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
}

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

.tag {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  color: #234137;
  background: var(--panel-soft);
  font-size: 13px;
  font-weight: 800;
}

.tag.blue {
  color: #244469;
  background: #e6edf6;
}

.tag.coral {
  color: #793328;
  background: #f7e6e1;
}

.list {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: var(--shadow);
}

.list-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
}

.list-row:last-child {
  border-bottom: 0;
}

.list-row h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.meta {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.empty {
  display: grid;
  min-height: 260px;
  place-items: center;
  border: 1px dashed #b9c4bd;
  border-radius: 8px;
  color: var(--muted);
  background: rgb(255 255 255 / 0.62);
  text-align: center;
  line-height: 1.8;
}

.editor-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 360px;
  gap: 16px;
  align-items: start;
}

.slide-list,
.inspector {
  position: sticky;
  top: 16px;
  max-height: calc(100dvh - 52px);
  overflow: auto;
}

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

.slide-thumb {
  display: grid;
  min-height: 88px;
  align-content: start;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px;
  background: white;
  text-align: left;
}

.slide-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgb(14 124 102 / 0.12);
}

.slide-thumb span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.slide-thumb strong {
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  text-overflow: ellipsis;
}

.stage-wrap {
  display: grid;
  gap: 14px;
}

.stage {
  position: relative;
  display: grid;
  min-height: 500px;
  align-content: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 60px;
  background: white;
  box-shadow: var(--shadow);
}

.stage.green {
  background: linear-gradient(135deg, #f8fcf8, #e9f3ee);
}

.stage.blue {
  background: linear-gradient(135deg, #f8fbff, #e7edf8);
}

.stage.coral {
  background: linear-gradient(135deg, #fffafa, #f8e9e4);
}

.stage::before {
  content: "";
  position: absolute;
  inset: auto -90px -120px auto;
  width: 280px;
  height: 280px;
  border: 38px solid rgb(23 32 27 / 0.06);
  border-radius: 50%;
}

.stage h2 {
  position: relative;
  max-width: 820px;
  margin: 0 0 18px;
  font-size: clamp(32px, 4.2vw, 58px);
  line-height: 1.16;
}

.stage p {
  position: relative;
  max-width: 780px;
  margin: 0 0 26px;
  color: var(--muted);
  font-size: 22px;
  line-height: 1.55;
}

.stage ul {
  position: relative;
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.stage li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  color: #24342d;
  font-size: 20px;
  line-height: 1.55;
}

.stage li::before {
  content: "";
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 12px;
  border-radius: 50%;
  background: var(--accent);
}

.stage.blue li::before {
  background: var(--blue);
}

.stage.coral li::before {
  background: var(--coral);
}

.watermark {
  position: absolute;
  right: 18px;
  bottom: 14px;
  color: rgb(23 32 27 / 0.34);
  font-size: 13px;
  font-weight: 800;
  pointer-events: none;
}

.stage-tools,
.editor-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
}

.inspector {
  padding: 18px;
}

.inspector h2 {
  margin: 0 0 18px;
  font-size: 20px;
}

.note {
  padding: 12px;
  border-radius: 8px;
  color: #314038;
  background: #eef2ec;
  line-height: 1.7;
}

.present {
  display: grid;
  min-height: 100dvh;
  grid-template-rows: 1fr auto;
  padding: 24px;
  background: #111816;
}

.present .stage {
  min-height: calc(100dvh - 116px);
}

.present-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 14px;
  color: white;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: 360px;
  border-radius: 8px;
  padding: 12px 14px;
  color: white;
  background: var(--ink);
  box-shadow: var(--shadow);
}

.admin-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
  padding: 16px;
}

@media (max-width: 1100px) {
  .editor-layout {
    grid-template-columns: 190px minmax(0, 1fr);
  }

  .inspector {
    position: static;
    grid-column: 1 / -1;
  }
}

@media (max-width: 820px) {
  .login-screen,
  .workspace {
    grid-template-columns: 1fr;
  }

  .login-brand {
    min-height: 46dvh;
    padding: 30px 22px;
  }

  .login-panel,
  .main {
    padding: 24px 18px;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 10;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .user-box {
    display: none;
  }

  .topbar,
  .list-row,
  .stage-tools,
  .present-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .editor-layout {
    grid-template-columns: 1fr;
  }

  .slide-list {
    position: static;
    max-height: none;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .stage {
    min-height: 420px;
    padding: 34px 24px;
  }

  .stage h2 {
    font-size: 34px;
  }

  .stage p,
  .stage li {
    font-size: 18px;
  }

  .admin-form {
    grid-template-columns: 1fr;
  }
}
