@use 'sass:math';
// iOS风格变量定义
$primary-color: #007AFF;
$primary-dark: #0062CC;
$secondary-color: #34C759;
$success-color: #34C759;
$warning-color: #FF9500;
$danger-color: #FF3B30;
$text-primary: #000000;
$text-secondary: #3C3C43;
$text-tertiary: #8E8E93;
$border-color: #D1D1D6;
$background-primary: #FFFFFF;
$background-secondary: #F2F2F7;
$background-tertiary: #E5E5EA;
$shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
$shadow-md: 0 4px 10px rgba(0,0,0,0.1);
$shadow-lg: 0 10px 30px rgba(0,0,0,0.1);
$border-radius: 10px;
$transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
$main-font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
$heading-font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', sans-serif;
$grid-gap: 16px;
$card-padding: 16px;

// 主容器样式 - iOS风格白色背景
.consultation-order-container {
  min-height: 100vh;
  background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
  padding: 24px;
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  animation: fadeIn 0.5s ease-out;
  
  @media (max-width: 768px) {
    padding: 16px;
  }
}

// 客户信息长条栏样式
.customer-info-bar {
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 122, 255, 0.1);
  transition: all 0.3s ease;
  
  &:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-1px);
  }
  
  .customer-bar-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    
    @media (max-width: 768px) {
      flex-direction: column;
      gap: 16px;
    }
  }
  
  .customer-search-area {
    flex: 1;
    position: relative;
    
    .search-input-container {
      display: flex;
      align-items: center;
      background: #ffffff;
      border: 2px solid #e5e5ea;
      border-radius: 12px;
      padding: 12px 16px;
      transition: all 0.3s ease;
      
      &:focus-within {
        border-color: #007AFF;
        box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
      }
      
      .search-icon {
        color: #8e8e93;
        margin-right: 12px;
        
        svg {
          width: 20px;
          height: 20px;
        }
      }
      
      .customer-search-input {
        flex: 1;
        border: none;
        outline: none;
        font-size: 16px;
        color: #1d1d1f;
        background: transparent;
        
        &::placeholder {
          color: #8e8e93;
        }
      }
      
      .search-action-btn {
        background: #007AFF;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 8px 16px;
        font-size: 14px;
        font-weight: 500;
        cursor: pointer;
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        gap: 6px;
        
        &:hover {
          background: #0062CC;
          transform: translateY(-1px);
        }
        
        &:disabled {
          background: #d1d1d6;
          cursor: not-allowed;
          transform: none;
        }
      }
    }
    
    // 搜索结果下拉
    .search-dropdown {
      position: absolute;
      top: 100%;
      left: 0;
      right: 0;
      background: white;
      border-radius: 12px;
      box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
      border: 1px solid #e5e5ea;
      margin-top: 8px;
      z-index: 1000;
      max-height: 300px;
      overflow-y: auto;
      
      .dropdown-header {
        padding: 12px 16px;
        border-bottom: 1px solid #f2f2f7;
        font-size: 14px;
        color: #8e8e93;
        font-weight: 500;
      }
      
      .customer-option {
        display: flex;
        align-items: center;
        padding: 12px 16px;
        cursor: pointer;
        transition: all 0.2s ease;
        
        &:hover {
          background: #f2f2f7;
        }
        
        .customer-avatar-sm {
          width: 40px;
          height: 40px;
          border-radius: 50%;
          background: #007AFF;
          color: white;
          display: flex;
          align-items: center;
          justify-content: center;
          font-weight: 600;
          margin-right: 12px;
          
          img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            object-fit: cover;
          }
        }
        
        .customer-details {
          flex: 1;
          
          .customer-name {
            font-weight: 600;
            color: #1d1d1f;
            margin-bottom: 2px;
          }
          
          .customer-phone {
            font-size: 14px;
            color: #8e8e93;
          }
        }
        
        .customer-tags {
          .tag {
            background: #e5f4ff;
            color: #007AFF;
            padding: 4px 8px;
            border-radius: 6px;
            font-size: 12px;
            font-weight: 500;
          }
        }
      }
    }
    
    // 已选择客户信息展示
    .selected-customer-info {
      display: flex;
      align-items: center;
      gap: 16px;
      
      .customer-avatar-lg {
        width: 60px;
        height: 60px;
        border-radius: 50%;
        background: #007AFF;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 700;
        font-size: 24px;
        
        img {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          object-fit: cover;
        }
      }
      
      .customer-main-info {
        flex: 1;
        
        .customer-name-lg {
          font-size: 20px;
          font-weight: 700;
          color: #1d1d1f;
          margin-bottom: 4px;
        }
        
        .customer-contact {
          display: flex;
          gap: 16px;
          
          .phone, .wechat {
            font-size: 14px;
            color: #8e8e93;
          }
        }
      }
      
      .customer-history {
        display: flex;
        flex-direction: column;
        gap: 4px;
        
        .history-item {
          display: flex;
          gap: 8px;
          font-size: 14px;
          
          .label {
            color: #8e8e93;
            font-weight: 500;
          }
          
          .value {
            color: #007AFF;
            font-weight: 600;
          }
        }
      }
    }
  }
  
  .customer-actions {
    display: flex;
    gap: 12px;
    
    .action-btn {
      padding: 10px 16px;
      border-radius: 8px;
      font-size: 14px;
      font-weight: 500;
      cursor: pointer;
      transition: all 0.3s ease;
      display: flex;
      align-items: center;
      gap: 6px;
      border: none;
      
      &.primary {
        background: #007AFF;
        color: white;
        
        &:hover {
          background: #0062CC;
          transform: translateY(-1px);
        }
      }
      
      &.secondary {
        background: #f2f2f7;
        color: #8e8e93;
        
        &:hover {
          background: #e5e5ea;
          color: #1d1d1f;
        }
      }
      
      &:disabled {
        opacity: 0.5;
        cursor: not-allowed;
        transform: none;
      }
    }
  }
}

