* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #1e293b;
  --text-light: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --radius: 12px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
  --shadow-lg: 0 10px 25px rgba(0,0,0,0.1), 0 4px 10px rgba(0,0,0,0.05);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

/* 顶部导航 */
.navbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.navbar-brand {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
}
/* 品牌文字：默认显示全称，隐藏简称 */
.brand-full { display: inline; }
.brand-short { display: none; }

/* 小屏或空间紧张时：显示简称，防止叠成两行 */
@media (max-width: 640px) {
  .brand-full { display: none; }
  .brand-short { display: inline; }
}

/* 强制 brand 不换行，避免 logo 和文字被挤成多行 */
.navbar-brand {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;   /* 允许 flex 收缩 */
}
.navbar-brand .logo {
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 16px; font-weight: 800;
}
.navbar-user {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px; color: var(--text-light);
}
.navbar-user .user-cn {
  background: #eff6ff; color: var(--primary);
  padding: 4px 12px; border-radius: 20px; font-weight: 600;
  border: none; cursor: pointer; font-size: 14px;
  transition: background 0.2s;
}
.navbar-user .user-cn:hover {
  background: #dbeafe;
}
.btn-logout {
  background: none; border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 8px; cursor: pointer;
  font-size: 13px; color: var(--text-light);
  transition: all 0.2s;
}
.btn-logout:hover { border-color: var(--danger); color: var(--danger); }

/* 容器 */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 32px 20px;
}

/* 登录页 */
.login-wrapper {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 50%, #f0fdfa 100%);
  padding: 20px;
}
.login-card {
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}
.login-card h1 {
  font-size: 24px; font-weight: 700;
  text-align: center; margin-bottom: 8px;
  color: var(--text);
}
.login-card .subtitle {
  text-align: center; color: var(--text-light);
  font-size: 14px; margin-bottom: 28px;
}
.form-group { margin-bottom: 10px; }
.form-group .compact { 
    margin-bottom: 8px;
}
.form-group label {
  display: block; font-size: 13px; font-weight: 600;
  color: var(--text); margin-bottom: 6px;
}
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px;
  color: var(--text); background: var(--card);
  transition: border-color 0.2s, box-shadow 0.2s;
  font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none; border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group .readonly {
  background: #f1f5f9; color: var(--text-light);
  cursor: not-allowed;
}

.btn-primary {
  width: 100%; padding: 12px;
  background: var(--primary); color: white;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600;
  cursor: pointer; transition: background 0.2s;
}
.btn-primary:hover { background: var(--primary-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  padding: 10px 20px;
  background: var(--card); color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px; font-size: 14px;
  cursor: pointer; transition: all 0.2s;
}
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }

