/* ==========================================================================
   知界课堂 · 设计系统 v4
   风格参考：ubuntu.cn/desktop（大字号、强对比、橙色点缀、充足留白）
   适配：知识付费 / 按类别订阅
   ========================================================================== */

/* ---------- 1. 变量 ---------- */
:root {
    --ink: #0F1317;
    --ink-2: #333B44;
    --ink-3: #5C6673;
    --ink-4: #8A94A1;

    --paper: #ffffff;
    --paper-2: #F7F8FA;
    --paper-3: #F1F3F6;

    --line: #E7EAEF;
    --line-2: #EFF1F5;

    --brand: #E95420;
    --brand-2: #C7431A;
    --brand-3: #FF7A45;
    --brand-soft: #FFF2EC;
    --brand-line: #FBD9CB;

    --dark: #0E1114;
    --dark-2: #161A1F;
    --dark-3: #232830;

    --ok: #11734B;
    --ok-soft: #E8F6EF;
    --warn: #A96500;
    --warn-soft: #FDF3E3;
    --danger: #B32B37;
    --danger-soft: #FDEEEF;

    --radius-sm: 10px;
    --radius: 14px;
    --radius-lg: 20px;
    --radius-xl: 28px;

    --shadow-sm: 0 1px 2px rgba(15, 19, 23, .04);
    --shadow: 0 10px 30px -18px rgba(15, 19, 23, .28);
    --shadow-lg: 0 30px 60px -32px rgba(15, 19, 23, .35);

    --font: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Source Han Sans SC",
            -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

    --wrap: 1180px;
    --header-h: 72px;
}

/* ---------- 2. 基础 ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html, body { margin: 0; padding: 0; overflow-x: hidden; }

body {
    background: var(--paper);
    color: var(--ink);
    font: 400 15.5px/1.7 var(--font);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

::selection { background: var(--brand); color: #fff; }

a { color: var(--ink); text-decoration: none; transition: color .18s ease; }
a:hover { color: var(--brand); }

img { max-width: 100%; display: block; }

h1, h2, h3, h4 { margin: 0; font-weight: 750; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 30px; line-height: 1.25; }
h2 { font-size: 21px; line-height: 1.35; }
h3 { font-size: 16.5px; line-height: 1.45; }
p { margin: 0 0 10px; }
ul, ol { margin: 0; padding: 0; }

:focus-visible {
    outline: 2px solid var(--brand);
    outline-offset: 2px;
    border-radius: 4px;
}

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

/* 破格：让某个区块占满视口宽度 */
.bleed {
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.site-main { min-height: 60vh; }
.page { padding-top: 8px; padding-bottom: 72px; }

/* 首尾是满宽色块时去掉容器留白，避免出现一条白边（不支持 :has 的浏览器只是多一条细边） */
.page:has(> .bleed:first-child) { padding-top: 0; }
.page:has(> .bleed:last-child) { padding-bottom: 0; }

.muted { color: var(--ink-3); }
.small { font-size: 13px; }
.meta { color: var(--ink-3); font-size: 13.5px; }
.meta.ok { color: var(--ok); }
.mono { font-family: var(--mono); font-size: 13px; letter-spacing: -.2px; }
.right { text-align: right; }
.inline { display: inline; }
.dot { opacity: .35; margin: 0 2px; }
.bar-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; }

/* ---------- 3. 按钮 ---------- */
.btn {
    --btn-bg: var(--brand);
    --btn-fg: #fff;
    --btn-bd: var(--brand);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 44px;
    padding: 0 22px;
    border: 1px solid var(--btn-bd);
    border-radius: 999px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    font: 600 14.5px/1 var(--font);
    letter-spacing: .01em;
    cursor: pointer;
    white-space: nowrap;
    transition: transform .18s ease, background .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(233, 84, 32, .65); }
.btn:active { transform: translateY(0); }

