/* ==========================================================================
   售后管理系统 (AfterSales) - 极客暗色玻璃拟态 (Glassmorphism) 核心设计系统
   ========================================================================== */

:root {
  /* 基础调色盘 - 基于 HSL 以实现最佳和谐度 */
  --bg-primary: #070a13;
  --bg-secondary: #0c1122;
  --bg-tertiary: #121b36;
  
  --card-bg: rgba(18, 25, 47, 0.55);
  --card-border: rgba(255, 255, 255, 0.07);
  --card-hover-border: rgba(99, 102, 241, 0.25);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  /* 品牌渐变与状态色 */
  --color-primary: #3b82f6;
  --color-purple: #8b5cf6;
  --color-success: #10b981;
  --color-warning: #f59e0b;
  --color-danger: #ef4444;
  
  --gradient-brand: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
  --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --gradient-warning: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  --gradient-danger: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
  --gradient-card-header: linear-gradient(90deg, rgba(255,255,255,0.03) 0%, rgba(255,255,255,0) 100%);
  
  /* 发光与阴影 */
  --shadow-glow-blue: 0 8px 32px 0 rgba(59, 130, 246, 0.15);
  --shadow-glow-purple: 0 8px 32px 0 rgba(139, 92, 246, 0.15);
  --shadow-card: 0 10px 30px -10px rgba(0, 0, 0, 0.5);
  
  /* 字体族 */
  --font-display: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ==========================================================================
   1. 基础与滚动条重置
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-body);
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

body {
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 99px;
  transition: background 0.2s;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(99, 102, 241, 0.4);
}

/* 氛围发光灯效 */
.ambient-glow {
  position: fixed;
  width: 45vw;
  height: 45vw;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
  opacity: 0.45;
  filter: blur(140px);
}
.glow-1 {
  top: -15%;
  left: -10%;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, rgba(139, 92, 246, 0.1) 60%, transparent 100%);
}
.glow-2 {
  bottom: -15%;
  right: -5%;
  background: radial-gradient(circle, rgba(139, 92, 246, 0.3) 0%, rgba(239, 68, 68, 0.05) 60%, transparent 100%);
}

/* ==========================================================================
   2. 整体布局结构
   ========================================================================== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* 侧边栏样式 */
.sidebar-wrapper {
  width: 260px;
  background: rgba(8, 12, 26, 0.7);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--card-border);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  left: 0;
  top: 0;
  z-index: 10;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-logo {
  padding: 30px 24px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.logo-icon {
  width: 38px;
  height: 38px;
  background: var(--gradient-brand);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.4);
}
.logo-icon i {
  color: #fff;
  width: 20px;
  height: 20px;
}
.logo-text {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, #fff 30%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}

.sidebar-menu {
  list-style: none;
  padding: 10px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex-grow: 1;
}
.menu-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.menu-item i {
  width: 18px;
  height: 18px;
  transition: transform 0.2s;
}
.menu-item:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}
.menu-item:hover i {
  transform: scale(1.1);
}
.menu-item.active {
  color: #fff;
  background: rgba(59, 130, 246, 0.15);
  border: 1px solid rgba(59, 130, 246, 0.25);
  box-shadow: inset 0 0 12px rgba(59, 130, 246, 0.1);
}
.menu-item.active i {
  color: var(--color-primary);
}

.sidebar-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* 主内容区域与顶栏 */
.content-wrapper {
  margin-left: 260px;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  position: relative;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.top-header {
  height: 76px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--card-border);
  background: rgba(7, 10, 19, 0.5);
  backdrop-filter: blur(12px);
  position: sticky;
  top: 0;
  z-index: 8;
}

/* 顶部搜索框 */
.header-search {
  position: relative;
  width: 320px;
}
.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}
.header-search input {
  width: 100%;
  padding: 10px 14px 10px 42px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 99px;
  color: var(--text-primary);
  font-size: 13px;
  transition: all 0.25s ease;
}
.header-search input:focus {
  outline: none;
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.15);
  width: 360px;
}

/* 用户角色与切换 */
.header-profile {
  display: flex;
  align-items: center;
  gap: 24px;
  position: relative;
}