/* 主站功能卡片 */
.page-title {
  font-size: 22px; font-weight: 700;
  margin-bottom: 6px; color: var(--text);
}
.page-desc {
  color: var(--text-light); font-size: 14px;
  margin-bottom: 28px;
}
.feature-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 18px;
}
.feature-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 22px;
  cursor: pointer;
  transition: all 0.25s;
  text-align: center;
}
.feature-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}
.feature-icon {
  width: 56px; height: 56px;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
  font-size: 26px;
}
.feature-card:nth-child(1) .feature-icon { background: #fef3c7; color: #d97706; }
.feature-card:nth-child(2) .feature-icon { background: #dbeafe; color: #2563eb; }
.feature-card:nth-child(3) .feature-icon { background: #d1fae5; color: #059669; }
.feature-card:nth-child(4) .feature-icon { background: #fce7f3; color: #db2777; }
.feature-card:nth-child(5) .feature-icon { background: #fce7f3; color: #db2777; }
.feature-card h3 {
  font-size: 16px; font-weight: 600;
  margin-bottom: 4px; color: var(--text);
}
.feature-card p {
  font-size: 12px; color: var(--text-light);
}

/* 筛选栏 */
.filter-bar {
  display: flex; gap: 12px; flex-wrap: wrap;
  margin-bottom: 20px; align-items: flex-end;
}
.filter-bar .form-group { margin-bottom: 0; min-width: 140px; flex: 1; }
.filter-bar .btn-secondary { height: 42px; }

/* 数据表格 */
.data-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.data-table th {
  background: #f8fafc;
  padding: 12px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table td {
  padding: 12px 14px;
  font-size: 13px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: top;
}
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover { background: #f8fafc; }

.status-tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}
.status-tag.green { background: #d1fae5; color: #059669; }
.status-tag.blue { background: #dbeafe; color: #2563eb; }
.status-tag.yellow { background: #fef3c7; color: #d97706; }
.status-tag.orange { background: #ffedd5; color: #ea580c; }
.status-tag.red { background: #fee2e2; color: #dc2626; }
.status-tag.gray { background: #f1f5f9; color: #64748b; }
.status-tag.purple { background: #ede9fe; color: #7c3aed; }

/* 卡片列表（移动端友好） */
.card-list { display: flex; flex-direction: column; gap: 12px; }
.data-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.data-card-header {
  display: flex; justify-content: space-between;
  align-items: flex-start; margin-bottom: 10px;
}
.data-card-title {
  font-size: 15px; font-weight: 600; color: var(--text);
}
.data-card-body { font-size: 13px; color: var(--text-light); }
.data-card-row {
  display: flex; justify-content: space-between;
  padding: 4px 0; border-bottom: 1px solid #f8fafc;
}
.data-card-row:last-child { border-bottom: none; }
.data-card-row .label { color: var(--text-light); }
.data-card-row .value { color: var(--text); font-weight: 500; text-align: right; max-width: 60%; }

/* 金额高亮 */
.amount-highlight {
  font-size: 20px; font-weight: 700;
  color: var(--danger);
}

/* 空状态 */
.empty-state {
  text-align: center; padding: 60px 20px;
  color: var(--text-light);
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty-state p { font-size: 14px; }

/* 加载 */
.loading {
  text-align: center; padding: 40px;
  color: var(--text-light); font-size: 14px;
}
.spinner {
  display: inline-block; width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-right: 8px; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

#toast-container {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}

/* 提示消息 */
.toast {
  position: relative;
  padding: 12px 24px;
  border-radius: 10px;
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-lg);
  animation: slideDown 0.3s ease;
  pointer-events: auto;
}
.toast.success { background: #d1fae5; color: #065f46; }
.toast.error { background: #fee2e2; color: #991b1b; }
.toast.info { background: #dbeafe; color: #1e40af; }
.toast.warning { background: #fef3c7; color: #92400e; }
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 返回按钮 */
.back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-light); font-size: 14px;
  cursor: pointer; margin-bottom: 20px;
  background: none; border: none;
  transition: color 0.2s;
}
.back-btn:hover { color: var(--primary); }

/* 表单卡片 */
.form-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow);
  max-width: 600px;
  margin: 0 auto;
}
.form-card h2 {
  font-size: 18px; font-weight: 700;
  margin-bottom: 20px; color: var(--text);
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 10px;
}
.form-row .form-group {
    margin-bottom: 0 !important;
}
.payee-group {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  padding: 16px;
}
.group-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
}
.group-scroll {
  max-height: 300px;
  overflow-y: auto;
  margin: 12px 0;
}
.record-info .row {
  display: flex;
  gap: 6px;
}
.btn-upload, .btn-merge {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.btn-upload { background: #3b82f6; }
.btn-merge { background: #10b981; margin-top: 8px; width: 100%; padding: 10px; }
/* style.css */
.status-filter-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--card);
  color: var(--text-light);
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}
.filter-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.total-amount-bar {
  background: var(--card);
  padding: 16px 20px;
  border-radius: var(--radius);
  margin-bottom: 20px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--shadow);
  color: var(--danger);
}
.record-item {
  position: relative;          /* 恢复 */
  padding: 4px 0;
  border-bottom: 1px solid #f1f5f9;
}
.record-header {
  margin-bottom: 6px;
}
.record-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  word-break: break-all;
  line-height: 1.4;
}
.record-actions {
  position: absolute;
  top: 4px;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  z-index: 2;
}
.record-details {
  font-size: 13px;
  color: var(--text-light);
}
.record-title {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
}
.record-details .row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);  /* ← 关键：允许收缩到0 */
  gap: 6px;
  padding: 2px 0;
  align-items: start;
  word-break: break-all;                        /* ← 关键：强制长单词换行 */
}
.record-details .row span {
  white-space: nowrap;
}

/* 响应式 */
@media (max-width: 640px) {
  .container { padding: 20px 14px; }
  .navbar { padding: 0 14px; }
  .feature-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .feature-card { padding: 20px 14px; }
  .feature-icon { width: 44px; height: 44px; font-size: 20px; }
  .form-row { grid-template-columns: 1fr; }
  .data-table { display: none; }
  .card-list { display: flex; }
  .login-card { padding: 28px 22px; }

  /* 排发页面表格在移动端强制显示 */
  #paifa-records-table {
    display: table !important;
  }
  
  /* 历史打表表格在移动端强制显示 */
  #dabiao-history-table {
    display: table !important;
    font-size: 12px;
  }
  #dabiao-history-table th,
  #dabiao-history-table td {
    padding: 8px 6px;
  }
  #dabiao-history-table td:nth-child(3) {
    max-width: 120px;
  }
}
@media (min-width: 641px) {
  .card-list { display: none; }
  #paifa-history-content .card-list { display: flex !important; }
  #paifa-manage-content .card-list { display: flex !important; }
}

.hidden { display: none !important; }
/* 弹窗遮罩 */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }

.modal-card {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 520px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h3 { margin: 0; font-size: 16px; }
.modal-close {
  background: none; border: none; font-size: 22px; color: #999;
  cursor: pointer; width: 32px; height: 32px; border-radius: 8px;
}
.modal-close:hover { background: #f5f5f5; color: #333; }

.modal-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.btn-secondary {
  padding: 8px 16px;
  border: 1px solid #e5e7eb;
  background: #fff;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}
.btn-secondary:hover { background: #f9fafb; }

/* 图片网格 */
.image-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.image-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}
.image-item img {
  width: 100%; height: 100%; object-fit: cover;
  display: block;
}
.image-item .delete-btn {
  position: absolute;
  top: 4px; right: 4px;
  width: 22px; height: 22px;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 2px;
}
.image-item .delete-btn:hover { background: rgba(220,38,38,0.85); }

/* 添加按钮 */
.add-image-btn {
  aspect-ratio: 1;
  border: 2px dashed #d1d5db;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 28px;
  color: #9ca3af;
  background: #fafafa;
  transition: all 0.2s;
}
.add-image-btn:hover {
  border-color: #3b82f6;
  color: #3b82f6;
  background: #eff6ff;
}

.modal-tip {
  margin: 12px 0 0;
  font-size: 12px;
  color: #9ca3af;
  text-align: center;
}

.preview-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  touch-action: none;
}
.preview-overlay.hidden { display: none; }

.preview-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-content img {
  max-width: 95%;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: default; /* 允许长按菜单 */
}

.preview-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
  opacity: 0.8;
  pointer-events: none;
}

.preview-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 36px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.preview-nav:active { background: rgba(255,255,255,0.3); }
.preview-prev { left: 12px; }
.preview-next { right: 12px; }

.preview-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.15);
  border: none;
  color: #fff;
  font-size: 24px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
}

/* 隐藏单张图时的左右箭头 */
.preview-overlay.single .preview-nav { display: none; }

/* 多选搜索筛选组件 */
.multi-select {
  position: relative;
  width: 100%;
}
.multi-select-trigger {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 14px;
  min-height: 42px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.multi-select-trigger:hover {
  border-color: var(--primary);
}
.multi-select-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}
.multi-select-text.placeholder {
  color: var(--text-light);
}
.multi-select-arrow {
  font-size: 10px;
  color: var(--text-light);
  margin-left: 8px;
  transition: transform 0.2s;
  flex-shrink: 0;
}
.multi-select.open .multi-select-arrow {
  transform: rotate(180deg);
}
.multi-select-dropdown {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 200;
  max-height: 320px;
  display: flex;
  flex-direction: column;
}
.multi-select-search {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.multi-select-search input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  font-family: inherit;
}
.multi-select-search input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.multi-select-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.multi-select-actions button {
  flex: 1;
  padding: 6px 0;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.multi-select-actions button:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.multi-select-options {
  overflow-y: auto;
  flex: 1;
  padding: 4px 0;
}
.multi-select-option {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  transition: background 0.15s;
}
.multi-select-option:hover {
  background: #f8fafc;
}
.multi-select-option.hidden {
  display: none;
}
.multi-select-option input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.multi-select-option span {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.multi-select-empty {
  padding: 20px;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
}
/* 实时搜索栏 */
.search-bar {
  margin-bottom: 16px;
}
.search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  font-size: 14px;
  color: var(--text-light);
  pointer-events: none;
  z-index: 1;
}
.search-input-wrapper input {
  width: 100%;
  padding: 11px 14px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text);
  background: var(--card);
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.search-input-wrapper input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.search-clear {
  position: absolute;
  right: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: none;
  background: var(--border);
  color: var(--text-light);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  line-height: 1;
  padding-bottom: 2px;
  transition: all 0.2s;
}
.search-clear:hover {
  background: var(--text-light);
  color: white;
}
.search-clear.hidden {
  display: none;
}
/* 排发记录表格 */
#paifa-table-wrapper {
  margin-bottom: 8px;
}
#paifa-records-table td img {
  max-width: 56px !important;
  max-height: 56px !important;
  margin: 0 !important;
  vertical-align: middle;
}
.btn-icon-download {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
  transition: background 0.2s;
  line-height: 1;
}
.btn-icon-download:hover {
  background: #f1f5f9;
}

/* 底部操作栏 */
.paifa-actions-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.paifa-action-btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.paifa-action-btns button {
  padding: 10px 20px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.paifa-action-btns .btn-secondary {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
}
.paifa-action-btns .btn-secondary:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.paifa-action-btns .btn-primary {
  background: var(--primary);
  color: white;
}
.paifa-action-btns .btn-primary:hover {
  background: var(--primary-dark);
}

/* 移动端表格适配 */
@media (max-width: 640px) {
  #paifa-records-table {
    font-size: 12px;
  }
  #paifa-records-table th,
  #paifa-records-table td {
    padding: 8px 4px;
  }
  #paifa-records-table td:nth-child(3) {
    max-width: 90px;
  }
  #paifa-records-table td:nth-child(2) {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .paifa-action-btns {
    width: 100%;
  }
  .paifa-action-btns button {
    flex: 1;
    padding: 10px;
    font-size: 13px;
  }
  .paifa-actions-bar {
    flex-direction: column;
    align-items: stretch;
  }
}

