/* ============================================================
   学途 · 通用组件
   统计卡 / 面板 / 表格 / 标签 / 按钮 / 表单 / 弹窗 / 提示 / 加载 / 空状态。

   其中 .card-glass / .panel-glass / .btn-glass 是旧版的玻璃拟态，
   安静皮肤下已被 skin-quiet.css 抹平 —— 保留定义只为回滚，新代码勿用。
   ============================================================ */

/* ============================================
   Stats Cards
   ============================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 28px;
}

.stat-card {
    background: var(--surface);
    border-radius: var(--r);
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border: 1px solid var(--line);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    opacity: 0;
    transition: opacity 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--sh);
}

.stat-card:hover::before { opacity: 1; }

.stat-card:nth-child(1)::before { background: linear-gradient(90deg, #E05555, #E88080); }
.stat-card:nth-child(2)::before { background: linear-gradient(90deg, #7BA7BC, #A4C5D4); }
.stat-card:nth-child(3)::before { background: linear-gradient(90deg, #5B9A6E, #8FBF98); }
.stat-card:nth-child(4)::before { background: linear-gradient(90deg, #9B7BA8, #BBA4C8); }
.stat-card:nth-child(5)::before { background: linear-gradient(90deg, #D4814A, #E0A878); }
.stat-card:nth-child(6)::before { background: linear-gradient(90deg, #D4A24E, #E0C078); }

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--r);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.stat-icon.pink { background: var(--red-soft); color: var(--red); }
.stat-icon.green { background: var(--green-soft); color: var(--green); }
.stat-icon.blue { background: var(--blue-soft); color: var(--blue); }
.stat-icon.orange { background: var(--amber-soft); color: var(--amber); }
.stat-icon.purple { background: var(--purple-soft); color: var(--purple); }
.stat-icon.yellow { background: var(--amber-soft); color: var(--amber); }

.stat-info { min-width: 0; }
.stat-info h3 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; }
.stat-info p { font-size: 0.78rem; color: var(--faint); margin-top: 3px; font-weight: 500; }

/* ============================================
   Panels / Cards
   ============================================ */
.panel {
    background: var(--surface);
    border-radius: var(--r);
    box-shadow: var(--shadow);
    margin-bottom: 24px;
    border: 1px solid var(--line);
    overflow: hidden;
    transition: var(--transition);
}

.panel:hover { box-shadow: var(--sh); }

.panel-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--line);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(to bottom, var(--canvas), var(--surface));
}

.panel-header h3 {
    font-size: 0.925rem;
    font-weight: 650;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
}

.panel-header h3 i { color: var(--brand); font-size: 0.9rem; }

.panel-body { padding: 20px 24px; }

/* ============================================
   Data Table
   ============================================ */
.data-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 0.855rem;
}

.data-table th {
    text-align: left;
    padding: 12px 16px;
    background: var(--canvas);
    color: var(--faint);
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    border-bottom: 1px solid var(--line);
}

.data-table th:first-child { border-radius: var(--r-sm) 0 0 var(--r-sm); }
.data-table th:last-child { border-radius: 0 var(--r-sm) var(--r-sm) 0; }

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    vertical-align: middle;
    color: var(--muted);
}

.data-table tr:last-child td { border-bottom: none; }

.data-table tbody tr {
    transition: var(--transition);
}

.data-table tbody tr:hover td {
    background: var(--brand-tint);
}

