:root {
    --bg: #f1f5f9;
    --card: #ffffff;
    --card-strong: #ffffff;
    --text: #1e293b;
    --muted: #64748b;
    --line: rgba(30, 41, 59, 0.08);
    --line-strong: rgba(30, 41, 59, 0.16);

    /* 主题色保留 */
    --brand: #92400e;
    --brand-soft: #fef3c7;
    --brand-soft-2: #fffbeb;
    --accent: #b45309;
    --warm: #d97706;
    --ok: #15803d;
    --warn: #92400e;

    /* 侧栏深棕（新增） */
    --sidebar-bg: #1f140c;
    --sidebar-text: #f5e9d6;
    --sidebar-muted: rgba(245, 233, 214, 0.55);
    --sidebar-hover: rgba(245, 233, 214, 0.06);
    --sidebar-active: #92400e;
    --sidebar-divider: rgba(245, 233, 214, 0.08);

    /* 阴影减弱（更系统化、更克制） */
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    --shadow-soft: 0 1px 1px rgba(0, 0, 0, 0.03);

    /* 布局尺寸 */
    --sidebar-width: 232px;
    --topbar-height: 56px;
    --content-max-width: 1400px;

    --bs-primary: #b45309;
    --bs-primary-rgb: 180, 83, 9;
    --bs-dark: #1e293b;
    --bs-dark-rgb: 30, 41, 59;
    --bs-btn-border-radius: 8px;
    --bs-btn-border-radius-lg: 10px;
    --bs-btn-border-radius-sm: 6px;
}

/* Typographic scale */
:root {
    --text-hero: 2.5rem;
    --text-h1: 1.75rem;
    --text-h2: 1.35rem;
    --text-h3: 1.1rem;
    --text-h4: 1rem;
    --text-body: 0.95rem;
    --text-small: 0.875rem;
    --text-xs: 0.8rem;
    --text-2xs: 0.75rem;
    --weight-heavy: 800;
    --weight-bold: 700;
    --weight-semibold: 600;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ===== Heading hierarchy ===== */
h1 { font-size: var(--text-h1); font-weight: var(--weight-heavy); line-height: 1.25; }
h2 { font-size: var(--text-h2); font-weight: var(--weight-heavy); line-height: 1.3; }
h3 { font-size: var(--text-h3); font-weight: var(--weight-bold); line-height: 1.35; }
h4 { font-size: var(--text-h4); font-weight: var(--weight-semibold); line-height: 1.4; }
h5 { font-size: var(--text-body); font-weight: var(--weight-semibold); line-height: 1.45; }
h6 { font-size: var(--text-small); font-weight: var(--weight-semibold); line-height: 1.5; }

h1, h2, h3, h4, h5, h6 { margin: 0; }

p { margin: 0 0 0.75em; line-height: 1.7; }
small { font-size: var(--text-small); color: var(--muted); }

.page-shell {
    min-height: 100vh;
    position: relative;
}

.ambient {
    display: none;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    backdrop-filter: blur(16px);
    background: #ffffff;
    border-bottom: 1px solid var(--line);
}

.header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 1rem 0;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.9rem;
    text-decoration: none;
    color: var(--text);
}

.brand-mark strong {
    display: block;
    font-size: 1.04rem;
    letter-spacing: -0.02em;
    font-weight: 700;
}

.brand-badge {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    /* background: linear-gradient(145deg, #92400e 0%, #b45309 100%); */
    box-shadow: none;
}

.brand-badge svg {
    width: 31px;
    height: 31px;
    display: block;
}

.main-nav {
    display: inline-flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.main-nav a {
    text-decoration: none;
    color: var(--muted);
    padding: 0.5rem 0;
    font-weight: 600;
    font-size: 0.92rem;
    position: relative;
    transition: color 180ms ease;
}

.main-nav a:hover {
    color: var(--text);
}

.main-nav a.active {
    color: var(--brand);
}

.main-nav a.active::after {
    content: "";
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--brand);
    border-radius: 1px;
}

.quick-create {
    border: 0;
    text-decoration: none;
    padding: 0.6rem 1rem;
    border-radius: 8px;
    background: var(--brand);
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 180ms ease;
}

.quick-create:hover {
    background: var(--accent);
}

.user-menu {
    flex-shrink: 0;
}

.user-menu-toggle {
    min-width: 8.5rem;
}

.user-menu-panel {
    min-width: 220px;
    padding: 0.55rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
}

.user-menu-meta {
    padding: 0.7rem 0.85rem 0.8rem;
    border-bottom: 1px solid var(--line);
    margin-bottom: 0.35rem;
}

.user-menu-meta strong,
.user-menu-meta span {
    display: block;
}

.user-menu-meta span {
    margin-top: 0.2rem;
    color: var(--muted);
    font-size: 0.84rem;
}

.user-menu-panel .dropdown-item {
    border-radius: 12px;
    font-weight: 700;
    padding: 0.72rem 0.85rem;
}

.auth-shell {
    min-height: min(680px, calc(100vh - 190px));
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(360px, 0.72fr);
    gap: 2rem;
    align-items: center;
}

.auth-brief {
    padding: clamp(1.2rem, 3vw, 3rem);
}

.auth-brief h1 {
    margin: 0.75rem 0 1rem;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: clamp(2.2rem, 5vw, 4.3rem);
    line-height: 1.08;
    font-weight: 900;
}

.auth-brief p {
    max-width: 680px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.9;
}

.auth-points {
    display: grid;
    gap: 0.8rem;
    margin-top: 1.5rem;
    max-width: 640px;
}

.auth-points div {
    padding: 1rem 1.1rem;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--line);
}

.auth-points strong,
.auth-points span {
    display: block;
}

.auth-points span {
    margin-top: 0.25rem;
    color: var(--muted);
}

.auth-card {
    width: 100%;
}

.page-main {
    position: relative;
    z-index: 1;
}

.hero-panel,
.sub-hero,
.panel-card,
.report-paper,
.workflow-band {
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
    border-radius: 12px;
}

.hero-panel {
    padding: 2.2rem;
}

.hero-panel-upgraded {
    background: var(--card);
}

.sub-hero {
    padding: 1.6rem 1.8rem;
}

.page-intro {
    margin-bottom: 1.15rem;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.page-intro-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
}

.page-intro-copy {
    min-width: 0;
}

