我来帮您将 `email-admin.html` 转换为 Vue 组件 `email/index.vue`。这是一个完整的邮件管理系统，需要将HTML、CSS和JavaScript逻辑转换为Vue的组件形式。

```vue:src/views/email/index.vue
<template>
  <div class="email-container">
    <!-- 顶部标题 -->
    <!-- <div class="email-header">
      <h1 class="email-title">
        <i class="el-icon-message"></i>
        邮件管理系统
      </h1>
    </div> -->

    <!-- 主要内容区域 -->
    <div class="email-main">
      <!-- 导航标签 -->
      <el-tabs v-model="activeTab" type="border-card">
        <el-tab-pane label="邮件模板" name="templates">
          <template #label>
            <span><i class="el-icon-document"></i> 邮件模板</span>
          </template>
          
          <div class="tab-header">
            <h4>选择邮件模板</h4>
            <el-button type="primary" @click="showTemplateModal = true">
              <i class="el-icon-plus"></i>
              创建模板
            </el-button>
          </div>

          <el-alert
            title="请选择一个邮件模板，然后点击'下一步'进入收件人管理"
            type="info"
            :closable="false"
            show-icon>
          </el-alert>

          <div class="templates-list">
            <div
              v-for="template in emailTemplates"
              :key="template.id"
              class="template-card"
              :class="{ selected: selectedTemplate && selectedTemplate.id === template.id }"
              @click="selectTemplate(template.id)">
              
              <!-- <div class="template-radio">
                <el-radio v-model="selectedTemplateId" :label="template.id"></el-radio>
              </div> -->
              
              <div class="template-header">
                <div class="flex-grow-1">
                  <div class="template-title">{{ template.name }}</div>
                  <div class="template-meta">
                    <span><i class="el-icon-date"></i> {{ template.createTime }}</span>
                    <span><i class="el-icon-data-line"></i> 使用{{ template.useCount }}次</span>
                    <span><i class="el-icon-price-tag"></i> {{ template.variables.length }}个变量</span>
                  </div>
                </div>
                <el-dropdown @command="handleTemplateAction" trigger="click" @click.stop>
                  <span class="el-dropdown-link">
                    <i class="el-icon-more"></i>
                  </span>
                  <template #dropdown>
                    <el-dropdown-menu>
                      <el-dropdown-item :command="{ action: 'edit', id: template.id }">
                        <i class="el-icon-edit"></i> 编辑
                      </el-dropdown-item>
                      <el-dropdown-item :command="{ action: 'duplicate', id: template.id }">
                        <i class="el-icon-document-copy"></i> 复制
                      </el-dropdown-item>
                      <el-dropdown-item :command="{ action: 'delete', id: template.id }" divided>
                        <i class="el-icon-delete"></i> 删除
                      </el-dropdown-item>
                    </el-dropdown-menu>
                  </template>
                </el-dropdown>
              </div>
              
              <p class="template-description">{{ template.description }}</p>
              <div class="template-preview" v-html="formatTemplateContent(template.content)"></div>
              
              <div class="template-variables">
                <strong>可用变量：</strong>
                <span v-for="variable in template.variables" :key="variable" class="variable-tag">
                  {{ '{' + '{' + variable + '}' + '}' }}
                </span>
              </div>
            </div>
          </div>

          <div class="tab-footer">
            <el-button type="success" :disabled="!selectedTemplate" @click="goToRecipients">
              <i class="el-icon-arrow-right"></i>
              下一步：选择收件人
            </el-button>
          </div>
        </el-tab-pane>

        <el-tab-pane label="收件人管理" name="recipients">
          <template #label>
            <span><i class="el-icon-user"></i> 收件人管理</span>
          </template>
          
          <div class="tab-header">
            <h4>收件人管理</h4>
            <div class="selected-template-info">
              已选择模板：<el-tag type="primary">{{ selectedTemplate ? selectedTemplate.name : '未选择' }}</el-tag>
            </div>
          </div>

          <!-- Excel批量导入区域 -->
          <div class="upload-section">
            <h5>Excel批量导入</h5>
            <div class="upload-area" @click="triggerFileUpload" @drop="handleDrop" @dragover.prevent @dragenter.prevent>
              <i class="el-icon-upload" style="font-size: 48px; color: #909399; margin-bottom: 16px;"></i>
              <h6>点击上传Excel文件</h6>
              <p>支持 .xlsx, .xls 格式</p>
              <input
                ref="fileInput"
                type="file"
                accept=".xlsx,.xls"
                style="display: none;"
                @change="handleFileUpload">
            </div>
            <div class="upload-tips">
              <i class="el-icon-info"></i>
              Excel文件应包含：姓名、邮箱、课程名称、公司等字段
            </div>
          </div>

          <!-- 用户列表选择区域 -->
          <div class="recipient-table">
            <div class="table-header">
              <el-checkbox v-model="selectAll" @change="toggleSelectAll">全选用户</el-checkbox>
            </div>
            <el-table
              :data="recipients"
              @selection-change="handleSelectionChange"
              style="width: 100%">
              <el-table-column type="selection" width="55"></el-table-column>
              <el-table-column prop="name" label="姓名"></el-table-column>
              <el-table-column prop="email" label="邮箱"></el-table-column>
              <el-table-column prop="company" label="公司"></el-table-column>
              <el-table-column prop="course" label="课程名称"></el-table-column>
            </el-table>
          </div>

          <!-- 数据统计预览 -->
          <div class="stats-section">
            <div class="stats-card">
              <i class="el-icon-user" style="font-size: 24px; color: #409EFF;"></i>
              <h4>{{ recipients.length }}</h4>
              <small>总用户数</small>
            </div>
            <div class="stats-card">
              <i class="el-icon-check" style="font-size: 24px; color: #67C23A;"></i>
              <h4>{{ selectedRecipients.length }}</h4>
              <small>已选择</small>
            </div>
            <div class="stats-card">
              <i class="el-icon-message" style="font-size: 24px; color: #E6A23C;"></i>
              <h4>{{ validEmailsCount }}</h4>
              <small>有效邮箱</small>
            </div>
          </div>

          <!-- 已选择的收件人 -->
          <div class="selected-section">
            <div class="section-header">
              <h5>已选择的收件人 ({{ selectedRecipients.length }}人)</h5>
              <div class="action-buttons">
                <el-button size="small" @click="clearSelection">
                  <i class="el-icon-close"></i> 清空选择
                </el-button>
                <el-button size="small" type="primary" @click="exportSelected">
                  <i class="el-icon-download"></i> 导出选中
                </el-button>
              </div>
            </div>
            
            <div v-if="selectedRecipients.length > 0" class="selected-preview">
              <el-table :data="selectedRecipients" size="small">
                <el-table-column prop="name" label="姓名"></el-table-column>
                <el-table-column prop="email" label="邮箱"></el-table-column>
                <el-table-column prop="company" label="公司"></el-table-column>
                <el-table-column prop="course" label="课程"></el-table-column>
                <el-table-column label="操作" width="80">
                  <template #default="scope">
                    <el-button size="mini" type="danger" @click="removeFromSelection(scope.row.id)">
                      <i class="el-icon-close"></i>
                    </el-button>
                  </template>
                </el-table-column>
              </el-table>
            </div>
            <div v-else class="empty-selection">
              暂未选择收件人
            </div>
          </div>

          <div class="tab-navigation">
            <el-button @click="goBackToTemplates">
              <i class="el-icon-arrow-left"></i>
              上一步：选择模板
            </el-button>
            <el-button type="success" :disabled="selectedRecipients.length === 0" @click="goToSend">
              <i class="el-icon-arrow-right"></i>
              下一步：批量发送
            </el-button>
          </div>
        </el-tab-pane>

        <el-tab-pane label="批量发送" name="send">
          <template #label>
            <span><i class="el-icon-s-promotion"></i> 批量发送</span>
          </template>
          
          <div class="tab-header">
            <h4>批量发送确认</h4>
            <div class="send-info">
              模板：<el-tag type="primary">{{ selectedTemplate ? selectedTemplate.name : '-' }}</el-tag>
              收件人：<el-tag type="success">{{ selectedRecipients.length }}人</el-tag>
            </div>
          </div>

          <el-row :gutter="20">
            <el-col :span="12">
              <h5>收件人预览（前3条）</h5>
              <div class="preview-table">
                <el-table :data="previewRecipients" size="small">
                  <el-table-column prop="name" label="姓名"></el-table-column>
                  <el-table-column prop="email" label="邮箱"></el-table-column>
                  <el-table-column prop="company" label="公司"></el-table-column>
                  <el-table-column prop="course" label="课程"></el-table-column>
                </el-table>
                <div v-if="selectedRecipients.length > 3" class="more-info">
                  还有 {{ selectedRecipients.length - 3 }} 位收件人未显示
                </div>
              </div>

              <h5 style="margin-top: 20px;">发送设置</h5>
              <el-form :model="sendForm" label-width="100px">
                <el-form-item label="邮件主题" required>
                  <el-input
                    v-model="sendForm.subject"
                    :placeholder="`支持变量，如：{{姓名}}，欢迎参加{{课程名称}}`"
                    @input="updateEmailPreview">
                  </el-input>
                </el-form-item>
                
                <el-form-item label="发送方式">
                  <el-radio-group v-model="sendForm.sendMode" @change="updateEmailPreview">
                    <el-radio label="now">立即发送</el-radio>
                    <el-radio label="scheduled">定时发送</el-radio>
                  </el-radio-group>
                </el-form-item>
                
                <el-form-item v-if="sendForm.sendMode === 'scheduled'" label="发送时间">
                  <el-date-picker
                    v-model="sendForm.scheduleTime"
                    type="datetime"
                    placeholder="选择发送时间">
                  </el-date-picker>
                </el-form-item>
                
                <el-form-item>
                  <el-checkbox v-model="sendForm.testSend">
                    先发送测试邮件到我的邮箱
                  </el-checkbox>
                </el-form-item>
              </el-form>
            </el-col>
            
            <el-col :span="12">
              <h5>邮件内容预览</h5>
              <div class="email-preview-card">
                <div class="preview-title">邮件预览</div>
                <div class="preview-meta">以第一位收件人为示例</div>
                <div class="preview-content" v-html="emailPreviewContent"></div>
              </div>
            </el-col>
          </el-row>

          <div class="tab-navigation">
            <el-button @click="goBackToRecipients">
              <i class="el-icon-arrow-left"></i>
              上一步：选择收件人
            </el-button>
            <el-button type="success" :disabled="!sendForm.subject" @click="confirmSending">
              <i class="el-icon-s-promotion"></i>
              确定发送
            </el-button>
          </div>

          <!-- 发送进度 -->
          <div v-if="showSendProgress" class="send-progress">
            <h5>发送进度</h5>
            <el-progress :percentage="sendProgress" :status="sendProgress === 100 ? 'success' : ''"></el-progress>
            <div class="send-status">
              <div v-for="status in sendStatusList" :key="status.id" class="progress-item">
                <div>
                  <strong>{{ status.name }}</strong> ({{ status.email }})
                </div>
                <el-tag :type="getStatusType(status.status)">{{ getStatusText(status.status) }}</el-tag>
              </div>
            </div>
          </div>
        </el-tab-pane>

        <el-tab-pane label="发送记录" name="history">
          <template #label>
            <span><i class="el-icon-time"></i> 发送记录</span>
          </template>
          
          <div class="tab-header">
            <h4>发送记录</h4>
            <el-select v-model="historyFilter" placeholder="全部状态" clearable>
              <el-option label="全部状态" value=""></el-option>
              <el-option label="发送成功" value="sent"></el-option>
              <el-option label="发送失败" value="failed"></el-option>
              <el-option label="等待发送" value="pending"></el-option>
            </el-select>
          </div>

          <el-table :data="filteredHistory" @row-click="toggleHistoryDetail">
            <el-table-column prop="sendTime" label="发送时间"></el-table-column>
            <el-table-column prop="templateName" label="模板名称"></el-table-column>
            <el-table-column prop="recipientCount" label="收件人数量">
              <template #default="scope">{{ scope.row.recipientCount }}人</template>
            </el-table-column>
            <el-table-column label="成功/失败">
              <template #default="scope">
                <span style="color: #67C23A;">{{ scope.row.successCount }}</span> / 
                <span style="color: #F56C6C;">{{ scope.row.failCount }}</span>
              </template>
            </el-table-column>
            <el-table-column prop="status" label="状态">
              <template #default="scope">
                <el-tag :type="scope.row.status === 'completed' ? 'success' : 'warning'">
                  {{ scope.row.status === 'completed' ? '已完成' : '进行中' }}
                </el-tag>
              </template>
            </el-table-column>
            <el-table-column label="操作">
              <template #default="scope">
                <el-button size="mini" @click.stop="toggleHistoryDetail(scope.row)">详情</el-button>
              </template>
            </el-table-column>
          </el-table>
        </el-tab-pane>
      </el-tabs>
    </div>

    <!-- 创建模板弹窗 -->
    <el-dialog
      title="创建邮件模板"
      :visible.sync="showTemplateModal"
      width="80%"
      :before-close="handleCloseTemplateModal">
      <el-form :model="templateForm" label-width="100px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="模板名称" required>
              <el-input v-model="templateForm.name"></el-input>
            </el-form-item>
            <el-form-item label="模板描述">
              <el-input v-model="templateForm.description" type="textarea" :rows="2"></el-input>
            </el-form-item>
            <el-form-item label="可用变量">
              <div class="variable-tags">
                <span
                  v-for="variable in availableVariables"
                  :key="variable"
                  class="variable-tag clickable"
                  @click="insertVariable(`{{${variable}}}`)">
                  {{ '{' + '{' + variable + '}' + '}' }}
                </span>
              </div>
            </el-form-item>
            <el-form-item label="邮件内容" required>
              <el-input
                ref="templateContentRef"
                v-model="templateForm.content"
                type="textarea"
                :rows="15"
                placeholder="请输入邮件内容，可以使用上方的变量..."
                @input="updateTemplatePreview">
              </el-input>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="实时预览">
              <div class="template-preview-container" v-html="templatePreviewContent"></div>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <span class="dialog-footer">
          <el-button @click="showTemplateModal = false">取消</el-button>
          <el-button type="primary" @click="saveTemplate">保存模板</el-button>
        </span>
      </template>
    </el-dialog>
  </div>
</template>

<script>
export default {
  name: 'EmailManagement',
  data() {
    return {
      activeTab: 'templates',
      showTemplateModal: false,
      showSendProgress: false,
      sendProgress: 0,
      selectAll: false,
      selectedTemplateId: null,
      historyFilter: '',
      
      // 表单数据
      templateForm: {
        name: '',
        description: '',
        content: ''
      },
      
      sendForm: {
        subject: '',
        sendMode: 'now',
        scheduleTime: null,
        testSend: false
      },

      // 邮件模板数据
      emailTemplates: [
        {
          id: 1,
          name: '课程通知模板',
          description: '用于课程开始前的通知邮件',
          content: `亲爱的{{姓名}}，您好！

