/* ============================================================
   玄通课堂 · H5 视觉增强层
   仅做样式叠加，不改动课程 / 播放 / 权限逻辑
   ============================================================ */

:root {
  --t-color-accent: #c6a15b;
  --t-color-accent-light: #e7cf9d;
  --t-shadow-card: 0 8px 24px rgba(34, 54, 68, 0.08);
  --ks-h5-gold: #c6a15b;
  --ks-h5-gold-soft: #e7cf9d;
  --ks-h5-ink: #1e3846;
}

html {
  scroll-behavior: smooth;
}

body {
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

#root {
  isolation: isolate;
}

#root > div {
  animation: ks-page-in 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
}

@keyframes ks-page-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

::selection {
  color: #fff;
  background: rgba(183, 138, 60, 0.68);
}

/* ---------- Hero / brand ---------- */

.login-hero {
  overflow: hidden;
}

.login-hero::after {
  content: "";
  position: absolute;
  top: -96px;
  right: -78px;
  width: 230px;
  height: 230px;
  border: 1px solid rgba(217, 179, 106, 0.18);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 26px rgba(217, 179, 106, 0.035),
    inset 0 0 0 56px rgba(217, 179, 106, 0.025);
  pointer-events: none;
}

.login-hero .brand {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Microsoft YaHei", serif;
  font-weight: 600;
}

.login-hero .sub {
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.18);
}

.login-hero .line {
  box-shadow: 0 0 14px rgba(217, 179, 106, 0.45);
}

/* ---------- Cards ---------- */

.card {
  background: rgba(255, 255, 255, 0.94);
  box-shadow:
    0 8px 24px rgba(34, 54, 68, 0.055),
    inset 0 0 0 1px rgba(232, 226, 214, 0.85);
  transition: box-shadow 0.22s ease, transform 0.22s ease;
}

.course-card {
  position: relative;
  border: 1px solid rgba(198, 161, 91, 0.18);
  box-shadow:
    0 10px 26px rgba(34, 54, 68, 0.08),
    inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.course-card::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.12), transparent 34%);
}

.course-card .cover {
  transition: transform 0.55s cubic-bezier(0.22, 0.61, 0.36, 1);
  transform-origin: center;
}

.course-card:active {
  transform: scale(0.975);
  box-shadow: 0 4px 14px rgba(34, 54, 68, 0.08);
}

.course-card:active .cover {
  transform: scale(1.03);
}

