/* ================================================================
   天下商盟 · 样式表（window.League）
   主题：古铜金 + 暗墨黑，呼应游戏仙侠 UI
   z-index 规划： league-panel 520 / 弹窗 9000 / 主界面邮件按钮 480
   ================================================================ */

/* ---------- 面板容器 ---------- */
#league-panel {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    z-index: 520; overflow-y: auto; padding: 12px;
    background:
        radial-gradient(120% 80% at 50% 0%, rgba(60,40,90,0.55), transparent 60%),
        linear-gradient(180deg, #14121f 0%, #0d0b16 100%);
    color: #e8e6f0;
    box-sizing: border-box;
}
#league-panel.hidden { display: none; }

/* ---------- 顶部信息栏 ---------- */
.lg-topbar {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 4px 12px; margin-bottom: 10px;
    border-bottom: 1px solid rgba(120,100,160,0.35);
}
.lg-topbar-title {
    flex: 1; text-align: center;
    font-size: 18px; font-weight: 700; letter-spacing: 2px;
    color: #e8c060;
    text-shadow: 0 0 8px rgba(212,168,67,0.45);
}
.lg-topbar-actions { display: flex; gap: 6px; }

/* ---------- Tab 切换 ---------- */
.lg-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.lg-tab {
    flex: 1; text-align: center; padding: 10px 4px;
    font-size: 14px; font-weight: 600; color: #9a93b5;
    background: rgba(30,26,48,0.6);
    border: 1px solid rgba(120,100,160,0.25);
    border-radius: 8px; cursor: pointer; user-select: none;
    transition: all .15s;
}
.lg-tab.active {
    color: #14121f;
    background: linear-gradient(180deg, #e8c060, #c9a23f);
    border-color: #e8c060;
    box-shadow: 0 2px 10px rgba(212,168,67,0.35);
}
.lg-page { display: none; }

/* ---------- 搜索 / 筛选栏 ---------- */
.lg-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.lg-input, .lg-select {
    flex: 1; min-width: 0; padding: 9px 10px;
    font-size: 13px; color: #e8e6f0;
    background: rgba(20,18,36,0.85);
    border: 1px solid rgba(120,100,160,0.35);
    border-radius: 8px; outline: none;
}
.lg-input::placeholder { color: #6f6888; }
.lg-input:focus, .lg-select:focus { border-color: #d4a843; }
.lg-select { flex: 0 0 auto; min-width: 96px; }

/* ---------- 列表通用 ---------- */
.lg-list { display: flex; flex-direction: column; gap: 8px; }
.lg-loading, .lg-empty {
    text-align: center; padding: 28px 12px; color: #9a93b5; font-size: 13px;
}

/* ---------- 商品项（交易市场 / 通用） ---------- */
.lg-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; background: rgba(28,24,46,0.7);
    border: 1px solid rgba(120,100,160,0.25);
    border-radius: 10px; cursor: pointer;
    transition: all .15s;
}
.lg-item:active { transform: scale(0.985); background: rgba(40,34,64,0.8); }
.lg-item-q {
    width: 8px; height: 38px; border-radius: 4px; flex: 0 0 auto;
    box-shadow: 0 0 8px rgba(255,255,255,0.15);
}
.lg-item-main { flex: 1; min-width: 0; }
.lg-item-name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-item-meta { font-size: 11px; color: #9a93b5; margin-top: 3px; }
.lg-item-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: 0 0 auto; }
.lg-item-total { font-size: 15px; font-weight: 700; color: #e8c060; }
.lg-item-total span { font-size: 11px; color: #9a93b5; font-weight: 400; }
.lg-item-qty { font-size: 11px; color: #9a93b5; }

/* ---------- 按钮 ---------- */
.lg-btn {
    padding: 9px 14px; font-size: 13px; font-weight: 600;
    color: #e8e6f0; cursor: pointer; border-radius: 8px;
    background: rgba(40,34,64,0.8);
    border: 1px solid rgba(120,100,160,0.4);
    transition: all .15s; user-select: none;
}
.lg-btn:active { transform: scale(0.97); }
.lg-btn-primary {
    color: #14121f; border: none;
    background: linear-gradient(180deg, #e8c060, #c9a23f);
    box-shadow: 0 2px 10px rgba(212,168,67,0.35);
}
.lg-btn-buy {
    padding: 7px 16px; font-size: 13px;
    color: #0e2a16; border: none;
    background: linear-gradient(180deg, #6fe39a, #3fae6b);
}
.lg-btn-danger {
    color: #fff; border: 1px solid rgba(224,80,80,0.5);
    background: rgba(90,30,30,0.7);
}
.lg-btn-icon {
    padding: 7px 11px; font-size: 13px; position: relative;
}
.lg-btn-back {
    padding: 7px 12px; font-size: 13px;
}

/* ---------- 我的寄售 ---------- */
.lg-mine-head {
    font-size: 13px; color: #cfcfe8; margin-bottom: 10px;
    padding: 8px 10px; background: rgba(28,24,46,0.6);
    border-radius: 8px; border: 1px solid rgba(120,100,160,0.2);
}
.lg-mine-tip { font-size: 11px; color: #9a93b5; margin-top: 4px; }
.lg-consign-btn { width: 100%; margin-bottom: 10px; }
.lg-mine-item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px; background: rgba(28,24,46,0.7);
    border: 1px solid rgba(120,100,160,0.25); border-radius: 10px;
}
.lg-mine-main { flex: 1; min-width: 0; }
.lg-mine-meta { font-size: 11px; color: #9a93b5; margin-top: 3px; }
.lg-mine-time { font-size: 11px; margin-top: 3px; }
.lg-mine-action { flex: 0 0 auto; }

/* ---------- 寄售选择列表 ---------- */
.lg-consign-list { max-height: 60vh; overflow-y: auto; }
.lg-consign-item {
    display: flex; align-items: center; gap: 10px; padding: 10px;
    background: rgba(28,24,46,0.7); border: 1px solid rgba(120,100,160,0.25);
    border-radius: 10px; margin-bottom: 8px; cursor: pointer;
}
.lg-consign-item:active { background: rgba(40,34,64,0.85); }
.lg-consign-main { flex: 1; min-width: 0; }
.lg-consign-go { color: #d4a843; font-size: 13px; font-weight: 600; }

/* ---------- 交易记录 ---------- */
.lg-rec-item {
    display: flex; align-items: center; gap: 8px;
    padding: 9px 10px; background: rgba(28,24,46,0.6);
    border: 1px solid rgba(120,100,160,0.2); border-radius: 8px;
    font-size: 13px;
}
.lg-rec-time { flex: 0 0 auto; color: #9a93b5; font-size: 11px; width: 84px; }
.lg-rec-type { flex: 0 0 auto; width: 56px; color: #cfcfe8; }
.lg-rec-name { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-rec-stone { flex: 0 0 auto; font-weight: 700; }

/* ---------- 弹窗（通用） ---------- */
.lg-modal-mask {
    position: fixed; inset: 0; z-index: 9000;
    background: rgba(6,5,14,0.82);
    display: flex; align-items: center; justify-content: center;
    padding: 16px; box-sizing: border-box;
}
.lg-modal-box {
    width: 100%; max-width: 360px; max-height: 86vh; overflow-y: auto;
    background: linear-gradient(180deg, #1c1830, #14111e);
    border: 1px solid rgba(212,168,67,0.5);
    border-radius: 14px; padding: 16px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.6), 0 0 0 1px rgba(212,168,67,0.1);
}
.lg-modal-title {
    font-size: 16px; font-weight: 700; color: #e8c060;
    margin-bottom: 12px; letter-spacing: 1px;
    text-shadow: 0 0 8px rgba(212,168,67,0.35);
}
.lg-modal-text { font-size: 13px; line-height: 1.7; color: #cfcfe8; }
.lg-modal-btns { display: flex; gap: 8px; margin-top: 16px; }
.lg-modal-btns .lg-btn { flex: 1; text-align: center; }

/* ---------- 须知 ---------- */
.lg-help { display: flex; flex-direction: column; gap: 8px; }
.lg-help div { font-size: 13px; line-height: 1.6; color: #cfcfe8; }

/* ---------- 详情 / 表单 ---------- */
.lg-detail { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.lg-detail-row { display: flex; justify-content: space-between; font-size: 13px; color: #cfcfe8; }
.lg-detail-row span { color: #9a93b5; }
.lg-form { display: flex; flex-direction: column; gap: 6px; }
.lg-form label { font-size: 12px; color: #9a93b5; }
.lg-form input {
    padding: 9px 10px; font-size: 14px; color: #e8e6f0;
    background: rgba(20,18,36,0.9);
    border: 1px solid rgba(120,100,160,0.4); border-radius: 8px; outline: none;
}
.lg-form input:focus { border-color: #d4a843; }
.lg-buy-preview { font-size: 13px; color: #cfcfe8; margin-top: 4px; }
.lg-buy-preview b { color: #e8c060; }

/* ---------- 邮件 ---------- */
.lg-mail-badge {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px; padding: 0 4px;
    font-size: 11px; line-height: 18px; text-align: center;
    color: #fff; background: #e05050; border-radius: 9px;
    box-shadow: 0 0 6px rgba(224,80,80,0.6);
}
.lg-mail-list { display: flex; flex-direction: column; gap: 8px; max-height: 56vh; overflow-y: auto; }
.lg-mail-item {
    padding: 10px 12px; background: rgba(28,24,46,0.75);
    border: 1px solid rgba(120,100,160,0.3); border-radius: 10px; cursor: pointer;
    position: relative; transition: all .15s;
}
.lg-mail-item:active { background: rgba(40,34,64,0.9); }
.lg-mail-item.lg-mail-claimed { opacity: 0.6; }
.lg-mail-title { font-size: 14px; font-weight: 600; color: #e8c060; }
.lg-mail-body { font-size: 12px; color: #cfcfe8; margin-top: 5px; white-space: pre-wrap; line-height: 1.5; }
.lg-mail-tag {
    display: inline-block; margin-top: 6px; font-size: 11px;
    color: #9a93b5;
}
.lg-mail-todo { color: #6fe39a; }

/* ---------- 杂项 ---------- */
.lg-muted { color: #888; font-size: 12px; }

/* ---------- 主界面邮件入口按钮 ---------- */
#lg-open-mail2 {
    position: fixed; right: 12px; bottom: 72px; z-index: 480;
    width: 46px; height: 46px; border-radius: 50%;
    font-size: 20px; line-height: 1; color: #e8c060;
    background: linear-gradient(180deg, rgba(40,34,64,0.95), rgba(24,20,40,0.95));
    border: 1px solid rgba(212,168,67,0.5);
    box-shadow: 0 4px 14px rgba(0,0,0,0.5);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
}
#lg-open-mail2:active { transform: scale(0.94); }
#lg-open-mail2 .lg-mail-badge { top: -4px; right: -4px; }