.notification-bell {
  position: relative;
  cursor: pointer;
  color: var(--text-secondary);
  transition: color 0.2s;
  padding: 6px;
}
.notification-bell:hover {
  color: var(--text-primary);
}
.notification-bell i {
  width: 20px;
  height: 20px;
}
.notification-bell .badge {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 8px;
  height: 8px;
  background: var(--color-danger);
  border-radius: 50%;
}

.profile-info {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 12px;
  transition: background 0.2s;
}
.profile-info:hover {
  background: rgba(255, 255, 255, 0.05);
}
.profile-info .avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  border: 1.5px solid var(--color-primary);
}
.user-meta {
  display: flex;
  flex-direction: column;
}
.user-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}
.user-role {
  font-size: 11px;
  color: var(--text-muted);
}
.profile-arrow {
  width: 14px;
  height: 14px;
  color: var(--text-muted);
  transition: transform 0.2s;
}
.profile-info:hover .profile-arrow {
  color: var(--text-primary);
}

/* 下拉菜单 */
.profile-dropdown {
  position: absolute;
  top: 115%;
  right: 0;
  width: 240px;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(25px);
  border: 1px solid var(--card-border);
  border-radius: 14px;
  box-shadow: var(--shadow-card);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 100;
  animation: dropdownFade 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.profile-dropdown.show {
  display: flex;
}
.dropdown-header {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 10px 12px;
}
.dropdown-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  text-align: left;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  transition: all 0.2s;
}
.dropdown-item i {
  width: 16px;
  height: 16px;
}
.dropdown-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-primary);
}
.dropdown-item.active {
  color: var(--color-primary);
  background: rgba(59, 130, 246, 0.08);
}

/* 页面内容挂载容器 */
.page-container {
  padding: 30px 40px;
  flex-grow: 1;
  z-index: 2;
}

/* ==========================================================================
   3. 通用玻璃拟态组件 (Glass Components)
   ========================================================================== */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.3s, transform 0.3s, box-shadow 0.3s;
  position: relative;
  overflow: hidden;
}
.glass-card:hover {
  border-color: var(--card-hover-border);
  transform: translateY(-2px);
  box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.6), 0 0 25px rgba(99, 102, 241, 0.08);
}
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
  background: var(--gradient-card-header);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-title i {
  color: var(--color-primary);
  width: 18px;
  height: 18px;
}
.card-body {
  padding: 24px;
}

/* 渐变标题 */
.page-title-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
}
.page-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 50%, #94a3b8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* 按钮设计 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 10px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
}
.btn i {
  width: 16px;
  height: 16px;
}
.btn-primary {
  background: var(--gradient-brand);
  color: #fff;
  box-shadow: 0 4px 15px rgba(59, 130, 246, 0.35);
}
.btn-primary:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(59, 130, 246, 0.5), 0 0 0 3px rgba(59, 130, 246, 0.2);
}
.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.15);
}
.btn-success {
  background: var(--gradient-success);
  color: #fff;
  box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}
