@use "sass:color";

/* 颜色变量 */
$primary-color: #007aff;
$primary-dark: #0051a8;
$success-color: #34c759;
$warning-color: #ff9500;
$danger-color: #ff3b30;
$info-color: #5ac8fa;
$text-primary-dark: #1c1c1e;
$text-secondary-dark: #636366;
$text-tertiary-dark: #8e8e93;
$border-color: #e5e5ea;
$background-color: #f2f2f7;
$card-background: #ffffff;
$shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
$shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
$shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
$border-radius: 12px;
$transition: all 0.2s ease;

/* iOS设计风格颜色变量 */
$ios-primary: #007aff;
$ios-primary-dark: #0051a8;
$ios-secondary: #5856d6;
$ios-success: #34c759;
$ios-warning: #ff9500;
$ios-danger: #ff3b30;
$ios-background: #f2f2f7;
$ios-card-background: #ffffff;
$ios-border: #e5e5ea;
$ios-text: #1c1c1e;
$ios-text-secondary: #636366;
$ios-text-tertiary: #8e8e93;
$ios-button-background: #f2f2f7;

/* iOS设计风格圆角变量 */
$ios-radius-sm: 8px;
$ios-radius-md: 12px;
$ios-radius-lg: 16px;
$ios-radius-xl: 22px;

/* 企业微信提示动画 */
@keyframes slideInRight {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

/* 新增：待跟进尾款项目列表样式 */
.pending-final-payment-section {
  background: $card-background;
  border-radius: $border-radius;
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: $shadow-sm;
  border: 1px solid $border-color;

  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;

    h3 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
      color: $text-primary-dark;
    }

    .section-stats {
      display: flex;
      align-items: center;
      gap: 8px;

      .stat-badge {
        background: $danger-color;
        color: white;
        padding: 4px 8px;
        border-radius: 12px;
        font-size: 12px;
        font-weight: 600;
        min-width: 20px;
        text-align: center;

        &.urgent {
          background: $danger-color;
          animation: pulse 2s infinite;
        }
      }

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

  .final-payment-list {
    display: flex;
    flex-direction: column;
    gap: 16px;

    .empty-state {
      text-align: center;
      padding: 40px 20px;
      color: $text-tertiary-dark;

      svg {
        margin-bottom: 16px;
        opacity: 0.5;
      }

      p {
        margin: 0;
        font-size: 14px;
      }
    }

    .final-payment-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px;
      border: 1px solid $border-color;
      border-radius: $ios-radius-md;
      background: $ios-card-background;
      transition: $transition;

      &:hover {
        box-shadow: $shadow-md;
        border-color: $primary-color;
      }

      .project-info {
        flex: 1;

        .project-header {
          display: flex;
          justify-content: space-between;
          align-items: center;
          margin-bottom: 8px;

          .project-name {
            margin: 0;
            font-size: 16px;
            font-weight: 600;
            color: $text-primary-dark;
          }

          .payment-amount {
            font-size: 18px;
            font-weight: 700;
            color: $danger-color;
          }
        }

        .customer-info {
          .customer-details {
            display: flex;
            gap: 16px;
            margin-bottom: 8px;

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

            .customer-phone {
              font-size: 14px;
              color: $text-secondary-dark;
            }
          }

          .project-meta {
            display: flex;
            justify-content: space-between;
            align-items: center;

            .notification-time {
              font-size: 12px;
              color: $text-tertiary-dark;
            }

            .status-badge {
              padding: 4px 8px;
              border-radius: 8px;
              font-size: 12px;
              font-weight: 500;

              &.pending_followup {
                background: rgba($warning-color, 0.1);
                color: $warning-color;
              }

              &.following_up {
                background: rgba($info-color, 0.1);
                color: $info-color;
              }

              &.payment_completed {
                background: rgba($success-color, 0.1);
                color: $success-color;
              }
            }
          }
        }
      }

      .payment-actions {
        display: flex;
        gap: 8px;
        margin-left: 16px;

        .btn-primary, .btn-success {
          &.mini {
            padding: 6px 12px;
            font-size: 12px;
            border-radius: 6px;
            white-space: nowrap;
          }
        }

        .btn-primary {
          background: $primary-color;
          color: white;
          border: none;
          cursor: pointer;
          transition: $transition;

          &:hover:not(:disabled) {
            background: $primary-dark;
          }

          &:disabled {
            background: $text-tertiary-dark;
            cursor: not-allowed;
          }
        }

        .btn-success {
          background: $success-color;
          color: white;
          border: none;
          cursor: pointer;
          transition: $transition;

          &:hover:not(:disabled) {
            background: color.adjust($success-color, $lightness: -10%);
          }

          &:disabled {
            background: $text-tertiary-dark;
            cursor: not-allowed;
          }
        }
      }
    }
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

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

/* 企业微信提示样式 */
.wechat-work-tip {
  .tip-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .tip-icon {
    font-size: 20px;
    text-align: center;
  }
  
  .tip-text {
    font-weight: 600;
    line-height: 1.4;
  }
  
  .tip-subtext {
    font-size: 12px;
    opacity: 0.9;
    line-height: 1.3;
  }
}

/* iOS风格的模态框覆盖层 */
.ios-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s ease;
}

/* iOS风格的面板 */
.ios-panel {
  background-color: $ios-card-background;
  border-radius: $ios-radius-xl;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  box-shadow: 0 10px 50px rgba(0, 0, 0, 0.3);
  transform: scale(0.95);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.ios-panel.ios-panel-visible {
  transform: scale(1);
  opacity: 1;
}

/* iOS面板头部 */
.ios-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid $ios-border;
}

.ios-panel-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: $ios-text;
  margin: 0;
}

