/* Shared styles for the HelloAI interactive labs. */
.lab-page {
    --lab-blue: #2563eb;
    --lab-purple: #7c3aed;
    --lab-emerald: #059669;
    --lab-amber: #d97706;
    --lab-rose: #e11d48;
    --lab-cyan: #0891b2;
    --lab-ink: #0f172a;
    --lab-muted: #64748b;
    --lab-line: #e2e8f0;
}

.lab-header {
    max-width: 1040px;
    margin: 0 auto 24px;
}

.lab-back {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #94a3b8;
    font-size: 12px;
    margin-bottom: 10px;
    transition: color .15s ease;
}
.lab-back:hover { color: var(--lab-blue); }

.lab-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 4px 10px;
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 999px;
    background: rgba(239, 246, 255, .8);
    color: #1d4ed8;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.lab-title {
    margin-top: 12px;
    font-family: "Noto Serif SC", "Songti SC", serif;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.12;
    font-weight: 800;
    color: var(--lab-ink);
    letter-spacing: 0;
}

.lab-subtitle {
    margin-top: 12px;
    max-width: 760px;
    color: #475569;
    font-size: 15px;
    line-height: 1.75;
}

.lab-shell {
    max-width: 1240px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 18px;
    align-items: start;
}

.lab-stage,
.lab-panel,
.lab-card {
    background: rgba(255, 255, 255, .88);
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .03), 0 18px 48px rgba(15, 23, 42, .04);
}

.lab-stage {
    padding: 14px;
    overflow: hidden;
}

.lab-canvas-wrap {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background: #0f172a;
    border: 1px solid #1e293b;
}

.lab-canvas-wrap canvas {
    display: block;
    width: 100%;
    height: auto;
    touch-action: none;
}

.lab-side {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.lab-panel {
    padding: 15px;
}

.lab-panel-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

details.lab-panel > summary.lab-panel-title {
    cursor: pointer;
    list-style: none;
}

details.lab-panel > summary.lab-panel-title::-webkit-details-marker {
    display: none;
}

.lab-panel-title span:last-child {
    color: #94a3b8;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 700;
}

.knn-panel-primary {
    position: relative;
    border-color: rgba(37, 99, 235, .3);
    box-shadow: 0 1px 3px rgba(15, 23, 42, .04), 0 18px 44px rgba(37, 99, 235, .12);
}
.knn-panel-primary::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    border-radius: 14px 0 0 14px;
    background: linear-gradient(180deg, #2563eb, #7c3aed);
}
.knn-panel-primary > summary.lab-panel-title > span:first-child {
    color: #1d4ed8;
}

.lab-controls {
    display: grid;
    gap: 12px;
}

.lab-control-row {
    display: grid;
    gap: 6px;
}

.lab-control-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #64748b;
    font-size: 12px;
    font-weight: 600;
}

.lab-control-value {
    color: #0f172a;
    font-family: "JetBrains Mono", monospace;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.lab-slider {
    width: 100%;
    height: 4px;
    border-radius: 999px;
    outline: none;
    accent-color: var(--lab-blue);
}

.lab-input,
.lab-select {
    width: 100%;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    color: #1e293b;
    font-size: 13px;
    padding: 9px 10px;
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lab-input:focus,
.lab-select:focus {
    border-color: rgba(37, 99, 235, .65);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .1);
}

.lab-btn-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.lab-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s ease, border-color .15s ease, color .15s ease, background .15s ease;
}
.lab-btn:hover {
    transform: translateY(-1px);
    border-color: rgba(37, 99, 235, .38);
    color: var(--lab-blue);
    background: #f8fbff;
}
.lab-btn.primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    box-shadow: 0 8px 22px rgba(37, 99, 235, .22);
}
.lab-btn.primary:hover {
    color: #fff;
    background: linear-gradient(135deg, #1d4ed8, #6d28d9);
}
.lab-btn.danger {
    color: #be123c;
    border-color: #fecdd3;
    background: #fff7f8;
}
.lab-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    transform: none;
}

