/* 美式音标全国机考测评系统 - 样式表 (style.css)
 * Official Signature: BySbinAuto v3sj
 */

:root {
  --bg-dark: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --border-color: #334155;
  --primary: #38bdf8;
  --primary-hover: #0ea5e9;
  --primary-glow: rgba(56, 189, 248, 0.25);
  --accent-gold: #f59e0b;
  --accent-green: #10b981;
  --accent-red: #ef4444;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--bg-dark);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* 顶部导航栏 */
.exam-header {
  height: 64px;
  background-color: rgba(30, 41, 59, 0.8);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-left, .header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.logo-badge {
  display: flex;
  align-items: center;
  gap: 10px;
}

.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--primary);
  box-shadow: 0 0 10px var(--primary);
  animation: pulse 1.8s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.8; }
}

.exam-title-text {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.3px;
  color: #fff;
}

/* 系统双核导航栏切换 Tabs */
.system-nav-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}

.nav-tab-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: all 0.2s ease;
}

.nav-tab-item:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
}

.nav-tab-item.active {
  background: rgba(56, 189, 248, 0.18);
  color: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.ai-chip {
  background: rgba(56, 189, 248, 0.12);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

.status-pill.online {
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 3px 8px;
  border-radius: 6px;
}

.candidate-info {
  font-size: 13px;
  color: var(--text-muted);
}

.candidate-info .cand-val {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* 主考场容器 */
.exam-container {
  flex: 1;
  max-width: 1080px;
  width: 100%;
  margin: 24px auto;
  padding: 0 20px 40px;
}

.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

/* 按钮通用 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--primary);
  color: #0f172a;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 0 15px var(--primary-glow);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-outline:hover {
  background: var(--bg-card);
  border-color: var(--primary);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.16);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 12.5px;
}

.btn-block {
  width: 100%;
}

/* 考场大厅 Lobby */
.lobby-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 36px 40px;
  box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5);
}

.lobby-hero {
  text-align: center;
  margin-bottom: 36px;
}

.lobby-hero h1 {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #fff 40%, var(--primary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lobby-hero .subtitle {
  color: var(--text-muted);
  font-size: 15px;
  margin-top: 8px;
}

.stats-ribbon {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
}

.ribbon-item {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ribbon-item span {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
}

.ribbon-item label {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.mode-selection-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 30px;
}

.mode-card {
  background: rgba(15, 23, 42, 0.6);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 24px;
  position: relative;
  cursor: pointer;
  transition: all 0.22s ease;
  display: flex;
  flex-direction: column;
}

.mode-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
  box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.15);
}

.mode-card.highlight {
  border-color: rgba(56, 189, 248, 0.5);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.08) 0%, rgba(15, 23, 42, 0.7) 100%);
}

.mode-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  font-size: 11px;
  background: rgba(56, 189, 248, 0.18);
  color: var(--primary);
  border: 1px solid rgba(56, 189, 248, 0.3);
  padding: 2px 7px;
  border-radius: 4px;
}

.mode-icon {
  font-size: 32px;
  margin-bottom: 12px;
}

.mode-card h3 {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}

.mode-card p {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  flex: 1;
  margin-bottom: 16px;
}

.mode-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: #cbd5e1;
  margin-bottom: 16px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.mic-test-bar {
  background: rgba(15, 23, 42, 0.8);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mic-status-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.mic-controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.mini-canvas {
  background: #000;
  border-radius: 4px;
  border: 1px solid #334155;
}

/* 考试作答厅 Exam Hall */
.exam-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  padding: 14px 20px;
  margin-bottom: 20px;
}

.progress-wrap {
  flex: 1;
  max-width: 500px;
}

.progress-label {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 6px;
}

.badge {
  background: var(--primary-glow);
  color: var(--primary);
  border: 1px solid var(--primary);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 11px;
}

.progress-bar-bg {
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  overflow: hidden;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #818cf8);
  transition: width 0.3s ease;
}

.timer-box {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.1);
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.question-stage {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 30px 36px;
}

.question-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
  margin-bottom: 24px;
}

.target-type-badge {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  background: rgba(56, 189, 248, 0.1);
  border-left: 3px solid var(--primary);
  padding: 4px 10px;
  border-radius: 0 4px 4px 0;
}

.btn-audio-sample {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent-gold);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-audio-sample:hover {
  background: rgba(245, 158, 11, 0.22);
}

.target-display-card {
  text-align: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.7);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.target-phoneme-large {
  font-size: 64px;
  font-weight: 800;
  color: #fff;
  font-family: "Lucida Sans Unicode", "Arial Unicode MS", "Segoe UI", sans-serif;
  letter-spacing: 1px;
  text-shadow: 0 0 20px var(--primary-glow);
}

.target-sub-words {
  font-size: 16px;
  color: var(--primary);
  margin-top: 6px;
}

