/* 游戏化功能样式 */

/* 积分通知 */
.points-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    border-radius: 10px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10000;
    min-width: 200px;
}

.points-notification.positive {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.points-notification.negative {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.points-notification.show {
    transform: translateX(0);
    opacity: 1;
}

.points-amount {
    font-size: 24px;
    font-weight: bold;
    text-align: center;
}

.points-reason {
    font-size: 14px;
    text-align: center;
    margin-top: 5px;
    opacity: 0.9;
}

/* 成就提示 */
.achievement-toast {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 10001;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
    min-width: 350px;
}

.achievement-toast.show {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.achievement-toast.common {
    border-left: 5px solid #28a745;
}

.achievement-toast.rare {
    border-left: 5px solid #007bff;
}

.achievement-toast.epic {
    border-left: 5px solid #6f42c1;
}

.achievement-toast.legendary {
    border-left: 5px solid #fd7e14;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.achievement-toast-content {
    display: flex;
    align-items: center;
    padding: 20px;
}

.achievement-icon {
    font-size: 48px;
    margin-right: 20px;
}

.achievement-info {
    flex: 1;
}

.achievement-title {
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.achievement-name {
    font-size: 16px;
    font-weight: 600;
    color: #555;
    margin-bottom: 5px;
}

.achievement-desc {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.achievement-points {
    font-size: 14px;
    color: #28a745;
    font-weight: bold;
}

/* 积分面板 */
.points-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.points-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.points-header h3 {
    margin: 0;
    color: #333;
    font-size: 24px;
}

.current-points {
    display: flex;
    align-items: center;
    gap: 10px;
}

.points-label {
    font-size: 16px;
    color: #666;
}

.points-value {
    font-size: 28px;
    font-weight: bold;
    color: #4facfe;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 32px;
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.stat-label {
    font-size: 14px;
    color: #666;
    margin-top: 2px;
}

.points-history h4 {
    color: #333;
    margin-bottom: 15px;
}

.points-rules {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.rule-icon {
    font-size: 20px;
}

.rule-text {
    color: #555;
    font-size: 14px;
}

/* 成就面板 */
.achievement-panel {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.achievement-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.achievement-header h3 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 24px;
}

.achievement-stats {
    display: flex;
    gap: 20px;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.stat-label {
    font-size: 14px;
    color: #666;
}

.stat-value {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.achievement-progress {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
}

.progress-bar {
    flex: 1;
    height: 10px;
    background: #e9ecef;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%);
    transition: width 0.3s ease;
}

.progress-text {
    font-weight: bold;
    color: #333;
}

.achievement-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 15px;
}

.achievement-card {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.achievement-card.unlocked {
    background: white;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
}

.achievement-card.locked {
    opacity: 0.6;
}

.achievement-card.common.unlocked {
    border-left: 4px solid #28a745;
}

.achievement-card.rare.unlocked {
    border-left: 4px solid #007bff;
}

.achievement-card.epic.unlocked {
    border-left: 4px solid #6f42c1;
}

.achievement-card.legendary.unlocked {
    border-left: 4px solid #fd7e14;
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
}

.achievement-icon {
    font-size: 40px;
    transition: filter 0.3s ease;
}

.achievement-icon.grayscale {
    filter: grayscale(100%);
}

.achievement-content {
    flex: 1;
}

.achievement-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
}

.achievement-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.achievement-points {
    font-size: 12px;
    color: #28a745;
    font-weight: bold;
}

.achievement-date {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.achievement-rarity {
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
}

.achievement-rarity.common {
    border-width: 0 25px 25px 0;
    border-color: transparent #28a745 transparent transparent;
}

.achievement-rarity.rare {
    border-width: 0 25px 25px 0;
    border-color: transparent #007bff transparent transparent;
}

.achievement-rarity.epic {
    border-width: 0 25px 25px 0;
    border-color: transparent #6f42c1 transparent transparent;
}

.achievement-rarity.legendary {
    border-width: 0 25px 25px 0;
    border-color: transparent #fd7e14 transparent transparent;
}

/* 竞技场样式 */
.arena-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
}

.arena-modal-content {
    background: white;
    border-radius: 15px;
    padding: 30px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.matchmaking-container {
    text-align: center;
    padding: 40px 20px;
}

.matchmaking-container h2 {
    color: #333;
    margin-bottom: 30px;
}

.matchmaking-spinner {
    margin: 30px 0;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4facfe;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.matchmaking-info p {
    color: #666;
    margin: 10px 0;
}

.cancel-btn {
    background: #dc3545;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    margin-top: 20px;
    transition: background 0.3s ease;
}

.cancel-btn:hover {
    background: #c82333;
}

/* 比赛界面 */
.match-content {
    max-width: 1000px;
}

.match-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.match-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
}

.match-progress {
    font-size: 18px;
    color: #666;
}

.match-players {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.player {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.player-avatar {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border-radius: 50%;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}

.player-info {
    text-align: center;
}

.player-name {
    font-size: 16px;
    font-weight: bold;
    color: #333;
}

.player-rank {
    font-size: 14px;
    color: #666;
    margin: 2px 0;
}

.player-rating {
    font-size: 12px;
    color: #999;
}

.player-score {
    font-size: 32px;
    font-weight: bold;
    color: #4facfe;
    background: white;
    padding: 10px 20px;
    border-radius: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.vs-indicator {
    font-size: 24px;
    font-weight: bold;
    color: #666;
    margin: 0 20px;
}

.match-question-area {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 3px 15px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.question-timer {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.timer-circle {
    width: 80px;
    height: 80px;
    border: 4px solid #e9ecef;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    color: #333;
    transition: all 0.3s ease;
}

.timer-circle.warning {
    border-color: #dc3545;
    color: #dc3545;
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.1); }
    100% { transform: scale(1); }
}

.match-question {
    text-align: center;
}

.question-difficulty {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: bold;
    margin-bottom: 20px;
}

.question-difficulty.简单 {
    background: #d4edda;
    color: #155724;
}

.question-difficulty.中等 {
    background: #fff3cd;
    color: #856404;
}

.question-difficulty.困难 {
    background: #f8d7da;
    color: #721c24;
}

.question-text {
    font-size: 20px;
    color: #333;
    margin-bottom: 30px;
    line-height: 1.5;
}

.question-options {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-width: 600px;
    margin: 0 auto;
}

.match-option {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 16px;
}

.match-option:hover {
    background: #e9ecef;
    border-color: #4facfe;
}

.match-option:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.option-letter {
    width: 30px;
    height: 30px;
    background: #4facfe;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
}

.option-text {
    flex: 1;
    text-align: left;
}

.judge-option .option-icon {
    font-size: 24px;
    color: #4facfe;
}

.fill-input-container {
    display: flex;
    gap: 10px;
    align-items: center;
}

.fill-input-container input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 16px;
}

.fill-input-container button {
    background: #4facfe;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
}

.match-status {
    text-align: center;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 16px;
}

.match-status .correct {
    color: #28a745;
    font-weight: bold;
}

.match-status .incorrect {
    color: #dc3545;
    font-weight: bold;
}

/* 比赛结果 */
.match-result {
    text-align: center;
    padding: 20px;
}

.result-header {
    margin-bottom: 30px;
}

.result-header.victory h2 {
    color: #28a745;
}

.result-header.defeat h2 {
    color: #dc3545;
}

.final-score {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    margin: 15px 0;
}

.result-details {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
}

.detail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
}

.detail-item .label {
    font-size: 14px;
    color: #666;
}

.detail-item .value {
    font-size: 18px;
    font-weight: bold;
    color: #333;
}

.result-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.primary-btn, .secondary-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.primary-btn {
    background: #4facfe;
    color: white;
}

.primary-btn:hover {
    background: #3d8bfe;
}

.secondary-btn {
    background: #6c757d;
    color: white;
}

.secondary-btn:hover {
    background: #5a6268;
}

/* 排行榜样式 */
.leaderboard-container {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.leaderboard-header h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 28px;
    text-align: center;
}

.leaderboard-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background: #f8f9fa;
    border: 2px solid transparent;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.tab-btn.active {
    background: #4facfe;
    color: white;
    border-color: #4facfe;
}

.tab-btn:hover:not(.active) {
    background: #e9ecef;
    border-color: #4facfe;
}

.leaderboard-content {
    margin-bottom: 25px;
}

.leaderboard-header-row {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    gap: 15px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    font-weight: bold;
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

.leaderboard-item {
    display: grid;
    grid-template-columns: 80px 1fr 120px 120px;
    gap: 15px;
    padding: 15px 20px;
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    margin-bottom: 8px;
    align-items: center;
    transition: all 0.3s ease;
}

.leaderboard-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.leaderboard-item.current-user {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.leaderboard-item.rank-first {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border-color: #ffc107;
}

.leaderboard-item.rank-second {
    background: linear-gradient(135deg, #e2e3e5 0%, #d6d8db 100%);
    border-color: #6c757d;
}

.leaderboard-item.rank-third {
    background: linear-gradient(135deg, #f8d7da 0%, #f5c6cb 100%);
    border-color: #dc3545;
}

.leaderboard-item.rank-top10 {
    background: linear-gradient(135deg, #d1ecf1 0%, #bee5eb 100%);
    border-color: #17a2b8;
}

.item-rank {
    font-size: 18px;
    font-weight: bold;
    text-align: center;
    color: #333;
}

.item-user {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar {
    font-size: 24px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 50%;
}

.user-info {
    flex: 1;
}

.username {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 2px;
}

.user-rank {
    font-size: 12px;
    color: #666;
}

.item-score {
    font-size: 16px;
    font-weight: bold;
    color: #4facfe;
    text-align: center;
}

.item-extra {
    font-size: 14px;
    color: #666;
    text-align: center;
}

.empty-leaderboard {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-leaderboard .empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-leaderboard .empty-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.empty-leaderboard .empty-desc {
    font-size: 16px;
    color: #666;
    margin-bottom: 24px;
}

.empty-leaderboard .empty-tips {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-top: 20px;
    text-align: left;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.empty-leaderboard .empty-tips p {
    margin: 0 0 12px 0;
    font-weight: bold;
    color: #2c3e50;
}

.empty-leaderboard .empty-tips ul {
    margin: 0;
    padding-left: 20px;
}

.empty-leaderboard .empty-tips li {
    margin-bottom: 8px;
    color: #555;
}

.user-position {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
}

.user-position-content {
    color: #666;
}

.position-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.position-info {
    display: flex;
    justify-content: center;
    gap: 20px;
    align-items: center;
}

.position-rank {
    font-size: 24px;
    font-weight: bold;
    color: #4facfe;
}

.position-score {
    font-size: 16px;
    color: #666;
}

/* 竞技场页面 */
.arena-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.arena-header {
    text-align: center;
    margin-bottom: 40px;
}

.arena-header h1 {
    color: #333;
    margin-bottom: 10px;
}

.arena-header p {
    color: #666;
    font-size: 16px;
}

.arena-content {
    display: grid;
    gap: 30px;
}

.arena-stats-section,
.arena-actions-section,
.arena-history-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.arena-stats-section h2,
.arena-actions-section h2,
.arena-history-section h2 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 22px;
}

.action-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.arena-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 30px 40px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.arena-btn.primary {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
}

.arena-btn.primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(79, 172, 254, 0.3);
}

.arena-btn.secondary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.arena-btn.secondary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
}

.btn-icon {
    font-size: 32px;
}

.btn-text {
    font-size: 18px;
    font-weight: bold;
}

.btn-desc {
    font-size: 14px;
    opacity: 0.9;
}

.match-history {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.match-history-item {
    display: grid;
    grid-template-columns: 120px 1fr 100px;
    gap: 20px;
    padding: 15px 20px;
    background: #f8f9fa;
    border-radius: 10px;
    align-items: center;
    transition: all 0.3s ease;
}

.match-history-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.match-history-item.victory {
    border-left: 4px solid #28a745;
}

.match-history-item.defeat {
    border-left: 4px solid #dc3545;
}

.match-history-item.draw {
    border-left: 4px solid #ffc107;
}

.match-result {
    display: flex;
    align-items: center;
    gap: 10px;
}

.result-icon {
    font-size: 24px;
}

.result-text {
    font-weight: bold;
    color: #333;
}

.match-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.opponent-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.opponent-avatar {
    font-size: 20px;
}

.opponent-name {
    font-weight: 600;
    color: #333;
}

.opponent-rank {
    font-size: 12px;
    color: #666;
    background: #e9ecef;
    padding: 2px 6px;
    border-radius: 10px;
}

.match-score {
    font-size: 16px;
    font-weight: bold;
    color: #4facfe;
}

.match-meta {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: right;
}

.match-date,
.match-duration,
.match-performance {
    font-size: 12px;
    color: #666;
}

.no-history,
.no-stats {
    text-align: center;
    padding: 40px;
    color: #666;
    font-size: 16px;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .achievement-grid {
        grid-template-columns: 1fr;
    }
    
    .leaderboard-header-row,
    .leaderboard-item {
        grid-template-columns: 60px 1fr 80px 80px;
        gap: 10px;
        padding: 12px 15px;
    }
    
    .match-players {
        flex-direction: column;
        gap: 20px;
    }
    
    .vs-indicator {
        transform: rotate(90deg);
    }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .arena-btn {
        min-width: 250px;
    }
    
    .match-history-item {
        grid-template-columns: 1fr;
        gap: 10px;
        text-align: center;
    }
    
    .result-details {
        flex-direction: column;
        gap: 15px;
    }
} 