/* ===== 模擬練習平臺補充樣式 =====
   基礎樣式已改用正式測驗頁面複製過來的 CSS/Student.css + CSS/bootstrap.minX.css，
   這份只放 Student.css 沒有、練習平台額外需要的部分(說明/成績頁、作答總覽格狀版面等)，
   不要重複定義 Student.css 已有的 class，避免覆蓋掉正式樣式。 */

:root {
  --brand: #5D8D70;
  --brand-dark: #4a7a5e;
  --gold: #d4a843;
  --gold-bg: #fff3cd;
  --danger: #c0392b;
  --current: #2479b8;
  --unanswered-bg: #b5d8b5;
  --border: #ccc;
  --text-dark: #333;
  --text-muted: #777;
  --shadow: 0 2px 8px rgba(0,0,0,0.08);
  --radius: 4px;
  --radius-lg: 6px;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Login.aspx/Confirm.aspx等有runat="server"的頁面，內容全部包在<form>裡，
   body的flex只看得到form這一個子元素，要把flex排版直接套在form上版權列才會被推到底部 */
.page-flex {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}
.page-flex > .container-fluid {
  flex: 1;
}

/* ===== 說明/成績/無題目畫面容器(Student.css沒有這種置中卡片版面) ===== */
.container-narrow {
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
  padding: 24px;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--brand);
}

.btn-start {
  background: var(--brand);
  color: #fff;
  border: none;
  padding: 14px 32px;
  border-radius: 6px;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-start:hover { background: var(--brand-dark); color: #fff; }

.btn-flat {
  background: #fff;
  border: 2px solid #999;
  color: var(--text-dark);
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
.btn-flat:hover { background: #f5f5f5; }
.btn-flat:disabled { opacity: 0.4; cursor: default; }

/* 結束畫面：灰底說明文字框 */
.practice-end-box {
  background: #e9e9e9;
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  color: var(--text-dark);
  font-size: 1.1rem;
  line-height: 1.9;
  text-align: left;
}
.practice-end-box p { margin: 0 0 12px; }
.practice-end-box + .btn-group { margin-top: 24px; }

.btn-group { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }

/* 0918：正式系統#btnPreview實測font-size:15px/padding:5px 10px(該站html根字級被舊版Bootstrap3
   疊加成10px，讓.btn-lg的rem換算變小)，練習平台沒有那份舊CSS包袱，.btn-lg會是標準的24px/8px 16px。
   不引入整份舊版CSS(會連帶弄壞題目文字等其他rem元件)，只針對這顆按鈕寫死同樣的px值對齊視覺。 */
#btnPreview {
  font-size: 15px;
  padding: 5px 10px;
}

/* 同一個根因：作答總覽視窗的「繼續作答」也是.btn-lg，另外疊了.continue{font-size:2rem}，
   正式系統(10px根字級)換算出來是font-size:20px、padding沿用.btn-lg的5px 10px */
#overviewOverlay .continue {
  font-size: 20px;
  padding: 5px 10px;
}

/* ===== 題目區輔助排版(question-wrap只補正式站#kk額外的footer留白，
   寬度完全交給Bootstrap .container決定，不能自己蓋max-width，
   否則會比上面StudentHeader的.container窄，兩段寬度對不齊看起來就很奇怪) ===== */
.question-wrap {
  padding-bottom: 5.5em;
}


/* 頁尾版權列(跟正式站.footer.fixed-bottom不同東西，這是練習平台自己的頁尾) */
footer.footer {
  background: #3d6b52;
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 20px 24px;
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* ===== 作答總覽(照抄Examination.aspx的#Query結構：modal-dialog.modal-xl > modal-content，
   裡面塞跟Btn_Query_Click產生的一樣的table.table-bordered，顏色沿用Student.css既有的
   .numcol/.currentcol/.whitecol/.unansweredcol/.flaggedcol，不再自己刻卡片版面) ===== */
.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1060;
  align-items: flex-start;
  justify-content: center;
  padding: 5em 16px 2em;
  overflow-y: auto;
}

#overviewOverlay .modal-dialog {
  margin: 0;
  max-height: calc(100vh - 4em);
}
#overviewOverlay .modal-content {
  margin: 0 auto;
  max-height: calc(100vh - 4em);
  overflow-y: auto;
}

/* Student.css沒有的.header是Examination.aspx自己的inline style，這裡補上 */
.header {
  text-align: center;
  padding: 2em 0px;
}

/* ===== 成績/詳解(Student.css沒有這種成績卡片，正式測驗不會在測驗頁顯示分數) ===== */
#result-title { color: var(--brand); }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.stat-card {
  background: #fff;
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--brand);
}
.stat-card.green { border-left-color: var(--brand); }
.stat-card.orange { border-left-color: var(--gold); }
.stat-card.blue { border-left-color: var(--current); }
.stat-card .stat-value { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1; }
.stat-card.orange .stat-value { color: var(--gold); }
.stat-card.blue .stat-value { color: var(--current); }
.stat-card .stat-label { font-size: 0.85rem; color: var(--text-muted); margin-top: 6px; }

.answer-item {
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  border-left: 4px solid var(--brand);
}
.answer-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.status { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 0.8rem; font-weight: 600; }
.status-success { background: #d5f5e3; color: #1e8449; }
.status-danger { background: #fadbd8; color: #b03a2e; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.4s ease-out; }