.page-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.32rem 0.68rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.06);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.page-intro h1 {
    margin: 0.55rem 0 0.3rem;
    font-size: clamp(1.6rem, 2.5vw, 2.1rem);
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.page-intro p {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.page-meta-strip {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.page-meta-strip span {
    display: inline-flex;
    align-items: center;
    padding: 0.36rem 0.68rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.05);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 600;
}

.hero-title,
.poster-title,
.sub-hero h1 {
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: clamp(2rem, 4vw, 3.5rem);
    line-height: 1.05;
    margin: 0.35rem 0 1rem;
    font-weight: 900;
    letter-spacing: -0.04em;
}

.hero-subtitle,
.sub-hero p,
.section-head p,
.tip-text,
.report-timeline p,
.report-timeline small {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.85rem;
    font-weight: 700;
}

.hero-actions,
.course-actions,
.headline-actions {
    display: flex;
    gap: 0.8rem;
    flex-wrap: wrap;
}

.poster-hero {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) 420px;
    gap: 1.5rem;
    padding: 2rem;
    border-radius: 12px;
    background: var(--card);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.poster-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(120deg, transparent 0 55%, rgba(180, 83, 9, 0.03) 55% 100%);
    pointer-events: none;
}

.poster-copy,
.poster-stage {
    position: relative;
    z-index: 1;
}

.poster-subtitle {
    max-width: 54rem;
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.8;
}

.evidence-strip {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.9rem;
}

.evidence-item {
    padding: 1rem 1.05rem;
    border-radius: 12px;
    background: rgba(255,255,255,0.78);
    border: 1px solid var(--line);
}

.evidence-item span,
.stage-metrics span,
.soft-note,
.template-ribbon span {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.evidence-item strong {
    display: block;
    margin: 0.35rem 0 0.15rem;
    font-size: 1.7rem;
    font-weight: 800;
}

.evidence-link {
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.evidence-link:hover {
    transform: translateY(-2px);
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 12px 26px -16px rgba(0, 0, 0, 0.25);
}

.workflow-guide {
    list-style: none;
    counter-reset: workflow-step;
    padding: 0;
    margin: 0.5rem 0 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.workflow-guide li {
    counter-increment: workflow-step;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.65rem 0.85rem;
    border-radius: 12px;
    background: var(--surface-soft, #f7f8fa);
    border: 1px solid var(--line);
}

.workflow-guide li::before {
    content: counter(workflow-step);
    flex: 0 0 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--ink-strong, #92400e);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.workflow-guide li strong {
    display: block;
    font-size: 0.95rem;
    line-height: 1.25;
}

.workflow-guide li span {
    display: block;
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 0.1rem;
}

.poster-stage {
    padding: 1.45rem;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(160deg, #92400e, #b45309);
}

.poster-stage-head {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.poster-stage-head h2 {
    margin: 0.7rem 0 0.2rem;
    font-family: "Songti SC", "STSong", "SimSun", serif;
    font-size: 1.5rem;
    font-weight: 800;
}

.poster-stage-head p {
    color: rgba(255,255,255,0.75);
    margin-bottom: 0;
}

.template-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    margin: 1.25rem 0;
}

.template-ribbon span {
    padding: 0.48rem 0.7rem;
    border-radius: 999px;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.85);
}

.next-step-note {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.08);
    margin-top: 1rem;
    color: #fef7f0;
}

.next-step-note span {
    color: rgba(255, 255, 255, 0.68);
    font-size: 0.84rem;
}

.next-step-note strong {
    font-size: 0.98rem;
    font-weight: 800;
}

.stage-metrics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.stage-metrics div {
    padding: 0.95rem 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.08);
}

.stage-metrics strong {
    display: block;
    margin-top: 0.3rem;
    font-weight: 800;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
}

.hero-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.9rem;
    margin-top: 1.75rem;
}

.hero-strip-item {
    padding: 1rem 1.1rem;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.74);
    border: 1px solid var(--line);
}

.hero-strip-item span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.35rem;
}

.hero-strip-item strong {
    font-size: 1.7rem;
    line-height: 1;
    font-weight: 800;
}

.hero-focus-card {
    height: 100%;
    padding: 1.6rem;
    border-radius: 12px;
    background: #1e293b;
    color: #fff;
    box-shadow: var(--shadow);
}

.focus-top {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.focus-top h2 {
    margin: 0.6rem 0 0.25rem;
    font-size: 1.35rem;
    font-weight: 800;
}

.focus-top p {
    color: rgba(255,255,255,0.65);
    margin-bottom: 0;
}

.focus-progress,
.mini-stage-track {
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.focus-progress {
    margin: 1.3rem 0;
}

.stage-pill,
.mini-stage-track span {
    padding: 0.48rem 0.72rem;
    border-radius: 999px;
    font-size: 0.84rem;
    font-weight: 700;
    border: 1px solid rgba(255,255,255,0.12);
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.72);
}

.stage-pill.done,
.mini-stage-track span.done {
    background: rgba(21, 128, 61, 0.22);
    color: #d8fee4;
    border-color: rgba(125, 255, 171, 0.18);
}

.focus-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.focus-grid div {
    padding: 1rem;
    border-radius: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.09);
}

.focus-grid span {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 0.84rem;
    margin-bottom: 0.35rem;
}

.focus-grid strong {
    font-weight: 800;
    font-size: 1.05rem;
}

.workflow-band {
    padding: 1.6rem 1.7rem;
}

.workflow-band-strong {
    background: var(--card);
}

.workflow-steps {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0.9rem;
}

.workflow-step {
    padding: 1rem;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.78);
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.workflow-step.current {
    background: #92400e;
    color: #fff;
    border-color: #92400e;
}

.workflow-step span {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: rgba(180, 83, 9, 0.08);
    font-weight: 800;
}

.workflow-step.current span {
    background: rgba(255,255,255,0.14);
}

.workflow-step strong {
    font-size: 1rem;
}

.workflow-step small {
    color: var(--muted);
}

.workflow-step.current small {
    color: rgba(255,255,255,0.72);
}

.section-head {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.section-head h2,
.panel-card h2 {
    margin: 0;
    font-weight: 800;
}

.section-kicker {
    display: inline-flex;
    align-items: center;
    padding: 0.55rem 0.8rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.08);
    font-size: 0.88rem;
    font-weight: 700;
}

.panel-card {
    padding: 1.5rem;
}

.soft-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.65rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.06);
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
}

.course-stream {
    display: grid;
    gap: 1rem;
}

.compact-action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.compact-action-bar strong {
    display: block;
    margin-bottom: 0.2rem;
}

.course-directory,
.report-center-grid {
    display: grid;
    gap: 1rem;
}

.directory-card,
.report-record-card {
    padding: 1.35rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow-soft);
}

.directory-card-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.directory-card-info {
    flex: 1;
    min-width: 0;
}

.directory-card-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
    min-width: 120px;
}

.directory-card-actions .btn {
    white-space: nowrap;
    text-align: center;
}

@media (max-width: 767.98px) {
    .directory-card-layout {
        flex-direction: column;
        gap: 1rem;
    }

    .directory-card-actions {
        flex-direction: row;
        flex-wrap: wrap;
        min-width: 0;
    }
}

.directory-card h2,
.report-record-card h2 {
    margin: 0 0 0.15rem;
    font-size: 1.25rem;
    font-weight: 800;
}

.directory-head p {
    margin: 0.35rem 0 0;
    color: var(--muted);
}

.directory-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 1rem 0;
}

.directory-meta span {
    padding: 0.4rem 0.74rem;
    border-radius: 999px;
    background: rgba(180, 83, 9, 0.05);
    color: var(--muted);
    font-size: 0.86rem;
}

