/* ============================================
   叁恒业务管理系统 v2 - 简约设计系统
   灵感: Apple HIG + 小米 HyperOS · 纯净·留白·层次
   ============================================ */

:root {
  /* 主色 — Apple 蓝 */
  --sh-primary: #007AFF;
  --sh-primary-hover: #1a8aff;
  --sh-primary-active: #0056CC;
  --sh-primary-tint: #E8F4FD;
  --sh-primary-lighter: #F0F7FF;

  /* 状态 */
  --sh-success: #34C759;
  --sh-warning: #FF9500;
  --sh-danger:  #FF3B30;
  --sh-info:    #5856D6;

  /* 文字 */
  --sh-text-1: #1d1d1f;
  --sh-text-2: #6e6e73;
  --sh-text-3: #aeaeb2;
  --sh-text-ph: #767679;

  /* 背景 */
  --sh-bg-page: #f5f5f7;
  --sh-bg-card: #ffffff;
  --sh-bg-hover: #f5f5f7;
  --sh-bg-input: #ffffff;

  /* 边框 */
  --sh-border: #e5e5ea;
  --sh-border-light: #f2f2f7;
  --sh-border-strong: #d1d1d6;

  /* 阴影 */
  --sh-shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --sh-shadow-md: 0 2px 8px rgba(0,0,0,0.06);
  --sh-shadow-lg: 0 8px 24px rgba(0,0,0,0.08);
  --sh-shadow-xl: 0 24px 48px rgba(0,0,0,0.12);

  /* 圆角 */
  --sh-r-sm: 8px;
  --sh-r-md: 12px;
  --sh-r-lg: 16px;
  --sh-r-xl: 20px;
  --sh-r-pill: 999px;

  /* 间距 */
  --sh-s-1: 4px;
  --sh-s-2: 8px;
  --sh-s-3: 12px;
  --sh-s-4: 16px;
  --sh-s-5: 24px;
  --sh-s-6: 32px;

  /* 布局 */
  --sh-sidebar: 240px;
  --sh-header: 52px;

  /* 字体 */
  --sh-font: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  --sh-font-num: -apple-system, 'SF Mono', Menlo, Consolas, 'PingFang SC', sans-serif;
  --sh-tx: 14px;
  --sh-tx-sm: 12px;
  --sh-tx-xs: 11px;
  --sh-tx-lg: 16px;
  --sh-tx-xl: 22px;

  /* 过渡 */
  --sh-tr: 0.2s cubic-bezier(0.25, 0.1, 0.25, 1);
}