.ios-close-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: $ios-text-secondary;
  transition: color 0.2s ease;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ios-close-button:hover {
  color: $ios-text;
  background-color: $ios-button-background;
}

/* iOS面板内容 */
.ios-panel-content {
  padding: 20px;
  overflow-y: auto;
  max-height: 60vh;
}

/* 表单样式 */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: $ios-text-secondary;
  margin-bottom: 8px;
}

/* iOS风格的表单输入框 */
.ios-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid $border-color;
  border-radius: 8px;
  font-size: 16px;
  background-color: white;
  transition: all 0.3s ease;
  outline: none;
  color: $ios-text;

  &:focus {
    border-color: $primary-color;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.2);
  }

  &::placeholder {
    color: $ios-text-secondary;
  }
}

/* 截止时间显示区域 */
.deadline-display {
  position: relative;
  cursor: pointer;
  padding-right: 30px !important;

  .dropdown-arrow {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.3s ease;
    color: $ios-text-secondary;
  }

  .dropdown-arrow.rotate {
    transform: translateY(-50%) rotate(180deg);
  }
}

/* 下拉选择框 */
.deadline-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 5px;
  background-color: white;
  border: 1px solid $border-color;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.deadline-dropdown.visible {
  opacity: 1;
  visibility: visible;
}

/* 下拉选项 */
.dropdown-option {
  padding: 12px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  color: $ios-text;

  &:hover {
    background-color: #f2f2f7;
  }

  &.selected {
    background-color: rgba(0, 122, 255, 0.1);
    color: $primary-color;
    font-weight: 500;
  }

  &.custom-option {
    color: $primary-color;
    font-weight: 500;
  }
}

/* 分隔线 */
.dropdown-divider {
  height: 1px;
  background-color: $border-color;
  margin: 4px 0;
}

/* 错误提示信息 */
.error-message {
  color: #ff3b30;
  font-size: 14px;
  margin-top: 5px;
  padding: 4px 0;
}

/* 自定义时间弹窗 */
.custom-time-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}

.custom-time-modal.modal-visible {
  opacity: 1;
  visibility: visible;
}

/* 弹窗背景 */
.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
}

/* 弹窗内容 */
.modal-content {
  position: relative;
  background-color: white;
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}

.custom-time-modal.modal-visible .modal-content {
  transform: translateY(0);
}

/* 弹窗头部 */
.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid $border-color;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
  color: $ios-text;
}

/* 关闭按钮 */
.close-button {
  background: none;
  border: none;
  font-size: 24px;
  color: $ios-text-secondary;
  cursor: pointer;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 15px;
  transition: all 0.2s ease;

  &:hover {
    background-color: #f2f2f7;
    color: $ios-text;
  }
}

/* 弹窗主体 */
.modal-body {
  padding: 20px;
}

/* 日期选择器 */
.date-picker,
.time-picker {
  margin-bottom: 16px;
}

.date-picker label,
.time-picker label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
  color: $ios-text;
}

/* 弹窗底部 */
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid $border-color;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* 按钮样式 */
.cancel-button,
.confirm-button {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cancel-button {
  background-color: #f2f2f7;
  color: $ios-text;
  border: none;
}

.confirm-button {
  background-color: $primary-color;
  color: white;
  border: none;
}

.cancel-button:hover {
  background-color: #e5e5ea;
}

.confirm-button:hover {
  background-color: #0066cc;
}

/* iOS面板底部 */
.ios-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 20px;
  border-top: 1px solid $ios-border;
  background-color: $ios-background;
}

/* iOS风格按钮 */
.ios-cancel-button,
.ios-submit-button {
  padding: 10px 20px;
  border: none;
  border-radius: $ios-radius-md;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  min-width: 80px;
}

.ios-cancel-button {
  background-color: $ios-button-background;
  color: $ios-text;
}

.ios-cancel-button:hover {
  background-color: color-mix(in srgb, $ios-button-background 80%, $ios-border 20%);
}

.ios-submit-button {
  background-color: $ios-primary;
  color: white;
}

.ios-submit-button:hover {
  background-color: $ios-primary-dark;
}

/* 动画 */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .ios-panel {
    width: 95%;
    margin: 20px;
  }
}

/* 数据看板 - iOS风格 */
.stats-dashboard {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.95));
  border-radius: 24px;
  padding: 28px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  margin-bottom: 24px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.stats-dashboard:hover {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.stats-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.stats-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: $text-primary-dark;
  margin: 0;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 20px;
}

