@use '../../styles/_ios-theme.scss' as ios;

:host { display: block; height: 100%; }

// 企业微信监控样式
.wechat-monitoring-section {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;
  color: white;

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

    h4 {
      margin: 0;
      font-size: 18px;
      font-weight: 600;
    }

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

      &.status-idle {
        background: rgba(255, 255, 255, 0.2);
      }

      &.status-processing {
        background: #ffc107;
        color: #000;
        animation: pulse 2s infinite;
      }

      &.status-completed {
        background: #28a745;
      }
    }
  }

  .monitoring-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;

    .btn {
      padding: 8px 16px;
      border: none;
      border-radius: 6px;
      font-size: 14px;
      cursor: pointer;
      transition: all 0.3s ease;

      &.btn-primary {
        background: #007bff;
        color: white;

        &:hover:not(:disabled) {
          background: #0056b3;
        }

        &:disabled {
          background: rgba(255, 255, 255, 0.3);
          cursor: not-allowed;
        }
      }

      &.btn-secondary {
        background: rgba(255, 255, 255, 0.2);
        color: white;

        &:hover {
          background: rgba(255, 255, 255, 0.3);
        }
      }

      i {
        margin-right: 6px;
      }
    }

    .monitoring-stats {
      display: flex;
      gap: 20px;
      margin-left: auto;

      .stat-item {
        display: flex;
        align-items: center;
        font-size: 14px;

        i {
          margin-right: 6px;
          opacity: 0.8;
        }
      }
    }
  }
}

// 实时代办项样式
.realtime-tasks-section {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 20px;

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

    h4 {
      margin: 0;
      color: #333;
      font-size: 18px;
      font-weight: 600;
    }

    .task-count {
      background: #dc3545;
      color: white;
      padding: 4px 12px;
      border-radius: 20px;
      font-size: 12px;
      font-weight: 500;
    }
  }

  .realtime-task-list {
    .task-item {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 15px;
      border: 1px solid #e9ecef;
      border-radius: 8px;
      margin-bottom: 10px;
      transition: all 0.3s ease;

      &:hover {
        border-color: #007bff;
        box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
      }

      &.processing {
        border-color: #ffc107;
        background: #fff9c4;
      }

      .task-info {
        flex: 1;

        .task-title {
          font-weight: 500;
          color: #333;
          margin-bottom: 8px;
          font-size: 14px;
        }

        .task-meta {
          display: flex;
          gap: 15px;
          font-size: 12px;
          color: #666;

          .customer {
            font-weight: 500;
          }

          .urgency {
            padding: 2px 8px;
            border-radius: 12px;
            font-weight: 500;

            &.urgency-urgent {
              background: #ffc107;
              color: #000;
            }

            &.urgency-critical {
              background: #dc3545;
              color: white;
            }
          }
        }
      }

      .task-actions {
        display: flex;
        gap: 8px;

        .btn {
          padding: 6px 12px;
          border: none;
          border-radius: 4px;
          font-size: 12px;
          cursor: pointer;
          transition: all 0.3s ease;

          &.btn-primary {
            background: #007bff;
            color: white;

            &:hover:not(:disabled) {
              background: #0056b3;
            }

            &:disabled {
              background: #6c757d;
              cursor: not-allowed;
            }
          }

          &.btn-warning {
            background: #ffc107;
            color: #000;

            &:hover {
              background: #e0a800;
            }
          }

          i {
            margin-right: 4px;
          }
        }
      }
    }
  }
}