/* 已选计数 + 下载按钮工具栏（在费用表单前面） */
.paifa-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 12px 0;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.paifa-toolbar #paifa-selected-count {
  font-size: 13px;
  color: var(--text-light);
}
.paifa-toolbar .btn-secondary {
  padding: 8px 16px;
  font-size: 13px;
}

/* 费用计算区域 */
#paifa-fee-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 4px;
}
#paifa-fee-section .form-group {
  margin-bottom: 10px;
}
#paifa-fee-section .form-row {
  gap: 10px;
}

/* 灰色提示 */
.hint-text {
  font-size: 12px;
  color: #94a3b8;
  margin: 2px 0 10px;
  line-height: 1.5;
}

/* 费用显示块 */
.fee-display {
  margin-top: 12px;
  padding: 12px;
  background: #f8fafc;
  border-radius: 8px;
}
.fee-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-bottom: 6px;
}
.fee-row.fee-total {
  font-size: 15px;
  font-weight: 700;
  color: var(--danger);
  border-top: 1px solid var(--border);
  padding-top: 8px;
  margin-bottom: 0;
}

/* 黄色警告 */
.warning-text {
  font-size: 12px;
  color: var(--warning);
  margin-top: 10px;
  line-height: 1.5;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .paifa-toolbar {
    flex-direction: row;
    gap: 8px;
  }
  .paifa-toolbar .btn-secondary {
    flex: 0 0 auto;
  }
}

