/**
 * 页面增强样式
 * 用于美化所有子菜单页面
 */

// =============================================
// 页面容器优化
// =============================================

.app-container {
  padding: 20px;
  background: #f5f7fa;
  min-height: calc(100vh - 102px);
}

// =============================================
// 搜索表单区域优化
// =============================================

.el-form {
  &.el-form--inline {
    // 搜索表单美化
    background: #ffffff;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    
    // 清除浮动，防止布局问题
    &::after {
      content: '';
      display: block;
      clear: both;
    }
    
    .el-form-item {
      margin-right: 20px;
      margin-bottom: 16px;
      
      .el-form-item__label {
        font-weight: 500;
        color: #606266;
        font-size: 14px;
      }
      
      .el-input,
      .el-select,
      .el-date-editor {
        .el-input__inner {
          border-radius: 6px;
          border: 1px solid #e4e7ed;
          transition: all 0.3s;
          
          &:hover {
            border-color: #c0c4cc;
          }
          
          &:focus {
            border-color: #667eea;
            box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
          }
        }
      }
    }
    
    // 搜索按钮组
    .el-form-item:last-child {
      margin-right: 0;
      
      .el-button {
        border-radius: 6px;
        padding: 9px 20px;
        font-weight: 500;
        transition: all 0.3s;
        
        &.el-button--primary {
          background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
          border: none;
          
          &:hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
          }
        }
        
        &.el-button--default {
          &:hover {
            color: #667eea;
            border-color: #667eea;
            background: rgba(102, 126, 234, 0.1);
          }
        }
      }
    }
  }
}

// =============================================
// 操作按钮栏优化
// =============================================

// 操作按钮栏容器美化
.mb8 {
  background: #ffffff;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

// right-toolbar 按钮样式优化（不改变布局）
.top-right-btn {
  .el-button {
    margin-left: 8px;
    border-radius: 50%;
    transition: all 0.3s;
    
    &:hover {
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
      border-color: #667eea;
      color: #667eea;
      transform: translateY(-2px);
    }
  }
}

// 操作栏按钮样式优化
.mb8 .el-button {
  border-radius: 6px;
  padding: 9px 16px;
  font-weight: 500;
  transition: all 0.3s;
  
  &.el-button--primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    }
  }
  
  &.el-button--success {
    background: linear-gradient(135deg, #84fab0 0%, #8fd3f4 100%);
    border: none;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(132, 250, 176, 0.4);
    }
  }
  
  &.el-button--danger {
    background: linear-gradient(135deg, #ff9a9e 0%, #fecfef 100%);
    border: none;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(255, 154, 158, 0.4);
    }
  }
  
  &.el-button--warning {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border: none;
    color: #333;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(252, 182, 159, 0.4);
    }
  }
  
  &.el-button--info {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border: none;
    color: #333;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(168, 237, 234, 0.4);
    }
  }
  
  // Plain 样式
  &.is-plain {
    background: #ffffff !important;
    
    &.el-button--primary {
      color: #667eea;
      border-color: #667eea;
      
      &:hover {
        background: rgba(102, 126, 234, 0.1) !important;
        transform: translateY(-2px);
      }
    }
    
    &.el-button--success {
      color: #67c23a;
      border-color: #67c23a;
      
      &:hover {
        background: rgba(103, 194, 58, 0.1) !important;
        transform: translateY(-2px);
      }
    }
    
    &.el-button--danger {
      color: #f56c6c;
      border-color: #f56c6c;
      
      &:hover {
        background: rgba(245, 108, 108, 0.1) !important;
        transform: translateY(-2px);
      }
    }
    
    &.el-button--warning {
      color: #e6a23c;
      border-color: #e6a23c;
      
      &:hover {
        background: rgba(230, 162, 60, 0.1) !important;
        transform: translateY(-2px);
      }
    }
    
    &.el-button--info {
      color: #909399;
      border-color: #909399;
      
      &:hover {
        background: rgba(144, 147, 153, 0.1) !important;
        transform: translateY(-2px);
      }
    }
  }
}

