/* Python kursi — NeoCoder dizayn tizimi asosida (indigo + Python sariq/ko'k) */
:root {
  --bg: #070a1a; --bg-2: #0d1230; --panel: rgba(255, 255, 255, .045); --panel-2: rgba(255, 255, 255, .08);
  --line: rgba(165, 180, 252, .16); --line-2: rgba(165, 180, 252, .28);
  --text: #eef2ff; --soft: #cbd5e1; --muted: #94a3b8; --faint: #64748b;
  --primary: #6366f1; --primary-2: #8b5cf6; --accent: #a5b4fc; --gold: #facc15;
  --ok: #22c55e; --bad: #ef4444; --warn: #f59e0b; --info: #38bdf8;
  --py-blue: #3776ab; --py-yellow: #ffd43b;
  --hh: 72px; --mono: 'JetBrains Mono', Consolas, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--hh) + 16px); }
body {
  font-family: Inter, system-ui, sans-serif; color: var(--text); min-height: 100vh; line-height: 1.7;
  background: radial-gradient(900px 500px at 90% -10%, rgba(99, 102, 241, .16), transparent 60%),
    radial-gradient(700px 420px at -10% 40%, rgba(55, 118, 171, .14), transparent 60%), var(--bg);
  background-attachment: fixed;
}
a { color: var(--gold); }
kbd { font: 600 .78em var(--mono); padding: 1px 6px; border-radius: 5px; background: var(--panel-2); border: 1px solid var(--line-2); border-bottom-width: 2px; color: var(--text); }
::selection { background: rgba(99, 102, 241, .45); }

.read-bar { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 100; pointer-events: none; }
.read-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--py-blue), var(--py-yellow)); transition: width .1s linear; }

