/* Tailwind 配置（通过@layer扩展工具类） */
@layer utilities {
  .content-auto {
    content-visibility: auto;
  }
  .card-shadow {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  }
  .transition-custom {
    transition: all 0.3s ease;
  }
  .page {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
  }
  .page.active {
    display: block;
  }
  .sidebar-link.active {
    background-color: #e0edff;
    color: #165DFF;
    font-weight: 500;
  }
  .sidebar-link.active i {
    color: #165DFF;
  }
  .mobile-nav-overlay {
    background-color: rgba(0, 0, 0, 0.5);
    transition: opacity 0.3s ease;
  }
  .mobile-sidebar-link.active {
    background-color: #e0edff;
    color: #165DFF;
    font-weight: 500;
  }
  .mobile-sidebar-link.active i {
    color: #165DFF;
  }
}

/* 自定义动画 */
@keyframes fadeIn {
  from { 
    opacity: 0; 
    transform: translateY(10px); 
  }
  to { 
    opacity: 1; 
    transform: translateY(0); 
  }
}

/* Tailwind 主题扩展配置（通过JS配置，此处仅定义变量映射） */
:root {
  --color-primary: #165DFF;
  --color-secondary: #36CFC9;
  --color-accent: #722ED1;
  --color-neutral: #F5F7FA;
  --color-dark: #1D2129;
}

/* 作业相关样式 */
.assignment-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
}

.assignment-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.assignment-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #f1f5f9;
  font-size: 0.875rem;
  color: #64748b;
}

.word-checkbox-item {
  display: flex;
  align-items: center;
  padding: 0.5rem;
  border-radius: 0.375rem;
  transition: background-color 0.2s ease;
}

.word-checkbox-item:hover {
  background-color: #f1f5f9;
}

.word-checkbox-item input {
  margin-right: 0.5rem;
}

.deadline-soon {
  color: #dc2626;
  font-weight: 500;
}

.assignment-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
}

.assignment-progress {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  margin: 0.75rem 0;
  overflow: hidden;
}

.assignment-progress-bar {
  height: 100%;
  background-color: #165DFF;
  border-radius: 4px;
  transition: width 0.3s ease;
}

/* 删除按钮hover效果增强 */
.assignment-actions button:nth-child(2):hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(220, 38, 38, 0.2);
}

/* 确认删除弹窗动画 */
.delete-confirm-modal {
  animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* 用户列表样式 */
.user-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem;
  transition: all 0.2s ease;
  cursor: pointer;
}

.user-card:hover {
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  border-color: #cbd5e1;
}

.user-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.user-name {
  font-size: 1.25rem;
  font-weight: 600;
}

.user-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.stat-item {
  background-color: #f8fafc;
  padding: 0.75rem;
  border-radius: 0.5rem;
}

.stat-label {
  font-size: 0.875rem;
  color: #64748b;
  margin-bottom: 0.25rem;
}

.stat-value {
  font-size: 1.125rem;
  font-weight: 600;
}

/* 用户详情弹窗样式 */
.user-detail-section {
  margin-bottom: 1.5rem;
}

.user-detail-section h4 {
  font-size: 1.125rem;
  font-weight: 600;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.assignment-detail {
  border: 1px solid #e2e8f0;
  border-radius: 0.5rem;
  padding: 1rem;
  margin-bottom: 1rem;
}

.word-proficiency {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.proficiency-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem;
  background-color: #f8fafc;
  border-radius: 0.5rem;
}

.proficiency-bar-container {
  height: 8px;
  background-color: #e2e8f0;
  border-radius: 4px;
  width: 100px;
  overflow: hidden;
}

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

/* 状态标签样式 */
.status-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 500;
}

.status-on-time {
  background-color: #10b9811a;
  color: #059669;
}

.status-late {
  background-color: #f59e0b1a;
  color: #d97706;
}

.status-missed {
  background-color: #ef44441a;
  color: #dc2626;
}

/* 简易视图样式 */
.user-card.simple {
  padding: 1rem;
}

.user-card.simple .user-header {
  margin-bottom: 0.5rem;
}

.simple-view-stats {
  display: flex;
  gap: 1.5rem;
  font-size: 0.875rem;
}

.simple-view-stat {
  display: flex;
  align-items: center;
  color: #64748b;
}

.simple-view-stat i {
  margin-right: 0.25rem;
  width: 16px;
  text-align: center;
}

/* 视图按钮激活状态 */
.view-btn-active {
  background-color: #165DFF !important;
  color: white !important;
}

/* 返回按钮样式优化 */
#back-to-user-list {
  padding: 4px 8px;
  border-radius: 6px;
  background-color: transparent;
  border: 1px solid transparent;
}

#back-to-user-list:hover {
  background-color: #f1f5f9;
  border-color: #e2e8f0;
}

/* 测试数据标签样式 */
.test-data-tag {
  display: inline-block;
  padding: 2px 8px;
  background-color: #f3f4f6;
  color: #6b7280;
  border-radius: 4px;
  font-size: 0.75rem;
  margin-left: 8px;
}

/* 用户列表-新增用户按钮 */
#add-user-modal-content {
  transition: all 0.3s ease;
}

#add-user-modal.active #add-user-modal-content {
  transform: scale(1);
  opacity: 1;
}

/* 题型卡片样式 */
.question-type-selection {
  width: 100%;
}

.type-card {
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  padding: 1.5rem 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.type-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* 四题型背景色区分 */
.type-card.fill {
  background-color: rgba(224, 242, 254, 0.3); /* 浅蓝 */
  border-color: #0284c7;
}

.type-card.single {
  background-color: rgba(220, 252, 231, 0.3); /* 浅绿 */
  border-color: #166534;
}

.type-card.multiple {
  background-color: rgba(243, 232, 255, 0.3); /* 浅紫 */
  border-color: #7e22ce;
}

.type-card.translate {
  background-color: rgba(254, 243, 199, 0.3); /* 浅黄 */
  border-color: #92400e;
}

/* 图标样式 */
.type-icon {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  color: #fff;
}

.type-card.fill .type-icon {
  background-color: #0284c7;
}

.type-card.single .type-icon {
  background-color: #166534;
}

.type-card.multiple .type-icon {
  background-color: #7e22ce;
}

.type-card.translate .type-icon {
  background-color: #92400e;
}

/* 练习区域样式 */
.feedback-container.correct {
  background-color: #dcfce7;
  color: #166534;
}

.feedback-container.incorrect {
  background-color: #fee2e2;
  color: #dc2626;
}

/* 响应式调整 */
@media (max-width: 768px) {
  .question-type-selection {
    grid-template-columns: 1fr 1fr;
  }
}


/* 翻译题专属样式 */
.translation-term {
  border-left: 4px solid #92400e; /* 黄色系边框 */
}

.translate-input input {
  min-height: 44px;
  font-size: 1rem;
}

/* 反馈样式 */
.feedback-container.correct {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.feedback-container.incorrect {
  background-color: #fee2e2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

/* 总结页面样式 */
.practice-summary {
  display: none; /* 默认隐藏 */
}

.stat-item {
  transition: transform 0.3s ease;
}

.stat-item:hover {
  transform: translateY(-3px);
}

/* 错误题目样式 */
.wrong-question {
  border-left: 4px solid #ef4444;
  background-color: #fff5f5;
}

.wrong-term {
  font-style: italic;
  color: #4b5563;
}

.wrong-answers {
  font-size: 0.95rem;
}

/* 总结按钮样式 */
.summary-actions button {
  transition: all 0.2s ease;
}

.summary-actions button:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}