/* ==========================================================================
   全局基础重置与原版排版质感
   ========================================================================== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  background-color: #FAF9F6;
  color: #2D3748;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Helvetica Neue", Arial, sans-serif;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

/* 弥散柔光背景（4 重径向光晕 + 14s 呼吸缓动） */
.ambient-glow {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 0;
  pointer-events: none;
  background: 
    radial-gradient(circle at 85% 15%, rgba(255, 142, 128, 0.25) 0%, transparent 45%),
    radial-gradient(circle at 15% 40%, rgba(140, 122, 230, 0.18) 0%, transparent 50%),
    radial-gradient(circle at 80% 85%, rgba(255, 142, 128, 0.22) 0%, transparent 55%),
    radial-gradient(circle at 30% 90%, rgba(140, 122, 230, 0.16) 0%, transparent 45%);
  animation: ambientFloat 14s ease-in-out infinite alternate;
}

@keyframes ambientFloat {
  0% { transform: scale(1) translateY(0); }
  100% { transform: scale(1.08) translateY(-20px); }
}

.app-wrapper {
  width: 100%;
  max-width: 420px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding: 20px 18px;
  position: relative;
  z-index: 1;
}

.view-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
}

/* 磨砂玻璃质感 */
.glass-card {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1.2px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 10px 30px rgba(255, 142, 128, 0.08), 0 2px 10px rgba(0, 0, 0, 0.02);
}

/* 胶囊按钮体系 */
.capsule-btn {
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  line-height: 1.2;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  outline: none;
  box-sizing: border-box;
}
.capsule-btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: linear-gradient(135deg, #FF758C 0%, #FF527B 50%, #E11D48 100%);
  color: #FFFFFF !important;
  box-shadow: 0 8px 20px rgba(225, 29, 72, 0.26), inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.88);
  color: #475569 !important;
  border: 1px solid rgba(203, 213, 225, 0.7) !important;
  box-shadow: 0 4px 12px rgba(140, 122, 230, 0.06);
}
.btn-secondary:active {
  background: #F8FAFC !important;
}

.portal-btn-fit {
  width: fit-content;
  min-width: 154px;
  margin: 0 auto;
}
#portal-view .btn-secondary {
  background: linear-gradient(135deg, #A78BFA 0%, #8C7AE6 100%) !important;
  color: #FFFFFF !important;
  border: none !important;
  box-shadow: 0 8px 20px rgba(140, 122, 230, 0.28) !important;
}

/* 顶部导航：左上角对齐 */
.top-nav-bar { 
  width: 100%;
  margin-bottom: 14px; 
  display: flex;
  justify-content: flex-start;
  align-items: center;
}
.back-link-btn {
  background: none;
  border: none;
  color: #64748B;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 0;
  display: inline-flex;
  align-items: center;
}

/* ==========================================================================
   状态 1：双门户首页（带微标排版）
   ========================================================================== */
.portal-center-wrap {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 22px;
  flex: 1;
  padding-bottom: 36px;
}
.portal-card {
  border-radius: 26px;
  padding: 28px 20px 26px 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.card-heading-center {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 10px;
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.portal-star {
  width: 15px;
  height: 15px;
}

/* 双门户卡片精致微标（关系测评 / PPT） */
.portal-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.8px;
  padding: 3px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.portal-badge.badge-rose {
  background: #FFE4E6;
  color: #E11D48;
  border: 1px solid #FECDD3;
}
.portal-badge.badge-purple {
  background: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

/* ==========================================================================
   状态 2：测算前导介绍页（中轴强对称）
   ========================================================================== */
#intro-view {
  align-items: center;
  justify-content: space-between;
}

.intro-top-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.intro-symbol-wrap {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 6px auto 14px auto;
  filter: drop-shadow(0 8px 18px rgba(255, 142, 128, 0.18));
}
.duality-symbol-svg { width: 100%; height: 100%; display: block; }

.intro-hero-title {
  font-size: 23px;
  font-weight: 900;
  color: #0F172A;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 0 0 10px 0;
  text-align: center;
}

.star-icon-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
}
.blue-star-svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 4px rgba(79, 70, 229, 0.25));
}