/* Header (navigatsiyani neo.js chizadi) */
.header { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px clamp(16px, 3vw, 32px); min-height: var(--hh);
  background: rgba(7, 10, 26, .86); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-icon { width: 42px; height: 42px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; color: #fff; transition: transform .2s; }
.brand-text { color: var(--text); font-size: 1.4rem; font-weight: 900; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; }
.nav-links a { color: var(--soft); text-decoration: none; padding: 8px 12px; border-radius: 10px; font-weight: 600; font-size: .92rem; display: inline-flex; gap: 8px; align-items: center; }
.nav-links a:hover { background: var(--panel-2); color: var(--text); }
.nav-links a.neo-active { background: rgba(99, 102, 241, .2); color: #fff; }

/* Asosiy joylashuv */
.layout { display: grid; grid-template-columns: 310px minmax(0, 1fr); min-height: calc(100vh - var(--hh)); }
.sidebar { border-right: 1px solid var(--line); background: rgba(10, 14, 36, .55); position: sticky; top: var(--hh); height: calc(100vh - var(--hh)); overflow-y: auto; padding: 18px 14px 40px; scrollbar-width: thin; }
.back { color: var(--muted); text-decoration: none; font-weight: 600; font-size: .85rem; display: inline-flex; gap: 6px; align-items: center; }
.back:hover { color: var(--text); }
.sb-title { display: flex; gap: 12px; align-items: center; margin: 14px 0 14px; text-decoration: none; color: var(--text); font-weight: 800; font-size: 1.15rem; line-height: 1.2; }
.sb-title small { display: block; color: var(--muted); font-weight: 500; font-size: .78rem; margin-top: 3px; }
.py-logo { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0;
  background: linear-gradient(135deg, var(--py-blue), #1e3a5f); color: var(--py-yellow); box-shadow: 0 6px 20px rgba(55, 118, 171, .4); }
.overall { height: 8px; border-radius: 6px; background: var(--panel-2); overflow: hidden; }
#overallBar { height: 100%; width: 0; background: linear-gradient(90deg, var(--py-blue), var(--py-yellow)); transition: width .5s; }
#overallText { color: var(--muted); font-size: .82rem; margin: 6px 0 12px; }
.toc-search { display: flex; align-items: center; gap: 8px; padding: 0 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 14px; color: var(--muted); }
.toc-search:focus-within { border-color: var(--accent); }
.toc-search input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; color: var(--text); font: 500 .88rem Inter, sans-serif; padding: 9px 0; }
.toc-empty { color: var(--muted); font-size: .88rem; padding: 8px; }
.mod { margin-bottom: 12px; }
.mod-title { font-size: .72rem; text-transform: uppercase; letter-spacing: .8px; color: var(--accent); font-weight: 800; padding: 6px 8px; display: flex; justify-content: space-between; gap: 8px; }
.mod-title span:last-child { color: var(--faint); }
.toc-item { display: flex; gap: 10px; align-items: center; padding: 6px 10px; border-radius: 9px; color: var(--soft); text-decoration: none; font-size: .9rem; line-height: 1.35; border: 1px solid transparent; }
.toc-item:hover { background: var(--panel-2); color: var(--text); }
.toc-item.active { background: rgba(99, 102, 241, .22); border-color: rgba(99, 102, 241, .45); color: #fff; }
.toc-item .t { flex: 1; min-width: 0; }
.toc-item .num { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--panel-2); flex-shrink: 0; }
.toc-item.done .num { background: var(--ok); color: #052e16; }
.toc-item.partial .num { background: rgba(245, 158, 11, .35); color: #fde68a; }
.toc-item small { color: var(--faint); font-size: .75rem; flex-shrink: 0; }

.content { padding: 28px clamp(16px, 4vw, 56px) 90px; max-width: 1020px; width: 100%; }
.toc-toggle { display: none; }

/* Dars sarlavhasi */
.l-head { margin-bottom: 20px; }
.crumbs { color: var(--muted); font-size: .85rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crumbs a { color: var(--accent); text-decoration: none; }
.crumbs i { font-size: .6rem; opacity: .6; }
.l-num { margin-top: 14px; font: 800 .85rem var(--mono); color: var(--py-yellow); letter-spacing: .5px; }
.l-num small { color: var(--faint); }
.lesson h1 { font-size: clamp(1.7rem, 3.4vw, 2.5rem); line-height: 1.2; margin: 4px 0 14px; font-weight: 900; letter-spacing: -.3px; }
.meta { display: flex; gap: 8px; color: var(--muted); font-size: .84rem; flex-wrap: wrap; }
.meta > span { display: inline-flex; gap: 6px; align-items: center; padding: 4px 10px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.meta .done-chip { color: #86efac; border-color: rgba(34, 197, 94, .45); background: rgba(34, 197, 94, .1); }
.lvl.lv1 { color: #86efac; } .lvl.lv2 { color: #fde68a; } .lvl.lv3 { color: #fca5a5; }

.intro { font-size: 1.06rem; color: #e2e8f0; background: linear-gradient(135deg, rgba(55, 118, 171, .22), rgba(255, 212, 59, .06)); border: 1px solid rgba(255, 212, 59, .18); border-left: 4px solid var(--py-yellow); padding: 16px 20px; border-radius: 14px; margin-bottom: 18px; }
.goals { padding: 16px 20px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 18px; }
.goals h3 { font-size: 1rem; margin-bottom: 8px; display: flex; gap: 8px; align-items: center; color: var(--accent); }
.goals ul { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 6px 18px; }
.goals li { padding-left: 26px; position: relative; color: var(--soft); font-size: .95rem; }
.goals li::before { content: '✓'; position: absolute; left: 0; top: 2px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: .7rem; font-weight: 900; background: rgba(99, 102, 241, .25); color: var(--accent); }
.l-toc { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.l-toc a { font-size: .82rem; color: var(--soft); text-decoration: none; padding: 5px 11px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line); }
.l-toc a:hover { border-color: var(--accent); color: var(--text); }
.l-toc b { color: var(--py-yellow); font-family: var(--mono); font-size: .75rem; margin-right: 2px; }

/* Bo'limlar */
.sec { margin: 34px 0; }
.sec h2 { font-size: 1.4rem; margin-bottom: 10px; display: flex; gap: 12px; align-items: baseline; line-height: 1.3; }
.sec h2 .idx { color: var(--py-yellow); font: 700 .9rem var(--mono); padding: 2px 8px; border-radius: 8px; background: rgba(255, 212, 59, .1); flex-shrink: 0; }
.sec p, .sec li { color: #dbe2ee; }
.sec p + p { margin-top: 10px; }
.sec ul, .sec ol { padding-left: 24px; margin: 8px 0; }
.sec li { margin: 4px 0; }
.sec h3 { font-size: 1.08rem; margin: 18px 0 6px; color: var(--accent); }
.sec code, .task-desc code, .quiz code, .intro code, .goals code, .summary code, .mistake code, .callout code {
  font-family: var(--mono); background: rgba(255, 255, 255, .08); padding: 1px 6px; border-radius: 5px; font-size: .88em; color: #fde68a; }
.sec table { border-collapse: collapse; margin: 12px 0; width: 100%; font-size: .94rem; display: block; overflow-x: auto; }
.sec th, .sec td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; vertical-align: top; }
.sec th { background: rgba(99, 102, 241, .12); color: var(--accent); font-weight: 700; white-space: nowrap; }
.sec tr:nth-child(even) td { background: rgba(255, 255, 255, .02); }
.task-desc pre { background: #0b1026; padding: 8px 12px; border-radius: 8px; font-family: var(--mono); }

/* Eslatma bloklari: <div class="callout tip|warn|info|deep"> */
.callout { margin: 14px 0; padding: 12px 16px 12px 48px; border-radius: 12px; position: relative; border: 1px solid; font-size: .96rem; color: #e2e8f0; }
.callout::before { position: absolute; left: 14px; top: 11px; font: 900 1rem 'Font Awesome 6 Free'; }
.callout b:first-child { display: block; margin-bottom: 2px; }
.callout.tip { background: rgba(34, 197, 94, .08); border-color: rgba(34, 197, 94, .35); }
.callout.tip::before { content: '\f0eb'; color: #86efac; }
.callout.warn { background: rgba(245, 158, 11, .08); border-color: rgba(245, 158, 11, .4); }
.callout.warn::before { content: '\f071'; color: #fcd34d; }
.callout.info { background: rgba(56, 189, 248, .08); border-color: rgba(56, 189, 248, .35); }
.callout.info::before { content: '\f05a'; color: #7dd3fc; }
.callout.deep { background: rgba(139, 92, 246, .1); border-color: rgba(139, 92, 246, .4); }
.callout.deep::before { content: '\f5dc'; color: #c4b5fd; }

/* Kod bloklari */
.code-box { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: #1e1f29; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.code-bar { display: flex; align-items: center; gap: 6px; padding: 7px 8px 7px 12px; background: #16171f; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.dots { display: inline-flex; gap: 5px; margin-right: 6px; }
.dots i { width: 10px; height: 10px; border-radius: 50%; background: #ff5f57; }
.dots i:nth-child(2) { background: #febc2e; } .dots i:nth-child(3) { background: #28c840; }
.code-bar .lbl { color: var(--muted); font: .8rem var(--mono); margin-right: auto; }
.cbtn { border: 0; border-radius: 8px; padding: 6px 11px; font: 600 .83rem Inter, sans-serif; cursor: pointer; color: #fff; background: rgba(255, 255, 255, .09); display: inline-flex; gap: 6px; align-items: center; }
.cbtn:hover { background: rgba(255, 255, 255, .17); }
.cbtn.run { background: #16a34a; }
.cbtn.run:hover { background: #22c55e; }
.cbtn.check { background: var(--primary); }
.cbtn.check:hover { background: #818cf8; }
.cbtn:disabled { opacity: .5; cursor: wait; }
.CodeMirror { height: auto; font-family: var(--mono); font-size: 14.5px; line-height: 1.6; padding: 8px 0; }
.CodeMirror-scroll { max-height: 540px; min-height: 40px; }
.cm-s-dracula.CodeMirror, .cm-s-dracula .CodeMirror-gutters { background: #1e1f29 !important; }
.output { display: none; margin: 0; padding: 10px 14px; font: 13.5px/1.55 var(--mono); background: #0d1117; border-top: 1px solid var(--line); white-space: pre-wrap; word-break: break-word; max-height: 340px; overflow: auto; color: #e6edf3; }
.output.show { display: block; }
.output::before { content: 'Natija'; display: block; font: 700 .68rem Inter, sans-serif; text-transform: uppercase; letter-spacing: 1px; color: var(--faint); margin-bottom: 4px; }
.output .err { color: #ff7b72; }
.output .muted { color: var(--muted); }
.expected { border-top: 1px solid var(--line); background: #12131a; }
.expected summary { cursor: pointer; padding: 7px 14px; font-size: .8rem; color: var(--muted); list-style: none; display: flex; gap: 8px; align-items: center; }
.expected summary::-webkit-details-marker { display: none; }
.expected summary:hover { color: var(--text); }
.expected pre { margin: 0; padding: 4px 14px 12px; font: 13.5px/1.55 var(--mono); color: #a5d6ff; white-space: pre-wrap; }
.scode { margin: 6px 0 0; padding: 10px 14px; border-radius: 10px; background: #0b1026; border: 1px solid var(--line); font: 13.5px/1.6 var(--mono); color: #c7d2fe; white-space: pre-wrap; word-break: break-word; overflow-x: auto; }
.scode code { background: none !important; padding: 0 !important; color: inherit !important; font-size: inherit !important; }
.scode.bad { border-color: rgba(239, 68, 68, .4); background: rgba(239, 68, 68, .06); }
.scode.ok { border-color: rgba(34, 197, 94, .4); background: rgba(34, 197, 94, .06); }

/* Blok sarlavhalari */
.quiz, .tasks, .mistakes, .summary { margin-top: 44px; }
.block-title { font-size: 1.45rem; margin-bottom: 14px; display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.bt-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-size: 1.15rem; background: var(--panel-2); border: 1px solid var(--line); }
.bt-ic.warn { color: var(--warn); }

/* Xatolar tahlili */
.mistake { padding: 16px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); margin-bottom: 12px; }
.mistake h4 { font-size: 1.02rem; margin-bottom: 8px; }
.mk-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.mk-lbl { font-size: .74rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px; display: inline-flex; gap: 6px; align-items: center; }
.mk-lbl.bad { color: #fca5a5; } .mk-lbl.ok { color: #86efac; }
.mistake p { margin-top: 10px; color: var(--soft); font-size: .93rem; }

/* Xulosa */
.summary { padding: 20px 22px; border-radius: 16px; background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(55, 118, 171, .08)); border: 1px solid var(--line-2); }
.summary .block-title { margin-bottom: 10px; }
.summary ul { list-style: none; display: grid; gap: 6px; }
.summary li { padding-left: 22px; position: relative; color: #e2e8f0; }
.summary li::before { content: ''; position: absolute; left: 4px; top: .68em; width: 8px; height: 8px; border-radius: 2px; background: var(--py-yellow); transform: rotate(45deg); }
.cheat { margin-top: 14px; }
.cheat-h { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--accent); font-size: .9rem; }
.cheat-h .cbtn { margin-left: auto; padding: 4px 9px; }

/* Test */
.score { margin-left: auto; font-size: .85rem; font-weight: 700; padding: 4px 12px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.score:empty { display: none; }
.score.perfect { background: rgba(34, 197, 94, .18); color: #86efac; }
.score.partial { background: rgba(245, 158, 11, .15); color: #fde68a; }
.q { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px; margin-bottom: 12px; transition: border-color .2s; }
.q.q-ok { border-color: rgba(34, 197, 94, .4); }
.q.q-bad { border-color: rgba(239, 68, 68, .35); }
.q h4 { margin-bottom: 10px; font-size: 1.02rem; display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.qn, .tn { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-size: .8rem; font-weight: 800; background: rgba(99, 102, 241, .22); color: var(--accent); flex-shrink: 0; }
.q .scode { margin-bottom: 10px; }
.opts { display: grid; gap: 8px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.opt { text-align: left; border: 1px solid var(--line); background: rgba(255, 255, 255, .03); color: #e2e8f0; padding: 9px 12px; border-radius: 10px; cursor: pointer; font: 500 .95rem Inter, sans-serif; display: flex; gap: 10px; align-items: center; transition: border-color .15s, background .15s; }
.opt .ol { width: 22px; height: 22px; border-radius: 6px; display: grid; place-items: center; font-size: .72rem; font-weight: 800; background: var(--panel-2); color: var(--muted); flex-shrink: 0; }
.opt:hover:not(:disabled) { border-color: var(--accent); background: rgba(99, 102, 241, .08); }
.opt.right { border-color: var(--ok); background: rgba(34, 197, 94, .14); }
.opt.right .ol { background: var(--ok); color: #052e16; }
.opt.wrong { border-color: var(--bad); background: rgba(239, 68, 68, .12); }
.opt.wrong .ol { background: var(--bad); color: #fff; }
.opt:disabled { cursor: default; }
.explain { margin-top: 10px; color: var(--soft); font-size: .92rem; display: none; padding: 8px 12px; border-radius: 10px; background: rgba(255, 255, 255, .03); }
.explain.show { display: block; }
.link-btn { background: none; border: 0; color: var(--accent); font: 600 .88rem Inter, sans-serif; cursor: pointer; display: inline-flex; gap: 6px; align-items: center; padding: 4px 0; }
.link-btn:hover { color: var(--text); }

/* Topshiriqlar */
.tasks-help { color: var(--muted); margin-bottom: 14px; font-size: .93rem; }
.task { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.task.passed { border-color: rgba(34, 197, 94, .55); box-shadow: 0 0 0 1px rgba(34, 197, 94, .2), 0 10px 30px rgba(34, 197, 94, .06); }
.task.passed .tn { background: var(--ok); color: #052e16; }
.task h4 { font-size: 1.1rem; display: flex; gap: 10px; align-items: center; margin-bottom: 8px; flex-wrap: wrap; }
.t-lvl { color: var(--gold); font-size: .8rem; letter-spacing: 1px; }
.badge-ok { font-size: .74rem; padding: 3px 10px; border-radius: 999px; background: var(--ok); color: #052e16; display: none; margin-left: auto; }
.task.passed .badge-ok { display: inline-flex; gap: 5px; align-items: center; }
.task-desc { color: #dbe2ee; margin-bottom: 4px; }
.task-desc ul { padding-left: 22px; margin: 6px 0; }
.t-example { margin: 8px 0 4px; font-size: .88rem; color: var(--muted); }
.result { margin-top: 10px; padding: 10px 14px; border-radius: 10px; display: none; white-space: pre-wrap; font-size: .93rem; font-family: var(--mono); }
.result.show { display: block; }
.result.ok { background: rgba(34, 197, 94, .13); border: 1px solid rgba(34, 197, 94, .5); font-family: Inter, sans-serif; }
.result.bad { background: rgba(239, 68, 68, .1); border: 1px solid rgba(239, 68, 68, .45); }
.hint-box { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: rgba(245, 158, 11, .08); border: 1px dashed rgba(245, 158, 11, .5); display: none; }
.hint-box.show { display: block; }
.hint-box pre { font-family: var(--mono); white-space: pre-wrap; margin-top: 6px; color: #fde68a; font-size: .9rem; }
.sol-wrap { margin-top: 8px; }
.sol-box { margin-top: 6px; padding: 12px 14px; border-radius: 12px; background: rgba(34, 197, 94, .06); border: 1px solid rgba(34, 197, 94, .3); }
.sol-box small { color: var(--muted); }

.done-banner { margin-top: 34px; padding: 18px 20px; border-radius: 16px; background: linear-gradient(135deg, rgba(34, 197, 94, .18), rgba(55, 118, 171, .18)); border: 1px solid rgba(34, 197, 94, .5); display: none; gap: 14px; align-items: center; }
.done-banner.show { display: flex; }
.db-ic { font-size: 2rem; }
.done-banner p { color: var(--soft); }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; flex-wrap: wrap; }
.pager a { flex: 1; min-width: 220px; text-decoration: none; padding: 14px 18px; border-radius: 14px; background: var(--panel); border: 1px solid var(--line); color: var(--text); font-weight: 600; transition: border-color .15s, transform .15s; }
.pager a:hover { border-color: var(--accent); transform: translateY(-2px); }
.pager small { display: flex; gap: 6px; align-items: center; color: var(--muted); font-weight: 500; margin-bottom: 2px; }
.pager .next { text-align: right; }
.pager .next small { justify-content: flex-end; }
.kbd-help { margin-top: 16px; text-align: center; color: var(--faint); font-size: .8rem; }

/* Kurs bosh sahifasi */
.hero { padding: clamp(22px, 4vw, 38px); border-radius: 24px; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; margin-bottom: 18px;
  background: linear-gradient(135deg, rgba(55, 118, 171, .3), rgba(99, 102, 241, .18) 60%, rgba(255, 212, 59, .06)); border: 1px solid var(--line-2); position: relative; overflow: hidden; }
.hero::after { content: '\f3e2'; font: 400 15rem 'Font Awesome 6 Brands'; position: absolute; right: -40px; bottom: -70px; color: rgba(255, 212, 59, .05); pointer-events: none; }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; padding: 5px 13px; border-radius: 999px; font-size: .8rem; font-weight: 700; color: var(--py-yellow); background: rgba(255, 212, 59, .1); border: 1px solid rgba(255, 212, 59, .3); }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.12; margin: 14px 0 10px; font-weight: 900; letter-spacing: -.5px; }
.grad { background: linear-gradient(90deg, #7cc0ff, var(--py-yellow)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p { color: #dbe2ee; max-width: 620px; }
.hero-btns { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; position: relative; z-index: 1; }
.big-btn { display: inline-flex; gap: 10px; align-items: center; padding: 13px 24px; border-radius: 14px; background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 10px 28px rgba(99, 102, 241, .4); transition: transform .15s; }
.big-btn:hover { transform: translateY(-2px); }
.big-btn.ghost { background: var(--panel-2); box-shadow: none; border: 1px solid var(--line-2); }
.ring { width: 150px; height: 150px; position: relative; z-index: 1; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring-bg { stroke: rgba(255, 255, 255, .08); }
.ring-fg { stroke: var(--py-yellow); stroke-linecap: round; transition: stroke-dashoffset 1s; }
.ring-in { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-in b { font-size: 2rem; font-weight: 900; line-height: 1; }
.ring-in span { color: var(--muted); font-size: .8rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 30px; }
.stat { padding: 14px 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; }
.stat i { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(99, 102, 241, .18); color: var(--accent); }
.stat b { font-size: 1.25rem; font-weight: 900; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .8rem; }
.h2 { font-size: 1.5rem; margin: 6px 0 14px; font-weight: 800; }
.how { margin-bottom: 30px; }
.how-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.how-grid > div { padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.how-grid span { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 900; background: var(--py-yellow); color: #1a1300; margin-bottom: 8px; }
.how-grid b { display: block; }
.how-grid p { color: var(--muted); font-size: .88rem; line-height: 1.5; }
.path { display: grid; gap: 14px; position: relative; }
.mod-card { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.mod-card.complete { border-color: rgba(34, 197, 94, .45); }
.mc-head { display: flex; gap: 14px; align-items: center; }
.mc-ic { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; background: var(--panel-2); border: 1px solid var(--line); flex-shrink: 0; }
.mc-head small { color: var(--muted); font-size: .78rem; }
.mc-head h3 { font-size: 1.15rem; line-height: 1.3; }
.mc-count { margin-left: auto; font-weight: 800; color: var(--muted); font-size: .9rem; }
.mc-desc { color: var(--soft); font-size: .92rem; margin: 10px 0 0; }
.mbar { height: 5px; border-radius: 4px; background: var(--panel-2); overflow: hidden; margin: 12px 0; }
.mbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--py-blue), var(--py-yellow)); }
.mod-lessons { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 6px; }
.mod-lessons .toc-item.next { border-color: rgba(255, 212, 59, .45); background: rgba(255, 212, 59, .06); }
.tips-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 30px; }
.tips-row > div { padding: 16px; border-radius: 16px; background: var(--panel); border: 1px solid var(--line); }
.tips-row i { color: var(--py-yellow); font-size: 1.2rem; }
.tips-row b { display: block; margin: 6px 0 2px; }
.tips-row p { color: var(--muted); font-size: .88rem; line-height: 1.6; }

.py-status { position: fixed; left: 16px; bottom: 16px; padding: 8px 14px; border-radius: 10px; background: rgba(13, 18, 48, .96); border: 1px solid var(--line); font-size: .85rem; display: none; z-index: 50; }
.py-status.show { display: block; }

@media (max-width: 1000px) {

  .tips-row { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; top: 0; left: 0; bottom: 0; height: 100vh; width: min(330px, 88vw); z-index: 60; transform: translateX(-100%); transition: transform .25s; box-shadow: 10px 0 40px rgba(0, 0, 0, .6); background: var(--bg-2); }
  .sidebar.open { transform: none; }
  .toc-toggle { display: inline-flex; gap: 8px; align-items: center; margin-bottom: 16px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); color: #fff; font: 600 .92rem Inter, sans-serif; cursor: pointer; position: sticky; top: calc(var(--hh) + 8px); z-index: 20; backdrop-filter: blur(8px); }
}
@media (max-width: 640px) {
  .hero { grid-template-columns: 1fr; }
  .ring { width: 120px; height: 120px; }
  .mk-grid { grid-template-columns: 1fr; }
  .cbtn span { display: none; }
  .sec h2 { font-size: 1.22rem; }
  .content { padding-top: 18px; }
  .kbd-help { display: none; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .ring-fg, .pager a, .big-btn { transition: none; } }
