/* ============================================================
   職業測試 — App 風格 UI
   ============================================================ */

.page-career-test .navbar,
.page-career-test-run .navbar,
.page-career-test .scroll-progress,
.page-career-test-run .scroll-progress,
.page-career-test .back-to-top,
.page-career-test-run .back-to-top {
  display: none;
}

.page-career-test footer,
.page-career-test-run footer {
  display: none;
}

.page-career-test-run .page-content {
  padding-top: 0;
}

/* --- 職業測試 hub：極簡二選一 --- */
.page-career-test .guide-hub-screen {
  padding-bottom: 8px;
}

.page-career-test .app-top-bar {
  position: sticky;
  top: 0;
  z-index: 1000;
}

.page-career-test .guide-hub-screen {
  padding-top: 8px;
}

.page-career-test .guide-topic-list-heading {
  margin-bottom: 10px;
}

.ct-hub-intro {
  margin: 0 0 28px;
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.55;
}

.ct-pick-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}


.ct-pick-label {
  display: inline-block;
  margin-left: 8px;
  padding: 3px 9px;
  border-radius: 100px;
  font-size: 0.68rem;
  font-weight: 800;
  vertical-align: middle;
  color: #4338ca;
  background: #e0e7ff;
  border: 1px solid #c7d2fe;
}


.ct-pick-tag {
  padding: 5px 11px;
  border-radius: 100px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-mid);
  background: var(--bg-light);
  border: 1px solid var(--border);
}

.ct-pick-tag.has-result {
  color: #00b86a;
  background: #f2faf4;
  border: 1px solid #d1e7d7;
}


.ct-hub-footnote {
  margin: 0 0 16px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.55;
  text-align: center;
  background: var(--bg-light);
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
}

.page-career-test .guide-hub-tip {
  margin-bottom: 0;
}


/* --- App 頂欄 --- */
.ct-app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: calc(10px + env(safe-area-inset-top)) 16px 12px;
  background: rgba(248, 250, 252, 0.92);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid var(--border);
}

.ct-app-header-inner {
  max-width: var(--app-max-width);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.ct-app-header-back {
  flex-shrink: 0;
  text-decoration: none;
  margin: 0;
}

.ct-app-header-text {
  flex: 1;
  min-width: 0;
}

.ct-app-header-text h1 {
  font-size: 1.05rem;
  font-weight: 900;
  color: var(--text-dark);
  margin: 0;
  line-height: 1.25;
}

.ct-app-header-text p {
  font-size: 0.75rem;
  color: var(--text-light);
  margin: 2px 0 0;
  line-height: 1.35;
}

/* --- 主內容區 --- */
.ct-screen {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 16px 16px 8px;
}

.ct-hero-card {
  background: linear-gradient(145deg, var(--primary) 0%, var(--primary-light) 100%);
  border-radius: 20px;
  padding: 22px 20px;
  color: #fff;
  margin-bottom: 20px;
  box-shadow: 0 8px 24px rgba(var(--primary-rgb, 13, 148, 136), 0.28);
}

.ct-hero-card .ct-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 100px;
  margin-bottom: 10px;
}

.ct-hero-card h2 {
  font-size: 1.35rem;
  font-weight: 900;
  margin: 0 0 8px;
  line-height: 1.25;
}

.ct-hero-card p {
  font-size: 0.85rem;
  line-height: 1.55;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
}

/* --- 測試類型列表（iOS 風格） --- */
.ct-section-label {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 4px 10px;
}

.ct-test-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.ct-test-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
}

.ct-test-row:active {
  transform: scale(0.98);
  border-color: var(--primary);
}

.ct-test-row-icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
}

.ct-test-row-icon--quick {
  background: rgba(245, 158, 11, 0.15);
}

.ct-test-row-icon--full {
  background: rgba(var(--primary-rgb, 13, 148, 136), 0.12);
}

.ct-test-row-body {
  flex: 1;
  min-width: 0;
}

.ct-test-row-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.ct-test-row-desc {
  font-size: 0.78rem;
  color: var(--text-light);
  line-height: 1.45;
  margin-bottom: 6px;
}