/* ============================================
   Badges
   ============================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    gap: 4px;
}

.badge-green { background: var(--green-soft); color: #4A825A; }
.badge-blue { background: var(--blue-soft); color: #5A8A9A; }
.badge-orange { background: var(--amber-soft); color: #B08830; }
.badge-red { background: var(--red-soft); color: #C04545; }
.badge-purple { background: var(--purple-soft); color: #7B5B88; }
.badge-gray { background: #F5EFE8; color: #8A7D72; }
.badge-pink { background: #FBF2F3; color: #B56570; }

/* ============================================
   Buttons
   ============================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border: none;
    border-radius: var(--r-sm);
    font-size: 0.84rem;
    font-weight: 550;
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(rgba(255,255,255,0.15), rgba(255,255,255,0));
    pointer-events: none;
}

.btn-primary {
    background: var(--brand);
    color: white;
    box-shadow: 0 1px 3px rgba(99, 102, 241, 0.3);
}
.btn-primary:hover {
    background: var(--brand-hover);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.35);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--green);
    color: white;
    box-shadow: 0 1px 3px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
    background: #059669;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
    transform: translateY(-1px);
}

.btn-danger {
    background: var(--red);
    color: white;
    box-shadow: 0 1px 3px rgba(244, 63, 94, 0.3);
}
.btn-danger:hover {
    background: #E11D48;
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
    transform: translateY(-1px);
}

.btn-sm { padding: 6px 12px; font-size: 0.76rem; border-radius: 6px; }

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--line);
    color: var(--muted);
    box-shadow: none;
}
.btn-outline::after { display: none; }
.btn-outline:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-tint);
}

.btn-glass {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(20px) saturate(160%);
    -webkit-backdrop-filter: blur(20px) saturate(160%);
    border: 1.5px solid rgba(0,0,0,0.08);
    border-top: 1.5px solid rgba(255,255,255,0.3);
    border-bottom: 1.5px solid rgba(0,0,0,0.1);
    color: var(--ink);
    font-weight: 500;
    letter-spacing: 0.01em;
    border-radius: 8px;
    box-shadow:
        0 4px 12px rgba(0,0,0,0.08),
        inset 0 0 0 1px rgba(255,255,255,0.15),
        inset 0 1px 0 rgba(255,255,255,0.3);
    transition: all 0.3s cubic-bezier(0.2, 0.9, 0.4, 1);
    position: relative;
    overflow: hidden;
}
.btn-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(160deg, rgba(255,255,255,0.08) 0%, transparent 40%, transparent 60%, rgba(0,0,0,0.02) 100%);
}
.btn-glass:hover {
    background: rgba(255,255,255,0.16);
    border-top-color: rgba(255,255,255,0.5);
    border-bottom-color: rgba(0,0,0,0.14);
    box-shadow:
        0 10px 28px rgba(0,0,0,0.14),
        inset 0 0 0 1px rgba(255,255,255,0.25),
        inset 0 2px 0 rgba(255,255,255,0.4);
    transform: translateY(-2px);
    color: var(--brand);
}
.btn-glass:active {
    transform: translateY(0);
    box-shadow:
        0 2px 6px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(255,255,255,0.12),
        inset 0 1px 0 rgba(255,255,255,0.2);
    transition: all 0.1s ease;
}
.btn-glass i {
    opacity: 0.65;
    transition: opacity 0.25s ease;
    filter: drop-shadow(0 1px 1px rgba(0,0,0,0.08));
}
.btn-glass:hover i {
    opacity: 1;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.12));
}

/* ============================================
   Glass card — frosted glass stat cards (STRONG)
   ============================================ */
.card-glass {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1.5px solid rgba(0,0,0,0.08);
    border-top: 1.5px solid rgba(255,255,255,0.35);
    border-bottom: 1.5px solid rgba(0,0,0,0.1);
    border-radius: var(--r);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.04),
        inset 0 0 0 1px rgba(255,255,255,0.2),
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 -1px 0 rgba(0,0,0,0.04);
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1);
    position: relative;
    overflow: hidden;
}
.card-glass::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: calc(var(--r) - 2px);
    pointer-events: none;
    z-index: 0;
    border: 1px solid rgba(255,255,255,0.12);
}
.card-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(160deg, rgba(255,255,255,0.1) 0%, transparent 30%, transparent 65%, rgba(0,0,0,0.03) 100%);
    z-index: 0;
}
.card-glass:hover {
    background: rgba(255,255,255,0.14);
    border-top-color: rgba(255,255,255,0.5);
    border-bottom-color: rgba(0,0,0,0.14);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.14),
        0 4px 12px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(255,255,255,0.3),
        inset 0 2px 0 rgba(255,255,255,0.4),
        inset 0 -1px 0 rgba(0,0,0,0.06);
    transform: translateY(-4px);
}
.card-glass > * { position: relative; z-index: 1; }

