// 工单中心样式
.ticket-center {
  min-height: 100vh;
  background: #f5f5f5;
  padding-bottom: env(safe-area-inset-bottom);
}

// 统计卡片
.stats-cards {
  display: flex;
  padding: 24px;
  background: linear-gradient(135deg, #007aff 0%, #5856d6 100%);
  
  .stats-card {
    flex: 1;
    text-align: center;
    padding: 24px 12px;
    
    .stats-num {
      font-size: 40px;
      font-weight: 700;
      color: #fff;
      display: block;
    }
    
    .stats-label {
      font-size: 24px;
      color: rgba(255, 255, 255, 0.8);
      margin-top: 8px;
      display: block;
    }
  }
}

// 筛选栏
.filter-bar {
  display: flex;
  align-items: center;
  padding: 24px;
  background: #fff;
  border-bottom: 1px solid #eee;
  
  .status-tabs {
    flex: 1;
    white-space: nowrap;
    
    .status-tab {
      display: inline-flex;
      align-items: center;
      padding: 16px 28px;
      margin-right: 16px;
      font-size: 28px;
      color: #666;
      position: relative;
      
      &.active {
        color: #007aff;
        font-weight: 600;
        
        &::after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translateX(-50%);
          width: 48px;
          height: 4px;
          background: #007aff;
          border-radius: 2px;
        }
      }
      
      .tab-badge {
        position: absolute;
        top: 8px;
        right: 8px;
        min-width: 32px;
        height: 32px;
        padding: 0 8px;
        background: #ff3b30;
        color: #fff;
        font-size: 20px;
        border-radius: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
      }
    }
  }
  
  .create-btn {
    padding: 16px 32px;
    background: #007aff;
    color: #fff;
    font-size: 28px;
    border-radius: 32px;
    
    &::after { border: none; }
  }
}

// 工单列表
.ticket-list {
  height: calc(100vh - 400px);
  padding: 24px;
  
  .loading, .empty {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 300px;
    color: #999;
    font-size: 28px;
  }
}

.ticket-card {
  background: #fff;
  border-radius: 24px;
  padding: 32px;
  margin-bottom: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  
  .ticket-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    
    .ticket-no {
      font-size: 24px;
      color: #999;
    }
    
    .status-tag {
      padding: 8px 20px;
      border-radius: 20px;
      font-size: 24px;
    }
  }
  
  .ticket-title {
    font-size: 32px;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: block;
    margin-bottom: 20px;
  }
  
  .ticket-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    
    .meta-left {
      display: flex;
      align-items: center;
      
      .priority-tag {
        font-size: 24px;
        font-weight: 600;
        margin-right: 16px;
      }
      
      .type-text {
        font-size: 24px;
        color: #666;
        margin-right: 16px;
      }
      
      .reply-count {
        font-size: 24px;
        color: #007aff;
      }
    }
    
    .time-text {
      font-size: 24px;
      color: #999;
    }
  }
  
  .ticket-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
    
    .solution-text {
      flex: 1;
      font-size: 26px;
      color: #34c759;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
    }
    
    .footer-actions {
      display: flex;
      align-items: center;
    }
    
    .rating-text {
      font-size: 26px;
      color: #ff9500;
    }
    
    .action-btn {
      padding: 12px 24px;
      font-size: 24px;
      border-radius: 20px;
      background: #f5f5f5;
      color: #666;
      
      &.close {
        background: #fff0f0;
        color: #ff3b30;
      }
      
      &::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;
  
  .create-modal {
    width: 100%;
    max-height: 85vh;
    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(85vh - 200px);
  }
  
  .form-item {
    margin-bottom: 32px;
    
    .form-label {
      font-size: 28px;
      font-weight: 600;
      color: #333;
      display: block;
      margin-bottom: 16px;
      
      .required {
        color: #ff3b30;
      }
    }
    
    .form-input {
      width: 100%;
      height: 88px;
      padding: 0 24px;
      background: #f5f5f5;
      border-radius: 16px;
      font-size: 28px;
    }
    
    .textarea-wrap {
      background: #f5f5f5;
      border-radius: 16px;
      padding: 24px;
      
      .form-textarea {
        width: 100%;
        min-height: 300px;
        font-size: 28px;
        line-height: 1.6;
      }
    }
  }
  
  .type-selector {
    display: flex;
    flex-wrap: wrap;
    
    .type-option {
      padding: 16px 28px;
      margin-right: 16px;
      margin-bottom: 16px;
      background: #f5f5f5;
      border-radius: 12px;
      font-size: 26px;
      color: #666;
      
      &.active {
        background: #e6f0ff;
        color: #007aff;
        font-weight: 600;
      }
    }
  }
  
  .priority-selector {
    display: flex;
    
    .priority-option {
      flex: 1;
      padding: 20px;
      margin-right: 16px;
      background: #fff;
      border: 2px solid #ddd;
      border-radius: 12px;
      font-size: 26px;
      text-align: center;
      
      &:last-child { margin-right: 0; }
      
      &.active {
        background: #f0f7ff;
        font-weight: 600;
      }
    }
  }
  
  .modal-footer {
    padding: 32px;
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    
    .submit-btn {
      width: 100%;
      height: 88px;
      line-height: 88px;
      background: #007aff;
      color: #fff;
      font-size: 32px;
      border-radius: 44px;
      
      &::after { border: none; }
    }
  }
}