/* 统计卡片 - iOS风格 */
.stat-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 248, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 20px;
  padding: 24px;
  text-align: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  backdrop-filter: blur(10px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.stat-card:hover {
  border-color: rgba($primary-color, 0.3);
  box-shadow: 
    0 8px 32px rgba($primary-color, 0.15),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-4px);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 252, 252, 0.95));
}

.stat-icon {
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, rgba($primary-color, 0.1), rgba($primary-color, 0.15));
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: $primary-color;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
  border: 1px solid rgba($primary-color, 0.1);
}

.stat-card:nth-child(2) .stat-icon {
  background: linear-gradient(135deg, rgba($success-color, 0.1), rgba($success-color, 0.15));
  color: $success-color;
  border: 1px solid rgba($success-color, 0.1);
}

.stat-card:nth-child(3) .stat-icon {
  background: linear-gradient(135deg, rgba($warning-color, 0.1), rgba($warning-color, 0.15));
  color: $warning-color;
  border: 1px solid rgba($warning-color, 0.1);
}

.stat-card:nth-child(4) .stat-icon {
  background: linear-gradient(135deg, rgba($danger-color, 0.1), rgba($danger-color, 0.15));
  color: $danger-color;
  border: 1px solid rgba($danger-color, 0.1);
}

.stat-number {
  font-size: 28px;
  font-weight: 700;
  color: $text-primary-dark;
  margin-bottom: 8px;
  line-height: 1.2;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, $text-primary-dark, #b8a99a);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.stat-label {
  font-size: 15px;
  color: $text-secondary-dark;
  margin: 0;
  font-weight: 500;
  letter-spacing: -0.2px;
}

/* 内容网格 */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 16px;
}

/* 任务列表区块 - iOS风格 */
.tasks-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.95));
  border-radius: 24px;
  padding: 28px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.tasks-section:hover {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

/* 通用区块头部 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: $text-primary-dark;
  margin: 0;
}

.section-header .view-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: $primary-color;
  text-decoration: none;
  transition: $transition;
}

.section-header .view-all:hover {
  color: $primary-dark;
}

/* 搜索框样式 */
.search-box {
  position: relative;
}

.search-input {
  padding: 8px 16px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  color: $text-primary-dark;
  background-color: $card-background;
  transition: $transition;
  outline: none;
  min-width: 200px;
}

.search-input:focus {
  border-color: $primary-color;
  box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 10%, transparent);
}

/* 紧急待办列表 */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tasks-list.empty {
  text-align: center;
  padding: 40px 20px;
  color: $text-tertiary-dark;
}

.tasks-list.empty p {
  font-size: 16px;
  margin: 0;
}

/* 任务项目样式 - iOS风格 */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-radius: 16px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  margin-bottom: 12px;
  position: relative;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 248, 0.9));
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.task-item.completed {
  background-color: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.task-item.overdue {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
}

.task-item:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 252, 252, 0.95));
  border-color: rgba(0, 0, 0, 0.1);
}

/* 任务复选框样式 */
.task-checkbox {
  margin-right: 16px;
}

.task-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: $primary-color;
  border-radius: 4px;
  cursor: pointer;
}

/* 任务状态标记 */
.task-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.task-status.overdue {
  background-color: color-mix(in srgb, $danger-color 15%, transparent);
  color: $danger-color;
}

/* 任务内容 */
.task-content {
  flex: 1;
}

.task-title {
  font-size: 18px;
  font-weight: 600;
  color: $text-primary-dark;
  margin-bottom: 4px;
  line-height: 1.3;
}

.task-project {
  font-size: 14px;
  color: $text-secondary-dark;
  margin-bottom: 8px;
}

.task-meta {
  font-size: 14px;
  color: $text-tertiary-dark;
}

/* 任务进度 */
.task-progress {
  width: 100%;
  height: 8px;
  background-color: $background-color;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, $primary-color, #5e9eff);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
  }

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-text {
  font-size: 12px;
  color: $text-tertiary-dark;
  text-align: right;
  margin-top: 4px;
  font-weight: 500;
}

/* 任务处理进度条容器 */
.task-progress-container {
  width: 100%;
  height: 12px;
  background-color: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, $primary-color 0%, #5e9eff 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  border-radius: 6px;
}

.task-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.5s infinite;
}

.task-progress-text {
  font-size: 10px;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* 任务操作按钮 */
.task-actions {
  display: flex;
  align-items: center;
}

.task-button {
  padding: 6px 12px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: $transition;
  background-color: $card-background;
  color: $text-secondary-dark;
  min-width: 60px;
  text-align: center;
}

.task-button:hover {
  border-color: $primary-color;
  color: $primary-color;
}

.task-button.primary {
  background-color: $primary-color;
  color: white;
  border-color: $primary-color;
}

.task-button.primary:hover {
  background-color: $primary-dark;
  border-color: $primary-dark;
  color: white;
}

.task-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 搜索框样式 */
.search-box {
  position: relative;
}

.search-input {
  padding: 8px 16px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  color: $text-primary-dark;
  background-color: $card-background;
  transition: $transition;
  outline: none;
  min-width: 200px;
}

.search-input:focus {
  border-color: $primary-color;
  box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 10%, transparent);
}

