/* ============ 模拟面试 Web 版 - 响应式样式 ============ */
/* 手机（<900px）单列布局；桌面（≥900px）宽屏双栏布局 */

:root {
  --primary: #4F6EF7;
  --primary-light: #EEF1FE;
  --text: #1F2329;
  --text-sub: #6B7280;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --danger: #DC2626;
  --ok: #16A34A;
  --radius: 12px;
  --shadow: 0 2px 10px rgba(31, 35, 41, 0.05);
}

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

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.65;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", "PingFang SC", "Microsoft YaHei", sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

#app { flex: 1; display: flex; flex-direction: column; }

/* ============ 顶部导航 ============ */

.topbar {
  background: var(--card);
  border-bottom: 1px solid rgba(31, 35, 41, 0.06);
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 20px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar-logo {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
}

.topbar-nav { display: flex; gap: 4px; }

.topbar-nav a {
  color: var(--text-sub);
  text-decoration: none;
  font-size: 14px;
  padding: 6px 14px;
  border-radius: 8px;
  transition: all 0.15s;
}

.topbar-nav a:hover { color: var(--primary); background: var(--primary-light); }

.topbar-nav a.active { color: var(--primary); background: var(--primary-light); font-weight: 600; }

/* ============ 页面容器 ============ */

.page {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.footer {
  text-align: center;
  color: #9CA3AF;
  font-size: 12px;
  padding: 20px 16px 28px;
}

/* ============ 卡片 ============ */

.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
}

.card-title-bar {
  display: inline-block;
  width: 4px;
  height: 15px;
  border-radius: 2px;
  background: var(--primary);
  margin-right: 8px;
}

/* ============ 首页 ============ */

.hero { text-align: center; padding: 24px 0 12px; }

.hero-title { font-size: 24px; font-weight: 700; }

.hero-sub { color: var(--text-sub); font-size: 14px; margin-top: 6px; }

.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }

.field-label { display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.field-label em { color: var(--danger); font-style: normal; }

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
  background: #FAFBFC;
  outline: none;
  transition: border 0.15s;
  font-family: inherit;
}

.input:focus { border-color: var(--primary); background: #fff; }

.job-group { margin-bottom: 12px; }
.job-group:last-child { margin-bottom: 0; }

.job-group-name { font-size: 12px; color: #9CA3AF; margin-bottom: 8px; }

.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }

.chip {
  border: 1px solid #E5E7EB;
  background: #FAFBFC;
  color: var(--text);
  border-radius: 999px;
  padding: 8px 18px;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.4;
}

.chip:hover { border-color: var(--primary); }

.chip.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 600;
}

.chip-sub { font-size: 11px; opacity: 0.75; font-weight: 400; }

.agree-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  cursor: pointer;
}

.agree-row input[type="checkbox"] { width: 17px; height: 17px; accent-color: var(--primary); cursor: pointer; }

.agree-row a { color: var(--primary); text-decoration: none; }

.disclaimer-text { text-align: left; max-height: 55vh; overflow-y: auto; }
.disclaimer-text p { margin-bottom: 8px; font-size: 13px; color: var(--text-sub); }

