:root {
  --bg: #0b0d14;
  --bg-2: #11141f;
  --card: #161a27;
  --card-2: #1c2131;
  --line: #242a3d;
  --text: #e8eaf2;
  --muted: #8f97ad;
  --brand: #6c5ce7;
  --brand-2: #00d2ff;
  --gold: #ffb648;
  --radius: 14px;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: radial-gradient(1200px 600px at 10% -10%, #221b45 0%, transparent 55%),
              radial-gradient(900px 500px at 90% 0%, #0d3340 0%, transparent 55%),
              var(--bg);
  color: var(--text);
  font: 15px/1.7 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.3; margin: 0 0 12px; }
.wrap { width: min(1180px, calc(100% - 40px)); margin: 0 auto; }
.site-main { flex: 1; padding-bottom: 60px; }

/* header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11, 13, 20, .82);
  backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 28px; height: 66px; }
.logo { display: flex; align-items: center; gap: 9px; font-weight: 700; font-size: 18px; letter-spacing: .5px; }
.logo-mark {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 15px;
}
.nav { display: flex; gap: 22px; flex: 1; }
.nav a { color: var(--muted); font-size: 14.5px; transition: color .2s; }
.nav a:hover, .nav a.on { color: #fff; }
.header-right { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
  background: linear-gradient(135deg, #4b3fb0, #1c8fa8); font-weight: 700;
}

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 18px; border-radius: 10px; border: 1px solid transparent;
  font-size: 14px; cursor: pointer; transition: .18s; white-space: nowrap;
}
.btn-primary { background: linear-gradient(135deg, var(--brand), #8f7bff); color: #fff; box-shadow: 0 8px 24px -10px rgba(108, 92, 231, .9); }
.btn-primary:hover { transform: translateY(-1px); }
.btn-ghost { border-color: var(--line); color: var(--text); background: rgba(255,255,255,.03); }
.btn-ghost:hover { border-color: #3a4260; }
.btn-gold { background: linear-gradient(135deg, #ff9f43, #ffcf6b); color: #241a00; font-weight: 700; }
.btn-block { width: 100%; }
.btn-lg { padding: 13px 26px; font-size: 15.5px; border-radius: 12px; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* hero */
.hero { padding: 64px 0 44px; }
.hero h1 { font-size: 42px; letter-spacing: -1px; }
.hero h1 em { font-style: normal; background: linear-gradient(120deg, #a78bfa, #38bdf8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: var(--muted); font-size: 16px; max-width: 620px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-stats { display: flex; gap: 40px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats b { font-size: 26px; display: block; }
.hero-stats span { color: var(--muted); font-size: 13px; }

/* section */
.section { padding: 34px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 22px; gap: 16px; }
.section-head h2 { font-size: 24px; margin: 0; }
.section-head .sub { color: var(--muted); font-size: 13.5px; margin: 6px 0 0; }

/* course grid */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.course-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: .22s;
}
.course-card:hover { transform: translateY(-4px); border-color: #39406380; box-shadow: 0 20px 40px -24px #000; }
.cover { position: relative; aspect-ratio: 16 / 9; background: #0e1220 center/cover no-repeat; }
.cover .badge {
  position: absolute; left: 10px; top: 10px; padding: 3px 9px; border-radius: 20px;
  background: rgba(0,0,0,.6); font-size: 11.5px; color: #dfe3f0; backdrop-filter: blur(4px);
}
.cover .free { background: rgba(0, 200, 120, .85); color: #04210f; font-weight: 700; }
.cover .dur { position: absolute; right: 10px; bottom: 10px; background: rgba(0,0,0,.72); padding: 2px 8px; border-radius: 6px; font-size: 11.5px; }
.course-body { padding: 14px 15px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.course-body h3 { font-size: 15.5px; margin: 0; line-height: 1.45; min-height: 44px; }
.course-meta { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.course-meta .teacher { color: var(--muted); font-size: 12.5px; }
.price { color: var(--gold); font-weight: 700; font-size: 16px; }
.price small { color: var(--muted); font-weight: 400; text-decoration: line-through; margin-left: 5px; font-size: 12px; }

/* list row */
.course-row {
  display: flex; gap: 18px; padding: 14px; background: var(--card);
  border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 14px;
}
.course-row .thumb { width: 220px; flex: none; aspect-ratio: 16/9; border-radius: 10px; background: #0e1220 center/cover no-repeat; }
.course-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.course-row h3 { font-size: 17px; margin: 2px 0 6px; }
.course-row p { color: var(--muted); font-size: 13.5px; margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.course-row .bottom { margin-top: auto; display: flex; align-items: center; justify-content: space-between; }

/* filter bar */
.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 24px; }
.chip { padding: 7px 16px; border-radius: 99px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; }
.chip.on, .chip:hover { color: #fff; border-color: var(--brand); background: rgba(108,92,231,.14); }

/* detail */
.breadcrumb { color: var(--muted); font-size: 13px; padding: 22px 0 10px; }
.breadcrumb a:hover { color: #fff; }
.detail { display: grid; grid-template-columns: 1fr 340px; gap: 28px; align-items: start; }
.detail-cover { border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.detail h1 { font-size: 28px; margin: 18px 0 10px; }
.detail .sub { color: var(--muted); margin-bottom: 16px; }
.tagline { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); font-size: 13.5px; border-bottom: 1px solid var(--line); padding-bottom: 18px; }
.tagline b { color: var(--text); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.panel h3 { font-size: 16px; }
.panel-title { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.side { position: sticky; top: 86px; }
.side .price-box { display: flex; align-items: baseline; gap: 10px; margin-bottom: 16px; }
.side .price-big { font-size: 32px; color: var(--gold); font-weight: 800; }
.side ul { list-style: none; padding: 0; margin: 16px 0 0; color: var(--muted); font-size: 13.5px; }
.side ul li { padding: 5px 0 5px 20px; position: relative; }
.side ul li::before { content: "✓"; position: absolute; left: 0; color: #38d39f; }

/* lesson list */
.lesson-list { list-style: none; padding: 0; margin: 0; }
.lesson-list li { border-bottom: 1px solid var(--line); }
.lesson-list li:last-child { border-bottom: 0; }
.lesson-list a, .lesson-list .locked {
  display: flex; align-items: center; gap: 14px; padding: 13px 4px; font-size: 14.5px; color: var(--text);
}
.lesson-list .no { width: 28px; color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-list .name { flex: 1; }
.lesson-list .dur { color: var(--muted); font-size: 12.5px; }
.lesson-list .lock { color: var(--muted); font-size: 12px; }
.lesson-list .free-tag { color: #38d39f; font-size: 12px; border: 1px solid #2a6b52; padding: 1px 7px; border-radius: 5px; }
.lesson-list .playing { color: var(--brand-2); }

/* player */
.player-wrap { background: #000; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.player-wrap video { width: 100%; aspect-ratio: 16/9; display: block; background: #000; }
.player-head { padding: 18px 0 10px; }
.player-head h1 { font-size: 21px; margin: 0 0 6px; }
.player-head .meta { color: var(--muted); font-size: 13px; }
.player-layout { display: grid; grid-template-columns: 1fr 320px; gap: 24px; align-items: start; margin-top: 16px; }
.player-layout .panel { max-height: 620px; overflow: auto; }

/* auth */
.auth-wrap { display: grid; place-items: center; padding: 70px 0; }
.auth-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 34px; }
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .tip { color: var(--muted); font-size: 13.5px; margin-bottom: 22px; }
.form-item { margin-bottom: 15px; }
.form-item label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.input {
  width: 100%; padding: 11px 13px; border-radius: 10px; border: 1px solid var(--line);
  background: #0e1220; color: var(--text); font-size: 14px; outline: none; transition: .18s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(108,92,231,.15); }
textarea.input { min-height: 110px; resize: vertical; }
.form-row { display: flex; gap: 14px; }
.form-row > * { flex: 1; }
.help { color: var(--muted); font-size: 12.5px; margin-top: 6px; }

/* flash */
.flash { margin-top: 16px; padding: 11px 16px; border-radius: 10px; font-size: 14px; }
.flash.ok { background: rgba(52, 211, 153, .12); border: 1px solid rgba(52, 211, 153, .35); color: #6ee7b7; }
.flash.err { background: rgba(248, 113, 113, .12); border: 1px solid rgba(248, 113, 113, .35); color: #fca5a5; }

/* table */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { padding: 11px 10px; text-align: left; border-bottom: 1px solid var(--line); }
.table th { color: var(--muted); font-weight: 500; font-size: 13px; }
.table tr:hover td { background: rgba(255,255,255,.02); }
.tiny { font-size: 12.5px; color: var(--muted); }
.pill { display: inline-block; padding: 2px 9px; border-radius: 99px; font-size: 12px; }
.pill.ok { background: rgba(52,211,153,.15); color: #6ee7b7; }
.pill.warn { background: rgba(255,182,72,.15); color: #ffce80; }
.pill.mute { background: rgba(255,255,255,.07); color: var(--muted); }

/* empty */
.empty { text-align: center; padding: 70px 20px; color: var(--muted); }
.empty .big { font-size: 40px; margin-bottom: 12px; }

/* pager */
.pager { display: flex; gap: 8px; justify-content: center; margin-top: 30px; flex-wrap: wrap; }
.pager .pg { min-width: 36px; height: 36px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); color: var(--muted); font-size: 13.5px; padding: 0 10px; }
.pager .pg.active, .pager .pg:hover { background: var(--brand); border-color: var(--brand); color: #fff; }
.pager .dots { color: var(--muted); align-self: center; }

/* footer */
.site-footer { border-top: 1px solid var(--line); background: rgba(0,0,0,.25); padding: 40px 0 0; margin-top: 40px; }
.footer-inner { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; padding-bottom: 30px; }
.footer-brand p { color: var(--muted); font-size: 13.5px; max-width: 380px; }
.footer-links h4 { font-size: 14px; margin-bottom: 10px; }
.footer-links a, .footer-links p { display: block; color: var(--muted); font-size: 13.5px; margin: 0 0 8px; }
.footer-links a:hover { color: #fff; }
.copyright { border-top: 1px solid var(--line); padding: 16px; text-align: center; color: #5d6480; font-size: 12.5px; }

.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.tabs a { padding: 10px 16px; color: var(--muted); font-size: 14px; border-bottom: 2px solid transparent; }
.tabs a.on { color: #fff; border-color: var(--brand); }

@media (max-width: 980px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .detail, .player-layout { grid-template-columns: 1fr; }
  .side { position: static; }
  .nav { display: none; }
  .hero h1 { font-size: 30px; }
  .course-row .thumb { width: 140px; }
  .footer-inner { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .grid { grid-template-columns: 1fr; }
  .course-row { flex-direction: column; }
  .course-row .thumb { width: 100%; }
  .hero { padding: 36px 0 24px; }
}