/* ===== 全局样式 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --primary: #1a56db;
  --primary-light: #3b82f6;
  --primary-dark: #1e40af;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-400: #9ca3af;
  --gray-600: #4b5563;
  --gray-800: #1f2937;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Helvetica Neue', 'Microsoft YaHei', sans-serif;
  background: #f5f7fa;
  color: #1a1a2e;
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
}

/* 通用按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  padding: 0 24px;
  transition: all 0.2s;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-primary {
  background: linear-gradient(135deg, #1a56db, #3b82f6);
  color: #fff;
}
.btn-primary:hover:not(:disabled) {
  background: linear-gradient(135deg, #1e40af, #2563eb);
  transform: scale(1.02);
}
.btn-outline {
  background: #fff;
  color: #1a56db;
  border: 2px solid #1a56db;
}
.btn-outline:hover:not(:disabled) {
  background: #eff6ff;
}
.btn-danger {
  background: #ef4444;
  color: #fff;
}
.btn-block {
  width: 100%;
}

/* 通用卡片 */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  margin: 16px auto;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  max-width: 640px;
}

/* 加载状态 */
.loading-mask {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}
.spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #e5e7eb;
  border-top-color: #1a56db;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
  color: #9ca3af;
}
.empty-state .icon { font-size: 48px; margin-bottom: 12px; }

/* Toast */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #1f2937;
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}
.toast.show { opacity: 1; }

