/* ===== Layout ===== */
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }
main#view { min-height: calc(100dvh - var(--nav-h)); }
.page-enter { animation: page-in .45s var(--ease) both; }
@keyframes page-in { from { opacity: 0; transform: translateY(8px); } }

/* ===== Nav ===== */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); border-bottom: 1px solid transparent; transition: border-color .3s, background .3s; }
.nav::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 78%, transparent); backdrop-filter: saturate(1.6) blur(16px); -webkit-backdrop-filter: saturate(1.6) blur(16px); z-index: -1; }
.nav.scrolled { border-bottom-color: var(--line); }
.nav .wrap { height: 100%; display: flex; align-items: center; gap: 20px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15.5px; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; border-radius: 9px; background: var(--ink); color: var(--bg); display: grid; place-items: center; position: relative; overflow: hidden; }
.brand-mark svg { width: 20px; height: 20px; }
.nav-links { display: flex; gap: 4px; margin-left: 8px; }
.nav-links a { height: 34px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 9px; color: var(--muted); font-weight: 550; font-size: 14px; transition: color .2s, background .2s; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); background: var(--line); }
.nav-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 650; font-size: 14px; color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--line-2); flex: none; }
.avatar.lg { width: 64px; height: 64px; font-size: 26px; }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-3); padding: 6px; opacity: 0; transform: translateY(-6px) scale(.98); transform-origin: top right; pointer-events: none; transition: all .2s var(--ease); }
.menu.open .menu-pop { opacity: 1; transform: none; pointer-events: auto; }
.menu-pop .who { padding: 10px 12px 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-pop .who b { display: block; font-size: 14px; }
.menu-pop .who span { font-size: 12.5px; color: var(--muted); }
.menu-pop a, .menu-pop button { display: flex; align-items: center; gap: 10px; width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; font-size: 14px; color: var(--ink-2); }
.menu-pop a:hover, .menu-pop button:hover { background: var(--line); color: var(--ink); }
@media (max-width: 640px) { .nav-links { display: none; } }

/* ===== Hero ===== */
.hero { position: relative; overflow: hidden; padding: 72px 0 64px; isolation: isolate; }
.hero-grid { position: absolute; inset: -1px 0 0; z-index: -2;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px; mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 30%, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 70% 80% at 70% 30%, #000 30%, transparent 75%); }
.hero-glow { position: absolute; z-index: -1; width: 680px; height: 680px; right: -140px; top: -240px; border-radius: 50%;
  background: radial-gradient(circle, var(--accent-glow), transparent 62%); filter: blur(20px); opacity: .7; }
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(40px, 6.4vw, 76px); line-height: 1.02; letter-spacing: -.045em; font-weight: 750; }
.hero h1 .grad { background: linear-gradient(100deg, var(--accent) 10%, var(--accent-2) 90%); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats { display: flex; gap: 28px; margin-top: 34px; flex-wrap: wrap; }
.stat b { display: block; font-size: 28px; font-weight: 700; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat span { font-size: 12.5px; color: var(--muted); font-weight: 500; }
.hero-cta { display: flex; gap: 10px; margin-top: 36px; flex-wrap: wrap; }
.orbit { position: relative; width: min(420px, 100%); aspect-ratio: 1; margin-left: auto; }
.orbit svg { width: 100%; height: 100%; overflow: visible; }
.orbit .ring { fill: none; stroke: var(--line-2); stroke-width: 1; }
.orbit .spin1 { transform-origin: 50% 50%; animation: orbit 18s linear infinite; }
.orbit .spin2 { transform-origin: 50% 50%; animation: orbit 26s linear infinite reverse; }
.orbit .spin3 { transform-origin: 50% 50%; animation: orbit 40s linear infinite; }
.orbit .core { fill: url(#coreGrad); filter: drop-shadow(0 0 30px var(--accent-glow)); }
.orbit .particle { fill: var(--ink); }
.orbit .particle.a { fill: var(--accent); }
.orbit .particle.b { fill: var(--accent-2); }
.orbit .wave { fill: none; stroke: url(#waveGrad); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 6 8; animation: dash 3s linear infinite; }
@keyframes orbit { to { transform: rotate(360deg); } }
@keyframes dash { to { stroke-dashoffset: -56; } }
@media (max-width: 860px) {
  .hero { padding: 40px 0 36px; }
  .hero .wrap { grid-template-columns: 1fr; }
  .orbit { position: absolute; width: 300px; right: -90px; top: -40px; opacity: .55; z-index: -1; }
}

/* ===== Sections ===== */
.section { padding: 28px 0 72px; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.section-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; }

.course-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 18px; }
.course-card { position: relative; display: flex; flex-direction: column; border-radius: var(--r-xl); background: var(--surface); border: 1px solid var(--line);
  overflow: hidden; transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .3s; box-shadow: var(--shadow-1); }
.course-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-3); border-color: transparent; }
.course-cover { position: relative; height: 168px; overflow: hidden; background: #0b0d14; color: #fff; padding: 22px; display: flex; flex-direction: column; justify-content: space-between; }
.course-cover::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(120% 90% at 100% 0%, rgba(118,128,255,.75), transparent 55%),
  radial-gradient(90% 90% at 0% 100%, rgba(18,194,181,.55), transparent 60%); }
.course-cover::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.07) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.07) 1px, transparent 1px); background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent); -webkit-mask-image: linear-gradient(180deg, #000, transparent); }
.course-cover > * { position: relative; z-index: 1; }
.course-cover .num { font-family: var(--mono); font-size: 54px; font-weight: 700; letter-spacing: -.04em; line-height: 1; opacity: .95; }
.course-cover .tag { align-self: flex-start; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 99px; background: rgba(255,255,255,.14); backdrop-filter: blur(6px); }
.course-body { padding: 18px 22px 20px; display: flex; align-items: center; gap: 12px; }
.course-body h3 { font-size: 18px; font-weight: 700; letter-spacing: -.015em; }
.course-meta { display: flex; gap: 14px; margin-top: 6px; color: var(--muted); font-size: 13px; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta .icon { width: 14px; height: 14px; }
.course-body .go { margin-left: auto; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--line); transition: background .25s, color .25s, transform .3s var(--ease); }
.course-card:hover .go { background: var(--ink); color: var(--bg); transform: translateX(2px); }

.continue-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; margin-bottom: 36px; }
.cont { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .25s var(--ease); }
.cont:hover { border-color: var(--line-2); transform: translateY(-2px); }
.cont .thumb { width: 48px; height: 48px; border-radius: 13px; background: var(--ink); color: var(--bg); display: grid; place-items: center; flex: none; }
.cont .t { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cont .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cont .bar { height: 3px; border-radius: 3px; background: var(--line); margin-top: 8px; overflow: hidden; }
.cont .bar i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ===== Course page ===== */
.course-head { padding: 40px 0 26px; position: relative; }
.crumb { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 13px; font-weight: 500; margin-bottom: 14px; transition: color .2s; }
.crumb:hover { color: var(--ink); }
.course-head h1 { font-size: clamp(30px, 4.6vw, 46px); font-weight: 750; letter-spacing: -.035em; line-height: 1.1; }
.course-head .row { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 22px; }
.course-head .chips { display: flex; gap: 8px; flex-wrap: wrap; }
.toolbar { position: sticky; top: var(--nav-h); z-index: 20; padding: 12px 0; margin-bottom: 6px; background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
.toolbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.lessons { display: grid; gap: 10px; padding-bottom: 80px; }
.lesson { display: grid; grid-template-columns: 76px 1fr auto; align-items: center; gap: 18px; padding: 14px 14px 14px 18px; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, box-shadow .25s, transform .25s var(--ease); position: relative; }
.lesson:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.lesson .code { font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: -.03em; color: var(--ink); line-height: 1; }
.lesson .code small { display: block; font-size: 10.5px; font-weight: 500; color: var(--faint); letter-spacing: .08em; margin-bottom: 6px; font-family: var(--font); }
.lesson .title { font-size: 15.5px; font-weight: 600; letter-spacing: -.005em; display: flex; align-items: center; gap: 8px; min-width: 0; }
.lesson .title span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lesson .sub { display: flex; align-items: center; gap: 12px; margin-top: 5px; color: var(--muted); font-size: 12.5px; }
.lesson .sub .icon { width: 13px; height: 13px; }
.lesson .sub > span { display: inline-flex; align-items: center; gap: 4px; }
.lesson .prog { width: 80px; height: 3px; border-radius: 3px; background: var(--line); overflow: hidden; }
.lesson .prog i { display: block; height: 100%; background: var(--accent); }
.lesson .acts { display: flex; gap: 8px; }
.act { height: 38px; padding: 0 14px; border-radius: 11px; display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; font-weight: 600; transition: all .2s; border: 1px solid var(--line-2); background: var(--surface); }
.act:hover { border-color: var(--ink); }
.act.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.act.primary:hover { background: color-mix(in srgb, var(--ink) 85%, var(--accent)); }
.act.locked { color: var(--muted); background: transparent; border-style: dashed; }
.act.locked:hover { color: var(--ink); border-color: var(--ink-2); border-style: solid; }
.act .icon { width: 16px; height: 16px; }
.act.is-wait { color: var(--muted); pointer-events: none; }
.badge-free { font-size: 10.5px; font-weight: 700; letter-spacing: .04em; padding: 2px 7px; border-radius: 6px; background: var(--ok-soft); color: var(--ok); flex: none; }
@media (max-width: 720px) {
  .lesson { grid-template-columns: 52px 1fr; gap: 12px; padding: 14px; }
  .lesson .code { font-size: 16px; }
  .lesson .acts { grid-column: 1 / -1; }
  .lesson .acts .act { flex: 1; justify-content: center; }
}

.exam-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; padding-bottom: 80px; }
.exam { border-radius: 20px; background: var(--surface); border: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column; gap: 18px; transition: border-color .2s, box-shadow .25s; }
.exam:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.exam .top { display: flex; align-items: flex-start; justify-content: space-between; }
.exam .n { font-family: var(--mono); font-size: 40px; font-weight: 700; letter-spacing: -.05em; line-height: .9; color: var(--ink); }
.exam .n small { font-size: 14px; color: var(--faint); margin-right: 2px; }
.exam .name { font-size: 14px; font-weight: 600; color: var(--ink-2); }
.exam .acts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.exam .act { justify-content: center; }

/* ===== Lesson (player) page ===== */
.watch { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; padding: 20px 0 64px; }
.watch-main { min-width: 0; }
.watch-info { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-top: 18px; flex-wrap: wrap; }
.watch-info h1 { font-size: 22px; font-weight: 700; letter-spacing: -.02em; display: flex; align-items: center; gap: 10px; }
.watch-info h1 .mono { font-size: 14px; padding: 3px 9px; border-radius: 8px; background: var(--line); color: var(--ink-2); font-weight: 600; }
.watch-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.watch-nav { display: flex; gap: 8px; margin-top: 18px; }
.side { position: sticky; top: calc(var(--nav-h) + 20px); align-self: start; max-height: calc(100dvh - var(--nav-h) - 40px); display: flex; flex-direction: column;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.side-head { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; font-weight: 650; font-size: 14px; }
.side-list { overflow: auto; padding: 6px; overscroll-behavior: contain; }
.side-item { display: grid; grid-template-columns: 44px 1fr auto; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 12px; font-size: 13.5px; transition: background .15s; }
.side-item:hover { background: var(--line); }
.side-item.cur { background: var(--accent-soft); }
.side-item.cur .c { color: var(--accent); }
.side-item .c { font-family: var(--mono); font-weight: 650; font-size: 12.5px; color: var(--muted); }
.side-item .t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.side-item .icon { width: 14px; height: 14px; color: var(--faint); }
.side-item .eq { display: inline-flex; gap: 2px; align-items: end; height: 12px; }
.side-item .eq i { width: 2px; background: var(--accent); border-radius: 2px; animation: eq 1s ease-in-out infinite; }
.side-item .eq i:nth-child(2) { animation-delay: -.3s; } .side-item .eq i:nth-child(3) { animation-delay: -.6s; }
@keyframes eq { 0%,100% { height: 3px; } 50% { height: 12px; } }
@media (max-width: 1000px) { .watch { grid-template-columns: 1fr; } .side { position: static; max-height: 460px; } }
@media (max-width: 640px) { .watch { padding-top: 0; } .watch .wrap-bleed { margin-inline: -16px; } .watch .player { border-radius: 0; } }

/* ===== Player ===== */
.player { position: relative; background: #000; border-radius: 20px; overflow: hidden; overflow: clip; aspect-ratio: 16 / 9; user-select: none; -webkit-user-select: none; isolation: isolate;
  box-shadow: 0 30px 60px -30px rgba(0,0,0,.5); -webkit-touch-callout: none; }
.player video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player .wm { position: absolute; inset: -50%; z-index: 2; pointer-events: none; background-repeat: repeat; animation: wm-drift 60s linear infinite; }
.player .wm2 { position: absolute; z-index: 3; pointer-events: none; color: rgba(125,130,144,.42); font-size: 13px; font-weight: 600; white-space: nowrap; transition: left 2.5s var(--ease), top 2.5s var(--ease); }
@keyframes wm-drift { from { transform: translate(0, 0); } to { transform: translate(300px, 170px); } }
.player .shade { position: absolute; inset: auto 0 0; height: 140px; z-index: 4; background: linear-gradient(transparent, rgba(0,0,0,.72)); pointer-events: none; transition: opacity .3s; }
.player .ctrls { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; padding: 0 14px 10px; color: #fff; transition: opacity .3s, transform .3s var(--ease); }
.player.idle .ctrls, .player.idle .shade { opacity: 0; transform: translateY(6px); pointer-events: none; }
.player.idle { cursor: none; }
.player .bar { position: relative; height: 18px; display: flex; align-items: center; cursor: pointer; touch-action: none; }
.player .track { position: relative; width: 100%; height: 4px; border-radius: 4px; background: rgba(255,255,255,.22); transition: height .15s; overflow: visible; }
.player .bar:hover .track, .player.seeking .track { height: 6px; }
.player .buf, .player .played { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 4px; }
.player .buf { background: rgba(255,255,255,.32); }
.player .played { background: #fff; }
.player .knob { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.4); transform: scale(0); transition: transform .15s; }
.player .bar:hover .knob, .player.seeking .knob { transform: scale(1); }
.player .hover-time { position: absolute; bottom: 22px; transform: translateX(-50%); background: rgba(20,20,24,.9); padding: 3px 8px; border-radius: 6px; font-size: 12px; font-family: var(--mono); opacity: 0; transition: opacity .15s; pointer-events: none; }
.player .bar:hover .hover-time { opacity: 1; }
.player .row { display: flex; align-items: center; gap: 4px; margin-top: 4px; }
.player .pb { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; color: #fff; transition: background .15s; position: relative; }
.player .pb:hover { background: rgba(255,255,255,.14); }
.player .pb .icon { width: 21px; height: 21px; }
.player .time { font-family: var(--mono); font-size: 12.5px; margin-left: 8px; opacity: .9; white-space: nowrap; }
.player .sp { flex: 1; }
.player .rate { width: auto; padding: 0 10px; font-weight: 650; font-size: 13px; font-family: var(--mono); }
.player .vol { display: flex; align-items: center; }
.player .vol input { width: 0; opacity: 0; transition: width .25s var(--ease), opacity .2s; accent-color: #fff; height: 4px; }
.player .vol:hover input, .player .vol input:focus { width: 72px; opacity: 1; margin-right: 6px; }
.player .pop { position: absolute; bottom: 46px; right: 0; background: rgba(22,22,26,.94); backdrop-filter: blur(10px); border-radius: 12px; padding: 5px; min-width: 96px; display: none; box-shadow: 0 10px 30px rgba(0,0,0,.4); }
.player .pop.open { display: block; animation: pop-in .2s var(--ease); }
.player .pop button { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; height: 32px; padding: 0 12px; border-radius: 8px; font-size: 13px; color: #fff; font-family: var(--mono); }
.player .pop button:hover { background: rgba(255,255,255,.12); }
.player .pop button.on { color: #9aa2ff; }
.player .big { position: absolute; z-index: 4; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: rgba(255,255,255,.16); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  display: grid; place-items: center; color: #fff; transition: transform .25s var(--ease), opacity .25s, background .2s; border: 1px solid rgba(255,255,255,.18); }
.player .big .icon { width: 30px; height: 30px; margin-left: 4px; }
.player .big:hover { transform: scale(1.06); background: rgba(255,255,255,.24); }
.player.playing .big, .player.loading .big { opacity: 0; pointer-events: none; transform: scale(.85); }
.player .spinner { position: absolute; z-index: 4; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; border: 3px solid rgba(255,255,255,.18); border-top-color: #fff; animation: spin .8s linear infinite; display: none; }
.player.loading .spinner { display: block; }
.player .flash { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 8px 14px; border-radius: 12px; background: rgba(0,0,0,.55); color: #fff; font-family: var(--mono); font-size: 14px; font-weight: 600; opacity: 0; transition: opacity .2s; pointer-events: none; }
.player .flash.show { opacity: 1; }
.player .err { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; text-align: center; color: #fff; background: rgba(0,0,0,.75); padding: 24px; }
.player .err .icon { width: 30px; height: 30px; margin: 0 auto 10px; opacity: .7; }
.player:fullscreen { border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100vh; }
.player:-webkit-full-screen { border-radius: 0; width: 100%; height: 100%; }
.player.pseudo-fs { position: fixed; inset: 0; z-index: 1000; border-radius: 0; aspect-ratio: auto; width: 100vw; height: 100dvh; }
.player .lock-cover { position: absolute; inset: 0; z-index: 6; display: grid; place-items: center; background: radial-gradient(120% 120% at 50% 0%, #1a1d2e, #050608); color: #fff; }
.player .lock-cover .in { display: grid; justify-items: center; gap: 16px; }
.player .lock-cover .ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.player .lock-cover .ring .icon { width: 26px; height: 26px; }
.player .lock-cover .btn-primary { background: #fff; color: #0b0d12; }
@media (max-width: 640px) {
  .player .vol, .player .skip { display: none; }
  .player .pb { width: 34px; height: 34px; }
  .player .ctrls { padding: 0 8px 6px; }
  .player .time { font-size: 11.5px; margin-left: 2px; }
  .player .big { width: 60px; height: 60px; margin: -30px 0 0 -30px; }
}

/* ===== PDF viewer ===== */
.viewer { position: fixed; inset: 0; z-index: 300; background: var(--bg-2); display: flex; flex-direction: column; animation: fade-in .25s var(--ease); }
.viewer-bar { height: 58px; flex: none; display: flex; align-items: center; gap: 10px; padding: 0 14px; background: color-mix(in srgb, var(--surface) 90%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.viewer-bar .title { font-weight: 650; font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.viewer-bar .grp { display: flex; align-items: center; gap: 2px; padding: 3px; border-radius: 11px; background: var(--line); }
.viewer-bar .grp .btn { --h: 30px; }
.viewer-bar .pg { font-family: var(--mono); font-size: 12.5px; color: var(--ink-2); padding: 0 8px; min-width: 64px; text-align: center; }
.viewer-scroll { flex: 1; overflow: auto; padding: 24px 16px 80px; overscroll-behavior: contain; }
.viewer-pages { display: grid; justify-content: center; gap: 18px; }
.vpage { position: relative; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08), 0 8px 30px -10px rgba(0,0,0,.18); border-radius: 4px; overflow: hidden; margin: 0 auto; -webkit-touch-callout: none; user-select: none; }
.vpage canvas { display: block; width: 100%; height: 100%; }
.vpage .pwm { position: absolute; inset: 0; pointer-events: none; background-repeat: repeat; }
.vpage .pno { position: absolute; right: 10px; bottom: 8px; font-family: var(--mono); font-size: 11px; color: rgba(0,0,0,.3); }
.vpage.skel-page { background: var(--surface); }
.viewer-load { position: absolute; inset: 58px 0 0; display: grid; place-items: center; }
.viewer-load .ring { width: 40px; height: 40px; border-radius: 50%; border: 3px solid var(--line-2); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@media (max-width: 640px) {
  .viewer-bar { gap: 6px; padding: 0 8px; }
  .viewer-bar .hide-sm { display: none; }
  .viewer-scroll { padding: 10px 6px 60px; }
  .viewer-pages { gap: 10px; }
}
@media print { body { display: none !important; } }

/* ===== Auth ===== */
.auth { min-height: calc(100dvh - var(--nav-h)); display: grid; place-items: center; padding: 32px 16px 64px; position: relative; overflow: hidden; isolation: isolate; }
.auth::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 40px 40px; mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, #000, transparent 75%); -webkit-mask-image: radial-gradient(ellipse 50% 60% at 50% 40%, #000, transparent 75%); }
.auth::after { content: ""; position: absolute; z-index: -1; width: 560px; height: 560px; left: 50%; top: 10%; transform: translateX(-50%); border-radius: 50%; background: radial-gradient(circle, var(--accent-glow), transparent 60%); opacity: .45; filter: blur(30px); }
.auth-card { width: min(400px, 100%); padding: 34px 30px 28px; border-radius: 26px; background: color-mix(in srgb, var(--surface) 92%, transparent); border: 1px solid var(--line); box-shadow: var(--shadow-3); backdrop-filter: blur(20px); }
.auth-card .mark { width: 44px; height: 44px; border-radius: 13px; background: var(--ink); color: var(--bg); display: grid; place-items: center; margin-bottom: 22px; }
.auth-card .mark svg { width: 26px; height: 26px; }
.auth-card h1 { font-size: 24px; font-weight: 720; letter-spacing: -.025em; margin-bottom: 24px; }
.auth-card form { display: grid; gap: 14px; }
.auth-card .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; font-size: 13.5px; color: var(--muted); }
.auth-card .foot a { color: var(--ink); font-weight: 600; }
.auth-card .foot a:hover { color: var(--accent); }
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 44px; }
.pw-wrap button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); }
.pw-wrap button:hover { color: var(--ink); background: var(--line); }
.strength { display: flex; gap: 4px; margin-top: 2px; }
.strength i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); transition: background .3s; }
.strength[data-s="1"] i:nth-child(-n+1) { background: var(--danger); }
.strength[data-s="2"] i:nth-child(-n+2) { background: var(--warn); }
.strength[data-s="3"] i:nth-child(-n+3) { background: var(--ok); }
.strength[data-s="4"] i { background: var(--ok); }
.code-btn { min-width: 98px; }

/* ===== Account ===== */
.account { display: grid; grid-template-columns: 300px 1fr; gap: 20px; padding: 36px 0 80px; align-items: start; }
.profile { padding: 28px 24px; display: grid; justify-items: center; text-align: center; gap: 4px; position: sticky; top: calc(var(--nav-h) + 20px); }
.profile .avatar { margin-bottom: 12px; }
.profile h2 { font-size: 19px; font-weight: 700; letter-spacing: -.01em; display: flex; align-items: center; gap: 6px; }
.profile .em { color: var(--muted); font-size: 13px; }
.profile .since { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); width: 100%; display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }
.profile .acts { margin-top: 14px; display: grid; gap: 8px; width: 100%; }
.panel { padding: 22px 24px; }
.panel + .panel { margin-top: 16px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.panel-head h3 { font-size: 16px; font-weight: 680; letter-spacing: -.01em; display: flex; align-items: center; gap: 8px; }
.meters { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.meter { padding: 16px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); display: grid; gap: 10px; }
.meter .k { display: flex; align-items: center; gap: 7px; font-size: 13px; color: var(--muted); font-weight: 550; }
.meter .k .icon { width: 15px; height: 15px; }
.meter .v { font-size: 24px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.meter .v small { font-size: 14px; color: var(--faint); font-weight: 600; }
.meter .bar { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.meter .bar i { display: block; height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); transition: width .8s var(--ease); }
.course-access + .course-access { margin-top: 18px; }
.course-access h4 { font-size: 13.5px; font-weight: 650; margin-bottom: 10px; color: var(--ink-2); }
.key-input { font-family: var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.key-list { display: grid; gap: 6px; margin-top: 14px; }
.key-list div { display: flex; justify-content: space-between; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
@media (max-width: 860px) { .account { grid-template-columns: 1fr; padding-top: 20px; } .profile { position: static; } .meters { grid-template-columns: repeat(2, 1fr); } }

/* Unlock modal */
.unlock-ico { width: 56px; height: 56px; border-radius: 18px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 18px; }
.unlock-ico .icon { width: 26px; height: 26px; }
.success-burst { display: grid; justify-items: center; gap: 14px; padding: 10px 0 4px; text-align: center; }
.success-burst .ring { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); animation: pop-in .5s var(--ease-spring); }
.success-burst .ring .icon { width: 30px; height: 30px; stroke-width: 2.4; }
.grant-chips { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; }

.foot-bar { border-top: 1px solid var(--line); padding: 26px 0 40px; color: var(--faint); font-size: 12.5px; }
.foot-bar .wrap { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.notfound { min-height: 60vh; display: grid; place-items: center; text-align: center; gap: 14px; }
.notfound b { font-size: 84px; font-family: var(--mono); letter-spacing: -.06em; line-height: 1; }
