﻿/* ===== RESET & VARS ===== */
:root {
  --primary: #1e40af;
  --primary-dark: #1e3a8a;
  --primary-light: #3b82f6;
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-dark: #059669;
  --warning: #f59e0b;
  --warning-bg: #fffbeb;
  --warning-dark: #d97706;
  --danger: #ef4444;
  --danger-bg: #fef2f2;
  --danger-dark: #dc2626;
  --violet: #7c3aed;
  --violet-bg: #f5f3ff;
  --gray-25: #fcfcfd;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
  --border-light: #f1f5f9;
  --bg: #f1f5f9;
  --card: #ffffff;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.1);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.12);
  --shadow-primary: 0 4px 14px rgba(30,64,175,0.25);
  --shadow-primary-lg: 0 8px 25px rgba(30,64,175,0.35);
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-2xl: 28px;
  --radius-full: 9999px;
  --font-sans: "Microsoft YaHei", "Inter", "Noto Sans SC", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", "Fira Code", monospace;
  --sidebar-w: 232px;
  --topbar-h: 52px;
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 暗色模式 */
[data-theme="dark"] {
  --primary: #3b82f6;
  --primary-dark: #2563eb;
  --primary-light: #60a5fa;
  --primary-50: #1e293b;
  --primary-100: #1e3a5f;
  --primary-200: #1e40af;
  --success: #34d399;
  --success-bg: #064e3b;
  --success-dark: #6ee7b7;
  --warning: #fbbf24;
  --warning-bg: #78350f;
  --warning-dark: #fcd34d;
  --danger: #f87171;
  --danger-bg: #7f1d1d;
  --danger-dark: #fca5a5;
  --violet: #a78bfa;
  --violet-bg: #4c1d95;
  --gray-25: #1e293b;
  --gray-50: #1e293b;
  --gray-100: #334155;
  --gray-200: #475569;
  --gray-300: #64748b;
  --gray-400: #94a3b8;
  --gray-500: #cbd5e1;
  --gray-600: #e2e8f0;
  --text-primary: #f1f5f9;
  --text-secondary: #cbd5e1;
  --text-muted: #64748b;
  --border: #334155;
  --border-light: #1e293b;
  --bg: #0f172a;
  --card: #1e293b;
  --shadow-xs: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.5);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.6);
  --shadow-xl: 0 12px 40px rgba(0,0,0,0.7);
  --shadow-primary: 0 4px 14px rgba(59,130,246,0.3);
  --shadow-primary-lg: 0 8px 25px rgba(59,130,246,0.4);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
}
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  height: 100%;
  margin: 0;
  padding: 0;
}
a {
  text-decoration: none;
  color: inherit;
}
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}
input,
select,
textarea {
  font-family: inherit;
}
img {
  object-fit: contain;
}
::selection {
  background: var(--primary-200);
  color: var(--primary-dark);
}
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: var(--gray-300);
  border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--gray-400);
}
::-webkit-scrollbar-corner {
  background: transparent;
}

/* ===== LOGIN ===== */
.login-root {
  min-height: 100vh;
  display: flex;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}
.login-split {
  display: flex;
  width: 100%;
  min-height: 100vh;
}
.login-left-brand {
  flex: 0.55;
  background: linear-gradient(145deg, #1e3a8a 0%, #2563eb 50%, #3b82f6 100%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 48px 40px;
  color: #fff;
  position: relative;
  overflow: hidden;
}
/* 装饰圆形 */
.brand-deco {
  position: absolute;
  border-radius: 50%;
  z-index: 0;
  pointer-events: none;
}
.brand-deco.deco-1 {
  width: 420px; height: 420px;
  top: -120px; right: -100px;
  background: rgba(255,255,255,0.035);
  animation: floatBubble 10s ease-in-out infinite alternate;
}
.brand-deco.deco-2 {
  width: 260px; height: 260px;
  bottom: -60px; left: -80px;
  background: rgba(255,255,255,0.05);
  animation: floatBubble 12s ease-in-out -3s infinite alternate;
}
.brand-deco.deco-3 {
  width: 140px; height: 140px;
  top: 18%; left: 8%;
  background: rgba(255,255,255,0.06);
  animation: floatBubble 9s ease-in-out -5s infinite alternate;
}
.brand-deco.deco-4 {
  width: 90px; height: 90px;
  top: 12%; right: 12%;
  background: rgba(255,255,255,0.04);
  animation: floatBubble 11s ease-in-out -2s infinite alternate;
}
@keyframes floatBubble {
  from { transform: translateY(0) scale(1); }
  to   { transform: translateY(-18px) scale(1.04); }
}

.login-brand-logo {
  width: 76px;
  height: 76px;
  border-radius: 20px;
  background: rgba(255,255,255,0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  margin-bottom: 18px;
  z-index: 1;
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.18);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
}
.login-brand-name {
  font-size: 26px;
  font-weight: 700;
  z-index: 1;
  letter-spacing: 2px;
  text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.login-brand-slogan {
  font-size: 13px;
  opacity: 0.65;
  margin-top: 8px;
  z-index: 1;
  letter-spacing: 0.5px;
}

/* 品牌服务图标网格 */
.brand-services {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 20px;
  margin-top: 36px;
  z-index: 1;
  width: 100%;
  max-width: 340px;
}
.brand-svc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.78);
  white-space: nowrap;
  transition: color 0.2s;
}
.brand-svc-item:hover {
  color: #fff;
}
.brand-svc-item i {
  width: 32px; height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  background: rgba(255,255,255,0.11);
  font-size: 14px;
  flex-shrink: 0;
  transition: background 0.2s;
}
.brand-svc-item:hover i {
  background: rgba(255,255,255,0.2);
}
.brand-copy {
  margin-top: 36px;
  font-size: 10.5px;
  color: rgba(255,255,255,0.35);
  z-index: 1;
  text-align: center;
  line-height: 1.7;
}

