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

/* ==================== CSS变量 & 重置 ==================== */
:root {
    --primary: #ff6b9d;           /* 主色 - 粉色 */
    --primary-dark: #e55a8a;      /* 深粉色 */
    --primary-light: #ffd4e4;     /* 浅粉色 */
    --secondary: #c084fc;         /* 紫色 - 辅助色 */
    --secondary-light: #e9d5ff;   /* 浅紫 */
    --accent: #38bdf8;            /* 蓝色 - 强调色 */
    --success: #4ade80;           /* 绿色 - 成功 */
    --warning: #fbbf24;           /* 黄色 - 警告 */
    --danger: #f87171;            /* 红色 - 错误 */
    --text-primary: #1e1b4b;      /* 深色文字 */
    --text-secondary: #6b7280;    /* 灰色文字 */
    --text-light: #ffffff;        /* 白色文字 */
    --glass-bg: rgba(255, 255, 255, 0.15);      /* 毛玻璃背景 */
    --glass-border: rgba(255, 255, 255, 0.3);    /* 毛玻璃边框 */
    --glass-shadow: rgba(31, 38, 135, 0.15);     /* 毛玻璃阴影 */
    --bg-gradient-start: #0f0c29;  /* 渐变背景色1 */
    --bg-gradient-mid: #302b63;    /* 渐变背景色2 */
    --bg-gradient-end: #24243e;    /* 渐变背景色3 */
    --radius: 16px;                /* 圆角 */
    --radius-sm: 10px;             /* 小圆角 */
    --shadow: 0 8px 32px rgba(31, 38, 135, 0.15);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-mid), var(--bg-gradient-end));
    min-height: 100vh;
    color: var(--text-light);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ==================== 粒子背景容器 ==================== */
#particle-canvas {
    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;
    padding: 20px 16px 40px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    text-align: center;
    margin: 20px 0;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: none;
}

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

/* ==================== 毛玻璃卡片 ==================== */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 28px 24px;
    width: 100%;
    max-width: 420px;
    margin-bottom: 20px;
    transition: transform 0.3s ease;
}

.glass-card:hover {
    transform: translateY(-2px);
}

.glass-card-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-light);
    text-align: center;
    letter-spacing: 0.5px;
}

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

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 6px;
    letter-spacing: 0.5px;
}

.form-group label .required {
    color: var(--danger);
    margin-left: 2px;
}

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

.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);
}

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

.form-input:-webkit-autofill {
    -webkit-text-fill-color: var(--text-light);
    -webkit-box-shadow: 0 0 0px 1000px rgba(48, 43, 99, 0.8) inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* ==================== 按钮样式 ==================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

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

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(255, 107, 157, 0.4);
}

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

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

.btn-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: white;
    box-shadow: 0 4px 15px rgba(34, 197, 94, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.4);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-light);
    border: 1.5px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.btn-sm {
    padding: 8px 16px;
    font-size: 13px;
    width: auto;
    min-width: 80px;
}

/* ==================== 摄像头区域 ==================== */
.camera-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 16px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    position: relative;
    background: #000;
    aspect-ratio: 4/3;
}

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

.camera-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.camera-frame {
    width: 70%;
    height: 70%;
    border: 2px solid var(--primary);
    border-radius: 12px;
    opacity: 0.6;
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.2);
}

.camera-toolbar {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 16px;
}

.camera-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: 3px solid var(--text-light);
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-light);
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.camera-btn:active {
    transform: scale(0.9);
}

.camera-btn-capture {
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 0 20px rgba(255, 107, 157, 0.5);
}

.camera-btn-capture:active {
    box-shadow: 0 0 30px rgba(255, 107, 157, 0.7);
}

/* ==================== 状态消息 ==================== */
.message-box {
    padding: 12px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
    font-size: 14px;
    text-align: center;
    display: none;
    animation: fadeIn 0.3s ease;
}

.message-box.show {
    display: block;
}

.message-success {
    background: rgba(74, 222, 128, 0.2);
    border: 1px solid rgba(74, 222, 128, 0.4);
    color: #86efac;
}

.message-error {
    background: rgba(248, 113, 113, 0.2);
    border: 1px solid rgba(248, 113, 113, 0.4);
    color: #fca5a5;
}

.message-info {
    background: rgba(56, 189, 248, 0.2);
    border: 1px solid rgba(56, 189, 248, 0.4);
    color: #7dd3fc;
}

/* ==================== 加载动画 ==================== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: var(--text-light);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
    vertical-align: middle;
}

.loading-lg {
    width: 40px;
    height: 40px;
    border-width: 3px;
}

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

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* ==================== 管理员页面 ==================== */
.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    max-width: 900px;
    padding: 16px 0;
    margin-bottom: 16px;
}

.admin-header h1 {
    font-size: 20px;
    font-weight: 600;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.admin-nav {
    display: flex;
    gap: 8px;
}

.admin-nav a {
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.08);
    transition: all 0.3s ease;
}

.admin-nav a:hover,
.admin-nav a.active {
    background: rgba(255, 107, 157, 0.2);
    color: var(--primary-light);
}

/* ==================== 审核列表 / 签到记录 ==================== */
.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table th {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    text-align: left;
}

.data-table td {
    padding: 12px 8px;
    font-size: 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

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

/* 状态标签 */
.status-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status-pending {
    background: rgba(251, 191, 36, 0.2);
    color: #fbbf24;
}

.status-approved {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.status-rejected {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

.status-pass {
    background: rgba(74, 222, 128, 0.2);
    color: #4ade80;
}

.status-fail {
    background: rgba(248, 113, 113, 0.2);
    color: #f87171;
}

/* 操作按钮组 */
.action-group {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

/* 头像缩略图 */
.avatar-thumb {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(255, 255, 255, 0.2);
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: rgba(255, 255, 255, 0.4);
}

.empty-state .icon {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
}

.empty-state p {
    font-size: 14px;
}

/* ==================== 分页 ==================== */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
}

.pagination button {
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.pagination button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.pagination button.active {
    background: var(--primary);
    border-color: var(--primary);
}

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

/* ==================== 响应式 ==================== */
@media (max-width: 600px) {
    .page-container {
        padding: 12px 12px 30px;
    }

    .glass-card {
        padding: 20px 16px;
        border-radius: 12px;
    }

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

    .admin-header {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
    }

    .admin-nav {
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

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

    .data-table th,
    .data-table td {
        padding: 10px 6px;
        font-size: 13px;
    }

    .avatar-thumb {
        width: 32px;
        height: 32px;
    }

    .camera-container {
        border-radius: var(--radius-sm);
    }
}

/* ==================== Toast提示 ==================== */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: transform 0.4s ease;
    max-width: 90%;
    text-align: center;
    backdrop-filter: blur(10px);
}

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

.toast-success {
    background: rgba(74, 222, 128, 0.9);
    color: white;
}

.toast-error {
    background: rgba(248, 113, 113, 0.9);
    color: white;
}

.toast-info {
    background: rgba(56, 189, 248, 0.9);
    color: white;
}

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

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

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

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