:root {
  color-scheme: light;
  --bg: #f6f8fc;
  --panel: #ffffff;
  --panel-soft: #f0f5ff;
  --text: #172033;
  --muted: #667085;
  --line: #e5eaf3;
  --brand: #2563eb;
  --brand-dark: #1d4ed8;
  --accent: #0f766e;
  --shadow: 0 18px 55px rgba(30, 41, 59, 0.12);
  font-family: Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.16), transparent 34rem),
    linear-gradient(180deg, #eef4ff 0%, var(--bg) 38%, #ffffff 100%);
  color: var(--text);
}

button,
input { font: inherit; }

button {
  border: 0;
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  color: var(--text);
  background: #edf2fb;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

button:hover { transform: translateY(-1px); box-shadow: 0 8px 22px rgba(37, 99, 235, 0.14); }
button:disabled { cursor: not-allowed; opacity: 0.45; transform: none; box-shadow: none; }

.primary {
  background: linear-gradient(135deg, var(--brand), #06b6d4);
  color: #fff;
  font-weight: 700;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero {
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(239,246,255,0.88));
  box-shadow: var(--shadow);
}

.topbar,
.hero-grid,
.layout,
.player-panel { backdrop-filter: blur(10px); }

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 24px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.brand { display: flex; align-items: center; gap: 12px; }
.brand small { display: block; margin-top: 2px; color: var(--muted); }
.brand-mark {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  background: #0f172a;
  color: #fff;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.ghost-link { color: var(--brand); text-decoration: none; font-weight: 700; }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(250px, 0.6fr);
  gap: 28px;
  padding: 34px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 12px; font-size: clamp(2.1rem, 4vw, 4.7rem); line-height: 1.02; letter-spacing: -0.06em; }
h2 { margin-bottom: 6px; letter-spacing: -0.03em; }
.hero-copy { max-width: 700px; color: var(--muted); font-size: 1.05rem; line-height: 1.8; }

.search-row {
  display: flex;
  max-width: 720px;
  gap: 10px;
  margin-top: 24px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
}

.search-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0 14px;
  color: var(--text);
}

.stats {
  display: grid;
  gap: 12px;
  align-content: center;
}

.stats div {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.72);
}

.stats strong { display: block; font-size: 2.2rem; line-height: 1; color: var(--brand-dark); }
.stats span { color: var(--muted); font-weight: 700; }

.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 22px;
  margin-top: 22px;
}

.sidebar,
.content,
.player-panel {
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 14px 44px rgba(30, 41, 59, 0.08);
}

.sidebar { padding: 18px; align-self: start; position: sticky; top: 18px; }
.content { padding: 24px; min-height: 520px; }

.panel-title,
.topic-head,
.player-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-title { margin-bottom: 14px; font-weight: 900; }
.panel-title button { padding: 0.42rem 0.82rem; color: var(--brand); background: #eaf1ff; }

.course-tree { display: grid; gap: 14px; }
.major h3 { margin: 0 0 8px; font-size: 0.95rem; color: #334155; }
.topic-button {
  display: flex;
  width: 100%;
  justify-content: space-between;
  gap: 10px;
  margin: 6px 0;
  border-radius: 16px;
  padding: 0.76rem 0.9rem;
  text-align: left;
  background: transparent;
}
.topic-button:hover,
.topic-button.active { background: var(--panel-soft); color: var(--brand-dark); }
.topic-button span:last-child { color: var(--muted); font-size: 0.88rem; }

.breadcrumb { margin: 0 0 6px; color: var(--accent); font-size: 0.86rem; font-weight: 800; }
#topicMeta { color: var(--muted); }

.message {
  margin: 18px 0;
  padding: 14px 16px;
  border: 1px solid #fed7aa;
  border-radius: 18px;
  background: #fff7ed;
  color: #9a3412;
}

.lesson-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 20px;
}

.lesson-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: start;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 16px;
  background: #fff;
  text-align: left;
}

.lesson-card.active { border-color: rgba(37, 99, 235, 0.55); box-shadow: 0 12px 28px rgba(37, 99, 235, 0.12); }
.lesson-card .seq {
  display: inline-grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border-radius: 16px;
  background: #eff6ff;
  color: var(--brand-dark);
  font-weight: 900;
}
.lesson-card strong { display: block; margin-bottom: 6px; }
.lesson-card small { color: var(--muted); line-height: 1.5; }

.player-panel { margin-top: 22px; overflow: hidden; }
.player-wrap { background: #0f172a; }
video { display: block; width: 100%; max-height: min(68vh, 620px); background: #0f172a; }
.player-meta { padding: 20px 24px; }
.player-detail { margin: 6px 0 0; color: var(--muted); }
.player-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 900px) {
  .hero-grid,
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: static; }
  .lesson-grid { grid-template-columns: 1fr; }
  .topic-head,
  .player-meta { align-items: flex-start; flex-direction: column; }
}

@media (max-width: 560px) {
  .shell { width: min(100% - 18px, 1180px); padding-top: 10px; }
  .topbar { align-items: flex-start; flex-direction: column; }
  .hero-grid { padding: 22px; }
  .search-row { border-radius: 22px; align-items: stretch; flex-direction: column; }
  .search-row input { min-height: 42px; }
  button { width: 100%; }
  .player-actions { width: 100%; }
}
