* { box-sizing: border-box; margin: 0; padding: 0; }

body.course-detail-page {
    font-family: "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
    background: #f3f6f9;
    color: #0f172a;
    line-height: 1.6;
}

a { color: inherit; text-decoration: none; }

:root {
    --course-brand: #16a34a;
    --course-brand-dark: #15803d;
    --course-brand-soft: #ecfdf5;
    --course-border: #e2e8f0;
    --course-muted: #64748b;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 40px;
    padding: 0 18px;
    border-radius: 10px;
    border: 1px solid transparent;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover { transform: translateY(-1px); }

.btn-lg {
    min-height: 44px;
    padding: 0 22px;
    font-size: 15px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--course-brand), #22c55e);
    color: #fff;
    box-shadow: 0 8px 20px rgba(22, 163, 74, .2);
}

.btn-outline {
    background: #fff;
    border-color: #bbf7d0;
    color: var(--course-brand-dark);
}

.btn-sm {
    min-height: 34px;
    padding: 0 14px;
    font-size: 13px;
    white-space: nowrap;
}

.btn-block { width: 100%; }

/* Hero */
.course-hero {
    position: relative;
    overflow: hidden;
    border-bottom: 1px solid #dff3e8;
    background:
        radial-gradient(circle at 70% 35%, rgba(205, 238, 216, .9) 0%, rgba(236, 248, 240, 0) 52%),
        linear-gradient(180deg, #fbfefb 0%, #eef9f2 100%);
}

.course-hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    opacity: .1;
    background-image: radial-gradient(circle, #7abf98 2px, transparent 2px);
    background-size: 18px 18px;
}

.course-hero-inner {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) min(480px, 44%);
    gap: 20px;
    align-items: center;
    padding: 20px 0 28px;
}

.course-hero-left {
    max-width: none;
    padding-right: 0;
    min-width: 0;
}

.course-hero-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 10px;
}

.course-tag {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .88);
    color: var(--course-brand-dark);
    font-size: 12px;
    font-weight: 700;
    border: 1px solid #bbf7d0;
}

.course-tag.is-soft {
    color: #475569;
    border-color: #e2e8f0;
    background: rgba(255, 255, 255, .72);
}

.course-hero-left h1 {
    font-size: clamp(24px, 2.5vw, 34px);
    line-height: 1.28;
    margin-bottom: 12px;
    max-width: 640px;
}

.course-hero-features {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    margin-bottom: 16px;
}

.course-hero-features li {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #334155;
    font-size: 13px;
}

.course-check {
    width: 16px;
    height: 16px;
    border-radius: 999px;
    background: var(--course-brand-soft);
    position: relative;
    flex-shrink: 0;
}

.course-check::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 3px;
    width: 4px;
    height: 7px;
    border: solid var(--course-brand);
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.course-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.course-hero-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.course-metric {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 38px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .86);
    border: 1px solid rgba(255, 255, 255, .9);
    box-shadow: 0 4px 14px rgba(15, 23, 42, .05);
}

.course-metric-icon {
    font-size: 14px;
    line-height: 1;
}

.course-metric strong {
    font-size: 15px;
    color: #111827;
}

.course-metric em {
    font-style: normal;
    color: var(--course-muted);
    font-size: 12px;
}

.course-hero-right {
    position: static;
    transform: none;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    max-width: none;
    min-width: 0;
    pointer-events: none;
}

.course-hero-visual {
    width: 100%;
    display: flex;
    justify-content: flex-end;
    align-items: center;
}

.course-hero-cover {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 280px;
    object-fit: contain;
    object-position: right center;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(15, 23, 42, .1);
}

.course-hero-mascot {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 240px;
    object-fit: contain;
    object-position: right center;
}

/* Breadcrumb bar */
.course-crumb-bar {
    background: #fff;
    border-bottom: 1px solid #edf2f7;
}

.course-crumb-bar .course-breadcrumb {
    margin-bottom: 0;
    padding: 12px 0;
}

.course-main {
    padding: 20px 0 72px;
}

