/* 背包模态框样式 */
.inventory-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.inventory-modal.show {
    opacity: 1;
}

.inventory-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('/images/quanjing.jpeg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    background-repeat: no-repeat;
    animation: overlayPulse 6s ease-in-out infinite;
}

.inventory-modal-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: 
        radial-gradient(ellipse at 20% 50%, rgba(139, 0, 0, 0.15) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 50%, rgba(139, 0, 0, 0.1) 0%, transparent 50%),
        rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    pointer-events: none;
}

@keyframes overlayPulse {
    0%, 100% {
        filter: brightness(0.9) contrast(1);
    }
    50% {
        filter: brightness(0.85) contrast(1.05);
    }
}

.inventory-modal-content {
    position: relative;
    background: linear-gradient(135deg, rgba(20, 0, 0, 0.95), rgba(40, 0, 0, 0.95));
    border: 2px solid rgba(139, 0, 0, 0.6);
    border-radius: 15px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 0 50px rgba(139, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.inventory-modal.show .inventory-modal-content {
    transform: scale(1);
}

/* 模态框头部 */
.inventory-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 2px solid rgba(139, 0, 0, 0.3);
    background: rgba(0, 0, 0, 0.3);
}

.inventory-modal-header h2 {
    margin: 0;
    color: #ff6b6b;
    font-size: 24px;
    text-shadow: 0 0 10px rgba(255, 107, 107, 0.5);
}

.inventory-close-btn {
    background: none;
    border: none;
    color: #ff6b6b;
    font-size: 32px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.inventory-close-btn:hover {
    background: rgba(139, 0, 0, 0.3);
    transform: rotate(90deg);
}

/* 分类标签 */
.inventory-categories {
    display: flex;
    gap: 10px;
    padding: 20px 30px;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
}

.inventory-category-btn {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.5);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.inventory-category-btn:hover {
    background: rgba(139, 0, 0, 0.2);
    border-color: #8b0000;
}

.inventory-category-btn.active {
    background: rgba(139, 0, 0, 0.4);
    border-color: #8b0000;
    color: #ff6b6b;
    box-shadow: 0 0 15px rgba(139, 0, 0, 0.5);
}

/* 商品列表 */
.inventory-products {
    padding: 20px 30px;
    max-height: calc(80vh - 200px);
    overflow-y: auto;
}

.inventory-products::-webkit-scrollbar {
    width: 8px;
}

.inventory-products::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
}

.inventory-products::-webkit-scrollbar-thumb {
    background: rgba(139, 0, 0, 0.5);
    border-radius: 4px;
}

.inventory-products::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 0, 0, 0.7);
}

/* 商品卡片 */
.inventory-product-card {
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(139, 0, 0, 0.5);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding-top: 35px;
}

.inventory-product-card:hover {
    border-color: #8b0000;
    background: rgba(139, 0, 0, 0.2);
    transform: translateX(5px);
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.3);
}

.inventory-product-icon {
    font-size: 48px;
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 0, 0, 0.2);
    border-radius: 10px;
}

.inventory-product-quantity {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(139, 0, 0, 0.8);
    color: #ff6b6b;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    min-width: 30px;
    text-align: center;
    border: 1px solid rgba(255, 107, 107, 0.5);
}

.inventory-product-rarity {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
}

.inventory-product-rarity.common {
    background: rgba(128, 128, 128, 0.3);
    color: #aaa;
}

.inventory-product-rarity.rare {
    background: rgba(0, 112, 221, 0.3);
    color: #4da6ff;
}

.inventory-product-rarity.epic {
    background: rgba(163, 53, 238, 0.3);
    color: #c084fc;
}

.inventory-product-rarity.legendary {
    background: rgba(255, 128, 0, 0.3);
    color: #ffa500;
}

.inventory-product-info {
    flex: 1;
}

.inventory-product-info h3 {
    margin: 0 0 5px 0;
    color: var(--text-primary);
    font-size: 18px;
}

.inventory-product-category {
    margin: 0 0 5px 0;
    color: var(--text-secondary);
    font-size: 13px;
}

.inventory-product-price {
    margin: 0;
    color: #ff6b6b;
    font-size: 14px;
    font-weight: bold;
}

/* 空背包 */
.inventory-empty {
    text-align: center;
    padding: 60px 20px;
}

.inventory-empty-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.inventory-empty-text {
    color: var(--text-secondary);
    font-size: 20px;
    margin: 0 0 10px 0;
}

.inventory-empty-hint {
    color: var(--text-secondary);
    font-size: 14px;
    margin: 0;
    opacity: 0.7;
}

/* 商品详情 */
.inventory-product-detail {
    padding: 20px;
}

.inventory-detail-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(139, 0, 0, 0.3);
}

.inventory-back-btn {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid rgba(139, 0, 0, 0.5);
    color: #ff6b6b;
    padding: 8px 15px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.inventory-back-btn:hover {
    background: rgba(139, 0, 0, 0.3);
    border-color: #8b0000;
}

.inventory-detail-header h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 22px;
}

.inventory-detail-content {
    display: flex;
    gap: 30px;
}

