/* 组件样式 */

/* =====================================================
   团队分组助手现代化样式
   ===================================================== */

/* 团队分组容器 */
.team-content {
    position: relative;
    background: linear-gradient(135deg, rgba(255,255,255,0.95) 0%, rgba(248,250,252,0.95) 100%);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* 团队分组表单 */
.team-form {
    position: relative;
    padding: 30px;
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-bottom: 30px;
}

.team-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    border-radius: 20px 20px 0 0;
}

/* 玩家选择区域样式 */
.player-checkboxes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 16px;
    max-height: 450px;
    overflow-y: auto;
    padding: 20px;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    margin-top: 12px;
    position: relative;
}

.player-checkboxes::-webkit-scrollbar {
    width: 8px;
}

.player-checkboxes::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
}

.player-checkboxes::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
}

/* 现代化玩家卡片 */
.player-checkbox {
    display: flex;
    align-items: center;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid transparent;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 4px 12px rgba(0, 0, 0, 0.05),
        0 1px 4px rgba(0, 0, 0, 0.1);
}

.player-checkbox::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    transition: width 0.3s ease;
    z-index: 0;
}

.player-checkbox:hover {
    border-color: #667eea;
    transform: translateY(-4px) scale(1.02);
    box-shadow: 
        0 12px 24px rgba(102, 126, 234, 0.15),
        0 4px 8px rgba(102, 126, 234, 0.1);
}

.player-checkbox:hover::before {
    width: 100%;
}

/* 选中状态样式 */
.player-checkbox input[type="checkbox"]:checked + .player-info::after {
    content: '✓';
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
    animation: checkmark-bounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkmark-bounce {
    0% { 
        transform: scale(0) rotate(0deg); 
        opacity: 0;
    }
    50% { 
        transform: scale(1.3) rotate(180deg); 
        opacity: 1;
    }
    100% { 
        transform: scale(1) rotate(360deg); 
        opacity: 1;
    }
}

.player-checkbox input[type="checkbox"]:checked ~ .player-info {
    position: relative;
}

.player-checkbox input[type="checkbox"]:checked {
    accent-color: #10b981;
}

/* 复选框样式 */
.player-checkbox input[type="checkbox"] {
    margin-right: 12px;
    width: 20px;
    height: 20px;
    accent-color: #667eea;
    border-radius: 4px;
    position: relative;
    z-index: 1;
}

/* 玩家信息样式 */
.player-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    position: relative;
    z-index: 1;
}

.player-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 6px;
    font-size: 15px;
    line-height: 1.2;
}

.player-stats {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

.player-stats::before {
    content: '⭐';
    font-size: 12px;
}

/* 选择计数器样式 */
.selection-count {
    color: #667eea;
    font-size: 14px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    display: inline-block;
    margin-left: 8px;
    transition: all 0.3s ease;
}

.selection-count:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
    transform: scale(1.05);
}

/* 加载占位符 */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    color: #64748b;
    padding: 60px 20px;
    font-style: italic;
    font-size: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border: 2px dashed #cbd5e1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-placeholder::before {
    content: '⏳';
    font-size: 24px;
    animation: pulse 2s infinite;
}

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

/* 团队分组结果样式 */
.team-results {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    margin-top: 30px;
    position: relative;
    overflow: hidden;
}

.team-results::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #047857 100%);
    border-radius: 20px 20px 0 0;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 24px;
    margin-top: 24px;
}

/* 现代化团队卡片 */
.team-card {
    background: linear-gradient(145deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid transparent;
    border-radius: 18px;
    padding: 26px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        0 4px 12px rgba(0, 0, 0, 0.04);
}

.team-card:nth-child(1) {
    border-left: 4px solid #667eea;
}

.team-card:nth-child(2) {
    border-left: 4px solid #10b981;
}

.team-card:hover {
    transform: translateY(-6px) scale(1.02);
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 
        0 16px 40px rgba(102, 126, 234, 0.15),
        0 8px 16px rgba(102, 126, 234, 0.1);
}

/* 团队标题 */
.team-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
    position: relative;
}