/* ============ 按钮 ============ */

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  padding: 13px 24px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { background: #C7D0F9; cursor: not-allowed; }

.btn-block { width: 100%; display: block; }

.btn-ghost {
  background: #fff;
  color: var(--text);
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 14px;
  padding: 11px 20px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }

.btn-ghost-danger { color: var(--danger); }
.btn-ghost-danger:hover { border-color: var(--danger); color: var(--danger); }

.btn-sm { padding: 7px 16px; font-size: 13px; }

.btn-text {
  background: none;
  border: none;
  color: var(--text-sub);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  font-family: inherit;
}

.btn-text:hover { color: var(--primary); }
.btn-text-danger:hover { color: var(--danger); }

/* ============ 面试作答页 ============ */

.iv-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.iv-progress-info { display: flex; align-items: center; gap: 10px; }

.iv-tag {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  padding: 3px 10px;
}

.iv-count { color: var(--text-sub); font-size: 13px; }

.q-meta { display: flex; gap: 8px; margin-bottom: 12px; }

.q-type {
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  border-radius: 5px;
  padding: 2px 8px;
}

.q-diff {
  background: #FDF3E7;
  color: #D97706;
  font-size: 12px;
  border-radius: 5px;
  padding: 2px 8px;
}

.q-prompt { font-size: 17px; font-weight: 600; line-height: 1.6; }

.iv-last-score {
  margin-top: 12px;
  font-size: 13px;
  color: #D97706;
  background: #FDF3E7;
  border-radius: 8px;
  padding: 8px 12px;
}

.card-tips .tips-title { font-size: 13px; font-weight: 600; color: var(--text-sub); margin-bottom: 8px; }

.tips-list { padding-left: 18px; }
.tips-list li { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }

.textarea {
  width: 100%;
  min-height: 220px;
  padding: 14px;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
  background: #FAFBFC;
  outline: none;
  resize: vertical;
  font-family: inherit;
  line-height: 1.7;
}

.textarea:focus { border-color: var(--primary); background: #fff; }

.iv-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  gap: 10px;
  flex-wrap: wrap;
}

.char-count { font-size: 12px; color: #9CA3AF; }

.iv-actions { display: flex; gap: 10px; }

/* ============ 评分中页 ============ */

.page-scoring { padding-top: 80px; }

.scoring-box { text-align: center; padding: 40px 0; }

.scoring-spinner {
  width: 46px;
  height: 46px;
  margin: 0 auto 20px;
  border: 4px solid var(--primary-light);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

.scoring-tip { font-size: 16px; font-weight: 600; }
.scoring-subtip { font-size: 13px; color: var(--text-sub); margin: 8px 0 24px; }

.scoring-progress {
  max-width: 320px;
  margin: 0 auto 24px;
  height: 8px;
  background: var(--primary-light);
  border-radius: 4px;
  overflow: hidden;
}

.scoring-progress-bar {
  height: 100%;
  background: var(--primary);
  border-radius: 4px;
  transition: width 0.16s linear;
}

/* ============ 报告页 ============ */

.report-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }

.report-score-ring {
  width: 128px;
  height: 128px;
  border: 6px solid var(--primary);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.report-score-num { font-size: 40px; font-weight: 700; line-height: 1.1; }

.report-score-unit { font-size: 11px; color: var(--text-sub); }

.report-score-level { font-size: 20px; font-weight: 700; margin-top: 8px; }

.report-meta { font-size: 14px; font-weight: 600; }
.report-date { font-size: 12px; color: #9CA3AF; margin-top: 2px; }
.report-comment { font-size: 14px; color: var(--text-sub); margin-top: 10px; text-align: center; }

.report-hero-btns { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; justify-content: center; }

.dim-row { margin-bottom: 14px; }
.dim-row:last-of-type { margin-bottom: 6px; }

.dim-head { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.dim-name { font-weight: 600; }
.dim-score em { font-style: normal; color: #9CA3AF; font-size: 12px; }

.dim-bar { height: 8px; background: #F3F4F6; border-radius: 4px; overflow: hidden; }
.dim-bar-fill { height: 100%; background: var(--primary); border-radius: 4px; }

.explain-toggle { font-size: 13px; color: var(--primary); cursor: pointer; margin-top: 8px; text-align: center; }
.explain-body p { font-size: 12px; color: var(--text-sub); margin-top: 8px; }

.q-item { border-bottom: 1px solid #F3F4F6; }
.q-item:last-child { border-bottom: none; }

.q-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 14px 0;
  cursor: pointer;
}

.q-item-title { display: flex; gap: 10px; align-items: flex-start; min-width: 0; }

.q-item-no {
  flex: none;
  width: 22px;
  height: 22px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}

.q-item-prompt { font-size: 14px; font-weight: 500; }

.q-item-right { display: flex; align-items: center; gap: 8px; flex: none; }

.q-item-prev { font-size: 12px; color: var(--ok); }

.q-item-score { font-size: 15px; font-weight: 700; }

.q-item-expand { font-size: 12px; color: var(--primary); }

.q-item-body { padding: 4px 0 16px 32px; }

.q-sec-title { font-size: 13px; font-weight: 600; color: var(--text-sub); margin: 12px 0 6px; }

.q-answer {
  background: #FAFBFC;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-all;
}

.q-capped { color: #D97706; font-size: 12px; font-weight: 400; }

.q-gained { font-size: 13px; color: var(--ok); margin-top: 6px; }

.q-hits { display: flex; flex-wrap: wrap; gap: 6px; }

.hit, .miss {
  font-size: 12px;
  border-radius: 5px;
  padding: 3px 8px;
}

.hit { background: #EBF7EE; color: var(--ok); }
.miss { background: #FDF0F0; color: var(--danger); }

.q-refs, .q-sugs { padding-left: 18px; }
.q-refs li, .q-sugs li { font-size: 13px; color: var(--text-sub); margin-bottom: 4px; }

.q-item-btns { margin-top: 14px; }

/* ============ 历史页 ============ */

.hs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid #F3F4F6;
  cursor: pointer;
}

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

.hs-main { flex: 1; min-width: 0; }

.hs-line1 { display: flex; justify-content: space-between; font-size: 14px; font-weight: 600; gap: 8px; }
.hs-score { color: var(--primary); font-weight: 700; flex: none; }
.hs-progress { color: var(--text-sub); font-size: 13px; flex: none; }

.hs-line2 { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-size: 12px; }

.hs-status { border-radius: 5px; padding: 1px 8px; font-size: 11px; }
.hs-status-done { background: #EBF7EE; color: var(--ok); }
.hs-status-active { background: var(--primary-light); color: var(--primary); }
.hs-status-broken { background: #F3F4F6; color: #9CA3AF; }

.hs-date { color: #9CA3AF; }
.hs-resume { color: var(--primary); }

.hs-delete {
  flex: none;
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: #C0C4CC;
  font-size: 14px;
  border-radius: 8px;
  cursor: pointer;
}

.hs-delete:hover { background: #FDF0F0; color: var(--danger); }

.empty-box { text-align: center; padding: 40px 0 24px; }
.empty-icon { font-size: 40px; margin-bottom: 10px; }
.empty-text { color: var(--text-sub); font-size: 14px; margin-bottom: 20px; }

/* ============ Toast / Modal ============ */

.mi-toast {
  position: fixed;
  left: 50%;
  bottom: 12%;
  transform: translateX(-50%) translateY(10px);
  background: rgba(31, 35, 41, 0.85);
  color: #fff;
  font-size: 14px;
  border-radius: 8px;
  padding: 10px 20px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s;
  z-index: 999;
  max-width: 80vw;
}

.mi-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mi-toast.success { background: rgba(22, 163, 74, 0.92); }

.mi-modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 24px;
  animation: fadeIn 0.15s;
}

@keyframes fadeIn { from { opacity: 0; } }

.mi-modal {
  background: #fff;
  border-radius: 14px;
  padding: 24px;
  width: 100%;
  max-width: 360px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

.mi-modal-lg { max-width: 520px; }

.mi-modal-title { font-size: 16px; font-weight: 700; text-align: center; margin-bottom: 12px; }

.mi-modal-content { font-size: 14px; color: var(--text-sub); text-align: center; }

.mi-modal-btns { display: flex; margin-top: 22px; gap: 12px; }

.mi-modal-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  font-family: inherit;
  border: none;
}

.mi-modal-btn.cancel { background: #F3F4F6; color: var(--text); }
.mi-modal-btn.ok { background: var(--primary); color: #fff; font-weight: 600; }
.mi-modal-btn.ok.danger { background: var(--danger); }

/* ============ 岗位选择弹层（底部弹层选择器） ============ */

.job-entry {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: #FAFBFC;
  border: 1px solid #E5E7EB;
  border-radius: 10px;
  font-size: 15px;
  font-family: inherit;
  cursor: pointer;
  transition: border 0.15s;
  text-align: left;
}

.job-entry:hover { border-color: var(--primary); background: #fff; }

.job-entry-name { font-weight: 600; color: var(--text); }

.job-entry-arrow {
  font-size: 20px;
  color: #9CA3AF;
  line-height: 1;
  flex: none;
}

.mi-picker-mask {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.5);
  z-index: 900;
  display: flex;
  align-items: flex-end; /* 手机：底部弹层 */
  justify-content: center;
  animation: fadeIn 0.15s;
}

.mi-picker {
  background: #fff;
  width: 100%;
  max-width: 560px;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  transform: translateY(100%);
  transition: transform 0.2s ease-out;
  overflow: hidden;
}

.mi-picker-mask.open .mi-picker { transform: translateY(0); }

.mi-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 8px;
  flex: none;
}

.mi-picker-title { font-size: 15px; font-weight: 600; }

.mi-picker-close {
  border: none;
  background: #F3F4F6;
  color: var(--text-sub);
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 13px;
  cursor: pointer;
}

.mi-picker-close:hover { background: #E5E7EB; color: var(--text); }

.mi-picker-tabs {
  display: flex;
  gap: 6px;
  padding: 4px 18px 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  flex: none;
  scrollbar-width: none;
}

.mi-picker-tabs::-webkit-scrollbar { display: none; }

.mi-picker-tab {
  flex: none;
  border: 1px solid #E5E7EB;
  background: #FAFBFC;
  color: var(--text-sub);
  font-size: 13px;
  font-family: inherit;
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}

.mi-picker-tab.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

.mi-picker-list {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 12px calc(16px + env(safe-area-inset-bottom));
}

.mi-picker-group {
  font-size: 12px;
  color: #9CA3AF;
  padding: 12px 8px 6px;
}

.mi-picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 52px;
  padding: 10px 12px;
  border: none;
  background: #FAFBFC;
  border-radius: 10px;
  margin-bottom: 6px;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: background 0.15s;
}

.mi-picker-item:hover { background: #F0F2F7; }

.mi-picker-item.selected { background: var(--primary-light); }

.mi-picker-item-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.mi-picker-item-name { font-size: 15px; font-weight: 600; color: var(--text); }

.mi-picker-item.selected .mi-picker-item-name { color: var(--primary); }

.mi-picker-item-desc {
  font-size: 12px;
  color: var(--text-sub);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mi-picker-item-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 桌面：弹层居中弹窗 */
@media (min-width: 900px) {
  .mi-picker-mask { align-items: center; padding: 24px; }

  .mi-picker {
    border-radius: 16px;
    max-height: 76vh;
    transform: translateY(16px);
    opacity: 0;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
  }

  .mi-picker-mask.open .mi-picker { transform: translateY(0); opacity: 1; }
}

/* ============ 桌面响应式（≥900px） ============ */

@media (min-width: 900px) {
  body { font-size: 15px; }

  .page { max-width: 960px; padding: 28px 24px 64px; }
  .page-narrow { max-width: 720px; }

  .hero-title { font-size: 28px; }

  /* 面试页：左侧题目 + 右侧答题 双栏 */
  .iv-cols { display: grid; grid-template-columns: 5fr 7fr; gap: 20px; align-items: start; }

  .textarea { min-height: 320px; }

  /* 报告概览：环形分 + 信息 横排 */
  .report-hero { flex-direction: row; text-align: left; gap: 36px; padding: 12px 8px; }

  .report-hero-info { flex: 1; }

  .report-comment { text-align: left; }

  .report-hero-btns { justify-content: flex-start; }

  .q-item-prompt { font-size: 15px; }

  .mi-modal-content { font-size: 14.5px; }
}

/* 手机小屏微调 */
@media (max-width: 400px) {
  .iv-actions { width: 100%; }
  .iv-actions .btn-primary { flex: 1; }
  .q-item-body { padding-left: 0; }
}
