/* ========================================
   客服小知工作台 - 样式表
   医知检医学检验平台
   ======================================== */

/* CSS 变量 */
:root {
  --primary: #2563eb;
  --primary-light: #3b82f6;
  --primary-dark: #1d4ed8;
  --primary-bg: #eff6ff;

  --finance: #ec4899;
  --finance-bg: #fdf2f8;
  --admin: #3b82f6;
  --admin-bg: #eff6ff;
  --hr: #8b5cf6;
  --hr-bg: #f5f3ff;
  --other: #f59e0b;
  --other-bg: #fffbeb;
  --kefu: #14b8a6;
  --kefu-bg: #f0fdfa;

  --status-pending: #f59e0b;
  --status-pending-bg: #fffbeb;
  --status-completed: #10b981;
  --status-completed-bg: #ecfdf5;
  --status-delayed: #ef4444;
  --status-delayed-bg: #fef2f2;
  --status-cancelled: #9ca3af;
  --status-cancelled-bg: #f3f4f6;

  --priority-high: #ef4444;
  --priority-medium: #f59e0b;
  --priority-low: #6b7280;

  --special: #06b6d4;
  --special-bg: #ecfeff;

  --bg: #f8fafc;
  --surface: #ffffff;
  --sidebar-bg: #1e293b;
  --sidebar-hover: #334155;
  --sidebar-active: #2563eb;
  --text: #1e293b;
  --text-secondary: #64748b;
  --text-light: #94a3b8;
  --border: #e2e8f0;
  --border-dark: #cbd5e1;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --sidebar-width: 240px;
  --sidebar-width-collapsed: 72px;
  --transition: 0.2s ease;
}

/* 全局重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

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

#app {
  display: flex;
  height: 100vh;
}

/* ========================================
   侧边栏
   ======================================== */
.sidebar {
  width: var(--sidebar-width);
  background: var(--sidebar-bg);
  color: #cbd5e1;
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: width 0.3s ease;
  z-index: 100;
  position: relative;
  overflow: hidden;
}

.sidebar-header {
  padding: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  min-height: 80px;
  display: flex;
  align-items: center;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.logo-img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.logo-text {
  overflow: hidden;
}

.logo-text h1 {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  white-space: nowrap;
}

.logo-text p {
  font-size: 12px;
  color: var(--text-light);
  white-space: nowrap;
}

.sidebar-collapse {
  position: absolute;
  top: 16px;
  right: 8px;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: all var(--transition);
  z-index: 10;
}

.sidebar-collapse:hover {
  background: rgba(255, 255, 255, 0.2);
}

body.sidebar-collapsed .sidebar {
  width: var(--sidebar-width-collapsed);
}

body.sidebar-collapsed .logo-text,
body.sidebar-collapsed .nav-label,
body.sidebar-collapsed .nav-badge,
body.sidebar-collapsed .user-info,
body.sidebar-collapsed .date-display {
  display: none;
}

body.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 10px;
}

body.sidebar-collapsed .nav-item .nav-badge {
  display: none;
}

body.sidebar-collapsed .sidebar-collapse {
  right: 50%;
  transform: translateX(50%);
}

body.sidebar-collapsed .sidebar-header {
  padding: 16px 8px;
  justify-content: center;
}

body.sidebar-collapsed .logo {
  justify-content: center;
}

body.sidebar-collapsed .logo-img {
  width: 36px;
  height: 36px;
}

body.sidebar-collapsed .user-card {
  justify-content: center;
}

body.sidebar-collapsed .sidebar-footer {
  padding: 12px 8px;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  overflow-y: auto;
}

.sidebar-nav::-webkit-scrollbar {
  width: 4px;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-xs);
  color: #cbd5e1;
  text-decoration: none;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  position: relative;
}

.nav-item:hover {
  background: var(--sidebar-hover);
  color: #fff;
}

