/* 现代化移动端样式 - 人脸信息采集系统 */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --border-radius: 16px;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.15);
}

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

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

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

header h1 {
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 2rem;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* 表单容器 */
.form-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.form-group {
    margin-bottom: 24px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1rem;
}

select {
    width: 100%;
    padding: 16px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 16px;
    background-color: white;
    transition: all 0.3s ease;
    font-size: 1rem;
}

select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* 按钮样式 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: all 0.3s ease;
    gap: 8px;
    min-height: 52px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    width: 100%;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary:disabled {
    background: #d1d5db;
    color: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: var(--shadow-sm);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    background: #475569;
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-success:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-info {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 学生列表 */
.student-list {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
}

.student-item {
    border-bottom: 1px solid #f3f4f6;
    transition: background-color 0.3s ease;
}

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

.student-item:hover {
    background-color: rgba(99, 102, 241, 0.05);
}

.student-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.student-link.submitted {
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1), transparent);
    border-left: 4px solid var(--success-color);
}

.student-link.not-submitted {
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1), transparent);
    border-left: 4px solid var(--error-color);
}

.student-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.student-mark {
    font-size: 0.9rem;
    color: var(--text-secondary);
    background: #f8fafc;
    padding: 4px 8px;
    border-radius: 6px;
    margin-left: 12px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-badge {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.submitted-badge {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.not-submitted-badge {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 班级统计概览 */
.stats-overview {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

.stats-overview h2 {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.class-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.class-stat-item {
    background: rgba(255, 255, 255, 0.7);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.class-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.class-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.class-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.submission-rate {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e5e7eb;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 15px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--success-color), var(--primary-color));
    border-radius: 4px;
    transition: width 0.5s ease;
}

.class-details {
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.detail-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.detail-value {
    font-weight: 600;
    font-size: 1.1rem;
}

.detail-value.submitted {
    color: var(--success-color);
}

.detail-value.not-submitted {
    color: var(--error-color);
}

/* 管理员页面样式 */
.overall-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 30px;
}

.overall-stat-item {
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.overall-stat-item:hover {
    transform: translateY(-2px);
}

.overall-stat-label {
    display: block;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.overall-stat-value {
    display: block;
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.filter-controls {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.sort-select {
    min-width: 160px;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    background-color: white;
    transition: all 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.class-actions {
    margin-top: 16px;
    text-align: center;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
    min-height: auto;
}

/* 验证码模态框 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-content h3 {
    margin-bottom: 16px;
    color: var(--text-primary);
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 8px;
    font-size: 1rem;
    margin-bottom: 16px;
    text-align: center;
    letter-spacing: 2px;
}

.modal-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.modal-error {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 8px;
    min-height: 20px;
}

/* 加载动画和状态提示 */
.loading-placeholder {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

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

.no-data {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-style: italic;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: var(--error-color);
    background: rgba(239, 68, 68, 0.1);
    border-radius: 12px;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

/* 统计信息 */
.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 24px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 24px;
}

.stat-item {
    text-align: center;
    padding: 16px;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    transition: transform 0.3s ease;
}

.stat-item:hover {
    transform: translateY(-2px);
}

.stat-label {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 500;
}

.stat-value {
    display: block;
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* 头部操作区域 */
.header-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

/* 摄像头页面样式 */
.camera-container {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 1px solid rgba(255, 255, 255, 0.2);
    text-align: center;
}

#video, #preview-img {
    width: 100%;
    max-width: 500px;
    height: auto;
    border-radius: var(--border-radius);
    border: 3px solid #e5e7eb;
    box-shadow: var(--shadow-md);
}

.camera-controls {
    margin: 24px 0;
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.preview-container {
    margin: 24px 0;
}

/* 消息样式 */
.message {
    padding: 16px;
    border-radius: 12px;
    margin: 20px 0;
    text-align: center;
    font-weight: 600;
    backdrop-filter: blur(10px);
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.message.error {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.message.info {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 加载动画 */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

.loading {
    animation: pulse 2s infinite;
}

/* 管理员入口样式 */
.admin-section {
    text-align: center;
    margin-bottom: 30px;
}

.admin-section .btn {
    background: linear-gradient(135deg, #8b5cf6, #7c3aed);
    color: white;
    border: none;
    box-shadow: var(--shadow-md);
}

.admin-section .btn:hover {
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* 移动端优化 */
@media (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    header {
        padding: 24px 20px;
    }
    
    header h1 {
        font-size: 1.75rem;
    }
    
    .form-container {
        padding: 24px 20px;
    }
    
    .stats {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }
    
    .student-link {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 16px;
    }
    
    .student-mark {
        margin-left: 0;
    }
    
    .header-actions {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        min-height: 48px;
    }
    
    .camera-controls {
        flex-direction: column;
        align-items: center;
    }
    
    .camera-controls .btn {
        max-width: 200px;
    }
    
    /* 管理员页面移动端优化 */
    .overall-stats {
        grid-template-columns: 1fr;
        gap: 12px;
        padding: 20px;
    }
    
    .overall-stat-item {
        padding: 16px;
    }
    
    .overall-stat-value {
        font-size: 2rem;
    }
    
    .filter-controls {
        flex-direction: column;
    }
    
    .search-input,
    .sort-select {
        min-width: auto;
        width: 100%;
    }
    
    .class-stats-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .class-stat-item {
        padding: 16px;
    }
    
    .class-details {
        flex-direction: column;
        gap: 8px;
    }
    
    .detail-item {
        flex-direction: row;
        justify-content: space-between;
        width: 100%;
    }
    
    .modal-content {
        margin: 20px;
        padding: 24px 20px;
    }
    
    .modal-actions {
        flex-direction: column;
    }
    
    .modal-actions .btn {
        width: 100%;
    }
}

/* 图标和按钮样式增强 */
.btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.btn-primary svg,
.btn-success svg,
.btn-info svg {
    stroke: white;
}

.btn-secondary svg {
    stroke: white;
}

/* 学生信息布局优化 */
.student-info {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.status-badge svg {
    width: 14px;
    height: 14px;
    margin-right: 4px;
}

/* 加载状态 */
.loading {
    animation: pulse 2s infinite;
}

.btn.loading {
    pointer-events: none;
    opacity: 0.7;
}

/* 预览图片样式 */
.preview-container img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    border: 3px solid #e5e7eb;
}

/* 性能优化：减少重绘和回流 */
.student-list,
.stats,
.form-container,
.camera-container {
    will-change: transform;
    transform: translateZ(0);
}

/* 减少动画对性能的影响 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .btn {
        min-height: 56px;
        padding: 18px 32px;
    }
    
    .student-link {
        padding: 24px 20px;
    }
    
    select {
        padding: 20px;
        font-size: 18px;
    }
}

/* 高对比度模式支持 */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #0000ff;
        --success-color: #008000;
        --error-color: #ff0000;
    }
    
    .btn {
        border: 2px solid currentColor;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    :root {
        --card-bg: rgba(30, 30, 30, 0.95);
        --text-primary: #ffffff;
        --text-secondary: #a0a0a0;
    }
    
    body {
        background: linear-gradient(135deg, #2d3748 0%, #4a5568 100%);
    }
    
    select {
        background-color: #2d3748;
        color: white;
        border-color: #4a5568;
    }
    
    .student-mark {
        background: #4a5568;
        color: #e2e8f0;
    }
}
.beian-footer {
            position: fixed;
            bottom: 20px;
            width: 100%;
            text-align: center;
            font-size: 0.9rem;
            color: var(--primary);
            opacity: 0.8;
            transition: opacity 0.3s ease;
        }
    
        .beian-footer a {
            color: inherit;
            text-decoration: none;
            border-bottom: 1px solid transparent;
            padding-bottom: 2px;
        }
    
        .beian-footer a:hover {
            opacity: 1;
            border-color: currentColor;
        }
    
        @media (max-width: 768px) {
            .beian-footer {
                position: static;
                margin-top: 2rem;
                padding-bottom: 1rem;
            }
        }