.intro-sub-category {
  font-size: 13.5px;
  font-weight: 700;
  color: #64748B;
  letter-spacing: 1.8px;
  margin-bottom: 22px;
  text-align: center;
}

.intro-dual-explain-box {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 20px;
}

.explain-item-card {
  border-radius: 20px;
  padding: 16px 18px;
  text-align: left;
}

/* 卡片内标题水平居中 */
.explain-card-title {
  font-size: 15px;
  font-weight: 800;
  color: #0F172A;
  margin-bottom: 8px;
  letter-spacing: 0.3px;
}
.explain-card-title.text-center {
  text-align: center;
}

.explain-card-desc {
  font-size: 13px;
  color: #475569;
  line-height: 1.65;
}

.intro-param-pill {
  font-size: 12.5px;
  color: #94A3B8;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
}

.intro-action-wrap {
  width: 100%;
  max-width: 340px;
  margin-top: auto;
  padding: 16px 0 10px 0;
}

/* 状态 3：PPT 画册 */
.ppt-header-box { margin-bottom: 16px; text-align: center; }
.ppt-title { font-size: 20px; font-weight: 800; color: #0F172A; }
.ppt-sub { font-size: 12px; color: #64748B; margin-top: 4px; }
.ppt-waterfall-list { display: flex; flex-direction: column; gap: 14px; padding-bottom: 40px; }
.ppt-slide-img { width: 100%; height: auto; border-radius: 16px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06); display: block; }

/* 状态 4：答题流程 */
.progress-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(226, 232, 240, 0.7);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 12px;
}
.progress-inner {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, #FF8E80, #E11D48);
  border-radius: 999px;
  transition: width 0.2s ease;
}
.step-indicator { font-size: 13px; font-weight: 800; color: #94A3B8; margin-bottom: 10px; }
.question-box h2 { font-size: 18px; line-height: 1.45; margin-bottom: 22px; color: #0F172A; }
.options-group { display: flex; flex-direction: column; gap: 12px; margin-bottom: 24px; }
.option-item {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1.2px solid rgba(255, 255, 255, 0.9);
  border-radius: 30px;
  padding: 13px 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,0.02);
  transition: all 0.2s ease;
}
.option-item:active { transform: translateY(-1px); }
.option-item.selected {
  border-color: #FF758C;
  background: rgba(255, 241, 242, 0.92);
  box-shadow: 0 0 20px rgba(255, 117, 140, 0.35);
}
.opt-badge {
  width: 26px; height: 26px; min-width: 26px;
  background: rgba(241, 245, 249, 0.9);
  color: #64748B;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 12px; margin-right: 12px;
  transition: all 0.2s ease;
}
.option-item.selected .opt-badge { background: #E11D48; color: #FFFFFF; }
.opt-text { flex: 1; font-size: 14px; line-height: 1.45; color: #334155; }
.quiz-nav-bar {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  padding: 12px 0 16px 0;
}
.nav-capsule-btn {
  background: rgba(255, 255, 255, 0.85);
  border: 1px solid rgba(203, 213, 225, 0.8);
  color: #475569;
  padding: 10px 24px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: bold;
  cursor: pointer;
  transition: all 0.15s ease;
}
.nav-capsule-btn:active:not(:disabled) { background: #F8FAFC; transform: scale(0.97); }
.nav-capsule-btn:disabled {
  background: rgba(248, 250, 252, 0.5);
  border-color: rgba(226, 232, 240, 0.5);
  color: #CBD5E1;
  cursor: not-allowed;
}

/* 状态 5：加载 */
#loading-view { justify-content: center; align-items: center; text-align: center; }
.spinner {
  width: 42px; height: 42px;
  border: 4px solid rgba(226, 232, 240, 0.8);
  border-top-color: #E11D48;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 130px auto 0 auto;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-tip { margin-top: 16px; color: #64748B; font-size: 13px; text-align: center; }

/* ==========================================================================
   状态 6：最终结果页样式
   ========================================================================== */
#result-view {
  padding-bottom: 30px;
}

#report-capture-area {
  width: 100%;
}

.top-portrait-header {
  font-size: 20px;
  font-weight: 800;
  color: #0F172A;
  margin: 6px 0 20px 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
}
.heart-symbol {
  color: #E11D48;
  font-size: 19px;
}

.result-block-card {
  border-radius: 24px;
  padding: 24px 20px;
  margin-bottom: 20px;
}

.card-hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  margin-bottom: 12px;
}
.block-icon-large {
  font-size: 24px;
  line-height: 1;
  margin-bottom: 6px;
}
.block-icon-large.rose-color {
  color: #E11D48;
}
.block-icon-large.purple-color {
  color: #8C7AE6;
}
.card-hero-title {
  font-size: 19px;
  font-weight: 800;
  color: #0F172A;
  letter-spacing: 0.5px;
}

.card-tags-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.hero-tag-badge {
  padding: 5px 16px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: 0.3px;
}
.hero-tag-badge.rose {
  background: #FFE4E6;
  color: #E11D48;
  border: 1px solid #FECDD3;
}
.hero-tag-badge.purple {
  background: #EDE9FE;
  color: #6D28D9;
  border: 1px solid #DDD6FE;
}

.block-sub-hint {
  font-size: 12.5px;
  color: #64748B;
  line-height: 1.55;
  margin-bottom: 14px;
}
.text-center {
  text-align: center;
}

/* 横轴刻度尺组件样式 */
.chart-scale-container {
  width: 100%;
  margin-bottom: 8px;
  padding-left: 56px;  /* 避开左侧 44px 维度名 + 12px 间隙 */
  padding-right: 38px; /* 避开右侧 26px 百分比 + 12px 间隙 */
  box-sizing: border-box;
}

.chart-scale-ruler {
  width: 100%;
  position: relative;
  height: 28px;
}

.ruler-axis-line {
  position: relative;
  width: 100%;
  height: 1px;
  background: #CBD5E1;
  top: 18px;
}

.ruler-tick-item {
  position: absolute;
  top: 0;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.tick-mark {
  width: 1px;
  height: 5px;
  background: #94A3B8;
  margin-top: 13px;
}

.tick-label {
  font-size: 11px;
  color: #64748B;
  font-weight: 600;
  position: absolute;
  top: -15px;
  white-space: nowrap;
}

.tick-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 999px;
  position: absolute;
  top: -18px;
  white-space: nowrap;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}
.tick-badge.badge-rose {
  background: linear-gradient(135deg, #FF758C, #E11D48);
  color: #FFFFFF;
}
.tick-badge.badge-purple {
  background: linear-gradient(135deg, #A78BFA, #8C7AE6);
  color: #FFFFFF;
}

/* 进度条组 */
.block-bar-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}
.bar-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bar-label {
  font-size: 13px;
  width: 44px;
  color: #334155;
  font-weight: 700;
  flex-shrink: 0;
}
.bar-track {
  flex: 1;
  height: 8px;
  background: rgba(226, 232, 240, 0.7);
  border-radius: 999px;
  overflow: hidden;
}
#wanted-bars .bar-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #FF758C, #E11D48);
}
#given-bars .bar-inner {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #A78BFA, #8C7AE6);
}
.bar-val {
  font-size: 12.5px;
  width: 40px;
  text-align: right;
  color: #64748B;
  font-weight: 700;
  flex-shrink: 0;
}

/* 画像解读多自然段独立排版 */
.result-conclusion-box {
  border-top: 1px dashed rgba(226, 232, 240, 0.85);
  padding-top: 18px;
}
.conclusion-badge {
  font-size: 12px;
  color: #94A3B8;
  font-weight: 700;
  margin-bottom: 10px;
  letter-spacing: 0.5px;
}

.portrait-content-box {
  display: flex;
  flex-direction: column;
}

.portrait-oneliner {
  font-size: 14.5px;
  font-weight: 800;
  color: #1E293B;
  line-height: 1.55;
  margin-bottom: 11px;
  letter-spacing: 0.2px;
}

.portrait-paragraph {
  font-size: 13.5px;
  color: #475569;
  line-height: 1.72;
  margin-bottom: 11px;
}
.portrait-paragraph:last-child {
  margin-bottom: 0;
}

/* 底部操作按钮体系 */
.result-action-dock {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  padding-bottom: 24px;
}
.full-dock-btn {
  width: 100%;
  min-height: 48px;
  font-size: 15.5px;
}
.action-sub-row {
  display: flex;
  gap: 12px;
  width: 100%;
}
.sub-dock-btn {
  flex: 1;
  min-height: 44px;
  font-size: 14px;
}

/* 弹窗通用体系 */
.modal-mask {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.48);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.modal-card {
  border-radius: 26px;
  padding: 24px 20px;
  max-width: 330px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: popIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes popIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.centered-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 18px;
}
.centered-header .modal-title {
  font-size: 18px;
  font-weight: 800;
  color: #0F172A;
  text-align: center;
  width: 100%;
}
.abs-close {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 22px;
  color: #94A3B8;
  cursor: pointer;
  padding: 0 4px;
}

.input-wrap { position: relative; margin-bottom: 6px; }
.input-wrap input {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #FF758C;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 999px;
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  text-align: center;
  color: #0F172A;
}
.input-wrap input:focus {
  border-color: #E11D48;
  box-shadow: 0 0 12px rgba(255, 117, 140, 0.3);
}
.error-msg { color: #EF4444; font-size: 12px; margin-bottom: 6px; text-align: center; }
.auth-helper-link {
  font-size: 12px;
  color: #8C7AE6;
  text-align: center;
  margin: 10px 0 18px 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  opacity: 0.9;
  font-weight: 600;
}

.qr-card, .poster-card {
  position: relative !important;
  max-width: 290px;
  padding: 24px 20px !important;
}
.qr-abs-close {
  position: absolute !important;
  top: 14px !important;
  right: 14px !important;
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  font-size: 24px;
  color: #94A3B8;
  cursor: pointer;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}
.qr-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 12px;
}
#shop-qr-img {
  width: 180px;
  height: 180px;
  border-radius: 14px;
  background: #FFFFFF;
  padding: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}