/* 项目动态流 - iOS风格 */
.project-updates-section {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.95));
  border-radius: 24px;
  padding: 28px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.project-updates-section:hover {
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transform: translateY(-2px);
}

.project-updates-section.empty {
  text-align: center;
  padding: 60px 20px;
  color: $text-tertiary-dark;
}

.project-updates-section.empty p {
  font-size: 16px;
  margin: 0;
}

.project-updates-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.update-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  transition: $transition;
  
  &:hover {
    border-color: $primary-color;
    box-shadow: 0 4px 12px color-mix(in srgb, $primary-color 10%, transparent);
    transform: translateY(-2px);
  }
  
  .update-icon {
    width: 44px;
    height: 44px;
    background-color: $primary-color;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    transition: $transition;
  }
  
  .update-content {
    flex: 1;
    
    .update-title {
      font-size: 18px;
      font-weight: 600;
      color: $text-primary-dark;
      margin-bottom: 6px;
      line-height: 1.3;
    }
    
    .update-text {
      font-size: 16px;
      color: $text-secondary-dark;
      margin-bottom: 12px;
      line-height: 1.4;
    }
    
    .update-meta {
      display: flex;
      align-items: center;
      gap: 20px;
      
      .update-time {
        font-size: 14px;
        color: $text-tertiary-dark;
      }
      
      .update-status {
        padding: 4px 12px;
        border-radius: 16px;
        font-size: 14px;
        font-weight: 600;
        transition: $transition;
        
        &.status-active,
        &.status-info {
          background-color: #e3f2fd;
          color: $primary-color;
          border: 1px solid #bbdefb;
        }
        
        &.status-completed,
        &.status-success {
          background-color: #e8f5e9;
          color: $success-color;
          border: 1px solid #c8e6c9;
        }
        
        &.status-warning {
          background-color: #fff3e0;
          color: $warning-color;
          border: 1px solid #ffe0b2;
        }
        
        &.status-danger {
          background-color: #ffebee;
          color: $danger-color;
          border: 1px solid #ffcdd2;
        }
      }
    }
  }
}
  
  .stats-dashboard .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

/* 欢迎区域 - iOS风格 */
.welcome-section {
  background: linear-gradient(135deg, #c7d3d9, #d4c5b9);
  color: #4a5568;
  padding: 28px 36px;
  border-radius: 24px;
  margin-bottom: 24px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.welcome-section h2 {
  font-size: 26px;
  font-weight: 700;
  margin: 0 0 8px 0;
  letter-spacing: -0.5px;
  color: #2d3748;
}

.welcome-section p {
  font-size: 15px;
  opacity: 0.8;
  margin: 0;
  font-weight: 500;
  color: #4a5568;
}

@media (max-width: 768px) {
  .welcome-section {
    margin-bottom: 16px;
    
    h2 {
      font-size: 20px;
    }
  }
  
  .stats-dashboard {
    margin-bottom: 16px;
    
    .stats-grid {
      grid-template-columns: 1fr;
      gap: 12px;
    }
    
    .stat-card {
      padding: 16px;
    }
    
    .stat-number {
      font-size: 20px;
    }
    
    .stat-icon {
      width: 40px;
      height: 40px;
    }
  }
  
  .tasks-section,
  .project-updates-section {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .task-item,
  .update-item {
    padding: 16px;
  }
  
  .task-actions {
    flex-wrap: wrap;
  }
  
  .task-button {
    font-size: 12px;
    padding: 4px 8px;
  }
}

@media (max-width: 480px) {
  .task-item {
    flex-direction: column;
    align-items: flex-start;
    
    .task-actions {
      margin-top: 12px;
      align-self: flex-end;
    }
  }
  
  .update-item {
    .update-icon {
      width: 32px;
      height: 32px;
    }
  }
}

/* ========== iOS风格新增样式 ========== */
.ios-page-transition {
  overflow: hidden;
  
  .stat-card {
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.4s ease;
    transform: translateY(20px);
    opacity: 0;
  }
}

.stat-card {
  &:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }
  
  perspective: 1000px;
  
  .stat-content {
    transform-style: preserve-3d;
    transition: transform 0.5s ease;
    
    &:hover {
      transform: translateZ(10px);
    }
  }
}

.stat-icon {
  position: relative;
  overflow: hidden;
  
  &::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
  }
}

/* 莫兰迪色系变量 */
$morandi-cream: #f5f1eb;
$morandi-sage: #a8b5a0;
$morandi-blush: #e8d5d2;
$morandi-stone: #d4c5b9;
$morandi-mist: #c7d3d9;
$morandi-dust: #b8a99a;

/* iOS风格卡片 - 莫兰迪色系 */
.ios-card {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 248, 0.9));
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 20px;
  box-shadow: 
    0 8px 32px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  
  &:hover {
    transform: translateY(-4px);
    box-shadow: 
      0 12px 40px rgba(0, 0, 0, 0.15),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
  
  &:active {
    transform: translateY(-1px);
    box-shadow: 
      0 4px 20px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.6);
  }
}

