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

body {
    font-family: var(--custom-font, 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif);
    background: #f5f7fa;
    min-height: 100vh;
    padding: 12px;
    color: #333;
    overflow: hidden;
}

.container {
    max-width: 1600px;
    margin: 0 auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    height: calc(100vh - 24px);
    display: flex;
    flex-direction: column;
}

/* 头部 */
.header {
    background: #ffffff;
    color: #333;
    padding: 8px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    border-bottom: 2px solid #e9ecef;
}

.title {
    font-size: 1.2em;
    font-weight: 700;
    color: #1f2937;
}

.header-info {
    display: flex;
    gap: 20px;
    font-size: 0.85em;
}

.class-info,
.date-info {
    display: flex;
    align-items: center;
    gap: 5px;
}

.label {
    opacity: 0.9;
    font-weight: 500;
}

.value {
    font-weight: 700;
}

/* 统计信息条 */
.statistics-bar {
    background: #f8f9fa;
    padding: 6px 15px;
    display: flex;
    justify-content: center;
    gap: 25px;
    flex-shrink: 0;
    border-bottom: 2px solid #e9ecef;
}

.statistics-bar .stat-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.85em;
}

.statistics-bar .stat-label {
    color: #666;
    font-weight: 500;
}

.statistics-bar .stat-value {
    font-weight: 700;
    font-size: 1.1em;
}

.statistics-bar .stat-total .stat-value {
    color: #2563eb;
}

.statistics-bar .stat-present .stat-value {
    color: #28a745;
}

.statistics-bar .stat-absent .stat-value {
    color: #dc3545;
}

.statistics-bar .stat-late .stat-value {
    color: #ffc107;
}

.statistics-bar .stat-leave .stat-value {
    color: #17a2b8;
}

/* 主要内容区域 - 两栏布局 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    min-height: 0;
}

/* 左侧栏 */
.left-column {
    flex: 0 0 420px;
    padding: 12px;
    overflow-y: auto;
    border-right: 2px solid #e9ecef;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
}

/* 右侧栏 */
.right-column {
    flex: 1;
    padding: 8px;
    overflow-y: auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* 手动拍照区域 */
.manual-capture-section {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    border-radius: 15px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    padding: 20px;
    margin-bottom: 20px;
}

.manual-capture-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.manual-capture-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.manual-capture-form label {
    font-weight: 600;
    color: #333;
    font-size: 0.95em;
}

.manual-capture-form .form-control {
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 0.95em;
    background: white;
    transition: border-color 0.3s;
}

.manual-capture-form .form-control:focus {
    outline: none;
    border-color: #2563eb;
}

.manual-capture-form .form-control:hover {
    border-color: #bbb;
}

/* 手机端签到区域 */
.mobile-checkin-section {
    padding: 10px;
    background: rgba(37, 99, 235, 0.05);
    border-radius: 15px;
    border: 2px solid rgba(37, 99, 235, 0.2);
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
}

/* 手机签到内容区域 - 双栏布局 */
.mobile-checkin-content {
    display: flex;
    gap: 10px;
    height: 100%;
    flex: 1;
}

/* 流程信息区域 - 紧凑版 */
.process-info-section {
    flex: 1;
    background: transparent;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    border-radius: 0;
}

.process-header {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(29, 78, 216, 0.08) 100%);
    border-radius: 6px;
}

.process-title {
    font-size: 0.85em;
    font-weight: 700;
    color: #2563eb;
}

/* 等待提示 - 紧凑版 */
.waiting-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 6px;
}

.waiting-icon {
    font-size: 1.3em;
}

.waiting-text {
    font-size: 0.85em;
    color: #6c757d;
    font-weight: 500;
}

/* 识别状态 - 紧凑版 */
.process-status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 5px;
}

.status-icon {
    font-size: 1.2em;
}

.status-text {
    font-size: 0.8em;
    color: #2563eb;
    font-weight: 600;
}

/* 学生信息 - 紧凑版 */
.process-student-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    background: rgba(40, 167, 69, 0.1);
    border-radius: 5px;
}

.student-icon {
    font-size: 1.1em;
}

