/* =============================================================
   人脸识别签到系统 - 全局样式表
   风格：粉调科技风 · 毛玻璃效果 · 移动端优先
   ============================================================= */

/* ------ CSS变量（统一色调）------ */
:root {
    --primary: #ff6b9d;           /* 主色：粉色 */
    --primary-dark: #e55a8a;      /* 深粉（hover状态） */
    --primary-light: #ffb3d0;     /* 浅粉 */
    --primary-gradient: linear-gradient(135deg, #ff6b9d 0%, #c44dff 100%);
    --secondary: #c44dff;         /* 辅色：紫色 */
    --text-primary: #2d1b36;      /* 主文字色 */
    --text-secondary: #6b5b7a;    /* 次要文字 */
    --text-light: #ffffff;
    --bg-dark: rgba(45, 27, 54, 0.8);
    --glass-bg: rgba(255, 255, 255, 0.15);
    --glass-border: rgba(255, 255, 255, 0.3);
    --glass-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    --success: #4caf50;
    --danger: #f44336;
    --warning: #ff9800;
    --radius: 16px;
    --radius-sm: 8px;
    --font: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', sans-serif;
}

/* ------ 全局重置 ------ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    font-family: var(--font);
    background: linear-gradient(135deg, #1a0a2e 0%, #2d1b36 30%, #ff6b9d 100%);
    background-attachment: fixed;
    min-height: 100vh;
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

/* ------ 粒子背景容器 ------ */
#particle-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
}

/* ------ 页面主体容器 ------ */
.page-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ------ 毛玻璃卡片 ------ */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--glass-shadow);
    padding: 32px 24px;
    width: 100%;
    max-width: 420px;
    transition: all 0.3s ease;
}

.glass-card:hover {
    box-shadow: 0 8px 40px rgba(255, 107, 157, 0.2);
}

/* ------ 标题样式 ------ */
.page-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-light);
    text-align: center;
    margin-bottom: 8px;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    margin-bottom: 28px;
}

.card-title {
    font-size: 22px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ------ 表单样式 ------ */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-light);
    margin-bottom: 6px;
    opacity: 0.9;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: var(--radius-sm);
    font-size: 16px;
    color: var(--text-light);
    outline: none;
    transition: all 0.3s ease;
    font-family: var(--font);
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(255, 107, 157, 0.2);
}

/* ------ 按钮样式 ------ */
.btn {
    display: block;
    width: 100%;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    font-family: var(--font);
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.97);
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--text-light);
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

.btn-primary:hover {
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.6);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-success {
    background: linear-gradient(135deg, #4caf50, #45a049);
    color: white;
    box-shadow: 0 4px 15px rgba(76, 175, 80, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f44336, #d32f2f);
    color: white;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255, 255, 255, 0.4);
    color: var(--text-light);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 14px;
    width: auto;
    display: inline-block;
}

/* ------ 摄像头预览区域 ------ */
.camera-container {
    position: relative;
    width: 100%;
    max-width: 360px;
    margin: 0 auto 20px;
    border-radius: var(--radius);
    overflow: hidden;
    background: rgba(0, 0, 0, 0.3);
    aspect-ratio: 4/3;
}

.camera-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.camera-container canvas {
    display: none;
}

.camera-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: rgba(255, 255, 255, 0.5);
    font-size: 14px;
}

.camera-placeholder .icon {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.camera-overlay {
    position: absolute;
    top: 10%;
    left: 10%;
    right: 10%;
    bottom: 10%;
    border: 2px dashed rgba(255, 255, 255, 0.5);
    border-radius: var(--radius);
    pointer-events: none;
    animation: pulse-border 2s ease-in-out infinite;
}

@keyframes pulse-border {
    0%, 100% { border-color: rgba(255, 107, 157, 0.3); }
    50% { border-color: rgba(255, 107, 157, 0.7); }
}

.camera-mask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,0.3) 100%);
    pointer-events: none;
}

/* ------ 拍照按钮 ------ */
.capture-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.6);
    background: rgba(255, 255, 255, 0.2);
    cursor: pointer;
    margin: 16px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.capture-btn::after {
    content: '';
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--primary-gradient);
    transition: all 0.3s ease;
}

.capture-btn:active {
    transform: scale(0.92);
}

.capture-btn:active::after {
    width: 40px;
    height: 40px;
}

/* ------ 拍照后的预览 ------ */
.photo-preview {
    width: 100%;
    max-width: 360px;
    margin: 0 auto 20px;
    border-radius: var(--radius);
    overflow: hidden;
    position: relative;
}

.photo-preview img {
    width: 100%;
    display: block;
    border-radius: var(--radius);
}