/* ============================================
   Glass panel — frosted glass chart panels (STRONG)
   ============================================ */
.panel-glass {
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(28px) saturate(180%);
    -webkit-backdrop-filter: blur(28px) saturate(180%);
    border: 1.5px solid rgba(0,0,0,0.08);
    border-top: 1.5px solid rgba(255,255,255,0.35);
    border-bottom: 1.5px solid rgba(0,0,0,0.1);
    border-radius: var(--r);
    box-shadow:
        0 8px 32px rgba(0,0,0,0.1),
        0 2px 8px rgba(0,0,0,0.04),
        inset 0 0 0 1px rgba(255,255,255,0.2),
        inset 0 1px 0 rgba(255,255,255,0.35),
        inset 0 -1px 0 rgba(0,0,0,0.04);
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.2, 0.9, 0.4, 1);
    position: relative;
}
.panel-glass::before {
    content: '';
    position: absolute;
    inset: 4px;
    border-radius: calc(var(--r) - 2px);
    pointer-events: none;
    z-index: 0;
    border: 1px solid rgba(255,255,255,0.12);
}
.panel-glass::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(160deg, rgba(255,255,255,0.1) 0%, transparent 30%, transparent 65%, rgba(0,0,0,0.03) 100%);
    z-index: 0;
}
.panel-glass:hover {
    background: rgba(255,255,255,0.14);
    border-top-color: rgba(255,255,255,0.5);
    border-bottom-color: rgba(0,0,0,0.14);
    box-shadow:
        0 16px 48px rgba(0,0,0,0.14),
        0 4px 12px rgba(0,0,0,0.06),
        inset 0 0 0 1px rgba(255,255,255,0.3),
        inset 0 2px 0 rgba(255,255,255,0.4),
        inset 0 -1px 0 rgba(0,0,0,0.06);
    transform: translateY(-3px);
}
.panel-glass > * { position: relative; z-index: 1; }

.btn-accent {
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: #fff;
    border: none;
    padding: 10px 18px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.btn-accent:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99,102,241,0.35);
}

/* ============================================
   Forms
   ============================================ */
.form-group { margin-bottom: 18px; }

.form-group label {
    display: block;
    font-size: 0.8rem;
    color: var(--muted);
    margin-bottom: 6px;
    font-weight: 600;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--line);
    border-radius: var(--r-sm);
    font-size: 0.855rem;
    font-family: inherit;
    transition: var(--transition);
    background: var(--surface);
    color: var(--ink);
}

.form-control:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

.form-control::placeholder { color: var(--faint); }

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M6 8L1 3h10z' fill='%2394A3B8'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* ============================================
   Modal
   ============================================ */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(15, 23, 42, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 200;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.modal-box {
    background: var(--surface);
    border-radius: var(--r);
    width: 100%;
    max-width: 580px;
    max-height: 85vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    box-shadow: var(--sh);
    animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-box h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--line);
    letter-spacing: -0.02em;
}

.modal-close {
    position: absolute;
    top: 20px; right: 20px;
    background: var(--canvas);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
    color: var(--faint);
    transition: var(--transition);
}

.modal-close:hover { background: var(--red-soft); color: var(--red); }

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 28px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

/* ============================================
   Toolbar
   ============================================ */
.toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.toolbar .search-input {
    padding: 9px 14px;
    border: 1.5px solid var(--line);
    border-radius: 100px;
    font-size: 0.84rem;
    font-family: inherit;
    width: 260px;
    transition: var(--transition);
}

.toolbar .search-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

/* ============================================
   Section Grid
   ============================================ */
.section-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* ============================================
   Chart Grid & Panels
   ============================================ */
.chart-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.chart-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--r);
    box-shadow: var(--sh);
    overflow: hidden;
    transition: var(--transition);
}

