// 订单分配阶段样式 - 纯 div+scss 实现

// 文件上传相关样式
.files-card {
  .wx-support-indicator {
    background-color: #dcfce7;
    color: #166534;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
  }

  .upload-section {
    margin-bottom: 24px;
  }

  .drop-zone {
    border: 2px dashed #d1d5db;
    border-radius: 8px;
    padding: 32px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #f9fafb;
    position: relative;
    min-height: 120px;
    display: flex;
    align-items: center;
    justify-content: center;

    &:hover {
      border-color: #3b82f6;
      background-color: #eff6ff;
    }

    &.drag-over {
      border-color: #3b82f6;
      background-color: #eff6ff;
      transform: scale(1.02);
    }

    &.uploading {
      border-color: #6b7280;
      background-color: #f3f4f6;
      cursor: not-allowed;
    }
  }

  .upload-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    .upload-icon {
      color: #6b7280;
      width: 48px;
      height: 48px;
      transition: color 0.3s ease;
    }

    .upload-text {
      .upload-title {
        font-size: 16px;
        font-weight: 500;
        margin: 0 0 8px 0;
        color: #374151;

        .upload-link {
          color: #3b82f6;
          text-decoration: underline;
          cursor: pointer;

          &:hover {
            color: #2563eb;
          }
        }
      }

      .upload-hint {
        font-size: 14px;
        color: #6b7280;
        margin: 0;
      }
    }
  }

  .upload-progress {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;

    .progress-circle {
      position: relative;
      width: 80px;
      height: 80px;

      .progress-svg {
        transform: rotate(-90deg);
        width: 100%;
        height: 100%;

        .progress-bg {
          fill: none;
          stroke: #e5e7eb;
          stroke-width: 3;
        }

        .progress-bar {
          fill: none;
          stroke: #3b82f6;
          stroke-width: 3;
          stroke-linecap: round;
          transition: stroke-dasharray 0.3s ease;
        }
      }

      .progress-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        font-size: 16px;
        font-weight: 600;
        color: #1f2937;
      }
    }

    .progress-title {
      font-size: 16px;
      font-weight: 500;
      color: #374151;
      margin: 0;
    }
  }

  .file-input {
    display: none;
  }

  .files-list {
    .section-title {
      font-size: 18px;
      font-weight: 600;
      color: #1f2937;
      margin: 0 0 16px 0;
      display: flex;
      align-items: center;
      gap: 8px;
    }
  }

  .files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }

  .file-item {
    background-color: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 16px;
    display: flex;
    gap: 12px;
    transition: all 0.2s ease;

    &:hover {
      box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
      border-color: #d1d5db;
    }
  }

  .file-preview {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 6px;
    overflow: hidden;
    background-color: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;

    .file-image {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .file-icon-large {
      font-size: 24px;
      line-height: 1;
    }
  }

  .file-info {
    flex: 1;
    min-width: 0;

    .file-name {
      font-size: 14px;
      font-weight: 500;
      color: #1f2937;
      margin: 0 0 8px 0;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    .file-meta {
      display: flex;
      flex-direction: column;
      gap: 4px;
      font-size: 12px;
      color: #6b7280;

      @media (min-width: 768px) {
        flex-direction: row;
        align-items: center;
        gap: 12px;

        &::before {
          content: '•';
          color: #d1d5db;
        }

        & > span:first-child::before {
          display: none;
        }
      }
    }
  }

  .file-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;

    @media (min-width: 768px) {
      flex-direction: row;
      gap: 8px;
    }

    .action-btn {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      height: 32px;
      padding: 0 10px;
      border-radius: 6px;
      border: 1px solid var(--light-shade);
      background: var(--white);
      color: var(--dark-color);
      font-size: 12px;
      cursor: pointer;
      transition: all 0.2s ease;

      &:hover {
        background: var(--light-color);
        border-color: var(--primary-color);
        color: var(--primary-color);
        transform: translateY(-1px);
      }

      &:active {
        transform: scale(0.98);
      }

      &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
      }

      svg {
        width: 16px;
        height: 16px;
      }

      &.download-btn {
        &::before {
          content: '⬇';
          font-size: 14px;
        }
      }

      &.delete-btn {
        border-color: var(--danger-color);
        color: var(--danger-color);

        &:hover {
          background: rgba(var(--danger-rgb), 0.08);
        }
      }

      &.analyze-btn {
        border-color: var(--tertiary-color);
        color: var(--tertiary-color);

        &:hover {
          background: rgba(var(--tertiary-rgb), 0.08);
        }
      }
    }
  }

  .action-btn {
    background: none;
    border: none;
    color: #6b7280;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;

    svg {
      width: 16px;
      height: 16px;
    }

    &:hover {
      background-color: #f3f4f6;
      color: #374151;

      &.delete-btn {
        background-color: #fee2e2;
        color: #dc2626;
      }
    }

    &.delete-btn {
      &:hover {
        background-color: #fee2e2;
        color: #dc2626;
      }
    }
  }

  .empty-files {
    text-align: center;
    padding: 48px 24px;
    color: #6b7280;

    .empty-icon {
      width: 64px;
      height: 64px;
      margin: 0 auto 16px;
      opacity: 0.3;
    }

    .empty-text {
      font-size: 16px;
      font-weight: 500;
      margin: 0 0 8px 0;
      color: #374151;
    }

    .empty-hint {
      font-size: 14px;
      margin: 0;
      line-height: 1.5;
    }
  }
}