/* ===== 登录页 ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.login-top-bar {
  background: linear-gradient(135deg, #1a56db, #2563eb);
  color: #fff;
  padding: 24px 20px;
  text-align: center;
}
.login-top-bar h2 { font-size: 18px; }
.login-top-bar p { font-size: 13px; opacity: 0.8; margin-top: 4px; }
.login-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-hero { text-align: center; margin-bottom: 24px; }
.login-hero h1 { font-size: 26px; color: #1a56db; }
.login-hero p { color: #6b7280; margin-top: 6px; font-size: 14px; }
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 28px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.form-row { margin-bottom: 16px; }
.form-label { display: block; font-size: 14px; color: #374151; margin-bottom: 6px; font-weight: 500; }
.form-label .req { color: #ef4444; }
.form-input {
  width: 100%;
  height: 44px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: #1a56db; box-shadow: 0 0 0 2px rgba(26,86,219,0.1); }
.login-footer { text-align: center; padding: 16px; color: #9ca3af; font-size: 12px; }

/* ===== 首页 ===== */
.home-container { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
.hero-section {
  background: linear-gradient(135deg, #1a56db, #3b82f6);
  color: #fff;
  text-align: center;
  padding: 40px 20px 32px;
  border-radius: 0 0 24px 24px;
}
.hero-badge { font-size: 13px; opacity: 0.85; margin-bottom: 4px; }
.hero-title { font-size: 28px; font-weight: 700; }
.hero-subtitle { font-size: 14px; opacity: 0.8; margin-top: 4px; }
.info-row { display: flex; justify-content: center; gap: 40px; text-align: center; }
.info-label { display: block; font-size: 13px; color: #6b7280; }
.info-value { font-size: 20px; font-weight: 700; color: #1a56db; }
.notice-card { margin-top: 8px; }
.notice-title { font-size: 15px; font-weight: 600; color: #374151; margin-bottom: 10px; }
.notice-item { font-size: 13px; color: #6b7280; line-height: 2; }
.home-footer { text-align: center; margin-top: 16px; }
.home-footer a { color: #9ca3af; text-decoration: none; font-size: 13px; }
.retest-status { padding: 8px 12px; border-radius: 8px; text-align: center; font-size: 14px; margin-bottom: 12px; }
.retest-status.pending { background: #fef3c7; color: #92400e; }
.retest-status.approved { background: #d1fae5; color: #065f46; }
.retest-status.rejected { background: #fee2e2; color: #991b1b; }

/* ===== 答题页 ===== */
.quiz-container { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
.progress-section { padding: 16px 0; }
.progress-top-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-size: 14px; }
.progress-bar-bg { height: 6px; background: #e5e7eb; border-radius: 3px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: linear-gradient(90deg, #1a56db, #3b82f6); border-radius: 3px; transition: width 0.3s; }
.timer-row { display: flex; justify-content: center; gap: 32px; margin-top: 10px; font-size: 13px; }
.timer-warning { color: #ef4444; font-weight: 700; animation: blink 0.6s infinite; }
@keyframes blink { 50% { opacity: 0.3; } }
.question-card { background: #fff; border-radius: 16px; padding: 24px; box-shadow: 0 2px 16px rgba(0,0,0,0.06); }
.question-no { display: inline-block; background: #eff6ff; color: #1a56db; padding: 2px 12px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 12px; }
.question-text { font-size: 16px; line-height: 1.8; color: #1f2937; margin-bottom: 20px; }
.option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s;
}
.option-item:hover { border-color: #93c5fd; background: #f8faff; }
.option-item.selected { border-color: #1a56db; background: #eff6ff; }
.option-badge {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  background: #f3f4f6;
  color: #6b7280;
  flex-shrink: 0;
}
.option-item.selected .option-badge { background: #1a56db; color: #fff; }
.option-text { flex: 1; font-size: 14px; line-height: 1.7; }
.bottom-actions { padding: 16px 0; }

/* 追问弹窗 */
.followup-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.followup-dialog {
  background: #fff; border-radius: 16px; width: 90%; max-width: 500px;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}
.followup-header { padding: 16px 20px; border-bottom: 1px solid #f3f4f6; display: flex; align-items: center; gap: 8px; font-weight: 600; }
.followup-header .timer { margin-left: auto; font-size: 13px; }
.followup-body { padding: 16px 20px; }
.followup-body textarea {
  width: 100%; min-height: 100px; border: 1px solid #d1d5db; border-radius: 8px;
  padding: 12px; font-size: 14px; resize: vertical; outline: none; font-family: inherit;
}
.followup-body textarea:focus { border-color: #1a56db; }
.followup-actions { padding: 12px 20px 16px; display: flex; gap: 10px; justify-content: flex-end; }
.original-review { background: #f9fafb; border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 13px; }
.original-review .or-header { font-weight: 600; color: #6b7280; margin-bottom: 6px; cursor: pointer; }
.original-review .or-content { color: #374151; }
.char-count { text-align: right; font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* ===== 报告页 ===== */
.report-container { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
.score-banner { text-align: center; padding: 24px 16px; border-radius: 16px; color: #fff; margin: 16px 0; }
.score-banner.banner-green { background: linear-gradient(135deg, #10b981, #34d399); }
.score-banner.banner-yellow { background: linear-gradient(135deg, #f59e0b, #fbbf24); }
.score-banner.banner-red { background: linear-gradient(135deg, #ef4444, #f87171); }
.banner-light { font-size: 18px; font-weight: 600; }
.banner-score { font-size: 40px; font-weight: 800; margin: 8px 0; }
.banner-unit { font-size: 18px; font-weight: 400; }
.banner-percent { font-size: 14px; opacity: 0.85; }
.veto-alert { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; padding: 16px; border-radius: 12px; margin: 16px 0; text-align: center; }
.veto-alert .veto-title { font-weight: 700; font-size: 16px; margin-bottom: 4px; }
.veto-alert .veto-desc { font-size: 13px; }
.card-title { font-size: 16px; font-weight: 600; color: #1f2937; margin-bottom: 16px; }
.dim-row { margin-bottom: 12px; }
.dim-header { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 4px; }
.dim-name { font-weight: 500; }
.dim-score { color: #1a56db; }
.dim-bar-bg { height: 8px; background: #f3f4f6; border-radius: 4px; overflow: hidden; }
.dim-bar-fill { height: 100%; background: linear-gradient(90deg, #1a56db, #3b82f6); border-radius: 4px; transition: width 0.5s; }
.style-tag { display: inline-block; background: #eff6ff; color: #1a56db; padding: 6px 20px; border-radius: 20px; font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.style-desc { color: #6b7280; font-size: 13px; }
.report-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 24px; }
.radar-container { display: flex; justify-content: center; }

/* AI评语 */
.ai-section { margin-bottom: 14px; }
.ai-label { font-weight: 600; font-size: 13px; color: #374151; display: block; margin-bottom: 4px; }
.ai-text { font-size: 14px; color: #4b5563; line-height: 1.7; }
.ai-list { list-style: none; padding: 0; }
.ai-item { padding: 6px 0; font-size: 14px; color: #4b5563; display: flex; gap: 8px; align-items: flex-start; }

/* ===== 管理面板 ===== */
.admin-container { max-width: 800px; margin: 0 auto; padding: 0 16px 40px; }
.tab-bar { display: flex; border-bottom: 2px solid #e5e7eb; margin-bottom: 16px; }
.tab-item {
  flex: 1; text-align: center; padding: 12px 0; font-size: 15px; font-weight: 500;
  color: #6b7280; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  position: relative;
}
.tab-item.active { color: #1a56db; border-bottom-color: #1a56db; }
.tab-badge {
  position: absolute; top: 6px; right: 8px;
  background: #ef4444; color: #fff; font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
}
.stats-bar { display: flex; gap: 8px; margin: 0 0 12px; flex-wrap: wrap; }
.stat-item { flex: 1; min-width: 70px; text-align: center; background: #fff; border-radius: 10px; padding: 12px 8px; box-shadow: 0 1px 8px rgba(0,0,0,0.05); }
.stat-num { font-size: 22px; font-weight: 700; color: #1f2937; display: block; }
.stat-num.today { color: #1a56db; }
.stat-num.green { color: #10b981; }
.stat-num.red { color: #ef4444; }
.stat-num.veto { color: #dc2626; }
.stat-label { font-size: 12px; color: #9ca3af; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-tag {
  background: #fff; border: 1px solid #d1d5db; padding: 6px 14px; border-radius: 20px;
  font-size: 13px; cursor: pointer; transition: all 0.2s;
}
.filter-tag:hover { border-color: #1a56db; }
.filter-tag.active { background: #eff6ff; border-color: #1a56db; color: #1a56db; }
.record-item {
  background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05); cursor: pointer;
}
.record-top { display: flex; justify-content: space-between; align-items: flex-start; }
.user-id { font-weight: 600; font-size: 15px; display: block; }
.record-no { font-size: 12px; color: #9ca3af; margin-top: 2px; display: block; }
.record-light { padding: 2px 12px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.light-green { background: #d1fae5; color: #065f46; }
.light-yellow { background: #fef3c7; color: #92400e; }
.light-red { background: #fee2e2; color: #991b1b; }
.record-mid { display: flex; gap: 12px; align-items: center; margin: 8px 0; }
.record-score { font-size: 16px; font-weight: 700; color: #1a56db; }
.record-style { font-size: 12px; color: #6b7280; }
.record-bottom { display: flex; gap: 12px; font-size: 12px; color: #9ca3af; }
.record-actions { display: flex; gap: 8px; margin-top: 12px; }
.ra-btn { padding: 6px 14px; border-radius: 8px; font-size: 13px; cursor: pointer; border: 1px solid #e5e7eb; }
.ra-btn.ra-report { background: #eff6ff; color: #1a56db; border-color: #bfdbfe; }
.ra-btn.ra-detail { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.ra-btn.ra-pdf { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.retest-item {
  background: #fff; border-radius: 12px; padding: 16px; margin-bottom: 12px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
}
.retest-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.retest-username { font-weight: 600; font-size: 15px; }
.retest-date { font-size: 12px; color: #9ca3af; display: block; }
.retest-badge { padding: 2px 10px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge-pending { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }
.retest-actions { display: flex; gap: 8px; margin-top: 12px; }
.rta-btn { padding: 6px 16px; border-radius: 8px; font-size: 13px; cursor: pointer; border: 1px solid #e5e7eb; }
.rta-btn.rta-approve { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }
.rta-btn.rta-reject { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.admin-footer { text-align: center; margin-top: 24px; }

/* ===== 历史记录 ===== */
.history-container { max-width: 640px; margin: 0 auto; padding: 0 16px 40px; }
.record-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.record-title { font-weight: 600; font-size: 15px; }
.record-body { font-size: 14px; color: #6b7280; }

/* ===== 感谢页 ===== */
.thanks-container { max-width: 400px; margin: 60px auto 0; padding: 0 20px; text-align: center; }
.thanks-icon { font-size: 64px; margin-bottom: 16px; }
.thanks-title { font-size: 24px; font-weight: 700; color: #1f2937; margin-bottom: 8px; }
.thanks-desc { color: #6b7280; font-size: 15px; margin-bottom: 24px; }
.thanks-divider { height: 1px; background: #e5e7eb; margin: 24px 0; }

/* ===== 详情页 ===== */
.detail-container { max-width: 800px; margin: 0 auto; padding: 0 16px 40px; }
.detail-header { background: #fff; border-radius: 12px; padding: 20px; margin-bottom: 16px; box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.dh-row { display: flex; justify-content: space-between; align-items: center; }
.dh-user { font-size: 18px; font-weight: 700; }
.dh-meta { font-size: 13px; color: #9ca3af; margin: 6px 0; }
.dh-scores { display: flex; gap: 24px; margin-top: 12px; }
.dh-score-item { text-align: center; }
.dh-score-val { font-size: 20px; font-weight: 700; color: #1a56db; display: block; }
.dh-score-label { font-size: 12px; color: #9ca3af; }
.dh-veto { background: #fef2f2; color: #991b1b; padding: 8px 12px; border-radius: 8px; font-size: 13px; margin-top: 8px; }
.q-card { background: #fff; border-radius: 10px; margin-bottom: 10px; box-shadow: 0 1px 6px rgba(0,0,0,0.04); overflow: hidden; }
.q-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; cursor: pointer; }
.q-header:hover { background: #f9fafb; }
.q-no { font-weight: 700; color: #1a56db; margin-right: 8px; }
.q-option-badge { display: inline-block; width: 24px; height: 24px; text-align: center; line-height: 24px; border-radius: 4px; font-size: 12px; font-weight: 700; margin-right: 8px; }
.opt-a { background: #eff6ff; color: #1a56db; }
.opt-b { background: #fef3c7; color: #92400e; }
.opt-c { background: #fce7f3; color: #be185d; }
.opt-d { background: #fee2e2; color: #dc2626; }
.q-score { font-size: 14px; font-weight: 600; color: #059669; margin-right: 8px; }
.q-expand { color: #9ca3af; }
.q-body { padding: 0 16px 16px; border-top: 1px solid #f3f4f6; }
.q-text { font-size: 14px; color: #4b5563; padding: 12px 0; line-height: 1.7; }
.q-selected-option { background: #f9fafb; padding: 10px 12px; border-radius: 8px; font-size: 13px; margin-bottom: 8px; }
.q-score-detail { display: flex; gap: 12px; font-size: 12px; color: #6b7280; }
.fu-block { background: #f9fafb; border-radius: 8px; padding: 10px 12px; margin: 8px 0; }
.fu-header { display: flex; gap: 10px; font-size: 12px; color: #6b7280; align-items: center; }
.fu-depth { font-weight: 600; color: #1a56db; }

/* 模态弹窗 */
.modal-overlay {
  position: fixed; top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5); z-index: 2000;
  display: flex; align-items: center; justify-content: center;
}
.modal-box {
  background: #fff; border-radius: 16px; padding: 24px; width: 90%; max-width: 360px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2); text-align: center;
}
.modal-box h3 { font-size: 17px; margin-bottom: 8px; }
.modal-box p { font-size: 14px; color: #6b7280; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; justify-content: center; }

/* 响应式 */
@media (max-width: 480px) {
  .card { margin: 10px 8px; padding: 16px; }
  .hero-section { padding: 28px 16px 24px; }
  .hero-title { font-size: 24px; }
  .banner-score { font-size: 32px; }
}