.lab-segment {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 4px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.lab-seg-btn {
    min-height: 30px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #64748b;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
.lab-seg-btn.active {
    background: #fff;
    color: var(--lab-blue);
    box-shadow: 0 1px 4px rgba(15, 23, 42, .08), 0 0 0 1px rgba(37, 99, 235, .18);
}

.lab-stat-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.lab-stat {
    padding: 10px;
    border-radius: 10px;
    background: #f8fafc;
    border: 1px solid #eef2f7;
}

.lab-stat-label {
    color: #94a3b8;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.lab-stat-value {
    margin-top: 3px;
    color: #0f172a;
    font-family: "JetBrains Mono", monospace;
    font-size: 18px;
    line-height: 1.1;
    font-weight: 900;
    font-variant-numeric: tabular-nums;
}

.lab-note {
    color: #475569;
    font-size: 12px;
    line-height: 1.65;
}
.lab-note strong { color: #1e293b; }

.lab-formula {
    margin: 10px 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: #0f172a;
    color: #dbeafe;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow-x: auto;
}

.knn-hint {
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

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

.knn-mode-grid .lab-seg-btn {
    width: 100%;
}

.knn-lesson-panel {
    display: grid;
    gap: 7px;
}

.knn-lesson-panel[hidden] {
    display: none;
}

.knn-lesson-step {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 8px;
    align-items: center;
    padding: 7px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.45;
}

.knn-lesson-step span {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0ecff;
    color: #1d4ed8;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 900;
}

.knn-lesson-step.done {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}

.knn-lesson-step.done span {
    background: #dcfce7;
    color: #15803d;
}

.knn-explain-card,
.knn-rule-card {
    margin-top: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(37, 99, 235, .14);
    background: linear-gradient(135deg, rgba(239, 246, 255, .86), rgba(255, 255, 255, .92));
}

.knn-explain-title {
    margin-bottom: 5px;
    color: #1e293b;
    font-size: 12px;
    font-weight: 900;
}

.knn-rule-card {
    display: grid;
    gap: 4px;
    border-color: #e2e8f0;
    background: #f8fafc;
    color: #64748b;
    font-size: 12px;
    line-height: 1.55;
}

.knn-rule-card strong {
    color: #334155;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.knn-table-wrap {
    margin-top: 12px;
    overflow-x: auto;
}

.knn-neighbor-table td,
.knn-neighbor-table th {
    white-space: nowrap;
}

.knn-class-pill {
    --pill: #64748b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 22px;
    padding: 0 7px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--pill) 14%, white);
    color: var(--pill);
    border: 1px solid color-mix(in srgb, var(--pill) 35%, white);
    font-weight: 900;
}

.knn-empty-cell {
    color: #94a3b8 !important;
    text-align: center !important;
    font-family: inherit !important;
}

.knn-demo-row {
    margin-top: 12px;
    align-items: center;
}

.knn-demo-status {
    flex: 1;
    min-width: 160px;
    color: #64748b;
    font-size: 11px;
    line-height: 1.45;
}

.knn-perf {
    color: #94a3b8;
    font-family: "JetBrains Mono", monospace;
    font-size: 10px;
    line-height: 1.5;
}

.knn-detail {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #eef2f7;
}
.knn-detail-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.knn-detail-note {
    margin-top: 6px;
    color: #64748b;
    font-size: 12px;
    line-height: 1.6;
}
.knn-detail .knn-table-wrap { margin-top: 10px; }
.knn-detail .knn-demo-row { margin-top: 10px; }

.lab-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.lab-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 999px;
    background: #f1f5f9;
    color: #475569;
    font-size: 11px;
    font-weight: 800;
}

.lab-legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    color: #64748b;
    font-size: 11px;
    margin-top: 10px;
}

.lab-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.lab-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(15, 23, 42, .14);
}

.lab-bottom-grid {
    max-width: 1240px;
    margin: 16px auto 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lab-card {
    padding: 16px;
}

.lab-card h3 {
    color: #0f172a;
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 8px;
}

.lab-card p,
.lab-card li {
    color: #64748b;
    font-size: 12px;
    line-height: 1.65;
}

.lab-card p + p {
    margin-top: 6px;
}

.lab-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}
.lab-table th,
.lab-table td {
    padding: 8px 6px;
    border-bottom: 1px solid #eef2f7;
    text-align: left;
}
.lab-table th {
    color: #94a3b8;
    font-size: 10px;
    letter-spacing: .06em;
    text-transform: uppercase;
}
.lab-table td {
    color: #475569;
    font-family: "JetBrains Mono", monospace;
}

