/**
 * trade.css - 交易行统一样式
 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Microsoft YaHei', sans-serif; background: #1a1a2e; color: #e0d5c1; height: 100vh; overflow: hidden; display: flex; flex-direction: column; }

/* 顶部导航 */
.top-nav { display: flex; justify-content: space-between; align-items: center; padding: 14px 24px; background: linear-gradient(180deg, #2a2a3e 0%, #1a1a2e 100%); border-bottom: 1px solid #3a3a5e; }
.top-nav .nav-left { display: flex; gap: 10px; align-items: center; }
.top-nav .nav-right { display: flex; gap: 12px; align-items: center; }
.top-nav .nav-item { padding: 8px 20px; border-radius: 4px; cursor: pointer; font-size: 15px; color: #b0a890; transition: all 0.3s; border: 1px solid transparent; }
.top-nav .nav-item:hover { color: #e0d5c1; }
.top-nav .nav-item.active { background: linear-gradient(180deg, #c8a84e, #a08030); color: #fff; border-color: #d4b85e; }
.top-nav .nav-btn { padding: 8px 16px; border-radius: 4px; cursor: pointer; font-size: 13px; border: 1px solid #4a4a6e; background: transparent; color: #b0a890; transition: all 0.3s; }
.top-nav .nav-btn:hover { border-color: #c8a84e; color: #e0d5c1; }
.top-nav .username { color: #c8a84e; font-size: 15px; font-weight: bold; }

/* 筛选栏 */
.filter-bar { display: flex; align-items: center; padding: 10px 24px; background: #1e1e32; gap: 12px; flex-wrap: wrap; }
.category-btn { padding: 7px 18px; border-radius: 3px; cursor: pointer; font-size: 14px; color: #b0a890; border: 1px solid #4a4a6e; background: transparent; transition: all 0.3s; }
.category-btn:hover { border-color: #c8a84e; color: #e0d5c1; }
.category-btn.active { background: #c8a84e; color: #fff; border-color: #c8a84e; }
.filter-bar select, .filter-bar input[type="text"] { padding: 7px 12px; border-radius: 3px; border: 1px solid #4a4a6e; background: #2a2a3e; color: #e0d5c1; font-size: 14px; }
.filter-bar input[type="text"] { width: 160px; }
.filter-bar .search-btn { padding: 7px 14px; background: #c8a84e; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 14px; }

/* 主容器 */
.main-container { display: flex; flex: 1; overflow: hidden; }

/* 侧边栏 */
.sidebar { width: 160px; background: #1e1e32; border-right: 1px solid #3a3a5e; padding: 12px 0; flex-shrink: 0; }
.sidebar .sidebar-title { padding: 12px 18px; font-size: 16px; font-weight: bold; color: #e0d5c1; }
.sidebar .sidebar-item { padding: 14px 18px; cursor: pointer; font-size: 14px; color: #b0a890; transition: all 0.3s; border-left: 3px solid transparent; }
.sidebar .sidebar-item:hover { background: #2a2a4e; color: #e0d5c1; }
.sidebar .sidebar-item.active { background: #2a2a4e; color: #c8a84e; border-left-color: #c8a84e; }

/* 内容区 */
.content-area { flex: 1; padding: 14px 20px; overflow: hidden; display: flex; flex-direction: column; }
.module-tabs { display: flex; gap: 0; margin-bottom: 12px; border-bottom: 2px solid #3a3a5e; flex-shrink: 0; }
.module-tabs .tab { padding: 12px 30px; cursor: pointer; font-size: 15px; color: #b0a890; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.3s; }
.module-tabs .tab:hover { color: #e0d5c1; }
.module-tabs .tab.active { color: #c8a84e; border-bottom-color: #c8a84e; }
.table-scroll-wrap { flex: 1; overflow-y: auto; min-height: 0; }

/* 数据表格 */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { padding: 16px 12px; text-align: center; font-size: 14px; color: #b0a890; background: #1e1e32; border-bottom: 1px solid #3a3a5e; vertical-align: middle; }
.data-table td { padding: 6px 12px; text-align: center; font-size: 14px; border-bottom: 1px solid #2a2a4e; vertical-align: middle; }
.data-table tr { min-height: 64px; }
.data-table tr:hover td { background: #2a2a4e; }
.data-table tr.selected td { background: #3a2020; }
.data-table .item-cell { display: flex; align-items: center; gap: 10px; justify-content: center; }
.data-table .player-name { color: #6ab0ff; cursor: pointer; }
.data-table .price { color: #c8a84e; }
.data-table .time { color: #90c860; }
.item-icon-img { width: 48px; height: 48px; object-fit: contain; vertical-align: middle; }

/* 分页 */
.pagination { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 10px 0; flex-shrink: 0; }
.pagination button { padding: 7px 14px; background: #2a2a3e; color: #e0d5c1; border: 1px solid #4a4a6e; border-radius: 3px; cursor: pointer; font-size: 13px; }
.pagination button:hover { border-color: #c8a84e; }
.pagination button:disabled { opacity: 0.4; cursor: default; }
.pagination .page-info { font-size: 14px; color: #b0a890; }

/* 底部栏 */
.bottom-bar { display: flex; justify-content: center; gap: 18px; padding: 14px 24px; background: #1e1e32; border-top: 1px solid #3a3a5e; }
.bottom-bar .action-btn { padding: 10px 28px; border-radius: 4px; cursor: pointer; font-size: 15px; border: none; transition: all 0.3s; }
.btn-primary { background: linear-gradient(180deg, #c8a84e, #a08030); color: #fff; }
.btn-primary:hover { background: linear-gradient(180deg, #d4b85e, #b09040); }
.btn-secondary { background: linear-gradient(180deg, #4a6a8e, #3a5a7e); color: #fff; }
.btn-secondary:hover { background: linear-gradient(180deg, #5a7a9e, #4a6a8e); }
.btn-danger { background: linear-gradient(180deg, #c84e4e, #a03030); color: #fff; }
.btn-danger:hover { background: linear-gradient(180deg, #d45e5e, #b04040); }

/* 模块切换 */
.module-section { display: none; height: 100%; }
.module-section.active { display: flex; flex-direction: column; }

/* 交易布局 */
.trade-layout { display: flex; gap: 0; height: 100%; border: 1px solid #3a3a5e; border-radius: 6px; overflow: hidden; }
.trade-submenu { width: 170px; background: #1a2040; border-right: 1px solid #3a3a5e; flex-shrink: 0; }
.trade-submenu .sub-item { padding: 16px 18px; cursor: pointer; font-size: 15px; color: #b0a890; transition: all 0.3s; border-left: 3px solid transparent; }
.trade-submenu .sub-item:hover { background: #2a2a5e; color: #e0d5c1; }
.trade-submenu .sub-item.active { background: #2a2a5e; color: #6ab0ff; border-left-color: #6ab0ff; }

/* 交易表单面板 */
.trade-form-panel { width: 280px; background: #1e2540; border-right: 1px solid #3a3a5e; padding: 20px; flex-shrink: 0; display: flex; flex-direction: column; }
.trade-form-panel .drop-zone { width: 100px; height: 100px; border: 2px dashed #4a5a8e; border-radius: 8px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-size: 36px; color: #6ab0ff; cursor: pointer; background: #1a2040; transition: all 0.3s; }
.trade-form-panel .drop-zone:hover { border-color: #c8a84e; }
.trade-form-panel .drop-zone.has-item { border-style: solid; border-color: #c8a84e; }
.trade-form-panel .drop-label { text-align: center; font-size: 12px; color: #b0a890; margin-bottom: 20px; }
.trade-form-panel .form-line { display: flex; align-items: center; margin-bottom: 12px; font-size: 13px; }
.trade-form-panel .form-line .fl-label { width: 120px; color: #b0a890; flex-shrink: 0; }
.trade-form-panel .form-line .fl-input { flex: 1; padding: 5px 8px; border-radius: 3px; border: 1px solid #4a5a8e; background: #2a2a4e; color: #e0d5c1; font-size: 13px; width: 80px; }
.trade-form-panel .form-line .fl-input[readonly] { background: #1a1a3e; }
.trade-form-panel .form-line .fl-unit { margin-left: 6px; color: #b0a890; font-size: 12px; }
.trade-form-panel .form-warn { font-size: 12px; color: #e06060; margin-top: 3px; }
.trade-form-panel .form-hr { border: none; border-top: 1px solid #3a3a5e; margin: 12px 0; }
.trade-form-panel .submit-btn { margin-top: auto; padding: 10px 30px; background: linear-gradient(180deg, #c8a84e, #a08030); color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 15px; align-self: center; transition: all 0.3s; }
.trade-form-panel .submit-btn:hover { background: linear-gradient(180deg, #d4b85e, #b09040); }

/* 网格面板 */
.trade-grid-panel { flex: 1; background: #1a2040; padding: 10px; overflow: hidden; display: flex; flex-direction: column; }
.trade-grid-panel .grid-header { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 8px; align-items: center; }
.trade-grid-panel .grid-header select { padding: 4px 8px; border-radius: 3px; border: 1px solid #4a5a8e; background: #2a2a4e; color: #e0d5c1; font-size: 12px; }
.trade-grid-panel .grid-header input { padding: 4px 8px; border-radius: 3px; border: 1px solid #4a5a8e; background: #2a2a4e; color: #e0d5c1; font-size: 12px; width: 120px; }
.trade-grid-panel .grid-header .grid-search-btn { padding: 4px 10px; background: #4a5a8e; color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 12px; }

.right-content-view { display: none; }
.right-content-view.active { display: flex; flex-direction: column; flex: 1; overflow: hidden; }
.right-content-view .list-table-wrap { padding: 5px; overflow-y: auto; flex: 1; }
.right-content-view .list-table-wrap .data-table { font-size: 13px; }
.right-content-view .list-table-wrap .data-table th { padding: 12px 8px; font-size: 13px; }
.right-content-view .list-table-wrap .data-table td { padding: 12px 8px; font-size: 13px; }

/* 背包格子 */
.bp-grid { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; overflow-y: auto; flex: 1; align-content: start; }
.bp-grid .bp-item { aspect-ratio: 1; border: 1px solid #3a4a6e; border-radius: 4px; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; background: #1e2540; transition: all 0.2s; position: relative; }
.bp-grid .bp-item:hover { border-color: #c8a84e; transform: scale(1.05); }
.bp-grid .bp-item.selected { border-color: #c8a84e; border-width: 2px; box-shadow: 0 0 8px rgba(200,168,78,0.4); }
.bp-grid .bp-item .bp-icon { font-size: 26px; line-height: 1; }
.bp-grid .bp-item .bp-icon-img { width: 90%; height: 90%; object-fit: contain; }
.bp-grid .bp-item .bp-qty { position: absolute; bottom: 1px; right: 3px; font-size: 10px; color: #c8a84e; font-weight: bold; }

/* Toast */
.trade-toast { position: fixed; top: 20px; left: 50%; transform: translateX(-50%); padding: 12px 30px; background: #2a6a3e; color: #fff; border-radius: 4px; font-size: 14px; z-index: 9999; opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.trade-toast.show { opacity: 1; }
.trade-toast.error { background: #8a2a2a; }

.empty-state { text-align: center; padding: 20px; color: #6a6a8e; font-size: 14px; }

/* ==================== 登录/注册页 ==================== */
.auth-page { display: flex; align-items: center; justify-content: center; height: 100vh; background: #1a1a2e; }
.auth-box { background: #1e1e32; border: 2px solid #c8a84e; border-radius: 12px; padding: 40px; width: 400px; max-width: 90%; }
.auth-box h2 { text-align: center; color: #c8a84e; margin-bottom: 30px; font-size: 22px; }
.auth-box .form-group { margin-bottom: 16px; }
.auth-box .form-group label { display: block; margin-bottom: 6px; font-size: 13px; color: #b0a890; }
.auth-box .form-group input, .auth-box .form-group select { width: 100%; padding: 10px 14px; border-radius: 6px; border: 1px solid #4a4a6e; background: #2a2a3e; color: #e0d5c1; font-size: 14px; }
.auth-box .auth-error { color: #e06060; font-size: 13px; margin-bottom: 12px; min-height: 20px; }
.auth-box .auth-submit { width: 100%; padding: 12px; background: linear-gradient(180deg, #c8a84e, #a08030); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 16px; font-weight: bold; transition: all 0.3s; }
.auth-box .auth-submit:hover { background: linear-gradient(180deg, #d4b85e, #b09040); }
.auth-box .auth-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.auth-box .auth-switch { text-align: center; margin-top: 16px; }
.auth-box .auth-switch a { color: #6ab0ff; cursor: pointer; font-size: 13px; text-decoration: underline; }
.auth-box .auth-back { text-align: center; margin-top: 10px; }
.auth-box .auth-back a { color: #b0a890; cursor: pointer; font-size: 12px; }

/* ==================== 个人信息页 ==================== */
.profile-page { padding: 20px; max-width: 700px; margin: 0 auto; overflow-y: auto; height: 100vh; }
.profile-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 12px; border-bottom: 1px solid #3a3a5e; }
.profile-header h2 { color: #c8a84e; font-size: 20px; }
.profile-header .header-btns { display: flex; gap: 10px; }
.profile-section { margin-bottom: 24px; }
.profile-section-title { color: #c8a84e; font-size: 15px; font-weight: bold; margin-bottom: 12px; padding-bottom: 6px; border-bottom: 1px solid #2a2a4e; }
.profile-form-group { margin-bottom: 14px; }
.profile-form-group label { display: block; margin-bottom: 5px; font-size: 13px; color: #b0a890; }
.profile-form-group input, .profile-form-group select, .profile-form-group textarea { width: 100%; padding: 8px 12px; border-radius: 4px; border: 1px solid #4a4a6e; background: #2a2a3e; color: #e0d5c1; font-size: 13px; }
.profile-form-group textarea { resize: vertical; min-height: 60px; }
.profile-form-group .readonly { background: #1a1a2e; color: #888; cursor: not-allowed; }
.profile-form-group .hint { font-size: 11px; color: #888; margin-top: 3px; }
.img-upload-area { border: 2px dashed #4a5a8e; border-radius: 8px; padding: 20px; text-align: center; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.img-upload-area .preview-img { max-width: 100%; max-height: 200px; border-radius: 4px; }
.img-upload-area .btn-upload-img { padding: 10px 20px; background: #2a2a4e; color: #b0a890; border: 1px solid #4a5a8e; border-radius: 4px; cursor: pointer; font-size: 13px; }
.img-upload-area .btn-upload-img:hover { border-color: #c8a84e; color: #e0d5c1; }
.img-upload-area .btn-change-img { position: absolute; bottom: 8px; right: 8px; padding: 4px 12px; background: rgba(0,0,0,0.7); color: #fff; border: none; border-radius: 3px; cursor: pointer; font-size: 11px; }
.profile-save-btn { padding: 10px 40px; background: linear-gradient(180deg, #c8a84e, #a08030); color: #fff; border: none; border-radius: 6px; cursor: pointer; font-size: 15px; }
.profile-save-btn:hover { background: linear-gradient(180deg, #d4b85e, #b09040); }

/* ==================== 管理员面板 ==================== */
.admin-panel { padding: 16px; overflow-y: auto; height: 100vh; }
.admin-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.admin-header h2 { color: #c8a84e; font-size: 18px; }
.admin-tabs { display: flex; gap: 0; margin-bottom: 16px; border-bottom: 2px solid #3a3a5e; }
.admin-tab-btn { padding: 10px 24px; cursor: pointer; font-size: 14px; color: #b0a890; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.3s; }
.admin-tab-btn:hover { color: #e0d5c1; }
.admin-tab-btn.active { color: #c8a84e; border-bottom-color: #c8a84e; }
.admin-search-bar { display: flex; gap: 8px; margin-bottom: 12px; align-items: center; }
.admin-search-bar input { padding: 6px 12px; border-radius: 4px; border: 1px solid #4a4a6e; background: #2a2a3e; color: #e0d5c1; font-size: 13px; width: 200px; }
.admin-search-bar button { padding: 6px 14px; background: #c8a84e; color: #fff; border: none; border-radius: 4px; cursor: pointer; font-size: 13px; }
.admin-btn { padding: 4px 10px; border-radius: 3px; cursor: pointer; font-size: 11px; border: 1px solid #4a4a6e; background: #2a2a4e; color: #e0d5c1; transition: all 0.2s; }
.admin-btn:hover { border-color: #c8a84e; }
.admin-btn.btn-red { background: #8a2a2a; border-color: #a03030; color: #fff; }
.admin-btn.btn-red:hover { background: #a03030; }
.admin-btn.btn-orange { background: #8a5a2a; border-color: #a07030; color: #fff; }
.admin-btn.btn-orange:hover { background: #a07030; }
.admin-btn.btn-green { background: #2a6a3e; border-color: #3a8a4e; color: #fff; }
.admin-btn.btn-green:hover { background: #3a8a4e; }

/* 管理员弹窗 */
.admin-modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; justify-content: center; align-items: center; }
.admin-modal-overlay.show { display: flex; }
.admin-modal { background: #1e1e32; border: 2px solid #c8a84e; border-radius: 8px; width: 90%; max-width: 500px; max-height: 80vh; overflow-y: auto; padding: 24px; position: relative; }
.admin-modal .modal-close { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #b0a890; background: none; border: none; }
.admin-modal h3 { color: #c8a84e; margin-bottom: 16px; text-align: center; }
.admin-player-info .info-row { margin-bottom: 10px; font-size: 13px; }
.admin-player-info .info-label { color: #b0a890; }
.admin-player-info .info-actions { margin-top: 16px; text-align: center; }
.admin-preview-img { max-width: 100%; max-height: 150px; border-radius: 4px; border: 1px solid #4a4a6e; display: block; margin-top: 4px; }

/* ==================== 玩家信息弹窗（原型风格） ==================== */
.modal-overlay { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); z-index: 1000; justify-content: center; align-items: center; }
.modal-overlay.show { display: flex; }
.modal { background: #1e1e32; border: 2px solid #c8a84e; border-radius: 8px; width: 90%; max-width: 700px; max-height: 85vh; overflow-y: auto; padding: 25px; position: relative; }
.modal-close { position: absolute; top: 10px; right: 15px; font-size: 24px; cursor: pointer; color: #b0a890; background: none; border: none; }
.modal-close:hover { color: #fff; }
.modal h2 { text-align: center; color: #c8a84e; margin-bottom: 20px; font-size: 18px; }
.player-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.player-info-grid .info-item { padding: 10px; background: #2a2a3e; border-radius: 4px; }
.player-info-grid .info-label { font-size: 12px; color: #b0a890; margin-bottom: 5px; }
.player-info-grid .info-value { font-size: 14px; color: #e0d5c1; }
.player-info-grid .screenshot { width: 100%; max-height: 200px; object-fit: contain; border-radius: 4px; border: 1px solid #4a4a6e; margin-top: 5px; }