.btn-primary { --btn-bg: var(--brand); --btn-fg: #fff; --btn-bd: var(--brand); }
.btn-primary:hover { --btn-bg: var(--brand-2); --btn-bd: var(--brand-2); color: #fff; }

.btn-dark { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: var(--ink); }
.btn-dark:hover { --btn-bg: #000; --btn-bd: #000; color: #fff; box-shadow: 0 10px 24px -14px rgba(15, 19, 23, .7); }

.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn-ghost:hover { --btn-bg: #fff; --btn-bd: var(--ink-4); color: var(--ink); box-shadow: var(--shadow); }

.btn-light { --btn-bg: #fff; --btn-fg: var(--ink); --btn-bd: #fff; }
.btn-light:hover { --btn-bg: #fff; --btn-fg: var(--brand); }

.btn-lg { height: 52px; padding: 0 30px; font-size: 15.5px; }
.btn-sm, .btn.sm { height: 36px; padding: 0 16px; font-size: 13.5px; }
.btn-block, .btn.block { display: flex; width: 100%; margin-top: 14px; }

/* 老视图里用的 .ghost / .sm 组合 */
.btn.ghost { --btn-bg: transparent; --btn-fg: var(--ink); --btn-bd: var(--line); }
.btn.ghost:hover { --btn-bg: #fff; --btn-bd: var(--ink-4); }

.linkbtn {
    background: none; border: 0; padding: 0; margin: 0;
    color: var(--ink-3); cursor: pointer;
    font: 500 14px/1.6 var(--font);
    transition: color .18s ease;
}
.linkbtn:hover { color: var(--brand); }
.linkbtn.danger { color: var(--danger); }
.linkbtn.danger:hover { color: #8f1f29; }
.linkbtn.small { font-size: 12.5px; }

/* ---------- 4. 头部 ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: rgba(255, 255, 255, .82);
    backdrop-filter: saturate(180%) blur(14px);
    -webkit-backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.site-header.is-scrolled {
    background: rgba(255, 255, 255, .94);
    border-bottom-color: var(--line);
    box-shadow: 0 6px 24px -22px rgba(15, 19, 23, .5);
}

.header-inner {
    display: flex;
    align-items: center;
    gap: 34px;
    height: var(--header-h);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 17px;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--ink);
    flex: none;
}
.brand:hover { color: var(--ink); }
.brand-mark {
    width: 22px; height: 22px;
    border-radius: 7px;
    background: linear-gradient(145deg, var(--brand-3), var(--brand) 55%, var(--brand-2));
    box-shadow: 0 6px 14px -6px rgba(233, 84, 32, .8);
    position: relative;
    flex: none;
}
.brand-mark::after {
    content: "";
    position: absolute;
    inset: 6px 6px auto auto;
    width: 8px; height: 8px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .92);
}

.nav-panel { display: flex; align-items: center; gap: 30px; margin-left: auto; }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a {
    font-size: 14.5px;
    font-weight: 500;
    color: var(--ink-2);
    position: relative;
    padding: 4px 0;
}
.nav-links a::after {
    content: "";
    position: absolute;
    left: 0; right: 100%;
    bottom: 0;
    height: 2px;
    background: var(--brand);
    border-radius: 2px;
    transition: right .22s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { right: 0; }

.nav-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.nav-login { font-size: 14.5px; font-weight: 500; color: var(--ink-2); }
.who {
    font-size: 13.5px;
    color: var(--ink-3);
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-toggle {
    display: none;
    width: 42px; height: 42px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    padding: 0;
    place-items: center;
    gap: 4px;
}
.nav-toggle span {
    display: block;
    width: 16px; height: 1.6px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform .2s ease, opacity .2s ease;
}

/* ---------- 5. 首页 Hero ---------- */
.hero {
    position: relative;
    padding: 88px 0 96px;
    background:
        radial-gradient(880px 420px at 82% -8%, #FFE3D6 0%, rgba(255, 227, 214, 0) 62%),
        radial-gradient(620px 320px at 4% 8%, #EDF1F6 0%, rgba(237, 241, 246, 0) 70%),
        var(--paper);
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(15, 19, 23, .045) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(15, 19, 23, .045) 1px, transparent 1px);
    background-size: 84px 84px;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 62%);
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent 62%);
    pointer-events: none;
}
.hero-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
    gap: 64px;
    align-items: center;
}

.hero-copy { min-width: 0; }

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 30px;
    padding: 0 14px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--brand-line);
    color: var(--brand-2);
    font-size: 12.5px;
    font-weight: 600;
    letter-spacing: .04em;
}
.hero-eyebrow::before {
    content: "";
    width: 6px; height: 6px;
    border-radius: 50%;
    background: var(--brand);
    box-shadow: 0 0 0 4px rgba(233, 84, 32, .14);
}

.hero-title {
    margin: 22px 0 20px;
    font-size: clamp(38px, 4.9vw, 64px);
    line-height: 1.08;
    letter-spacing: -.025em;
    font-weight: 800;
}
.hero-title .hl {
    color: var(--brand);
    position: relative;
    white-space: nowrap;
}
.hero-title .hl::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: .06em;
    height: .12em;
    border-radius: 999px;
    background: linear-gradient(90deg, rgba(233, 84, 32, .28), rgba(233, 84, 32, .06));
}

.hero-sub {
    max-width: 520px;
    font-size: 16.5px;
    line-height: 1.75;
    color: var(--ink-3);
    margin-bottom: 34px;
}

.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-stats {
    display: flex;
    gap: 48px;
    margin-top: 46px;
    padding-top: 26px;
    border-top: 1px solid var(--line);
    flex-wrap: wrap;
}
.hero-stats div { display: flex; flex-direction: column; gap: 2px; }
.hero-stats strong {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -.03em;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.hero-stats span { font-size: 13px; color: var(--ink-3); }

/* Hero 右侧：类别到期卡片堆 */
.hero-visual { position: relative; min-height: 340px; }
.hero-visual::before {
    content: "";
    position: absolute;
    width: 340px; height: 340px;
    right: -40px; top: -30px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(233, 84, 32, .16), rgba(233, 84, 32, 0) 68%);
    filter: blur(6px);
}

.sub-card {
    position: relative;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 20px 22px;
    box-shadow: var(--shadow-lg);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sub-card + .sub-card { margin-top: -14px; }
.sub-card--a { transform: rotate(-1.6deg); z-index: 3; }
.sub-card--b { transform: rotate(1.2deg) translateX(26px) scale(.97); z-index: 2; opacity: .96; }
.sub-card--c { transform: rotate(-.6deg) translateX(10px) scale(.94); z-index: 1; opacity: .9; }

.sub-top { display: flex; align-items: center; justify-content: space-between; }
.sub-name { font-size: 15px; font-weight: 700; }
.sub-days { font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.sub-days.is-off { color: var(--ink-4); }
.sub-track {
    height: 6px;
    border-radius: 999px;
    background: var(--paper-3);
    overflow: hidden;
}
.sub-track i {
    display: block;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--brand-3), var(--brand));
}
.sub-track i.is-off { background: var(--line); }

/* ---------- 6. 区块 ---------- */
.section { padding: 88px 0; }
.section--soft { background: var(--paper-2); border-top: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.section--dark { background: var(--dark); }

.section-head { max-width: 720px; margin-bottom: 44px; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

.eyebrow {
    display: block;
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--brand);
    margin-bottom: 14px;
}
.section-title {
    font-size: clamp(26px, 2.9vw, 40px);
    line-height: 1.2;
    letter-spacing: -.02em;
    font-weight: 800;
    margin-bottom: 14px;
}
.section-sub { font-size: 16px; color: var(--ink-3); line-height: 1.75; }

.section--dark .section-title { color: #fff; }
.section--dark .section-sub { color: rgba(255, 255, 255, .62); }
.section--dark .eyebrow { color: var(--brand-3); }

/* 兼容旧视图的 .sec-title */
.sec-title {
    font-size: clamp(22px, 2.2vw, 30px);
    font-weight: 800;
    letter-spacing: -.02em;
    margin: 56px 0 20px;
}

/* ---------- 7. 类别卡片 ---------- */
.cat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.cat-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 26px 26px 22px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s ease, border-color .22s ease;
    overflow: hidden;
}
.cat-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, var(--brand), var(--brand-3));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s ease;
}
.cat-card:hover {
    transform: translateY(-4px);
    border-color: var(--brand-line);
    box-shadow: 0 26px 50px -30px rgba(15, 19, 23, .4);
    color: inherit;
}
.cat-card:hover::before { transform: scaleX(1); }

.cat-card-top { display: flex; align-items: center; justify-content: space-between; }
.cat-index {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .12em;
    color: var(--ink-4);
    font-variant-numeric: tabular-nums;
}
.cat-card .cat-name { font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.cat-desc {
    font-size: 14px;
    line-height: 1.7;
    color: var(--ink-3);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 44px;
}
.cat-meta {
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    padding-top: 14px;
    border-top: 1px solid var(--line-2);
    font-size: 13px;
    color: var(--ink-3);
}
.cat-meta b { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cat-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--ink-3);
    min-height: 20px;
}
.cat-arrow {
    display: inline-grid;
    place-items: center;
    width: 30px; height: 30px;
    border-radius: 50%;
    border: 1px solid var(--line);
    color: var(--ink-2);
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.cat-card:hover .cat-arrow {
    background: var(--brand);
    border-color: var(--brand);
    color: #fff;
    transform: translateX(2px);
}

/* ---------- 8. 套餐卡片 ---------- */
.pkg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.pkg-card {
    display: flex;
    flex-direction: column;
    padding: 30px 28px 26px;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.pkg-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 30px 56px -34px rgba(15, 19, 23, .45);
    border-color: var(--brand-line);
}
.pkg-name { font-size: 16px; font-weight: 700; color: var(--ink-2); letter-spacing: .01em; }
.pkg-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 14px 0 4px;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: -.03em;
}
.pkg-price .cur { font-size: 20px; font-weight: 700; color: var(--brand); }
.pkg-price .num { font-size: 46px; line-height: 1; font-variant-numeric: tabular-nums; }
.pkg-price span.unit { font-size: 13px; font-weight: 500; color: var(--ink-3); letter-spacing: 0; }
.pkg-desc { font-size: 13.5px; color: var(--ink-3); line-height: 1.7; min-height: 44px; }
.pkg-list { list-style: none; margin: 18px 0 0; padding: 18px 0 0; border-top: 1px solid var(--line-2); }
.pkg-list li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 9px;
    font-size: 13.5px;
    color: var(--ink-2);
}
.pkg-list li::before {
    content: "";
    position: absolute;
    left: 2px; top: 7px;
    width: 12px; height: 7px;
    border-left: 2px solid var(--brand);
    border-bottom: 2px solid var(--brand);
    transform: rotate(-45deg);
    border-radius: 1px;
}
.pkg-card .btn { margin-top: auto; }
/* 让按钮始终贴底：表单/链接推到卡片底部，内容多少不同也对齐 */
.pkg-card > form { margin-top: auto; }
.pkg-card > form .btn-block { margin-top: 18px; }
.pkg-card > a.btn-block { margin-top: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; }

.chip {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-2);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}
.chip.free { background: var(--brand-soft); color: var(--brand-2); }
.chip.dead { background: var(--paper-3); color: var(--ink-4); text-decoration: line-through; }
.chip.link { background: #fff; border: 1px solid var(--line); }
.chip.link:hover { border-color: var(--brand-line); color: var(--brand-2); }

.badge {
    display: inline-flex;
    align-items: center;
    height: 24px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-3);
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}
.badge.ok { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.dead { background: var(--paper-3); color: var(--ink-4); }

/* ---------- 9. 步骤 ---------- */
.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 28px;
    list-style: none;
    counter-reset: step;
}
.step {
    position: relative;
    padding-top: 26px;
    border-top: 2px solid var(--line);
}
.step::before {
    counter-increment: step;
    content: "0" counter(step);
    position: absolute;
    top: -22px;
    left: 0;
    background: var(--paper-2);
    padding-right: 12px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .1em;
    color: var(--brand);
}
.step h3 { font-size: 16.5px; margin-bottom: 6px; }
.step p { font-size: 13.5px; color: var(--ink-3); line-height: 1.7; margin: 0; }