/* iOS风格按钮 */
.ios-btn {
  background: linear-gradient(135deg, $primary-color, $primary-dark);
  border: none;
  border-radius: 16px;
  color: white;
  font-weight: 600;
  font-size: 16px;
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 
    0 4px 12px rgba($primary-color, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
  
  &:hover {
    transform: translateY(-2px);
    box-shadow: 
      0 6px 20px rgba($primary-color, 0.4),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  
  &:active {
    transform: translateY(0);
    box-shadow: 
      0 2px 8px rgba($primary-color, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
  }
  
  &.mini {
    padding: 8px 16px;
    font-size: 14px;
    border-radius: 12px;
  }
  
  &.outline {
    background: transparent;
    border: 2px solid $primary-color;
    color: $primary-color;
    box-shadow: none;
    
    &:hover {
      background: $primary-color;
      color: white;
      box-shadow: 0 4px 12px rgba($primary-color, 0.3);
    }
  }
  
  &.secondary {
    background: linear-gradient(135deg, $morandi-sage, $morandi-dust);
    box-shadow: 
      0 4px 12px rgba($morandi-sage, 0.3),
      inset 0 1px 0 rgba(255, 255, 255, 0.2);
    
    &:hover {
      box-shadow: 
        0 6px 20px rgba($morandi-sage, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    }
  }
}

/* iOS风格面板 - 紧急事项添加 */
.ios-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: iosFadeIn 0.3s ease;
}

@keyframes iosFadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.ios-panel {
  width: 90%;
  max-width: 500px;
  background-color: white;
  border-radius: 16px;
  padding: 28px;
  transform: scale(0.95);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
  margin: 0 auto;
  max-height: 80vh;
  overflow-y: auto;
}

.ios-panel.ios-panel-visible {
  transform: scale(1);
  opacity: 1;
}

.ios-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.ios-panel-header h3 {
  font-size: 18px;
  font-weight: 600;
  color: $text-primary-dark;
  margin: 0;
}

.ios-close-button {
  background: none;
  border: none;
  padding: 8px;
  cursor: pointer;
  color: $text-secondary-dark;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.2s ease;
}

.ios-close-button:hover {
  background-color: #f5f5f5;
}

.ios-panel-content {
  max-height: 70vh;
  overflow-y: auto;
}

.ios-input, .ios-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
  box-sizing: border-box;
}

.ios-input:focus, .ios-select:focus {
  outline: none;
  border-color: $primary-color;
  box-shadow: 0 0 0 3px rgba(99, 172, 255, 0.1);
}

.ios-input:disabled, .ios-select:disabled {
  background-color: #f9f9f9;
  color: $text-tertiary-dark;
  border-color: #e0e0e0;
  cursor: not-allowed;
}

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

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: $text-secondary-dark;
}

/* 增强版日期时间选择器 */
.datetime-picker-container {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  
  .date-picker, .time-picker {
    flex: 1;
    position: relative;
    
    label {
      display: block;
      margin-bottom: 8px;
      font-size: 14px;
      font-weight: 500;
      color: $text-secondary-dark;
    }
    
    input {
      width: 100%;
      padding: 12px 16px;
      border: 1px solid $border-color;
      border-radius: 10px;
      font-size: 16px;
      background-color: white;
      transition: all 0.2s ease;
      -webkit-appearance: none;
      -moz-appearance: none;
      appearance: none;
      
      &:focus {
        border-color: $primary-color;
        box-shadow: 0 0 0 3px rgba($primary-color, 0.1);
        outline: none;
      }
      
      &::-webkit-calendar-picker-indicator {
        background: transparent;
        bottom: 0;
        color: transparent;
        cursor: pointer;
        height: auto;
        left: 0;
        position: absolute;
        right: 0;
        top: 0;
        width: auto;
      }
    }
    
    &::after {
      content: "";
      position: absolute;
      right: 16px;
      top: 38px;
      width: 20px;
      height: 20px;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: center;
      pointer-events: none;
    }
  }
  
  .time-picker {
    input {
      &::-webkit-calendar-picker-indicator {
        background: transparent;
        bottom: 0;
        color: transparent;
        cursor: pointer;
        height: auto;
        left: 0;
        position: absolute;
        right: 0;
        top: 0;
        width: auto;
      }
    }
    
    &::after {
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23636366' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'%3E%3C/circle%3E%3Cpolyline points='12 6 12 12 16 14'%3E%3C/polyline%3E%3C/svg%3E");
    }
  }
}

input[type="datetime-local"]:focus {
  outline: none;
  border-color: $primary-color;
  box-shadow: 0 0 0 3px rgba(99, 172, 255, 0.1);
}

input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  background: url("data:image/svg+xml,%3Csvg width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2363acff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E") no-repeat center center;
  width: 24px;
  height: 24px;
  cursor: pointer;
  opacity: 0.7;
}

/* iOS风格文本域 */
.ios-textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
  min-height: 80px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  background-color: white;
  box-sizing: border-box;
}

.ios-textarea:focus {
  outline: none;
  border-color: $primary-color;
  box-shadow: 0 0 0 3px rgba(99, 172, 255, 0.1);
}

/* iOS风格面板底部按钮 */
.ios-panel-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

.ios-cancel-button, .ios-submit-button {
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  box-sizing: border-box;
  min-width: 80px;
}