.student-name {
    font-size: 0.8em;
    font-weight: 600;
    color: #28a745;
    flex: 1;
}

.student-phone {
    font-size: 0.7em;
    color: #6c757d;
}

/* 流程步骤 - 紧凑版 */
.process-steps-compact {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.step-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    background: rgba(108, 117, 125, 0.1);
    border-radius: 4px;
}

.step-item.active {
    background: rgba(37, 99, 235, 0.15);
    border-left: 3px solid #2563eb;
}

.step-item.completed {
    background: rgba(40, 167, 69, 0.1);
    border-left: 3px solid #28a745;
}

.step-indicator {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #6c757d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.75em;
    flex-shrink: 0;
}

.step-item.active .step-indicator {
    background: #2563eb;
}

.step-item.completed .step-indicator {
    background: #28a745;
}

.step-text {
    font-size: 0.75em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.step-status-text {
    font-size: 0.7em;
    color: #6c757d;
}

.step-item.active .step-status-text {
    color: #2563eb;
    font-weight: 600;
}

.step-item.completed .step-status-text {
    color: #28a745;
    font-weight: 600;
}

/* 倒计时 - 紧凑版 */
.countdown-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px;
    background: rgba(255, 193, 7, 0.15);
    border-radius: 5px;
}

.countdown-label {
    font-size: 0.8em;
    color: #856404;
    font-weight: 600;
}

.countdown-value {
    font-size: 1.5em;
    font-weight: 700;
    color: #ffc107;
    min-width: 30px;
    text-align: center;
}

/* 成功提示 - 紧凑版 */
.success-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: rgba(40, 167, 69, 0.15);
    border-radius: 5px;
}

.success-icon {
    font-size: 1.3em;
}

.success-text {
    font-size: 0.85em;
    font-weight: 700;
    color: #28a745;
}

.section-title {
    font-size: 1.3em;
    font-weight: 700;
    color: #333;
    margin-bottom: 2px;
    text-align: center;
}

.section-subtitle {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
    text-align: center;
}

/* 任务信息 */
.task-info {
    background: white;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.task-details {
    font-size: 0.9em;
}

.no-task-message {
    color: #999;
    text-align: center;
    padding: 10px;
}

/* 任务状态提示 */
.task-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 0.85em;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.task-status-badge.status-pending {
    background: #fff3cd;
    color: #856404;
}

.task-status-badge.status-active {
    background: #d4edda;
    color: #155724;
}

.task-status-badge.status-completed {
    background: #f8d7da;
    color: #721c24;
}

.task-status-badge.status-unknown {
    background: #e2e3e5;
    color: #383d41;
}

.task-status-message {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
    padding: 6px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 3px solid #007bff;
}

.task-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #333;
    margin-bottom: 10px;
}

.task-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.task-info-item .label {
    color: #666;
}

.task-info-item .value {
    font-weight: 600;
    color: #333;
}

/* 禁用状态 */
.disabled {
    opacity: 0.5;
    pointer-events: none;
    filter: grayscale(100%);
}

/* 任务配置模式 */
.task-modes {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #eee;
}

.task-mode-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 0.85em;
    padding: 4px 8px;
    border-radius: 4px;
    background: #f5f5f5;
}

.task-mode-item .mode-label {
    color: #666;
}

.task-mode-item .mode-value {
    font-weight: 600;
}

.task-mode-item.mode-required .mode-value {
    color: #e74c3c;
}

.task-mode-item.mode-optional .mode-value {
    color: #27ae60;
}

.task-mode-item.mode-disabled .mode-value {
    color: #95a5a6;
}

/* 手机签到二维码 */
.mobile-checkin-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 0;
}

.qr-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 80px;
    width: 100%;
}

.qr-placeholder {
    text-align: center;
    color: #999;
    padding: 5px;
}

.qr-placeholder .placeholder-icon {
    font-size: 2em;
    margin-bottom: 5px;
}

.qr-container img {
    max-width: 67px;
    max-height: 67px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* 签到链接 */
.checkin-link {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 2px solid #e9ecef;
}

.link-label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 5px;
}