.ct-test-row-meta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--primary);
  background: var(--accent-soft, rgba(79, 209, 197, 0.15));
  padding: 3px 8px;
  border-radius: 100px;
}

.ct-test-row-chevron {
  color: var(--text-light);
  font-size: 0.85rem;
  flex-shrink: 0;
}

/* --- 功能亮點橫滑 --- */
.ct-features-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  padding: 0 16px 4px;
  margin: 0 -16px 20px;
  scrollbar-width: none;
}

.ct-features-scroll::-webkit-scrollbar {
  display: none;
}

.ct-feature-chip {
  flex: 0 0 auto;
  scroll-snap-align: start;
  width: 140px;
  padding: 14px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  text-align: center;
}

.ct-feature-chip .ct-fc-icon {
  font-size: 1.6rem;
  margin-bottom: 8px;
  line-height: 1;
}

.ct-feature-chip .ct-fc-title {
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 4px;
}

.ct-feature-chip .ct-fc-desc {
  font-size: 0.68rem;
  color: var(--text-light);
  line-height: 1.4;
}

/* --- 提示卡片 --- */
.ct-tip-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.ct-tip-card h3 {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-tip-card h3 i {
  color: var(--accent);
}

.ct-tip-card p {
  font-size: 0.82rem;
  color: var(--text-mid);
  line-height: 1.7;
  margin: 0;
}

/* ============================================================
   測試進行頁 (career-test-run)
   ============================================================ */

.page-career-test-run .page-content {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.page-career-test-run.ct-showing-result .page-content {
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

.ct-run-progress-wrap {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 16px 12px;
}

.ct-run-progress-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.ct-run-progress-meta span {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-mid);
}

.ct-run-progress-bar {
  height: 6px;
  background: var(--border);
  border-radius: 100px;
  overflow: hidden;
}

.ct-run-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 100px;
  transition: width 0.35s ease;
}

.ct-question-card {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 0 16px;
}

.ct-question-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--primary);
  background: var(--accent-soft, rgba(79, 209, 197, 0.15));
  padding: 5px 10px;
  border-radius: 100px;
  margin-bottom: 12px;
}

.ct-question-text {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--text-dark);
  line-height: 1.5;
  margin-bottom: 20px;
}

.ct-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.ct-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.ct-option:active {
  transform: scale(0.99);
}

.ct-option.selected {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 13, 148, 136), 0.08);
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 13, 148, 136), 0.12);
}

.ct-option-check {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  transition: var(--transition);
}

.ct-option.selected .ct-option-check {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.ct-option.selected .ct-option-check i {
  font-size: 0.65rem;
}

.ct-option-check i {
  display: none;
}

.ct-option.selected .ct-option-check i {
  display: block;
}

.ct-option-text {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
  font-weight: 500;
}

.ct-option.selected .ct-option-text {
  color: var(--text-dark);
  font-weight: 700;
}

/* 底部固定操作欄 */
.ct-run-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--app-max-width);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(248, 250, 252, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 150;
  display: flex;
  gap: 10px;
}

.ct-btn-prev,
.ct-btn-next {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 16px;
  border-radius: 14px;
  font-weight: 800;
  font-size: 0.92rem;
  cursor: pointer;
  border: none;
  transition: var(--transition);
}

.ct-btn-prev {
  flex: 0 0 auto;
  min-width: 100px;
  background: var(--bg-card);
  color: var(--text-mid);
  border: 1px solid var(--border);
}

.ct-btn-prev:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ct-btn-next {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px rgba(var(--primary-rgb, 13, 148, 136), 0.35);
}

.ct-btn-next:active:not(:disabled) {
  transform: scale(0.98);
}

.ct-btn-next:disabled {
  background: var(--border);
  color: var(--text-light);
  box-shadow: none;
  cursor: not-allowed;
}

/* --- 結果頁 --- */
.ct-result-screen {
  max-width: var(--app-max-width);
  margin: 0 auto;
  padding: 8px 16px 24px;
}

.ct-result-hero {
  text-align: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 28px 20px 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-md);
}

.ct-result-emoji {
  font-size: 4rem;
  line-height: 1;
  margin-bottom: 12px;
}

.ct-result-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.ct-result-type-name {
  font-size: 1.65rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 10px;
  line-height: 1.2;
}