// 新客户表单样式
.new-customer-form {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid #f2f2f7;
  max-width: 100%;
  overflow: hidden; // 防止内容溢出
  
  .form-header {
    margin-bottom: 20px;
    
    h3 {
      font-size: 18px;
      font-weight: 600;
      color: #1d1d1f;
      margin: 0 0 6px 0;
    }
    
    p {
      font-size: 14px;
      color: #8e8e93;
      margin: 0;
      line-height: 1.4;
    }
  }
  
  .simple-customer-form {
    .form-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
      align-items: start;
      width: 100%;
      
      @media (max-width: 992px) {
        gap: 16px;
      }
      
      @media (max-width: 768px) {
        grid-template-columns: 1fr;
        gap: 16px;
      }
      
      @media (max-width: 480px) {
        gap: 12px;
      }
    }
    
    .form-field {
      display: flex;
      flex-direction: column;
      min-width: 0; // 防止flex项目溢出
      
      .field-label {
        display: block;
        font-size: 14px;
        font-weight: 500;
        color: #1d1d1f;
        margin-bottom: 8px;
        white-space: nowrap;
        
        .required {
          color: #ff3b30;
        }
      }
      
      .field-input {
        width: 100%;
        min-width: 0; // 防止输入框溢出
        padding: 12px 16px;
        border: 2px solid #e5e5ea;
        border-radius: 8px;
        font-size: 16px;
        transition: all 0.3s ease;
        background: white;
        box-sizing: border-box; // 确保padding不会导致溢出
        
        &:focus {
          outline: none;
          border-color: #007AFF;
          box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
        }
        
        &::placeholder {
          color: #8e8e93;
        }
        
        &:invalid {
          border-color: #ff3b30;
        }
      }
    }
  }
}

// 项目配置卡片样式
.project-config-card {
  background: white;
  border-radius: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 24px;
  margin-bottom: 24px;
  border: 1px solid rgba(0, 122, 255, 0.1);
  
  .config-header {
    margin-bottom: 24px;
    
    h2 {
      font-size: 20px;
      font-weight: 700;
      color: #1d1d1f;
      margin: 0 0 4px 0;
    }
    
    p {
      font-size: 14px;
      color: #8e8e93;
      margin: 0;
    }
  }
  
  .project-config-form {
    .config-grid {
      display: grid;
      grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
      gap: 20px;
      
      @media (max-width: 768px) {
        grid-template-columns: 1fr;
      }
    }
    
    .config-item {
      background: #f8f9fa;
      border-radius: 12px;
      padding: 16px;
      border: 1px solid #e5e5ea;
      transition: all 0.3s ease;
      
      &:hover {
        border-color: #007AFF;
        box-shadow: 0 4px 12px rgba(0, 122, 255, 0.1);
      }
      
      .config-label {
        display: flex;
        align-items: center;
        gap: 8px;
        margin-bottom: 12px;
        font-size: 14px;
        font-weight: 600;
        color: #1d1d1f;
        
        svg {
          color: #007AFF;
        }
      }
      
      .config-select, .config-input {
        width: 100%;
        padding: 10px 12px;
        border: 1px solid #d1d1d6;
        border-radius: 8px;
        font-size: 14px;
        background: white;
        transition: all 0.3s ease;
        
        &:focus {
          outline: none;
          border-color: #007AFF;
          box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
        }
      }
      
      .payment-input-group {
        display: flex;
        align-items: center;
        background: white;
        border: 1px solid #d1d1d6;
        border-radius: 8px;
        overflow: hidden;
        transition: all 0.3s ease;
        
        &:focus-within {
          border-color: #007AFF;
          box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
        }
        
        .payment-input {
          flex: 1;
          border: none;
          padding: 10px 12px;
          
          &:focus {
            outline: none;
            box-shadow: none;
          }
        }
        
        .currency-unit {
          padding: 10px 12px;
          background: #f2f2f7;
          color: #8e8e93;
          font-size: 14px;
          font-weight: 500;
        }
      }
      
      .confirmation-group {
        .confirmation-checkbox {
          display: flex;
          align-items: center;
          gap: 8px;
          cursor: pointer;
          
          input[type="checkbox"] {
            width: 18px;
            height: 18px;
            accent-color: #007AFF;
          }
          
          .checkbox-text {
            font-size: 14px;
            color: #1d1d1f;
          }
        }
      }
      
      .payment-details {
        display: flex;
        gap: 8px;
        
        .small {
          flex: 1;
        }
      }
    }
  }
}

