/* ============================================================
   MYTH ATLAS · 样式
   配色（紫微星宫神话主题）：月白淡紫（答题）+ 星空紫金（结果卡）
   金边 #e8c87a + 仙气紫 #b69ae8 + 深紫夜 #171232/#2b2350
   ============================================================ */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #171326;
  color: #2c2c2a;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 480px; margin: 0 auto; min-height: 100vh; background: #f1ecf7; }
.screen { min-height: 100vh; }

/* ---------------- 首屏密码门 ---------------- */
.gate-screen {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(120% 80% at 50% 0%, #2b2350 0%, #171232 60%);
  padding: 28px 22px;
}
.gate-inner { width: 100%; max-width: 360px; text-align: center; color: #f3ecd8; }
.gate-brand { font-size: 13px; letter-spacing: 3px; color: #e8c87a; font-weight: 600; }
.gate-title { font-size: 26px; font-weight: 700; margin-top: 14px; letter-spacing: 2px; }
.gate-desc { font-size: 13px; color: rgba(243,236,216,.65); line-height: 1.7; margin-top: 12px; }
.gate-box {
  margin: 28px 0 18px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(232,200,122,.22); border-radius: 16px; padding: 22px 18px;
}
.gate-label { display: block; font-size: 12px; color: rgba(232,200,122,.8); text-align: left; margin-bottom: 10px; }
.gate-input {
  width: 100%; box-sizing: border-box; text-align: center; letter-spacing: 2px;
  background: #15141f; color: #f3ecd8; border: 1px solid rgba(232,200,122,.35);
  border-radius: 10px; padding: 13px 12px; font-size: 17px; outline: none;
}
.gate-input::placeholder { color: rgba(243,236,216,.3); letter-spacing: 1px; }
.gate-input:focus { border-color: #e8c87a; }
.gate-btn {
  width: 100%; margin-top: 14px; background: linear-gradient(90deg,#caa55a,#e8c87a);
  color: #171232; border: none; border-radius: 10px; padding: 14px; font-size: 16px; font-weight: 700;
  cursor: pointer; letter-spacing: 2px;
}
.gate-btn:active { transform: scale(.98); }
.gate-err {
  display: none; margin-top: 12px; font-size: 12px; color: #ff9a7a; line-height: 1.5;
}
.gate-note { font-size: 11px; color: rgba(243,236,216,.45); line-height: 1.7; }

/* ---------------- 答题阶段 ---------------- */
#quiz { padding: 18px 18px 40px; }
.topbar { display: flex; flex-direction: column; gap: 10px; }
.brand { font-size: 13px; letter-spacing: 2px; color: #8a6d3b; font-weight: 600; }
.progress-wrap { width: 100%; }
.progress-label { font-size: 12px; color: #9a8f7a; margin-bottom: 5px; }
.progress-track { height: 6px; background: #e4dcf0; border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; background: linear-gradient(90deg,#caa55a,#e8c87a); border-radius: 99px; transition: width .35s ease; }

.sampler { margin: 22px 0 14px; font-size: 13px; color: #6f6450; text-align: center; }
.sampler b { color: #b5894a; }

.qcard {
  background: #fbf9ff; border: 1px solid #e7e0f0; border-radius: 16px;
  padding: 20px 18px; box-shadow: 0 6px 22px rgba(120,100,60,.08);
}
.qmeta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.qtag { font-size: 12px; color: #b5894a; background: #f7eed9; padding: 3px 10px; border-radius: 99px; }
.qbadge { font-size: 10px; letter-spacing: 1px; color: #fff; background: #241f4a; padding: 3px 8px; border-radius: 6px; }
.qcount { font-size: 11px; color: #a99c84; margin-left: auto; }
.qtext { font-size: 17px; line-height: 1.6; font-weight: 500; color: #2c2c2a; margin-bottom: 18px; }

.opts { display: flex; flex-direction: column; gap: 11px; }
.opt {
  display: flex; align-items: center; gap: 12px; text-align: left;
  background: #f6f2fd; border: 1px solid #e7e0f0; border-radius: 12px;
  padding: 14px 14px; cursor: pointer; transition: .15s; font-size: 15px; color: #3a352b;
}
.opt:active { transform: scale(.98); }
.opt:hover { border-color: #d9b86a; background: #f1ebff; }
.opt-key {
  flex: 0 0 26px; height: 26px; border-radius: 50%; background: #241f4a; color: #e8c87a;
  display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600;
}
.opt-txt { flex: 1; line-height: 1.45; }

.qfoot { display: flex; align-items: center; justify-content: space-between; margin-top: 18px; gap: 12px; }
.ghost-btn { background: none; border: 1px solid #d8cdb6; color: #8a7c60; border-radius: 10px; padding: 9px 16px; font-size: 13px; cursor: pointer; }
.hint { font-size: 11px; color: #b3a890; text-align: right; flex: 1; }

/* ---------------- 结果阶段 ---------------- */
#result { background: #f1ecf7; padding: 0 0 40px; }
.result-inner { padding: 16px 14px; }

/* 分享卡（深色墨夜金） */
.share-card {
  background: radial-gradient(120% 80% at 50% 0%, #2b2350 0%, #171232 60%);
  border: 1px solid rgba(232,200,122,.25); border-radius: 18px;
  padding: 22px 20px 18px; color: #f3ecd8; box-shadow: 0 10px 30px rgba(20,16,40,.35);
  overflow: hidden; position: relative; width: 100%; box-sizing: border-box;
}
.sc-head { text-align: center; }
.sc-brand { font-size: 18px; letter-spacing: 4px; color: #e8c87a; font-weight: 600; }
.sc-sub { font-size: 10px; letter-spacing: 1px; color: rgba(232,200,122,.6); margin-top: 4px; }
.sc-tags { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 6px; }
.pill { font-size: 11px; color: #e8c87a; border: 1px solid rgba(232,200,122,.4); padding: 3px 10px; border-radius: 99px; }
.pill.hl { background: #e8c87a; color: #171232; border-color: #e8c87a; font-weight: 600; }
.sc-name { text-align: center; font-size: 40px; font-weight: 700; color: #fff; margin-top: 8px; letter-spacing: 3px; }
.sc-era { text-align: center; font-size: 12px; color: rgba(243,236,216,.6); margin-top: 4px; }
.sc-quote { text-align: center; font-size: 14px; color: #b69ae8; margin: 14px 0 12px; font-style: italic; }
.sc-pills2 { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.tag { font-size: 12px; background: rgba(182,154,232,.15); color: #9fe0c4; border: 1px solid rgba(182,154,232,.35); padding: 4px 12px; border-radius: 99px; }
.sc-match { text-align: center; font-size: 12px; color: rgba(243,236,216,.7); margin-top: 14px; }
.sc-match b { color: #e8c87a; font-size: 15px; }
.sc-radar { width: 240px; height: 240px; margin: 10px auto 4px; }
.sc-foot { text-align: center; font-size: 10px; color: rgba(243,236,216,.4); margin-top: 6px; }

/* 截图专用：html2canvas 渲染兼容性覆盖（屏幕显示不受影响） */
.share-card.cap {
  overflow: hidden;
  box-shadow: none;
  background: linear-gradient(180deg, #2b2350 0%, #1a1638 55%, #171232 100%);
  max-width: 376px;           /* 固定宽度，防止画布被父容器撑大 */
  margin: 0 auto;             /* 居中（不影响截图，但保布局稳定） */
  box-sizing: border-box;
}
.share-card.cap .sc-brand,
.share-card.cap .sc-name { letter-spacing: 0; }
.share-card.cap .sc-tags,
.share-card.cap .sc-pills2 { gap: 0; }
.share-card.cap .sc-tags > *,
.share-card.cap .sc-pills2 > * { margin: 3px 4px; }
.share-card.cap .sc-quote { margin: 14px 4px 12px; }

/* 报告正文 */
.report { margin-top: 16px; background: #fbf9ff; border: 1px solid #e7e0f0; border-radius: 16px; padding: 6px 16px 20px; }
.sec { font-size: 16px; color: #241f4a; margin: 22px 0 10px; font-weight: 600; }
.sec.warn { color: #b5582f; }
.sec-note { font-size: 12px; color: #9a8f7a; margin: -4px 0 12px; }
.note-list { list-style: none; margin: 4px 0 0; padding: 0; }
.note-list li { position: relative; padding: 9px 0 9px 16px; font-size: 13px; line-height: 1.7; color: #3a3450; border-top: 1px dashed #e7e0f0; }
.note-list li:first-child { border-top: none; }
.note-list li::before { content: "·"; position: absolute; left: 2px; top: 9px; color: #b69ae8; font-weight: 800; font-size: 16px; }
.note-list li b { color: #241f4a; }
.report p { font-size: 14px; line-height: 1.75; color: #44403a; margin: 0 0 4px; }
.report .dyn { font-size: 12px; color: #b5894a; margin-top: 10px; }

/* 卷宗摘要 */
.sum-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 18px; }
.sum-item { background: #f6f2fd; border: 1px solid #e7e0f0; border-radius: 12px; padding: 12px; }
.sum-item.hl { border-color: #d9b86a; background: #f1ebff; }
.sum-k { font-size: 11px; color: #a99c84; }
.sum-v { font-size: 15px; color: #241f4a; font-weight: 600; margin: 4px 0 3px; }
.sum-n { font-size: 11px; color: #b3a890; line-height: 1.5; }

/* 生平简介 */
.bio-name { font-size: 15px; font-weight: 600; color: #241f4a; margin-top: 18px; }
.bio-txt { font-size: 13px; line-height: 1.7; color: #55504a; margin-top: 6px; }
.bio-meta { font-size: 10px; color: #b3a890; margin-top: 8px; }

/* 能力结构 */
.struct-radar { width: 260px; height: 260px; margin: 6px auto 14px; }
.dim-cards { display: flex; flex-direction: column; gap: 10px; }
.dc { background: #f6f2fd; border: 1px solid #e7e0f0; border-radius: 12px; padding: 12px; }
.dc.weak { border-color: #d98a5a; background: #fdf1ea; }
.dc-top { display: flex; justify-content: space-between; align-items: center; }
.dc-name { font-size: 14px; color: #241f4a; font-weight: 600; }
.dc-val { font-size: 15px; color: #b5894a; font-weight: 600; }
.dc-track { height: 7px; background: #e7e0f0; border-radius: 99px; overflow: hidden; margin: 8px 0; }
.dc-bar { height: 100%; background: linear-gradient(90deg,#b69ae8,#9d7fe0); border-radius: 99px; }
.dc.weak .dc-bar { background: linear-gradient(90deg,#e0966a,#d9794a); }
.dc-desc { font-size: 12px; color: #8a8070; line-height: 1.5; }
.dc-warn { font-size: 11px; color: #c0623a; margin-top: 6px; }

/* 人生建议 */
.adv { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.adv-item { background: #f6f2fd; border-left: 3px solid #b69ae8; border-radius: 0 10px 10px 0; padding: 11px 14px; }
.adv-k { font-size: 13px; font-weight: 600; color: #241f4a; margin-bottom: 4px; }
.adv-item p { font-size: 13px; margin: 0; }

/* 底部转化 */
.cta { margin-top: 24px; border-top: 1px dashed #e0d6c2; padding-top: 18px; }
.cta-tip { font-size: 11px; color: #a99c84; text-align: center; margin-bottom: 12px; }
.cta-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.cta-btn { background: #fbf9ff; border: 1px solid #d8cdb6; border-radius: 12px; padding: 13px; font-size: 14px; color: #3a352b; cursor: pointer; }
.cta-btn:active { transform: scale(.98); }
.cta-btn.gold { background: #e8c87a; border-color: #e8c87a; color: #171232; font-weight: 600; }
.copyright { font-size: 10px; color: #b3a890; text-align: center; margin-top: 16px; line-height: 1.6; }

/* 弹窗 */
.modal { position: fixed; inset: 0; background: rgba(20,16,40,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 24px; }
.modal-box { background: #fbf9ff; border-radius: 16px; padding: 22px 20px; max-width: 320px; width: 100%; text-align: center; }
.modal-title { font-size: 17px; font-weight: 700; color: #241f4a; margin-bottom: 10px; }
.modal-txt { font-size: 13px; line-height: 1.7; color: #55504a; }
.modal-txt b { color: #b5894a; }
.qr { margin: 16px 0; padding: 16px; background: #f1ecf7; border-radius: 12px; font-size: 13px; color: #6f6450; line-height: 1.6; }
.qr span { font-size: 11px; color: #a99c84; }
.modal-close { margin-top: 4px; background: #241f4a; color: #e8c87a; border: none; border-radius: 10px; padding: 11px 24px; font-size: 14px; cursor: pointer; }

/* 轻提示 */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%) translateY(20px); background: #241f4a; color: #f3ecd8; padding: 10px 18px; border-radius: 99px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.show { opacity: 1; }