// 响应式设计
@media (max-width: 768px) {
  .files-card {
    .drop-zone {
      padding: 24px 16px;
      min-height: 100px;
    }

    .upload-content {
      .upload-icon {
        width: 36px;
        height: 36px;
      }

      .upload-text {
        .upload-title {
          font-size: 14px;
        }

        .upload-hint {
          font-size: 12px;
        }
      }
    }

    .upload-progress {
      .progress-circle {
        width: 60px;
        height: 60px;

        .progress-text {
          font-size: 14px;
        }
      }

      .progress-title {
        font-size: 14px;
      }
    }

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

    .file-item {
      padding: 12px;
    }

    .file-preview {
      width: 40px;
      height: 40px;
    }

    .file-info {
      .file-name {
        font-size: 13px;
      }

      .file-meta {
        font-size: 11px;
      }
    }
  }
}

// CSS 变量定义
:host {
  --primary-color: #3880ff;
  --primary-rgb: 56, 128, 255;
  --secondary-color: #0cd1e8;
  --tertiary-color: #7044ff;
  --success-color: #2dd36f;
  --warning-color: #ffc409;
  --danger-color: #eb445a;
  --dark-color: #222428;
  --medium-color: #92949c;
  --light-color: #f4f5f8;
  --light-shade: #d7d8da;
  --white: #ffffff;
}

// 加载容器
.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 50vh;
  padding: 20px;

  .spinner {
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    position: relative;

    .spinner-circle {
      width: 100%;
      height: 100%;
      border: 4px solid var(--light-shade);
      border-top-color: var(--primary-color);
      border-radius: 50%;
      animation: spin 0.8s linear infinite;
    }
  }

  p {
    color: var(--medium-color);
    margin: 0;
    font-size: 14px;
  }
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

