/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    font-family: 'Microsoft YaHei', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    line-height: 1.6;
}
/* 容器样式 */
.container, .admin-container, .login-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}
/* 头部样式 */
header {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.header-content h1 {
    font-size: 32px;
    color: #1e3c72;
    margin-bottom: 5px;
}
.subtitle {
    color: #718096;
    font-size: 14px;
}
.header-actions {
    display: flex;
    gap: 15px;
}
/* 按钮样式 */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-block;
}
.btn-primary {
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    color: white;
}
.btn-success {
    background: #48bb78;
    color: white;
}
.btn-danger {
    background: #f56565;
    color: white;
}
.btn-warning {
    background: #ecc94b;
    color: #744210;
}
.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}
.btn-small {
    padding: 6px 12px;
    font-size: 12px;
}
.btn-icon {
    width: 30px;
    height: 30px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s;
}
.btn-icon:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}
/* 筛选栏 */
.filter-bar {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.search-form {
    display: flex;
    gap: 15px;
    align-items: center;
}
.search-box {
    flex: 1;
    display: flex;
    gap: 10px;
}
.search-box input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 14px;
    transition: all 0.3s;
}
.search-box input:focus {
    border-color: #667eea;
    outline: none;
}
.btn-search {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
}
.class-filter select {
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    min-width: 150px;
    background: white;
}
/* 前三名展示 */
.top-three {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}
.top-card {
    background: white;
    border-radius: 15px;
    padding: 30px 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    transition: all 0.3s;
}
.top-card:hover {
    transform: translateY(-5px);
}
.top-1 {
    background: linear-gradient(135deg, #ffd700 0%, #fbbf24 100%);
    color: #744210;
}
.top-2 {
    background: linear-gradient(135deg, #c0c0c0 0%, #a0aec0 100%);
    color: #2d3748;
}
.top-3 {
    background: linear-gradient(135deg, #cd7f32 0%, #b45309 100%);
    color: #fff;
}
.top-rank {
    font-size: 48px;
    margin-bottom: 10px;
}
.top-avatar {
    width: 80px;
    height: 80px;
    background: rgba(255,255,255,0.3);
    border-radius: 50%;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: bold;
}
.top-name {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 5px;
}
.top-class {
    font-size: 14px;
    opacity: 0.9;
    margin-bottom: 10px;
}
.top-points {
    font-size: 28px;
    font-weight: bold;
}
/* 排行榜表格 - 移除滚动条 */
.rank-board {
    background: white;
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    overflow-x: auto;
    overflow-y: visible; /* 修改：取消垂直滚动条 */
    max-height: none; /* 修改：取消最大高度限制 */
}
.rank-table {
    width: 100%;
    border-collapse: collapse;
}
.rank-table th {
    background: #f7fafc;
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}
.rank-table td {
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.rank-table tbody tr:hover {
    background: #f7fafc;
}
.rank {
    font-weight: bold;
    font-size: 18px;
}
.rank-top-1 {
    color: #f6ad55;
}
.rank-top-2 {
    color: #a0aec0;
}
.rank-top-3 {
    color: #c4a484;
}
.class-badge {
    background: #e2e8f0;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 12px;
    color: #4a5568;
}
.student-name {
    font-weight: 600;
    color: #2d3748;
}
.points {
    font-weight: bold;
    color: #e53e3e;
    font-size: 18px;
}
.comment-bubble {
    background: #edf2f7;
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    color: #4a5568;
    max-width: 300px;
    position: relative;
}
.comment-count {
    background: #667eea;
    color: white;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 10px;
    margin-left: 5px;
}
.no-comments {
    color: #a0aec0;
    font-style: italic;
}
.no-data {
    text-align: center;
    padding: 50px !important;
    color: #a0aec0;
    font-size: 16px;
}
/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 30px;
}
.page-link {
    padding: 10px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.3s;
}
.page-link:hover, .page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}
/* 模态框 */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    animation: fadeIn 0.3s;
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.modal-content {
    background: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
}
@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}
.close {
    position: absolute;
    right: 20px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    color: #a0aec0;
    cursor: pointer;
    transition: color 0.3s;
}
.close:hover {
    color: #4a5568;
}
.highlight {
    color: #667eea;
    font-weight: bold;
}
/* 后台样式 */
.admin-container {
    background: #f7fafc;
    min-height: 100vh;
    padding: 20px;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}
.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.stat-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    color: white;
}
.stat-info {
    flex: 1;
}
.stat-value {
    font-size: 28px;
    font-weight: bold;
    color: #1e3c72;
}
.stat-label {
    color: #718096;
    font-size: 14px;
}
.card {
    background: white;
    border-radius: 15px;
    margin-bottom: 30px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    overflow: hidden;
}
.card-header {
    background: #f7fafc;
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
}
.card-header h2 {
    color: #1e3c72;
    font-size: 18px;
}
.card-body {
    padding: 20px;
}
.alert {
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-weight: 500;
}
.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}
.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}
.form-inline {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}
.form-input {
    padding: 10px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    flex: 1;
    min-width: 150px;
}
.form-input:focus {
    border-color: #667eea;
    outline: none;
}
.text-muted {
    color: #718096;
    margin-bottom: 10px;
    font-size: 14px;
}
.example-box {
    background: #f7fafc;
    padding: 15px;
    border-radius: 8px;
    font-family: monospace;
    font-size: 13px;
    margin-bottom: 15px;
    border-left: 4px solid #667eea;
}
.batch-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-family: monospace;
    font-size: 14px;
    margin-bottom: 15px;
    resize: vertical;
}
.batch-textarea:focus {
    border-color: #667eea;
    outline: none;
}
.admin-table {
    width: 100%;
    border-collapse: collapse;
}
.admin-table th {
    background: #f7fafc;
    padding: 12px;
    text-align: left;
    font-weight: 600;
    color: #4a5568;
    border-bottom: 2px solid #e2e8f0;
}
.admin-table td {
    padding: 12px;
    border-bottom: 1px solid #e2e8f0;
    vertical-align: middle;
}
.points-control {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}
.points-display {
    font-weight: bold;
    color: #e53e3e;
    min-width: 30px;
    text-align: center;
}
.points-input {
    padding: 5px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    width: 60px;
}
.status-badge {
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}
.status-active {
    background: #c6f6d5;
    color: #22543d;
}
.status-inactive {
    background: #fed7d7;
    color: #742a2a;
}
/* 登录页面 */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}
.login-box {
    background: white;
    border-radius: 20px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.login-box h1 {
    text-align: center;
    color: #1e3c72;
    margin-bottom: 30px;
}
.login-form {
    margin-bottom: 20px;
}
.login-form .form-group {
    margin-bottom: 20px;
}
.login-form label {
    display: block;
    margin-bottom: 5px;
    color: #4a5568;
    font-weight: 500;
}
.login-form input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
}
.login-form input:focus {
    border-color: #667eea;
    outline: none;
}
.btn-block {
    width: 100%;
}
.back-link {
    display: block;
    text-align: center;
    margin-top: 15px;
    color: #667eea;
    text-decoration: none;
}
.back-link:hover {
    text-decoration: underline;
}
.login-info {
    margin-top: 30px;
    padding: 15px;
    background: #f7fafc;
    border-radius: 8px;
    font-size: 14px;
    color: #4a5568;
    border-left: 4px solid #667eea;
}
.login-info p {
    margin: 5px 0;
}
/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .header-actions {
        width: 100%;
        justify-content: center;
    }
    
    .search-form {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .class-filter {
        width: 100%;
    }
    
    .class-filter select {
        width: 100%;
    }
    
    .top-three {
        grid-template-columns: 1fr;
    }
    
    .form-inline {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-table {
        display: block;
        overflow-x: auto;
    }
}
/* 统计信息样式 */
.stats-info {
    background: white;
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    font-size: 14px;
    color: #4a5568;
}
.stats-info span {
    display: flex;
    align-items: center;
    gap: 5px;
}
/* 清除筛选按钮 */
.btn-clear {
    padding: 8px 15px;
    background: #e2e8f0;
    color: #4a5568;
    border-radius: 5px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.3s;
}
.btn-clear:hover {
    background: #cbd5e0;
}
/* 分页优化 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin: 30px 0 15px;
    flex-wrap: wrap;
}
.page-link {
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    text-decoration: none;
    color: #4a5568;
    transition: all 0.3s;
    min-width: 40px;
    text-align: center;
}
.page-link:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    transform: translateY(-2px);
}
.page-link.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    font-weight: bold;
}
.page-dots {
    padding: 8px 12px;
    color: #a0aec0;
}
/* 快速跳转 */
.pagination-jump {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    font-size: 14px;
    color: #718096;
}
.pagination-jump input {
    width: 60px;
    padding: 6px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    text-align: center;
}
.pagination-jump input:focus {
    outline: none;
    border-color: #667eea;
}
.btn-jump {
    padding: 6px 15px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
}
.btn-jump:hover {
    background: #5a67d8;
}
/* 响应式调整 */
@media (max-width: 768px) {
    .stats-info {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .pagination {
        gap: 3px;
    }
    
    .page-link {
        padding: 6px 10px;
        min-width: 35px;
        font-size: 13px;
    }
    
    .pagination-jump {
        flex-wrap: wrap;
    }
}
/* 表格优化 - 适应更多数据 */
.rank-table {
    font-size: 14px;
}
.rank-table th {
    position: sticky;
    top: 0;
    background: #f7fafc;
    z-index: 10;
}
.rank-table td {
    padding: 12px 10px;
}
/* 移除整个排行榜的滚动条 - 已在上方修改 */

/* 留言容器样式 - 核心优化（保留滚动条并美化） */
.comments-container {
    position: relative;
    width: 320px;
    max-width: 100%;
    background: #f8f9fa;
    border-radius: 12px;
    padding: 8px;
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 2px rgba(0,0,0,0.06);
    transition: all 0.3s ease;
}
.comments-container:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    border-color: #dee2e6;
}
/* 留言滚动区域 - 保留滚动条并美化 */
.comments-scroll {
    max-height: 90px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #667eea #e9ecef;
    padding: 0 5px;
    transition: max-height 0.5s ease-in-out;
    border-radius: 6px;
}
/* 跨浏览器统一滚动条样式 - 美化 */
.comments-scroll::-webkit-scrollbar {
    width: 8px;
}
.comments-scroll::-webkit-scrollbar-track {
    background: #e9ecef;
    border-radius: 10px;
    margin: 2px 0;
}
.comments-scroll::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 10px;
    border: 2px solid #e9ecef;
}
.comments-scroll::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2, #667eea);
}
.comments-scroll::-webkit-scrollbar-thumb:active {
    background: #5a67d8;
}
/* 单条留言样式 - 优化间距和层次 */
.comment-item {
    padding: 10px 12px;
    margin-bottom: 6px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
    transition: all 0.2s ease;
    font-size: 13px;
    line-height: 1.6;
    border-left: 3px solid #667eea;
    position: relative;
    overflow: hidden;
}
.comment-item:last-child {
    margin-bottom: 0;
}
.comment-item:hover {
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(102, 126, 234, 0.15);
}
/* 添加装饰性小圆点 */
.comment-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: inherit;
}
/* 留言时间 */
.comment-time {
    color: #868e96;
    font-size: 11px;
    display: block;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
    font-weight: 500;
}
/* 留言内容 */
.comment-content {
    color: #495057;
    word-break: break-word;
    display: block;
    line-height: 1.5;
}
/* 留言数量提示 - 优化过渡 */
.comments-more {
    text-align: center;
    padding: 8px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 0 0 8px 8px;
    font-size: 12px;
    color: #495057;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    border: 1px solid #dee2e6;
    border-top: none;
}
.comments-more:hover {
    background: linear-gradient(135deg, #e9ecef, #dee2e6);
    color: #667eea;
    transform: translateY(-1px);
}
/* 展开状态 - 平滑过渡 */
.comments-container.expanded .comments-scroll {
    max-height: 300px;
}
.comments-container.expanded .comments-more {
    border-radius: 8px;
    margin-top: 6px;
    background: linear-gradient(135deg, #667eea20, #764ba220);
    border: 1px solid #667eea40;
}
.comments-more:after {
    content: " ▼ 展开";
    font-size: 11px;
    opacity: 0.8;
}
.comments-container.expanded .comments-more:after {
    content: " ▲ 收起";
}
/* 暂无留言样式 */
.no-comments {
    color: #adb5bd;
    font-style: italic;
    padding: 20px 10px;
    display: block;
    text-align: center;
    font-size: 13px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px dashed #dee2e6;
}
/* 留言区域动画 */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.comment-item {
    animation: slideIn 0.3s ease;
}
/* 不同状态的留言样式 - 使用渐变色区分 */
.comment-item:nth-child(odd) {
    border-left-color: #48bb78;
}
.comment-item:nth-child(even) {
    border-left-color: #f6ad55;
}
/* 留言数量徽章 - 优化动效 */
.comment-badge {
    display: inline-block;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ff6b6b, #ee5a5a);
    color: white;
    border-radius: 20px;
    font-size: 9px;
    margin-left: 5px;
    animation: pulse 2s infinite ease-in-out;
    box-shadow: 0 2px 4px rgba(255,107,107,0.3);
    font-weight: 600;
    letter-spacing: 0.3px;
}
@keyframes pulse {
    0% {
        transform: scale(1);
        opacity: 0.9;
    }
    50% {
        transform: scale(1.08);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 0.9;
    }
}
/* 留言统计 */
.comments-count {
    text-align: center;
    padding: 6px;
    color: #868e96;
    font-size: 12px;
    margin-top: 8px;
    border-top: 1px dashed #dee2e6;
    font-weight: 500;
}
/* 留言内容中的链接/表情样式 */
.comment-content a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}
.comment-content a:hover {
    text-decoration: underline;
}
.comment-content img.emoji {
    height: 1.2em;
    width: 1.2em;
    margin: 0 0.05em 0 0.1em;
    vertical-align: -0.1em;
}
/* 小屏设备留言容器适配 */
@media (max-width: 768px) {
    .comments-container {
        width: 240px;
    }
    .comments-scroll {
        max-height: 80px;
    }
    .comment-item {
        font-size: 12px;
        padding: 8px 10px;
    }
    .comments-container.expanded .comments-scroll {
        max-height: 200px;
    }
    /* 小屏设备滚动条稍小 */
    .comments-scroll::-webkit-scrollbar {
        width: 6px;
    }
}