/* 全局重置和基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    display: flex;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    color: #e0e0e0;
    font-family: 'Orbitron', 'Microsoft YaHei', 'Segoe UI', system-ui, sans-serif;
    overflow: hidden;
}

/* 主题配色 */
:root {
    --army-green: #4d5d53;
    --camouflage: #6b8e23;
    --highlight: #cd853f;
    --dark-bg: #2c3539;
    --border-color: #5c6c73;
}

/* 导航栏 */
.nav-container {
    display: flex;
    flex-direction: column;
    width: 80px;
    padding: 15px;
    background: linear-gradient(to right, var(--army-green), #36454f);
    border-radius: 0 10px 10px 0;
    flex-shrink: 0;
    box-shadow: 2px 0 5px rgba(0,0,0,0.3);
}

/* 导航栏中的轮换阈值设置 */
.rotation-setting-nav {
    margin-top: auto;
    padding: 10px 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rotation-label {
    font-size: 12px;
    color: white;
    text-align: center;
}

.threshold-input-nav {
    width: 50px;
    padding: 4px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid var(--highlight);
    border-radius: 3px;
    text-align: center;
    font-size: 12px;
}

.apply-btn-nav {
    padding: 4px 8px;
    background-color: var(--camouflage);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
    font-size: 10px;
}

.tab-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.tab-button {
    background: var(--camouflage);
    border: 1px solid var(--highlight);
    color: white;
    padding: 12px 8px;
    border-radius: 5px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: center;
    font-size: 14px;
    width: 100%;
}

.tab-button:hover {
    background-color: #7fa537;
    transform: translateX(5px);
}

.tab-button.active {
    background-color: var(--highlight);
    border-color: #d2691e;
}

/* 主内容区域 */
.main-content {
    display: flex;
    flex: 1;
    overflow: hidden;
    gap: 20px;
    padding: 20px;
}

/* 左侧面板 - 物品选择区域 */
.left-panel {
    width: 60%;
    padding: 20px;
    background-color: rgba(44, 53, 57, 0.9);
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

/* 确保滚动条样式美观 */
.left-panel::-webkit-scrollbar {
    width: 8px;
}

.left-panel::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb {
    background: var(--highlight);
    border-radius: 4px;
}

.left-panel::-webkit-scrollbar-thumb:hover {
    background: #d2691e;
}

/* 物品卡片 */
.item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    background: rgba(77, 93, 83, 0.95);
    position: relative;
    overflow: hidden;
    width: 100%;
    height: auto;
    min-height: 180px;
    transition: all 0.3s ease;
}

/* 确保卡片在网格中不会堆叠 */
.item {
    grid-column: span 1;
    grid-row: span 1;
}

.item:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.3);
    border-color: var(--highlight);
}

/* 调整图片大小以适应卡片 */
.item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 10px;
    z-index: 1;
}

/* 物品标签 */
.item label {
    font-size: 16px;
    text-align: center;
    margin-bottom: 10px;
    z-index: 1;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 右侧轮转区域物品标签 */
.selected-item span {
    font-size: 20px;
    font-weight: bold;
}

/* 数量控制 */
.quantity-control {
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 10;
}

.quantity-btn {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    background-color: var(--highlight);
    color: white;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
}

.quantity-btn:hover {
    background-color: #d2691e;
    transform: scale(1.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-display {
    min-width: 30px;
    text-align: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    z-index: 20;
}

/* 右侧面板 */
.right-panel {
    width: 40%;
    padding: 10px;
    background-color: transparent;
    max-height: calc(100vh - 20px);
    overflow-y: auto;
}

/* 已选物品 */
.selected-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
    padding: 5px 0;
    background-color: transparent;
    border: none;
}

.selected-item img {
    width: 100px;
    height: 100px;
    object-fit: contain;
    margin-right: 15px;
}

.selected-item-info {
    flex: 1;
}

.selected-item.rotating img {
    animation: rotateItems 10s infinite linear;
}

/* 轮换阈值设置 */
.rotation-setting {
    margin-bottom: 20px;
    padding: 5px 0;
    background-color: transparent;
    display: flex;
    align-items: center;
    gap: 10px;
    border: none;
}

.threshold-input {
    width: 60px;
    padding: 5px;
    background-color: rgba(0, 0, 0, 0.5);
    color: white;
    border: 1px solid var(--highlight);
    border-radius: 3px;
}

.apply-btn {
    padding: 5px 15px;
    background-color: var(--camouflage);
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s;
}

/* 统计信息区域 */
.stats {
    background-color: transparent;
    margin-bottom: 10px;
}

/* 轮播容器和显示区域 */
.carousel-container,
.display-area {
    background-color: transparent;
}

.apply-btn:hover {
    background-color: #556b2f;
}

/* 物品品质颜色类 */
.red-text {
    color: #FF4500;
    font-weight: bold;
}

.blue-text {
    color: #1E90FF;
    font-weight: bold;
}

.purple-text {
    color: #9370DB;
    font-weight: bold;
}

.gold-text {
    color: #FFD700;
    font-weight: bold;
}

.default-text {
    color: #e0e0e0;
}

/* 醒目高亮文本 */
.highlight-text {
    color: #FFA500;
    font-weight: bold;
    font-size: 16px;
    text-shadow: 0 0 5px rgba(255, 165, 0, 0.5);
}

/* 统计信息区域 - 美美得吃 */
.stats .highlight-text {
    font-size: 24px;
    font-weight: 800;
    color: #FFD700;
    text-shadow: 0 0 10px rgba(255, 215, 0, 0.8), 0 0 20px rgba(255, 215, 0, 0.4);
    margin: 8px 0;
    letter-spacing: 1px;
    font-family: 'Orbitron', 'Microsoft YaHei', sans-serif;
}

/* 美美得吃标题特殊样式 */
.stats .highlight-text:first-child {
    font-size: 28px;
    color: #FFA500;
    text-shadow: 0 0 15px rgba(255, 165, 0, 0.9), 0 0 30px rgba(255, 165, 0, 0.5);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* 动画 */
@keyframes rotateItems {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0; transform: scale(0.8); }
}

@keyframes pulse {
    0% { opacity: 0.6; transform: scale(0.95); }
    50% { opacity: 1; transform: scale(1); }
    100% { opacity: 0.6; transform: scale(0.95); }
}

/* 加载动画 */
.item.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .left-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    body {
        flex-direction: column;
    }
    
    .nav-container {
        width: 100%;
        flex-direction: row;
        border-radius: 0;
        padding: 10px;
        overflow-x: auto;
    }
    
    .tab-container {
        flex-direction: row;
        width: 100%;
        justify-content: center;
    }
    
    .tab-button {
        min-width: 80px;
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .main-content {
        flex-direction: column;
    }
    
    .left-panel {
        width: 100%;
        max-height: 50vh;
        grid-template-columns: repeat(3, 1fr);
    }
    
    .right-panel {
        width: 100%;
        max-height: 40vh;
        margin-left: 0;
        border-left: none;
        border-top: 2px solid var(--border-color);
    }
}

@media (max-width: 480px) {
    .left-panel {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* 引入军事风格字体 */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;600&display=swap');

/* 加载指示器 */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.8);
    color: white;
    padding: 20px;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    z-index: 1000;
    border: 2px solid var(--highlight);
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top: 4px solid var(--highlight);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 错误显示 */
.error-display {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ff4444;
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.3);
    z-index: 1001;
    max-width: 300px;
    word-wrap: break-word;
}