/* ==========================================================
   七彩工单系统 - 全局样式
   ========================================================== */
:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #eff6ff;
  --success: #16a34a;
  --success-light: #f0fdf4;
  --warning: #ea580c;
  --warning-light: #fff7ed;
  --danger: #dc2626;
  --danger-light: #fef2f2;
  --text: #1f2937;
  --text-sub: #6b7280;
  --border: #e5e7eb;
  --bg: #f3f4f6;
  --card: #ffffff;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(0, 0, 0, .08);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, .12);
  --rainbow: linear-gradient(90deg, #f56c6c, #e6a23c, #67c23a, #409eff, #9b59b6, #00bcd4, #ff6b9d);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
}
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ========== 顶部导航 ========== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #fff;
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.topbar-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  height: 58px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-rainbow {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--rainbow);
  display: inline-block;
  position: relative;
}
.brand-rainbow::after {
  content: "工";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 16px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
.brand-name { font-size: 17px; letter-spacing: 1px; }
.main-nav { display: flex; gap: 4px; flex: 1; }
.nav-link {
  padding: 7px 14px;
  border-radius: 8px;
  color: var(--text);
  font-weight: 500;
}
.nav-link:hover { background: var(--bg); text-decoration: none; }
.nav-link.active { background: var(--primary-light); color: var(--primary); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.user-chip { display: flex; align-items: center; gap: 8px; }
.user-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--rainbow);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.user-name { font-weight: 500; }
.role-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
}
.role-admin { background: var(--warning-light); color: var(--warning); border: 1px solid #fdba74; }
.role-operator { background: var(--primary-light); color: var(--primary); border: 1px solid #bfdbfe; }
.logout-btn {
  color: var(--text-sub);
  border: 1px solid var(--border);
  padding: 5px 12px;
  border-radius: 8px;
  font-size: 13px;
}
.logout-btn:hover { color: var(--danger); border-color: #fca5a5; text-decoration: none; }

/* ========== 页面容器 ========== */
.page { max-width: 1280px; margin: 20px auto 60px; padding: 0 20px; }

/* ========== 卡片 ========== */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 20px;
}
.card-narrow { max-width: 860px; }
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.card-head h2 { margin: 0; font-size: 18px; }
.card-sub { font-size: 13px; color: var(--text-sub); font-weight: 400; margin-left: 8px; }
.card-actions { display: flex; gap: 8px; }

/* ========== 统计卡片 ========== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  padding: 18px 20px;
}
.stat-box {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-label { font-size: 13px; color: var(--text-sub); }
.stat-value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.stat-blue { color: var(--primary); }
.stat-orange { color: var(--warning); }
.stat-red { color: var(--danger); }
.stat-purple { color: #9b59b6; }
/* 可点击统计卡片 */
.stat-link {
  display: block;
  text-decoration: none;
  cursor: pointer;
  transition: box-shadow .15s, transform .1s, border-color .15s;
}
.stat-link:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 14px rgba(29, 111, 209, .15);
  transform: translateY(-1px);
}
.stat-link:active { transform: translateY(0); }

/* ========== 按钮 ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  transition: all .15s;
  text-decoration: none;
  line-height: 1.4;
}
.btn:hover { text-decoration: none; filter: brightness(.96); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-success { background: var(--success); color: #fff; }
.btn-warning { background: var(--warning); color: #fff; }
.btn-danger { background: var(--danger); color: #fff; }
.btn-default { background: #fff; border-color: var(--border); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--text-sub); }
.btn-danger-ghost { background: transparent; border-color: #fecaca; color: var(--danger); }
.btn-danger-ghost:hover { background: var(--danger-light); }
.btn-block { width: 100%; }
.btn-lg { padding: 11px 22px; font-size: 15px; }
.btn-xs { padding: 4px 10px; font-size: 12.5px; border-radius: 6px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

/* ========== 表单 ========== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-weight: 500; margin-bottom: 6px; font-size: 13.5px; }
.form-group .req { color: var(--danger); }
input[type=text], input[type=password], input[type=number], input[type=color],
input[type=search], input[type=tel], select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}
textarea { resize: vertical; }
input[type=file] { padding: 8px; border: 1px dashed var(--border); border-radius: 8px; background: #fafafa; }
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--primary); }
.switch-label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 9px 12px; border: 1px solid var(--border); border-radius: 8px; background: #fafafa; }
.hint { font-size: 12.5px; color: var(--text-sub); }
.form-errors {
  background: var(--danger-light);
  border: 1px solid #fecaca;
  color: var(--danger);
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.form-actions { display: flex; gap: 10px; margin-top: 8px; align-items: center; }
.customer-picker { display: flex; gap: 8px; }
.customer-picker select { flex: 1; }
.receivable-box {
  border: 1px dashed #c7d2fe;
  background: var(--primary-light);
  border-radius: 8px;
  padding: 9px 12px;
  min-height: 40px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.receivable-amount { font-size: 18px; font-weight: 700; color: var(--primary); }
.receivable-sub { font-size: 12.5px; color: var(--text-sub); }

/* 权限勾选 */
.perm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.perm-item {
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  cursor: pointer;
  font-size: 13.5px;
  background: #fafafa;
}
.perm-item:hover { border-color: var(--primary); }

/* ========== 筛选栏 ========== */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}
.filter-bar input[type=text] { width: 240px; }
.filter-bar select { width: 150px; }
.filter-bar input[type=date] { width: 150px; padding: 9px 10px; }
.filter-sep { color: var(--text-sub); font-size: 13.5px; }
.filter-tip {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #f0f6ff;
  border: 1px solid #cfe2ff;
  color: var(--text-main);
  border-radius: 6px;
  padding: 8px 12px;
  margin: -4px 0 12px;
  font-size: 13.5px;
}
.filter-tip strong { color: #1d6fd1; }
.check-inline { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text-sub); }

