/* 全局样式 */
:root {
    --primary-color: #4a90e2;
    --secondary-color: #ff6b6b;
    --success-color: #2ecc71;
    --warning-color: #f1c40f;
    --danger-color: #e74c3c;
    --gray-color: #95a5a6;
    --light-gray: #f8f9fa;
    --dark-color: #2c3e50;
    --white-color: #ffffff;
}

body {
    background-color: var(--light-gray);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/* 卡片样式 */
.custom-card {
    background: var(--white-color);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    transition: transform 0.2s ease;
}

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

/* 导航栏样式 */
.navbar {
    background: linear-gradient(135deg, var(--primary-color), #2980b9);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.5rem;
}

/* 按钮样式 */
.btn-custom-primary {
    background: var(--primary-color);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    color: var(--white-color);
    transition: all 0.3s ease;
}

.btn-custom-primary:hover {
    background: #357abd;
    transform: translateY(-1px);
}

/* 统计卡片 */
.stats-card {
    padding: 20px;
    border-radius: 15px;
    background: var(--white-color);
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
}

.stats-number {
    font-size: 2rem;
    font-weight: bold;
    color: var(--primary-color);
}

.stats-label {
    color: var(--gray-color);
    font-size: 0.9rem;
}

/* 表格样式 */
.custom-table {
    width: 100%;
    background: var(--white-color);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.custom-table th {
    background-color: var(--primary-color);
    color: var(--white-color);
    padding: 15px;
    font-weight: 500;
}

.custom-table td {
    padding: 12px 15px;
    vertical-align: middle;
}

/* 表单样式 */
.form-control {
    border-radius: 8px;
    border: 1px solid #dee2e6;
    padding: 10px 15px;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(74, 144, 226, 0.25);
}

/* 糖果图标动画 */
.candy-icon {
    font-size: 2.5rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
    100% { transform: translateY(0px); }
}

/* 响应式布局 */
@media (max-width: 768px) {
    .stats-card {
        margin-bottom: 15px;
    }
    
    .custom-table {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .container {
        padding-left: 10px;
        padding-right: 10px;
    }
    
    .stats-number {
        font-size: 1.5rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* 加载动画 */
.loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading::after {
    content: '';
    width: 50px;
    height: 50px;
    border: 5px solid var(--light-gray);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* 提示消息样式 */
.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
}

.toast {
    background: var(--white-color);
    border-radius: 8px;
    padding: 15px 20px;
    margin-bottom: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    animation: slideIn 0.3s ease-out;
}

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

/* 排名样式 */
.rank-item {
    display: flex;
    align-items: center;
    padding: 10px;
    margin-bottom: 10px;
    background: var(--white-color);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.rank-item:hover {
    transform: translateX(5px);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.rank-number {
    width: 30px;
    height: 30px;
    background: var(--primary-color);
    color: var(--white-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-weight: bold;
}

.rank-info {
    flex: 1;
}

.rank-name {
    font-weight: bold;
    margin-bottom: 5px;
}

.rank-score {
    color: var(--secondary-color);
    font-weight: bold;
}