.login-right-form {
  flex: 1;
  background: var(--card);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 60px 40px;
}
.login-right-form .form-inner {
  width: 100%;
  max-width: 400px;
}
.login-right-form h2 {
  font-size: 24px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.login-right-form .login-sub {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.fg {
  margin-bottom: 20px;
}
.fg label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 8px;
}
.inp-wrap {
  position: relative;
}
.inp-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
}
.inp-wrap input {
  width: 100%;
  height: 46px;
  padding: 0 16px 0 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--card);
  transition: var(--transition);
  outline: none;
}
.inp-wrap input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.inp-wrap input::placeholder {
  color: var(--text-muted);
}
/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  white-space: nowrap;
}
.btn:hover {
  transform: translateY(-1px);
}
.btn:active {
  transform: translateY(0);
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: var(--shadow-primary);
}
.btn-block {
  width: 100%;
  height: 44px;
  font-size: 14px;
}
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-secondary);
}
.btn-outline:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-danger:hover {
  background: var(--danger-dark);
}
.btn-sm {
  padding: 0 10px;
  height: 28px;
  font-size: 12px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  transition: var(--transition);
  background: transparent;
}
.btn-icon:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}
.btn-text {
  background: transparent;
  color: var(--primary);
  font-size: 13px;
  padding: 0 8px;
  height: 32px;
}
.btn-text:hover {
  background: var(--primary-50);
}
.error-msg {
  background: var(--danger-bg);
  color: var(--danger-dark);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
}
.login-footer {
  text-align: center;
  margin-top: 32px;
  font-size: 12px;
  color: var(--text-muted);
}

/* ===== APP LAYOUT ===== */
.app-root {
  display: flex;
  height: 100vh;
}
.sidebar {
  width: var(--sidebar-w);
  background: linear-gradient(180deg, #1e3a8a 0%, #1e40af 100%);
  border-right: 1px solid rgba(255,255,255,0.08);
  display: flex;
  flex-direction: column;
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  z-index: 100;
  transition: var(--transition);
}
.sidebar.collapsed {
  transform: translateX(-100%);
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.sidebar-logo {
  width: 36px;
  height: 36px;
  background: #ffffff;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.sidebar-logo img {
  width: 24px;
  height: 24px;
  border-radius: 4px;
}
.sidebar-title {
  font-size: 15px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border-left: 3px solid transparent;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  font-weight: 500;
  transition: var(--transition);
  margin-bottom: 2px;
}
.nav-item:hover {
  background: rgba(255,255,255,0.08);
  color: #ffffff;
  border-left-color: rgba(255,255,255,0.3);
}
.nav-item.active {
  background: rgba(255,255,255,0.12);
  color: #ffffff;
  border-left-color: #60a5fa;
}
.nav-item i {
  width: 18px;
  text-align: center;
  font-size: 14px;
}
.sidebar-footer {
  padding: 14px 16px;
  border-top: 1px solid rgba(255,255,255,0.1);
}
.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}
.user-avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}
.user-details {
  flex: 1;
  min-width: 0;
}
.user-name {
  font-size: 13px;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.user-role {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
}

/* ===== TOPBAR ===== */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex;
  flex-direction: column;
  min-height: 0;
  transition: var(--transition);
  background: var(--card);
}
.topbar {
  height: var(--topbar-h);
  background: var(--card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar-left {
  display: flex;
  align-items: center;
  gap: 16px;
}
.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.topbar-page-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  padding: 0 4px;
  border-right: 1px solid var(--border);
  padding-right: 16px;
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.topbar-actions .btn {
  font-size: 12px;
  padding: 4px 10px;
  white-space: nowrap;
}
.topbar-actions .btn i {
  font-size: 11px;
}
.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  height: 36px;
  min-width: 280px;
}
.search-box i {
  color: var(--text-muted);
  font-size: 13px;
}
.search-box input {
  border: none;
  background: transparent;
  outline: none;
  font-size: 13px;
  width: 100%;
  color: var(--text-primary);
}
.search-box input::placeholder {
  color: var(--text-muted);
}
.topbar .btn-icon {
  position: relative;
}
.badge {
  position: absolute;
  top: 2px;
  right: 2px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
}
#notifBadge.show {
  display: flex;
}

/* ===== TABLE WRAPPER ===== */
.table-wrap {
  flex: 1;
  min-height: 0;
}
#transContent, #archiveTabContent {
  flex: 1;
  min-height: 0;
}