.team-header h4 {
    color: #1e293b;
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-header h4::before {
    content: '🏆';
    font-size: 16px;
}

.team-card:nth-child(2) .team-header h4::before {
    content: '⚔️';
}

.team-score {
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.25);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.team-card:nth-child(2) .team-score {
    color: #ffffff;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

/* 团队评分组 */
.team-scores {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.period-scores {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.period-score {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.period-score.early {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.period-score.mid {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.period-score.late {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

/* 团队成员列表 */
.team-members {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px 12px 24px;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.8) 0%, rgba(241, 245, 249, 0.8) 100%);
    border-radius: 12px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.team-member::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transition: all 0.3s ease;
    border-radius: 0 2px 2px 0;
}

.team-member:hover {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.08) 100%);
    border-color: rgba(102, 126, 234, 0.3);
    transform: translateX(6px) scale(1.01);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.12);
}

.team-member:hover::before {
    width: 8px;
}

/* 成员信息区域 */
.member-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    margin-left: 8px;
}

.member-name {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
}

.member-period-scores {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.rating {
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    color: white;
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
}

.rating.early {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.rating.mid {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
}

.rating.late {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
}

.member-score {
    color: #667eea;
    font-size: 13px;
    font-weight: 600;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.12) 100%);
    padding: 4px 10px;
    border-radius: 14px;
    min-width: 52px;
    text-align: center;
    border: 1px solid rgba(102, 126, 234, 0.15);
    margin-left: 12px;
}

/* 分组统计样式 */
.division-stats {
    margin-top: 24px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
    border-radius: 12px;
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.division-stats h4 {
    color: #1e293b;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.division-stats h4::before {
    content: '📊';
    font-size: 14px;
}

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

.stats-row span {
    color: #64748b;
    font-size: 14px;
    font-weight: 500;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.5);
    text-align: center;
}

/* 表单操作按钮样式 */
.form-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 24px;
}

.btn {
    padding: 14px 24px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 140px;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    outline: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: 2px solid transparent;
}

.btn-primary:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:active {
    transform: translateY(-1px) scale(1.02);
}

.btn-secondary {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: #64748b;
    border: 2px solid #e2e8f0;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary:active {
    transform: translateY(-1px) scale(1.02);
}

.btn:disabled {
    background: #cbd5e1;
    color: #94a3b8;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    border-color: #cbd5e1;
}

.btn:disabled:hover {
    transform: none;
    box-shadow: none;
}

.btn-icon {
    font-size: 16px;
    z-index: 2;
    position: relative;
}

/* 按钮文字 */
.btn span:not(.btn-icon) {
    z-index: 2;
    position: relative;
}

/* 数据源选择标签页 */
.data-source-tabs {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    padding: 6px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.tab-btn {
    flex: 1;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: #64748b;
    position: relative;
    overflow: hidden;
}

.tab-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.tab-btn:hover::before {
    left: 100%;
}

.tab-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.tab-btn:hover:not(.active) {
    background: #e2e8f0;
    color: #475569;
    transform: translateY(-1px);
}

.tab-icon {
    font-size: 16px;
    z-index: 2;
    position: relative;
}

/* 数据源面板 */
.data-source-panel {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.data-source-panel.active {
    display: block;
}

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

/* 房间输入组 */
.room-input-group {
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.room-input-group .form-input {
    flex: 1;
    margin: 0;
}

.room-input-group .btn {
    min-width: auto;
    padding: 12px 20px;
    margin: 0;
    white-space: nowrap;
}

/* 房间玩家列表 */
.room-players {
    margin-top: 20px;
    padding: 20px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
        max-height: 0;
    }
    to {
        opacity: 1;
        transform: translateY(0);
        max-height: 500px;
    }
}

.room-player-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.room-player-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    padding: 16px;
    border-radius: 12px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    cursor: pointer;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.room-player-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.5s;
    z-index: 1;
}

.room-player-card:hover::before {
    left: 100%;
}

.room-player-card:hover {
    transform: translateY(-3px) scale(1.02);
    border-color: #667eea;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.2);
    background: linear-gradient(135deg, #f8fafc 0%, #e0ecff 100%);
}

.room-player-name {
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 8px;
    z-index: 2;
    position: relative;
}

.room-player-elo {
    font-size: 14px;
    color: #64748b;
    z-index: 2;
    position: relative;
}

.room-player-elo strong {
    color: #667eea;
    font-weight: 600;
}

/* 🎯 新增：三时期评分样式 */
.room-player-score {
    font-size: 14px;
    color: #64748b;
    margin-top: 4px;
    z-index: 2;
    position: relative;
}

.room-player-score strong {
    color: #10b981;
    font-weight: 600;
}

.room-player-periods {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    z-index: 2;
    position: relative;
}

.period-rating {
    font-size: 12px;
    padding: 4px 8px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
    min-width: 40px;
}

.period-rating.early {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    color: #92400e;
    border: 1px solid #fbbf24;
}

.period-rating.mid {
    background: linear-gradient(135deg, #dbeafe 0%, #93c5fd 100%);
    color: #1e40af;
    border: 1px solid #3b82f6;
}

.period-rating.late {
    background: linear-gradient(135deg, #f3e8ff 0%, #c4b5fd 100%);
    color: #6b21a8;
    border: 1px solid #8b5cf6;
}

.room-player-card.selected .room-player-score {
    color: rgba(255, 255, 255, 0.9);
}

.room-player-card.selected .room-player-score strong {
    color: white;
}

.room-player-card.selected .period-rating.early {
    background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
    color: white;
    border-color: #f59e0b;
}

.room-player-card.selected .period-rating.mid {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border-color: #2563eb;
}

.room-player-card.selected .period-rating.late {
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    color: white;
    border-color: #7c3aed;
}

.room-player-card.selected {
    border-color: #667eea;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.35);
    color: white;
}

.room-player-card.selected .room-player-name {
    color: white;
    font-weight: 700;
}

.room-player-card.selected .room-player-elo {
    color: rgba(255, 255, 255, 0.9);
}

.room-player-card.selected .room-player-elo strong {
    color: white;
}

.room-player-card.selected::after {
    content: '✓';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 22px;
    height: 22px;
    background: white;
    color: #667eea;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 3;
    animation: checkmark 0.3s ease-in-out;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

@keyframes checkmark {
    0% {
        transform: scale(0) rotate(0deg);
        opacity: 0;
    }
    50% {
        transform: scale(1.2) rotate(180deg);
        opacity: 1;
    }
    100% {
        transform: scale(1) rotate(360deg);
        opacity: 1;
    }
}

/* 状态消息 */
.room-status {
    padding: 12px 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.room-status.loading {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8);
    color: white;
    animation: pulse 2s infinite;
}

.room-status.success {
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
}

.room-status.error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    color: white;
}

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

/* 响应式设计 */
@media (max-width: 768px) {
    .player-checkboxes {
        grid-template-columns: 1fr;
        padding: 16px;
    }
    
    .teams-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .team-form {
        padding: 20px;
    }
    
    .team-results {
        padding: 20px;
    }
    
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 280px;
    }
    
    .data-source-tabs {
        flex-direction: column;
    }
    
    .room-input-group {
        flex-direction: column;
    }
    
    .room-player-list {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    .player-checkbox {
        padding: 12px;
    }
    
    .team-card {
        padding: 16px;
    }
    
    .team-header h4 {
        font-size: 16px;
    }
    
    .team-score {
        font-size: 14px;
        padding: 4px 8px;
    }
}

/* 统计样式 */
.stats-sections {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-section {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    padding: 20px;
    transition: transform 0.2s ease;
}

.stat-section:hover {
    transform: translateY(-2px);
}

.stat-section h5 {
    margin: 0 0 16px 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
}

.stat-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.stat-row:hover {
    background: #e9ecef;
}

.stat-name {
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.stat-value {
    font-size: 13px;
    color: #666;
    font-weight: 500;
}
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.stat-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.stat-card-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    font-size: 20px;
}

.stat-title {
    font-size: 16px;
    font-weight: 600;
}

.stat-card-body {
    padding: 20px;
}

.stat-item {
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.stat-item-name {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.stat-item-winrate {
    font-weight: bold;
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 6px;
    min-width: 50px;
    text-align: center;
}

.stat-item-winrate.win {
    background: #e8f5e8;
    color: #67c23a;
}

.stat-item-winrate.loss {
    background: #ffeaea;
    color: #f56c6c;
}

.stat-item-details {
    display: flex;
    gap: 12px;
    font-size: 12px;
    color: #666;
}

.stat-wins {
    color: #67c23a;
    font-weight: 500;
}

.stat-losses {
    color: #f56c6c;
    font-weight: 500;
}

.stat-total {
    color: #999;
}

/* 比赛列表样式 */
.match-list-section {
    margin-top: 30px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.match-list-section h4 {
    margin: 0;
    padding: 20px 24px 16px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
}

.match-list {
    max-height: 600px;
    overflow-y: auto;
}

.match-item {
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.match-item:hover {
    background-color: #f8f9fa;
}

.match-item.expanded {
    background-color: #f0f7ff;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
    min-height: 60px;
}

.match-basic {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    flex-wrap: wrap;
}

.match-result {
    font-size: 18px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
}

.match-result.win {
    color: #67c23a;
}

.match-result.loss {
    color: #f56c6c;
}

.match-room {
    color: #333;
    font-weight: 600;
    font-size: 14px;
    min-width: 120px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.match-map {
    color: #666;
    font-size: 13px;
    background: #e8f4fd;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #b3d8f2;
}

.match-mode {
    color: #666;
    font-size: 13px;
    background: #f0f9ff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

.match-players {
    color: #888;
    font-size: 12px;
    background: #f5f5f5;
    padding: 4px 6px;
    border-radius: 3px;
    min-width: 35px;
    text-align: center;
}

.match-date {
    color: #999;
    font-size: 12px;
    min-width: 120px;
    margin-left: auto;
}

.match-arrow {
    color: #999;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.match-item.expanded .match-arrow {
    transform: rotate(180deg);
}

.match-details {
    background: #fafbfc;
    border-top: 1px solid #e8eaed;
    padding: 20px 24px;
}

.players-list {
    margin-bottom: 20px;
}

.players-list h5 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 14px;
    font-weight: 600;
}

.player-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 6px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.player-item.winner {
    background: #f0f9ff;
    border-color: #67c23a;
}

.player-item.loser {
    background: #fefefe;
    border-color: #f56c6c;
}

.player-result {
    font-size: 16px;
    min-width: 25px;
    text-align: center;
}

.player-name {
    font-weight: 500;
    color: #333;
    min-width: 100px;
    flex: 1;
}

.player-civ {
    color: #666;
    font-size: 13px;
    background: #f8f9fa;
    padding: 4px 8px;
    border-radius: 4px;
    min-width: 80px;
    text-align: center;
}

.player-rating {
    color: #888;
    font-size: 12px;
    min-width: 70px;
    text-align: right;
}

.no-players {
    color: #999;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

.match-extra-info {
    border-top: 1px solid #e9ecef;
    padding-top: 16px;
    margin-top: 16px;
}

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

.info-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.info-label {
    color: #666;
    font-size: 13px;
    font-weight: 500;
    min-width: 80px;
}

.info-value {
    color: #333;
    font-size: 14px;
    font-weight: 500;
}

/* 消息提示 */
.message {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    background: white;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    max-width: 500px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    border-left: 4px solid #409eff;
}

.message.show {
    transform: translateX(0);
}

.message-success {
    border-left-color: #67c23a;
}

.message-error {
    border-left-color: #f56c6c;
}

.message-warning {
    border-left-color: #e6a23c;
}

.message-info {
    border-left-color: #409eff;
}

.message-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.message-text {
    color: #333;
    font-size: 14px;
    line-height: 1.4;
}

/* 确认对话框 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.confirm-overlay.show {
    opacity: 1;
}

.confirm-dialog {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    min-width: 400px;
    max-width: 600px;
    transform: scale(0.8);
    transition: transform 0.3s ease;
}

.confirm-overlay.show .confirm-dialog {
    transform: scale(1);
}

.confirm-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.confirm-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.confirm-body {
    padding: 20px 24px;
}

.confirm-content {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}

.confirm-footer {
    padding: 16px 24px 20px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* 全局加载 */
.global-loading {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.global-loading-content {
    text-align: center;
}

.global-loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #409eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

.global-loading-text {
    color: #666;
    font-size: 16px;
    font-weight: 500;
}

/* 错误页面 */
.error-page {
    text-align: center;
    padding: 80px 20px;
    color: #666;
}

.error-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.6;
}

.error-page h2 {
    font-size: 24px;
    margin-bottom: 16px;
    color: #333;
}

.error-page p {
    font-size: 16px;
    margin-bottom: 30px;
    line-height: 1.6;
}

/* 玩家复选框 */
.player-checkboxes {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e4e7ed;
    border-radius: 8px;
    padding: 16px;
    background: #fafafa;
}

.player-checkbox-item {
    margin-bottom: 12px;
}

.player-checkbox-item:last-child {
    margin-bottom: 0;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.checkbox-label:hover {
    background: #f0f9ff;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.checkbox-text {
    font-weight: 500;
    color: #333;
    flex: 1;
}

.player-score {
    font-size: 12px;
    color: #666;
    background: #f0f9ff;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #bae6fd;
}

/* 分析结果样式 */
.analysis-summary, .bond-summary, .team-summary {
    margin-top: 20px;
}

.player-info h3 {
    margin: 0 0 8px 0;
    color: #333;
    font-size: 20px;
}

.player-info p {
    margin: 0 0 16px 0;
    color: #666;
    font-size: 14px;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-item {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: bold;
    color: #409eff;
}

.matches-table h4 {
    margin: 0 0 16px 0;
    color: #333;
    font-size: 16px;
}

/* 羁绊分析样式 */
.bond-stats h4 {
    margin: 20px 0 12px 0;
    color: #333;
    font-size: 16px;
}

.teammates-list, .opponents-list {
    display: grid;
    gap: 8px;
    margin-bottom: 20px;
}

.teammate-item, .opponent-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.teammate-name, .opponent-name {
    font-weight: 500;
    color: #333;
}

.teammate-matches, .opponent-matches {
    font-size: 12px;
    color: #666;
}

.teammate-winrate, .opponent-winrate {
    font-size: 12px;
    font-weight: 500;
}

.teammate-winrate {
    color: #67c23a;
}

.opponent-winrate {
    color: #f56c6c;
}

/* 团队分组样式 */
.division-info {
    margin-bottom: 24px;
    padding: 16px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.division-info p {
    margin: 0 0 8px 0;
    font-size: 14px;
    color: #666;
}

.division-info p:last-child {
    margin-bottom: 0;
}

.teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 24px;
}

.team-card {
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    overflow: hidden;
}

.team-header {
    background: #409eff;
    color: white;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.team-header h4 {
    margin: 0;
    font-size: 16px;
}

.team-score {
    font-size: 12px;
    opacity: 0.9;
}

.team-members {
    padding: 16px;
}

.team-member {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
}

.team-member:last-child {
    border-bottom: none;
}

.member-name {
    font-weight: 500;
    color: #333;
}

.member-score {
    font-size: 12px;
    color: #666;
    background: #e3f2fd;
    padding: 4px 8px;
    border-radius: 4px;
}

.division-stats {
    background: #f8f9fa;
    padding: 16px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.division-stats h4 {
    margin: 0 0 12px 0;
    color: #333;
    font-size: 16px;
}

.stats-row {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.stats-row span {
    font-size: 14px;
    color: #666;
    background: white;
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #e9ecef;
}

/* 分页省略号 */
.pagination-ellipsis {
    padding: 8px 12px;
    color: #999;
    user-select: none;
}

.pagination-info {
    margin-left: 20px;
    font-size: 12px;
    color: #999;
}

/* 排名数字 */
.rank-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: #409eff;
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: bold;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .message {
        top: 10px;
        right: 10px;
        left: 10px;
        min-width: auto;
        max-width: none;
    }

    .confirm-dialog {
        min-width: 300px;
        margin: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .teams-grid {
        grid-template-columns: 1fr;
    }

    .stats-row {
        flex-direction: column;
        gap: 8px;
    }

    .teammate-item, .opponent-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* 羁绊分析结果样式 */
.bond-summary {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-top: 20px;
}

.players-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 30px;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 15px;
}

.player-card {
    text-align: center;
    padding: 20px;
    background: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    min-width: 150px;
}

.player-card h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1.3em;
}

.player-card p {
    margin: 0;
    color: #667eea;
    font-weight: 600;
    font-size: 1.1em;
}

.vs-divider {
    font-size: 2em;
    font-weight: bold;
    color: #dc3545;
    text-shadow: 0 2px 4px rgba(220, 53, 69, 0.3);
}

.analysis-period {
    background: #f8f9fa;
    padding: 15px 20px;
    border-radius: 10px;
    margin: 20px;
    border-left: 4px solid #667eea;
}

.analysis-period p {
    margin: 5px 0;
    color: #555;
    font-size: 0.95em;
}

.bond-stats {
    padding: 0 20px 20px;
}

.stats-section {
    margin-bottom: 25px;
}

.stats-section h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5e9;
}

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

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 3px solid #667eea;
}

.stat-label {
    font-weight: 600;
    color: #555;
}

.stat-value {
    font-weight: 700;
    font-size: 1.1em;
}

.stat-value.win {
    color: #28a745;
}

.stat-value.lose {
    color: #dc3545;
}

.recent-matches {
    padding: 0 20px 20px;
}

.recent-matches h4 {
    margin: 0 0 15px 0;
    color: #333;
    font-size: 1.2em;
    padding-bottom: 8px;
    border-bottom: 2px solid #e1e5e9;
}

.matches-list {
    max-height: 300px;
    overflow-y: auto;
}

.match-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
    transition: all 0.3s ease;
}

.match-item.teammate {
    border-left-color: #28a745;
}

.match-item.opponent {
    border-left-color: #dc3545;
}

.match-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.match-info {
    display: flex;
    gap: 15px;
    font-size: 0.9em;
    color: #666;
}

.match-result {
    display: flex;
    gap: 10px;
    align-items: center;
}

.relationship-tag {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.relationship-tag.teammate {
    background: #d4edda;
    color: #155724;
}

.relationship-tag.opponent {
    background: #f8d7da;
    color: #721c24;
}

.result-tag {
    padding: 4px 8px;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

.result-tag.win {
    background: #d4edda;
    color: #155724;
}

.result-tag.lose {
    background: #f8d7da;
    color: #721c24;
}

@media (max-width: 768px) {
    .players-info {
        flex-direction: column;
        gap: 20px;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .match-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .match-info {
        flex-direction: column;
        gap: 5px;
    }
}

/* =====================================================
   多方案分组选择器样式
   ===================================================== */

/* 多方案选择器样式 */
.schemes-overview {
    margin-bottom: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: 12px;
    border: 1px solid #dee2e6;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.overview-info p {
    margin: 0;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
}

.scheme-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 15px;
}

.scheme-selector label {
    font-weight: 600;
    color: #495057;
    white-space: nowrap;
    font-size: 14px;
}

.scheme-selector select {
    flex: 1;
    padding: 10px 12px;
    border: 2px solid #ced4da;
    border-radius: 8px;
    background: white;
    font-size: 14px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.scheme-selector select:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

/* 方案详情样式 */
.scheme-detail {
    background: white;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    border: 1px solid #e9ecef;
}

.scheme-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 2px solid #e9ecef;
}

.scheme-rating {
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
}

/* 无方案提示样式 */
.no-schemes {
    text-align: center;
    padding: 40px;
    color: #6c757d;
    font-style: italic;
    background: #f8f9fa;
    border-radius: 8px;
    border: 2px dashed #dee2e6;
}