.course-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 8px;
    color: var(--course-muted);
    font-size: 13px;
}

.course-breadcrumb a {
    color: var(--course-brand);
    font-weight: 600;
}

.course-breadcrumb .cur {
    color: #0f172a;
    font-weight: 700;
}

.course-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 288px;
    gap: 20px;
    align-items: start;
}

/* Tabs */
.course-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--course-border);
    background: #fff;
    border-radius: 14px 14px 0 0;
    padding: 0 8px;
}

.course-tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 52px;
    padding: 0 20px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent;
    color: #64748b;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    margin-bottom: -1px;
}

.course-tab.active {
    color: var(--course-brand-dark);
    border-bottom-color: var(--course-brand);
    background: transparent;
    box-shadow: none;
}

.course-panel { display: none; }
.course-panel.active { display: block; }

.course-panel-card,
.course-side-card {
    background: #fff;
    border: 1px solid var(--course-border);
    border-radius: 0 0 16px 16px;
    padding: 20px 22px 22px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .04);
}

.course-tabs + .course-panel .course-panel-card {
    border-radius: 0 0 16px 16px;
    margin-top: -1px;
}

.course-panel-card h2 {
    font-size: 18px;
    margin-bottom: 0;
}

.course-panel-head-with-action {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.course-panel-head-with-action > div {
    min-width: 0;
}

.course-panel-head-with-action .btn {
    flex-shrink: 0;
    margin-top: 2px;
}

.course-practice-more {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    text-align: center;
}

.course-metric-link {
    text-decoration: none;
    color: inherit;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.course-metric-link:hover {
    border-color: #bbf7d0;
    box-shadow: 0 8px 20px rgba(22, 163, 74, .08);
}

.course-metric-link em {
    color: var(--course-brand);
}

.course-panel-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid #f1f5f9;
}

.course-panel-head p {
    color: var(--course-muted);
    font-size: 13px;
}

/* Chapter accordion */
.course-chapter-accordion {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.course-chapter-item {
    border: 1px solid #edf2f7;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.course-chapter-head {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto 20px;
    gap: 12px;
    align-items: center;
    padding: 14px 16px;
    border: 0;
    background: #f8fafc;
    cursor: pointer;
    text-align: left;
}

.course-chapter-item.is-open .course-chapter-head {
    background: #fff;
    border-bottom: 1px solid #f1f5f9;
}

.course-chapter-no {
    display: none; /* 临时隐藏，预览无序号效果 */
    width: 44px;
    height: 44px;
    border-radius: 12px;
    place-items: center;
    background: linear-gradient(135deg, var(--course-brand), #22c55e);
    color: #fff;
    font-size: 15px;
    font-weight: 800;
}

.course-chapter-name {
    font-size: 16px;
    font-weight: 700;
    color: #111827;
    line-height: 1.4;
}

.course-chapter-meta {
    color: var(--course-muted);
    font-size: 13px;
    white-space: nowrap;
}

.course-chapter-chevron {
    width: 10px;
    height: 10px;
    border-right: 2px solid #94a3b8;
    border-bottom: 2px solid #94a3b8;
    transform: rotate(45deg);
    transition: transform .2s ease;
    margin-left: auto;
}

.course-chapter-item.is-open .course-chapter-chevron {
    transform: rotate(-135deg);
    margin-top: 4px;
}

.course-chapter-panel {
    display: none;
    padding: 8px 16px 14px;
}

.course-chapter-item.is-open .course-chapter-panel {
    display: block;
}

.course-section-item {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 14px 0;
    border-bottom: 1px solid #f1f5f9;
}

.course-section-item:last-child {
    border-bottom: 0;
    padding-bottom: 4px;
}

.course-section-main {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    min-width: 0;
}

.course-section-icon {
    width: 28px;
    height: 28px;
    margin-top: 2px;
    border-radius: 999px;
    background: var(--course-brand-soft);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--course-brand);
}

.course-section-icon svg {
    display: block;
}

.course-section-info {
    min-width: 0;
    flex: 1;
}

.course-section-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.course-section-title em {
    font-style: normal;
    color: var(--course-brand-dark);
    font-size: 13px;
    font-weight: 700;
}

.course-section-title strong {
    font-size: 15px;
    line-height: 1.45;
    color: #111827;
}

.course-section-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    margin-bottom: 8px;
    color: var(--course-muted);
    font-size: 12px;
}

.course-section-progress {
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
    max-width: 320px;
}

.course-section-progress i {
    display: block;
    width: 0;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, var(--course-brand), #22c55e);
}

.course-section-item .btn {
    width: fit-content;
    max-width: 100%;
    justify-self: end;
}

.course-section-actions-inline {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
/* Practice tab */
.course-practice-table-head,
.course-practice-row {
    display: grid;
    grid-template-columns: 72px 110px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.course-practice-table-head > div,
.course-practice-row > div {
    min-width: 0;
}

.course-practice-table-head {
    padding: 10px 0;
    border-bottom: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    font-weight: 700;
}

.course-practice-col-index {
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.course-practice-col-type {
    text-align: center;
}

.course-practice-row {
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
    color: inherit;
    text-decoration: none;
    transition: background-color .2s ease;
}

.course-practice-row:last-child {
    border-bottom: none;
}

.course-practice-row:hover {
    background: #f8fafc;
}

.course-practice-col-index {
    color: #94a3b8;
    font-size: 13px;
    font-weight: 700;
}

.course-practice-type {
    display: inline-block;
    max-width: 100%;
    padding: 4px 10px;
    border-radius: 999px;
    background: #ecfdf5;
    color: var(--course-brand);
    font-size: 12px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    vertical-align: middle;
}

.course-practice-title {
    color: #0f172a;
    font-size: 14px;
    line-height: 1.55;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.course-practice-row:hover .course-practice-title {
    color: var(--course-brand);
}

.course-practice-wrap .pager {
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    color: #475569;
    font-size: 13px;
}

.course-practice-wrap .pager-summary {
    margin: 0;
    color: #64748b;
}

.course-practice-wrap .pager-summary b {
    color: #0f172a;
    font-weight: 700;
}

.course-practice-wrap .pager-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex: 1 1 auto;
}

.course-practice-wrap .pager-btn,
.course-practice-wrap .pager-ellipsis {
    min-width: 36px;
    height: 36px;
    padding: 0 10px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    line-height: 1;
    white-space: nowrap;
    color: #334155;
    text-decoration: none;
}

.course-practice-wrap .pager-btn:hover {
    border-color: var(--course-brand);
    color: var(--course-brand);
}

.course-practice-wrap .pager-btn.cur {
    border-color: var(--course-brand);
    background: var(--course-brand);
    color: #fff;
    font-weight: 700;
}

.course-practice-wrap .pager-btn.disabled,
.course-practice-wrap .pager-btn.disabled:hover {
    color: #94a3b8;
    border-color: #e2e8f0;
    background: #f8fafc;
    cursor: not-allowed;
}

.course-practice-wrap .pager-ellipsis {
    border-color: transparent;
    background: transparent;
    min-width: 24px;
    padding: 0 4px;
    color: #94a3b8;
}

.course-practice-wrap .pager-jump {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
}

.course-practice-wrap .pager-jump-label,
.course-practice-wrap .pager-jump-unit {
    color: #64748b;
    font-size: 13px;
}

.course-practice-wrap .pager-jump-input {
    width: 52px;
    height: 36px;
    padding: 0 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    text-align: center;
    outline: none;
}

.course-practice-wrap .pager-jump-input:focus {
    border-color: var(--course-brand);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .16);
}

.course-practice-wrap .pager-jump-btn {
    height: 36px;
    padding: 0 14px;
    border: 1px solid var(--course-brand);
    border-radius: 8px;
    background: var(--course-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}

.course-practice-wrap .pager-jump-btn:hover {
    background: var(--course-brand-dark);
    border-color: var(--course-brand-dark);
}

.course-paper-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.course-paper-card {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 16px;
    border-radius: 14px;
    background: #f8fafc;
    border: 1px solid #edf2f7;
}

.course-paper-no {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--course-brand), #22c55e);
    color: #fff;
    font-weight: 800;
}

.course-paper-body h3 {
    font-size: 15px;
    margin-bottom: 4px;
}

.course-paper-body p {
    color: var(--course-muted);
    font-size: 13px;
}

.course-empty {
    padding: 36px 0;
    text-align: center;
    color: var(--course-muted);
}

/* Sidebar */
.course-sidebar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    position: sticky;
    top: 102px;
}

.course-sidebar .course-side-card {
    border-radius: 16px;
    padding: 18px 16px;
}

.course-side-title {
    font-size: 17px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 14px;
}

.course-side-sub {
    color: var(--course-muted);
    font-size: 13px;
    margin: 0 0 14px;
    line-height: 1.5;
}

.course-side-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 14px;
}

.course-side-head .course-side-title {
    margin-bottom: 0;
}

.course-service-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.course-service-link {
    width: 100%;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) 16px;
    gap: 10px;
    align-items: center;
    padding: 10px 8px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    color: inherit;
    transition: background .15s ease;
}