.qr-tip {
  font-size: 12px;
  color: #64748B;
  margin-top: 14px;
  line-height: 1.5;
  font-weight: 600;
}

.poster-tip {
  font-size: 13px;
  color: #64748B;
  margin-bottom: 12px;
  font-weight: 700;
}
.poster-img-wrap {
  max-height: 65vh;
  overflow-y: auto;
  border-radius: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,0.1);
}
#final-poster-img {
  width: 100%;
  display: block;
}
/* ==========================================================================
   PPT 画册瀑布流及底部下载区域样式
   ========================================================================== */
.ppt-header-box { 
  margin-bottom: 16px; 
  text-align: center; 
}
.ppt-title { 
  font-size: 20px; 
  font-weight: 800; 
  color: #0F172A; 
}
.ppt-sub { 
  font-size: 12.5px; 
  color: #64748B; 
  margin-top: 4px; 
}
.ppt-waterfall-list { 
  display: flex; 
  flex-direction: column; 
  gap: 16px; 
  padding-bottom: 20px; 
}
.ppt-slide-img { 
  width: 100%; 
  height: auto; 
  border-radius: 18px; 
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06); 
  display: block; 
}

/* PPT 底部下载固定卡槽 */
.ppt-download-dock {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 0 34px 0;
  gap: 10px;
}
.ppt-download-hint {
  font-size: 12px;
  color: #94A3B8;
  line-height: 1.5;
  text-align: center;
  padding: 0 10px;
  letter-spacing: 0.3px;
}