:root {
  --bg: #f5f6f3;
  --surface: #ffffff;
  --surface-alt: #eef2ef;
  --line: #d7ddd7;
  --text: #18231f;
  --muted: #61716a;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --gold: #eab308;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(24, 35, 31, 0.12);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
  letter-spacing: 0;
}

button {
  min-height: 40px;
  border: 1px solid var(--teal-dark);
  border-radius: 6px;
  background: var(--teal);
  color: #fff;
  padding: 0 16px;
  cursor: pointer;
}

button:hover {
  background: var(--teal-dark);
}

button:disabled {
  cursor: not-allowed;
  border-color: #a9b7b1;
  background: #a9b7b1;
}

.hidden {
  display: none !important;
}

.welcome-view {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: #ffffff;
}

.welcome-ellipse {
  position: absolute;
  display: block;
  user-select: none;
  pointer-events: none;
}

.welcome-ellipse-red {
  top: 0;
  left: 0;
  width: min(54vw, 935px);
  height: auto;
}

.welcome-ellipse-blue {
  top: 0;
  right: 0;
  width: min(54vw, 999px);
  height: auto;
}

.welcome-actions {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  width: min(520px, calc(100vw - 48px));
  display: grid;
  gap: 10px;
  justify-items: center;
  transform: translate(-50%, -50%);
}

.welcome-brand-logo-full {
  display: block;
  width: min(340px, 100%);
  height: auto;
  margin-bottom: 14px;
  user-select: none;
}

.welcome-action-control,
.welcome-action-link {
  min-height: 0;
  width: min(340px, 100%);
  display: block;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  cursor: pointer;
}

.welcome-action-control:hover,
.welcome-action-control:focus-visible,
.welcome-action-link:hover,
.welcome-action-link:focus-visible {
  background: transparent;
}

.welcome-action-control:focus-visible,
.welcome-action-link:focus-visible {
  outline: 3px solid rgba(57, 124, 207, 0.4);
  outline-offset: 4px;
}

.welcome-action-button {
  display: block;
  width: min(340px, 100%);
  height: auto;
  user-select: none;
}

.welcome-footer {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 84px;
  overflow: hidden;
}

.welcome-bottom-line {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  pointer-events: none;
}

.welcome-footer-content {
  position: relative;
  z-index: 1;
  height: 100%;
  display: grid;
  align-content: start;
  justify-items: center;
  color: #000000;
  text-align: center;
}

.welcome-friend-links {
  margin: 26px 0 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
}

.welcome-youtube {
  color: #f14e4c;
}

.welcome-footer p {
  height: 12px;
  margin: 0;
  color: #b7b8be;
  font-size: 12px;
  line-height: 12px;
}

.login-view {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px;
  background:
    linear-gradient(180deg, rgba(57, 124, 207, 0.05) 0%, rgba(234, 103, 98, 0.04) 100%),
    #ffffff;
  overflow-x: hidden;
}

.login-panel {
  display: grid;
  width: min(600px, 100%);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 0;
  background: #ffffff;
  border: 1px solid #dee3e9;
  border-radius: 32px;
  box-shadow: rgba(57, 124, 207, 0.16) 0 1px 4px;
}

.login-content {
  display: grid;
  align-content: center;
  gap: 24px;
  padding: 44px;
}

.login-brand {
  display: grid;
  gap: 14px;
  text-align: left;
}

.login-brand-main {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
}

.login-logo {
  display: block;
  width: 86px;
  height: 86px;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: rgba(57, 124, 207, 0.18) 0 10px 22px;
}

.login-title {
  display: grid;
  gap: 2px;
  margin: 0;
  color: #0a1317;
  font-size: 48px;
  font-weight: 500;
  line-height: 1.17;
}

.login-title span {
  display: block;
}

.login-title .title-blue {
  color: #397ccf;
}

.login-title .title-red {
  color: #ea6762;
}

.login-brand p {
  margin: 0;
  color: #5d6c7b;
  font-size: 16px;
}

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

label {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  color: var(--muted);
  font-size: 14px;
}

.login-panel label {
  margin: 0;
}

.form-field {
  color: #1c1e21;
  font-weight: 700;
}

input,
select {
  min-height: 44px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  padding: 0 12px;
  outline: none;
}

.form-field input {
  min-height: 50px;
  border: 1px solid #ced0d4;
  border-radius: 8px;
  padding: 10px 12px;
  color: #1c1e21;
  background: #ffffff;
}