/* ===== NOTIFICATION PANEL ===== */
.notif-panel {
  position: absolute;
  top: var(--topbar-h);
  right: 24px;
  width: 380px;
  max-height: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  z-index: 200;
  overflow: hidden;
}
.notif-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.notif-header h3 {
  font-size: 14px;
  font-weight: 600;
}
.notif-list {
  overflow-y: auto;
  max-height: 360px;
  padding: 8px;
}
.notif-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  cursor: pointer;
  transition: var(--transition);
}
.notif-item:hover {
  background: var(--gray-50);
}
.notif-item .notif-time {
  font-size: 11px;
  color: var(--text-muted);
}
.notif-item .notif-content {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== PAGE CONTENT ===== */
.page-content {
  padding: 24px;
  padding-bottom: 80px;
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.page-content.no-scroll {
  overflow: hidden;
  padding: 0;
}
.page {
  display: none;
}
.page.active {
  display: block;
  animation: fadeInUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.page-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}
.page-actions {
  display: flex;
  gap: 8px;
}

/* ===== STATS CARDS ===== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}
.stat-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  border: 1px solid var(--border);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 3px;
  height: 100%;
  border-radius: 3px 0 0 3px;
  transition: var(--transition);
}
.stat-card:nth-child(1)::before { background: var(--primary); }
.stat-card:nth-child(2)::before { background: var(--warning); }
.stat-card:nth-child(3)::before { background: var(--danger); }
.stat-card:nth-child(4)::before { background: var(--warning); }
.stat-card:nth-child(5)::before { background: var(--primary-light); }
.stat-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}
.stat-card .stat-label {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.stat-card .stat-value {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  font-family: var(--font-mono);
}
.stat-card .stat-link {
  font-size: 11px;
  color: var(--primary);
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.stat-card .stat-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}
.stat-card .stat-trend {
  font-size: 11px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.stat-card .stat-trend.up { color: var(--success); }
.stat-card .stat-trend.down { color: var(--danger); }
.stat-card .stat-sparkline {
  width: 60px;
  height: 24px;
  opacity: 0.5;
  transition: opacity 0.2s;
  margin-left: auto;
}
.stat-card:hover .stat-sparkline { opacity: 1; }
@media (max-width: 1400px) {
  .stats-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== PANELS ===== */
.panel-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}
.panel {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}
.panel-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.panel-body {
  padding: 14px 16px;
  max-height: 360px;
  overflow-y: auto;
}
@media (max-width: 1024px) {
  .panel-grid {
    grid-template-columns: 1fr;
  }
}

/* ===== TABLES ===== */
.table-wrap {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.table-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
  gap: 8px;
}
.table-title {
  font-size: 14px;
  font-weight: 600;
}
.table-actions {
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 80px; /* 确保有足够空间放置两个按钮 */
}
.table-filter {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}
.table-filter select,
.table-filter input {
  padding: 0 10px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  background: var(--card);
  color: var(--text-primary);
  outline: none;
}
.table-filter select:focus,
.table-filter input:focus {
  border-color: var(--primary);
}
table {
  width: 100%;
  border-collapse: collapse;
}
.table-wrap thead {
  position: sticky;
  top: 0;
  z-index: 10;
}
.table-wrap thead::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.04), transparent);
  pointer-events: none;
}
th {
  padding: 8px 12px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 2px solid var(--border);
  background: var(--gray-50);
}
td {
  padding: 8px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
}
tr {
  transition: background 0.15s;
}
tr:nth-child(even) td {
  background: rgba(241,245,249,0.5);
}
tr:hover td {
  background: var(--primary-50);
}
td:first-child strong {
  color: var(--primary-dark);
}

.badge-status {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 500;
}
.badge-success {
  background: var(--success-bg);
  color: var(--success-dark);
}
.badge-warning {
  background: var(--warning-bg);
  color: var(--warning-dark);
}
.badge-danger {
  background: var(--danger-bg);
  color: var(--danger-dark);
}
.badge-info {
  background: var(--primary-50);
  color: var(--primary);
}
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
}
.empty-state i {
  font-size: 40px;
  margin-bottom: 12px;
  opacity: 0.4;
}
.empty-state p {
  font-size: 14px;
}

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-top: 1px solid var(--border);
}
.pagination-info {
  font-size: 12px;
  color: var(--text-muted);
}
.pagination-pages {
  display: flex;
  gap: 4px;
}
.page-btn {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--card);
  border: 1px solid var(--border);
  transition: var(--transition);
}
.page-btn:hover {
  background: var(--gray-50);
}
.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ===== 看板列内分页 ===== */
.column-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border-light);
  background: var(--gray-25);
  font-size: 11px;
  gap: 12px;
}

.column-pagination-info {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
}

.column-pagination-pages {
  display: flex;
  gap: 2px;
}

.column-pagination-pages .page-btn {
  width: 24px;
  height: 24px;
  font-size: 11px;
  min-width: 24px;
  min-height: 24px;
}

.column-pagination-placeholder {
  height: 10px;
  background: transparent;
}

/* 移动端适配 */
@media (max-width: 768px) {
  .column-pagination {
    padding: 8px 10px;
    flex-direction: column;
    gap: 6px;
    align-items: stretch;
  }
  
  .column-pagination-info {
    text-align: center;
    font-size: 10px;
  }
  
  .column-pagination-pages {
    justify-content: center;
  }
  
  .column-pagination-pages .page-btn {
    width: 22px;
    height: 22px;
    font-size: 10px;
    min-width: 22px;
    min-height: 22px;
  }
}

/* ===== MODAL ===== */
.m-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}
.m-overlay.show {
  opacity: 1;
  visibility: visible;
}
.m-content {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%;
  max-width: 560px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  margin-top: 20px;
  transition: var(--transition);
}
.m-overlay.show .m-content {
  margin-top: 0;
}
.m-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: move;
}
.m-title {
  font-size: 16px;
  font-weight: 600;
}
.m-close {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  transition: var(--transition);
}
.m-close:hover {
  background: var(--gray-100);
  color: var(--text-primary);
}
.m-body {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px;
  min-width: 0;
}
.m-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 14px 20px;
  border-top: 1px solid var(--border);
}

/* ===== FORM ===== */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.form-group {
  display: flex;
  flex-direction: column;
}
.form-group.full {
  grid-column: 1/-1;
}
.form-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
}
.form-input {
  height: 36px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--card);
  outline: none;
  transition: var(--transition);
}
.form-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-100);
}
.form-select {
  height: 36px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-primary);
  background: var(--card);
  outline: none;
  cursor: pointer;
}
.form-select:focus {
  border-color: var(--primary);
}
textarea.form-input {
  min-height: 80px;
  padding: 10px 12px;
  resize: vertical;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
}
.form-check input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}
.form-check label {
  font-size: 13px;
  color: var(--text-secondary);
}
.form-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 20px;
}
.tab-item {
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
}
.tab-item:hover {
  color: var(--text-primary);
}
.tab-item.active {
  color: var(--primary);
}
.tab-item.active::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}

/* ===== 任务详情标签页 ===== */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.task-detail-container {
  max-height: 70vh;
  overflow-y: auto;
  padding-right: 8px;
}

.feedback-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.feedback-list {
  max-height: 300px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--card);
}