// 主表单容器 - dashboard卡片风格
.order-form {
  background-color: #ffffff;
  border-radius: 20px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  padding: 32px;
  margin-bottom: 32px;
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.05);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 122, 255, 0.3) 50%, transparent 100%);
  }
  
  &:hover {
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
  }
  
  @media (max-width: 768px) {
    padding: 24px;
    margin-bottom: 24px;
    border-radius: 16px;
  }
}

.main-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0;
  
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  
  @media (max-width: 768px) {
    gap: 24px;
  }
}

// iOS风格页面头部样式
.page-header {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  padding: 32px;
  background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #007AFF 0%, #34C759 100%);
  }

  // 返回按钮样式
  .back-button {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 12px;
    color: #007AFF;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    margin-right: 24px;
    min-width: 80px;
    
    &:hover {
      background: rgba(0, 122, 255, 0.15);
      border-color: rgba(0, 122, 255, 0.3);
      transform: translateY(-1px);
      box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
    }
    
    &:active {
      transform: translateY(0);
      box-shadow: 0 2px 6px rgba(0, 122, 255, 0.15);
    }
    
    svg {
      transition: transform 0.3s ease;
    }
    
    &:hover svg {
      transform: translateX(-2px);
    }
    
    span {
      font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', sans-serif;
    }
  }

  // 头部内容区域
  .header-content {
    flex: 1;
    text-align: center;
  }
  
  h1 {
    font-size: 36px;
    font-weight: 800;
    color: #1c1c1e;
    margin: 0 0 12px;
    line-height: 1.1;
    letter-spacing: -0.6px;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', 'Helvetica Neue', sans-serif;
    background: linear-gradient(135deg, #1c1c1e 0%, #3c3c43 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
  }
  
  .header-meta {
    font-size: 16px;
    color: #6c757d;
    margin: 0;
    line-height: 1.5;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
    opacity: 0.9;
  }
  
  .subtitle {
    font-size: 15px;
    color: #8e8e93;
    margin: 0;
    line-height: 1.4;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
  }
  
  @media (max-width: 768px) {
    padding: 24px 16px;
    margin-bottom: 24px;
    
    h1 {
      font-size: 28px;
      font-weight: 700;
    }
    
    .header-meta {
      font-size: 14px;
    }
  }
}

// 订单分配方式选择样式
.creation-method-section {
  margin-bottom: 32px;
  animation: fadeIn 0.6s ease-out;
}

.method-selector {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 24px;
  border: 1px solid #f0f0f0;
  
  .method-title {
    font-size: 18px;
    font-weight: 600;
    color: #1c1c1e;
    margin-bottom: 20px;
    text-align: center;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', sans-serif;
  }
}

.method-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  
  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

