/* 班级积分管理系统 - 主样式文件 */

/* ========== 全局样式 ========== */
:root {
    --primary-color: #4e73df;
    --primary-light: #5a82f7;
    --primary-dark: #3d5ac7;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fc;
    --dark-color: #343a40;
    --gray-100: #f8f9fa;
    --gray-200: #e9ecef;
    --gray-300: #dee2e6;
    --gray-400: #ced4da;
    --gray-500: #adb5bd;
    --gray-600: #6c757d;
    --gray-700: #495057;
    --gray-800: #343a40;
    --gray-900: #212529;
    --border-radius: 0.375rem;
    --box-shadow: 0 0.15rem 1.75rem 0 rgba(58, 59, 69, 0.15);
    --box-shadow-sm: 0 0.125rem 0.25rem 0 rgba(58, 59, 69, 0.2);
    --font-family: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
}

* {
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 0.875rem;
    color: var(--gray-600);
    background-color: var(--light-color);
    line-height: 1.5;
}

.h1, .h2, .h3, .h4, .h5, .h6, h1, h2, h3, h4, h5, h6 {
    color: var(--gray-800);
    font-weight: 600;
}

/* ========== 认证页面样式 ========== */
.auth-page {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1rem;
}

.auth-container {
    width: 100%;
    max-width: 400px;
}

.auth-card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    padding: 2rem;
    text-align: center;
}

.auth-header {
    margin-bottom: 2rem;
}

.auth-logo {
    width: 80px;
    height: 80px;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    color: white;
    font-size: 2rem;
}

.auth-header h1 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--gray-800);
}

.auth-header p {
    color: var(--gray-600);
    margin: 0;
}

.auth-form {
    text-align: left;
}

.auth-form .form-group {
    margin-bottom: 1.5rem;
}

.auth-form .form-control {
    height: calc(2.25rem + 2px);
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.auth-form .input-group-text {
    background-color: var(--gray-100);
    border: 1px solid var(--gray-300);
    color: var(--gray-600);
}

.auth-form .btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    font-weight: 600;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
}

.auth-form .btn-primary:hover {
    background-color: var(--primary-dark);
    border-color: var(--primary-dark);
}

.auth-footer {
    margin-top: 2rem;
    text-align: center;
}

.auth-footer a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
}

.auth-footer a:hover {
    text-decoration: underline;
}

/* 加载动画 */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    text-align: center;
    min-width: 200px;
}

.loading-spinner .spinner-border {
    margin-bottom: 1rem;
}

/* ========== 控制台样式 ========== */
.dashboard-page {
    background-color: var(--light-color);
}

/* 导航栏 */
.navbar-brand {
    font-weight: 700;
    font-size: 1.2rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
}

