// 自定义主题
$primary-color: #1e40af; // 深蓝主色，传递可靠感
$primary-light: #3b82f6; // 浅蓝色，用于悬停效果
$secondary-color: #0d9488; // 薄荷绿，作为强调色
$success-color: #10b981; // 成功色
$warning-color: #f59e0b; // 警告色（浅橙）
$error-color: #ef4444; // 错误色
$info-color: #3b82f6; // 信息色
$text-primary: #1f2937; // 主要文本色
$text-secondary: #4b5563; // 次要文本色
$text-tertiary: #9ca3af; // 辅助文本色
$bg-primary: #ffffff; // 主背景色
$bg-secondary: #f9fafb; // 次要背景色
$bg-tertiary: #f3f4f6; // 辅助背景色
$border-color: #e5e7eb; // 边框色
$shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
$shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
$border-radius: 8px;
$transition: all 0.2s ease;

// 主容器样式
.attendance-container {
  padding: 24px;
  min-height: 100vh;
  background-color: $bg-secondary;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

// 页面标题
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid $border-color;

  h1 {
    font-size: 28px;
    font-weight: 700;
    color: $text-primary;
    margin: 0 0 8px 0;
  }

  .page-description {
    font-size: 16px;
    color: $text-secondary;
    margin: 0;
  }
}

// 时间维度切换栏
.time-dimension-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background-color: $bg-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  flex-wrap: wrap;
  gap: 16px;

  .date-navigation {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .nav-btn {
    color: $text-secondary;
    transition: $transition;

    &:hover {
      color: $primary-color;
      background-color: $bg-tertiary;
    }
  }

  .current-date {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 18px;
    font-weight: 600;
    color: $text-primary;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: $border-radius;
    transition: $transition;

    &:hover {
      background-color: $bg-tertiary;
    }

    .calendar-icon {
      font-size: 16px;
    }
  }

  .view-tabs {
    display: flex;
    align-items: center;
    background-color: $bg-tertiary;
    border-radius: $border-radius;
    padding: 4px;
  }

  .view-btn {
    padding: 8px 20px;
    border-radius: $border-radius;
    font-size: 14px;
    font-weight: 500;
    transition: $transition;

    &.active {
      background-color: $primary-color;
      color: white;
    }

    &:not(.active) {
      background-color: transparent;
      color: $text-secondary;

      &:hover {
        background-color: $bg-secondary;
        color: $text-primary;
      }
    }
  }

  .action-buttons {
    display: flex;
    align-items: center;
    gap: 12px;
  }

  .export-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background-color: $primary-color;
    color: white;
    border: none;
    border-radius: $border-radius;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: $transition;

    &:hover {
      background-color: $primary-light;
      transform: translateY(-1px);
      box-shadow: $shadow-md;
    }

    &:active {
      transform: translateY(0);
      box-shadow: $shadow-sm;
    }
  }
}

// 主内容区
.main-content {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 24px;
  align-items: start;
  min-height: 600px;
}

// 左侧：考勤日历
.calendar-section {
  background-color: $bg-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  padding: 20px;
  height: fit-content;
  position: sticky;
  top: 24px;
  grid-column: 1;
}

// 视图切换按钮
.view-toggle-buttons {
  display: flex;
  gap: 12px;
  margin-bottom: 24px;
  background-color: $bg-tertiary;
  border-radius: $border-radius;
  padding: 4px;
  
  .view-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: $border-radius;
    font-size: 14px;
    font-weight: 500;
    transition: $transition;
    border: none;
    cursor: pointer;
    
    &.active {
      background-color: $primary-color;
      color: white;
      box-shadow: $shadow-md;
    }
    
    &:not(.active) {
      background-color: transparent;
      color: $text-secondary;
      
      &:hover {
        background-color: $bg-secondary;
        color: $text-primary;
      }
    }
  }
}

