/* 现代化设计系统 */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --secondary-gradient: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --success-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --warning-gradient: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    --danger-gradient: linear-gradient(135deg, #fa709a 0%, #ff6b6b 100%);
    --info-gradient: linear-gradient(135deg, #30cfd0 0%, #330867 100%);
    
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;
    
    --bg-color: #f8fafc;
    --card-bg: rgba(255, 255, 255, 0.95);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: rgba(226, 232, 240, 0.8);
    
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-glow: 0 0 20px rgba(102, 126, 234, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: var(--bg-color);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text-primary);
    line-height: 1.6;
}

/* 页面容器 */
.page-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
}

/* 欢迎区域 */
.welcome-section {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: var(--primary-gradient);
    border-radius: var(--radius-xl);
    color: white;
    box-shadow: var(--shadow-xl), var(--shadow-glow);
    position: relative;
    overflow: hidden;
}

.welcome-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.welcome-subtitle {
    font-size: 1rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

/* --- 修改部分开始：统计卡片网格 --- */
.stats-grid {
    display: grid;
    /* 强制分为 4 列，确保始终在一行 */
    grid-template-columns: repeat(4, 1fr); 
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    width: 100%;
}
/* --- 修改部分结束 --- */

/* 现代化统计卡片 */
.stat-card-modern {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    /* 确保内容不会溢出导致换行 */
    white-space: nowrap; 
}

.stat-card-modern::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--card-gradient, var(--primary-gradient));
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.stat-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
}

.stat-card-modern:hover::before {
    transform: scaleX(1);
}

.stat-card-modern.personal { --card-gradient: var(--primary-gradient); }
.stat-card-modern.punish { --card-gradient: var(--success-gradient); }
.stat-card-modern.class { --card-gradient: var(--danger-gradient); }
.stat-card-modern.report { --card-gradient: var(--warning-gradient); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.stat-icon-wrapper {
    width: 48px; /* 稍微缩小图标以适应一行 */
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-gradient, var(--primary-gradient));
    box-shadow: var(--shadow-md);
    flex-shrink: 0; /* 防止图标被压缩 */
}

.stat-icon-wrapper i {
    font-size: 1.25rem;
    color: white;
}

.stat-trend {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem; /* 缩小字体 */
    font-weight: 600;
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    flex-shrink: 0;
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger-color);
}

.stat-value {
    font-size: 1.75rem; /* 稍微缩小数字字体 */
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.25rem;
    line-height: 1.2;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 0.85rem; /* 缩小标签字体 */
    font-weight: 500;
}

/* --- 修改部分开始：功能卡片网格 --- */
.features-section {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.features-grid {
    display: grid;
    /* 默认一行 4 个 */
    grid-template-columns: repeat(4, 1fr); 
    gap: 1.5rem;
}
/* --- 修改部分结束 --- */

.feature-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    cursor: pointer;
    text-decoration: none !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.feature-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--card-gradient, var(--primary-gradient));
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.feature-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.feature-card:hover::after {
    opacity: 0.03;
}

.feature-card > * {
    position: relative;
    z-index: 1;
}

.feature-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.25rem;
    background: var(--card-gradient, var(--primary-gradient));
    box-shadow: var(--shadow-lg);
}

.feature-icon i {
    font-size: 1.75rem;
    color: white;
}

.feature-card.personal { --card-gradient: var(--primary-gradient); }
.feature-card.punish { --card-gradient: var(--danger-gradient); }
.feature-card.class { --card-gradient: var(--warning-gradient); }
.feature-card.report { --card-gradient: var(--info-gradient); }

.feature-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.feature-desc {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* 快捷操作区域 */
.quick-actions-section {
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    padding: 2rem;
    margin-bottom: 2.5rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.quick-actions-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    text-align: center;
}

.quick-actions-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
}

.quick-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    background: white;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none !important;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.quick-action-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

.quick-action-btn i {
    font-size: 1.1rem;
}

/* 底部信息区域 */
.info-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

.info-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
}

.info-card-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--bg-color);
}

.info-list {
    list-style: none;
}

.info-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.info-item:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.info-value {
    color: var(--text-primary);
    font-weight: 500;
}

.info-value a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.info-value a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* --- 修改部分开始：响应式调整 --- */

/* 平板及中等屏幕：功能卡片变为 2x2 */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 列 */
    }
    
    .info-section {
        grid-template-columns: 1fr;
    }
}

/* 小屏幕/手机：统计卡片保持一行，但压缩内容 */
@media (max-width: 768px) {
    .page-container {
        padding: 1rem;
    }
    
    .welcome-section {
        padding: 1.5rem;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
    
    /* 统计卡片在手机上2x2，通过缩小 padding 和字体来适应 */
    .stats-grid {
        gap: 1rem;
        grid-template-columns: repeat(2, 1fr);
    }
    
    .stat-card-modern {
        padding: 1rem; /* 减小内边距 */
    }
    
    .stat-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .stat-icon-wrapper i {
        font-size: 1rem;
    }
    
    .stat-value {
        font-size: 1.5rem;
    }
    
    .stat-label {
        font-size: 0.75rem;
    }
    
    .stat-trend {
        font-size: 0.65rem;
        padding: 0.15rem 0.5rem;
    }
    
    /* 功能卡片在手机上保持 2x2 或者根据需求调整，这里保持 2 列 */
    .features-grid {
        grid-template-columns: repeat(2, 1fr); 
        gap: 1rem;
    }
    
    .feature-card {
        padding: 1.5rem 1rem;
    }
    
    .feature-icon {
        width: 50px;
        height: 50px;
        margin-bottom: 1rem;
    }
    
    .feature-icon i {
        font-size: 1.5rem;
    }
    
    .feature-title {
        font-size: 1rem;
    }
    
    .feature-desc {
        font-size: 0.8rem;
        display: none; /* 极小屏幕下隐藏描述以节省空间 */
    }
    
    .quick-actions-grid {
        flex-direction: column;
    }
    
    .quick-action-btn {
        width: 100%;
        justify-content: center;
    }
}

/* 超小屏幕：如果实在塞不下，允许统计卡片横向滚动，或者保持压缩 */
@media (max-width: 480px) {
    .stats-grid {
        /* 如果 4 列太挤，可以开启横向滚动，或者继续压缩 */
        /* 这里选择继续压缩，保持一行 */
        /*display: grid;*/
        display: none;
        grid-template-columns: repeat(2, 1fr);
        overflow-x: auto; /* 防止溢出 */
        padding-bottom: 10px;
    }
    
    .stat-card-modern {
        min-width: 0; /* 允许压缩 */
    }
    
    .stat-label {
        display: none; /* 超小屏幕隐藏标签，只显示数字 */
    }
    
    .stat-header {
        margin-bottom: 0.5rem;
    }
}

/* --- 修改部分结束 --- */

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.stat-card-modern,
.feature-card,
.quick-actions-section,
.info-card {
    animation: fadeInUp 0.6s ease-out forwards;
}

.stat-card-modern:nth-child(1) { animation-delay: 0.1s; }
.stat-card-modern:nth-child(2) { animation-delay: 0.2s; }
.stat-card-modern:nth-child(3) { animation-delay: 0.3s; }
.stat-card-modern:nth-child(4) { animation-delay: 0.4s; }

.feature-card:nth-child(1) { animation-delay: 0.5s; }
.feature-card:nth-child(2) { animation-delay: 0.6s; }
.feature-card:nth-child(3) { animation-delay: 0.7s; }
.feature-card:nth-child(4) { animation-delay: 0.8s; }

/* 玻璃拟态效果增强 */
.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* 渐变文字 */
.gradient-text {
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}