/* 统计卡片 */
.card {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.card.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.card.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.card.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.card.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.card-header {
    background-color: var(--light-color);
    border-bottom: 1px solid var(--gray-200);
}

.card-header h6 {
    margin: 0;
    font-weight: 700;
    color: var(--primary-color);
}

/* 按钮样式 */
.btn {
    font-weight: 600;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

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

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

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

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

/* 表格样式 */
.table {
    color: var(--gray-800);
}

.table thead th {
    border-top: none;
    border-bottom: 1px solid var(--gray-200);
    font-weight: 700;
    color: var(--gray-700);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.table td {
    border-top: 1px solid var(--gray-200);
    vertical-align: middle;
}

/* 模态框样式 */
.modal-content {
    border: none;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
}

.modal-header {
    border-bottom: 1px solid var(--gray-200);
    background-color: var(--light-color);
}

.modal-header .modal-title {
    font-weight: 700;
    color: var(--primary-color);
}

.modal-footer {
    border-top: 1px solid var(--gray-200);
    background-color: var(--light-color);
}

/* 表单样式 */
.form-control {
    border: 1px solid var(--gray-300);
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(78, 115, 223, 0.25);
}

.form-group label {
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 0.5rem;
}

/* 警告框样式 */
.alert {
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.alert-primary {
    background-color: rgba(78, 115, 223, 0.15);
    color: var(--primary-dark);
}

.alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    color: #155724;
}

.alert-info {
    background-color: rgba(23, 162, 184, 0.15);
    color: #0c5460;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    color: #721c24;
}

/* 徽章样式 */
.badge {
    font-weight: 600;
    font-size: 0.75rem;
}

.badge-primary {
    background-color: var(--primary-color);
}

.badge-success {
    background-color: var(--success-color);
}

.badge-info {
    background-color: var(--info-color);
}

.badge-warning {
    background-color: var(--warning-color);
}

.badge-danger {
    background-color: var(--danger-color);
}

/* 分页样式 */
.pagination .page-link {
    color: var(--primary-color);
    border-color: var(--gray-300);
}

.pagination .page-link:hover {
    color: var(--primary-dark);
    background-color: var(--gray-200);
    border-color: var(--gray-300);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* 下拉菜单样式 */
.dropdown-menu {
    border: none;
    box-shadow: var(--box-shadow);
    border-radius: var(--border-radius);
}

.dropdown-item {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
}

.dropdown-item:hover {
    background-color: var(--gray-100);
}

.dropdown-header {
    font-weight: 700;
    color: var(--gray-700);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* 图表容器 */
.chart-area {
    position: relative;
    height: 300px;
}

/* 学生卡片 */
.student-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    transition: all 0.3s ease;
}

.student-card:hover {
    box-shadow: var(--box-shadow-sm);
    transform: translateY(-2px);
}

.student-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
}

.student-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.student-info h5 {
    margin: 0 0 0.5rem 0;
    font-weight: 600;
}

.student-info .text-muted {
    font-size: 0.8rem;
}

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

/* 积分操作按钮 */
.point-actions .btn {
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

.point-actions .btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

/* 排行榜样式 */
.ranking-item {
    display: flex;
    align-items: center;
    padding: 1rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    background: white;
}

.ranking-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    margin-right: 1rem;
}

.ranking-number.top-1 {
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    color: #b45309;
}

.ranking-number.top-2 {
    background: linear-gradient(45deg, #c0c0c0, #e5e7eb);
    color: #374151;
}

.ranking-number.top-3 {
    background: linear-gradient(45deg, #cd7f32, #d97706);
    color: white;
}

.ranking-number.other {
    background: var(--gray-100);
    color: var(--gray-600);
}

/* 小组卡片 */
.group-card {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin-bottom: 1rem;
    background: white;
}

.group-header {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 1rem;
}

.group-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--gray-800);
    margin: 0;
}

.group-stats {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.group-stat {
    text-align: center;
}

.group-stat-value {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--primary-color);
}

.group-stat-label {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* 商品卡片 */
.shop-item {
    border: 1px solid var(--gray-200);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin-bottom: 1rem;
    background: white;
    text-align: center;
}

.shop-item-image {
    width: 80px;
    height: 80px;
    border-radius: var(--border-radius);
    margin: 0 auto 1rem;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--gray-400);
}

.shop-item-name {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.shop-item-cost {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--warning-color);
}

.shop-item-stock {
    font-size: 0.8rem;
    color: var(--gray-600);
}

/* 工具提示 */
.tooltip {
    font-size: 0.75rem;
}

/* 进度条 */
.progress {
    height: 0.5rem;
    border-radius: calc(var(--border-radius) / 2);
    background-color: var(--gray-200);
}

.progress-bar {
    border-radius: calc(var(--border-radius) / 2);
}

/* 自定义滚动条 */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}

/* 动画效果 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, to { transform: translate3d(0,0,0); }
    40%, 43% { transform: translate3d(0, -30px, 0); }
    70% { transform: translate3d(0, -15px, 0); }
    90% { transform: translate3d(0, -4px, 0); }
}

.bounce {
    animation: bounce 1s ease-out;
}

/* 辅助类 */
.text-xs {
    font-size: 0.75rem !important;
}

.font-weight-bold {
    font-weight: 700 !important;
}

.text-uppercase {
    text-transform: uppercase !important;
}

.shadow {
    box-shadow: var(--box-shadow) !important;
}

.shadow-sm {
    box-shadow: var(--box-shadow-sm) !important;
}

.border-left-primary {
    border-left: 0.25rem solid var(--primary-color) !important;
}

.border-left-success {
    border-left: 0.25rem solid var(--success-color) !important;
}

.border-left-info {
    border-left: 0.25rem solid var(--info-color) !important;
}

.border-left-warning {
    border-left: 0.25rem solid var(--warning-color) !important;
}

.border-left-danger {
    border-left: 0.25rem solid var(--danger-color) !important;
}

.text-gray-300 { color: var(--gray-300) !important; }
.text-gray-400 { color: var(--gray-400) !important; }
.text-gray-500 { color: var(--gray-500) !important; }
.text-gray-600 { color: var(--gray-600) !important; }
.text-gray-700 { color: var(--gray-700) !important; }
.text-gray-800 { color: var(--gray-800) !important; }
.text-gray-900 { color: var(--gray-900) !important; }