/* 三列布局（省市区） */
.form-row.three-col {
  grid-template-columns: 1fr 1fr 1fr;
}

/* 地址卡片 */
.address-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.address-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.addr-receiver {
  font-weight: 700;
  font-size: 15px;
  color: var(--text);
}
.addr-phone {
  color: var(--text-light);
  font-size: 13px;
  margin-left: 10px;
}
.addr-default-tag {
  display: inline-block;
  margin-left: 8px;
  background: var(--primary);
  color: white;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}
.address-card-body {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  margin-bottom: 12px;
}
.address-card-actions {
  display: flex;
  gap: 16px;
  border-top: 1px solid #f1f5f9;
  padding-top: 10px;
}
.btn-text {
  background: none;
  border: none;
  font-size: 13px;
  color: var(--primary);
  cursor: pointer;
  padding: 0;
}
.btn-text:hover {
  text-decoration: underline;
}
.btn-text.btn-danger {
  color: var(--danger);
}

/* 排发表单中的地址信息卡片 */
#paifa-address-info,
#paifa-new-address-form {
  font-size: 13px;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .form-row.three-col {
    grid-template-columns: 1fr;
  }
  .address-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
  .addr-phone {
    margin-left: 0;
  }
}

/* 历史打表表格 */
#dabiao-history-table td:nth-child(3) {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#dabiao-history-table td:nth-child(2) {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 二维码区域 */
.qr-code-grid {
  display: flex;
  justify-content: center;
  gap: 24px;
  flex-wrap: wrap;
}
.qr-code-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.qr-img {
  width: 120px;
  height: 120px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  padding: 4px;
  object-fit: contain;
}
.qr-label {
  font-size: 12px;
  font-weight: 600;
}
.qr-label.alipay {
  color: #1677ff;
}
.qr-label.wechat {
  color: #07c160;
}