// 订单分配容器
.stage-order-container {
  padding: 0;

  // 通用卡片样式
  .card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 16px;
    overflow: hidden;

    .card-header {
      padding: 16px;
      border-bottom: 1px solid var(--light-shade);

      .card-title {
        display: flex;
        align-items: center;
        gap: 8px;
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--dark-color);

        .icon {
          width: 20px;
          height: 20px;
          color: var(--primary-color);
          flex-shrink: 0;
        }
      }

      .card-subtitle {
        margin: 4px 0 0;
        font-size: 12px;
        color: var(--medium-color);
      }
    }

    .card-content {
      padding: 16px;
    }
  }

  // 必填标记
  .required {
    color: var(--danger-color);
    margin-left: 4px;
  }

  // 客户信息卡片
  .customer-card {
    .info-list {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .info-item {
      .info-text {
        .info-label {
          color: var(--medium-color);
          font-size: 12px;
          margin: 0 0 4px;
        }

        .info-value {
          color: var(--dark-color);
          font-size: 15px;
          font-weight: 500;
          margin: 0;
        }

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

  // 项目基本信息卡片
  .project-info-card {
    .form-list {
      display: flex;
      flex-direction: column;
      gap: 16px;
    }

    .form-group {
      .form-label {
        display: block;
        font-weight: 500;
        color: var(--dark-color);
        margin-bottom: 8px;
        font-size: 14px;
      }

      .form-input,
      .form-select,
      .form-textarea {
        width: 100%;
        padding: 12px 16px;
        background: var(--light-color);
        border: 1px solid var(--light-shade);
        border-radius: 8px;
        font-size: 14px;
        color: var(--dark-color);
        transition: all 0.3s;
        font-family: inherit;

        &:focus {
          outline: none;
          border-color: var(--primary-color);
          background: var(--white);
          box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.1);
        }

        &::placeholder {
          color: var(--medium-color);
        }

        &:disabled {
          background: var(--light-color);
          color: var(--medium-color);
          cursor: not-allowed;
          opacity: 0.7;
        }
      }

      .form-textarea {
        min-height: 80px;
        resize: vertical;
      }

      .form-select {
        cursor: pointer;
        appearance: none;
        background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%2392949c'%3E%3Cpath d='M7 10l5 5 5-5z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 12px center;
        background-size: 20px;
        padding-right: 40px;
      }
    }
  }

  // 报价明细卡片
  .quotation-card {
    .space-section {
      margin-bottom: 24px;
      padding-bottom: 24px;
      border-bottom: 1px solid var(--light-shade);

      &:last-of-type {
        border-bottom: none;
        margin-bottom: 0;
        padding-bottom: 0;
      }

      .space-header {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 16px;
        padding: 10px 14px;
        background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
        border-radius: 8px;
        color: white;

        .icon {
          width: 20px;
          height: 20px;
          flex-shrink: 0;
        }

        h3 {
          margin: 0;
          font-size: 15px;
          font-weight: 600;
        }
      }

      .process-grid {
        display: grid;
        gap: 12px;

        .process-item {
          padding: 12px;
          background-color: var(--light-color);
          border-radius: 8px;
          border: 2px solid transparent;
          transition: all 0.3s;

          &.enabled {
            background-color: white;
            border-color: rgba(var(--primary-rgb), 0.3);
            box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.1);
          }

          .process-header {
            display: flex;
            align-items: center;
            gap: 8px;
            cursor: pointer;
            margin-bottom: 8px;
            user-select: none;

            // 自定义 checkbox
            .checkbox-wrapper {
              display: inline-flex;
              align-items: center;
              cursor: pointer;
              position: relative;
              margin-right: 4px;

              .checkbox-input {
                position: absolute;
                opacity: 0;
                cursor: pointer;
                width: 0;
                height: 0;

                &:checked + .checkbox-custom {
                  background-color: var(--primary-color);
                  border-color: var(--primary-color);

                  &::after {
                    display: block;
                  }
                }

                &:disabled + .checkbox-custom {
                  opacity: 0.5;
                  cursor: not-allowed;
                }
              }

              .checkbox-custom {
                position: relative;
                height: 20px;
                width: 20px;
                background-color: var(--white);
                border: 2px solid var(--medium-color);
                border-radius: 4px;
                transition: all 0.3s;
                display: flex;
                align-items: center;
                justify-content: center;

                &::after {
                  content: '';
                  display: none;
                  width: 5px;
                  height: 10px;
                  border: solid white;
                  border-width: 0 2px 2px 0;
                  transform: rotate(45deg);
                }
              }
            }

            .badge {
              display: inline-block;
              font-size: 12px;
              padding: 4px 10px;
              border-radius: 12px;
              font-weight: 600;

              // 根据 data-color 属性设置颜色
              &[data-color="primary"] {
                background: var(--primary-color);
                color: white;
              }

              &[data-color="secondary"] {
                background: var(--secondary-color);
                color: white;
              }

              &[data-color="tertiary"] {
                background: var(--tertiary-color);
                color: white;
              }

              &[data-color="success"] {
                background: var(--success-color);
                color: white;
              }

              &[data-color="warning"] {
                background: var(--warning-color);
                color: var(--dark-color);
              }

              &[data-color="danger"] {
                background: var(--danger-color);
                color: white;
              }
            }
          }

          .process-inputs {
            display: grid;
            gap: 10px;
            padding-top: 12px;
            border-top: 1px solid var(--light-shade);

            .input-group {
              .input-label {
                display: block;
                font-size: 12px;
                color: var(--medium-color);
                margin-bottom: 6px;
                font-weight: 500;
              }

              .input-with-note {
                display: flex;
                align-items: center;
                gap: 8px;

                .input-field {
                  flex: 1;
                  padding: 8px 12px;
                  background: var(--light-color);
                  border: 1px solid var(--light-shade);
                  border-radius: 6px;
                  font-size: 14px;
                  color: var(--dark-color);
                  transition: all 0.3s;

                  &:focus {
                    outline: none;
                    border-color: var(--primary-color);
                    background: var(--white);
                    box-shadow: 0 0 0 2px rgba(var(--primary-rgb), 0.1);
                  }

                  &::placeholder {
                    color: var(--medium-color);
                  }

                  &:disabled {
                    background: var(--light-color);
                    color: var(--medium-color);
                    cursor: not-allowed;
                    opacity: 0.7;
                  }

                  // 隐藏 number input 的上下箭头
                  &[type="number"] {
                    -moz-appearance: textfield;

                    &::-webkit-outer-spin-button,
                    &::-webkit-inner-spin-button {
                      -webkit-appearance: none;
                      margin: 0;
                    }
                  }
                }

                .input-note {
                  font-size: 12px;
                  color: var(--medium-color);
                  white-space: nowrap;
                  flex-shrink: 0;
                }
              }
            }

            .process-subtotal {
              text-align: right;
              font-size: 13px;
              font-weight: 600;
              color: var(--primary-color);
              margin-top: 4px;
              padding-top: 8px;
              border-top: 1px dashed var(--light-shade);
            }
          }
        }
      }
    }

    .total-section {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 16px 20px;
      margin-top: 20px;
      background: linear-gradient(135deg, var(--success-color) 0%, #28ba62 100%);
      border-radius: 10px;
      box-shadow: 0 4px 12px rgba(45, 211, 111, 0.3);

      .total-label {
        font-size: 16px;
        font-weight: 600;
        color: white;
      }

      .total-amount {
        font-size: 24px;
        font-weight: 700;
        color: white;
        letter-spacing: 0.5px;
      }
    }
  }

  // 设计师分配卡片
  .designer-card {
    .empty-state {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 40px 20px;
      text-align: center;

      .icon-large {
        width: 64px;
        height: 64px;
        color: var(--medium-color);
        margin-bottom: 16px;
        opacity: 0.5;
      }

      p {
        color: var(--medium-color);
        margin: 0;
        font-size: 14px;
      }
    }

    .designer-grid {
      display: grid;
      gap: 12px;

      .designer-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        background-color: var(--light-color);
        border-radius: 8px;
        border: 2px solid transparent;
        cursor: pointer;
        transition: all 0.3s;

        &:hover {
          background-color: var(--light-shade);
          transform: translateX(2px);
        }

        &.selected {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.08);
          box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);

          .designer-info h4 {
            color: var(--primary-color);
          }
        }

        .designer-avatar {
          width: 48px;
          height: 48px;
          border-radius: 50%;
          overflow: hidden;
          background: var(--light-shade);
          display: flex;
          align-items: center;
          justify-content: center;

          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
          }

          .avatar-icon {
            width: 48px;
            height: 48px;
            color: var(--medium-color);
          }
        }

        .designer-info {
          flex: 1;
          min-width: 0;

          h4 {
            margin: 0 0 4px;
            font-size: 15px;
            font-weight: 600;
            color: var(--dark-color);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: color 0.3s;
          }

          p {
            margin: 0;
            font-size: 12px;
            color: var(--medium-color);
          }
        }

        .selected-icon {
          position: absolute;
          top: 8px;
          right: 8px;
          width: 20px;
          height: 20px;
          color: var(--primary-color);
        }
      }
    }
  }

  // Badge 组件
  .badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;

    &.badge-primary {
      background: var(--primary-color);
      color: white;
    }

    &.badge-secondary {
      background: var(--secondary-color);
      color: white;
    }

    &.badge-tertiary {
      background: var(--tertiary-color);
      color: white;
    }

    &.badge-success {
      background: var(--success-color);
      color: white;
    }

    &.badge-warning {
      background: var(--warning-color);
      color: var(--dark-color);
    }

    &.badge-danger {
      background: var(--danger-color);
      color: white;
    }

    &.badge-medium {
      background: var(--medium-color);
      color: white;
    }
  }

  // 场景选择卡片（家装/工装）
  .scene-card {
    .section-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--dark-color);
      margin: 20px 0 12px;

      &:first-child {
        margin-top: 0;
      }
    }

    // 单选框组
    .radio-group {
      display: flex;
      flex-wrap: wrap;
      gap: 12px;
      margin-top: 8px;

      .radio-label {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 8px 16px;
        background: var(--light-color);
        border: 2px solid transparent;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s;
        user-select: none;

        &:hover {
          background: var(--light-shade);
        }

        input[type="radio"] {
          cursor: pointer;

          &:checked {
            + .radio-text {
              font-weight: 600;
              color: var(--primary-color);
            }
          }

          &:disabled {
            cursor: not-allowed;
          }
        }

        .radio-text {
          font-size: 14px;
          color: var(--dark-color);
          transition: all 0.3s;
        }
      }
    }

    // 房间选择（家装）
    .room-selection {
      margin-top: 24px;

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

      .generate-quotation-btn {
        width: 100%;
        margin-top: 24px;
        padding: 14px 24px;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(56, 128, 255, 0.25);
        transition: all 0.3s ease;

        .icon {
          width: 20px;
          height: 20px;
        }

        &:hover:not(:disabled) {
          transform: translateY(-2px);
          box-shadow: 0 6px 16px rgba(56, 128, 255, 0.35);
        }

        &:active:not(:disabled) {
          transform: translateY(0);
        }

        &:disabled {
          opacity: 0.5;
          cursor: not-allowed;
          box-shadow: none;
        }
      }

      .room-item {
        border: 2px solid var(--light-shade);
        border-radius: 8px;
        padding: 14px;
        background: var(--white);
        transition: all 0.3s;

        &.selected {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.05);
          box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.15);
        }

        .room-checkbox {
          display: flex;
          align-items: flex-start;
          gap: 12px;
          cursor: pointer;
          user-select: none;

          input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin-top: 2px;
            cursor: pointer;
            flex-shrink: 0;

            &:disabled {
              cursor: not-allowed;
            }
          }

          .checkbox-custom {
            // 预留自定义复选框样式
          }

          .room-info {
            flex: 1;

            h5 {
              margin: 0 0 6px;
              font-size: 16px;
              font-weight: 600;
              color: var(--dark-color);
            }

            .base-price {
              margin: 0;
              font-size: 14px;
              color: var(--success-color);
              font-weight: 600;
            }
          }
        }

        .room-adjustments {
          margin-top: 12px;
          padding-top: 12px;
          border-top: 1px solid var(--light-shade);
          display: flex;
          flex-direction: column;
          gap: 10px;
        }
      }
    }

    // 空间选择（工装）
    .space-selection {
      margin-top: 24px;

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

      .generate-quotation-btn {
        width: 100%;
        margin-top: 24px;
        padding: 14px 24px;
        font-size: 16px;
        font-weight: 600;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        box-shadow: 0 4px 12px rgba(56, 128, 255, 0.25);
        transition: all 0.3s ease;

        .icon {
          width: 20px;
          height: 20px;
        }

        &:hover:not(:disabled) {
          transform: translateY(-2px);
          box-shadow: 0 6px 16px rgba(56, 128, 255, 0.35);
        }

        &:active:not(:disabled) {
          transform: translateY(0);
        }

        &:disabled {
          opacity: 0.5;
          cursor: not-allowed;
          box-shadow: none;
        }
      }

      .space-item {
        border: 2px solid var(--light-shade);
        border-radius: 8px;
        padding: 14px;
        background: var(--white);
        transition: all 0.3s;

        &.selected {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.05);
          box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.15);
        }

        .space-checkbox {
          display: flex;
          align-items: flex-start;
          gap: 12px;
          cursor: pointer;
          user-select: none;

          input[type="checkbox"] {
            width: 20px;
            height: 20px;
            margin-top: 2px;
            cursor: pointer;
            flex-shrink: 0;

            &:disabled {
              cursor: not-allowed;
            }
          }

          .space-info {
            flex: 1;

            h5 {
              margin: 0 0 4px;
              font-size: 16px;
              font-weight: 600;
              color: var(--dark-color);
            }

            .space-type {
              margin: 0 0 6px;
              font-size: 12px;
              color: var(--medium-color);
            }

            .base-price {
              margin: 0;
              font-size: 14px;
              color: var(--success-color);
              font-weight: 600;
            }
          }
        }

        .space-adjustments {
          margin-top: 12px;
          padding-top: 12px;
          border-top: 1px solid var(--light-shade);
          display: flex;
          flex-direction: column;
          gap: 10px;
        }
      }
    }

    // 加价选项
    .adjustment-item {
      display: flex;
      align-items: center;
      gap: 8px;

      .adjustment-label {
        font-size: 13px;
        color: var(--medium-color);
        min-width: 90px;
        flex-shrink: 0;
      }

      .adjustment-input {
        flex: 1;
        padding: 6px 10px;
        border: 1px solid var(--light-shade);
        border-radius: 6px;
        font-size: 13px;
        background: var(--light-color);
        transition: all 0.3s;

        &:focus {
          outline: none;
          border-color: var(--primary-color);
          background: var(--white);
        }

        // 隐藏 number input 的上下箭头
        &[type="number"] {
          -moz-appearance: textfield;

          &::-webkit-outer-spin-button,
          &::-webkit-inner-spin-button {
            -webkit-appearance: none;
            margin: 0;
          }
        }
      }

      .adjustment-unit {
        font-size: 13px;
        color: var(--medium-color);
        flex-shrink: 0;
      }

      .adjustment-checkbox {
        display: flex;
        align-items: center;
        gap: 6px;
        cursor: pointer;
        user-select: none;

        input[type="checkbox"] {
          width: 16px;
          height: 16px;
          cursor: pointer;
        }

        .checkbox-text {
          font-size: 13px;
          color: var(--dark-color);
        }
      }
    }
  }

  // 设计师分配 - 项目组和组员选择
  .designer-card {
    .section-title {
      font-size: 15px;
      font-weight: 600;
      color: var(--dark-color);
      margin: 0 0 12px;

      &:not(:first-child) {
        margin-top: 24px;
      }
    }

    .loading-spinner {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 12px;
      padding: 40px 20px;

      .spinner-sm {
        width: 24px;
        height: 24px;
        border: 3px solid var(--light-shade);
        border-top-color: var(--primary-color);
        border-radius: 50%;
        animation: spin 0.8s linear infinite;
      }

      p {
        margin: 0;
        font-size: 14px;
        color: var(--medium-color);
      }
    }

    // 项目组选择
    .department-section {
      margin-bottom: 24px;

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

      .department-item {
        position: relative;
        padding: 14px;
        border: 2px solid var(--light-shade);
        border-radius: 8px;
        background: var(--white);
        cursor: pointer;
        transition: all 0.3s;

        &:hover {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.03);
          transform: translateY(-2px);
        }

        &.selected {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.08);
          box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);
        }

        h5 {
          margin: 0 0 6px;
          font-size: 15px;
          font-weight: 600;
          color: var(--dark-color);
          padding-right: 24px;
        }

        p {
          margin: 0;
          font-size: 13px;
          color: var(--medium-color);
        }

        .selected-icon {
          position: absolute;
          top: 10px;
          right: 10px;
          width: 22px;
          height: 22px;
          color: var(--primary-color);
        }
      }
    }

    // 已分配组员展示
    .assigned-teams-section {
      margin-bottom: 32px;
      padding-bottom: 24px;
      border-bottom: 2px solid var(--light-shade);

      .team-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 16px;
        margin-top: 16px;
      }

      .team-item {
        background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--primary-rgb), 0.02) 100%);
        border: 2px solid var(--primary-color);
        border-radius: 10px;
        padding: 16px;
        transition: all 0.3s ease;
        position: relative;

        &.clickable {
          cursor: pointer;

          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.15);
            background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.04) 100%);

            .edit-icon {
              opacity: 1;
            }
          }

          &:active {
            transform: translateY(0);
          }
        }

        &:not(.clickable):hover {
          transform: translateY(-2px);
          box-shadow: 0 6px 16px rgba(var(--primary-rgb), 0.15);
        }

        .edit-icon {
          position: absolute;
          top: 12px;
          right: 12px;
          width: 20px;
          height: 20px;
          color: var(--primary-color);
          opacity: 0.6;
          transition: opacity 0.3s;
        }

        .team-member {
          display: flex;
          align-items: center;
          gap: 14px;

          .member-avatar {
            width: 56px;
            height: 56px;
            border-radius: 50%;
            overflow: hidden;
            background: white;
            border: 3px solid var(--primary-color);
            flex-shrink: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.2);

            img {
              width: 100%;
              height: 100%;
              object-fit: cover;
            }

            .avatar-icon {
              width: 32px;
              height: 32px;
              color: var(--primary-color);
            }
          }

          .member-info {
            flex: 1;
            min-width: 0;

            h5 {
              margin: 0 0 6px;
              font-size: 16px;
              font-weight: 700;
              color: var(--dark-color);
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            }

            .member-spaces {
              margin: 0;
              font-size: 13px;
              color: var(--primary-color);
              font-weight: 500;
              display: flex;
              align-items: center;
              gap: 4px;

              &::before {
                content: '📦';
                font-size: 14px;
              }
            }
          }
        }
      }
    }

    // 组员选择
    .designer-section {
      .designer-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 12px;
      }

      .designer-item {
        position: relative;
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px;
        border: 2px solid var(--light-shade);
        border-radius: 8px;
        background: var(--white);
        cursor: pointer;
        transition: all 0.3s;

        &:hover {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.03);
          transform: translateX(2px);
        }

        &.selected {
          border-color: var(--primary-color);
          background: rgba(var(--primary-rgb), 0.08);
          box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.2);

          .designer-info h4 {
            color: var(--primary-color);
          }
        }

        .designer-avatar {
          width: 48px;
          height: 48px;
          border-radius: 50%;
          overflow: hidden;
          background: var(--light-shade);
          flex-shrink: 0;
          display: flex;
          align-items: center;
          justify-content: center;

          img {
            width: 100%;
            height: 100%;
            object-fit: cover;
          }

          .avatar-icon {
            width: 28px;
            height: 28px;
            color: var(--medium-color);
          }
        }

        .designer-info {
          flex: 1;
          min-width: 0;

          h4 {
            margin: 0 0 4px;
            font-size: 15px;
            font-weight: 600;
            color: var(--dark-color);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            transition: color 0.3s;
          }

          p {
            margin: 0;
            font-size: 12px;
            color: var(--medium-color);
          }
        }

        .selected-icon {
          position: absolute;
          top: 8px;
          right: 8px;
          width: 20px;
          height: 20px;
          color: var(--primary-color);
        }
      }
    }
  }

  // 操作按钮
  .action-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    padding: 16px 0;
    margin-top: 20px;

    .btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      padding: 12px 24px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s;
      border: none;
      outline: none;
      height: 48px;

      .icon {
        width: 20px;
        height: 20px;
        flex-shrink: 0;
      }

      &.btn-primary {
        background: var(--primary-color);
        color: white;

        &:hover {
          background: #2f6ce5;
          transform: translateY(-2px);
          box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
        }

        &:active {
          transform: translateY(0);
        }
      }

      &.btn-outline {
        background: white;
        color: var(--primary-color);
        border: 2px solid var(--primary-color);

        &:hover {
          background: var(--primary-color);
          color: white;
        }

        &:active {
          transform: scale(0.98);
        }
      }

      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        pointer-events: none;
      }
    }
  }
}