// 右侧：统计图表和异常列表
.stats-section {
  background-color: $bg-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  padding: 20px;
  grid-column: 2;
  height: fit-content;
  position: sticky;
  top: 24px;
  max-height: 80vh;
  overflow-y: auto;
  
  // 统计卡片
  .stats-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 24px;
  }
  
  .stat-card {
    padding: 16px;
    border-radius: $border-radius;
    background-color: $bg-secondary;
    text-align: center;
    transition: $transition;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: $shadow-md;
    }
    
    .stat-value {
      font-size: 24px;
      font-weight: 700;
      color: $text-primary;
      margin-bottom: 4px;
    }
    
    .stat-label {
      font-size: 14px;
      color: $text-secondary;
    }
    
    .stat-rate {
      font-size: 12px;
      color: $success-color;
      margin-top: 4px;
    }
    
    &.warning {
      background-color: rgba($warning-color, 0.1);
      .stat-value { color: $warning-color; }
    }
    
    &.danger {
      background-color: rgba($error-color, 0.1);
      .stat-value { color: $error-color; }
    }
    
    &.info {
      background-color: rgba($info-color, 0.1);
      .stat-value { color: $info-color; }
    }
    
    &.primary {
      background-color: rgba($primary-color, 0.1);
      .stat-value { color: $primary-color; }
    }
  }
}