.complaint-card {
  padding: ios.$ios-spacing-md;
  background: ios.$ios-background;
  border-radius: 12px;
  border: 1px solid ios.$ios-border;

  // 统计数据概览
  .stats-overview {
    margin-bottom: ios.$ios-spacing-lg;
    
    h4 {
      margin: 0 0 ios.$ios-spacing-md 0;
      font-size: ios.$ios-font-size-lg;
      font-weight: ios.$ios-font-weight-semibold;
      color: ios.$ios-text-primary;
    }

    .stats-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: ios.$ios-spacing-md;

      .stat-item {
        text-align: center;
        padding: ios.$ios-spacing-md;
        background: ios.$ios-background-secondary;
        border-radius: ios.$ios-radius-md;
        border: 1px solid ios.$ios-border;

        .stat-value {
          font-size: ios.$ios-font-size-xl;
          font-weight: ios.$ios-font-weight-bold;
          color: ios.$ios-text-primary;
          margin-bottom: ios.$ios-spacing-xs;

          .time-suffix {
            font-size: ios.$ios-font-size-sm;
            color: ios.$ios-text-secondary;
          }
        }

        .stat-label {
          font-size: ios.$ios-font-size-xs;
          color: ios.$ios-text-secondary;
        }

        &.total .stat-value { color: ios.$ios-primary; }
        &.pending .stat-value { color: ios.$ios-warning; }
        &.processing .stat-value { color: #1890ff; }
        &.resolved .stat-value { color: ios.$ios-success; }
        &.high-priority .stat-value { color: ios.$ios-danger; }
        &.resolution-time .stat-value { color: #722ed1; }
        
        // 新增统计项样式
        &.wechat-count .stat-value { color: #52c41a; }
        &.auto-tagged .stat-value { color: #13c2c2; }
        &.overdue .stat-value { color: #ff4d4f; }
        &.follow-up .stat-value { color: #fa8c16; }
      }
    }
  }

  // 企业微信监控面板
  .wechat-monitoring-panel {
    margin-bottom: ios.$ios-spacing-lg;
    padding: ios.$ios-spacing-md;
    background: linear-gradient(135deg, #e6f7ff 0%, #f0f9ff 100%);
    border-radius: ios.$ios-radius-md;
    border: 1px solid #91d5ff;

    h4 {
      margin: 0 0 ios.$ios-spacing-md 0;
      font-size: ios.$ios-font-size-lg;
      font-weight: ios.$ios-font-weight-semibold;
      color: #1890ff;
      display: flex;
      align-items: center;
      gap: ios.$ios-spacing-sm;

      &::before {
        content: '📱';
        font-size: ios.$ios-font-size-lg;
      }
    }

    .monitoring-controls {
      display: flex;
      align-items: center;
      gap: ios.$ios-spacing-md;
      margin-bottom: ios.$ios-spacing-md;
      flex-wrap: wrap;

      .control-btn {
        display: flex;
        align-items: center;
        gap: ios.$ios-spacing-xs;
        padding: ios.$ios-spacing-sm ios.$ios-spacing-md;
        background: #1890ff;
        color: white;
        border: none;
        border-radius: ios.$ios-radius-sm;
        font-size: ios.$ios-font-size-sm;
        cursor: pointer;
        transition: all 0.3s ease;

        &:hover {
          background: #40a9ff;
          transform: translateY(-1px);
        }

        .btn-icon {
          font-size: ios.$ios-font-size-md;
        }

        &.setup-keywords {
          background: #52c41a;

          &:hover {
            background: #73d13d;
          }
        }
      }

      .monitoring-status {
        display: flex;
        align-items: center;
        gap: ios.$ios-spacing-xs;
        margin-left: auto;

        .status-label {
          font-size: ios.$ios-font-size-sm;
          color: ios.$ios-text-secondary;
        }

        .status-indicator {
          padding: 2px 8px;
          border-radius: 10px;
          font-size: ios.$ios-font-size-xs;
          font-weight: ios.$ios-font-weight-medium;

          &.active {
            background: #f6ffed;
            color: #52c41a;
            border: 1px solid #b7eb8f;
          }
        }
      }
    }

    .keyword-display {
      display: flex;
      align-items: center;
      gap: ios.$ios-spacing-sm;
      flex-wrap: wrap;

      .keyword-label {
        font-size: ios.$ios-font-size-sm;
        color: ios.$ios-text-secondary;
        white-space: nowrap;
      }

      .keyword-tags {
        display: flex;
        gap: ios.$ios-spacing-xs;
        flex-wrap: wrap;

        .keyword-tag {
          padding: 2px 8px;
          background: #fff2e8;
          color: #fa8c16;
          border: 1px solid #ffd591;
          border-radius: 10px;
          font-size: ios.$ios-font-size-xs;
          font-weight: ios.$ios-font-weight-medium;
        }
      }
    }
  }

  // 实时代办项状态
  .real-time-task-status {
    margin-bottom: ios.$ios-spacing-lg;
    padding: ios.$ios-spacing-md;
    background: linear-gradient(135deg, #fff7e6 0%, #fffbe6 100%);
    border-radius: ios.$ios-radius-md;
    border: 1px solid #ffd591;

    .task-status-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: ios.$ios-spacing-sm;

      h5 {
        margin: 0;
        font-size: ios.$ios-font-size-md;
        font-weight: ios.$ios-font-weight-semibold;
        color: #fa8c16;
      }

      .task-status-badge {
        padding: 4px 12px;
        border-radius: ios.$ios-radius-sm;
        font-size: ios.$ios-font-size-xs;
        font-weight: ios.$ios-font-weight-medium;

        &.processing {
          background: #fff2e8;
          color: #fa8c16;
          border: 1px solid #ffd591;
        }

        &.completed {
          background: #f6ffed;
          color: #52c41a;
          border: 1px solid #b7eb8f;
        }
      }
    }

    .task-progress {
      .progress-bar {
        width: 100%;
        height: 6px;
        background: #fff7e6;
        border-radius: 3px;
        overflow: hidden;
        margin-bottom: ios.$ios-spacing-xs;

        .progress-fill {
          height: 100%;
          background: linear-gradient(90deg, #fa8c16, #ffa940);
          border-radius: 3px;
          animation: progress-animation 2s ease-in-out infinite;
        }
      }

      .progress-text {
        font-size: ios.$ios-font-size-xs;
        color: ios.$ios-text-secondary;
      }
    }
  }

  @keyframes progress-animation {
    0% { width: 0%; }
    50% { width: 70%; }
    100% { width: 100%; }
  }

  // 优先级统计 - 小卡片样式
  .priority-stats {
    margin-bottom: ios.$ios-spacing-lg;
    padding: ios.$ios-spacing-md;
    background: ios.$ios-background-secondary;
    border-radius: ios.$ios-radius-md;
    border: 1px solid ios.$ios-border;

    h5 {
      margin: 0 0 ios.$ios-spacing-md 0;
      font-size: ios.$ios-font-size-md;
      font-weight: ios.$ios-font-weight-semibold;
      color: ios.$ios-text-primary;
    }

    .priority-cards-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
      gap: ios.$ios-spacing-md;

      .priority-card {
        background: ios.$ios-background;
        border-radius: ios.$ios-radius-md;
        border: 2px solid;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
        transition: all 0.3s ease;

        &:hover {
          transform: translateY(-2px);
          box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        }

        .priority-card-header {
          padding: ios.$ios-spacing-sm ios.$ios-spacing-md;
          color: white;
          text-align: center;

          .priority-card-label {
            font-size: ios.$ios-font-size-sm;
            font-weight: ios.$ios-font-weight-semibold;
            text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
          }
        }

        .priority-card-body {
          padding: ios.$ios-spacing-md;
          text-align: center;
          background: ios.$ios-background;

          .priority-card-count {
            font-size: 28px;
            font-weight: ios.$ios-font-weight-bold;
            color: ios.$ios-text-primary;
            line-height: 1;
            margin-bottom: 4px;
          }

          .priority-card-suffix {
            font-size: ios.$ios-font-size-xs;
            color: ios.$ios-text-secondary;
            font-weight: ios.$ios-font-weight-medium;
          }
        }
      }
    }
  }

  // 类型统计
  .type-stats {
    margin-bottom: ios.$ios-spacing-lg;
    padding: ios.$ios-spacing-md;
    background: ios.$ios-background-secondary;
    border-radius: ios.$ios-radius-md;
    border: 1px solid ios.$ios-border;

    h5 {
      margin: 0 0 ios.$ios-spacing-md 0;
      font-size: ios.$ios-font-size-md;
      font-weight: ios.$ios-font-weight-semibold;
      color: ios.$ios-text-primary;
    }

    .type-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
      gap: ios.$ios-spacing-sm;

      .type-item {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: ios.$ios-spacing-sm;
        background: ios.$ios-background;
        border-radius: ios.$ios-radius-sm;
        border: 1px solid ios.$ios-border;

        .type-label {
          font-size: ios.$ios-font-size-xs;
          color: ios.$ios-text-secondary;
        }

        .type-count {
          font-size: ios.$ios-font-size-sm;
          font-weight: ios.$ios-font-weight-semibold;
          color: ios.$ios-primary;
        }
      }
    }
  }

  // 筛选区域
  .filter-section {
    margin-bottom: ios.$ios-spacing-lg;
    padding: ios.$ios-spacing-md;
    background: ios.$ios-background-secondary;
    border-radius: ios.$ios-radius-md;
    border: 1px solid ios.$ios-border;

    .search-row {
      margin-bottom: ios.$ios-spacing-md;

      .search-group {
        display: flex;
        align-items: center;
        gap: ios.$ios-spacing-sm;

        label {
          font-size: ios.$ios-font-size-sm;
          color: ios.$ios-text-secondary;
          white-space: nowrap;
        }

        .search-input {
          flex: 1;
          padding: ios.$ios-spacing-sm;
          border: 1px solid ios.$ios-border;
          border-radius: ios.$ios-radius-sm;
          background: ios.$ios-background;
          color: ios.$ios-text-primary;
          font-size: ios.$ios-font-size-sm;

          &:focus {
            outline: none;
            border-color: ios.$ios-primary;
          }

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

    .filter-row {
      display: flex;
      flex-wrap: wrap;
      gap: ios.$ios-spacing-md;
      margin-bottom: ios.$ios-spacing-md;

      &:last-child {
        margin-bottom: 0;
      }

      .filter-group {
        display: flex;
        align-items: center;
        gap: ios.$ios-spacing-sm;

        label {
          font-size: ios.$ios-font-size-sm;
          color: ios.$ios-text-secondary;
          white-space: nowrap;
        }

        .filter-buttons {
          display: flex;
          gap: ios.$ios-spacing-xs;

          .filter-btn {
            padding: ios.$ios-spacing-xs ios.$ios-spacing-sm;
            border: 1px solid ios.$ios-border;
            background: ios.$ios-background;
            color: ios.$ios-text-secondary;
            border-radius: ios.$ios-radius-sm;
            font-size: ios.$ios-font-size-xs;
            cursor: pointer;
            transition: all 0.2s ease;

            &:hover {
              background: ios.$ios-background-secondary;
            }

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

            &.pending.active {
              background: ios.$ios-warning;
              border-color: ios.$ios-warning;
            }

            &.processing.active {
              background: #1890ff;
              border-color: #1890ff;
            }

            &.resolved.active {
              background: ios.$ios-success;
              border-color: ios.$ios-success;
            }
          }
        }

        .filter-select {
          padding: ios.$ios-spacing-xs ios.$ios-spacing-sm;
          border: 1px solid ios.$ios-border;
          border-radius: ios.$ios-radius-sm;
          background: ios.$ios-background;
          color: ios.$ios-text-primary;
          font-size: ios.$ios-font-size-xs;
          min-width: 120px;

          &:focus {
            outline: none;
            border-color: ios.$ios-primary;
          }
        }
      }
    }
  }

  // 投诉列表样式
  .complaints-list {
    margin-top: 20px;

    .complaints-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
      gap: 16px;
      padding: 0;
    }

    .complaint-card-item {
      background: #ffffff;
      border-radius: 12px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
      border: 1px solid #e8e8e8;
      overflow: hidden;
      transition: all 0.3s ease;
      display: flex;
      flex-direction: column;

      &:hover {
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        transform: translateY(-2px);
      }

      &.overdue {
        border-left: 4px solid #ff4757;
        
        .card-header {
          background: linear-gradient(135deg, #fff5f5 0%, #ffffff 100%);
        }
      }

      // 卡片头部
        .card-header {
          padding: 12px 16px;
          background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
          border-bottom: 1px solid #e9ecef;
          display: flex;
          justify-content: space-between;
          align-items: center;

        .header-left {
          display: flex;
          align-items: center;
          gap: 12px;
          flex: 1;

          .type-tag {
            background: #007bff;
            color: white;
            padding: 4px 12px;
            border-radius: 16px;
            font-size: 12px;
            font-weight: 500;
            white-space: nowrap;

            &.quality {
              background: #dc3545;
            }

            &.service {
              background: #28a745;
            }

            &.delivery {
              background: #ffc107;
              color: #212529;
            }

            &.other {
              background: #6c757d;
            }
          }

          .priority-badge {
            color: white;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
          }

          // 新增标识样式
          .source-badge {
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;

            &.manual {
              background: #f0f0f0;
              color: #666;
              border: 1px solid #d9d9d9;
            }

            &.wechat_auto {
              background: #e6f7ff;
              color: #1890ff;
              border: 1px solid #91d5ff;
            }

            &.keyword_monitor {
              background: #fff2e8;
              color: #fa8c16;
              border: 1px solid #ffd591;
            }
          }

          .urgency-badge {
            color: white;
            padding: 4px 10px;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
          }

          .auto-tag-badge {
            background: #f6ffed;
            color: #52c41a;
            border: 1px solid #b7eb8f;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: 500;
            white-space: nowrap;
          }

          .escalation-badge {
            background: #fff1f0;
            color: #ff4d4f;
            border: 1px solid #ffccc7;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: 500;
            white-space: nowrap;
          }
        }

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

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

            &.pending {
              background: #fff3cd;
              color: #856404;
              border: 1px solid #ffeaa7;
            }

            &.processing {
              background: #d1ecf1;
              color: #0c5460;
              border: 1px solid #bee5eb;
            }

            &.resolved {
              background: #d4edda;
              color: #155724;
              border: 1px solid #c3e6cb;
            }
          }

          .overdue-badge {
            background: #ff4757;
            color: white;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: 600;
            animation: pulse 2s infinite;
          }

          .follow-up-badge {
            background: #fff2e8;
            color: #fa8c16;
            border: 1px solid #ffd591;
            padding: 2px 8px;
            border-radius: 10px;
            font-size: 10px;
            font-weight: 500;
            white-space: nowrap;
          }
        }
      }

      // 卡片主体
      .card-body {
        padding: 16px;
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 12px;

        .customer-info {
          display: flex;
          align-items: center;
          padding: 8px 12px;
          background: #f8f9fa;
          border-radius: 8px;
          border-left: 3px solid #007bff;

          .customer-label {
            font-weight: 500;
            color: #495057;
            margin-right: 8px;
          }

          .customer-name {
            color: #007bff;
            font-weight: 600;
          }
        }

        // 新增信息区域样式
        .wechat-info {
          padding: 8px 12px;
          background: #e6f7ff;
          border-radius: 8px;
          border-left: 3px solid #1890ff;

          .wechat-label {
            font-weight: 500;
            color: #1890ff;
            margin-right: 8px;
          }

          .wechat-group {
            color: #1890ff;
            font-weight: 600;
          }

          .matched-keywords {
            margin-top: 6px;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;

            .keyword-label {
              font-size: 12px;
              color: #666;
            }

            .matched-keyword {
              background: #fff2e8;
              color: #fa8c16;
              border: 1px solid #ffd591;
              padding: 2px 6px;
              border-radius: 8px;
              font-size: 11px;
              font-weight: 500;
            }
          }
        }

        .assignment-info {
          padding: 8px 12px;
          background: #f6ffed;
          border-radius: 8px;
          border-left: 3px solid #52c41a;

          .assignment-label {
            font-weight: 500;
            color: #52c41a;
            margin-right: 8px;
          }

          .assignee-name {
            color: #52c41a;
            font-weight: 600;
          }
        }

        .tags-section {
          padding: 8px 12px;
          background: #fff7e6;
          border-radius: 8px;
          border-left: 3px solid #fa8c16;

          .tags-label {
            font-weight: 500;
            color: #fa8c16;
            margin-right: 8px;
          }

          .tags-list {
            display: flex;
            gap: 6px;
            flex-wrap: wrap;
            margin-top: 6px;

            .complaint-tag {
              background: #fff2e8;
              color: #fa8c16;
              border: 1px solid #ffd591;
              padding: 2px 8px;
              border-radius: 10px;
              font-size: 11px;
              font-weight: 500;
            }
          }
        }

        .complaint-description {
          h4 {
            margin: 0 0 8px 0;
            font-size: 14px;
            font-weight: 600;
            color: #343a40;
          }

          p {
            margin: 0;
            color: #6c757d;
            line-height: 1.5;
            font-size: 14px;
          }
        }

        .complaint-images {
          h5 {
            margin: 0 0 8px 0;
            font-size: 13px;
            font-weight: 600;
            color: #495057;
          }

          .images-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
            gap: 6px;
            max-width: 100%;
          }

          .complaint-image {
            width: 100%;
            height: 60px;
            object-fit: cover;
            border-radius: 4px;
            border: 1px solid #dee2e6;
            cursor: pointer;
            transition: transform 0.2s ease;

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

        .time-section {
          background: #f8f9fa;
          padding: 12px;
          border-radius: 8px;
          border: 1px solid #e9ecef;

          .time-item {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 6px;

            &:last-child {
              margin-bottom: 0;
            }

            .time-label {
              font-size: 13px;
              color: #6c757d;
              font-weight: 500;
            }

            .time-value {
              font-size: 13px;
              color: #495057;
              font-weight: 600;
            }
          }
        }

        .handler-section {
          background: #e3f2fd;
          padding: 12px;
          border-radius: 8px;
          border-left: 3px solid #2196f3;

          h5 {
            margin: 0 0 8px 0;
            font-size: 13px;
            font-weight: 600;
            color: #1976d2;
          }

          .handler-comment {
            margin: 0 0 8px 0;
            color: #424242;
            font-size: 13px;
            line-height: 1.4;
          }

          .handler-info {
            display: flex;
            align-items: center;

            .handler-label {
              font-size: 12px;
              color: #757575;
              margin-right: 6px;
            }

            .handler-name {
              font-size: 12px;
              color: #1976d2;
              font-weight: 600;
            }
          }
        }

        .solution-section {
          background: #e8f5e8;
          padding: 12px;
          border-radius: 8px;
          border-left: 3px solid #4caf50;

          h5 {
            margin: 0 0 8px 0;
            font-size: 13px;
            font-weight: 600;
            color: #388e3c;
          }

          .solution-text {
            margin: 0;
            color: #424242;
            font-size: 13px;
            line-height: 1.4;
          }
        }
      }

      // 卡片底部
      .card-footer {
        padding: 12px 16px;
        background: #f8f9fa;
        border-top: 1px solid #e9ecef;
        display: flex;
        flex-wrap: wrap;
        justify-content: flex-start;
        align-items: center;
        gap: 8px;

        .action-btn {
          display: flex;
          align-items: center;
          gap: 6px;
          padding: 6px 12px;
          border: none;
          border-radius: 6px;
          font-size: 13px;
          font-weight: 500;
          cursor: pointer;
          transition: all 0.2s ease;
          white-space: nowrap;
          flex: 0 1 auto;
          max-width: 100%;

          .btn-icon {
            font-size: 14px;
          }

          &.process-btn {
            background: #007bff;
            color: white;

            &:hover {
              background: #0056b3;
              transform: translateY(-1px);
            }
          }

          &.complete-btn {
            background: #28a745;
            color: white;

            &:hover {
              background: #1e7e34;
              transform: translateY(-1px);
            }
          }

          &.detail-btn {
            background: #6c757d;
            color: white;

            &:hover {
              background: #545b62;
              transform: translateY(-1px);
            }
          }

          // 新增操作按钮样式
          &.task-btn {
            background: #fa8c16;
            color: white;

            &:hover {
              background: #d46b08;
              transform: translateY(-1px);
            }
          }

          &.escalate-btn {
            background: #ff4d4f;
            color: white;

            &:hover {
              background: #cf1322;
              transform: translateY(-1px);
            }
          }

          &.assign-btn {
            background: #52c41a;
            color: white;

            &:hover {
              background: #389e0d;
              transform: translateY(-1px);
            }
          }

          &.tag-btn {
            background: #722ed1;
            color: white;

            &:hover {
              background: #531dab;
              transform: translateY(-1px);
            }
          }

          &.follow-up-btn {
            background: #13c2c2;
            color: white;

            &:hover {
              background: #08979c;
              transform: translateY(-1px);
            }

            &.active {
              background: #52c41a;

              &:hover {
                background: #389e0d;
              }
            }
          }
        }

        .completed-status {
          display: flex;
          align-items: center;
          gap: 6px;
          color: #28a745;
          font-weight: 600;
          font-size: 13px;

          .completed-icon {
            background: #28a745;
            color: white;
            width: 18px;
            height: 18px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
          }
        }
      }
    }

    // 空状态样式
    .empty-state {
      text-align: center;
      padding: 60px 20px;
      color: #6c757d;

      .empty-icon {
        font-size: 48px;
        margin-bottom: 16px;
        opacity: 0.5;
      }

      .empty-title {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 8px;
        color: #495057;
      }

      .empty-description {
        font-size: 14px;
        color: #6c757d;
      }
    }
  }

  // 响应式设计 - 中等屏幕
  @media (max-width: 1024px) {
    .complaints-list {
      .complaints-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 14px;
      }
    }
  }

  // 响应式设计 - 小屏幕
  @media (max-width: 768px) {
    .complaints-list {
      .complaints-grid {
        grid-template-columns: 1fr;
        gap: 12px;
      }

      .complaint-card-item {
        .card-header {
          padding: 10px 12px;
          flex-direction: column;
          align-items: flex-start;
          gap: 6px;

          .header-left {
            width: 100%;
          }

          .header-right {
            width: 100%;
            justify-content: flex-end;
          }
        }

        .card-body {
          padding: 12px;
          gap: 10px;
        }

        .card-footer {
          padding: 10px 12px;
          flex-direction: column;
          gap: 6px;

          .action-btn {
            width: 100%;
            justify-content: center;
          }
        }
      }
    }
  }

  // 响应式设计 - 超小屏幕
  @media (max-width: 480px) {
    .complaints-list {
      .complaints-grid {
        gap: 10px;
      }

      .complaint-card-item {
        .card-header {
          padding: 8px 10px;
        }

        .card-body {
          padding: 10px;
          gap: 8px;

          .complaint-images .images-grid {
            grid-template-columns: repeat(auto-fill, minmax(50px, 1fr));
            gap: 4px;
          }

          .complaint-image {
            height: 50px;
          }
        }

        .card-footer {
          padding: 8px 10px;
        }
      }
    }
  }

  // 动画效果
  @keyframes pulse {
    0% {
      opacity: 1;
    }
    50% {
      opacity: 0.5;
    }
    100% {
      opacity: 1;
    }
  }

  // 响应式设计
  @media (max-width: 768px) {
    .stats-grid {
      grid-template-columns: repeat(2, 1fr);
      gap: ios.$ios-spacing-sm;
    }

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

    .filter-section {
      .search-row .search-group {
        flex-direction: column;
        align-items: stretch;
      }

      .filter-row {
        flex-direction: column;
        align-items: stretch;

        .filter-group {
          flex-direction: column;
          align-items: stretch;

          .filter-buttons {
            justify-content: center;
          }
        }
      }
    }

    .complaints-list .complaint-item .complaint-header {
      flex-direction: column;
      gap: ios.$ios-spacing-sm;
    }
  }
}

// ==================== 弹窗样式 ====================

// 弹窗遮罩层
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

// 弹窗内容
.modal-content {
  background: white;
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 800px;
  width: 100%;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
  
  &.complaint-detail-modal {
    max-width: 900px;
  }
  
  &.tag-modal {
    max-width: 600px;
  }
}

// 弹窗头部
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  border-bottom: 1px solid #e8e8e8;
  
  h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #333;
  }
  
  .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
    
    &:hover {
      background: #f5f5f5;
      color: #333;
    }
  }
}

// 弹窗主体
.modal-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

// 弹窗底部
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid #e8e8e8;
  
  .btn {
    padding: 8px 20px;
    border-radius: 6px;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    
    &.btn-secondary {
      background: #f5f5f5;
      color: #666;
      
      &:hover {
        background: #e8e8e8;
      }
    }
    
    &.btn-primary {
      background: #1890ff;
      color: white;
      
      &:hover {
        background: #40a9ff;
      }
      
      i {
        margin-right: 6px;
      }
    }
  }
}

// ==================== 投诉详情弹窗样式 ====================

.complaint-detail-modal {
  .detail-section {
    margin-bottom: 24px;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    .section-title {
      font-size: 16px;
      font-weight: 600;
      color: #333;
      margin: 0 0 16px 0;
      padding-bottom: 8px;
      border-bottom: 2px solid #f0f0f0;
    }
  }
  
  .info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    
    .info-item {
      display: flex;
      align-items: flex-start;
      gap: 8px;
      
      &.full-width {
        grid-column: 1 / -1;
      }
      
      .label {
        font-weight: 500;
        color: #666;
        white-space: nowrap;
        min-width: 80px;
      }
      
      .value {
        color: #333;
        flex: 1;
        
        &.warning {
          color: #ff4d4f;
          font-weight: 600;
        }
        
        &.type-badge,
        &.priority-badge,
        &.status-badge,
        &.source-badge {
          padding: 4px 12px;
          border-radius: 12px;
          font-size: 12px;
          font-weight: 500;
        }
        
        &.type-badge {
          background: #e6f7ff;
          color: #1890ff;
        }
        
        &.priority-badge {
          color: white;
        }
        
        &.status-badge {
          &.pending {
            background: #fff7e6;
            color: #fa8c16;
          }
          
          &.processing {
            background: #e6f7ff;
            color: #1890ff;
          }
          
          &.resolved {
            background: #f6ffed;
            color: #52c41a;
          }
        }
        
        &.source-badge {
          background: #f0f0f0;
          color: #666;
        }
      }
    }
  }
  
  .complaint-content-box,
  .comment-box,
  .solution-box {
    background: #f9f9f9;
    padding: 16px;
    border-radius: 8px;
    border-left: 4px solid #1890ff;
    
    p {
      margin: 0;
      line-height: 1.6;
      color: #333;
    }
  }
  
  .comment-box {
    border-left-color: #52c41a;
    
    .comment-author {
      margin-top: 12px;
      text-align: right;
      color: #999;
      font-size: 14px;
      font-style: italic;
    }
  }
  
  .solution-box {
    border-left-color: #52c41a;
    background: #f6ffed;
  }
  
  .keyword-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    
    .keyword-tag {
      background: #fff1f0;
      color: #ff4d4f;
      padding: 4px 10px;
      border-radius: 12px;
      font-size: 12px;
      font-weight: 500;
    }
  }
  
  .tags-display {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    
    .tag-item {
      background: #f0f0f0;
      color: #333;
      padding: 6px 12px;
      border-radius: 16px;
      font-size: 13px;
      display: flex;
      align-items: center;
      gap: 6px;
      
      .tag-remove {
        background: none;
        border: none;
        color: #999;
        cursor: pointer;
        padding: 0;
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 16px;
        line-height: 1;
        transition: all 0.2s;
        
        &:hover {
          background: #d9d9d9;
          color: #333;
        }
      }
    }
  }
  
  .images-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 12px;
    
    .gallery-image {
      width: 100%;
      height: 150px;
      object-fit: cover;
      border-radius: 8px;
      cursor: pointer;
      transition: transform 0.2s;
      
      &:hover {
        transform: scale(1.05);
      }
    }
  }
}