.course-service-link:hover {
    background: #f8fafc;
}

.course-service-icon {
    width: 40px;
    height: 40px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: var(--course-brand-soft);
    color: var(--course-brand-dark);
}

.course-service-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.course-service-text strong {
    font-size: 14px;
    color: #111827;
    line-height: 1.35;
}

.course-service-text em {
    font-style: normal;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.45;
}

.course-service-arrow {
    color: #cbd5e1;
    font-size: 20px;
    line-height: 1;
    text-align: right;
}

.course-side-wxapp-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    text-align: center;
}

.course-side-qr {
    width: 120px;
    max-width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--course-border);
    background: #fff;
    flex-shrink: 0;
}

.course-wxapp-modal-qr {
    width: min(220px, 100%);
    margin: 0 auto;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--course-border);
    background: #fff;
}

.course-side-wxapp-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.course-side-wxapp-copy strong {
    font-size: 15px;
    color: #111827;
    line-height: 1.4;
}

.course-side-wxapp-copy span {
    font-size: 13px;
    color: var(--course-muted);
    line-height: 1.5;
}

.course-side-wxapp-copy .btn {
    width: 100%;
    margin-top: 4px;
}

.course-side-qr img,
.course-wxapp-modal-qr img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-related-refresh {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    font-size: 12px;
    cursor: pointer;
    padding: 4px 0;
}

