/* ==========================================================================
   快乐农场 - 侧边背包栏 (inventory.css)
   ========================================================================== */

/* ==========================================================================
   1. 侧边栏主体布局 (Sidebar Container)
   ========================================================================== */

.side-inventory {
    position: fixed;
    /* 悬浮避让设定 */
    top: 100px;       /* 顶部下移，完全避开顶部导航栏 (导航栏约占90px) */
    bottom: 0;        /* 底部留空，形成悬浮面板效果 */
    height: auto;     /* 取消固定高度，由 top 和 bottom 决定 */
    
    width: var(--inv-width);
    right: calc(var(--inv-width) * -1); /* 默认隐藏在右侧外 */
    
    /* 玻璃拟态背景 */
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    
    /* 边框和圆角：左上和左下都设置圆角 */
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-right: none; /* 贴右边不需要边框 */
    border-radius: 24px 0 0 24px; 
    
    box-shadow: -5px 10px 30px rgba(0, 0, 0, 0.08);
    z-index: 900;
    
    /* 核心动画属性：平滑滑入滑出 */
    transition: right 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
}

/* 激活状态：滑入屏幕 */
.side-inventory.active {
    right: 0;
    box-shadow: -15px 15px 40px rgba(0, 0, 0, 0.15);
}

/* 内容区域 */
.inventory-content {
    width: 100%;
    height: 100%;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    /* 保持圆角不被内容溢出切断 */
    border-radius: 24px 0 0 24px; 
}

/* ==========================================================================
   2. 开关按钮 (Toggle Button)
   ========================================================================== */

/* 圆形开关按钮 */
.inventory-toggle-btn {
    position: absolute;
    left: -65px; 
    
    /* 按钮位置 */
    top: 80%;
    transform: translateY(-50%);
    
    width: 50px;
    height: 50px;
    border-radius: 50%;
    
    background: #007bff;
    color: white;
    border: 3px solid white;
    box-shadow: -2px 2px 10px rgba(0, 0, 0, 0.15);
    
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 901;
}

.inventory-toggle-btn .icon {
    font-size: 1.4em;
    margin-top: 3px; /* 微调 emoji 居中 */
}

.inventory-toggle-btn .label { display: none; }

/* 悬停效果 */
.inventory-toggle-btn:hover {
    background-color: #0056b3;
    transform: translateY(-50%) scale(1.1);
}

/* 激活状态：变为红色关闭按钮 */
.side-inventory.active .inventory-toggle-btn {
    background-color: #dc3545;
}

/* ==========================================================================
   3. 滚动区域与分区区块 (Scroll Area & Warehouse Sections)
   ========================================================================== */

/* 滚动区域 */
#inventory-scroll-area {
    padding: 10px 15px;
    flex: 1;
    overflow-y: auto;
    /* 底部留白可以稍微减小，因为现在面板本身就有 bottom 距离 */
    padding-bottom: 20px; 
}

/* 滚动条美化 */
#inventory-scroll-area::-webkit-scrollbar { width: 4px; }
#inventory-scroll-area::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

/* 仓库分类区块 (从原杂项提取) */
.warehouse-section {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
    min-width: 0;
    margin-bottom: 15px; /* 增加区块间距 */
}

.warehouse-section.section-items {
    grid-column: 1 / -1; /* 如果在网格中，跨越所有列 */
}

/* 区块标题 */
.warehouse-section h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 0.9em;
    color: #555;
    border-left: 4px solid #007bff;
    padding-left: 10px;
}

/* 标题样式 (胶囊状 - 补充重置) */
.inventory-content h3 {
    font-size: 0.85em;
    margin: 15px 15px 8px 15px; /* 增加左右边距 */
    color: #495057;
    background: rgba(0, 0, 0, 0.05);
    padding: 6px 12px;
    border-radius: 50px;
    text-align: center;
    font-weight: 700;
}
.inventory-content .warehouse-section:first-child h3 { margin-top: 15px; }

/* ==========================================================================
   4. 背包内部卡片微调 (Inventory Item Adjustments)
   ========================================================================== */

/* 背包内卡片样式 (保持之前的修复，防止布局崩坏) */
.inventory-content .shop-item {
    width: 100%;
    margin-bottom: 8px;
    padding: 10px;
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.03);
    display: block; 
}

/* 强制重置第一项 (图标容器) */
.inventory-content .shop-item > div:first-child {
    width: 100% !important;
    height: auto !important;
    background: transparent !important;
    border-radius: 0 !important;
    font-size: 1em !important; 
    margin: 0 !important;
    display: flex !important;
    align-items: center;
}

/* 图标微调 */
.inventory-content .shop-item span[style*="font-size:1.5em"] {
    font-size: 1.2em !important;
    background: #f8f9fa;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    margin-right: 10px;
    flex-shrink: 0;
}

/* 文字微调 */
.inventory-content .shop-item div[style*="font-weight:bold"] {
    font-size: 0.9em !important;
    color: #333;
    font-weight: 600 !important;
}

.inventory-content .shop-item div[style*="color:#666"] {
    font-size: 0.75em !important;
    color: #888 !important;
    margin-top: 2px;
}

/* 按钮区域 */
.inventory-content .shop-item > div:last-child {
    margin-top: 8px !important;
    position: static !important;
}

.inventory-content .shop-item button {
    width: 100%;
    padding: 5px 0;
    font-size: 0.8em;
    border-radius: 6px;
    background-color: #ffc107;
    color: #333;
    font-weight: bold;
    box-shadow: none;
}
.inventory-content .shop-item button:hover {
    background-color: #e0a800;
}