// 甘特图区域
.gantt-section {
  background-color: $bg-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  padding: 24px;
  margin-top: 24px;
  
  .gantt-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 16px;
    
    h2 {
      font-size: 20px;
      font-weight: 600;
      color: $text-primary;
      margin: 0;
    }
    
    .gantt-controls {
      display: flex;
      gap: 16px;
      align-items: center;
      flex-wrap: wrap;
      
      .gantt-mode-buttons,
      .gantt-scale-buttons {
        display: flex;
        gap: 4px;
        background-color: $bg-tertiary;
        border-radius: $border-radius;
        padding: 4px;
        
        .mode-btn,
        .scale-btn {
          padding: 8px 16px;
          border-radius: $border-radius;
          font-size: 14px;
          font-weight: 500;
          transition: $transition;
          border: none;
          cursor: pointer;
          
          &.active {
            background-color: $primary-color;
            color: white;
            box-shadow: $shadow-sm;
          }
          
          &:not(.active) {
            background-color: transparent;
            color: $text-secondary;
            
            &:hover {
              background-color: $bg-secondary;
              color: $text-primary;
            }
          }
        }
      }
      
      .department-select {
        padding: 8px 12px;
        border: 1px solid $border-color;
        border-radius: $border-radius;
        background-color: $bg-primary;
        color: $text-primary;
        font-size: 14px;
        cursor: pointer;
        transition: $transition;
        
        &:focus {
          outline: none;
          border-color: $primary-color;
          box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
        }
        
        &:hover {
          border-color: $primary-light;
        }
      }
    }
  }
  
  .gantt-chart {
    width: 100%;
    height: 600px;
    min-height: 500px;
    border-radius: $border-radius;
    background-color: $bg-primary;
    border: 1px solid $border-color;
    margin-bottom: 20px;
  }
  
  .gantt-legend {
    display: flex;
    gap: 24px;
    margin-bottom: 20px;
    padding: 16px;
    background-color: $bg-secondary;
    border-radius: $border-radius;
    flex-wrap: wrap;
    
    .legend-item {
      display: flex;
      align-items: center;
      gap: 8px;
      font-size: 14px;
      color: $text-secondary;
      
      .legend-color {
        width: 16px;
        height: 16px;
        border-radius: 4px;
        
        &.normal { background-color: #22c55e; }
        &.late { background-color: #f59e0b; }
        &.early { background-color: #f97316; }
        &.absent { background-color: #ef4444; }
        &.leave { background-color: #8b5cf6; }
        &.overtime { background-color: #06b6d4; }
      }
    }
  }
  
  .gantt-stats {
    display: flex;
    gap: 24px;
    padding: 16px;
    background-color: $bg-secondary;
    border-radius: $border-radius;
    flex-wrap: wrap;
    
    .stat-item {
      display: flex;
      gap: 8px;
      font-size: 14px;
      
      .stat-label {
        color: $text-secondary;
        font-weight: 500;
      }
      
      .stat-value {
        color: $text-primary;
        font-weight: 600;
      }
    }
  }
}

  .section-header {
    margin-bottom: 20px;

    h2 {
      font-size: 20px;
      font-weight: 600;
      color: $text-primary;
      margin: 0;
    }
  }

  .calendar-header {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 8px;

    .weekday {
      text-align: center;
      font-size: 14px;
      font-weight: 600;
      color: $text-secondary;
      padding: 8px;
    }
  }

  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 16px;
  }

  .calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border-radius: $border-radius;
    cursor: pointer;
    position: relative;
    transition: $transition;
    background-color: $bg-secondary;

    &.current-month {
      background-color: $bg-secondary;
    }

    &.other-month {
      opacity: 0.4;
    }

    &.today {
      border: 2px solid $primary-color;
      font-weight: 600;
    }

    &:hover {
      transform: scale(1.05);
      box-shadow: $shadow-md;
    }

    .day-number {
      font-size: 14px;
      color: $text-primary;
    }

    .attendance-indicator {
      width: 8px;
      height: 8px;
      border-radius: 50%;
      margin-top: 4px;
      transition: $transition;
    }

    &.normal .attendance-indicator {
      background-color: $success-color;
    }

    &.late .attendance-indicator {
      background-color: $warning-color;
    }

    &.early .attendance-indicator {
      background-color: $warning-color;
    }

    &.absent .attendance-indicator {
      background-color: $error-color;
    }

    &.leave .attendance-indicator {
      background-color: $info-color;
    }

    &.normal {
      background-color: color-mix(in srgb, $success-color 5%, $bg-secondary);
    }

    &.late {
      background-color: color-mix(in srgb, $warning-color 5%, $bg-secondary);
    }

    &.early {
      background-color: color-mix(in srgb, $warning-color 5%, $bg-secondary);
    }

    &.absent {
      background-color: color-mix(in srgb, $error-color 5%, $bg-secondary);
    }

    &.leave {
      background-color: color-mix(in srgb, $info-color 5%, $bg-secondary);
    }
  }

  .calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid $border-color;

    .legend-item {
      display: flex;
      align-items: center;
      gap: 6px;
      font-size: 12px;
      color: $text-secondary;

      .legend-dot {
        width: 8px;
        height: 8px;
        border-radius: 50%;
      }

      .legend-dot.normal {
        background-color: $success-color;
      }

      .legend-dot.late {
        background-color: $warning-color;
      }

      .legend-dot.early {
        background-color: $warning-color;
      }

      .legend-dot.absent {
        background-color: $error-color;
      }

      .legend-dot.leave {
        background-color: $info-color;
      }
    }
  }

// 右侧：统计图表和异常列表
.stats-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

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

  .stat-card {
    background-color: $bg-primary;
    border-radius: $border-radius;
    box-shadow: $shadow-sm;
    padding: 20px;
    text-align: center;
    transition: $transition;
    position: relative;
    overflow: hidden;

    &:hover {
      transform: translateY(-2px);
      box-shadow: $shadow-md;
    }

    .stat-value {
      font-size: 28px;
      font-weight: 700;
      color: $text-primary;
      margin-bottom: 4px;
    }

    .stat-label {
      font-size: 14px;
      color: $text-secondary;
      margin-bottom: 8px;
    }

    .stat-rate {
      font-size: 16px;
      font-weight: 600;
      color: $success-color;
    }

    .stat-sub {
      font-size: 12px;
      color: $text-tertiary;
    }

    &.primary {
      border-top: 3px solid $primary-color;
    }

    &.warning {
      border-top: 3px solid $warning-color;
    }

    &.danger {
      border-top: 3px solid $error-color;
    }

    &.info {
      border-top: 3px solid $info-color;
    }
  }
}

// 部门考勤对比
.department-comparison {
  background-color: $bg-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  padding: 20px;
  margin-bottom: 24px;

  .section-header {
    margin-bottom: 20px;

    h2 {
      font-size: 20px;
      font-weight: 600;
      color: $text-primary;
      margin: 0;
    }
  }

  .department-chart {
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .dept-bar-container {
    display: flex;
    align-items: center;
    gap: 16px;
    transition: $transition;

    &:hover {
      transform: translateX(4px);
    }

    .dept-info {
      display: flex;
      flex-direction: column;
      min-width: 120px;

      .dept-name {
        font-size: 14px;
        font-weight: 500;
        color: $text-primary;
      }

      .dept-rate {
        font-size: 18px;
        font-weight: 700;
        color: $primary-color;
      }
    }

    .progress-bar {
      flex: 1;
      height: 12px;
      background-color: $bg-tertiary;
      border-radius: 6px;
      overflow: hidden;
      position: relative;
    }

    .progress-fill {
      height: 100%;
      background-color: $primary-color;
      border-radius: 6px;
      transition: width 1s ease-in-out;
      position: relative;
      overflow: hidden;

      &::after {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
        animation: progressAnimation 1.5s infinite;
      }
    }

    .dept-stats {
      font-size: 12px;
      color: $text-tertiary;
      min-width: 100px;
      text-align: right;
    }
  }
}

// 异常考勤列表
.exceptions-section {
  background-color: $bg-primary;
  border-radius: $border-radius;
  box-shadow: $shadow-sm;
  padding: 20px;

  .section-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;

    h2 {
      font-size: 20px;
      font-weight: 600;
      color: $text-primary;
      margin: 0;
    }

    .exception-count {
      font-size: 14px;
      color: $text-tertiary;
      background-color: $bg-tertiary;
      padding: 2px 8px;
      border-radius: 12px;
    }
  }

  .exceptions-table {
    overflow-x: auto;
  }

  .exception-table {
    width: 100%;
    min-width: 600px;

    .mat-header-row {
      background-color: $bg-tertiary;
      font-weight: 600;
      color: $text-primary;

      .mat-header-cell {
        padding: 12px;
        font-size: 14px;
        color: $text-primary;
        font-weight: 600;
        border-bottom: 1px solid $border-color;
      }
    }

    .mat-row {
      transition: $transition;
      cursor: pointer;

      &:hover {
        background-color: color-mix(in srgb, $primary-color 2%, transparent);
      }

      .mat-cell {
        padding: 12px;
        font-size: 14px;
        color: $text-secondary;
        border-bottom: 1px solid $border-color;
        vertical-align: middle;
      }

      &:last-child .mat-cell {
        border-bottom: none;
      }
    }

    .status-badge {
      padding: 2px 8px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 500;
      display: inline-block;
    }

    .status-normal {
      background-color: color-mix(in srgb, $success-color 15%, transparent);
      color: $success-color;
    }

    .status-late {
      background-color: color-mix(in srgb, $warning-color 15%, transparent);
      color: $warning-color;
    }

    .status-early {
      background-color: color-mix(in srgb, $warning-color 15%, transparent);
      color: $warning-color;
    }

    .status-absent {
      background-color: color-mix(in srgb, $error-color 15%, transparent);
      color: $error-color;
    }

    .status-leave {
      background-color: color-mix(in srgb, $info-color 15%, transparent);
      color: $info-color;
    }

    .fix-btn {
      padding: 6px 12px;
      font-size: 12px;
      transition: $transition;

      &:hover {
        transform: scale(1.05);
      }
    }

    .no-data {
      text-align: center;
      padding: 40px 20px;
      color: $text-tertiary;
      font-style: italic;
    }
  }
}

// 动画定义
@keyframes progressAnimation {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

// 响应式设计
@media (max-width: 1200px) {
  .attendance-container {
    padding: 16px;
  }

  .main-content {
    grid-template-columns: 1fr;
  }

  .calendar-section {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  .attendance-container {
    padding: 12px;
  }

  .page-header {
    text-align: center;
  }

  .time-dimension-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;

    .date-navigation, .view-tabs, .action-buttons {
      justify-content: center;
    }
  }

  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .calendar-section {
    position: static;
  }
}

/* 修复Material图标字体和奇怪字符问题 */
mat-icon {
  font-family: 'Material Icons' !important;
  font-feature-settings: 'liga' 1;
  -webkit-font-feature-settings: 'liga';
  -moz-font-feature-settings: 'liga';
  font-variant-ligatures: common-ligatures;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: inherit;
  line-height: inherit;
  vertical-align: middle;
  
  &::before {
    content: none !important;
  }
}

/* 统一按钮图标与文字对齐 */
.export-btn, .fix-btn, .nav-btn {
  mat-icon {
    font-size: 18px !important;
    width: 18px !important;
    height: 18px !important;
    line-height: 18px !important;
    vertical-align: middle;
    margin-right: 4px;
  }
}

/* 日历图标特殊处理 */
.calendar-icon {
  font-size: 16px !important;
  width: 16px !important;
  height: 16px !important;
  line-height: 16px !important;
}

/* 卡片美化 */
.calendar-section, .stats-section {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
  }
}

/* 统计卡片优化 */
.stat-card {
  background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, $primary-color, $secondary-color);
  }
  
  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 20px -5px rgba(0, 0, 0, 0.15);
  }
  
  &.warning::before {
    background: linear-gradient(90deg, $warning-color, #fbbf24);
  }
  
  &.danger::before {
    background: linear-gradient(90deg, $error-color, #f87171);
  }
  
  &.info::before {
    background: linear-gradient(90deg, $info-color, #60a5fa);
  }
  
  &.primary::before {
    background: linear-gradient(90deg, $primary-color, $primary-light);
  }
  
  .stat-value {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    background: linear-gradient(135deg, $text-primary, $text-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .stat-label {
    font-size: 14px;
    color: $text-secondary;
    font-weight: 500;
    margin-bottom: 4px;
  }
  
  .stat-rate, .stat-sub {
    font-size: 12px;
    color: $text-tertiary;
    font-weight: 400;
  }
}

/* 表格优化 */
.exception-table {
  width: 100%;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  
  .mat-header-cell {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    color: $text-primary;
    font-weight: 600;
    font-size: 14px;
    border-bottom: 2px solid $border-color;
    padding: 16px 12px;
  }
  
  .mat-cell {
    padding: 16px 12px;
    font-size: 14px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
    
    &:last-child {
      text-align: center;
    }
  }
  
  .mat-row {
    transition: all 0.2s ease;
    
    &:hover {
      background-color: rgba(59, 130, 246, 0.05);
    }
  }
  
  .no-data {
    text-align: center;
    color: $text-tertiary;
    font-style: italic;
    padding: 40px 20px;
  }
}

/* 状态徽章优化 */
.status-badge {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  
  &.normal {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(16, 185, 129, 0.2));
    color: $success-color;
    border: 1px solid rgba(16, 185, 129, 0.3);
  }
  
  &.late, &.early {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1), rgba(245, 158, 11, 0.2));
    color: $warning-color;
    border: 1px solid rgba(245, 158, 11, 0.3);
  }
  
  &.absent {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.1), rgba(239, 68, 68, 0.2));
    color: $error-color;
    border: 1px solid rgba(239, 68, 68, 0.3);
  }
  
  &.leave {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(59, 130, 246, 0.2));
    color: $info-color;
    border: 1px solid rgba(59, 130, 246, 0.3);
  }
}

