/* 补充样式：Tailwind 无法直接表达的部分 */

/* 页面切换（不再用 display 控制，完全由 Tailwind 的 hidden 类控制） */
.content-section { display: none; }
.content-section.active { display: block; }

/* 导航链接状态 */
.nav-link {
  color: rgb(71 85 105); /* slate-600 */
}
.nav-link:hover {
  background-color: rgb(241 245 249); /* slate-100 */
  color: rgb(15 23 42); /* slate-900 */
}
.dark .nav-link {
  color: rgb(203 213 225); /* slate-300 */
}
.dark .nav-link:hover {
  background-color: rgb(51 65 85); /* slate-700 */
  color: rgb(241 245 249);
}
.nav-link.active {
  background: linear-gradient(135deg, rgb(139 92 246), rgb(109 40 217));
  color: white !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}

/* 模板卡片 */
.template-card {
  border: 2px solid rgb(226 232 240); /* slate-200 */
  background: white;
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.dark .template-card {
  background: rgb(30 41 59); /* slate-800 */
  border-color: rgb(51 65 85); /* slate-700 */
}
.template-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
  border-color: rgb(167 139 250); /* brand-400 */
}
.template-card.selected {
  border-color: rgb(139 92 246); /* brand-500 */
  background: linear-gradient(135deg, rgb(245 243 255), rgb(237 233 254));
  box-shadow: 0 4px 12px rgba(139, 92, 246, 0.2);
}
.dark .template-card.selected {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(109, 40, 217, 0.15));
  border-color: rgb(139 92 246);
}
.template-card h4 {
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: rgb(30 41 59);
}
.dark .template-card h4 {
  color: rgb(241 245 249);
}
.template-card p {
  font-size: 0.75rem;
  color: rgb(100 116 139); /* slate-500 */
  line-height: 1.4;
}

/* 比例按钮 */
.ratio-btn {
  padding: 0.5rem;
  border: 1.5px solid rgb(226 232 240);
  background: white;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
  font-size: 0.75rem;
  color: rgb(71 85 105);
}
.dark .ratio-btn {
  background: rgb(30 41 59);
  border-color: rgb(51 65 85);
  color: rgb(203 213 225);
}
.ratio-btn:hover {
  border-color: rgb(167 139 250);
  color: rgb(109 40 217);
}
.dark .ratio-btn:hover {
  color: rgb(196 181 253);
}
.ratio-btn.selected {
  background: linear-gradient(135deg, rgb(139 92 246), rgb(109 40 217));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 6px rgba(139, 92, 246, 0.4);
}
.ratio-btn .ratio-icon {
  display: block;
  margin: 0 auto 3px;
  background: currentColor;
  opacity: 0.2;
  border-radius: 2px;
}
.ratio-btn.selected .ratio-icon { opacity: 0.5; }

/* 上传盒子激活态 */
#uploadBox.drag-over {
  border-color: rgb(139 92 246);
  background-color: rgba(139, 92, 246, 0.05);
}

/* 加载旋转器 */
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid rgb(226 232 240);
  border-top-color: rgb(139 92 246);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto;
}
.dark .spinner {
  border-color: rgb(51 65 85);
  border-top-color: rgb(167 139 250);
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 预览图淡入 */
.result-img { opacity: 0; transition: opacity 0.4s; cursor: zoom-in; }
.result-img.loaded { opacity: 1; }

/* 历史卡片对比布局 */
.history-compare {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 4px;
  align-items: center;
}
.history-compare .compare-col img {
  aspect-ratio: 1;
  width: 100%;
  object-fit: cover;
  border-radius: 6px;
}

/* 管理后台侧边栏激活项 */
.admin-nav-link.active {
  background: linear-gradient(135deg, rgb(139 92 246), rgb(109 40 217));
  color: white !important;
  box-shadow: 0 2px 8px rgba(139, 92, 246, 0.4);
}
.admin-nav-link.active i { color: white; }

/* 表格行悬停 */
.data-row {
  transition: background-color 0.15s;
}
.data-row:hover {
  background: rgb(248 250 252);
}
.dark .data-row:hover {
  background: rgb(30 41 59);
}

/* 浏览器默认样式覆盖 */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: inherit;
  -webkit-box-shadow: 0 0 0px 1000px transparent inset;
  transition: background-color 5000s ease-in-out 0s;
}

/* 隐藏 Tailwind 默认滚动条样式（可选） */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgb(203 213 225); border-radius: 4px; }
.dark ::-webkit-scrollbar-thumb { background: rgb(51 65 85); }
::-webkit-scrollbar-thumb:hover { background: rgb(148 163 184); }


/* 历史记录卡片淡入动画 */
.history-item {
  animation: cardIn 0.4s ease-out backwards;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
