/* ==========================================================================
   报表 · 馆掌移动端版式（1:1 复刻馆掌「营业统计」，2026-11-06 定稿）
   --------------------------------------------------------------------------
   为什么会单独有这个文件：
     mobile.css 会把 table.tb 自动拆成「标签 : 值」的卡片，那是给列表用的；
     报表是「业务 × 收款方式」的矩阵，拆成卡片就变成一屏几十行标签，非常凌乱。
     所以报表统一用 table.rp-tb（横向滚动 + 左侧冻结列），必须排在 mobile.css
     之后加载，才能盖住 mobile.css 里 input/select 的 40px 大号规则。

   命名：.rp-*  只被 js/pages/report.js 使用
   ========================================================================== */

.rp-wrap { display: block; overflow-x: clip; }
/* 双栏容器里的表格会把 grid 轨道撑宽（小程序/手机端整页横向滚动就是它）
   → 子项必须 min-width:0，宽表只在自己的 .rp-tbwrap 里滑 */
.rp-wrap .grid2 > *, .rp-wrap .grid3 > * { min-width: 0; }
.rp-wrap .grid2, .rp-wrap .grid3 { min-width: 0; }

/* ---------------- 顶部筛选条 ---------------- */
.rp-bar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: #fff; border-radius: 10px; padding: 10px 12px; margin-bottom: 8px;
}
.rp-dates { display: flex; align-items: center; gap: 6px; flex: 1 1 auto; min-width: 0; }
.rp-dates .rp-lab { font-size: 12.5px; color: #7b8494; white-space: nowrap; }
.rp-dates input[type="date"] {
  flex: 1 1 0; min-width: 0; width: auto; height: 34px; min-height: 34px;
  border: 1px solid #e6e9ef; border-radius: 8px; padding: 0 8px;
  font-size: 13.5px; color: #1a1a1a; background: #fff; outline: none;
  font-family: var(--f); -webkit-appearance: none; appearance: none;
}
.rp-dates input[type="date"]:focus { border-color: var(--pri); }
.rp-ops { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.rp-ops .btn { height: 34px; min-height: 34px; font-size: 13px; padding: 0 12px; border-radius: 8px; }

/* 馆掌那两个下拉开关（是否显示退款 / 是否统计赠送金额） */
.rp-flags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; width: 100%; }
.rp-chip {
  display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 4px 0 10px;
  background: #f4f6fa; border-radius: 8px; font-size: 12.5px; color: #5b6472; white-space: nowrap;
}
.rp-chip select {
  height: 26px; min-height: 26px; border: 0; background: transparent; color: #1a1a1a;
  font-size: 12.5px; font-weight: 600; padding: 0 6px 0 0; margin-right: 2px;
  outline: none; font-family: var(--f);
}

/* ---------------- 区块 ---------------- */
.rp-sec { background: #fff; border-radius: 10px; padding: 14px 12px 12px; margin-bottom: 8px; }
.rp-sec-h { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-bottom: 11px; }
.rp-sec-h b { font-size: 15px; font-weight: 700; color: #1a1a1a; letter-spacing: -.2px; }
.rp-sec-h i { font-style: normal; font-size: 11.5px; color: #9aa1ad; line-height: 1.4; }
.rp-sec-h .rp-more { margin-left: auto; font-size: 11.5px; color: var(--pri); }

/* ---------------- 数据格（馆掌那种浅蓝灰小卡） ---------------- */
.rp-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
/* 3 个一排是馆掌默认；只有 4 格時排 2×2，别出现「3 + 1」的孤儿格 */
@media (max-width: 820px) {
  .rp-tiles.n1 { grid-template-columns: 1fr; }
  .rp-tiles.n2, .rp-tiles.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.rp-tile { background: #f4f7fb; border-radius: 6px; padding: 9px 10px 10px; min-width: 0; }
.rp-tile .l {
  font-size: 12px; color: #7b8494; line-height: 1.3; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}
.rp-tile .v {
  margin-top: 5px; font-size: 15px; font-weight: 600; color: #1a1a1a;
  letter-spacing: -.3px; line-height: 1.25; font-variant-numeric: tabular-nums;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rp-tile .v.sm { font-size: 13px; letter-spacing: -.4px; }
.rp-tile .v.xs { font-size: 12px; letter-spacing: -.5px; }
.rp-tile .s { margin-top: 3px; font-size: 10.5px; color: #98a0ae; line-height: 1.35; }
.rp-tile .v .u { font-size: 11px; font-weight: 400; color: #7b8494; margin-left: 2px; }
.rp-tile.hi { background: #fdf3f3; }
.rp-tile.hi .v { color: #cf1322; }

/* ---------------- 报表矩阵（横向滚动 + 左两列冻结） ---------------- */
.rp-tbwrap {
  overflow-x: auto; -webkit-overflow-scrolling: touch;
  margin: 10px -12px 0; padding: 0 0 2px;
}
.rp-tbwrap::-webkit-scrollbar { height: 4px; }
.rp-tbwrap::-webkit-scrollbar-thumb { background: #d7dce4; border-radius: 2px; }
table.rp-tb { width: 100%; border-collapse: collapse; font-size: 13px; }
table.rp-tb th {
  font-weight: 400; color: #8a93a3; text-align: right; padding: 9px 8px;
  background: #fafbfc; border-bottom: 1px solid #eef0f3; white-space: nowrap; font-size: 12px;
}
table.rp-tb td {
  padding: 12px 8px; border-bottom: 1px solid #f3f5f8; text-align: right;
  white-space: nowrap; color: #333; font-variant-numeric: tabular-nums;
}
table.rp-tb th:first-child, table.rp-tb td:first-child { text-align: left; }
table.rp-tb tbody tr:last-child td { border-bottom: 0; }
/* 冻结列：业务 / 子业务（跟馆掌一致，滑到右边也知道自己在看哪一行）
   ⚠ 冻结列必须定宽：table-layout:fixed + 写死 60/82，sticky 的 left 才和列边界对得上，
     否则左列会把「营业额」那列盖掉一半（2026-11-06 踩过） */
table.rp-tb .fk1, table.rp-tb .fk2 { background: #fff; }
table.rp-tb th.fk1, table.rp-tb th.fk2 { background: #fafbfc; }
table.rp-tb td.fk1 { font-weight: 600; color: #1a1a1a; }
table.rp-tb td.fk1, table.rp-tb th.fk1 { padding-left: 12px; }
table.rp-tb tr.sub td.fk1 { background: #fcfdfe; }
table.rp-tb tr.tot td.fk1 { background: #fafbfc; }
@media (max-width: 820px) {
  table.rp-tb.fixed { table-layout: fixed; width: max-content; }
  table.rp-tb.fixed th, table.rp-tb.fixed td { overflow: hidden; text-overflow: ellipsis; }
  table.rp-tb .fk1, table.rp-tb .fk2 { position: sticky; z-index: 2; }
  table.rp-tb th.fk1, table.rp-tb th.fk2 { z-index: 3; }
  table.rp-tb .fk1 { left: 0; }
  table.rp-tb .fk2 { left: 60px; }
  /* 冻结列右边缘用一层淡阴影表示「右边还有内容」，比 1px 线更像原生 App */
  table.rp-tb .fk2 { box-shadow: 6px 0 8px -6px rgba(16, 24, 40, .22); }
}
table.rp-tb tr.sub td { color: #5b6472; background: #fcfdfe; }
table.rp-tb tr.sub td.fk1, table.rp-tb tr.sub td.fk2 { background: #fcfdfe; }
table.rp-tb tr.tot td { font-weight: 700; color: #1a1a1a; background: #fafbfc; }
table.rp-tb tr.tot td.fk1, table.rp-tb tr.tot td.fk2 { background: #fafbfc; }
table.rp-tb td.z { color: #b6bcc6; }   /* 0.00 淡化，弱化噪音 */
table.rp-tb td.empty { text-align: center; color: var(--txt-3); padding: 28px 0; }

/* 非矩阵类报表（会员 / 商品 / 门票 …）同样用 rp-tb，只是列少不冻结 */
.rp-tbwrap.plain { margin: 10px 0 0; padding: 0; }

/* ---------------- 收入构成 / 排行（标签 + 进度条） ---------------- */
.rp-list { display: flex; flex-direction: column; gap: 11px; }
.rp-li-top { display: flex; align-items: baseline; gap: 8px; font-size: 13.5px; }
.rp-li-top .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #1a1a1a; }
.rp-li-top .am { font-weight: 700; font-variant-numeric: tabular-nums; color: #1a1a1a; }
.rp-li-top .pc { font-size: 11.5px; color: #8a93a3; width: 46px; text-align: right; font-variant-numeric: tabular-nums; }
.rp-prog { height: 5px; border-radius: 3px; background: #f0f3f8; margin-top: 6px; overflow: hidden; }
.rp-prog > i { display: block; height: 100%; border-radius: 3px; background: linear-gradient(90deg, #6fa0ff, #2b6ffe); }
.rp-prog > i.g { background: linear-gradient(90deg, #6dd39a, #36a86e); }
.rp-prog > i.o { background: linear-gradient(90deg, #ffc46b, #f0a020); }

/* ---------------- 说明 / 空态 ---------------- */
.rp-note {
  margin-top: 10px; padding: 9px 10px; background: #f7f9fc; border-radius: 6px;
  font-size: 11.5px; color: #7b8494; line-height: 1.65;
}
.rp-note b { color: #5b6472; font-weight: 600; }
/* 旧的 .tipbox 说明块：在灰底页面上改成白卡，别浮着一块蓝底 */
.rp-wrap .tipbox { background: #fff; border: 0; border-radius: 10px; padding: 12px; color: #5b6472; font-size: 12px; }
.rp-wrap .tipbox.warn { background: #fffbe6; color: #8a6116; }
.rp-more { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.rp-more .btn { height: 26px; min-height: 26px; font-size: 12px; padding: 0 9px; border-radius: 7px; }
.rp-empty { text-align: center; color: #b6bcc6; font-size: 12.5px; padding: 26px 0; }
.rp-loading { text-align: center; color: #b6bcc6; font-size: 13px; padding: 34px 0; }
.rp-swipe { font-size: 11px; color: #b0b6c0; }
/* 桌面端所有列都露出来了，滑动提示没意义 */
@media (min-width: 821px) { .rp-swipe { display: none; } }
/* 手机上「报表门店」下拉压成一行，别占掉一整块 */
@media (max-width: 820px) {
  #repStoreSel { max-width: 210px; height: 32px !important; font-size: 12.5px !important; padding: 0 8px; }
}

/* 趋势柱（手机端压缩高度） */
.rp-trend { display: flex; align-items: flex-end; gap: 5px; min-height: 132px; overflow-x: auto; padding: 4px 0 2px; }
.rp-trend > div { flex: 1 0 30px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.rp-trend .v { font-size: 10px; color: #98a0ae; white-space: nowrap; font-variant-numeric: tabular-nums; }
.rp-trend .b { width: 58%; border-radius: 3px 3px 0 0; background: linear-gradient(180deg, #6fa0ff, #2b6ffe); }
.rp-trend .t { font-size: 10px; color: #8a93a3; white-space: nowrap; }

/* ---------------- 桌面端（≥821px）：馆掌版式同样成立，只是放宽 ---------------- */
@media (min-width: 821px) {
  .rp-wrap { max-width: 1180px; }
  .rp-bar { padding: 12px 16px; }
  .rp-sec { padding: 16px 18px; }
  .rp-tiles { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
  .rp-tile { padding: 11px 12px 12px; }
  .rp-tile .v { font-size: 16px; }
  .rp-tbwrap { margin: 12px 0 0; padding: 0; }
  table.rp-tb { font-size: 13px; }
  table.rp-tb th, table.rp-tb td { padding: 11px 12px; }
  .rp-trend > div { flex: 1 1 0; }
}