/* 移动端适配 */
@media (max-width: 640px) {
  .qr-img {
    width: 100px;
    height: 100px;
  }
  .qr-code-grid {
    gap: 16px;
  }
}

/* 自助打表表格 */
.dabiao-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  margin-bottom: 8px;
}
.dabiao-table th {
  background: #f8fafc;
  padding: 10px 12px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  border-bottom: 1px solid var(--border);
}
.dabiao-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.dabiao-table td input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
}
.dabiao-table td input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37,99,235,0.1);
}
.dabiao-table .btn-remove-row {
  background: none;
  border: none;
  color: var(--danger);
  cursor: pointer;
  font-size: 18px;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dabiao-table .btn-remove-row:hover {
  background: #fee2e2;
}
.btn-add-row {
  width: 100%;
  padding: 10px;
  background: none;
  border: 1px dashed var(--border);
  border-radius: 0 0 var(--radius) var(--radius);
  cursor: pointer;
  font-size: 13px;
  color: var(--primary);
  font-weight: 600;
  transition: all 0.2s;
}
.btn-add-row:hover {
  background: #f8fafc;
  border-color: var(--primary);
}

/* 输入错误提示 */
.input-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
}
.input-error.hidden {
  display: none;
}

/* cn验证视觉反馈 */
.dabiao-table td input.cn-error {
  border-color: var(--danger);
  background: #fef2f2;
}
.dabiao-table td input.cn-valid {
  border-color: var(--success);
  background: #f0fdf4;
}

/* ========== 自助打表：radio 去圆点 + 间距统一 ========== */

/* radio 组：去圆点 + 紧凑一行 */
.radio-group {
  display: flex;
  gap: 8px;
}
.radio-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--card);
  font-size: 13px;
  flex: 1;
  position: relative;
  text-align: center;
}
/* 彻底隐藏原生 radio 圆点，不占位 */
.radio-label input[type="radio"] {
  appearance: none;
  -webkit-appearance: none;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  border: none;
  outline: none;
  position: absolute;
  opacity: 0;
}
/* 选中状态 */
.radio-label:has(input:checked) {
  border-color: var(--primary);
  background: #eff6ff;
  color: var(--primary);
  font-weight: 600;
}

#dabiao-personal .form-row,
#dabiao-group .form-row,
#dabiao-transfer .form-row {
  gap: 12px;
}
/* form-row 内部 form-group 不再额外产生间距 */
#dabiao-personal .form-row .form-group,
#dabiao-group .form-row .form-group,
#dabiao-transfer .form-row .form-group {
  margin-bottom: 0;
}

/* 日期输入框 placeholder 强制显示 yyyy/mm/dd */
input[type="date"] {
  position: relative;
}
input[type="date"]::-webkit-datetime-edit {
  color: transparent;
}
input[type="date"]:valid::-webkit-datetime-edit {
  color: var(--text);
}
input[type="date"]:not(:valid):before {
  content: "yyyy/mm/dd";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-light);
  font-size: 14px;
  pointer-events: none;
  font-family: inherit;
}
input[type="date"]:not(:valid) {
  color: var(--text-light);
}
.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-light);
}