.btn-success:hover {
  transform: translateY(-1.5px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
}
.btn-icon-only {
  padding: 10px;
  border-radius: 10px;
}

/* 状态标签样式 */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 99px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.status-badge::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-pending {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.25);
}
.badge-pending::before { background-color: #3b82f6; }

.badge-processing {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.25);
}
.badge-processing::before { background-color: #f59e0b; }

.badge-resolved {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.25);
}
.badge-resolved::before { background-color: #10b981; }

.badge-closed {
  background: rgba(148, 163, 184, 0.12);
  color: #94a3b8;
  border: 1px solid rgba(148, 163, 184, 0.22);
}
.badge-closed::before { background-color: #94a3b8; }

/* 优先级标签 */
.priority-tag {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
}
.priority-low { background: rgba(148, 163, 184, 0.15); color: #94a3b8; }
.priority-medium { background: rgba(59, 130, 246, 0.15); color: #60a5fa; }
.priority-high { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }
.priority-urgent {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  animation: pulse-border 1.5s infinite alternate;
}

/* ==========================================================================
   4. 各页面专属样式 (Dashboard, Tickets, Customers, Inventory)
   ========================================================================== */

/* --- 仪表盘 Dashboard --- */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.kpi-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
}
.kpi-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.kpi-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.kpi-value {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 700;
  color: #fff;
}
.kpi-footer {
  font-size: 11px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.kpi-up { color: var(--color-success); }
.kpi-down { color: var(--color-danger); }

.kpi-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kpi-card:nth-child(1) .kpi-icon-box { background: rgba(59, 130, 246, 0.15); color: var(--color-primary); }
.kpi-card:nth-child(2) .kpi-icon-box { background: rgba(139, 92, 246, 0.15); color: var(--color-purple); }
.kpi-card:nth-child(3) .kpi-icon-box { background: rgba(16, 185, 129, 0.15); color: var(--color-success); }
.kpi-card:nth-child(4) .kpi-icon-box { background: rgba(245, 158, 11, 0.15); color: var(--color-warning); }

.dashboard-charts-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}

.chart-wrapper {
  height: 300px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 仪表盘近期任务与动态 */
.dashboard-activities {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.activity-list, .urgent-tickets-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.activity-item, .urgent-ticket-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  transition: all 0.2s;
}
.activity-item:hover, .urgent-ticket-item:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.activity-content {
  display: flex;
  align-items: center;
  gap: 12px;
}
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.activity-dot.blue { background-color: var(--color-primary); }
.activity-dot.green { background-color: var(--color-success); }
.activity-dot.orange { background-color: var(--color-warning); }
.activity-dot.red { background-color: var(--color-danger); }

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

/* --- 工单中心 Tickets --- */
.tickets-filter-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  gap: 16px;
  flex-wrap: wrap;
}
.filter-tabs {
  display: flex;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 4px;
  border-radius: 10px;
}
.filter-tab {
  background: transparent;
  border: none;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: 8px;
  transition: all 0.2s;
}
.filter-tab:hover {
  color: var(--text-primary);
}
.filter-tab.active {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.filter-actions {
  display: flex;
  gap: 12px;
}
.select-wrapper select {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 10px 32px 10px 14px;
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}
.select-wrapper select:focus {
  border-color: rgba(59, 130, 246, 0.4);
  background-color: rgba(15, 23, 42, 0.95);
}

/* 滚动表格 */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}
.custom-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}
.custom-table th {
  padding: 16px 20px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--card-border);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.custom-table td {
  padding: 16px 20px;
  font-size: 13px;
  color: var(--text-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}
.custom-table tbody tr {
  transition: background 0.15s;
  cursor: pointer;
}
.custom-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.015);
}
.custom-table tbody tr:last-child td {
  border-bottom: none;
}

.table-ticket-no {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-primary);
}
.table-device {
  font-weight: 500;
}
.table-desc-cell {
  max-width: 240px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text-secondary);
}

/* Pagination */
.pagination-wrapper {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  border-top: 1px solid var(--card-border);
  font-size: 12px;
  color: var(--text-secondary);
}
.pagination-btns {
  display: flex;
  gap: 6px;
}

/* ==========================================================================
   5. 侧滑详情抽屉 (Slide-out Drawer)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  top: 76px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(3, 7, 18, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99;
  display: none;
  animation: fadeIn 0.25s ease;
}
.drawer-backdrop.show {
  display: block;
}

.slide-drawer {
  position: fixed;
  top: 76px;
  right: 0;
  width: 580px;
  height: calc(100vh - 76px);
  background: rgba(11, 17, 34, 0.96);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border-left: 1px solid var(--card-border);
  box-shadow: -10px 0 40px rgba(0, 0, 0, 0.8);
  z-index: 100;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}
.slide-drawer.show {
  transform: translateX(0);
}

.drawer-header {
  padding: 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-card-header);
}
.drawer-title-box {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.drawer-title {
  font-size: 18px;
  font-weight: 700;
}
.drawer-subtitle {
  font-family: var(--font-display);
  font-size: 13px;
  color: var(--color-primary);
  font-weight: 600;
}
.btn-close-drawer {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s;
}
.btn-close-drawer:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.drawer-content {
  flex-grow: 1;
  overflow-y: auto;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 抽屉内分区卡片 */
