@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

body {
  font-family: 'Inter', sans-serif;
}

.checkbox-custom:checked + label div {
  border-color: #000;
  background-color: #000;
}

.radio-custom:checked + label {
  border-color: #000;
  background-color: #f8f8f8;
}

.step-line {
  width: 2px;
  height: 100%;
  background: #f0f0f0;
  position: absolute;
  left: 24px;
  top: 0;
  z-index: -1;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr); /* 减少为5列 */
  gap: 0.5rem; /* 增加间距 */
  padding: 0.25rem; /* 调整内边距 */
  min-height: 0;
  height: 100%; /* 使用100%高度 */
  align-content: start; /* 从顶部开始排列 */
}

@media (max-width: 1536px) { /* 2xl */
  .checkbox-grid { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 1280px) { /* xl */
  .checkbox-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) { /* lg */
  .checkbox-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) { /* md */
  .checkbox-grid { grid-template-columns: repeat(2, 1fr); }
}

.name-block {
  position: relative;
  height: 48px; /* 增加高度 */
  width: 100%; /* 确保占满网格单元格 */
  animation: slideIn 0.3s ease-out forwards;
  opacity: 0;
}

.name-block:nth-child(n) {
  animation-delay: calc(0.03s * var(--animation-order, 0));
}

.name-block label {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  padding: 0 1.25rem; /* 增加内边距 */
  font-size: 1.125rem; /* 增大字号 */
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem; /* 增大圆角 */
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  letter-spacing: 0.02em;
  justify-content: space-between; /* 调整内容布局 */
  white-space: nowrap; /* 防止文字换行 */
  height: 100%; /* 确保label填满整个block */
}

.name-block label span {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1; /* 让文字占据剩余空间 */
  margin-right: 8px; /* 与图标保持间距 */
}

.name-block:hover label {
  border-color: #000;
  background: #f8f8f8;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.checkbox-custom:checked + label {
  background: #f8f8f8;
  border-color: #000;
}

.checkbox-custom:checked + label .check-icon {
  opacity: 1;
  animation: checkmark 0.3s ease-in-out forwards;
}

.check-icon {
  opacity: 0;
  transition: opacity 0.2s;
  margin-left: 12px; /* 增加与文字的间距 */
  font-size: 1rem; /* 增大对勾图标 */
  color: #000;
}

#checkboxArea, #radioArea, .bg-gray-50 {
  border-radius: 1rem; /* 增大区块圆角 */
  background: #f8f8f8 !important; /* 覆盖原有的背景色 */
  background-size: 200% 200%;
  animation: gradientBG 15s ease infinite;
}

.bg-gray-50 {
  background: #f8f8f8 !important; /* 覆盖原有的背景色 */
  background-size: 200% 200%;
  animation: gradientBG 15s ease infinite;
}

/* 添加结果页面的样式 */
.result-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.result-card {
  background: #f8f8f8;
  padding: 1.5rem;
  border-radius: 1rem;
  transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

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

.result-card .name {
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.75rem;
}

.result-card .task {
  font-size: 1.125rem;
  color: #666;
}

.radio-custom + label,
.checkbox-custom + label {
  position: relative;
  overflow: hidden;
}

.radio-custom + label::after,
.checkbox-custom + label::after {
  content: '';
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  pointer-events: none;
  background-image: radial-gradient(circle, #000 10%, transparent 10.01%);
  background-repeat: no-repeat;
  background-position: 50%;
  transform: scale(10, 10);
  opacity: 0;
  transition: transform .5s, opacity 1s;
}

.radio-custom:active + label::after,
.checkbox-custom:active + label::after {
  transform: scale(0, 0);
  opacity: 0.2;
  transition: 0s;
}

@keyframes checkmark {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  50% {
    opacity: 0.5;
    transform: scale(1.2);
  }
  100% {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes gradientBG {
  0% { background-position: 0% 50% }
  50% { background-position: 100% 50% }
  100% { background-position: 0% 50% }
}

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

button,
input {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

button:active {
  transform: scale(0.95);
}

/* 移除旧的动画类 */
.animate__animated {
  display: none;
}

/* 移除3D相关样式 */
.grid.gap-4 > div {
  opacity: 0;  /* 初始隐藏，由GSAP控制显示 */
}

/* 自定义加载进度条样式 */
#nprogress .bar {
  background: #000 !important;
  height: 3px !important;
}

#nprogress .peg {
  box-shadow: 0 0 10px #000, 0 0 5px #000 !important;
}

#nprogress .spinner-icon {
  border-top-color: #000 !important;
  border-left-color: #000 !important;
}

/* 修改清除按钮样式 */
#clearAllBtn {
  z-index: 100;
  transition: all 0.2s ease-out;
}

#clearAllBtn.confirm {
  background-color: #dc2626; /* red-600 */
}

