/* ===== LM License 前端样式（会员中心 / 卡密核销） ===== */
.lm-member, .lm-redeem, .lm-buy {
    max-width: 1080px;
    margin: 20px auto;
    font-family: inherit;
    color: #1f2937;
}

/* 标题 */
.lm-member-title, .lm-redeem-title, .lm-buy h3 {
    font-size: 20px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    gap: 8px;
}
.lm-member-title::before, .lm-redeem-title::before, .lm-buy h3::before {
    content: '';
    display: inline-block;
    width: 4px;
    height: 18px;
    background: #2271b1;
    border-radius: 2px;
}

/* 积分卡片 */
.lm-balance-card {
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff;
    border-radius: 12px;
    padding: 24px 28px;
    margin: 0 0 20px;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.2);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.lm-balance-label {
    font-size: 14px;
    opacity: 0.85;
}
.lm-balance-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0.5px;
}
.lm-balance-value::after {
    content: '积分';
    font-size: 14px;
    font-weight: 500;
    margin-left: 6px;
    opacity: 0.85;
}

/* 段落（授权信息） */
.lm-section {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.lm-section-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin: 0 0 12px;
}
/* section 标题行：左标题 + 右操作按钮（去核销卡密/购买会员等） */
.lm-section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
}
.lm-section-head .lm-section-title { margin: 0; }
.lm-section-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}
.lm-section-actions .lm-btn { padding: 6px 14px; font-size: 13px; }
.lm-info-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #f1f5f9;
    font-size: 14px;
}
.lm-info-row:last-child { border-bottom: none; }
.lm-info-k { color: #6b7280; }
.lm-info-v { color: #111827; font-weight: 500; }
.lm-empty {
    color: #9ca3af;
    font-size: 14px;
    margin: 8px 0;
    text-align: center;
}
.lm-link {
    color: #2271b1 !important;
    text-decoration: none;
    font-weight: 500;
}
.lm-link:hover { text-decoration: underline; }

/* 订单表 */
.lm-orders-wrap { overflow-x: auto; }
.lm-orders {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}
.lm-orders th, .lm-orders td {
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
}
.lm-orders th {
    background: #f8fafc;
    color: #6b7280;
    font-weight: 500;
    font-size: 12px;
}
.lm-orders tbody tr:hover { background: #fafbfc; }

/* 标题行：标题在左，操作按钮在右 */
.lm-member-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.lm-member-head .lm-actions { margin-top: 0; flex-shrink: 0; }

/* 左菜单 + 右内容 布局 */
.lm-layout {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}
.lm-sidebar {
    flex: 0 0 200px;
    position: sticky;
    top: 20px;
}
.lm-menu {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lm-menu-item {
    display: block;
    padding: 11px 14px;
    border-radius: 8px;
    color: #374151 !important;
    text-decoration: none !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s ease;
}
.lm-menu-item:hover { background: #f1f5f9; color: #2271b1 !important; }
.lm-menu-item.is-active { background: #2271b1; color: #fff !important; }
.lm-menu-sep {
    height: 1px;
    background: #eef2f7;
    margin: 6px 4px;
}
.lm-menu-btn {
    width: 100%;
    text-align: center;
    margin-top: 2px;
}
.lm-main {
    flex: 1 1 auto;
    min-width: 0;
}
.lm-main .lm-section:last-child { margin-bottom: 0; }

/* 窄屏：菜单移到顶部，横向排列 */
@media (max-width: 720px) {
    .lm-layout { flex-direction: column; }
    .lm-sidebar { flex-basis: auto; width: 100%; position: static; }
    .lm-menu { flex-direction: row; flex-wrap: wrap; gap: 6px; }
    .lm-menu-item { flex: 1 1 auto; text-align: center; }
    .lm-menu-sep { display: none; }
    .lm-menu-btn { width: auto; flex: 1 1 auto; }
}

/* 操作按钮 */
.lm-actions {
    display: flex;
    gap: 10px;
    margin-top: 18px;
    flex-wrap: wrap;
}
.lm-btn {
    display: inline-block;
    padding: 9px 22px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.2;
    text-decoration: none !important;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .15s ease;
    font-family: inherit;
}
.lm-btn-primary {
    background: #2271b1;
    color: #fff !important;
    border-color: #2271b1;
    box-shadow: 0 1px 2px rgba(34, 113, 177, 0.25);
}
.lm-btn-primary:hover {
    background: #135e96;
    border-color: #135e96;
    color: #fff !important;
}
.lm-btn-ghost {
    background: #fff;
    color: #2271b1 !important;
    border-color: #cbd5e1;
}
.lm-btn-ghost:hover {
    border-color: #2271b1;
    background: #f0f6fc;
    color: #2271b1 !important;
}

/* 卡密核销 */
.lm-redeem-tip {
    color: #6b7280;
    font-size: 13px;
    margin: 0 0 14px;
}
.lm-redeem-form {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.lm-redeem-input {
    flex: 1 1 240px;
    min-width: 200px;
    padding: 10px 14px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.lm-redeem-input:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 3px rgba(34, 113, 177, 0.12);
}
.lm-msg {
    padding: 10px 14px;
    border-radius: 8px;
    margin-bottom: 14px;
    font-size: 13px;
}
.lm-msg-info { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.lm-msg-error { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.lm-msg-success { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* 购买会员卡片（增强原 lm-plan） */
.lm-plan {
    border: 1px solid #e5e7eb !important;
    padding: 16px 18px !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
    background: #fff;
    transition: all .15s ease;
}
.lm-plan:hover {
    border-color: #c7d8eb !important;
    box-shadow: 0 2px 6px rgba(34, 113, 177, 0.08);
}
.lm-plan-head {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}
.lm-plan-name { font-size: 15px; font-weight: 600; color: #111827; }
.lm-plan-price { font-size: 20px; font-weight: 700; color: #2271b1; }
.lm-plan-dur { font-size: 13px; color: #9ca3af; }
.lm-plan-form { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* 积分充值区块 */
.lm-recharge { border: 1px solid #e5e7eb; border-radius: 12px; padding: 22px 20px; margin-bottom: 22px; background: #fff; }
.lm-recharge .lm-msg { margin: 0 0 14px; }
.lm-recharge-bal { margin: 0 0 14px; color: #374151; font-size: 14px; }
.lm-recharge-bal strong { color: #2271b1; font-size: 16px; }
.lm-recharge-tip { margin: 0; padding: 12px 14px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 8px; color: #9a3412; font-size: 13px; line-height: 1.6; }
.lm-recharge-tip strong { color: #c2410c; }
.lm-recharge-form { display: flex; flex-direction: column; gap: 14px; }
.lm-recharge-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.lm-recharge-label { font-size: 14px; color: #374151; min-width: 64px; }
.lm-recharge-row input[type="number"] { flex: 1; min-width: 180px; padding: 10px 12px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 15px; }
.lm-recharge-row input[type="number"]:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34,113,177,.15); }
.lm-recharge-channels { display: flex; flex-wrap: wrap; gap: 10px; }

/* 弹框组件 */
.lm-modal-noscroll { overflow: hidden; }
#lm-modal-overlay {
    display: none;
    position: fixed; inset: 0; z-index: 99999;
    background: rgba(15, 23, 42, .55);
    align-items: center; justify-content: center;
    padding: 20px;
}
#lm-modal-overlay.lm-modal-open { display: flex; }
.lm-modal {
    background: #fff; width: 100%; max-width: 420px;
    border-radius: 14px; box-shadow: 0 20px 60px rgba(0,0,0,.25);
    overflow: hidden; animation: lm-modal-in .18s ease;
}
@keyframes lm-modal-in { from { transform: translateY(12px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
.lm-modal-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px 20px; border-bottom: 1px solid #eef2f7; background: #f8fafc;
}
.lm-modal-title { font-size: 16px; font-weight: 600; color: #1f2937; }
.lm-modal-close {
    border: none; background: transparent; font-size: 24px; line-height: 1;
    color: #94a3b8; cursor: pointer; padding: 0 4px; border-radius: 6px;
}
.lm-modal-close:hover { color: #475569; background: #eef2f7; }
.lm-modal-body { padding: 20px; }
.lm-modal-tip { margin: 0 0 16px; color: #64748b; font-size: 13px; line-height: 1.6; }
.lm-modal-tip.lm-modal-warn { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 12px 14px; border-radius: 8px; }
.lm-modal-result { padding: 16px 18px; border-radius: 10px; font-size: 14px; text-align: center; }
.lm-modal-result.lm-modal-ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }
.lm-modal-result.lm-modal-err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.lm-modal-actions { margin-top: 16px; text-align: center; }
.lm-modal-plan { margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px dashed #e5e7eb; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.lm-modal-plan .lm-plan-price { color: #e11d48; font-weight: 600; }
.lm-modal-plan .lm-plan-dur { color: #94a3b8; font-size: 13px; }

/* 区块精简：只保留标题 + 按钮 */
.lm-plan { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid #f1f5f9; }
.lm-plan:last-child { border-bottom: none; }

/* 购买会员：套餐选择列表弹框 */
.lm-buy-list { display: flex; flex-direction: column; gap: 10px; }
.lm-buy-item { width: 100%; text-align: left; justify-content: flex-start; }

/* ===== 购买 UI：等级选择卡片 ===== */
.lm-buy-item {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 14px 16px; border: 1px solid #e5e7eb; border-radius: 10px;
    background: #fff; cursor: pointer; font-family: inherit;
    transition: all .15s ease;
}
.lm-buy-item:hover {
    border-color: #2271b1;
    box-shadow: 0 2px 10px rgba(34, 113, 177, .12);
    transform: translateY(-1px);
}
.lm-bi-main { display: flex; flex-direction: column; gap: 2px; }
.lm-bi-name { font-size: 15px; font-weight: 600; color: #111827; }
.lm-bi-dur { font-size: 12px; color: #9ca3af; }
.lm-bi-side { display: flex; align-items: center; gap: 12px; }
.lm-bi-price { font-size: 18px; font-weight: 700; color: #2271b1; }
.lm-bi-go { font-size: 12px; color: #2271b1; background: #f0f6fc; border-radius: 999px; padding: 4px 10px; transition: all .15s ease; }
.lm-buy-item:hover .lm-bi-go { background: #2271b1; color: #fff; }

/* ===== 购买 UI：确认弹窗 ===== */
.lm-buy-confirm .lm-bc-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    background: linear-gradient(135deg, #2271b1 0%, #135e96 100%);
    color: #fff; border-radius: 10px; padding: 14px 16px; margin-bottom: 12px;
}
.lm-bc-name { font-size: 16px; font-weight: 700; }
.lm-bc-dur { font-size: 12px; opacity: .9; background: rgba(255, 255, 255, .18); padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.lm-bc-price { text-align: center; font-size: 34px; font-weight: 700; color: #e11d48; line-height: 1.2; margin-bottom: 4px; }
.lm-bc-form { display: flex; flex-direction: column; gap: 10px; }
.lm-bc-btn { width: 100%; text-align: center; padding: 11px 0; font-size: 14px; }

/* ===== 历史订单筛选 ===== */
.lm-orders-filter {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 0 0 12px; padding: 10px 12px;
    background: #f8fafc; border: 1px solid #eef2f7; border-radius: 8px;
}
.lm-orders-filter select,
.lm-orders-filter input[type="date"] {
    padding: 6px 10px; border: 1px solid #d1d5db; border-radius: 8px;
    font-size: 13px; background: #fff; font-family: inherit; color: #374151;
}
.lm-orders-filter input[type="date"]:focus,
.lm-orders-filter select:focus { outline: none; border-color: #2271b1; box-shadow: 0 0 0 2px rgba(34, 113, 177, .12); }
.lm-orders-filter .lm-btn { padding: 7px 16px; font-size: 13px; }
.lm-filter-sep { color: #9ca3af; font-size: 13px; }

/* ===== 已购会员卡片 ===== */
.lm-mc-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 12px; margin: 4px 0 12px;
}
.lm-member-card {
    position: relative; overflow: hidden;
    border-radius: 14px; padding: 16px 18px;
    color: #fff; min-height: 84px;
    display: flex; flex-direction: column; justify-content: space-between; gap: 8px;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .15);
    transition: transform .15s ease, box-shadow .15s ease;
}
.lm-member-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px rgba(15, 23, 42, .22); }
.lm-member-card::after {
    content: ''; position: absolute; right: -28px; top: -28px; width: 104px; height: 104px;
    background: rgba(255, 255, 255, .09); border-radius: 50%;
}
.lm-mc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; position: relative; z-index: 1; }
.lm-mc-name { font-size: 16px; font-weight: 700; letter-spacing: .3px; }
.lm-mc-badge { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.lm-mc-badge.is-ok { background: rgba(255, 255, 255, .22); }
.lm-mc-badge.is-forever { background: #f59e0b; color: #fff; box-shadow: 0 1px 4px rgba(0, 0, 0, .18); }
.lm-mc-badge.is-expired { background: rgba(0, 0, 0, .28); }
.lm-mc-bottom { position: relative; z-index: 1; }
.lm-mc-expire { font-size: 12.5px; opacity: .92; }
/* 主题色（有效期） */
.lm-mc-blue.is-valid { background: linear-gradient(135deg, #2271b1 0%, #135e96 100%); }
.lm-mc-teal.is-valid { background: linear-gradient(135deg, #0ea772 0%, #067a53 100%); }
.lm-mc-violet.is-valid { background: linear-gradient(135deg, #6353ff 0%, #4436c9 100%); }
/* 过期：灰色渐变（置于主题色后，同权重靠后生效） */
.lm-member-card.is-expired { background: linear-gradient(135deg, #94a3b8 0%, #64748b 100%); }
.lm-member-card.is-expired .lm-mc-name { opacity: .85; }