:root {
  --primary: #1F4E79;
  --accent: #FF6B6B;
  --bg: #F7F8FA;
  --card: #FFFFFF;
  --text: #1A1A1A;
  --text-2: #666666;
  --text-3: #999999;
  --border: #EEEEEE;
  --green: #4CAF50;
  --warn: #F0B33A;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body {
  margin: 0; padding: 0; background: var(--bg); color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Source Han Sans CN", "Microsoft YaHei", sans-serif;
  font-size: 14px; line-height: 1.6;
}
#app { max-width: 420px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
.boot-msg { padding: 60px 20px; text-align: center; color: #999; }

.page { padding: 16px; padding-bottom: 100px; }
.h1 { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.h2 { font-size: 17px; font-weight: 600; margin: 16px 0 8px; }
.sub { color: var(--text-2); font-size: 13px; margin-bottom: 16px; }
.card { background: var(--card); border-radius: 12px; padding: 16px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,0.03); }
.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; background: #EEF3F9; color: var(--primary); margin-right: 6px; margin-bottom: 6px; }

.btn-primary {
  display: block; width: 100%; padding: 14px; border: none; border-radius: 12px;
  background: var(--primary); color: #fff; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: opacity .2s;
}
.btn-primary:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-accent { background: var(--accent); }
.btn-ghost { background: #fff; color: var(--primary); border: 1px solid var(--primary); }

.progress { height: 6px; background: #EEE; border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--primary); transition: width .3s; }

.topbar { display: flex; align-items: center; padding: 12px 16px; background: var(--bg); position: sticky; top: 0; z-index: 10; }
.topbar .back { font-size: 22px; padding: 4px 10px 4px 0; cursor: pointer; }
.topbar .title { flex: 1; font-size: 16px; font-weight: 600; text-align: center; margin-right: 32px; }

/* 首页 */
.home-hero {
  padding: 40px 24px 28px; text-align: center;
  background: linear-gradient(160deg, #1F4E79 0%, #2E6BA8 100%);
  color: #fff; border-radius: 0 0 24px 24px;
  position: relative;
}
.home-hero h1 { font-size: 26px; margin: 0 0 8px; font-weight: 700; }
.home-hero p { font-size: 14px; opacity: 0.9; margin: 0; }
.home-hero .gear {
  position: absolute; top: 14px; right: 18px; color: #fff; opacity: .7;
  font-size: 18px; cursor: pointer;
}

.home-actions { padding: 20px 16px; }
.home-action-card {
  background: #fff; border-radius: 14px; padding: 18px;
  margin-bottom: 12px; display: flex; align-items: center;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04); cursor: pointer;
}
.home-action-card .emoji { font-size: 32px; margin-right: 14px; }
.home-action-card .info { flex: 1; }
.home-action-card .info .t { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.home-action-card .info .d { font-size: 12px; color: var(--text-3); }
.home-action-card .arrow { color: var(--text-3); font-size: 20px; }

.persona-strip {
  background: #fff; border-radius: 14px; padding: 14px; margin-top: 4px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.persona-strip .head {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 13px; color: var(--text-2);
}
.persona-strip .name {
  font-size: 16px; font-weight: 600; color: var(--primary); margin-top: 4px;
}
.persona-strip .switch {
  color: var(--primary); font-size: 13px; cursor: pointer;
}

/* 设置 - 人格切换卡片 */
.persona-card {
  background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 12px;
  border: 2px solid transparent; cursor: pointer; transition: all .2s;
}
.persona-card.active { border-color: var(--primary); background: #F4F8FC; }
.persona-card .row1 { display: flex; align-items: center; margin-bottom: 6px; }
.persona-card .emoji { font-size: 26px; margin-right: 10px; }
.persona-card .name { font-size: 16px; font-weight: 700; }
.persona-card .check-r {
  margin-left: auto; width: 22px; height: 22px; border-radius: 50%;
  border: 1.5px solid #ccc; display: flex; align-items: center; justify-content: center;
  font-size: 12px; color: #fff;
}
.persona-card.active .check-r { background: var(--primary); border-color: var(--primary); }
.persona-card .tagline { font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.persona-card .fit { font-size: 12px; color: var(--text-3); margin-bottom: 8px; }
.persona-card .sample {
  background: #F7F8FA; border-radius: 8px; padding: 10px;
  font-size: 12px; color: var(--text-2); line-height: 1.6;
  border-left: 3px solid var(--primary);
}
.persona-card.active .sample { border-left-color: var(--accent); }

/* 问卷 */
.quiz-progress { padding: 8px 16px 4px; }
.quiz-progress .label { font-size: 12px; color: var(--text-3); margin-bottom: 6px; }
.quiz-stage { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.quiz-q-title { font-size: 18px; font-weight: 700; line-height: 1.5; margin-bottom: 8px; }
.quiz-scenario {
  background: #FFF7E6; border-radius: 10px; padding: 10px 12px;
  font-size: 13px; color: #8C5A00; line-height: 1.7; margin-bottom: 10px;
}
.quiz-scenario .label { font-weight: 600; }
.quiz-ask { font-size: 14px; color: var(--text-2); margin-bottom: 12px; line-height: 1.6; }

.quiz-option {
  background: #fff; border: 1.5px solid var(--border); border-radius: 12px;
  padding: 12px 14px; margin-bottom: 8px; cursor: pointer; transition: all .2s;
  display: flex; align-items: flex-start;
}
.quiz-option.selected { border-color: var(--primary); background: #F4F8FC; }
.quiz-option .check {
  width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid #ccc;
  margin-right: 10px; flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #fff; margin-top: 2px;
}
.quiz-option.selected .check { background: var(--primary); border-color: var(--primary); }
.quiz-option .opt-label { flex: 1; line-height: 1.6; font-size: 14px; }

.dual-slider-block {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.dual-slider-block .dual-label {
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px;
}
.dual-slider-block .slider-value {
  text-align: center; font-size: 22px; font-weight: 700; color: var(--primary); margin-bottom: 4px;
}
.slider {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px;
  background: #DDD; outline: none;
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); cursor: pointer; box-shadow: 0 2px 6px rgba(0,0,0,0.2);
}
.slider::-moz-range-thumb {
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--primary); cursor: pointer; border: none;
}
.slider-labels { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-top: 6px; }

/* 置信度选择器 */
.confidence-row {
  display: flex; gap: 6px; margin-top: 14px; padding: 10px;
  background: #F7F8FA; border-radius: 10px;
}
.confidence-row .label {
  font-size: 12px; color: var(--text-3); align-self: center; margin-right: 4px;
}
.confidence-chip {
  flex: 1; text-align: center; padding: 6px 4px; border-radius: 6px;
  background: #fff; border: 1px solid var(--border); cursor: pointer;
  font-size: 11px; color: var(--text-2);
}
.confidence-chip.selected { border-color: var(--primary); background: #F4F8FC; color: var(--primary); font-weight: 600; }
.confidence-chip .emoji { font-size: 16px; display: block; margin-bottom: 2px; }

.quiz-footer {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; padding: 12px 16px; background: var(--bg);
  display: flex; gap: 10px;
}

/* 图片上传 */
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upload-cell {
  position: relative; aspect-ratio: 1; background: #fff;
  border-radius: 10px; overflow: hidden; border: 1px solid var(--border);
}
.upload-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.upload-cell .remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; cursor: pointer;
}
.upload-cell-add {
  aspect-ratio: 1; background: #fff; border: 1.5px dashed var(--border);
  border-radius: 10px; display: flex; flex-direction: column;
  align-items: center; justify-content: center; cursor: pointer;
  color: var(--text-3); font-size: 12px;
}
.upload-cell-add .plus { font-size: 28px; line-height: 1; margin-bottom: 4px; color: var(--primary); }

.image-note-input {
  width: 100%; padding: 8px 10px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 6px;
  margin-top: 6px; font-family: inherit;
}
.image-note-input:focus { outline: none; border-color: var(--primary); }

.image-list-item {
  background: #fff; border-radius: 10px; padding: 10px; margin-bottom: 10px;
  display: flex; gap: 10px;
}
.image-list-item img { width: 80px; height: 80px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.image-list-item .right { flex: 1; display: flex; flex-direction: column; }
.image-list-item .right input { flex: 1; }
.image-list-item .remove-btn {
  font-size: 12px; color: var(--accent); align-self: flex-end; cursor: pointer;
}

/* 报告 */
.report-hero {
  background: linear-gradient(160deg, #1F4E79 0%, #2E6BA8 100%);
  color: #fff; padding: 24px 20px; border-radius: 16px; margin-bottom: 14px;
}
.report-hero .tag-label {
  display: inline-block; background: rgba(255,255,255,0.2);
  padding: 4px 12px; border-radius: 999px; font-size: 12px; margin-bottom: 10px;
}
.report-hero .one-liner {
  font-size: 18px; font-weight: 700; line-height: 1.6; margin-bottom: 12px;
}
.report-hero .meta {
  font-size: 12px; opacity: 0.85; line-height: 1.7;
}
.report-hero .meta .pill-meta {
  background: rgba(255,255,255,0.18); padding: 2px 8px; border-radius: 4px; margin-right: 6px;
}

.evaluation-card {
  background: #FFF7E6; border-radius: 12px; padding: 14px;
  font-size: 14px; color: #8C5A00; line-height: 1.8; margin-bottom: 14px;
  border-left: 3px solid var(--warn);
}

.section-head { display: flex; align-items: center; margin: 20px 0 10px; }
.section-head .num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--primary);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; margin-right: 10px;
}
.section-head .title { font-size: 18px; font-weight: 700; }

.trait-item {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.trait-item .t-num { font-size: 13px; color: var(--accent); font-weight: 700; margin-bottom: 4px; }
.trait-item .t-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.trait-item .t-summary { font-size: 13px; color: var(--text-2); margin-bottom: 8px; line-height: 1.7; }
.trait-item .t-detail {
  background: #F7F8FA; border-radius: 8px; padding: 10px;
  font-size: 13px; line-height: 1.7; color: var(--text); margin-bottom: 6px;
}
.trait-item .t-evidence { font-size: 11px; color: var(--text-3); }

.risk-item {
  background: #FFF4F4; border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px; margin-bottom: 10px;
}
.risk-item .r-title { font-weight: 700; margin-bottom: 6px; color: #C62828; }
.risk-item .r-desc { font-size: 13px; color: var(--text-2); margin-bottom: 8px; line-height: 1.7; }
.risk-item .r-advice {
  background: #fff; border-radius: 6px; padding: 8px 10px;
  font-size: 13px; color: var(--text); line-height: 1.7;
}
.risk-item .r-advice .lbl { color: var(--green); font-weight: 600; margin-right: 4px; }

.guide-item {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.guide-item .g-head { display: flex; align-items: baseline; margin-bottom: 8px; }
.guide-item .g-scenario { font-weight: 700; font-size: 15px; color: var(--primary); }
.guide-item .g-principle { font-size: 12px; color: var(--text-3); margin-left: 8px; }
.guide-item .g-row { padding: 8px 10px; border-radius: 8px; margin-bottom: 6px; font-size: 13px; line-height: 1.7; }
.guide-item .g-wrong { background: #FFF4F4; }
.guide-item .g-right { background: #F0F8F2; }
.guide-item .g-row .lbl { font-weight: 700; margin-right: 4px; }
.guide-item .g-why { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.7; }

.mantra-card {
  background: linear-gradient(135deg, #FFF7E6 0%, #FFE6E6 100%);
  border-radius: 14px; padding: 18px; margin: 16px 0;
}
.mantra-card .title { font-size: 14px; color: #8C5A00; margin-bottom: 12px; font-weight: 600; }
.mantra-card .item {
  background: #fff; border-radius: 10px; padding: 12px;
  font-size: 14px; line-height: 1.7; margin-bottom: 8px;
  font-weight: 600; color: var(--text); display: flex; align-items: flex-start;
}
.mantra-card .item .num {
  color: var(--accent); font-size: 16px; font-weight: 800; margin-right: 8px; flex-shrink: 0;
}

/* 翻译 / 支招 */
.translate-input {
  width: 100%; padding: 12px 14px;
  border: 1.5px solid var(--border); border-radius: 12px;
  font-size: 14px; line-height: 1.6; resize: none; background: #fff;
  font-family: inherit;
}
.translate-input:focus { outline: none; border-color: var(--primary); }

.field-label {
  font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 6px;
}
.field-hint { font-size: 12px; color: var(--text-3); margin-bottom: 6px; line-height: 1.6; }

.recap-card {
  background: linear-gradient(160deg, #F4F8FC 0%, #E8F0F9 100%);
  border-radius: 12px; padding: 14px; margin-bottom: 14px;
}
.recap-card .lbl { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.recap-card .text { font-size: 14px; line-height: 1.7; color: var(--text); }

.intent-card {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
  border: 1.5px solid var(--primary);
}
.intent-card .main {
  font-size: 16px; font-weight: 700; color: var(--primary); margin-bottom: 8px;
  line-height: 1.6;
}
.intent-card .exp {
  font-size: 13px; color: var(--text-2); line-height: 1.7; margin-bottom: 10px;
}
.intent-card .alt {
  font-size: 12px; color: var(--text-3); padding: 6px 8px;
  background: #F7F8FA; border-radius: 6px; margin-bottom: 4px; line-height: 1.7;
}
.intent-card .alt .alt-label { color: var(--text-2); font-weight: 600; margin-right: 4px; }

.action-card {
  background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px;
}
.action-card .a-title {
  font-size: 15px; font-weight: 700; color: var(--primary); margin-bottom: 4px;
}
.action-card .a-when {
  font-size: 12px; color: var(--text-3); margin-bottom: 10px;
}
.action-card .a-script {
  background: #F7F8FA; border-radius: 8px; padding: 12px;
  font-size: 14px; line-height: 1.7; margin-bottom: 8px; white-space: pre-wrap;
}
.action-card .a-why {
  font-size: 12px; color: var(--text-2); line-height: 1.7; margin-bottom: 10px;
  padding: 8px 10px; background: #F0F8F2; border-radius: 6px;
}
.action-card .a-why .lbl { color: var(--green); font-weight: 600; margin-right: 4px; }
.action-card .copy-btn {
  padding: 6px 14px; background: var(--primary); color: #fff;
  border: none; border-radius: 6px; font-size: 12px; cursor: pointer;
}

.warning-card {
  background: #FFF4F4; border-radius: 12px; padding: 14px; margin-bottom: 12px;
  border-left: 3px solid var(--accent);
}
.warning-card .w-title { color: var(--accent); font-weight: 700; margin-bottom: 10px; }
.warning-card .w-item { margin-bottom: 8px; }
.warning-card .w-item .dont { font-weight: 600; }
.warning-card .w-item .reason { font-size: 12px; color: var(--text-2); margin-top: 2px; }

.insight-card {
  background: linear-gradient(135deg, #FFF7E6 0%, #FFE6E6 100%);
  border-radius: 14px; padding: 18px;
  font-size: 16px; font-weight: 600; line-height: 1.8;
  color: #8C5A00; text-align: center; margin: 16px 0;
  position: relative;
}
.insight-card::before {
  content: '"'; font-size: 56px; color: var(--warn); position: absolute;
  top: -10px; left: 12px; line-height: 1; opacity: 0.5;
}

/* 加载 / 流式 */
.loading-wrap { text-align: center; padding: 40px 20px; color: var(--text-3); }
.loading-dots::after {
  content: '...'; animation: dots 1.4s infinite; display: inline-block;
}
@keyframes dots {
  0% { content: '.'; } 33% { content: '..'; } 66% { content: '...'; }
}
.stream-preview {
  background: #fff; border-radius: 10px; padding: 12px;
  font-size: 12px; color: var(--text-3); margin-top: 14px;
  max-height: 160px; overflow-y: auto; white-space: pre-wrap;
  text-align: left; font-family: monospace;
  border: 1px dashed var(--border);
}

/* Toast */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.78); color: #fff; padding: 10px 18px;
  border-radius: 8px; font-size: 13px; z-index: 999;
  opacity: 0; transition: opacity .25s; pointer-events: none;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }

/* 状态徽章 */
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
}
.status-on { background: #E6F4EA; color: #2E7D32; }
.status-off { background: #FFF4F4; color: var(--accent); }

/* ===== 引导页（首次使用）===== */
.onboarding-page { min-height: 100vh; display: flex; flex-direction: column; }
.onboarding-hero {
  padding: 52px 24px 32px; text-align: center;
  background: linear-gradient(160deg, #1F4E79 0%, #2E6BA8 100%);
  color: #fff; border-radius: 0 0 28px 28px;
}
.onboarding-hero .app-icon { font-size: 52px; margin-bottom: 12px; }
.onboarding-hero h1 { font-size: 28px; margin: 0 0 6px; font-weight: 700; }
.onboarding-hero p { font-size: 14px; opacity: 0.85; margin: 0; }
.onboarding-body { padding: 20px 16px 100px; flex: 1; }
.onboarding-hint {
  text-align: center; font-size: 13px; color: var(--text-3); margin: 16px 0 4px;
}

/* ===== 首页 · 无档案状态 ===== */
.home-empty-card {
  background: #fff; border-radius: 18px; padding: 28px 22px;
  text-align: center; margin-bottom: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.home-empty-card .emoji-big { font-size: 54px; margin-bottom: 14px; }
.home-empty-card .ec-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.home-empty-card .ec-desc {
  font-size: 13px; color: var(--text-2); line-height: 1.8; margin-bottom: 22px;
}
.home-empty-card .ec-steps {
  display: flex; justify-content: space-around; margin-bottom: 22px;
  background: #F7F8FA; border-radius: 10px; padding: 12px 8px;
}
.home-empty-card .ec-steps .step { text-align: center; }
.home-empty-card .ec-steps .step-icon { font-size: 20px; margin-bottom: 4px; }
.home-empty-card .ec-steps .step-txt { font-size: 11px; color: var(--text-2); }
.home-empty-card .ec-steps .step-arrow {
  align-self: center; color: var(--text-3); font-size: 16px;
}

.home-divider {
  text-align: center; color: var(--text-3); font-size: 12px;
  margin: 8px 0 12px; position: relative;
}
.home-divider::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: var(--border);
}
.home-divider span { background: var(--bg); padding: 0 10px; position: relative; }

/* ===== 首页 · 有档案状态 ===== */
.boss-profile-card {
  background: linear-gradient(160deg, #1F4E79 0%, #2E6BA8 100%);
  border-radius: 18px; padding: 20px 20px 18px; margin-bottom: 14px;
  color: #fff; cursor: pointer; position: relative; overflow: hidden;
}
.boss-profile-card .bp-tag {
  display: inline-flex; align-items: center;
  background: rgba(255,255,255,0.18); padding: 3px 10px;
  border-radius: 999px; font-size: 12px; margin-bottom: 10px; gap: 5px;
}
.boss-profile-card .bp-tag .mbti {
  background: rgba(255,255,255,0.3); padding: 1px 6px; border-radius: 4px;
}
.boss-profile-card .bp-one-liner {
  font-size: 15px; font-weight: 600; line-height: 1.65; margin-bottom: 12px;
}
.boss-profile-card .bp-confidence {
  font-size: 11px; opacity: 0.7; margin-bottom: 14px;
}
.boss-profile-card .bp-view-btn {
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(255,255,255,0.2); padding: 6px 14px;
  border-radius: 8px; font-size: 12px; font-weight: 600;
}

/* ===== 补充完善页 ===== */
.mini-profile-summary {
  background: linear-gradient(135deg, #EEF3F9 0%, #E0EBF7 100%);
  border-radius: 12px; padding: 14px; margin-bottom: 16px;
  border-left: 3px solid var(--primary);
}
.mini-profile-summary .lbl { font-size: 11px; color: var(--text-3); margin-bottom: 4px; }
.mini-profile-summary .one-liner { font-size: 14px; font-weight: 600; color: var(--primary); line-height: 1.6; }

/* ===== 首页 · 参谋信息条 ===== */
.home-persona-bar {
  display: flex; align-items: center; justify-content: space-between;
  background: #fff; border-radius: 12px; padding: 12px 14px;
  margin-bottom: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.04);
  cursor: pointer;
}
.home-persona-bar .left { display: flex; align-items: center; gap: 8px; }
.home-persona-bar .p-emoji { font-size: 20px; }
.home-persona-bar .p-info .p-name { font-size: 14px; font-weight: 600; }
.home-persona-bar .p-info .p-tagline { font-size: 11px; color: var(--text-3); }
.home-persona-bar .p-switch { font-size: 12px; color: var(--primary); }