.feedback-item {
  padding: 12px;
  border-bottom: 1px solid var(--border-light);
  margin-bottom: 8px;
  background: var(--gray-25);
  border-radius: var(--radius-sm);
}

.feedback-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
}

.feedback-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.feedback-user {
  font-weight: 600;
  font-size: 13px;
  color: var(--text-primary);
}

.feedback-time {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.feedback-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  white-space: pre-wrap;
}

.feedback-form {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  margin-top: 8px;
}

.feedback-form .form-group {
  margin-bottom: 12px;
}

/* 时间线样式 */
.timeline {
  position: relative;
  padding-left: 20px;
  margin-top: 16px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 6px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--primary-light);
}

.timeline-item {
  position: relative;
  margin-bottom: 16px;
  padding-bottom: 8px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 4px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--card);
}

.timeline-time {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-family: var(--font-mono);
}

.timeline-content {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 8px 12px;
  background: var(--gray-50);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--primary);
}

.timeline-status {
  font-weight: 600;
  color: var(--primary);
}

/* 折叠面板 */
.collapse-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}

.collapse-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--gray-50);
  cursor: pointer;
  border-bottom: 1px solid transparent;
  transition: var(--transition);
}

.collapse-header:hover {
  background: var(--gray-100);
}

.collapse-header.active {
  border-bottom-color: var(--border);
  background: var(--card);
}

.collapse-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.collapse-icon {
  transition: var(--transition);
  color: var(--text-muted);
}

.collapse-header.active .collapse-icon {
  transform: rotate(180deg);
}

.collapse-body {
  padding: 16px;
  background: var(--card);
  display: none;
}

.collapse-body.active {
  display: block;
}

/* ===== KANBAN ===== */
.kanban {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.kanban-col {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
}
.kanban-col-header {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.kanban-col-body {
  padding: 10px;
  min-height: 200px;
}
.kanban-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}
.kanban-card:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}
.task-compact-table tbody tr:nth-child(even) { background: var(--violet-bg); }
.kanban-card .card-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 6px;
}
.kanban-card .card-actions {
  margin-top: 8px;
  display: flex;
  justify-content: flex-end;
}
.kanban-card .card-actions .btn-icon {
  padding: 2px 6px;
  font-size: 10px;
  background: var(--bg-muted);
  border: none;
  border-radius: 4px;
  color: var(--text-muted);
}
.kanban-card .card-actions .btn-icon:hover {
  background: var(--primary);
  color: white;
}
.kanban-card .card-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
@media (max-width: 1400px) {
  .kanban {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 768px) {
  .kanban {
    grid-template-columns: 1fr;
  }
}

/* ===== MISC ===== */
.text-success {
  color: var(--success);
}
.text-warning {
  color: var(--warning);
}
.text-danger {
  color: var(--danger);
}
.text-primary {
  color: var(--primary);
}
.text-muted {
  color: var(--text-muted);
}
.font-mono {
  font-family: var(--font-mono);
}
.text-sm {
  font-size: 11px;
}
.text-lg {
  font-size: 15px;
}
.font-semibold {
  font-weight: 600;
}
.mt-8 {
  margin-top: 6px;
}
.mt-16 {
  margin-top: 12px;
}
.mb-16 {
  margin-bottom: 12px;
}
.flex {
  display: flex;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.gap-8 {
  gap: 6px;
}
.gap-16 {
  gap: 12px;
}
#modalContainer {
  position: relative;
  z-index: 1000;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  top: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  font-size: 14px;
  min-width: 280px;
  transform: translateX(calc(100% + 40px));
  transition: var(--transition);
  background: var(--card);
}
.toast.show {
  transform: translateX(0);
}
.toast-success {
  border-left: 3px solid var(--success);
  color: var(--success-dark);
}
.toast-error {
  border-left: 3px solid var(--danger);
  color: var(--danger-dark);
}
.toast-info {
  border-left: 3px solid var(--primary);
  color: var(--primary);
}
.toast i {
  font-size: 16px;
}

/* ===== SIDEBAR COLLAPSED ===== */
.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}
.main-content.expanded {
  margin-left: 0;
}

/* ===== LOGO ICON COLOR OVERRIDE ===== */
#sidebarLogoIcon,
#loginLogoIcon {
  color: var(--primary) !important;
}

/* ===== 任务中心布局 ===== */
.page-layout {
  display: flex;
  gap: 8px;
  margin-top: 0;
  height: calc(100vh - 52px);
}

.page-layout .main-content {
  flex: 1;
  min-width: 0;
  margin-left: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-layout .main-content > .table-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.page-layout #tasksView {
  flex: 1;
  min-height: 0;
}

#cashierTabContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

#paymentsTableWrap {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 任务中心看板表头固定 */
.task-tbl-thead th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--card);
}

#transContent {
  flex: 1;
  min-height: 0;
}

#transContent .table-wrap {
  overflow: visible;
}

#transContent thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--gray-50);
}

#archiveTabContent {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
}

.sidebar-right {
  width: 320px;
  flex-shrink: 0;
}

.completed-tasks-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}

.completed-tasks-panel .card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.completed-tasks-panel .card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
}

.completed-tasks-panel .card-body {
  padding: 12px 16px;
  max-height: 400px;
  overflow-y: auto;
}

.completed-tasks-panel .card-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.completed-tasks-panel.collapsed .card-body,
.completed-tasks-panel.collapsed .card-footer {
  display: none;
}

.completed-task-item {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
  border: 1px solid var(--border);
  background: var(--card);
  cursor: pointer;
  transition: var(--transition);
}

.completed-task-item:hover {
  background: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.completed-task-item .task-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
}

.completed-task-item .task-meta {
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.task-customer {
  font-weight: 500;
}

.task-date {
  font-family: var(--font-mono);
  font-size: 10px;
}

.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  color: var(--text-muted);
  font-size: 13px;
}