感谢您报名参加我们的课程。以下是课程详细信息：

课程名称：{{课程名称}}
开始时间：{{开始时间}}
上课地点：{{地点}}

请您准时参加，如有任何问题，请随时联系我们。

祝好！
苏州科技商学院`,
          variables: ['姓名', '课程名称', '开始时间', '地点'],
          createTime: '2025-06-01 10:00',
          useCount: 15
        },
        {
          id: 2,
          name: '课程反馈邀请',
          description: '课程结束后邀请填写反馈问卷',
          content: `{{姓名}}同学，您好！

感谢您参加{{课程名称}}课程。为了不断改进我们的教学质量，诚邀您填写课程反馈问卷。

您的宝贵意见对我们非常重要，问卷填写仅需3-5分钟。

点击链接填写：[问卷链接]

再次感谢您的参与！

{{公司}}
苏州科技商学院`,
          variables: ['姓名', '课程名称', '公司'],
          createTime: '2025-06-02 14:30',
          useCount: 8
        }
      ],

      // 收件人数据
      recipients: [],
      selectedRecipients: [],

      // 发送记录
      sendHistory: [
        {
          id: 1,
          templateName: '课程通知模板',
          recipientCount: 25,
          successCount: 23,
          failCount: 2,
          status: 'completed',
          sendTime: '2025-06-01 15:30',
          details: '发送完成，2封邮件因邮箱地址无效发送失败'
        },
        {
          id: 2,
          templateName: '课程反馈邀请',
          recipientCount: 15,
          successCount: 15,
          failCount: 0,
          status: 'completed',
          sendTime: '2025-06-02 18:00',
          details: '全部发送成功'
        }
      ],
      
      sendStatusList: [],
      availableVariables: ['姓名', '邮箱', '公司', '课程名称', '开始时间', '地点']
    }
  },

  computed: {
    selectedTemplate() {
      return this.emailTemplates.find(t => t.id === this.selectedTemplateId)
    },

    validEmailsCount() {
      return this.recipients.filter(user => user.email && user.email.includes('@')).length
    },

    previewRecipients() {
      return this.selectedRecipients.slice(0, 3)
    },

    emailPreviewContent() {
      if (!this.selectedTemplate || this.selectedRecipients.length === 0 || !this.sendForm.subject) {
        return '请先完善发送设置...'
      }

      const sampleUser = this.selectedRecipients[0]
      const subjectPreview = this.replaceVariables(this.sendForm.subject, sampleUser)
      const contentPreview = this.replaceVariables(this.selectedTemplate.content, sampleUser)

      return `
        <div class="mb-3">
          <strong>主题：</strong>${subjectPreview}
        </div>
        <div class="mb-3">
          <strong>收件人：</strong>${sampleUser.name} (${sampleUser.email})
        </div>
        <hr>
        <div>${contentPreview.replace(/\n/g, '<br>')}</div>
      `
    },

    templatePreviewContent() {
      if (!this.templateForm.content) {
        return '预览内容将在这里显示...'
      }

      const sampleData = {
        name: '张三',
        email: 'zhangsan@example.com',
        company: '科技有限公司',
        course: '智能制造专题'
      }

      return this.replaceVariables(this.templateForm.content, sampleData, true).replace(/\n/g, '<br>')
    },

    filteredHistory() {
      if (!this.historyFilter) return this.sendHistory
      return this.sendHistory.filter(record => record.status === this.historyFilter)
    }
  },

  methods: {
    // 模板相关方法
    selectTemplate(templateId) {
      this.selectedTemplateId = templateId
    },

    handleTemplateAction(command) {
      switch (command.action) {
        case 'edit':
          this.editTemplate(command.id)
          break
        case 'duplicate':
          this.duplicateTemplate(command.id)
          break
        case 'delete':
          this.deleteTemplate(command.id)
          break
      }
    },

    editTemplate(templateId) {
      const template = this.emailTemplates.find(t => t.id === templateId)
      if (template) {
        this.templateForm = { ...template }
        this.showTemplateModal = true
      }
    },

    duplicateTemplate(templateId) {
      const template = this.emailTemplates.find(t => t.id === templateId)
      if (template) {
        const newTemplate = {
          ...template,
          id: Date.now(),
          name: template.name + ' (副本)',
          createTime: new Date().toLocaleString('zh-CN'),
          useCount: 0
        }
        this.emailTemplates.push(newTemplate)
        this.$message.success('模板复制成功！')
      }
    },

    deleteTemplate(templateId) {
      this.$confirm('确定要删除这个模板吗？', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        this.emailTemplates = this.emailTemplates.filter(t => t.id !== templateId)
        if (this.selectedTemplateId === templateId) {
          this.selectedTemplateId = null
        }
        this.$message.success('删除成功！')
      })
    },

    formatTemplateContent(content) {
      return content.replace(/\n/g, '<br>')
                   .replace(/\{\{([^}]+)\}\}/g, '<span class="variable-tag">{{$1}}</span>')
    },

    // 导航方法
    goToRecipients() {
      if (!this.selectedTemplate) {
        this.$message.warning('请先选择一个邮件模板')
        return
      }
      this.activeTab = 'recipients'
    },

    goBackToTemplates() {
      this.activeTab = 'templates'
    },

    goToSend() {
      if (!this.selectedTemplate) {
        this.$message.warning('请先选择邮件模板')
        return
      }
      if (this.selectedRecipients.length === 0) {
        this.$message.warning('请先选择收件人')
        return
      }
      this.activeTab = 'send'
      this.updateEmailPreview()
    },

    goBackToRecipients() {
      this.activeTab = 'recipients'
    },

    // 文件上传相关方法
    triggerFileUpload() {
      this.$refs.fileInput.click()
    },

    handleFileUpload(event) {
      const file = event.target.files[0]
      if (file) {
        this.parseExcelFile(file)
      }
    },

    handleDrop(event) {
      event.preventDefault()
      const files = event.dataTransfer.files
      if (files.length > 0) {
        this.parseExcelFile(files[0])
      }
    },

    parseExcelFile(file) {
      // 模拟Excel解析
      const loading = this.$loading({
        lock: true,
        text: '正在解析Excel文件...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      })

      setTimeout(() => {
        const newUsers = [
          { id: Date.now() + 1, name: '新用户1', email: 'newuser1@example.com', company: '导入公司1', course: '导入课程1' },
          { id: Date.now() + 2, name: '新用户2', email: 'newuser2@example.com', company: '导入公司2', course: '导入课程2' },
          { id: Date.now() + 3, name: '新用户3', email: 'newuser3@example.com', company: '导入公司3', course: '导入课程3' }
        ]

        this.recipients = [...this.recipients, ...newUsers]
        loading.close()
        this.$message.success(`成功导入 ${newUsers.length} 个用户数据！`)
      }, 2000)
    },

    // 收件人选择相关方法
    handleSelectionChange(selection) {
      this.selectedRecipients = selection
    },

    toggleSelectAll() {
      this.$refs.recipientTable.toggleAllSelection()
    },

    removeFromSelection(userId) {
      this.selectedRecipients = this.selectedRecipients.filter(user => user.id !== userId)
    },

    clearSelection() {
      this.selectedRecipients = []
      this.$refs.recipientTable.clearSelection()
    },

    exportSelected() {
      if (this.selectedRecipients.length === 0) {
        this.$message.warning('请先选择要导出的用户')
        return
      }

      // 创建CSV内容
      const csvData = [
        ['姓名', '邮箱', '公司', '课程名称'],
        ...this.selectedRecipients.map(user => [
          user.name,
          user.email,
          user.company,
          user.course || ''
        ])
      ]

      const csvContent = csvData.map(row => row.join(',')).join('\n')
      const blob = new Blob(['\ufeff' + csvContent], { type: 'text/csv;charset=utf-8;' })
      const link = document.createElement('a')
      const url = URL.createObjectURL(blob)
      
      link.setAttribute('href', url)
      link.setAttribute('download', `选中用户_${new Date().toISOString().slice(0, 10)}.csv`)
      link.style.visibility = 'hidden'
      
      document.body.appendChild(link)
      link.click()
      document.body.removeChild(link)

      this.$message.success(`已导出 ${this.selectedRecipients.length} 个用户数据`)
    },

    // 模板编辑相关方法
    handleCloseTemplateModal() {
      this.templateForm = {
        name: '',
        description: '',
        content: ''
      }
      this.showTemplateModal = false
    },

    insertVariable(variable) {
      const textarea = this.$refs.templateContentRef.$el.querySelector('textarea')
      const start = textarea.selectionStart
      const end = textarea.selectionEnd
      const text = this.templateForm.content
      
      this.templateForm.content = text.substring(0, start) + variable + text.substring(end)
      
      this.$nextTick(() => {
        textarea.focus()
        textarea.setSelectionRange(start + variable.length, start + variable.length)
      })
    },

    updateTemplatePreview() {
      // 预览内容通过计算属性自动更新
    },

    saveTemplate() {
      if (!this.templateForm.name || !this.templateForm.content) {
        this.$message.error('请填写模板名称和内容')
        return
      }

      // 提取变量
      const variables = [...new Set(this.templateForm.content.match(/\{\{([^}]+)\}\}/g) || [])].map(v => v.slice(2, -2))

      const template = {
        id: this.templateForm.id || Date.now(),
        name: this.templateForm.name,
        description: this.templateForm.description,
        content: this.templateForm.content,
        variables: variables,
        createTime: new Date().toLocaleString('zh-CN'),
        useCount: this.templateForm.useCount || 0
      }

      if (this.templateForm.id) {
        // 编辑现有模板
        const index = this.emailTemplates.findIndex(t => t.id === this.templateForm.id)
        this.emailTemplates.splice(index, 1, template)
        this.$message.success('模板更新成功！')
      } else {
        // 创建新模板
        this.emailTemplates.push(template)
        this.$message.success('模板创建成功！')
      }

      this.handleCloseTemplateModal()
    },

    // 发送相关方法
    updateEmailPreview() {
      // 预览内容通过计算属性自动更新
    },

    confirmSending() {
      if (!this.sendForm.subject) {
        this.$message.error('请填写邮件主题')
        return
      }

      this.$confirm(
        `确定要发送邮件给 ${this.selectedRecipients.length} 个收件人吗？\n\n模板：${this.selectedTemplate.name}\n主题：${this.sendForm.subject}`,
        '确认发送',
        {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }
      ).then(() => {
        this.simulateSending()
      })
    },

    simulateSending() {
      this.showSendProgress = true
      this.sendProgress = 0
      this.sendStatusList = this.selectedRecipients.map(user => ({
        ...user,
        status: 'pending'
      }))

      let sent = 0
      const total = this.selectedRecipients.length

      const sendInterval = setInterval(() => {
        if (sent < total) {
          // 模拟发送成功/失败
          const success = Math.random() > 0.1 // 90%成功率
          this.sendStatusList[sent].status = success ? 'sent' : 'failed'
          
          sent++
          this.sendProgress = Math.round((sent / total) * 100)
          
          if (sent === total) {
            clearInterval(sendInterval)
            this.$message.success('邮件发送完成！')
            
            // 添加到发送记录
            const newRecord = {
              id: Date.now(),
              templateName: this.selectedTemplate.name,
              recipientCount: total,
              successCount: this.sendStatusList.filter(s => s.status === 'sent').length,
              failCount: this.sendStatusList.filter(s => s.status === 'failed').length,
              status: 'completed',
              sendTime: new Date().toLocaleString('zh-CN'),
              details: '发送完成'
            }
            
            this.sendHistory.unshift(newRecord)
          }
        }
      }, 1000)
    },

    // 发送记录相关方法
    toggleHistoryDetail(record) {
      // 这里可以展开显示详细的发送记录
      console.log('查看记录详情:', record)
    },

    // 工具方法
    replaceVariables(text, userData, isPreview = false) {
      let result = text
        .replace(/\{\{姓名\}\}/g, userData.name || '示例姓名')
        .replace(/\{\{邮箱\}\}/g, userData.email || 'example@email.com')
        .replace(/\{\{公司\}\}/g, userData.company || '示例公司')
        .replace(/\{\{课程名称\}\}/g, userData.course || '示例课程')
        .replace(/\{\{开始时间\}\}/g, '2025-06-15 09:00')
        .replace(/\{\{地点\}\}/g, '苏州科技大学')

      if (isPreview) {
        result = result.replace(/\{\{([^}]+)\}\}/g, '<span class="variable-tag">{{$1}}</span>')
      }

      return result
    },

    getStatusType(status) {
      const statusMap = {
        pending: 'warning',
        sending: 'primary',
        sent: 'success',
        failed: 'danger'
      }
      return statusMap[status] || 'info'
    },

    getStatusText(status) {
      const statusMap = {
        pending: '等待发送',
        sending: '发送中',
        sent: '发送成功',
        failed: '发送失败'
      }
      return statusMap[status] || '未知状态'
    }
  }
}
</script>

<style scoped>
.email-container {
  padding: 20px;
  background-color: #f8f9fa;
  min-height: 100vh;
}

.email-header {
  background: white;
  padding: 20px 30px;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  margin-bottom: 20px;
  border-radius: 8px;
}

.email-title {
  font-size: 24px;
  font-weight: 700;
  color: #2c3e50;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.email-main {
  max-width: 1400px;
  margin: 0 auto;
}

.tab-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.tab-footer, .tab-navigation {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid #e9ecef;
}

.templates-list {
  margin: 20px 0;
}

.template-card {
  background: white;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  padding: 24px;
  margin-bottom: 20px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
}

.template-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.15);
  transform: translateY(-2px);
}

.template-card.selected {
  border-color: #409EFF;
  background: #f8fbff;
}

.template-radio {
  position: absolute;
  top: 16px;
  right: 16px;
}

.template-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.template-title {
  font-size: 18px;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 8px;
}

.template-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 16px;
}

.template-description {
  color: #6c757d;
  margin-bottom: 16px;
}

.template-preview {
  background: #f8f9fa;
  border: 1px solid #e9ecef;
  border-radius: 8px;
  padding: 16px;
  margin-bottom: 16px;
  font-size: 14px;
  line-height: 1.6;
}

.template-variables {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.variable-tag {
  background: #e3f2fd;
  color: #1976d2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-family: monospace;
}

.variable-tag.clickable {
  cursor: pointer;
  transition: background-color 0.2s;
}

.variable-tag.clickable:hover {
  background: #bbdefb;
}

.upload-section {
  margin-bottom: 30px;
}

.upload-area {
  border: 2px dashed #e9ecef;
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  background: white;
  transition: all 0.3s ease;
  cursor: pointer;
}

.upload-area:hover {
  border-color: #409EFF;
  background: #f8f9ff;
}

.upload-tips {
  margin-top: 10px;
  font-size: 14px;
  color: #6c757d;
}

.recipient-table {
  background: white;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.table-header {
  background: #409EFF;
  color: white;
  padding: 16px 20px;
  font-weight: 600;
}

.stats-section {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 30px;
}

.stats-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.stats-card h4 {
  margin: 10px 0 5px;
  font-size: 24px;
  font-weight: bold;
}

.stats-card small {
  color: #6c757d;
  font-size: 12px;
}

.selected-section {
  background: white;
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-bottom: 20px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.action-buttons {
  display: flex;
  gap: 10px;
}

.selected-preview {
  margin-top: 15px;
}

.empty-selection {
  text-align: center;
  color: #6c757d;
  padding: 20px;
}

.selected-template-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.send-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.preview-table {
  background: white;
  border-radius: 8px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.more-info {
  text-align: center;
  color: #6c757d;
  margin-top: 10px;
  font-size: 14px;
}

.email-preview-card {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 8px;
}

.preview-meta {
  font-size: 14px;
  color: #6c757d;
  margin-bottom: 15px;
}

.preview-content {
  border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 15px;
  background: #fafafa;
  line-height: 1.6;
}

.send-progress {
  background: white;
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  margin-top: 20px;
}

.send-status {
  margin-top: 20px;
}

.progress-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e9ecef;
}

.progress-item:last-child {
  border-bottom: none;
}

.template-preview-container {
    border: 1px solid #e9ecef;
  border-radius: 4px;
  padding: 15px;
  background: #fafafa;
  min-height: 400px;
  max-height: 400px;
  overflow-y: auto;
  line-height: 1.6;
}

.variable-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flex-grow-1 {
  flex-grow: 1;
}

.el-dropdown-link {
  cursor: pointer;
  color: #409EFF;
  font-size: 16px;
  padding: 5px;
}

.el-dropdown-link:hover {
  color: #66b1ff;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .email-container {
    padding: 10px;
  }
  
  .email-header {
    padding: 15px 20px;
  }
  
  .email-title {
    font-size: 20px;
  }
  
  .tab-header {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  
  .tab-navigation {
    flex-direction: column;
    gap: 10px;
  }
  
  .template-card {
    padding: 16px;
  }
  
  .template-meta {
    flex-direction: column;
    gap: 8px;
  }
  
  .stats-section {
    grid-template-columns: 1fr;
  }
  
  .send-info {
    flex-direction: column;
    gap: 10px;
  }
  
  .action-buttons {
    flex-direction: column;
    width: 100%;
  }
  
  .upload-area {
    padding: 20px;
  }
  
  .selected-template-info {
    flex-direction: column;
    gap: 5px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .template-variables {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .variable-tags {
    justify-content: flex-start;
  }
  
  .section-header {
    flex-direction: column;
    gap: 10px;
    text-align: center;
  }
  
  .email-preview-card {
    padding: 15px;
  }
  
  .preview-table {
    padding: 10px;
  }
}

/* Element UI 样式覆盖 */
::v-deep .el-tabs__content {
  padding: 20px 0;
}

::v-deep .el-tabs__header {
  margin-bottom: 0;
}

::v-deep .el-tabs--border-card > .el-tabs__content {
  padding: 20px;
}

::v-deep .el-table th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  font-weight: 600;
}

::v-deep .el-table tbody tr:hover > td {
  background-color: #f8f9fa;
}

::v-deep .el-dialog__header {
  padding: 20px 20px 10px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
}

::v-deep .el-dialog__title {
  color: white;
  font-weight: 600;
}

::v-deep .el-dialog__headerbtn .el-dialog__close {
  color: white;
}

::v-deep .el-progress-bar__outer {
  border-radius: 10px;
}

::v-deep .el-progress-bar__inner {
  border-radius: 10px;
}

::v-deep .el-alert {
  border-radius: 8px;
  margin-bottom: 20px;
}

::v-deep .el-form-item__label {
  font-weight: 500;
  color: #2c3e50;
}

::v-deep .el-input__inner, 
::v-deep .el-textarea__inner {
  border-radius: 6px;
  border: 1px solid #dcdfe6;
  transition: all 0.3s;
}

::v-deep .el-input__inner:focus, 
::v-deep .el-textarea__inner:focus {
  border-color: #409EFF;
  box-shadow: 0 0 0 2px rgba(64, 158, 255, 0.2);
}

::v-deep .el-button {
  border-radius: 6px;
  font-weight: 500;
  transition: all 0.3s;
}

::v-deep .el-button--primary {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border: none;
}

::v-deep .el-button--primary:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(64, 158, 255, 0.3);
}

::v-deep .el-button--success {
  background: linear-gradient(135deg, #67c23a 0%, #85ce61 100%);
  border: none;
}

::v-deep .el-button--success:hover {
  background: linear-gradient(135deg, #5daf34 0%, #7bc451 100%);
  transform: translateY(-1px);
}

::v-deep .el-tag {
  border-radius: 12px;
  font-weight: 500;
}

::v-deep .el-radio__input.is-checked .el-radio__inner {
  background: #409EFF;
  border-color: #409EFF;
}

::v-deep .el-checkbox__input.is-checked .el-checkbox__inner {
  background: #409EFF;
  border-color: #409EFF;
}

/* 自定义滚动条 */
.template-preview-container::-webkit-scrollbar,
.send-status::-webkit-scrollbar {
  width: 6px;
}

.template-preview-container::-webkit-scrollbar-track,
.send-status::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.template-preview-container::-webkit-scrollbar-thumb,
.send-status::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

.template-preview-container::-webkit-scrollbar-thumb:hover,
.send-status::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 动画效果 */
.template-card {
  animation: fadeInUp 0.3s ease-out;
}

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

.progress-item {
  animation: slideInLeft 0.3s ease-out;
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 加载状态样式 */
.loading-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  z-index: 10;
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #409EFF;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* 拖拽上传样式 */
.upload-area.dragover {
  border-color: #409EFF;
  background: #e3f2fd;
  transform: scale(1.02);
}

/* 错误状态样式 */
.error-state {
  text-align: center;
  padding: 40px;
  color: #909399;
}

.error-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* 成功状态样式 */
.success-state {
  text-align: center;
  padding: 40px;
  color: #67C23A;
}

.success-state i {
  font-size: 48px;
  margin-bottom: 16px;
  display: block;
}

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: #909399;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  display: block;
  color: #c0c4cc;
}

.empty-state h4 {
  margin-bottom: 12px;
  color: #606266;
}

.empty-state p {
  margin-bottom: 0;
  font-size: 14px;
}

/* 高亮搜索结果 */
.highlight {
  background-color: #fff2cc;
  padding: 1px 3px;
  border-radius: 2px;
}

/* 状态徽章动画 */
.status-badge {
  animation: pulse 0.5s ease-in-out;
}

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

/* 工具提示样式 */
.tooltip-content {
  max-width: 200px;
  word-wrap: break-word;
}

/* 表格行悬停效果增强 */
::v-deep .el-table__row:hover {
  background-color: #f8f9fa;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

/* 按钮组样式 */
.button-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.button-group .el-button {
  margin: 0;
}

/* 卡片悬停效果 */
.hover-card {
  transition: all 0.3s ease;
}

.hover-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* 渐变背景 */
.gradient-bg {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

/* 文本渐变 */
.gradient-text {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 600;
}

/* 打字机效果 */
.typewriter {
  overflow: hidden;
  border-right: .15em solid #409EFF;
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: .15em;
  animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}

@keyframes typing {
  from { width: 0 }
  to { width: 100% }
}

@keyframes blink-caret {
  from, to { border-color: transparent }
  50% { border-color: #409EFF; }
}

/* 加载动画 */
.bounce {
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    animation-timing-function: cubic-bezier(0.215, 0.610, 0.355, 1.000);
    transform: translate3d(0,0,0);
  }
  40%, 43% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -30px, 0);
  }
  70% {
    animation-timing-function: cubic-bezier(0.755, 0.050, 0.855, 0.060);
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0,-4px,0);
  }
}

/* 波浪动画 */
.wave {
  animation: wave 2s ease-in-out infinite;
}

@keyframes wave {
  0%, 100% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 进度条增强样式 */
.progress-enhanced {
  position: relative;
  background: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 100%);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: inset 0 2px 5px rgba(0,0,0,0.1);
}

.progress-enhanced::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.4) 50%, transparent 100%);
  animation: shimmer 2s infinite;
}

@keyframes shimmer {
  0% { left: -100%; }
  100% { left: 100%; }
}

/* 通知提示样式 */
.notification-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff4757;
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: pulse-notification 2s infinite;
}

@keyframes pulse-notification {
  0% {
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0.7);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(255, 71, 87, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(255, 71, 87, 0);
  }
}

/* 拖拽排序样式 */
.sortable-ghost {
  opacity: 0.4;
  background: #c8ebfb;
}

.sortable-chosen {
  transform: rotate(5deg);
}

.sortable-drag {
  transform: rotate(5deg);
  opacity: 0.8;
}

/* 代码块样式 */
.code-block {
  background: #2d3748;
  color: #e2e8f0;
  padding: 16px;
  border-radius: 8px;
  font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: auto;
}

.code-block .keyword {
  color: #ed8936;
}

.code-block .string {
  color: #68d391;
}

.code-block .comment {
  color: #a0aec0;
  font-style: italic;
}

/* 表单验证样式 */
.form-error {
  border-color: #f56565 !important;
  box-shadow: 0 0 0 2px rgba(245, 101, 101, 0.2) !important;
}

.form-success {
  border-color: #48bb78 !important;
  box-shadow: 0 0 0 2px rgba(72, 187, 120, 0.2) !important;
}

.error-message {
  color: #f56565;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.success-message {
  color: #48bb78;
  font-size: 12px;
  margin-top: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* 深色模式支持 */
@media (prefers-color-scheme: dark) {
  .email-container {
    background-color: #1a202c;
    color: #e2e8f0;
  }
  
  .email-header {
    background: #2d3748;
    border-bottom-color: #4a5568;
  }
  
  .template-card,
  .stats-card,
  .selected-section,
  .email-preview-card,
  .send-progress {
    background: #2d3748;
    border-color: #4a5568;
  }
  
  .template-preview,
  .preview-content,
  .template-preview-container {
    background: #1a202c;
    border-color: #4a5568;
    color: #e2e8f0;
  }
  
  .upload-area {
    background: #2d3748;
    border-color: #4a5568;
  }
  
  .upload-area:hover {
    background: #374151;
  }
}

/* 自定义选择器样式 */
.custom-select {
  position: relative;
}

.custom-select::after {
  content: '\25BC';
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  pointer-events: none;
  color: #666;
}

/* 图标动画 */
.icon-spin {
  animation: spin 1s linear infinite;
}

.icon-bounce {
  animation: iconBounce 1s ease-in-out infinite;
}

@keyframes iconBounce {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-10px);
  }
}

/* 文字闪烁效果 */
.text-blink {
  animation: blink 1.5s linear infinite;
}

@keyframes blink {
  0%, 50% {
    opacity: 1;
  }
  51%, 100% {
    opacity: 0;
  }
}

/* 悬停放大效果 */
.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

/* 边框渐变效果 */
.gradient-border {
  position: relative;
  background: white;
  border-radius: 8px;
}

.gradient-border::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 8px;
  padding: 2px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
}

/* 水波纹效果 */
.ripple {
  position: relative;
  overflow: hidden;
}

.ripple::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.5);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

.ripple:active::before {
  width: 300px;
  height: 300px;
}

/* 文字打字效果 */
.typing-effect {
  overflow: hidden;
  white-space: nowrap;
  width: 0;
  animation: typing 2s steps(20, end) forwards;
}

/* 滑入效果 */
.slide-in-left {
  animation: slideInLeft 0.5s ease-out;
}

.slide-in-right {
  animation: slideInRight 0.5s ease-out;
}

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

/* 翻转效果 */
.flip-card {
  perspective: 1000px;
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: center;
  transition: transform 0.6s;
  transform-style: preserve-3d;
}

.flip-card:hover .flip-card-inner {
  transform: rotateY(180deg);
}

.flip-card-front, .flip-card-back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  border-radius: 8px;
}

.flip-card-back {
  transform: rotateY(180deg);
}

/* 毛玻璃效果 */
.glass-effect {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

/* 霓虹灯效果 */
.neon-text {
  color: #fff;
  text-shadow: 
    0 0 5px #409EFF,
    0 0 10px #409EFF,
    0 0 20px #409EFF,
    0 0 40px #409EFF;
}

/* 粒子效果背景 */
.particles-bg {
  position: relative;
  overflow: hidden;
}

.particles-bg::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(circle at 20% 50%, rgba(64, 158, 255, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(118, 75, 162, 0.1) 0%, transparent 50%),
    radial-gradient(circle at 40% 80%, rgba(64, 158, 255, 0.1) 0%, transparent 50%);
  animation: particles 10s ease-in-out infinite;
}

@keyframes particles {
  0%, 100% {
    transform: translate(0, 0) rotate(0deg);
  }
  33% {
    transform: translate(30px, -30px) rotate(120deg);
  }
  66% {
    transform: translate(-20px, 20px) rotate(240deg);
  }
}

/* 脉冲光晕效果 */
.pulse-glow {
  animation: pulseGlow 2s ease-in-out infinite alternate;
}

@keyframes pulseGlow {
  from {
    box-shadow: 0 0 20px rgba(64, 158, 255, 0.4);
  }
  to {
    box-shadow: 0 0 30px rgba(64, 158, 255, 0.8);
  }
}

/* 浮动标签效果 */
.floating-label {
  position: relative;
}

.floating-label input:focus + label,
.floating-label input:not(:placeholder-shown) + label {
  transform: translateY(-25px) scale(0.8);
  color: #409EFF;
}

.floating-label label {
  position: absolute;
  top: 12px;
  left: 12px;
  transition: all 0.3s ease;
  pointer-events: none;
  color: #999;
}

/* 微交互按钮 */
.micro-interaction-btn {
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.micro-interaction-btn::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.3s, height 0.3s;
}

.micro-interaction-btn:hover::after {
  width: 100%;
  height: 100%;
}

/* 数据可视化样式 */
.chart-container {
  position: relative;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  border-radius: 12px;
  overflow: hidden;
}

.chart-grid {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    linear-gradient(rgba(64, 158, 255, 0.1) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 158, 255, 0.1) 1px, transparent 1px);
  background-size: 20px 20px;
}

/* 加载骨架屏 */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

@keyframes loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.skeleton-text {
  height: 16px;
  border-radius: 4px;
  margin-bottom: 8px;
}

.skeleton-title {
  height: 24px;
  border-radius: 4px;
  margin-bottom: 16px;
  width: 60%;
}

.skeleton-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
}

/* 工具提示增强 */
.tooltip-enhanced {
  position: relative;
  cursor: help;
}

.tooltip-enhanced::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 12px;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
  z-index: 1000;
}

.tooltip-enhanced::before {
  content: '';
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(1px);
  border: 5px solid transparent;
  border-top-color: #333;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 1000;
}

.tooltip-enhanced:hover::after,
.tooltip-enhanced:hover::before {
  opacity: 1;
}

/* 状态指示器 */
.status-indicator {
  position: relative;
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 8px;
}

.status-indicator.online {
  background: #52c41a;
  box-shadow: 0 0 0 2px rgba(82, 196, 26, 0.3);
}

.status-indicator.offline {
  background: #ff4d4f;
}

.status-indicator.away {
  background: #faad14;
}

.status-indicator.busy {
  background: #722ed1;
}

/* 进度环 */
.progress-circle {
  position: relative;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: conic-gradient(#409EFF 0deg, #409EFF var(--progress, 0deg), #e6f7ff var(--progress, 0deg));
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-circle::before {
  content: '';
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: white;
}

.progress-circle .progress-text {
  position: relative;
  z-index: 1;
  font-weight: bold;
  color: #409EFF;
}

/* 卡片堆叠效果 */
.card-stack {
  position: relative;
}

.card-stack .card {
  position: relative;
  background: white;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease;
}

.card-stack .card:nth-child(2) {
  transform: translateY(-4px) rotate(1deg);
  z-index: -1;
}

.card-stack .card:nth-child(3) {
  transform: translateY(-8px) rotate(-1deg);
  z-index: -2;
}

.card-stack:hover .card {
  transform: translateY(0) rotate(0deg);
}

/* 标签云效果 */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.tag-cloud .tag {
  padding: 4px 12px;
  border-radius: 16px;
  font-size: 12px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.tag-cloud .tag:nth-child(3n+1) {
  background: rgba(64, 158, 255, 0.1);
  color: #409EFF;
}

.tag-cloud .tag:nth-child(3n+2) {
  background: rgba(103, 194, 58, 0.1);
  color: #67C23A;
}

.tag-cloud .tag:nth-child(3n+3) {
  background: rgba(230, 162, 60, 0.1);
  color: #E6A23C;
}

.tag-cloud .tag:hover {
  transform: scale(1.1);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

/* 时间轴样式 */
.timeline {
  position: relative;
  padding-left: 30px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 10px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: #e8e8e8;
}

.timeline-item {
  position: relative;
  margin-bottom: 20px;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -25px;
  top: 8px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #409EFF;
  border: 3px solid white;
  box-shadow: 0 0 0 2px #409EFF;
}

/* 涟漪效果 */
.ripple-effect {
  position: relative;
  overflow: hidden;
}

.ripple-effect::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.6);
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}

/* 3D 卡片效果 */
.card-3d {
  transform-style: preserve-3d;
  transition: transform 0.3s;
}

.card-3d:hover {
  transform: rotateX(10deg) rotateY(10deg);
}

/* 打印样式 */
@media print {
  .email-container {
    background: white !important;
    color: black !important;
  }
  
  .email-header {
    background: white !important;
    box-shadow: none !important;
  }
  
  .tab-navigation,
  .action-buttons,
  .el-button {
    display: none !important;
  }
  
  .template-card,
  .stats-card {
    box-shadow: none !important;
    border: 1px solid #ccc !important;
  }
}

/* 可访问性增强 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* 高对比度模式 */
@media (prefers-contrast: high) {
  .template-card {
    border: 2px solid #000;
  }
  
  .variable-tag {
    background: #000;
    color: #fff;
  }
  
  .el-button {
    border: 2px solid #000;
  }
}

/* 焦点样式增强 */
.el-button:focus,
.el-input__inner:focus,
.el-textarea__inner:focus {
  outline: 2px solid #409EFF;
  outline-offset: 2px;
}

/* 错误边界样式 */
.error-boundary {
  padding: 40px;
  text-align: center;
  background: #fff2f0;
  border: 1px solid #ffccc7;
  border-radius: 8px;
  color: #a8071a;
}

.error-boundary h3 {
  color: #cf1322;
  margin-bottom: 16px;
}

.error-boundary p {
  margin-bottom: 0;
  font-size: 14px;
}
</style>