.course-card .cover-placeholder {
  background:
    radial-gradient(circle at 50% 44%, rgba(217, 179, 106, 0.2), transparent 42%),
    linear-gradient(150deg, #345568, #1b303b);
}

.course-card .cover-placeholder .ring {
  border-color: rgba(217, 179, 106, 0.42);
  box-shadow:
    inset 0 0 0 12px rgba(217, 179, 106, 0.05),
    0 0 30px rgba(217, 179, 106, 0.08);
}

.course-card .body .name {
  letter-spacing: 0.04em;
}

/* ---------- Level badge ---------- */

.level-tag {
  padding: 3px 11px;
  letter-spacing: 0.1em;
  box-shadow:
    0 2px 8px rgba(34, 54, 68, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.level-tag.fengshui {
  background: linear-gradient(135deg, #416579, #2f4a5a);
}

.level-tag.qimen {
  color: #3a2b13;
  background: linear-gradient(135deg, #e7cf9d, #b78a3c);
}

.member-card {
  border: 1px solid rgba(217, 179, 106, 0.28);
}

.member-card::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(231, 207, 157, 0.9), transparent);
}

/* ---------- Section heading ---------- */

.section-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", "Microsoft YaHei", serif;
  font-size: 20px;
  letter-spacing: 0.24em;
}

.section-title::before,
.section-title::after {
  width: 42px;
  opacity: 0.9;
}

/* ---------- Buttons & inputs ---------- */

.btn-primary {
  height: 48px;
  border-radius: 13px;
  letter-spacing: 0.24em;
  background: linear-gradient(135deg, #416579, #24414f 58%, #1e3644);
  box-shadow:
    0 10px 24px rgba(34, 54, 68, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.995);
  box-shadow:
    0 4px 12px rgba(34, 54, 68, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.btn-primary:disabled {
  opacity: 0.56;
}

.text-input {
  height: 48px;
  border-color: rgba(198, 161, 91, 0.32);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 16px;
  letter-spacing: 0.02em;
}

.text-input:focus {
  border-color: var(--ks-h5-gold);
  box-shadow: 0 0 0 4px rgba(198, 161, 91, 0.14);
}

.login-form > div:last-child {
  padding: 0 8px;
  font-size: 12px;
  line-height: 1.75;
  letter-spacing: 0.015em;
}

/* ---------- Page header ---------- */

.page-header {
  height: 54px;
  background: rgba(247, 243, 236, 0.88);
  border-bottom: 1px solid rgba(183, 138, 60, 0.24);
  box-shadow: 0 6px 20px rgba(34, 54, 68, 0.04);
}

.page-header .title {
  letter-spacing: 0.06em;
}

.page-header .back {
  transition: background 0.2s ease, transform 0.2s ease;
}

.page-header .back:active {
  transform: scale(0.92);
}

/* ---------- Lessons & player ---------- */

.lesson-row {
  min-height: 60px;
  transition: background 0.18s ease;
}

.lesson-row:active {
  background: rgba(183, 138, 60, 0.07);
}

.lesson-row .icon {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.lesson-row .state.studying {
  color: var(--ks-h5-gold);
  font-weight: 500;
}

.player-shell {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.controls {
  padding: 9px 12px;
  background: linear-gradient(180deg, rgba(14, 24, 32, 0.35), #0e1820);
}

.controls button {
  min-width: 36px;
  min-height: 36px;
  border-radius: 10px;
  transition: background 0.18s ease;
}

.controls button:active {
  background: rgba(255, 255, 255, 0.12);
}

.play-btn {
  box-shadow:
    0 10px 28px rgba(0, 0, 0, 0.4),
    0 0 0 10px rgba(198, 161, 91, 0.12),
    0 0 0 20px rgba(198, 161, 91, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-btn:active {
  transform: scale(0.94);
}

/* ---------- Feedback states ---------- */

.empty {
  letter-spacing: 0.12em;
  line-height: 1.8;
}

.spinner {
  box-shadow: 0 0 18px rgba(198, 161, 91, 0.18);
}

.progress-track {
  box-shadow: inset 0 1px 2px rgba(34, 54, 68, 0.08);
}

.progress-fill.gold {
  background: linear-gradient(90deg, #e7cf9d, #b78a3c);
  box-shadow: 0 0 12px rgba(183, 138, 60, 0.28);
}

/* ---------- Desktop frame ---------- */

@media (min-width: 481px) {
  #root {
    box-shadow:
      0 0 0 1px rgba(217, 179, 106, 0.42),
      0 30px 90px rgba(0, 0, 0, 0.48);
  }
}

@media (max-width: 360px) {
  .login-hero {
    padding-top: 58px;
    padding-bottom: 44px;
  }

  .section-title {
    font-size: 18px;
    letter-spacing: 0.2em;
  }

  .course-card .body .name {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* ---------- Boot loader / back label ---------- */

.ks-boot {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background:
    radial-gradient(120% 60% at 50% 0%, rgba(47, 74, 90, 0.1), transparent 55%),
    #f7f3ec;
}

.ks-boot-seal {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(198, 161, 91, 0.55);
  border-radius: 16px;
  color: #b78a3c;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 28px;
  background: linear-gradient(145deg, rgba(198, 161, 91, 0.16), rgba(198, 161, 91, 0.03));
  box-shadow: inset 0 0 0 4px rgba(247, 243, 236, 0.9);
}

.ks-boot-title {
  color: #1e3846;
  font-family: "Songti SC", "STSong", "Noto Serif SC", serif;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.24em;
}

.ks-boot-bar {
  position: relative;
  width: 116px;
  height: 2px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 2px;
  background: rgba(183, 138, 60, 0.16);
}

.ks-boot-bar::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 46px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #c6a15b, transparent);
  animation: ks-boot-slide 1.15s ease-in-out infinite;
}

.ks-boot-tip {
  color: #9a9182;
  font-size: 12px;
  letter-spacing: 0.14em;
}

@keyframes ks-boot-slide {
  0% { transform: translateX(-50px); }
  100% { transform: translateX(120px); }
}

.page-header .back {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: auto;
  min-width: 0;
  height: 38px;
  padding: 0 10px;
  gap: 2px;
  font-size: 15px;
  letter-spacing: 0.02em;
  z-index: 2;
}

.page-header .title {
  padding: 0 78px;
}

.page-header .side {
  width: 70px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}


/* ---------- Fullscreen player ---------- */

.player-shell:fullscreen,
.player-shell:-webkit-full-screen {
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: 100vw;
  height: 100vh;
  background: #000;
}

.player-shell:fullscreen > div:first-child,
.player-shell:-webkit-full-screen > div:first-child {
  width: 100%;
}

.player-shell:fullscreen video,
.player-shell:-webkit-full-screen video {
  max-height: calc(100vh - 52px);
  object-fit: contain;
}

.player-shell:fullscreen .controls,
.player-shell:-webkit-full-screen .controls {
  width: 100%;
}


/* CSS 全屏（兼容微信/iOS，不依赖原生 Fullscreen API） */
.player-shell.player-fs {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 9999;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  background: #000;
}

.player-shell.player-fs > div:first-child {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  background: #000;
}

.player-shell.player-fs video {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 48px);
  object-fit: contain;
  aspect-ratio: auto;
}

.player-shell.player-fs .controls {
  width: 100%;
  flex: 0 0 auto;
}