.nav-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.nav-icon {
  font-size: 18px;
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-label {
  white-space: nowrap;
  overflow: hidden;
}

.nav-badge {
  margin-left: auto;
  background: var(--status-pending);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  min-width: 20px;
  text-align: center;
  flex-shrink: 0;
}

.nav-item.active .nav-badge {
  background: #fff;
  color: var(--sidebar-active);
}

.nav-badge-memo {
  background: var(--special);
}

.nav-divider {
  height: 1px;
  background: rgba(255, 255, 255, 0.1);
  margin: 12px 8px;
}

.sidebar-footer {
  padding: 12px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
}

.user-info {
  overflow: hidden;
}

.user-name {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.user-role {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.date-display {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
}

/* ========================================
   主内容区
   ======================================== */
.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
  gap: 16px;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
  color: var(--text);
}

.system-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.system-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.system-subtitle {
  font-size: 12px;
  color: var(--text-secondary);
  margin-top: 2px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-icon {
  position: absolute;
  left: 10px;
  font-size: 14px;
  color: var(--text-light);
}

.search-box input {
  padding: 8px 12px 8px 34px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  width: 220px;
  outline: none;
  transition: all var(--transition);
  background: var(--bg);
}

.search-box input:focus {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary {
  background: var(--border);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: var(--border-dark);
}

.btn-danger {
  background: var(--status-delayed);
  color: #fff;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover {
  background: var(--border);
}

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

.btn-icon {
  padding: 6px;
  border-radius: var(--radius-xs);
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.btn-icon:hover {
  background: var(--border);
  color: var(--text);
}

/* ========================================
   视图容器
   ======================================== */
.view-container {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
}

.view {
  display: none;
  animation: fadeIn 0.2s ease;
}

.view.active {
  display: block;
}

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

/* ========================================
   统计卡片
   ======================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 16px;
  transition: transform var(--transition);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}

.stat-icon.pending {
  background: var(--status-pending-bg);
}

.stat-icon.completed {
  background: var(--status-completed-bg);
}

.stat-icon.delayed {
  background: var(--status-delayed-bg);
}

.stat-icon.total {
  background: var(--primary-bg);
}

.stat-info h3 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

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

/* ========================================
   任务列表
   ======================================== */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
  flex-wrap: wrap;
}

.section-header h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.section-header .actions {
  display: flex;
  gap: 8px;
}

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.task-item {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  transition: all var(--transition);
  border-left: 4px solid transparent;
  position: relative;
  cursor: pointer;
}

.task-item:hover {
  box-shadow: var(--shadow-lg);
  transform: translateX(2px);
}

.task-item.priority-high {
  border-left-color: var(--priority-high);
}

.task-item.priority-medium {
  border-left-color: var(--priority-medium);
}

.task-item.priority-low {
  border-left-color: var(--priority-low);
}

.task-item.status-completed {
  opacity: 0.7;
}

.task-item.status-completed .task-name {
  text-decoration: line-through;
}

.task-item.status-delayed {
  background: var(--status-delayed-bg);
}

.task-item.status-cancelled {
  opacity: 0.5;
}

.task-item.status-cancelled .task-name {
  text-decoration: line-through;
}

/* 特殊任务样式 */
.task-item.is-special {
  border-left-color: var(--special);
  background: linear-gradient(to right, var(--special-bg) 0%, var(--surface) 30%);
}

.task-item.is-special.desc-expanded {
  background: var(--surface);
}

.tag-special {
  background: var(--special-bg);
  color: var(--special);
  border: 1px solid var(--special);
}

.tag-special-count {
  background: var(--special);
  color: #fff;
  font-weight: 700;
}

.tag-other {
  background: var(--other-bg);
  color: var(--other);
}

/* 完成按钮（显眼） */
.task-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.task-item:hover .task-actions {
  opacity: 1;
}

.btn-complete {
  padding: 8px 16px;
  background: var(--status-completed);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}

.btn-complete:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-complete.done {
  background: var(--status-completed-bg);
  color: var(--status-completed);
  border: 1px solid var(--status-completed);
  box-shadow: none;
  cursor: pointer;
}

.btn-complete.done:hover {
  background: var(--status-completed);
  color: #fff;
}

.btn-complete.cancelled {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
  border: 1px solid var(--status-cancelled);
  cursor: not-allowed;
  box-shadow: none;
}

/* 处理一次按钮 */
.btn-process {
  padding: 8px 14px;
  background: var(--special);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(6, 182, 212, 0.25);
}

.btn-process:hover {
  background: #0891b2;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(6, 182, 212, 0.3);
}

.task-content {
  flex: 1;
  min-width: 0;
}

.task-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: white-space 0.2s ease;
}

.task-item.desc-expanded .task-name {
  white-space: normal;
}

.task-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.task-name-row .task-name {
  flex: 1;
  min-width: 0;
}

.task-desc {
  display: none;
  margin-top: 8px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  border-left: 3px solid var(--primary);
  white-space: pre-wrap;
  word-break: break-word;
  animation: descExpand 0.2s ease;
}

.task-desc.expanded {
  display: block;
}

@keyframes descExpand {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 1000px;
  }
}

.task-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-time {
  font-size: 12px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
}

.task-time.urgent {
  color: var(--status-delayed);
  font-weight: 600;
}

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

.tag-finance {
  background: var(--finance-bg);
  color: var(--finance);
}

.tag-admin {
  background: var(--admin-bg);
  color: var(--admin);
}

.tag-hr {
  background: var(--hr-bg);
  color: var(--hr);
}

.tag-other {
  background: var(--other-bg);
  color: var(--other);
}

.tag-kefu {
  background: var(--kefu-bg);
  color: var(--kefu);
}

.tag-pending {
  background: var(--status-pending-bg);
  color: var(--status-pending);
}

.tag-completed {
  background: var(--status-completed-bg);
  color: var(--status-completed);
}

.tag-delayed {
  background: var(--status-delayed-bg);
  color: var(--status-delayed);
}

.tag-cancelled {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
}

.tag-priority-high {
  background: var(--status-delayed-bg);
  color: var(--priority-high);
}

.tag-priority-medium {
  background: var(--status-pending-bg);
  color: var(--priority-medium);
}

.tag-priority-low {
  background: var(--status-cancelled-bg);
  color: var(--priority-low);
}

.tag-delay-badge {
  background: var(--status-delayed);
  color: #fff;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

/* ========================================
   筛选器
   ======================================== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.filter-chip {
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-secondary);
  transition: all var(--transition);
}

.filter-chip:hover {
  border-color: var(--primary);
}

.filter-chip.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ========================================
   时间轴（每月任务）
   ======================================== */
.timeline {
  position: relative;
  padding-left: 80px;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 30px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: linear-gradient(to bottom, var(--primary) 0%, var(--primary-light) 100%);
}

.timeline-group {
  position: relative;
  margin-bottom: 20px;
}

.timeline-dot {
  position: absolute;
  left: -80px;
  top: 6px;
  width: 60px;
  height: 60px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  z-index: 2;
}

.timeline-dot span {
  font-size: 20px;
  line-height: 1;
}

.timeline-dot small {
  font-size: 11px;
  margin-top: 2px;
  opacity: 0.85;
}

.timeline-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
}

.empty-state h4 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.empty-state p {
  font-size: 13px;
}

/* ========================================
   模态框
   ======================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.15s ease;
}

.modal-overlay.active {
  display: flex;
}

.modal {
  background: var(--surface);
  border-radius: var(--radius);
  width: 520px;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideUp 0.2s ease;
}

.modal-sm {
  width: 400px;
}

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

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

.modal-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  transition: all var(--transition);
}

.modal-close:hover {
  background: var(--border);
}

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

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

/* ========================================
   表单
   ======================================== */
.form-group {
  margin-bottom: 16px;
}

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

.form-group .required {
  color: var(--status-delayed);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
  background: var(--surface);
  color: var(--text);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.form-group textarea {
  resize: vertical;
}

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

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

/* ========================================
   图表容器
   ======================================== */
.chart-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.chart-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.chart-card h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 16px;
}

.chart-wrapper {
  position: relative;
  height: 260px;
}

/* ========================================
   特殊任务统计
   ======================================== */
.special-stats-section {
  margin-bottom: 24px;
}

.month-select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.special-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.special-stat-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--special);
}