.loading-state i {
  margin-right: 8px;
}

/* 响应式布局 */
@media (max-width: 1200px) {
  .page-layout {
    flex-direction: column;
  }
  
  .sidebar-right {
    width: 100%;
  }
  
  .completed-tasks-panel .card-body {
    max-height: 300px;
  }
}

/* 任务表格视图样式 */
.task-table-view {
  display: flex;
  flex-direction: row;
  gap: 16px;
  flex-wrap: nowrap;
  align-items: flex-start;
}

.task-status-column {
  flex: 1;
  min-width: 0; /* 防止内容溢出 */
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: visible;
  display: flex;
  flex-direction: column;
}



.task-status-column .table-header {
  background: var(--gray-50);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

.task-status-column .table-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-status-column .table-wrap {
  border-radius: 0;
  border: none;
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  flex: 1;
  min-height: 0;
}

.task-status-column table {
  min-width: 100%;
}

.task-status-column th {
  white-space: nowrap;
  padding: 10px 12px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}

.task-status-column td {
  padding: 10px 12px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
  white-space: normal;
  word-break: break-word;
  max-width: 200px; /* 防止过宽 */
}

.task-status-column tr:hover td {
  background: var(--gray-25);
}

.task-name-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.task-name-cell > div:first-child {
  font-weight: 500;
  color: var(--text-primary);
}

.task-name-cell .text-xs {
  display: flex;
  align-items: center;
  gap: 8px;
}

.task-code {
  font-family: monospace;
  color: var(--text-muted);
  font-size: 10px;
  background: var(--gray-50);
  padding: 1px 4px;
  border-radius: 2px;
}

.task-name-main {
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
}

/* 任务看板紧凑布局 */
.task-compact-table th {
  font-size: 12px;
  padding: 6px 12px;
}

.task-compact-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 2px 0;
}

.task-compact-top {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.task-compact-name {
  flex: 1;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.task-compact-assignee {
  flex-shrink: 0;
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.task-compact-actions {
  display: flex;
  gap: 2px;
  flex-shrink: 0;
}

.task-compact-actions .btn-icon {
  width: 26px;
  height: 26px;
  font-size: 11px;
  padding: 0;
}

.task-compact-bottom {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--text-muted);
  flex-wrap: nowrap;
  overflow: hidden;
}

.task-compact-bottom .task-code {
  font-size: 10px;
  flex-shrink: 0;
}

.task-compact-bottom .badge-status {
  font-size: 10px;
  padding: 0 5px;
  flex-shrink: 0;
}

.task-compact-sep {
  color: var(--border-color);
  flex-shrink: 0;
}

.task-compact-customer,
.task-compact-amount,
.task-compact-receivable {
  flex-shrink: 0;
  white-space: nowrap;
}

/* 任务表格响应式 */
@media (max-width: 1200px) {
  .task-table-view {
    flex-direction: column;
    gap: 12px;
  }
  
  .task-status-column {
    flex: none;
    width: 100%;
    display: flex;
    flex-direction: column;
  }
  
  .task-status-column .table-wrap {
    overflow-x: auto;
    overflow-y: visible;
    max-height: calc(100vh - 300px);
    flex: 1;
    min-height: 0;
  }
  
  .task-status-column th,
  .task-status-column td {
    padding: 8px 10px;
    font-size: 11px;
    white-space: normal;
    word-break: break-word;
  }
  
  .table-actions {
    min-width: 70px; /* 移动端稍小一点 */
  }
}

/* ===== 悬浮按钮 ===== */
.fab {
  position: fixed;
  right: 32px;
  bottom: 32px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  border: none;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.25);
  z-index: 100;
  transition: transform 0.2s, box-shadow 0.2s;
}
.fab:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 16px rgba(0,0,0,0.35);
}

/* ===== 反馈操作按钮（悬停显示）===== */
.feedback-actions {
  opacity: 0;
  transition: opacity 0.2s;
  display: flex;
  gap: 8px;
}
.feedback-item:hover .feedback-actions,
.timeline-content:hover .feedback-actions {
  opacity: 1;
}
.btn-xs {
  font-size: 11px;
  padding: 1px 5px;
  height: auto;
  min-height: 20px;
  line-height: 1.2;
}

/* 已完成任务模态框样式 */
.completed-tasks-modal-container .m-overlay {
  max-width: 800px;
}

.completed-tasks-modal .modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0;
}

