/* ==================== P2P交易系统（易宝）- 样式表 ==================== */

/* --- 交易窗口 --- */
.trade-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 600;
    display: flex; justify-content: center; align-items: center;
}
.trade-window {
    width: 95%; max-width: 900px; height: 80vh; max-height: 600px;
    background: #0a1f33; border: 2px solid #444;
    box-shadow: 0 0 50px rgba(0,0,0,0.8); display: flex; flex-direction: column;
    border-radius: 4px; overflow: hidden;
}
.trade-header {
    height: 42px; background: linear-gradient(to bottom, #1a4261, #0a1f33);
    display: flex; justify-content: space-between; align-items: center;
    padding: 0 16px; color: #ffcc66; font-weight: bold; letter-spacing: 2px;
    border-bottom: 1px solid #333; flex-shrink: 0;
}
.trade-close { cursor: pointer; font-size: 22px; opacity: 0.7; }
.trade-close:hover { opacity: 1; color: #fff; }

/* 内容区 */
.trade-body {
    flex: 1; display: flex; overflow: hidden;
}
.trade-left {
    flex: 1.2; border-right: 2px solid #8b6d45; display: flex; flex-direction: column;
}
.trade-right {
    flex: 1; display: flex; flex-direction: column; background: #e6ce9e;
    box-shadow: inset 0 0 30px #d4b47c;
}

/* 区域标题 */
.trade-section-title {
    background: rgba(0,0,0,0.15); padding: 8px 15px; font-weight: bold;
    color: #ffcc66; border-bottom: 1px solid rgba(255,204,102,0.2);
    font-size: 13px; display: flex; justify-content: space-between; align-items: center;
    flex-shrink: 0;
}
.trade-section-title .trade-lock-tag {
    font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: normal;
}
.trade-lock-tag.unlocked { background: rgba(255,255,255,0.1); color: #aaa; }
.trade-lock-tag.locked { background: #2e7d32; color: #fff; }

/* 出价区 & 对方出价区 */
.trade-offer-area {
    flex: 1; padding: 12px; overflow-y: auto;
}
.trade-opponent-area {
    flex: 1; padding: 12px; border-top: 2px solid #8b6d45;
    background: rgba(255,255,255,0.05); overflow-y: auto;
}

/* 背包区（右侧） */
.trade-inventory-area {
    flex: 1; padding: 12px; overflow-y: auto;
}
.trade-inventory-area.disabled { pointer-events: none; opacity: 0.5; filter: grayscale(0.8); }

/* 灵石格子 */
.trade-slot-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.trade-slot {
    width: 100%; aspect-ratio: 1; background: rgba(0,0,0,0.1);
    border: 1.5px solid #8b6d45; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; position: relative; transition: 0.2s;
    flex-direction: column;
}
.trade-slot:hover { border-color: #ffcc66; transform: scale(1.05); }
.trade-slot img { width: 36px; height: 36px; object-fit: contain; }
.trade-slot-lv {
    font-size: 10px; font-weight: bold; color: #c00; margin-top: 2px;
}
.trade-slot-qty {
    position: absolute; top: 2px; right: 4px; font-size: 10px;
    background: rgba(10,31,51,0.8); color: #fff; padding: 0 5px;
    border-radius: 8px;
}

/* 点券输入区 */
.trade-coupons-row {
    display: flex; align-items: center; gap: 8px; margin-top: 10px;
    padding: 8px 12px; background: rgba(0,0,0,0.05); border-radius: 6px;
}
.trade-coupons-input {
    width: 120px; padding: 6px 10px; border: 1px solid #8b6d45;
    border-radius: 4px; background: rgba(255,255,255,0.5);
    text-align: center; font-size: 13px; color: #3d2a1a;
}
.trade-coupons-label { font-size: 12px; color: #666; }

/* 底部控制栏 */
.trade-footer {
    height: 60px; display: flex; justify-content: center; align-items: center;
    gap: 30px; background: rgba(0,0,0,0.3); flex-shrink: 0;
}
.trade-btn {
    padding: 8px 30px; background: #8d4513; color: #fff; border: 1px solid #5a4033;
    cursor: pointer; border-radius: 4px; font-size: 14px; font-weight: bold;
    transition: 0.2s;
}
.trade-btn:hover { background: #ff6600; box-shadow: 0 0 8px rgba(255,102,0,0.4); }
.trade-btn.lock-btn { background: #1565c0; }
.trade-btn.lock-btn:hover { background: #1976d2; }
.trade-btn.lock-btn.is-locked { background: #c00; }
.trade-btn.confirm-btn { background: #2e7d32; }
.trade-btn.confirm-btn:hover { background: #43a047; }
.trade-btn.cancel-btn { background: #555; }
.trade-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ==================== 二次确认弹窗 ==================== */
.trade-confirm-overlay {
    position: fixed; inset: 0; background: rgba(0,0,0,0.85); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
}
.trade-confirm-modal {
    width: 90%; max-width: 500px; background: #e6ce9e; border: 3px solid #ffcc66;
    padding: 30px; border-radius: 15px; box-shadow: 0 0 100px rgba(255,204,102,0.3);
    text-align: center; color: #3d2a1a;
}
.trade-confirm-title { font-size: 20px; font-weight: bold; color: #c00000; margin-bottom: 8px; }
.trade-confirm-hint { font-size: 13px; color: #666; margin-bottom: 16px; }

.trade-confirm-list {
    display: flex; margin: 16px 0; padding: 12px; background: rgba(0,0,0,0.05);
    border-radius: 8px;
}
.trade-confirm-half {
    flex: 1; text-align: center; padding: 8px;
}
.trade-confirm-half:first-child { border-right: 1px solid #8b6d45; }
.trade-confirm-half-title { font-size: 13px; margin-bottom: 8px; font-weight: bold; }
.trade-confirm-half-title.lose { color: #c00; }
.trade-confirm-half-title.gain { color: #2e7d32; }
.trade-confirm-item { font-size: 14px; margin: 4px 0; color: #3d2a1a; font-weight: bold; }

.trade-confirm-check {
    margin: 12px 0; font-size: 13px; color: #666;
}
.trade-confirm-btn {
    width: 100%; padding: 14px; background: #2e7d32; color: #fff; border: none;
    border-radius: 8px; font-size: 18px; font-weight: bold; cursor: pointer;
    transition: 0.2s;
}
.trade-confirm-btn:hover { background: #43a047; }
.trade-confirm-btn:disabled { background: #999; cursor: not-allowed; }
.trade-confirm-cancel {
    cursor: pointer; color: #666; font-size: 12px; margin-top: 10px;
    display: inline-block;
}
.trade-confirm-cancel:hover { color: #333; }