.drawer-section {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  padding: 18px;
}
.drawer-section-title {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.drawer-section-title i {
  width: 14px;
  height: 14px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 24px;
}
.detail-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.detail-label {
  font-size: 11px;
  color: var(--text-muted);
}
.detail-value {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
}

/* 动作操作条 */
.drawer-action-bar {
  display: flex;
  gap: 12px;
  margin-top: 10px;
}

/* 日志时间线 (Timeline) */
.timeline {
  display: flex;
  flex-direction: column;
  position: relative;
  padding-left: 20px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: rgba(255, 255, 255, 0.1);
}
.timeline-item {
  position: relative;
  padding-bottom: 16px;
}
.timeline-item:last-child {
  padding-bottom: 0;
}
.timeline-dot {
  position: absolute;
  left: -20px;
  top: 5px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--text-muted);
  border: 2px solid var(--bg-primary);
}
.timeline-dot.active {
  background: var(--color-primary);
  box-shadow: 0 0 10px var(--color-primary);
}
.timeline-dot.green {
  background: var(--color-success);
  box-shadow: 0 0 10px var(--color-success);
}
.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.timeline-operator {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}
.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
}
.timeline-desc {
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* 日志表单 */
.log-form {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.log-form textarea {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--text-primary);
  font-size: 13px;
  resize: vertical;
  min-height: 60px;
}
.log-form textarea:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.3);
}

/* 备件申领清单 */
.parts-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}
.parts-tag {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 11.5px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.parts-tag span {
  font-weight: 600;
  color: var(--color-primary);
}

/* 申领备件表单 */
.parts-apply-form {
  margin-top: 14px;
  background: rgba(0, 0, 0, 0.15);
  border-radius: 8px;
  padding: 12px;
  display: flex;
  align-items: flex-end;
  gap: 10px;
}
.parts-apply-form .form-group {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.parts-apply-form label {
  font-size: 10.5px;
  color: var(--text-muted);
}
.parts-apply-form select, .parts-apply-form input {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 8px;
  color: var(--text-primary);
  font-size: 12px;
}
.parts-apply-form input {
  width: 60px;
  text-align: center;
}

/* ==========================================================================
   6. 弹窗样式 (Modal)
   ========================================================================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.7);
  backdrop-filter: blur(6px);
  z-index: 199;
  display: none;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}
.modal-backdrop.show {
  display: flex;
}
.modal-wrapper {
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.8);
  width: 500px;
  max-width: 90vw;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: scale(0.95);
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-backdrop.show .modal-wrapper {
  transform: scale(1);
}

.modal-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--card-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--gradient-card-header);
}
.modal-title {
  font-size: 16px;
  font-weight: 700;
}
.modal-close {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.modal-close:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.modal-body {
  padding: 24px;
  max-height: 70vh;
  overflow-y: auto;
}

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

/* 表单布局 */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-group:last-child {
  margin-bottom: 0;
}
.form-group label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.form-control {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13px;
  transition: all 0.2s;
}
.form-control:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  background: rgba(0, 0, 0, 0.35);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}
textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* 评分评级组件 */
.star-rating {
  display: flex;
  gap: 8px;
  font-size: 24px;
  color: var(--text-muted);
}
.star-rating i {
  cursor: pointer;
  transition: color 0.15s, transform 0.15s;
}
.star-rating i:hover {
  transform: scale(1.15);
}
.star-rating i.selected {
  color: var(--color-warning);
  text-shadow: 0 0 10px rgba(245, 158, 11, 0.4);
}

/* --- 客户档案 Customers --- */
.customer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.customer-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  cursor: pointer;
}
.customer-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.customer-main-info {
  display: flex;
  align-items: center;
  gap: 12px;
}
.customer-avatar {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
}
.customer-name-phone {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.customer-cname {
  font-size: 14.5px;
  font-weight: 700;
  color: #fff;
}
.customer-cphone {
  font-size: 11.5px;
  color: var(--text-muted);
}
.customer-stats-badge {
  background: rgba(139, 92, 246, 0.12);
  color: var(--color-purple);
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10.5px;
  font-weight: 700;
}
.customer-meta-details {
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  padding-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 12px;
}
.meta-detail-row {
  display: flex;
  justify-content: space-between;
}
.meta-detail-row span:first-child {
  color: var(--text-muted);
}
.meta-detail-row span:last-child {
  color: var(--text-secondary);
  font-weight: 500;
}

/* --- 备件库存 Inventory --- */
.inventory-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
}
.stock-warning-banner {
  background: rgba(239, 68, 68, 0.1);
  border: 1.5px dashed rgba(239, 68, 68, 0.25);
  border-radius: 12px;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.stock-warning-banner-text {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13.5px;
  color: #f87171;
  font-weight: 600;
}
.stock-warning-banner-text i {
  color: var(--color-danger);
  animation: pulse-glow 1.2s infinite;
}

.stock-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
}
.stock-indicator.green { background-color: var(--color-success); }
.stock-indicator.red {
  background-color: var(--color-danger);
  animation: pulse-glow 1.2s infinite;
}