#clearAllBtn:active {
  transform: scale(0.95);
}

/* 移除原有的hover效果 */
#clearAllBtn:hover {
  transform: none;
  box-shadow: none;
}

/* 优化调试面板样式 */
.debug-panel {
  position: fixed;
  inset: 0;
  background: rgba(255, 255, 255, 0.98);
  z-index: 1000;
  transform: translateY(100%);
  transition: transform 0.3s ease-out;
  overflow-y: auto;
}

.debug-panel.show {
  transform: translateY(0);
}

.debug-section {
  background: #f8f8f8;
  border-radius: 1rem;
  padding: 1.5rem;
}

/* 右侧卡片统一圆角 */
#radioArea, #subjectArea, #generateButton {
  border-radius: 1rem;
}

/* 优化文件上传按钮样式 */
.file-upload {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1rem;
  background: #f0f0f0;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
  justify-content: center;
}

.file-upload:hover {
  background: #e0e0e0;
}

.file-upload input[type="file"] {
  display: none;
}

/* 统一卡片面板样式 */
.card-panel {
  border-radius: 1rem;  /* 增大圆角 */
  background: #f8f8f8;
  border: 1px solid rgba(0, 0, 0, 0.05);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02), 
             0 4px 8px rgba(0, 0, 0, 0.02);  /* 更细腻的阴影 */
  transition: box-shadow 0.2s ease-in-out;    /* 添加过渡效果 */
}

.card-panel:hover {
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.04), 
             0 6px 12px rgba(0, 0, 0, 0.02);  /* 悬停时加深阴影 */
}

/* 修改已有的样式 */
#checkboxArea, #radioArea, #subjectArea, #actionArea {
  background: none !important;  /* 移除之前的背景样式 */
}

/* 修改已有的样式 */
#checkboxArea, #radioArea, #subjectArea, #actionArea {
  background: #f8f8f8 !important; /* 覆盖原有的背景色 */
}

/* 科目选择区域的特定样式 */
#subjectArea {
  height: 18rem;
  overflow: hidden; /* 防止内容溢出 */
}

#subjectArea > div:last-child {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.75rem;
  margin-top: 1rem;
  height: calc(100% - 70px); /* 减去标题区域高度 */
  overflow-y: auto; /* 内容过多时可滚动 */
}

#subjectArea > div:last-child > div {
  height: 45px; /* 固定每个按钮的高度 */
  margin: 0 !important;
}

#subjectArea > div:last-child > div label {
  height: 100%;
  display: flex;
  align-items: center;
  padding: 0 1rem;
}

/* 移除之前不正确的space-y类相关样式 */
#subjectArea .space-y-3 {
  margin: 0 !important;
}

/* 移除原有的背景渐变 */
.bg-gray-50 {
  background: #f8f8f8 !important;
}

/* 轮换按钮样式 */
.rotate-btn {
  display: flex;
  align-items: center;
  padding: 0.75rem;
  background: #f1f1f1;
  border-radius: 0.75rem;
  cursor: pointer;
  transition: all 0.2s;
}

.rotate-btn:hover {
  background: #e5e5e5;
}

.rotate-btn .status {
  font-size: 0.875rem;
  color: #666;
}

.rotate-btn .status.review {
  color: #dc2626;
  font-weight: 500;
}

/* 修改结果页面的统计卡片样式 */
.stats-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.stats-item .status-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 1rem;
  font-size: 0.875rem;
  background: #f3f4f6;
}

.stats-item .status-badge.review {
  background: #fee2e2;
  color: #dc2626;
}

/* 添加错改比例输入框样式 */
.correction-ratio {
  background: transparent;
  border: 1px solid #e5e7eb;
  border-radius: 0.375rem;
  transition: all 0.2s;
}

.correction-ratio:focus {
  outline: none;
  border-color: #000;
  background: white;
}

.correction-ratio::-webkit-inner-spin-button,
.correction-ratio::-webkit-outer-spin-button {
  opacity: 1;
  height: 1.5em;
}

/* 更新important按钮样式以适应输入框 */
.radio-custom + label {
  padding-right: 0.75rem !important;
}

.radio-custom:checked + label .correction-ratio {
  border-color: #000;
  background: white;
}
