
/* ===== Filter Bar ===== */
.filter-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.filter-bar .form-group {
  margin-bottom: 0;
  min-width: 180px;
}

.filter-bar .btn {
  padding: 8px 16px;
  font-size: 13px;
  height: 38px;
  align-self: flex-end;
}

/* ===== Tables ===== */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border-light);
}

.table th {
  background: var(--slate-50);
  font-weight: 600;
  font-size: 13px;
  color: var(--slate-600);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.table td {
  font-size: 14px;
  color: var(--text-primary);
}

.table tr:hover td {
  background: var(--slate-50);
}

/* ===== Status Badges ===== */
.status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
}

.status-pending {
  background: var(--warning-light);
  color: #B45309;
}

.status-submitted {
  background: var(--brand-light);
  color: #1D4ED8;
}

.status-repairing {
  background: var(--success-light);
  color: #047857;
}

.status-completed {
  background: #F0F9FF;
  color: #0369A1;
}

.status-audited {
  background: var(--info-light);
  color: #6D28D9;
}

.status-rejected {
  background: var(--danger-light);
  color: #B91C1C;
}

/* ===== Stats Grid ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 14px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-light);
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 90px;
  height: 90px;
  transition: var(--transition-fast);
}

.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: var(--slate-300);
}

.stat-card .stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  font-weight: 500;
}

.stat-card.primary .stat-value { color: var(--brand); }
.stat-card.success .stat-value { color: var(--success); }
.stat-card.warning .stat-value { color: var(--warning); }
.stat-card.danger .stat-value { color: var(--danger); }
.stat-card.info .stat-value { color: var(--info); }

.stat-card.maintenance-warning {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
  border-color: transparent;
}

.stat-card.maintenance-warning .stat-value,
.stat-card.maintenance-warning .stat-label {
  color: #FFFFFF;
}

.stat-card.inspection-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  border-color: transparent;
}

.stat-card.inspection-warning .stat-value,
.stat-card.inspection-warning .stat-label {
  color: #FFFFFF;
}

.stat-card.mini-stat {
  padding: 12px 10px;
}

.stat-card.mini-stat .stat-value {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.stat-card.mini-stat .stat-label {
  font-size: 11px;
  opacity: 0.85;
  margin-bottom: 4px;
}

.mini-extra {
  font-size: 10px;
  opacity: 0.75;
  line-height: 1.3;
  margin-top: 2px;
}

.dashboard-top {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  flex-wrap: wrap;
  align-items: stretch;
}

.dashboard-top .filter-bar {
  flex: 1;
  min-width: 400px;
}

.utility-row {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
  align-items: stretch;
}

.stats-grid-8 {
  grid-template-columns: repeat(8, 1fr);
  gap: 12px;
}

.stats-grid-6 {
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
}

.stats-grid-4 {
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.stats-grid-4 .stat-card {
  padding: 16px 14px;
  min-height: 90px;
  height: 90px;
}

.stats-grid-4 .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.1;
}

.stats-grid-4 .stat-label {
  font-size: 12px;
  color: var(--text-secondary);
}

.stats-grid-4 .stat-card.primary .stat-value { color: var(--brand); }
.stats-grid-4 .stat-card.success .stat-value { color: var(--success); }
.stats-grid-4 .stat-card.info .stat-value { color: var(--info); }
.stats-grid-4 .stat-card.danger .stat-value { color: var(--danger); }

.stat-card-sm {
  padding: 16px 10px;
  min-height: 90px;
  height: 90px;
}

.stat-card-sm .stat-value {
  font-size: 22px;
  margin-bottom: 4px;
}

.stat-card-sm .stat-label {
  font-size: 12px;
}

.stat-card-sm.maintenance-warning {
  background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
}

.stat-card-sm.inspection-warning {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
}

/* ===== 西安今日油价（5列网格，全局设计令牌统一风格） ===== */
.oil-price-wrap {
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #eef0f3);
  border-radius: var(--radius-md, 14px);
  padding: 14px 16px 16px;
  margin: 0 0 var(--gap-md, 14px);
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.04));
}
.oil-price-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 12px;
  flex-wrap: wrap;
}
.oil-price-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary, #1f2937);
}
.oil-ic { font-size: 15px; }
.oil-price-next {
  font-size: 11px;
  color: var(--text-muted, #94a3b8);
  font-weight: 400;
  margin-left: 4px;
}
.oil-price-time {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  white-space: nowrap;
}
.oil-price-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: var(--gap-sm, 10px);
}
.oil-price-cell {
  background: var(--bg-secondary, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: var(--radius-sm, 10px);
  padding: 12px 6px;
  text-align: center;
  transition: all 0.2s ease;
}
.oil-price-cell:hover {
  background: var(--card-bg, #ffffff);
  border-color: var(--primary-light, #bae7ff);
  box-shadow: var(--shadow-md, 0 3px 10px rgba(24, 144, 255, 0.10));
  transform: translateY(-1px);
}
.oil-price-label {
  font-size: 11.5px;
  color: var(--text-secondary, #64748b);
  margin-bottom: 4px;
  font-weight: 500;
  letter-spacing: 0.2px;
}
.oil-price-value {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.3px;
  color: var(--primary-color, #1890ff);
}
.oil-price-cell.oil-loading {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  padding: 14px 0;
  font-weight: 500;
  grid-column: 1 / -1;
}
@media (max-width: 640px) {
  .oil-price-grid { grid-template-columns: repeat(5, 1fr); gap: 6px; }
  .oil-price-cell { padding: 10px 4px; }
  .oil-price-label { font-size: 10.5px; }
  .oil-price-value { font-size: 13px; }
  .oil-price-title { font-size: 13px; }
  .oil-price-wrap { padding: 12px 10px 14px; }
}

/* ===== Notification Bell ===== */
.notification-bell {
  position: relative;
  cursor: pointer;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.notification-bell:hover {
  background: var(--slate-100);
}

.bell-icon {
  font-size: 20px;
}

.notification-bell .badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  background: var(--danger);
  color: #FFFFFF;
  border-radius: var(--radius-full);
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  font-weight: 600;
  box-shadow: 0 0 0 2px #FFFFFF;
}

.notification-dropdown {
  position: absolute;
  top: 100%;
  right: 0;
  width: 320px;
  background: #FFFFFF;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  margin-top: 8px;
  z-index: 100;
  overflow: hidden;
  border: 1px solid var(--border);
}

.notification-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

.notification-header a {
  font-size: 12px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 500;
}

.notification-list {
  max-height: 300px;
  overflow-y: auto;
}

.notification-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.notification-item:hover {
  background: var(--slate-50);
}

.notification-item.unread {
  background: var(--brand-lighter);
}

.notification-item.unread .notification-title::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--danger);
  border-radius: 50%;
  margin-right: 8px;
}

.notification-title {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.notification-content {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.notification-time {
  font-size: 11px;
  color: var(--text-muted);
}

.notification-footer {
  padding: 10px 16px;
  text-align: center;
  border-top: 1px solid var(--border-light);
}

.notification-footer a {
  font-size: 13px;
  color: var(--brand);
  cursor: pointer;
  font-weight: 500;
}

.notification-list-full {
  min-height: 300px;
}

.notification-item-full {
  padding: 16px;
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: var(--transition-fast);
}

.notification-item-full:hover {
  background: var(--slate-50);
}

.notification-item-full.unread {
  background: var(--brand-lighter);
  border-left: 3px solid var(--brand);
}

.notification-item-full .notification-title {
  font-size: 15px;
  margin-bottom: 8px;
}

.notification-item-full .notification-content {
  font-size: 13px;
  white-space: normal;
  margin-bottom: 8px;
  line-height: 1.6;
}

.notification-item-full .notification-time {
  font-size: 12px;
}

/* ===== Modal ===== */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(4px);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.modal.show {
  display: flex;
}

.modal-content {
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  width: 600px;
  max-height: 85vh;
  overflow: hidden;
  max-width: 90%;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  border: 1px solid var(--border);
  animation: modalSlideIn 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* V21 修复：桌面端弹窗统一限宽，确保"新增工单/车辆档案/工单查看"不铺满全屏。
   HTML 里这些大弹窗用 inline style 设了 width(720~820px)，此处再用 !important 兜底
   限制 max-width，防止在窄屏/缩放场景下被撑到接近 100vw。 */
@media (min-width: 769px) {
  .modal-content {
    max-width: min(860px, 90vw) !important;
  }
}

/* Round6.5: 加油登记·草料数据弹窗——原为小表单限宽520px；Round6.6 内容增多（抓取结果+照片墙），
   放宽到 min(880px, 94vw)，高度最高 92vh。若后续要恢复小窗，把 min(880px, 94vw) 改回 min(520px, 96vw) 即可。
   注：弹窗 DOM 存在嵌套（cliim 的 .modal-content 是 #vehicleDetailModal 的后代），
   #vehicleDetailModal .modal-content 的 800px!important 会覆盖通用规则，
   故此处用更高的选择器特异性(id+class+class)确保覆盖。 */
@media (min-width: 769px) {
  #cliimCenterModal.modal #cliimCenterModal .modal-content,
  body.theme-ios #cliimCenterModal .modal-content {
    width: min(880px, 94vw) !important;
    max-width: min(880px, 94vw) !important;
    height: auto !important;
    max-height: 92vh !important;
  }
}

@keyframes modalSlideIn {
  from { opacity: 0; transform: translateY(20px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-light);
}

.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.modal-close {
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-muted);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.modal-close:hover {
  color: var(--danger);
  background: var(--danger-light);
}

.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
  min-height: 0;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--border-light);
}

/* ===== Tabs ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.tab-item {
  padding: 12px 24px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-secondary);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: var(--transition-fast);
  font-weight: 500;
}

.tab-item:hover {
  color: var(--brand);
}

.tab-item.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

.vehicle-detail-tabs {
  display: flex;
  gap: 24px;
  border-bottom: 2px solid var(--border-light);
  margin-bottom: 20px;
}

.vehicle-detail-tab {
  padding: 12px 0;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  font-size: 14px;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  font-weight: 500;
}

.vehicle-detail-tab:hover {
  color: var(--brand);
}

.vehicle-detail-tab.active {
  color: var(--brand);
  border-bottom-color: var(--brand);
  font-weight: 600;
}

/* ===== Upload ===== */
.upload-box {
  position: relative;
}

.upload-area {
  border: 2px dashed var(--slate-300);
  border-radius: var(--radius);
  padding: 30px;
  text-align: center;
  cursor: pointer;
  transition: var(--transition-fast);
  background: var(--slate-50);
}

.upload-area:hover {
  border-color: var(--brand);
  background: var(--brand-lighter);
}

.upload-area .upload-icon {
  font-size: 48px;
  color: var(--slate-300);
  margin-bottom: 10px;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--slate-100);
  border: 1px solid var(--border);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.photo-item .photo-actions {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
}

.photo-item:hover .photo-actions {
  display: block;
}

.photo-item .photo-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 24px;
  height: 24px;
  line-height: 22px;
  text-align: center;
  background: rgba(239, 68, 68, 0.9);
  color: #FFFFFF;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: none;
  backdrop-filter: blur(4px);
}

.photo-item:hover .photo-delete {
  display: block;
}

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .empty-icon {
  font-size: 64px;
  margin-bottom: 16px;
  opacity: 0.5;
}

/* U5: 空状态图标美化 */
.empty-state-with-icon {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state-with-icon .empty-icon-large {
  font-size: 56px;
  margin-bottom: 12px;
  opacity: 0.4;
  display: block;
}
.empty-state-with-icon .empty-title {
  font-size: 15px;
  font-weight: 500;
  margin-bottom: 6px;
  color: var(--text-secondary);
}
.empty-state-with-icon .empty-desc {
  font-size: 13px;
  color: var(--text-muted);
}

/* ===== 表单验证 ===== */
.input-error {
  border-color: #ff4d4f !important;
  background-color: #fff2f0 !important;
}
.input-error:focus {
  border-color: #ff4d4f !important;
  box-shadow: 0 0 0 2px rgba(255, 77, 79, 0.1) !important;
}
.field-error {
  color: #ff4d4f;
  font-size: 12px;
  margin-top: 4px;
  line-height: 1.4;
  animation: shake 0.3s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* U6: 骨架屏 */
.skeleton-row {
  display: flex;
  align-items: center;
  padding: 12px 16px;
  gap: 12px;
}
.skeleton-line {
  height: 14px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s infinite;
  border-radius: 4px;
}
.skeleton-line.short { width: 60px; }
.skeleton-line.medium { width: 120px; }
.skeleton-line.long { width: 200px; }
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Alerts ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.alert-warning {
  background: var(--warning-light);
  border: 1px solid #FDE68A;
  color: #92400E;
}

.alert-danger {
  background: var(--danger-light);
  border: 1px solid #FECACA;
  color: #B91C1C;
}

.alert-success {
  background: var(--success-light);
  border: 1px solid #A7F3D0;
  color: #065F46;
}

/* ===== Detail Grid ===== */
.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.detail-item {
  display: flex;
  gap: 8px;
}

.detail-label {
  color: var(--text-muted);
  min-width: 80px;
  font-size: 13px;
  font-weight: 500;
}

.detail-value {
  color: var(--text-primary);
  font-weight: 500;
}

.action-btns {
  display: flex;
  gap: 8px;
}

/* ===== Tags ===== */
.tag {
  display: inline-block;
  padding: 2px 10px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--slate-100);
  color: var(--slate-600);
  font-weight: 500;
}

.tag-warning {
  background: var(--warning-light);
  color: #B45309;
}

.tag-danger {
  background: var(--danger-light);
  color: #B91C1C;
}

.tag-success {
  background: var(--success-light);
  color: #065F46;
}

/* ===== Page Sections ===== */
.page-section {
  display: none;
  box-sizing: border-box;
  padding: 0;
  width: 100%;
}

.page-section.active {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  height: auto;
  max-height: none;
  min-height: 100%;
  -webkit-overflow-scrolling: touch;
  animation: fadeInPage 0.15s ease;
}

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

/* Scrollbar */
.page-section.active::-webkit-scrollbar {
  width: 8px;
}
.page-section.active::-webkit-scrollbar-track {
  background: transparent;
}
.page-section.active::-webkit-scrollbar-thumb {
  background: var(--slate-300);
  border-radius: 4px;
}
.page-section.active::-webkit-scrollbar-thumb:hover {
  background: var(--slate-400);
}

/* ===== Amount Text ===== */
.amount-text {
  font-weight: 600;
  color: var(--danger);
}

.discount-text {
  color: var(--success);
}

/* ===== Settings ===== */
.settings-groups {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (max-width: 768px) {
  .settings-grid-inline {
    grid-template-columns: 1fr;
  }
}

.settings-card {
  background: #FFFFFF;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  border: 1px solid var(--border-light);
}

.settings-card .card-header {
  padding: 14px 20px;
  margin-bottom: 0;
  background: var(--slate-50);
  border-bottom: 1px solid var(--border-light);
}

.settings-card .card-body {
  padding: 16px 20px;
}

.settings-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 20px;
}

.settings-grid .form-group {
  margin-bottom: 0;
}

.settings-grid-inline {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px 16px;
}

.form-group-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
}

.form-group-inline label {
  flex: 0 0 auto;
  min-width: 140px;
  font-size: 13px;
  color: var(--slate-700);
  font-weight: 500;
  margin: 0;
  white-space: nowrap;
}

.form-group-inline input,
.form-group-inline select {
  flex: 1;
  padding: 6px 10px;
  border: 1px solid var(--border-input);
  border-radius: var(--radius-sm);
  font-size: 13px;
  height: 32px;
  outline: none;
  transition: var(--transition-fast);
  background: #FFFFFF;
  color: var(--text-primary);
}

.form-group-inline input:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

.form-group-inline.form-group-checkbox {
  min-height: 32px;
}

.form-group-inline.form-group-checkbox .checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--slate-700);
  cursor: pointer;
}

.form-group-inline.form-group-checkbox .checkbox-text {
  font-weight: 500;
}

.settings-actions {
  display: flex;
  justify-content: center;
  padding-top: 4px;
}

.settings-actions .btn {
  min-width: 160px;
}

/* ===== Checkbox ===== */
.form-group-checkbox {
  display: flex;
  align-items: center;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 0;
}

.checkbox-label input[type="checkbox"] {
  display: none;
}

.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-input);
  border-radius: var(--radius-sm);
  position: relative;
  transition: var(--transition-fast);
  flex-shrink: 0;
  background: #FFFFFF;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
  background: var(--brand);
  border-color: var(--brand);
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
  content: '';
  position: absolute;
  left: 5px;
  top: 2px;
  width: 6px;
  height: 10px;
  border: solid #FFFFFF;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checkbox-text {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ===== Pull Refresh ===== */