/* ===== Reset ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--sh-font);
  font-size: var(--sh-tx);
  font-weight: 400;
  color: var(--sh-text-1);
  background: var(--sh-bg-page);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
  line-height: 1.5;
  display: flex;
  min-height: 100vh;
}
a { color: var(--sh-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
input, select, button, textarea { font-family: inherit; }

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,0.2); }

/* ===== 左侧目录 — 整体白色 ===== */
.sidebar {
  width: var(--sh-sidebar);
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  border-right: 1px solid var(--sh-border-light);
}
.sidebar .brand {
  padding: 18px 20px;
  border-bottom: 1px solid var(--sh-border-light);
}
.sidebar .brand .logo {
  color: var(--sh-text-1);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.sidebar .brand .sub {
  color: var(--sh-text-3);
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.sidebar .nav-title {
  padding: 16px 20px 6px;
  color: var(--sh-text-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar .nav { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.sidebar .nav li a {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 20px;
  color: var(--sh-text-2);
  cursor: pointer;
  text-decoration: none;
  font-size: var(--sh-tx);
  font-weight: 500;
  border-left: 3px solid transparent;
  border-radius: 0;
  transition: background 0.15s ease, color 0.15s ease;
}
.sidebar .nav li a:hover { background: var(--sh-bg-hover); color: var(--sh-text-1); text-decoration: none; }
.sidebar .nav li a.active {
  background: var(--sh-primary-lighter);
  color: var(--sh-primary);
  border-left-color: var(--sh-primary);
}
.sidebar .nav li a .icon { width: 18px; text-align: center; font-size: 14px; opacity: 0.8; }
.sidebar .nav li a.active .icon { opacity: 1; }
.sidebar .nav li a .badge-count {
  margin-left: auto;
  background: var(--sh-bg-hover);
  color: var(--sh-text-2);
  font-size: 11px;
  font-weight: 600;
  padding: 1px 8px;
  border-radius: var(--sh-r-pill);
  font-variant-numeric: tabular-nums;
}
.sidebar .nav li a.active .badge-count { background: var(--sh-primary); color: #fff; }
.sidebar .footer {
  margin-top: auto;
  padding: 14px 20px;
  border-top: 1px solid var(--sh-border-light);
  font-size: var(--sh-tx-xs);
  color: var(--sh-text-3);
}
.sidebar .footer .user { color: var(--sh-text-1); font-size: 12px; margin-bottom: 4px; font-weight: 500; }
.sidebar .footer a { color: var(--sh-primary); cursor: pointer; }
.sidebar .footer a:hover { text-decoration: underline; }

/* ===== 主区 ===== */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

header {
  background: var(--sh-bg-card);
  padding: 0 24px;
  min-height: var(--sh-header);
  display: flex; align-items: center; gap: 12px;
  position: relative;
  z-index: 50;
  border-bottom: 1px solid var(--sh-border-light);
}
header h1 {
  font-size: 17px;
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.01em;
}
header .count {
  display: none;  /* 暂时隐藏阶段总数小数字 (用户觉得没用) */
  color: var(--sh-text-2);
  font-size: var(--sh-tx-sm);
  background: var(--sh-bg-hover);
  padding: 2px 10px;
  border-radius: var(--sh-r-pill);
  font-variant-numeric: tabular-nums;
}
header .spacer { flex: 1; }
header .back-link {
  color: var(--sh-primary);
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 500;
}
header .back-link:hover { text-decoration: underline; }

/* 顶部全局搜索框 (header 正中央, 永远可见) */
header .top-search {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--sh-bg-hover);
  border: 1px solid transparent;
  border-radius: var(--sh-r-pill);
  padding: 4px 12px;
  height: 36px;
  transition: all 0.15s ease;
}
header .top-search:focus-within {
  background: var(--sh-bg-card);
  border-color: var(--sh-primary);
  box-shadow: 0 0 0 3px var(--sh-primary-lighter);
}
header .top-search .ts-icon { color: var(--sh-text-3); font-size: 13px; }
header .top-search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  color: var(--sh-text-1);
  font-family: inherit;
  padding: 0;
  min-width: 0;
}
header .top-search input::placeholder { color: var(--sh-text-3); }
header .top-search .ts-clear {
  background: none; border: none; cursor: pointer;
  color: var(--sh-text-3); font-size: 18px; padding: 0 4px; line-height: 1;
}

.top-search-dropdown {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  top: var(--sh-header);
  width: min(560px, 92vw);
  background: var(--sh-bg-card);
  border: 1px solid var(--sh-border-light);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  z-index: 49;
  max-height: 60vh;
  overflow-y: auto;
}
.ts-loading, .ts-empty { padding: 24px; text-align: center; color: var(--sh-text-3); font-size: 13px; }
.ts-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--sh-bg-hover);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ts-item:last-child { border-bottom: none; }
.ts-item:hover, .ts-item:active { background: var(--sh-bg-hover); }
.ts-name { font-size: 14px; font-weight: 500; color: var(--sh-primary); margin-bottom: 4px; }
.ts-meta { display: flex; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--sh-text-2); margin-bottom: 4px; }
.ts-status {
  background: var(--sh-bg-hover); padding: 1px 6px; border-radius: 4px; font-size: 11px;
}
.ts-sub { display: flex; justify-content: space-between; font-size: 12px; color: var(--sh-text-3); }
.ts-total { font-weight: 600; color: var(--sh-text-1); font-variant-numeric: tabular-nums; }

/* ===== 工具栏 — 极简白底按钮 ===== */
.toolbar {
  background: var(--sh-bg-card);
  padding: 12px 24px;
  display: flex; gap: 6px; align-items: center; flex-wrap: wrap;
}
.tb-btn {
  padding: 6px 14px;
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-sm);
  background: var(--sh-bg-card);
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 500;
  color: var(--sh-text-2);
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all 0.15s ease;
}
.tb-btn:hover {
  background: var(--sh-bg-hover);
  border-color: var(--sh-border);
  color: var(--sh-text-1);
}
.tb-btn.active {
  background: var(--sh-primary-lighter);
  border-color: var(--sh-primary-lighter);
  color: var(--sh-primary);
}
.tb-btn .badge {
  background: var(--sh-primary);
  color: #fff;
  border-radius: var(--sh-r-pill);
  padding: 0 6px;
  font-size: 10px;
  font-weight: 600;
  line-height: 16px;
  min-width: 16px;
  text-align: center;
}
.tb-btn.active .badge { background: var(--sh-primary); }
.tb-btn-primary {
  background: var(--sh-primary);
  border-color: var(--sh-primary);
  color: #fff;
  font-weight: 600;
}
.tb-btn-primary:hover { background: var(--sh-primary-hover); border-color: var(--sh-primary-hover); color: #fff; }

#searchBox {
  padding: 6px 12px;
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
  width: 260px;
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  transition: box-shadow 0.15s ease, border-color 0.15s ease;
  outline: none;
}
#searchBox::placeholder { color: var(--sh-text-ph); }
#searchBox:hover { border-color: var(--sh-border); }
#searchBox:focus { border-color: var(--sh-primary); box-shadow: 0 0 0 3px var(--sh-primary-lighter); }

/* ===== 已激活筛选 chips ===== */
.chips-bar {
  background: #fffbef;
  border-bottom: 1px solid #ffe58f;
  padding: 8px 24px;
  font-size: var(--sh-tx-sm);
  color: #874d00;
  display: none;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.chips-bar.show { display: flex; }
.chips-bar .conj {
  background: #fff7d9;
  border: 1px solid #ffd666;
  padding: 1px 10px;
  border-radius: var(--sh-r-pill);
  font-size: var(--sh-tx-xs);
  font-weight: 600;
}
.chips-bar .chip {
  background: #fff;
  border: 1px solid #ffd666;
  padding: 2px 4px 2px 10px;
  border-radius: var(--sh-r-pill);
  font-size: var(--sh-tx-xs);
  display: inline-flex; align-items: center; gap: 4px;
}
.chips-bar .chip .x {
  cursor: pointer;
  color: #aaa;
  padding: 0 6px;
  font-size: 14px;
  line-height: 1;
}
.chips-bar .chip .x:hover { color: var(--sh-danger); }
.chips-bar a { color: var(--sh-primary); cursor: pointer; margin-left: auto; font-weight: 500; }

/* ===== 表格 ===== */
.table-wrap {
  margin: 16px 24px;
  background: var(--sh-bg-card);
  border-radius: var(--sh-r-md);
  box-shadow: var(--sh-shadow-sm);
  overflow: auto;
  max-height: calc(100vh - 220px);
}
table { border-collapse: separate; border-spacing: 0; width: 100%; }
th, td {
  border-bottom: 1px solid var(--sh-border-light);
  padding: 8px 12px;
  white-space: nowrap;
  text-align: left;
  font-size: var(--sh-tx-sm);
}
th {
  background: var(--sh-bg-card);
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--sh-text-2);
  cursor: pointer;
  user-select: none;
  z-index: 2;
  font-size: var(--sh-tx-xs);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--sh-border);
}
th:hover { background: var(--sh-bg-hover); color: var(--sh-text-1); }
th .sort { color: var(--sh-text-3); font-size: 10px; margin-left: 4px; }
th .sort.active { color: var(--sh-primary); }
th { position: relative; }
th .resize {
  position: absolute; top: 0; right: 0; width: 6px; height: 100%;
  cursor: col-resize; user-select: none;
}
th .resize:hover, th .resize.active { background: var(--sh-primary); opacity: 0.4; }
th.dragging { opacity: 0.4; }
th.drag-over-left::before { content: ''; position: absolute; left: -1px; top: 0; bottom: 0; width: 2px; background: var(--sh-primary); }
th.drag-over-right::after { content: ''; position: absolute; right: -1px; top: 0; bottom: 0; width: 2px; background: var(--sh-primary); }
td.num { text-align: right; font-variant-numeric: tabular-nums; font-family: var(--sh-font-num); }
td.empty { color: var(--sh-text-3); }
td.action { padding: 4px 8px; }
tbody tr:hover { background: var(--sh-bg-hover); }
tbody tr:last-child td { border-bottom: none; }
.edit-btn {
  border: 1px solid var(--sh-primary);
  background: var(--sh-primary-tint);
  color: var(--sh-primary);
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.edit-btn:hover { background: var(--sh-primary); color: #fff; }
.assign-btn {
  border: 1px solid var(--sh-warning);
  background: #FFF4E0;
  color: var(--sh-warning);
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.assign-btn:hover { background: var(--sh-warning); color: #fff; }
.feedback-btn {
  border: 1px solid var(--sh-success);
  background: #E8F8EE;
  color: var(--sh-success);
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.feedback-btn:hover { background: var(--sh-success); color: #fff; }
.confirm-btn {
  border: 1px solid var(--sh-info);
  background: #EEF0FF;
  color: var(--sh-info);
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.confirm-btn:hover { background: var(--sh-info); color: #fff; }
.make-verify-btn {
  border: 1px solid #5856D6;
  background: #EEF0FF;
  color: #5856D6;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.make-verify-btn:hover { background: #5856D6; color: #fff; }
.issue-cert-btn {
  border: 1px solid #34C759;
  background: #E8F8EE;
  color: #1F7A33;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.issue-cert-btn:hover { background: #34C759; color: #fff; }
.make-invoice-btn {
  border: 1px solid #007AFF;
  background: #E5F1FF;
  color: #0050B3;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.make-invoice-btn:hover { background: #007AFF; color: #fff; }
.confirm-invoice-btn {
  border: 1px solid #5856D6;
  background: #EEF0FF;
  color: #5856D6;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.confirm-invoice-btn:hover { background: #5856D6; color: #fff; }
.payment-btn {
  border: 1px solid #34C759;
  background: #E8F8EE;
  color: #1F7A33;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.payment-btn:hover { background: #34C759; color: #fff; }
.approve-btn {
  border: 1px solid #5856D6;
  background: #EEF0FF;
  color: #5856D6;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.approve-btn:hover { background: #5856D6; color: #fff; }
.send-verify-btn {
  border: 1px solid #FF9500;
  background: #FFF4E0;
  color: #FF9500;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.send-verify-btn:hover { background: #FF9500; color: #fff; }
.send-cert-btn {
  border: 1px solid #007AFF;
  background: #E5F1FF;
  color: #007AFF;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.send-cert-btn:hover { background: #007AFF; color: #fff; }
.apply-fee-btn {
  border: 1px solid #FF9500;
  background: #FFF4E0;
  color: #FF9500;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.apply-fee-btn:hover { background: #FF9500; color: #fff; }
.approve-fee-btn {
  border: 1px solid #5856D6;
  background: #EEF0FF;
  color: #5856D6;
  padding: 3px 12px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-xs);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.approve-fee-btn:hover { background: #5856D6; color: #fff; }
.reject-btn {
  border: 1px solid #FF3B30;
  background: #FFE5E5;
  color: #FF3B30;
  padding: 6px 16px;
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 600;
  font-family: inherit;
  transition: all 0.15s ease;
}
.reject-btn:hover { background: #FF3B30; color: #fff; }

/* ===== 客户确认弹窗 — 附件列表 ===== */
.cf-attachments { display: flex; flex-direction: column; gap: 6px; }
.cf-attach-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
}
.cf-attach-icon { font-size: 16px; }
.cf-attach-name {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--sh-primary); text-decoration: none;
}
.cf-attach-name:hover { text-decoration: underline; }
.cf-attach-size { color: var(--sh-text-3); font-size: var(--sh-tx-xs); font-variant-numeric: tabular-nums; }

/* ===== 详情页附件区 — 1 张图直接铺开, 多张缩略图 + 打包下载 ===== */
.det-attach-wrap { display: flex; flex-direction: column; gap: 10px; }
.det-attach-single-img {
  display: block; max-width: 100%; max-height: 360px;
  border: 1px solid var(--sh-border-light); border-radius: var(--sh-r-sm);
  object-fit: contain; background: #fafafa;
}
.det-attach-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px; padding: 4px;
}
.det-attach-thumb {
  position: relative;
  border: 1px solid var(--sh-border-light); border-radius: var(--sh-r-sm);
  background: #fff; overflow: hidden; cursor: pointer;
  display: flex; flex-direction: column;
}
.det-attach-thumb:hover { border-color: var(--sh-primary); }
.det-attach-thumb img {
  width: 100%; height: 100px; object-fit: cover; background: #fafafa;
}
.det-attach-thumb .det-thumb-name {
  font-size: 11px; color: var(--sh-text-1);
  padding: 6px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.det-attach-zip-btn {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px;
  background: var(--sh-primary); color: #fff;
  border-radius: var(--sh-r-sm);
  text-decoration: none; font-size: var(--sh-tx-sm); font-weight: 600;
  cursor: pointer;
}
.det-attach-zip-btn:hover { background: #0070e0; }
.det-attach-empty { color: var(--sh-text-3); font-size: var(--sh-tx-sm); padding: 4px 0; }

/* ===== 施工反馈 — 拖拽上传 ===== */
.fb-drop {
  border: 2px dashed var(--sh-border-strong);
  border-radius: var(--sh-r-md);
  padding: 22px 16px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.15s ease;
}
.fb-drop:hover { border-color: var(--sh-primary); background: var(--sh-primary-lighter); }
.fb-drop.drag { border-color: var(--sh-primary); background: var(--sh-primary-tint); }
.fb-drop-hint { color: var(--sh-text-2); font-size: 13px; font-weight: 500; }
.fb-files { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.fb-file-item {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 10px;
  background: #fff;
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
}
.fb-file-icon { font-size: 16px; }
.fb-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--sh-text-1); }
.fb-file-size { color: var(--sh-text-3); font-size: var(--sh-tx-xs); font-variant-numeric: tabular-nums; }
.fb-file-del {
  cursor: pointer;
  color: var(--sh-text-3);
  font-size: 18px;
  line-height: 1;
  padding: 0 8px;
  font-weight: 300;
}
.fb-file-del:hover { color: var(--sh-danger); }
.empty-table {
  text-align: center;
  padding: 80px 20px;
  color: var(--sh-text-3);
  font-size: var(--sh-tx);
}
.empty-table .icon { font-size: 48px; opacity: 0.4; margin-bottom: 12px; display: block; }

/* ===== 分页 ===== */
.pager {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  padding: 12px 16px 16px;
}
.pager button {
  padding: 5px 14px;
  border: 1px solid var(--sh-border);
  background: var(--sh-bg-card);
  border-radius: var(--sh-r-sm);
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 500;
  color: var(--sh-text-1);
  font-family: inherit;
  transition: all 0.15s ease;
}
.pager button:hover:not(:disabled) { background: var(--sh-bg-hover); border-color: var(--sh-border-strong); }
.pager button:disabled { color: var(--sh-text-3); cursor: not-allowed; }
.pager #pageInfo { color: var(--sh-text-2); font-size: var(--sh-tx-sm); font-variant-numeric: tabular-nums; }
.pager select {
  padding: 4px 8px;
  font-size: var(--sh-tx-sm);
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

/* ===== 工作台 卡片 ===== */
.dash { padding: 12px 24px 24px; }
.dash-header {
  margin-bottom: 12px;
  color: var(--sh-text-2);
  font-size: var(--sh-tx-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dash-header strong { color: var(--sh-text-1); font-weight: 600; }
.dash-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.dash-card {
  background: var(--sh-bg-card);
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-md);
  padding: 18px 20px;
  cursor: pointer;
  text-decoration: none;
  color: var(--sh-text-1);
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: var(--sh-shadow-sm);
}
.dash-card:hover {
  border-color: var(--sh-primary);
  box-shadow: var(--sh-shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
}
.dash-card .ctitle {
  font-size: 15px;
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  letter-spacing: -0.01em;
}
.dash-card .ctitle .tag {
  font-size: 10px;
  background: var(--sh-primary-tint);
  color: var(--sh-primary);
  padding: 1px 8px;
  border-radius: var(--sh-r-pill);
  font-weight: 600;
}
.dash-card .ccount {
  font-size: 28px;
  font-weight: 700;
  color: var(--sh-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  font-family: var(--sh-font-num);
  letter-spacing: -0.02em;
}
.dash-card .ccount.zero { color: var(--sh-text-3); }
.dash-card .crule {
  color: var(--sh-text-2);
  font-size: var(--sh-tx-xs);
  line-height: 1.5;
  max-height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.dash-card .cgo {
  font-size: var(--sh-tx-xs);
  color: var(--sh-primary);
  font-weight: 500;
  margin-top: 2px;
}

/* ===== 弹窗 (筛选/编辑/列设置) ===== */
.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.65);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding-top: 80px;
  animation: fadeIn 0.15s ease;
}
.modal-mask.open { display: flex; }

.filter-panel, .col-modal, .edit-modal {
  background: var(--sh-bg-card);
  border-radius: var(--sh-r-lg);
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-shadow-xl);
  border: 1px solid var(--sh-border-light);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(8px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.filter-panel { width: 720px; max-height: 80vh; }
.filter-panel .head, .col-modal h2, .edit-modal h2 {
  padding: 16px 24px;
  border-bottom: 1px solid var(--sh-border-light);
  display: flex; align-items: center; gap: 12px;
}
.filter-panel .head h2, .col-modal h2, .edit-modal h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  border: none;
  padding: 0;
}
.filter-panel .head .conj-toggle {
  display: inline-flex;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  overflow: hidden;
  font-size: var(--sh-tx-sm);
  background: var(--sh-bg-card);
}
.filter-panel .head .conj-toggle button {
  padding: 4px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
  color: var(--sh-text-2);
  transition: all 0.15s ease;
}
.filter-panel .head .conj-toggle button.active { background: var(--sh-primary); color: #fff; }
.filter-panel .head .spacer { flex: 1; }
.filter-panel .head .close, .edit-modal h2 .close {
  cursor: pointer;
  color: var(--sh-text-3);
  font-size: 22px;
  line-height: 1;
  padding: 0 8px;
  font-weight: 300;
  transition: color 0.15s ease;
}
.filter-panel .head .close:hover, .edit-modal h2 .close:hover { color: var(--sh-text-1); }

.filter-panel .body, .col-modal .body, .edit-modal .body {
  padding: 16px 24px;
  overflow: auto;
  flex: 1;
}
.filter-panel .foot, .col-modal .footer, .edit-modal .footer {
  padding: 14px 24px;
  border-top: 1px solid var(--sh-border-light);
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  align-items: center;
}
.filter-panel .foot button, .col-modal .footer button, .edit-modal .footer button {
  padding: 7px 18px;
  border-radius: var(--sh-r-sm);
  border: 1px solid var(--sh-border);
  background: var(--sh-bg-card);
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 500;
  font-family: inherit;
  color: var(--sh-text-1);
  transition: all 0.15s ease;
}
.filter-panel .foot button:hover, .col-modal .footer button:hover { background: var(--sh-bg-hover); border-color: var(--sh-border-strong); }
.filter-panel .foot button.primary, .col-modal .footer button.primary, .edit-modal .footer button.primary {
  background: var(--sh-primary);
  color: #fff;
  border-color: var(--sh-primary);
}
.filter-panel .foot button.primary:hover, .col-modal .footer button.primary:hover, .edit-modal .footer button.primary:hover {
  background: var(--sh-primary-hover);
  border-color: var(--sh-primary-hover);
}
.filter-panel .actions { display: flex; gap: 12px; padding: 8px 0 4px; font-size: var(--sh-tx-sm); }
.filter-panel .actions a { color: var(--sh-primary); cursor: pointer; font-weight: 500; }

/* 条件行 */
.cond-row {
  display: flex; gap: 6px; align-items: center;
  margin-bottom: 8px;
  padding: 8px 10px;
  background: var(--sh-bg-page);
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-sm);
}
.cond-row .field, .cond-row .op {
  padding: 5px 10px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
  font-family: inherit;
  background: var(--sh-bg-card);
  min-width: 110px;
  outline: none;
}
.cond-row .field { min-width: 140px; }
.cond-row .val {
  padding: 5px 10px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
  font-family: inherit;
  background: var(--sh-bg-card);
  flex: 1;
  min-width: 80px;
  outline: none;
}
.cond-row .val:focus { border-color: var(--sh-primary); box-shadow: 0 0 0 3px var(--sh-primary-lighter); }
.cond-row .val-range { display: flex; gap: 4px; flex: 1; }
.cond-row .val-range input {
  padding: 5px 10px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
  font-family: inherit;
  background: var(--sh-bg-card);
  flex: 1;
  outline: none;
}
.cond-row .val-range input:focus { border-color: var(--sh-primary); box-shadow: 0 0 0 3px var(--sh-primary-lighter); }
.cond-row .del {
  cursor: pointer;
  color: var(--sh-text-3);
  font-size: 18px;
  line-height: 1;
  padding: 0 8px;
  user-select: none;
  font-weight: 300;
}
.cond-row .del:hover { color: var(--sh-danger); }
.cond-row.disabled .val, .cond-row.disabled .val-range input { background: var(--sh-bg-hover); color: var(--sh-text-3); cursor: not-allowed; }
.empty-conds { color: var(--sh-text-3); text-align: center; padding: 32px 20px; font-size: var(--sh-tx-sm); }

/* ===== 列设置 ===== */
.col-modal { width: 720px; max-height: 80vh; }
.col-modal .body { padding: 14px 24px; }
.col-modal .footer { justify-content: space-between; }
.col-modal .footer > div { display: flex; gap: 8px; }
.col-list { display: flex; flex-direction: column; gap: 2px; max-height: 50vh; overflow: auto; }
.col-item {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 10px;
  border: 1px solid transparent;
  border-radius: var(--sh-r-sm);
  cursor: grab;
  user-select: none;
  font-size: var(--sh-tx-sm);
  transition: all 0.12s ease;
}
.col-item:hover { background: var(--sh-primary-lighter); border-color: var(--sh-primary-lighter); }
.col-item.dragging { opacity: 0.4; }
.col-item.drag-over { border-top: 2px solid var(--sh-primary); }
.col-item .grip { color: var(--sh-text-3); font-size: 16px; cursor: grab; }
.col-item .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.col-item .typ { color: var(--sh-text-3); font-size: var(--sh-tx-xs); }
.col-item .width-input {
  width: 64px;
  padding: 3px 6px;
  border: 1px solid var(--sh-border);
  border-radius: 6px;
  font-size: var(--sh-tx-xs);
  outline: none;
}
.col-item .width-input:focus { border-color: var(--sh-primary); box-shadow: 0 0 0 3px var(--sh-primary-lighter); }

/* ===== 编辑订单 弹窗 ===== */
.edit-modal { width: 900px; max-height: 85vh; }
.edit-modal h2 { display: flex; align-items: center; gap: 10px; }
.edit-modal h2 .spacer { flex: 1; }
.edit-modal .footer { gap: 8px; }
.edit-modal .footer .spacer { flex: 1; }
.edit-modal .footer #editErr { color: var(--sh-danger); font-size: var(--sh-tx-sm); }
.edit-section { margin-bottom: 20px; }
.edit-section h3 {
  margin: 0 0 10px;
  font-size: var(--sh-tx-xs);
  color: var(--sh-text-2);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  border-bottom: 1px dashed var(--sh-border);
  padding-bottom: 6px;
}
.edit-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}
.edit-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-size: var(--sh-tx-xs);
  color: var(--sh-text-2);
  font-weight: 500;
}
.edit-grid input, .edit-grid textarea {
  padding: 7px 10px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  font-size: var(--sh-tx-sm);
  font-family: inherit;
  background: var(--sh-bg-input);
  color: var(--sh-text-1);
  outline: none;
  transition: all 0.15s ease;
}
.edit-grid input:focus, .edit-grid textarea:focus {
  border-color: var(--sh-primary);
  box-shadow: 0 0 0 3px var(--sh-primary-lighter);
}
.edit-grid textarea { resize: vertical; min-height: 56px; }
.edit-grid .full { grid-column: span 2; }

/* ===== 详情弹窗 (只读, 紧凑) ===== */
.detail-modal h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  padding: 14px 24px;
  border-bottom: 1px solid var(--sh-border-light);
  color: var(--sh-text-2);
  letter-spacing: -0.01em;
}
.detail-modal {
  background: var(--sh-bg-card);
  border-radius: var(--sh-r-lg);
  width: 880px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--sh-shadow-xl);
  border: 1px solid var(--sh-border-light);
  animation: slideUp 0.2s ease;
}
.detail-modal .body { padding: 16px 24px; overflow: auto; flex: 1; }
.detail-modal .footer { padding: 12px 24px; border-top: 1px solid var(--sh-border-light); display: flex; align-items: center; gap: 8px; }
.detail-modal .footer .spacer { flex: 1; }
.detail-modal .footer button {
  padding: 6px 16px;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  background: var(--sh-bg-card);
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 500;
  font-family: inherit;
  color: var(--sh-text-1);
}
.detail-modal .footer button:hover { background: var(--sh-bg-hover); }
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 24px;
}
.detail-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--sh-border-light);
  font-size: var(--sh-tx-sm);
}
.detail-item .lbl {
  color: var(--sh-text-3);
  font-size: var(--sh-tx-xs);
  font-weight: 500;
  min-width: 84px;
  flex-shrink: 0;
}
.detail-item .val {
  color: var(--sh-text-1);
  font-weight: 500;
  word-break: break-all;
  flex: 1;
  min-width: 0;
}
.detail-item .val.num { font-family: var(--sh-font-num); font-variant-numeric: tabular-nums; text-align: right; }
.detail-item.empty .val { color: var(--sh-text-3); font-weight: 400; }
.detail-item.full { grid-column: span 2; }

/* 拨号链接 (tel:) — 移动端长按/点按弹出拨号面板 */
a.phone-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: rgba(51,112,255,0.12);
  border-bottom: 1px dashed rgba(51,112,255,0.4);
  padding-bottom: 1px;
}
a.phone-link:hover { color: var(--sh-primary); border-bottom-color: var(--sh-primary); }

/* 客户名点击态 */
td.link {
  color: var(--sh-primary);
  cursor: pointer;
  font-weight: 500;
}
td.link:hover { text-decoration: underline; background: var(--sh-primary-lighter); }

/* ===== 通用工具 ===== */
.sh-page-title {
  font-size: var(--sh-tx-xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin: 0;
}
.sh-section-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 var(--sh-s-4);
}
.sh-empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--sh-text-3);
}
.sh-empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; display: block; }
.sh-empty-state .text { font-size: var(--sh-tx); }

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  :root { --sh-sidebar: 200px; --sh-s-4: 12px; --sh-s-5: 16px; }
  .filter-panel, .col-modal, .edit-modal { width: 90vw; }
}
@media (max-width: 767px) {
  :root { --sh-sidebar: 0px; --sh-s-4: 10px; --sh-s-5: 14px; }
  body { font-size: 13px; }
  .sidebar { display: none; }
  /* .edit-grid mobile 双列布局在下面更靠后的 media query 里覆盖 */
  #searchBox { width: 180px; }
}

/* ===== 新建订单 全屏页 (完整版) ===== */
.create-page {
  position: fixed;
  inset: 0;
  background: var(--sh-bg-page);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.18s ease;
}
.create-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  padding: 14px 24px;
  background: var(--sh-bg-card);
  border-bottom: 1px solid var(--sh-border-light);
}
.create-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}
.create-header .sub-desc {
  color: #86868b;
  font-size: 12px;
}
.create-header .spacer { flex: 1; }

.create-body {
  flex: 1;
  overflow: auto;
  padding: 16px 24px 60px;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
}

.create-section {
  background: var(--sh-bg-card);
  border: 1px solid var(--sh-border-light);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 12px;
  box-shadow: var(--sh-shadow-sm);
}
.create-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--sh-text-1);
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}

.create-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 16px;
}
.create-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px 16px;
}
.create-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 16px;
}
.create-section label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #6e6e73;
  font-weight: 500;
}
.create-section label em {
  color: #ff3b30;
  font-style: normal;
  margin-left: 2px;
}
.create-section label.switch-label {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fafafa;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--sh-border-light);
}
.create-section input[type=text],
.create-section input[type=number],
.create-section input[type=date],
.create-section select,
.create-section textarea {
  padding: 7px 10px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--sh-text-1);
  outline: none;
  transition: all 0.15s ease;
  width: 100%;
}
.create-section textarea {
  resize: vertical;
  min-height: 56px;
  font-family: inherit;
}
.create-section input:focus,
.create-section select:focus,
.create-section textarea:focus {
  border-color: var(--sh-primary);
  box-shadow: 0 0 0 3px var(--sh-primary-lighter);
}

