body,
html {
    margin: 0;
    padding: 0;
    background-color: #1a1a1a;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: white;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

/* 隐藏滚动条 */
body::-webkit-scrollbar,
html::-webkit-scrollbar,
.object-box::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.object-box {
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}
.constainer{
    width: 100%;
    display: flex;
}


/* 控制栏布局 */
.control-bar {
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: #171a1c;
    border: 1px solid rgb(50, 52, 54);
    padding: 10px;
    margin: 15px 0;
    width: 100%;
    box-sizing: border-box;
}

.gain-box {
    width: 100%;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 0 0 10px 0;
    padding: 5px;
}

.gain-box p {
    margin: 0;
    text-align: center;
    font-size: 14px;
    font-weight: 500;
    color: #fff;
}

#total-value-span {
    color: #ffffff;
    font-weight: bold;
    margin-left: 5px;
    font-size: 16px;
}

.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    width: 100%;
}

#search-btn {
    width: 120px;
    height: 40px;
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 400;
    background: transparent;
    text-align: center;
    cursor: pointer;
    background-color: #38be75;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    flex-shrink: 0;
}

#refresh-btn {
    width: 120px;
    height: 40px;
    color: white;
    border: none;
    font-size: 16px;
    font-weight: 400;
    background: transparent;
    text-align: center;
    cursor: pointer;
    background-color: #ff4848;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
    flex-shrink: 0;
}

#search-btn:hover {
    background-color: #348d5c;
    box-shadow: 0 2px 5px rgba(36, 167, 255, 0.3);
}

#refresh-btn:hover {
    background-color: #aa3e3e;
    box-shadow: 0 2px 5px rgba(255, 72, 72, 0.3);
}

#search-btn:active, #refresh-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}


#itembox{
    display: flex;
    position: relative;
}
.bagbox {
    width: 120px;
    height: 120px;
    background-color: #171a1c;
    border: 1px solid rgb(50, 52, 54);
    margin-bottom: 10px;
    margin-right: 5px;

}
.object-box {
    width: 100%;
    max-width: 458px;
    height: 100vh;
    background-color: #080c0e;
    box-sizing: border-box;
    padding: 15px;
    margin: auto;
    overflow-y: auto;
}

/* 响应式设计：在小屏幕上隐藏bagbox并调整布局 */
@media (max-width: 468px) {
    .bagbox {
        display: none;
    }
    
    /* 调整itembox布局，让item-grid-container靠在最左边 */
    #itembox {
        justify-content: flex-start;
    }
    
    /* 确保item-grid-container靠在最左边 */
    #item-grid-container {
        margin: 0;
    }
    
    /* 调整控制栏和爆率设置的边距 */
    .control-bar, .drop-rate-container {
        margin: 10px 0;
    }
}

/* 自定义爆率设置样式 */
.drop-rate-container {
    background-color: #171a1c;
    border: 1px solid rgb(50, 52, 54);
    margin: 15px 0;
    overflow: hidden;
}

.drop-rate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    cursor: pointer;
    user-select: none;
}

.drop-rate-container h3 {
    margin: 0;
    font-size: 16px;
    color: #ffffff;
}

.toggle-btn {
    width: 25px;
    height: 25px;
    background: none;
    border: none;
    color: #ffffff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: transform 0.3s ease;
}

.toggle-btn.collapsed {
    transform: rotate(-90deg);
}

.drop-rate-controls {
    max-height: 500px;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 15px 15px 15px;
}

.drop-rate-controls.collapsed {
    max-height: 0;
    padding: 0 15px;
}

.drop-rate-controls {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.drop-rate-item {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.drop-rate-item label {
    width: 100px;
    text-align: right;
    font-weight: 500;
}

.drop-rate-item input[type="range"] {
    flex: 1;
    height: 5px;
    background: #333;
    outline: none;
    -webkit-appearance: none;
}

.drop-rate-item input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #24a7ff;
    cursor: pointer;
}

.drop-rate-item input[type="range"]::-moz-range-thumb {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #24a7ff;
    cursor: pointer;
    border: none;
}

.drop-rate-item span {
    width: 40px;
    text-align: center;
    font-weight: bold;
}

#reset-rates-btn {
    width: 120px;
    height: 40px;
    margin: 15px auto 10px auto;
    font-weight: 400;
    display: block;
    color: white;
    border: none;
    font-size: 14px;
    background-color: #3286f3;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.1s, box-shadow 0.3s;
}

#reset-rates-btn:hover {
    background-color: #416797;
    box-shadow: 0 2px 5px rgba(108, 117, 125, 0.3);
}

#reset-rates-btn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.total-rate {
    margin: 0;
    text-align: center;
    font-size: 12px;
    color: #888;
}


#objectname {
    color: beige;
    font-size: 15px;
    text-align: center;
    margin-bottom: 10px;
    border-left: 4px solid #e4212a;
    border-right: 4px solid #e4212a;
    height: 60px;
    background: repeating-linear-gradient(-45deg, #222, #222 10px, #333 10px, #333 15px);
    position: relative;
    display: flex;
    align-items: center;
}

#objectname::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, #5f2326 60%, #5f2326 100%);
    pointer-events: none;
}

#objectname p {
    margin: 0;
    padding: 15px;
    color: aliceblue;
    text-align: left;
    position: relative;
}



#item-grid-container {
    position: relative;
    display: grid;
    grid-template-columns: repeat(5, 60px);
    grid-template-rows: repeat(9, 60px);
    /* 添加整体边框，避免边缘线条过细 */
    border: 1px solid rgb(39, 44, 44);
    box-sizing: border-box;

}

.grid-cell {
    background-color: #171a1c;
    /* 只保留右侧和下侧边框，避免相邻叠加 */
    border-right: 1px solid rgb(39, 44, 44);
    border-bottom: 1px solid rgb(39, 44, 44);
    box-sizing: border-box;
}

.item-block {
    position: absolute;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #fff;
    background-size: cover;
    border: 1px solid rgb(50, 52, 54);
    box-sizing: border-box;
    background-position: center;
    background-repeat: no-repeat;
    transition: box-shadow 0.3s ease-in-out, transform 0.2s ease, border-color 0.3s;
    overflow: hidden;
}

.item-name-tag {
    position: absolute;
    top: 0;
    left: 0;
    max-width: 100%;
    padding: 2px 5px;
          color: rgb(255, 255, 255, 0.7);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 10px;
    font-weight: normal;
    text-shadow: 1px 1px 3px#202020;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    box-sizing: border-box;
    opacity: 0;
    transition: opacity 0.5s ease 0.2s;
}

.item-name-tag.visible {
    opacity: 1;
}

@keyframes search-orbit {
    from {
        transform: translate(-50%, -50%) rotate(0deg) translateX(5px) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg) translateX(5px) rotate(-360deg);
    }
}

.item-block.searching::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100px;
    height: 100px;
    background-image: url('../assets/images/search.png');
    background-repeat: no-repeat;
    animation: search-orbit 1.2s linear infinite;
}

@keyframes wave-effect {
    0% {
        transform: scale(0.8);
        opacity: 0.8;
    }

    100% {
        transform: scale(3);
        opacity: 0;
    }
}

.item-block::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    box-sizing: border-box;
    padding: 15px;
}

.rarity-yellow::before {
    animation: wave-effect 5s ease-out;
    box-shadow: 0 0 0 60px rgb(204, 186, 84);
}

.rarity-red::before {
    animation: wave-effect 4s ease-out;
    box-shadow: 0 0 0 100px #ff4848;
}