.chart-panel:hover {
    box-shadow: var(--sh);
}

.chart-wrap {
    position: relative;
    width: 100%;
    height: 280px;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

/* ============================================
   分析看板 · 追加三块
   （学习成效 / 行为与学科分布 / 多智能体工作台）
   ============================================ */

.dash-sub {
    font-size: 0.75rem;
    color: var(--faint);
    font-weight: 400;
}

/* 左雷达 + 右明细 */
.dash-split {
    display: flex;
    gap: 20px;
    align-items: center;
}

.dash-radar {
    position: relative;
    flex: 0 0 240px;
    height: 240px;
}

.dash-radar canvas {
    width: 100% !important;
    height: 100% !important;
}

.dash-side {
    flex: 1;
    min-width: 0;
}

.dash-score {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 14px;
}

.dash-score-num {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.dash-score-cap {
    font-size: 0.78rem;
    color: var(--faint);
}

.dash-delta {
    font-weight: 600;
}

.dash-delta.up { color: var(--m-high); }
.dash-delta.down { color: var(--m-low); }

/* 标签 + 进度条 + 数值 */
.dash-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dash-bar-row {
    display: grid;
    grid-template-columns: 5.5rem 1fr 2rem;
    align-items: center;
    gap: 10px;
    font-size: 0.78rem;
}

.dash-bar-label {
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dash-bar-track {
    height: 6px;
    border-radius: 3px;
    background: var(--line);
    overflow: hidden;
}

.dash-bar-track > i {
    display: block;
    height: 100%;
    border-radius: 3px;
    background: var(--brand);
}

.dash-bar-val {
    text-align: right;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

/* 弱项 */
.dash-weak {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--line);
}

.dash-weak-cap {
    font-size: 0.78rem;
    color: var(--faint);
}

.dash-tag {
    font-size: 0.75rem;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--m-low-t);
    color: var(--m-low);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* 多智能体工作台 */
.dash-agent-block + .dash-agent-block {
    margin-top: 22px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}

.dash-agent-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 650;
    color: var(--ink);
    margin-bottom: 14px;
}

.dash-agent-total {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--faint);
}

.dash-metrics {
    display: flex;
    gap: 28px;
    margin-bottom: 16px;
}

.dash-metric {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.dash-metric b {
    font-size: 1.4rem;
    line-height: 1.1;
    color: var(--ink);
    font-variant-numeric: tabular-nums;
}

.dash-metric span {
    font-size: 0.72rem;
    color: var(--faint);
}

/* 学习任务完成情况：按到期日逐日列出 */
.tdl-sum { display: flex; gap: 18px; font-size: 0.76rem; color: var(--muted); margin-bottom: 14px; }
.tdl-sum b { color: var(--ink); font-variant-numeric: tabular-nums; }
.tdl-sum b.ok { color: var(--m-high); }

.tdl-days { display: flex; flex-direction: column; gap: 14px; max-height: 340px; overflow-y: auto; padding-right: 4px; }
.tdl-days::-webkit-scrollbar { width: 4px; }
.tdl-days::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.08); border-radius: 4px; }

.tdl-day { border-left: 3px solid var(--line); padding-left: 12px; }
.tdl-day.is-today { border-left-color: var(--brand); }
.tdl-day.is-overdue { border-left-color: var(--m-low); }

.tdl-day-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.tdl-date { font-size: 0.82rem; font-weight: 650; color: var(--ink); }
.tdl-week { font-weight: 400; color: var(--faint); font-size: 0.72rem; }
.tdl-phrase { font-size: 0.7rem; color: var(--faint); }
.tdl-phrase.bad { color: var(--m-low); font-weight: 600; }
.tdl-count { margin-left: auto; font-size: 0.72rem; color: var(--faint); font-variant-numeric: tabular-nums; }