/* iOS 风格开关 */
.sh-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}
.sh-switch input { opacity: 0; width: 0; height: 0; }
.sh-switch-slider {
  position: absolute;
  inset: 0;
  background: #e5e5ea;
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s;
}
.sh-switch-slider::before {
  content: "";
  position: absolute;
  width: 20px; height: 20px;
  left: 2px; top: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}
.sh-switch input:checked + .sh-switch-slider {
  background: var(--sh-success);
}
.sh-switch input:checked + .sh-switch-slider::before {
  transform: translateX(20px);
}

/* AI 解析面板 */
#aiPanelBody { margin-top: 10px; }
#aiInput {
  width: 100%;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  background: #fff;
  color: var(--sh-text-1);
  outline: none;
  resize: vertical;
}
#aiInput:focus {
  border-color: var(--sh-primary);
  box-shadow: 0 0 0 3px var(--sh-primary-lighter);
}
.ai-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

/* 自动建议下拉 */
.customer-suggest {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.10);
  z-index: 200;
  max-height: 280px;
  overflow: auto;
  margin-top: 2px;
}
.cust-sug-item {
  padding: 8px 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid var(--sh-border-light);
}
.cust-sug-item:last-child { border-bottom: none; }
.cust-sug-item:hover { background: var(--sh-primary-lighter); }