.method-option {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: #ffffff;
  border: 2px solid #e5e5ea;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.05) 0%, rgba(52, 199, 89, 0.05) 100%);
    transition: width 0.3s ease;
    z-index: 1;
  }
  
  &:hover {
    border-color: #007AFF;
    box-shadow: 0 8px 25px rgba(0, 122, 255, 0.15);
    transform: translateY(-2px);
    
    &::before {
      width: 100%;
    }
    
    .option-icon {
      transform: scale(1.1);
      box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
    }
    
    .option-title {
      color: #007AFF;
    }
  }
  
  &.active {
    border-color: #007AFF;
    background: linear-gradient(135deg, #ffffff 0%, #f0f8ff 100%);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.2);
    
    &::before {
      width: 100%;
      background: linear-gradient(135deg, rgba(0, 122, 255, 0.08) 0%, rgba(52, 199, 89, 0.08) 100%);
    }
    
    .option-icon {
      background: linear-gradient(135deg, #007AFF 0%, #34C759 100%);
      color: #ffffff;
      box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
    }
    
    .option-title {
      color: #007AFF;
      font-weight: 600;
    }
    
    .option-badge {
      background: linear-gradient(135deg, #007AFF 0%, #34C759 100%);
      color: #ffffff;
      animation: pulse 2s infinite;
    }
  }
  
  @media (max-width: 768px) {
    padding: 16px;
    gap: 12px;
  }
}

.option-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f2f2f7;
  color: #8e8e93;
  transition: all 0.3s ease;
  position: relative;
  z-index: 2;
  
  &.miniprogram-icon {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    color: #1976d2;
  }
  
  &.manual-icon {
    background: linear-gradient(135deg, #fff3e0 0%, #fef7ed 100%);
    color: #f57c00;
  }
  
  svg {
    width: 24px;
    height: 24px;
    transition: transform 0.3s ease;
  }
}

.option-content {
  flex: 1;
  position: relative;
  z-index: 2;
}

.option-title {
  font-size: 16px;
  font-weight: 600;
  color: #1c1c1e;
  margin: 0 0 4px;
  transition: all 0.3s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'PingFang SC', sans-serif;
}

.option-desc {
  font-size: 13px;
  color: #8e8e93;
  margin: 0;
  line-height: 1.4;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', sans-serif;
}

.option-badge {
  background: linear-gradient(135deg, #34C759 0%, #30D158 100%);
  color: #ffffff;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  position: relative;
  z-index: 2;
  transition: all 0.3s ease;
  box-shadow: 0 2px 6px rgba(52, 199, 89, 0.3);
}

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

// 成功提示样式 - dashboard设计
.success-toast {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #ffffff;
  color: #1c1c1e;
  padding: 16px 20px;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  border-left: 4px solid #34c759;
  z-index: 1000;
  animation: slideInRight 0.3s ease-out;
  min-width: 280px;
  
  .toast-content {
    display: flex;
    align-items: center;
    gap: 12px;
    
    svg {
      flex-shrink: 0;
      color: #34c759;
    }
    
    span {
      font-weight: 500;
      font-size: 16px;
    }
  }
}

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

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

// 动画效果 - dashboard风格
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

// iOS风格信息卡片样式
.info-card {
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  border: 1px solid rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: fadeIn 0.3s ease-out;
  margin-bottom: 20px;
  position: relative;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 122, 255, 0.2) 50%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  &:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: rgba(0, 122, 255, 0.1);
    
    &::before {
      opacity: 1;
    }
  }
  
  &:last-child {
    margin-bottom: 0;
  }
}

// iOS风格卡片头部样式
.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  background: linear-gradient(135deg, #ffffff 0%, #fafbfc 100%);
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  
  &::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 24px;
    right: 24px;
    height: 1px;
    background: linear-gradient(90deg, transparent 0%, rgba(0, 122, 255, 0.1) 50%, transparent 100%);
  }
  
  @media (max-width: 768px) {
    padding: 16px 20px;
    
    &::after {
      left: 20px;
      right: 20px;
    }
  }
  
  .header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    
    @media (max-width: 768px) {
      gap: 8px;
      flex-direction: column-reverse;
      align-items: flex-end;
    }
    
    @media (max-width: 480px) {
      flex-direction: row;
      gap: 6px;
      
      .btn-sm {
        padding: 6px 12px;
        font-size: 13px;
        
        svg {
          width: 14px;
          height: 14px;
        }
        
        span {
          display: none;
        }
      }
    }
  }
  
  .icon-wrapper {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    
    &.customer-icon {
      background-color: #007AFF;
      color: #ffffff;
    }
    
    &.requirement-icon {
      background-color: #007AFF;
      color: #ffffff;
    }
    
    &.price-icon {
      background-color: #007AFF;
      color: #ffffff;
    }
    
    &.consultation-icon {
      background-color: #007AFF;
      color: #ffffff;
    }
  }
  
  .header-text {
    h2 {
      font-size: 17px;
      font-weight: 600;
      color: #000000;
      margin: 0;
      line-height: 1.3;
    }
    
    p {
      font-size: 13px;
      color: #8e8e93;
      margin: 2px 0 0;
      line-height: 1.4;
    }
  }
}

// 卡片内容样式
.card-content {
  padding: 32px 24px;
  background: #ffffff;
  
  @media (max-width: 768px) {
    padding: 24px 20px;
  }
}

// 表单分组样式 - dashboard风格
.form-section {
  background-color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  padding: 28px;
  margin-bottom: 28px;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  animation: fadeIn 0.5s ease-out;
  border: 1px solid rgba(0, 0, 0, 0.04);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #007AFF 0%, #34C759 50%, #FF9500 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
  }
  
  &:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    
    &::before {
      opacity: 1;
    }
  }
  
  &:last-child {
    margin-bottom: 0;
  }
  
  &:nth-child(1) {
    animation-delay: 0s;
  }
  
  &:nth-child(2) {
    animation-delay: 0.1s;
  }
  
  &:nth-child(3) {
    animation-delay: 0.2s;
  }
  
  &:nth-child(4) {
    animation-delay: 0.3s;
  }
  
  &:nth-child(5) {
    animation-delay: 0.4s;
  }
  
  @media (max-width: 768px) {
    padding: 20px;
    margin-bottom: 20px;
    border-radius: 14px;
  }
  
  .section-title {
    font-size: 22px;
    font-weight: 700;
    color: #1c1c1e;
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    
    .section-subtitle {
      font-size: 14px;
      font-weight: 400;
      color: #8e8e93;
      margin-left: 8px;
    }
  }
}

// 表单网格布局 - dashboard响应式网格
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  
  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