.pull-refresh-wrap {
  position: relative;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.pull-refresh-indicator {
  position: absolute;
  top: -50px;
  left: 0;
  right: 0;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  pointer-events: none;
  z-index: 5;
}
.pull-refresh-indicator::before {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid var(--slate-200);
  border-top-color: var(--brand);
  border-radius: 50%;
  margin-right: 8px;
  transition: transform 0.3s ease;
}
.pull-refresh-wrap.pulling .pull-refresh-indicator::before {
  transform: rotate(180deg);
}
.pull-refresh-wrap.refreshing .pull-refresh-indicator::before {
  animation: pullRefreshSpin 0.8s linear infinite;
}
@keyframes pullRefreshSpin {
  to { transform: rotate(360deg); }
}

/* ===== Responsive: Large screens ===== */
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-grid-6 {
    grid-template-columns: repeat(3, 1fr);
  }
  .stats-grid-8 {
    grid-template-columns: repeat(4, 1fr);
  }
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-top {
    flex-direction: column;
  }
  .dashboard-top .filter-bar {
    min-width: unset;
    width: 100%;
  }
  .utility-row {
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid-6 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid-8 {
    grid-template-columns: repeat(2, 1fr);
  }
  .stats-grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Print ===== */
.print-area { display: none; }
@media print {
  /* Round6.12: 打印只输出公文内容。用 display:none 隐藏框架（不用 visibility，避免子元素无法突破祖先 hidden 导致空白页） */
  html, body { height: auto !important; overflow: visible !important; background: #fff !important; }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* 隐藏整个页面的 UI 框架（display:none 彻底移除，不占打印流） */
  .sidebar, .app-bg, .app-blob, .doc-pro-bg, .doc-pro-topbar, .doc-pro-sidebar, .doc-pro-subtop,
  .doc-pro-nav, .doc-pro-stats, .no-print,
  #docProRagHits, #docProPrintBtn, #docProCopyBtn, #docProWordBtn,
  #docProGenBtn, #docProExamBtn, #docProExamWordBtn, #docProExamPrintBtn,
  .layout > .main > *:not(#page-materials),
  #page-materials .doc-pro-wrap > *:not(main),
  #docProWrite > .doc-pro-card:not(#docProPreviewCard),
  #docProPreviewCard .doc-pro-row,
  .header, .user-info, .notification-dropdown, #chatV2AttachMenu {
    display: none !important;
  }

  /* 页面主体与预览卡片正常显示（不隐藏祖先，只隐藏无关元素） */
  .layout, .layout > .main, #page-materials, .doc-pro-wrap, .doc-pro-content,
  #docProWrite, #docProPreviewCard {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: none !important;
  }
  #docProPreviewCard.hidden { display: block !important; }

  #docProPreviewCard .doc-gongwen {
    display: block !important;
    position: static !important;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 auto !important;
    padding: 20px !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: #fff !important;
  }
}
.receipt { max-width: 800px; margin: 0 auto; border: 1px solid #333; padding: 24px; font-size: 14px; background: #fff; }
.receipt-header { text-align: center; margin-bottom: 20px; }
.receipt-header h2 { font-size: 20px; margin-bottom: 8px; }
.receipt-info { display: flex; justify-content: space-between; margin-bottom: 16px; }
.receipt-table { width: 100%; border-collapse: collapse; margin: 16px 0; }
.receipt-table th, .receipt-table td { border: 1px solid #333; padding: 6px 8px; text-align: left; font-size: 12px; }
.receipt-table th { background: #f8f9fa; }
.receipt-total { margin-top: 16px; text-align: right; font-weight: 600; }
.receipt-footer { margin-top: 24px; text-align: center; font-size: 12px; color: #666; }

/* ===== Pagination ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
}

.pagination-info {
  font-size: 13px;
  color: var(--text-secondary);
}

.pagination-btns {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-btns button {
  min-width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #FFFFFF;
  color: var(--slate-700);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}

.pagination-btns button:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-lighter);
}

.pagination-btns button.active {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}

.pagination-btns button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-ellipsis {
  padding: 4px 8px;
  color: var(--text-muted);
}

/* ===== Timeline ===== */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--border);
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
  padding: 16px;
  background: var(--slate-50);
  border-radius: var(--radius);
  border-left: 3px solid var(--timeline-color, var(--brand));
  transition: var(--transition-fast);
}

.timeline-item:hover {
  background: var(--slate-100);
  box-shadow: var(--shadow-sm);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -24px;
  top: 20px;
  width: 12px;
  height: 12px;
  background: var(--timeline-color, var(--brand));
  border-radius: 50%;
  border: 2px solid #FFFFFF;
  box-shadow: 0 0 0 2px var(--timeline-color, var(--brand));
}

.timeline-date {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.timeline-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.timeline-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-amount {
  color: var(--danger);
  font-weight: 600;
}

/* ===== Chart Container ===== */
.chart-container {
  width: 100%;
  height: 400px;
  margin-bottom: 20px;
}

/* ===== Pub Order Table ===== */
.pub-order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.pub-order-table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 600;
  padding: 14px 16px;
  text-align: left;
  font-size: 13px;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.pub-order-table td {
  padding: 14px 16px;
  color: var(--slate-700);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
  font-size: 14px;
}

.pub-order-table tr:hover {
  background: var(--slate-50);
}

.pub-order-table .order-tag {
  display: inline-block;
  padding: 4px 10px;
  background: var(--slate-100);
  color: var(--slate-600);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 13px;
}

.pub-order-table .plate-text {
  color: var(--brand);
  font-weight: 600;
  font-size: 14px;
}

.pub-order-table .amount-normal {
  color: var(--slate-500);
  font-weight: 500;
}

.pub-order-table .amount-final {
  color: var(--danger);
  font-weight: 600;
  font-size: 14px;
}

.pub-order-table .order-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* ===== Repair Cost Summary ===== */
.repair-cost-summary {
  background: var(--slate-50);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-top: 12px;
  border: 1px solid var(--border);
}

.repair-cost-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-size: 13px;
  color: var(--slate-500);
}

.repair-cost-row .cost-label {
  color: var(--slate-500);
  font-size: 13px;
}

.repair-cost-row .cost-value {
  font-weight: 500;
  color: var(--slate-700);
  font-size: 13px;
}

.repair-cost-row.discount .cost-value {
  color: var(--success);
}

.repair-cost-row.total {
  padding: 10px 0 0 0;
  margin-top: 6px;
  border-top: 1px solid var(--slate-300);
}

.repair-cost-row.total .cost-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.repair-cost-row.total .cost-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
}

/* ===== Pub Order Items Table ===== */
.pub-order-items-table {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.pub-order-items-table th {
  background: var(--slate-50);
  color: var(--slate-600);
  font-weight: 600;
  padding: 12px 10px;
  border-bottom: 2px solid var(--border);
  font-size: 13px;
}

.pub-order-items-table td {
  padding: 10px;
  border-bottom: 1px solid var(--border-light);
  font-size: 13px;
  color: var(--text-primary);
}

.pub-order-items-table input[type="text"],
.pub-order-items-table input[type="number"],
.pub-order-items-table select {
  width: 100%;
  min-width: 60px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  transition: var(--transition-fast);
  font-family: var(--font);
  background: #FFFFFF;
  color: var(--text-primary);
  outline: none;
}

.pub-order-items-table input[type="text"]:focus,
.pub-order-items-table input[type="number"]:focus,
.pub-order-items-table select:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

.pub-order-cost-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--slate-50);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.pub-order-cost-bar .cost-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
}

.pub-order-cost-bar .cost-label {
  color: var(--slate-500);
  font-weight: 500;
}

.pub-order-cost-bar .cost-value {
  font-weight: 600;
  color: var(--slate-700);
  font-size: 15px;
  min-width: 50px;
  text-align: right;
}

.pub-order-cost-bar .cost-value.discount {
  color: var(--success);
}

.pub-order-cost-bar .cost-unit {
  color: var(--text-muted);
  font-size: 13px;
}

.pub-order-cost-bar .discount-input {
  width: 80px !important;
  padding: 6px 10px !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-sm) !important;
  font-size: 14px !important;
  text-align: center;
  outline: none;
}