/* ==========================================================================
   7. 全局 Toast 提示
   ========================================================================== */
.toast-wrapper {
  position: fixed;
  bottom: 30px;
  right: 30px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  z-index: 9999;
}
.toast-msg {
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px 20px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 280px;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  animation: slideInLeft 0.3s cubic-bezier(0.16, 1, 0.3, 1), fadeOut 0.3s ease 2.7s forwards;
}
.toast-msg.success { border-left: 4px solid var(--color-success); }
.toast-msg.error { border-left: 4px solid var(--color-danger); }
.toast-msg.info { border-left: 4px solid var(--color-primary); }
.toast-msg i {
  width: 18px;
  height: 18px;
}
.toast-msg.success i { color: var(--color-success); }
.toast-msg.error i { color: var(--color-danger); }
.toast-msg.info i { color: var(--color-primary); }

/* ==========================================================================
   8. 动画与响应式设计
   ========================================================================== */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
.fade-in {
  animation: fadeIn 0.35s ease;
}

@keyframes dropdownFade {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  to { opacity: 0; transform: translateY(10px); visibility: hidden; }
}

@keyframes pulse-border {
  from { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  to { box-shadow: 0 0 0 6px rgba(239, 68, 68, 0); }
}

@keyframes pulse-glow {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.2); opacity: 0.7; }
  100% { transform: scale(1); opacity: 1; }
}

.pulse-glow {
  animation: pulse-glow 1.5s infinite;
}

/* 响应式调整 */
@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .dashboard-charts-row {
    grid-template-columns: 1fr;
  }
  .customer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .inventory-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 768px) {
  .sidebar-wrapper {
    width: 70px;
  }
  .sidebar-wrapper .logo-text,
  .sidebar-wrapper .menu-item span,
  .sidebar-wrapper .sidebar-footer {
    display: none;
  }
  .sidebar-wrapper .menu-item {
    justify-content: center;
    padding: 12px;
  }
  .content-wrapper {
    margin-left: 70px;
  }
  .top-header {
    padding: 0 20px;
  }
  .header-search {
    width: 200px;
  }
  .header-search input:focus {
    width: 240px;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .customer-grid {
    grid-template-columns: 1fr;
  }
  .slide-drawer {
    width: 100vw;
  }
  .page-container {
    padding: 20px;
  }
  .detail-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   9. 8D 改善报告及打印系统样式
   ========================================================================== */
.d8-steps-indicator {
  display: flex;
  justify-content: space-between;
  margin-bottom: 24px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px 10px;
}
.d8-step-node {
  flex-grow: 1;
  text-align: center;
  position: relative;
}
.d8-step-node:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: 55%;
  right: -45%;
  height: 2px;
  background: rgba(255, 255, 255, 0.08);
  z-index: 1;
  transition: background 0.3s;
}
.d8-step-node.completed:not(:last-child)::after {
  background: var(--color-success);
}
.d8-step-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 2px solid rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 6px auto;
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
  position: relative;
  z-index: 2;
  transition: all 0.3s;
}
.d8-step-node.active .d8-step-circle {
  background: var(--color-primary);
  border-color: #60a5fa;
  color: #fff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.4);
}
.d8-step-node.completed .d8-step-circle {
  background: var(--color-success);
  border-color: #34d399;
  color: #fff;
}
.d8-step-text {
  font-size: 11px;
  color: var(--text-muted);
  transition: color 0.3s;
}
.d8-step-node.active .d8-step-text {
  color: var(--color-primary);
  font-weight: 600;
}
.d8-step-node.completed .d8-step-text {
  color: var(--color-success);
}