.directory-bottom {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: end;
    flex-wrap: wrap;
}

.directory-next {
    display: grid;
    gap: 0.25rem;
}

.directory-next span {
    color: var(--muted);
    font-size: 0.82rem;
}

.directory-next strong {
    font-size: 1rem;
    font-weight: 800;
}

.step-card:hover,
.simple-card:hover,
.objective-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 36px rgba(180, 83, 9, 0.08);
}

.focus-top,
.headline-main {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: start;
}

.headline-main {
    align-items: end;
}

.course-meta-list span {
    padding: 0.4rem 0.7rem;
    border-radius: 999px;
    background: rgba(15,23,42,0.05);
    font-size: 0.86rem;
    color: var(--muted);
}

.course-actions.compact {
    margin-top: 1rem;
}

.report-timeline {
    display: grid;
    gap: 1rem;
}

.timeline-item {
    display: grid;
    grid-template-columns: 14px 1fr;
    gap: 0.9rem;
    align-items: start;
}

.timeline-dot {
    width: 14px;
    height: 14px;
    margin-top: 0.45rem;
    border-radius: 50%;
    background: #cbd5e1;
    box-shadow: 0 0 0 6px rgba(180, 83, 9, 0.05);
}

.timeline-dot.ok {
    background: var(--ok);
}

.timeline-dot.pending {
    background: var(--warm);
}

.insight-note {
    margin-top: 1.3rem;
    padding: 1rem 1.1rem;
    border-radius: 10px;
    background: rgba(180, 83, 9, 0.06);
}

.insight-loading-hint {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    margin-top: 0.85rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.9rem;
}

.insight-spinner {
    width: 1rem;
    height: 1rem;
    border-radius: 50%;
    border: 2px solid rgba(180, 83, 9, 0.25);
    border-top-color: #b45309;
    animation: insight-spin 0.8s linear infinite;
}

@keyframes insight-spin {
    to { transform: rotate(360deg); }
}

.accent-note {
    background: var(--brand-soft);
}

.metric-card {
    padding: 1.2rem 1.3rem;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--line);
}

.metric-card span {
    display: block;
    color: var(--muted);
    font-size: 0.92rem;
    margin-bottom: 0.45rem;
}

.metric-card strong {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.metric-card.solid {
    height: 100%;
}

.metric-ok strong {
    color: var(--ok);
}

.metric-warn strong {
    color: var(--warm);
}

.chip,
.status-pill,
.weight-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.85rem;
}

.chip-sample {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
}

.status-pill.ok {
    background: rgba(21, 128, 61, 0.12);
    color: var(--ok);
}

.status-pill.pending {
    background: rgba(154, 52, 18, 0.12);
    color: var(--warn);
}

.weight-badge {
    background: rgba(180, 83, 9, 0.08);
}

.course-tabs {
    display: flex;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.course-nav-shell {
    display: grid;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.course-tabs a {
    text-decoration: none;
    padding: 0.55rem 1rem;
    border-radius: 8px;
    color: var(--muted);
    border: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.9rem;
    transition: color 180ms ease, border-color 180ms ease;
}

.course-tabs a:hover {
    color: var(--text);
    border-color: var(--line-strong);
}

.course-tabs a.active {
    color: var(--brand);
    border-color: var(--brand);
    background: var(--brand-soft);
}

.course-tools-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    align-items: center;
}

.course-tools-row span {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.course-tools-row a {
    text-decoration: none;
    padding: 0.55rem 0.85rem;
    border-radius: 999px;
    background: rgba(15,23,42,0.05);
    border: 1px dashed var(--line-strong);
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.course-tools-row a.active {
    color: #fff;
    background: var(--accent);
    border-style: solid;
    border-color: rgba(217, 119, 6, 0.4);
}

.ops-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
}

.ops-progress {
    display: grid;
    gap: 0.85rem;
}

.ops-progress-item {
    display: flex;
    gap: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 10px;
    background: rgba(180, 83, 9, 0.04);
    border: 1px solid var(--line);
}

.ops-progress-item.done {
    background: rgba(217, 119, 6, 0.08);
}

.ops-progress-item span {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.72);
    font-weight: 800;
}

.ops-progress-item small {
    display: block;
    color: var(--muted);
}

.ops-grid,
.step-grid,
.stack-grid,
.mini-stats,
.info-grid,
.focus-grid,
.insight-grid,
.source-legend-grid {
    display: grid;
    gap: 1rem;
}

.ops-grid,
.step-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mini-stats,
.info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
}

.insight-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.source-legend-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step-card,
.simple-card,
.objective-card,
.tip-panel,
.empty-panel {
    display: block;
    padding: 1.2rem;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--line);
    text-decoration: none;
    color: inherit;
    transition: box-shadow 180ms ease, border-color 180ms ease;
}

.manual-objective-accordion {
    margin-bottom: 1rem;
    border: 1px dashed var(--line);
    border-radius: 10px;
    background: var(--card);
}

.manual-objective-accordion > summary {
    list-style: none;
    cursor: pointer;
    padding: 0.85rem 1.1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.manual-objective-accordion > summary::-webkit-details-marker {
    display: none;
}

.manual-objective-accordion > summary::before {
    content: "▸";
    color: var(--muted);
    transition: transform 180ms ease;
}

.manual-objective-accordion[open] > summary::before {
    transform: rotate(90deg);
}

.manual-objective-accordion > summary > span {
    font-weight: 600;
    font-size: 0.95rem;
}

.manual-objective-accordion > summary > small {
    color: var(--muted);
    font-size: 0.82rem;
}

.manual-objective-body {
    padding: 0 1.1rem 1rem;
}

.empty-panel.dark {
    background: rgba(255,255,255,0.06);
    border-color: rgba(255,255,255,0.08);
    color: #fef7f0;
}

.step-card span:first-child {
    display: inline-flex;
    width: 38px;
    height: 38px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    background: var(--brand-soft);
    color: var(--brand);
    font-weight: 700;
    margin-bottom: 0.85rem;
}

.step-card strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
}

.mini-stats div,
.info-grid div,
.insight-tile {
    padding: 0.95rem 1rem;
    border-radius: 10px;
    background: var(--card);
    border: 1px solid var(--line);
}

.mini-stats span,
.info-grid span,
.insight-tile span,
.objective-meta span {
    display: block;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 0.28rem;
}

.mini-stats strong,
.info-grid strong,
.insight-tile strong,
.objective-meta strong {
    font-weight: 800;
}

.insight-tile.accent {
    background: var(--brand-soft);
}

.insight-tile small {
    color: var(--muted);
}

.insight-card {
    font-size: 0.95rem;
    line-height: 1.7;
}

.ai-overview-panel p:last-child {
    margin-bottom: 0;
}

.objective-ai-card p,
.improvement-action-card p {
    line-height: 1.72;
}

.ai-evidence-list li {
    line-height: 1.62;
}