/* ---------- 10. 卡片 / 通用容器 ---------- */
.card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 26px 28px;
    margin-bottom: 18px;
}
.card.center { text-align: center; padding: 72px 24px; }
.card h1 { margin-bottom: 8px; }

.alert {
    border-radius: var(--radius);
    padding: 13px 18px;
    margin-bottom: 18px;
    font-size: 14px;
    border: 1px solid transparent;
}
.alert.ok { background: var(--ok-soft); color: #0d5c3b; border-color: #CDEBDD; }
.alert.err { background: var(--danger-soft); color: #8E222C; border-color: #F6D5D8; }
.alert.err:empty { display: none; }

/* ---------- 11. 页头（内页） ---------- */
.page-hero {
    position: relative;
    padding: 44px 0 56px;
    background:
        radial-gradient(620px 260px at 88% 0%, #FFE9DE 0%, rgba(255, 233, 222, 0) 70%),
        var(--paper-2);
    border-bottom: 1px solid var(--line-2);
    margin-bottom: 40px;
    overflow: hidden;
}
.page-title {
    font-size: clamp(30px, 3.6vw, 46px);
    line-height: 1.15;
    letter-spacing: -.025em;
    font-weight: 800;
    margin: 8px 0 12px;
}
.page-sub { font-size: 16px; color: var(--ink-3); max-width: 680px; line-height: 1.75; }

.crumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--ink-4);
    margin-bottom: 6px;
    flex-wrap: wrap;
}
.crumb a { color: var(--ink-4); }
.crumb a:hover { color: var(--brand); }

.page-cta {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 26px;
}

/* ---------- 12. 课程 / 课时列表 ---------- */
.course-card { padding: 0; overflow: hidden; }
.course-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 24px 28px 18px;
    border-bottom: 1px solid var(--line-2);
}
.course-head h2 { font-size: 19px; font-weight: 750; }