/* ========== 批量操作栏 ========== */
.batch-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: #fff7e6;
  border: 1px solid #ffe0a3;
  border-radius: 6px;
  padding: 8px 12px;
  margin: -4px 0 12px;
  font-size: 13.5px;
}
.batch-info strong { color: #d9822b; }
.batch-status-select { padding: 5px 8px; border: 1px solid var(--border); border-radius: 4px; font-size: 13px; }

/* ========== 标题：点击进详情 + 悬停显示明细 ========== */
.title-cell { position: relative; }
.title-link { color: var(--link, #1d6fd1); text-decoration: none; font-weight: 500; }
.title-link:hover { text-decoration: underline; }
.title-tip {
  display: none;
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 60;
  min-width: 320px;
  max-width: 560px;
  max-height: 260px;
  overflow-y: auto;
  padding: 10px 12px;
  background: #fff;
  border: 1px solid #cfe0f5;
  border-radius: 6px;
  box-shadow: 0 6px 18px rgba(30, 80, 140, .14);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-main);
  white-space: pre-wrap;
  word-break: break-word;
}
.title-cell:hover .title-tip,
.title-cell:focus-within .title-tip { display: block; }

/* ========== 数据表格 ========== */
.table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
  padding: 11px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.data-table th {
  font-size: 12.5px;
  color: var(--text-sub);
  font-weight: 600;
  background: #fafafa;
  white-space: nowrap;
}
.data-table tbody tr:hover { background: #f8faff; }
.data-table tr.row-urgent { background: #fffbf5; }
.data-table tr.row-urgent:hover { background: #fff6e8; }
.empty-row { text-align: center; color: var(--text-sub); padding: 40px 0 !important; }
.ta-right { text-align: right; }
.ta-center { text-align: center; }
.nowrap { white-space: nowrap; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--text-sub); }
.cell-title { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.price-cell { font-weight: 600; white-space: nowrap; }
.price-big { font-size: 20px; font-weight: 700; }
.price-purple { color: #9b59b6; }
.price-unpaid { color: var(--danger); font-weight: 700; }
.price-paid { color: var(--success); }
.order-no-link { font-weight: 600; font-family: Consolas, Monaco, monospace; }
.inline-form { display: inline-block; margin-left: 4px; }
.status-select { width: auto; padding: 4px 8px; font-size: 12.5px; border-radius: 6px; }

/* ========== 徽章 ========== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
}
.badge-blue { background: #3b82f6; }
.badge-orange { background: #f97316; }
.badge-green { background: #22c55e; }
.badge-red { background: #ef4444; }
.badge-gray { background: #9ca3af; }
.urgent-badge { animation: urgent-pulse 1.6s infinite; }
@keyframes urgent-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, .45); }
  50% { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

/* ========== 类别管理 ========== */
.category-add { display: flex; gap: 10px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; }
.category-add input[type=text] { width: 240px; }
.category-add input[type=color] { width: 50px; height: 40px; padding: 4px; cursor: pointer; }
.category-add input[type=number] { width: 90px; }
.sort-num { width: 70px !important; padding: 5px 8px !important; }
.color-swatch { display: inline-block; width: 16px; height: 16px; border-radius: 4px; vertical-align: middle; margin-right: 6px; }
.palette { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.palette-swatch {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform .1s;
}
.palette-swatch:hover { transform: scale(1.12); }
.palette-swatch.selected { border-color: #111; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #111; }
.palette input[type=color] { width: 40px; height: 30px; padding: 2px; cursor: pointer; }

/* ========== 详情页 ========== */
.detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 8px; }
.detail-block {
  background: #fafafa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
}
.detail-item { padding: 5px 0; }
.detail-label { display: inline-block; width: 92px; color: var(--text-sub); font-size: 13px; }
.detail-value { font-size: 14px; font-weight: 500; }
.detail-section { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
.detail-section h3 { margin: 0 0 10px; font-size: 15px; }
.detail-title-text { font-size: 15px; font-weight: 600; }
.detail-rich { min-height: 40px; max-height: 320px; overflow-y: auto; padding-right: 6px; }
.detail-rich img { max-width: 100%; }
.detail-remark { white-space: pre-line; }
.empty-text { color: var(--text-sub); font-size: 13px; }
.detail-foot { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--border); display: flex; gap: 10px; }

/* 操作日志 */
.log-list { max-height: 260px; overflow-y: auto; }
.log-item {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dashed var(--border);
  font-size: 13.5px;
}
.log-time { color: var(--text-sub); font-family: Consolas, monospace; font-size: 12.5px; white-space: nowrap; }
.log-op { font-weight: 600; white-space: nowrap; }
.log-action { color: var(--text-sub); }

/* ========== 附件 ========== */
.attach-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.attach-item {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  background: #fafafa;
  max-width: 640px;
}
.attach-icon {
  background: var(--rainbow);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: .5px;
}
.attach-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attach-size { color: var(--text-sub); font-size: 12.5px; white-space: nowrap; }

/* ========== 分页 ========== */
.pager { display: flex; justify-content: space-between; align-items: center; margin-top: 16px; flex-wrap: wrap; gap: 10px; }
.pager-info { color: var(--text-sub); font-size: 13px; }
.pager-btns { display: flex; gap: 8px; }

/* ========== 弹窗 ========== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, .45);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal {
  background: #fff;
  border-radius: 12px;
  width: 460px;
  max-width: calc(100vw - 40px);
  max-height: calc(100vh - 80px);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { margin: 0; font-size: 16px; }
.modal-close { border: none; background: none; font-size: 22px; cursor: pointer; color: var(--text-sub); line-height: 1; }
.modal-close:hover { color: var(--danger); }
.modal-body { padding: 18px 20px; }
.modal-foot { padding: 14px 20px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 10px; }

/* ========== Toast ========== */
.flash-wrap { position: fixed; top: 70px; right: 20px; z-index: 2000; display: flex; flex-direction: column; gap: 10px; }
.toast {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  border-radius: 8px;
  padding: 12px 18px;
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  animation: toast-in .25s ease;
  max-width: 420px;
}
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
.toast-warning { border-left-color: var(--warning); }
@keyframes toast-in {
  from { opacity: 0; transform: translateX(30px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ========== 登录页 ========== */
.login-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eef2ff 0%, #fdf2f8 100%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: var(--shadow-lg);
  width: 400px;
  max-width: calc(100vw - 40px);
  padding: 36px 34px;
  position: relative;
  overflow: hidden;
}
.login-card::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 5px;
  background: var(--rainbow);
}
.login-brand { text-align: center; margin-bottom: 24px; }
.login-brand h1 { font-size: 22px; margin: 12px 0 4px; }
.login-brand p { color: var(--text-sub); font-size: 13px; margin: 0; }
.brand-rainbow-lg { width: 56px; height: 56px; border-radius: 14px; display: inline-block; }
.brand-rainbow-lg::after { font-size: 24px; }
.login-error {
  background: var(--danger-light);
  color: var(--danger);
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 10px 14px;
  margin-bottom: 16px;
  font-size: 13.5px;
}
.login-hint { text-align: center; color: var(--text-sub); font-size: 12.5px; margin-top: 18px; line-height: 1.8; }

/* 登录验证码 */
.captcha-row { display: flex; align-items: center; gap: 12px; }
.captcha-question {
  flex: 0 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 14px;
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
  letter-spacing: 2px;
  min-width: 86px;
  text-align: center;
}
.captcha-input { width: 90px; text-align: center; font-size: 16px; }

/* ========== 打印 ========== */
@media print {
  .topbar, .card-actions, .detail-foot, .inline-form, .flash-wrap, .logout-btn { display: none !important; }
  body { background: #fff; }
  .page { margin: 0; padding: 0; max-width: none; }
  .card { border: none; box-shadow: none; padding: 0; }
  .detail-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ========== 响应式 ========== */
/* 汉堡按钮（默认隐藏，手机端显示）与抽屉（checkbox 纯 CSS 控制） */
.nav-check { display: none; }
.nav-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 18px;
  color: var(--text);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  margin-left: auto;
  user-select: none;
}
.nav-toggle:hover { background: var(--bg); }
.nav-logout-mobile { display: none; }
.mobile-mask { display: none; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid, .detail-grid { grid-template-columns: 1fr; }
  .perm-grid { grid-template-columns: repeat(2, 1fr); }
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 16px; gap: 8px; }
  .main-nav { order: 3; width: 100%; overflow-x: auto; }
  .filter-bar input[type=text] { width: 100%; }
}

/* ========== 手机端（≤768px） ========== */
@media (max-width: 768px) {
  /* 顶栏：logo 居左、菜单按钮固定在右上角，菜单收入抽屉 */
  .topbar-inner { flex-wrap: nowrap; height: 54px; padding: 0 12px; gap: 8px; position: relative; }
  .brand-name { font-size: 15px; }
  .user-chip { display: none; }
  .logout-btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .topbar-right { margin-left: auto; }
  .main-nav {
    position: fixed;
    top: 0;
    right: -280px;
    width: 260px;
    height: 100%;
    z-index: 210;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 64px 14px 24px;
    background: #fff;
    box-shadow: -6px 0 24px rgba(0, 0, 0, .12);
    border-left: 1px solid var(--border);
    transition: right .22s ease;
    order: 0;
    overflow-y: auto;
  }
  .nav-check:checked ~ .main-nav { right: 0; }
  .main-nav .nav-link {
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 15px;
    display: block;
  }
  .nav-logout-mobile { display: block; border-top: 1px solid var(--border); margin-top: 8px; border-radius: 0; padding-top: 14px !important; color: var(--danger) !important; }
  .mobile-mask {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .38);
    z-index: 200;
    cursor: pointer;
  }
  .nav-check:checked ~ .mobile-mask { display: block; }

  /* 统计卡片：4 项一行、缩小（第4列“未收款总额”需放得下） */
  .stat-grid { grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 8px 8px; }
  .stat-box { padding: 6px 2px; text-align: center; }
  .stat-label { font-size: 9px; line-height: 1.25; }
  .stat-value { font-size: 13px; margin-top: 2px; letter-spacing: -0.2px; }

  /* 工单列表：卡片式重排（含明细） */
  .table-wrap { overflow-x: visible; }
  .data-table thead { display: none; }
  .data-table tbody tr {
    display: block;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 12px;
    background: #fff;
  }
  .data-table tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 5px 0;
    border: none;
    font-size: 13.5px;
    text-align: right;
  }
  .data-table tbody td[data-label]::before {
    content: attr(data-label);
    flex: 0 0 auto;
    color: var(--text-sub);
    font-size: 12px;
    white-space: nowrap;
  }
  /* 首列复选框：整行显示 */
  .data-table tbody td:first-child { display: block; padding: 2px 0 6px; }
  .data-table tbody td:first-child::before { content: none; }
  /* 标题行：标题 + 明细（明细直接展示） */
  .data-table tbody td.title-cell {
    display: block;
    text-align: left;
    border-bottom: 1px dashed var(--border);
    margin: 4px 0 2px;
    padding-bottom: 8px;
  }
  .data-table tbody td.title-cell::before { content: none; }
  .title-link { font-size: 15px; font-weight: 600; }
  .title-tip {
    display: block;
    position: static;
    min-width: 0;
    max-width: none;
    max-height: none;
    box-shadow: none;
    border: none;
    background: var(--bg);
    padding: 8px 10px;
    margin-top: 6px;
    font-size: 12.5px;
    line-height: 1.6;
  }
  /* 状态/客户 等右对齐子元素 */
  .cell-main { flex: 1; text-align: right; }
  .cell-sub { flex: 1; text-align: right; }
  .price-cell { font-weight: 700; }
  /* 操作按钮组：换行排列 */
  .data-table tbody td:last-child {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 6px;
    text-align: left;
    border-top: 1px dashed var(--border);
    margin-top: 6px;
    padding-top: 8px;
  }
  .data-table tbody td:last-child::before { content: none; }
  .inline-form { display: inline-flex; }
  /* 批量栏与分页适配 */
  .batch-bar { margin: 0 0 12px; }
  .pager { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card { padding: 14px; }
  .card-head h2 { font-size: 16px; }
  .filter-bar { padding: 8px 0; }
  .filter-bar input[type=date] { flex: 1; min-width: 0; }

  /* 手机端详情页：只保留 客户名称/标题/明细/备注/本单价格/客户应收/现金结算 */
  .d-mob-hide { display: none !important; }
  .detail-grid { grid-template-columns: 1fr; gap: 4px; }
  .detail-block { border-bottom: 1px dashed var(--border); padding: 4px 0; }
  .detail-item { flex-direction: row; justify-content: space-between; align-items: center; padding: 7px 0; }
  .detail-label { flex: 0 0 96px; }
  .detail-value { flex: 1; text-align: right; }

  /* 手机端明细文本框（简易编辑器） */
  .detail-textarea {
    max-height: 320px;
    min-height: 120px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.7;
    width: 100%;
    box-sizing: border-box;
  }
  .m-upload-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 8px;
  }
  .m-upload-hint { font-size: 12px; color: var(--text-sub); flex: 1 1 100%; }
  .btn-sm { padding: 6px 12px; font-size: 13px; }
}
