/*
 * LinsGeek ERP —— Mercado Livre「广告」页面样式（配合 49-ml-ads.js；按钮 / 提示沿用 44-ml-questions.css 的 .mlq-btn / .mlq-link，更新时间条沿用 46 的 .lg-ml-sched）
 * 和 48「店铺信誉」同一套配色、圆角、表格样式；窄屏表格横向滑动，第一列固定在左边。
 * 回滚：删除 49-ml-ads.css + 49-ml-ads.js。
 */
#lg-mlad {
  --s-brand: #0d7b6d; --s-bright: #13b8a6; --s-soft: #e7f2f0; --s-ink: #0f1a18; --s-muted: #6b7a77; --s-line: rgba(15, 35, 30, .08); --s-grid: #e6ecea;
  --c-cost: #f08b2c; --c-sales: #0d7b6d; --c-good: #1f7a40; --c-good-bg: #dcf3e4; --c-warn: #9a5b0b; --c-warn-bg: #fff4e2;
  --s-danger: #d64545; --s-danger-bg: #fdecec; --c-purple: #5b47a8;
  font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  color: var(--s-ink); padding: 4px 0 40px; min-width: 0;
}
#lg-mlad *, #lg-mlad *::before, #lg-mlad *::after { box-sizing: border-box; }
#lg-mlad svg { width: 16px; height: 16px; flex: 0 0 auto; }

/* 标题 */
#lg-mlad .mlad-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
#lg-mlad .mlad-title { min-width: 0; flex: 1 1 420px; }
#lg-mlad .mlad-title h1 { margin: 0; display: flex; align-items: center; gap: 10px; font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
#lg-mlad .mlad-title h1 svg { width: 30px; height: 30px; padding: 6px; border-radius: 10px; color: #fff; background: linear-gradient(135deg, #0d7b6d, #13b8a6); }
#lg-mlad .mlad-title p { margin: 6px 0 0; color: var(--s-muted); font-size: 13.5px; line-height: 1.55; max-width: 820px; }
#lg-mlad .mlad-actions { display: flex; gap: 8px; flex-wrap: wrap; }
#lg-mlad .mlad-how { margin: 0 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--s-soft); color: #23413c; font-size: 13.5px; line-height: 1.7; }
#lg-mlad .mlad-how[hidden] { display: none; }
#lg-mlad .mlad-how p { margin: 0 0 8px; }
#lg-mlad .mlad-how ul { margin: 0 0 8px; padding-left: 20px; list-style: disc; }
#lg-mlad .mlad-how li { list-style: disc; }

/* 筛选 */
#lg-mlad .mlad-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 10px; }
#lg-mlad .mlad-frow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
#lg-mlad .mlad-range { flex-basis: 100%; color: var(--s-muted); font-size: 12px; }
#lg-mlad .mlad-select { font: inherit; font-size: 13.5px; height: 34px; padding: 0 10px; border-radius: 10px; border: 1px solid #dfe6e4; background: #fff; min-width: 220px; max-width: 100%; outline: none; color: var(--s-ink); }
#lg-mlad .mlad-select.sm { min-width: 180px; height: 32px; font-size: 13px; }
#lg-mlad .mlad-select:focus, #lg-mlad .mlad-custom input:focus, #lg-mlad .mlad-search:focus-within { border-color: var(--s-bright); box-shadow: 0 0 0 3px rgba(19,184,166,.15); }
#lg-mlad .mlad-seg { display: inline-flex; padding: 3px; border-radius: 10px; background: #eef2f1; gap: 2px; }
#lg-mlad .mlad-seg button { all: unset; cursor: pointer; padding: 0 12px; height: 28px; line-height: 28px; border-radius: 8px; font-size: 12.5px; font-weight: 700; color: #4b5a57; font-family: inherit; }
#lg-mlad .mlad-seg button.on { background: #fff; color: var(--s-brand); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
#lg-mlad .mlad-seg button:focus-visible { outline: 2px solid var(--s-bright); }
#lg-mlad .mlad-chips { display: flex; gap: 4px; flex-wrap: wrap; min-width: 0; }
#lg-mlad .mlad-chip { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 999px; font-size: 13px; font-weight: 600; color: #4b5a57; background: #fff; border: 1px solid #dfe6e4; white-space: nowrap; font-family: inherit; }
#lg-mlad .mlad-chip:hover { border-color: rgba(19,184,166,.5); }
#lg-mlad .mlad-chip.on { background: var(--s-soft); border-color: transparent; color: var(--s-brand); }
#lg-mlad .mlad-chip i { font-style: normal; font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #eef2f1; color: #4b5a57; }
#lg-mlad .mlad-chip.on i { background: var(--s-brand); color: #fff; }
#lg-mlad .mlad-chip.hot i { background: var(--s-danger-bg); color: var(--s-danger); }
#lg-mlad .mlad-chip:focus-visible { outline: 2px solid var(--s-bright); outline-offset: 1px; }
#lg-mlad .mlad-custom { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--s-muted); }
#lg-mlad .mlad-custom input { font: inherit; font-size: 13px; height: 32px; padding: 0 8px; border-radius: 10px; border: 1px solid #dfe6e4; background: #fff; outline: none; color: var(--s-ink); }

