/* ========================================
   DISC性格测试 H5 — 全局样式
   配色：淡蓝淡绿，简洁大方
   rpx换算：1rpx ≈ 0.5px（基于375px宽度）
   ======================================== */

/* ----- 重置 & 基础 ----- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial,
    sans-serif;
  font-size: 14px;
  color: #333;
  background-color: #F8F6F3;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  height: 100%;
  overflow: hidden;
}

/* ----- 页面容器（SPA多屏） ----- */
.app-container {
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  height: 100vh;
  height: 100dvh;
  position: relative;
  overflow: hidden;
  background: #F8F6F3;
}

.page {
  display: none;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

.page.active {
  display: flex;
}

/* ----- 导航栏 ----- */
.nav-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: #3B5998;
  color: #fff;
  font-size: 17px;
  font-weight: 600;
  position: relative;
  padding: 0 16px;
}

.nav-bar .nav-back {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #fff;
  background: none;
  border: none;
}

/* ----- 安全区底部 ----- */
.safe-bottom {
  padding-bottom: constant(safe-area-inset-bottom);
  padding-bottom: env(safe-area-inset-bottom);
}

/* ========================================
   首页 (index)
   ======================================== */
#page-index .page-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.intro-images {
  display: flex;
  flex-direction: column;
}

.intro-img {
  width: 100%;
  display: block;
}

.btn-area {
  width: 100%;
  padding: 15px 30px;
  display: flex;
  justify-content: center;
  flex-shrink: 0;
}

.btn-row {
  display: flex;
  width: 100%;
  gap: 12px;
}

.btn-row .btn-retake,
.btn-row .btn-view {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border-radius: 22px;
  font-size: 16px;
  font-weight: bold;
  border: none;
  cursor: pointer;
  color: #fff;
}

.btn-start {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #2979FF, #2979FF);
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-start:active,
.btn-retake:active,
.btn-view:active {
  opacity: 0.85;
}

.btn-retake {
  background: #8899AA;
}

.btn-view {
  background: linear-gradient(135deg, #2979FF, #2979FF);
}

/* ========================================
   测前提示页 (pre-test)
   ======================================== */
#page-pre-test .page-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow-y: auto;
}

.notice-area {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 10px;
}

.notice-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
}

.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #2979FF, #2979FF);
  color: #fff;
  font-size: 18px;
  font-weight: bold;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  white-space: nowrap;
}

.btn-primary:active {
  opacity: 0.85;
}

/* ========================================
   答题页 (quiz)
   ======================================== */
#page-quiz {
  background: #f8f9fb;
}

/* 进度条 */
.progress-bar-wrap {
  flex-shrink: 0;
  padding: 10px 15px 8px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0,0,0,0.03);
}

.progress-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.progress-text {
  font-size: 14px;
  color: #888;
}

.progress-num {
  font-size: 19px;
  font-weight: bold;
  color: #5B7FC0;
}

.progress-bar {
  width: 100%;
  height: 4px;
  background: #E8ECF2;
  border-radius: 2px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #87CEEB, #2979FF);
  border-radius: 2px;
  transition: width 0.3s ease;
}

/* 题目列表 */
.question-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 5px 10px 60px;
}

/* 题目卡片 */
.question-card {
  margin: 8px 0;
  padding: 16px 14px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
}

.question-header {
  display: flex;
  align-items: flex-start;
  margin-bottom: 14px;
}

.q-number {
  font-size: 17px;
  font-weight: bold;
  color: #333;
  margin-right: 6px;
  flex-shrink: 0;
  line-height: 1.6;
}

.q-text {
  font-size: 17px;
  color: #333;
  line-height: 1.6;
  font-weight: bold;
}

/* 选项 */
.options-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.option-item {
  display: flex;
  align-items: flex-start;
  padding: 11px 10px;
  border-radius: 6px;
  background: #F8F9FB;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.option-item:active {
  background: #EBF0F8;
}

.option-item.selected {
  background: #EBF0F8;
  border-color: #2979FF;
}

.option-dot {
  font-size: 16px;
  font-weight: bold;
  color: #888;
  margin-right: 7px;
  flex-shrink: 0;
  line-height: 1.6;
}

.option-item.selected .option-dot {
  color: #2979FF;
}

.option-text {
  font-size: 16px;
  color: #444;
  line-height: 1.6;
  flex: 1;
}

.option-item.selected .option-text {
  color: #2979FF;
}