.checkin-url {
    display: inline-block;
    color: #2563eb;
    text-decoration: none;
    font-size: 0.9em;
    word-break: break-all;
    max-width: 300px;
}

.checkin-url:hover {
    text-decoration: underline;
}

.scan-info {
    background: white;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.scan-info-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.scan-info-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.scan-info-name {
    font-size: 1.1em;
    font-weight: 700;
    color: #2563eb;
}

.scan-info-details {
    margin-bottom: 15px;
}

.scan-info-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9em;
}

.scan-info-item .label {
    color: #666;
}

.scan-info-item .value {
    font-weight: 600;
    color: #333;
}

.scan-info-status {
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    font-size: 0.9em;
    font-weight: 600;
    color: #2563eb;
}

.no-scan-placeholder {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #6c757d;
}

.placeholder-icon {
    font-size: 4em;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-scan-placeholder p {
    font-size: 1em;
    font-weight: 500;
}

/* 摄像头扫描区域 */
.camera-section {
    flex-shrink: 0;
    margin-bottom: 10px;
}

.camera-container {
    position: relative;
    width: 100%;
    height: 280px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-bottom: 10px;
}

.qr-reader {
    width: 100%;
    height: 100%;
    position: relative;
    background: #000;
}

.qr-reader video {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

.qr-reader video::-webkit-media-controls {
    display: none !important;
}

.qr-reader video::-webkit-media-controls-enclosure {
    display: none !important;
}

/* 扫描线动画 */
.scan-line {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, #28a745, transparent);
    box-shadow: 0 0 10px rgba(40, 167, 69, 0.8);
    animation: scanMove 2s ease-in-out infinite;
}

@keyframes scanMove {
    0%, 100% {
        top: 10%;
        opacity: 0;
    }
    10%, 90% {
        opacity: 1;
    }
    50% {
        top: 90%;
        opacity: 1;
    }
}

.camera-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 8px 12px;
    font-size: 0.85em;
    text-align: center;
}

.scan-result {
    padding: 8px 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #2563eb;
}

.result-label {
    font-weight: 600;
    color: #666;
    margin-bottom: 3px;
    font-size: 0.75em;
}

.result-value {
    font-size: 0.85em;
    font-weight: 700;
    color: #333;
    word-break: break-all;
}

.result-value.scanned {
    color: #28a745;
    animation: highlight 0.5s ease-in-out;
}

@keyframes highlight {
    0% {
        transform: scale(1);
        background: rgba(40, 167, 69, 0.2);
    }
    50% {
        transform: scale(1.05);
        background: rgba(40, 167, 69, 0.4);
    }
    100% {
        transform: scale(1);
        background: transparent;
    }
}

/* 控制按钮 */
.controls {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: auto;
    flex-shrink: 0;
}

.debug-info {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    font-size: 0.75em;
}

.debug-label {
    color: #6c757d;
    font-weight: 500;
}

.debug-value {
    color: #2563eb;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.btn {
    padding: 7px 12px;
    border: none;
    border-radius: 6px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    white-space: nowrap;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(0);
}

.btn-primary {
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    color: white;
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(135deg, #ffc107 0%, #fd7e14 100%);
    color: white;
}

.btn-secondary {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
}

.icon {
    font-size: 1em;
}

/* 学生列表区域 */
.student-section {
    padding: 8px 15px;
    background: #f8f9fa;
    border-top: 2px solid #e9ecef;
    flex-shrink: 0;
    min-height: 0;
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.student-scroll {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 6px 8px;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #2563eb #e9ecef;
    /* 默认最多显示3行 */
    max-height: calc((42px + 8px) * 3);
}

.student-scroll::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.student-scroll::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 4px;
}

.student-scroll::-webkit-scrollbar-thumb {
    background: #2563eb;
    border-radius: 4px;
}

.student-scroll::-webkit-scrollbar-thumb:hover {
    background: #1d4ed8;
}

/* 学生卡片 */
.student-card {
    background: white;
    border-radius: 8px;
    padding: 6px 10px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    min-width: 140px;
    flex: 1 0 auto;
}

.student-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #e9ecef;
    transition: background 0.3s;
}

.student-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.student-card.not-checked-in::before {
    background: #6c757d;
}

.student-card.not-checked-in {
    border-color: #6c757d;
}

.student-card.present::before {
    background: #28a745;
}

.student-card.present {
    border-color: #28a745;
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.student-card.absent::before {
    background: #dc3545;
}

.student-card.absent {
    border-color: #dc3545;
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
}

.student-card.late::before {
    background: #ffc107;
}

.student-card.late {
    border-color: #ffc107;
    background: linear-gradient(135deg, rgba(255, 193, 7, 0.1) 0%, rgba(255, 193, 7, 0.05) 100%);
}

.student-card.leave::before {
    background: #17a2b8;
}

.student-card.leave {
    border-color: #17a2b8;
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.05) 100%);
}

