/* 玩家资料模态框样式 */

.player-profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    align-items: center;
    justify-content: center;
}

.player-profile-modal.active {
    display: flex;
    animation: fadeIn 0.3s ease-out;
}

.player-profile-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    cursor: pointer;
    animation: fadeIn 0.3s ease-out;
    backdrop-filter: blur(2px);
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.player-profile-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), 0 0 1px rgba(0, 212, 255, 0.3);
    border: 1px solid rgba(0, 212, 255, 0.2);
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.player-profile-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.player-profile-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.player-profile-close {
    background: none;
    border: none;
    font-size: 28px;
    color: #fff;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.player-profile-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.player-profile-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* 加载状态 */
.player-profile-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
    animation: fadeIn 0.3s ease-out;
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #00d4ff;
    border-right-color: rgba(0, 212, 255, 0.5);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 0 20px rgba(0, 212, 255, 0.3);
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.player-profile-loading p {
    color: #aaa;
    margin: 0;
    font-size: 14px;
    letter-spacing: 0.5px;
}

/* 错误状态 */
.player-profile-error {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    gap: 16px;
    text-align: center;
    animation: fadeIn 0.3s ease-out;
}

.error-message {
    color: #ff6b6b;
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    max-width: 300px;
}

.retry-btn {
    background-color: #00d4ff;
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.3);
}

.retry-btn:hover {
    background-color: #00b8d4;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 212, 255, 0.4);
}

.retry-btn:active {
    transform: translateY(0);
}

/* 玩家信息 */
.player-profile-info {
    animation: fadeIn 0.3s ease-out;
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 壁纸背景覆盖层 */
.player-profile-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1;
    pointer-events: none;
}

.player-header {
    display: flex;
    gap: 16px;
    padding: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    align-items: flex-start;
    position: relative;
    z-index: 2;
    flex-shrink: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
}

.player-avatar {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    object-fit: cover;
    background-color: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(0, 212, 255, 0.3);
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
    transition: all 0.2s ease;
}

.player-avatar:hover {
    border-color: rgba(0, 212, 255, 0.6);
    box-shadow: 0 6px 16px rgba(0, 212, 255, 0.3);
}

.player-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.player-nickname {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    word-break: break-word;
}

.player-id {
    margin: 8px 0 0 0;
    font-size: 13px;
    color: #00d4ff;
    font-family: 'Courier New', monospace;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-shadow: 0 0 8px rgba(0, 212, 255, 0.4);
    background: linear-gradient(90deg, rgba(0, 212, 255, 0.1), transparent);
    padding: 4px 8px;
    border-radius: 4px;
    border-left: 2px solid rgba(0, 212, 255, 0.5);
}

/* 角色列表 */
.player-characters {
    position: relative;
    z-index: 2;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
    padding: 16px;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.7));
    overflow: hidden;
}

.player-characters h4 {
    margin: 0 0 12px 0;
    font-size: 14px;
    font-weight: 600;
    color: #00d4ff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.characters-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
    overflow-y: auto;
    padding-right: 4px;
}

.character-item {
    background-color: rgba(0, 212, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 6px;
    padding: 12px;
    transition: all 0.2s ease;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    gap: 12px;
    align-items: center;
}

.character-item:hover {
    background-color: rgba(0, 212, 255, 0.2);
    border-color: rgba(0, 212, 255, 0.6);
    transform: translateX(4px);
    box-shadow: 0 4px 12px rgba(0, 212, 255, 0.2);
}

.character-item:active {
    transform: translateX(2px);
}

.item-icon {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    background-size: cover;
    background-position: center;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(0, 212, 255, 0.3);
    flex-shrink: 0;
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

.character-name,
.item-name {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    word-break: break-word;
}

.item-category {
    color: #00d4ff;
    font-size: 12px;
    opacity: 0.8;
}

.item-meta {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.item-days {
    color: #ffa500;
    font-size: 12px;
    font-weight: 600;
}

.item-quantity {
    color: #00d4ff;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0, 212, 255, 0.2);
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid rgba(0, 212, 255, 0.4);
}

.empty-message {
    text-align: center;
    color: #aaa;
    font-size: 14px;
    padding: 20px;
    margin: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .player-profile-content {
        width: 95%;
        max-height: 85vh;
        border-radius: 16px;
    }

    .player-profile-header {
        padding: 16px;
    }

    .player-profile-body {
        padding: 16px;
    }

    .player-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .player-avatar {
        width: 100px;
        height: 100px;
    }

    .player-nickname {
        font-size: 16px;
    }

    .characters-list {
        max-height: 250px;
    }
}

@media (max-width: 480px) {
    .player-profile-content {
        width: 98%;
        max-height: 90vh;
        border-radius: 12px;
    }

    .player-profile-header {
        padding: 12px;
    }

    .player-profile-body {
        padding: 12px;
    }

    .player-profile-title {
        font-size: 18px;
    }

    .player-avatar {
        width: 80px;
        height: 80px;
    }

    .player-nickname {
        font-size: 14px;
    }

    .player-id {
        font-size: 11px;
    }

    .characters-list {
        max-height: 200px;
        gap: 6px;
    }

    .character-item {
        padding: 10px;
    }

    .character-name {
        font-size: 13px;
    }
}

/* 滚动条样式 */
.player-profile-body::-webkit-scrollbar {
    width: 8px;
}

.player-profile-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
}

.player-profile-body::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 4px;
    transition: background 0.2s ease;
}

.player-profile-body::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.6);
}

.characters-list::-webkit-scrollbar {
    width: 6px;
}

.characters-list::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 3px;
}

.characters-list::-webkit-scrollbar-thumb {
    background: rgba(0, 212, 255, 0.3);
    border-radius: 3px;
}

.characters-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 212, 255, 0.5);
}


/* 焦点状态和无障碍支持 */
.player-profile-close:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.retry-btn:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

.character-item:focus {
    outline: 2px solid #00d4ff;
    outline-offset: 2px;
}

/* 禁用状态 */
.retry-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

/* 打印样式 */
@media print {
    .player-profile-modal {
        display: none !important;
    }
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
    .player-profile-content {
        background: linear-gradient(135deg, #0f0f1e 0%, #1a1a2e 100%);
    }
}

/* 减少动画支持 */
@media (prefers-reduced-motion: reduce) {
    .player-profile-modal.active,
    .player-profile-backdrop,
    .player-profile-content,
    .player-profile-loading,
    .player-profile-error,
    .player-profile-info {
        animation: none !important;
    }

    .character-item,
    .retry-btn,
    .player-profile-close {
        transition: none !important;
    }
}