// 表单行布局 - 支持多行表单
.form-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-bottom: 20px;
  
  &:last-child {
    margin-bottom: 0;
  }
  
  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
  }
}

// iOS风格表单字段样式
.form-field {
  display: flex;
  flex-direction: column;
  margin-bottom: 16px;
  
  &.full-width {
    grid-column: 1 / -1;
  }
  
  .field-label {
    font-size: 15px;
    font-weight: 400;
    color: #000000;
    margin-bottom: 8px;
    
    .required {
      color: #ff3b30;
      margin-left: 2px;
    }
    
    .optional {
      color: #8e8e93;
      font-size: 13px;
      font-weight: 300;
      margin-left: 4px;
    }
  }
  
  .field-input,
  .field-select,
  .field-textarea {
    padding: 11px 16px;
    border: 1px solid #d1d1d6;
    border-radius: 10px;
    font-size: 17px;
    transition: border-color 0.2s ease;
    background: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
    color: #000000;
    
    &:focus {
      outline: none;
      border-color: #007aff;
    }
    
    &::placeholder {
      color: #8e8e93;
    }
  }
  
  .field-textarea {
    resize: vertical;
    min-height: 88px;
    font-family: inherit;
    line-height: 1.4;
  }
}

// 带单位的输入框
.input-with-unit {
  position: relative;
  display: flex;
  align-items: center;
  
  .field-input {
    flex: 1;
    padding-right: 50px;
  }
  
  .input-unit {
    position: absolute;
    right: 16px;
    font-size: 0.875rem;
    color: #6b7280;
    font-weight: 500;
  }
}

// iOS风格卡片
.card {
  background-color: $background-primary;
  border-radius: $border-radius;
  padding: $card-padding;
  margin-bottom: $grid-gap;
  transition: $transition;
  border: 0.5px solid rgba(0,0,0,0.1);
  
  &:hover {
    box-shadow: $shadow-sm;
  }
  
  &.highlight {
    border-left: 4px solid $primary-color;
  }
  
  .card {

    margin-top: math.div(-$grid-gap, 2);
    border-top: 0.5px solid $border-color;
    border-radius: 0 0 $border-radius $border-radius;
  }
}

// 客户信息区域
.customer-info-section {
  @extend .card;
  @extend .highlight;
}

// 客户搜索区域样式
.search-section {
  margin-bottom: 24px;
  
  .search-input-group {
    display: flex;
    gap: 12px;
    align-items: flex-end;
    
    @media (max-width: 768px) {
      flex-direction: column;
      align-items: stretch;
    }
    
    .search-field {
      flex: 1;
    }
    
    .search-btn {
      padding: 11px 20px;
      background: #007aff;
      color: white;
      border: none;
      border-radius: 10px;
      font-weight: 600;
      font-size: 17px;
      cursor: pointer;
      transition: background-color 0.2s ease;
      display: flex;
      align-items: center;
      gap: 8px;
      white-space: nowrap;
      
      &:hover {
        background: #0056cc;
      }
      
      &:active {
        background: #004499;
      }
      
      &:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        background: #007aff;
      }
    }
  }
}

// 搜索结果样式
.search-results {
  margin-top: 20px;
  
  .results-list {
    display: grid;
    gap: 12px;
  }
  
  .result-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    
    &:hover {
      border-color: #3b82f6;
      background: #eff6ff;
    }
    
    .result-header {
      display: flex;
      align-items: center;
      gap: 12px;
      margin-bottom: 8px;
      
      .customer-avatar {
        width: 40px;
        height: 40px;
        border-radius: 10px;
        background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
        display: flex;
        align-items: center;
        justify-content: center;
        color: white;
        font-weight: 600;
        font-size: 0.875rem;
      }
      
      .customer-name {
        font-weight: 600;
        color: #1e293b;
        font-size: 1rem;
      }
    }
    
    .result-details {
      display: flex;
      flex-wrap: wrap;
      gap: 16px;
      font-size: 0.875rem;
      color: #64748b;
      
      .detail-item {
        display: flex;
        align-items: center;
        gap: 4px;
      }
    }
    
    .result-tags {
      margin-top: 12px;
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      
      .tag {
        background: #dbeafe;
        color: #1d4ed8;
        padding: 4px 8px;
        border-radius: 6px;
        font-size: 0.75rem;
        font-weight: 500;
      }
    }
  }
}

// 搜索输入框样式 - dashboard设计
.search-input-wrapper {
  position: relative;
  
  .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: #8e8e93;
  }
  
  .search-input {
    width: 100%;
    padding: 12px 16px 12px 44px;
    border: 1px solid #d1d1d6;
    border-radius: 12px;
    font-size: 16px;
    transition: all 0.2s ease;
    background-color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    
    &:focus {
      outline: none;
      border-color: #007aff;
      box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
    }
    
    &::placeholder {
      color: #8e8e93;
    }
  }
}

.search-input-group {
  display: flex;
  align-items: center;
  position: relative;
  max-width: 400px;
}

