/**
 * 友链外链交易中心 - 前端样式
 * 覆盖：交易中心列表页 / 详情页 / 用户中心面板 / 申请与操作弹窗（购物车页专属样式独立在 user-cart.css，本文件须先行加载）
 * 变量体系：跟随主题 CSS 变量（var(--ri-*, fallback)；主题为按需裁剪版 Bootstrap，--bs-* 未定义）
 * 由 inc/template-assets.php 在交易相关页面条件加载（filemtime 版本号防缓存）
 */

/* ============================================================
 * 基础
 * ============================================================ */
/* 页面主体容器（交易中心列表 / 详情页）：替代工具页共用的 .seo-check-body，上边距收紧为 20px；
   详情页 .le-detail-body 的 padding-top 仍在其后覆盖 */
.le-body {
    background-color: #f5f7fc;
    padding: 20px 0 64px;
}

.le-dim { color: var(--ri-secondary-color, #6c757d); font-size: 12.5px; }

.le-crumb { font-size: 13px; color: var(--ri-secondary-color, #6c757d); margin-bottom: 14px; }
.le-crumb a { color: inherit; text-decoration: none; }
.le-crumb a:hover { color: var(--ri-primary, #0d6efd); }

.le-empty, .le-empty-line {
    padding: 34px 16px;
    text-align: center;
    color: var(--ri-secondary-color, #6c757d);
    background: var(--ri-tertiary-bg, #f8f9fa);
    border: 1px dashed var(--ri-border-color, #dee2e6);
    border-radius: 10px;
}
.le-empty-line { padding: 18px 16px; }

/* ============================================================
 * 徽章
 * ============================================================ */
.le-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 9px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.7;
    border-radius: 999px;
    border: 1px solid transparent;
    white-space: nowrap;
}
.le-badge-ok, .le-badge-st-ok { color: var(--ri-success, #198754); background: rgba(12, 188, 135, .12); border-color: rgba(12, 188, 135, .3); }
.le-badge-wait, .le-badge-st-wait { color: #9a6700; background: rgba(247, 195, 46, .16); border-color: rgba(247, 195, 46, .4); }
.le-badge-bad, .le-badge-st-bad { color: var(--ri-danger, #dc3545); background: rgba(214, 41, 62, .1); border-color: rgba(214, 41, 62, .3); }
.le-badge-st-warn { color: #b02a37; background: rgba(253, 126, 20, .12); border-color: rgba(253, 126, 20, .3); }
.le-badge-cat { color: var(--ri-primary, #0d6efd); background: rgba(33, 99, 232, .08); border-color: rgba(33, 99, 232, .22); }
/* 进行中（该链接位已有 N 笔进行中的交易，仍可受理新申请）：中性琥珀调，提示热度而非锁定 */
.le-badge-active { color: #8a5a00; background: rgba(214, 158, 46, .14); border-color: rgba(214, 158, 46, .36); }
.le-badge-pos-home, .le-badge-pos-inner, .le-badge-pos-content {
    color: var(--ri-body-color, #212529);
    background: var(--ri-tertiary-bg, #f8f9fa);
    border-color: var(--ri-border-color, #dee2e6);
}

/* ============================================================
 * 顶部轻提示（JS 动态插入）
 * ============================================================ */
.le-toast {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translate(-50%, -16px);
    z-index: 2000;
    max-width: min(92vw, 560px);
    padding: 10px 18px;
    font-size: 14px;
    color: #fff;
    background: rgba(33, 37, 41, .92);
    border-radius: 999px;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transition: all .2s ease;
}
.le-toast.is-show { opacity: 1; visibility: visible; transform: translate(-50%, 0); }
.le-toast.is-error { background: rgba(220, 53, 69, .94); }

/* 按钮 loading 态 */
.btn.is-loading { opacity: .6; pointer-events: none; }

/* 按钮完成态（提交成功后的状态反馈，如发起交易按钮） */
.btn.is-done { background: #198754; border-color: #198754; color: #fff; opacity: 1; }

/* ============================================================
 * 交易中心 - 筛选栏
 * ============================================================ */
.le-filter {
    padding: 16px 18px;
    background: #ffffff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 12px;
}
.le-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
    align-items: flex-end;
}
.le-filter-item { display: flex; flex-direction: column; gap: 4px; }
.le-filter-item > span { font-size: 12px; color: var(--ri-secondary-color, #6c757d); }
.le-filter-item select, .le-filter-item input {
    min-width: 130px;
    padding: 6px 10px;
    font-size: 14px;
    background: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 8px;
}
.le-filter-range { display: flex; align-items: center; gap: 6px; }
.le-filter-range input { width: 82px; min-width: 0; }
.le-filter-range em { font-style: normal; color: var(--ri-secondary-color, #6c757d); }
.le-filter-actions { display: flex; gap: 8px; margin-left: auto; }
/* 筛选提交按钮：主题的 .banner-search-btn 样式为上下文选择器（仅 .banner-search 内生效），筛选栏内需单独补充 */
.le-filter-actions .banner-search-btn {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    border: 0;
    cursor: pointer;
    line-height: 24px;
    color: #191a1f;
    font-size: 14.5px;
    font-family: inherit;
    border-radius: 50px;
    background-color: #f7c32e;
    padding: 11px 22px;
    white-space: nowrap;
    transition: all .3s ease;
}
.le-filter-actions .banner-search-btn:hover { color: #fff; background-color: #66aeff; }
.le-filter-reset { color: var(--ri-secondary-color, #6c757d); font-size: 13px; align-self: center; text-decoration: none; }
.le-filter-reset:hover { color: var(--ri-primary, #0d6efd); }

/* ============================================================
 * 交易中心 - 链接位列表（行式出售列表：左侧站点信息、中部数据指标、右侧价格）
 * ============================================================ */
.le-list {
    display: flex;
    flex-direction: column;
    margin-top: 16px;
    background: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 12px;
    overflow: hidden;
}
.le-row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 18px;
    background: #fff;
    border-bottom: 1px solid var(--ri-border-color, rgba(0, 0, 0, .08));
    text-decoration: none;
    transition: background-color .15s ease;
}
.le-row-wrap { display: flex; align-items: stretch; background: #fff; border-bottom: 1px solid var(--ri-border-color, rgba(0, 0, 0, .08)); }
.le-list .le-row-wrap:last-child { border-bottom: 0; }
.le-row-wrap .le-row { flex: 1 1 auto; min-width: 0; border-bottom: 0; }
.le-row-wrap:hover { background-color: rgba(33, 99, 232, .045); }
.le-row-wrap:hover .le-row-domain { color: var(--ri-primary, #0d6efd); }
.le-row:hover { background-color: transparent; }

/* 列表工具行：全选 + 购物车入口 */
.le-list-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 16px; margin-top: 16px; padding: 9px 18px; background: #fff; border: 1px solid var(--ri-border-color, #dee2e6); border-radius: 12px; }
.le-list-head .le-check { align-items: center; font-size: 13px; font-weight: 600; color: var(--ri-body-color, #212529); }
.le-list-head .le-check input { margin-top: 0; }
.le-cart-entry { display: inline-flex; align-items: center; font-size: 13px; font-weight: 600; color: var(--ri-primary, #0d6efd); text-decoration: none; }
.le-cart-entry:hover { color: var(--ri-primary, #0d6efd); text-decoration: underline; }
.le-cart-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; margin-left: 6px; padding: 0 5px; font-size: 11px; font-weight: 700; line-height: 1; color: #fff; background: var(--ri-primary, #0d6efd); border-radius: 50px; }
.le-cart-badge:empty, .le-cart-badge[data-cart-badge="0"] { display: none; }

/* 链接位多选框（勾选加入购物车） */
.le-pick {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    padding: 0 2px 0 18px;
    cursor: pointer;
}
.le-pick input, .le-list-head .le-check input { width: 16px; height: 16px; accent-color: var(--ri-primary, #0d6efd); cursor: pointer; }

/* 多选加购底部操作条（fixed 滑出；勾选后显示） */
.le-pickbar {
    position: fixed;
    left: 50%;
    bottom: 20px;
    z-index: 1030;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 14px 10px 18px;
    background: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 50px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .16);
    transform: translateX(-50%);
}
.le-pickbar[hidden] { display: none; }
.le-pickbar-sum { font-size: 13px; font-weight: 600; color: var(--ri-body-color, #212529); white-space: nowrap; }
.le-row-main { flex: 1 1 auto; min-width: 0; }
.le-row-head { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.le-row-domain { font-size: 15.5px; font-weight: 700; color: var(--ri-body-color, #212529); }
.le-row:hover .le-row-domain { color: var(--ri-primary, #0d6efd); }

/* 域名 favicon：加载成功显示真实图标并隐藏地球图标；失败回退地球图标 */
.le-favicon-wrap { display: inline-flex; align-items: center; height: 1em; vertical-align: -0.125em; }
.le-favicon-fb { margin-right: 5px; font-size: 0.83em; line-height: 1; transform: translateY(-0.29em); }
.le-favicon { display: none; margin-right: 6px; border-radius: 3px; object-fit: contain; }
.le-favicon.is-loaded { display: inline-block; }
.le-row-title { font-size: 12.5px; color: var(--ri-secondary-color, #6c757d); }
.le-row-req { margin: 2px 0 0; font-size: 12px; color: var(--ri-secondary-color, #6c757d); }
.le-row-req i { color: var(--ri-success, #198754); }

/* 两段式事实行：①门槛数值 ②定价匹配 + 风险标记（同行紧凑，左侧最多三行） */
.le-row-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 14px;
    row-gap: 2px;
    margin-top: 3px;
    font-size: 12.5px;
    line-height: 1.45;
    color: var(--ri-secondary-color, #6c757d);
}
.le-row-facts .le-fact { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.le-row-facts em { font-style: normal; margin-right: 1px; color: var(--ri-secondary-color, #6c757d); opacity: .85; }
/* 定价匹配与风险标记的分隔线（rel 恒有输出，固定作为分组起点） */
.le-fact-divide { padding-left: 13px; border-left: 1px solid var(--ri-border-color, rgba(0, 0, 0, .08)); }
.le-facts-main { margin-top: 5px; color: var(--ri-body-color, #212529); }
.le-facts-main .le-fact { white-space: normal; }
.le-facts-main b { font-size: 13px; font-weight: 700; line-height: 1.3; color: var(--ri-body-color, #212529); }
.le-fact-extra { font-size: 11.5px; color: var(--ri-secondary-color, #6c757d); }

/* 验证与风险标记 */
.le-metric-ok { font-size: 11px; color: var(--ri-success, #198754); }
.le-metric-warn { font-size: 11px; color: var(--ri-danger, #dc3545); }
.le-metric-up { font-size: 11px; color: var(--ri-success, #198754); }
.le-metric-down { font-size: 11px; color: var(--ri-danger, #dc3545); }
.le-trend-up { color: var(--ri-success, #198754); }
.le-trend-down { color: var(--ri-danger, #dc3545); }
.le-fact-ok { color: var(--ri-success, #198754); }

/* 右侧价格区 */
.le-row-side {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 5px;
    min-width: 118px;
}
.le-row-price { font-size: 18px; font-weight: 800; line-height: 1.2; color: #dc3545; white-space: nowrap; }
.le-row-price.is-free { font-size: 15px; color: var(--ri-success, #198754); }
/* 月价标注（/月）：列表价格、链接位表格等处复用 */
.le-price-per { font-style: normal; font-size: 0.72em; font-weight: 600; margin-left: 1px; color: var(--ri-secondary-color, #6c757d); }
/* 交易金额统一标红（表格金额列、提示内嵌金额等复用） */
.le-price-red { color: #dc3545; font-weight: 700; }
.le-row-type { font-size: 12px; color: var(--ri-secondary-color, #6c757d); white-space: nowrap; }
.le-row-arrow {
    flex: 0 0 auto;
    font-size: 13px;
    color: var(--ri-secondary-color, #6c757d);
    transition: transform .15s ease, color .15s ease;
}
.le-row:hover .le-row-arrow { color: var(--ri-primary, #0d6efd); transform: translateX(2px); }

/* ============================================================
 * 详情页
 * ============================================================ */
.le-detail-body { padding-top: 36px; }
.le-detail-card {
    background: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 12px;
    padding: 18px 20px;
    margin-bottom: 16px;
}
.le-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.le-detail-id { font-size: 22px; font-weight: 800; color: var(--ri-body-color, #212529); }
.le-detail-domain { font-size: 15px; font-weight: 600; color: var(--ri-primary, #0d6efd); }
.le-detail-sitetitle { font-size: 13px; color: var(--ri-secondary-color, #6c757d); }
.le-detail-intro { margin: 10px 0 0; font-size: 13.5px; color: var(--ri-secondary-color, #6c757d); }
.le-detail-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.le-preview-note {
    margin-top: 12px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #9a6700;
    background: rgba(255, 193, 7, .12);
    border: 1px solid rgba(255, 193, 7, .3);
    border-radius: 8px;
}
.le-detail-h2 {
    display: flex;
    align-items: center;
    margin: 0 0 12px;
    font-size: 15px;
    font-weight: 700;
    color: var(--ri-body-color, #212529);
}
.le-detail-dl { margin: 0; display: grid; gap: 10px; }
.le-detail-dl > div { display: flex; gap: 12px; font-size: 13.5px; }
.le-detail-dl dt { flex: 0 0 92px; margin: 0; color: var(--ri-secondary-color, #6c757d); }
.le-detail-dl dd { margin: 0; color: var(--ri-body-color, #212529); }

/* 指标网格 */
.le-metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
    gap: 10px;
}
.le-metric, .le-mg-item {
    padding: 10px 8px;
    text-align: center;
    background: var(--ri-tertiary-bg, #f8f9fa);
    border-radius: 10px;
}
.le-metric b, .le-mg-item b { display: block; font-size: 17px; color: var(--ri-body-color, #212529); }
.le-metric span, .le-mg-item span { font-size: 12px; color: var(--ri-secondary-color, #6c757d); }
.le-mg-item > i { display: block; font-style: normal; font-size: 12px; margin-bottom: 2px; color: var(--ri-secondary-color, #6c757d); }

/* 右侧价格卡 */
.le-side-card { position: sticky; top: 86px; }
.le-price-block { display: flex; align-items: baseline; gap: 8px; }
.le-price-num { font-size: 30px; font-weight: 800; color: #dc3545; }
.le-price-num.le-price-free { color: var(--ri-success, #198754); }
.le-price-unit { font-size: 13px; color: var(--ri-secondary-color, #6c757d); }
.le-side-pub { margin: 10px 0 12px; font-size: 13px; color: var(--ri-secondary-color, #6c757d); }
.le-side-balance { margin: 10px 0 0; font-size: 12.5px; color: var(--ri-secondary-color, #6c757d); }
.le-side-balance.is-low { color: var(--ri-danger, #dc3545); }
.le-side-low {
    margin: 8px 0 0;
    padding: 8px 12px;
    font-size: 12.5px;
    color: var(--ri-danger, #dc3545);
    background: rgba(220, 53, 69, .08);
    border-radius: 8px;
}
.le-side-note { margin: 14px 0 0; font-size: 12px; color: var(--ri-secondary-color, #6c757d); }
.le-apply-btn { margin-top: 4px; }

/* 流程步骤 */
.le-steps { margin: 0; padding-left: 20px; display: grid; gap: 8px; font-size: 13px; color: var(--ri-secondary-color, #6c757d); }

/* ============================================================
 * 表单（面板与弹窗共用）
 * ============================================================ */
.le-form-card {
    margin-top: 18px;
    padding: 18px 20px;
    background: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 12px;
}
.le-form-title { display: flex; align-items: center; margin: 0 0 6px; font-size: 15px; font-weight: 700; }
.le-form-hint { margin: 0 0 12px; font-size: 12.5px; color: var(--ri-secondary-color, #6c757d); }
.le-form-sub { margin: 0; font-size: 13px; font-weight: 600; color: var(--ri-body-color, #212529); }
/* 指标区标题行：说明文字 + 自动获取按钮（右侧） */
.le-metric-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.le-metric-head .le-form-sub { margin: 0; }
.le-form-note { margin: 6px 0 0; font-size: 12px; color: var(--ri-secondary-color, #6c757d); }

/* 站点指标展示卡（只读展示，替代输入框；空值为 —，已验证右上角绿勾） */
.le-metric-tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 100%;
    padding: 10px 12px;
    background: linear-gradient(135deg, rgba(33, 99, 232, .07), rgba(33, 99, 232, .02));
    border: 1px solid rgba(33, 99, 232, .16);
    border-radius: 10px;
}
.le-metric-tile-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 14px;
    color: var(--ri-primary, #0d6efd);
    background: rgba(33, 99, 232, .1);
    border-radius: 9px;
}
.le-metric-tile-body { display: flex; flex-direction: column; min-width: 0; }
.le-metric-tile-label { font-size: 12px; font-style: normal; line-height: 1.25; color: var(--ri-secondary-color, #6c757d); }
.le-metric-tile-value { font-size: 17px; font-weight: 700; line-height: 1.3; }
.le-metric-tile:not(.is-set) .le-metric-tile-value { color: var(--ri-secondary-color, #6c757d); font-weight: 600; }
.le-metric-tile-ok { display: none; position: absolute; top: 7px; right: 7px; font-size: 11px; color: var(--ri-success, #198754); }
.le-metric-tile.is-set .le-metric-tile-ok { display: inline-block; }
.le-label { display: block; margin-bottom: 5px; font-size: 13px; font-weight: 600; color: var(--ri-body-color, #212529); }
.le-label em { color: var(--ri-danger, #dc3545); font-style: normal; }
.le-field { display: block; margin-bottom: 14px; }
.le-field input[type="text"], .le-field input[type="url"], .le-field input[type="number"],
.le-field textarea, .le-field select { width: 100%; }

/* 表单控件外观：模板中控件均为裸元素（无 .form-control），需模块内补全基础样式
 * 覆盖范围：用户中心表单卡（.le-form-card）与弹窗表单体（.le-modal-body） */
.le-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.le-modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]),
.le-form-card select, .le-modal-body select,
.le-form-card textarea, .le-modal-body textarea {
    display: block;
    width: 100%;
    padding: 7px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: var(--ri-body-color, #212529);
    background-color: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 8px;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.le-form-card input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
.le-modal-body input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]):not([type="file"]):focus,
.le-form-card select:focus, .le-modal-body select:focus,
.le-form-card textarea:focus, .le-modal-body textarea:focus {
    border-color: var(--ri-primary, #0d6efd);
    box-shadow: 0 0 0 3px rgba(13, 110, 253, .12);
    outline: 0;
}
.le-form-card input[readonly], .le-modal-body input[readonly] {
    color: var(--ri-secondary-color, #6c757d);
    background-color: var(--ri-tertiary-bg, #f8f9fa);
}
.le-form-card textarea, .le-modal-body textarea { resize: vertical; }
.le-form-card ::placeholder, .le-modal-body ::placeholder { color: var(--ri-secondary-color, #6c757d); opacity: .75; }
.le-form-foot { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.le-form-msg { margin: 0; font-size: 13px; }
.le-form-msg.is-error { color: var(--ri-danger, #dc3545); }
.le-form-msg.is-ok { color: var(--ri-success, #198754); }

/* 单选行 */
.le-radio-row { display: flex; flex-wrap: wrap; gap: 8px 14px; }
.le-radio { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; cursor: pointer; }
.le-check { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; cursor: pointer; }
.le-check input { margin-top: 3px; }

/* 条款 */
.le-terms {
    margin: 4px 0 14px;
    padding: 12px 14px;
    max-height: 180px;
    overflow: auto;
    font-size: 12.5px;
    color: var(--ri-secondary-color, #6c757d);
    background: var(--ri-tertiary-bg, #f8f9fa);
    border-radius: 10px;
}
.le-terms-title { margin: 0 0 8px; font-weight: 700; color: var(--ri-body-color, #212529); }
.le-terms-list { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
.le-terms-text { margin: 0; }

/* 验证指引 */
.le-guide {
    margin-top: 16px;
    padding: 14px 16px;
    background: rgba(13, 110, 253, .05);
    border: 1px solid rgba(13, 110, 253, .2);
    border-radius: 12px;
}
.le-guide-title { margin: 0 0 8px; font-size: 14px; font-weight: 700; color: var(--ri-primary, #0d6efd); }
.le-code {
    margin: 8px 0 0;
    padding: 9px 12px;
    background: #fff;
    border: 1px dashed var(--ri-border-color, #dee2e6);
    border-radius: 8px;
    cursor: pointer;
    word-break: break-all;
}
.le-code code { font-size: 12.5px; color: var(--ri-body-color, #212529); }

/* 验证指引 - 步骤列表与操作行（编辑表单下方 / 站点列表展开行共用） */
.le-guide-steps { margin: 0; padding-left: 20px; display: grid; gap: 7px; font-size: 12.5px; color: var(--ri-secondary-color, #6c757d); }
.le-guide-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 10px; }
.le-guide-switch { margin: 10px 0 0; font-size: 12px; }

/* 站点列表：验证指引展开行 */
.le-guide-row td { padding-top: 0; }
.le-guide-row .le-guide { margin-top: 0; margin-bottom: 2px; }
.le-guide-row:hover td { background-color: transparent; }

.le-reject { margin-top: 6px; font-size: 12.5px; color: var(--ri-danger, #dc3545); }

/* ============================================================
 * 弹窗（自建轻量 modal）
 * ============================================================ */
.le-modal-open body { overflow: hidden; }
.le-modal { position: fixed; inset: 0; z-index: 1500; display: flex; align-items: center; justify-content: center; padding: 18px; }
.le-modal-mask { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); backdrop-filter: blur(2px); }
.le-modal-dialog {
    position: relative;
    width: 100%;
    max-width: 560px;
    max-height: calc(100vh - 60px);
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .22);
    overflow: hidden;
}
.le-modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--ri-border-color, #dee2e6);
}
.le-modal-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.le-modal-x {
    border: 0;
    background: none;
    font-size: 22px;
    line-height: 1;
    color: var(--ri-secondary-color, #6c757d);
    cursor: pointer;
    padding: 0 2px;
}
.le-modal-x:hover { color: var(--ri-body-color, #212529); }
/* 表单类弹窗更宽（站点 / 链接位编辑表单字段较多） */
.le-form-dialog { max-width: 720px; }
.le-modal-body { padding: 16px 18px; overflow-y: auto; }
.le-modal-foot {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 4px;
    padding-top: 12px;
    border-top: 1px solid var(--ri-border-color, #dee2e6);
}

/* ============================================================
 * 用户中心面板
 * ============================================================ */
.user-exchange-wrap .card-header { padding-bottom: 5px; margin-bottom: 10px; border-bottom: 1px solid var(--ri-border-color, rgba(0, 0, 0, .1)); }
/* 页签导航：浅蓝底胶囊组（头部导航 / 交易管理角色切换共用；选中态为柔和半透明底，不加粗以免宽度跳变） */
.le-tab-links { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 2px; padding: 4px; background: rgba(13, 110, 253, .07); border-radius: 12px; }
.le-tab-links a { display: inline-flex; align-items: center; padding: 5px 13px; border-radius: 8px; font-size: 13px; line-height: 1.5; color: var(--ri-secondary-color, #6c757d); text-decoration: none; white-space: nowrap; transition: background-color .18s ease, color .18s ease; }
.le-tab-links a:hover { color: #0d6efd; background: rgba(13, 110, 253, .07); }
.le-tab-links a.is-active { color: #0d6efd; background: rgba(13, 110, 253, .14); }

/* 说明气泡：默认仅显示 info 图标，悬浮 / 点击（聚焦）时在图标下方弹出完整说明 */
.le-hint-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; color: var(--ri-secondary-color, #6c757d); cursor: pointer; outline: none; }
.le-hint-tip i { font-size: 14px; }
.le-hint-tip:hover, .le-hint-tip:focus { color: #0d6efd; background: rgba(13, 110, 253, .08); }
.le-hint-tip::after { content: attr(data-le-hint); position: absolute; top: calc(100% + 8px); right: 0; width: max-content; max-width: 320px; padding: 9px 12px; border-radius: 8px; background: rgba(33, 37, 41, .95); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.6; text-align: left; white-space: normal; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); opacity: 0; visibility: hidden; transform: translateY(-2px); transition: opacity .15s ease, transform .15s ease, visibility .15s ease; pointer-events: none; z-index: 30; }
.le-hint-tip:hover::after, .le-hint-tip:focus::after { opacity: 1; visibility: visible; transform: translateY(0); }

/* 站点指标：图表图标 + 悬浮 / 点击弹出详情气泡（气泡由 JS 以 fixed 定位渲染，避免表格容器裁剪） */
.le-metrics-tip { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; color: var(--ri-secondary-color, #6c757d); cursor: pointer; outline: none; transition: color .15s ease, background-color .15s ease; }
.le-metrics-tip:hover, .le-metrics-tip:focus { color: #0d6efd; background: rgba(13, 110, 253, .08); }
.le-metrics-tip i { font-size: 15px; }
.le-metrics-pop { position: fixed; z-index: 1080; max-width: 320px; padding: 9px 12px; border-radius: 8px; background: rgba(33, 37, 41, .95); color: #fff; font-size: 12.5px; font-weight: 400; line-height: 1.6; text-align: left; white-space: pre-line; box-shadow: 0 6px 18px rgba(0, 0, 0, .16); pointer-events: none; }

/* 表格样式：主题为按需裁剪版 Bootstrap，不含 .table / .table-responsive，模块内自包含补齐
 * 关键：width 100% 撑满模块（否则表格塌缩为内容宽度，列表又窄又挤） */
.user-exchange-wrap .table-responsive { overflow-x: auto; }
.le-table {
    width: 100%;
    margin-bottom: 0;
    font-size: 13.5px;
    border-collapse: collapse;
}
.le-table th, .le-table td {
    padding: 11px 12px;
    vertical-align: middle;
    border-bottom: 1px solid var(--ri-border-color, rgba(0, 0, 0, .1));
}
.le-table th { text-align: left; }
.le-table thead th { font-size: 12.5px; color: var(--ri-secondary-color, #6c757d); font-weight: 600; white-space: nowrap; }
.le-table tbody tr:last-child td { border-bottom: 0; }
.le-table tbody tr:hover td { background-color: rgba(33, 99, 232, .04); }
.le-row-actions { white-space: nowrap; }
.le-row-actions a, .le-row-actions button { margin-left: 8px; }
.le-row-actions a { text-decoration: none; }

/* 用户中心：刷新验证指标按钮 */
.le-act-btn {
    background: none;
    border: 0;
    padding: 0;
    font-size: inherit;
    color: var(--ri-primary, #0d6efd);
    cursor: pointer;
}
.le-act-btn:hover { opacity: .82; }
.le-act-btn:disabled { opacity: .45; cursor: default; }
.le-act-btn.is-danger { color: var(--ri-danger, #dc3545); }

/* 交易单列表 */
.le-deal-list { display: grid; gap: 12px; }
.le-deal-item {
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 12px;
}
.le-deal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.le-deal-no { font-size: 13px; font-weight: 700; color: var(--ri-body-color, #212529); }
.le-deal-body { display: flex; flex-wrap: wrap; gap: 10px 22px; justify-content: space-between; }
.le-deal-main { flex: 1 1 300px; font-size: 13.5px; display: grid; gap: 3px; }
/* 站点行：favicon + 域名 + 位置徽章 同一行 */
.le-deal-site { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }
.le-deal-url { word-break: break-all; }
.le-deal-target { word-break: break-all; }
.le-deal-anchor { word-break: break-all; }
/* 信息前缀标签（目标网址 / 锚文本），淡灰小字 */
.le-deal-label { margin-right: 4px; color: #98a2b3; }

/* 出售方（发布方）视角：需挂链接 / 锚文本 指令行（琥珀色强调）+ 一键复制（链接 / 锚文本）+ 完整 HTML 代码复制 */
.le-deal-need { display: flex; align-items: center; flex-wrap: wrap; gap: 2px 6px; }
.le-deal-need .le-need-label { margin-right: 0; color: #b45309; font-weight: 600; }
.le-need-val { color: var(--ri-body-color, #212529); font-weight: 600; }
.le-need-extra { white-space: nowrap; }
.le-copy-mini {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: 1px solid var(--ri-border-color, #dee2e6);
    border-radius: 6px;
    background: #fff;
    color: #667085;
    font-size: 12px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.le-copy-mini:hover { color: var(--ri-primary, #0d6efd); border-color: var(--ri-primary, #0d6efd); }
.le-deal-code { margin-top: 2px; }
.le-copy-code {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border: 1px dashed var(--ri-border-color, #dee2e6);
    border-radius: 6px;
    background: #f8f9fa;
    color: #475467;
    font-size: 12px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}
.le-copy-code:hover { color: var(--ri-primary, #0d6efd); border-color: var(--ri-primary, #0d6efd); }
.le-deal-side { flex: 0 0 auto; display: grid; gap: 4px; align-content: start; font-size: 12.5px; }
.le-deal-credits { font-size: 15px; font-weight: 700; color: #dc3545; }
/* 发布方交易行到手净额下方的毛额/佣金补充说明 */
.le-deal-fee-note { font-size: 11.5px; font-weight: 600; color: var(--ri-secondary-color, #6c757d); margin-top: 2px; }
/* 定价表单中的平台抽佣提示（复用 le-dim 行，额外金棕色调） */
.le-comm-tip { color: #b8860b; }
.le-deal-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* 无操作按钮时（如已完成单）不占底部间距 */
.le-deal-actions:not(:has(*)) { margin-top: 0; }

/* 托管冻结（租期未到）标记与汇总条 */
.le-deal-escrow { color: #9a6700; }
.le-escrow-sum {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 12px;
    padding: 8px 12px;
    font-size: 12.5px;
    color: #9a6700;
    background: rgba(247, 195, 46, .14);
    border: 1px dashed rgba(247, 195, 46, .55);
    border-radius: 8px;
}

.le-detect { display: flex; align-items: center; gap: 4px; font-size: 12.5px; }
.le-detect.is-ok { color: var(--ri-success, #198754); }
.le-detect.is-bad { color: var(--ri-danger, #dc3545); }

/* ============================================================
 * 交易维护（后台关闭「开启交易」时）
 * 列表保留但模糊降透明度并由维护卡遮挡；站点 / 链接位管理入口不受影响
 * ============================================================ */
.le-list-wrap { position: relative; }
.le-list-wrap.is-maint .le-list { filter: blur(2px); opacity: .42; pointer-events: none; user-select: none; }
.le-maint {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 46px 16px;
    background: linear-gradient(180deg, rgba(245, 247, 252, .6), rgba(245, 247, 252, .18));
    border-radius: 12px;
}
.le-maint--standalone { position: static; margin-top: 16px; padding: 0; background: none; }
.le-maint-card {
    width: 100%;
    max-width: 460px;
    margin: 0 auto;
    padding: 24px 26px;
    text-align: center;
    background: rgba(255, 255, 255, .97);
    border: 1px solid #e2eaf5;
    border-radius: 16px;
    box-shadow: 0 18px 42px -18px rgba(15, 23, 42, .28);
}
.le-maint-ic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    font-size: 18px;
    color: #b8860b;
    background: rgba(247, 195, 46, .16);
    border-radius: 12px;
}
.le-maint-title { margin: 0 0 6px; font-size: 17px; font-weight: 700; color: #0f172a; }
.le-maint-desc { margin: 0; font-size: 13px; line-height: 1.75; color: #64748b; }
/* 详情页维护提示 */
.le-side-maint { margin: 10px 0 0; font-size: 12px; line-height: 1.7; color: #9a6700; }
/* 用户中心友链交易面板维护提示 */
.le-uc-maint {
    margin-bottom: 14px;
    padding: 10px 14px;
    font-size: 12.5px;
    line-height: 1.7;
    color: #9a6700;
    background: rgba(247, 195, 46, .14);
    border: 1px dashed rgba(247, 195, 46, .55);
    border-radius: 8px;
}

/* ============================================================
 * 响应式
 * ============================================================ */
@media (max-width: 767.98px) {
    .le-filter-actions { margin-left: 0; width: 100%; }
    .le-detail-body { padding-top: 26px; }
    .le-row { flex-wrap: wrap; gap: 10px 14px; }
    .le-row-main { flex: 1 1 100%; }
    .le-row-side { flex-direction: row; align-items: baseline; gap: 12px; margin-left: auto; min-width: 0; }
    .le-row-arrow { display: none; }
    .le-side-card { position: static; }
    .le-detail-dl > div { flex-direction: column; gap: 2px; }
    .le-detail-dl dt { flex: none; }
    .le-deal-actions .btn { flex: 1 1 auto; }
    .le-list-head { margin-top: 12px; }
    .le-pick { padding-left: 12px; }
    .le-pickbar { left: 12px; right: 12px; bottom: 12px; justify-content: space-between; transform: none; border-radius: 14px; }
    .le-maint { padding: 20px 12px; }
    .le-maint-card { padding: 20px 18px; }
}