.lesson-list { list-style: none; }
.lesson-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 15px 28px;
    border-bottom: 1px solid var(--line-2);
    transition: background .16s ease;
}
.lesson-row:last-child { border-bottom: 0; }
.lesson-row:hover { background: #FBFAF9; }
.lesson-idx {
    flex: none;
    width: 30px;
    font-size: 12px;
    font-weight: 700;
    color: var(--ink-4);
    font-variant-numeric: tabular-nums;
}
.lesson-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.lesson-title { font-size: 14.5px; font-weight: 500; color: var(--ink); flex: 1; min-width: 180px; }
.lesson-title:hover { color: var(--brand); }
.lesson-tags { display: flex; align-items: center; gap: 8px; flex: none; }
.lock { font-size: 12px; color: var(--ink-4); }
.lesson-row .meta { flex: none; font-variant-numeric: tabular-nums; }

/* 旧结构：ol.lessons */
.lessons { margin: 14px 0 0; padding-left: 20px; }
.lessons li { margin-bottom: 10px; }
.lesson-link { color: var(--ink); font-weight: 500; }
.lesson-link:hover { color: var(--brand); }

/* ---------- 13. 课时正文 ---------- */
.reading { max-width: 820px; margin: 0 auto; }
.reading-head { margin-bottom: 34px; }
.reading-title {
    font-size: clamp(28px, 3.4vw, 40px);
    line-height: 1.22;
    letter-spacing: -.022em;
    font-weight: 800;
    margin: 10px 0 16px;
}
.lesson-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.prose {
    font-size: 16.5px;
    line-height: 1.95;
    color: var(--ink-2);
    letter-spacing: .002em;
}
.prose > *:first-child { margin-top: 0; }
.prose h1 { font-size: 28px; margin: 40px 0 14px; }
.prose h2 { font-size: 23px; margin: 40px 0 14px; letter-spacing: -.015em; }
.prose h3 { font-size: 18px; margin: 30px 0 10px; }
.prose h4 { font-size: 16px; margin: 24px 0 8px; }
.prose p { margin: 0 0 18px; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 24px; }
.prose li { margin-bottom: 8px; }
.prose li::marker { color: var(--ink-4); }
.prose strong { color: var(--ink); font-weight: 650; }
.prose a { color: var(--brand-2); border-bottom: 1px solid var(--brand-line); }
.prose a:hover { border-bottom-color: var(--brand); }
.prose code {
    background: var(--paper-3);
    padding: 2px 6px;
    border-radius: 6px;
    font-family: var(--mono);
    font-size: .88em;
    color: #B03A14;
}
.prose pre {
    background: var(--dark);
    color: #E9EDF2;
    border-radius: var(--radius);
    padding: 20px 22px;
    overflow-x: auto;
    margin: 0 0 22px;
    font-size: 13.5px;
    line-height: 1.75;
}
.prose pre code { background: none; padding: 0; color: inherit; font-size: 13.5px; }
.prose blockquote {
    margin: 0 0 22px;
    padding: 4px 0 4px 20px;
    border-left: 3px solid var(--brand);
    color: var(--ink-2);
    background: linear-gradient(90deg, var(--brand-soft), rgba(255, 242, 236, 0));
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose img { border-radius: var(--radius); margin: 8px 0 20px; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 32px 0; }
.prose table {
    border-collapse: collapse;
    width: 100%;
    margin: 0 0 22px;
    font-size: 14.5px;
}
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
.prose th { background: var(--paper-2); font-weight: 650; }

.locked-panel {
    text-align: center;
    padding: 64px 28px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(420px 200px at 50% 0%, #FFF1EA 0%, rgba(255, 241, 234, 0) 70%),
        var(--paper);
}
.lock-icon {
    display: inline-grid;
    place-items: center;
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 22px;
    margin-bottom: 16px;
}
.locked-panel h2 { font-size: 21px; margin-bottom: 10px; }

.upsell {
    margin-top: 32px;
    padding: 20px 24px;
    background: var(--brand-soft);
    border: 1px solid var(--brand-line);
    border-radius: var(--radius);
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.upsell a { font-weight: 600; color: var(--brand-2); }

.pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    max-width: 820px;
    margin: 36px auto 0;
}
.pager-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 22px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: #fff;
    transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.pager-card:hover { border-color: var(--brand-line); transform: translateY(-2px); box-shadow: var(--shadow); }
.pager-label { font-size: 12px; color: var(--ink-4); letter-spacing: .08em; }
.pager-title { font-size: 14.5px; font-weight: 600; color: var(--ink); }
.pager-card.next { text-align: right; align-items: flex-end; }
.pager-card.empty { visibility: hidden; }

/* ---------- 14. 认证页 ---------- */
.auth-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: calc(100vh - var(--header-h) - 220px);
    border: 1px solid var(--line);
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: #fff;
    margin: 20px 0 40px;
}
.auth-aside {
    position: relative;
    padding: 56px 48px;
    background:
        radial-gradient(560px 300px at 10% 0%, rgba(233, 84, 32, .32), rgba(233, 84, 32, 0) 60%),
        linear-gradient(160deg, #14181D, #0B0E11);
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 40px;
}
.auth-aside .brand { color: #fff; }
.auth-aside h2 {
    color: #fff;
    font-size: clamp(26px, 2.6vw, 36px);
    line-height: 1.24;
    letter-spacing: -.02em;
    font-weight: 800;
    max-width: 420px;
}
.auth-aside p { color: rgba(255, 255, 255, .62); font-size: 14.5px; line-height: 1.8; }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.auth-points li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, .86);
}
.auth-points li::before {
    content: "";
    flex: none;
    width: 16px; height: 9px;
    margin-top: 6px;
    border-left: 2px solid var(--brand-3);
    border-bottom: 2px solid var(--brand-3);
    transform: rotate(-45deg);
    border-radius: 1px;
}
.auth-main {
    padding: 56px 48px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}
.auth-form { width: 100%; max-width: 380px; margin: 0 auto; }
.auth-form h1 { font-size: 30px; margin-bottom: 8px; letter-spacing: -.02em; }
.auth-form > p { color: var(--ink-3); font-size: 14px; margin-bottom: 28px; }

/* 兼容旧 .auth 卡片 */
.auth { max-width: 440px; margin: 34px auto; }

/* ---------- 15. 表单 ---------- */
.field { display: block; margin-bottom: 18px; }
.field > span {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 8px;
}
input[type=text], input[type=password], input[type=number], input[type=file],
input[type=search], input:not([type]), select, textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--ink);
    font: 400 14.5px/1.5 var(--font);
    transition: border-color .18s ease, box-shadow .18s ease;
}
input:hover, select:hover, textarea:hover { border-color: #D8DDE5; }
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(233, 84, 32, .12);
}
input::placeholder, textarea::placeholder { color: var(--ink-4); }
textarea { resize: vertical; min-height: 140px; }
.mono-area { font-family: var(--mono); font-size: 13.5px; line-height: 1.75; }
select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%235C6673' stroke-width='1.6' stroke-linecap='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 20px; }
.inline-form { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 14px; }
.inline-form input, .inline-form select { width: auto; min-width: 170px; min-height: 42px; }
.checks { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: 8px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.check input { width: 16px; height: 16px; min-height: 0; accent-color: var(--brand); }
.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0 20px;
    align-items: end;
    margin: 16px 0 6px;
}
.form-row .field { margin-bottom: 12px; }
.form-row button[type=submit] { height: 46px; margin-bottom: 12px; }
.form-row input[type=file] { font-size: 13px; padding: 10px 12px; }
.footlink { margin-top: 20px; }