.student-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    margin: 0;
    background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1em;
    color: white;
    font-weight: 700;
    flex-shrink: 0;
}

.student-info {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 6px;
}

.student-name {
    font-size: 0.9em;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.student-status {
    font-size: 0.7em;
    padding: 2px 6px;
    border-radius: 4px;
    display: inline-block;
    font-weight: 500;
    flex-shrink: 0;
}

.student-card.not-checked-in .student-status {
    background: #e9ecef;
    color: #6c757d;
}

.student-card.present .student-status {
    background: rgba(40, 167, 69, 0.2);
    color: #28a745;
}

.student-card.absent .student-status {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.student-card.late .student-status {
    background: rgba(255, 193, 7, 0.2);
    color: #856404;
}

.student-card.leave .student-status {
    background: rgba(23, 162, 184, 0.2);
    color: #17a2b8;
}

/* 加载中 */
.loading {
    text-align: center;
    padding: 20px;
    font-size: 1em;
    color: #666;
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #fff;
    border-top: 4px solid #2563eb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 响应式设计 */
@media (max-width: 1200px) {
    .left-column {
        flex: 0 0 280px;
        padding: 10px;
    }

    .camera-container {
        height: 240px;
    }

    .student-scroll {
        gap: 7px;
    }

    .student-card {
        padding: 5px 9px;
        min-height: 40px;
        min-width: 130px;
        gap: 7px;
    }

    .student-avatar {
        width: 26px;
        height: 26px;
        font-size: 0.95em;
    }

    .student-name {
        font-size: 0.85em;
    }

    .student-status {
        font-size: 0.68em;
        padding: 2px 5px;
    }
}

@media (max-width: 900px) {
    body {
        padding: 8px;
    }

    .container {
        height: calc(100vh - 16px);
    }

    .header {
        padding: 6px 12px;
    }

    .title {
        font-size: 1.1em;
    }

    .header-info {
        font-size: 0.8em;
        gap: 15px;
    }

    .statistics-bar {
        gap: 15px;
        padding: 6px 12px;
    }

    .statistics-bar .stat-item {
        font-size: 0.8em;
    }

    .statistics-bar .stat-value {
        font-size: 1em;
    }

    .left-column {
        flex: 1;
        padding: 8px;
    }

    .right-column {
        display: none;
    }

    .camera-section {
        margin-bottom: 8px;
    }

    .camera-container {
        height: 150px;
        margin-bottom: 8px;
    }

    .controls {
        gap: 6px;
        margin-top: 0;
    }

    .debug-info {
        padding: 5px 8px;
        font-size: 0.75em;
    }

    .btn {
        padding: 6px 12px;
        font-size: 0.8em;
    }

    .student-section {
        padding: 8px 12px;
    }

    .student-scroll {
        gap: 6px;
        padding: 5px 6px;
    }

    .student-card {
        padding: 5px 8px;
        min-height: 38px;
        min-width: 120px;
        gap: 6px;
    }

    .student-avatar {
        width: 24px;
        height: 24px;
        font-size: 0.9em;
    }

    .student-name {
        font-size: 0.82em;
    }

    .student-status {
        font-size: 0.65em;
        padding: 1px 4px;
    }
}

@media (max-width: 600px) {
    body {
        padding: 4px;
    }

    .container {
        height: calc(100vh - 8px);
    }

    .header {
        flex-direction: column;
        text-align: center;
        gap: 3px;
        padding: 5px 10px;
    }

    .header-info {
        flex-direction: column;
        gap: 2px;
    }

    .title {
        font-size: 0.95em;
    }

    .statistics-bar {
        gap: 10px;
        padding: 5px 10px;
    }

    .statistics-bar .stat-item {
        font-size: 0.7em;
        gap: 3px;
    }

    .statistics-bar .stat-value {
        font-size: 0.9em;
    }

    .left-column {
        flex: 1;
        padding: 6px;
    }

    .right-column {
        display: none;
    }

    .camera-section {
        margin-bottom: 6px;
    }

    .camera-container {
        height: 130px;
        margin-bottom: 6px;
    }

    .camera-info {
        padding: 6px 8px;
        font-size: 0.75em;
    }

    .scan-result {
        padding: 6px 8px;
    }

    .result-label {
        font-size: 0.75em;
        margin-bottom: 3px;
    }

    .result-value {
        font-size: 0.85em;
    }

    .controls {
        gap: 5px;
        margin-top: 0;
    }

    .debug-info {
        padding: 4px 8px;
        font-size: 0.7em;
        margin-bottom: 2px;
    }

    .btn {
        padding: 5px 10px;
        font-size: 0.75em;
        gap: 4px;
    }

    .icon {
        font-size: 0.9em;
    }

    .student-section {
        padding: 6px 10px;
    }

    .student-scroll {
        gap: 5px;
        padding: 5px 5px;
    }

    .student-card {
        padding: 4px 7px;
        min-height: 36px;
        min-width: 110px;
        gap: 5px;
    }

    .student-avatar {
        width: 22px;
        height: 22px;
        font-size: 0.85em;
    }

    .student-name {
        font-size: 0.78em;
    }

    .student-status {
        font-size: 0.62em;
        padding: 1px 3px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 3px;
    }

    .container {
        height: calc(100vh - 6px);
    }

    .header {
        padding: 4px 8px;
    }

    .title {
        font-size: 0.9em;
    }

    .header-info {
        font-size: 0.75em;
    }

    .statistics-bar {
        gap: 8px;
        padding: 4px 8px;
    }

    .statistics-bar .stat-item {
        font-size: 0.65em;
    }

    .statistics-bar .stat-value {
        font-size: 0.85em;
    }

    .left-column {
        flex: 1;
        padding: 5px;
    }

    .right-column {
        display: none;
    }

    .camera-section {
        margin-bottom: 5px;
    }

    .camera-container {
        height: 110px;
        margin-bottom: 5px;
    }

    .camera-info {
        padding: 5px 6px;
        font-size: 0.7em;
    }

    .scan-result {
        padding: 5px 6px;
    }

    .result-label {
        font-size: 0.7em;
    }

    .result-value {
        font-size: 0.8em;
    }

    .controls {
        gap: 4px;
    }

    .debug-info {
        padding: 3px 6px;
        font-size: 0.65em;
    }

    .btn {
        padding: 4px 8px;
        font-size: 0.7em;
    }

    .icon {
        font-size: 0.85em;
    }

    .student-section {
        padding: 5px 8px;
    }

    .student-scroll {
        gap: 4px;
        padding: 4px 4px;
    }

    .student-card {
        padding: 4px 6px;
        min-height: 34px;
        min-width: 100px;
        gap: 4px;
    }

    .student-avatar {
        width: 20px;
        height: 20px;
        font-size: 0.8em;
    }

    .student-name {
        font-size: 0.75em;
    }

    .student-status {
        font-size: 0.6em;
        padding: 1px 3px;
    }
}

/* ==================== 签到方式突出显示 ==================== */

/* 强制要求的签到方式高亮样式 */
.mobile-checkin-section.highlight-required {
    border: 3px solid #ef4444;
    border-radius: 12px;
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: #ef4444;
        box-shadow: 0 0 20px rgba(239, 68, 68, 0.3);
    }
    50% {
        border-color: #dc2626;
        box-shadow: 0 0 30px rgba(239, 68, 68, 0.5);
    }
}

/* 强制模式标识 */
.mode-required {
    color: #ef4444 !important;
    font-weight: 700;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
}

/* 全屏模式下的学生列表样式 */
.student-section.full-screen {
    flex: 1;
    height: 100%;
    overflow-y: auto;
}

.student-section.full-screen .student-scroll {
    /* 全屏模式最多显示8行 */
    max-height: calc((42px + 8px) * 8);
    overflow-y: auto;
}

/* 隐藏 main-content 时的样式调整 */
.container .main-content[style*="display: none"] ~ .student-section {
    flex: 1;
    height: 100%;
}

.container .main-content[style*="display: none"] ~ .student-section .student-scroll {
    /* 全屏模式最多显示8行 */
    max-height: calc((42px + 8px) * 8);
    overflow-y: auto;
}

/* ==================== 打卡结束Modal ==================== */

.checkin-end-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    width: 90%;
    max-width: 900px;
    max-height: 85vh;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    flex-shrink: 0;
}

.modal-title {
    font-size: 1.5em;
    font-weight: 700;
    margin: 0;
}

.modal-close {
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.2em;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 25px;
}

/* Modal统计信息 */
.modal-statistics {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    margin-bottom: 20px;
    flex-shrink: 0;
}

.modal-stat-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.modal-stat-label {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.modal-stat-value {
    font-size: 2em;
    font-weight: 700;
    min-width: 60px;
    text-align: center;
}

.modal-stat-present .modal-stat-value {
    color: #28a745;
}

.modal-stat-absent .modal-stat-value {
    color: #dc3545;
}

.modal-stat-late .modal-stat-value {
    color: #ffc107;
}

.modal-stat-leave .modal-stat-value {
    color: #17a2b8;
}

/* Modal学生列表 */
.modal-student-list {
    background: #f8f9fa;
    border-radius: 12px;
    overflow: hidden;
    flex: 1;
    min-height: 300px;
    max-height: 400px;
    overflow-y: auto;
}

.modal-student-header {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 12px 15px;
    background: #e9ecef;
    font-weight: 600;
    color: #495057;
    position: sticky;
    top: 0;
    z-index: 10;
}

.modal-student-header-id,
.modal-student-header-name,
.modal-student-header-status,
.modal-student-header-time {
    font-size: 0.9em;
}

.modal-student-items {
    display: flex;
    flex-direction: column;
}

.modal-student-item {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 10px;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    transition: background 0.2s;
}

.modal-student-item:hover {
    background: #e9ecef;
}

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

.modal-student-id {
    font-size: 0.9em;
    color: #666;
    font-weight: 500;
}

.modal-student-name {
    font-size: 0.9em;
    color: #333;
    font-weight: 600;
}

.modal-student-status {
    font-size: 0.85em;
    font-weight: 600;
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    text-align: center;
}

.modal-student-status.not-checked-in {
    background: #e9ecef;
    color: #6c757d;
}

.modal-student-status.present {
    background: #d4edda;
    color: #155724;
}

.modal-student-status.absent {
    background: #f8d7da;
    color: #721c24;
}

.modal-student-status.late {
    background: #fff3cd;
    color: #856404;
}

.modal-student-status.leave {
    background: #d1ecf1;
    color: #0c5460;
}

.modal-student-time {
    font-size: 0.85em;
    color: #666;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .modal-header {
        padding: 15px 20px;
    }

    .modal-title {
        font-size: 1.2em;
    }

    .modal-statistics {
        gap: 15px;
        padding: 15px;
    }

    .modal-stat-label {
        font-size: 0.8em;
    }

    .modal-stat-value {
        font-size: 1.5em;
        min-width: 45px;
    }

    .modal-student-header,
    .modal-student-item {
        grid-template-columns: 1fr 1fr 1fr;
        gap: 8px;
        padding: 8px 10px;
    }

    .modal-student-header-time,
    .modal-student-time {
        display: none;
    }

    .modal-body {
        padding: 15px;
    }
}