// =============================================
// 表格优化
// =============================================

.el-table {
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  font-size: 13px;  // 整体缩小表格字体
  
  // 表头美化
  th {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%) !important;
    color: #333 !important;
    font-weight: 600 !important;
    font-size: 13px !important;
    border-bottom: 2px solid #e4e7ed !important;
    padding: 8px 0 !important;  // 减小表头高度
  }
  
  // 表格数据行
  td {
    border-bottom: 1px solid #f0f2f5 !important;
    padding: 8px 0 !important;  // 减小单元格高度
  }
  
  // 单元格内容
  .cell {
    padding: 0 8px !important;  // 减小内边距
    line-height: 1.6 !important;
  }
  
  // 表格行悬停效果
  tr:hover {
    background: rgba(102, 126, 234, 0.05) !important;
  }
  
  // 操作列 - 防止按钮换行
  .fixed-width .cell,
  .small-padding .cell {
    white-space: nowrap;
    padding: 0 5px !important;  // 操作列更紧凑
  }
  
  // 操作列按钮优化
  .el-button--text {
    padding: 3px 6px;
    font-weight: 500;
    border-radius: 3px;
    transition: all 0.3s;
    margin: 0 1px;
    font-size: 12px;
    position: relative;
    line-height: 1.5;
    vertical-align: middle;
    display: inline-block;  // 确保按钮水平排列
    
    // 详情按钮 - 蓝色
    &:first-child {
      color: #409eff;
      
      &:hover {
        background: rgba(64, 158, 255, 0.1);
        color: #66b1ff;
      }
    }
    
    // 修改按钮 - 橙色  
    &:nth-child(2) {
      color: #e6a23c;
      
      &:hover {
        background: rgba(230, 162, 60, 0.1);
        color: #ebb563;
      }
    }
    
    // 删除按钮 - 红色
    &:nth-child(3) {
      color: #f56c6c;
      
      &:hover {
        background: rgba(245, 108, 108, 0.1);
        color: #f78989;
      }
    }
    
    // 更多按钮
    &:nth-child(4),
    &:nth-child(n+4) {
      color: #909399;
      
      &:hover {
        background: rgba(144, 147, 153, 0.1);
        color: #a6a9ad;
      }
    }
    
    // 图标优化
    i {
      margin-right: 3px;
      font-size: 12px;
      vertical-align: middle;
    }
  }
  
  // Dropdown 在操作列的样式
  .el-dropdown {
    margin: 0 1px;
    display: inline-block;
    vertical-align: middle;
    font-size: 12px;
  }
  
  // 斑马纹
  &.el-table--striped {
    .el-table__body {
      tr.el-table__row--striped {
        td {
          background: #fafafa;
        }
      }
    }
  }
}

// =============================================
// 分页器优化
// =============================================

.pagination-container {
  background: #ffffff;
  padding: 20px;
  border-radius: 12px;
  margin-top: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  display: flex;
  justify-content: flex-end;
}

.el-pagination {
  .el-pager {
    li {
      border-radius: 6px;
      margin: 0 4px;
      font-weight: 500;
      transition: all 0.3s;
      
      &.active {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        color: #ffffff;
      }
      
      &:hover {
        color: #667eea;
      }
    }
  }
  
  .btn-prev,
  .btn-next {
    border-radius: 6px;
    background: #f5f7fa;
    transition: all 0.3s;
    
    &:hover {
      color: #667eea;
      background: rgba(102, 126, 234, 0.1);
    }
  }
}

// =============================================
// 对话框优化
// =============================================