.course-related-refresh:hover {
    color: var(--course-brand-dark);
}

.course-related-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.course-related-item {
    display: grid;
    grid-template-columns: 72px minmax(0, 1fr);
    gap: 12px;
    padding: 12px 10px;
    border-radius: 12px;
    border: 1px solid #edf2f7;
    background: #f8fafc;
    transition: border-color .15s ease, transform .15s ease;
}

.course-related-item.is-hidden {
    display: none;
}

.course-related-item:hover {
    border-color: #bbf7d0;
    transform: translateY(-1px);
}

.course-related-cover {
    width: 72px;
    height: 88px;
    border-radius: 10px;
    overflow: hidden;
    background: var(--course-brand-soft);
    display: grid;
    place-items: center;
    color: var(--course-brand-dark);
    font-weight: 800;
}

.course-related-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.course-related-body {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.course-related-body strong {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    line-height: 1.45;
    color: #111827;
}

.course-related-learn {
    font-size: 12px;
    color: var(--course-muted);
}

/* Modal */
.course-wxapp-modal {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: grid;
    place-items: center;
    padding: 20px;
}

.course-wxapp-modal[hidden] { display: none; }

.course-wxapp-modal-mask {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .48);
}

.course-wxapp-modal-panel {
    position: relative;
    z-index: 1;
    width: min(360px, 100%);
    padding: 28px 24px 24px;
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 24px 48px rgba(15, 23, 42, .18);
    text-align: center;
}

.course-wxapp-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.course-wxapp-modal-panel h3 {
    font-size: 20px;
    margin-bottom: 8px;
}