.pub-order-cost-bar .cost-item.highlight .cost-label {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 15px;
}

.pub-order-cost-bar .cost-item.highlight .cost-value {
  color: var(--danger);
  font-size: 22px;
  font-weight: 700;
}

/* ===== Template Table ===== */
.template-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--border);
  font-size: 13px;
  margin: 12px 0;
  border-radius: var(--radius);
  overflow: hidden;
}

.template-table th {
  background: var(--slate-50);
  color: var(--slate-700);
  font-weight: 600;
  padding: 12px 14px;
  border: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
}

.template-table td {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  color: var(--slate-600);
  font-size: 13px;
}

.template-table tr:nth-child(even) td {
  background: var(--slate-50);
}

.template-table .example-row td {
  background: var(--warning-light);
  color: #92400E;
  font-style: italic;
}

/* ===== Global Loading ===== */
.global-loading-overlay {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(15, 23, 42, 0.75);
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  pointer-events: none;
  animation: fadeIn 0.2s ease;
  backdrop-filter: blur(4px);
}

.global-loading-spinner {
  width: 24px;
  height: 24px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: #FFFFFF;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin-right: 8px;
}

.global-loading-overlay::after {
  content: '加载中...';
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translate(-50%, -60%); }
  to { opacity: 1; transform: translate(-50%, -50%); }
}

@keyframes spin {
  to { transform: rotate(360deg); }
}