/* 没开通 / 刚授权的店铺提示 */
#lg-mlad .mlad-notes:empty { display: none; }
#lg-mlad .mlad-notes { display: grid; gap: 4px; margin-bottom: 12px; }
#lg-mlad .mlad-notes p { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: #4b5a57; line-height: 1.5; }
#lg-mlad .mlad-notes svg { width: 14px; height: 14px; margin-top: 2px; color: #8a9895; }

/* 标签 */
#lg-mlad .mlad-tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--s-grid); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; scroll-margin-top: 80px; }
#lg-mlad .mlad-tabs:empty { display: none; }
#lg-mlad .mlad-tabs::-webkit-scrollbar { display: none; }
#lg-mlad .mlad-tab { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; font-size: 14px; font-weight: 600; color: #5b6a67; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; font-family: inherit; }
#lg-mlad .mlad-tab:hover { color: var(--s-ink); }
#lg-mlad .mlad-tab.on { color: var(--s-brand); border-bottom-color: var(--s-brand); }
#lg-mlad .mlad-tab i { font-style: normal; font-size: 11.5px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #e08a12; color: #fff; }
#lg-mlad .mlad-tab:focus-visible { outline: 2px solid var(--s-bright); outline-offset: -2px; }
#lg-mlad .mlad-body.busy, #lg-mlad .busy { opacity: .55; transition: opacity .15s; pointer-events: none; }

/* 状态 */
#lg-mlad .mlad-state { text-align: center; padding: 40px 16px; color: var(--s-muted); font-size: 14px; }
#lg-mlad .mlad-block { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 56px 20px; background: #fff; border: 1px dashed #d3dcda; border-radius: 16px; }
#lg-mlad .mlad-block.sm { border: 0; padding: 40px 20px; }
#lg-mlad .mlad-block svg { width: 40px; height: 40px; padding: 9px; border-radius: 12px; background: var(--s-soft); color: var(--s-brand); }
#lg-mlad .mlad-block b { font-size: 16px; }
#lg-mlad .mlad-block p { margin: 0; max-width: 520px; color: var(--s-muted); font-size: 13.5px; line-height: 1.6; }
#lg-mlad .mlad-dash { color: #b8c2bf; }

/* 赠金提醒条 */
#lg-mlad .mlad-alert { all: unset; box-sizing: border-box; cursor: pointer; width: 100%; display: flex; align-items: center; gap: 10px; padding: 11px 16px; margin-bottom: 12px; border-radius: 14px; background: var(--s-danger-bg); color: #a42f2f; font-size: 13.5px; font-weight: 600; font-family: inherit; border: 1px solid rgba(214,69,69,.18); }
#lg-mlad .mlad-alert:hover { border-color: rgba(214,69,69,.4); }
#lg-mlad .mlad-alert:focus-visible { outline: 2px solid var(--s-danger); outline-offset: 2px; }
#lg-mlad .mlad-alert > span { flex: 1 1 auto; min-width: 0; }
#lg-mlad .mlad-alert em { font-style: normal; display: inline-flex; align-items: center; gap: 2px; font-size: 13px; white-space: nowrap; }
#lg-mlad .mlad-alert em svg { width: 14px; height: 14px; }