.improvement-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.8rem;
    margin-bottom: 0.9rem;
}

.priority-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.38rem 0.7rem;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 800;
}

.priority-pill.priority-high {
    background: rgba(220, 38, 38, 0.08);
    color: #b91c1c;
}

.priority-pill.priority-mid {
    background: rgba(180, 83, 9, 0.08);
    color: #92400e;
}

.priority-pill.priority-low {
    background: rgba(21, 128, 61, 0.08);
    color: #15803d;
}

.priority-pill.priority-mid {
    background: rgba(180, 83, 9, 0.14);
    color: #92400e;
}

.priority-pill.priority-low {
    background: rgba(217, 119, 6, 0.14);
    color: #d97706;
}

.flow-list,
.plain-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
}

.flow-item {
    list-style: none;
    display: grid;
    grid-template-columns: 4.6rem minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.plain-list li {
    list-style: none;
    display: flex;
    gap: 0.9rem;
    align-items: start;
}

.flow-item strong {
    width: 4.6rem;
    min-width: 4.6rem;
    height: 4.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 1rem;
    background: rgba(180, 83, 9, 0.08);
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1;
}

.flow-item span {
    display: block;
    padding-top: 0.15rem;
    line-height: 1.65;
}

.create-note {
    margin-top: 1.35rem;
    padding: 1rem 1.05rem;
    border-radius: 10px;
    background: var(--brand-soft-2);
    border: 1px solid var(--line);
}

.create-note span {
    display: block;
    color: var(--muted);
    font-size: 0.84rem;
    margin-bottom: 0.3rem;
}

.create-note strong {
    font-size: 0.98rem;
    line-height: 1.65;
}

.source-note {
    margin-bottom: 1rem;
    padding: 0.95rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--card);
}

.source-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.55rem;
    margin-bottom: 0.65rem;
}

.source-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.34rem 0.68rem;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 800;
}

.source-badge.source-direct {
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
}

.source-badge.source-manual {
    background: rgba(71, 85, 105, 0.12);
    color: #475569;
}

.source-badge.source-computed {
    background: rgba(217, 119, 6, 0.14);
    color: #d97706;
}

.source-badge.source-ai {
    background: rgba(245, 158, 11, 0.14);
    color: #d97706;
}

.source-note p {
    color: var(--muted);
    line-height: 1.7;
}

.calculation-panel {
    background: var(--card);
}

.calculation-overview-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.calculation-card {
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.78);
}

.calculation-card span,
.calculation-step summary span {
    color: var(--muted);
    font-weight: 800;
}

.calculation-card strong {
    display: block;
    margin: 0.3rem 0 0.55rem;
    font-size: 2rem;
    line-height: 1;
    letter-spacing: -0.04em;
}

.calculation-card p,
.calculation-step p {
    margin: 0 0 0.55rem;
    color: var(--text);
    line-height: 1.75;
}

.calculation-card small {
    display: block;
    color: var(--muted);
    line-height: 1.65;
}

.calculation-section {
    margin-top: 1.1rem;
    padding-top: 1.1rem;
    border-top: 1px solid var(--line);
}

.calculation-section h3 {
    margin: 0 0 0.45rem;
    font-weight: 800;
}

.calculation-section h4 {
    margin: 0.2rem 0 0.8rem;
    color: var(--muted);
    font-size: 1rem;
    font-weight: 700;
}

.calculation-section > p {
    margin: 0 0 0.9rem;
    color: var(--muted);
    line-height: 1.75;
}

.calculation-step {
    margin-bottom: 0.8rem;
    padding: 0.95rem 1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.72);
}

.calculation-step.compact {
    padding: 0.85rem 0.9rem;
}

.calculation-step summary {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    list-style: none;
}

.calculation-step summary::-webkit-details-marker {
    display: none;
}

.calculation-step summary strong {
    padding: 0.28rem 0.62rem;
    border-radius: 6px;
    background: var(--brand-soft);
    color: var(--brand);
    white-space: nowrap;
    font-weight: 700;
}

.calculation-step[open] summary {
    margin-bottom: 0.7rem;
}

.calculation-step .plain-list {
    padding: 0;
    margin: 0.65rem 0 0;
    gap: 0.45rem;
}

.calculation-step .plain-list li {
    padding: 0.55rem 0.65rem;
    border-radius: 12px;
    background: rgba(180, 83, 9, 0.035);
    line-height: 1.65;
}

.calculation-two-col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.calculation-result-line {
    padding: 0.65rem 0.75rem;
    border-radius: 8px;
    background: var(--brand-soft);
    color: var(--brand) !important;
    font-weight: 700;
}

.plain-list.ordered {
    padding-left: 1.2rem;
}

.plain-list.ordered li {
    list-style: decimal;
    display: list-item;
}

.objective-meta {
    display: grid;
    gap: 0.8rem;
    grid-template-columns: 1fr;
}

.modern-table thead th {
    color: var(--muted);
    font-size: 0.86rem;
    font-weight: 700;
    border-bottom-color: var(--line);
}

.modern-table tbody td,
.modern-table tbody th {
    border-color: var(--line);
    vertical-align: middle;
}

.chart-box {
    height: 360px;
}

.chart-box-short {
    height: 300px;
}

.report-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 1.5rem;
    align-items: start;
}

.report-paper {
    padding: 2rem;
}

.elevated-report {
    background: var(--card);
}