.ios-cancel-button {
  background-color: #f5f5f5;
  color: $text-secondary-dark;
}

.ios-cancel-button:hover {
  background-color: #eeeeee;
}

.ios-cancel-button:active {
  background-color: #e0e0e0;
  transform: scale(0.98);
}

.ios-submit-button {
  background-color: $primary-color;
  color: white;
}

.ios-submit-button:hover {
  background-color: $primary-dark;
}

.ios-submit-button:active {
  background-color: #4a89dc;
  transform: scale(0.98);
}

.ios-submit-button:disabled {
  background-color: #e0e0e0;
  color: $text-tertiary-dark;
  cursor: not-allowed;
  transform: none;
}
/* 核心指标渐变卡片 */
.core-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}

.core-metric-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-radius: 14px;
  color: #fff;
  box-shadow: $shadow-md;

  .metric-icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .metric-content {
    .metric-value { font-size: 22px; font-weight: 700; }
    .metric-label { font-size: 13px; opacity: 0.9; }
  }

  &.gradient-green {
    background: linear-gradient(135deg, #34d399, #10b981);
  }
  &.gradient-orange {
    background: linear-gradient(135deg, #f59e0b, #f97316);
  }
  &.gradient-blue {
    background: linear-gradient(135deg, #60a5fa, #3b82f6);
  }
}

/* CRM队列 - iOS风格 */
.crm-queues {
  margin-bottom: 24px;
}

.crm-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.crm-card {
  @extend .ios-card;
  padding: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(248, 248, 248, 0.95));
}

.crm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 16px;

  .crm-title-section {
    flex: 1;
    
    h3 { 
      margin: 0 0 8px 0; 
      font-size: 16px; 
      font-weight: 600; 
      color: $ios-text;
    }
  }

  .crm-stats {
    display: flex;
    gap: 16px;
    margin-top: 4px;
    
    .stat-item {
      display: flex;
      flex-direction: column;
      align-items: center;
      gap: 2px;
      
      .stat-number {
        font-size: 18px;
        font-weight: 700;
        color: $ios-text;
        
        &.success {
          color: $ios-success;
        }
        
        &.warning {
          color: $ios-warning;
        }
        
        &.danger {
          color: $ios-danger;
        }
      }
      
      .stat-label {
        font-size: 11px;
        color: $ios-text-secondary;
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.5px;
      }
    }
  }
  
  .view-all-link { 
    color: $primary-color; 
    font-size: 13px; 
    cursor: pointer;
    white-space: nowrap;
    margin-top: 4px;
    
    &:hover {
      color: $ios-primary-dark;
    }
  }
}

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

