:root {
  --bg: #f6f9fc;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-line: rgba(176, 193, 214, 0.72);
  --text: #132033;
  --muted: #526276;
  --muted-light: #6d7d90;
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.1);
  --primary-line: rgba(37, 99, 235, 0.18);
  --accent: #0f9f8f;
  --accent-soft: rgba(15, 159, 143, 0.1);
  --warm: #f59e0b;
  --shadow: 0 24px 54px rgba(39, 58, 88, 0.12);
  --radius: 22px;
  --max: 1500px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "Microsoft YaHei", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--text);
  line-height: 1.7;
  background:
    radial-gradient(circle at 14% 18%, rgba(15, 159, 143, 0.12), transparent 26%),
    radial-gradient(circle at 92% 12%, rgba(37, 99, 235, 0.14), transparent 28%),
    linear-gradient(180deg, #fbfdff 0%, #eef5fb 100%);
  -webkit-font-smoothing: antialiased;
}

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

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid rgba(208, 218, 231, 0.72);
  box-shadow: 0 8px 28px rgba(34, 53, 84, 0.07);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-logo {
  display: block;
  width: 56px;
  height: 42px;
  object-fit: contain;
}

.brand-ai {
  color: #111827;
  font-weight: 900;
}

main,
footer {
  position: relative;
  z-index: 1;
}

main {
  flex: 1;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

section {
  width: 100%;
  height: 100%;
  min-height: 0;
  padding: clamp(18px, 2.4vh, 28px) 0;
}

section > .container {
  height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(14px, 2vh, 22px);
}

.page-head {
  width: calc(100% - 308px);
  margin: 0 0 0 308px;
  text-align: center;
}

.page-head h1 {
  display: inline-block;
  margin: 0 0 10px;
  font-size: clamp(30px, 3.4vh, 38px);
  line-height: 1.25;
  color: var(--text);
}

.task-title {
  color: #111827;
  font-weight: 900;
}

.story-text {
  position: relative;
  display: inline-block;
  overflow: hidden;
  color: #111827;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: none;
}

.story-text::after {
  content: "";
  position: absolute;
  top: -18%;
  bottom: -18%;
  left: -36%;
  width: 22%;
  background: linear-gradient(100deg, transparent 0%, rgba(255, 255, 255, 0.62) 48%, transparent 100%);
  transform: skewX(-18deg);
  mix-blend-mode: screen;
  animation: light-sweep 4.4s ease-in-out infinite;
  pointer-events: none;
}

@keyframes light-sweep {
  0%,
  36% {
    left: -36%;
    opacity: 0;
  }

  48% {
    opacity: 0.9;
  }

  70%,
  100% {
    left: 112%;
    opacity: 0;
  }
}

.page-head p {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 760px;
  min-height: 38px;
  margin: 0;
  padding: 6px 18px;
  border: 1px solid rgba(37, 99, 235, 0.14);
  border-radius: 999px;
  color: #39506d;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(240, 249, 255, 0.9) 55%, rgba(236, 253, 245, 0.86) 100%);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.08);
  font-size: clamp(15px, 1.8vh, 18px);
  font-weight: 600;
  line-height: 1.5;
}

.page-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  min-height: 0;
}

.side-nav,
.cover-card,
.video-card {
  background: var(--surface);
  border: 1px solid var(--surface-line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.side-nav {
  padding: clamp(18px, 2.2vh, 26px) 22px;
  border-top: 4px solid var(--accent);
}

.nav-group + .nav-group {
  margin-top: clamp(14px, 2vh, 22px);
}

.nav-title {
  margin: 0 0 10px;
  font-size: clamp(16px, 1.8vh, 18px);
  font-weight: 800;
  color: var(--text);
}

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

.nav-item {
  display: block;
  padding: clamp(7px, 1.2vh, 10px) 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: var(--muted);
  font-size: clamp(14px, 1.55vh, 16px);
  transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.nav-item:hover {
  color: var(--primary);
  background: var(--primary-soft);
  border-color: var(--primary-line);
  transform: translateX(2px);
}

.nav-item.active {
  color: #0f766e;
  background: linear-gradient(135deg, rgba(15, 159, 143, 0.16) 0%, rgba(37, 99, 235, 0.08) 100%);
  border-color: rgba(15, 159, 143, 0.26);
  font-weight: 800;
}

.cover-card {
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 0;
}

.cover-card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(246, 250, 253, 0.12) 0%, rgba(246, 250, 253, 0) 26%, rgba(246, 250, 253, 0.2) 100%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.1) 0%, rgba(37, 99, 235, 0.08) 100%);
  pointer-events: none;
}