.tdl-items { display: flex; flex-wrap: wrap; gap: 6px; }
.tdl-item { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; padding: 3px 9px; border-radius: 6px; font-size: 0.74rem; border: 1px solid transparent; }
.tdl-item i { font-size: 0.62rem; flex-shrink: 0; }
.tdl-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tdl-item.done { background: var(--m-high-t); color: var(--m-high); }
.tdl-item.late { background: var(--m-mid-t); color: var(--m-mid); }
.tdl-item.todo { background: var(--canvas); color: var(--muted); }
.tdl-item.overdue { background: var(--m-low-t); color: var(--m-low); font-weight: 600; }

.tdl-more { margin-top: 12px; font-size: 0.7rem; color: var(--faint); }

/* 空态 —— 不留一张空白画布 */
.dash-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: 100%;
    min-height: 180px;
    text-align: center;
    color: var(--faint);
    font-size: 0.82rem;
    line-height: 1.6;
}

.dash-empty i {
    font-size: 1.4rem;
    opacity: 0.5;
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast {
    padding: 14px 20px;
    border-radius: var(--r-sm);
    font-size: 0.84rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--sh);
    pointer-events: auto;
    animation: toastIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 380px;
    backdrop-filter: blur(12px);
}

.toast-success {
    background: linear-gradient(135deg, #ECFDF5, #D1FAE5);
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.toast-error {
    background: linear-gradient(135deg, #FFF1F2, #FFE4E6);
    color: #9F1239;
    border: 1px solid #FECDD3;
}

.toast-info {
    background: linear-gradient(135deg, #EEF2FF, #E0E7FF);
    color: #3730A3;
    border: 1px solid #C7D2FE;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateX(40px) scale(0.95); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes toastOut {
    to { opacity: 0; transform: translateX(40px) scale(0.95); }
}

/* ============================================
   Loading
   ============================================ */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    gap: 8px;
    color: var(--faint);
    font-size: 0.875rem;
}

.loading-spinner::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* 按钮内的行内转圈。旧版 main.js 写了
     <div class="spinner" style="width:14px;height:14px;border-width:2px">
   但 .spinner 全站从未定义 —— 内联只给了尺寸，没有 border-style / border-color /
   animation，所以那是个【隐形空盒子】：「分析中...」旁边什么都看不到。 */
.spinner {
    display: inline-block;
    border-style: solid;
    border-color: var(--line);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================
   Empty State
   ============================================ */
.empty-state {
    text-align: center;
    padding: 48px 20px;
    color: var(--faint);
}

.empty-state i { font-size: 2.5rem; margin-bottom: 12px; opacity: 0.3; }
.empty-state p { font-size: 0.875rem; }


/* ============================================================
   补：main.js 用到但全站从未定义的类
   ============================================================ */

/* 学习评估页的标题容器。
   旧版 main.js 写了 <div class="page-header">，但 2071 行的 style.css 里
   grep 不到任何 .page-header —— 标题一直靠浏览器默认 h2 样式渲染，
   和其它页面的标题不一致。 */
.page-header { margin-bottom: var(--s5); }
.page-header h2 {
  font-size: var(--t-lg);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.01em;
}
.page-header p { color: var(--faint); font-size: var(--t-xs); margin-top: 2px; }

/* 六维标识圆点 —— 代替原先六个 emoji（🧠📈🔥💾🎯🏆）。
   颜色走 tokens.css 的 --d1..--d6。 */
.dim-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  vertical-align: middle;
  margin-right: var(--s2);
  flex-shrink: 0;
}
.dim-dot.d1 { background: var(--d1); }
.dim-dot.d2 { background: var(--d2); }
.dim-dot.d3 { background: var(--d3); }
.dim-dot.d4 { background: var(--d4); }
.dim-dot.d5 { background: var(--d5); }
.dim-dot.d6 { background: var(--d6); }

/* 课程资料编辑器的「取消」按钮：main.js 用了 .btn-secondary，
   但全站没有定义 → 渲染成裸 .btn（无背景无边框），与旁边「保存」不协调。 */
.btn-secondary {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--ink);
}
.btn-secondary:hover { border-color: var(--brand-2); color: var(--brand-deep); }