.inventory-detail-icon {
    font-size: 100px;
    width: 150px;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(139, 0, 0, 0.2);
    border-radius: 15px;
    border: 2px solid rgba(139, 0, 0, 0.5);
}

.inventory-detail-info {
    flex: 1;
}

.inventory-detail-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid rgba(139, 0, 0, 0.2);
}

.inventory-detail-label {
    color: var(--text-secondary);
    font-weight: bold;
}

/* 详情页面中的稀有度 */
.inventory-detail-rarity {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    display: inline-block;
}

.inventory-detail-rarity.common {
    background: rgba(128, 128, 128, 0.3);
    color: #aaa;
}

.inventory-detail-rarity.rare {
    background: rgba(0, 112, 221, 0.3);
    color: #4da6ff;
}

.inventory-detail-rarity.epic {
    background: rgba(163, 53, 238, 0.3);
    color: #c084fc;
}

.inventory-detail-rarity.legendary {
    background: rgba(255, 128, 0, 0.3);
    color: #ffa500;
}

.inventory-detail-stats {
    margin-top: 20px;
    padding: 15px;
    background: rgba(139, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(139, 0, 0, 0.3);
}

.inventory-detail-stats h4 {
    margin: 0 0 15px 0;
    color: var(--text-primary);
}

.inventory-stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.inventory-stat-item {
    text-align: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 6px;
}

.inventory-stat-label {
    display: block;
    color: var(--text-secondary);
    font-size: 12px;
    margin-bottom: 5px;
}

.inventory-stat-value {
    display: block;
    color: #ff6b6b;
    font-size: 24px;
    font-weight: bold;
}

.inventory-detail-description {
    margin-top: 20px;
}

.inventory-detail-description h4 {
    margin: 0 0 10px 0;
    color: var(--text-primary);
}

.inventory-detail-description p {
    margin: 0;
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
    word-wrap: break-word;
    word-break: break-word;
}

/* 描述和媒体URL容器 */
.inventory-detail-description-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

/* 媒体预览部分 */
.inventory-detail-media {
    padding: 15px;
    background: rgba(20, 20, 40, 0.8);
    border-radius: 8px;
    border: 1px solid rgba(139, 0, 0, 0.5);
}

.inventory-detail-media h4 {
    margin: 0 0 15px 0;
    color: #88ccff;
    font-size: 14px;
    font-weight: bold;
}

.inventory-media-previews {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.inventory-media-preview-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inventory-media-preview-container {
    width: 100%;
    height: 120px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 6px;
    border: 1px solid rgba(136, 204, 255, 0.3);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.inventory-media-preview {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.inventory-media-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.inventory-media-label {
    color: #88ccff;
    font-weight: bold;
    font-size: 12px;
}

.inventory-copy-btn {
    background: rgba(139, 0, 0, 0.2);
    border: 1px solid rgba(139, 0, 0, 0.5);
    color: #ff6b6b;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.inventory-copy-btn:hover {
    background: rgba(139, 0, 0, 0.3);
    border-color: #8b0000;
    transform: scale(1.1);
}

.inventory-copy-btn:active {
    transform: scale(0.95);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .inventory-modal-content {
        width: 95%;
        max-height: 90vh;
    }

    .inventory-modal-header {
        padding: 15px 20px;
    }

    .inventory-modal-header h2 {
        font-size: 20px;
    }

    .inventory-categories {
        padding: 15px 20px;
        flex-wrap: wrap;
    }

    .inventory-category-btn {
        padding: 8px 15px;
        font-size: 13px;
    }

    .inventory-products {
        padding: 15px 20px;
    }

    .inventory-product-card {
        flex-direction: column;
        text-align: center;
    }

    .inventory-product-icon {
        width: 80px;
        height: 80px;
        font-size: 60px;
    }

    .inventory-detail-content {
        flex-direction: column;
    }

    .inventory-detail-icon {
        width: 100%;
        height: 120px;
    }

    .inventory-stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .inventory-detail-description-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .inventory-media-url {
        font-size: 10px;
    }
}


/* 装备按钮样式 */
.inventory-detail-actions {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid rgba(139, 0, 0, 0.3);
    display: flex;
    gap: 12px;
    justify-content: center;
}

.inventory-equip-btn,
.inventory-unequip-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.inventory-equip-btn {
    background: linear-gradient(135deg, #4da6ff 0%, #0070dd 100%);
    color: white;
}

.inventory-equip-btn:hover {
    background: linear-gradient(135deg, #66b3ff 0%, #1a7fe6 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(77, 166, 255, 0.4);
}

.inventory-equip-btn:active {
    transform: translateY(0);
}

.inventory-unequip-btn {
    background: linear-gradient(135deg, #ff6b6b 0%, #d32f2f 100%);
    color: white;
}

.inventory-unequip-btn:hover {
    background: linear-gradient(135deg, #ff8080 0%, #e53935 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 107, 107, 0.4);
}

.inventory-unequip-btn:active {
    transform: translateY(0);
}

/* 响应式设计 */
@media (max-width: 768px) {
    .inventory-detail-actions {
        flex-direction: column;
    }
    
    .inventory-equip-btn,
    .inventory-unequip-btn {
        width: 100%;
    }
}