.search-input {
  flex: 1;
  padding: 10px 12px;
  border: 1px solid $border-color;
  border-radius: $border-radius 0 0 $border-radius;
  font-size: 14px;
  transition: $transition;
  &:focus {
    outline: none;
    border-color: $primary-color;
    box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 10%, transparent);
  }
}

.search-btn {
  padding: 10px 16px;
  background-color: $primary-color;
  color: white;
  border: none;
  border-radius: 0 $border-radius $border-radius 0;
  cursor: pointer;
  transition: $transition;
  &:hover {
    background-color: $primary-dark;
    transform: translateY(-1px);
    box-shadow: $shadow-md;
  }
  &:active {
    transform: translateY(0);
  }
}

// 搜索结果
.search-results {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  margin-top: 4px;
  background-color: $background-primary;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  box-shadow: $shadow-lg;
  z-index: 1000;
  max-height: 300px;
  overflow-y: auto;
}

.customer-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  cursor: pointer;
  transition: $transition;
  &:hover {
    background-color: $background-secondary;
  }
}

.customer-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.customer-details {
  flex: 1;
}

.customer-name {
  font-weight: 500;
  color: $text-primary;
  margin-bottom: 2px;
}

.customer-phone {
  font-size: 12px;
  color: $text-secondary;
  margin-bottom: 4px;
}

.customer-tags {
  display: flex;
  gap: 6px;
}

// 标签样式 - dashboard设计
.tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  
  &.type-tag {
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #bbdefb;
  }
  
  &.source-tag {
    background-color: #e8f5e8;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
  }
  
  &:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }
}

// 预设标签样式
.preset-tag {
  background-color: #f2f2f7;
  color: #1c1c1e;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  
  &:hover {
    background-color: #e5e5ea;
    transform: translateY(-1px);
  }
  
  &.selected {
    background-color: #007aff;
    color: white;
    border-color: #007aff;
  }
}

.tag.source {
  background-color: color-mix(in srgb, $secondary-color 10%, transparent);
  color: $secondary-color;
}

// 偏好标签样式
.preference-tags {
  .tags-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
    
    @media (max-width: 768px) {
      grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
      gap: 8px;
    }
  }
  
  .tag-chip {
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 20px;
    padding: 8px 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
    font-weight: 500;
    color: #475569;
    
    &:hover {
      border-color: #3b82f6;
      background: #eff6ff;
      color: #1d4ed8;
    }
    
    &.selected {
      background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
      border-color: #1d4ed8;
      color: white;
    }
  }
  
  .preset-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    
    .preset-tag-btn {
      background: #f8fafc;
      border: 1px solid #e2e8f0;
      border-radius: 16px;
      padding: 6px 12px;
      font-size: 0.75rem;
      color: #64748b;
      cursor: pointer;
      transition: all 0.2s ease;
      
      &:hover {
        background: #e2e8f0;
        color: #374151;
      }
    }
  }
}

// 表单样式
.customer-form,
.requirement-form {
  .form-row {
    display: flex;
    gap: 24px; // 增加行内表单元素间距防止重合
    margin-bottom: 24px;
    flex-wrap: wrap;
  }
  
  .form-group {
    flex: 1;
    min-width: 200px;
    label {
      display: block;
      font-size: 18px; // 放大表单标签
      font-weight: 500;
      color: $text-primary;
      margin-bottom: 8px;
    }
    input,
    select,
    textarea {
      width: 100%;
      padding: 12px 16px; // 增加内边距
      border: 1px solid $border-color;
      border-radius: $border-radius;
      font-size: 16px; // 放大输入元素字体
      transition: $transition;
      &:focus {
        outline: none;
        border-color: $primary-color;
        box-shadow: 0 0 0 3px color-mix(in srgb, $primary-color 10%, transparent);
      }
    }
    textarea {
      resize: vertical;
      min-height: 80px;
      line-height: 1.6;
    }
  }
  
  .form-group.full-width {
    min-width: 100%;
  }
}

.required {
  color: $danger-color;
}

// 清除客户按钮
.clear-customer-btn {
  padding: 6px 12px;
  background-color: transparent;
  color: $text-secondary;
  border: 1px solid $border-color;
  border-radius: $border-radius;
  font-size: 14px;
  cursor: pointer;
  transition: $transition;
  &:hover {
    background-color: $background-secondary;
    border-color: $danger-color;
    color: $danger-color;
  }
}

// 需求信息区域
.requirement-section {
  @extend .card;
}

// 报价区域样式
.price-section {
  margin-bottom: 32px;
  
  .price-card {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border: 2px solid #0ea5e9;
    border-radius: 16px;
    padding: 24px;
    text-align: center;
    
    .price-header {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 8px;
      margin-bottom: 12px;
      color: #0369a1;
      font-weight: 600;
      font-size: 0.875rem;
    }
    
    .price-value {
      font-size: 1.5rem;
      font-weight: 700;
      color: #0c4a6e;
      line-height: 1.2;
    }
  }
}

