/* views.css — 各页面专属样式 */

/* ==================== 登录 ==================== */

.public-view { min-height: 100vh; background: var(--bg); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 28px 18px; }
.login-brand { position: absolute; top: 26px; left: 30px; display: flex; align-items: center; gap: 10px; }
.login-brand > span:last-child { display: flex; flex-direction: column; line-height: 1.3; }
.login-brand strong { font-size: 14px; }
.login-brand small { color: var(--muted); font-size: 11px; }
.login-panel { width: min(420px, 100%); padding: 32px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
.login-panel h1 { font-size: 23px; margin-bottom: 5px; }
.login-panel > p { margin-bottom: 22px; }
.login-panel .field { display: block; margin-bottom: 16px; }
.login-panel .field > span { display: block; font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 5px; }
.login-note { margin: 14px 0 0 !important; text-align: center; }
.login-switch { display: block; border: 0; background: none; color: var(--brand-dark); margin: 12px auto 0; font-size: 12.5px; text-decoration: underline; }
.login-error { padding: 9px 11px; border: 1px solid #fecaca; border-radius: var(--radius-sm); background: var(--danger-soft); color: var(--danger); font-size: 12.5px; margin-bottom: 12px; }
.user-email { color: var(--muted); font-size: 12px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==================== 工作流 / 概览 ==================== */

.eyebrow {
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 7px;
}

.workflow-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius);
  background: linear-gradient(110deg, var(--brand-soft), #fff 72%);
}
.workflow-copy { min-width: 0; }
.workflow-copy h2, .welcome-hero h2 { font-size: 21px; letter-spacing: -.01em; }
.workflow-copy p, .welcome-hero p { margin-top: 6px; color: var(--text-2); max-width: 640px; }
.workflow-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.workflow-secondary { background: rgba(255,255,255,.72); }
.welcome-hero {
  max-width: 900px;
  margin: 10px auto 20px;
  padding: 34px 28px;
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  background: linear-gradient(110deg, var(--brand-soft), #fff 70%);
}
.welcome-detail { max-width: 900px; margin: 0 auto; }
.welcome-detail h3 { font-size: 15px; margin-bottom: 8px; }

@media (max-width: 680px) {
  .workflow-banner { align-items: flex-start; flex-direction: column; padding: 18px; }
  .workflow-copy h2, .welcome-hero h2 { font-size: 18px; }
  .welcome-hero { padding: 24px 18px; margin-top: 0; }
  .workflow-actions .btn { flex: 1 1 auto; }
}

/* ==================== 资料库 ==================== */

.upload-panel { margin-bottom: 22px; }

.doc-row .doc-ico {
  width: 36px; height: 36px;
  border-radius: 9px;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 700;
  flex: none;
  text-transform: uppercase;
}

/* 检索结果 */
.search-bar {
  display: flex; gap: 10px; align-items: center;
  margin-bottom: 16px;
}
.search-bar .input { flex: 1; }

.hit-list { display: flex; flex-direction: column; gap: 12px; }

.hit {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  transition: border-color .13s, box-shadow .13s;
}
.hit:hover { border-color: var(--brand-line); box-shadow: var(--shadow); }
.hit-head {
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--muted);
  margin-bottom: 7px;
  flex-wrap: wrap;
}
.hit-text {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}
.hit-actions { margin-top: 10px; display: flex; gap: 8px; align-items: center; }
.score-pill {
  margin-left: auto;
  font-size: 11px;
  font-family: var(--mono);
  color: var(--muted-2);
}

mark.hl {
  background: #fef08a;
  color: #713f12;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}

/* 文档原文查看 */
.doc-viewer {
  max-height: 62vh;
  overflow-y: auto;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
  font-size: 13px;
  line-height: 1.85;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-2);
}

/* ==================== 题库 ==================== */

.bank-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 14px;
}

.bank-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 10px;
  transition: border-color .13s, box-shadow .13s, transform .13s;
}
.bank-card:hover { border-color: var(--brand-line); box-shadow: var(--shadow); transform: translateY(-1px); }
.bank-card h3 { font-size: 14.5px; line-height: 1.4; }
.bank-card .bank-meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; }
.bank-card .bank-foot { display: flex; gap: 7px; margin-top: auto; padding-top: 4px; flex-wrap: wrap; }

.type-bars { display: flex; gap: 4px; height: 5px; border-radius: 4px; overflow: hidden; }
.type-bars i { display: block; height: 100%; }

/* ==================== 题目卡片 ==================== */

.q-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.q-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.q-head .q-index {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--mono);
}
.q-head .spacer { flex: 1; }

.q-stem {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  margin-bottom: 15px;
  white-space: pre-wrap;
  word-break: break-word;
}

.q-options { display: flex; flex-direction: column; gap: 9px; }

.opt {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: left;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-2);
  transition: border-color .13s, background .13s;
  width: 100%;
}
.opt:hover:not(.locked) { border-color: var(--brand-line); background: var(--surface-2); }
.opt .opt-key {
  width: 22px; height: 22px;
  flex: none;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 1px;
}
.opt .opt-text { flex: 1; word-break: break-word; }

