/* ============================================================
   极速职业身份卡 — 样式表
   设计：玻璃拟态 / 蓝色主色调 / 移动端优先
   ============================================================ */

/* ---------- 变量与重置 ---------- */
:root {
  --blue: #3a8cff;
  --blue-light: #5ca8ff;
  --blue-dark: #2a70d8;
  --glass-bg: rgba(255, 255, 255, 0.4);
  --glass-border: rgba(255, 255, 255, 0.5);
  --glass-blur: blur(16px);
  --radius: 20px;
  --radius-btn: 30px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --pad: 20px;
  --gap: 24px;
}

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

html {
  font-size: 16px;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  min-height: 100vh;
  min-height: 100dvh;
  background: linear-gradient(145deg, #e8f5fe 0%, #b3d9f7 100%);
  color: #1a2634;
  line-height: 1.6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow-x: hidden;
}

/* 背景装饰 */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(58, 140, 255, 0.12) 0%, transparent 50%),
    radial-gradient(circle at 80% 80%, rgba(92, 192, 255, 0.10) 0%, transparent 50%);
}

/* ---------- 页面容器 ---------- */
.page {
  display: none;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  padding: var(--pad);
  position: relative;
  z-index: 1;
}

.page.active {
  display: flex;
}

/* ---------- 玻璃拟态通用 ---------- */
.glass-card,
.quiz-card,
.result-hero,
.result-tags,
.result-radar,
.result-majors,
.result-ai-warning,
.result-hidden,
.result-actions,
.major-card,
.modal-card {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ---------- 首页 ---------- */
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 24px;
  padding: 40px 0;
}

.brand-title {
  font-size: 2.2rem;
  font-weight: 800;
  color: #1a2634;
  letter-spacing: 2px;
}

.brand-subtitle {
  font-size: 1rem;
  color: #5a6b7c;
  font-weight: 500;
}

.home-footer {
  font-size: 0.8rem;
  color: #5a6b7c;
  margin-top: 32px;
  line-height: 1.8;
}

/* ---------- 主按钮 ---------- */
.btn-primary {
  display: inline-block;
  padding: 14px 48px;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  box-shadow: 0 4px 16px rgba(58, 140, 255, 0.35);
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, filter 0.2s;
  letter-spacing: 1px;
  -webkit-tap-highlight-color: transparent;
}

.btn-primary:hover {
  filter: brightness(0.95);
}

.btn-primary:active {
  transform: scale(0.96);
  filter: brightness(0.88);
  box-shadow: 0 2px 8px rgba(58, 140, 255, 0.3);
}

/* ---------- 问卷页 ---------- */
.quiz-container {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.quiz-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-text {
  background: none;
  border: none;
  color: var(--blue);
  font-size: 0.9rem;
  cursor: pointer;
  padding: 4px 0;
}

.quiz-progress-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: #5a6b7c;
}

/* 进度条 */
.progress-bar {
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 3px;
  transition: width 0.35s ease;
  width: 5%;
}

/* 题目卡片 */
.quiz-card {
  flex: 1;
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.question-text {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.6;
  color: #1a2634;
}

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

.option-btn {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 20px;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.45);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  border-radius: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: #1a2634;
  -webkit-tap-highlight-color: transparent;
}

.option-btn:active {
  transform: scale(0.98);
}

.option-btn.selected {
  background: rgba(58, 140, 255, 0.15);
  border-color: var(--blue);
  color: var(--blue-dark);
  font-weight: 600;
}

/* 底部导航 */
.quiz-nav {
  display: flex;
  gap: 12px;
}

.btn-nav {
  flex: 1;
  padding: 14px;
  font-size: 0.95rem;
  font-weight: 600;
  border-radius: var(--radius-btn);
  border: 1.5px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.35);
  color: #5a6b7c;
  cursor: pointer;
  transition: all 0.2s;
  -webkit-tap-highlight-color: transparent;
}

.btn-nav:active {
  transform: scale(0.97);
}

.btn-nav-primary {
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: #fff;
  border: none;
  box-shadow: 0 4px 12px rgba(58, 140, 255, 0.3);
  transition: filter 0.2s;
}

.btn-nav-primary:hover {
  filter: brightness(0.95);
}

.btn-nav-primary:active {
  filter: brightness(0.88);
}

.btn-nav:disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ---------- 加载过渡页 ---------- */
.loading-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 24px;
}

.loading-spinner {
  position: relative;
  width: 96px;
  height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.spinner-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--blue);
  border-right-color: var(--blue-light);
  animation: spin 1s linear infinite;
}

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

.spinner-icon {
  font-size: 2.2rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {

  0%,
  100% {
    transform: scale(1);
    opacity: 1;
  }

  50% {
    transform: scale(1.2);
    opacity: 0.7;
  }
}

.loading-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: #3a8cff;
}

/* 进度条 */
.loading-progress-bar {
  width: 100%;
  max-width: 280px;
  height: 6px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 3px;
  overflow: hidden;
}

.loading-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--blue), var(--blue-light));
  border-radius: 3px;
  transition: width 0.1s linear;
}