// ==================== 添加标签弹窗样式 ====================

.tag-modal {
  .current-tags-section,
  .preset-tags-section,
  .custom-tag-section {
    margin-bottom: 24px;
    
    &:last-child {
      margin-bottom: 0;
    }
    
    .section-title {
      font-size: 14px;
      font-weight: 600;
      color: #333;
      margin: 0 0 12px 0;
    }
  }
  
  .current-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 8px;
    min-height: 50px;
    
    .tag-item {
      background: #1890ff;
      color: white;
      padding: 6px 12px;
      border-radius: 16px;
      font-size: 13px;
      display: flex;
      align-items: center;
      gap: 6px;
      
      .tag-remove {
        background: rgba(255, 255, 255, 0.3);
        border: none;
        color: white;
        cursor: pointer;
        padding: 0;
        width: 16px;
        height: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        font-size: 16px;
        line-height: 1;
        transition: all 0.2s;
        
        &:hover {
          background: rgba(255, 255, 255, 0.5);
        }
      }
    }
  }
  
  .preset-tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
    
    .preset-tag-btn {
      background: #f5f5f5;
      border: 2px solid transparent;
      color: #666;
      padding: 8px 12px;
      border-radius: 6px;
      font-size: 13px;
      cursor: pointer;
      transition: all 0.2s;
      
      &:hover {
        background: #e8e8e8;
        border-color: #d9d9d9;
      }
      
      &.selected {
        background: #e6f7ff;
        border-color: #1890ff;
        color: #1890ff;
        font-weight: 500;
      }
    }
  }
  
  .custom-tag-input-group {
    display: flex;
    gap: 8px;
    
    .custom-tag-input {
      flex: 1;
      padding: 8px 12px;
      border: 1px solid #d9d9d9;
      border-radius: 6px;
      font-size: 14px;
      transition: all 0.2s;
      
      &:focus {
        outline: none;
        border-color: #1890ff;
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
      }
      
      &::placeholder {
        color: #bfbfbf;
      }
    }
  }
}

// ==================== 动画 ====================

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

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

// ==================== 响应式 ====================

@media (max-width: 768px) {
  .modal-content {
    max-width: 100%;
    max-height: 100vh;
    border-radius: 0;
    
    &.complaint-detail-modal,
    &.tag-modal {
      max-width: 100%;
    }
  }
  
  .complaint-detail-modal {
    .info-grid {
      grid-template-columns: 1fr;
    }
    
    .images-gallery {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
  }
  
  .tag-modal {
    .preset-tags-grid {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
  }
}