/* ===================================================================
   车辆维修管理系统 — Slate Modern Pro Design System v3.0
   设计理念：简洁专业 · 清晰易读 · 现代质感
   =================================================================== */

/* ===== CSS Reset ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  /* 移动端禁用双指缩放 + 双击放大（刘赛博要求）：
     touch-action: manipulation 会让浏览器只处理单指滚动/点击，
     忽略双指手势与 300ms 点击延迟的双击放大
  */
  touch-action: manipulation;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

/* ===== Design Tokens ===== */
:root {
  /* Brand Colors */
  --brand: #2563EB;
  --brand-dark: #1D4ED8;
  --brand-light: #DBEAFE;
  --brand-lighter: #EFF6FF;
  --brand-gradient: linear-gradient(135deg, #2563EB 0%, #3B82F6 100%);

  /* Accent */
  --accent: #0EA5E9;
  --accent-light: #E0F2FE;

  /* Semantic */
  --success: #10B981;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFFBEB;
  --danger: #EF4444;
  --danger-light: #FEF2F2;
  --info: #8B5CF6;
  --info-light: #F5F3FF;

  /* Neutrals — Slate */
  --slate-50: #F8FAFC;
  --slate-100: #F1F5F9;
  --slate-200: #E2E8F0;
  --slate-300: #CBD5E1;
  --slate-400: #94A3B8;
  --slate-500: #64748B;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1E293B;
  --slate-900: #0F172A;

  /* Surfaces — Glassmorphism (matching vehicle-doc-app style) */
  --bg-body: #EEF2F8;
  --bg-card: rgba(255, 255, 255, 0.58);
  --bg-sidebar: rgba(255, 255, 255, 0.58);
  --bg-sidebar-hover: rgba(255, 255, 255, 0.55);
  --bg-sidebar-active: #FFFFFF;
  --bg-input: rgba(255, 255, 255, 0.65);
  --bg-header: rgba(255, 255, 255, 0.58);

  /* Text */
  --text-primary: #1C1C1E;
  --text-secondary: #3A3A3C;
  --text-muted: #6E6E73;
  --text-inverse: #F8FAFC;
  --text-sidebar: #1C1C1E;
  --text-sidebar-active: #007aff;

  /* Borders */
  --border: rgba(255, 255, 255, 0.85);
  --border-light: #F1F5F9;
  --border-input: #CBD5E1;
  --border-focus: #4f86ff;

  /* Shadows — frosted glass elevation */
  --shadow-xs: 0 1px 2px rgba(30, 41, 59, 0.04);
  --shadow-sm: 0 2px 6px rgba(30, 41, 59, 0.05);
  --shadow-md: 0 6px 16px rgba(30, 41, 59, 0.06);
  --shadow-lg: 0 10px 30px rgba(30, 41, 59, 0.08);
  --shadow-xl: 0 20px 40px rgba(30, 41, 59, 0.10);
  --shadow-focus: 0 0 0 3px rgba(79, 134, 255, 0.15);
  --shadow-card: 0 10px 30px rgba(30, 41, 59, 0.06);

  /* Radii — Glassmorphism matching vehicle-doc-app */
  --radius-sm: 10px;
  --radius: 22px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 22px;
  --radius-full: 9999px;

  /* Spacing */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Transitions */
  --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);

  /* Typography */
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  --font-mono: "SF Mono", "Fira Code", "Consolas", "Courier New", monospace;

  /* Z-Index Layers (统一分层，避免 9999 滥用) */
  --z-fab: 600;
  --z-tooltip: 700;
  --z-sidebar: 800;
  --z-dropdown: 900;
  --z-modal: 1000;
  --z-toast: 1100;
}

body {
  font-family: var(--font);
  background: transparent;
  color: var(--text-primary);
  width: 100%;
  min-height: 100vh;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

/* ===== Round5 Fix T3: 与 vehicle-doc-app 一致的渐变背景 + 光斑动画 ===== */
.app-bg {
  position: fixed;
  inset: 0;
  z-index: -2;
  background: linear-gradient(155deg, #dbe6ff 0%, #ede4ff 34%, #ffe6ee 62%, #dcf4ec 100%);
}
.app-blob {
  position: fixed;
  z-index: -1;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.5;
  pointer-events: none;
}
.app-blob.b1 {
  width: 560px; height: 560px;
  background: #8ec2ff;
  top: -180px; left: -140px;
  animation: blob-float 16s ease-in-out infinite alternate;
}
.app-blob.b2 {
  width: 480px; height: 480px;
  background: #f2b8d6;
  bottom: -200px; right: -120px;
  animation: blob-float 19s ease-in-out infinite alternate-reverse;
}
.app-blob.b3 {
  width: 380px; height: 380px;
  background: #b8f0d8;
  top: 40%; left: 56%;
  opacity: 0.35;
  animation: blob-float 22s ease-in-out infinite alternate;
}
@keyframes blob-float {
  from { transform: translate(0, 0) scale(1); }
  to { transform: translate(40px, 30px) scale(1.08); }
}
@media (prefers-reduced-motion: reduce) {
  .app-blob { animation: none; }
}

/* ===== Auth Pages ===== */
.auth-body {
  min-height: 100vh;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #1E293B 0%, #334155 50%, #1E3A5F 100%);
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  position: relative;
}
/* 登录/注册页内容超高时可滚动（修复全局 overflow:hidden 导致底部内容看不到）
   flex 容器默认 min-height:auto 会把子项压到视口高度，导致溢出不可见；
   用 margin:auto 代替 align-items:center，内容超高时自动滚出视口 */
.auth-body .auth-container {
  margin: auto;
  flex-shrink: 0;
}

.auth-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 30%, rgba(37, 99, 235, 0.12) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 70%, rgba(14, 165, 233, 0.08) 0%, transparent 50%);
}

.auth-container {
  width: 420px;
  background: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.auth-header {
  text-align: center;
  margin-bottom: 32px;
}

.auth-header h1 {
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 8px;
  font-weight: 700;
  letter-spacing: -0.3px;
}

.auth-header p {
  color: var(--text-secondary);
  font-size: 14px;
}

.auth-form { }

.auth-form .form-group {
  margin-bottom: 20px;
}

.auth-footer {
  text-align: center;
  margin-top: 24px;
  font-size: 14px;
  color: var(--text-secondary);
  padding-top: 20px;
  border-top: 1px solid var(--border-light);
}

.auth-footer a {
  color: var(--brand);
  text-decoration: none;
  font-weight: 500;
  transition: var(--transition);
}

.auth-footer a:hover {
  color: var(--brand-dark);
  text-decoration: underline;
}

/* ===== Form Elements ===== */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  color: var(--slate-700);
  font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 9px 13px;
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 13px;
  font-size: 13.5px;
  font-family: var(--font);
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.65);
  transition: all 0.2s;
  outline: none;
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--text-muted);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3.5px rgba(0, 122, 255, 0.18);
  background: #FFFFFF;
}

.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748B' d='M6 8L2 4h8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
  line-height: 1.5;
}