/* 部门对比图表优化 */
.department-comparison {
  margin-top: 24px;
  
  .dept-bar-container {
    margin-bottom: 16px;
    padding: 16px;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 8px;
    border: 1px solid rgba(226, 232, 240, 0.8);
    transition: all 0.3s ease;
    
    &:hover {
      transform: translateX(4px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
  }
  
  .dept-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    
    .dept-name {
      font-weight: 600;
      color: $text-primary;
    }
    
    .dept-rate {
      font-weight: 700;
      color: $primary-color;
    }
  }
  
  .progress-bar {
    height: 8px;
    background-color: rgba(226, 232, 240, 0.5);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 8px;
    
    .progress-fill {
      height: 100%;
      background: linear-gradient(90deg, $primary-color, $secondary-color);
      border-radius: 4px;
      transition: width 0.6s ease;
    }
  }
  
  .dept-stats {
    font-size: 12px;
    color: $text-tertiary;
  }
}

/* 日历优化 */
.calendar-day {
  &:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1;
  }
  
  &.today {
    border: 2px solid $primary-color;
    box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.1);
  }
}

/* 图例优化 */
.calendar-legend {
  .legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all 0.2s ease;
    
    &:hover {
      background-color: rgba(59, 130, 246, 0.05);
    }
    
    .legend-dot {
      width: 12px;
      height: 12px;
      border-radius: 50%;
      box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    }
    
    span {
      font-size: 13px;
      font-weight: 500;
      color: $text-secondary;
    }
  }
}

/* 响应式优化 */
@media (min-width: 1024px) {
  .main-content {
    grid-template-columns: 400px 1fr;
  }
}

@media (max-width: 768px) {
  .time-dimension-bar {
    flex-direction: column;
    align-items: stretch;
    
    .date-navigation, .view-tabs, .action-buttons {
      justify-content: center;
    }
  }
  
  .stats-cards {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .calendar-section {
    position: static;
  }
}