.course-wxapp-modal-panel p {
    color: var(--course-muted);
    font-size: 14px;
    margin-bottom: 16px;
}

.course-not-found-main {
    display: grid;
    place-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
}

.course-not-found-card {
    position: relative;
    width: min(820px, 100%);
    overflow: hidden;
    padding: 54px 44px 42px;
    border-radius: 28px;
    background:
        radial-gradient(circle at 18% 12%, rgba(34, 197, 94, .14), transparent 30%),
        radial-gradient(circle at 90% 18%, rgba(59, 130, 246, .10), transparent 28%),
        #fff;
    border: 1px solid var(--course-border);
    text-align: center;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .10);
}

.course-not-found-card::before {
    content: "";
    position: absolute;
    inset: auto -80px -120px auto;
    width: 240px;
    height: 240px;
    border-radius: 999px;
    background: rgba(22, 163, 74, .08);
    pointer-events: none;
}

.course-not-found-visual {
    position: relative;
    width: 150px;
    height: 150px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
}

.course-not-found-visual::before {
    content: "";
    position: absolute;
    inset: 18px;
    border-radius: 34px;
    background: linear-gradient(135deg, var(--course-brand), #22c55e);
    box-shadow: 0 18px 38px rgba(22, 163, 74, .24);
    transform: rotate(8deg);
}

.course-not-found-visual strong {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 34px;
    letter-spacing: .04em;
}

.course-not-found-orbit {
    position: absolute;
    inset: 0;
    border-radius: 999px;
    border: 1px dashed rgba(22, 163, 74, .45);
}

.course-not-found-orbit::after {
    content: "";
    position: absolute;
    top: 16px;
    right: 20px;
    width: 12px;
    height: 12px;
    border-radius: 999px;
    background: #22c55e;
    box-shadow: 0 0 0 8px rgba(34, 197, 94, .12);
}

.course-not-found-eyebrow {
    margin-bottom: 8px;
    color: var(--course-brand);
    font-size: 13px;
    font-weight: 800;
}

.course-not-found-card h1 {
    margin-bottom: 10px;
    font-size: 34px;
    line-height: 1.2;
}

.course-not-found-desc {
    max-width: 640px;
    margin: 0 auto;
    color: var(--course-muted);
    font-size: 15px;
    line-height: 1.8;
}

.course-not-found-ref {
    margin-top: 10px;
    color: var(--course-muted);
    font-size: 13px;
}

.course-not-found-search {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    max-width: 560px;
    margin: 26px auto 0;
}

.course-not-found-search input {
    height: 46px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
}

.course-not-found-search input:focus {
    border-color: var(--course-brand);
    box-shadow: 0 0 0 3px rgba(22, 163, 74, .12);
}

.course-not-found-search button {
    height: 46px;
    padding: 0 20px;
    border: 1px solid var(--course-brand);
    border-radius: 12px;
    background: var(--course-brand);
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.course-not-found-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.course-not-found-links {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 22px;
}

.course-not-found-links a {
    padding: 7px 12px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
}

.course-not-found-links a:hover {
    border-color: #bbf7d0;
    color: var(--course-brand);
}

@media (max-width: 1080px) {
    .course-hero-inner {
        grid-template-columns: 1fr;
    }

    .course-hero-left {
        max-width: none;
        padding-right: 0;
    }

    .course-hero-right {
        width: 100%;
        margin-top: 16px;
        pointer-events: auto;
    }

    .course-hero-visual {
        justify-content: center;
    }

    .course-hero-cover {
        max-width: min(320px, 88vw);
        max-height: 220px;
        border-radius: 14px;
    }

    .course-layout {
        grid-template-columns: 1fr;
    }

    .course-sidebar {
        position: static;
    }
}

@media (max-width: 720px) {
    .course-not-found-main {
        padding-top: 12px;
        padding-bottom: 12px;
    }

    .course-not-found-card {
        padding: 38px 18px 30px;
        border-radius: 20px;
    }

    .course-not-found-visual {
        width: 118px;
        height: 118px;
        margin-bottom: 18px;
    }

    .course-not-found-visual strong {
        font-size: 28px;
    }

    .course-not-found-card h1 {
        font-size: 28px;
    }

    .course-not-found-search {
        grid-template-columns: 1fr;
    }

    .course-not-found-search button,
    .course-not-found-search input {
        width: 100%;
    }

    .course-hero-inner {
        padding: 16px 0 18px;
    }

    .course-hero-metrics {
        gap: 8px;
    }

    .course-metric {
        min-height: 34px;
        padding: 0 10px;
    }

    .course-chapter-head {
        grid-template-columns: minmax(0, 1fr) 18px;
    }

    .course-chapter-meta {
        grid-column: 1;
        margin-top: -4px;
        font-size: 12px;
    }

    .course-practice-table-head {
        display: none;
    }

    .course-practice-row {
        grid-template-columns: 40px minmax(0, 1fr);
        grid-template-areas:
            "index type"
            "title title";
        align-items: start;
        gap: 8px 10px;
        padding: 12px 0;
    }

    .course-practice-col-index {
        grid-area: index;
        text-align: left;
    }

    .course-practice-col-type {
        grid-area: type;
        text-align: right;
    }

    .course-practice-col-title {
        grid-area: title;
    }

    .course-practice-title {
        -webkit-line-clamp: 3;
        font-size: 15px;
    }

    .course-practice-wrap .pager {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .course-practice-wrap .pager-summary {
        text-align: center;
    }

    .course-practice-wrap .pager-nav {
        justify-content: center;
    }

    .course-practice-wrap .pager-jump {
        justify-content: center;
        flex-wrap: wrap;
    }

    .course-section-item,
    .course-paper-card {
        grid-template-columns: 1fr;
    }

    .course-section-item .btn,
    .course-paper-card .btn {
        justify-self: start;
    }
}

/* 404 页：限制在一屏内，不出现页面滚动条 */
html:has(body.course-not-found-page),
body.course-not-found-page {
    height: 100%;
    overflow: hidden;
}

body.course-not-found-page .site-page {
    height: 100vh;
    max-height: 100vh;
    min-height: 0;
    overflow: hidden;
}

body.course-not-found-page .site-page__content {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body.course-not-found-page .course-main.course-not-found-main {
    flex: 1 1 auto;
    min-height: 0;
    padding: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.course-not-found-page .course-not-found-card {
    max-height: 100%;
    overflow: hidden;
    padding: clamp(22px, 3.5vh, 48px) clamp(18px, 4vw, 44px) clamp(18px, 3vh, 36px);
}

body.course-not-found-page .course-not-found-visual {
    width: clamp(96px, 16vh, 140px);
    height: clamp(96px, 16vh, 140px);
    margin-bottom: clamp(10px, 1.8vh, 20px);
}

body.course-not-found-page .course-not-found-visual strong {
    font-size: clamp(26px, 4vh, 34px);
}

body.course-not-found-page .course-not-found-card h1 {
    font-size: clamp(24px, 4.2vh, 34px);
    margin-bottom: clamp(6px, 1vh, 10px);
}

body.course-not-found-page .course-not-found-desc {
    font-size: clamp(13px, 2vh, 15px);
    line-height: 1.65;
}

body.course-not-found-page .course-not-found-search {
    margin-top: clamp(12px, 2vh, 22px);
}

body.course-not-found-page .course-not-found-actions {
    margin-top: clamp(12px, 2vh, 20px);
}

body.course-not-found-page .course-not-found-links {
    margin-top: clamp(10px, 1.8vh, 18px);
}

@media (max-height: 760px) {
    body.course-not-found-page .st-footer-simple {
        padding: 16px 12px 18px;
    }

    body.course-not-found-page .course-not-found-search input,
    body.course-not-found-page .course-not-found-search button {
        height: 40px;
    }
}

@media (max-height: 640px) {
    body.course-not-found-page .course-not-found-links {
        display: none;
    }

    body.course-not-found-page .course-not-found-desc {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        overflow: hidden;
    }
}
