/**
 * 班级操行分管理系统 - 全局样式
 * 
 * 开发者: Canglan
 * 联系方式: admin@sea-studio.top
 * 版权归属: Sea Network Technology Studio
 * 许可证: MIT License
 * 
 * 版权所有 © Sea Network Technology Studio
 */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f7fb;
    min-height: 100vh;
    font-size: 14px;
    color: #333;
}

/* ========== 登录页面 ========== */
.login-container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 400px;
    max-width: 90%;
    margin: 100px auto;
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 24px;
    color: #333;
    margin-bottom: 8px;
}

.login-header p {
    color: #666;
    font-size: 14px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form label {
    display: block;
    margin-bottom: 6px;
    color: #555;
    font-weight: 500;
}

.login-form input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.login-form input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-login {
    width: 100%;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: opacity 0.3s;
}

.btn-login:hover {
    opacity: 0.9;
}

.error-msg {
    background: #fee;
    color: #c33;
    padding: 10px;
    border-radius: 8px;
    margin-top: 15px;
    text-align: center;
    font-size: 13px;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    color: #999;
    font-size: 12px;
}

/* ========== 公共头部 ========== */
.header {
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 12px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 18px;
    color: #333;
}

.header-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.user-name {
    color: #666;
    font-weight: 500;
}

.user-role {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
}

.btn-logout {
    background: #e53e3e;
    color: white;
    border: none;
    padding: 6px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: background 0.3s;
}

.btn-logout:hover {
    background: #c53030;
}

/* ========== 导航菜单 ========== */
.nav {
    background: white;
    padding: 0 24px;
    border-bottom: 1px solid #eee;
    display: flex;
    gap: 4px;
    overflow-x: auto;
}

.nav-item {
    padding: 12px 20px;
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    border-bottom: 2px solid transparent;
    text-decoration: none;
    display: inline-block;
}

.nav-item:hover {
    color: #667eea;
}

.nav-item.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* ========== 容器 ========== */
.container {
    max-width: 1200px;
    margin: 24px auto;
    padding: 0 24px;
}

/* ========== 卡片 ========== */
.card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.card-title {
    font-size: 18px;
    font-weight: bold;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #667eea;
    color: #333;
}

/* ========== 统计卡片网格 ========== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.stat-value {
    font-size: 32px;
    font-weight: bold;
    color: #667eea;
    margin: 10px 0;
}

.stat-label {
    color: #666;
    font-size: 13px;
}

/* ========== 表格 ========== */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background: #f8f9fa;
    font-weight: 600;
    color: #555;
}

tr:hover {
    background: #f8f9fa;
}

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

.status-submitted {
    background: #c6f6d5;
    color: #22543d;
}

.status-not_submitted {
    background: #fed7d7;
    color: #742a2a;
}

.status-late {
    background: #feebc8;
    color: #7c2d12;
}

.status-present {
    background: #c6f6d5;
    color: #22543d;
}

.status-absent {
    background: #fed7d7;
    color: #742a2a;
}

.status-leave {
    background: #e9d8fd;
    color: #553c9a;
}

/* ========== 按钮 ========== */
.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    transition: all 0.3s;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a67d8;
}

.btn-danger {
    background: #e53e3e;
    color: white;
}

.btn-danger:hover {
    background: #c53030;
}

.btn-success {
    background: #38a169;
    color: white;
}

.btn-success:hover {
    background: #2f855a;
}

.btn-sm {
    padding: 4px 10px;
    font-size: 12px;
}

/* ========== 模态框 ========== */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    border-radius: 12px;
    padding: 24px;
    width: 500px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid #eee;
}

.modal-header h3 {
    font-size: 18px;
    color: #333;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
}

.modal-footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #555;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.form-group small {
    display: block;
    color: #999;
    font-size: 12px;
    margin-top: 4px;
}

/* ========== 复选框组 ========== */
.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.checkbox-group input {
    width: auto;
}

/* ========== 操作栏 ========== */
.action-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

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

.search-bar input {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    width: 200px;
}

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

.pagination a, .pagination span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #666;
    cursor: pointer;
}

.pagination .active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* ========== 提示消息 ========== */
.toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    z-index: 1100;
    animation: fadeInUp 0.3s ease;
}

.toast-success {
    background: #38a169;
}

.toast-error {
    background: #e53e3e;
}

.toast-warning {
    background: #ed8936;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

/* ========== 加载动画 ========== */
.loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-top-color: #667eea;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ========== 底部 ========== */
.footer {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 12px;
}

/* ========== 记录项 ========== */
.record-item {
    padding: 12px 0;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.record-points {
    font-weight: bold;
}

.record-points.plus {
    color: #38a169;
}

.record-points.minus {
    color: #e53e3e;
}

.record-reason {
    flex: 1;
    margin: 0 15px;
    color: #555;
}

.record-time {
    font-size: 12px;
    color: #999;
}

.view-more {
    text-align: center;
    margin-top: 15px;
}

.view-more a {
    color: #667eea;
    text-decoration: none;
}

.conduct-score {
    text-align: center;
    padding: 20px;
}

.score-number {
    font-size: 64px;
    font-weight: bold;
    color: #667eea;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    th, td {
        padding: 8px;
        font-size: 12px;
    }
    
    .card {
        padding: 16px;
    }
    
    .nav {
        padding: 0 16px;
    }
    
    .nav-item {
        padding: 10px 14px;
        font-size: 13px;
    }
    
    .action-bar {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-bar {
        width: 100%;
    }
    
    .search-bar input {
        flex: 1;
    }
}