/* CRM项目 - iOS风格卡片 */
.crm-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(0, 0, 0, 0.05);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(248, 248, 248, 0.9));
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  margin-bottom: 8px;

  &:hover { 
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95), rgba(252, 252, 252, 0.95));
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    border-color: rgba(0, 0, 0, 0.1);
  }

  .crm-item-main { display: flex; align-items: flex-start; gap: 12px; }
  .avatar.small {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, $primary-color, $primary-dark); 
    color: #fff; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    font-weight: 600;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba($primary-color, 0.3);
    transition: all 0.2s ease;
    
    &.alt { 
      background: linear-gradient(135deg, $morandi-sage, $morandi-dust);
      box-shadow: 0 2px 8px rgba($morandi-sage, 0.3);
    }
    
    &:hover {
      transform: scale(1.05);
      box-shadow: 0 4px 12px rgba($primary-color, 0.4);
      
      &.alt {
        box-shadow: 0 4px 12px rgba($morandi-sage, 0.4);
      }
    }
  }
  .info {
    .name { 
      font-weight: 600; 
      color: $text-primary-dark; 
      font-size: 15px;
      letter-spacing: -0.2px;
    }
    .meta { 
      color: $text-tertiary-dark; 
      font-size: 12px; 
      display: flex; 
      gap: 8px; 
      margin-bottom: 8px;
      font-weight: 500;
    }
    .tag { 
      background: linear-gradient(135deg, rgba(0,0,0,0.03), rgba(0,0,0,0.06)); 
      padding: 3px 8px; 
      border-radius: 8px;
      font-size: 11px;
      font-weight: 600;
      backdrop-filter: blur(4px);
      
      &.value-tag {
        background: linear-gradient(135deg, #f0fdf4, #dcfce7);
        color: #166534;
        border: 1px solid rgba(22, 101, 52, 0.1);
      }
      &.price-tag {
        background: linear-gradient(135deg, #fffbeb, #fef3c7);
        color: #d97706;
        border: 1px solid rgba(217, 119, 6, 0.1);
      }
    }
    .strategy-info {
      font-size: 12px;
      line-height: 1.5;
      margin-top: 6px;
      
      .recommended-phrase {
        color: $morandi-dust;
        margin-bottom: 4px;
        font-style: italic;
        font-weight: 500;
        letter-spacing: -0.1px;
      }
      
      .case-strategy {
        color: $morandi-sage;
        font-size: 11px;
        font-weight: 500;
        background: rgba($morandi-sage, 0.1);
        padding: 2px 6px;
        border-radius: 4px;
        display: inline-block;
      }
    }
  }

  .ios-btn.mini { 
    padding: 8px 14px; 
    font-size: 13px; 
    border-radius: 10px;
    font-weight: 600;
    letter-spacing: -0.2px;
    background: linear-gradient(135deg, $primary-color, $primary-dark);
    box-shadow: 0 2px 8px rgba($primary-color, 0.3);
    
    &:hover {
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba($primary-color, 0.4);
    }
    
    &:active {
      transform: translateY(0);
      box-shadow: 0 1px 4px rgba($primary-color, 0.3);
    }
  }
  
  .ios-btn.outline.mini {
    background: transparent;
    border: 2px solid $primary-color;
    color: $primary-color;
    box-shadow: none;
    
    &:hover {
      background: $primary-color;
      color: white;
      box-shadow: 0 2px 8px rgba($primary-color, 0.3);
    }
  }
}

.empty-state.small { color: $text-tertiary-dark; font-size: 13px; text-align: center; padding: 8px 0; }

@media (max-width: 900px) {
  .core-metrics-grid { grid-template-columns: 1fr; }
  .crm-grid { grid-template-columns: 1fr; }
}

.core-metric-card:hover {
  border-color: $primary-color;
  box-shadow: 0 4px 12px color-mix(in srgb, $primary-color 10%, transparent);
  transform: translateY(-2px);
}

.core-icon {
  width: 48px;
  height: 48px;
  background-color: color-mix(in srgb, $primary-color 15%, transparent);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 12px;
  color: $primary-color;
  transition: $transition;
}

.core-card:nth-child(2) .core-icon {
  background-color: color-mix(in srgb, $success-color 15%, transparent);
  color: $success-color;
}

.core-card:nth-child(3) .core-icon {
  background-color: color-mix(in srgb, $warning-color 15%, transparent);
  color: $warning-color;
}

.core-card:nth-child(4) .core-icon {
  background-color: color-mix(in srgb, $danger-color 15%, transparent);
  color: $danger-color;
}

.core-number {
  font-size: 24px;
  font-weight: 700;
  color: $text-primary-dark;
  margin-bottom: 6px;
  line-height: 1.2;
}

.core-label {
  font-size: 14px;
  color: $text-secondary-dark;
  margin: 0;
}

/* 内容网格 */
.content-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

/* 任务列表区块 */
.tasks-section {
  background-color: $card-background;
  border-radius: $border-radius;
  padding: 24px;
  box-shadow: $shadow-md;
  transition: $transition;
}

.tasks-section:hover {
  box-shadow: $shadow-lg;
}

/* 通用区块头部 */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.section-header h3 {
  font-size: 20px;
  font-weight: 600;
  color: $text-primary-dark;
  margin: 0;
}

.section-header .view-all {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  color: $primary-color;
  text-decoration: none;
  transition: $transition;
}

.section-header .view-all:hover {
  color: $primary-dark;
}

/* 搜索框样式 */
.search-box {
  position: relative;
}

.search-input {
  padding: 8px 16px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  color: $text-primary-dark;
  background-color: $card-background;
  transition: $transition;
  outline: none;
  min-width: 200px;
}

.search-input:focus {
  border-color: $primary-color;
  box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 10%, transparent);
}

/* 紧急待办列表 */
.tasks-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tasks-list.empty {
  text-align: center;
  padding: 40px 20px;
  color: $text-tertiary-dark;
}

.tasks-list.empty p {
  font-size: 16px;
  margin: 0;
}

/* 任务项目样式 */
.task-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-radius: $border-radius;
  transition: $transition;
  margin-bottom: 12px;
  position: relative;
}

.task-item.completed {
  background-color: #e8f5e9;
  border: 1px solid #c8e6c9;
}

.task-item.overdue {
  background-color: #ffebee;
  border: 1px solid #ffcdd2;
}

.task-item:hover {
  transform: translateY(-1px);
}

/* 任务复选框样式 */
.task-checkbox {
  margin-right: 16px;
}

.task-checkbox input[type="checkbox"] {
  width: 20px;
  height: 20px;
  accent-color: $primary-color;
  border-radius: 4px;
  cursor: pointer;
}

/* 任务状态标记 */
.task-status {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

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

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

.task-status.overdue {
  background-color: color-mix(in srgb, $danger-color 15%, transparent);
  color: $danger-color;
}

/* 任务内容 */
.task-content {
  flex: 1;
}

.task-title {
  font-size: 18px;
  font-weight: 600;
  color: $text-primary-dark;
  margin-bottom: 4px;
  line-height: 1.3;
}

.task-project {
  font-size: 14px;
  color: $text-secondary-dark;
  margin-bottom: 8px;
}

.task-meta {
  font-size: 14px;
  color: $text-tertiary-dark;
}

/* 任务进度 */
.task-progress {
  width: 100%;
  height: 8px;
  background-color: $background-color;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, $primary-color, #5e9eff);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    border-radius: 4px;
  }

.progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.progress-text {
  font-size: 12px;
  color: $text-tertiary-dark;
  text-align: right;
  margin-top: 4px;
  font-weight: 500;
}

/* 任务处理进度条容器 */
.task-progress-container {
  width: 100%;
  height: 12px;
  background-color: #f5f5f5;
  border-radius: 6px;
  overflow: hidden;
  margin-top: 12px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.1);
}