input:focus,
select:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.14);
}

.form-field input:focus {
  border-color: #397ccf;
  box-shadow: 0 0 0 3px rgba(57, 124, 207, 0.16);
}

.login-panel button {
  width: 100%;
}

.primary-button {
  min-height: 52px;
  border: 0;
  border-radius: 999px;
  background: #397ccf;
  color: #ffffff;
  font-weight: 700;
  box-shadow: rgba(57, 124, 207, 0.22) 0 10px 22px;
}

.primary-button:hover {
  background: #236bb9;
}

.primary-button:disabled {
  background: #8595a4;
  box-shadow: none;
}

.message {
  min-height: 20px;
  margin: 0;
  color: #5d6c7b;
  font-size: 14px;
}

.login-status {
  color: #397ccf;
}

.login-status:not(:empty) {
  color: #ea6762;
}

.app-view {
  min-height: 100vh;
  display: grid;
  grid-template-rows: auto 1fr;
}

.topbar {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 22px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.brand-line,
.account-line {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-line img {
  width: 34px;
  height: 34px;
}

.brand-copy {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.brand-line strong {
  font-size: 18px;
  line-height: 1.1;
}

.brand-line span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
}

.account-line span {
  max-width: 28vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
}

.account-line button {
  min-height: 34px;
  padding: 0 12px;
  background: #fff;
  color: var(--teal-dark);
}

.account-line button:hover {
  background: var(--surface-alt);
}

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

.library {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(180px, 42vh) 1fr;
  gap: 16px;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #fbfcfa;
}

.library-block {
  min-height: 0;
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 10px;
}

.block-title,
.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.list {
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.list-item {
  width: 100%;
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-align: left;
}

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

.list-item:hover {
  background: var(--surface-alt);
}

.list-item.is-active {
  background: #dff3ed;
  box-shadow: inset 3px 0 0 var(--teal);
}

.item-title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-weight: 700;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
}

.lesson {
  min-width: 0;
  display: grid;
  grid-template-rows: auto auto auto;
  align-content: start;
  gap: 16px;
  padding: 18px 22px 22px;
}

.player-shell {
  position: relative;
  width: 100%;
  max-height: min(62vh, 720px);
  aspect-ratio: 16 / 9;
  background: #0b0f0d;
  border: 1px solid #111815;
  border-radius: 8px;
  overflow: hidden;
}

body.has-player-browser-fullscreen {
  overflow: hidden;
}

.player-shell.is-browser-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: none;
  aspect-ratio: auto;
  border: 0;
  border-radius: 0;
}

video {
  width: 100%;
  height: 100%;
  display: block;
  background: #0b0f0d;
  cursor: pointer;
  user-select: none;
}

.aliyun-player,
.aliyun-player .prism-player,
.aliyun-player video {
  width: 100%;
  height: 100%;
  background: #0b0f0d;
}

.aliyun-player {
  display: block;
  user-select: none;
}

.aliyun-player .prism-player {
  position: relative;
}

.aliyun-player .prism-controlbar {
  z-index: 5 !important;
}

.is-drm-player .watermark-layer {
  z-index: 3;
}

.is-drm-player .player-loading {
  z-index: 6;
}

.player-loading {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(11, 15, 13, 0.78), rgba(11, 15, 13, 0.42)),
    rgba(11, 15, 13, 0.54);
  color: #fff;
  pointer-events: none;
}

.player-loading.is-compact {
  inset: 14px 14px auto auto;
  width: min(330px, calc(100% - 28px));
  display: block;
  padding: 0;
  background: transparent;
}

.loading-panel {
  width: min(380px, 100%);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 10px 12px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 11, 0.86);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.player-loading.is-compact .loading-panel {
  width: 100%;
  grid-template-columns: auto 1fr auto;
  gap: 6px 9px;
  padding: 9px 10px;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(8, 13, 11, 0.74);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(6px);
}

.loader-ring {
  width: 30px;
  height: 30px;
  border: 3px solid rgba(255, 255, 255, 0.22);
  border-top-color: #2dd4bf;
  border-radius: 50%;
  animation: loader-spin 0.9s linear infinite;
}

.player-loading.is-compact .loader-ring {
  width: 18px;
  height: 18px;
  border-width: 2px;
}