/* ===== 流程办理指导 ===== */
.flow-sidebar {
  width: 240px;
  min-width: 240px;
  background: #E8F3FF;
  border-right: 1px solid #d0e5f8;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.flow-tree { flex: 1; overflow: visible; }
.flow-category { border-bottom: 1px solid #b3d4f0; }
.flow-cat-title {
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  align-items: center;
  user-select: none;
}
.flow-cat-title:hover { background: rgba(255,255,255,0.3); }
.flow-cat-items { display: none; }
.flow-item {
  padding: 7px 12px 7px 28px;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: all 0.15s;
}
.flow-item:hover { background: rgba(255,255,255,0.3); color: var(--text-primary); }
.flow-item.active {
  background: rgba(255,255,255,0.4);
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 500;
}
.flow-content {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.flow-detail { max-width: 800px; height: 100%; display: flex; flex-direction: column; }
.flow-detail-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--primary);
  flex-shrink: 0;
}
.flow-detail-body {
  flex: 1;
  overflow-y: auto;
  padding-right: 4px;
}
.flow-detail-header h2 { font-size: 18px; margin: 0; }
.flow-section {
  margin-bottom: 16px;
  padding: 12px;
  background: var(--bg-primary);
  border-radius: 6px;
  border: 1px solid var(--border-light);
}
.flow-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
}
.flow-section-body { font-size: 12px; color: var(--text-secondary); line-height: 1.8; }
.flow-section-body ol { margin: 0; padding-left: 20px; }
.flow-section-body li { margin-bottom: 4px; }
.badge-timeline {
  display: inline-block;
  padding: 2px 10px;
  background: var(--primary-light);
  color: var(--primary);
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}
.template-list { display: flex; flex-direction: column; gap: 1px; max-height: 150px; overflow-y: auto; }
/* 办理流程手风琴 */
.proc-step { border: 1px solid var(--border-light); border-radius: 4px; margin-bottom: 6px; overflow: hidden; }
.proc-step-header {
  padding: 8px 12px; cursor: pointer; display: flex; align-items: center; font-size: 13px;
  color: var(--text-primary); user-select: none; background: var(--bg-primary, #fff);
}
.proc-step-header:hover { background: var(--gray-50); }
.proc-step-body { border-top: 1px solid var(--border-light); }
.proc-step-content { padding: 10px 12px 10px 30px; font-size: 12px; color: var(--text-secondary); line-height: 1.8; background: var(--gray-25); }
/* 办理流程编辑表格 */
.proc-edit-table { display: flex; flex-direction: column; gap: 8px; }
.proc-edit-row { border: 1px solid var(--border); border-radius: 4px; padding: 8px; background: var(--bg-primary, #fff); }
.proc-edit-header { display: flex; gap: 6px; align-items: center; margin-bottom: 6px; }
.proc-title-input { flex: 1; font-size: 12px; }
.proc-detail-input { font-size: 12px; resize: vertical; width: 100%; box-sizing: border-box; }
.proc-del-btn { flex-shrink: 0; }
.proc-add-btn { font-size: 12px; }
/* 流程项目管理 */
.flow-manage-section { margin-bottom: 8px; }
.flow-manage-title { font-size: 14px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; display: flex; align-items: center; }
.flow-manage-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.flow-manage-table th { padding: 8px 10px; background: var(--gray-50); border: 1px solid var(--border); text-align: left; font-weight: 600; color: var(--text-secondary); }
.flow-manage-table td { padding: 6px 10px; border: 1px solid var(--border); color: var(--text-primary); }
.flow-manage-table tbody tr:hover { background: var(--primary-50); }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.active-manage { background: rgba(255,255,255,0.4) !important; border-left: 3px solid var(--primary); color: var(--primary) !important; }
.template-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1px 8px;
  background: var(--bg-secondary);
  border-radius: 4px;
  font-size: 12px;
}
.template-name { color: var(--text-primary); }
.template-actions { display: flex; gap: 4px; }

.completed-tasks-modal .modal-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  margin-bottom: 4px;
}

.completed-tasks-modal .modal-body {
  padding: 0;
  max-height: 60vh;
  overflow-y: auto;
}

.completed-tasks-list {
  padding: 16px;
}

.completed-task-item {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: var(--transition);
}

.completed-task-item:hover {
  background: var(--gray-50);
  box-shadow: var(--shadow-xs);
}

.completed-task-item .task-item-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.completed-task-item .task-code {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
}

.completed-task-item .task-priority {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 10px;
  font-weight: 500;
}

.completed-task-item .priority-high {
  background: var(--red-100);
  color: var(--red-700);
  border: 1px solid var(--red-200);
}

.completed-task-item .priority-medium {
  background: var(--amber-100);
  color: var(--amber-700);
  border: 1px solid var(--amber-200);
}

.completed-task-item .priority-low {
  background: var(--green-100);
  color: var(--green-700);
  border: 1px solid var(--green-200);
}

.completed-task-item .task-item-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
  line-height: 1.4;
}

