/* ============================================================
 * 基础样式
 * ============================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: "Microsoft YaHei", -apple-system, BlinkMacSystemFont, sans-serif;
  background: #f5f5f5;
  padding: 12px;
  /* 底部固定导航栏预留空间 */
  padding-bottom: 68px;
  font-size: 14px;
  color: #333;
  /* 禁用双击缩放与点击高亮，保留正常滚动 */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

/* ============================================================
 * 底部导航栏（手机app风格，固定底部）
 * ============================================================ */
.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  background: #fff;
  border-top: 1px solid #e0e0e0;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  z-index: 100;
  /* iOS 底部安全区适配 */
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 0 6px;
  border: none;
  background: transparent;
  color: #9a9a9a;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.2s;
  min-width: 0;
}

.tab-item:active { color: #2b78e4; }
.tab-item.active { color: #2b78e4; }

.tab-icon {
  width: 22px;
  height: 22px;
  fill: currentColor;
  display: block;
}

.tab-label {
  font-size: 11px;
  line-height: 1;
  white-space: nowrap;
}

/* ============================================================
 * 页面切换
 * ============================================================ */
.page { display: none; }
.page.active { display: block; }

/* ============================================================
 * 表格通用
 * ============================================================ */
.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin-bottom: 12px;
  border-radius: 6px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  text-align: center;
  font-size: 13px;
  /* 固定布局：列宽自动均分，保证表格不超出容器宽度 */
  table-layout: fixed;
}

th {
  background: #eee;
  padding: 6px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
td {
  border: 1px solid #ccc;
  padding: 6px 4px;
  word-break: break-all;
}

.red { background: #e64340; color: #fff; }
.blue { background: #409eff; color: #fff; }
.green { background: #67c23a; color: #fff; }

/* ============================================================
 * 汇总表格
 * ============================================================ */
#summaryTable th:first-child,
#summaryTable td:first-child {
  width: 38px;
  min-width: 38px;
  background: #f0f0f0;
  font-weight: bold;
}

.money {
  background: #fff8e1;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.money:hover { background: #ffe082; }
.money:active { background: #ffd54f; }

.summary-total-cell {
  background: #fff0f0;
  font-weight: bold;
  text-align: center;
  font-size: 15px;
}

.total {
  font-weight: bold;
  color: #e74c3c;
  font-size: 15px;
}

/* ============================================================
 * 风险值表格
 * ============================================================ */
.risk-wrap {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 14px;
  border: 1px solid #ddd;
}

.risk-wrap .table-scroll { margin-bottom: 0; }

/* 风险统计栏 */
.risk-stat {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 4px;
  font-size: 12px;
}
.risk-stat-item { padding: 2px 6px; border-radius: 4px; background: #f5f5f5; color: #666; }
.risk-stat-item b { font-weight: bold; }
.risk-stat-item.risk-neg { background: #fdeaea; color: #e64340; }
.risk-stat-item.risk-pos { background: #eaf7e8; color: #67c23a; }
.risk-stat-item.risk-zero { background: #f0f0f0; color: #999; }

.risk-table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  text-align: center;
  font-size: 13px;
  table-layout: fixed;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  border-radius: 6px;
  overflow: hidden;
}

.risk-table thead th {
  background: #4a5568;
  color: #fff;
  padding: 10px 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 600;
  position: sticky;
  top: 0;
  z-index: 1;
}
.risk-table tbody tr:nth-child(even) { background: #fafafa; }
.risk-table tbody tr:hover { background: #f0f7ff; }
.risk-table td { border: 1px solid #eee; padding: 8px 3px; word-break: break-all; }
.risk-table .risk-animal {
  display: inline-block;
  margin-right: 4px;
  padding: 0 4px;
  border-radius: 3px;
  background: #f0e9d6;
  color: #8a6d3b;
  font-weight: bold;
  font-size: 0.85em;
}
.risk-table .risk-plus { color: #67c23a; font-weight: bold; }
.risk-table .risk-minus { color: #e64340; font-weight: bold; }
.risk-table .risk-zero { color: #999; }
/* 反水金额列：统一橙色显示 */
.risk-table .risk-rebate { color: #ff8c00; font-weight: bold; }

/* ============================================================
 * 输入区
 * ============================================================ */
.box-wrap {
  background: #fff;
  padding: 12px;
  border-radius: 8px;
  margin-top: 14px;
  border: 1px solid #ddd;
}

/* ============================================================
 * 快速选号区（底部可折叠面板）
 * ============================================================ */
.quick-pick-panel {
  display: none;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  margin-top: 10px;
}

.quick-pick-panel.open {
  display: block;
}

/* 金额行 */
.qp-amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  padding-bottom: 10px;
  margin-bottom: 10px;
  border-bottom: 1px dashed #ddd;
}

.qp-amt-label {
  font-size: 13px;
  font-weight: bold;
  color: #555;
  flex: 1;
  min-width: 0;
}

.qp-confirm-btn {
  padding: 7px 16px;
  background: #2b78e4;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}

.qp-confirm-btn:hover { background: #1e6bd0; }
.qp-confirm-btn:active { background: #155ab0; }

.qp-clear-btn {
  padding: 7px 12px;
  background: #f0f0f0;
  color: #666;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

.qp-clear-btn:hover { background: #e6e6e6; }

.qp-preview {
  width: 100%;
  font-size: 12px;
  color: #2b78e4;
  word-break: break-all;
  padding: 4px 0;
}

.qp-empty {
  color: #999;
}

.qp-preview-count {
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
}

.qp-preview-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  padding: 6px 0;
  border-top: 1px dashed #eee;
}

.qp-preview-label {
  flex-shrink: 0;
  min-width: 34px;
  font-weight: bold;
  color: #fff;
  background: #2b78e4;
  border-radius: 4px;
  padding: 1px 6px;
  text-align: center;
}

.qp-preview-nums {
  flex: 1;
  min-width: 60px;
  color: #333;
  word-break: break-all;
}

/* 号码 chip：可点击删除单个号码 */
.qp-num-chip {
  display: inline-flex;
  align-items: center;
  background: #f4f6f8;
  border: 1px solid #ccc;
  border-radius: 3px;
  padding: 1px 2px 1px 5px;
  margin: 2px 3px 2px 0;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.4;
  color: #333;
  user-select: none;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.qp-num-chip:hover {
  background: #ffe5e5;
  border-color: #e64340;
  color: #c00;
}

.qp-num-del {
  display: inline-block;
  margin-left: 4px;
  color: #999;
  font-style: normal;
  font-weight: bold;
  font-size: 13px;
  line-height: 1;
  padding: 0 1px;
  border-radius: 2px;
  transition: color 0.15s;
}

.qp-num-chip:hover .qp-num-del {
  color: #e64340;
}

/* 每组独立的金额输入框 */
.qp-group-amt {
  width: 70px;
  padding: 5px 6px;
  border: 1px solid #aaa;
  border-radius: 4px;
  /* 16px 防止 iOS 聚焦自动放大 */
  font-size: 16px;
  text-align: center;
  flex-shrink: 0;
}

.qp-group-amt:focus {
  border-color: #2b78e4;
  outline: none;
  box-shadow: 0 0 0 2px rgba(43, 120, 228, 0.15);
}

/* 每组小计：× N = 合计 */
.qp-group-total {
  flex-shrink: 0;
  font-size: 12px;
  color: #888;
  white-space: nowrap;
}

.qp-group-total b {
  color: #e74c3c;
  font-size: 13px;
}

/* 分块布局 */
.quick-pick {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.qp-block {
  background: #fafafa;
  border: 1px solid #eee;
  border-radius: 8px;
  padding: 8px 10px;
}

.qp-title {
  font-size: 12px;
  font-weight: bold;
  color: #666;
  margin-bottom: 6px;
}

.qp-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* 头/尾按钮放大 */
.qp-btns-lg .qp-btn {
  padding: 12px 10px;
  font-size: 18px;
  border-radius: 8px;
}

.qp-btns-lg {
  gap: 8px;
}

/* 生肖用等宽网格，更整齐 */
.qp-animal-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 6px;
}

.qp-btn {
  padding: 7px 4px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f4f6f8;
  color: #333;
  font-size: 13px;
  cursor: pointer;
  text-align: center;
  transition: background 0.15s, border-color 0.15s, transform 0.05s;
}

.qp-btn:hover {
  background: #e3edfb;
  border-color: #2b78e4;
}

.qp-btn:active {
  background: #2b78e4;
  color: #fff;
  transform: scale(0.96);
}

.qp-animal {
  background: #eaf7ea;
  border-color: #b6e0b6;
}

/* 选中态 */
.qp-btn.selected {
  background: #2b78e4;
  color: #fff;
  border-color: #1e6bd0;
  font-weight: bold;
}

.qp-animal.selected {
  background: #2e9e4b;
  border-color: #1f7a36;
}

/* 生肖网格布局已统一下方响应式断点处理 */

#identifyInput {
  width: 100%;
  min-height: 80px;
  padding: 8px 10px;
  border: 1px solid #ccc;
  border-radius: 6px;
  /* 16px 防止 iOS 聚焦自动放大 */
  font-size: 16px;
  resize: vertical;
}

/* 点击输入框聚焦后提示文字自动消失，避免干扰输入 */
#identifyInput::placeholder {
  color: #aaa;
}

#identifyInput:focus::placeholder {
  color: transparent;
}

.identify-preview {
  min-height: 18px;
  max-height: 168px;
  overflow-y: auto;
  margin-bottom: 6px;
  font-size: 12px;
  line-height: 1.5;
  word-break: break-all;
}

.identify-preview .ip-ok { color: #2e9e4b; }
.identify-preview .ip-ok b { color: #e74c3c; }
.identify-preview .ip-nums { color: #333; margin-left: 4px; }
.identify-preview .ip-warn { color: #e74c3c; }

/* 多行解析结果：每行一条 */
.identify-preview .ip-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px;
  padding: 3px 0;
  border-top: 1px dashed #e3e6ea;
}

.identify-preview .ip-line .ip-nums {
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 0;
  letter-spacing: .5px;
}

.identify-preview .ip-meta {
  flex: 0 0 auto;
  color: #888;
  white-space: nowrap;
}

.identify-preview .ip-meta b { color: #e74c3c; }

.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

#pasteBtn {
  padding: 8px 16px;
  background: #6c757d;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

#pasteBtn:hover { background: #5a6268; }

#sendBtn {
  padding: 8px 16px;
  background: #2b78e4;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex: 1;
}

#sendBtn:hover { background: #1e6bd0; }

.qp-toggle-btn {
  padding: 8px 12px;
  background: #f0ad4e;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  font-weight: bold;
}

.qp-toggle-btn:hover { background: #ec971f; }
.qp-toggle-btn:active { background: #d58512; }

.record-list {
  min-height: 80px;
  max-height: 200px;
  overflow-y: auto;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 10px;
  background: #fafafa;
}

/* 记录区标题栏：标题 + 展开按钮 */
.record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
  gap: 8px;
}

.record-title {
  font-size: 13px;
  font-weight: bold;
  color: #555;
}

.record-title b {
  color: #e74c3c;
}

.record-header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

/* 生肖汇总标题栏 */
.summary-header { margin-top: 10px; }

/* 汇总表折叠：隐藏表格内容仅保留标题栏 */
#summaryScroll.collapsed {
  display: none;
}

.record-clear-btn {
  padding: 4px 10px;
  background: #fdf0f0;
  color: #e74c3c;
  border: 1px solid #f0c4c4;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.record-clear-btn:hover { background: #fbe0e0; border-color: #e74c3c; }
.record-clear-btn:active { background: #f6cfcf; }

.record-expand-btn {
  padding: 4px 10px;
  background: #f0f0f0;
  color: #2b78e4;
  border: 1px solid #d0d0d0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.record-expand-btn:hover { background: #e3edfb; border-color: #2b78e4; }
.record-expand-btn:active { background: #d0e0f7; }

.record-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 6px;
  border-bottom: 1px solid #eee;
  font-size: 14px;
  gap: 8px;
}

.record-item span {
  flex: 1;
  word-break: break-all;
}

.record-item:last-child { border-bottom: none; }

/* 时间标签：撤销按钮前的相对时间 */
.record-time {
  flex: 0 0 auto !important;
  font-size: 11px;
  color: #999;
  white-space: nowrap;
}

.undo-btn {
  font-size: 11px;
  padding: 2px 6px;
  background: #ff6b6b;
  color: #fff;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
}

.undo-btn:hover { background: #f24b4b; }

/* ============================================================
 * 全局设置
 * ============================================================ */
.setting-wrap {
  background: #fff;
  padding: 16px;
  border-radius: 8px;
}

.setting-item {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  flex-wrap: wrap;
}

.setting-item label { width: 110px; flex-shrink: 0; }

.setting-item input {
  padding: 6px;
  width: 180px;
  border: 1px solid #aaa;
  border-radius: 4px;
  /* 16px 防止 iOS 聚焦自动放大 */
  font-size: 16px;
}

.set-save-btn {
  padding: 6px 14px;
  background: #2b78e4;
  color: #fff;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.set-save-btn:hover { background: #1e6bd0; }

.set-desc {
  margin-top: 20px;
  font-size: 13px;
  color: #666;
  line-height: 1.7;
}

/* ============================================================
 * 平板适配
 * ============================================================ */
@media (max-width: 768px) {
  body { padding: 10px; padding-bottom: 64px; font-size: 13px; }
}

/* ============================================================
 * 手机适配：自动缩小字号 + 收紧间距，确保组件完整显示
 * ============================================================ */
@media (max-width: 640px) {
  body { padding: 6px; padding-bottom: 60px; font-size: 12px; }

  /* 底部导航栏收紧 */
  .tab-item { padding: 6px 0 5px; }
  .tab-icon { width: 20px; height: 20px; }
  .tab-label { font-size: 10px; }

  /* 表格字号随屏幕宽度自动缩放，保证不溢出 */
  table { font-size: 11px; }
  th, td { padding: 4px 2px; }

  #summaryTable th:first-child,
  #summaryTable td:first-child { width: 28px; min-width: 28px; }

  .summary-total-cell { font-size: 12px; }
  .total { font-size: 12px; }

  .risk-table { font-size: 11px; }
  .risk-table thead th, .risk-table td { padding: 6px 2px; }

  .box-wrap { padding: 8px; margin-top: 10px; }
  .risk-wrap { padding: 8px; margin-top: 10px; }
  .record-item { font-size: 12px; padding: 4px; gap: 4px; }
  .undo-btn { font-size: 10px; padding: 2px 4px; }

  /* 快速选号面板收紧 */
  .quick-pick-panel { padding: 8px; }
  .qp-amount-row { gap: 6px; padding-bottom: 8px; margin-bottom: 8px; }
  .qp-confirm-btn { padding: 6px 12px; font-size: 13px; }
  .qp-clear-btn { padding: 6px 10px; font-size: 12px; }
  .qp-btn { padding: 6px 2px; font-size: 12px; }
  .qp-block { padding: 6px 8px; }
  .qp-btns { gap: 4px; }
  .qp-btns-lg .qp-btn { padding: 9px 6px; font-size: 15px; }
  .qp-btns-lg { gap: 6px; }
  /* 生肖网格收窄为 4 列 */
  .qp-animal-grid { grid-template-columns: repeat(4, 1fr); }

  .setting-wrap { padding: 10px; }
  .setting-item { flex-direction: column; align-items: stretch; }
  .setting-item label { width: auto; }
  .setting-item input { width: 100%; }
}

/* ============================================================
 * 超小屏（极窄手机）：进一步收紧，保证全部内容可见
 * ============================================================ */
@media (max-width: 380px) {
  body { padding: 4px; padding-bottom: 56px; font-size: 11px; }

  /* 底部导航栏极窄屏收紧 */
  .tab-item { padding: 5px 0 4px; }
  .tab-icon { width: 18px; height: 18px; }
  .tab-label { font-size: 10px; }

  table { font-size: 10px; }
  th, td { padding: 3px 1px; }

  #summaryTable th:first-child,
  #summaryTable td:first-child { width: 22px; min-width: 22px; }

  .summary-total-cell { font-size: 11px; }
  .total { font-size: 11px; }
  .risk-table { font-size: 10px; }
  .risk-table thead th, .risk-table td { padding: 4px 1px; }

  /* 生肖网格在极窄屏进一步收紧为 3 列 */
  .qp-animal-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .qp-btn { font-size: 11px; padding: 5px 2px; }
  .qp-btns-lg .qp-btn { padding: 8px 4px; font-size: 14px; }
  /* 极窄屏的分组金额输入框稍微缩窄 */
  .qp-group-amt { width: 60px; padding: 4px 4px; }
  .qp-confirm-btn { padding: 5px 10px; font-size: 12px; }
  .qp-clear-btn { padding: 5px 8px; font-size: 11px; }

  .box-wrap { padding: 6px; }
  .risk-wrap { padding: 6px; }
  .record-item { font-size: 11px; }
  /* 输入框保持 16px，避免 iOS 聚焦自动放大 */
  #identifyInput { font-size: 16px; min-height: 60px; padding: 6px; }
  #pasteBtn, #sendBtn, .qp-toggle-btn { padding: 6px 10px; font-size: 12px; }
  .btn-row { gap: 4px; }
}

/* ============================================================
 * 横屏与极小高度：让表格区域可纵向滚动，避免布局溢出
 * ============================================================ */
@media (max-height: 500px) and (orientation: landscape) {
  .record-list { max-height: 120px; }
}

/* ============================================================
 * 删除号码确认弹窗
 * ============================================================ */
.confirm-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.confirm-modal[hidden] { display: none; }

.confirm-modal-box {
  background: #fff;
  border-radius: 8px;
  padding: 18px 20px 14px;
  width: 280px;
  max-width: 90vw;
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
  animation: confirmModalIn 0.18s ease-out;
}

@keyframes confirmModalIn {
  from { transform: scale(0.9); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

.confirm-modal-text {
  font-size: 15px;
  color: #333;
  margin-bottom: 16px;
  text-align: center;
  line-height: 1.5;
}

.confirm-modal-text b {
  color: #e64340;
  font-size: 17px;
  margin: 0 2px;
}

.confirm-modal-btns {
  display: flex;
  gap: 10px;
  justify-content: center;
}

.confirm-btn-cancel,
.confirm-btn-ok {
  flex: 1;
  padding: 9px 12px;
  border-radius: 4px;
  font-size: 14px;
  cursor: pointer;
  border: none;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.confirm-btn-cancel {
  background: #f0f0f0;
  color: #666;
}
.confirm-btn-cancel:hover { background: #e0e0e0; }

.confirm-btn-ok {
  background: #e64340;
  color: #fff;
}
.confirm-btn-ok:hover { background: #c9302c; }
.confirm-btn-ok:active { background: #a82822; }

/* ============================================================
 * 全屏记录查看模态
 * ============================================================ */
.record-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 999;
  display: flex;
  flex-direction: column;
  animation: recordModalIn 0.18s ease-out;
}

.record-modal[hidden] { display: none; }

@keyframes recordModalIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.record-modal-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: #fff;
  border-bottom: 1px solid #eee;
  flex-shrink: 0;
}

.record-modal-title {
  font-size: 15px;
  font-weight: bold;
  color: #333;
}

.record-modal-title b {
  color: #e74c3c;
}

.record-modal-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.record-clear-all-btn {
  padding: 6px 12px;
  background: #fff0f0;
  color: #e64340;
  border: 1px solid #f5b5b5;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.record-clear-all-btn:hover { background: #ffe0e0; }

.record-close-btn {
  padding: 6px 12px;
  background: #f0f0f0;
  color: #666;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-size: 13px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s;
}

.record-close-btn:hover { background: #e0e0e0; }

.record-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: #fff;
  padding: 8px 12px 20px;
}

.record-modal-body .record-item {
  padding: 10px 6px;
  font-size: 14px;
  border-bottom: 1px solid #eee;
}

.record-modal-empty {
  text-align: center;
  color: #999;
  padding: 40px 0;
  font-size: 14px;
}

/* ============================================================
 * 旧浏览器兼容（不支持 flex gap 的浏览器用 margin 兜底）
 * 覆盖 iOS 13.x / 旧版微信内置浏览器等场景
 * ============================================================ */
@supports not (gap: 1px) {
  /* 横向 flex 不换行：相邻元素加左 margin */
  .btn-row > * + * { margin-left: 8px; }
  .record-item > * + * { margin-left: 8px; }
  .record-modal-actions > * + * { margin-left: 8px; }

  /* 纵向 flex：相邻元素加顶 margin */
  .quick-pick > * + * { margin-top: 10px; }
  .tab-item > * + * { margin-top: 2px; }

  /* 可换行 flex：容器负 margin + 子项正 margin 模拟 gap */
  .qp-amount-row { margin: -4px -4px 0 -4px; }
  .qp-amount-row > * { margin: 4px; }

  .qp-btns { margin: -3px; }
  .qp-btns > * { margin: 3px; }

  .setting-item { margin: -4px -4px 0 -4px; }
  .setting-item > * { margin: 4px; }

  /* 媒体查询里的 gap 覆盖在旧浏览器里也对应缩放 */
  @media (max-width: 640px) {
    .btn-row > * + * { margin-left: 4px; }
    .qp-amount-row { margin: -3px -3px 0 -3px; }
    .qp-amount-row > * { margin: 3px; }
    .qp-btns { margin: -2px; }
    .qp-btns > * { margin: 2px; }
  }
}
