@import './tokens.css';
@import url("https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500;700&family=Outfit:wght@400;500;600;700;800&display=swap");

/* 基础重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* 数据跟踪仪表盘 */
body.tracking-page {
    font-family: 'Inter', 'Microsoft YaHei', 'Segoe UI', Tahoma, sans-serif;
    background: radial-gradient(circle at top, #1e1b4b 0%, #0f172a 45%, #020617 100%);
    color: #e2e8f0;
    min-height: 100vh;
    padding: 40px 20px 60px;
}

body.tracking-page .container {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

body.tracking-page .hero {
    background: linear-gradient(120deg, rgba(79, 70, 229, 0.9), rgba(14, 165, 233, 0.85));
    border-radius: 28px;
    padding: 32px 36px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 24px;
    box-shadow: 0 30px 60px rgba(15, 23, 42, 0.45);
}

body.tracking-page .hero h1 {
    font-size: 42px;
    margin-bottom: 12px;
}

body.tracking-page .hero p {
    font-size: 16px;
    opacity: 0.9;
    line-height: 1.6;
}

body.tracking-page .hero-meta {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
    font-size: 14px;
    opacity: 0.85;
}

body.tracking-page .hero-actions {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    flex-wrap: wrap;
}

body.tracking-page .btn {
    padding: 12px 22px;
    border-radius: 999px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
}

body.tracking-page .btn-primary {
    background: #0f172a;
    color: #f8fafc;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35);
}

body.tracking-page .btn-secondary {
    background: rgba(248, 250, 252, 0.12);
    color: #f8fafc;
    border: 1px solid rgba(248, 250, 252, 0.25);
}

body.tracking-page .btn:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}

body.tracking-page .control-panel {
    background: rgba(15, 23, 42, 0.7);
    border-radius: 24px;
    padding: 24px 28px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.05);
}

body.tracking-page .control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

body.tracking-page .control-group label {
    display: block;
    font-size: 13px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #94a3b8;
    margin-bottom: 8px;
}

body.tracking-page input[type="datetime-local"],
body.tracking-page input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid rgba(148, 163, 184, 0.35);
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    font-size: 15px;
}

body.tracking-page input[type="datetime-local"]:focus,
body.tracking-page input[type="text"]:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.25);
}

body.tracking-page .quick-range {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

body.tracking-page .quick-range button {
    background: rgba(248, 250, 252, 0.08);
    border: 1px solid transparent;
    color: #e2e8f0;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s, border 0.2s;
}

body.tracking-page .quick-range button.active,
body.tracking-page .quick-range button:hover {
    background: rgba(56, 189, 248, 0.2);
    border-color: rgba(56, 189, 248, 0.5);
    color: #f8fafc;
}

body.tracking-page .card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 18px;
}

body.tracking-page .metric-card {
    background: rgba(15, 23, 42, 0.75);
    border-radius: 22px;
    padding: 20px 22px;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: inset 0 1px 0 rgba(248, 250, 252, 0.04);
}

body.tracking-page .metric-label {
    font-size: 13px;
    color: #94a3b8;
    letter-spacing: 0.02em;
}

body.tracking-page .metric-value {
    font-size: 36px;
    font-weight: 700;
    margin: 8px 0;
}

body.tracking-page .metric-trend {
    font-size: 14px;
    color: #94a3b8;
}

/* 股市习惯：上升红、下降绿 */
body.tracking-page .metric-trend.positive {
    color: #ef4444;
}

body.tracking-page .metric-trend.negative {
    color: #22c55e;
}

body.tracking-page .metric-trend.down {
    color: #22c55e;
}

body.tracking-page .chart-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 20px;
}

body.tracking-page .chart-card {
    background: rgba(15, 23, 42, 0.8);
    border-radius: 24px;
    padding: 24px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

body.tracking-page .chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    color: #cbd5f5;
    font-weight: 600;
}

body.tracking-page .table-section,
body.tracking-page .detail-panel {
    background: rgba(15, 23, 42, 0.82);
    border-radius: 24px;
    padding: 24px 28px;
    border: 1px solid rgba(148, 163, 184, 0.2);
}

body.tracking-page table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

body.tracking-page thead {
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 12px;
    color: #94a3b8;
    border-bottom: 1px solid rgba(148, 163, 184, 0.25);
}

body.tracking-page th,
body.tracking-page td {
    padding: 14px 10px;
    text-align: left;
}

body.tracking-page tbody tr {
    border-bottom: 1px solid rgba(148, 163, 184, 0.15);
    transition: background 0.2s;
}

body.tracking-page tbody tr:hover {
    background: rgba(56, 189, 248, 0.08);
    cursor: pointer;
}

body.tracking-page tbody tr.selected {
    background: rgba(56, 189, 248, 0.18);
}

/* 表格环比列：股市习惯 上升红、下降绿 */
body.tracking-page td.positive {
    color: #ef4444;
}
body.tracking-page td.negative {
    color: #22c55e;
}

body.tracking-page .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.2);
    color: #cbd5f5;
}

/* 股市习惯：上升红、下降绿 */
body.tracking-page .badge.positive {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

body.tracking-page .badge.negative {
    background: rgba(34, 197, 94, 0.2);
    color: #22c55e;
}

body.tracking-page .detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
    margin: 20px 0;
}

body.tracking-page .detail-grid .metric-card {
    border-radius: 18px;
}

body.tracking-page .timeline {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-top: 16px;
}

body.tracking-page .timeline-item {
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 14px;
    padding: 12px;
}

body.tracking-page .timeline-date {
    font-size: 12px;
    color: #94a3b8;
    margin-bottom: 6px;
}

body.tracking-page .timeline-value {
    font-size: 20px;
    font-weight: 600;
}

body.tracking-page .api-log {
    margin-top: 18px;
    border-top: 1px solid rgba(148, 163, 184, 0.18);
    padding-top: 12px;
    font-size: 13px;
    color: #94a3b8;
}

body.tracking-page .api-log li {
    margin: 4px 0;
    font-family: 'JetBrains Mono', 'SFMono-Regular', Consolas, monospace;
}

body.tracking-page .local-warning {
    background: rgba(248, 180, 0, 0.15);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.4);
    padding: 16px;
    border-radius: 16px;
    margin-top: 12px;
}

body.tracking-page footer {
    text-align: center;
    color: #94a3b8;
    padding: 20px 0 10px;
    font-size: 14px;
}

@media (max-width: 768px) {
    body.tracking-page {
        padding: 24px 14px 40px;
    }

    body.tracking-page .hero {
        flex-direction: column;
    }

    body.tracking-page .card-grid,
    body.tracking-page .chart-grid,
    body.tracking-page .detail-grid {
        grid-template-columns: 1fr;
    }
}

/* 首页：技术学习演示中心 */
body.home-page {
    padding: 40px 20px;
}

body.home-page .container {
    max-width: 1200px;
    margin: 0 auto;
}

body.home-page header {
    text-align: center;
    color: white;
    margin-bottom: 50px;
}

.demo-main-site-bar {
    margin: 0 0 20px;
    font-size: 15px;
    opacity: 0.95;
}

.demo-main-site-bar a {
    color: #fff;
    text-decoration: none;
    font-weight: 600;
}

.demo-main-site-bar a:hover {
    text-decoration: underline;
}

.demo-main-site-bar span {
    margin: 0 8px;
    opacity: 0.7;
}