.lab-mini-chart {
    width: 100%;
    height: 120px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
}

/* ── 神经网络 Playground ─────────────────────────────── */
.nn-main-column {
    display: grid;
    gap: 14px;
    min-width: 0;
}

.nn-canvas-stage {
    padding: 14px;
}

.nn-error-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, .18);
}

.nn-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 12px;
    padding: 6px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
}

.nn-presets .lab-seg-btn {
    flex: 1 1 96px;
    min-height: 32px;
    white-space: nowrap;
}

.nn-control-group {
    display: grid;
    gap: 10px;
    padding: 12px;
    border: 1px solid #e6edf7;
    border-radius: 12px;
    background: linear-gradient(180deg, #fff, #fbfdff);
}

.nn-control-group + .nn-control-group {
    margin-top: 10px;
}

.nn-control-group h3 {
    margin: 0;
    color: #1e293b;
    font-size: 12px;
    font-weight: 900;
    letter-spacing: .05em;
    text-transform: uppercase;
}

.nn-mini-note {
    margin: 0;
    padding: 8px 9px;
    border-radius: 10px;
    background: #f8fafc;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.55;
}

.nn-mini-note strong {
    color: #334155;
}

.nn-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 34px;
    padding: 7px 9px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #475569;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
}

.nn-check-row input {
    accent-color: var(--lab-blue);
}

.nn-chart-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 12px 0 6px;
    color: #64748b;
    font-size: 11px;
    font-weight: 800;
}

.nn-chart-head span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.nn-key {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 999px;
}

.nn-key-loss { background: #7c3aed; }
.nn-key-acc { background: #059669; }

.nn-observation-card {
    display: grid;
    gap: 10px;
}

.nn-observation-card h2 {
    margin: 0;
    color: #0f172a;
    font-size: 18px;
    font-weight: 900;
    letter-spacing: 0;
}

.nn-observation-card > p {
    margin: 0;
    color: #475569;
    font-size: 13px;
    line-height: 1.7;
}

.nn-observation-notes {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.nn-chart-card {
    display: grid;
    gap: 0;
}

.nn-wide-chart {
    height: 190px;
}

.nn-summary {
    margin-top: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(5, 150, 105, .18);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(236, 253, 245, .9), rgba(255, 255, 255, .92));
    color: #166534;
    font-size: 12px;
    line-height: 1.6;
}

.nn-summary[hidden] {
    display: none;
}

.nn-summary strong {
    color: #14532d;
}

.nn-graph {
    min-height: 180px;
    margin-top: 10px;
}

.nn-graph svg {
    width: 100%;
    height: auto;
    display: block;
}

.nn-graph text {
    font-family: "Inter", "Noto Sans SC", sans-serif;
    fill: #475569;
}

.nn-graph .nn-layer-label {
    fill: #334155;
    font-size: 11px;
    font-weight: 800;
}

.nn-graph .nn-weight-hint {
    fill: #94a3b8;
    font-size: 10px;
}

#nn-concept {
    margin-top: 10px;
}

.nn-advanced-settings {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #f8fafc;
    overflow: hidden;
}

.nn-advanced-settings > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 12px;
    color: #334155;
    font-size: 12px;
    font-weight: 900;
}

.nn-advanced-settings > summary::-webkit-details-marker {
    display: none;
}

.nn-advanced-settings > summary::after {
    content: "展开";
    color: #2563eb;
    font-size: 11px;
    font-weight: 900;
}

.nn-advanced-settings[open] > summary::after {
    content: "收起";
}

.nn-advanced-settings > .nn-control-group {
    margin: 0 10px 10px;
}

.nn-tasks-head {
    align-items: center;
}

.nn-tasks-progress {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #1d4ed8 !important;
    font-family: inherit !important;
}

.nn-tasks-progress b {
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 900;
}