.special-stat-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--special);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* 卡片内联选择器 */
.ym-selector-inline {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ym-selector-inline select {
  padding: 4px 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 12px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: all var(--transition);
}

.ym-selector-inline select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary-bg);
}

.ym-selector-inline select:hover {
  border-color: var(--primary);
}

.special-stat-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.special-stat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--special-bg);
  border-radius: var(--radius-xs);
}

.special-stat-name {
  font-size: 12px;
  color: var(--text-secondary);
}

.special-stat-value {
  font-size: 14px;
  font-weight: 700;
  color: var(--special);
}

/* ========================================
   模板库
   ======================================== */
.template-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.template-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  transition: all var(--transition);
  cursor: pointer;
  border: 2px solid transparent;
}

.template-card:hover {
  box-shadow: var(--shadow-lg);
  border-color: var(--primary);
  transform: translateY(-2px);
}

.template-card .tpl-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.template-card .tpl-icon {
  font-size: 28px;
}

.template-card h4 {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 8px;
}

.template-card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}

.template-card .tpl-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ========================================
   工作日志
   ======================================== */
.log-entry {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 16px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.log-entry .log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.log-entry .log-date {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.log-entry .log-stats {
  font-size: 12px;
  color: var(--text-secondary);
}

.log-task-list {
  list-style: none;
  padding: 0;
}

.log-task-list li {
  padding: 6px 0;
  font-size: 13px;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px dashed var(--border);
}

.log-task-list li:last-child {
  border-bottom: none;
}

.log-task-list li .check {
  color: var(--status-completed);
  font-weight: 700;
}

.log-notes {
  margin-top: 10px;
  padding: 10px;
  background: var(--bg);
  border-radius: var(--radius-xs);
  font-size: 13px;
  color: var(--text-secondary);
}

/* ========================================
   历史记录
   ======================================== */
.history-timeline {
  position: relative;
  padding-left: 24px;
}

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

.history-item {
  position: relative;
  padding: 12px 16px;
  margin-bottom: 12px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}

.history-item::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 18px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--primary);
  border: 2px solid var(--surface);
}