/* 底部提示 */
.bottom-tip {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 15px 0;
}

.tip-text {
  font-size: 13px;
  color: #ccc;
}

/* ========================================
   结果报告页 (result)
   ======================================== */
#page-result {
  background: #F5F7FA;
}

.report-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 15px;
}

/* 标题 */
.report-title {
  text-align: center;
  font-size: 20px;
  font-weight: bold;
  color: #2c3e50;
  padding: 18px 0 8px;
  letter-spacing: 1px;
}

/* 图表容器 */
.chart-container {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 10px 0;
  width: 100%;
  overflow: hidden;
}

.disc-canvas {
  width: 100%;
  height: 260px;
}

/* 双高组合 */
.combo-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 10px 0 0;
  padding: 12px;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 1px 7px rgba(0,0,0,0.04);
}

.combo-name {
  font-size: 17px;
  font-weight: bold;
  color: #5B7FC0;
}

.combo-desc {
  font-size: 13px;
  color: #777;
  margin-top: 4px;
  text-align: center;
  line-height: 1.5;
}

/* 代表人物卡片 */
.representative-card {
  margin: 5px 0;
  padding: 8px 10px;
  background: radial-gradient(circle at center, #4a7db8 10%, #2d4373 100%);
  border-radius: 9px;
  box-shadow: 0 1px 7px rgba(0,0,0,0.04);
  text-align: center;
}

.representative-card .card-text {
  color: #ffffff;
  font-size: 15px;
}

/* 信息卡片 */
.info-card {
  margin: 5px 0;
  padding: 10px;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 1px 7px rgba(0,0,0,0.04);
}

/* 渐变间隔带 */
.gradient-divider {
  display: block;
  margin: 8px 0;
  padding: 8px 0;
  background: linear-gradient(to right, #3a6ba0 10%, #5b8fc9 40%, #8aadd5 80%, #b0cce5);
  border-radius: 5px;
}

.card-title {
  font-size: 15px;
  font-weight: bold;
  color: #2c3e50;
  margin-bottom: 9px;
  padding-bottom: 7px;
  border-bottom: 1px solid #E8EDF2;
}

.card-text {
  font-size: 16px;
  color: #444;
  line-height: 1.5;
}

.card-text.desc {
  font-size: 17px;
  line-height: 2.0;
  text-align: justify;
  white-space: pre-wrap;
}

/* 公司宣传区域 */
.company-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 5px 0;
  padding: 15px;
  background: #fff;
  border-radius: 9px;
  box-shadow: 0 1px 7px rgba(0,0,0,0.04);
}

.company-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  margin-bottom: 10px;
}

.company-section {
  width: 100%;
  margin-bottom: 12px;
}

.company-section:last-child {
  margin-bottom: 0;
}

.company-title {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #2d4373;
  font-weight: bold;
  font-size: 18px;
  letter-spacing: 2px;
  margin-bottom: 6px;
}

.company-title::before,
.company-title::after {
  content: "";
  width: 20px;
  height: 3px;
  background: #2d4373;
  border-radius: 2px;
  flex-shrink: 0;
}

.company-title .title-text {
  margin: 0 10px;
  white-space: nowrap;
}

.company-text {
  text-align: center;
  color: #444;
  font-size: 16px;
  line-height: 1.5;
}

.company-desc {
  text-align: justify;
  line-height: 2.0;
  font-size: 17px;
  padding: 0 5px;
}

/* 底部按钮栏 */
.bottom-bar {
  flex-shrink: 0;
  padding: 10px 15px;
  background: #fff;
}

.btn-download {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 44px;
  background: linear-gradient(135deg, #2979FF, #2979FF);
  color: #fff;
  font-size: 18px;
  border-radius: 22px;
  border: none;
  cursor: pointer;
  font-weight: bold;
}

.btn-download:active {
  opacity: 0.85;
}

/* 隐藏canvas（用于导出） */
.export-canvas {
  position: fixed;
  left: -9999px;
  top: -9999px;
}

/* ========================================
   Toast提示
   ======================================== */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0, 0, 0, 0.75);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  z-index: 9999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
}

/* ========================================
   响应式：大屏居中
   ======================================== */
@media (min-width: 481px) {
  body {
    background: #e8ecf2;
  }
  .app-container {
    box-shadow: 0 0 30px rgba(0,0,0,0.1);
    border-radius: 0;
  }
}