.opt.selected { border-color: var(--brand); background: var(--brand-soft); }
.opt.selected .opt-key { background: var(--brand); border-color: var(--brand); color: #fff; }

.opt.correct { border-color: var(--ok); background: var(--ok-soft); }
.opt.correct .opt-key { background: var(--ok); border-color: var(--ok); color: #fff; }

.opt.wrong { border-color: var(--danger); background: var(--danger-soft); }
.opt.wrong .opt-key { background: var(--danger); border-color: var(--danger); color: #fff; }

.opt.locked { cursor: default; }

/* 答题反馈 */
.q-feedback {
  margin-top: 15px;
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  font-size: 13px;
  line-height: 1.7;
  border: 1px solid;
  animation: fade .18s ease;
}
.q-feedback.ok { background: var(--ok-soft); border-color: #a7f3d0; }
.q-feedback.bad { background: var(--danger-soft); border-color: #fecaca; }
.q-feedback .fb-title { font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 7px; }
.q-feedback.ok .fb-title { color: var(--ok); }
.q-feedback.bad .fb-title { color: var(--danger); }
.q-feedback .fb-answer { font-weight: 600; }
.q-feedback .fb-analysis {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed rgba(0, 0, 0, .1);
  color: var(--text-2);
  white-space: pre-wrap;
}

/* 文本题作答 */
.text-answer { display: flex; flex-direction: column; gap: 10px; }
.self-grade { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.answer-reveal {
  background: var(--ok-soft);
  border: 1px solid #a7f3d0;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.7;
  white-space: pre-wrap;
}

/* ==================== 练习 / 考试 ==================== */

.practice-bar {
  display: flex; align-items: center; gap: 14px;
  padding: 13px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  position: sticky; top: -24px; z-index: 10;
}
.practice-bar .pb-info { display: flex; align-items: center; gap: 14px; flex: 1; flex-wrap: wrap; font-size: 13px; }
.practice-bar .pb-progress { flex: 1; min-width: 120px; }

.timer {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 650;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.timer.warn { color: var(--warn); }
.timer.danger { color: var(--danger); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .45; } }

/* 答题卡 */
.sheet {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(38px, 1fr));
  gap: 7px;
}
.sheet-cell {
  aspect-ratio: 1;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  font-size: 12px;
  font-family: var(--mono);
  color: var(--muted);
  display: grid; place-items: center;
  transition: background .12s, border-color .12s, color .12s;
}
.sheet-cell:hover { border-color: var(--brand); color: var(--brand); }
.sheet-cell.done { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-dark); font-weight: 600; }
.sheet-cell.correct { background: var(--ok); border-color: var(--ok); color: #fff; }
.sheet-cell.wrong { background: var(--danger); border-color: var(--danger); color: #fff; }
.sheet-cell.star { box-shadow: inset 0 0 0 2px #fbbf24; }
.sheet-cell.current { outline: 2px solid var(--brand); outline-offset: 1px; }

/* 结果页 */
.result-hero {
  text-align: center;
  padding: 30px 20px 24px;
}
.score-ring {
  width: 132px; height: 132px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid; place-items: center;
  position: relative;
}
.score-ring .ring-inner {
  width: 106px; height: 106px;
  border-radius: 50%;
  background: var(--surface);
  display: grid; place-items: center;
  flex-direction: column;
}
.score-ring .ring-value { font-size: 30px; font-weight: 700; letter-spacing: -.02em; line-height: 1; }
.score-ring .ring-label { font-size: 11.5px; color: var(--muted); margin-top: 4px; }

.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 12px;
  margin: 20px 0;
}

/* ==================== 统计 ==================== */

.bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 10px; }
.bar-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bar-stack { width: 100%; max-width: 40px; display: flex; flex-direction: column; justify-content: flex-end; flex: 1; border-radius: 6px 6px 0 0; overflow: hidden; }
.bar-stack .b-correct { background: var(--ok); }
.bar-stack .b-wrong { background: #fca5a5; }
.bar-label { font-size: 10.5px; color: var(--muted); white-space: nowrap; }
.bar-value { font-size: 10.5px; color: var(--muted-2); font-variant-numeric: tabular-nums; }

.legend { display: flex; gap: 16px; font-size: 12px; color: var(--muted); }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; }

.meter-list { display: flex; flex-direction: column; gap: 11px; }
.meter { display: flex; flex-direction: column; gap: 5px; }
.meter-head { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; }
.meter-head .name { font-weight: 600; color: var(--text-2); }
.meter-head .num { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12px; }

/* ==================== 设置 ==================== */

.setting-block { max-width: 720px; }
.kv { display: grid; grid-template-columns: 132px 1fr; gap: 8px 14px; font-size: 13px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; }

/* ==================== 导入预览 ==================== */

.preview-tabs { margin-bottom: 0; }

.preview-q {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 13px 15px;
  margin-bottom: 10px;
  background: var(--surface);
  transition: border-color .12s, background .12s;
}
.preview-q.picked { border-color: var(--brand); background: var(--brand-soft); }
.preview-q .pq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.preview-q .pq-stem { font-size: 13.5px; line-height: 1.7; margin-bottom: 7px; }
.preview-q .pq-opts { font-size: 12.5px; color: var(--muted); line-height: 1.8; }
.preview-q .pq-ans { font-size: 12.5px; margin-top: 6px; color: var(--ok); font-weight: 600; }
.preview-q .pq-meta { font-size: 11px; color: var(--muted-2); margin-top: 7px; font-family: var(--mono); }

.conf-high { color: var(--ok); }
.conf-medium { color: var(--warn); }
.conf-low { color: var(--danger); }