.ct-result-mbti {
  display: inline-block;
  padding: 6px 14px;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--text-mid);
  margin-bottom: 14px;
}

.ct-result-desc {
  font-size: 0.88rem;
  color: var(--text-mid);
  line-height: 1.75;
  text-align: left;
  margin: 0;
}

.ct-traits-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.ct-trait-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.ct-trait-icon {
  font-size: 1.35rem;
  margin-bottom: 4px;
}

.ct-trait-name {
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 6px;
}

.ct-trait-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.ct-trait-bar {
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
}

.ct-trait-pct {
  font-size: 0.68rem;
  color: var(--text-light);
  font-weight: 600;
}

.ct-rec-block {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 12px;
}

.ct-rec-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ct-course-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ct-course-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  background: var(--bg-light);
  border-radius: 12px;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.ct-course-item:active {
  background: rgba(var(--primary-rgb, 13, 148, 136), 0.08);
}

.ct-course-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.ct-course-name {
  font-size: 0.85rem;
  font-weight: 800;
  color: var(--text-dark);
  margin-bottom: 2px;
}

.ct-course-uni {
  font-size: 0.72rem;
  color: var(--text-light);
}

.ct-career-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ct-career-tag {
  padding: 6px 12px;
  background: var(--accent-soft, rgba(79, 209, 197, 0.15));
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--primary);
  border: 1px solid rgba(var(--primary-rgb, 13, 148, 136), 0.2);
}

.ct-result-mode-note {
  max-width: var(--app-max-width);
  margin: 0 auto 12px;
  padding: 0 16px;
  font-size: 0.8rem;
  color: var(--text-mid);
  line-height: 1.5;
}

/* 結果頁底部固定操作欄 */
.ct-result-footer {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: var(--app-max-width);
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(248, 250, 252, 0.94);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  z-index: 150;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 10px;
}

.ct-result-footer.is-hidden {
  display: none;
}

.ct-result-footer .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  border-radius: 14px;
  font-weight: 800;
  white-space: nowrap;
}

#btnGoHome {
  flex: 1 1 0;
  min-width: 0;
  border-radius: 100px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

#btnGoHome:hover {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
}

#btnRestart {
  flex: 0 0 auto;
  border-radius: 100px;
}

/* 舊 class 別名，供 JS 渲染選項 */
.page-career-test-run .option-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px;
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 14px;
  cursor: pointer;
  transition: var(--transition);
}

.page-career-test-run .option-item.selected {
  border-color: var(--primary);
  background: rgba(var(--primary-rgb, 13, 148, 136), 0.08);
}

.page-career-test-run .option-radio {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
}

.page-career-test-run .option-item.selected .option-radio {
  background: var(--primary);
  border-color: var(--primary);
}

.page-career-test-run .option-item.selected .option-radio::after {
  content: '\f00c';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.65rem;
  color: #fff;
  display: block;
  width: auto;
  height: auto;
  position: static;
  transform: none;
  background: none;
  border-radius: 0;
}

.page-career-test-run .option-text {
  font-size: 0.9rem;
  color: var(--text-mid);
  line-height: 1.5;
  font-weight: 500;
}

.page-career-test-run .option-item.selected .option-text {
  color: var(--text-dark);
  font-weight: 700;
}

.page-career-test-run .ct-run-footer.is-hidden {
  display: none;
}

/* --- 職業測試獨立頁卡片特調（不影響首頁彈窗） --- */
.page-career-test .ct-topic-row {
  padding: 20px 18px;
  gap: 16px;
}

.page-career-test .ct-topic-row .guide-topic-headline {
  gap: 8px;
}

.page-career-test .ct-topic-row .guide-topic-title {
  font-size: 1.25rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  line-height: 1.2;
}

.page-career-test .ct-topic-row .guide-topic-desc {
  font-size: 0.85rem;
  color: var(--text-light);
  line-height: 1.5;
}

.page-career-test .ct-topic-row .guide-topic-icon {
  width: 76px;
  height: 76px;
  border-radius: 22px;
}

.page-career-test .ct-topic-row .guide-topic-icon-img {
  width: 62px;
  height: 62px;
}