.report-header {
    padding-bottom: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.report-header span {
    color: var(--muted);
    font-weight: 700;
}

.report-header h2 {
    margin: 0.5rem 0;
    font-size: 1.75rem;
    font-weight: 800;
}

.report-subtitle {
    margin: 1rem 0 0.6rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.report-note {
    margin-bottom: 0.9rem;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.7;
}

.report-table th,
.report-table td {
    background: transparent;
}

.pre-wrap {
    white-space: pre-wrap;
}

.minor-title {
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.tip-panel {
    background: var(--brand-soft-2);
}

.empty-panel {
    text-align: center;
    padding: 2.5rem 1.5rem;
}

.empty-panel h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 1.5rem;
    align-items: start;
}

.knowledge-side {
    position: sticky;
    top: 110px;
}

.knowledge-nav {
    display: grid;
    gap: 0.55rem;
}

.knowledge-nav a {
    text-decoration: none;
    color: var(--text);
    padding: 0.75rem 0.9rem;
    border-radius: 8px;
    background: rgba(180, 83, 9, 0.04);
    font-weight: 700;
}

.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 480ms ease, transform 480ms ease;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 1199px) {
    .poster-hero,
    .evidence-strip {
        grid-template-columns: 1fr;
    }

    .insight-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .source-legend-grid {
        grid-template-columns: 1fr;
    }

    .calculation-overview-grid {
        grid-template-columns: 1fr;
    }

    .directory-bottom {
        align-items: start;
    }

    .workflow-steps {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .header-bar,
    .section-head,
    .headline-main,
    .page-intro-main,
    .compact-action-bar {
        align-items: start;
        flex-direction: column;
    }

    .hero-strip,
    .auth-shell,
    .ops-shell,
    .ops-grid,
    .step-grid,
    .report-layout,
    .workflow-steps,
    .mini-stats,
    .info-grid,
    .focus-grid,
    .insight-grid,
    .source-legend-grid,
    .calculation-two-col,
    .knowledge-grid {
        grid-template-columns: 1fr 1fr;
    }

    .chart-box {
        height: 320px;
    }

    .quick-create {
        display: none;
    }

    .user-menu .quick-create {
        display: inline-flex;
    }

    .knowledge-side {
        position: static;
    }
}

@media print {
    .site-header,
    .course-tabs,
    .btn,
    .alert,
    .report-side,
    .knowledge-side {
        display: none !important;
    }

    .page-main {
        padding: 0;
    }

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

    .report-paper {
        box-shadow: none;
        border: 0;
        background: #fff;
    }
}

/* table header 默认不换行，保持列标题紧凑 */
th {
    white-space: nowrap;
}

/* 个别需要换行的长表头可用此 class 覆盖 */
th.wrap-cell {
    white-space: normal;
}

/* ===== 报告预览：评价结果分析与持续改进措施 ===== */

.insight-overview {
    margin: 0.5rem 0 1.5rem;
    padding: 1rem 1.25rem;
    border-left: 4px solid var(--ink-strong, #92400e);
    background: rgba(180, 83, 9, 0.04);
    border-radius: 0 12px 12px 0;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
}

.insight-objective-grid {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-bottom: 1.5rem;
}

.insight-objective-card {
    padding: 1rem 1.2rem 1.1rem;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: rgba(255, 250, 245, 0.7);
    border-left: 4px solid var(--ink-strong, #92400e);
}

.insight-objective-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.insight-objective-head strong {
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
}

.insight-focus-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 600;
}

.insight-objective-analysis {
    margin: 0 0 0.75rem;
    line-height: 1.75;
    color: var(--text);
}

.insight-evidence-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    margin-bottom: 0.6rem;
}

.insight-evidence-label {
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.5;
}

.insight-evidence-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.insight-evidence-chip {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    color: #b45309;
    font-size: 0.78rem;
    line-height: 1.5;
}

.insight-suggestion-row {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.5rem;
    border-top: 1px dashed var(--line);
}

.insight-suggestion-label {
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: rgba(180, 83, 9, 0.15);
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.6;
}

.insight-suggestion-row > span:last-child {
    font-size: 0.88rem;
    color: var(--muted);
    line-height: 1.6;
}

.insight-action-list {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    margin-top: 0.75rem;
}

.insight-action-card {
    padding: 1rem 1.2rem;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
}

.insight-action-head {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.insight-action-no {
    flex-shrink: 0;
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 50%;
    background: var(--ink-strong, #92400e);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.insight-action-title-row {
    flex: 1;
    min-width: 0;
}

.insight-action-title-row strong {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.insight-action-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.insight-action-meta > span:not([class]) {
    font-size: 0.8rem;
    color: var(--muted);
}

.insight-priority-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
}

.insight-priority-badge.priority-high {
    background: rgba(220, 38, 38, 0.12);
    color: #b91c1c;
}

.insight-priority-badge.priority-medium {
    background: rgba(180, 83, 9, 0.15);
    color: #92400e;
}

.insight-priority-badge.priority-low {
    background: rgba(34, 197, 94, 0.12);
    color: #15803d;
}

.insight-action-body {
    padding-left: 2.45rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.insight-action-field {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    line-height: 1.65;
}

.insight-field-label {
    flex-shrink: 0;
    width: 2.5rem;
    padding: 0.1rem 0;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
}

/* 报告预览：数据来源概览单行省略 */
.report-meta-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* 报告预览：紧凑操作条 */
.report-action-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin: 0.75rem 0 0.5rem;
    padding: 0.6rem 0.9rem;
    border-radius: 12px;
    background: rgba(250, 247, 242, 0.7);
    border: 1px solid var(--line);
}

/* 报告预览：单行来源说明 */
.report-source-legend {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    flex-wrap: wrap;
    margin: 0.5rem 0 1.25rem;
    padding: 0.65rem 1rem;
    border-radius: 12px;
    background: rgba(250, 247, 242, 0.5);
    border: 1px solid var(--line);
    font-size: 0.85rem;
}

.source-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.source-legend-text {
    color: var(--muted);
}

/* 评价与改进：课程目标分析卡片 */
.objective-ai-card {
    display: flex;
    flex-direction: column;
    border-left: 4px solid var(--ink-strong, #92400e);
}

.objective-ai-head {
    margin-bottom: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--line);
}

.objective-ai-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.objective-ai-title {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.objective-ai-focus {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.5;
}

.objective-ai-analysis {
    margin: 0 0 0.85rem;
    padding: 0.65rem 0.85rem;
    border-left: 3px solid rgba(180, 83, 9, 0.18);
    background: rgba(180, 83, 9, 0.03);
    border-radius: 0 8px 8px 0;
    line-height: 1.72;
    color: var(--text);
    font-size: 0.92rem;
}

.objective-ai-evidence {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-bottom: 0.85rem;
}

.objective-ai-evidence-label {
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: rgba(217, 119, 6, 0.12);
    color: #b45309;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.55;
}

.objective-ai-evidence-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.objective-ai-evidence-chip {
    display: inline-flex;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: rgba(217, 119, 6, 0.08);
    border: 1px solid rgba(217, 119, 6, 0.2);
    color: #b45309;
    font-size: 0.78rem;
    line-height: 1.5;
}

.objective-ai-suggestion {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: auto;
    padding-top: 0.7rem;
    border-top: 1px dashed var(--line);
    line-height: 1.65;
}

.objective-ai-suggestion-label {
    flex-shrink: 0;
    padding: 0.15rem 0.5rem;
    border-radius: 6px;
    background: rgba(180, 83, 9, 0.15);
    color: #92400e;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.55;
}

.objective-ai-suggestion > span:last-child {
    font-size: 0.88rem;
    color: var(--muted);
}

/* 评价与改进：AI 建议与教师补充来源标识 */
.insight-source-section {
    position: relative;
    padding-top: 0.5rem;
}

.insight-source-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 0.65rem;
    letter-spacing: 0.02em;
}

.insight-source-tag-ai {
    background: rgba(180, 83, 9, 0.10);
    color: #92400e;
    border: 1px solid rgba(180, 83, 9, 0.20);
}

.insight-source-tag-teacher {
    background: rgba(30, 41, 59, 0.08);
    color: #1e293b;
    border: 1px solid rgba(30, 41, 59, 0.15);
}

.insight-source-tag-teacher {
    background: rgba(217, 119, 6, 0.12);
    color: #92400e;
    border: 1px solid rgba(217, 119, 6, 0.25);
}

/* AI overview 区块带来源标识 */
.insight-source-ai .insight-source-tag,
.insight-source-teacher .insight-source-tag {
    margin-bottom: 0.75rem;
}

.insight-source-teacher {
    border-left-color: #d97706 !important;
}

.insight-source-teacher .insight-overview,
.insight-source-teacher.insight-overview {
    border-left: 4px solid #d97706;
    background: rgba(217, 119, 6, 0.04);
}

/* 教师补充：达成情况分析卡片 */
.teacher-overview-panel {
    padding: 1rem 1.2rem;
    border-radius: 10px;
    background: rgba(217, 119, 6, 0.05);
    border-left: 4px solid #d97706;
    line-height: 1.75;
}

.teacher-overview-panel strong {
    color: #92400e;
    font-size: 0.95rem;
}

.teacher-overview-panel p {
    color: var(--text);
    margin-bottom: 0.5rem;
}

.teacher-overview-panel p:last-child {
    margin-bottom: 0;
}

/* 成绩对话页 */
.chat-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.6;
}

.chat-loading-hint {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: rgba(217, 119, 6, 0.10);
    color: #7c2d12;
    font-size: 0.9rem;
}

.chat-error-msg {
    margin-top: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    background: rgba(220, 38, 38, 0.08);
    color: #991b1b;
    font-size: 0.9rem;
}

.chat-result-area {
    margin-top: 1rem;
}

.chat-result-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.chat-sql-details {
    font-size: 0.82rem;
}

.chat-sql-details summary {
    cursor: pointer;
    color: var(--muted);
}

.chat-sql-details pre {
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: rgba(180, 83, 9, 0.04);
    border-radius: 8px;
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.chat-history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.chat-history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    background: rgba(250, 247, 242, 0.7);
    border: 1px solid var(--line);
    flex-wrap: wrap;
}

.chat-history-q {
    flex: 1;
    min-width: 0;
}

.chat-history-meta {
    flex-shrink: 0;
}

.chat-suggestion-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.chat-suggestion-btn {
    padding: 0.45rem 0.9rem;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(250, 247, 242, 0.7);
    color: var(--text);
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}

.chat-suggestion-btn:hover {
    background: rgba(180, 83, 9, 0.06);
    border-color: rgba(180, 83, 9, 0.25);
}

/* 成绩对话 - ChatGPT 式聊天界面 */
.chat-shell {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 220px);
    min-height: 480px;
    max-width: 100%;
}

.chat-window {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    border-radius: 12px 12px 0 0;
    background: rgba(250, 247, 242, 0.6);
    border: 1px solid var(--line);
    border-bottom: none;
}

.chat-welcome {
    text-align: center;
    padding: 2rem 1rem 1.25rem;
}

.chat-welcome-icon {
    font-size: 2.4rem;
    margin-bottom: 0.5rem;
}

.chat-welcome h3 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.chat-welcome p {
    color: var(--muted);
    font-size: 0.9rem;
    max-width: 560px;
    margin: 0 auto;
    line-height: 1.6;
}

.chat-suggestion-area {
    margin: 1rem auto 1.5rem;
    max-width: 680px;
}

.chat-suggestion-title {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.6rem;
}

.chat-messages {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    max-width: 860px;
    margin: 0 auto;
    padding-bottom: 1rem;
}

.chat-bubble {
    display: flex;
    max-width: 85%;
    animation: chatFadeIn 0.25s ease;
}

@keyframes chatFadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.chat-bubble-user {
    align-self: flex-end;
    justify-content: flex-end;
}

.chat-bubble-assistant {
    align-self: flex-start;
    justify-content: flex-start;
    max-width: 92%;
}

.chat-bubble-content {
    padding: 0.85rem 1.1rem;
    border-radius: 16px;
    line-height: 1.65;
    word-break: break-word;
}

.chat-bubble-user .chat-bubble-content {
    background: var(--ink-strong, #92400e);
    color: #fff;
    border-bottom-right-radius: 4px;
}

.chat-bubble-assistant .chat-bubble-content {
    background: #fff;
    border: 1px solid var(--line);
    border-bottom-left-radius: 4px;
    width: 100%;
}

.chat-bubble-loading .chat-bubble-content {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.chat-bubble-summary {
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--text);
}

.chat-bubble-error {
    color: #991b1b;
    margin: 0;
}

.chat-bubble-analysis {
    margin: 0 0 0.5rem;
    padding: 0.6rem 0.8rem;
    background: rgba(217, 119, 6, 0.06);
    border-left: 3px solid rgba(217, 119, 6, 0.45);
    border-radius: 0.4rem;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
    white-space: pre-wrap;
}

.chat-result-table {
    margin: 0.5rem 0;
    font-size: 0.85rem;
}

.chat-result-table th {
    font-size: 0.8rem;
}

.chat-sql-details {
    margin-top: 0.65rem;
    font-size: 0.8rem;
}

.chat-sql-details summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.78rem;
}

.chat-sql-details pre {
    margin-top: 0.4rem;
    padding: 0.65rem;
    background: rgba(180, 83, 9, 0.05);
    border-radius: 8px;
    font-size: 0.76rem;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all;
    max-height: 200px;
    overflow-y: auto;
}

.chat-input-bar {
    display: flex;
    align-items: flex-end;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
    border-radius: 0 0 12px 12px;
    background: #fff;
    border: 1px solid var(--line);
}

.chat-input {
    flex: 1;
    resize: none;
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 0.7rem 0.9rem;
    line-height: 1.5;
    font-size: 0.95rem;
    max-height: 120px;
    outline: none;
    transition: border-color 0.15s ease;
}

.chat-input:focus {
    border-color: var(--ink-strong, #92400e);
}

.chat-send-btn {
    flex-shrink: 0;
    padding: 0.7rem 1.5rem;
    border-radius: 12px;
}

/* 隐藏旧的 chat 相关样式（保留兼容） */
.chat-textarea,
.chat-loading-hint,
.chat-error-msg,
.chat-result-area,
.chat-history-list,
.chat-history-item,
.chat-history-q,
.chat-history-meta {
    display: none !important;
}

/* ===== Bootstrap 组件覆盖 ===== */

.btn {
    border-radius: 8px !important;
    font-weight: 700 !important;
    padding: 0.65rem 1.25rem !important;
    transition: all 200ms ease !important;
}

.btn-lg {
    border-radius: 10px !important;
    padding: 0.85rem 1.6rem !important;
}

.btn-sm {
    border-radius: 6px !important;
    padding: 0.45rem 0.9rem !important;
}

.btn-dark {
    background: #b45309 !important;
    border-color: #b45309 !important;
    box-shadow: 0 6px 18px rgba(180, 83, 9, 0.20);
}

.btn-dark:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(180, 83, 9, 0.25);
}

.btn-outline-dark {
    border-color: #b45309 !important;
    color: #b45309 !important;
}

.btn-outline-dark:hover {
    background: #b45309 !important;
    border-color: #b45309 !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.btn-primary {
    background: #d97706 !important;
    border-color: #d97706 !important;
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.20);
}

.btn-primary:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    transform: translateY(-1px);
}

