* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", sans-serif;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  min-height: 100vh;
  padding: 2rem 1rem;
  color: #333;
}

.container { max-width: 800px; margin: 0 auto; }

.header { text-align: center; color: #fff; margin-bottom: 1.5rem; }
.header h1 { font-size: 2rem; margin-bottom: 0.4rem; }
.subtitle { opacity: 0.85; font-size: 0.95rem; }

/* 步骤条 */
.steps-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 50px;
  padding: 0.8rem 2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  gap: 0.5rem;
}
.step-item { display: flex; align-items: center; gap: 0.5rem; opacity: 0.4; font-size: 0.9rem; }
.step-item.active { opacity: 1; font-weight: 600; }
.step-circle {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: #ddd;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; font-weight: bold;
}
.step-item.active .step-circle { background: linear-gradient(135deg, #667eea, #764ba2); }
.step-arrow { color: #aaa; font-size: 1.2rem; }

.form { display: flex; flex-direction: column; gap: 1rem; }
.block {
  background: #fff;
  border-radius: 12px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}
.block h2 { font-size: 1.05rem; margin-bottom: 1rem; color: #2c3e50; }
.block h2 small { font-weight: normal; color: #888; font-size: 0.8rem; margin-left: 0.5rem; }
.block h3 { font-size: 0.95rem; color: #555; margin-bottom: 0.8rem; border-bottom: 1px solid #eee; padding-bottom: 0.4rem; }

textarea, input[type="text"], input[type="number"], select {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1.5px solid #e0e0e0;
  border-radius: 8px;
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
  background: #fafafa;
  transition: border-color 0.2s;
}
textarea:focus, input:focus, select:focus { border-color: #667eea; background: #fff; }

/* 按钮 */
.actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; margin-top: 0.5rem; }
button {
  padding: 0.75rem 2rem;
  border: none;
  border-radius: 50px;
  font-size: 1rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
button:disabled { opacity: 0.6; cursor: not-allowed; transform: none !important; }
.btn-primary {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(102,126,234,0.5); }
.btn-secondary { background: #f0f0f0; color: #555; }
.btn-secondary:hover:not(:disabled) { background: #e0e0e0; }
.btn-small { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.btn-danger { background: #fff0f0; color: #e53; border: 1px solid #fcc; }
.btn-danger:hover:not(:disabled) { background: #ffe0e0; }

/* 分析结果 */
.analysis-box { margin-bottom: 1rem; }
.analysis-text { background: #f0f7ff; border-left: 4px solid #667eea; padding: 0.8rem 1rem; border-radius: 0 8px 8px 0; font-size: 0.9rem; color: #333; margin-bottom: 1rem; }
.groups-list { display: flex; flex-direction: column; gap: 0.6rem; }
.group-item { background: #f9f9f9; border-radius: 8px; padding: 0.7rem 1rem; }
.group-item strong { color: #333; }
.group-reason { color: #888; font-size: 0.8rem; margin-left: 0.5rem; }
.group-kps { color: #555; font-size: 0.88rem; margin-top: 0.3rem; }

/* 题型选择 */
.type-list { display: flex; flex-direction: column; gap: 0.7rem; }
.type-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.7rem 1rem;
  background: #f9f9f9;
  border-radius: 8px;
}
.type-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; flex: 1; min-width: 200px; }
.type-label input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; accent-color: #667eea; }
.type-label strong { font-size: 0.95rem; }
.type-hint { font-size: 0.8rem; color: #888; margin-left: 0.3rem; }
.type-count-wrap { display: flex; align-items: center; gap: 0.5rem; }
.type-count-wrap label { display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; color: #555; }
.type-count { width: 60px !important; text-align: center; }
.type-count-wrap input[type="checkbox"]:not(:checked) ~ * { opacity: 0.4; }

/* 生成状态 */
.gen-status { text-align: center; padding: 1rem; border-radius: 8px; font-size: 0.95rem; margin-bottom: 1rem; }
.gen-status.success { background: #f0fff0; color: #2a8; border: 1px solid #cfc; }
.gen-status.error { background: #fff0f0; color: #e53; border: 1px solid #fcc; }

/* 下载链接 */
.download-links { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }
.dl-btn {
  background: linear-gradient(135deg, #667eea, #764ba2);
  color: #fff;
  text-decoration: none;
  padding: 0.7rem 1.8rem;
  border-radius: 50px;
  font-size: 0.95rem;
  font-weight: 600;
  box-shadow: 0 4px 15px rgba(102,126,234,0.4);
  transition: transform 0.2s;
}
.dl-btn:hover { transform: translateY(-2px); }
.dl-teacher { background: linear-gradient(135deg, #f093fb, #f5576c); }

/* 文件列表 */
.files-list { margin-bottom: 1rem; }
.empty-tip { text-align: center; color: #aaa; padding: 1.5rem; font-size: 0.9rem; }
.files-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.files-table th, .files-table td { padding: 0.5rem 0.8rem; text-align: left; border-bottom: 1px solid #eee; }
.files-table th { color: #888; font-weight: normal; font-size: 0.82rem; }
.files-table tr:hover { background: #f9f9f9; }
.dl-link { color: #667eea; text-decoration: none; font-weight: 600; }
.dl-link:hover { text-decoration: underline; }

/* spinner */
.spinner {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 600px) {
  body { padding: 1rem 0.5rem; }
  .steps-bar { flex-wrap: wrap; border-radius: 12px; }
  .step-item span { display: none; }
  .type-item { flex-direction: column; align-items: flex-start; }
  .actions { flex-direction: column; }
  button { width: 100%; }
}