.history-item .hist-time {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}

.history-item .hist-content {
  font-size: 13px;
  color: var(--text);
}

/* ========================================
   备忘录
   ======================================== */
.memo-intro {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding: 10px 14px;
  background: var(--special-bg);
  border-left: 3px solid var(--special);
  border-radius: var(--radius-xs);
}

.memo-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.memo-card {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  transition: all var(--transition);
}

.memo-card.priority-urgent {
  border-left-color: var(--status-delayed);
  background: linear-gradient(to right, var(--status-delayed-bg) 0%, var(--surface) 30%);
}

.memo-card.priority-important {
  border-left-color: var(--status-pending);
}

.memo-card.priority-normal {
  border-left-color: var(--primary-light);
}

.memo-card.completed {
  opacity: 0.6;
}

.memo-card.completed .memo-title {
  text-decoration: line-through;
  color: var(--text-light);
}

.memo-card.overdue {
  border-left-color: var(--status-delayed);
  background: linear-gradient(to right, var(--status-delayed-bg) 0%, var(--surface) 50%);
  animation: overduePulse 2s infinite;
}

@keyframes overduePulse {
  0%, 100% { box-shadow: var(--shadow); }
  50% { box-shadow: 0 0 0 4px var(--status-delayed-bg); }
}

.memo-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.memo-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.memo-priority-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
}

.priority-urgent .memo-priority-dot {
  background: var(--status-delayed);
}

.priority-important .memo-priority-dot {
  background: var(--status-pending);
}

.memo-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.memo-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.memo-card:hover .memo-actions {
  opacity: 1;
}

.memo-content {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 8px;
  white-space: pre-wrap;
  word-break: break-word;
}

.memo-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
  font-size: 12px;
  color: var(--text-light);
}

.memo-remind {
  color: var(--primary);
}

.memo-remind.urgent {
  color: var(--status-delayed);
  font-weight: 700;
}

.memo-time {
  color: var(--text-light);
}

/* ========================================
   Toast 通知
   ======================================== */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  background: var(--surface);
  border-radius: var(--radius-sm);
  padding: 12px 20px;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 500;
  min-width: 280px;
  animation: slideInRight 0.3s ease;
  border-left: 4px solid var(--primary);
}

.toast.success {
  border-left-color: var(--status-completed);
}

.toast.success .toast-icon {
  color: var(--status-completed);
}

.toast.error {
  border-left-color: var(--status-delayed);
}

.toast.error .toast-icon {
  color: var(--status-delayed);
}

.toast.warning {
  border-left-color: var(--status-pending);
}

.toast.warning .toast-icon {
  color: var(--status-pending);
}

.toast.info .toast-icon {
  color: var(--primary);
}

.toast-icon {
  font-size: 18px;
}

.toast.fade-out {
  animation: slideOutRight 0.3s ease forwards;
}

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

@keyframes slideOutRight {
  to {
    transform: translateX(120%);
    opacity: 0;
  }
}