/* 数字卡片 */
#lg-mlad .mlad-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
#lg-mlad .mlad-kpi { display: flex; flex-direction: column; gap: 2px; padding: 12px 16px; border-radius: 16px; background: #fff; border: 1px solid var(--s-line); min-width: 0; }
#lg-mlad .mlad-kpi > span { font-size: 13px; color: var(--s-muted); }
#lg-mlad .mlad-kpi > b { font-size: 24px; line-height: 1.2; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lg-mlad .mlad-kpi-f { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; min-width: 0; }
#lg-mlad .mlad-kpi-f small { font-size: 12px; color: var(--s-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#lg-mlad .mlad-kpi.k-cost { box-shadow: inset 3px 0 0 var(--c-cost); }
#lg-mlad .mlad-kpi.k-sales { box-shadow: inset 3px 0 0 var(--c-sales); }
#lg-mlad .mlad-kpi.k-roas { background: linear-gradient(135deg, #f1faf8, #fff); }
#lg-mlad .mlad-kpi.k-roas > b { color: var(--s-brand); }
#lg-mlad .mlad-delta { font-style: normal; font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums; }
#lg-mlad .mlad-delta.good { color: var(--c-good); }
#lg-mlad .mlad-delta.bad { color: var(--s-danger); }
#lg-mlad .mlad-delta.flat, #lg-mlad .mlad-delta.none { color: #8a9895; }

/* 卡片 */
#lg-mlad .mlad-card { background: #fff; border: 1px solid var(--s-line); border-radius: 16px; min-width: 0; }
#lg-mlad .mlad-card > header { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 16px 4px; }
#lg-mlad .mlad-card h2 { margin: 0; display: flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 700; }
#lg-mlad .mlad-card h2 svg { width: 16px; height: 16px; color: #e08a12; }
#lg-mlad .mlad-card h2 i { font-style: normal; font-size: 11.5px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; display: inline-flex; align-items: center; justify-content: center; background: #fdf0dc; color: #9a5b0b; }
#lg-mlad .mlad-grid2 { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(300px, 1fr); gap: 12px; align-items: start; }
#lg-mlad .mlad-legend { display: flex; gap: 12px; font-size: 12px; color: #4b5a57; flex-wrap: wrap; }
#lg-mlad .mlad-legend span { display: inline-flex; align-items: center; gap: 5px; }
#lg-mlad .lg-cost, #lg-mlad .lg-sales, .mlad-tip .lg-cost, .mlad-tip .lg-sales { display: inline-block; width: 10px; height: 10px; border-radius: 3px; }
#lg-mlad .lg-cost, .mlad-tip .lg-cost { background: #f6b46f; }
#lg-mlad .lg-sales, .mlad-tip .lg-sales { background: transparent; height: 3px; border-radius: 2px; box-shadow: inset 0 0 0 2px #0d7b6d; width: 14px; }

