<template>
  <div>
    <div class="execution-records">
      <!-- 顶部导航栏 -->
      <div class="navigation-tabs">
        <div class="nav-tab" @click="handleInspection1">待办事项</div>
        <div class="nav-tab" @click="handleInspection2">巡检管理</div>
        <div class="nav-tab" @click="handleInspection3">试验管理</div>
        <div class="nav-tab" @click="handleInspection4">报修管理</div>
        <div class="nav-tab" @click="handleInspection5">抢修管理</div>
        <div class="nav-tab active" @click="handleInspection6">工单管理</div>
        <div class="nav-tab" @click="handleInspection7">运维组织</div>
      </div>

      <!-- 页面标题 -->
      <TitleComponent title="工单管理模块" subtitle="发起工单任务，跟踪流程记录和执行情况"></TitleComponent>

      <!-- 子选项卡 -->
      <div class="tabs-wrapper">
        <div style="display: flex; align-items: center; gap: 10px">
          <el-button type="primary" @click="handleInspectionManagement1">工单列表</el-button>
          <el-button type="primary" @click="handleInspectionManagement2">派单计划</el-button>
          <el-button type="primary" @click="handleInspectionManagement3">执行记录</el-button>
        </div>
      </div>

      <!-- 搜索和筛选区 -->
      <div class="search-filter">
        <div class="search-container">
          <el-input
            v-model="searchKeyword"
            placeholder="搜索工单记录"
            class="search-input"
            suffix-icon="el-icon-search"
            @keyup.enter="handleSearch"
          ></el-input>
          <el-button type="primary" class="filter-btn" @click="showFilter = !showFilter">
            筛选 <i class="el-icon-arrow-down" :class="{ 'rotate-180': showFilter }"></i>
          </el-button>
        </div>

        <!-- 筛选条件区域 -->
        <div class="filter-options" v-if="showFilter">
          <div class="filter-row">
            <div class="filter-item">
              <el-select v-model="filterStatus" placeholder="执行状态" clearable>
                <el-option label="全部状态" value="all"></el-option>
                <el-option label="已完成" value="completed"></el-option>
                <el-option label="执行中" value="executing"></el-option>
              </el-select>
            </div>
            <div class="filter-item">
              <el-select v-model="filterType" placeholder="工单类型" clearable>
                <el-option label="全部类型" value="all"></el-option>
                <el-option label="新设备安装调试" value="installation"></el-option>
                <el-option label="系统升级改造" value="upgrade"></el-option>
                <el-option label="月度设备检查" value="monthlyCheck"></el-option>
              </el-select>
            </div>
            <div class="filter-item">
              <el-select v-model="filterExecutor" placeholder="执行人" clearable>
                <el-option label="全部人员" value="all"></el-option>
                <el-option label="赵工" value="zhao"></el-option>
                <el-option label="李工" value="li"></el-option>
                <el-option label="王工" value="wang"></el-option>
              </el-select>
            </div>
            <div class="filter-item">
              <el-date-picker
                v-model="filterDateRange"
                type="daterange"
                range-separator="至"
                start-placeholder="开始日期"
                end-placeholder="结束日期"
                format="yyyy/MM/dd"
                value-format="yyyy/MM/dd"
              ></el-date-picker>
            </div>
            <div class="filter-actions">
              <el-button type="text" @click="resetFilter">重置</el-button>
              <el-button type="primary" @click="handleSearch">确定</el-button>
            </div>
          </div>
        </div>
      </div>

      <!-- 重点跟踪区域 -->
      <div class="tracking-section">
        <div class="tracking-header">
          <h3>重点跟踪</h3>
          <div class="tracking-tag executing"><i class="el-icon-loading"></i> 执行中</div>
        </div>

        <div class="tracking-card">
          <div class="tracking-title">
            <div class="tracking-main-info">
              <div class="task-info">
                <span class="task-type"> <i class="el-icon-machine"></i> 新设备安装调试 </span>
                <span class="work-order-no"> <i class="el-icon-ticket"></i> WO-2023-0618-054 </span>
              </div>
              <div class="time-range">
                <i class="el-icon-time"></i>
                <span>执行时间：2025-06-18 08:00 至 2025-06-20 18:00</span>
              </div>
            </div>
          </div>

          <!-- 横向进度时间线 - 使用Element Plus的Steps组件 -->
          <div style="margin: 30px 0">
            <el-steps direction="horizontal" :active="2" align-center class="custom-steps" :progress-dot="false">
              <el-step title="设备开始检查开箱" status="finish">
                <template #description>
                  <div style="text-align: center">
                    <div style="color: #165dff; margin-bottom: 4px">赵工 • 2025-06-18 15:30</div>
                    <div>设备包装完好，配件齐全，无损坏，准备进行安装</div>
                  </div>
                </template>
              </el-step>
              <el-step title="基础安装完成" status="finish">
                <template #description>
                  <div style="text-align: center">
                    <div style="color: #165dff; margin-bottom: 4px">赵工 • 2025-06-19 10:15</div>
                    <div>设备固定安装完成，电源线连接规范，线路布局合理</div>
                  </div>
                </template>
              </el-step>
              <el-step title="初步调试完成" status="process">
                <template #description>
                  <div style="text-align: center">
                    <div style="color: #165dff; margin-bottom: 4px">李工 • 2025-06-18 16:45</div>
                    <div>设备通电正常，基本功能运行良好，正在进行调试</div>
                  </div>
                </template>
              </el-step>
              <el-step title="完成测试" status="wait">
                <template #description>
                  <div style="text-align: center">
                    <div style="color: #165dff; margin-bottom: 4px">王工 • 2025-06-20 18:00</div>
                    <div>检测设备性能，验证稳定性，准备投入实际生产场景</div>
                  </div>
                </template>
              </el-step>
            </el-steps>
          </div>
        </div>
      </div>

      <!-- 执行记录表格 -->
      <div class="table-wrapper">
        <el-table :data="pagedTableData" stripe style="width: 100%" highlight-current-row class="custom-table">
          <el-table-column align="center" prop="orderNo" label="工单编号" min-width="120"></el-table-column>
          <el-table-column align="center" prop="description" label="工单描述" min-width="150"></el-table-column>
          <el-table-column align="center" prop="executor" label="执行人" min-width="100"></el-table-column>
          <el-table-column align="center" prop="startTime" label="开始时间" min-width="140"></el-table-column>
          <el-table-column align="center" prop="endTime" label="完成时间" min-width="140"></el-table-column>
          <el-table-column align="center" prop="status" label="执行状态" min-width="100">
            <template #default="scope">
              <el-tag :type="getStatusTagType(scope.row.status)" class="status-tag">
                {{ scope.row.status }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="completion" label="完成度" min-width="120">
            <template #default="scope">
              <div class="completion-bar">
                <div class="completion-progress" :style="{ width: scope.row.completion }" :class="getCompletionClass(scope.row.completion)"></div>
              </div>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="inspectionResult" label="验收结果" min-width="100">
            <template #default="scope">
              <el-tag :type="getResultTagType(scope.row.inspectionResult)" class="result-tag">
                {{ scope.row.inspectionResult || '-' }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column align="center" label="操作" min-width="180" fixed="right">
            <template #default="scope">
              <el-button type="text" @click="handleViewDetails(scope.row)" size="small" class="action-btn detail-btn">详情</el-button>
              <el-button
                type="text"
                @click="handleViewReport(scope.row)"
                size="small"
                class="action-btn"
                :class="{
                  'report-btn': scope.row.inspectionResult !== '需整改',
                  'rectify-btn': scope.row.inspectionResult === '需整改'
                }"
                v-if="scope.row.status === '已完成'"
              >
                {{ scope.row.inspectionResult === '需整改' ? '查看整改项' : scope.row.inspectionResult === '' ? '沟通' : '查看报告' }}
              </el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>

      <!-- 分页区域 -->
      <div class="pagination-section">
        <div class="pagination-info">
          显示第{{ (currentPage - 1) * pageSize + 1 }}到{{ Math.min(currentPage * pageSize, total) }}条，共{{ total }}条记录
        </div>
        <div class="pagination-controls">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage"
            :page-sizes="[10, 20, 30, 40]"
            :page-size="pageSize"
            layout="prev, pager, next, jumper"
            :total="total"
            background
          >
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import { ref, computed } from 'vue';
import router from '@/router';
import TitleComponent from './TitleComponent.vue';
// 导入Element Plus的Steps组件
import { ElSteps, ElStep } from 'element-plus';

// 搜索和筛选条件
const searchKeyword = ref('');
const showFilter = ref(false);
const filterStatus = ref('all');
const filterType = ref('all');
const filterExecutor = ref('all');
const filterDateRange = ref([]);

// 执行记录数据
const rawTableData = ref([
  {
    orderNo: 'WO-2023-0618-054',
    description: '新设备安装调试',
    executor: '赵工, 李工',
    startTime: '2023-06-18 14:00',
    endTime: '',
    status: '执行中',
    completion: '75%',
    inspectionResult: ''
  },
  {
    orderNo: 'WO-2023-0617-053',
    description: '系统升级改造',
    executor: '赵工',
    startTime: '2023-06-17 10:00',
    endTime: '2023-06-19 16:45',
    status: '已完成',
    completion: '100%',
    inspectionResult: ''
  },
  {
    orderNo: 'WO-2023-0618-052',
    description: '月度设备检查',
    executor: '赵工, 王工',
    startTime: '2023-06-18 09:30',
    endTime: '2023-06-18 15:20',
    status: '已完成',
    completion: '100%',
    inspectionResult: '需整改'
  },
  {
    orderNo: 'WO-2023-0618-051',
    description: '新设备安装调试',
    executor: '赵工, 李工',
    startTime: '2023-06-18 14:00',
    endTime: '2023-06-19 11:30',
    status: '已完成',
    completion: '100%',
    inspectionResult: '验收通过'
  },
  {
    orderNo: 'WO-2023-0618-050',
    description: '新设备安装调试',
    executor: '赵工, 李工',
    startTime: '2023-06-18 14:00',
    endTime: '2023-06-19 09:15',
    status: '已完成',
    completion: '100%',
    inspectionResult: '验收通过'
  },
  {
    orderNo: 'WO-2023-0618-049',
    description: '新设备安装调试',
    executor: '赵工, 李工',
    startTime: '2023-06-18 14:00',
    endTime: '2023-06-19 10:45',
    status: '已完成',
    completion: '100%',
    inspectionResult: '验收通过'
  },
  {
    orderNo: 'WO-2023-0618-048',
    description: '新设备安装调试',
    executor: '赵工, 李工',
    startTime: '2023-06-18 14:00',
    endTime: '2023-06-19 16:20',
    status: '已完成',
    completion: '100%',
    inspectionResult: '验收通过'
  },
  {
    orderNo: 'WO-2023-0618-047',
    description: '新设备安装调试',
    executor: '赵工, 李工',
    startTime: '2023-06-18 14:00',
    endTime: '2023-06-19 15:30',
    status: '已完成',
    completion: '100%',
    inspectionResult: '验收通过'
  }
]);

// 分页相关
const currentPage = ref(1);
const pageSize = ref(10);
const total = ref(rawTableData.value.length);

// 分页处理后的数据
const pagedTableData = computed(() => {
  // 筛选逻辑
  let filteredData = [...rawTableData.value];

  // 搜索关键词筛选
  if (searchKeyword.value) {
    const keyword = searchKeyword.value.toLowerCase();
    filteredData = filteredData.filter(
      (item) =>
        item.orderNo.toLowerCase().includes(keyword) ||
        item.description.toLowerCase().includes(keyword) ||
        item.executor.toLowerCase().includes(keyword)
    );
  }

  // 状态筛选
  if (filterStatus.value !== 'all') {
    filteredData = filteredData.filter((item) => item.status === filterStatus.value);
  }

  // 类型筛选
  if (filterType.value !== 'all') {
    const typeMap = {
      'installation': '新设备安装调试',
      'upgrade': '系统升级改造',
      'monthlyCheck': '月度设备检查'
    };
    filteredData = filteredData.filter((item) => item.description.includes(typeMap[filterType.value]));
  }

  // 执行人筛选
  if (filterExecutor.value !== 'all') {
    const executorMap = {
      'zhao': '赵工',
      'li': '李工',
      'wang': '王工'
    };
    filteredData = filteredData.filter((item) => item.executor.includes(executorMap[filterExecutor.value]));
  }

  // 日期范围筛选
  if (filterDateRange.value && filterDateRange.value.length === 2) {
    const startDate = new Date(filterDateRange.value[0]);
    const endDate = new Date(filterDateRange.value[1]);
    filteredData = filteredData.filter((item) => {
      const itemDate = item.startTime ? new Date(item.startTime) : new Date();
      return itemDate >= startDate && itemDate <= endDate;
    });
  }

  // 更新总条数
  total.value = filteredData.length;

  // 分页处理
  const startIndex = (currentPage.value - 1) * pageSize.value;
  const endIndex = startIndex + pageSize.value;
  return filteredData.slice(startIndex, endIndex);
});

// 获取状态标签样式
const getStatusTagType = (status) => {
  const statusMap = {
    '已完成': 'success',
    '执行中': 'primary'
  };
  return statusMap[status] || 'default';
};

// 获取验收结果标签样式
const getResultTagType = (result) => {
  const resultMap = {
    '验收通过': 'success',
    '需整改': 'warning'
  };
  return resultMap[result] || 'default';
};

// 获取完成度样式
const getCompletionClass = (completion) => {
  const percentage = parseInt(completion);
  if (percentage === 100) return 'completed';
  if (percentage > 0) return 'in-progress';
  return 'not-started';
};

// 搜索处理
const handleSearch = () => {
  currentPage.value = 1; // 重置到第一页
};

// 重置筛选条件
const resetFilter = () => {
  filterStatus.value = 'all';
  filterType.value = 'all';
  filterExecutor.value = 'all';
  filterDateRange.value = [];
  currentPage.value = 1;
};

// 分页事件
const handleSizeChange = (val) => {
  pageSize.value = val;
  currentPage.value = 1;
};

const handleCurrentChange = (val) => {
  currentPage.value = val;
};

// 操作按钮事件
const handleViewDetails = (row) => {
  console.log('查看详情:', row);
  // 实际应用中这里会跳转到详情页
};

const handleViewReport = (row) => {
  console.log('查看报告:', row);
  // 实际应用中这里会打开报告查看页面
};

const handleDeviceAcceptance = (row) => {
  console.log('设备验收:', row);
  // 实际应用中这里会打开验收表单
};

// 导航路由跳转
const handleInspection1 = () => {
  router.push('/rili/rili');
};
const handleInspection2 = () => {
  router.push('/rili/InspectionManagement');
};
const handleInspection3 = () => {
  router.push('/rili/shiyanguanli');
};
const handleInspection4 = () => {
  router.push('/rili/baoxiuguanli');
};
const handleInspection5 = () => {
  router.push('/rili/qiangxiuguanli');
};
const handleInspection6 = () => {
  router.push('/rili/gongdanguanli');
};
const handleInspection7 = () => {
  router.push('/rili/renyuanzhuangtai');
};

// 子选项卡路由跳转
const handleInspectionManagement1 = () => {
  router.push('/rili/gongdanliebiao');
};
const handleInspectionManagement2 = () => {
  router.push('/rili/paidanjilu');
};
const handleInspectionManagement3 = () => {
  router.push('/rili/zhixingjilu');
};
</script>

<style scoped>
.execution-records {
  padding: 20px;
  background-color: #f5f7fa;
  min-height: 100vh;
}

/* 选项卡样式 */
.tabs-wrapper {
  background-color: #fff;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* 搜索和筛选区样式 */
.search-filter {
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.search-container {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
}

.search-input {
  flex: 1;
  max-width: 500px;
  height: 36px;
}

.filter-btn {
  white-space: nowrap;
  margin-left: 16px;
}

.filter-options {
  padding: 16px 24px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.filter-item {
  flex-shrink: 0;
}

.filter-options .el-select,
.filter-options .el-date-picker {
  width: 180px;
  height: 36px;
}

.filter-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

/* 重点跟踪区域样式 */
.tracking-section {
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

.tracking-header {
  display: flex;
  align-items: center;
  padding: 16px 24px;
  border-bottom: 1px solid #f0f0f0;
  background-color: #f5f7fa;
}

.tracking-header h3 {
  font-size: 16px;
  font-weight: 500;
  color: #303133;
  margin: 0;
}

.tracking-tag {
  margin-left: 12px;
  background-color: #e6f7ff;
  color: #1890ff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
}

.tracking-card {
  padding: 24px;
}

.tracking-title {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f0f0;
}

.task-type {
  display: inline-block;
  font-weight: 500;
  color: #303133;
  margin-right: 24px;
}

.work-order-no,
.time-range {
  display: inline-block;
  color: #606266;
  margin-right: 24px;
  font-size: 14px;
}

/* 动画效果 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 93, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 93, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 93, 255, 0);
  }
}

/* Element Plus Steps 组件自定义样式 - 优化版 */
.custom-steps {
  background: linear-gradient(135deg, #f8faff 0%, #f0f7ff 100%);
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.06);
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* 添加背景装饰 */
.custom-steps::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, #165dff, #409eff, #69c0ff);
}

/* 步骤标题样式 */
.el-step__title {
  font-size: 18px;
  font-weight: 600;
  color: #303133;
  transition: all 0.3s ease;
  padding: 0 10px;
}

/* 步骤描述样式 */
.el-step__description {
  font-size: 14px;
  color: #606266;
  line-height: 1.6;
  margin-top: 12px;
  width: auto !important;
  max-width: 240px;
  background-color: rgba(255, 255, 255, 0.7);
  padding: 12px 16px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

/* 当前步骤样式 */
.el-step__title.is-process {
  color: #165dff;
  font-weight: 700;
  font-size: 19px;
  text-shadow: 0 2px 4px rgba(22, 93, 255, 0.1);
}

.el-step__icon.is-process {
  background: linear-gradient(135deg, #165dff, #409eff);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 0 16px rgba(22, 93, 255, 0.4),
    0 4px 12px rgba(22, 93, 255, 0.2);
  animation:
    pulse 2s infinite,
    float 6s ease-in-out infinite;
  transform: scale(1.05);
}

.el-step__icon.is-process .el-icon {
  color: #fff;
  font-size: 20px;
}

/* 已完成步骤样式 */
.el-step__title.is-finish {
  color: #303133;
  font-weight: 600;
}

.el-step__icon.is-finish {
  background: linear-gradient(135deg, #52c41a, #73d13d);
  border: 3px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 0 12px rgba(82, 196, 26, 0.3);
  transition: all 0.3s ease;
}

.el-step__icon.is-finish:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px rgba(82, 196, 26, 0.4);
}

.el-step__icon.is-finish .el-icon {
  color: #fff;
  font-size: 20px;
}

/* 待处理步骤样式 */
.el-step__icon.is-wait {
  background-color: #f0f2f5;
  border: 3px solid rgba(255, 255, 255, 0.9);
  transition: all 0.3s ease;
}

.el-step__icon.is-wait:hover {
  background-color: #e6f7ff;
  box-shadow: 0 0 12px rgba(22, 93, 255, 0.1);
}

.el-step__icon.is-wait .el-icon {
  color: #909399;
  font-size: 18px;
}

/* 连接线样式 */
.el-step__line {
  top: 50%;
  transform: translateY(-50%);
}

.el-step__line-inner {
  height: 8px;
  border-radius: 4px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

/* 为连接线添加渐变效果 */
.el-step__line.is-finish .el-step__line-inner {
  background: linear-gradient(90deg, #52c41a, #73d13d);
  box-shadow: 0 2px 8px rgba(82, 196, 26, 0.2);
}

.el-step__line.is-process .el-step__line-inner {
  background: linear-gradient(90deg, #165dff, #409eff);
  box-shadow: 0 2px 8px rgba(22, 93, 255, 0.2);
}

.el-step__line.is-process .el-step__line-inner::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 2s infinite;
}

.el-step__line.is-wait .el-step__line-inner {
  background-color: #e4e7ed;
  border: 1px solid #f0f2f5;
}

/* 图标尺寸 */
.el-step__icon {
  width: 48px;
  height: 48px;
  line-height: 42px;
  font-size: 20px;
  border-radius: 50%;
  transition: all 0.3s ease;
}

/* 横向步骤条样式调整 */
.el-steps--horizontal {
  align-items: center;
}

.el-steps--horizontal .el-step {
  padding-bottom: 0;
  min-height: 160px;
}

/* 悬浮效果 */
.el-step:hover .el-step__title {
  color: #165dff;
  transform: translateY(-2px);
}

.el-step:hover .el-step__description {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

/* 新增浮动动画 */
@keyframes float {
  0%,
  100% {
    transform: translateY(0) scale(1.05);
  }
  50% {
    transform: translateY(-6px) scale(1.05);
  }
}

/* 新增闪光动画 */
@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(250%);
  }
}

.ant-steps-large .ant-steps-item-title {
  font-size: 16px;
}

.ant-steps-large .ant-steps-item-description {
  font-size: 14px;
}

/* 表格样式优化 */
.table-wrapper {
  background-color: #fff;
  border-radius: 8px;
  margin-bottom: 24px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
  overflow: hidden;
}

/* 使用Element Plus原生表格样式 */
.el-table {
  border-collapse: collapse;
  width: 100%;
}

.el-table th {
  background-color: #f8f9fa;
  font-weight: 600;
  color: #495057;
  text-align: center;
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
}

.el-table td {
  padding: 12px 8px;
  border-bottom: 1px solid #dee2e6;
  color: #333;
  text-align: center;
  font-size: 14px;
}

/* 条纹样式 */
.el-table--striped .el-table__body tr.el-table__row--striped td {
  background-color: #fafbfc;
}

/* 悬停效果 */
.el-table__body tr:hover > td {
  background-color: #f8f9ff !important;
}

/* 当前行效果 */
.el-table__body tr.current-row > td {
  background-color: #e6f7ff !important;
}

/* 状态标签样式 */
.status-tag {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.result-tag {
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

/* 完成度样式优化 */
.completion-bar {
  width: 100%;
  height: 8px;
  background-color: #f0f2f5;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.completion-progress {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s ease;
}

.completion-progress.completed {
  background-color: #52c41a;
}

.completion-progress.in-progress {
  background-color: #fa8c16;
}

.completion-progress.not-started {
  background-color: #e4e7ed;
}

/* 操作按钮样式优化 */
.action-btn {
  color: #333;
  font-size: 13px;
  padding: 4px 10px;
  margin: 0 3px;
  transition: all 0.2s ease;
}

.action-btn:hover {
  background-color: #f8f9ff;
}

.detail-btn {
  color: #165dff !important;
}

.detail-btn:hover {
  color: #094ab2 !important;
  background-color: #e6f7ff !important;
}

.report-btn {
  color: #333;
}

/* 新增整改项按钮红色样式 */
.rectify-btn {
  color: #ff4d4f;
}

.rectify-btn:hover {
  color: #cf1322;
  background-color: #fff2f0;
}

/* 分页区域样式 */
.pagination-section {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  padding: 16px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.05);
}

.pagination-info {
  font-size: 14px;
  color: #606266;
}

.pagination-controls .el-pagination {
  margin: 0;
}

.pagination-controls .el-pagination button,
.pagination-controls .el-pagination .el-pager li {
  min-width: 36px;
  height: 36px;
  line-height: 36px;
  border-radius: 4px;
}

.pagination-controls .el-pagination .el-pager li.active {
  background-color: #165dff;
  color: #fff;
}

/* 导航栏样式 */
.navigation-tabs {
  display: flex;
  margin-bottom: 20px;
  background-color: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  padding: 2px;
}

.nav-tab {
  padding: 12px 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 4px;
  font-size: 14px;
  color: #606266;
  border-right: 1px solid #f0f0f0;
  flex: 1;
  text-align: center;
}

.nav-tab:last-child {
  border-right: none;
}

.nav-tab:hover {
  color: #409eff;
  background-color: #ecf5ff;
}

.nav-tab.active {
  background-color: #409eff;
  color: #fff;
  box-shadow: 0 2px 4px rgba(64, 158, 255, 0.3);
}

.nav-tab {
  cursor: pointer;
  user-select: none;
}

/* 动画效果 */
@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(22, 93, 255, 0.4);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(22, 93, 255, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(22, 93, 255, 0);
  }
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .filter-row {
    flex-direction: column;
    align-items: stretch;
  }

  .filter-actions {
    margin-left: 0;
    justify-content: flex-end;
    margin-top: 10px;
  }

  .filter-options .el-select,
  .filter-options .el-date-picker {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .execution-records {
    padding: 10px;
  }

  .navigation-tabs {
    flex-wrap: wrap;
  }

  .nav-tab {
    flex: 1 0 33%;
    padding: 10px 0;
    font-size: 12px;
  }

  .tracking-title {
    display: flex;
    flex-direction: column;
  }

  .task-type,
  .work-order-no,
  .time-range {
    margin-right: 0;
    margin-bottom: 8px;
  }

  .pagination-section {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}

/* 旋转动画 */
.rotate-180 {
  transform: rotate(180deg);
  transition: transform 0.3s ease;
}
</style>
