/* ==================== 全局样式 ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #f5f7fa 0%, #e4edf5 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 导航栏 ==================== */
.navbar {
    background: linear-gradient(120deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    padding: 15px 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.admin-navbar {
    background: linear-gradient(120deg, #13c2c2 0%, #1890ff 100%);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 1px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

#userStatus, #adminUserStatus {
    font-weight: 500;
}

/* ==================== 按钮样式 ==================== */
.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.btn-primary {
    background: linear-gradient(120deg, #6a11cb 0%, #2575fc 100%);
    color: white;
}

.btn-primary:hover {
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.4);
}

.btn-success {
    background: linear-gradient(120deg, #52c41a 0%, #73d13d 100%);
    color: white;
}

.btn-warning {
    background: linear-gradient(120deg, #fa8c16 0%, #ffa940 100%);
    color: white;
}

.btn-danger {
    background: linear-gradient(120deg, #ff4d4f 0%, #cf1322 100%);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid rgba(255,255,255,0.3);
    color: white;
}

.btn-outline:hover {
    background: rgba(255,255,255,0.1);
}

.btn-block {
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.9rem;
}

.btn-icon {
    font-size: 1.1em;
}

/* ==================== 卡片样式 ==================== */
.card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    margin-bottom: 25px;
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    background: linear-gradient(120deg, #f6ffed 0%, #e6f7ff 100%);
    border-bottom: 1px solid #e8e8e8;
}

.card-header h2 {
    font-size: 1.4rem;
    color: #1a365d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #595959;
}
/* 查询输入框特殊样式 */
#queryIdInput {
    font-weight: 600;
    letter-spacing: 1px;
}

#queryIdInput:focus {
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 查询结果高亮 */
.member-item {
    position: relative;
    transition: all 0.3s;
}
.required {
    color: #ff4d4f;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #d9d9d9;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.3s;
}

.form-control:focus {
    border-color: #1677ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.2);
}

.form-text {
    color: #8c8c8c;
    font-size: 0.9rem;
    margin-top: 5px;
    display: block;
}

/* ==================== 网格布局 ==================== */
.grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 25px;
}

.admin-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
}

.stat-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

@media (max-width: 968px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 参与者列表 ==================== */
.participants-list {
    max-height: 400px;
    overflow-y: auto;
}

.participant-item {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s;
}

.participant-item:hover {
    background: #f9fbfd;
}

.participant-id {
    background: #1677ff;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-right: 12px;
}

.participant-name {
    font-weight: 600;
    color: #1a365d;
}

.participant-score {
    font-weight: bold;
    color: #1677ff;
    font-size: 1.1rem;
    margin-left: 15px;
}

.btn-remove {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 15px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s;
}

.btn-remove:hover {
    background: #cf1322;
}

/* ==================== 匹配结果 ==================== */
.match-result {
    min-height: 300px;
    margin-top: 20px;
}

.combo-card {
    background: linear-gradient(135deg, #f6ffed 0%, #e6f7ff 100%);
    border: 2px solid #52c41a;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(82, 196, 26, 0.15);
    transition: all 0.3s ease;
}

.combo-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(82, 196, 26, 0.25);
}

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

.combo-index {
    background: linear-gradient(120deg, #722ed1 0%, #9254de 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.combo-total {
    font-size: 1.4rem;
    font-weight: bold;
    color: #52c41a;
}

.combo-members {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.member-item {
    background: white;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #e6f7ff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
    transition: all 0.2s ease;
}

.member-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.member-id {
    display: inline-block;
    background: #1677ff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.member-name {
    font-weight: 600;
    color: #595959;
    margin-bottom: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

.member-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1677ff;
}

/* ==================== 自动匹配结果 ==================== */
.auto-match-result {
    background: linear-gradient(135deg, #fffbe6 0%, #fff1b8 100%);
    border: 2px solid #faad14;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
    display: none;
    box-shadow: 0 4px 12px rgba(250, 173, 20, 0.15);
}

.auto-match-result .card-header {
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ffd591;
}

.auto-match-result h3 {
    color: #fa8c16;
    font-size: 1.3rem;
    font-weight: 600;
    margin: 0;
}

.auto-match-empty {
    text-align: center;
    padding: 25px;
    color: #fa8c16;
}

.auto-match-empty .empty-icon {
    font-size: 2.5rem;
    margin-bottom: 12px;
}

.auto-match-loading {
    text-align: center;
    padding: 25px;
    color: #1890ff;
}

.auto-match-loading .loading-icon {
    font-size: 2rem;
    margin-bottom: 12px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ==================== 查询结果优化 ==================== */
.query-result-card {
    background: linear-gradient(135deg, #f0f5ff 0%, #e6f4ff 100%);
    border: 2px solid #1677ff;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 12px rgba(22, 119, 255, 0.15);
}

.query-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid #91caff;
}

.query-result-index {
    background: linear-gradient(120deg, #1677ff 0%, #40a9ff 100%);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.9rem;
}

.query-result-total {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1677ff;
}

.query-result-members {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 10px;
}

.query-member-item {
    background: white;
    padding: 12px 8px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid #d6e4ff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.query-member-id {
    display: inline-block;
    background: #1677ff;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.query-member-name {
    font-weight: 600;
    color: #595959;
    margin-bottom: 4px;
    font-size: 0.85rem;
    word-break: break-all;
}

.query-member-score {
    font-size: 1.1rem;
    font-weight: bold;
    color: #1677ff;
}

/* ==================== 空状态 ==================== */
.empty-state {
    text-align: center;
    padding: 40px 20px;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}

.empty-text {
    color: #8c8c8c;
    margin-top: 10px;
    font-size: 0.95rem;
}

/* ==================== 统计卡片 ==================== */
.stat-card {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    font-size: 2.5rem;
}

.stat-content {
    flex: 1;
}

.stat-label {
    color: #8c8c8c;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.stat-value {
    font-size: 1.8rem;
    font-weight: bold;
    color: #1a365d;
}

.stat-card-blue .stat-value { color: #1677ff; }
.stat-card-green .stat-value { color: #52c41a; }
.stat-card-orange .stat-value { color: #fa8c16; }
.stat-card-purple .stat-value { color: #722ed1; }

/* ==================== 表格样式 ==================== */
.table-responsive {
    overflow-x: auto;
}

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

.table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.table th {
    background: #f9fbfd;
    font-weight: 600;
    color: #595959;
    font-size: 0.95rem;
}

.table tbody tr:hover {
    background: #f9fbfd;
}

.table td {
    color: #333;
}

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

.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: modalFadeIn 0.3s;
}

@keyframes modalFadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 20px 25px;
    background: linear-gradient(120deg, #f6ffed 0%, #e6f7ff 100%);
    border-bottom: 1px solid #e8e8e8;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    font-size: 1.3rem;
    color: #1a365d;
}

.close {
    font-size: 2rem;
    cursor: pointer;
    color: #8c8c8c;
    transition: color 0.2s;
}

.close:hover {
    color: #ff4d4f;
}

.modal-body {
    padding: 25px;
}

.error-message {
    background: #fff2f0;
    border: 1px solid #ffa39e;
    border-radius: 8px;
    padding: 12px 15px;
    color: #cf1322;
    margin-bottom: 15px;
    font-size: 0.9rem;
}

/* ==================== 公告栏 ==================== */
.announcement {
    background: linear-gradient(120deg, #fff7e6 0%, #fffbe6 100%);
    border-left: 5px solid #faad14;
    padding: 12px 0;
    margin-bottom: 25px;
}

.announcement .container {
    display: flex;
    align-items: center;
    gap: 15px;
}

.announcement-icon {
    font-size: 1.5rem;
}

.announcement-text {
    color: #ad6800;
    font-size: 0.95rem;
}

/* ==================== 状态徽章 ==================== */
.status-badge {
    display: inline-block;
    padding: 6px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

.status-success {
    background: rgba(82, 196, 26, 0.15);
    color: #52c41a;
}

.status-error {
    background: rgba(255, 77, 79, 0.15);
    color: #ff4d4f;
}

/* ==================== Footer ==================== */
.footer {
    background: #f9fbfd;
    padding: 30px 0 20px;
    margin-top: 40px;
    border-top: 1px solid #eee;
    text-align: center;
}

.footer p {
    color: #666;
    font-size: 0.95rem;
}

.footer-note {
    color: #8c8c8c;
    font-size: 0.9rem;
    margin-top: 8px;
}

/* ==================== 加载动画和进度条样式 ==================== */

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

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

@keyframes shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* 进度条动画效果 */
#progressBar {
    animation: shimmer 2s infinite linear;
    background: linear-gradient(90deg, 
        #1890ff 0%, 
        #40a9ff 25%, 
        #69c0ff 50%, 
        #40a9ff 75%, 
        #1890ff 100%);
    background-size: 200% 100%;
}

/* 加载文本脉冲效果 */
#loadingText {
    animation: pulse 2s ease-in-out infinite;
}

/* 计算提示区域样式 */
#calculationTips {
    animation: fadeInUp 0.5s ease-out;
}

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

/* 加载背景模糊效果 */
#globalLoadingIndicator {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

/* 按钮加载状态 */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* 进度百分比动画 */
#progressPercent {
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: right;
}

/* 预估时间闪烁效果 */
#estimatedTime {
    animation: blink 3s infinite;
}

@keyframes blink {
    0%, 50%, 100% { opacity: 1; }
    25%, 75% { opacity: 0.7; }
}

/* 响应式加载界面 */
@media (max-width: 768px) {
    #globalLoadingIndicator {
        padding: 20px;
    }
    
    #globalLoadingIndicator > div {
        max-width: 90vw;
    }
    
    #loadingProgress {
        width: 90vw;
        max-width: 300px;
    }
    
    #calculationTips {
        font-size: 0.9rem;
        padding: 15px;
    }
}

/* 高性能计算提示 */
.performance-tip {
    background: linear-gradient(135deg, #fffbe6, #feffe6);
    border-left: 4px solid #faad14;
    padding: 12px 16px;
    margin: 15px 0;
    border-radius: 0 8px 8px 0;
    font-size: 0.9rem;
    color: #d48806;
}

/* ==================== 响应式设计 ==================== */
@media (max-width: 768px) {
    .grid {
        grid-template-columns: 1fr;
    }
    
    .navbar .container {
        flex-direction: column;
        gap: 15px;
    }
    
    .combo-members {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .modal-content {
        width: 95%;
    }
}

/* ==================== 按分数查找用户功能样式 ==================== */

.score-search-section {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 2px solid #f0f0f0;
}

.score-search-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.score-search-icon {
    font-size: 1.5rem;
    color: #1890ff;
}

.score-search-controls {
    display: flex;
    gap: 15px;
    align-items: end;
    flex-wrap: wrap;
    margin-bottom: 15px;
}

.score-search-input {
    flex: 1;
    min-width: 200px;
    padding: 12px 15px;
    border: 2px solid #d9d9d9;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.score-search-input:focus {
    border-color: #1890ff;
    outline: none;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.score-search-results {
    margin-top: 20px;
    padding: 20px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.score-match-count {
    background: linear-gradient(120deg, #1890ff 0%, #40a9ff 100%);
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    display: inline-block;
}

.user-list-grid {
    display: grid;
    gap: 15px;
    margin-bottom: 25px;
}

.score-user-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #fafafa;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
    transition: all 0.3s ease;
}

.score-user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    background: #f0f8ff;
}

.user-basic-info {
    flex: 1;
}

.user-id-display {
    font-weight: bold;
    color: #262626;
    font-size: 1.1rem;
    margin-bottom: 5px;
}

.user-name-display {
    color: #595959;
    font-size: 0.95rem;
}

.user-score-display {
    font-size: 1.4rem;
    font-weight: bold;
    color: #1890ff;
    background: white;
    padding: 8px 15px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.test-user-highlight {
    border-left-color: #ff4d4f !important;
    background: #fff2f0 !important;
}

.test-user-highlight .user-id-display,
.test-user-highlight .user-name-display,
.test-user-highlight .user-score-display {
    color: #ff4d4f !important;
}

.test-badge {
    display: inline-block;
    background: #ff4d4f;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 10px;
}

.statistics-panel {
    background: #f0f5ff;
    border-radius: 8px;
    padding: 20px;
    border-left: 4px solid #1890ff;
    margin-top: 20px;
}

.statistics-title {
    color: #1890ff;
    margin: 0 0 15px 0;
    font-size: 1.1rem;
}

.statistics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.statistic-item {
    padding: 10px;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.statistic-label {
    font-weight: 500;
    color: #595959;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.statistic-value {
    font-size: 1.1rem;
    font-weight: 600;
    color: #262626;
}

.empty-search-result {
    text-align: center;
    padding: 40px 20px;
}

.empty-search-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.6;
}

.empty-search-text {
    color: #8c8c8c;
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.empty-search-subtext {
    color: #bfbfbf;
    font-size: 0.95rem;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .score-search-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .score-search-input {
        min-width: 100%;
    }
    
    .score-user-card {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .user-score-display {
        align-self: flex-end;
    }
    
    .statistics-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== 开关样式 ==================== */
.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 26px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 26px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: #1890ff;
}

input:checked + .slider:before {
    transform: translateX(24px);
}