body.home-page h1 {
    font-size: 48px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.home-page .subtitle {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 10px;
}

body.home-page .last-updated {
    font-size: 14px;
    opacity: 0.7;
    font-style: italic;
}

body.home-page .lab-series {
    margin-bottom: 28px;
    padding: 28px 32px 32px;
    border-radius: 24px;
    background: #fff;
    color: #1f2937;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

body.home-page .lab-series-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

body.home-page .lab-series-kicker {
    font-size: 12px;
    letter-spacing: 0.12em;
    font-weight: 700;
    color: #1fa89a;
    margin-bottom: 6px;
}

body.home-page .lab-series h2 {
    font-size: 28px;
    line-height: 1.2;
    color: #1e293b;
    margin-bottom: 8px;
}

body.home-page .lab-series-head p {
    color: #64748b;
    font-size: 15px;
    line-height: 1.5;
    max-width: 40em;
}

body.home-page .lab-series-all {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    background: #1e293b;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

body.home-page .lab-series-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

@media (max-width: 1100px) {
    body.home-page .lab-series-grid {
        grid-template-columns: 1fr 1fr;
    }
}

body.home-page .lab-series-card {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-height: 148px;
    padding: 16px;
    border-radius: 16px;
    text-decoration: none;
    background: #f0f4fa;
    color: #1e293b;
    border-top: 3px solid #2b4c8c;
}

body.home-page .lab-series-card:nth-child(2) { border-top-color: #1fa89a; }
body.home-page .lab-series-card:nth-child(3) { border-top-color: #ff6b5c; }
body.home-page .lab-series-card:nth-child(4) { border-top-color: #e8b84a; }

body.home-page .lab-series-card span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    color: #2b4c8c;
}

body.home-page .lab-series-card h3 {
    font-size: 18px;
    line-height: 1.3;
}

body.home-page .lab-series-card p {
    color: #64748b;
    font-size: 14px;
    line-height: 1.5;
}

body.home-page .lab-series-card:hover {
    transform: translateY(-3px);
}

body.home-page .demo-spotlight {
    margin-bottom: 40px;
    padding: 28px 32px 32px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(12px);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.18);
}

body.home-page .demo-spotlight-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

body.home-page .demo-spotlight-heading {
    color: #fff;
    font-size: 28px;
    margin-bottom: 8px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

body.home-page .demo-spotlight-sub {
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    line-height: 1.5;
}

body.home-page .demo-spotlight-refresh {
    padding: 10px 20px;
    border: none;
    border-radius: 999px;
    background: #fff;
    color: #5b4bb7;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s, box-shadow 0.2s;
}

body.home-page .demo-spotlight-refresh:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

body.home-page .demo-spotlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

body.home-page .demo-spotlight-card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 20px;
    border-radius: 16px;
    background: #fff;
    color: #1f2937;
    text-decoration: none;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s, box-shadow 0.25s;
    min-height: 160px;
}

body.home-page .demo-spotlight-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

body.home-page .demo-spotlight-tag {
    display: inline-block;
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #eef2ff, #fae8ff);
    color: #5b21b6;
    font-size: 12px;
    font-weight: 600;
}

body.home-page .demo-spotlight-title {
    font-size: 18px;
    line-height: 1.35;
    color: #111827;
}

body.home-page .demo-spotlight-desc {
    flex: 1;
    font-size: 14px;
    line-height: 1.55;
    color: #6b7280;
}

body.home-page .demo-spotlight-cta {
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
}

body.home-page .demo-spotlight-loading,
body.home-page .demo-spotlight-error {
    color: rgba(255, 255, 255, 0.9);
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
}

body.home-page .categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

body.home-page .category-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s, box-shadow 0.3s;
    animation: fadeInUp 0.6s ease-out;
}

body.home-page .category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

body.home-page .category-card:nth-child(1) {
    animation-delay: 0.1s;
}

body.home-page .category-card:nth-child(2) {
    animation-delay: 0.2s;
}

body.home-page .category-header {
    display: flex;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 3px solid #f0f0f0;
}

body.home-page .category-icon {
    font-size: 48px;
    margin-right: 20px;
}

body.home-page .category-info h2 {
    color: #333;
    font-size: 28px;
    margin-bottom: 8px;
}

body.home-page .category-desc {
    color: #666;
    font-size: 14px;
}

body.home-page .page-list {
    list-style: none;
}

body.home-page .page-item {
    margin-bottom: 15px;
}

body.home-page .page-link {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
    border: 2px solid transparent;
}

body.home-page .page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateX(5px);
}

body.home-page .page-icon {
    font-size: 24px;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

body.home-page .page-info {
    flex: 1;
}

body.home-page .page-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 5px;
}

body.home-page .page-description {
    font-size: 14px;
    opacity: 0.8;
}

body.home-page .page-difficulty {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    vertical-align: middle;
}

body.home-page .page-difficulty--入门 {
    background: #dcfce7;
    color: #166534;
}

body.home-page .page-difficulty--进阶 {
    background: #fef3c7;
    color: #92400e;
}

body.home-page .page-difficulty--高级 {
    background: #fee2e2;
    color: #991b1b;
}

body.home-page .demo-search-section {
    margin-bottom: 32px;
}

body.home-page .demo-search-wrap {
    position: relative;
    max-width: 640px;
    margin: 0 auto 24px;
}

body.home-page .demo-search-input {
    width: 100%;
    padding: 16px 22px;
    border: none;
    border-radius: 999px;
    font-size: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    outline: none;
}

body.home-page .demo-search-input:focus {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2), 0 0 0 3px rgba(255, 255, 255, 0.35);
}

body.home-page .demo-search-results {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px);
    z-index: 20;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    max-height: 360px;
    overflow-y: auto;
}

body.home-page .demo-search-hit {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    text-decoration: none;
    color: #111827;
    border-bottom: 1px solid #f3f4f6;
}

body.home-page .demo-search-hit:hover {
    background: #f8f9ff;
}

body.home-page .demo-search-hit-icon {
    font-size: 22px;
}

body.home-page .demo-search-hit-body {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

body.home-page .demo-search-hit-body small {
    color: #6b7280;
    font-size: 12px;
}

body.home-page .demo-search-empty {
    padding: 20px;
    text-align: center;
    color: #6b7280;
}

body.home-page .learning-paths-section {
    margin-bottom: 40px;
}

body.home-page .learning-paths-heading {
    color: #fff;
    font-size: 28px;
    margin-bottom: 8px;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.25);
}

body.home-page .learning-paths-sub {
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
    margin-bottom: 20px;
}

body.home-page .learning-paths-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

body.home-page .learning-path-card {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 22px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.95);
    text-decoration: none;
    color: #111827;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    transition: transform 0.25s, box-shadow 0.25s;
}

body.home-page .learning-path-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.18);
}

body.home-page .learning-path-icon {
    font-size: 36px;
    line-height: 1;
}

body.home-page .learning-path-body {
    flex: 1;
}

body.home-page .learning-path-title {
    font-size: 18px;
    margin-bottom: 6px;
}

body.home-page .learning-path-desc {
    font-size: 13px;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 10px;
}

body.home-page .learning-path-meta {
    display: flex;
    gap: 8px;
    align-items: center;
}

body.home-page .learning-path-steps {
    font-size: 12px;
    color: #667eea;
    font-weight: 600;
}

body.home-page .learning-path-cta {
    align-self: center;
    font-size: 14px;
    font-weight: 600;
    color: #667eea;
    white-space: nowrap;
}

body.home-page .demo-categories--filtered {
    opacity: 0.35;
    pointer-events: none;
}

body.home-page .demo-catalog-error {
    color: #fff;
    text-align: center;
    padding: 40px;
    grid-column: 1 / -1;
}

/* 演示页路径导航（全站通用） */
#demo-nav-mount {
    max-width: 1200px;
    margin: 0 auto 16px;
}

.demo-site-links {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 14px;
    margin: 0 0 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #eef2ff 0%, #f0fdf4 100%);
    border: 1px solid #c7d2fe;
    border-radius: 10px;
    font-size: 14px;
}