/* 8D 报告预览排版表 (带格栅网格) */
.report-8d-box {
  background: #fff;
  color: #1e293b;
  padding: 30px;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  font-family: var(--font-body);
  border: 1px solid #cbd5e1;
  max-width: 900px;
  margin: 0 auto;
}
.report-8d-title {
  text-align: center;
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.report-8d-subtitle {
  text-align: center;
  font-size: 13px;
  color: #64748b;
  margin-bottom: 24px;
}
.report-8d-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  background-color: #fff;
}
.report-8d-table th, .report-8d-table td {
  border: 1px solid #475569;
  padding: 10px 14px;
  font-size: 12.5px;
  text-align: left;
  line-height: 1.45;
  color: #1e293b;
}
.report-8d-table th {
  background-color: #f1f5f9;
  color: #0f172a;
  font-weight: 700;
  width: 120px;
  white-space: nowrap;
}
.report-8d-table td.sec-title {
  background-color: #cbd5e1;
  font-weight: 800;
  color: #0f172a;
  font-size: 13px;
  text-align: center;
}

/* 打印版优化样式 */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  
  /* 彻底隐藏页面非打印主体 */
  .sidebar-wrapper,
  .top-header,
  .page-title-section,
  .tickets-filter-bar,
  #main-content > .glass-card,
  .modal-close,
  #btn-print-8d-report {
    display: none !important;
  }
  
  /* 确保预览弹窗铺满且可见 */
  .modal-backdrop {
    display: block !important;
    visibility: visible !important;
    position: static !important;
    background: transparent !important;
    backdrop-filter: none !important;
    padding: 0 !important;
    margin: 0 !important;
    z-index: auto !important;
  }
  
  .modal-wrapper {
    display: block !important;
    visibility: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  
  .modal-header {
    display: none !important; /* 隐藏弹窗标题、关闭按钮和打印按钮本身 */
  }

  .modal-body {
    display: block !important;
    visibility: visible !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .report-8d-box {
    visibility: visible !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  
  .report-8d-box * {
    visibility: visible !important;
  }
  
  .report-8d-table th, .report-8d-table td {
    border: 1.5px solid #000 !important;
    color: #000 !important;
  }
  
  .report-8d-table th {
    background-color: #e2e8f0 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
  
  .report-8d-table td.sec-title {
    background-color: #cbd5e1 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ==========================================================================
   10. 登录界面与修改密码模态框
   ========================================================================== */

/* 登录大背景 */
.login-screen-wrapper {
  position: fixed;
  inset: 0;
  background: #070b19;
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-family: var(--font-body);
}

.login-ambient-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
}
.login-ambient-glow.glow-1 {
  width: 400px;
  height: 400px;
  background: var(--color-primary);
  top: -50px;
  left: -50px;
}
.login-ambient-glow.glow-2 {
  width: 500px;
  height: 500px;
  background: var(--color-purple);
  bottom: -100px;
  right: -100px;
}

/* 登录磨砂玻璃卡片 */
.login-card {
  width: 440px;
  padding: 40px;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(35px);
  -webkit-backdrop-filter: blur(35px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6);
  z-index: 10;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  transition: transform 0.3s ease;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}
.login-logo .logo-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  box-shadow: 0 0 20px rgba(59, 130, 246, 0.4);
}
.login-logo .logo-text {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 800;
  background: linear-gradient(135deg, #fff 40%, rgba(255, 255, 255, 0.6));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-title {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
}
.login-subtitle {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 32px;
}

/* 登录表单 */
.login-form {
  width: 100%;
}
.login-form .input-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 20px;
}
.login-form label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}
.login-form .input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.login-form .input-icon {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
}
.login-form input {
  width: 100%;
  padding: 12px 16px 12px 42px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  transition: all 0.25s;
  box-sizing: border-box;
}
.login-form input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.5);
  background: rgba(0, 0, 0, 0.4);
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.2);
}

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-purple));
  border: none;
  border-radius: 10px;
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.3s;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
  margin-top: 10px;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(59, 130, 246, 0.3);
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
}
.btn-login:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 演示账号芯片 */
.quick-accounts {
  margin-top: 36px;
  width: 100%;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
  padding-top: 24px;
}
.quick-title {
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 12px;
}
.quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}
.account-chip {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 11.5px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 6px;
}
.account-chip i {
  width: 12px;
  height: 12px;
}
.account-chip:hover, .account-chip.selected {
  background: rgba(59, 130, 246, 0.1);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--color-primary);
}