.cover-image {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: cover;
  object-position: center;
  filter: saturate(1.06) contrast(1.02);
}

.accent-line {
  position: absolute;
  left: 28px;
  right: 28px;
  bottom: 28px;
  z-index: 2;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 72%, var(--warm) 100%);
  opacity: 0.78;
  box-shadow: 0 10px 24px rgba(15, 159, 143, 0.2);
}

.video-card {
  min-height: 0;
  padding: clamp(16px, 2vh, 24px);
}

.video-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  border: 1px solid rgba(37, 99, 235, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.86) 0%, rgba(240, 249, 255, 0.9) 52%, rgba(236, 253, 245, 0.86) 100%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.62);
}

.video-slot::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(37, 99, 235, 0.05), transparent 36%, rgba(15, 159, 143, 0.06)),
    url("../img/favicon.png") center / cover no-repeat;
  opacity: 0.46;
  pointer-events: none;
}

.video-slot.is-playing::before {
  opacity: 0;
}

.video-slot video {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
  background: #000000;
}

.video-slot video[hidden] {
  display: none;
}

.video-start {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 12px;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: #26364b;
  font-weight: 800;
  text-align: center;
  cursor: pointer;
  font: inherit;
}

.video-start:hover .play-icon {
  transform: translateY(-2px) scale(1.04);
  box-shadow: 0 22px 38px rgba(37, 99, 235, 0.28);
}

.video-start:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.28);
  outline-offset: 8px;
  border-radius: 16px;
}

.video-slot.is-playing .video-start {
  display: none;
}