// 响应式适配
@media (min-width: 768px) {
  .stage-order-container {
    .quotation-card {
      .space-section {
        .process-grid {
          grid-template-columns: repeat(2, 1fr);
        }
      }
    }

    .designer-card {
      .designer-grid {
        grid-template-columns: repeat(2, 1fr);
      }
    }
  }
}

@media (min-width: 1024px) {
  .stage-order-container {
    .quotation-card {
      .space-section {
        .process-grid {
          grid-template-columns: repeat(3, 1fr);
        }
      }
    }

    .designer-card {
      .designer-grid {
        grid-template-columns: repeat(3, 1fr);
      }
    }
  }
}

// 模态框样式
.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: 10000;
  animation: fadeIn 0.2s ease-out;
}

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

.modal-dialog {
  background: var(--white);
  border-radius: 12px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.3s ease-out;
}

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

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

  .modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
  }

  .modal-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s;

    .icon {
      width: 20px;
      height: 20px;
      color: var(--medium-color);
    }

    &:hover {
      background: var(--light-color);

      .icon {
        color: var(--dark-color);
      }
    }
  }
}

.modal-content {
  flex: 1;
  overflow-y: auto;
  padding: 24px;

  .designer-preview {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.05) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border-radius: 10px;
    margin-bottom: 24px;

    .designer-avatar {
      width: 64px;
      height: 64px;
      border-radius: 50%;
      overflow: hidden;
      background: var(--white);
      border: 3px solid var(--primary-color);
      display: flex;
      align-items: center;
      justify-content: center;
      box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.2);

      img {
        width: 100%;
        height: 100%;
        object-fit: cover;
      }

      .avatar-icon {
        width: 36px;
        height: 36px;
        color: var(--primary-color);
      }
    }

    .designer-name {
      font-size: 18px;
      font-weight: 600;
      color: var(--dark-color);
    }
  }

  .space-selection-section {
    .form-label {
      display: block;
      font-weight: 500;
      color: var(--dark-color);
      margin-bottom: 8px;
      font-size: 14px;

      .required {
        color: var(--danger-color);
        margin-left: 4px;
      }
    }

    .form-help {
      margin: 0 0 12px;
      font-size: 13px;
      color: var(--medium-color);
    }

    .space-checkbox-list {
      display: flex;
      flex-direction: column;
      gap: 10px;

      .space-checkbox-item {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 12px 16px;
        background: var(--light-color);
        border: 2px solid transparent;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.3s;
        user-select: none;

        &:hover {
          background: var(--light-shade);
          border-color: rgba(var(--primary-rgb), 0.3);
        }

        input[type="checkbox"] {
          position: absolute;
          opacity: 0;
          cursor: pointer;
          width: 0;
          height: 0;

          &:checked + .checkbox-custom {
            background-color: var(--primary-color);
            border-color: var(--primary-color);

            &::after {
              display: block;
            }
          }

          &:checked ~ .space-name {
            color: var(--primary-color);
            font-weight: 600;
          }
        }

        .checkbox-custom {
          position: relative;
          height: 20px;
          width: 20px;
          background-color: var(--white);
          border: 2px solid var(--medium-color);
          border-radius: 4px;
          transition: all 0.3s;
          display: flex;
          align-items: center;
          justify-content: center;
          flex-shrink: 0;

          &::after {
            content: '';
            display: none;
            width: 5px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
          }
        }

        .space-name {
          flex: 1;
          font-size: 14px;
          color: var(--dark-color);
          transition: all 0.3s;
        }
      }
    }
  }
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px;
  border-top: 1px solid var(--light-shade);

  .btn {
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    border: none;
    outline: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    &.btn-outline {
      background: white;
      color: var(--dark-color);
      border: 2px solid var(--light-shade);

      &:hover:not(:disabled) {
        background: var(--light-color);
        border-color: var(--medium-color);
      }
    }

    &.btn-primary {
      background: var(--primary-color);
      color: white;

      &:hover:not(:disabled) {
        background: #2f6ce5;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(var(--primary-rgb), 0.3);
      }

      &:active:not(:disabled) {
        transform: translateY(0);
      }
    }

    &:disabled {
      opacity: 0.5;
      cursor: not-allowed;
      pointer-events: none;
    }
  }
}