/* 抖动动画 */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}
.shake {
  animation: shake 0.4s ease;
}

/* 密码修改模态框特置 */
.password-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(3, 7, 18, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.25s ease;
}

.glass-card {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  overflow: hidden;
}

.scale-in {
  animation: scaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.scale-out {
  animation: scaleOut 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes scaleIn {
  from { transform: scale(0.92); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes scaleOut {
  from { transform: scale(1); opacity: 1; }
  to { transform: scale(0.92); opacity: 0; }
}

.modal-header {
  padding: 18px 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin: 0;
}
.btn-close-modal {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.btn-close-modal:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.modal-body {
  padding: 24px;
}
.glass-input {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
  color: #fff;
  font-size: 13.5px;
  transition: all 0.2s;
  box-sizing: border-box;
}
.glass-input:focus {
  outline: none;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.15);
}

.modal-form label {
  display: block;
  font-size: 12px;
  color: var(--text-secondary);
  font-weight: 600;
  margin-bottom: 6px;
}

/* ==========================================================================
   8D 纠正措施报告 A4 打印与预览样式
   ========================================================================== */
.report-8d-box {
  background: #ffffff;
  color: #0f172a;
  padding: 30px 40px;
  border-radius: 8px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  max-width: 900px;
  margin: 0 auto;
  font-family: var(--font-body);
}

.report-8d-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  text-align: center;
  color: #0f172a;
  margin-bottom: 2px;
}

.report-8d-subtitle {
  font-family: var(--font-display);
  font-size: 13px;
  color: #64748b;
  text-align: center;
  margin-bottom: 24px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.report-8d-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 20px;
  font-size: 13px;
  border: 1px solid #cbd5e1;
}

.report-8d-table th,
.report-8d-table td {
  border: 1px solid #cbd5e1;
  padding: 10px 12px;
  line-height: 1.5;
  vertical-align: middle;
}

.report-8d-table th {
  background-color: #f8fafc;
  color: #334155;
  font-weight: 600;
  width: 120px; /* 优化为 120px 宽度 */
  white-space: nowrap; /* 避免文字挤压折行 */
  text-align: left;
}

.report-8d-table td {
  background-color: #ffffff;
  color: #0f172a;
  word-break: break-all;
}

.report-8d-table .sec-title {
  background-color: #f1f5f9;
  color: #1e293b;
  font-weight: 700;
  font-size: 13.5px;
  text-align: left;
  border-top: 2px solid #cbd5e1;
  padding: 8px 12px;
}

/* 打印时媒体查询 */
@media print {
  body * {
    visibility: hidden;
  }
  #report-preview-body-container,
  #report-preview-body-container * {
    visibility: visible;
  }
  #report-preview-body-container {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    background: white !important;
    padding: 0 !important;
  }
  .report-8d-box {
    box-shadow: none !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }
  /* 强制打印背景颜色，如 sec-title 和 th */
  .report-8d-table th,
  .report-8d-table .sec-title {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}