/* 业务明细表格 */
.items-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--sh-border-light);
  border-radius: 8px;
}
.items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.items-table thead th {
  background: #fafafa;
  font-weight: 600;
  color: #6e6e73;
  padding: 8px 10px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--sh-border);
  white-space: nowrap;
  position: static;
  cursor: default;
}
.items-table tbody td {
  padding: 4px 6px;
  border-bottom: 1px solid var(--sh-border-light);
  vertical-align: middle;
}
.items-table tbody tr:last-child td { border-bottom: none; }
.items-table tbody tr:hover { background: #fafbfc; }
.items-table input,
.items-table select {
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  background: transparent;
  width: 100%;
  outline: none;
  font-variant-numeric: tabular-nums;
}
.items-table input:hover,
.items-table select:hover { border-color: var(--sh-border); background: #fff; }
.items-table input:focus,
.items-table select:focus {
  border-color: var(--sh-primary);
  background: #fff;
  box-shadow: 0 0 0 3px var(--sh-primary-lighter);
}
.items-table .row-sub {
  color: #34C759;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  display: inline-block;
  padding: 0 8px;
}
.items-table .row-del {
  width: 28px; height: 28px;
  border: none;
  background: transparent;
  color: var(--sh-text-3);
  cursor: pointer;
  font-size: 18px;
  border-radius: 50%;
  line-height: 1;
  font-weight: 300;
  font-family: inherit;
}
.items-table .row-del:hover {
  background: #ffebee;
  color: var(--sh-danger);
}
.items-table .row-del:disabled {
  color: var(--sh-text-3);
  cursor: not-allowed;
  background: transparent;
}

/* ===== 开发票弹窗 — invoice_items 行表 ===== */
#mi_itemsTable tbody td { padding: 6px 8px; vertical-align: middle; }
#mi_itemsTable tbody tr:hover { background: #fafbfc; }
#mi_itemsTable .mi-row-item,
#mi_itemsTable .mi-row-detail,
#mi_itemsTable .mi-row-amount { margin: 0; }
#mi_itemsTable .mi-row-amount { font-variant-numeric: tabular-nums; }

/* 居间信息小标题 */
#invoiceTypeWrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 11px;
  color: #6e6e73;
  font-weight: 500;
}
#invoiceTypeWrap select { margin-top: 0; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* R0 验证失败样式 */
.r0-error,
.r0-error:focus {
  border-color: #ff3b30 !important;
  box-shadow: 0 0 0 3px rgba(255, 59, 48, 0.12) !important;
  background: #FFF5F5 !important;
  animation: r0Shake 0.32s ease;
}
@keyframes r0Shake {
  0%, 100% { transform: translateX(0); }
  25%      { transform: translateX(-3px); }
  75%      { transform: translateX(3px); }
}

/* =====================================================
   移动端响应式 (≤768px)
   设计原则: 减法 + 触摸友好
   ===================================================== */

/* Hamburger 按钮: 已删除 (与底部"菜单"tab 重复, 改用 bottom-sheet) */

/* Sidebar 遮罩 (默认隐藏) */
.sidebar-mask { display: none; }
.sidebar-mask.open {
  display: block;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 99;
  animation: r0FadeIn 0.2s;
}

/* 底部 Tab Bar (≥769 隐藏, ≤768 显示) */
.bottom-nav {
  display: none;
}
@media (max-width: 768px) {
  .bottom-nav {
    display: flex;
    position: fixed;
    left: 0; right: 0; bottom: 0;
    height: 56px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 95;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .bn-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--sh-text-3);
    text-decoration: none;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    position: relative;
    padding: 6px 0;
    min-height: 56px;
  }
  .bn-tab:active { opacity: 0.6; }
  .bn-tab.active { color: var(--sh-primary); }
  .bn-icon { font-size: 22px; line-height: 1; }
  .bn-text { font-size: 11px; margin-top: 2px; }
  .bn-badge {
    position: absolute;
    top: 4px; right: 22%;
    min-width: 18px; height: 18px;
    padding: 0 5px;
    background: var(--sh-danger);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    border-radius: 9px;
    line-height: 18px;
    text-align: center;
    box-sizing: border-box;
  }

  /* "我" 底部抽屉 */
  .bottom-sheet-mask { display: none; }
  .bottom-sheet-mask.open {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 96;
    animation: r0FadeIn 0.2s;
  }
  .bottom-sheet {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    background: var(--sh-bg-card);
    border-radius: 12px 12px 0 0;
    transform: translateY(100%);
    transition: transform 0.25s ease;
    z-index: 97;
    padding-bottom: env(safe-area-inset-bottom);
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
  }
  .bottom-sheet.open { transform: translateY(0); }
  .bottom-sheet .bs-head {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid var(--sh-bg-hover);
    position: sticky;
    top: 0;
    background: var(--sh-bg-card);
  }
  .bottom-sheet .bs-head h3 { margin: 0; flex: 1; font-size: 16px; font-weight: 600; }
  .bottom-sheet .bs-head .close {
    width: 32px; height: 32px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 24px; color: var(--sh-text-2);
  }
  .bottom-sheet .bs-body { padding: 8px 0; }
  .bottom-sheet .bs-item {
    display: block;
    padding: 14px 20px;
    color: var(--sh-text-1);
    font-size: 15px;
    text-decoration: none;
    border-bottom: 1px solid var(--sh-bg-hover);
    cursor: pointer;
    min-height: 44px;
  }
  .bottom-sheet .bs-item:active { background: var(--sh-bg-hover); }
  .bottom-sheet .bs-item.danger { color: var(--sh-danger); }
  .bottom-sheet .bs-divider {
    height: 1px;
    background: var(--sh-bg-hover);
    margin: 8px 0;
  }
  .bottom-sheet .bs-sub-title {
    padding: 6px 20px 2px;
    font-size: 12px;
    color: var(--sh-text-3);
    font-weight: 500;
  }
  .bottom-sheet .bs-meta {
    padding: 12px 20px;
    font-size: 12px;
    color: var(--sh-text-3);
    text-align: center;
  }

  /* 给主区加底部留白, 不让内容被 nav 挡住 */
  .main { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }
}