// 移动端优化
@media (max-width: 480px) {
  .stage-order-container {
    .card {
      border-radius: 10px;
      margin-bottom: 12px;

      .card-header {
        padding: 12px;

        .card-title {
          font-size: 15px;

          .icon {
            width: 18px;
            height: 18px;
          }
        }

        .card-subtitle {
          font-size: 11px;
        }
      }

      .card-content {
        padding: 12px;
      }
    }

    .quotation-card {
      .space-section {
        margin-bottom: 20px;
        padding-bottom: 20px;

        .space-header {
          padding: 8px 12px;

          .icon {
            width: 18px;
            height: 18px;
          }

          h3 {
            font-size: 14px;
          }
        }

        .process-grid {
          gap: 10px;

          .process-item {
            padding: 10px;

            .process-header {
              .checkbox-wrapper {
                .checkbox-custom {
                  height: 18px;
                  width: 18px;

                  &::after {
                    width: 4px;
                    height: 8px;
                  }
                }
              }

              .badge {
                font-size: 11px;
                padding: 3px 8px;
              }
            }
          }
        }
      }

      .total-section {
        padding: 12px 16px;

        .total-label {
          font-size: 14px;
        }

        .total-amount {
          font-size: 20px;
        }
      }
    }

    .designer-card {
      .designer-grid {
        .designer-item {
          padding: 10px;

          .designer-avatar {
            width: 40px;
            height: 40px;

            .avatar-icon {
              width: 40px;
              height: 40px;
            }
          }

          .designer-info {
            h4 {
              font-size: 14px;
            }

            p {
              font-size: 11px;
            }
          }

          .selected-icon {
            width: 24px;
            height: 24px;
          }
        }
      }
    }

    .action-buttons {
      gap: 10px;
      padding: 12px 0;

      .btn {
        padding: 10px 16px;
        font-size: 13px;
        height: 44px;

        .icon {
          width: 18px;
          height: 18px;
        }
      }
    }

    .form-group {
      .form-input,
      .form-select,
      .form-textarea {
        padding: 10px 12px;
        font-size: 13px;
      }

      .form-select {
        background-position: right 10px center;
        background-size: 18px;
        padding-right: 36px;
      }
    }
  }
}