.btn-outline-primary {
    border-color: #d97706 !important;
    color: #d97706 !important;
}

.btn-outline-primary:hover {
    background: #d97706 !important;
    border-color: #d97706 !important;
    color: #fff !important;
}

.btn-light {
    background: rgba(180, 83, 9, 0.08) !important;
    border-color: transparent !important;
    color: #b45309 !important;
}

.btn-light:hover {
    background: rgba(180, 83, 9, 0.15) !important;
    color: #b45309 !important;
}

/* Bootstrap alerts */
.alert {
    border-radius: 10px !important;
}

/* SMS 验证码 toast 容器 */
.sms-toast-wrap {
    position: fixed;
    top: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 90vw;
    pointer-events: none;
}

.alert-success {
    background: rgba(21, 128, 61, 0.10) !important;
    border-left: 4px solid #15803d !important;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.10) !important;
    border-left: 4px solid #dc2626 !important;
}

.alert-warning {
    background: rgba(180, 83, 9, 0.10) !important;
    border-left: 4px solid #b45309 !important;
}

.alert-info {
    background: rgba(217, 119, 6, 0.10) !important;
    border-left: 4px solid #d97706 !important;
}

/* Bootstrap form controls */
.form-control,
.form-select {
    border-radius: 8px !important;
    border-color: var(--line-strong) !important;
    padding: 0.65rem 1rem !important;
    transition: border-color 200ms ease, box-shadow 200ms ease !important;
}