/* ========================================
   提醒弹窗
   ======================================== */
.reminder-banner {
  background: linear-gradient(135deg, var(--status-pending), #f97316);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  font-weight: 600;
  animation: slideDown 0.3s ease;
}

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

.reminder-banner .reminder-close {
  margin-left: auto;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-xs);
  font-size: 14px;
}

/* ========================================
   响应式
   ======================================== */
@media (max-width: 1024px) {
  .chart-grid {
    grid-template-columns: 1fr;
  }

  .search-box input {
    width: 160px;
  }

  .timeline {
    padding-left: 70px;
  }

  .timeline-dot {
    width: 50px;
    height: 50px;
    left: -70px;
  }
}

@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100%;
    transform: translateX(-100%);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .menu-toggle {
    display: block;
  }

  .search-box {
    display: none;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  .topbar-right .btn span {
    display: none;
  }

  .timeline {
    padding-left: 60px;
  }

  .timeline-dot {
    width: 44px;
    height: 44px;
    left: -60px;
  }

  .timeline-dot span {
    font-size: 16px;
  }
}

@media (max-width: 480px) {
  .stats-grid {
    grid-template-columns: 1fr;
  }

  .view-container {
    padding: 16px;
  }

  .topbar {
    padding: 10px 16px;
  }

  .system-name {
    font-size: 16px;
  }
}

/* 滚动条美化 */
.view-container::-webkit-scrollbar {
  width: 6px;
}

/* ========================================
   登录界面
   ======================================== */
.login-screen {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #1e293b 0%, #2563eb 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.login-box {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 40px 36px;
  width: 380px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  animation: slideUp 0.4s ease;
}

.login-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: center;
  margin-bottom: 16px;
}

.login-logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #fff;
}

.login-title h1 {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  text-align: left;
  line-height: 1.3;
}

.login-title p {
  font-size: 12px;
  color: var(--text-secondary);
  text-align: left;
}

.login-avatar {
  margin-bottom: 24px;
}

.login-avatar img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--primary-bg);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.login-field {
  position: relative;
  display: flex;
  align-items: center;
}

.login-field-icon {
  position: absolute;
  left: 12px;
  font-size: 16px;
  color: var(--text-light);
  pointer-events: none;
}

.login-field input {
  width: 100%;
  padding: 12px 12px 12px 38px;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: all var(--transition);
}

.login-field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-bg);
}

.login-btn {
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all var(--transition);
  margin-top: 4px;
}

.login-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

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

.login-hint {
  font-size: 13px;
  color: var(--status-delayed);
  min-height: 20px;
}

/* 退出登录按钮 */
.btn-logout {
  width: 100%;
  padding: 8px;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-xs);
  color: #cbd5e1;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-logout:hover {
  background: var(--status-delayed);
  color: #fff;
  border-color: var(--status-delayed);
}

body.sidebar-collapsed .btn-logout {
  font-size: 0;
  padding: 8px;
}

body.sidebar-collapsed .btn-logout::before {
  content: "🔒";
  font-size: 16px;
}

/* ========================================
   操作日志表格
   ======================================== */
.oplog-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  background: var(--surface);
}

.oplog-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.oplog-table th {
  background: var(--bg);
  padding: 10px 14px;
  text-align: left;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.oplog-table td {
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: top;
}

.oplog-table tr:hover {
  background: var(--bg);
}

.oplog-table .col-time {
  white-space: nowrap;
  color: var(--text-secondary);
  font-size: 12px;
}

.oplog-table .col-action {
  white-space: nowrap;
  font-weight: 600;
}

/* 导出按钮 */
.btn-export {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: var(--status-completed);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.2);
}

.btn-export:hover {
  background: #059669;
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}

.btn-export.secondary {
  background: var(--primary);
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.2);
}

.btn-export.secondary:hover {
  background: var(--primary-dark);
}

/* 年月选择器 */
.ym-selector {
  display: flex;
  align-items: center;
  gap: 8px;
}

.ym-selector select {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  outline: none;
}

.ym-selector select:focus {
  border-color: var(--primary);
}

.view-container::-webkit-scrollbar-track {
  background: transparent;
}

.view-container::-webkit-scrollbar-thumb {
  background: var(--border-dark);
  border-radius: 3px;
}

.view-container::-webkit-scrollbar-thumb:hover {
  background: var(--text-light);
}