.nn-tasks-progress i {
    display: block;
    width: 86px;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}

.nn-tasks-progress em {
    display: block;
    width: 0;
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width .28s ease;
}

.nn-task-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}

.nn-task {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 128px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    color: #64748b;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.nn-task.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
    color: #166534;
}

.nn-task-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nn-task-top span {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0ecff;
    color: #1d4ed8;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 900;
}

.nn-task.is-done .nn-task-top span {
    background: #dcfce7;
    color: #15803d;
}

.nn-task-top strong {
    color: #1e293b;
    font-size: 12.5px;
    line-height: 1.35;
    font-weight: 900;
}

.nn-task p {
    margin: 0;
    font-size: 11.5px;
    line-height: 1.55;
}

.lab-toast {
    position: absolute;
    left: 14px;
    top: 14px;
    z-index: 5;
    max-width: min(420px, calc(100% - 28px));
    padding: 8px 10px;
    border-radius: 10px;
    background: rgba(15, 23, 42, .78);
    color: #e2e8f0;
    font-size: 12px;
    line-height: 1.45;
    backdrop-filter: blur(8px);
    opacity: .94;
    transition: opacity .28s ease, transform .28s ease;
}

.lab-toast.is-muted {
    opacity: .24;
    transform: translateY(-2px);
}

.lab-canvas-wrap:hover .lab-toast.is-muted,
.lab-toast:focus-within {
    opacity: .94;
    transform: translateY(0);
}

.lab-wide-note {
    max-width: 1240px;
    margin: 16px auto 0;
    padding: 14px 16px;
    border: 1px solid rgba(37, 99, 235, .15);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(239, 246, 255, .85), rgba(245, 243, 255, .72));
    color: #475569;
    font-size: 13px;
    line-height: 1.7;
}

/* ── 实验指南（可折叠引导）──────────────────────────── */
.lab-guide {
    max-width: 1240px;
    margin: 0 auto 18px;
    border: 1px solid rgba(37, 99, 235, .16);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(239, 246, 255, .9), rgba(255, 255, 255, .96));
    box-shadow: 0 1px 3px rgba(15, 23, 42, .03), 0 18px 48px rgba(15, 23, 42, .04);
    overflow: hidden;
}

.lab-guide > summary {
    list-style: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    user-select: none;
}
.lab-guide > summary::-webkit-details-marker { display: none; }

.lab-guide-summary-main {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}
.lab-guide-badge {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    font-size: 15px;
}
.lab-guide-summary-text { min-width: 0; }
.lab-guide-summary-text strong {
    display: block;
    color: #0f172a;
    font-size: 15px;
    font-weight: 900;
    line-height: 1.3;
}
.lab-guide-summary-text span {
    color: #64748b;
    font-size: 12px;
}
.lab-guide-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #2563eb;
    font-size: 12px;
    font-weight: 800;
}
.lab-guide-toggle::after {
    content: "▾";
    display: inline-block;
    transition: transform .2s ease;
}
.lab-guide[open] .lab-guide-toggle::after { transform: rotate(180deg); }
.lab-guide[open] .lab-guide-toggle .lab-guide-toggle-close { display: none; }
.lab-guide:not([open]) .lab-guide-toggle .lab-guide-toggle-open { display: none; }

.lab-guide-body {
    padding: 4px 18px 18px;
}