/* 图表 */
#lg-mlad .mlad-chart { position: relative; display: grid; grid-template-columns: 64px minmax(0, 1fr); grid-template-rows: 220px 22px; padding: 10px 16px 10px 4px; }
#lg-mlad .mlad-chart.mini { grid-template-rows: 150px 20px; padding: 6px 4px 4px 0; grid-template-columns: 58px minmax(0, 1fr); }
#lg-mlad .mlad-yl { position: relative; grid-row: 1; }
#lg-mlad .mlad-yl span { position: absolute; right: 8px; transform: translateY(50%); font-size: 11px; color: #8a9895; white-space: nowrap; font-variant-numeric: tabular-nums; }
#lg-mlad .mlad-plot { position: relative; grid-row: 1; grid-column: 2; border-bottom: 1px solid #cfd9d6; cursor: crosshair; touch-action: pan-y; }
#lg-mlad .mlad-plot > i { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed #e6ecea; }
#lg-mlad .mlad-plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
#lg-mlad .mlad-plot .bars rect { fill: #f6b46f; }
#lg-mlad .mlad-plot .line { fill: none; stroke: #0d7b6d; stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
#lg-mlad .mlad-hl { position: absolute; top: 0; bottom: 0; background: rgba(13,123,109,.08); border-radius: 3px; pointer-events: none; }
#lg-mlad .mlad-hl[hidden] { display: none; }
#lg-mlad .mlad-xl { position: relative; grid-row: 2; grid-column: 2; }
#lg-mlad .mlad-xl span { position: absolute; top: 5px; transform: translateX(-50%); font-size: 11px; color: #8a9895; white-space: nowrap; font-variant-numeric: tabular-nums; }
.mlad-tip { position: fixed; z-index: 3000; pointer-events: none; min-width: 168px; padding: 9px 12px; border-radius: 12px; background: rgba(15,26,24,.94); color: #fff; font-size: 12px; line-height: 1.7; box-shadow: 0 10px 30px -10px rgba(0,0,0,.4); font-family: 'Noto Sans SC', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif; }
.mlad-tip[hidden] { display: none; }
.mlad-tip b { display: block; font-size: 12.5px; margin-bottom: 2px; }
.mlad-tip span { display: flex; align-items: center; gap: 6px; }
.mlad-tip em { font-style: normal; margin-left: auto; padding-left: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.mlad-tip .lg-sales { box-shadow: inset 0 0 0 2px #5fe0cd; }

/* 需要注意 */
#lg-mlad .mlad-issues { align-self: stretch; }
#lg-mlad .mlad-issue-list { list-style: none; margin: 0; padding: 4px 8px 8px; }
#lg-mlad .mlad-issue-list li { display: flex; gap: 10px; padding: 10px 8px; border-bottom: 1px solid var(--s-grid); }
#lg-mlad .mlad-issue-list li:last-child { border-bottom: 0; }
#lg-mlad .mlad-issue-ic { width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; flex: 0 0 auto; background: var(--c-warn-bg); color: #c47812; }
#lg-mlad .is-bonus .mlad-issue-ic, #lg-mlad .is-noOrders .mlad-issue-ic, #lg-mlad .is-lowRoas .mlad-issue-ic { background: var(--s-danger-bg); color: var(--s-danger); }
#lg-mlad .is-budget .mlad-issue-ic { background: var(--c-good-bg); color: var(--c-good); }
#lg-mlad .mlad-issue-list li > div { min-width: 0; flex: 1 1 auto; }
#lg-mlad .mlad-issue-h { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
#lg-mlad .mlad-issue-h b { font-size: 13.5px; }
#lg-mlad .mlad-issue-h small { font-size: 12px; color: var(--s-muted); }
#lg-mlad .mlad-issue-list p { margin: 3px 0 4px; font-size: 13px; line-height: 1.55; color: #3c4a47; overflow-wrap: anywhere; }
#lg-mlad .mlad-issue-a { display: flex; gap: 14px; flex-wrap: wrap; }
#lg-mlad .mlad-ok { margin: 0; padding: 28px 16px; text-align: center; color: var(--c-good); font-size: 13.5px; }
#lg-mlad .mlad-more { margin: 0; padding: 0 16px 14px; font-size: 12px; color: var(--s-muted); line-height: 1.5; }

/* 表格面板 */
#lg-mlad .mlad-panel { overflow: hidden; }
#lg-mlad .mlad-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--s-grid); flex-wrap: wrap; }
#lg-mlad .mlad-bar-r { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; min-width: 0; }
#lg-mlad .mlad-search { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 10px; border-radius: 10px; border: 1px solid #dfe6e4; background: #fff; min-width: 220px; color: #8a9895; }
#lg-mlad .mlad-search input { all: unset; flex: 1 1 auto; min-width: 0; font-size: 13px; color: var(--s-ink); font-family: inherit; }
#lg-mlad .mlad-tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
#lg-mlad .mlad-tablewrap:focus-visible { outline: 2px solid var(--s-bright); outline-offset: -2px; }
#lg-mlad .mlad-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
#lg-mlad .t-camp { min-width: 1180px; }
#lg-mlad .t-group { min-width: 1320px; }
#lg-mlad .t-bonus { min-width: 980px; }
#lg-mlad .mlad-table th, #lg-mlad .mlad-table td { padding: 10px 12px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--s-grid); background: #fff; }
#lg-mlad .mlad-table thead th { position: sticky; top: 0; z-index: 2; background: #f6f9f8; color: #4b5a57; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
#lg-mlad .mlad-table th.s button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 3px; font: inherit; color: inherit; }
#lg-mlad .mlad-table th.s button svg { width: 12px; height: 12px; opacity: .35; }
#lg-mlad .mlad-table th.s.on { color: var(--s-brand); }
#lg-mlad .mlad-table th.s.on button svg { opacity: 1; }
#lg-mlad .mlad-table th.s.on.desc button svg path:first-child, #lg-mlad .mlad-table th.s.on.asc button svg path:last-child { opacity: .25; }
#lg-mlad .mlad-table th.s button:focus-visible { outline: 2px solid var(--s-bright); outline-offset: 2px; border-radius: 4px; }
#lg-mlad .mlad-table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#lg-mlad .mlad-table th.num button { flex-direction: row-reverse; }
#lg-mlad .mlad-table .nowrap { white-space: nowrap; }
#lg-mlad .mlad-table td small { display: block; color: var(--s-muted); font-size: 11.5px; margin-top: 2px; }
#lg-mlad .mlad-table tbody tr[data-crow], #lg-mlad .mlad-table tbody tr[data-grow] { cursor: pointer; }
#lg-mlad .mlad-table tbody tr[data-crow]:hover td, #lg-mlad .mlad-table tbody tr[data-grow]:hover td { background: #f8fbfa; }
#lg-mlad .mlad-table tbody tr.open td { background: #f6faf9; border-bottom-color: transparent; }
#lg-mlad .mlad-table tbody tr:last-child td { border-bottom: 0; }
#lg-mlad .mlad-table .c0 { position: sticky; left: 0; z-index: 1; min-width: 220px; max-width: 280px; box-shadow: 1px 0 0 var(--s-grid); }
#lg-mlad .t-group .c0 { min-width: 300px; max-width: 340px; }
#lg-mlad .mlad-table thead .c0 { z-index: 3; }
#lg-mlad .mlad-table tr.r-flag td.c0 { box-shadow: inset 3px 0 0 #f0a13a, 1px 0 0 var(--s-grid); }
#lg-mlad .mlad-table td b.bad, #lg-mlad .mlad-table td .bad { color: var(--s-danger); }
#lg-mlad .mlad-tstate { text-align: center; padding: 36px 16px; color: var(--s-muted); font-size: 14px; }
#lg-mlad .mlad-pager { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px; border-top: 1px solid var(--s-grid); font-size: 12.5px; color: var(--s-muted); }
#lg-mlad .mlad-pager .mlq-btn[disabled] { opacity: .4; pointer-events: none; }

#lg-mlad .mlad-name, #lg-mlad .mlad-item { display: flex; align-items: center; gap: 8px; min-width: 0; }
#lg-mlad .mlad-name > div, #lg-mlad .mlad-item > div { min-width: 0; }
#lg-mlad .mlad-name b, #lg-mlad .mlad-item b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; font-weight: 700; font-size: 13.5px; line-height: 1.35; overflow-wrap: anywhere; }
#lg-mlad .mlad-name small { display: flex !important; align-items: center; gap: 6px; flex-wrap: wrap; }
#lg-mlad .mlad-item small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lg-mlad .mlad-item .mlad-camp { color: #8a9895; }
#lg-mlad .mlad-chev { width: 16px; height: 16px; flex: 0 0 auto; color: #8a9895; transition: transform .15s; display: inline-flex; }
#lg-mlad tr.open .mlad-chev { transform: rotate(90deg); color: var(--s-brand); }
#lg-mlad .mlad-thumb { width: 40px; height: 40px; border-radius: 9px; flex: 0 0 auto; object-fit: cover; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 16px; background: #13b8a6; }
#lg-mlad .mlad-thumb.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 12px; }
#lg-mlad .mlad-st { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: #eef2f1; color: #5b6a67; }
#lg-mlad .mlad-st.st-active { background: var(--c-good-bg); color: var(--c-good); }
#lg-mlad .mlad-st.st-hold { background: var(--c-warn-bg); color: var(--c-warn); cursor: help; }
#lg-mlad .mlad-st.st-idle { cursor: help; }

/* ROAS 对比目标 */
#lg-mlad .c-roas { min-width: 140px; }
#lg-mlad .mlad-roas { display: flex; align-items: baseline; gap: 4px; }
#lg-mlad .mlad-roas b { font-size: 14px; font-variant-numeric: tabular-nums; }
#lg-mlad .mlad-roas small { display: inline !important; margin: 0 !important; }
#lg-mlad .mlad-roas.good b { color: var(--c-good); }
#lg-mlad .mlad-roas.mid b { color: #a06a00; }
#lg-mlad .mlad-roas.bad b { color: var(--s-danger); }
#lg-mlad .mlad-rbar { position: relative; display: block; height: 6px; margin-top: 6px; max-width: 120px; border-radius: 999px; background: #eef2f1; }
#lg-mlad .mlad-rbar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: #9ccfc6; }
#lg-mlad .mlad-roas.good + .mlad-rbar i { background: #5cc08a; }
#lg-mlad .mlad-roas.mid + .mlad-rbar i { background: #f2c230; }
#lg-mlad .mlad-roas.bad + .mlad-rbar i { background: #ee8a84; }
#lg-mlad .mlad-rbar em { position: absolute; top: -3px; bottom: -3px; width: 2px; margin-left: -1px; background: var(--s-ink); border-radius: 1px; }

/* 曝光份额 */
#lg-mlad .c-share { min-width: 190px; }
#lg-mlad .mlad-sbar { display: flex; height: 8px; border-radius: 999px; overflow: hidden; background: #eef2f1; max-width: 160px; }
#lg-mlad .mlad-sbar i { display: block; height: 100%; }
#lg-mlad .s-won { background: #13b8a6; }
#lg-mlad .s-budget { background: #f6b46f; }
#lg-mlad .s-rank { background: #b9a9ec; }
#lg-mlad .mlad-share small { display: flex !important; align-items: center; gap: 4px; flex-wrap: wrap; margin-top: 4px !important; }
#lg-mlad .mlad-share small b { color: var(--s-ink); }
#lg-mlad .mlad-share em.w { font-style: normal; display: inline-flex; align-items: center; gap: 2px; color: var(--c-warn); font-weight: 600; }
#lg-mlad .mlad-share em.w svg { width: 12px; height: 12px; }

/* 问题标签 */
#lg-mlad .mlad-flags { display: flex; gap: 4px; flex-wrap: wrap; }
#lg-mlad .mlad-flag { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; background: var(--c-warn-bg); color: var(--c-warn); }
#lg-mlad .mlad-flag svg { width: 12px; height: 12px; }
#lg-mlad .mlad-flag.f-budget { background: var(--c-good-bg); color: var(--c-good); }
#lg-mlad .mlad-flag.f-lowRoas, #lg-mlad .mlad-flag.f-noOrders { background: var(--s-danger-bg); color: var(--s-danger); }

/* 展开详情 */
#lg-mlad tr.mlad-detail > td { background: #f6faf9; padding: 4px 16px 18px; }
#lg-mlad .mlad-detail-in { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); gap: 16px; position: sticky; left: 0; max-width: calc(100vw - 300px); min-width: 0; }
#lg-mlad .mlad-dchart, #lg-mlad .mlad-dside { background: #fff; border: 1px solid var(--s-line); border-radius: 12px; padding: 10px 12px; min-width: 0; }
#lg-mlad .mlad-dside { display: flex; flex-direction: column; gap: 8px; }
#lg-mlad .mlad-dh { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
#lg-mlad .mlad-dh b { font-size: 13.5px; }
#lg-mlad .mlad-why { display: flex; gap: 6px; align-items: flex-start; margin: 0; padding: 8px 10px; border-radius: 10px; font-size: 12.5px; line-height: 1.55; background: var(--c-warn-bg); color: #6b4a12; }
#lg-mlad .mlad-why svg { width: 14px; height: 14px; margin-top: 2px; }
#lg-mlad .mlad-why.f-budget { background: #eaf7ef; color: #1f5a34; }
#lg-mlad .mlad-why.f-lowRoas, #lg-mlad .mlad-why.f-noOrders { background: var(--s-danger-bg); color: #8f2a2a; }
#lg-mlad .mlad-mini-list { list-style: none; margin: 0; padding: 0; }
#lg-mlad .mlad-mini-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--s-grid); }
#lg-mlad .mlad-mini-list li:last-child { border-bottom: 0; }
#lg-mlad .mlad-mini-list .mlad-thumb { grid-row: 1 / 3; }
#lg-mlad .mlad-mini-list span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#lg-mlad .mlad-mini-list em { font-style: normal; font-size: 12.5px; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
#lg-mlad .mlad-mini-list small { grid-column: 3; text-align: right; margin: 0 !important; }
#lg-mlad .mlad-note { display: flex; gap: 6px; align-items: flex-start; margin: 2px 0 0; font-size: 11.5px; color: var(--s-muted); line-height: 1.5; }
#lg-mlad .mlad-note svg { width: 13px; height: 13px; margin-top: 2px; }
#lg-mlad .mlad-subwrap { overflow-x: auto; }
#lg-mlad .mlad-sub { width: 100%; border-collapse: collapse; font-size: 12.5px; }
#lg-mlad .mlad-sub th, #lg-mlad .mlad-sub td { padding: 6px 8px; border-bottom: 1px solid var(--s-grid); text-align: left; background: #fff; }
#lg-mlad .mlad-sub th { font-size: 11.5px; color: var(--s-muted); font-weight: 700; white-space: nowrap; }
#lg-mlad .mlad-sub .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
#lg-mlad .mlad-sub tr:last-child td { border-bottom: 0; }
#lg-mlad .mlad-links { display: flex; gap: 16px; flex-wrap: wrap; padding-top: 2px; }
#lg-mlad .mlad-links a.mlq-link { text-decoration: none; }
#lg-mlad .mlad-links svg { width: 14px; height: 14px; }

/* 赠金 */
#lg-mlad .mlad-btype { display: flex; gap: 8px; align-items: flex-start; }
#lg-mlad .mlad-btype > svg { width: 28px; height: 28px; padding: 6px; border-radius: 8px; background: #f3effc; color: var(--c-purple); }
#lg-mlad .mlad-btype b { cursor: help; }
#lg-mlad .mlad-stuck { display: flex !important; gap: 4px; align-items: flex-start; color: var(--c-warn) !important; line-height: 1.4; white-space: normal; }
#lg-mlad .mlad-stuck svg { width: 12px; height: 12px; margin-top: 1px; }
#lg-mlad .c-bal b { font-variant-numeric: tabular-nums; }
#lg-mlad .mlad-used { display: block; height: 5px; margin: 5px 0 0 auto; width: 90px; border-radius: 999px; background: #ebeef0; overflow: hidden; }
#lg-mlad .mlad-used i { display: block; height: 100%; background: #8f7fd6; } /* 条 = 还剩多少余额 */
#lg-mlad .mlad-bstate { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap; }
#lg-mlad .mlad-bstate.s-expiring { background: var(--s-danger-bg); color: var(--s-danger); }
#lg-mlad .mlad-bstate.s-active { background: var(--c-good-bg); color: var(--c-good); }
#lg-mlad .mlad-bstate.s-used, #lg-mlad .mlad-bstate.s-expired { background: #eef2f1; color: #8a9895; }
#lg-mlad .t-bonus tr.b-used td, #lg-mlad .t-bonus tr.b-expired td { color: #8a9895; }
#lg-mlad .t-bonus tr.b-expiring td.c0 { box-shadow: inset 3px 0 0 var(--s-danger), 1px 0 0 var(--s-grid); }
#lg-mlad .t-bonus tr.b-stuck td.c0 { box-shadow: inset 3px 0 0 #f0a13a, 1px 0 0 var(--s-grid); }

/* 菜单：复制出来的「广告」在本页时高亮；本页时原 Shopee 项不高亮 */
aside [data-lg-mlad-item] div.lg-mlad-active { background: #E8F8F6 !important; color: #0d7b6d; }
body.lg-mlad-on aside li:not([data-lg-mlad-item]) > a .\!bg-\[\#E8F8F6\] { background: transparent !important; }
.lg-mlad-badge { background: #e08a12 !important; }
.lg-mlad-badge[hidden] { display: none !important; }

/* 窄屏 */
@media (max-width: 1280px) {
  #lg-mlad .mlad-grid2 { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1180px) {
  #lg-mlad .mlad-kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  #lg-mlad .mlad-detail-in { grid-template-columns: minmax(0, 1fr); max-width: calc(100vw - 48px); }
}
@media (max-width: 720px) {
  #lg-mlad .mlad-title h1 { font-size: 20px; }
  #lg-mlad .mlad-actions { width: 100%; }
  #lg-mlad .mlad-actions .mlq-btn { flex: 1 1 0; }
  #lg-mlad .mlad-filters { gap: 8px; }
  #lg-mlad .mlad-frow { width: 100%; }
  #lg-mlad .mlad-select { width: 100%; min-width: 0; }
  #lg-mlad .mlad-frow > .mlad-seg { width: 100%; }
  #lg-mlad .mlad-seg button { flex: 1 1 0; text-align: center; }
  #lg-mlad .mlad-chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; }
  #lg-mlad .mlad-chips::-webkit-scrollbar { display: none; }
  #lg-mlad .mlad-custom { width: 100%; }
  #lg-mlad .mlad-custom input { flex: 1 1 0; min-width: 0; }
  #lg-mlad .mlad-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #lg-mlad .mlad-kpi { padding: 10px 12px; }
  #lg-mlad .mlad-kpi > b { font-size: 19px; }
  #lg-mlad .mlad-kpi-f { flex-direction: column; align-items: flex-start; gap: 0; }
  #lg-mlad .mlad-kpi-f small { max-width: 100%; }
  #lg-mlad .mlad-chart { grid-template-columns: 52px minmax(0, 1fr); grid-template-rows: 180px 22px; padding-right: 10px; }
  #lg-mlad .mlad-bar { flex-direction: column; align-items: stretch; }
  #lg-mlad .mlad-bar-r { flex-direction: column; align-items: stretch; }
  #lg-mlad .mlad-search, #lg-mlad .mlad-select.sm { width: 100%; min-width: 0; }
  #lg-mlad .mlad-table .c0 { min-width: 160px; max-width: 180px; }
  #lg-mlad .t-group .c0 { min-width: 200px; max-width: 210px; }
  #lg-mlad .mlad-item .mlad-thumb { width: 32px; height: 32px; }
  #lg-mlad tr.mlad-detail > td { padding: 4px 8px 14px; }
  #lg-mlad .mlad-detail-in { max-width: calc(100vw - 32px); }
  #lg-mlad .mlad-alert { align-items: flex-start; }
  #lg-mlad .mlad-alert em { display: none; }
}