.form-control:focus,
.form-select:focus {
    border-color: #d97706 !important;
    box-shadow: 0 0 0 3px rgba(217, 119, 6, 0.15) !important;
}

/* Badges */
.badge {
    border-radius: 999px !important;
    font-weight: 700 !important;
    padding: 0.35rem 0.7rem !important;
}

/* Dropdown items */
.dropdown-item {
    border-radius: 10px !important;
    padding: 0.6rem 0.85rem !important;
}

.dropdown-item:hover {
    background: rgba(180, 83, 9, 0.08) !important;
}

/* Pagination */
.page-link {
    border-radius: 10px !important;
    margin: 0 2px;
    color: #b45309 !important;
    border-color: var(--line) !important;
}

.page-link:hover {
    background: rgba(180, 83, 9, 0.08) !important;
    color: #b45309 !important;
}

.page-item.active .page-link {
    background: #b45309 !important;
    border-color: #b45309 !important;
}

/* Progress bars */
.progress {
    border-radius: 999px !important;
    background: rgba(180, 83, 9, 0.08) !important;
}

.progress-bar {
    background: linear-gradient(90deg, #d97706, #b45309) !important;
    border-radius: 999px !important;
}

/* Spinner */
.spinner-border {
    color: #d97706 !important;
}

/* Links */
a {
    color: #b45309;
}

a:hover {
    color: #d97706;
}

/* ===== 额外视觉差异化 ===== */

/* 增大卡片圆角 */
.hero-panel,
.sub-hero,
.panel-card,
.report-paper,
.workflow-band {
    border-radius: 10px;
}

/* 按钮组间距增加 */
.btn-group {
    gap: 0.5rem;
}

/* 表格样式微调 */
.table {
    border-radius: 10px;
    overflow: hidden;
}

.table thead th {
    background: rgba(180, 83, 9, 0.06) !important;
    border-bottom: 2px solid rgba(180, 83, 9, 0.15) !important;
    font-weight: 700 !important;
    color: var(--text) !important;
}

/* 滚动条 */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(180, 83, 9, 0.15);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(180, 83, 9, 0.25);
}

/* ============================================================
   工作台布局重构（教务系统风）
   左侧固定侧栏 + 右侧顶栏 + 内容区
   保留旧类名兼容未改造页面
   ============================================================ */

/* ===== 应用骨架（新） ===== */
.app-shell {
    display: flex;
    min-height: 100vh;
    background: var(--bg);
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    z-index: 40;
    transition: transform 220ms ease;
}

.app-sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid var(--sidebar-divider);
    text-decoration: none;
    color: var(--sidebar-text);
}

.app-sidebar-brand img {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    flex-shrink: 0;
}

.app-sidebar-brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-sidebar-brand-text strong {
    font-size: 0.98rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.app-sidebar-brand-text small {
    font-size: 0.72rem;
    color: var(--sidebar-muted);
    font-weight: 500;
}

.app-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.85rem 0.75rem 1.25rem;
}

.app-sidebar-group-label {
    padding: 0.85rem 0.75rem 0.35rem;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--sidebar-muted);
    text-transform: uppercase;
}

.app-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 160ms ease, color 160ms ease;
}

.app-sidebar-link svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: 0.85;
}

.app-sidebar-link:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

.app-sidebar-link.active {
    background: var(--sidebar-active);
    color: #fff;
}

.app-sidebar-link.active svg {
    opacity: 1;
}

.app-sidebar-user {
    border-top: 1px solid var(--sidebar-divider);
    padding: 0.75rem 0.75rem;
}

.app-sidebar-user-toggle {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--sidebar-text);
    text-align: left;
    cursor: pointer;
}

.app-sidebar-user-toggle:hover {
    background: var(--sidebar-hover);
}

.app-sidebar-user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    flex-shrink: 0;
}

.app-sidebar-user-meta {
    flex: 1;
    min-width: 0;
    line-height: 1.25;
}

.app-sidebar-user-meta strong {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-sidebar-user-meta small {
    font-size: 0.72rem;
    color: var(--sidebar-muted);
}

.app-sidebar-user-menu {
    margin: 0.25rem 0 0;
    padding: 0.35rem;
    background: rgba(0, 0, 0, 0.25);
    border-radius: 8px;
}

.app-sidebar-user-menu a,
.app-sidebar-user-menu button {
    display: block;
    width: 100%;
    padding: 0.5rem 0.65rem;
    border: 0;
    background: transparent;
    color: var(--sidebar-text);
    text-align: left;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    cursor: pointer;
}

.app-sidebar-user-menu a:hover,
.app-sidebar-user-menu button:hover {
    background: var(--sidebar-hover);
    color: #fff;
}

/* ===== 右侧主区 ===== */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.app-topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    background: #fff;
    border-bottom: 1px solid var(--line);
}

