/* 微我学堂 · 样式（在主站 styles.css 基础上扩展，沿用微我蓝设计体系） */
body.learn { background: var(--bg-2); }
.links a.on { color: var(--brand); font-weight: 600; }
.learn-main { padding-top: 24px; padding-bottom: 56px; }
.learn h1 { font-size: clamp(26px, 3.4vw, 36px); line-height: 1.25; font-weight: 800; letter-spacing: -.01em; }
.learn h2, .learn .h2 { font-size: 18px; font-weight: 700; margin: 0 0 12px; }
.learn h3 { font-size: 15px; font-weight: 700; margin: 14px 0 8px; }
.card { background: #fff; border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(15, 23, 42, .04); }
.pad { padding: 24px; }
.col-main > .card, .col-side > .card, .learn-main > .card { margin: 0 0 16px; }
.learn ul, .learn ol { padding-left: 20px; margin: 0; }
.learn li { margin: 4px 0; }
.tag.teal { background: #f0fdfa; color: var(--teal); border-color: #ccfbf1; }
.btn.block { width: 100%; margin-top: 12px; }
[hidden] { display: none !important; }

/* 账号区（与主站一致） */
.account { position: relative; display: flex; align-items: center; }
.acct-login { font-size: 14px; font-weight: 600; color: #fff; background: var(--brand); padding: 7px 14px; border-radius: 10px; }
.acct-chip { display: flex; align-items: center; gap: 8px; padding: 3px 10px 3px 3px; border: 1px solid var(--line); border-radius: 999px; background: #fff; cursor: pointer; font: inherit; }
.acct-avatar { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; }
.acct-name { font-size: 14px; font-weight: 600; max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-menu { position: absolute; right: 0; top: calc(100% + 8px); min-width: 168px; background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 6px; box-shadow: 0 12px 32px -8px rgba(15, 23, 42, .18); z-index: 20; }
.acct-menu a, .acct-menu button { display: block; width: 100%; text-align: left; padding: 9px 12px; border: 0; background: none; border-radius: 8px; font: inherit; font-size: 14px; color: var(--ink); cursor: pointer; }
.acct-menu a:hover, .acct-menu button:hover { background: var(--bg-2); }
.acct-menu button { color: #dc2626; }

/* 面包屑 */
.crumbs { font-size: 13px; color: var(--ink-3); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.crumbs a { color: var(--ink-2); }
.crumbs a:hover { color: var(--brand); }
.crumbs b { color: var(--ink); font-weight: 600; }

/* 首页 */
.learn-hero { padding: 40px 0 28px; }
.learn-hero .lead { max-width: 720px; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 28px; }
.stats div { background: #fff; border-radius: 14px; box-shadow: 0 0 0 1px var(--line); padding: 16px 18px; }
.stats b { display: block; font-size: 26px; font-weight: 800; color: var(--brand); }
.stats span { font-size: 13px; color: var(--ink-2); }
.section-tight { margin: 28px 0 8px; }
.routes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 14px; }
.route { padding: 20px; }
.route-no { font-size: 13px; font-weight: 700; color: var(--brand); }
.route h3 { margin: 4px 0 6px; font-size: 17px; }
.route p { font-size: 14px; color: var(--ink-2); }
.route-path { margin-top: 12px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; font-size: 13px; }
.route-path a { padding: 2px 8px; border-radius: 6px; background: var(--brand-l); color: var(--brand); font-weight: 600; }
.route-path i { font-style: normal; color: var(--ink-3); }
.block { margin-top: 32px; scroll-margin-top: 80px; }
.block-head { display: flex; gap: 14px; align-items: center; margin-bottom: 14px; }
.block-head h2 { margin: 0; font-size: 20px; }
.block-id { width: 44px; height: 44px; border-radius: 12px; background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 18px; flex-shrink: 0; }
.mods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.mod { display: flex; flex-direction: column; gap: 8px; padding: 20px; transition: box-shadow .15s, transform .15s; }
.mod:hover { box-shadow: 0 0 0 1px #bfdbfe, 0 8px 20px -10px rgba(37, 99, 235, .35); transform: translateY(-1px); }
.mod h3 { margin: 4px 0 0; font-size: 16px; }
.mod p { font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; flex: 1; }
.mod-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mod-id { font-size: 13px; font-weight: 800; color: #fff; background: var(--brand); border-radius: 8px; padding: 2px 8px; }
.mod-id.lg { font-size: 15px; padding: 4px 10px; }
.mod-meta { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12px; color: var(--ink-3); }
.mod.is-done { box-shadow: 0 0 0 1px #bbf7d0; }
.mod.is-done .mod-id { background: #16a34a; }
.progress { height: 6px; background: var(--bg-2); border-radius: 999px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress i { display: block; height: 100%; width: 0; background: var(--brand); border-radius: 999px; transition: width .3s; }
.progress.lg { height: 8px; margin-top: 16px; }
.mod-status { font-size: 12px; min-height: 18px; margin-top: 6px; color: var(--ink-2); }
.how { margin-top: 32px; }
.how ol { font-size: 14px; color: var(--ink-2); }

/* 模块页 / 课节页布局 */
.mod-hero h1 { margin: 12px 0 8px; }
.mod-hero .lead { font-size: 16px; margin-top: 0; }
.mod-hero .actions { margin-top: 18px; }
.two { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; margin-top: 16px; }
.col-side { display: flex; flex-direction: column; gap: 0; align-self: stretch; } /* 撑满行高，sticky 侧栏才能随滚动固定 */
.sticky { position: sticky; top: 80px; }
.ticks { list-style: none; padding: 0 !important; }
.ticks li { padding-left: 22px; position: relative; font-size: 14px; color: var(--ink-2); }
.ticks li::before { content: "✓"; position: absolute; left: 0; color: var(--teal); font-weight: 700; }
.lessons { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.lesson-row { display: flex; align-items: center; gap: 14px; padding: 12px 14px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.lesson-row:hover { box-shadow: 0 0 0 1px #bfdbfe; background: var(--brand-l); }
.lesson-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lesson-row b { font-size: 15px; }
.lesson-row .muted { font-size: 12px; }
.lesson-no { width: 30px; height: 30px; border-radius: 9px; background: var(--brand-l); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: 14px; flex-shrink: 0; }
.lesson-no.sm { width: 24px; height: 24px; font-size: 12px; border-radius: 7px; }
.check { width: 20px; height: 20px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); flex-shrink: 0; }
a.done .check { background: #16a34a; box-shadow: none; }
a.done .check::after { content: "✓"; color: #fff; font-size: 12px; display: grid; place-items: center; height: 100%; }
a.done .lesson-no { background: #dcfce7; color: #15803d; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cols ol, .cols ul { font-size: 14px; color: var(--ink-2); }
.terms { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow: auto; }
.term { padding: 10px 12px; border-radius: 10px; background: var(--bg-2); }
.term b { font-size: 14px; }
.term p { font-size: 13px; color: var(--ink-2); margin-top: 2px; }
.res { list-style: none; padding: 0 !important; }
.res li { margin-bottom: 12px; }
.res a { font-weight: 600; color: var(--brand); }
.res p { font-size: 13px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.side-lessons { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 2px; margin-bottom: 4px; }
.side-lessons a { display: flex; gap: 10px; align-items: flex-start; padding: 8px; border-radius: 10px; font-size: 13px; color: var(--ink-2); line-height: 1.5; }
.side-lessons a:hover { background: var(--bg-2); }
.side-lessons a.on { background: var(--brand-l); color: var(--brand); font-weight: 600; }
.sticky h2 a:hover { color: var(--brand); }

/* 课节正文 */
.lesson-head h1 { margin: 10px 0 14px; font-size: clamp(22px, 2.8vw, 30px); }
.objectives { background: var(--brand-l); border-radius: 12px; padding: 12px 16px; font-size: 14px; }
.objectives ul { margin-top: 4px; color: var(--ink-2); }
.prose { font-size: 16px; line-height: 1.85; color: var(--ink); word-break: break-word; }
.prose p { margin: 0 0 14px; }
.prose h3 { font-size: 18px; margin: 26px 0 10px; padding-left: 10px; border-left: 3px solid var(--brand); }
.prose h3:first-child { margin-top: 0; }
.prose ul, .prose ol { margin: 0 0 14px; }
.prose li { margin: 6px 0; }
.prose blockquote { margin: 0 0 14px; padding: 12px 16px; border-radius: 10px; background: #f0fdfa; color: #134e4a; }
.prose pre { margin: 0 0 14px; padding: 14px 16px; border-radius: 12px; background: #0f172a; color: #e2e8f0; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }
.prose :not(pre) > code { background: var(--bg-2); padding: 1px 6px; border-radius: 5px; box-shadow: inset 0 0 0 1px var(--line); }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 14px; font-size: 14px; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--bg-2); }
.reveal { margin-top: 16px; border-radius: 12px; box-shadow: 0 0 0 1px var(--line); }
.reveal summary { cursor: pointer; padding: 12px 16px; font-weight: 600; color: var(--brand); list-style: none; }
.reveal summary::-webkit-details-marker { display: none; }
.reveal summary::before { content: "▸ "; }
.reveal[open] summary::before { content: "▾ "; }
.reveal .prose { padding: 0 16px 6px; font-size: 15px; }
.done-bar { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.done-bar p { font-size: 13px; margin-top: 2px; }

/* 测验 */
.q-list { list-style: none; padding: 0 !important; display: flex; flex-direction: column; gap: 16px; counter-reset: q; }
.q-item { counter-increment: q; }
.q-stem { font-weight: 600; margin-bottom: 8px; }
.q-stem::before { content: counter(q) ". "; color: var(--brand); }
.q-opts { display: flex; flex-direction: column; gap: 8px; }
.q-opt { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 10px; box-shadow: inset 0 0 0 1px var(--line); cursor: pointer; font-size: 14px; }
.q-opt:hover { background: var(--bg-2); }
.q-opt input { position: absolute; opacity: 0; pointer-events: none; }
.q-letter { width: 22px; height: 22px; border-radius: 6px; background: var(--bg-2); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--ink-2); flex-shrink: 0; }
.q-opt:has(input:checked) { box-shadow: inset 0 0 0 2px var(--brand); background: var(--brand-l); }
.q-opt:has(input:checked) .q-letter { background: var(--brand); color: #fff; }
.q-opt:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.q-opt.right { box-shadow: inset 0 0 0 2px #16a34a; background: #f0fdf4; }
.q-opt.right .q-letter { background: #16a34a; color: #fff; }
.q-opt.wrong { box-shadow: inset 0 0 0 2px #dc2626; background: #fef2f2; }
.q-opt.wrong .q-letter { background: #dc2626; color: #fff; }
.q-feedback { font-size: 14px; color: var(--ink-2); margin-top: 8px; }
.q-feedback:empty { display: none; }
.q-item.ok .q-feedback b { color: #15803d; }
.q-item.bad .q-feedback b { color: #dc2626; }
.q-foot { display: flex; align-items: center; gap: 14px; margin-top: 18px; flex-wrap: wrap; }
.q-result { font-size: 14px; font-weight: 600; color: var(--ink-2); }

@media (max-width: 960px) {
    .two { grid-template-columns: 1fr; }
    .sticky { position: static; }
    .lesson-layout .col-side { order: -1; }
    .lesson-layout .col-side .side-lessons { display: none; }
    .mods, .routes { grid-template-columns: repeat(2, 1fr); }
    .stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
    .learn .links { display: flex; gap: 14px; font-size: 14px; }
    .learn .links a:not(.on) { display: none; }
    .acct-name { display: none; }
    .acct-chip { padding: 3px; }
    .mods, .routes, .cols { grid-template-columns: 1fr; }
    .pad { padding: 18px; }
    .prose { font-size: 15.5px; }
    .learn-hero { padding-top: 24px; }
    .pager .btn { flex: 1; }
}