/* ------ 提示消息 ------ */
.message-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    margin-bottom: 16px;
    display: none;
    text-align: center;
}

.message-box.success {
    display: block;
    background: rgba(76, 175, 80, 0.15);
    border: 1px solid rgba(76, 175, 80, 0.3);
    color: #81c784;
}

.message-box.error {
    display: block;
    background: rgba(244, 67, 54, 0.15);
    border: 1px solid rgba(244, 67, 54, 0.3);
    color: #ef9a9a;
}

.message-box.info {
    display: block;
    background: rgba(33, 150, 243, 0.15);
    border: 1px solid rgba(33, 150, 243, 0.3);
    color: #90caf9;
}

/* ------ Loading 动画 ------ */
.loading {
    display: none;
    text-align: center;
    padding: 20px 0;
}

.loading.active {
    display: block;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.2);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 12px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.loading-text {
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

/* ------ 管理员登录 ------ */
.admin-card {
    max-width: 380px;
}

.login-icon {
    font-size: 64px;
    text-align: center;
    margin-bottom: 16px;
}

/* ------ 审核列表 ------ */
.review-container {
    max-width: 600px;
    padding: 20px;
    width: 100%;
}

.review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-light);
}

.review-header h1 {
    font-size: 20px;
}

.review-header .back-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-size: 14px;
}

.review-header .back-link:hover {
    color: var(--primary-light);
}

.review-item {
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    color: var(--text-light);
}

.review-item .student-info {
    margin-bottom: 12px;
}

.review-item .student-name {
    font-size: 18px;
    font-weight: 600;
}

.review-item .student-detail {
    font-size: 14px;
    opacity: 0.8;
    margin-top: 4px;
}

.review-item .student-photo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-sm);
    object-fit: cover;
    margin-bottom: 12px;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.review-item .action-btns {
    display: flex;
    gap: 12px;
    margin-top: 12px;
}

.review-item .action-btns .btn {
    flex: 1;
    padding: 10px;
    font-size: 14px;
}

.empty-tip {
    text-align: center;
    color: rgba(255, 255, 255, 0.6);
    padding: 40px 0;
    font-size: 16px;
}

/* ------ 签到记录页样式 ------ */
.log-container {
    max-width: 700px;
    padding: 20px;
    width: 100%;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: var(--text-light);
}

.log-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.log-filters .form-input {
    flex: 1;
    min-width: 120px;
    padding: 8px 12px;
    font-size: 14px;
}

.log-filters .btn {
    width: auto;
    padding: 8px 20px;
    font-size: 14px;
    flex-shrink: 0;
}

.log-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.log-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: var(--text-light);
}

.log-table th,
.log-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.log-table th {
    font-weight: 600;
    opacity: 0.8;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.log-table tr:hover td {
    background: rgba(255, 255, 255, 0.05);
}

.badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: rgba(76, 175, 80, 0.2);
    color: #81c784;
}

.badge-danger {
    background: rgba(244, 67, 54, 0.2);
    color: #ef9a9a;
}

.badge-warning {
    background: rgba(255, 152, 0, 0.2);
    color: #ffb74d;
}

.badge-info {
    background: rgba(33, 150, 243, 0.2);
    color: #90caf9;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
}

.pagination .btn {
    width: auto;
    padding: 8px 16px;
    font-size: 14px;
}

/* ------ 签到成功动画 ------ */
.success-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 100;
    backdrop-filter: blur(4px);
}

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

.success-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 32px;
    text-align: center;
    max-width: 340px;
    width: 90%;
    animation: scaleIn 0.4s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.8); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.success-name {
    font-size: 28px;
    font-weight: 700;
    color: white;
    margin-bottom: 4px;
}

.success-class {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 20px;
}

.success-score {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.5);
}

/* ------ 响应式适配 ------ */
@media (max-width: 480px) {
    .glass-card {
        padding: 24px 16px;
        border-radius: 12px;
    }

    .page-title {
        font-size: 24px;
    }

    .card-title {
        font-size: 20px;
    }

    .camera-container {
        max-width: 100%;
    }

    .log-filters .form-input {
        min-width: 80px;
        font-size: 13px;
    }

    .log-table {
        font-size: 13px;
    }

    .log-table th,
    .log-table td {
        padding: 8px 6px;
    }
}

/* ------ 滚动条美化 ------ */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ------ 通用工具类 ------ */
.text-center { text-align: center; }
.mt-16 { margin-top: 16px; }
.mb-16 { margin-bottom: 16px; }
.mt-8 { margin-top: 8px; }
.mb-8 { margin-bottom: 8px; }
.flex-center { display: flex; align-items: center; justify-content: center; }