.demo-site-links a {
    color: #4338ca;
    text-decoration: none;
    font-weight: 500;
}

.demo-site-links a:hover {
    text-decoration: underline;
}

.demo-site-links-brand {
    font-weight: 700 !important;
    color: #312e81 !important;
}

.demo-site-links-sep {
    color: #94a3b8;
}

.demo-breadcrumb {
    margin: 0 0 12px;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #334155;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.demo-breadcrumb a {
    color: #4338ca;
    text-decoration: none;
    font-weight: 600;
}

.demo-breadcrumb a:hover {
    color: #312e81;
    text-decoration: underline;
}

.demo-breadcrumb-sep {
    margin: 0 8px;
    color: #94a3b8;
}

.demo-breadcrumb-current {
    color: #0f172a;
    font-weight: 600;
}

.demo-breadcrumb--only {
    margin-bottom: 0;
}

.demo-path-nav {
    margin: 0 0 20px;
    padding: 16px 20px;
    background: #fff;
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
}

.demo-path-nav-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 14px;
}

.demo-nav-home,
.demo-nav-path-link {
    color: #4338ca;
    text-decoration: none;
    font-weight: 600;
}

.demo-nav-home:hover,
.demo-nav-path-link:hover {
    text-decoration: underline;
}

.demo-nav-progress {
    margin-left: auto;
    padding: 4px 12px;
    border-radius: 999px;
    background: #eef2ff;
    color: #312e81;
    font-size: 13px;
    font-weight: 600;
}

.demo-nav-steps {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 14px;
}

.demo-nav-step {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #c7d2fe;
    color: #6366f1;
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: all 0.2s;
}

.demo-nav-step:hover {
    border-color: #6366f1;
    transform: scale(1.08);
}

.demo-nav-step--active {
    background: #6366f1;
    border-color: #6366f1;
    color: #fff;
}

.demo-nav-step--done {
    background: #dcfce7;
    border-color: #86efac;
    color: #166534;
}

.demo-path-nav-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.demo-nav-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 999px;
    background: #6366f1;
    color: #fff;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, transform 0.2s;
}

.demo-nav-btn:hover {
    background: #4f46e5;
    transform: translateY(-1px);
}

.demo-nav-btn--disabled {
    padding: 10px 18px;
    border-radius: 999px;
    background: #e2e8f0;
    color: #94a3b8;
    font-size: 14px;
}

.demo-nav-prev {
    background: #64748b;
}

.demo-nav-prev:hover {
    background: #475569;
}

.demo-nav-progress-bar {
    height: 6px;
    background: #e0e7ff;
    border-radius: 999px;
    margin-bottom: 14px;
    overflow: hidden;
}

.demo-nav-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #6366f1, #8b5cf6);
    border-radius: 999px;
    transition: width 0.4s ease;
}

.demo-nav-step--done {
    font-size: 11px;
}

.demo-path-badge-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    max-width: 360px;
    transform: translateY(120%);
    opacity: 0;
    transition: transform 0.4s ease, opacity 0.4s ease;
    pointer-events: none;
}

.demo-path-badge-toast--show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.demo-path-badge-inner {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #f59e0b;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(245, 158, 11, 0.35);
}

.demo-path-badge-icon {
    font-size: 36px;
    line-height: 1;
}

.demo-path-badge-title {
    display: block;
    color: #92400e;
    font-size: 16px;
    margin-bottom: 4px;
}

.demo-path-badge-desc {
    color: #78350f;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

.demo-path-badge-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 22px;
    color: #92400e;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
}

body.home-page .page-arrow {
    font-size: 20px;
    opacity: 0.5;
    transition: opacity 0.3s;
}

body.home-page .page-link:hover .page-arrow {
    opacity: 1;
}

body.home-page .stats {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: fadeInUp 0.6s ease-out 0.3s backwards;
}

body.home-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

body.home-page .stat-item {
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 15px;
    color: white;
}

body.home-page .stat-number {
    font-size: 36px;
    font-weight: bold;
    margin-bottom: 5px;
}

body.home-page .stat-label {
    font-size: 14px;
    opacity: 0.9;
}

body.home-page footer {
    text-align: center;
    color: var(--bx-ink);
    margin-top: 50px;
    opacity: 1;
    font-size: 14px;
}

body.home-page .summary-section {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 15px;
    padding: 20px;
    margin-top: 30px;
    backdrop-filter: blur(10px);
}

body.home-page .summary-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 15px;
    opacity: 1;
    color: white;
}

body.home-page .summary-content {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-top: 10px;
}

body.home-page .summary-item {
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 20px;
    border-radius: 10px;
    font-size: 14px;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.home-page .summary-item strong {
    display: block;
    font-size: 16px;
    margin-bottom: 5px;
    color: #333;
}

body.home-page .summary-loading {
    opacity: 0.7;
    font-style: italic;
    color: white;
}

body.home-page .summary-error {
    opacity: 0.7;
    color: #ffcccc;
}

@media (max-width: 768px) {
    body.home-page {
        padding: 24px 12px 32px;
    }

    body.home-page .categories {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    body.home-page .category-card {
        padding: 20px 16px;
        min-width: 0;
    }

    body.home-page .demo-spotlight {
        padding: 20px 16px;
    }

    body.home-page .demo-spotlight-header {
        flex-direction: column;
        align-items: stretch;
    }

    body.home-page .demo-spotlight-grid {
        grid-template-columns: 1fr;
    }

    body.home-page .lab-series {
        padding: 20px 16px;
    }

    body.home-page .lab-series-grid {
        grid-template-columns: 1fr;
    }

    body.home-page .learning-paths-grid {
        grid-template-columns: 1fr;
    }

    body.home-page .demo-main-site-bar {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 6px 10px;
        line-height: 1.6;
    }

    body.home-page .demo-main-site-bar span {
        margin: 0;
    }

    body.home-page .page-link {
        padding: 12px 14px;
    }

    body.home-page .page-title {
        font-size: 16px;
    }

    body.home-page h1 {
        font-size: 36px;
    }

    body.home-page .category-header {
        flex-direction: column;
        text-align: center;
    }

    body.home-page .category-icon {
        margin-right: 0;
        margin-bottom: 15px;
    }

    .demo-path-nav {
        padding: 12px 14px;
    }

    .demo-path-nav-top {
        flex-direction: column;
        align-items: flex-start;
    }

    .demo-nav-progress {
        margin-left: 0;
    }

    .demo-path-nav-actions {
        flex-direction: column;
    }

    .demo-nav-btn {
        width: 100%;
        text-align: center;
        justify-content: center;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ONNX.js 图片增强 */
body.image-enhance-page .container {
    max-width: 1400px;
    margin: 0 auto;
}

body.image-enhance-page header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

body.image-enhance-page h1 {
    font-size: 42px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.image-enhance-page .subtitle {
    font-size: 16px;
    opacity: 0.9;
}

body.image-enhance-page .main-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

body.image-enhance-page .upload-section {
    margin-bottom: 30px;
}

body.image-enhance-page .upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
}

body.image-enhance-page .upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
}

body.image-enhance-page .upload-area.dragover {
    background: #e8ebff;
    border-color: #764ba2;
    transform: scale(1.02);
}

body.image-enhance-page .upload-icon {
    font-size: 64px;
    margin-bottom: 15px;
}

body.image-enhance-page .upload-text {
    font-size: 18px;
    color: #667eea;
    margin-bottom: 10px;
}

body.image-enhance-page .upload-hint {
    font-size: 14px;
    color: #999;
}

body.image-enhance-page #fileInput {
    display: none;
}

body.image-enhance-page .controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 30px;
}

body.image-enhance-page .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

body.image-enhance-page .btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.image-enhance-page .btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

body.image-enhance-page .btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.image-enhance-page .btn-secondary {
    background: #f0f0f0;
    color: #333;
}

body.image-enhance-page .btn-secondary:hover {
    background: #e0e0e0;
}

body.image-enhance-page .model-select {
    flex: 1;
    min-width: 200px;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 10px;
    font-size: 16px;
}

body.image-enhance-page .size-control {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    margin-bottom: 20px;
}

body.image-enhance-page .size-control label {
    font-weight: 500;
    color: #333;
    white-space: nowrap;
}

body.image-enhance-page .size-slider-container {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.image-enhance-page .size-slider {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

body.image-enhance-page .size-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    transition: all 0.2s;
}

body.image-enhance-page .size-slider::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

body.image-enhance-page .size-slider::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    cursor: pointer;
    border: none;
    transition: all 0.2s;
}

body.image-enhance-page .size-slider::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
}