.task-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, $primary-color 0%, #5e9eff 100%);
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  border-radius: 6px;
}

.task-progress-bar::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.5s infinite;
}

.task-progress-text {
  font-size: 10px;
  color: white;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

/* 任务操作按钮 */
.task-actions {
  display: flex;
  align-items: center;
}

.task-button {
  padding: 6px 12px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: $transition;
  background-color: $card-background;
  color: $text-secondary-dark;
  min-width: 60px;
  text-align: center;
}

.task-button:hover {
  border-color: $primary-color;
  color: $primary-color;
}

.task-button.primary {
  background-color: $primary-color;
  color: white;
  border-color: $primary-color;
}

.task-button.primary:hover {
  background-color: $primary-dark;
  border-color: $primary-dark;
  color: white;
}

.task-button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* 搜索框样式 */
.search-box {
  position: relative;
}

.search-input {
  padding: 8px 16px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  color: $text-primary-dark;
  background-color: $card-background;
  transition: $transition;
  outline: none;
  min-width: 200px;
}

.search-input:focus {
  border-color: $primary-color;
  box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 10%, transparent);
}

/* 项目动态流 */
.project-updates-section {
  background-color: $card-background;
  border-radius: $border-radius;
  padding: 24px;
  box-shadow: $shadow-md;
  transition: $transition;
}

.project-updates-section:hover {
  box-shadow: $shadow-lg;
}

.project-updates-section.empty {
  text-align: center;
  padding: 60px 20px;
  color: $text-tertiary-dark;
}

.project-updates-section.empty p {
  font-size: 16px;
  margin: 0;
}

.project-updates-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.update-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  transition: $transition;
  
  &:hover {
    border-color: $primary-color;
    box-shadow: 0 4px 12px color-mix(in srgb, $primary-color 10%, transparent);
    transform: translateY(-2px);
  }
  
  .update-icon {
    width: 44px;
    height: 44px;
    background-color: $primary-color;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    transition: $transition;
  }
  
  .update-content {
    flex: 1;
    
    .update-title {
      font-size: 18px;
      font-weight: 600;
      color: $text-primary-dark;
      margin-bottom: 6px;
      line-height: 1.3;
    }
    
    .update-text {
      font-size: 16px;
      color: $text-secondary-dark;
      margin-bottom: 12px;
      line-height: 1.4;
    }
    
    .update-meta {
      display: flex;
      align-items: center;
      gap: 20px;
      
      .update-time {
        font-size: 14px;
        color: $text-tertiary-dark;
      }
      
      .update-status {
        padding: 4px 12px;
        border-radius: 16px;
        font-size: 14px;
        font-weight: 600;
        transition: $transition;
        
        &.status-active,
        &.status-info {
          background-color: #e3f2fd;
          color: $primary-color;
          border: 1px solid #bbdefb;
        }
        
        &.status-completed,
        &.status-success {
          background-color: #e8f5e9;
          color: $success-color;
          border: 1px solid #c8e6c9;
        }
        
        &.status-warning {
          background-color: #fff3e0;
          color: $warning-color;
          border: 1px solid #ffe0b2;
        }
        
        &.status-danger {
          background-color: #ffebee;
          color: $danger-color;
          border: 1px solid #ffcdd2;
        }
      }
    }
  }
}

/* 回到顶部按钮 */
.back-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background-color: $primary-color;
  color: white;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: $shadow-md;
  transition: $transition;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  
  &.visible {
    opacity: 1;
    visibility: visible;
  }
  
  &:hover {
    background-color: $primary-dark;
    transform: translateY(-2px);
    box-shadow: $shadow-lg;
  }
  
  &:active {
    transform: translateY(0);
  }
}

/* 响应式设计 */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .core-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .welcome-section {
    padding: 16px 20px;
    margin-bottom: 16px;
  }

  .welcome-section h2 {
    font-size: 20px;
  }

  .welcome-section p {
    font-size: 13px;
  }

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

  .content-grid {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 12px;
  }

  .crm-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .core-metrics-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .crm-item {
    padding: 10px 0;
    
    .strategy-info {
      .recommended-phrase {
        font-size: 11px;
      }
      
      .case-strategy {
        font-size: 10px;
      }
    }
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    
    h3 {
      font-size: 18px;
    }
  }
  
  .task-title,
  .update-title {
    font-size: 16px !important;
  }
  
  .task-project,
  .update-text {
    font-size: 14px !important;
  }
}

@media (max-width: 480px) {
  .welcome-section {
    padding: 12px 16px;
  }

  .stats-dashboard,
  .crm-queues {
    margin-bottom: 16px;
  }

  .crm-item {
    .avatar.small {
      width: 24px;
      height: 24px;
      font-size: 11px;
    }
    
    .info .name {
      font-size: 14px;
    }
    
    .info .meta {
      font-size: 11px;
      gap: 6px;
    }
  }
}