.lab-guide-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.lab-guide-cell {
    padding: 14px;
    border: 1px solid #e6edf7;
    border-radius: 12px;
    background: rgba(255, 255, 255, .8);
}
.lab-guide-cell-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 900;
}
.lab-guide-cell-head em {
    font-style: normal;
    font-size: 15px;
}
.lab-guide-cell p {
    color: #475569;
    font-size: 12.5px;
    line-height: 1.7;
}
.lab-guide-cell p + p { margin-top: 8px; }
.lab-guide-cell .lab-guide-em { color: #1d4ed8; font-weight: 800; }

.lab-steps { display: grid; gap: 9px; }
.lab-step {
    display: grid;
    grid-template-columns: 22px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.55;
}
.lab-step b {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0ecff;
    color: #1d4ed8;
    font-family: "JetBrains Mono", monospace;
    font-size: 11px;
    font-weight: 900;
}
.lab-step strong { color: #1e293b; font-weight: 800; }

.lab-focus { display: grid; gap: 8px; }
.lab-focus-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 9px;
    align-items: start;
    color: #475569;
    font-size: 12.5px;
    line-height: 1.55;
}
.lab-focus-item i {
    margin-top: 4px;
    width: 12px;
    height: 12px;
    border-radius: 4px;
    background: var(--fc, #2563eb);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--fc, #2563eb) 18%, transparent);
}
.lab-focus-item strong { color: #1e293b; font-weight: 800; }

/* ── 引导任务 ───────────────────────────────────────── */
.knn-tasks-head {
    display: flex;
    align-items: center;
    gap: 10px;
}
.knn-tasks-progress {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
    font-weight: 800;
    color: #1d4ed8;
}
.knn-tasks-bar {
    width: 84px;
    height: 6px;
    border-radius: 999px;
    background: #e2e8f0;
    overflow: hidden;
}
.knn-tasks-bar > i {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #7c3aed);
    transition: width .3s ease;
}
.knn-task-list {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
}
.knn-task {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 12px;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #fff;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.knn-task.is-done {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.knn-task-top {
    display: flex;
    align-items: center;
    gap: 8px;
}
.knn-task-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #e0ecff;
    color: #1d4ed8;
    font-family: "JetBrains Mono", monospace;
    font-size: 12px;
    font-weight: 900;
}
.knn-task.is-done .knn-task-num { background: #dcfce7; color: #15803d; }
.knn-task-title {
    color: #1e293b;
    font-size: 12.5px;
    font-weight: 800;
    line-height: 1.4;
}
.knn-task-look {
    display: flex;
    gap: 6px;
    color: #64748b;
    font-size: 11.5px;
    line-height: 1.5;
}
.knn-task-look::before {
    content: "👀";
    flex-shrink: 0;
}
.knn-task.is-done .knn-task-look { color: #166534; }
.knn-tasks-done-note {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    border: 1px solid #bbf7d0;
    background: #f0fdf4;
    color: #166534;
    font-size: 12.5px;
    line-height: 1.6;
}
.knn-tasks-done-note[hidden] { display: none; }

/* ── 画布上的预测浮标 + 拖动提示 ──────────────────────── */
.knn-pred-badge {
    position: absolute;
    z-index: 6;
    transform: translate(-50%, -150%);
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(15, 23, 42, .9);
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 18px rgba(15, 23, 42, .3);
    transition: opacity .2s ease;
}
.knn-pred-badge b {
    color: var(--pc, #f59e0b);
    font-family: "JetBrains Mono", monospace;
}
.knn-pred-badge[hidden] { display: none; }
.knn-drag-hint {
    position: absolute;
    z-index: 6;
    transform: translate(18px, -50%);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 9px;
    border-radius: 999px;
    background: rgba(245, 158, 11, .95);
    color: #1f2937;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
    pointer-events: none;
    box-shadow: 0 6px 16px rgba(245, 158, 11, .4);
    animation: knnDragPulse 1.6s ease-in-out infinite;
}
.knn-drag-hint[hidden] { display: none; }
@keyframes knnDragPulse {
    0%, 100% { transform: translate(18px, -50%); }
    50% { transform: translate(24px, -50%); }
}

@media (max-width: 980px) {
    .lab-guide-grid { grid-template-columns: 1fr; }
    .knn-task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .nn-task-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .lab-shell {
        grid-template-columns: 1fr;
    }
    .lab-side {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .lab-bottom-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 700px) {
    .lab-page {
        padding-left: 0;
        padding-right: 0;
    }
    .lab-side {
        grid-template-columns: 1fr;
    }
    .lab-stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .nn-observation-notes,
    .nn-task-list {
        grid-template-columns: 1fr;
    }
    .nn-task {
        min-height: 0;
    }
    .nn-wide-chart {
        height: 150px;
    }
    .nn-tasks-head {
        align-items: flex-start;
        flex-direction: column;
    }
    .lab-title {
        font-size: 28px;
    }
    .knn-task-list { grid-template-columns: 1fr; }
}
