/* css/file-list.css */
:root {
    --color-primary: #0d6efd;
    --color-primary-dark: #0a58ca;
    --bg-dark: #1f1e1e;
    --bg-gray: #6d6666;
    --bg-light: #fafafa;
    --bg-light-hover: #f0f0f0;
    --bg-nav: #f8f9fa;
    --bg-nav-hover: #e9ecef;
    --bg-page: #f5f5f5;
    --text-light: #ffffff;
    --text-dark: #333333;
    --text-muted: #999999;
    --text-nav: #495057;
    --border-light: #e0e0e0;
    --border-lighter: #e8e8e8;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: var(--bg-page);
    color: var(--text-dark);
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

/* 顶部栏 */
.header {
    height: 60px;
    padding: 0 24px;
    background-color: var(--bg-dark);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-md);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.back-btn {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 16px;
    color: var(--text-light);
    font-size: 14px;
    border-radius: var(--radius-sm);
    transition: background-color 0.2s ease;
}

.back-btn:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.logo {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-light);
}

.profileButton {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background-color: var(--bg-light);
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--border-lighter);
    transition: background-color 0.2s ease;
}

.profileButton:hover {
    background-color: var(--bg-light-hover);
}

.profile-icon {
    width: 20px;
    height: 20px;
}

.profileButton span {
    font-size: 14px;
    color: var(--text-dark);
}

/* 列表容器 */
.list-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 24px;
}

/* 列表头部 */
.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    flex-wrap: wrap;
    gap: 16px;
}

.list-title {
    font-size: 24px;
    font-weight: 600;
    color: var(--text-dark);
}

.search-bar {
    display: flex;
    gap: 12px;
}

.search-field {
    width: 280px;
    height: 44px;
    padding: 0 16px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    font-size: 14px;
    outline: none;
    transition: all 0.2s ease;
}

.search-field:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
}

/* 按钮 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(145deg, #ffffff, #e6e6e6);
    color: var(--text-dark);
    box-shadow:
            4px 4px 12px rgba(0, 0, 0, 0.1),
            -4px -4px 12px rgba(255, 255, 255, 0.9),
            inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.btn-primary:hover {
    background: linear-gradient(145deg, #f0f0f0, #dcdcdc);
    transform: translateY(1px);
}

.btn-primary:active {
    background: linear-gradient(145deg, #e0e0e0, #d0d0d0);
    box-shadow:
            inset 2px 2px 6px rgba(0, 0, 0, 0.1),
            inset -2px -2px 6px rgba(255, 255, 255, 0.5);
    transform: translateY(2px);
}

.btn-download {
    padding: 8px 20px;
    background: var(--color-primary);
    color: var(--text-light);
    border-radius: var(--radius-sm);
}

.btn-download:hover {
    background: var(--color-primary-dark);
}

/* 试卷列表 */
.exam-list {
    background: var(--bg-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-lighter);
    overflow: hidden;
}

/* 列表项 */
.exam-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-lighter);
    transition: background-color 0.2s ease;
}

.exam-item:last-child {
    border-bottom: none;
}

.exam-item:hover {
    background-color: var(--bg-nav);
}

.exam-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 24px;
    margin-right: 20px;
}

.exam-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-dark);
    flex: 1;
}

.exam-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    color: var(--text-muted);
    font-size: 13px;
    white-space: nowrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.meta-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-text {
    font-size: 16px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 24px 0;
}

.pagination button {
    padding: 10px 18px;
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    background: var(--bg-light);
    color: var(--text-nav);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.pagination button:hover:not(:disabled) {
    background: var(--bg-nav-hover);
}

.pagination button.active {
    background: var(--bg-dark);
    color: var(--text-light);
    border-color: var(--bg-dark);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Toast */
.toast {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-20px);
    padding: 14px 24px;
    background: var(--bg-dark);
    color: var(--text-light);
    border-radius: var(--radius-md);
    font-size: 14px;
    box-shadow: var(--shadow-md);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 2000;
}

.toast.show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast.success {
    background: #198754;
}

.toast.error {
    background: #dc3545;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.25s ease;
}

.modal-overlay.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 32px;
    width: 380px;
    max-width: 90%;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    transform: scale(0.9);
    transition: transform 0.25s ease;
}

.modal-overlay.show .modal-content {
    transform: scale(1);
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-dark);
    margin: 0 0 12px 0;
    text-align: center;
}

.modal-text {
    font-size: 14px;
    color: var(--text-muted);
    text-align: center;
    margin: 0 0 24px 0;
    line-height: 1.6;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.modal-actions .btn {
    min-width: 100px;
}

/* 响应式 */
@media (max-width: 768px) {
    .list-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .search-bar {
        width: 100%;
    }

    .search-field {
        flex: 1;
        width: auto;
    }

    .exam-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .exam-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        margin-right: 0;
    }

    .exam-meta {
        gap: 12px;
    }
}

.list-empty,
.list-loading {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}