body.image-enhance-page .size-value {
    min-width: 60px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
    font-size: 16px;
}

body.image-enhance-page #modelInfo code {
    background: #fff;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
    font-size: 13px;
}

body.image-enhance-page .image-comparison {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 30px;
}

body.image-enhance-page .image-panel {
    text-align: center;
}

body.image-enhance-page .image-panel h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 20px;
}

body.image-enhance-page .image-container {
    position: relative;
    background: #f5f5f5;
    border: 3px dashed #ddd;
    border-radius: 15px;
    overflow: hidden;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.image-enhance-page .image-container.has-image {
    border: none;
}

body.image-enhance-page .image-container img {
    max-width: 100%;
    max-height: 600px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

body.image-enhance-page .placeholder {
    color: #999;
    font-size: 16px;
}

body.image-enhance-page .loading {
    display: none;
    text-align: center;
    padding: 20px;
}

body.image-enhance-page .loading.active {
    display: block;
}

body.image-enhance-page .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

body.image-enhance-page .status {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    display: none;
}

body.image-enhance-page .status.active {
    display: block;
}

body.image-enhance-page .status.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

body.image-enhance-page .status.success {
    background: #e8f5e9;
    color: #388e3c;
    border-left: 4px solid #388e3c;
}

body.image-enhance-page .status.error {
    background: #ffebee;
    color: #d32f2f;
    border-left: 4px solid #d32f2f;
}

body.image-enhance-page .stats {
    display: flex;
    gap: 20px;
    margin-top: 20px;
    flex-wrap: wrap;
}

body.image-enhance-page .stat-item {
    flex: 1;
    min-width: 150px;
    padding: 15px;
    background: #f8f9ff;
    border-radius: 10px;
    text-align: center;
}

body.image-enhance-page .stat-label {
    font-size: 14px;
    color: #666;
    margin-bottom: 5px;
}

body.image-enhance-page .stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #667eea;
}

@media (max-width: 768px) {
    body.image-enhance-page .image-comparison {
        grid-template-columns: 1fr;
    }

    body.image-enhance-page h1 {
        font-size: 32px;
    }

    body.image-enhance-page .controls {
        flex-direction: column;
    }
}

/* YOLO 演示页面 */
body.yolo-page .container {
    max-width: 1400px;
    margin: 0 auto;
}

body.yolo-page header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

body.yolo-page h1 {
    font-size: 42px;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.yolo-page .subtitle {
    font-size: 16px;
    opacity: 0.9;
}

body.yolo-page .main-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 20px;
}

body.yolo-page .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    border-bottom: 2px solid #e0e0e0;
}

body.yolo-page .tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.3s;
    font-weight: 500;
}

body.yolo-page .tab:hover {
    color: #667eea;
}

body.yolo-page .tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

body.yolo-page .tab-content {
    display: none;
}

body.yolo-page .tab-content.active {
    display: block;
}

body.yolo-page .upload-area {
    border: 3px dashed #667eea;
    border-radius: 15px;
    padding: 40px;
    text-align: center;
    background: #f8f9ff;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 20px;
}

body.yolo-page .upload-area:hover {
    background: #f0f2ff;
    border-color: #764ba2;
}

body.yolo-page .upload-area.dragover {
    background: #e8ebff;
    border-color: #764ba2;
    transform: scale(1.02);
}

body.yolo-page .upload-icon {
    font-size: 64px;
    color: #667eea;
    margin-bottom: 15px;
}

body.yolo-page .upload-text {
    font-size: 18px;
    color: #333;
    margin-bottom: 10px;
}

body.yolo-page .upload-hint {
    font-size: 14px;
    color: #999;
}

body.yolo-page input[type="file"] {
    display: none;
}

body.yolo-page .controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    align-items: center;
}

body.yolo-page .btn {
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

body.yolo-page .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

body.yolo-page .btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

body.yolo-page .btn-secondary {
    background: #6c757d;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
}

body.yolo-page .btn-secondary:hover:not(:disabled) {
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.6);
}

body.yolo-page .slider-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

body.yolo-page .slider-label {
    font-size: 14px;
    color: #666;
    white-space: nowrap;
}