.loading-copy {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.loading-copy strong {
  font-size: 15px;
  line-height: 1.3;
}

.player-loading.is-compact .loading-copy strong {
  font-size: 12px;
}

.loading-copy span {
  color: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.player-loading.is-compact .loading-copy span {
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.loading-meter {
  grid-column: 1 / -1;
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.player-loading.is-compact .loading-meter {
  height: 4px;
}

.loading-meter span {
  width: 0%;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #2dd4bf, #eab308);
  transition: width 180ms ease;
}

.loading-meter span.is-indeterminate {
  width: 42%;
  animation: loading-slide 1.15s ease-in-out infinite;
}

.loading-percent {
  min-width: 48px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 14px;
  font-weight: 700;
  text-align: right;
}

.player-loading.is-compact .loading-percent {
  min-width: 36px;
  font-size: 12px;
}

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

@keyframes loading-slide {
  0% {
    transform: translateX(-115%);
  }

  50% {
    transform: translateX(55%);
  }

  100% {
    transform: translateX(235%);
  }
}

.watermark-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: minmax(72px, 1fr);
  align-items: center;
  pointer-events: none;
  opacity: 0.06;
}

.watermark-layer span {
  color: rgba(255, 255, 255, 0.82);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  text-align: center;
  transform: rotate(-18deg);
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 0 8px rgba(0, 0, 0, 0.55);
  user-select: none;
  overflow-wrap: anywhere;
}

.custom-controls {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto minmax(80px, 1fr) auto auto minmax(58px, 92px) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(8, 13, 11, 0.76);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(10px);
}

.control-button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
  line-height: 1;
}

.control-button:hover,
.control-button:focus-visible {
  background: rgba(255, 255, 255, 0.14);
  outline: none;
}

.time-label {
  min-width: 42px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.seek-slider,
.volume-slider {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  accent-color: #2dd4bf;
  cursor: pointer;
}

.seek-slider:focus,
.volume-slider:focus {
  box-shadow: none;
}

.seek-slider::-webkit-slider-runnable-track,
.volume-slider::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.seek-slider::-webkit-slider-thumb,
.volume-slider::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  margin-top: -5.5px;
}

.seek-slider::-moz-range-track,
.volume-slider::-moz-range-track {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

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

.lesson-header h2 {
  margin: 4px 0 0;
  font-size: 22px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.course-description {
  margin: 0;
  max-width: 900px;
  color: var(--muted);
  line-height: 1.7;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 16px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-line {
    width: 100%;
  }

  .account-line span {
    max-width: none;
    margin-right: auto;
  }

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

  .library {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    grid-template-rows: auto auto;
  }

  .list {
    max-height: 34vh;
  }

  .lesson {
    padding: 16px;
  }

  .custom-controls {
    right: 10px;
    bottom: 10px;
    left: 10px;
    grid-template-columns: auto auto minmax(60px, 1fr) auto auto;
    gap: 7px;
    padding: 8px 9px;
  }

  .volume-slider {
    display: none;
  }
}

@media (max-width: 520px) {
  .login-view {
    min-height: 100svh;
    align-content: start;
    place-items: start stretch;
    align-items: start;
    justify-items: stretch;
    padding: max(16px, env(safe-area-inset-top)) 14px 16px;
  }

  .login-panel {
    width: min(100%, 440px);
    margin: 0 auto;
    border-radius: 24px;
  }

  .login-content {
    gap: 18px;
    padding: 24px;
  }

  .login-brand-main {
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 12px;
  }

  .login-logo {
    width: 58px;
    height: 58px;
    border-radius: 16px;
  }

  .login-title {
    font-size: 32px;
    line-height: 1.18;
  }

  .login-brand p {
    font-size: 15px;
    line-height: 1.45;
  }

  .login-form {
    gap: 14px;
  }

  .primary-button {
    min-height: 46px;
  }

  .lesson-header {
    display: grid;
  }

  .watermark-layer {
    grid-template-columns: repeat(2, 1fr);
  }

  .player-loading {
    padding: 12px;
  }

  .loading-panel {
    grid-template-columns: auto 1fr;
  }

  .loading-percent {
    grid-column: 1 / -1;
    min-width: 0;
    text-align: left;
  }

  .custom-controls {
    bottom: 8px;
    border-radius: 8px;
  }

  .time-label {
    min-width: 36px;
    font-size: 12px;
  }

  .control-button {
    width: 30px;
    height: 30px;
    min-height: 30px;
  }
}
