// 数据导入样式
.data-import {
  min-height: 100vh;
  background: #f5f5f5;
  padding-bottom: env(safe-area-inset-bottom);
}

// Tab 切换
.tab-bar {
  display: flex;
  background: #fff;
  border-bottom: 1px solid #eee;
  
  .tab-item {
    flex: 1;
    text-align: center;
    padding: 32px 0;
    font-size: 30px;
    color: #666;
    position: relative;
    
    &.active {
      color: #007aff;
      font-weight: 600;
      
      &::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translateX(-50%);
        width: 80px;
        height: 4px;
        background: #007aff;
        border-radius: 2px;
      }
    }
  }
}

.loading, .empty {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 400px;
  color: #999;
  font-size: 28px;
}

// 导入记录
.task-list, .template-list {
  height: calc(100vh - 120px);
  padding: 24px;
}

.task-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  
  .task-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    
    .task-info {
      display: flex;
      align-items: flex-start;
      
      .task-icon {
        font-size: 48px;
        margin-right: 16px;
      }
      
      .task-meta {
        .task-name {
          font-size: 32px;
          font-weight: 600;
          color: #333;
          display: block;
          margin-bottom: 8px;
        }
        
        .task-file {
          font-size: 24px;
          color: #999;
        }
      }
    }
    
    .task-status {
      font-size: 26px;
      font-weight: 500;
    }
  }
  
  .progress-section {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
    
    .progress-bar {
      flex: 1;
      height: 12px;
      background: #f0f0f0;
      border-radius: 6px;
      overflow: hidden;
      margin-right: 16px;
      
      .progress-fill {
        height: 100%;
        background: linear-gradient(90deg, #007aff, #5856d6);
        border-radius: 6px;
        transition: width 0.3s;
      }
    }
    
    .progress-text {
      font-size: 26px;
      color: #007aff;
      font-weight: 600;
      min-width: 80px;
      text-align: right;
    }
  }
  
  .task-stats {
    display: flex;
    margin-bottom: 24px;
    
    .stat-item {
      flex: 1;
      text-align: center;
      
      .stat-value {
        font-size: 36px;
        font-weight: 700;
        color: #333;
        display: block;
      }
      
      .stat-label {
        font-size: 24px;
        color: #999;
      }
      
      &.success .stat-value { color: #34c759; }
      &.error .stat-value { color: #ff3b30; }
    }
  }
  
  .task-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    
    .task-time {
      font-size: 24px;
      color: #999;
    }
    
    .action-btns {
      display: flex;
      
      .action-btn {
        padding: 12px 20px;
        margin-left: 12px;
        font-size: 24px;
        background: #f5f5f5;
        color: #333;
        border-radius: 8px;
        
        &.cancel {
          background: #fff0f0;
          color: #ff3b30;
        }
        
        &::after { border: none; }
      }
    }
  }
}

// 模板列表
.template-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  
  .template-header {
    display: flex;
    align-items: flex-start;
    margin-bottom: 24px;
    
    .template-icon {
      font-size: 48px;
      margin-right: 16px;
    }
    
    .template-info {
      flex: 1;
      
      .template-name {
        font-size: 32px;
        font-weight: 600;
        color: #333;
        display: block;
        margin-bottom: 8px;
      }
      
      .template-desc {
        font-size: 26px;
        color: #666;
        line-height: 1.5;
      }
    }
  }
  
  .template-fields {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 24px;
    
    .fields-label {
      font-size: 26px;
      font-weight: 600;
      color: #333;
      margin-bottom: 16px;
      display: block;
    }
    
    .field-item {
      display: flex;
      align-items: center;
      padding: 12px 0;
      border-bottom: 1px solid #eee;
      
      &:last-child { border-bottom: none; }
      
      .field-name {
        flex: 1;
        font-size: 26px;
        color: #333;
        
        .required { color: #ff3b30; }
      }
      
      .field-type {
        font-size: 24px;
        color: #999;
        margin-right: 16px;
      }
      
      .field-example {
        font-size: 24px;
        color: #007aff;
        max-width: 200px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
      }
    }
    
    .more-fields {
      font-size: 24px;
      color: #007aff;
      text-align: center;
      display: block;
      margin-top: 12px;
    }
  }
  
  .template-actions {
    display: flex;
    
    .download-btn {
      flex: 1;
      height: 80px;
      line-height: 80px;
      font-size: 28px;
      border-radius: 40px;
      margin: 0 8px;
      background: #f5f5f5;
      color: #333;
      
      &.primary {
        background: #007aff;
        color: #fff;
      }
      
      &:first-child { margin-left: 0; }
      &:last-child { margin-right: 0; }
      &::after { border: none; }
    }
  }
}

// 弹窗样式
.modal-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: flex-end;
  z-index: 1000;
  
  .error-modal, .template-modal {
    width: 100%;
    max-height: 80vh;
    background: #fff;
    border-radius: 32px 32px 0 0;
    display: flex;
    flex-direction: column;
  }
  
  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 32px;
    border-bottom: 1px solid #eee;
    
    .modal-title {
      font-size: 36px;
      font-weight: 600;
    }
    
    .modal-close {
      width: 64px;
      height: 64px;
      display: flex;
      align-items: center;
      justify-content: center;
      font-size: 36px;
      color: #999;
    }
  }
  
  .modal-body {
    flex: 1;
    padding: 32px;
    max-height: calc(80vh - 200px);
  }
  
  .modal-footer {
    padding: 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    
    .footer-btn {
      width: 100%;
      height: 88px;
      line-height: 88px;
      background: #007aff;
      color: #fff;
      font-size: 32px;
      border-radius: 44px;
      
      &::after { border: none; }
    }
  }
}

// 错误详情
.error-item {
  background: #fff5f5;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 16px;
  
  .error-row {
    display: flex;
    margin-bottom: 12px;
    
    &:last-child { margin-bottom: 0; }
    
    .error-label {
      width: 100px;
      font-size: 26px;
      color: #999;
      flex-shrink: 0;
    }
    
    .error-value {
      flex: 1;
      font-size: 26px;
      color: #333;
    }
    
    &.suggestion {
      background: #f0fff0;
      padding: 12px;
      border-radius: 8px;
      margin-top: 8px;
    }
  }
  
  .error-val {
    color: #ff3b30;
  }
  
  .error-msg {
    color: #ff3b30;
    font-weight: 600;
  }
}

// 模板详情
.template-desc-full {
  font-size: 28px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 32px;
  display: block;
}

.fields-section {
  .section-title {
    font-size: 30px;
    font-weight: 600;
    color: #333;
    margin-bottom: 24px;
    display: block;
  }
  
  .field-detail {
    background: #f9f9f9;
    padding: 24px;
    border-radius: 16px;
    margin-bottom: 16px;
    
    .field-header {
      display: flex;
      align-items: center;
      margin-bottom: 12px;
      
      .field-name {
        font-size: 28px;
        font-weight: 600;
        color: #333;
      }
      
      .required-tag {
        margin-left: 12px;
        padding: 4px 12px;
        background: #ff3b30;
        color: #fff;
        font-size: 20px;
        border-radius: 8px;
      }
    }
    
    .field-info {
      display: flex;
      margin-bottom: 8px;
      
      Text {
        font-size: 24px;
        color: #666;
        margin-right: 24px;
      }
    }
    
    .field-options, .field-length, .field-example {
      font-size: 24px;
      color: #007aff;
      display: block;
      margin-top: 8px;
    }
  }
}