body.yolo-page input[type="range"] {
    flex: 1;
    height: 6px;
    border-radius: 3px;
    background: #e0e0e0;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

body.yolo-page input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

body.yolo-page input[type="range"]::-moz-range-thumb {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

body.yolo-page .image-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

body.yolo-page .image-box {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.yolo-page .image-box canvas {
    max-width: 100%;
    max-height: 600px;
    border-radius: 10px;
}

body.yolo-page .image-label {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
}

body.yolo-page .status {
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    line-height: 1.6;
    white-space: pre-wrap;
    display: none;
}

body.yolo-page .status.show {
    display: block;
}

body.yolo-page .status.info {
    background: #e3f2fd;
    color: #1976d2;
    border-left: 4px solid #1976d2;
}

body.yolo-page .status.success {
    background: #e8f5e9;
    color: #388e3c;
    border-left: 4px solid #388e3c;
}

body.yolo-page .status.error {
    background: #ffebee;
    color: #d32f2f;
    border-left: 4px solid #d32f2f;
}

body.yolo-page .loading {
    display: none;
    text-align: center;
    padding: 20px;
}

body.yolo-page .loading.active {
    display: block;
}

body.yolo-page .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 10px;
}

body.yolo-page .model-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

body.yolo-page .model-info strong {
    color: #667eea;
}

body.yolo-page .model-selector {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    margin-bottom: 20px;
}

body.yolo-page .model-selector label {
    display: block;
    font-weight: 500;
    margin-bottom: 10px;
    color: #333;
}

body.yolo-page .model-select {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

body.yolo-page .model-select:hover {
    border-color: #667eea;
}

body.yolo-page .model-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

body.yolo-page .detection-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

body.yolo-page .stat-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

body.yolo-page .stat-value {
    font-size: 32px;
    font-weight: bold;
    margin-bottom: 5px;
}

body.yolo-page .stat-label {
    font-size: 14px;
    opacity: 0.9;
}

body.yolo-page .detection-table-container {
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow-x: auto;
}

body.yolo-page .detection-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

body.yolo-page .detection-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

body.yolo-page .detection-table th {
    padding: 12px;
    text-align: left;
}

body.yolo-page .detection-table td {
    padding: 10px;
    border-bottom: 1px solid #f0f0f0;
}

body.yolo-page .detection-table tbody tr:hover {
    background: #f8f9ff;
}

body.yolo-page .camera-container {
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

body.yolo-page .camera-preview {
    width: 100%;
    border-radius: 10px;
    background: #000;
}

body.yolo-page .camera-controls {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 15px;
}

body.yolo-page .segment-overlay {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

body.yolo-page .segment-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 10px;
}

body.yolo-page .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
}

body.yolo-page .legend-color {
    width: 14px;
    height: 14px;
    border-radius: 3px;
}

body.yolo-page .model-downloads {
    margin-top: 20px;
}

body.yolo-page .model-downloads ul {
    margin-top: 10px;
    padding-left: 20px;
}

body.yolo-page .model-downloads li {
    margin-bottom: 6px;
    color: #333;
}

body.yolo-page .advanced-settings {
    margin-top: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

body.yolo-page .advanced-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

body.yolo-page .advanced-item label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 6px;
}

body.yolo-page .advanced-item input,
body.yolo-page .advanced-item select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
}

body.yolo-page .advanced-item small {
    display: block;
    margin-top: 4px;
    color: #888;
}

body.yolo-page .tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
    padding: 6px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
}

body.yolo-page .tag::before {
    content: "●";
    font-size: 10px;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* ============================================
   chem 页面样式 - mhchem 化学公式演示
   ============================================ */
body.chem-page .container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

body.chem-page .header {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

body.chem-page .header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.chem-page .header p {
    font-size: 1.2em;
    opacity: 0.9;
}

body.chem-page .content {
    padding: 30px;
}

body.chem-page .section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #43e97b;
}

body.chem-page .section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
    display: flex;
    align-items: center;
    gap: 10px;
}

body.chem-page .section h3 {
    color: #555;
    margin: 20px 0 10px 0;
    font-size: 1.3em;
}

body.chem-page .demo-box {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.chem-page .demo-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 15px 0;
    align-items: center;
}

body.chem-page .chem-demo-intro {
    color: #555;
    line-height: 1.65;
    margin: 0 0 18px 0;
    font-size: 0.95em;
}

body.chem-page .chem-demo-block {
    margin: 14px 0 22px 0;
}

body.chem-page .chem-demo-block .demo-row {
    margin-top: 0;
    margin-bottom: 0;
}

body.chem-page .chem-demo-meta {
    margin: 0 0 8px 0;
    font-size: 0.95em;
    color: #444;
    line-height: 1.55;
}

body.chem-page .chem-demo-meta code {
    font-size: 0.88em;
    background: #f0f0f0;
    padding: 1px 5px;
    border-radius: 3px;
}

body.chem-page .code-display {
    background: #2d2d2d;
    color: #f8f8f2;
    padding: 15px;
    border-radius: 5px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 14px;
    overflow-x: auto;
    white-space: pre;
}

body.chem-page .code-display[contenteditable="true"] {
    outline: none;
    cursor: text;
    transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

body.chem-page .code-display[contenteditable="true"]:focus {
    background: #ffffff;
    color: #1a1a1a;
    box-shadow: 0 0 0 2px rgba(67, 233, 123, 0.55);
}

body.chem-page .result-display-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    align-self: stretch;
}

body.chem-page .demo-row .result-display-stack {
    justify-content: center;
}

body.chem-page .result-display-bar {
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}

body.chem-page .btn-copy-svg {
    font-size: 12px;
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid #43e97b;
    background: #fff;
    color: #2e7d32;
    cursor: pointer;
    font-family: inherit;
}

body.chem-page .btn-copy-svg:hover {
    background: #e8f5e9;
}

body.chem-page .math-render-error-msg {
    color: #c62828;
    font-size: 0.85em;
}

body.chem-page .result-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 5px;
    font-size: 1.5em;
    text-align: center;
    border: 2px solid #43e97b;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

body.chem-page .result-display-stack > .result-display {
    flex: 1;
    width: 100%;
}

body.chem-page .result-display::-webkit-scrollbar {
    height: 8px;
}

body.chem-page .result-display::-webkit-scrollbar-track {
    background: #e0e0e0;
    border-radius: 4px;
}

body.chem-page .result-display::-webkit-scrollbar-thumb {
    background: #43e97b;
    border-radius: 4px;
}

body.chem-page .result-display::-webkit-scrollbar-thumb:hover {
    background: #38d970;
}

body.chem-page .explanation {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #3498db;
    margin: 20px 0;
}

body.chem-page .explanation p {
    line-height: 1.6;
    color: #555;
    margin: 10px 0;
}

body.chem-page .tip-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-left: 5px solid #ffc107;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

body.chem-page .tip-box strong {
    color: #856404;
}

body.chem-page .interactive-section {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 8px;
    border-radius: 5px;
    margin: 6px 0;
}

body.chem-page .input-group {
    margin: 10px 0;
}

body.chem-page .input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    color: #333;
}

body.chem-page .input-group input {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-family: 'Consolas', 'Monaco', monospace;
}

body.chem-page .input-group input:focus {
    outline: none;
    border-color: #43e97b;
}

body.chem-page .btn {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    margin: 6px 3px;
}

body.chem-page .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(67, 233, 123, 0.4);
}

body.chem-page .category-tag {
    display: inline-block;
    background: #43e97b;
    color: white;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.9em;
    margin: 3px;
}

body.chem-page table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
    background: white;
}

body.chem-page table th,
body.chem-page table td {
    border: 1px solid #ddd;
    padding: 12px;
    text-align: left;
}

body.chem-page table th {
    background: #43e97b;
    color: white;
    font-weight: bold;
}

body.chem-page table tr:nth-child(even) {
    background: #f8f9fa;
}

body.chem-page .example-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin: 20px 0;
}

body.chem-page .example-card {
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    padding: 15px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-width: 0;
}

body.chem-page .example-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.chem-page .example-card h4 {
    margin-bottom: 10px;
    color: #333;
}