.app-topbar-toggle {
    display: none;
    width: 38px;
    height: 38px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fff;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.app-topbar-toggle svg {
    width: 20px;
    height: 20px;
}

.app-topbar-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.app-topbar-role {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.7rem;
    border-radius: 999px;
    background: var(--brand-soft);
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
}

.app-content {
    flex: 1;
    padding: 1.5rem;
}

.app-content-inner {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

/* ===== 侧栏遮罩（移动端抽屉） ===== */
.app-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    z-index: 35;
}

.app-sidebar-backdrop.show {
    display: block;
}
.collapse.show {
    visibility: visible !important;
}
/* ===== 移动端：侧栏折叠为抽屉 ===== */
@media (max-width: 991.98px) {
    .app-sidebar {
        transform: translateX(-100%);
        box-shadow: 0 0 30px rgba(0, 0, 0, 0.25);
    }

    .app-sidebar.show {
        transform: translateX(0);
    }

    .app-main {
        margin-left: 0;
    }

    .app-topbar-toggle {
        display: inline-flex;
    }
}

/* ============================================================
   工作台首屏（dashboard）
   ============================================================ */

.workbench-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

@media (max-width: 1199.98px) {
    .workbench-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 575.98px) {
    .workbench-stats {
        grid-template-columns: 1fr;
    }
}

.stat-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem 1.25rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: var(--shadow-soft);
    text-decoration: none;
    color: var(--text);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.stat-card:hover {
    border-color: rgba(180, 83, 9, 0.25);
    box-shadow: var(--shadow);
}

.stat-card.is-link:hover {
    color: var(--brand);
}

.stat-card-label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted);
}

.stat-card-value {
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
}

.stat-card-note {
    font-size: 0.76rem;
    color: var(--muted);
}

.stat-card-accent .stat-card-value {
    color: var(--brand);
}

/* 继续上次工作卡片（弱化 featured） */
.workbench-continue {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: 1rem 1.25rem;
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
    border: 1px solid rgba(180, 83, 9, 0.2);
    border-radius: 10px;
}

.workbench-continue-copy strong {
    display: block;
    font-size: 1.02rem;
    font-weight: 700;
    color: var(--text);
}

.workbench-continue-copy span {
    font-size: 0.82rem;
    color: var(--muted);
}

/* ============================================================
   page_intro 恢复渲染（新 Tailwind 版式）
   ============================================================ */
.page-intro {
    background: transparent;
    border: 0;
    padding: 0;
    margin-bottom: 1.5rem;
}

.page-intro-main {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.25rem;
    flex-wrap: wrap;
}

.page-intro-copy h1 {
    font-size: var(--text-h1);
    font-weight: 800;
    margin: 0;
    line-height: 1.25;
}

.page-intro-copy p {
    margin: 0.45rem 0 0;
    color: var(--muted);
    font-size: 0.92rem;
    max-width: 720px;
}

.page-intro .headline-actions {
    display: inline-flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin: 0;
}

/* ============================================================
   课程 Tab（带图标横向 tab）
   ============================================================ */
.course-nav-shell {
    margin-bottom: 1.25rem;
}

.course-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
}

.course-tabs a {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.7rem 0.9rem;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    border-bottom: 2px solid transparent;
    white-space: nowrap;
    transition: color 160ms ease, border-color 160ms ease;
}

.course-tabs a svg {
    width: 16px;
    height: 16px;
    opacity: 0.75;
}

.course-tabs a:hover {
    color: var(--text);
}

.course-tabs a.active {
    color: var(--brand);
    border-bottom-color: var(--brand);
}

.course-tabs a.active svg {
    opacity: 1;
}

/* ============================================================
   居中卡片式登录页
   ============================================================ */
.auth-center {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.25rem;
    padding: 2rem 1rem;
    margin: -1.5rem;
    background: var(--bg);
}

.auth-center-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.auth-center-brand img {
    width: 48px;
    height: 48px;
    border-radius: 12px;
}

.auth-center-brand strong {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}

.auth-center-card {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    padding: 1.75rem;
}

.auth-center-points {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    width: 100%;
    max-width: 420px;
}

.auth-center-points div {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 0.85rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--muted);
}

.auth-center-points strong {
    color: var(--text);
    font-weight: 700;
}

/* ============================================================
   兼容旧 base.html 类（防未改造页面崩溃）
   保留 .page-shell / .site-header 行为，但默认隐藏 ambient
   ============================================================ */
.page-shell {
    min-height: 100vh;
    background: var(--bg);
}

.page-main {
    padding: 1.5rem 0;
}

.ambient {
    display: none !important;
}

/* ============================================================
   登录协议、法律页面与 AI 内容标识
   ============================================================ */
.auth-consent {
    padding: 0.75rem 0.85rem;
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--muted);
}

.auth-consent .form-check {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    margin: 0;
}

.auth-consent .form-check-input {
    flex: 0 0 auto;
    margin-top: 0.2rem;
}

.auth-consent a {
    color: var(--brand);
    font-weight: 600;
    text-decoration: none;
}

.auth-consent a:hover {
    text-decoration: underline;
}

.legal-page {
    min-height: 100vh;
    padding: 2rem 1rem 3rem;
    background: var(--bg);
}

.app-content .legal-page {
    min-height: 0;
    padding: 0;
    background: transparent;
}

.legal-doc {
    width: min(920px, 100%);
    margin: 0 auto;
    padding: 2rem 2.25rem;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    color: var(--text);
    line-height: 1.85;
}

.legal-doc-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding-bottom: 1.25rem;
    border-bottom: 1px solid var(--line);
}

.legal-kicker {
    display: inline-block;
    margin-bottom: 0.35rem;
    color: var(--brand);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.legal-doc h1 {
    margin: 0 0 0.5rem;
    font-size: 1.65rem;
    font-weight: 800;
}

.legal-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.8rem;
}

.legal-callout {
    margin: 1.25rem 0;
    padding: 0.9rem 1rem;
    background: #fff7ed;
    border-left: 4px solid var(--brand);
    border-radius: 6px;
    color: #7c2d12;
    font-size: 0.9rem;
}

.legal-doc h2 {
    margin: 1.75rem 0 0.65rem;
    font-size: 1.05rem;
    font-weight: 800;
}

.legal-doc p,
.legal-doc li {
    font-size: 0.92rem;
}

.legal-doc ul,
.legal-doc ol {
    padding-left: 1.4rem;
}

.legal-table {
    width: 100%;
    margin: 0.75rem 0 1.25rem;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.legal-table th,
.legal-table td {
    padding: 0.6rem 0.65rem;
    border: 1px solid var(--line);
    vertical-align: top;
    text-align: left;
}

.legal-table th {
    background: var(--bg);
    font-weight: 700;
}

.ai-disclosure {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 8px;
    color: #78350f;
    font-size: 0.84rem;
    line-height: 1.55;
}

.ai-badge {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0.12rem 0.5rem;
    background: #92400e;
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 1.5;
    white-space: nowrap;
}

.ai-badge-fallback {
    background: #6b7280;
}

.ai-block-label {
    margin: 0.85rem 0 0.55rem;
}

.chat-ai-notice {
    margin-top: 1rem;
}

.chat-ai-meta {
    margin-bottom: 0.45rem;
}

.chat-data-note {
    margin: 0.65rem 0 0;
    color: var(--muted);
    font-size: 0.75rem;
}

.insight-source-tag-fallback {
    background: #f3f4f6;
    color: #4b5563;
}

.report-ai-note {
    margin-bottom: 1rem;
}

@media (max-width: 576px) {
    .legal-doc {
        padding: 1.25rem 1rem;
    }

    .legal-doc-head {
        flex-direction: column;
    }
}