/* === 平板 + 手机 (≤768px) === */
@media (max-width: 768px) {
  body { font-size: 14px; }
  html, body { -webkit-text-size-adjust: 100%; }

  /* 工作台底部留 tab 高度 (避免被 4 tab 栏遮挡) */
  .dash { padding-bottom: 72px; }

  /* Sidebar 默认隐藏, 抽屉化 */
  .sidebar {
    position: fixed;
    left: 0; top: 0; bottom: 0;
    width: 240px;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    z-index: 100;
    box-shadow: none;
    border-right: none;
    background: var(--sh-bg-card);
    display: flex;  /* 覆盖 @media (max-width:767px) 里的 display:none */
  }
  .sidebar.open {
    transform: translateX(0);
    display: flex;
    box-shadow: 2px 0 24px rgba(0, 0, 0, 0.15);
  }

  /* 主区占满 */
  .main { margin-left: 0; padding: 12px; }

  /* 顶部 header: hamburger 已删除 (改用底部菜单 sheet) */
  .header { padding: 8px 0 12px; }

  /* Dashboard 卡片: 自适应 (auto-fill 至少 2 列) */
  .dash-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    gap: 10px !important;
  }
  .dash-card { padding: 14px 12px; min-height: 80px; }
  .ctitle { font-size: 13px; }
  .ccount { font-size: 22px !important; }
  .cdesc { font-size: 12px; }

  /* 表格: 横滚容器 (mobile 上承认横滚, 不再尝试 sticky) */
  .table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  }
  table { min-width: 600px; }
  thead th { font-size: 13px; }

  /* 卡片视图 (mobile ≤768 替代表格) */
  #tableWrap { display: none !important; }
  #cardsList { display: block !important; padding: 8px 0 80px; }
  .order-card {
    background: var(--sh-bg-card);
    margin: 8px 12px;
    padding: 14px;
    border-radius: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .order-card:active { background: var(--sh-bg-hover); }
  .oc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .oc-name {
    font-size: 16px; font-weight: 600; color: var(--sh-primary);
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .oc-total { font-size: 16px; font-weight: 700; color: #1d1d1f; font-variant-numeric: tabular-nums; flex-shrink: 0; }
  .oc-meta {
    margin-top: 6px; display: flex; gap: 8px; flex-wrap: wrap;
    font-size: 13px; color: var(--sh-text-2);
  }
  .oc-status {
    background: var(--sh-bg-hover); padding: 2px 8px; border-radius: 4px;
    font-size: 12px; font-weight: 500;
  }
  .oc-sub { margin-top: 6px; font-size: 12px; color: var(--sh-text-3); }
  .oc-action { margin-top: 10px; }
  .oc-action .tb-btn { width: 100%; min-height: 40px; font-size: 14px; }

  /* Toolbar: 紧凑, 关键按钮显眼 */
  .toolbar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 0;
  }
  .tb-btn {
    padding: 8px 12px;
    font-size: 13px;
    min-height: 36px;
  }
  #searchBox { width: 100%; order: 99; }

  /* Pager 紧凑 */
  .pager { padding: 8px 0; font-size: 13px; }

  /* 表单 (新建订单 / 编辑): 双列紧凑 (在下面更靠后的 media query 里覆盖) */
  .create-grid-2, .create-grid-3, .create-grid-4 { grid-template-columns: 1fr !important; gap: 10px !important; }
  .create-section label.switch-label[style*="span 2"], .create-section label.switch-label[style*="span 3"], .create-section label.switch-label[style*="span 4"] { grid-column: span 1 !important; }
  /* edit-modal / detail-modal 内: 字号缩到 13px (详情页风格), 不影响 create-page */
  .edit-modal input, .edit-modal select, .edit-modal textarea,
  .detail-modal input, .detail-modal select, .detail-modal textarea {
    font-size: 13px !important;
    padding: 6px 8px !important;
    min-height: 32px;
  }

  /* create-page 业务明细: 9 列表格 mobile 转 2 列卡片 (每个字段 label + 输入), 字号 10/12 */
  /* create-page 所有表单字段统一 12px (跟业务明细一致) */
  .create-section input[type=text],
  .create-section input[type=number],
  .create-section input[type=date],
  .create-section select,
  .create-section textarea {
    padding: 5px 8px !important;
    font-size: 12px !important;
  }
  .create-section label { font-size: 11px !important; }

  .items-table-wrap { overflow: hidden; }
  .items-table thead { display: none; }
  .items-table { display: block !important; width: 100% !important; min-width: 0 !important; max-width: 100% !important; box-sizing: border-box; table-layout: fixed; }
  .items-table tbody { display: block; width: 100% !important; box-sizing: border-box; }
  .items-table tr {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 4px 8px;
    width: 100% !important;
    background: #fafbfc;
    border: 1px solid var(--sh-border-light);
    border-radius: 8px;
    margin-bottom: 10px;
    padding: 6px;
    box-sizing: border-box;
  }
  .items-table td {
    display: flex; align-items: center; gap: 4px;
    width: auto !important;
    padding: 4px 6px !important;
    border: none !important;
    border-radius: 4px;
    background: #fff;
    min-width: 0;
    box-sizing: border-box;
  }
  .items-table td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    font-size: 10px; color: var(--sh-text-3); font-weight: 500;
    white-space: nowrap;
  }
  .items-table td > input, .items-table td > select, .items-table td > .row-sub {
    flex: 1; min-width: 0; width: auto;
    font-size: 12px !important; padding: 2px 4px !important;
    min-height: 22px !important;
  }
  /* 业务类型 select 跨满一整行 (因为名字长) */
  .items-table td[data-label="业务类型"] { grid-column: span 2; }
  /* 单位 单独: 输入框小 */
  .items-table td[data-label="单位"] input { max-width: 40px; flex: 0 0 40px; text-align: center; }
  /* 小计 + 删除 同行: 小计左, 删除右 */
  .items-table td[data-label="小计"] { background: transparent; padding-left: 0 !important; }
  .items-table td[data-label="操作"] { background: transparent; justify-content: flex-end; padding-right: 0 !important; }
  .items-table td[data-label="操作"]::before { display: none; }
  .items-table td[data-label="小计"] .row-sub { font-size: 13px; color: var(--sh-primary); font-weight: 700; }
  .items-table td[data-label="操作"] .row-del { width: 24px; height: 24px; min-height: 24px; font-size: 14px; line-height: 1; padding: 0; }
  /* 业务明细标题旁 "+ 添加一行" 按钮在 mobile 上要小, 别跟标题同高 */
  .create-section-title button, .create-section-title button.tb-btn, .create-section-title .tb-btn-primary {
    min-height: 28px !important; max-height: 28px !important; height: 28px !important;
    padding: 0 12px !important; font-size: 12px !important; line-height: 1 !important;
    align-self: flex-start !important;
    white-space: nowrap !important; flex-shrink: 0 !important;
  }
  input[type="checkbox"], input[type="radio"] {
    width: 20px; height: 20px; min-height: auto;
  }

  /* Modal 全屏化 */
  .modal-mask { padding: 0; align-items: stretch; }
  .modal, .filter-panel, .edit-modal, .detail-modal, .create-page {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  .modal .body, .filter-panel .body, .edit-modal .body, .detail-modal .body {
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* 弹窗头部更大, sticky */
  .modal .head, .filter-panel .head, .edit-modal h2, .detail-modal h2, .create-page .head {
    padding: 12px 16px;
    position: sticky;
    top: 0;
    background: var(--sh-bg-card);
    z-index: 5;
    font-size: 15px;
  }
  .modal .foot, .filter-panel .foot, .edit-modal .footer, .detail-modal .footer, .create-page .foot {
    padding: 10px 16px;
    position: sticky;
    bottom: 0;
    background: var(--sh-bg-card);
    border-top: 1px solid var(--sh-bg-hover);
  }

  /* edit-modal 内: 保持 2 列紧凑 (像详情页), 别一列堆叠 */
  .edit-modal .body { padding: 10px 14px; }
  .edit-section { margin-bottom: 14px; }
  .edit-section h3 { margin: 0 0 6px; font-size: 11px; padding-bottom: 4px; }
  .edit-grid { grid-template-columns: repeat(2, 1fr); gap: 6px 12px; }
  .edit-grid .full { grid-column: span 2; }
  .edit-grid label { font-size: 11px; gap: 2px; }
  .edit-grid input, .edit-grid textarea, .edit-grid select {
    font-size: 13px; padding: 5px 8px;
  }
  .edit-grid textarea { min-height: 48px; }

  /* Chips bar 换行 */
  .chips-bar { flex-wrap: wrap; padding: 6px 0; font-size: 12px; }

  /* Header 顶部: h1 单行截断, stage rule 隐藏 */
  header { padding: 0 12px; min-height: 48px; }
  header h1 {
    font-size: 15px; flex: 0 1 auto; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  header .count { font-size: 11px; padding: 1px 8px; }
  header .back-link { font-size: 12px; flex-shrink: 0; }
  /* 顶部搜索框 mobile: 占中, 不挤其他元素 */
  header .top-search { max-width: none; height: 32px; padding: 4px 10px; }
  header .top-search input { font-size: 13px; }
  header .top-search input::placeholder { font-size: 12px; }

  /* Field chips 触摸友好 */
  .field-chip { min-height: 36px; padding: 6px 10px; font-size: 13px; }
}

/* === 小屏手机 (≤480px) === */
@media (max-width: 480px) {
  body { font-size: 13px; }
  h1 { font-size: 16px; }
  .dash-grid {
    grid-template-columns: 1fr !important;   /* 单列堆叠 */
  }
  .dash-card { min-height: 72px; padding: 12px; }
  .ctitle { font-size: 14px; }
  .ccount { font-size: 26px !important; }
  .tb-btn { padding: 10px 14px; min-height: 40px; }

  /* 新建订单页: 别跟老年机似的 */
  .create-header { padding: 12px 16px; }
  .create-header h2 { font-size: 16px; }
  .create-header .sub-desc { font-size: 11px; }
  .create-body { padding: 12px 16px 60px; }
  .create-section { padding: 12px; }
  .create-section-title { font-size: 14px; }
  .field-label, .form-row label { font-size: 12px; }
  /* create-page input 字号 13px 但用 .create-page input 16px !important 防 iOS 缩放 */
  .create-body input, .create-body select, .create-body textarea {
    font-size: 13px;
    padding: 8px 10px;
  }
  .create-body input::placeholder, .create-body textarea::placeholder { font-size: 13px; }
  /* iOS 不缩放: create-page 内 input 必须 ≥16px 才能防止聚焦时浏览器缩放页面 */
  .create-page input, .create-page select, .create-page textarea {
    font-size: 16px !important;
    min-height: 44px;
  }
  /* AI 助手框字号 */
  .ai-assist-head { padding: 10px 14px; }
  .ai-assist-title { font-size: 13px; }
  .ai-assist-sub { font-size: 11px; }
  .ai-assist-input-row textarea { font-size: 13px; padding: 8px 10px; }
}

/* 触摸设备反馈 */
@media (hover: none) {
  .tb-btn:active, .dash-card:active { opacity: 0.7; }
}

/* === 桌面隐藏 bottom-sheet (mobile only 组件) === */
@media (min-width: 769px) {
  .bottom-sheet, .bottom-sheet-mask { display: none !important; }
}

/* ===== 自定义下拉菜单 (替代原生 select, 避免 iOS 大滚轮) ===== */
.cs-wrap { position: relative; display: inline-block; width: 100%; }
.cs-trigger {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 8px;
  border: 1px solid var(--sh-border);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
  color: var(--sh-text);
  cursor: pointer;
  min-height: 28px;
  box-sizing: border-box;
  text-align: left;
}
.cs-trigger:active { background: #f5f5f5; }
.cs-trigger .cs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cs-trigger .cs-text.cs-placeholder { color: #999; }
.cs-trigger .cs-arrow { color: #999; font-size: 10px; margin-left: 6px; flex-shrink: 0; }
.cs-popup {
  position: absolute;
  z-index: 9500;
  background: #fff;
  border: 1px solid var(--sh-border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  max-height: 50vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.cs-popup.cs-popup-full {
  position: fixed; left: 5%; right: 5%; top: 10%;
  width: auto; max-width: 360px; margin: 0 auto;
}
.cs-item {
  padding: 10px 12px;
  font-size: 13px;
  color: var(--sh-text);
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  line-height: 1.3;
}
.cs-item:last-child { border-bottom: none; }
.cs-item:active { background: #f0f5ff; }
.cs-item.cs-selected { color: var(--sh-primary); font-weight: 600; background: #f0f5ff; }
.cs-item.cs-check::before { content: "✓"; color: var(--sh-primary); font-weight: 700; margin-right: 6px; }
.cs-popup-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.3);
  z-index: 9400;
}

/* mobile 全屏式下拉 (选项多时居中弹出, 不挡视线) */
@media (max-width: 768px) {
  .cs-popup:not(.cs-popup-inline) {
    position: fixed !important;
    left: 50% !important;
    top: 50% !important;
    transform: translate(-50%, -50%);
    width: 86vw;
    max-width: 360px;
    max-height: 70vh;
  }
}

/* === 全局动画 (移动端用) === */
@keyframes r0FadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* === 排名全屏页 === */
.ranking-page {
  position: fixed;
  inset: 0;
  background: var(--sh-bg-page);
  z-index: 100;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: fadeIn 0.18s ease;
}
.rk-header {
  background: var(--sh-bg-card);
  padding: 12px 16px;
  border-bottom: 1px solid var(--sh-border-light);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.rk-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.rk-back {
  background: none;
  border: 1px solid var(--sh-border-light);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--sh-text-2);
  font-family: inherit;
  min-height: 36px;
}
.rk-toggle {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  background: var(--sh-bg-card);
  border-bottom: 1px solid var(--sh-border-light);
  flex-shrink: 0;
}
.rk-toggle button {
  flex: 1;
  padding: 10px 16px;
  border: 1px solid var(--sh-border-light);
  border-radius: 8px;
  background: var(--sh-bg-card);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  color: var(--sh-text-2);
  font-family: inherit;
  min-height: 40px;
}
.rk-toggle button.active {
  background: var(--sh-primary);
  color: white;
  border-color: var(--sh-primary);
}
.ranking-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 80px;
}
.rk-meta {
  padding: 12px 16px;
  font-size: 12px;
  color: var(--sh-text-3);
  background: var(--sh-bg-card);
  border-bottom: 1px solid var(--sh-border-light);
}
.rk-list {
  padding: 8px 0;
}
.rk-item {
  display: grid;
  grid-template-columns: 36px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  background: var(--sh-bg-card);
  margin: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.rk-item.me {
  background: #eef4ff;
  border: 2px solid var(--sh-primary);
  box-shadow: 0 1px 4px rgba(51,112,255,0.2);
}
.rk-rank {
  font-size: 18px;
  font-weight: 700;
  color: var(--sh-text-2);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.rk-item:nth-child(1) .rk-rank { color: #ff9500; }
.rk-item:nth-child(2) .rk-rank { color: #8e8e93; }
.rk-item:nth-child(3) .rk-rank { color: #cd7f32; }
.rk-name {
  font-size: 15px;
  font-weight: 500;
  color: var(--sh-text-1);
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rk-me-tag {
  background: var(--sh-primary);
  color: white;
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
}
.rk-amt {
  font-size: 15px;
  font-weight: 700;
  color: var(--sh-text-1);
  font-variant-numeric: tabular-nums;
  text-align: right;
}
.rk-cnt {
  font-size: 12px;
  color: var(--sh-text-3);
  text-align: right;
  font-variant-numeric: tabular-nums;
  min-width: 50px;
}


/* =====================================================
   我的设置 全屏页 (亮/暗主题共用, 主题切换通过 CSS 变量覆盖)
   ===================================================== */

.me-page {
  position: fixed;
  inset: 0;
  background: var(--sh-bg-page);
  z-index: 200;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.me-header {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  height: var(--sh-header);
  background: var(--sh-bg-card);
  border-bottom: 1px solid var(--sh-border-light);
  gap: 12px;
}
.me-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  color: var(--sh-text-1);
}
.me-back {
  background: transparent;
  border: none;
  color: var(--sh-primary);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
}
.me-back:hover { background: var(--sh-bg-hover); }
.me-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-bottom: 80px;
}

/* 用户卡片 */
.me-user-card {
  background: var(--sh-bg-card);
  border-radius: 12px;
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.me-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--sh-primary), #5856D6);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  font-weight: 600;
  flex-shrink: 0;
}
.me-user-name {
  font-size: 18px;
  font-weight: 600;
  color: var(--sh-text-1);
  margin-bottom: 4px;
}
.me-user-meta {
  font-size: 12px;
  color: var(--sh-text-2);
}

/* 通用设置区块 */
.me-section {
  background: var(--sh-bg-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.me-section-title {
  padding: 12px 16px 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--sh-text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.me-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-top: 1px solid var(--sh-border-light);
  cursor: pointer;
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  font-size: 14px;
  gap: 12px;
}
.me-item:first-child { border-top: none; }
.me-item:hover { background: var(--sh-bg-hover); }
.me-item-icon {
  width: 28px;
  text-align: center;
  font-size: 18px;
  flex-shrink: 0;
}
.me-item-label { flex: 1; }
.me-item-desc {
  font-size: 11px;
  color: var(--sh-text-3);
  margin-top: 2px;
}
.me-item-value {
  font-size: 13px;
  color: var(--sh-text-2);
  font-variant-numeric: tabular-nums;
}
.me-item-arrow {
  color: var(--sh-text-3);
  font-size: 14px;
}
.me-item-danger { color: var(--sh-danger); }
.me-item-danger:hover { background: #fff5f5; }

/* 主题切换 segmented */
.me-theme-toggle {
  display: flex;
  background: var(--sh-bg-hover);
  border-radius: 8px;
  padding: 3px;
}
.me-theme-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--sh-text-2);
  cursor: pointer;
  border-radius: 6px;
  transition: var(--sh-tr);
}
.me-theme-toggle button.active {
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  box-shadow: 0 1px 2px rgba(0,0,0,0.08);
  font-weight: 500;
}

/* 改密码 弹窗 */
.me-pwd-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.me-pwd-modal {
  background: var(--sh-bg-card);
  border-radius: 12px;
  padding: 24px 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--sh-shadow-lg);
}
.me-pwd-modal h3 {
  margin: 0 0 16px;
  font-size: 17px;
  font-weight: 600;
  color: var(--sh-text-1);
}
.me-pwd-modal label {
  display: block;
  margin-bottom: 12px;
}
.me-pwd-modal label span {
  display: block;
  font-size: 12px;
  color: var(--sh-text-2);
  margin-bottom: 4px;
}
.me-pwd-modal input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--sh-border);
  border-radius: 6px;
  font-size: 15px;
  background: var(--sh-bg-input);
  color: var(--sh-text-1);
}
.me-pwd-modal input:focus {
  outline: none;
  border-color: var(--sh-primary);
}
.me-pwd-modal-err {
  color: var(--sh-danger);
  font-size: 12px;
  min-height: 16px;
  margin: 8px 0 0;
}
.me-pwd-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}
.me-pwd-modal-actions button {
  padding: 9px 16px;
  border: 1px solid var(--sh-border);
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.me-pwd-modal-actions button.primary {
  background: var(--sh-primary);
  border-color: var(--sh-primary);
  color: #fff;
}
.me-pwd-modal-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

/* =====================================================
   深色主题 (通过 body[data-theme="dark"] 触发)
   简版: 只覆盖最常用的颜色变量, 不动布局/阴影
   ===================================================== */
body[data-theme="dark"] {
  --sh-bg-page: #1c1c1e;
  --sh-bg-card: #2c2c2e;
  --sh-bg-input: #1c1c1e;
  --sh-bg-hover: #3a3a3c;
  --sh-text-1: #f5f5f7;
  --sh-text-2: #aeaeb2;
  --sh-text-3: #6e6e73;
  --sh-text-ph: #6e6e73;
  --sh-border: #3a3a3c;
  --sh-border-light: #2c2c2e;
  --sh-border-strong: #48484a;
}
body[data-theme="dark"] .me-item-danger:hover {
  background: #3a2828;
}
body[data-theme="dark"] .rk-item.me {
  background: #1f2f4d;
  border-color: var(--sh-primary);
}

/* ===== AI 助手 ===== */
/* 浮动按钮 (右下角, 不挡底部 tab) */
.ai-fab {
  position: fixed;
  right: 16px;
  bottom: 72px;  /* 避开底部 4 tab 栏 (56px) */
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--sh-primary);
  color: #fff;
  border: none;
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  z-index: 90;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
.ai-fab:active { transform: scale(0.92); }
@keyframes aiFabPulse {
  0%, 100% { box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); }
  50% { box-shadow: 0 4px 24px rgba(51, 112, 255, 0.5); }
}
.ai-fab { animation: aiFabPulse 2.5s ease-in-out infinite; }

/* 聊天页 (全屏, 类似 me-page) */
.ai-chat-page {
  position: fixed;
  inset: 0;
  background: var(--sh-bg-page);
  z-index: 200;
  display: flex;
  flex-direction: column;
}
.ai-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--sh-bg-card);
  border-bottom: 1px solid var(--sh-border-light);
}
.ai-chat-header h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
}
.ai-chat-header .ai-tag {
  font-size: 11px;
  background: #FF9500;
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.ai-chat-header .ai-back {
  background: transparent;
  border: none;
  color: var(--sh-primary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}
.ai-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  -webkit-overflow-scrolling: touch;
}
.ai-msg {
  max-width: 80%;
  margin-bottom: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  white-space: pre-wrap;
  word-break: break-word;
}
.ai-msg-user {
  margin-left: auto;
  background: var(--sh-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.ai-msg-ai {
  margin-right: auto;
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  border-bottom-left-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}
.ai-msg-ai.ai-thinking {
  color: var(--sh-text-3);
  font-style: italic;
}
.ai-chat-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--sh-bg-card);
  border-top: 1px solid var(--sh-border-light);
}
.ai-chat-input-bar textarea {
  flex: 1;
  border: 1px solid var(--sh-border-light);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: none;
  max-height: 100px;
  outline: none;
  background: var(--sh-bg-page);
  color: var(--sh-text-1);
}
.ai-chat-input-bar textarea:focus {
  border-color: var(--sh-primary);
}
.ai-send-btn {
  background: var(--sh-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.ai-send-btn:active { opacity: 0.7; }
.ai-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* 当前草稿卡片 */
.ai-draft-card {
  margin: 8px 12px 16px;
  background: linear-gradient(135deg, #fff8e6, #fffbf0);
  border: 1px solid #f5c241;
  border-radius: 10px;
  padding: 12px 14px;
  box-shadow: 0 2px 8px rgba(245, 194, 65, 0.12);
}
[data-theme="dark"] .ai-draft-card {
  background: linear-gradient(135deg, #3a2f1a, #2a2519);
  border-color: #8b6f1d;
}
.ai-draft-title {
  font-size: 13px;
  font-weight: 600;
  color: #b88300;
  margin-bottom: 8px;
}
[data-theme="dark"] .ai-draft-title { color: #f5c241; }
.ai-draft-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-draft-row {
  display: flex;
  font-size: 13px;
  line-height: 1.5;
  padding: 3px 0;
}
.ai-draft-key {
  color: var(--sh-text-3);
  flex: 0 0 90px;
}
.ai-draft-val {
  color: var(--sh-text-1);
  font-weight: 500;
  word-break: break-all;
  flex: 1;
}
.ai-draft-confirm {
  margin-top: 10px;
  width: 100%;
  background: #00b86b;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ai-draft-confirm:active { opacity: 0.85; }
.ai-draft-hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sh-text-3);
  text-align: center;
  padding-top: 6px;
  border-top: 1px dashed var(--sh-border-light);
}

/* 新建订单页顶部 AI 助手栏 (可折叠) */
.ai-assist-bar {
  background: linear-gradient(135deg, #f0f7ff, #e6f0ff);
  border-bottom: 1px solid #d0ddf0;
  overflow: hidden;
  max-height: 44px;
  transition: max-height 0.25s ease;
}
[data-theme="dark"] .ai-assist-bar {
  background: linear-gradient(135deg, #1e2a3d, #18222f);
  border-bottom-color: #2c3a52;
}
.ai-assist-bar.expanded {
  max-height: 360px;
}
.ai-assist-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  font-size: 14px;
  color: var(--sh-text-1);
  font-weight: 500;
}
.ai-assist-head:active { opacity: 0.7; }
.ai-assist-arrow {
  font-size: 11px;
  color: var(--sh-text-3);
  width: 14px;
  display: inline-block;
}
.ai-assist-title {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex: 1;
}
.ai-assist-sub {
  font-size: 12px;
  color: var(--sh-text-3);
  font-weight: 400;
}
.ai-assist-status {
  font-size: 12px;
  color: var(--sh-text-3);
  font-style: italic;
}
.ai-assist-body {
  padding: 0 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ai-assist-log {
  max-height: 220px;
  overflow-y: auto;
  background: var(--sh-bg-card);
  border: 1px solid var(--sh-border-light);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.ai-assist-log:empty { display: none; }
.ai-assist-msg-user { color: var(--sh-primary); }
.ai-assist-msg-ai { color: var(--sh-text-1); }
.ai-assist-input-row {
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.ai-assist-input-row textarea {
  flex: 1;
  border: 1px solid var(--sh-border-light);
  border-radius: 6px;
  padding: 7px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  outline: none;
  background: var(--sh-bg-card);
  color: var(--sh-text-1);
  min-height: 32px;
  max-height: 80px;
}
.ai-assist-input-row textarea:focus { border-color: var(--sh-primary); }
.ai-assist-send {
  background: var(--sh-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 7px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
}
.ai-assist-send:active { opacity: 0.75; }

/* 桌面端聊天页稍微居中, 不撑满 */
@media (min-width: 769px) {
  .ai-chat-page {
    max-width: 720px;
    margin: 0 auto;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.08);
  }
}

/* ===== 问题反馈 小窗口 (不占全屏, 让员工能同时看到主界面) ===== */
.fb-panel {
  position: fixed;
  right: 16px;
  bottom: 140px;  /* FAB 上方 (FAB bottom=72px + 高度 52px + 16px 间距) */
  width: 380px;
  max-width: calc(100vw - 32px);
  height: 480px;
  max-height: calc(100vh - 200px);
  background: var(--sh-bg-card);
  border-radius: 14px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  z-index: 89;  /* 比 FAB (90) 低, 让 FAB 浮在最前 */
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: fbSlideUp 0.22s cubic-bezier(0.25, 0.1, 0.25, 1);
}
.fb-panel.open { display: flex; }
@keyframes fbSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fb-panel-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  background: var(--sh-primary);
  color: #fff;
  flex-shrink: 0;
}
.fb-panel-head .fb-title {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
}
.fb-panel-head .fb-tag {
  font-size: 10px;
  background: rgba(255,255,255,0.22);
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 500;
}
.fb-panel-head .fb-close {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
  font-weight: 300;
  -webkit-tap-highlight-color: transparent;
}
.fb-panel-head .fb-close:hover { opacity: 0.7; }
.fb-panel-meta {
  padding: 8px 14px;
  font-size: 11px;
  color: var(--sh-text-3);
  background: var(--sh-bg-page);
  border-bottom: 1px solid var(--sh-border-light);
  flex-shrink: 0;
}
.fb-panel-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  -webkit-overflow-fallback: touch;
}
.fb-msg {
  max-width: 88%;
  margin-bottom: 8px;
  padding: 8px 12px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
.fb-msg-meta {
  font-size: 10px;
  opacity: 0.7;
  margin-bottom: 3px;
}
.fb-msg-me {
  margin-left: auto;
  background: var(--sh-primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.fb-msg-sys {
  margin-right: auto;
  background: var(--sh-bg-page);
  color: var(--sh-text-1);
  border-bottom-left-radius: 4px;
}
.fb-panel-input-bar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: var(--sh-bg-card);
  border-top: 1px solid var(--sh-border-light);
  flex-shrink: 0;
}
.fb-panel-input-bar textarea {
  flex: 1;
  border: 1px solid var(--sh-border-light);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 13px;
  font-family: inherit;
  resize: none;
  max-height: 80px;
  outline: none;
  background: var(--sh-bg-page);
  color: var(--sh-text-1);
  min-height: 32px;
}
.fb-panel-input-bar textarea:focus { border-color: var(--sh-primary); }
.fb-send-btn {
  background: var(--sh-primary);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.fb-send-btn:active { opacity: 0.7; }
.fb-send-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* mobile 上小窗口改全屏 (留点边距) */
@media (max-width: 768px) {
  .fb-panel {
    right: 8px;
    left: 8px;
    bottom: 140px;
    width: auto;
    max-width: none;
    height: 65vh;
    max-height: 65vh;
  }
}

/* ===== 申请居间费 — 按业务来源分组视图 ===== */
.fee-toggle {
  display: inline-flex;
  border: 1px solid var(--sh-border);
  border-radius: var(--sh-r-sm);
  overflow: hidden;
  background: var(--sh-bg-card);
}
.fee-toggle-btn {
  padding: 6px 14px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: var(--sh-tx-sm);
  font-weight: 500;
  color: var(--sh-text-2);
  font-family: inherit;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.fee-toggle-btn.active {
  background: var(--sh-primary);
  color: #fff;
}
.fee-toggle-btn:not(.active):hover { background: var(--sh-bg-hover); color: var(--sh-text-1); }

#feeBySourceWrap {
  padding: 16px 24px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
}
.fee-source-card {
  background: var(--sh-bg-card);
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-md);
  padding: 16px 18px;
  box-shadow: var(--sh-shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.fee-source-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--sh-border-light);
}
.fee-source-title {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.fee-source-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--sh-text-1);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fee-source-mgr {
  font-size: 11px;
  color: var(--sh-text-3);
}
.fee-source-count {
  background: var(--sh-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--sh-r-pill);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.fee-source-stats {
  display: flex;
  gap: 8px;
}
.fee-source-stats .stat {
  flex: 1;
  background: var(--sh-bg-page);
  padding: 8px 10px;
  border-radius: var(--sh-r-sm);
  min-width: 0;
}
.fee-source-stats .stat-label {
  font-size: 10px;
  color: var(--sh-text-3);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.fee-source-stats .stat-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--sh-text-1);
  font-variant-numeric: tabular-nums;
  font-family: var(--sh-font-num);
}
.fee-source-stats .stat-highlight {
  background: linear-gradient(135deg, #fff4e0, #fff8e6);
}
.fee-source-stats .stat-highlight .stat-val { color: #FF9500; }
[data-theme="dark"] .fee-source-stats .stat-highlight {
  background: linear-gradient(135deg, #3a2f1a, #2a2519);
}
.fee-source-apply-btn {
  width: 100%;
  background: var(--sh-success);
  color: #fff;
  border: none;
  border-radius: var(--sh-r-sm);
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.fee-source-apply-btn:hover { background: #2BA84A; }
.fee-source-apply-btn:active { opacity: 0.8; }

@media (max-width: 768px) {
  #feeBySourceWrap {
    padding: 10px 12px;
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* 申请居间费 — 中间人卡片下的订单列表 (展开) */
.fee-source-toggle-btn {
  width: 100%;
  background: var(--sh-bg-page);
  color: var(--sh-text-2);
  border: 1px solid var(--sh-border-light);
  border-radius: var(--sh-r-sm);
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: all 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.fee-source-toggle-btn:hover { background: var(--sh-bg-hover); color: var(--sh-text-1); }
.fee-source-toggle-arrow { font-size: 10px; color: var(--sh-text-3); margin-left: 8px; }

.fee-source-orders {
  margin-top: -2px;
  background: var(--sh-bg-page);
  border: 1px solid var(--sh-border-light);
  border-top: none;
  border-radius: 0 0 var(--sh-r-sm) var(--sh-r-sm);
  max-height: 280px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.fee-source-order-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--sh-border-light);
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.fee-source-order-row:last-child { border-bottom: none; }
.fee-source-order-row:hover { background: var(--sh-bg-hover); }
.fee-source-order-row:active { background: var(--sh-primary-lighter); }
.fee-source-order-name {
  color: var(--sh-text-1);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.fee-source-order-amt {
  color: var(--sh-text-3);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.fee-source-order-fee {
  color: var(--sh-warning);
  font-weight: 700;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

@media (max-width: 768px) {
  .fee-source-order-row {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 10px 12px;
  }
  .fee-source-order-amt { font-size: 11px; }
  .fee-source-order-fee { font-size: 12px; }
}

/* ===== 我的订单 全屏页 表格 ===== */
.my-orders-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 0;
}
.my-orders-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  font-size: 13px;
}
.my-orders-table thead th {
  background: var(--sh-bg-card);
  position: sticky;
  top: 0;
  font-weight: 600;
  color: var(--sh-text-2);
  padding: 10px 12px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--sh-border);
  text-align: left;
  white-space: nowrap;
  z-index: 2;
}
.my-orders-table tbody td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--sh-border-light);
  white-space: nowrap;
  color: var(--sh-text-1);
}
.my-orders-table tbody tr:hover { background: var(--sh-bg-hover); }
.my-orders-table tbody tr:last-child td { border-bottom: none; }

@media (max-width: 768px) {
  /* mobile 上 5 个 tab 缩小 */
  .bn-tab .bn-text { font-size: 10px; }
  .bn-tab .bn-icon { font-size: 20px; }
  /* 我的订单 mobile 表格字号缩到 11px, 让一屏多看几行 */
  .my-orders-table { font-size: 11px; }
  .my-orders-table thead th { font-size: 10px; padding: 8px 6px; }
  .my-orders-table tbody td { padding: 6px 6px; }
}