.play-icon {
  position: relative;
  display: block;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background:
    linear-gradient(135deg, rgba(37, 99, 235, 0.9) 0%, rgba(15, 159, 143, 0.9) 100%);
  box-shadow: 0 18px 34px rgba(37, 99, 235, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.play-icon::after {
  content: "";
  position: absolute;
  top: 26px;
  left: 31px;
  width: 0;
  height: 0;
  border-top: 12px solid transparent;
  border-bottom: 12px solid transparent;
  border-left: 18px solid #ffffff;
}

.footer {
  margin-top: auto;
  padding: 8px 0 10px;
  background: rgba(255, 255, 255, 0.9);
  border-top: 1px solid rgba(203, 213, 225, 0.8);
}

.footer .container {
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
  width: calc(100% - 308px);
  margin-left: 308px;
  text-align: center;
  color: var(--muted-light);
  font-size: 12px;
  line-height: 1.55;
}

.mobile-nav-toggle,
.mobile-nav-backdrop {
  display: none;
}

@media (max-width: 960px) {
  main {
    align-items: flex-start;
  }

  .page-head {
    width: 100%;
    margin-left: 0;
  }

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

  .side-nav {
    border-top-width: 0;
    border-left: 4px solid var(--accent);
  }

  .footer .container {
    width: min(var(--max), calc(100% - 32px));
    margin-left: auto;
  }
}

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

  .topbar-inner {
    height: 62px;
  }

  .brand {
    font-size: 19px;
  }

  .brand-logo {
    width: 48px;
    height: 36px;
  }

  section {
    padding: 16px 0;
  }

  .page-head h1 {
    font-size: 28px;
  }

  .page-head p {
    font-size: 16px;
  }

  .side-nav {
    padding: 22px 18px;
  }

  .page-layout {
    gap: 14px;
  }

  .accent-line {
    left: 18px;
    right: 18px;
    bottom: 18px;
  }
}

@media (max-width: 768px), (pointer: coarse) and (max-width: 932px) and (orientation: portrait) {
  html,
  body {
    height: auto !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    overscroll-behavior-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  body {
    height: auto !important;
    min-height: 100svh !important;
  }

  main {
    display: block !important;
    flex: 1 0 auto;
    min-height: 0 !important;
    overflow: visible !important;
  }

  section {
    height: auto !important;
    min-height: 0 !important;
    padding: 12px 0 18px;
    overflow: visible !important;
  }

  section > .container {
    height: auto !important;
    min-height: 0 !important;
    display: grid;
    grid-template-rows: auto auto;
    gap: 12px;
  }

  .topbar-inner {
    height: auto;
    min-height: 60px;
    padding: 10px 0;
    align-items: flex-start;
  }

  .brand {
    max-width: 100%;
    gap: 8px;
    font-size: clamp(15px, 4.2vw, 18px);
    line-height: 1.2;
  }

  .brand-logo {
    width: 44px;
    height: 32px;
    flex-shrink: 0;
  }

  .page-head {
    width: 100%;
    margin-left: 0;
  }

  .page-head h1 {
    margin-bottom: 8px;
    font-size: clamp(22px, 7vw, 30px);
  }

  .page-head p {
    min-height: 34px;
    padding: 6px 14px;
    font-size: 13px;
  }

  .page-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px;
    min-height: auto !important;
  }

  .cover-card,
  .video-card {
    order: 1;
    width: 100%;
  }

  .side-nav {
    position: fixed;
    top: calc(env(safe-area-inset-top) + 88px);
    left: 0;
    bottom: 16px;
    width: min(78vw, 320px);
    max-width: calc(100vw - 52px);
    margin: 0;
    padding: 18px 14px 22px;
    border-top-width: 0;
    border-left: 4px solid var(--accent);
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    transform: translateX(calc(-100% - 18px));
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: transform 0.24s ease, opacity 0.2s ease, visibility 0.2s ease;
    z-index: 42;
  }

  .side-nav,
  .cover-card,
  .video-card {
    border-radius: 18px;
  }

  body.mobile-nav-open .side-nav {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .nav-group + .nav-group {
    margin-top: 12px;
  }

  .nav-title {
    margin-bottom: 8px;
    font-size: 15px;
  }

  .nav-list {
    gap: 8px;
  }

  .nav-item {
    min-height: 48px;
    padding: 10px 12px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    text-align: left;
    font-size: 13px;
    line-height: 1.35;
  }

  .cover-card {
    min-height: clamp(300px, 48svh, 520px);
    aspect-ratio: 9 / 14;
  }

  .cover-image {
    width: 100%;
    height: 100%;
    min-height: clamp(300px, 48svh, 520px);
    object-fit: cover;
  }

  .video-card {
    padding: 12px;
  }

  .video-slot {
    min-height: clamp(340px, 56svh, 540px);
    aspect-ratio: 9 / 14;
  }

  .video-slot video {
    object-fit: contain;
  }

  .video-start {
    gap: 10px;
    padding: 20px;
  }

  .play-icon {
    width: 68px;
    height: 68px;
  }

  .play-icon::after {
    top: 23px;
    left: 29px;
    border-top: 11px solid transparent;
    border-bottom: 11px solid transparent;
    border-left: 16px solid #ffffff;
  }

  .footer {
    position: static !important;
    padding: 8px 0 12px;
  }

  .footer .container {
    width: min(var(--max), calc(100% - 24px));
    margin-left: auto;
    gap: 8px 14px;
    font-size: 11px;
  }

  .mobile-nav-toggle {
    position: fixed;
    left: 10px;
    top: 50%;
    z-index: 44;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 60px;
    padding: 0;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 0 16px 16px 0;
    background: rgba(255, 255, 255, 0.94);
    color: var(--primary);
    box-shadow: 0 16px 30px rgba(39, 58, 88, 0.16);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    cursor: pointer;
    transform: translateY(-50%);
  }

  .mobile-nav-toggle:active {
    transform: translateY(-50%) scale(0.97);
  }

  .mobile-nav-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
  }

  .mobile-nav-backdrop {
    position: fixed;
    inset: 0;
    z-index: 41;
    display: block;
    background: rgba(15, 23, 42, 0.18);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, visibility 0.2s ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }
}

@media (max-width: 420px), (pointer: coarse) and (max-width: 480px) and (orientation: portrait) {
  .brand {
    font-size: 14px;
  }

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

  .page-head p {
    font-size: 12px;
  }

  .video-slot {
    min-height: clamp(300px, 52svh, 480px);
  }
}