/* 但提示文字保持灰色（通过更具体的选择器） */
#dabiao-personal label span[style*="text-light"],
#dabiao-group label span[style*="text-light"],
#dabiao-transfer label span[style*="text-light"] {
  color: var(--text-light) !important;
}

/* ========== 历史打表卡片列表 ========== */
#dabiao-history-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* 编辑弹窗内的表单统一间距 */
#dabiao-edit-modal-body .form-group {
  margin-bottom: 14px;
}
#dabiao-edit-modal-body .form-group.compact {
  margin-bottom: 10px;
}
#dabiao-edit-modal-body .form-row {
  margin-bottom: 16px;
}
#dabiao-edit-modal-body .form-row:last-child {
  margin-bottom: 0;
}
#dabiao-edit-modal-body .dabiao-table {
  margin-bottom: 0;
}
#dabiao-edit-modal-body .dabiao-table td input {
  background: var(--card);
}

/* 只读字段在编辑弹窗中的样式 */
#dabiao-edit-modal-body input.readonly,
#dabiao-edit-modal-body textarea.readonly {
  background: #f1f5f9;
  color: var(--text-light);
  cursor: not-allowed;
}

/* 弹窗底部红色实心删除按钮（与 btn-secondary 同款尺寸） */
/* 红色删除按钮：加粗、不换行 */
.btn-delete {
  padding: 8px 16px;
  background: var(--danger);
  color: #fff;
  border: 1px solid var(--danger);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;        /* 加粗 */
  white-space: nowrap;     /* 宽屏下文字横向显示，不换行 */
  transition: all 0.2s;
}
.btn-delete:hover {
  background: #dc2626;
  border-color: #dc2626;
}
#screenshot-modal {
  z-index: 1100;
}
/* 排发管理：复制按钮紧凑排列 */
#paifa-detail-body .form-group input.readonly {
  background: #f1f5f9;
  color: var(--text-light);
  cursor: not-allowed;
}
#paifa-detail-body .form-row {
  align-items: flex-end;
}
/* 更新记录表格紧凑样式 */
#update-records-content .data-table {
  font-size: 12px;
  border-collapse: collapse;
}
#update-records-content .data-table th,
#update-records-content .data-table td {
  padding: 6px 8px;
  vertical-align: middle;
  white-space: nowrap;
}
#update-records-content .data-table td img {
  max-width: 40px;
  max-height: 40px;
  border-radius: 4px;
  cursor: pointer;
}
/* 移动端不强制 nowrap，允许换行，但表格本身滚动 */
@media (max-width: 640px) {
  #update-records-content .data-table {
    display: table !important;
    font-size: 11px;  /* 可选：减小字号以容纳更多列 */
  }
  #update-records-content .data-table th,
  #update-records-content .data-table td {
    padding: 4px 6px;
    white-space: nowrap; /* 强制不换行，依靠横向滚动 */
  }
  #update-records-content .data-table td img {
    max-width: 24px;
    max-height: 24px;
  }
    #international-step1 .data-table,
  #international-step2 .data-table {
    display: table !important;
    font-size: 11px;
  }
  #international-step1 .data-table th,
  #international-step1 .data-table td,
  #international-step2 .data-table th,
  #international-step2 .data-table td {
    padding: 4px 6px;
    white-space: nowrap;
  }
  #international-step1 .data-table td img,
  #international-step2 .data-table td img {
    max-width: 24px;
    max-height: 24px;
  }
  #international-preview-content .data-table {
    display: table !important;
    font-size: 11px;
  }
  #international-preview-content .data-table th,
  #international-preview-content .data-table td {
    padding: 4px 6px;
    white-space: nowrap;
  }
  #international-preview-content .data-table td img {
    max-width: 24px;
    max-height: 24px;
  }
  #international-preview-content .form-group {
    width: 100%;
  }
  #international-preview-content .form-group select,
  #international-preview-content .form-group input {
    width: 100% !important;
  }
  #international-preview-content button {
    width: 100%;
    justify-content: center;
  }
  #kidney-view-content .data-table {
    display: table !important;
    font-size: 12px;
  }
  #kidney-view-content .data-table th,
  #kidney-view-content .data-table td {
    padding: 4px 6px;
    white-space: nowrap;
  }
  #kidney-view-content .data-table td img {
    max-width: 24px;
    max-height: 24px;
  }
  /* 表格父容器横向滚动 */
  #kidney-view-content {
    overflow-x: auto;
  }
  #page-other-kidney .form-card > div:last-of-type {
    overflow-x: visible !important; /* 如果父容器有 overflow-x:auto，则覆盖 */
  }
  #other-kidney-table {
    table-layout: auto; /* 自动列宽，根据内容分配 */
    width: 100%;
  }
  /* 重置列宽为自动，不设固定百分比 */
  #other-kidney-table th,
  #other-kidney-table td {
    width: auto !important;
    min-width: 0 !important;
    padding: 6px 4px;
    word-break: break-word;  /* 长内容换行 */
    white-space: normal;      /* 允许换行 */
  }
  /* 输入框在移动端更紧凑 */
  #other-kidney-table td input {
    font-size: 13px;
    padding: 6px 4px;
  }
  #member-list-content .data-table {
    font-size: 12px;
  }
  #member-list-content .data-table th,
  #member-list-content .data-table td {
    padding: 6px 8px;
    white-space: nowrap;   /* 防止换行，依赖横向滚动 */
  }
  /* 父容器横向滚动 */
  #member-list-content {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch; /* iOS 平滑滚动 */
  }
}
#member-list-content .data-table {
  display: table !important;
  font-size: 13px;  /* 桌面默认大小 */
}
#update-status-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 4px 0;
}
#update-status-checkboxes label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  cursor: pointer;
}