// 案例区域样式
.cases-section {
  margin-bottom: 32px;
  
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    
    h3 {
      font-size: 1.125rem;
      font-weight: 600;
      color: #1e293b;
      margin: 0;
    }
    
    .section-subtitle {
      font-size: 0.875rem;
      color: #64748b;
    }
  }
}

// 报价与案例匹配区域
.price-match-section {
  @extend .card;
}

// 价格信息
.price-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  background-color: color-mix(in srgb, $primary-color 5%, transparent);
  border-radius: $border-radius;
  margin-bottom: 24px;
  box-shadow: $shadow-sm;
}

.price-label {
  font-size: 18px; // 放大价格标签
  color: $text-secondary;
  font-weight: 500;
}

.price-value {
  font-size: 24px; // 放大价格值
  font-weight: 700;
  color: $primary-color;
  letter-spacing: 0.5px;
}

// 匹配案例
.matched-cases {
  h3 {
    font-size: 18px;
    font-weight: 600;
    color: $text-primary;
    margin-bottom: 16px;
  }
}

// 案例网格样式
.cases-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  
  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

// 案例卡片样式
.case-card {
  background: white;
  border: 2px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  
  &:hover {
    transform: translateY(-4px);
    border-color: #3b82f6;
    box-shadow: 0 12px 32px rgba(59, 130, 246, 0.15);
  }
  
  .case-image-wrapper {
    position: relative;
    
    .case-image {
      width: 100%;
      height: 200px;
      object-fit: cover;
    }
    
    .similarity-badge {
      position: absolute;
      top: 12px;
      right: 12px;
      background: linear-gradient(135deg, #10b981 0%, #059669 100%);
      color: white;
      padding: 6px 12px;
      border-radius: 20px;
      font-size: 0.75rem;
      font-weight: 600;
      box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
    }
  }
  
  .case-content {
    padding: 20px;
    
    .case-name {
      font-size: 1.125rem;
      font-weight: 600;
      color: #1e293b;
      margin: 0 0 12px 0;
      line-height: 1.3;
    }
    
    .case-meta {
      display: flex;
      gap: 16px;
      font-size: 0.875rem;
      color: #64748b;
      
      .case-designer,
      .case-area {
        display: flex;
        align-items: center;
        gap: 6px;
      }
    }
  }
}

.case-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.case-info {
  padding: 16px;
}

.case-name {
  font-size: 16px;
  font-weight: 500;
  color: $text-primary;
  margin-bottom: 8px;
}

.case-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  .case-designer,
  .case-area {
    font-size: 13px;
    color: $text-secondary;
  }
}

.similarity-badge {
  display: inline-block;
  padding: 4px 12px;
  background-color: color-mix(in srgb, $success-color 10%, transparent);
  color: $success-color;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 500;
}

// 已选案例区域样式
.selected-cases-section {
  .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    
    h3 {
      font-size: 1.125rem;
      font-weight: 600;
      color: #1e293b;
      margin: 0;
    }
    
    .section-subtitle {
      font-size: 0.875rem;
      color: #64748b;
      background: #f1f5f9;
      padding: 4px 12px;
      border-radius: 12px;
    }
  }
  
  .selected-cases-list {
    display: grid;
    gap: 12px;
  }
  
  .selected-case-item {
    background: #f8fafc;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
    
    &:hover {
      border-color: #10b981;
      background: #f0fdf4;
    }
    
    .case-info {
      display: flex;
      align-items: center;
      gap: 8px;
      color: #059669;
      font-weight: 500;
      font-size: 0.875rem;
    }
    
    .remove-case-btn {
      background: none;
      border: none;
      color: #ef4444;
      cursor: pointer;
      padding: 8px;
      border-radius: 8px;
      transition: all 0.2s ease;
      display: flex;
      align-items: center;
      justify-content: center;
      
      &:hover {
        background: #fef2f2;
        color: #dc2626;
      }
    }
  }
}

// 已选参考案例
.selected-cases {
  margin-top: 24px;
  h3 {
    font-size: 16px;
    font-weight: 600;
    color: $text-primary;
    margin-bottom: 12px;
  }
}

.selected-cases-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.selected-case-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background-color: color-mix(in srgb, $primary-color 10%, transparent);
  color: $primary-color;
  border-radius: 16px;
  font-size: 13px;
}

.remove-case-btn {
  background: none;
  border: none;
  color: $text-tertiary;
  cursor: pointer;
  padding: 2px;
  transition: $transition;
  &:hover {
    color: $danger-color;
  }
}