body.chem-page .example-card .code-display {
    font-size: 12px;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

body.chem-page .example-card .result-display {
    font-size: 1.3em;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 15px 10px;
    justify-content: flex-start;
}

body.chem-page .back-button {
    display: inline-block;
    background: #6c757d;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    text-decoration: none;
    margin: 20px 0;
    transition: background 0.3s;
}

body.chem-page .back-button:hover {
    background: #5a6268;
}

@media (max-width: 768px) {
    body.chem-page .demo-row {
        grid-template-columns: 1fr;
    }

    body.chem-page .header h1 {
        font-size: 2em;
    }

    body.chem-page .content {
        padding: 20px;
    }

    body.chem-page .result-display {
        font-size: 1.2em;
        padding: 15px 10px;
        justify-content: flex-start;
        text-align: left;
    }

    body.chem-page .example-card .result-display {
        font-size: 1.1em;
    }
}

/* ============================================
   math 页面样式 - SVD 奇异值分解演示
   ============================================ */
body.math-page .container {
    max-width: 1400px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

body.math-page .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

body.math-page .header h1 {
    font-size: 48px;
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.math-page .header p {
    font-size: 18px;
    opacity: 0.9;
}

body.math-page .content {
    padding: 40px;
}

body.math-page .control-panel {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

body.math-page .control-group {
    margin-bottom: 25px;
}

body.math-page .control-group:last-child {
    margin-bottom: 0;
}

body.math-page .control-label {
    display: block;
    font-weight: bold;
    margin-bottom: 10px;
    color: #333;
    font-size: 16px;
}

body.math-page .matrix-input {
    display: grid;
    gap: 5px;
    margin-bottom: 15px;
}

body.math-page .matrix-input input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

body.math-page .matrix-input input:focus {
    outline: none;
    border-color: #667eea;
}

body.math-page .slider-container {
    display: flex;
    align-items: center;
    gap: 15px;
}

body.math-page .slider {
    flex: 1;
    height: 8px;
    border-radius: 4px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

body.math-page .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
}

body.math-page .slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
}

body.math-page .slider-value {
    min-width: 50px;
    text-align: center;
    font-weight: bold;
    color: #667eea;
}

body.math-page .button-group {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

body.math-page .btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}

body.math-page .btn-primary {
    background: #667eea;
    color: white;
}

body.math-page .btn-primary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

body.math-page .btn-secondary {
    background: #6c757d;
    color: white;
}

body.math-page .btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

body.math-page .btn-success {
    background: #28a745;
    color: white;
}

body.math-page .btn-success:hover {
    background: #218838;
    transform: translateY(-2px);
}

body.math-page .visualization-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 30px;
}

body.math-page .matrix-display {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

body.math-page .matrix-display h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

body.math-page .matrix {
    display: grid;
    gap: 5px;
    justify-content: center;
    margin-bottom: 15px;
}

body.math-page .matrix-cell {
    width: 50px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-weight: bold;
    font-size: 14px;
}

body.math-page .matrix-cell.highlight {
    background: #fff3cd;
    border-color: #ffc107;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

body.math-page .chart-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 2px solid #e9ecef;
}

body.math-page .chart-container h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

body.math-page .chart-wrapper {
    position: relative;
    height: 300px;
}

body.math-page .formula-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    border: 2px solid #e9ecef;
}

body.math-page .formula-section h3 {
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

body.math-page .formula {
    text-align: center;
    font-size: 18px;
    margin: 20px 0;
    padding: 20px;
    background: white;
    border-radius: 10px;
    border: 1px solid #ddd;
}

body.math-page .explanation {
    background: #e3f2fd;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border-left: 5px solid #2196f3;
}

body.math-page .explanation h3 {
    color: #1976d2;
    margin-bottom: 15px;
}

body.math-page .explanation p {
    margin-bottom: 10px;
    line-height: 1.6;
}

body.math-page .back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #667eea;
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 20px;
    transition: color 0.3s;
}

body.math-page .back-link:hover {
    color: #5a6fd8;
}

body.math-page .loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

body.math-page .spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@media (max-width: 768px) {
    body.math-page .visualization-container {
        grid-template-columns: 1fr;
    }

    body.math-page .header h1 {
        font-size: 36px;
    }

    body.math-page .content {
        padding: 20px;
    }

    body.math-page .button-group {
        flex-direction: column;
    }
}

/* ============================================
   ml 页面样式 - MLE 和 BiasSVD 演示
   ============================================ */
body.ml-page .container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

body.ml-page .header {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    padding: 30px;
    text-align: center;
}

body.ml-page .header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

body.ml-page .header p {
    font-size: 1.2em;
    opacity: 0.9;
}

body.ml-page .content {
    padding: 30px;
}

body.ml-page .section {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 10px;
    border-left: 5px solid #4facfe;
}

body.ml-page .section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

body.ml-page .controls {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    align-items: center;
}

body.ml-page .control-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

body.ml-page .control-group label {
    font-weight: bold;
    color: #555;
}

body.ml-page .control-group input {
    padding: 8px 12px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    transition: border-color 0.3s;
}

body.ml-page .control-group input:focus {
    outline: none;
    border-color: #4facfe;
}

body.ml-page .btn {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
}

body.ml-page .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.4);
}

body.ml-page .chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.ml-page .formula {
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 25px;
    border-radius: 12px;
    font-size: 1.1em;
    text-align: center;
    margin: 20px 0;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
    border: 2px solid #3498db;
    position: relative;
    overflow: hidden;
}

body.ml-page .formula::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #e74c3c, #f39c12, #2ecc71);
}

body.ml-page .formula-display {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 15px 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.ml-page .formula-inline {
    background: #e3f2fd;
    border-left: 4px solid #2196f3;
    padding: 10px 15px;
    margin: 10px 0;
    border-radius: 4px;
    font-family: 'Times New Roman', serif;
}

body.ml-page .explanation {
    background: #e8f4fd;
    padding: 20px;
    border-radius: 10px;
    border-left: 5px solid #3498db;
    margin: 20px 0;
}

body.ml-page .explanation h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

body.ml-page .explanation p {
    line-height: 1.6;
    color: #555;
}

body.ml-page .result {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    font-weight: bold;
}

body.ml-page .data-points {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 15px 0;
}

body.ml-page .data-point {
    background: #4facfe;
    color: white;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: bold;
}

body.ml-page .slider-container {
    margin: 20px 0;
}

body.ml-page .slider {
    width: 100%;
    height: 8px;
    border-radius: 5px;
    background: #ddd;
    outline: none;
    -webkit-appearance: none;
}

body.ml-page .slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4facfe;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

body.ml-page .slider::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #4facfe;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
    -moz-appearance: none;
    appearance: none;
}

/* BiasSVD 特定样式 */
body.ml-page.bias-svd-page .header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

body.ml-page.bias-svd-page .section {
    margin-bottom: 40px;
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

body.ml-page.bias-svd-page .section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
    border-bottom: 3px solid #667eea;
    padding-bottom: 10px;
}

body.ml-page.bias-svd-page .controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

body.ml-page.bias-svd-page .control-group {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.ml-page.bias-svd-page .control-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #333;
}

body.ml-page.bias-svd-page .control-group input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
}

body.ml-page.bias-svd-page .control-group input[type="number"] {
    width: 100%;
    padding: 8px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

body.ml-page.bias-svd-page .control-group .value-display {
    font-size: 18px;
    font-weight: bold;
    color: #667eea;
    text-align: center;
}

body.ml-page.bias-svd-page .button-group {
    text-align: center;
    margin: 20px 0;
}

body.ml-page.bias-svd-page .btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    margin: 0 10px;
    transition: all 0.3s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

body.ml-page.bias-svd-page .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

body.ml-page.bias-svd-page .btn:active {
    transform: translateY(0);
}

body.ml-page.bias-svd-page .matrix-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin: 20px 0;
}