/* 编辑时输入框样式 */
.edit-cell-input,
.edit-cell-select {
  background: white;
  border: 2px solid var(--primary);
  border-radius: 4px;
  padding: 4px 6px;
  font-size: inherit;
  font-family: inherit;
  width: 100%;
  box-sizing: border-box;
}
/* 审核按钮：面性轻量风格，与整体圆角/阴影体系对齐 */
.btn-approve,
.btn-reject {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  line-height: 1;
}

.btn-approve {
  background: #d1fae5;
  color: #065f46;
}
.btn-approve:hover {
  background: #10b981;
  color: #fff;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.btn-reject {
  background: #fee2e2;
  color: #991b1b;
}
.btn-reject:hover {
  background: #ef4444;
  color: #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
  transform: translateY(-1px);
}

/* 批量操作按钮：更大、更突出，与整体主按钮尺寸接近 */
.btn-approve.batch,
.btn-reject.batch {
  padding: 8px 20px;
  font-size: 14px;
  border-radius: 10px;
}
/* 收款人筛选框美化 */
#audit-payee-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8fafc;
  padding: 6px 16px 6px 12px;
  border-radius: 30px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
#audit-payee-filter label {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0;
}
#audit-payee-filter select {
  padding: 8px 32px 8px 14px;
  border: 1px solid #d1d5db;
  border-radius: 20px;
  background-size: 12px;
  -webkit-appearance: none;
  appearance: none;
  font-size: 14px;
  font-weight: 500;
  color: #1e293b;
  cursor: pointer;
  transition: border 0.2s, box-shadow 0.2s;
  min-width: 120px;
}
#audit-payee-filter select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.15);
}
#audit-payee-filter select:disabled {
  background-color: #f1f5f9;
  color: #64748b;
  cursor: not-allowed;
  opacity: 0.8;
}
/* 其他肾表 - 列宽优化 */
#other-kidney-table {
  width: 100%;
  table-layout: fixed; /* 固定列宽算法，按百分比分配 */
  border-collapse: collapse;
}

/* 各列宽度分配（不含操作列） */
#other-kidney-table th:nth-child(1),
#other-kidney-table td:nth-child(1) {
  width: 46%;  /* cn */
}
#other-kidney-table th:nth-child(2),
#other-kidney-table td:nth-child(2) {
  width: 46%;  /* 肾额 */
}
#other-kidney-table th:nth-child(3),
#other-kidney-table td:nth-child(3) {
  width: 8%;   /* 操作按钮 */
  min-width: 40px;
}

/* 输入框填满单元格 */
#other-kidney-table td input {
  width: 100%;
  box-sizing: border-box;
}

.update-row {
  box-sizing: border-box;
}
.update-row > div {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}
/* 图片单元格内图片限制大小 */
.update-row img {
  max-width: 28px;
  max-height: 28px;
  vertical-align: middle;
}