// 操作按钮区域
.action-section {
  margin-top: 40px;
  .action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    
    button {
      transition: all 0.3s ease;
      
      &:hover:not([disabled]) {
        transform: translateY(-2px);
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
      }
      
      &:active:not([disabled]) {
        transform: translateY(0);
      }
    }
    
    .btn-primary {
      background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    }
    
    .btn-secondary {
      background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    }
  }

  .action-buttons {
    display: flex;
    gap: 16px;
    justify-content: center;
    
    @media (max-width: 768px) {
      flex-direction: column;
      gap: 12px;
    }
  }
  
  .btn-primary,
  .btn-secondary {
    padding: 16px 32px;
    border: none;
    border-radius: 16px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    min-width: 180px;
    
    &.btn-lg {
      padding: 18px 36px;
      font-size: 1.125rem;
    }
    
    &:disabled {
      opacity: 0.6;
      cursor: not-allowed;
      transform: none;
    }
    
    .animate-spin {
      animation: spin 1s linear infinite;
    }
  }
  
  .btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
    color: white;
    box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    
    &:hover:not(:disabled) {
      transform: translateY(-2px);
      box-shadow: 0 12px 48px rgba(59, 130, 246, 0.4);
    }
  }
  
  .btn-secondary {
    background: white;
    color: #3b82f6;
    border: 2px solid #3b82f6;
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.1);
    
    &:hover:not(:disabled) {
      background: #3b82f6;
      color: white;
      transform: translateY(-2px);
      box-shadow: 0 8px 32px rgba(59, 130, 246, 0.3);
    }
  }
}

// 旋转动画
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

// 现代化按钮样式
.btn-ghost {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 0, 0, 0.08);
  color: #6b7280;
  font-weight: 500;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s ease;
  }
  
  &:hover {
    background: rgba(248, 250, 252, 0.95);
    border-color: rgba(0, 0, 0, 0.12);
    color: #374151;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    
    &::before {
      left: 100%;
    }
  }
  
  &:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
  }
}

.btn-sm {
  padding: 8px 16px;
  font-size: 14px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  border: none;
  outline: none;
  
  svg {
    width: 16px;
    height: 16px;
    transition: transform 0.2s ease;
  }
  
  &:hover svg {
    transform: scale(1.1);
  }
}

// 专门的收起按钮样式
.btn-ghost.btn-sm {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  
  &:hover {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(254, 242, 242, 0.8);
    
    svg {
      transform: rotate(90deg) scale(1.1);
    }
  }
  
  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }
  
  &:active {
    transform: translateY(0) scale(0.98);
    
    svg {
      transform: rotate(90deg) scale(1.05);
    }
  }
}

// 专门的提取按钮样式
.btn-primary.btn-sm {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border: none;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.25);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
  }
  
  &:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    
    &::before {
      left: 100%;
    }
  }
  
  &:active:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
  }
  
  &:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2), 0 2px 8px rgba(59, 130, 246, 0.25);
  }
  
  &:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.15);
    
    &::before {
      display: none;
    }
  }
  
  mat-spinner {
    width: 16px !important;
    height: 16px !important;
    
    ::ng-deep circle {
      stroke: white;
      stroke-width: 3;
    }
  }
  
  // 加载状态的脉冲效果
  &:disabled mat-spinner {
    animation: pulse 1.5s ease-in-out infinite;
  }
}

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

// iOS风格操作按钮区域
.action-section {
  background-color: $background-tertiary;
  padding: 16px;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  border-top: 0.5px solid $border-color;
  
  @media (min-width: 768px) {
    position: sticky;
    bottom: 20px;
    left: auto;
    right: auto;
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: $grid-gap auto 0;
    border-radius: $border-radius;
    border: 0.5px solid rgba(0,0,0,0.1);
    box-shadow: $shadow-sm;
  }
  
  .primary-btn, .secondary-btn {
    flex: 1;
    text-align: center;
  }
}

.primary-btn,
.secondary-btn {
  padding: 14px 24px;
  border-radius: 10px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
  border: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 120px;
  text-transform: none;
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Helvetica Neue', sans-serif;
}

.primary-btn {
  background-color: #007aff;
  color: white;
  &:hover:not(:disabled) {
    background-color: #0056cc;
  }
  &:active:not(:disabled) {
    background-color: #004499;
  }
  &:disabled {
    background-color: #8e8e93;
    cursor: not-allowed;
  }
}

.secondary-btn {
  background-color: #f2f2f7;
  color: #007aff;
  border: 1px solid #d1d1d6;
  &:hover:not(:disabled) {
    background-color: #e5e5ea;
  }
  &:active:not(:disabled) {
    background-color: #d1d1d6;
  }
  &:disabled {
    background-color: #f2f2f7;
    color: #8e8e93;
    border-color: #d1d1d6;
    cursor: not-allowed;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .consultation-order-container {
    padding: 16px;
  }
  
  .page-header {
    h1 {
      font-size: 24px;
    }
  }
  
  .form-row {
    flex-direction: column;
    gap: 12px;
  }
  
  .form-group {
    min-width: 100%;
  }
  
  .cases-grid {
    grid-template-columns: 1fr;
  }
  
  .action-section {
    flex-direction: column;
  }
  
  .primary-btn,
  .secondary-btn {
    width: 100%;
  }
  
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}