.target-vocal-pill {
  display: inline-block;
  margin-top: 12px;
  background: rgba(16, 185, 129, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 4px 14px;
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 600;
}

.mouth-guide-tip {
  margin-top: 16px;
  background: rgba(255, 255, 255, 0.03);
  border-left: 3px solid #64748b;
  padding: 10px 14px;
  font-size: 13px;
  color: #cbd5e1;
  line-height: 1.5;
  border-radius: 0 6px 6px 0;
}

/* 录音工作台 */
.recording-station {
  margin-top: 26px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.waveform-box {
  width: 100%;
  max-width: 600px;
  background: #020617;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 10px;
  position: relative;
}

#waveformCanvas {
  width: 100%;
  height: 80px;
  display: block;
}

.rec-time-badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.station-actions {
  margin-top: 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.btn-record {
  width: 220px;
  height: 52px;
  border-radius: 26px;
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  transition: all 0.2s ease;
  box-shadow: 0 4px 15px rgba(239, 68, 68, 0.35);
}

.btn-record:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 20px rgba(239, 68, 68, 0.5);
}

.btn-record.recording {
  background: #f59e0b;
  box-shadow: 0 0 20px rgba(245, 158, 11, 0.6);
  animation: pulseRec 1s infinite alternate;
}

@keyframes pulseRec {
  0% { transform: scale(1); }
  100% { transform: scale(1.04); }
}

.rec-icon-inner {
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  display: inline-block;
}

.btn-record.recording .rec-icon-inner {
  border-radius: 2px;
  background: #0f172a;
}

.playback-controls {
  display: flex;
  gap: 10px;
}

/* 机器实时打分浮层卡片 */
.eval-result-card {
  margin-top: 24px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--primary);
  box-shadow: 0 8px 30px rgba(56, 189, 248, 0.15);
  border-radius: 12px;
  padding: 20px;
  animation: slideUp 0.3s ease;
}

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

.eval-header {
  display: flex;
  align-items: center;
  gap: 18px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 14px;
  margin-bottom: 12px;
}

.eval-score-ring {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 3px solid var(--primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(56, 189, 248, 0.08);
}

.score-num {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.score-label {
  font-size: 9px;
  color: var(--text-muted);
}

.verdict-title {
  font-size: 17px;
  font-weight: 700;
  color: #fff;
}

.verdict-metrics {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}

.verdict-metrics strong {
  color: #fff;
}

.eval-feedback-body {
  font-size: 13.5px;
  color: #e2e8f0;
  line-height: 1.6;
}

.eval-suggestions {
  margin-top: 8px;
  font-size: 12.5px;
  color: #38bdf8;
}

.eval-suggestions ul {
  padding-left: 20px;
  margin-top: 4px;
}

/* 底部操作区 */
.stage-footer {
  margin-top: 30px;
  border-top: 1px solid var(--border-color);
  padding-top: 18px;
  display: flex;
  justify-content: space-between;
}

/* 阶段 3 成绩报告单 Report */
.report-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 40px;
  position: relative;
}

.report-header {
  text-align: center;
  border-bottom: 2px solid var(--border-color);
  padding-bottom: 24px;
  position: relative;
}

.stamp-box {
  position: absolute;
  top: 0;
  right: 0;
}

.exam-stamp {
  border: 3px double #10b981;
  color: #10b981;
  padding: 4px 14px;
  font-weight: 900;
  font-size: 18px;
  letter-spacing: 2px;
  transform: rotate(12deg);
  border-radius: 6px;
  display: inline-block;
}

.report-header h2 {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
}

.exam-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 6px;
}

.score-dashboard {
  display: flex;
  gap: 24px;
  margin: 30px 0;
}

.main-score-pill {
  flex: 0 0 200px;
  background: rgba(15, 23, 42, 0.7);
  border: 2px solid var(--primary);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px 10px;
}

.score-big {
  font-size: 64px;
  font-weight: 900;
  color: var(--primary);
  font-family: var(--font-mono);
  line-height: 1;
}

.score-rank {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin-top: 8px;
}

.sub-score-grid {
  flex: 1;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

.sub-card {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.sub-label {
  font-size: 12.5px;
  color: var(--text-muted);
}

.sub-val {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  font-family: var(--font-mono);
  margin-top: 6px;
}

.report-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 14px;
  font-size: 13px;
}

.report-table th, .report-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-color);
  text-align: left;
}

.report-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
  font-weight: 600;
}

.report-table tr:hover {
  background: rgba(255, 255, 255, 0.02);
}

.score-tag-high { color: #10b981; font-weight: 700; }
.score-tag-mid { color: #f59e0b; font-weight: 700; }
.score-tag-low { color: #ef4444; font-weight: 700; }

.report-actions {
  margin-top: 32px;
  display: flex;
  justify-content: center;
  gap: 16px;
}

/* 弹窗 Modal */
.modal-backdrop {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  max-width: 520px;
  width: 100%;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  overflow: hidden;
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.btn-close {
  background: transparent;
  border: none;
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 20px;
  font-size: 13.5px;
  line-height: 1.6;
  color: #cbd5e1;
}

.modal-body p {
  margin-bottom: 12px;
}

.signature-foot {
  font-size: 11px;
  color: #64748b;
  font-family: var(--font-mono);
  margin-top: 16px;
  border-top: 1px dashed var(--border-color);
  padding-top: 8px;
}

.modal-footer {
  padding: 14px 20px;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
}

/* 打印自适应 */
@media print {
  .exam-header, .report-actions, .btn, .no-print {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .report-card {
    border: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .report-header h2, .sub-val, .score-rank {
    color: #000 !important;
  }
  .score-big {
    color: #1e3a8a !important;
  }
  .report-table th, .report-table td {
    color: #000 !important;
    border-bottom: 1px solid #ccc !important;
  }
}