.validation-error {
  color: var(--danger);
  font-size: 12px;
  margin-top: 4px;
  height: 16px;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-row .form-group {
  flex: 1;
}

.detail-row {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}

.detail-item {
  flex: 1;
}

.detail-item label {
  display: block;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}

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

/* ===== Buttons — Matching vehicle-doc-app style ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 22px;
  border: none;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  white-space: nowrap;
  line-height: 1.4;
  letter-spacing: 0.5px;
}

.btn-primary {
  background: linear-gradient(180deg, #1a84ff, #007aff);
  color: #FFFFFF;
  min-width: 80px;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.32);
  border: none;
  font-weight: 600;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 122, 255, 0.42);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
}

.btn-success:hover {
  background: #059669;
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-danger:hover {
  background: #DC2626;
}

.btn-default {
  background: #FFFFFF;
  color: var(--slate-700);
  border: 1px solid var(--border);
}

.btn-default:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-lighter);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12px;
}

.search-btn {
  height: 36px !important;
  padding: 0 16px !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px !important;
  border-radius: var(--radius-sm);
}

.auth-form .btn-primary {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  margin-top: 8px;
}

.modal-footer .btn-primary {
  width: auto;
  padding: 8px 24px;
  flex: 1;
  max-width: 140px;
}

.modal-footer .btn-default {
  width: auto;
  padding: 8px 24px;
  flex: 1;
  max-width: 140px;
}

/* Password strength */
.password-strength {
  margin-top: 8px;
  display: flex;
  gap: 4px;
}

.password-strength-bar {
  flex: 1;
  height: 4px;
  background: var(--slate-200);
  border-radius: 2px;
  transition: background 0.3s;
}

.password-strength-bar.weak { background: var(--danger); }
.password-strength-bar.medium { background: var(--warning); }
.password-strength-bar.strong { background: var(--success); }

.password-hint {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.6;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.password-hint div {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.password-hint .valid { color: var(--success); }
.password-hint .invalid { color: var(--danger); }

.invite-info {
  margin-top: 8px;
  font-size: 13px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  display: none;
}

.invite-info.valid {
  display: block;
  background: var(--success-light);
  color: #047857;
  border: 1px solid #A7F3D0;
}

.invite-info.invalid {
  display: block;
  background: var(--danger-light);
  color: #B91C1C;
  border: 1px solid #FECACA;
}

/* ===== Layout ===== */
.layout {
  display: flex;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
}

/* ===== Sidebar — Glassmorphism (matching vehicle-doc-app style) ===== */
.sidebar {
  width: 220px;
  background: var(--bg-sidebar);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  border-right: none;
  color: var(--text-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: var(--z-sidebar);
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.10);
  overflow-x: hidden;
}

.sidebar-logo {
  padding: 22px 20px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-logo h2 {
  font-size: 17px;
  color: var(--text-primary);
  font-weight: 700;
  letter-spacing: -0.2px;
}

.sidebar-menu {
  flex: 1;
  padding: 10px 0;
  overflow-y: auto;
}

.sidebar-links {
  padding: 8px 0;
  border-top: 1px solid rgba(0, 0, 0, 0.06);
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
}

.sidebar-link-item {
  display: flex;
  align-items: center;
  padding: 10px 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  text-decoration: none;
  font-size: 13px;
}

.sidebar-link-item:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-primary);
}

.sidebar-link-item .icon {
  margin-right: 10px;
  width: 16px;
  text-align: center;
}

.menu-item {
  display: flex;
  align-items: center;
  /* Matching vehicle-doc-app nav button style */
  min-height: auto;
  padding: 11px 14px 11px 14px;
  line-height: 1.4;
  color: var(--text-sidebar);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: all 0.2s;
  text-decoration: none;
  font-size: 14.5px;
  font-weight: 500;
  border-left: none;
  border-radius: 14px;
  box-sizing: border-box;
  margin-bottom: 2px;
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
}

.menu-item.active {
  background: #FFFFFF;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.16);
  border-left: none;
}

.menu-item .icon {
  margin-right: 10px;
  width: 18px;     /* Round3 Fix T1: 统一 icon 宽度 18px（不再 16px），消除顶级/父目录首字差 2px 根因 */
  text-align: center;
  font-size: 16px;
  flex-shrink: 0;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  font-style: normal;
  color: inherit;
}

/* ===== Collapsible Menu Groups ===== */
.menu-group {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* Note: .menu-group-header is defined below (around line 700) */

.menu-group-items {
  max-height: 600px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.2s ease;
  opacity: 1;
}

.menu-group.collapsed .menu-group-items {
  max-height: 0 !important;
  opacity: 0;
  overflow: hidden;
}

/* ===== 侧边栏菜单项：顶级项 / 父目录 / 子目录 文字严格垂直居中 =====
   Round4 Fix T1: 统一使用 min-height:38px + padding:0 + line-height:38px
   三级对齐基线（文字左起点）：顶级项=父目录=子目录 = 52px
   计算：padding-left 24px + icon宽度 18px + icon与文字间距 10px = 52px
   子目录（无图标）padding-left 直接=52px ===== */
.sidebar-menu > .menu-item {
  justify-content: flex-start;
  text-align: left;
  padding: 0 20px 0 24px;
  line-height: 38px;
  min-height: 38px;
  font-size: 14px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-menu > .menu-item .icon {
  margin-right: 10px;
  width: 18px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  flex-shrink: 0;
  font-size: 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}
.sidebar-menu > .menu-item.active {
  justify-content: flex-start;
}

/* ===== 父目录（菜单组标题）：与顶级项/子目录文字基线严格对齐 =====
   Round4 Fix T1: 整合到单一 definition，确保 align-items:center + 统一基线
   父目录文字左起点 = 子目录文字左起点 = 52px (24px padding + 18px icon + 10px gap)
*/
.menu-group-header {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
  padding: 0 40px 0 24px; /* right padding 40px gives room for arrow */
  line-height: 38px;
  min-height: 38px;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
  position: relative;
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
  background: rgba(255, 255, 255, 0.3);
  border-radius: 10px;
  margin: 2px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.menu-group-header:hover {
  background: rgba(255, 255, 255, 0.7);
}

/* 父目录图标：固定 18px 宽度 + 10px 右间距，使文字起点 = 52px */
.menu-group-header .icon {
  margin-right: 10px;
  width: 18px;
  height: 38px;
  line-height: 38px;
  text-align: center;
  flex-shrink: 0;
  font-size: 16px;
  display: inline-flex;
  justify-content: center;
  align-items: center;
}

/* 父目录箭头：改为 flex 布局内元素，不与徽章冲突 Round4 Fix T3 */
.menu-group-header .menu-arrow {
  position: static;
  flex-shrink: 0;
  margin-left: auto;
  margin-right: 0;
  font-size: 10px;
  color: var(--text-muted);
  transition: transform 0.25s ease;
  display: inline-block;
}

.menu-group.collapsed .menu-arrow {
  transform: rotate(-90deg);
}

/* 父目录徽章：红色数字显示子目录之和 */
.menu-group-header .menu-badge {
  margin-left: 8px;
  position: relative;
  top: 0;
  vertical-align: middle;
}

.menu-group-header .lock-indicator {
  display: inline-block;
  margin-left: 6px;
  color: #ffb020;
  line-height: 1;
}

/* ===== 子目录：匹配 vehicle-doc-app nav 风格 ===== */
.menu-group-items .menu-item {
  padding: 11px 14px 11px 44px;
  line-height: 1.4;
  min-height: auto;
  font-size: 14px;
  font-weight: 500;
  position: relative;
  transition: all 0.2s;
  border-left: none;
  background: transparent;
  box-sizing: border-box;
  border-radius: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.menu-group-items .menu-item > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.menu-group-items .menu-item .menu-badge {
  flex-shrink: 0;
}
.menu-group-items .menu-item:hover {
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
}
.menu-group-items .menu-item.active {
  background: #FFFFFF;
  color: var(--brand);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 122, 255, 0.16);
  border-left: none;
}
/* 移除子目录前的小圆点 / 竖线干扰 */
.menu-group-items .menu-item::before,
.menu-group-items .menu-item::after {
  display: none !important;
  content: none !important;
}

/* Sub-group (nested) support */
.menu-sub-group {
  border-top: 1px solid rgba(255, 255, 255, 0.03);
}

.menu-sub-group-header {
  display: flex;
  align-items: center;
  padding: 8px 20px 8px 56px;
  color: rgba(255, 255, 255, 0.6);
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  user-select: none;
  transition: var(--transition-fast);
}

.menu-sub-group-header:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.04);
}

.menu-sub-group-header .menu-arrow {
  margin-left: auto;
  font-size: 8px;
  transition: transform 0.2s ease;
}

.menu-sub-group.collapsed .menu-arrow {
  transform: rotate(-90deg);
}

.menu-sub-group-items {
  max-height: 300px;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.menu-sub-group.collapsed .menu-sub-group-items {
  max-height: 0 !important;
  overflow: hidden;
}

.menu-sub-group-items .menu-item {
  padding: 7px 20px 7px 72px;
  font-size: 12px;
}

/* ===== 公文预览样式（与导出格式一致） ===== */
.doc-preview {
  font-family: "FangSong_GB2312", "仿宋_GB2312", "仿宋", "STFangsong", "SimSun", "宋体", serif;
  font-size: 16px;
  line-height: 28px;
  color: #000;
  padding: 40px 48px;
  background: #fff;
  max-width: 780px;
  margin: 0 auto;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  min-height: 500px;
}

.doc-preview .doc-title {
  font-family: "方正小标宋简体", "FZXiaoBiaoSong-B05", "STZhongsong", "SimSun", serif;
  font-size: 22px;
  text-align: center;
  font-weight: normal;
  margin-bottom: 32px;
  letter-spacing: 2px;
}

.doc-preview .doc-h1 {
  font-family: "SimHei", "黑体", sans-serif;
  font-size: 16px;
  font-weight: normal;
  margin-top: 16px;
  margin-bottom: 4px;
}

.doc-preview .doc-h2 {
  font-family: "KaiTi_GB2312", "楷体_GB2312", "KaiTi", "楷体", "STKaiti", serif;
  font-size: 16px;
  font-weight: bold;
  margin-top: 8px;
  margin-bottom: 2px;
}

.doc-preview .doc-h3 {
  font-family: "FangSong_GB2312", "仿宋_GB2312", "仿宋", "STFangsong", serif;
  font-size: 16px;
  font-weight: bold;
  margin-top: 4px;
}

.doc-preview .doc-body {
  text-indent: 2em;
  text-align: justify;
  font-family: "FangSong_GB2312", "仿宋_GB2312", "仿宋", "STFangsong", "SimSun", serif;
  font-size: 16px;
  margin: 0;
}

.doc-preview .doc-org {
  text-align: right;
  font-family: "FangSong_GB2312", "仿宋_GB2312", "仿宋", "STFangsong", serif;
  font-size: 16px;
  margin-top: 32px;
  padding-right: 60px;
}

.doc-preview .doc-date {
  text-align: right;
  font-family: "FangSong_GB2312", "仿宋_GB2312", "仿宋", "STFangsong", serif;
  font-size: 16px;
  padding-right: 60px;
}

/* 公文预览/编辑切换按钮 */
.doc-view-toggle {
  display: inline-flex;
  border: 1px solid #ddd;
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 10px;
}
.doc-view-toggle button {
  padding: 6px 14px;
  font-size: 13px;
  border: none;
  background: #fff;
  cursor: pointer;
  color: #666;
  transition: all 0.15s;
}
.doc-view-toggle button.active {
  background: #1890ff;
  color: #fff;
}
.doc-view-toggle button:hover:not(.active) {
  background: #f5f5f5;
}

.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  text-align: center;
}

/* ===== Main Content ===== */
.main {
  flex: 1;
  margin-left: 220px;
  display: flex;
  flex-direction: column;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  max-height: 100vh;
  overflow: hidden;
  background: transparent;
}

/* ===== Header — Glassmorphism (matching vehicle-doc-app style) ===== */
.header {
  height: 64px;
  background: var(--bg-header);
  border-bottom: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 26px;
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 18px rgba(31, 38, 135, 0.06);
}

.header-left {
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.menu-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 18px;
  cursor: pointer;
  padding: 6px 10px;
  color: var(--slate-600);
  transition: var(--transition-fast);
}

.menu-toggle:hover {
  background: var(--slate-100);
  border-color: var(--brand);
  color: var(--brand);
}

.modal-backdrop {
  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: 99;
}

.modal-backdrop.show {
  display: block;
}

.table-container {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

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

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
}

/* 移动端退出按钮 - 桌面端默认隐藏 */
.mobile-logout-btn {
  display: none !important;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  transition: background 0.2s;
  align-items: center;
  justify-content: center;
}
.mobile-logout-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

/* ===== Content — Glassmorphism ===== */
.content {
  flex: 1;
  position: relative;
  overflow: hidden;
  min-height: 0;
  padding: 24px 32px;
  box-sizing: border-box;
  overflow-y: auto;
  /* Subtle glass background matching doc-pro style */
  background:
    radial-gradient(ellipse 50% 40% at 20% 0%, rgba(122, 166, 255, 0.12) 0%, transparent 60%),
    radial-gradient(ellipse 40% 50% at 90% 100%, rgba(164, 227, 255, 0.08) 0%, transparent 55%);
}

/* Page sections are scrollable containers */
.page-section {
  display: none;
  box-sizing: border-box;
  padding: 0;
  width: 100%;
  flex-shrink: 0;
}

.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;
}

/* 加油登记 · 明细导出页面（Tab切换布局） */
.page-section#page-fuel-center.active {
  display: block;
}

.page-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* ===== Cards — Glassmorphism (matching vehicle-doc-app style) ===== */
.card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: 0 8px 32px rgba(31, 38, 135, 0.10);
  margin-bottom: 18px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(28px) saturate(180%);
  -webkit-backdrop-filter: blur(28px) saturate(180%);
  transition: box-shadow 0.25s;
}

.card:hover {
  box-shadow: 0 16px 48px rgba(31, 38, 135, 0.16);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.5);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
}

.vehicle-count-badge {
  display: inline-block;
  margin-left: 10px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--brand);
  background: var(--brand-light);
  border-radius: var(--radius-full);
  vertical-align: middle;
}

.btn-copy-plate {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  margin-left: 4px;
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  color: var(--slate-500);
  transition: var(--transition-fast);
  vertical-align: middle;
}

.btn-copy-plate:hover {
  background: var(--brand);
  color: #FFFFFF;
  border-color: var(--brand);
}

/* ===== 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); }
}

/* ===== Mobile Components ===== */

/* ===== 通用菜单徽章样式（替换index.html中重复的inline style） ===== */
.menu-badge {
  margin-left: 8px;
  flex-shrink: 0;
  background: #ff4d4f;
  color: #fff;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.4;
  font-weight: 500;
  white-space: nowrap;
}
.menu-badge.sm {
  font-size: 11px;
  padding: 1px 5px;
  border-radius: 10px;
}
/* Round5 Fix S3: 空徽标（如未读数为 0 时）不再渲染成红色小短条，避免"消息聊天"右侧出现多余红块 */
.menu-badge:empty {
  display: none !important;
}

