/* 学生端共享历史面板 */
.student-history-overlay {
    position: fixed;
    inset: 0;
    z-index: 450;
    background: rgba(15, 23, 42, .42);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .2s ease, visibility 0s linear .2s;
}
.student-history-overlay.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition: opacity .2s ease;
}
.student-history-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 451;
    width: min(520px, 92vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    box-shadow: -18px 0 40px rgba(15, 23, 42, .14);
    transform: translateX(100%);
    transition: transform .24s ease;
}
.student-history-panel.is-open {
    transform: translateX(0);
}
.student-history-panel__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 24px 24px 16px;
    border-bottom: 1px solid #eef0f6;
}
.student-history-panel__title {
    font-size: 20px;
    font-weight: 800;
    color: #232936;
}
.student-history-panel__sub {
    margin-top: 4px;
    color: #9aa2b1;
    font-size: 12px;
}
.student-history-panel__close {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 10px;
    background: #f6f7fb;
    color: #737b8c;
    cursor: pointer;
}
.student-history-panel__close:hover {
    background: #eef0f7;
    color: #2f3542;
}
.student-history-panel__controls {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 24px 12px;
    border-bottom: 1px solid #f1f3f8;
}
.student-history-current-type {
    display: inline-flex;
    align-self: flex-start;
    min-height: 32px;
    align-items: center;
    padding: 0 12px;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
}
.student-history-segment {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.student-history-segment__btn {
    min-height: 34px;
    padding: 0 13px;
    border: 1px solid #e0e4ef;
    border-radius: 999px;
    background: #fff;
    color: #697386;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.student-history-segment__btn.is-active {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.student-history-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #d9d3ff;
    border-radius: 999px;
    background: #f8f6ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.student-history-panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 18px 24px;
    background: #fbfcff;
}
.student-history-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.student-history-item {
    border: 1px solid #edf0f7;
    border-radius: 14px;
    padding: 16px;
    background: #fff;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .035);
}
.student-history-item__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}
.student-history-item__tag {
    flex: 0 0 auto;
    min-height: 26px;
    display: inline-flex;
    align-items: center;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--primary-bg);
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
}
.student-history-item__time {
    min-width: 0;
    color: #a1a8b6;
    font-size: 12px;
    white-space: nowrap;
}
.student-history-item__title {
    color: #2f3542;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.6;
    word-break: break-word;
}
.student-history-item__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin-top: 10px;
    color: #8790a2;
    font-size: 12px;
}
.student-history-item__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}
.student-history-action {
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 14px;
    border: 1px solid #d9d3ff;
    border-radius: 10px;
    background: #f7f5ff;
    color: var(--primary);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}
.student-history-action:hover {
    border-color: var(--primary);
    background: var(--primary);
    color: #fff;
}
.student-history-empty {
    min-height: 220px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #b1b8c7;
    font-size: 14px;
    text-align: center;
}
.student-history-empty i {
    font-size: 34px;
    color: #d8ddea;
}
.student-history-panel__pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 24px 18px;
    border-top: 1px solid #eef0f6;
    background: #fff;
}
.student-history-pager__total {
    color: #8b93a3;
    font-size: 12px;
    white-space: nowrap;
}
.student-history-pager__current {
    color: #4b5563;
    font-size: 13px;
    font-weight: 800;
    white-space: nowrap;
}
.student-history-pager__btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid #dde2ee;
    border-radius: 10px;
    background: #fff;
    color: #4b5563;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
}
.student-history-pager__btn:disabled {
    color: #c1c7d3;
    cursor: not-allowed;
}
.student-history-detail {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.student-history-detail__block {
    border: 1px solid #edf0f7;
    border-radius: 14px;
    padding: 16px;
    background: #fff;
}
.student-history-detail__block h3 {
    margin: 0 0 12px;
    color: #4b5563;
    font-size: 14px;
    font-weight: 800;
}
.student-history-detail__text {
    max-height: 36vh;
    overflow-y: auto;
    color: #374151;
    font-size: 14px;
    line-height: 1.9;
    white-space: pre-wrap;
    word-break: break-word;
}

@media (max-width: 767px) {
    .student-history-panel {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw;
        height: min(92vh, 720px);
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
        box-shadow: 0 -18px 40px rgba(15, 23, 42, .18);
    }
    .student-history-panel.is-open {
        transform: translateY(0);
    }
    .student-history-panel__head {
        padding: 18px 16px 12px;
    }
    .student-history-panel__title {
        font-size: 18px;
    }
    .student-history-panel__sub {
        font-size: 11px;
    }
    .student-history-panel__controls {
        padding: 12px 16px 10px;
    }
    .student-history-panel__body {
        padding: 14px 16px;
    }
    .student-history-panel__pager {
        padding: 12px 16px max(14px, env(safe-area-inset-bottom));
        flex-wrap: wrap;
    }
    .student-history-pager__total {
        width: 100%;
        text-align: center;
    }
    .student-history-pager__btn {
        flex: 1 1 0;
    }
    .student-history-pager__current {
        flex: 0 0 auto;
    }
    .student-history-item {
        padding: 14px;
    }
    .student-history-item__top {
        align-items: flex-start;
        flex-direction: column;
        gap: 6px;
    }
    .student-history-item__time {
        white-space: normal;
    }
    .student-history-item__actions {
        justify-content: stretch;
    }
    .student-history-action {
        flex: 1 1 auto;
    }
    .student-history-segment {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 2px;
        -webkit-overflow-scrolling: touch;
    }
    .student-history-segment__btn {
        flex: 0 0 auto;
    }
    .student-history-detail__text {
        max-height: 30vh;
        font-size: 13px;
    }
}