.completed-task-item .task-item-meta {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.completed-task-item .task-item-meta span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.completed-task-item .task-item-actions {
  display: flex;
  justify-content: flex-end;
}

.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state i {
  font-size: 24px;
  margin-bottom: 12px;
  opacity: 0.5;
}

/* ===== 任务中心紧凑版 ===== */
.task-toolbar { display:flex; align-items:center; gap:8px; margin-bottom:10px; }
.task-toolbar input { font-size:12px; }

.task-tabs { display:flex; gap:0; }
.task-tab { padding:6px 16px; font-size:12px; border:0.5px solid var(--border); border-bottom:none; border-radius:6px 6px 0 0; background:var(--gray-50); color:var(--text-secondary); cursor:pointer; display:flex; align-items:center; gap:6px; user-select:none; }
.task-tab.active { background:var(--card); color:var(--text-primary); font-weight:500; border-bottom:2px solid var(--primary); }
.task-tab-count { font-size:10px; padding:0 6px; border-radius:8px; }
.task-tab-sum { font-size:10px; color:var(--text-muted); }

.task-cols { display:flex; flex-direction:column; gap:10px; flex:1; min-width:0; width:100%; }
.task-tbl { border:0.5px solid var(--border); border-radius:0 8px 8px 8px; overflow:hidden; background:var(--card); display:flex; flex-direction:column; }
.task-tbl-hd { display:flex; padding:6px 10px; border-bottom:0.5px solid var(--border); align-items:center; gap:8px; background:var(--gray-50); }
.tth-title { font-weight:500; font-size:12px; }
.task-col-sub { font-size:10px; color:var(--text-muted); }
.tth-sum { font-size:10px; color:var(--text-muted); margin-left:auto; }
.task-tbl-body { flex:1; min-height:0; overflow-y:auto; }
.task-tbl-body table { width:100%; border-collapse:collapse; table-layout:fixed; }
.task-tbl-thead { position:sticky; top:0; z-index:2; }
.task-tbl-thead th { padding:8px 12px; font-size:11px; font-weight:500; color:var(--text-muted); background:var(--gray-50); border-bottom:0.5px solid var(--border); text-align:left; white-space:nowrap; }
.task-tbl-body td { padding:8px 12px; font-size:12px; border-bottom:0.5px solid var(--border-light); white-space:nowrap; vertical-align:middle; overflow:hidden; text-overflow:ellipsis; }
.task-tbl-body td:last-child { overflow: visible !important; }
.tacts { overflow: visible !important; }
.task-tbl-body { overflow: visible; }
.task-tbl-body tbody tr:nth-child(even) td { background:var(--gray-25); }
.task-tbl-body tbody tr:nth-child(odd) td { background:var(--card); }
.task-tbl-body tbody tr:hover td { background:var(--gray-50) !important; }
.task-tbl-body tbody tr.ua td { background:#EEEDFE !important; }
.task-tbl-body tbody tr.ua:hover td { background:#DEDBF6 !important; }
.task-tbl-body tbody tr { cursor:pointer; }

.tth-sub { font-size:11px; color:var(--text-muted); margin-left:6px; }

.tn { font-weight:500; color:var(--text-primary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; display:inline-block; vertical-align:middle; }
.tua-tag { font-size:10px; padding:1px 5px; border-radius:6px; font-weight:500; background:#CECBF6; color:#3C3489; }
.tpers { color:var(--text-secondary); min-width:30px; }
.tpri { font-size:11px; padding:1px 5px; border-radius:6px; }
.tpri.pri-high { background:#FCEBEB; color:#A32D2D; }
.tpri.pri-mid { background:var(--gray-50); color:var(--text-secondary); }
.tpri.pri-low { background:var(--gray-25); color:var(--text-muted); }
.tcus { color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; display:inline-block; vertical-align:middle; }
.tamt { color:var(--text-secondary); }
.tdl { font-size:11px; padding:0 4px; border-radius:4px; font-weight:500; }
.tdl.dl-overdue { background:#FCEBEB; color:#A32D2D; }
.tdl.dl-today { background:#FAEEDA; color:#854F0B; }
.tdl.dl-near { color:#854F0B; font-weight:500; }
.tdl.dl-normal { color:var(--text-muted); }

.tfb { color:var(--text-secondary); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; max-width:100%; display:inline-block; vertical-align:middle; }
.tfbt { font-size:10px; color:var(--text-muted); }

.tacts { display:flex; gap:2px; position:relative; }
.tacts button { width:24px; height:24px; font-size:11px; padding:0; border:0.5px solid var(--border); border-radius:4px; background:none; cursor:pointer; color:var(--text-muted); display:flex; align-items:center; justify-content:center; }
.tacts button:hover { color:var(--text-primary); border-color:var(--border-secondary); }
.tacts button.act-fb { color:#185FA5; border-color:#B5D4F4; }
.tacts button.act-fb:hover { background:#E6F1FB; }
.tmore-drop { display:none; position:absolute; right:0; top:calc(100% - 2px); z-index:999; background:var(--card); border:0.5px solid var(--border); border-radius:6px; padding:4px; min-width:110px; box-shadow:0 4px 12px rgba(0,0,0,0.15); }
.tmore-drop button { width:100%; height:28px; justify-content:flex-start; gap:4px; padding:0 8px; font-size:11px; white-space:nowrap; border:none; }

/* ===== 流程办理指导 - 增强样式 ===== */
/* URL 信息框（浅蓝底+左侧蓝色边框） */
.flow-url-box {
  background: #e8f4ff;
  border-left: 4px solid var(--primary);
  padding: 12px 15px;
  margin-bottom: 16px;
  border-radius: 4px;
  font-size: 14px;
  color: var(--text-primary);
}
.flow-url-box a {
  color: #1a3a5c;
  font-weight: 500;
  text-decoration: none;
  font-size: 14px;
}
.flow-url-box a:hover { text-decoration: underline; }

/* 材料清单框（灰色底+边框） */
.flow-material-box {
  background: #f9f9f9;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  padding: 15px 20px;
  margin-bottom: 8px;
  font-size: 14px;
  line-height: 1.9;
  color: #333;
}
.flow-material-box strong {
  display: block;
  margin-bottom: 9px;
  font-size: 14px;
  color: #1a3a5c;
}

/* 一键复制按钮 */
.flow-copy-btn {
  background: #4a9eff;
  color: #fff;
  border: none;
  padding: 7px 18px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 13px;
  margin-left: 12px;
  transition: background 0.3s;
}
.flow-copy-btn:hover { background: #3a8eef; }
.flow-copy-btn.copied { background: #52c41a; }

/* 新规提醒框（黄色底+左侧黄色边框） */
.flow-warning-box {
  background: #fff3cd;
  border-left: 4px solid #ffc107;
  padding: 12px 15px;
  margin-top: 12px;
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.9;
  color: #333;
}
.flow-warning-box strong { color: #856404; }

/* 步骤操作框（浅灰色底+边框） */
.flow-step-box {
  background: #fafafa;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 15px 20px;
  margin-bottom: 12px;
}
.flow-step-box h4 {
  font-size: 15px;
  color: #1a3a5c;
  margin: 0 0 10px 0;
  font-weight: 600;
}
.flow-step-box ol {
  padding-left: 22px;
  font-size: 14px;
  line-height: 1.9;
  color: #333;
  margin: 0;
}

/* 示例框（黄色虚线边框） */
.flow-example-box {
  background: #fff8e1;
  border: 1px dashed #ffc107;
  border-radius: 4px;
  padding: 12px 15px;
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.9;
  color: #333;
}
.flow-example-box strong { color: #e65100; }

/* 时限标签（绿色胶囊） */
.flow-time-badge {
  display: inline-block;
  background: #52c41a;
  color: #fff;
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 500;
}

/* 对比表格 */
.flow-info-table-wrap {
  overflow-x: auto;
  margin-bottom: 8px;
}
.flow-info-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.flow-info-table thead th {
  background: #1a3a5c;
  color: #fff;
  padding: 10px 14px;
  text-align: left;
  font-weight: 500;
  white-space: nowrap;
}
.flow-info-table tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #e8e8e8;
  color: #333;
}
.flow-info-table tbody tr:nth-child(even) { background: #fafafa; }
.flow-info-table tbody tr:hover { background: #f0f7ff; }

/* ===== 客户详情面板 ===== */
.customer-detail-panel {
  min-height: 300px;
}
.detail-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 16px;
}
.detail-tab {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 6px;
  user-select: none;
}
.detail-tab:hover {
  color: var(--text-primary);
}
.detail-tab.active {
  color: var(--primary);
}
.detail-tab.active::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 1px;
}
.detail-tab .tab-count {
  font-size: 10px;
  padding: 0 6px;
  border-radius: 8px;
  background: var(--gray-100);
  color: var(--text-muted);
}
.detail-tab.active .tab-count {
  background: var(--primary-50);
  color: var(--primary);
}
.detail-tab-content {
  max-height: 55vh;
  overflow-y: auto;
}
.detail-info-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.detail-info-item {
  padding: 10px 14px;
  background: var(--gray-25);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
}
.detail-info-item label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.detail-info-item span {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}
.compact-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}
.compact-table th {
  padding: 7px 10px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--gray-50);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 2;
}
.compact-table td {
  padding: 7px 10px;
  font-size: 12px;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.compact-table tbody tr:nth-child(even) td {
  background: #fafbfc;
}
.compact-table tbody tr:hover td {
  background: #eef6ff;
}
.compact-table a {
  color: var(--primary);
  text-decoration: none;
}
.compact-table a:hover {
  text-decoration: underline;
}
@media (max-width: 768px) {
  .detail-info-grid {
    grid-template-columns: 1fr;
  }
  /* 侧边栏收起为图标模式 */
  :root { --sidebar-w: 64px; }
  .sidebar-title, .user-details, .nav-item span { display: none !important; }
  .sidebar-brand { justify-content: center; padding: 0 0 !important; }
  .nav-item { justify-content: center; padding: 12px 0; }
  .sidebar-footer .user-info { justify-content: center; }
}

/* ≤1024px：小屏笔记本 —— 压缩内边距，提升信息密度 */
@media (max-width: 1024px) {
  .page-content { padding: 12px !important; }
  .card { padding: 12px !important; }
  .topbar-left { gap: 8px !important; }
  .search-box input { width: 160px !important; }
}

/* ≥1440px：大屏铺满，无额外限制 */

/* ≥1920px：超宽屏 —— 适当放大字体 */
@media (min-width: 1920px) {
  html { font-size: 15px; }
}

/* ===== 主题切换按钮 ===== */
.theme-toggle {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
  font-size: 16px;
}
.theme-toggle:hover {
  background: var(--gray-100);
  color: var(--primary);
}
[data-theme="dark"] .theme-toggle:hover {
  background: var(--gray-100);
  color: #fbbf24;
}

/* 暗色模式下的特殊样式适配 */
[data-theme="dark"] .sidebar {
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 100%);
  border-right-color: rgba(255,255,255,0.06);
}
[data-theme="dark"] .topbar {
  border-bottom-color: var(--border);
}
[data-theme="dark"] tr:nth-child(even) td {
  background: rgba(255,255,255,0.02);
}
[data-theme="dark"] tr:hover td {
  background: rgba(59,130,246,0.08);
}
[data-theme="dark"] .search-box {
  background: var(--gray-100);
  border-color: var(--border);
}
[data-theme="dark"] .login-left-brand {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 100%);
}
[data-theme="dark"] .table-wrap thead::after {
  background: linear-gradient(to bottom, rgba(255,255,255,0.02), transparent);
}
[data-theme="dark"] .btn-outline:hover {
  background: var(--gray-100);
}

/* ===== 骨架屏 ===== */
@keyframes shimmer {
  0%{background-position:-400px 0}100%{background-position:400px 0}
}
.skeleton{background:linear-gradient(90deg,var(--gray-100)25%,var(--gray-50)50%,var(--gray-100)75%);background-size:800px 100%;animation:shimmer 1.5s infinite;border-radius:4px}
.skeleton-card{padding:16px;border:1px solid var(--border);border-radius:8px;background:var(--card)}
.skeleton-card .sk-line{height:12px;margin-bottom:8px;background:var(--gray-100);border-radius:4px}
.sk-w80{width:80%}.sk-w60{width:60%}.sk-w40{width:40%}.sk-h32{height:32px;margin-top:12px}

/* ===== 增强空状态 ===== */
.empty-state i{font-size:48px;margin-bottom:16px;opacity:0.3;display:block}
.empty-state .empty-hint{font-size:12px;color:var(--text-muted);margin-bottom:16px}

/* ===== 表格Pill标签 ===== */
.badge-pill{display:inline-flex;align-items:center;padding:2px 10px;border-radius:999px;font-size:11px;font-weight:500;line-height:1.6;white-space:nowrap}
.badge-pill.pill-blue{background:#eff6ff;color:#1e40af}
.badge-pill.pill-green{background:#ecfdf5;color:#065f46}
.badge-pill.pill-orange{background:#fff7ed;color:#9a3412}
.badge-pill.pill-red{background:#fef2f2;color:#991b1b}
.badge-pill.pill-gray{background:#f1f5f9;color:#64748b}
.badge-pill.pill-violet{background:#f5f3ff;color:#5b21b6}

/* ===== 动画微交互 ===== */
.btn:active{transform:scale(0.97)}
.btn-icon:active{transform:scale(0.92)}
.btn{transition:all .15s ease}
tr{transition:background .12s ease,transform .12s ease}
tr:hover{transform:translateX(2px)}
.table-wrap table thead th{background:linear-gradient(180deg,#f0f4ff 0%,#f1f5f9 100%);color:#1e3a8a;font-weight:600}
@keyframes toastIn{from{opacity:0;transform:translateX(60px)}to{opacity:1;transform:translateX(0)}}
.toast{animation:toastIn .3s cubic-bezier(.16,1,.3,1)}