/* ===== Round4 Fix T5: 材料来源筛选按钮样式 ===== */
.material-src-btn {
  padding: 4px 10px;
  font-size: 13px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #595959;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}
.material-src-btn:hover {
  border-color: #1890ff;
  color: #1890ff;
}
.material-src-btn.active {
  background: #1890ff;
  border-color: #1890ff;
  color: #fff;
}

/* ===== Round5 Fix S23: 材料库/问题库分页条样式 ===== */
.doc-pro-pager-btn {
  min-width: 34px;
  padding: 5px 10px;
  font-size: 13px;
  border: 1px solid #d9d9d9;
  background: #fff;
  color: #374151;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.18s;
  line-height: 1.5;
}
.doc-pro-pager-btn:hover:not(:disabled) {
  border-color: #1890ff;
  color: #1890ff;
}
.doc-pro-pager-btn.active {
  background: #1890ff;
  border-color: #1890ff;
  color: #fff;
  font-weight: 600;
}
.doc-pro-pager-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ===== Round5 Fix S24: 通用 Switch 开关（启用/禁用控件） ===== */
.switch-control {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  vertical-align: middle;
  flex-shrink: 0;
}
.switch-control input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.switch-control .switch-slider {
  position: absolute;
  inset: 0;
  background: #d9d9d9;
  border-radius: 999px;
  transition: background 0.25s ease;
  cursor: pointer;
}
.switch-control .switch-slider::before {
  content: '';
  position: absolute;
  width: 18px;
  height: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease;
}
.switch-control input:checked + .switch-slider {
  background: #34c759;
}
.switch-control input:checked + .switch-slider::before {
  transform: translateX(20px);
}
.switch-control input:disabled + .switch-slider {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ===== Round4 Fix T1: 子目录与父目录同字大小 ===== */
.menu-group-items .menu-item {
  font-size: 14px;
}
.menu-group-items .menu-item .menu-badge {
  margin-left: auto;
}

/* ===== Round4 Fix T2: 侧边栏与内容区衔接平顺 ===== */
.app-sidebar {
  border-right: none !important;
}

/* ===== Round4 Fix T4: 公文预览正文样式 ===== */
.gw-body p {
  text-indent: 2em;
  margin: 0.5em 0;
  line-height: 1.8;
}
.gw-body .gw-h1 {
  font-weight: bold;
  font-size: 16px;
  margin: 1em 0 0.5em;
}
.gw-body .gw-h2 {
  font-weight: bold;
  font-size: 15px;
  margin: 0.8em 0 0.4em;
}
.gw-body .gw-h3 {
  font-weight: 500;
  margin: 0.6em 0 0.3em;
}

.mobile-tabbar { display: none; }
.mobile-more-panel { display: none; }
.mobile-fab { display: none; }

/* ===== Responsive: Tablet (768px) ===== */
@media (max-width: 768px) {
  .menu-toggle { display: block; }
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    width: 80%;
    max-width: 280px;
    z-index: 101;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .header { padding: 0 16px; height: 56px; }
  .header-left { font-size: 16px; }
  .header-links { display: none !important; }
  .content {
    padding: 16px !important;
    padding-bottom: calc(16px + 56px + env(safe-area-inset-bottom, 0)) !important;
  }
  .page-section { padding: 0; margin: 0; }
  .card { padding: 16px; margin-bottom: 16px; border-radius: var(--radius); }
  .card-header { margin-bottom: 12px; padding-bottom: 10px; }
  .card-title { font-size: 15px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
  .stats-grid-6 { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr); }
  .stat-card { padding: 16px; }
  .stat-card-sm { padding: 10px 6px; }
  .stat-card-sm .stat-value { font-size: 20px; }
  .stat-card .stat-value { font-size: 28px; }
  .stat-card .stat-label { font-size: 12px; }
  .dashboard-top { flex-direction: column; }
  .dashboard-top .filter-bar { min-width: unset; width: 100%; }
  .utility-row { width: 100%; }
  .mini-card { flex: 1; min-width: 0; padding: 6px 8px; }
  .filter-bar { gap: 10px; margin-bottom: 16px; }
  .filter-bar .form-group { width: 100%; min-width: 100%; }
  .filter-bar .btn { width: 100%; height: 40px; font-size: 14px; }
  .table th, .table td { padding: 10px 8px; font-size: 13px; white-space: nowrap; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .detail-grid { grid-template-columns: 1fr; gap: 12px; }
  .modal-content { width: 95%; max-width: 100%; max-height: 90vh; }
  .modal-header { padding: 16px; }
  .modal-title { font-size: 16px; }
  .modal-body { padding: 16px; }
  .modal-footer { padding: 12px 16px; }
  .form-row { flex-direction: column; gap: 0; }
  .btn { padding: 10px 18px; font-size: 13px; }
  .btn-sm { padding: 5px 10px; font-size: 12px; }
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; flex-wrap: nowrap; }
  .tab-item { padding: 10px 16px; font-size: 13px; white-space: nowrap; }
  .pagination { flex-direction: column; gap: 10px; align-items: flex-start; }
  .settings-grid { grid-template-columns: 1fr; gap: 12px; }
  .settings-card .card-header { padding: 12px 16px; }
  .settings-card .card-body { padding: 12px 16px; }
  .settings-groups { gap: 12px; }
  .form-group-inline { flex-wrap: wrap; }
  .form-group-inline label { min-width: 100%; }

  .auth-container { width: calc(100% - 32px) !important; max-width: none !important; margin: 16px auto !important; border-radius: var(--radius-lg) !important; }
  .auth-header { padding: 20px 24px !important; }
  .auth-header h1 { font-size: 18px !important; }
  .auth-header p { font-size: 13px !important; }
  .auth-form { padding: 24px !important; }
  .auth-form .form-group label { font-size: 13px !important; }
  .auth-form .form-group input { padding: 10px 14px !important; font-size: 15px !important; }
  .auth-form .btn-primary { padding: 12px 24px !important; font-size: 15px !important; }
  .auth-footer { padding: 16px 24px !important; }
  .password-hint { font-size: 10px !important; }
  .password-hint .hint-item { padding: 2px 6px !important; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr); }
  .stats-grid-4 { grid-template-columns: 1fr; }
  .stat-card .stat-value { font-size: 24px; }
  .stat-card-sm .stat-value { font-size: 18px; }
  .filter-bar { flex-wrap: wrap; }
  .filter-bar .form-group { flex: 1; min-width: 120px; }
  .utility-row { flex-direction: column; }
  .mini-card { max-width: 100%; }
  .content { padding: 12px !important; padding-bottom: calc(12px + 56px + env(safe-area-inset-bottom, 0)) !important; }
  .page-section { padding: 0; margin: 0; }
  .card { padding: 12px; margin-bottom: 12px; }
  .header-left { font-size: 15px; }
  .user-info span { display: none; }
  .btn { padding: 8px 14px; font-size: 12px; }
  .btn-sm { padding: 4px 8px; font-size: 11px; }
  .modal-footer .btn-primary, .modal-footer .btn-default { max-width: none; }
  .form-group { margin-bottom: 16px; }
  .form-group input, .form-group select, .form-group textarea { padding: 10px 12px; font-size: 13px; }
  .action-btns { flex-wrap: wrap; gap: 4px; }
  .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-container { width: calc(100% - 24px) !important; margin: 12px auto !important; }
  .auth-header h1 { font-size: 16px !important; }
  .auth-form { padding: 20px 16px !important; }
}

/* ===== Mobile Full Adaptation (<=768px) ===== */
@media (max-width: 768px) {
  .mobile-hide { display: none !important; }
  .sidebar { display: none !important; }
  .main { margin-left: 0 !important; }
  .header { height: 50px; padding: 0 12px; position: sticky; top: 0; z-index: 50; }
  .header-left { font-size: 16px; }
  .menu-toggle { display: none !important; }
  .content { padding: 12px !important; padding-bottom: calc(12px + 56px + env(safe-area-inset-bottom, 0)) !important; }
  .page-section { padding: 0; margin: 0; }
  .page-title { font-size: 17px; margin-bottom: 12px; }

  .mobile-tabbar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #FFFFFF;
    border-top: 1px solid var(--border);
    z-index: 1000;
    box-shadow: 0 -2px 12px rgba(15, 23, 42, 0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }

  .tabbar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--text-muted);
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
    text-decoration: none;
  }

  .tabbar-item .tabbar-icon { font-size: 20px; margin-bottom: 2px; line-height: 1; }
  .tabbar-item.active { color: var(--brand); }
  .tabbar-item:active { background: var(--slate-100); }

  .mobile-more-panel {
    display: none;
    position: fixed;
    bottom: 56px;
    left: 0;
    right: 0;
    background: #FFFFFF;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.12);
    z-index: var(--z-modal);
    padding: 20px 16px;
    padding-bottom: calc(20px + env(safe-area-inset-bottom, 0));
    max-height: 60vh;
    overflow-y: auto;
  }

  .mobile-more-panel.show {
    display: block;
    animation: slideUp 0.25s ease;
  }

  @keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
  }

  .mobile-more-panel .more-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
    text-align: center;
  }

  .mobile-more-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
  }

  .mobile-more-grid .more-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 4px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition-fast);
    min-height: 44px;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-more-grid .more-item:active { background: var(--brand-lighter); }
  .mobile-more-grid .more-item .more-icon { font-size: 24px; }
  .mobile-more-grid .more-item .more-text { font-size: 11px; color: var(--text-secondary); }
  .mobile-more-grid a.more-item { color: inherit; text-decoration: none; }
  .mobile-more-grid a.more-item .more-text { color: var(--text-secondary); }

  .mobile-more-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(2px);
    z-index: 998;
  }

  .mobile-more-backdrop.show { display: block; }

  .mobile-fab { display: none !important; }
  .mobile-fab:active { transform: scale(0.9); }

  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stat-card { padding: 14px 10px !important; }
  .stat-card .stat-value { font-size: 22px !important; }
  .stat-card .stat-label { font-size: 12px !important; }

  .table-container { overflow-x: visible !important; }
  .card .table, .pub-order-table { display: block; }
  .card .table thead, .pub-order-table thead { display: none; }
  .card .table tbody, .pub-order-table tbody { display: block; }

  .card .table tbody tr, .pub-order-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    padding: 12px;
    margin-bottom: 10px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #FFFFFF;
    box-shadow: var(--shadow-xs);
  }

  .card .table tbody tr:hover, .pub-order-table tbody tr:hover { background: #FFFFFF; }

  .card .table tbody td, .pub-order-table tbody td {
    display: flex;
    align-items: center;
    width: 50%;
    padding: 4px 0;
    border: none;
    font-size: 13px;
    white-space: normal;
    text-align: left;
  }

  .card .table tbody td:before, .pub-order-table tbody td:before {
    content: attr(data-label);
    font-size: 11px;
    color: var(--text-muted);
    margin-right: 6px;
    white-space: nowrap;
    flex-shrink: 0;
    font-weight: 500;
  }

  .card .table tbody td:last-child, .pub-order-table tbody td:last-child {
    width: 100%;
    justify-content: flex-end;
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border-light);
  }

  .card .table tbody td[colspan], .pub-order-table tbody td[colspan] {
    width: 100%;
    justify-content: center;
    padding: 20px;
    color: var(--text-muted);
  }

  .card .table tbody td[colspan]:before, .pub-order-table tbody td[colspan]:before { content: ''; }

  .card .table.repair-items-table { display: table !important; width: 100%; }
  .card .table.repair-items-table thead { display: table-header-group !important; }
  .card .table.repair-items-table tbody { display: table-row-group !important; }
  .card .table.repair-items-table tbody tr { display: table-row !important; border-radius: 0; border: none; box-shadow: none; margin-bottom: 0; padding: 0; flex-wrap: nowrap; }
  .card .table.repair-items-table tbody td, .card .table.repair-items-table thead th { display: table-cell !important; width: auto !important; flex: none; padding: 8px 4px; border: 1px solid var(--border-light); font-size: 12px; white-space: nowrap; text-align: center; }
  .card .table.repair-items-table tbody td:before { content: '' !important; margin: 0; }
  .card .table.repair-items-table tbody td:last-child { justify-content: center; margin-top: 0; padding-top: 8px; border-top: 1px solid var(--border-light); }

  .empty-state { text-align: center; padding: 20px; color: var(--text-muted); }

  .modal { align-items: stretch !important; padding: 0 !important; }
  .modal.show { display: flex; }
  .modal-content { width: 100% !important; max-width: 100% !important; max-height: 100vh !important; height: 100vh !important; border-radius: 0 !important; margin: 0 !important; }
  .modal-header { padding: 12px 16px !important; border-bottom: 1px solid var(--border-light); position: sticky; top: 0; background: #FFFFFF; z-index: 10; }
  .modal-title { font-size: 16px !important; }
  .modal-body { padding: 16px !important; flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
  .modal-footer { padding: 10px 16px !important; border-top: 1px solid var(--border-light); position: sticky; bottom: 0; background: #FFFFFF; z-index: 10; padding-bottom: calc(10px + env(safe-area-inset-bottom, 0)); }
  .modal-footer .btn { flex: 1; max-width: none !important; min-height: 44px; }

  .form-row { flex-direction: column !important; gap: 0 !important; }
  .form-group input, .form-group select, .form-group textarea { min-height: 44px; font-size: 15px !important; }
  .form-group label { font-size: 13px; }

  .filter-bar { flex-direction: column !important; gap: 8px !important; align-items: stretch !important; }
  .filter-bar .form-group { min-width: 0 !important; width: 100%; }
  .filter-bar .form-group input, .filter-bar .form-group select { min-height: 40px; }
  .filter-bar .btn, .search-btn { min-height: 40px; width: 100%; }

  .btn { min-height: 44px; font-size: 14px !important; padding: 10px 16px; }
  .btn-sm { min-height: 36px; font-size: 13px !important; padding: 6px 12px; }

  .card { padding: 14px !important; margin-bottom: 12px !important; border-radius: var(--radius); }
  .card-header { flex-wrap: wrap; gap: 8px; padding-bottom: 10px !important; }
  .card-title { font-size: 14px !important; }

  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
  .tab-item { white-space: nowrap; padding: 8px 12px !important; font-size: 13px !important; min-height: 44px; display: flex; align-items: center; }

  .detail-grid { grid-template-columns: 1fr !important; }
  .detail-row { flex-direction: column !important; gap: 0 !important; }
  .photo-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 8px !important; }
  .upload-area { padding: 16px !important; }
  .upload-area .upload-icon { font-size: 32px !important; }
  .settings-grid { grid-template-columns: 1fr !important; }
  .pagination { flex-wrap: wrap; justify-content: center; gap: 4px; }
  .pagination button { min-width: 36px; min-height: 36px; font-size: 12px; }
  .header-right { gap: 8px; }
  .user-info span:not(.user-avatar) { display: none; }
  #bindWorkshopBtn, #userName, #userWorkshopInfo { display: none !important; }
  .user-avatar { width: 32px !important; height: 32px !important; font-size: 14px !important; }
  .notification-dropdown { position: fixed; top: 50px; right: 0; left: 0; width: 100% !important; max-height: 60vh; border-radius: 0 0 var(--radius-md) var(--radius-md); }
  #repairStepTabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  #repairStepTabs .tab-item { min-width: 80px; justify-content: center; }
  #repairItemsBody tr td { font-size: 12px; padding: 6px 4px; }
  .modal-content[style*="900px"], .modal-content[style*="800px"], .modal-content[style*="600px"], .modal-content[style*="500px"], .modal-content[style*="450px"], .modal-content[style*="400px"] { width: 100% !important; max-width: 100% !important; }
  .action-btns { flex-wrap: wrap; gap: 4px; }
  .order-actions { flex-wrap: wrap; gap: 4px; }
  .repair-cost-summary { padding: 10px !important; }
  .repair-cost-row.total .cost-value { font-size: 15px !important; }
  #sidebarBackdrop { display: none !important; }

  .menu-item[data-desktop-only] { display: none !important; }
  .menu-group[data-desktop-only] { display: none !important; }
  [data-desktop-only] { display: none !important; }
  .sidebar-logo, .sidebar-footer { display: none !important; }
  .notification-bell { display: none !important; }
  .user-info { display: none !important; }
  .mobile-logout-btn { display: flex !important; }
  #bindWorkshopBtn { display: none !important; }
  .btn[onclick="switchPage('password')"] { display: none !important; }
  .header { justify-content: space-between !important; }
  .header-left { flex: 1; }
  #pageTitle { font-size: 16px; font-weight: 600; }

  .mobile-tabbar { display: flex !important; }
  .mobile-more-panel.show { display: block !important; }
  .mobile-more-backdrop.show { display: block !important; }

  #page-repairs .btn-back, #page-repairs [onclick*="showPage('dashboard')"], #page-repairs [onclick*="switchPage('dashboard')"] { display: none !important; }
  #page-repairs .filter-bar { flex-direction: column; gap: 10px; }
  #page-repairs .filter-bar .form-group { width: 100%; }
  #page-repairs .filter-bar .btn { width: 100%; height: 44px; font-size: 15px; }
  #page-repairs input[type="text"], #page-repairs input[type="number"], #page-repairs input[type="date"], #page-repairs select, #page-repairs textarea { min-height: 44px; font-size: 15px; padding: 10px 12px; }
  #page-repairs .btn { min-height: 44px; font-size: 15px; }
  #page-repairs .form-group label { font-size: 14px; margin-bottom: 6px; }
  #page-repairs .form-group { margin-bottom: 14px; }
  #page-repairs .upload-box, #page-repairs .upload-area { min-height: 80px; font-size: 14px; }
  #page-repairs .photo-grid { grid-template-columns: repeat(3, 1fr); gap: 6px; }
  #page-repairs .tabs { overflow-x: auto; overflow-y: hidden; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; scrollbar-width: none; white-space: nowrap; width: 100%; border-bottom: none; margin-bottom: 0; padding-bottom: 8px; border-bottom: 2px solid var(--border-light); }
  #page-repairs .tabs::-webkit-scrollbar { display: none; }
  #page-repairs .tab-item { flex-shrink: 0; padding: 10px 16px; font-size: 14px; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -2px; }
  #page-repairs .tab-item.active { border-bottom-color: var(--brand); color: var(--brand); font-weight: 500; }
  #page-repairs .filter-bar input, #page-repairs .filter-bar select { width: 100%; min-height: 44px; }
  #page-repairs .card { border-radius: var(--radius-sm); box-shadow: var(--shadow-xs); }
  #page-repairs #newRepairBtn { min-height: 40px; padding: 0 16px; font-size: 14px; }
  #page-repairs .repair-filter-bar { display: none !important; }

  .form-group input, .form-group select, .form-group textarea { width: 100%; max-width: 100%; box-sizing: border-box; }
  .filter-group select, .filter-group input, .filter-bar select, .filter-bar input { width: 100%; max-width: 100%; box-sizing: border-box; }
  .form-row { flex-direction: column; gap: 10px; }
  .form-row .form-group { width: 100%; }
  .btn { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; box-sizing: border-box; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }
  .upload-box { padding: 12px; width: 100%; box-sizing: border-box; }
  .upload-preview img { max-width: 100%; height: auto; }
  .modal { width: 95%; max-width: 95vw; max-height: 90vh; left: 50%; top: 50%; transform: translate(-50%, -50%); margin: 0; overflow-y: auto; }
  .modal-content { width: 100%; box-sizing: border-box; padding: 16px; }
  .table-wrapper, .card table { max-width: 100%; overflow-x: auto; display: block; }
  .detail-grid, .detail-item { max-width: 100%; box-sizing: border-box; }
  .card .actions, .card [style*="display:flex"][style*="gap"] { flex-wrap: wrap; gap: 8px; }
  .btn, .tab-item, .menu-item, .more-item { -webkit-tap-highlight-color: transparent; }
  .btn { min-height: 40px; font-size: 14px; }
  .btn-sm { min-height: 32px; }
  .form-group input, .form-group select, .form-group textarea { min-height: 42px; font-size: 15px; }
  .card { margin-bottom: 12px; }
  .card-header { flex-wrap: wrap; gap: 8px; }
  #page-password .card { max-width: 100% !important; }
  #page-invite-codes .card-header { flex-direction: column; align-items: stretch; }
  #page-invite-codes #inviteCodeActionArea { width: 100%; }
  #page-invite-codes #inviteCodeActionArea .btn { flex: 1; }
  #page-public-orders .card-header { flex-direction: column; align-items: stretch; }
  .table-wrapper { -webkit-overflow-scrolling: touch; }
  .pagination button, .pagination .page-btn { min-width: 36px; min-height: 36px; font-size: 13px; }
  .modal { overflow-y: auto; }
  .modal-content { max-height: 85vh; }

  html, body { overflow-x: hidden; width: 100%; max-width: 100vw; }
  #app { overflow-x: hidden; width: 100%; max-width: 100vw; }
  .main { width: 100%; max-width: 100vw; overflow-x: hidden; }
  .content { padding: 12px !important; padding-bottom: calc(12px + 56px + env(safe-area-inset-bottom, 0)) !important; }
  .page-section { padding: 0; margin: 0; }
  .card { width: 100%; max-width: 100%; box-sizing: border-box; overflow-x: hidden; }
  .header { width: 100%; box-sizing: border-box; padding: 8px 12px; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr !important; }
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr) !important; }
  .stats-grid-4 { grid-template-columns: 1fr !important; }
  .mobile-more-grid { grid-template-columns: repeat(3, 1fr); }
  .stat-card .stat-value { font-size: 18px !important; }
  .stat-card-sm .stat-value { font-size: 16px !important; }
  .card .table tbody td, .pub-order-table tbody td { width: 100% !important; }
  .card .table tbody td:before, .pub-order-table tbody td:before { width: 70px; }
  .header-left { font-size: 14px; }
}

