/* ===== 考生端公共样式 ===== */
:root {
  --primary: #5063E0;
  --primary-dark: #3A4FCC;
  --primary-light: #EEF1FE;
  --danger: #EF4444;
  --success: #22C55E;
  --warning: #F59E0B;
  --bg: #F8F9FC;
  --card-bg: #FFFFFF;
  --text: #1F2937;
  --text-secondary: #6B7280;
  --text-light: #9CA3AF;
  --border: #E5E7EB;
  --radius: 10px;
  --shadow: 0 1px 4px rgba(0,0,0,0.05);
  --shadow-lg: 0 4px 20px rgba(0,0,0,0.08);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  font-size: 15px;
}

/* ===== 页面容器 ===== */
.page-container {
  max-width: 600px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
}

@media (min-width: 769px) {
  .page-container { max-width: 900px; }
}

/* ===== 顶部标题栏 ===== */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

.top-bar .back-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.top-bar .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
}

.top-bar .right-action {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
}

/* ===== 卡片 ===== */
.card {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin: 16px;
}

.card-clickable {
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.card-clickable:hover, .card-clickable:active {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
}

.card-clickable.selected {
  border: 2px solid var(--primary);
  background: var(--primary-light);
}

/* ===== 按钮 ===== */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 13px 24px;
  border-radius: var(--radius);
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.1s;
  width: 100%;
}

.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}

.btn-text {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 14px;
  cursor: pointer;
  width: auto;
  padding: 4px 8px;
}

/* ===== 表单 ===== */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
  background: var(--card-bg);
}

.form-input:focus {
  border-color: var(--primary);
}

.form-select {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: var(--card-bg);
  outline: none;
}

/* ===== 倒计时 ===== */
.countdown-display {
  position: fixed;
  top: 56px;
  right: 16px;
  z-index: 99;
  background: var(--primary);
  color: white;
  padding: 8px 16px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  box-shadow: 0 2px 8px rgba(80,99,224,0.3);
}

.countdown-display.warning {
  background: var(--danger);
  animation: blink 1s infinite;
}

@keyframes blink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* ===== 扫码区域 ===== */
.scan-area {
  background: #1a1a2e;
  min-height: 60vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
}

.scan-frame {
  width: 240px;
  height: 240px;
  border: 3px solid var(--primary);
  border-radius: 12px;
  position: relative;
}

.scan-frame::before, .scan-frame::after {
  content: '';
  position: absolute;
  width: 30px;
  height: 30px;
  border: 4px solid var(--primary);
}

.scan-frame::before {
  top: -4px; left: -4px;
  border-right: none; border-bottom: none;
  border-radius: 12px 0 0 0;
}

.scan-frame::after {
  bottom: -4px; right: -4px;
  border-left: none; border-top: none;
  border-radius: 0 0 12px 0;
}

.scan-line {
  position: absolute;
  left: 0; right: 0;
  height: 2px;
  background: var(--primary);
  animation: scan-move 2s linear infinite;
}

@keyframes scan-move {
  0% { top: 0; }
  100% { top: 100%; }
}

.scan-hint {
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  margin-top: 24px;
}

/* ===== 试题展示 ===== */
.question-container {
  padding: 16px;
}

.question-image {
  width: 100%;
  border-radius: 8px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 播音三题型导航 */
.topic-nav {
  display: flex;
  gap: 0;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.topic-nav-item {
  flex: 1;
  padding: 12px;
  text-align: center;
  background: var(--card-bg);
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
}

.topic-nav-item.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: var(--primary-light);
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state .icon {
  font-size: 48px;
  margin-bottom: 16px;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: white;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 9999;
  animation: toast-in 0.3s;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateX(-50%) translateY(10px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 模态框 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal {
  background: white;
  border-radius: var(--radius);
  padding: 24px;
  max-width: 90%;
  width: 320px;
  text-align: center;
}

.modal .modal-title {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 12px;
}

.modal .modal-body {
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.modal .modal-actions {
  display: flex;
  gap: 12px;
}

.modal .modal-actions .btn {
  flex: 1;
}

/* ===== 底部导航 ===== */
.bottom-nav {
  display: flex;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 600px;
  margin: 0 auto;
  background: var(--card-bg);
  border-top: 1px solid var(--border);
  z-index: 100;
}

@media (min-width: 769px) {
  .bottom-nav { max-width: 900px; }
}

.bottom-nav-item {
  flex: 1;
  padding: 10px 4px;
  text-align: center;
  color: var(--text-light);
  font-size: 12px;
  cursor: pointer;
  text-decoration: none;
}

.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item .nav-icon {
  font-size: 22px;
  display: block;
  margin-bottom: 2px;
}

/* ===== 加载中 ===== */
.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: var(--text-light);
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 列表 ===== */
.list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.list-item:last-child { border-bottom: none; }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}

.tag-success { background: #DCFCE7; color: var(--success); }
.tag-warning { background: #FEF3C7; color: var(--warning); }
.tag-danger { background: #FEE2E2; color: var(--danger); }
.tag-info { background: var(--primary-light); color: var(--primary); }