/* 切换文案 */
.loading-copy {
  font-size: 0.9rem;
  color: #5a6b7c;
  min-height: 1.4em;
  text-align: center;
  transition: opacity 0.3s;
}

/* ---------- 结果页 ---------- */
.result-container {
  display: flex;
  flex-direction: column;
  gap: var(--gap);
  padding-bottom: 40px;
}

.section-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 12px;
  color: #1a2634;
}

/* 区块1：身份头部 */
.result-hero {
  padding: 32px 24px;
  text-align: center;
}

.result-brand {
  font-size: 0.75rem;
  color: #5a6b7c;
  letter-spacing: 1px;
}

.hero-icon {
  font-size: 4rem;
  margin: 16px 0 8px;
}

.hero-name {
  font-size: 1.8rem;
  font-weight: 800;
  color: #1a2634;
}

.hero-slogan {
  font-size: 1rem;
  color: #5a6b7c;
  font-style: italic;
  margin-top: 6px;
}

/* 区块2：标签 */
.result-tags {
  padding: 20px 24px;
  display: flex;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.tag-item {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(255, 255, 255, 0.4);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  color: #3a8cff;
}

.tag-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* 区块3：雷达图 */
.result-radar {
  padding: 24px;
  text-align: center;
}

.radar-wrapper {
  max-width: 320px;
  margin: 0 auto;
}

.radar-wrapper canvas {
  width: 100%;
  height: auto;
}

.radar-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 16px;
  margin-top: 12px;
  font-size: 0.75rem;
  color: #5a6b7c;
}

.radar-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.radar-legend .legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.radar-legend .legend-dot.highlight {
  width: 10px;
  height: 10px;
  box-shadow: 0 0 6px currentColor;
}

/* 区块4：适合专业 */
.result-majors {
  padding: 24px;
}

.major-card {
  padding: 18px 20px;
  margin-bottom: 12px;
}

.major-card:last-child {
  margin-bottom: 0;
}

.major-name-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.major-name {
  font-size: 1.05rem;
  font-weight: 700;
}

.major-heat {
  font-size: 0.85rem;
  letter-spacing: 1px;
}

.major-schools {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.85rem;
  color: #5a6b7c;
}

.school-tier {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.school-tier .tier-label {
  font-weight: 600;
  flex-shrink: 0;
}

/* 区块5：AI时代提醒 */
.result-ai-warning {
  padding: 24px;
}

.result-ai-warning .section-title {
  font-size: 0.95rem;
  color: #c47a2a;
}

#ai-warning-text {
  font-size: 0.9rem;
  color: #5a6b7c;
  line-height: 1.7;
}

/* 区块6：隐藏潜力 */
.result-hidden {
  padding: 24px;
  text-align: center;
}

.hidden-name {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 4px 0;
}

.hidden-desc {
  font-size: 0.9rem;
  color: #5a6b7c;
  margin-bottom: 12px;
}

.btn-unlock {
  display: inline-block;
  padding: 10px 32px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--blue);
  background: rgba(58, 140, 255, 0.1);
  border: 1.5px solid var(--blue);
  border-radius: var(--radius-btn);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-unlock:active {
  background: rgba(58, 140, 255, 0.2);
  transform: scale(0.96);
}

/* 区块7：分享与行动 */
.result-actions {
  padding: 24px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.share-hint {
  font-size: 0.9rem;
  color: #5a6b7c;
}

.btn-text-link {
  background: none;
  border: none;
  color: #5a6b7c;
  font-size: 0.85rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 4px 0;
}

/* ---------- 弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.modal-overlay.show {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  width: calc(100% - 48px);
  max-width: 400px;
  max-height: 85vh;
  overflow-y: auto;
  padding: 28px 24px;
  position: relative;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.modal-overlay.show .modal-card {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 1.6rem;
  color: #5a6b7c;
  cursor: pointer;
  line-height: 1;
}

.modal-icon {
  font-size: 3rem;
  margin-bottom: 8px;
}

.modal-name {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 20px;
  color: #1a2634;
}

.modal-section {
  text-align: left;
  margin-bottom: 16px;
}

.modal-section h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #1a2634;
  margin-bottom: 4px;
}

.modal-section p {
  font-size: 0.9rem;
  color: #3d4f5f;
  line-height: 1.6;
}

.modal-directions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.modal-directions .dir-tag {
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1a2634;
  background: rgba(58, 140, 255, 0.1);
  border-radius: 20px;
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2634;
  color: #fff;
  padding: 12px 28px;
  border-radius: 30px;
  font-size: 0.9rem;
  z-index: 200;
  opacity: 0;
  transition: all 0.35s ease;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================================================
   响应式：平板及以上
   ============================================================ */
@media (min-width: 600px) {
  html {
    font-size: 17px;
  }

  .page {
    padding: 28px;
  }

  .brand-title {
    font-size: 2.6rem;
  }

  .hero-icon {
    font-size: 5rem;
  }

  .hero-name {
    font-size: 2rem;
  }
}

@media (min-width: 900px) {
  html {
    font-size: 18px;
  }

  .page {
    max-width: 520px;
  }
}