body.ml-page.bias-svd-page .matrix-display {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.ml-page.bias-svd-page .matrix-display h3 {
    margin-bottom: 15px;
    color: #333;
    text-align: center;
}

body.ml-page.bias-svd-page .matrix {
    display: grid;
    gap: 2px;
    margin: 10px 0;
    justify-content: center;
}

body.ml-page.bias-svd-page .matrix-cell {
    background: #f0f0f0;
    border: 1px solid #ddd;
    padding: 8px;
    text-align: center;
    font-family: monospace;
    font-size: 12px;
    min-width: 40px;
    min-height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

body.ml-page.bias-svd-page .matrix-cell.rating {
    background: #e3f2fd;
    border-color: #2196f3;
}

body.ml-page.bias-svd-page .matrix-cell.prediction {
    background: #f3e5f5;
    border-color: #9c27b0;
}

body.ml-page.bias-svd-page .matrix-cell.error {
    background: #ffebee;
    border-color: #f44336;
}

body.ml-page.bias-svd-page .recommendations {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

body.ml-page.bias-svd-page .recommendation-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    margin: 10px 0;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

body.ml-page.bias-svd-page .recommendation-item .user-item {
    font-weight: bold;
    color: #333;
}

body.ml-page.bias-svd-page .recommendation-item .score {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-weight: bold;
}

body.ml-page.bias-svd-page .chart-container {
    position: relative;
    height: 400px;
    margin: 20px 0;
}

body.ml-page.bias-svd-page .formula {
    background: #ffffff;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    border-left: 4px solid #667eea;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

body.ml-page.bias-svd-page .formula p {
    color: #333;
    margin: 10px 0;
}

body.ml-page.bias-svd-page .formula strong {
    color: #2c3e50;
    font-weight: bold;
}

body.ml-page.bias-svd-page .formula ul {
    color: #333;
    margin: 15px 0;
    padding-left: 25px;
}

body.ml-page.bias-svd-page .formula li {
    color: #333;
    margin: 8px 0;
    line-height: 1.8;
}

body.ml-page.bias-svd-page .formula .MathJax,
body.ml-page.bias-svd-page .formula .MathJax * {
    color: #1a1a1a !important;
}

body.ml-page.bias-svd-page .formula mjx-container {
    color: #1a1a1a !important;
}

body.ml-page.bias-svd-page .stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

body.ml-page.bias-svd-page .stat-card {
    background: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.ml-page.bias-svd-page .stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin-bottom: 5px;
}

body.ml-page.bias-svd-page .stat-label {
    color: #666;
    font-size: 14px;
}

body.ml-page.bias-svd-page .training-status {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

body.ml-page.bias-svd-page .training-status h3 {
    margin-bottom: 15px;
    color: #333;
}

body.ml-page.bias-svd-page .progress-bar-container {
    width: 100%;
    height: 30px;
    background: #f0f0f0;
    border-radius: 15px;
    overflow: hidden;
    margin: 10px 0;
    position: relative;
}

body.ml-page.bias-svd-page .progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: width 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

body.ml-page.bias-svd-page .training-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 15px;
}

body.ml-page.bias-svd-page .info-item {
    background: #f8f9fa;
    padding: 10px;
    border-radius: 8px;
    text-align: center;
}

body.ml-page.bias-svd-page .info-item label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

body.ml-page.bias-svd-page .info-item .value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

body.ml-page.bias-svd-page .evaluation {
    background: white;
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-top: 20px;
}

body.ml-page.bias-svd-page .evaluation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

body.ml-page.bias-svd-page .evaluation-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

body.ml-page.bias-svd-page .evaluation-grade {
    font-size: 32px;
    font-weight: bold;
    padding: 10px 20px;
    border-radius: 10px;
    text-align: center;
    min-width: 80px;
}

body.ml-page.bias-svd-page .evaluation-grade.excellent {
    background: linear-gradient(135deg, #4caf50 0%, #81c784 100%);
    color: white;
}

body.ml-page.bias-svd-page .evaluation-grade.good {
    background: linear-gradient(135deg, #8bc34a 0%, #aed581 100%);
    color: white;
}

body.ml-page.bias-svd-page .evaluation-grade.fair {
    background: linear-gradient(135deg, #ffc107 0%, #ffd54f 100%);
    color: #333;
}

body.ml-page.bias-svd-page .evaluation-grade.poor {
    background: linear-gradient(135deg, #ff9800 0%, #ffb74d 100%);
    color: white;
}

body.ml-page.bias-svd-page .evaluation-grade.bad {
    background: linear-gradient(135deg, #f44336 0%, #e57373 100%);
    color: white;
}

body.ml-page.bias-svd-page .evaluation-content {
    line-height: 1.8;
    color: #555;
}

body.ml-page.bias-svd-page .evaluation-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

body.ml-page.bias-svd-page .evaluation-metric {
    text-align: center;
}

body.ml-page.bias-svd-page .evaluation-metric label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

body.ml-page.bias-svd-page .evaluation-metric .value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

body.ml-page.bias-svd-page .evaluation-conclusion {
    margin-top: 20px;
    padding: 15px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

body.ml-page.bias-svd-page .evaluation-conclusion h4 {
    margin-bottom: 10px;
    color: #333;
}

body.ml-page.bias-svd-page .evaluation-conclusion p {
    margin: 8px 0;
    color: #555;
}

@media (max-width: 768px) {
    body.ml-page .controls {
        flex-direction: column;
        align-items: stretch;
    }

    body.ml-page .header h1 {
        font-size: 2em;
    }

    body.ml-page .content {
        padding: 20px;
    }

    body.ml-page.bias-svd-page .matrix-container {
        grid-template-columns: 1fr;
    }

    body.ml-page.bias-svd-page .controls {
        grid-template-columns: 1fr;
    }

    body.ml-page.bias-svd-page .header h1 {
        font-size: 36px;
    }
}

/* ============================================
   net 页面样式 - 限流算法演示
   ============================================ */
body.net-page .container {
    max-width: 1400px;
    margin: 0 auto;
}

body.net-page h1 {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    font-size: 36px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

body.net-page .algorithms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 30px;
}

body.net-page .algorithm-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transition: transform 0.3s;
}

body.net-page .algorithm-card:hover {
    transform: translateY(-5px);
}

body.net-page .algorithm-header {
    text-align: center;
    margin-bottom: 20px;
}

body.net-page .algorithm-title {
    font-size: 24px;
    color: #333;
    margin-bottom: 10px;
}

body.net-page .algorithm-desc {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}

body.net-page .visualization {
    position: relative;
    height: 300px;
    background: #f8f9fa;
    border-radius: 10px;
    margin-bottom: 20px;
    overflow: hidden;
    border: 2px solid #e0e0e0;
}

body.net-page .token-bucket {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 200px;
    border: 3px solid #4CAF50;
    border-radius: 10px;
    background: linear-gradient(to top, #e8f5e9 0%, transparent 100%);
    overflow: hidden;
}

body.net-page .token {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #4CAF50;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

body.net-page .leaky-bucket {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 200px;
    clip-path: polygon(20% 0%, 80% 0%, 100% 100%, 0% 100%);
    border: 3px solid #2196F3;
    background: linear-gradient(to top, #e3f2fd 0%, transparent 100%);
    overflow: hidden;
}

body.net-page .leak-hole {
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 10px;
    background: #2196F3;
    border-radius: 0 0 10px 10px;
}

body.net-page .water-drop {
    position: absolute;
    width: 100%;
    height: 20px;
    background: rgba(33, 150, 243, 0.3);
    border-radius: 5px;
}

body.net-page .fixed-window {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 200px;
    border: 3px solid #FF9800;
    border-radius: 10px;
    background: #fff3e0;
    display: flex;
    flex-wrap: wrap;
    padding: 10px;
    gap: 5px;
    align-content: flex-start;
    overflow: hidden;
}

body.net-page .window-slot {
    width: 30px;
    height: 30px;
    background: #FFE0B2;
    border: 2px solid #FF9800;
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: #F57C00;
}

body.net-page .window-slot.filled {
    background: #FF9800;
    color: white;
}

body.net-page .request {
    position: absolute;
    width: 40px;
    height: 40px;
    background: #9C27B0;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
    animation: fallDown 1s ease-in;
}

@keyframes fallDown {
    from {
        top: -50px;
        opacity: 0;
    }

    to {
        top: 50%;
        opacity: 1;
    }
}

body.net-page .request.accepted {
    background: #4CAF50;
}

body.net-page .request.rejected {
    background: #f44336;
}

body.net-page .controls {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

body.net-page button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: bold;
    color: white;
}

body.net-page .btn-send {
    background: #9C27B0;
}

body.net-page .btn-send:hover {
    background: #7B1FA2;
}

body.net-page .btn-burst {
    background: #FF5722;
}

body.net-page .btn-burst:hover {
    background: #E64A19;
}

body.net-page .btn-reset {
    background: #607D8B;
}

body.net-page .btn-reset:hover {
    background: #455A64;
}

body.net-page .stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    text-align: center;
}

body.net-page .stat-item {
    background: #f5f5f5;
    padding: 10px;
    border-radius: 5px;
}

body.net-page .stat-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 5px;
}

body.net-page .stat-value {
    font-size: 20px;
    font-weight: bold;
    color: #333;
}

body.net-page .stat-value.success {
    color: #4CAF50;
}

body.net-page .stat-value.error {
    color: #f44336;
}

body.net-page .window-timer {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255, 152, 0, 0.9);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-weight: bold;
    font-size: 14px;
}

body.net-page .capacity-display {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 12px;
}

body.net-page .sliding-window {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 280px;
    height: 200px;
    border: 3px solid #E91E63;
    border-radius: 10px;
    background: #fce4ec;
    overflow: hidden;
}

body.net-page .time-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 30px;
    background: linear-gradient(to right, #f8bbd0 0%, #E91E63 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 12px;
}

body.net-page .request-dot {
    position: absolute;
    width: 20px;
    height: 20px;
    background: #E91E63;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 10px;
    font-weight: bold;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

body.net-page .request-dot.expired {
    opacity: 0.3;
    background: #ccc;
}

body.net-page .window-slider {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: calc(100% - 30px);
    border-right: 3px dashed #E91E63;
    animation: slideWindow 10s linear infinite;
}

@keyframes slideWindow {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(-100%);
    }
}

body.net-page .info-table {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

body.net-page table {
    width: 100%;
    border-collapse: collapse;
}

body.net-page th,
body.net-page td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

body.net-page th {
    background: #667eea;
    color: white;
    font-weight: bold;
}

body.net-page tr:hover {
    background: #f5f5f5;
}

/* 通用页脚样式 */
.site-footer {
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    background: rgba(255, 255, 255, 0.5);
    border-radius: 10px;
    font-size: 14px;
    color: #666;
}

.site-footer a {
    color: #2d8659;
    text-decoration: none;
    font-weight: bold;
    transition: color 0.3s;
}

.site-footer a:hover {
    color: #1e5d3f;
    text-decoration: underline;
}

/* 不同页面类型的footer适配 */
body.biology-page .site-footer,
body.ml-page .site-footer,
body.math-page .site-footer,
body.chem-page .site-footer,
body.net-page .site-footer {
    background: rgba(255, 255, 255, 0.9);
    margin: 30px 0 0;
}

body.home-page .site-footer {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

body.home-page .site-footer a {
    color: #ffd166;
}

body.home-page .site-footer a:hover {
    color: #ffc107;
}

/* === 品牌刷新（覆盖紫渐变模板，与 phpems brand 对齐）=== */
body {
    font-family: var(--bx-font-body);
    background: var(--bx-canvas);
    background-image: var(--bx-gradient-mesh);
    color: var(--bx-ink);
    padding: clamp(16px, 3vw, 28px);
}

body.home-page {
    padding: clamp(24px, 4vw, 48px) clamp(16px, 3vw, 28px);
}

body.home-page header {
    text-align: left;
    color: var(--bx-ink);
    margin-bottom: clamp(32px, 5vw, 56px);
    max-width: 720px;
}

body.home-page h1 {
    font-family: var(--bx-font-display);
    font-size: clamp(2rem, 4.5vw, 3rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.15;
    margin-bottom: 12px;
    text-shadow: none;
    color: var(--bx-primary);
}

body.home-page .subtitle {
    font-size: clamp(1rem, 2vw, 1.125rem);
    color: var(--bx-muted);
    opacity: 1;
    max-width: 42ch;
    line-height: 1.6;
}

body.home-page .last-updated {
    color: var(--bx-muted);
    opacity: 1;
    font-style: normal;
    font-size: 13px;
    margin-top: 8px;
}

.demo-main-site-bar {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 10px;
    margin: 0 0 24px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--bx-surface);
    border: 1px solid var(--bx-line);
    box-shadow: var(--bx-shadow-card);
    font-size: 13px;
}

.demo-main-site-bar a {
    color: var(--bx-primary);
    font-weight: 600;
}

.demo-main-site-bar a:hover {
    color: var(--bx-accent);
}

.demo-main-site-bar span {
    opacity: 0.45;
    margin: 0;
}

body.home-page .demo-spotlight {
    background: var(--bx-surface);
    border: 1px solid var(--bx-line);
    box-shadow: var(--bx-shadow-card);
    backdrop-filter: none;
}

body.home-page .demo-spotlight-heading,
body.home-page .learning-paths-heading {
    color: var(--bx-ink);
    text-shadow: none;
    font-family: var(--bx-font-display);
    letter-spacing: -0.02em;
}

body.home-page .demo-spotlight-sub,
body.home-page .learning-paths-sub {
    color: var(--bx-muted);
}

body.home-page .demo-spotlight-refresh {
    background: var(--bx-primary);
    color: #fff;
}

body.home-page .demo-spotlight-refresh:hover {
    background: #234078;
}

body.home-page .demo-spotlight-card {
    background: var(--bx-canvas);
    border: 1px solid var(--bx-line);
    color: var(--bx-ink);
}

body.home-page .category-card {
    border-radius: var(--bx-radius-lg);
    box-shadow: var(--bx-shadow-card);
    border: 1px solid var(--bx-line);
}

body.home-page .category-card:hover {
    box-shadow: var(--bx-shadow-hover);
    transform: translateY(-4px);
}

body.home-page .category-info h2 {
    color: var(--bx-primary);
    font-family: var(--bx-font-display);
}

body.home-page .page-link:hover {
    background: var(--bx-primary-soft);
    color: var(--bx-primary);
    border-color: var(--bx-primary);
    transform: translateX(4px);
}

body.home-page .demo-search-input {
    border: 1px solid var(--bx-line);
    border-radius: var(--bx-radius-md);
    box-shadow: var(--bx-shadow-card);
}

body.home-page .demo-search-input:focus {
    border-color: var(--bx-primary);
    box-shadow: 0 0 0 3px var(--bx-primary-soft);
}

body.home-page .demo-search-hit:hover {
    background: var(--bx-primary-soft);
}

body.home-page .site-footer {
    background: var(--bx-surface);
    color: var(--bx-muted);
    border-top: 1px solid var(--bx-line);
    border-radius: var(--bx-radius-md);
}

body.home-page .site-footer a {
    color: var(--bx-primary);
}

body.home-page .site-footer a:hover {
    color: var(--bx-accent);
}

body.home-page footer a {
    color: var(--bx-primary) !important;
    font-weight: 700;
}

body.home-page footer a:hover {
    color: var(--bx-accent) !important;
}

.demo-site-links {
    background: var(--bx-surface) !important;
    border: 1px solid var(--bx-line) !important;
    border-radius: var(--bx-radius-md) !important;
}

.demo-site-links a {
    color: var(--bx-primary) !important;
}

.demo-breadcrumb {
    background: var(--bx-surface) !important;
    border: 1px solid var(--bx-line) !important;
    color: var(--bx-muted) !important;
    box-shadow: none !important;
}

.demo-breadcrumb a {
    color: var(--bx-primary) !important;
}

.demo-breadcrumb-current {
    color: var(--bx-ink) !important;
}

.demo-path-nav {
    background: var(--bx-surface) !important;
    border: 1px solid var(--bx-line) !important;
    box-shadow: var(--bx-shadow-card) !important;
}

.demo-nav-home,
.demo-nav-path-link {
    color: var(--bx-primary) !important;
}

.demo-nav-progress {
    background: var(--bx-primary-soft) !important;
    color: var(--bx-primary) !important;
}

.demo-nav-btn {
    background: var(--bx-primary) !important;
}

.demo-nav-btn:hover {
    background: #234078 !important;
}

.demo-nav-prev {
    background: var(--bx-canvas) !important;
    color: var(--bx-muted) !important;
    border: 1px solid var(--bx-line) !important;
}

.demo-nav-step--active {
    background: var(--bx-primary) !important;
    border-color: var(--bx-primary) !important;
    color: #fff !important;
}

.demo-nav-step--done {
    background: var(--bx-secondary-soft) !important;
    border-color: rgba(31, 168, 154, 0.45) !important;
    color: var(--bx-secondary) !important;
}

@media (prefers-reduced-motion: reduce) {
    body.home-page .category-card,
    body.home-page .demo-spotlight-refresh,
    body.home-page .page-link {
        transition: none !important;
        animation: none !important;
    }
}