/* ---------- 16. 个人中心 ---------- */
.profile-head {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 32px 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background:
        radial-gradient(480px 200px at 92% 0%, #FFEDE4 0%, rgba(255, 237, 228, 0) 70%),
        #fff;
    margin-bottom: 28px;
    flex-wrap: wrap;
}
.avatar {
    flex: none;
    width: 62px; height: 62px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(145deg, var(--brand-3), var(--brand));
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    box-shadow: 0 12px 26px -14px rgba(233, 84, 32, .9);
}
.profile-id { flex: 1; min-width: 180px; }
.profile-id h1 { font-size: 24px; margin-bottom: 4px; }
.profile-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- 17. 表格 ---------- */
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; }
.tbl th, .tbl td {
    padding: 13px 12px;
    border-bottom: 1px solid var(--line-2);
    text-align: left;
    vertical-align: middle;
}
.tbl th {
    font-weight: 600;
    color: var(--ink-4);
    font-size: 12.5px;
    letter-spacing: .04em;
    text-transform: uppercase;
    border-bottom-color: var(--line);
}
.tbl tbody tr { transition: background .14s ease; }
.tbl tbody tr:hover { background: #FBFAF9; }
.tbl tr:last-child td { border-bottom: 0; }
.plain { margin: 0; padding-left: 20px; }
.plain li { margin-bottom: 8px; }

/* ---------- 18. 后台 ---------- */
.subnav {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line-2);
}
.subnav a {
    font-size: 13.5px;
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 999px;
    background: #fff;
    border: 1px solid var(--line);
    color: var(--ink-2);
    transition: all .16s ease;
}
.subnav a:hover {
    border-color: var(--brand-line);
    color: var(--brand-2);
    background: var(--brand-soft);
}
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 18px; }
.grid { display: grid; gap: 16px; }
.grid.stats-grid { margin-bottom: 18px; }
.cats { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }
.pkgs { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }

.stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px 24px;
    margin: 0;
}
.stat-num {
    font-size: 34px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}
.stat-label { font-size: 12.5px; color: var(--ink-3); }

.tabs { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.tabs a {
    font-size: 13px;
    padding: 7px 14px;
    border-radius: 999px;
    background: var(--paper-3);
    color: var(--ink-2);
}
.tabs a.on { background: var(--ink); color: #fff; }
.tabs a:hover { text-decoration: none; color: var(--brand-2); }
.tabs a.on:hover { color: #fff; }

.note ol.steps { margin: 8px 0 0; padding-left: 22px; }
.note ol.steps li { margin-bottom: 8px; }
.subcats { margin: 6px 0 24px; }

/* ---------- 19. 页脚 ---------- */
.site-footer {
    background: var(--dark);
    color: rgba(255, 255, 255, .58);
    padding: 64px 0 28px;
    margin-top: 0;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1.6fr 1fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 44px;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
}
.footer-brand .brand { color: #fff; margin-bottom: 14px; }
.footer-brand p { font-size: 13.5px; line-height: 1.8; max-width: 300px; color: rgba(255, 255, 255, .5); }
.footer-col { display: flex; flex-direction: column; gap: 12px; }
.footer-col h4 {
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
    margin-bottom: 2px;
}
.footer-col a, .footer-col span { font-size: 13.5px; color: rgba(255, 255, 255, .72); }
.footer-col a:hover { color: var(--brand-3); }
.footer-bottom {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
    padding-top: 24px;
    font-size: 12.5px;
    color: rgba(255, 255, 255, .4);
}
/* 兼容旧 .foot 结构 */
.foot { border-top: 1px solid var(--line); padding: 24px 0; color: var(--ink-3); font-size: 13px; }
.foot .wrap { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- 20. 响应式 ---------- */
@media (max-width: 1080px) {
    .hero-grid { gap: 40px; }
    .hero-stats { gap: 36px; }
}

@media (max-width: 900px) {
    :root { --header-h: 64px; }

    .hero { padding: 64px 0 72px; }
    .hero-grid { grid-template-columns: 1fr; gap: 52px; }
    .hero-visual { min-height: 260px; max-width: 460px; }
    .hero-sub { font-size: 15.5px; }
    .section { padding: 64px 0; }
    .auth-split { grid-template-columns: 1fr; }
    .auth-aside { padding: 36px 32px; }
    .auth-aside h2 { font-size: 24px; }
    .auth-main { padding: 36px 28px 44px; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
    .pager { grid-template-columns: 1fr; }
    .pager-card.next { text-align: left; align-items: flex-start; }
}

@media (max-width: 860px) {
    .nav-panel {
        display: none;
        position: absolute;
        top: var(--header-h);
        left: 0; right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        padding: 12px 24px 20px;
        background: #fff;
        border-bottom: 1px solid var(--line);
        box-shadow: 0 24px 40px -30px rgba(15, 19, 23, .5);
        margin-left: 0;
    }
    .site-header.is-open .nav-panel { display: flex; }

    .nav-links { flex-direction: column; align-items: stretch; gap: 0; }
    .nav-links a { width: 100%; padding: 13px 0; font-size: 15.5px; border-bottom: 1px solid var(--line-2); }
    .nav-links a::after { display: none; }

    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding-top: 14px;
    }
    .nav-actions .btn { width: 100%; }
    .nav-actions .who { max-width: none; padding: 4px 0; }
    .nav-actions form .linkbtn { padding: 6px 0; }

    .header-inner { gap: 12px; }
    .nav-toggle { display: grid; margin-left: auto; }
    .brand { margin-right: auto; }
}

@media (max-width: 640px) {
    body { font-size: 15px; }
    .wrap { padding: 0 18px; }
    .hero { padding: 44px 0 56px; }
    .hero-title { font-size: 34px; }
    .hero-stats { gap: 24px; margin-top: 34px; }
    .hero-stats strong { font-size: 24px; }
    .hero-visual { min-height: 220px; }
    .sub-card { padding: 16px 18px; }
    .section { padding: 52px 0; }
    .section-head { margin-bottom: 30px; }
    .card { padding: 20px; border-radius: var(--radius); }
    .cat-card { padding: 22px; }
    .cat-card .cat-name { font-size: 19px; }
    .pkg-card { padding: 24px 22px; }
    .pkg-price .num { font-size: 38px; }
    .course-head { padding: 18px 20px 14px; }
    .lesson-row { padding: 13px 20px; gap: 10px; }
    .lesson-idx { display: none; }
    .page-hero { padding: 28px 0 36px; margin-bottom: 28px; }
    .profile-head { padding: 24px; }
    .tbl { font-size: 13px; }
    .tbl th, .tbl td { padding: 10px 8px; }
    .footer-grid { grid-template-columns: 1fr; gap: 28px; padding-bottom: 32px; }
    .site-footer { padding: 48px 0 24px; }
    .auth-aside { display: none; }
    .auth-split { min-height: 0; }
    .steps-row { gap: 22px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
        scroll-behavior: auto !important;
    }
}