.el-dialog {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.15);
  
  .el-dialog__header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px 24px;
    
    .el-dialog__title {
      color: #ffffff;
      font-size: 18px;
      font-weight: 600;
    }
    
    .el-dialog__headerbtn {
      top: 20px;
      right: 24px;
      
      .el-dialog__close {
        color: #ffffff;
        font-size: 20px;
        
        &:hover {
          color: rgba(255, 255, 255, 0.8);
        }
      }
    }
  }
  
  .el-dialog__body {
    padding: 24px;
  }
  
  .el-dialog__footer {
    padding: 16px 24px;
    background: #f5f7fa;
    
    .el-button {
      border-radius: 6px;
      padding: 10px 24px;
      font-weight: 500;
      
      &.el-button--primary {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border: none;
      }
    }
  }
}

// =============================================
// 卡片优化
// =============================================

.el-card {
  border-radius: 12px;
  border: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  overflow: hidden;
  transition: all 0.3s;
  
  &:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
  }
  
  .el-card__header {
    background: linear-gradient(135deg, #f5f7fa 0%, #f0f2f5 100%);
    padding: 16px 20px;
    border-bottom: 2px solid #e4e7ed;
    font-weight: 600;
    font-size: 15px;
    color: #333;
  }
  
  .el-card__body {
    padding: 20px;
  }
}

// =============================================
// Tree 树形控件优化
// =============================================

.el-tree {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  
  .el-tree-node {
    .el-tree-node__content {
      height: 36px;
      border-radius: 6px;
      margin-bottom: 4px;
      transition: all 0.3s;
      
      &:hover {
        background: rgba(102, 126, 234, 0.08);
      }
      
      .el-tree-node__label {
        font-size: 14px;
        color: #606266;
      }
    }
    
    &.is-current > .el-tree-node__content {
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.15) 0%, rgba(118, 75, 162, 0.15) 100%);
      color: #667eea;
      font-weight: 600;
      
      .el-tree-node__label {
        color: #667eea;
      }
    }
  }
}

// =============================================
// 标签页优化
// =============================================

.el-tabs {
  .el-tabs__header {
    margin-bottom: 20px;
    
    .el-tabs__nav-wrap {
      &::after {
        height: 1px;
        background: #e4e7ed;
      }
    }
    
    .el-tabs__item {
      height: 44px;
      line-height: 44px;
      font-size: 14px;
      font-weight: 500;
      color: #606266;
      transition: all 0.3s;
      
      &:hover {
        color: #667eea;
      }
      
      &.is-active {
        color: #667eea;
        font-weight: 600;
      }
    }
    
    .el-tabs__active-bar {
      height: 3px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 2px;
    }
  }
}

// =============================================
// 输入框增强
// =============================================

.el-input,
.el-textarea,
.el-select {
  .el-input__inner,
  .el-textarea__inner {
    border-radius: 6px;
    border: 1px solid #e4e7ed;
    transition: all 0.3s;
    
    &:hover {
      border-color: #c0c4cc;
    }
    
    &:focus {
      border-color: #667eea;
      box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    }
  }
}

// =============================================
// 开关优化
// =============================================

.el-switch {
  &.is-checked {
    .el-switch__core {
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-color: #667eea;
    }
  }
}

// =============================================
// 下拉菜单优化
// =============================================

.el-dropdown-menu {
  border-radius: 8px;
  border: 1px solid #e4e7ed;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 8px 0;
  
  .el-dropdown-menu__item {
    padding: 10px 20px;
    font-size: 14px;
    transition: all 0.3s;
    
    &:hover {
      background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
      color: #667eea;
    }
  }
}

// =============================================
// 头部容器
// =============================================

.head-container {
  background: #ffffff;
  padding: 16px;
  border-radius: 12px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

// =============================================
// 响应式优化
// =============================================

@media (max-width: 768px) {
  .app-container {
    padding: 16px;
  }
  
  .el-form--inline {
    .el-form-item {
      display: block;
      margin-right: 0;
    }
  }
  
  .mb8 {
    .el-button {
      width: 100%;
      margin-bottom: 10px;
    }
  }
}