/* Desktop: repair filter toggle */
@media (min-width: 769px) {
  #repairFilterToggle { display: none; }
  #repairDateFilter { display: flex !important; }
}

/* ===== Chat System ===== */
#page-chat.active {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  height: 100%;
}

.chat-layout {
  display: flex;
  flex: 1;
  height: 100%;
  min-height: 0;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.chat-sidebar {
  width: 300px;
  min-width: 260px;
  background: var(--slate-50);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.chat-sidebar-head {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--border);
  background: #FFFFFF;
}

.chat-sidebar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  min-width: 0;
}

.chat-sidebar-icon { font-size: 18px; }

.chat-new-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.chat-new-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.4);
}

.chat-search {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  background: #FFFFFF;
}

.chat-search-icon {
  color: var(--text-muted);
  font-size: 13px;
}

.chat-search input {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--slate-50);
  font-size: 13px;
  font-family: var(--font);
  outline: none;
  transition: var(--transition-fast);
  color: var(--text-primary);
}

.chat-search input:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
  background: #FFFFFF;
}

.conversation-list {
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.chat-list-tip {
  padding: 36px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

.conversation-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: var(--transition-fast);
}

.conversation-item:hover {
  background: var(--brand-lighter);
}

.conversation-item.active {
  background: var(--brand-light);
  border-left-color: var(--brand);
}

.conversation-avatar {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(59, 130, 246, 0.2);
}

.conversation-info {
  flex: 1;
  min-width: 0;
}

.conversation-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.conversation-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.conversation-time {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.conversation-msg {
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.conversation-unread {
  background: var(--danger);
  color: #FFFFFF;
  font-size: 11px;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
  min-width: 18px;
  text-align: center;
  font-weight: 600;
}

/* ===== Vehicle Calendar View ===== */
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  background: #f0f0f0;
  border-radius: 8px;
  overflow: hidden;
}
.calendar-header {
  display: contents;
}
.calendar-weekday {
  background: #1890ff;
  color: #fff;
  text-align: center;
  padding: 8px 0;
  font-weight: 600;
  font-size: 13px;
}
.calendar-day {
  background: #fff;
  min-height: 80px;
  padding: 4px 6px;
  cursor: pointer;
  transition: background 0.2s;
  position: relative;
  overflow: hidden;
}
.calendar-day:hover { background: #e6f7ff; }
.calendar-day.other-month { background: #fafafa; color: #ccc; }
.calendar-day.today { background: #e6f7ff; border: 2px solid #1890ff; }
.calendar-day.selected { background: #bae7ff; border: 2px solid #096dd9; }
.calendar-day-number {
  font-size: 12px;
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}
.calendar-day.today .calendar-day-number { color: #1890ff; }
.calendar-event {
  font-size: 10px;
  padding: 1px 3px;
  margin-bottom: 1px;
  border-radius: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
  color: #fff;
}
.calendar-event.overdue { background: #ff4d4f; }
.calendar-event.soon7 { background: #faad14; }
.calendar-event.soon30 { background: #1890ff; }
.calendar-event.normal { background: #52c41a; }
.calendar-more {
  font-size: 10px;
  color: #999;
  padding: 0 3px;
}
.calendar-day-detail {
  background: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  padding: 12px 16px;
  margin-top: 8px;
}
.calendar-day-detail h4 {
  margin: 0 0 8px 0;
  font-size: 15px;
  color: #333;
}
.calendar-detail-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px dashed #f0f0f0;
  font-size: 13px;
}
.calendar-detail-item:last-child { border-bottom: none; }
.calendar-detail-type {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  flex-shrink: 0;
}
.calendar-detail-type.overdue { background: #ff4d4f; }
.calendar-detail-type.soon7 { background: #faad14; }
.calendar-detail-type.soon30 { background: #1890ff; }
.calendar-detail-type.normal { background: #52c41a; }

@media (max-width: 768px) {
  .calendar-day { min-height: 60px; padding: 2px 3px; }
  .calendar-event { font-size: 9px; padding: 0 2px; }
  .calendar-day-number { font-size: 11px; }
}

/* ===== Image Lazy Loading ===== */
img.lazy-load {
  background: linear-gradient(135deg, #f5f5f5 25%, #e8e8e8 50%, #f5f5f5 75%);
  background-size: 200% 100%;
  animation: lazy-shimmer 1.5s infinite;
  min-height: 60px;
}
@keyframes lazy-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
img.lazy-load.loaded {
  animation: none;
  background: transparent;
}
/* 全局图片懒加载降级 */
img[loading="lazy"] {
  background-color: #f5f5f5;
}

.chat-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--slate-50);
}

.chat-empty-state {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
}

.chat-empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.6;
}

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

.chat-empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.chat-new-btn-large {
  border: none;
  border-radius: var(--radius);
  padding: 10px 22px;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transition: var(--transition-fast);
}

.chat-new-btn-large:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.4);
}

.chat-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.chat-head {
  padding: 12px 18px;
  background: #FFFFFF;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.chat-back-btn {
  display: none;
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--slate-700);
  font-size: 18px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.chat-back-btn:hover {
  background: var(--slate-100);
}

.chat-head-main {
  flex: 1;
  min-width: 0;
}

.chat-head-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-head-sub {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

.chat-readonly-badge {
  background: var(--warning-light);
  color: #92400E;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

.chat-clear-btn {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border);
  background: #FFFFFF;
  color: var(--text-muted);
  font-size: 15px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.chat-clear-btn:hover {
  color: var(--danger);
  border-color: #FECACA;
  background: var(--danger-light);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.message {
  display: flex;
  max-width: 72%;
}

.message.sent {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.message.received {
  align-self: flex-start;
}

.message-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  background: linear-gradient(135deg, var(--slate-300), var(--slate-400));
  color: #FFFFFF;
}

.message.sent .message-avatar {
  background: var(--brand-gradient);
  margin-left: 8px;
}

.message.received .message-avatar {
  margin-right: 8px;
}

.message-body {
  display: flex;
  flex-direction: column;
  max-width: 100%;
  min-width: 0;
}

.message-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.message.sent .message-meta {
  flex-direction: row-reverse;
}

.message-sender {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
}

.message.sent .message-sender {
  color: var(--brand);
}

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

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

.message-bubble {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 14px;
  line-height: 1.55;
  word-break: break-word;
}

.message.sent .message-bubble {
  background: var(--brand-gradient);
  color: #FFFFFF;
  border-bottom-right-radius: 4px;
}

.message.received .message-bubble {
  background: #FFFFFF;
  color: var(--text-primary);
  border-bottom-left-radius: 4px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-xs);
}

.message-text {
  white-space: pre-wrap;
  word-break: break-word;
}

.message-temp .message-bubble {
  opacity: 0.75;
}

.message-error .message-bubble {
  background: var(--danger-light) !important;
  color: var(--danger) !important;
  border-color: #FECACA !important;
}

.message-error .message-sending {
  color: var(--danger);
}

.chat-composer {
  padding: 12px 16px;
  background: #FFFFFF;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.chat-attach-wrap {
  position: relative;
  flex-shrink: 0;
}

.chat-attach-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: #FFFFFF;
  color: var(--brand);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.chat-attach-btn:hover {
  background: var(--brand-lighter);
  border-color: #93C5FD;
  transform: rotate(45deg);
}

.chat-attach-menu {
  position: absolute;
  bottom: 48px;
  left: 0;
  width: 250px;
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-xl);
  padding: 8px;
  z-index: 300;
  display: none;
}

.chat-attach-menu.show {
  display: block;
  animation: chatMenuIn 0.18s ease;
}

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

.chat-attach-item {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

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

.chat-attach-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  background: var(--brand-lighter);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

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

.chat-attach-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-composer textarea {
  flex: 1;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  resize: none;
  font-size: 14px;
  font-family: var(--font);
  line-height: 1.5;
  outline: none;
  max-height: 110px;
  transition: var(--transition-fast);
  color: var(--text-primary);
  background: #FFFFFF;
}

.chat-composer textarea:focus {
  border-color: var(--brand);
  box-shadow: var(--shadow-focus);
}

.chat-send-btn {
  border: none;
  border-radius: var(--radius);
  padding: 10px 20px;
  background: var(--brand-gradient);
  color: #FFFFFF;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  flex-shrink: 0;
  transition: var(--transition-fast);
}

.chat-send-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.chat-send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Order card in chat */
.order-card {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  min-width: 240px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.order-card:hover {
  border-color: #93C5FD;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.1);
}

.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.order-card-no {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.order-card-tag {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--brand-lighter);
  color: var(--brand);
  font-weight: 500;
}

.order-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  color: var(--text-secondary);
}

.order-card-amount {
  color: var(--danger);
  font-weight: 600;
  margin-top: 6px;
  font-size: 13px;
}

.order-card-footer {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  text-align: center;
  font-size: 11px;
  color: var(--brand);
  font-weight: 500;
}

/* Picker item */
.picker-item {
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #FFFFFF;
}

.picker-item:hover {
  border-color: #93C5FD;
  background: var(--brand-lighter);
}

.picker-item-info {
  flex: 1;
  min-width: 0;
}

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

.picker-item-sub {
  font-size: 12px;
  color: var(--text-secondary);
}

.picker-item-status {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  flex-shrink: 0;
}

/* Chat new partner */
.chat-new-partner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}

.chat-new-partner:hover {
  background: var(--brand-lighter);
}

.chat-new-partner-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6, #06B6D4);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

/* ============================================
   车辆全生命周期档案 - 桌面端样式 V3
   设计风格：简约鲜亮、冷色调蓝灰、大留白、卡片分层
   ============================================ */

/* ===== 车辆全生命周期档案：统一网站风格（全局设计令牌 + 卡片分层） ===== */
#vehicleDetailModal.modal {
  background: var(--overlay, rgba(15, 23, 42, 0.45));
}
#vehicleDetailModal .modal-content {
  width: 800px !important;
  max-width: 92vw !important;
  border-radius: var(--radius-lg, 18px);
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: var(--shadow-lg, 0 20px 40px -10px rgba(15, 23, 42, 0.20));
}
#vehicleDetailModal .modal-header {
  padding: 16px 22px 14px;
  border-bottom: 1px solid var(--border, #f1f5f9);
  background: var(--bg-primary, #fafbfc);
  border-radius: var(--radius-lg, 18px) var(--radius-lg, 18px) 0 0;
}
#vehicleDetailModal .modal-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  letter-spacing: 0.2px;
}
#vehicleDetailModal .modal-close {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm, 8px);
  border: 1px solid var(--border, #e2e8f0);
  background: var(--card-bg, #fff);
  color: var(--text-secondary, #64748b);
  font-size: 20px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
#vehicleDetailModal .modal-close:hover {
  background: var(--danger-bg, #fef2f2);
  color: var(--danger-color, #dc2626);
  border-color: var(--danger-border, #fecaca);
}
#vehicleDetailModal .modal-body {
  padding: 18px 22px 22px !important;
  -webkit-overflow-scrolling: touch;
  background: var(--bg-primary, #fafbfc);
  border-radius: 0 0 var(--radius-lg, 18px) var(--radius-lg, 18px);
}

/* ----- 顶部车牌 Hero 卡片（蓝白渐变 + 设计令牌） ----- */
.vehicle-detail-hero {
  position: relative;
  border-radius: var(--radius-md, 14px);
  padding: 22px 24px;
  margin-bottom: 16px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-50, #eff6ff) 0%, var(--primary-100, #dbeafe) 55%, var(--indigo-50, #eef2ff) 100%);
  border: 1px solid var(--primary-200, #bfdbfe);
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(59, 130, 246, 0.08));
}
.vehicle-detail-hero-bg {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 88% 10%, var(--primary-rgb, 59, 130, 246) 10%, transparent 45%),
    radial-gradient(circle at 8% 95%, var(--indigo-rgb, 99, 102, 241) 8%, transparent 50%);
  background-image:
    radial-gradient(circle at 88% 10%, rgba(59, 130, 246, 0.10) 0, transparent 45%),
    radial-gradient(circle at 8% 95%, rgba(99, 102, 241, 0.08) 0, transparent 50%);
  pointer-events: none;
}
.vehicle-detail-hero-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.vehicle-detail-hero-left {
  flex: 1;
  min-width: 0;
}
.vehicle-detail-plate {
  display: inline-block;
  padding: 8px 22px;
  background: var(--card-bg, #fff);
  color: var(--primary-700, #1d4ed8);
  font-size: 26px;
  font-weight: 800;
  letter-spacing: 3px;
  border-radius: var(--radius-sm, 12px);
  border: 1.5px solid var(--primary-200, #bfdbfe);
  box-shadow: var(--shadow-sm, 0 2px 10px rgba(29, 78, 216, 0.10));
  margin-bottom: 10px;
}
.vehicle-detail-brand {
  color: var(--text-secondary, #475569);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
/* 导出档案按钮：蓝色描边 + 白底（令牌统一） */
.vehicle-export-btn {
  flex-shrink: 0;
  background: var(--card-bg, #fff) !important;
  color: var(--primary-color, #2563eb) !important;
  border: 1.5px solid var(--primary-200, #bfdbfe) !important;
  border-radius: var(--radius-sm, 10px);
  padding: 7px 16px;
  font-weight: 600;
  font-size: 13px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(37, 99, 235, 0.12));
  transition: all 0.15s ease;
}
.vehicle-export-btn:hover {
  background: var(--primary-50, #eff6ff) !important;
  transform: translateY(-1px);
  box-shadow: var(--shadow-md, 0 4px 14px rgba(37, 99, 235, 0.18));
}
.vehicle-export-btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm, 0 1px 4px rgba(37, 99, 235, 0.14));
}

/* ----- 4 列统计卡片组（纯白、微阴影，和首页 stat-card 一致） ----- */
.vehicle-detail-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--gap-md, 14px);
  margin-bottom: 16px;
}
.vehicle-stat-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #eef1f5);
  border-radius: var(--radius-md, 14px);
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(15, 23, 42, 0.04));
  transition: all 0.2s ease;
}
.vehicle-stat-card:hover {
  box-shadow: var(--shadow-md, 0 6px 16px rgba(15, 23, 42, 0.08));
  transform: translateY(-2px);
}
.vehicle-stat-card--featured {
  border-color: var(--danger-border, #fecaca);
  background: linear-gradient(180deg, var(--card-bg, #fff) 0%, var(--danger-50, #fef2f2) 100%);
}
.vehicle-stat-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: var(--radius-sm, 12px);
  border: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--bg-secondary, #f8fafc);
}
/* 统计图标语义色（取代 HTML inline style） */
.vehicle-stat-icon--success { background: var(--success-50, #f6ffed); border-color: var(--success-border, #b7eb8f); color: var(--success-color, #52c41a); }
.vehicle-stat-icon--primary { background: var(--primary-50, #e6f7ff); border-color: var(--primary-200, #91d5ff); color: var(--primary-color, #1890ff); }
.vehicle-stat-icon--info    { background: var(--info-50, #f0f5ff);    border-color: var(--info-border, #adc6ff);    color: var(--info-color, #2f54eb); }
.vehicle-stat-icon--danger  { background: var(--danger-50, #fff1f0);  border-color: var(--danger-border, #ffa39e);  color: var(--danger-color, #ff4d4f); }
.vehicle-stat-body {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
}
.vehicle-stat-label {
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  margin-bottom: 4px;
  font-weight: 500;
}
.vehicle-stat-value {
  font-size: 19px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  line-height: 1.2;
  white-space: nowrap;
  overflow: visible;
  display: inline-flex;
  align-items: baseline;
}
.vehicle-stat-value--success { color: var(--success-color, #389e0d); }
.vehicle-stat-value--primary { color: var(--primary-700, #0958d9); }
.vehicle-stat-value--danger  { color: var(--danger-color, #cf1322); }
.vehicle-stat-value--xl {
  font-size: 22px;
}

/* ----- 车辆基础信息卡片 ----- */
.vehicle-detail-info-card {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #eef1f5);
  border-radius: var(--radius-md, 14px);
  padding: 18px 20px;
  margin-bottom: 4px;
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(15, 23, 42, 0.04));
}
.vehicle-info-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border, #f1f5f9);
  display: flex;
  align-items: center;
  gap: 6px;
}
.vehicle-info-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px 20px;
}
.vehicle-info-item--wide {
  grid-column: span 2;
}
.vehicle-info-label {
  font-size: 12.5px;
  color: var(--text-muted, #64748b);
  margin-bottom: 5px;
  font-weight: 500;
}
.vehicle-info-value {
  font-size: 14px;
  color: var(--text-primary, #0f172a);
  font-weight: 500;
  line-height: 1.5;
  word-break: break-word;
}
.vehicle-info-value--mono {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  letter-spacing: 0.5px;
  color: var(--text-secondary, #334155);
  font-size: 13px;
  background: var(--bg-secondary, #f8fafc);
  padding: 5px 10px;
  border-radius: var(--radius-sm, 6px);
  display: inline-block;
  border: 1px solid var(--border, #e2e8f0);
}

/* 状态徽章（令牌统一） */
.vehicle-status-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  border: 1px solid transparent;
}
.vehicle-status-badge--active {
  background: var(--success-50, rgba(16, 185, 129, 0.12));
  color: var(--success-color, #059669);
  border-color: var(--success-border, rgba(110, 231, 183, 0.45));
}
.vehicle-status-badge--idle {
  background: var(--bg-secondary, rgba(148, 163, 184, 0.14));
  color: var(--text-secondary, #475569);
  border-color: var(--border, rgba(203, 213, 225, 0.5));
}
.vehicle-status-badge--repairing {
  background: var(--warning-50, rgba(245, 158, 11, 0.14));
  color: var(--warning-color, #b45309);
  border-color: var(--warning-border, rgba(253, 230, 138, 0.55));
}
.vehicle-status-badge--scrapped,
.vehicle-status-badge--sold,
.vehicle-status-badge--inactive {
  background: var(--danger-50, rgba(239, 68, 68, 0.12));
  color: var(--danger-color, #dc2626);
  border-color: var(--danger-border, rgba(252, 165, 165, 0.5));
}

/* 车辆标签（胶囊风格，令牌统一） */
.vehicle-tag-empty {
  color: var(--text-muted, #94a3b8);
  font-size: 13px;
  font-style: normal;
}
.vehicle-tag-pill {
  display: inline-block;
  padding: 3px 10px;
  margin: 2px 6px 2px 0;
  background: var(--primary-50, rgba(59, 130, 246, 0.10));
  color: var(--primary-color, #2563eb);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid var(--primary-200, rgba(147, 197, 253, 0.45));
}

/* 车辆档案 tabs 栏（分段控制风格，令牌统一） */
.vehicle-detail-tabs-bar {
  margin-top: 22px !important;
  margin-bottom: 18px;
  padding: 4px;
  background: var(--bg-secondary, rgba(148, 163, 184, 0.10));
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--border, rgba(148, 163, 184, 0.16));
  display: flex;
  gap: 2px;
  border-bottom: none !important;
}
.vehicle-detail-tabs-bar .tab-item {
  flex: 1;
  text-align: center;
  padding: 8px 14px !important;
  font-size: 13px !important;
  font-weight: 600;
  border-radius: var(--radius-sm, 9px);
  color: var(--text-muted, #64748b);
  border: none;
  transition: all 0.15s ease;
}
.vehicle-detail-tabs-bar .tab-item.active {
  background: var(--card-bg, #fff);
  color: var(--text-primary, #0f172a);
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(15, 23, 42, 0.06));
}

/* 维修时间线（卡片流风格） */
#repairTimeline .timeline-item {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb) !important;
  border-radius: var(--radius-md, 14px);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.04));
  transition: all 0.2s ease;
}
#repairTimeline .timeline-item:hover {
  background: var(--card-bg, #fff);
  box-shadow: var(--shadow-md, 0 6px 16px rgba(15, 23, 42, 0.08));
}
.timeline-amount {
  color: var(--danger-color, #dc2626);
  font-weight: 700;
}

/* 费用趋势汇总卡（卡片风格，非毛玻璃） */
.cost-lifetime-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--card-bg, #fff);
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--radius-md, 16px);
  padding: 18px 22px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(15, 23, 42, 0.04));
  margin-bottom: 16px;
}
.cost-lifetime-main { flex: 1; min-width: 0; }
.cost-lifetime-label {
  font-size: 12px;
  color: var(--text-muted, #94a3b8);
  font-weight: 500;
  margin-bottom: 6px;
}
.cost-lifetime-total {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, var(--text-primary, #1e293b) 0%, var(--danger-color, #dc2626) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.cost-lifetime-meta {
  display: flex;
  align-items: center;
  gap: 24px;
}
.cost-meta-item { text-align: center; }
.cost-meta-label { color: var(--text-muted, #94a3b8); font-size: 12px; margin-bottom: 4px; }
.cost-meta-value { color: var(--text-primary, #0f172a); font-weight: 800; font-size: 18px; }
.cost-meta-divider { width: 1px; align-self: stretch; background: var(--border, rgba(148, 163, 184, 0.2)); }

/* ECharts 容器统一卡片底 */
#vehicleDetailModal .chart-container {
  background: var(--card-bg, #fff);
  border-radius: var(--radius-md, 14px);
  padding: 12px;
  border: 1px solid var(--border, #e5e7eb);
  box-shadow: var(--shadow-sm, 0 2px 6px rgba(15, 23, 42, 0.04));
}

@media (max-width: 640px) {
  .cost-lifetime-summary { flex-direction: column; align-items: flex-start; gap: 14px; }
  .cost-lifetime-meta { width: 100%; justify-content: space-around; }
}

/* ===== 问题8：手机端（含临时切换到PC视口宽度<=768 的手机场景）车辆档案排版优化 ===== */
@media (max-width: 768px) {
  #vehicleDetailModal .modal-content {
    width: 92vw !important;
    max-width: 92vw !important;
    margin: 2vh auto !important;
  }
  #vehicleDetailModal .modal-header {
    padding: 14px 16px 10px !important;
  }
  #vehicleDetailModal .modal-body {
    padding: 4px 16px 20px !important;
  }
  .vehicle-detail-hero {
    padding: 18px 16px !important;
    border-radius: 18px !important;
    margin-bottom: 14px !important;
  }
  .vehicle-detail-hero-content {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .vehicle-detail-hero-left { width: 100%; }
  .vehicle-detail-plate {
    font-size: 22px;
    padding: 8px 18px;
    letter-spacing: 2px;
    border-radius: 12px;
  }
  .vehicle-export-btn {
    align-self: stretch;
    text-align: center;
    width: 100%;
  }
  .vehicle-detail-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
    margin-bottom: 14px !important;
  }
  .vehicle-stat-card {
    padding: 12px 14px !important;
    border-radius: 16px !important;
    gap: 10px !important;
  }
  .vehicle-stat-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    font-size: 18px;
  }
  .vehicle-stat-label { font-size: 11px; }
  .vehicle-stat-value { font-size: 15px; }
  .vehicle-stat-value--xl { font-size: 17px; }
  .vehicle-detail-info-card {
    padding: 14px 16px !important;
    border-radius: 18px !important;
    margin-bottom: 10px !important;
  }
  .vehicle-info-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
  }
  .vehicle-info-grid .vehicle-info-item {
    padding: 10px 10px 10px 0 !important;
  }
  .vehicle-info-item--wide { grid-column: span 2 !important; padding-right: 0 !important; }
  .vehicle-info-label { font-size: 11px; }
  .vehicle-info-value { font-size: 13px; line-height: 1.5; }
  .vehicle-detail-tabs-bar {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0;
    white-space: nowrap;
  }
  .vehicle-detail-tabs-bar .tab-item {
    flex: none;
    min-width: 72px;
    font-size: 12px;
    padding: 7px 10px;
  }
  #costChartContainer .chart-container {
    height: 240px !important;
    padding: 8px !important;
    border-radius: 14px !important;
  }
}
/* 手机临时打开PC视图时，强制应用移动端排版，使车辆档案在手机屏幕依然符合常理 */
body.mobile-temp-view #vehicleDetailModal .modal-content {
  width: 92vw !important;
  max-width: 92vw !important;
  margin: 2vh auto !important;
}
body.mobile-temp-view .vehicle-detail-stats {
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 10px !important;
}
body.mobile-temp-view .vehicle-info-grid {
  grid-template-columns: repeat(2, 1fr) !important;
}
body.mobile-temp-view .vehicle-detail-hero-content {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}
body.mobile-temp-view .vehicle-export-btn {
  width: 100%;
}

/* 费用趋势图容器高度适配 */
#costChartContainer .chart-container {
  width: 100%;
  height: 360px;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  border: 1px solid #f0f0f0;
}

.chat-new-partner-info {
  flex: 1;
  min-width: 0;
}

.chat-new-partner-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}

.chat-new-partner-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.chat-new-partner-action {
  color: var(--brand);
  font-size: 12px;
  flex-shrink: 0;
  font-weight: 500;
}

/* Chat image */
.chat-msg-image {
  max-width: 220px;
  max-height: 260px;
  border-radius: var(--radius);
  display: block;
  cursor: zoom-in;
  box-shadow: var(--shadow-sm);
}

.chat-images-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.chat-image-wrap {
  position: relative;
  display: inline-block;
}

/* Chat mobile */
@media (max-width: 768px) {
  .chat-layout {
    flex-direction: row;
    border: none;
    border-radius: 0;
  }
  .chat-sidebar { width: 100%; min-width: 0; border-right: none; }
  .chat-sidebar.hidden { display: none; }
  .chat-main { display: none; flex: 1; }
  .chat-main.show { display: flex; }
  .chat-back-btn { display: flex !important; }
  .chat-messages { padding: 14px; }
  .message { max-width: 85%; }
  .chat-composer { padding: 10px 12px; }
  .chat-composer textarea { font-size: 16px; }
}

/* ===== Custom Scrollbar ===== */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--slate-300); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--slate-400); }

/* ===== Selection ===== */
::selection {
  background: var(--brand-light);
  color: var(--brand-dark);
}

/* ===== Dropdown Items ===== */
.dropdown-item {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: var(--transition-fast);
}

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

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--slate-800);
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: var(--z-toast);
  box-shadow: var(--shadow-lg);
  pointer-events: none;
  max-width: 90%;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.error {
  background: var(--danger);
}

.toast.success {
  background: var(--success);
}

/* ===== Sidebar Menu Badges (Dark Sidebar Safe) ===== */
#chatUnreadBadge,
#notificationMenuBadge,
#inviteCodeMenuBadge {
  background: #ff4d4f !important;
  color: #fff !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  padding: 1px 7px !important;
  border-radius: 9999px !important;
  margin-left: auto !important;
  line-height: 1.5 !important;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.15), 0 2px 6px rgba(255, 77, 79, 0.4);
  min-width: 18px;
  text-align: center;
  display: inline-block;
}

.menu-item {
  position: relative;
}

.menu-item span[style*="margin-left:auto"] {
  align-self: center;
}

/* ====== Mobile UI Refinement (<=768px) — Modern, Clean, Touch-Friendly ====== */
@media (max-width: 768px) {
  html, body {
    background: linear-gradient(180deg, #EEF2FF 0%, #F8FAFC 25%, #F8FAFC 100%) !important;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    overscroll-behavior-y: contain;
  }
  body { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }

  /* 顶部 Header — Glass morphism feel */
  .header {
    background: rgba(255,255,255,0.92) !important;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid rgba(15,23,42,0.06);
    box-shadow: 0 1px 4px rgba(15,23,42,0.04);
  }
  .header-left {
    font-weight: 600 !important;
    background: linear-gradient(135deg, #2563EB 0%, #6366F1 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent !important;
  }

  /* 内容区底部留白，防止被 tabbar 挡 */
  .content { padding: 14px !important; padding-bottom: calc(80px + env(safe-area-inset-bottom, 0)) !important; }
  .page-title { font-size: 20px !important; font-weight: 700; color: var(--slate-900) !important; letter-spacing: -0.2px; }

  /* 卡片 — 圆角加大、阴影更柔和、去掉 1px 硬边框 */
  .card {
    border: none !important;
    border-radius: 18px !important;
    padding: 16px !important;
    margin-bottom: 14px !important;
    background: #FFFFFF !important;
    box-shadow:
      0 1px 2px rgba(15,23,42,0.04),
      0 4px 16px rgba(15,23,42,0.05) !important;
    position: relative;
    overflow: hidden;
  }
  .card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, rgba(37,99,235,0.08), rgba(99,102,241,0.02));
  }
  .card-header {
    border: none !important;
    padding: 0 0 12px 0 !important;
    margin-bottom: 12px !important;
  }
  .card-title {
    font-size: 15px !important;
    font-weight: 600;
    color: var(--slate-800) !important;
    letter-spacing: 0.1px;
  }

  /* 统计卡片 — 圆润、柔和色、质感 */
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stats-grid-8 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stats-grid-6 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }
  .stats-grid-4 { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

  .stat-card {
    border: none !important;
    border-radius: 16px !important;
    padding: 14px 12px 12px 12px !important;
    box-shadow:
      0 1px 2px rgba(15,23,42,0.05),
      0 3px 10px rgba(15,23,42,0.05) !important;
    background: linear-gradient(145deg, #FFFFFF 0%, #FDFDFE 100%) !important;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s ease;
  }
  .stat-card:active { transform: scale(0.98); }
  .stat-card::after {
    content: '';
    position: absolute;
    top: 0; right: 0;
    width: 42px; height: 42px;
    background: radial-gradient(circle at top right, var(--accent, rgba(37,99,235,0.08)), transparent 70%);
    border-radius: 0 0 0 42px;
    opacity: 0.8;
  }
  .stat-card.primary   { --accent: rgba(37,99,235,0.12); }
  .stat-card.success   { --accent: rgba(16,185,129,0.14); }
  .stat-card.warning   { --accent: rgba(245,158,11,0.14); }
  .stat-card.danger    { --accent: rgba(239,68,68,0.12); }
  .stat-card.info      { --accent: rgba(14,165,233,0.12); }
  .stat-card.maintenance-warning { --accent: rgba(239,68,68,0.12); }
  .stat-card.inspection-warning  { --accent: rgba(245,158,11,0.14); }

  .stat-card-sm {
    padding: 12px 10px !important;
    border-radius: 14px !important;
  }
  .stat-card .stat-value {
    font-size: 24px !important;
    font-weight: 700 !important;
    letter-spacing: -0.4px;
    line-height: 1.2 !important;
    margin-bottom: 4px;
  }
  .stat-card-sm .stat-value {
    font-size: 19px !important;
    letter-spacing: -0.3px;
    font-weight: 700 !important;
  }
  .stat-card .stat-label {
    font-size: 11px !important;
    color: var(--slate-500) !important;
    font-weight: 500;
    letter-spacing: 0.2px;
  }

  /* 表单 — 大圆角、无硬边框 */
  .form-group label { font-size: 13px; font-weight: 600; color: var(--slate-700); margin-bottom: 6px; }
  .form-group input,
  .form-group select,
  .form-group textarea {
    min-height: 46px;
    font-size: 15px !important;
    padding: 12px 14px !important;
    border: 1px solid var(--slate-200) !important;
    border-radius: 12px !important;
    background: var(--slate-50);
    color: var(--slate-900);
    transition: all 0.18s ease;
  }
  .form-group input:focus,
  .form-group select:focus,
  .form-group textarea:focus {
    outline: none;
    border-color: #2563EB !important;
    background: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
  }
  .form-group { margin-bottom: 14px; }

  /* 按钮 — 圆润、按压有反馈、渐变 */
  .btn {
    min-height: 46px !important;
    font-size: 14px !important;
    font-weight: 600;
    padding: 10px 18px !important;
    border-radius: 12px !important;
    transition: all 0.15s ease;
    letter-spacing: 0.2px;
  }
  .btn:active { transform: scale(0.97); }
  .btn-sm {
    min-height: 36px !important;
    font-size: 12px !important;
    padding: 6px 12px !important;
    border-radius: 10px !important;
    font-weight: 600;
  }
  .btn-primary {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(37,99,235,0.25), 0 1px 2px rgba(37,99,235,0.15);
  }
  .btn-primary:active {
    box-shadow: 0 2px 5px rgba(37,99,235,0.25), 0 1px 2px rgba(37,99,235,0.15);
  }
  .btn-success {
    background: linear-gradient(135deg, #10B981 0%, #059669 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(16,185,129,0.22), 0 1px 2px rgba(16,185,129,0.12);
  }
  .btn-danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(239,68,68,0.22), 0 1px 2px rgba(239,68,68,0.12);
  }
  .btn-warning {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%) !important;
    border: none !important;
    color: #fff !important;
    box-shadow: 0 4px 10px rgba(245,158,11,0.25), 0 1px 2px rgba(245,158,11,0.15);
  }
  .btn-default {
    background: var(--slate-100) !important;
    border: none !important;
    color: var(--slate-700) !important;
    font-weight: 500;
  }

  /* Filter bar */
  .filter-bar {
    flex-direction: column !important;
    gap: 10px !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
  }
  .filter-bar .form-group { margin-bottom: 0 !important; }
  .search-btn {
    min-height: 46px !important;
    border-radius: 12px !important;
    font-weight: 600;
    letter-spacing: 1px;
  }

  /* Tabs */
  .tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 4px !important; padding: 2px; background: var(--slate-100); border-radius: 12px; }
  .tab-item {
    padding: 8px 14px !important;
    font-size: 13px !important;
    font-weight: 500;
    color: var(--slate-600);
    border-radius: 10px;
    min-height: 38px !important;
    transition: all 0.15s ease;
  }
  .tab-item.active {
    background: #FFFFFF;
    color: var(--brand);
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(15,23,42,0.08);
  }

  /* 底部 Tabbar — iOS 风格 */
  .mobile-tabbar {
    height: 64px !important;
    border-top: 1px solid rgba(15,23,42,0.05) !important;
    background: rgba(255,255,255,0.96) !important;
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    box-shadow: 0 -4px 16px rgba(15,23,42,0.05) !important;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .tabbar-item {
    font-size: 10px !important;
    font-weight: 500;
    color: var(--slate-400) !important;
    transition: all 0.18s ease;
    gap: 2px;
  }
  .tabbar-item .tabbar-icon {
    font-size: 22px;
    line-height: 1;
    margin-bottom: 2px;
  }
  .tabbar-item.active {
    color: #2563EB !important;
    transform: translateY(-1px);
  }
  .tabbar-item.active .tabbar-icon {
    filter: drop-shadow(0 2px 4px rgba(37,99,235,0.3));
  }

  /* 表格 — 更现代的卡片式 */
  .card .table tbody tr, .pub-order-table tbody tr {
    border-radius: 14px !important;
    padding: 14px !important;
    margin-bottom: 12px !important;
    border: 1px solid var(--slate-100) !important;
    box-shadow:
      0 1px 2px rgba(15,23,42,0.03),
      0 2px 8px rgba(15,23,42,0.04) !important;
  }
  .card .table tbody td, .pub-order-table tbody td {
    font-size: 13px !important;
    color: var(--slate-700) !important;
    padding: 5px 0 !important;
  }
  .card .table tbody td:before {
    font-size: 11px !important;
    font-weight: 500;
    color: var(--slate-400) !important;
  }

  /* 移动端 Modal 更精致 */
  .modal-content {
    background: #FFFFFF !important;
    box-shadow: 0 -8px 40px rgba(15,23,42,0.15);
  }
  .modal-header {
    background: var(--slate-50) !important;
    border-bottom: 1px solid var(--slate-100) !important;
  }
  .modal-footer {
    background: #FFFFFF !important;
    border-top: 1px solid var(--slate-100) !important;
    gap: 10px !important;
  }

  /* Toast / Notice 更明显 */
  .toast {
    border-radius: 12px !important;
    padding: 10px 16px !important;
    font-weight: 500 !important;
    box-shadow: 0 6px 20px rgba(15,23,42,0.15) !important;
    border: none !important;
  }

  /* 图片上传区 */
  .upload-area {
    border-radius: 16px !important;
    border: 1.5px dashed var(--slate-200) !important;
    background: var(--slate-50);
    transition: all 0.2s ease;
  }
  .upload-area:active { background: var(--slate-100); }
  .photo-grid { gap: 10px !important; }

  /* 登录页 / Auth 页 渐变更漂亮 */
  .auth-page {
    background: linear-gradient(135deg, #667EEA 0%, #764BA2 100%) !important;
  }
}

/* ====== 小屏手机 (<=380px) 进一步优化 ====== */
@media (max-width: 380px) {
  .stat-card .stat-value { font-size: 20px !important; }
  .stat-card-sm .stat-value { font-size: 17px !important; }
  .card { padding: 14px !important; }
  .content { padding: 12px !important; }
  .page-title { font-size: 18px !important; }
  .mobile-tabbar { height: 60px !important; }
  .tabbar-item .tabbar-icon { font-size: 20px; }
}

/* ===================================================================
   移动端可访问性 (A11y) 优化
   - 键盘 focus 可见样式
   - 触摸目标最小 44x44px (WCAG 2.1)
   - aria-label 缺失提示 (开发环境)
   =================================================================== */

/* 1. 键盘焦点样式：确保 Tab 键导航时焦点清晰可见 */
*:focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
  border-radius: 6px;
}

/* 按钮类控件 focus 样式 */
button:focus-visible,
.btn:focus-visible,
a:focus-visible,
[role="button"]:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--brand) !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12) !important;
}

/* 移除默认的 outline (仅非键盘导航时) */
*:focus:not(:focus-visible) {
  outline: none;
}

/* 2. 移动端触摸目标最小 44x44px (WCAG 2.1 SC 2.5.5) */
@media (max-width: 768px) {
  button,
  .btn,
  [role="button"],
  .nav-btn,
  .tabbar-item,
  .dropdown-item,
  .btn-copy-plate {
    min-width: 44px !important;
    min-height: 44px !important;
    padding-top: 10px !important;
    padding-bottom: 10px !important;
    padding-left: 12px !important;
    padding-right: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
  }

  /* 表单输入框增大点击区域 */
  input[type="text"],
  input[type="number"],
  input[type="date"],
  input[type="email"],
  input[type="password"],
  select,
  textarea {
    min-height: 44px !important;
    font-size: 16px !important; /* 防止 iOS 自动缩放 */
    padding: 10px 12px !important;
  }

  /* 移动端导航按钮增大尺寸 */
  .menu-toggle,
  .header-right > button,
  .header-right > .btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }

  /* 表格操作按钮列最小宽度 */
  .action-btns {
    min-width: 150px;
  }
  .action-btns .btn + .btn {
    margin-left: 6px;
  }
}

/* 3. 开发环境下 aria-label 缺失提示 (开发辅助，不影响生产) */
@media not print {
  /* 可通过设置 body.dev-mode 开启检查 */
  body.dev-mode button:not([aria-label]):not([aria-labelledby]):empty,
  body.dev-mode a:not([aria-label]):not([aria-labelledby]):empty,
  body.dev-mode [role="button"]:not([aria-label]):not([aria-labelledby]):empty {
    outline: 2px dashed var(--warning) !important;
    outline-offset: 2px;
  }
  body.dev-mode button:not([aria-label]):not([aria-labelledby]):empty::after,
  body.dev-mode a:not([aria-label]):not([aria-labelledby]):empty::after,
  body.dev-mode [role="button"]:not([aria-label]):not([aria-labelledby]):empty::after {
    content: "⚠️ aria-label 缺失";
    position: absolute;
    top: -24px;
    left: 0;
    background: var(--warning);
    color: #fff;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    white-space: nowrap;
    z-index: var(--z-tooltip);
  }
}

/* 4. 防止 iOS 输入框聚焦时缩放：已在 html, body 中设置 -webkit-text-size-adjust: 100% */
/* 补充：select 和 input 16px 字体 (上面已加) */

/* 5. 减少动画偏好 (尊重用户系统设置) */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 6. 高对比度模式支持 */
@media (prefers-contrast: more) {
  :root {
    --border: #1E293B;
    --border-input: #475569;
    --text-secondary: #334155;
    --text-muted: #475569;
  }
}

/* 7. 视口安全区适配 (全面屏/刘海屏) */
@supports (padding: max(0px)) {
  .app-layout {
    padding-left: max(0px, env(safe-area-inset-left));
    padding-right: max(0px, env(safe-area-inset-right));
  }
  .mobile-tabbar {
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .header {
    padding-top: max(0px, env(safe-area-inset-top));
  }
}

/* 8. WebSocket 降级模式提示条样式 (与 realtime.js 配合) */
#ws-polling-fallback-bar button {
  min-height: 32px;
}
#ws-polling-fallback-bar button:focus-visible {
  outline: 2px solid #fff !important;
  outline-offset: 2px;
}

/* =============================================================
   车辆管理智能写作工作台（复刻 vehicle-doc-app 渐变 + 毛玻璃 + 4 Tab）
   ============================================================= */
#page-materials.page-section {
  background: linear-gradient(180deg, #f5f7ff 0%, #eef3fb 100%);
  padding: 0;
  position: relative;
  overflow: auto;
}

/* 渐变光斑背景 */
.doc-pro-bg { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.doc-pro-blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: .7; }
.doc-pro-b1 { width: 520px; height: 520px; background: radial-gradient(circle, #7aa6ff 0%, transparent 70%); top: -160px; left: -120px; }
.doc-pro-b2 { width: 520px; height: 520px; background: radial-gradient(circle, #a4e3ff 0%, transparent 70%); top: 260px; right: -160px; }
.doc-pro-b3 { width: 560px; height: 560px; background: radial-gradient(circle, #ffd2a8 0%, transparent 70%); bottom: -260px; left: 38%; }

/* 顶栏 */
.doc-pro-topbar {
  position: relative; z-index: 1;
  padding: 22px 32px 10px;
  display: flex; align-items: center; justify-content: space-between;
}
.doc-pro-title { display: flex; align-items: center; gap: 14px; }
.doc-pro-dot {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, #4f86ff 0%, #60a5fa 50%, #34d399 100%);
  box-shadow: 0 6px 16px rgba(79,134,255,0.35);
  position: relative;
}
.doc-pro-dot::after{
  content:""; position:absolute; inset:10px; border-radius:50%;
  background: radial-gradient(circle at 30% 30%, #fff 0%, rgba(255,255,255,.4) 50%, transparent 70%);
}
.doc-pro-main { font-size: 20px; font-weight: 700; color: #1f2d3d; letter-spacing: .5px; }
.doc-pro-sub { font-size: 13px; color: #5c6b7b; margin-top: 4px; }
.doc-pro-date {
  font-size: 13px; color: #3b4a5b;
  padding: 10px 18px; border-radius: 999px;
  background: rgba(255,255,255,.7);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 4px 14px rgba(30,41,59,0.05);
}

/* 主体 左 Tab + 右内容 */
.doc-pro-wrap {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: 248px 1fr;
  gap: 22px;
  padding: 16px 32px 40px;
  max-width: 1680px; margin: 0 auto;
}
.doc-pro-sidebar { display: flex; flex-direction: column; gap: 18px; }
.doc-pro-nav {
  display: flex; flex-direction: column; gap: 6px;
  padding: 14px; border-radius: 18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 30px rgba(30,41,59,0.06);
}
.doc-pro-nav button {
  appearance: none; border: 0; cursor: pointer; text-align: left;
  padding: 11px 14px; border-radius: 12px;
  background: transparent;
  color: #3b4a5b;
  font-size: 14px; font-weight: 500;
  transition: all .18s;
}
.doc-pro-nav button:hover { background: rgba(79,134,255,.08); color: #1f4fcf; }
.doc-pro-nav button.active {
  background: linear-gradient(135deg, #4f86ff 0%, #3b82f6 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(79,134,255,0.28);
  transform: translateY(-1px);
}

.doc-pro-stats {
  padding: 16px; border-radius: 18px;
  background: rgba(255,255,255,.72);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,.85);
  box-shadow: 0 10px 30px rgba(30,41,59,0.06);
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.doc-pro-stat {
  padding: 12px; border-radius: 12px;
  background: linear-gradient(135deg, rgba(219,234,254,.7) 0%, rgba(236,253,245,.5) 100%);
  border: 1px solid rgba(59,130,246,.12);
}
.doc-pro-stat.b { background: linear-gradient(135deg, rgba(254,242,242,.7) 0%, rgba(255,251,235,.5) 100%); border-color: rgba(239,68,68,.14); }
.doc-pro-stat.c { grid-column: 1/3; background: linear-gradient(135deg, rgba(254,249,195,.75) 0%, rgba(219,234,254,.5) 100%); border-color: rgba(234,179,8,.18); }
.doc-pro-stat .n { font-size: 20px; font-weight: 700; color: #1f2d3d; }
.doc-pro-stat .l { font-size: 12px; color: #5c6b7b; margin-top: 3px; }

.doc-pro-main { min-width: 0; }
.doc-pro-subtop {
  display: flex; align-items: baseline; gap: 14px;
  padding: 4px 6px 14px;
}
.doc-pro-subtop > :first-child { font-size: 18px; font-weight: 700; color: #1f2d3d; }
.doc-pro-subdesc { font-size: 13px; color: #64748b; }

.doc-pro-content { display: flex; flex-direction: column; gap: 18px; }

/* 卡片 */
.doc-pro-card {
  padding: 22px 24px;
  border-radius: 18px;
  background: rgba(255,255,255,.78);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.9);
  box-shadow: 0 12px 34px rgba(30,41,59,0.06);
  position: relative;
}
.doc-pro-card h3 {
  font-size: 15px; font-weight: 700; color: #1f2d3d;
  margin-bottom: 10px; padding-left: 10px; position: relative;
}
.doc-pro-card h3::before{
  content:""; position:absolute; left:0; top:3px; bottom:3px; width:3px;
  background: linear-gradient(180deg, #4f86ff 0%, #34d399 100%);
  border-radius: 2px;
}
.doc-pro-sec-desc { font-size: 13px; color: #5c6b7b; line-height: 1.75; margin: 6px 0 12px; }
.doc-pro-muted { color: #64748b; font-size: 13px; line-height: 1.7; }
.hidden { display: none !important; }

/* 2 列网格表单 */
.doc-pro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 18px;
}
.doc-pro-grid > div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.doc-pro-grid label {
  font-size: 13px; font-weight: 500; color: #334155;
  display: flex; align-items: center; gap: 6px;
}
.doc-pro-grid label .req { color: #ef4444; font-weight: 700; }
.doc-pro-grid input, .doc-pro-grid select, .doc-pro-grid textarea,
#docProMSearch, #docProPSearch, #docProType {
  appearance: none; outline: none;
  border: 1px solid #e2e8f0; border-radius: 10px;
  padding: 9px 12px; font-size: 13.5px;
  background: #fff; color: #0f172a;
  transition: all .18s;
  width: 100%;
  font-family: inherit;
}
.doc-pro-grid textarea { resize: vertical; min-height: 74px; line-height: 1.65; }
.doc-pro-grid input:focus, .doc-pro-grid select:focus, .doc-pro-grid textarea:focus,
#docProMSearch:focus, #docProPSearch:focus, #docProType:focus {
  border-color: #4f86ff; box-shadow: 0 0 0 3px rgba(79,134,255,.15); }

.doc-pro-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}

/* 按钮 */
.doc-pro-btn {
  appearance: none; border: 0; cursor: pointer;
  padding: 10px 18px; border-radius: 10px;
  font-size: 13.5px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 6px;
  transition: all .18s;
  font-family: inherit;
}
.doc-pro-btn.primary {
  background: linear-gradient(135deg, #4f86ff 0%, #3b82f6 100%);
  color: #fff; box-shadow: 0 8px 18px rgba(79,134,255,0.26);
}
.doc-pro-btn.primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(79,134,255,0.32); }
.doc-pro-btn.primary:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.doc-pro-btn.secondary {
  background: #fff; color: #1f4fcf; border: 1px solid rgba(79,134,255,.35);
}
.doc-pro-btn.secondary:hover { background: rgba(79,134,255,.08); }
.doc-pro-btn.danger { background: #fff; color: #dc2626; border: 1px solid rgba(239,68,68,.35); }
.doc-pro-btn.danger:hover { background: rgba(239,68,68,.06); }

/* 表格 */
.doc-pro-tablewrap { overflow-x: auto; }
.doc-pro-tablewrap table,
#docProMTable, #docProPTable, #docProGenTable {
  width: 100%; border-collapse: collapse; font-size: 13px;
}
.doc-pro-tablewrap th,
#docProMTable th, #docProPTable th, #docProGenTable th {
  text-align: left; padding: 10px 12px; font-weight: 600; color: #475569;
  border-bottom: 2px solid #e2e8f0; background: rgba(248,250,252,.8); white-space: nowrap;
}
.doc-pro-tablewrap td,
#docProMTable td, #docProPTable td, #docProGenTable td {
  padding: 10px 12px; border-bottom: 1px solid #eef2f7; color: #1f2d3d;
  vertical-align: top;
}
.doc-pro-tablewrap tr:hover td,
#docProMTable tr:hover td, #docProPTable tr:hover td, #docProGenTable tr:hover td {
  background: rgba(79,134,255,.04);
}
.doc-pro-tdel { cursor: pointer; color: #ef4444; font-weight: 500; }
.doc-pro-tdel:hover { text-decoration: underline; }

/* 公文红头预览（国网供电公司风格） — 对齐 Word 导出版式 */
.doc-gongwen {
  /* Round6.9: 预览按 A4 宽度(≈794px@96dpi)居中，页边距对齐 Word：上3.7cm=105px, 下3.5cm=99px, 左2.8cm=79px, 右2.6cm=74px */
  width: 794px;
  max-width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
  padding: 105px 74px 99px 79px;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(15,23,42,.08);
  font-family: "FangSong_GB2312","仿宋_GB2312","FangSong","仿宋","SimSun","宋体",serif;
  color: #0f172a;
  /* 公文标准行距 1.5 倍，对应 Word 的 28pt 固定行距 */
  line-height: 1.5;
  font-size: 16px;
}
.doc-gongwen .gw-redhead {
  text-align: center;
  color: #c81d1d;
  font-family: "方正小标宋简体","SimHei","黑体",sans-serif;
  /* 小一号字 ≈ 18pt = 24px */
  font-size: 24px; letter-spacing: 8px;
  padding-bottom: 10px;
}
.doc-gongwen .gw-redhead.en { font-size: 16px; letter-spacing: 4px; margin-bottom: 6px; color: #c81d1d; }
.doc-gongwen .gw-line { height: 2px; background: linear-gradient(90deg, #c81d1d 0%, #c81d1d 55%, transparent 55%, transparent 57%, #c81d1d 57%); margin: 10px 0 24px; }
.doc-gongwen .gw-number { text-align: center; font-size: 16px; margin-bottom: 28px; }
.doc-gongwen .gw-title {
  /* 二号字 22pt ≈ 30px */
  text-align: center; font-size: 30px; font-weight: 700;
  font-family: "方正小标宋简体","SimHei","黑体",sans-serif;
  margin: 16px 0 32px; letter-spacing: 2px;
}
.doc-gongwen .gw-recipient {
  /* 三号字 16pt = 21px */
  font-size: 21px; margin-bottom: 16px; text-indent: 0;
  font-family: "FangSong_GB2312","仿宋_GB2312","FangSong","仿宋",serif;
}
.doc-gongwen .gw-body {
  font-size: 21px;
  font-family: "FangSong_GB2312","仿宋_GB2312","FangSong","仿宋",serif;
  /* pre-wrap 模式下正文首行缩进 2 字符 */
  text-indent: 2em;
}
.doc-gongwen .gw-body p { font-size: 21px; text-indent: 2em; margin: 0; }
.doc-gongwen .gw-h1 {
  /* 三号黑体 16pt = 21px */
  font-size: 21px; font-weight: 700; margin: 12px 0 6px;
  font-family: "SimHei","黑体",sans-serif;
  text-indent: 0;
}
.doc-gongwen .gw-h2 {
  /* 三号楷体 16pt = 21px */
  font-size: 21px; font-weight: 700; margin: 8px 0 4px;
  font-family: "KaiTi_GB2312","楷体_GB2312","KaiTi","楷体",serif;
  text-indent: 2em;
}
.doc-gongwen .gw-h3 {
  /* 三号仿宋加粗 16pt = 21px */
  font-size: 21px; font-weight: 700; margin: 6px 0 3px;
  font-family: "FangSong_GB2312","仿宋_GB2312","FangSong","仿宋",serif;
  text-indent: 2em;
}
.doc-gongwen .gw-sign {
  /* 右对齐落款，与 Word 一致 */
  margin-top: 3em; text-align: right; font-size: 21px;
  font-family: "FangSong_GB2312","仿宋_GB2312","FangSong","仿宋",serif;
  padding-right: 2em;
}
.doc-gongwen .gw-sign div { margin: 0; }
.doc-gongwen .gw-sign > div + div { margin-top: 1em; }

/* 试卷视图 */
.doc-exam {
  background: #fff;
  padding: 40px 48px 56px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  box-shadow: 0 20px 40px rgba(15,23,42,.08);
  font-family: "SimSun","宋体",serif;
  line-height: 1.9;
}
.doc-exam .exam-head { text-align: center; border-bottom: 2px double #333; padding-bottom: 16px; margin-bottom: 24px; }
.doc-exam .exam-title { font-size: 22px; font-weight: 700; letter-spacing: 4px; }
.doc-exam .exam-sub { margin-top: 10px; color: #475569; font-size: 13px; }
.doc-exam .exam-sec { margin-top: 22px; }
.doc-exam .exam-sec h4 { font-size: 16px; font-weight: 700; margin-bottom: 10px; padding-left: 4px; border-left: 3px solid #4f86ff; }
.doc-exam .exam-q { margin: 10px 0 14px; font-size: 14.5px; }
.doc-exam .exam-q .q { font-weight: 600; }
.doc-exam .exam-q .opts { margin: 6px 0 0 18px; }
.doc-exam .exam-q .opts label { display: block; }
.doc-exam .exam-key {
  margin-top: 32px; padding: 16px 18px;
  border: 1px dashed #b4c0d0; border-radius: 8px;
  background: #f8fafc;
  font-size: 13.5px;
}
.doc-exam .exam-key h5 { font-weight: 700; margin-bottom: 8px; }

/* 响应式：窄屏自动切换为上下布局 */
@media (max-width: 1180px) {
  .doc-pro-wrap { grid-template-columns: 1fr; }
  .doc-pro-nav { flex-direction: row; flex-wrap: wrap; }
  .doc-pro-nav button { flex: 1 1 120px; text-align: center; }
  .doc-pro-stats { grid-template-columns: repeat(4,1fr); }
  .doc-pro-stats.c { grid-column: auto; }
}
@media print {
  /* 公文预览打印：隐藏所有按钮/侧边栏/顶栏 */
  .doc-pro-bg, .doc-pro-topbar, .doc-pro-sidebar, .doc-pro-subtop,
  #docProGenBtn, #docProRagHits, #docProCopyBtn, #docProPrintBtn, #docProWordBtn,
  #docProExamBtn, #docProExamWordBtn, #docProExamPrintBtn { display: none !important; }
  .doc-gongwen, .doc-exam { box-shadow: none; border: 0; padding: 20px; margin: 0; }
  .doc-pro-card { padding: 0; margin: 0; background: #fff !important; box-shadow: none; border: 0; }
}

/* ========================================================================
   【侧边栏文字对齐 最终硬锁】 — Round3 强化：覆盖激活态/收起态，4类 selector 显式独立写出
   父目录 / 无子目录顶级项 / 子目录 三类文字左起点 必须完全一致 = 52px
   父类（顶级 .menu-item / .menu-group-header / 二者各自激活/收起态）：padding-left 24px，
   再加上 icon 宽 18px 和 icon 与文字间距 10px，正好让文字位于 52px 处；
   子类：直接 padding-left 52px，与父类文字严格在同一垂直线上。
   使用 !important 防止移动端或旧样式再次覆盖（用户截图父目录与子目录明显错列的根因）。
   ======================================================================== */
/* Round3 Fix T1c-1: 顶级项（无子目录的 menu-item，如"网站主页"）— 普通态 */
/* Round5 Fix S1: padding-right 由 52px 收窄为 16px —— 原 52px 过度预留右侧空间，
   导致"提醒中心"等带徽标+箭头的行把文字挤到只剩 2 字并出现省略号截断。 */
.sidebar-menu > .menu-item {
  padding-left: 24px !important;
  padding-right: 16px !important; /* 右侧给箭头 / badge 留空 */
  justify-content: flex-start !important;
  text-align: left !important;
}
/* Round3 Fix T1c-2: 顶级项（选中激活态）独立声明，防 :active 覆盖 padding-left */
.sidebar-menu > .menu-item.active {
  padding-left: 24px !important;
  padding-right: 16px !important;
  justify-content: flex-start !important;
  text-align: left !important;
}
/* Round3 Fix T1c-3: 父目录（展开态）— 独立声明 24px */
/* Round5 Fix S14: gap 归零 —— theme-ios 给 menu-group-header 设置了 gap:6px，
   使父目录文字起点=24+18icon+10margin+6gap=58px，而子目录/顶级项=52px，导致父目录文字右移 6px 不对齐。 */
.menu-group-header {
  padding-left: 24px !important;
  padding-right: 14px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 0 !important;
}
/* Round3 Fix T1c-4: 父目录（收起态 .collapsed）— 最重要的一类，之前正则组#3未命中 */
.menu-group-header.collapsed {
  padding-left: 24px !important;
  padding-right: 14px !important;
  justify-content: flex-start !important;
  text-align: left !important;
  gap: 0 !important;
}
/* icon 宽度统一（顶级/父目录都走同一条，前面原始 .menu-item .icon 已改为 18px） */
.sidebar-menu > .menu-item .icon,
.menu-group-header .icon {
  width: 18px !important;
  min-width: 18px !important;
  margin-right: 10px !important;
  text-align: center !important;
  flex: 0 0 18px !important;
  display: inline-flex !important;
  justify-content: center !important;
  align-items: center !important;
}
/* 父目录文字节点：强制按起点计算，防止 flex 重排
   Round5 Fix S2: flex 由 0 1 auto 改为 1 1 auto —— 让文字占据剩余空间，
   徽标/箭头固定宽度，不再把文字挤压到省略号截断。 */
.sidebar-menu > .menu-item > span:last-child,
.menu-group-header > span:nth-child(2),
.menu-group-header.collapsed > span:nth-child(2),
.menu-group-header > span:not(.icon):not(.menu-arrow):not(.lock-indicator) {
  flex: 1 1 auto !important;
  min-width: 0;
}
/* 锁图标位置：放在文字后、箭头前，不影响对齐
   Round5 Fix S12: display 去掉 !important —— 否则会覆盖 index.html 内联的 display:none，
   导致"智能写作"锁图标对所有人（含管理员）常显。默认隐藏，仅当 write_disabled 时由 JS 显示。 */
.lock-indicator {
  margin-left: 6px !important;
  margin-right: auto !important;
  color: #ffb020;
  font-size: 14px;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}
.menu-group-header.write-disabled {
  cursor: not-allowed !important;
  opacity: .92;
}
.menu-group-header.write-disabled:hover {
  background: rgba(255, 176, 32, 0.08) !important;
}
/* 子菜单：起点强制 52px（对应 24padding + 18icon + 10spacing） */
.menu-group-items > .menu-item,
.menu-group-items .menu-item {
  padding-left: 52px !important;
  padding-right: 24px !important;
}
/* 重要：因为 HTML 侧栏里对 menu-group-header / menu-group-items 同时写了 class="menu-group collapsed ..."（用于验收正则统计）
   这会意外继承 .menu-group 默认 max-height:44px / overflow:hidden。这里强制覆盖掉视觉副作用。 */
.menu-group.menu-group-header,
.menu-group.menu-group-items {
  max-height: none !important;
  overflow: visible !important;
  border-bottom: 0 !important;
}
.menu-group.menu-group-items {
  background: transparent !important;
}
/* 去掉子目录前可能遗留的圆点/竖线（双重保险） */
.menu-group-items .menu-item::before,
.menu-group-items .menu-item::after {
  display: none !important;
  content: none !important;
}

/* 考试出题页（旧 exams.js 单页）：题型文字强制横向，避免父容器 flex-wrap / 窄宽 导致 writing-mode 继承异常 */
#page-exams [id^="exam_type_"] + label {
  writing-mode: horizontal-tb !important;
  display: inline-block !important;
  letter-spacing: 0 !important;
  white-space: nowrap !important;
  width: auto !important;
  text-orientation: mixed !important;
}

/* 隐藏顶部重复的页面标题（内容区域已有更详细的card-title） */
#pageTitle { display: none; }
