:root {
  --primary: #4a00e0;
  --primary-light: #7c3aed;
  --accent: #ff2d55;
  --bg: #faf7ff;
  --card: #ffffff;
  --text: #1a1a2e;
  --text-sub: #6b6b85;
  --border: #ece5f7;
  --shadow: 0 4px 24px rgba(74, 0, 224, 0.08);
  --shadow-lg: 0 12px 48px rgba(74, 0, 224, 0.14);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

#app { max-width: 720px; margin: 0 auto; min-height: 100vh; }

.view { display: none; padding: 24px 20px 60px; animation: fadeIn 0.4s ease; }
.view.active { display: block; }

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.hidden { display: none !important; }

/* ---------- 顶部导航 ---------- */
.top-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,0.92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav-inner { max-width: 720px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; }
.nav-logo { font-size: 18px; font-weight: 800; color: var(--primary); cursor: pointer; }
.nav-links { display: flex; gap: 8px; }
.nav-btn { background: none; border: none; font-size: 14px; color: var(--text-sub); cursor: pointer; padding: 6px 12px; border-radius: 8px; transition: all 0.15s; }
.nav-btn:hover { color: var(--primary); background: #f6f0ff; }

/* ---------- 按钮 ---------- */
.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  color: #fff; border: none; border-radius: 14px;
  padding: 14px 32px; font-size: 16px; font-weight: 600;
  cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  box-shadow: 0 6px 20px rgba(74, 0, 224, 0.28);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 10px 28px rgba(74, 0, 224, 0.36); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.btn-lg { padding: 16px 44px; font-size: 17px; }
.btn-block { width: 100%; margin-top: 24px; }
.btn-sm { padding: 10px 20px; font-size: 14px; }

.btn-outline {
  background: #fff; color: var(--primary); border: 1.5px solid var(--border);
  border-radius: 14px; padding: 13px 28px; font-size: 15px; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.btn-outline:hover { border-color: var(--primary); background: #f6f0ff; }

.btn-text { background: none; border: none; color: var(--text-sub); font-size: 14px; cursor: pointer; padding: 8px; }
.btn-text:hover { color: var(--primary); }

.btn-row { display: flex; gap: 12px; justify-content: center; margin-top: 28px; }

/* ---------- 登录/注册 ---------- */
.auth-wrap { max-width: 420px; margin: 0 auto; padding-top: 60px; }
.auth-header { text-align: center; margin-bottom: 36px; }
.auth-title { font-size: 42px; font-weight: 900; color: var(--primary); margin: 16px 0 8px; }
.auth-sub { font-size: 15px; color: var(--text-sub); }

.auth-card { background: var(--card); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 2px solid var(--border); }
.auth-tab { flex: 1; background: none; border: none; padding: 12px; font-size: 16px; font-weight: 600; color: var(--text-sub); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.15s; }
.auth-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

.auth-form { display: flex; flex-direction: column; gap: 4px; }
.auth-form .field-label { margin-top: 14px; }
.auth-form .field-label:first-child { margin-top: 0; }

.auth-error { margin-top: 16px; padding: 12px 16px; background: #fff0f3; border-radius: 10px; color: var(--accent); font-size: 14px; text-align: center; }
.auth-skip { text-align: center; margin-top: 24px; }

/* ---------- 落地页 ---------- */
.hero { text-align: center; padding: 56px 8px 40px; }
.hero-badge {
  display: inline-block; background: #f0e6ff; color: var(--primary);
  padding: 6px 16px; border-radius: 20px; font-size: 13px; font-weight: 600; margin-bottom: 24px;
}
.hero-title { font-size: 34px; font-weight: 800; line-height: 1.35; letter-spacing: -0.5px; margin-bottom: 20px; }
.hero-sub { font-size: 16px; color: var(--text-sub); max-width: 520px; margin: 0 auto 32px; }
.hero-meta { margin-top: 18px; font-size: 13px; color: var(--text-sub); }

.section-title { font-size: 22px; font-weight: 700; text-align: center; margin: 40px 0 24px; }

.case-grid { display: grid; gap: 16px; }
.case-card {
  background: var(--card); border-radius: 18px; padding: 22px; box-shadow: var(--shadow);
  border: 1px solid var(--border); transition: transform 0.2s, box-shadow 0.2s;
}
.case-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.case-pattern {
  display: inline-block; font-size: 12px; font-weight: 700; color: var(--accent);
  background: #fff0f3; padding: 4px 12px; border-radius: 12px; margin-bottom: 12px;
}
.case-title { font-size: 16px; font-weight: 700; line-height: 1.5; margin-bottom: 10px; }
.case-excerpt { font-size: 14px; color: var(--text-sub); margin-bottom: 14px; }
.case-highlight { font-size: 14px; font-weight: 600; color: var(--primary); font-style: italic; }
.case-scores { display: flex; gap: 8px; margin-top: 14px; }
.score-pill { font-size: 12px; background: #f6f0ff; color: var(--primary); padding: 3px 10px; border-radius: 10px; }

.footer { text-align: center; margin-top: 56px; padding-top: 24px; border-top: 1px solid var(--border); color: var(--text-sub); font-size: 13px; }
.footer-icp { margin-top: 8px; font-size: 12px; color: var(--text-sub); opacity: 0.75; }
.icp-link { color: inherit; text-decoration: none; }
.icp-link:hover { text-decoration: underline; }

/* ---------- 测评 ---------- */
.assess-wrap { max-width: 600px; margin: 0 auto; padding-top: 20px; }
.progress-bar { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: 4px; transition: width 0.35s ease; width: 8%; }
.progress-text { text-align: center; font-size: 13px; color: var(--text-sub); margin: 12px 0 24px; }

.question-card { background: var(--card); border-radius: 20px; padding: 32px 28px; box-shadow: var(--shadow); border: 1px solid var(--border); min-height: 280px; }
.q-section { font-size: 13px; font-weight: 700; color: var(--accent); letter-spacing: 1px; margin-bottom: 14px; }
.q-title { font-size: 20px; font-weight: 700; line-height: 1.5; margin-bottom: 12px; }
.q-desc { font-size: 14px; color: var(--text-sub); margin-bottom: 22px; }

.q-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 14px 16px;
  font-size: 15px; font-family: inherit; resize: vertical; transition: border-color 0.15s; background: #fcfaff;
}
.q-input:focus { outline: none; border-color: var(--primary); background: #fff; }

.number-wrap { display: flex; align-items: center; gap: 12px; }
.number-wrap .q-input { max-width: 160px; }
.number-unit { font-size: 15px; color: var(--text-sub); }

.option-list { display: grid; gap: 12px; }
.option-item {
  border: 1.5px solid var(--border); border-radius: 12px; padding: 16px 18px; font-size: 15px;
  cursor: pointer; transition: all 0.15s; background: #fcfaff;
}
.option-item:hover { border-color: var(--primary-light); }
.option-item.selected { border-color: var(--primary); background: #f3eaff; font-weight: 600; color: var(--primary); }

/* ---------- 报告 ---------- */
.report-wrap { max-width: 600px; margin: 0 auto; }
.report-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-top: 12px; }
.report-pattern { font-size: 24px; font-weight: 800; color: var(--primary); }
.report-date { font-size: 13px; color: var(--text-sub); }

.card { background: var(--card); border-radius: 18px; padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); margin-bottom: 16px; }
.card-title { font-size: 17px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.card-text { font-size: 15px; color: var(--text-sub); line-height: 1.8; }
.card-sub { font-size: 13px; color: var(--text-sub); line-height: 1.6; margin: -6px 0 14px; }

.radar-card { text-align: center; }
.radar-card canvas { max-width: 100%; }

/* 3个未解问题（转化钩子） */
.hook-card { background: linear-gradient(160deg, #faf7ff 0%, #fff 100%); }
.hook-item { padding: 13px 16px; border-left: 3px solid var(--primary); background: #f4efff; border-radius: 0 12px 12px 0; margin-bottom: 10px; }
.hook-item:last-child { margin-bottom: 0; }
.hook-q { font-weight: 700; font-size: 15px; color: var(--text); margin-bottom: 4px; line-height: 1.5; }
.hook-hint { font-size: 13px; color: var(--text-sub); line-height: 1.6; }

/* 深度报告模块预告 */
.module-item { display: flex; gap: 12px; align-items: flex-start; padding: 9px 0; border-bottom: 1px dashed var(--border); }
.module-item:last-child { border-bottom: none; }
.module-idx { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: #efe9ff; color: var(--primary); font-weight: 800; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.module-info { flex: 1; }
.module-name { font-size: 14px; font-weight: 700; color: var(--text); }
.module-desc { font-size: 12.5px; color: var(--text-sub); margin-top: 2px; line-height: 1.5; }
.module-focus { display: inline-block; margin-left: 8px; font-size: 11px; color: var(--accent); background: #fff0f4; padding: 2px 8px; border-radius: 20px; font-weight: 600; vertical-align: 1px; }

.cta-card { background: linear-gradient(135deg, var(--primary), var(--primary-light)); border-radius: 20px; padding: 32px 28px; text-align: center; color: #fff; margin-top: 24px; box-shadow: var(--shadow-lg); }
.cta-kicker { font-size: 12px; letter-spacing: 2px; opacity: 0.8; margin-bottom: 8px; font-weight: 600; }
.cta-title { font-size: 20px; font-weight: 700; margin-bottom: 12px; line-height: 1.4; }
.cta-desc { font-size: 14px; opacity: 0.92; margin-bottom: 16px; line-height: 1.7; }
.cta-features { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin-bottom: 14px; }
.cta-feature { font-size: 12px; background: rgba(255,255,255,0.16); border-radius: 20px; padding: 5px 12px; font-weight: 600; }
.cta-price { font-size: 36px; font-weight: 900; margin-bottom: 20px; line-height: 1; }
.cta-price-sub { font-size: 13px; font-weight: 400; opacity: 0.85; margin-left: 6px; }
.cta-card .btn-primary { background: #fff; color: var(--primary); box-shadow: 0 6px 20px rgba(0,0,0,0.15); }
.cta-card .btn-text { color: rgba(255,255,255,0.85); display: block; margin: 16px auto 0; }
.cta-card .btn-text:hover { color: #fff; }

/* ---------- 深度表单 ---------- */
.deep-wrap { max-width: 600px; margin: 0 auto; }
.page-title { font-size: 26px; font-weight: 800; text-align: center; margin-top: 16px; }
.page-sub { text-align: center; color: var(--text-sub); font-size: 14px; margin: 10px 0 24px; }

.field-label { display: block; font-size: 14px; font-weight: 600; margin: 18px 0 8px; }
.field-label:first-child { margin-top: 0; }
.req { color: var(--accent); }
.field-input {
  width: 100%; border: 1.5px solid var(--border); border-radius: 12px; padding: 12px 14px;
  font-size: 15px; font-family: inherit; resize: vertical; background: #fcfaff; transition: border-color 0.15s;
}
.field-input:focus { outline: none; border-color: var(--primary); background: #fff; }
.char-count { text-align: right; font-size: 12px; color: var(--text-sub); margin-top: 4px; }

.option-row { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--border); background: #fcfaff; border-radius: 20px; padding: 9px 18px;
  font-size: 14px; cursor: pointer; transition: all 0.15s;
}
.chip:hover { border-color: var(--primary-light); }
.chip.selected { border-color: var(--primary); background: #f3eaff; color: var(--primary); font-weight: 600; }

/* ---------- 支付 ---------- */
.payment-wrap { max-width: 480px; margin: 0 auto; }
.payment-card { padding: 28px; }
.payment-summary { margin-bottom: 24px; }
.payment-item { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; font-size: 15px; }
.payment-amount { font-weight: 700; }
.payment-total { font-size: 17px; font-weight: 700; }
.payment-total .payment-amount { color: var(--accent); font-size: 20px; }
.payment-divider { height: 1px; background: var(--border); margin: 8px 0; }
.payment-methods { margin-bottom: 24px; }

.payment-qr { text-align: center; padding: 24px 0; }
.qr-placeholder { padding: 40px 20px; border: 2px dashed var(--border); border-radius: 16px; color: var(--text-sub); }
.qr-hint { font-size: 13px; margin-top: 8px; opacity: 0.7; }
#qr-canvas { margin: 0 auto; border-radius: 12px; }
.qr-status { margin-top: 16px; font-size: 14px; color: var(--text-sub); }

.payment-dev-hint { margin-top: 20px; padding: 16px; background: #fffbe6; border-radius: 12px; text-align: center; font-size: 13px; color: #8b6914; }
.payment-dev-hint .btn-outline { margin-top: 12px; }

/* ---------- 深度报告 ---------- */
.deep-report-wrap { max-width: 900px; margin: 0 auto; }
.dr-toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-top: 8px; }
.dr-title { font-size: 16px; font-weight: 700; }
.deep-report-frame { width: 100%; height: 80vh; border: 1px solid var(--border); border-radius: 16px; background: #fff; box-shadow: var(--shadow); }

/* ---------- 历史记录 ---------- */
.history-wrap { max-width: 600px; margin: 0 auto; }
.history-section { margin-top: 28px; }
.history-subtitle { font-size: 18px; font-weight: 700; margin-bottom: 16px; padding-left: 12px; border-left: 4px solid var(--primary); }
.history-list { display: grid; gap: 12px; }
.history-empty { text-align: center; color: var(--text-sub); font-size: 14px; padding: 24px; }

.history-item {
  background: var(--card); border-radius: 14px; padding: 18px 20px; box-shadow: var(--shadow);
  border: 1px solid var(--border); cursor: pointer; transition: transform 0.15s, box-shadow 0.15s;
  display: flex; justify-content: space-between; align-items: center;
}
.history-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.history-item-left { flex: 1; }
.history-item-title { font-size: 15px; font-weight: 600; margin-bottom: 4px; }
.history-item-meta { font-size: 13px; color: var(--text-sub); }
.history-item-scores { display: flex; gap: 6px; }
.history-item-scores .score-pill { font-size: 11px; }
.history-item-arrow { color: var(--text-sub); font-size: 18px; margin-left: 12px; }

/* ---------- 加载遮罩 ---------- */
.loading-mask { position: fixed; inset: 0; background: rgba(26, 26, 46, 0.55); display: flex; align-items: center; justify-content: center; z-index: 100; backdrop-filter: blur(2px); }
.loading-mask.hidden { display: none; }
.loading-box { background: #fff; border-radius: 20px; padding: 36px 44px; text-align: center; box-shadow: var(--shadow-lg); }
.spinner { width: 44px; height: 44px; border: 4px solid var(--border); border-top-color: var(--primary); border-radius: 50%; margin: 0 auto 18px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text { font-size: 15px; color: var(--text); font-weight: 500; }

/* ---------- 平板适配 ---------- */
@media (max-width: 768px) {
  #app { max-width: 100%; }
  .hero-title { font-size: 28px; }
  .deep-report-wrap { padding: 0 8px; }
  .deep-report-frame { height: 70vh; }
}

/* ---------- 手机适配 ---------- */
@media (max-width: 480px) {
  /* 全局 */
  body { font-size: 15px; line-height: 1.6; }
  #app { max-width: 100%; }
  .view { padding: 16px 14px 48px; }

  /* 导航 */
  .nav-inner { padding: 10px 14px; }
  .nav-logo { font-size: 16px; }
  .nav-btn { font-size: 13px; padding: 5px 8px; }

  /* 登录/注册 */
  .auth-wrap { padding-top: 24px; max-width: 100%; }
  .auth-title { font-size: 30px; }
  .auth-sub { font-size: 13px; }
  .auth-card { padding: 24px 18px; border-radius: 16px; }
  .auth-tab { font-size: 15px; padding: 10px; }
  .field-input { padding: 12px; font-size: 16px; border-radius: 10px; }
  .btn-block { margin-top: 18px; padding: 14px; }

  /* 落地页 */
  .hero { padding: 32px 4px 28px; }
  .hero-badge { font-size: 12px; padding: 5px 12px; }
  .hero-title { font-size: 24px; line-height: 1.4; margin-bottom: 14px; }
  .hero-sub { font-size: 14px; margin-bottom: 24px; }
  .hero-meta { font-size: 12px; }
  .btn-lg { padding: 14px 32px; font-size: 16px; }
  .section-title { font-size: 19px; margin: 28px 0 16px; }
  .case-card { padding: 18px 16px; border-radius: 14px; }
  .case-title { font-size: 15px; }
  .case-excerpt { font-size: 13px; }
  .footer { margin-top: 36px; font-size: 12px; }

  /* 测评 */
  .assess-wrap { padding-top: 12px; }
  .progress-text { font-size: 12px; margin: 8px 0 16px; }
  .question-card { padding: 22px 16px; border-radius: 16px; min-height: 240px; }
  .q-section { font-size: 12px; margin-bottom: 10px; }
  .q-title { font-size: 17px; margin-bottom: 10px; }
  .q-desc { font-size: 13px; margin-bottom: 16px; }
  .q-input { padding: 12px; font-size: 16px; border-radius: 10px; }
  .option-item { padding: 14px 14px; font-size: 14px; border-radius: 10px; }
  .btn-row { flex-direction: column-reverse; gap: 10px; margin-top: 20px; }
  .btn-row button { width: 100%; }
  .btn-primary { padding: 14px 24px; font-size: 15px; border-radius: 12px; }
  .btn-outline { padding: 13px 24px; font-size: 14px; border-radius: 12px; }

  /* 报告 */
  .report-wrap { max-width: 100%; }
  .report-header { margin-bottom: 14px; }
  .report-pattern { font-size: 20px; }
  .card { padding: 18px 16px; border-radius: 14px; margin-bottom: 12px; }
  .card-title { font-size: 15px; margin-bottom: 8px; }
  .card-text { font-size: 14px; line-height: 1.7; }
  .card-sub { font-size: 12.5px; margin: -4px 0 12px; }
  .radar-card canvas { width: 300px !important; height: 270px !important; }
  .hook-item { padding: 12px 14px; }
  .hook-q { font-size: 14px; }
  .hook-hint { font-size: 12.5px; }
  .module-idx { width: 26px; height: 26px; font-size: 12px; }
  .module-name { font-size: 13px; }
  .module-desc { font-size: 12px; }
  .module-focus { margin-left: 6px; font-size: 10px; padding: 2px 6px; }
  .cta-card { padding: 24px 18px; border-radius: 16px; }
  .cta-title { font-size: 18px; }
  .cta-desc { font-size: 13px; }
  .cta-price { font-size: 30px; }

  /* 深度表单 */
  .deep-wrap { max-width: 100%; }
  .page-title { font-size: 22px; }
  .page-sub { font-size: 13px; }
  .field-label { font-size: 13px; margin: 14px 0 6px; }
  .char-count { font-size: 11px; }
  .option-row { gap: 8px; }
  .chip { padding: 8px 14px; font-size: 13px; }

  /* 支付 */
  .payment-wrap { max-width: 100%; }
  .payment-card { padding: 20px 16px; }
  .payment-item { font-size: 14px; }
  .payment-total .payment-amount { font-size: 18px; }

  /* 深度报告 */
  .deep-report-wrap { max-width: 100%; padding: 0; }
  .dr-toolbar { padding-top: 4px; margin-bottom: 10px; }
  .dr-toolbar .btn-outline { padding: 8px 14px; font-size: 13px; }
  .dr-title { font-size: 14px; }
  .deep-report-frame { height: 75vh; border-radius: 12px; }

  /* 历史记录 */
  .history-wrap { max-width: 100%; }
  .history-subtitle { font-size: 16px; }
  .history-item { padding: 14px 14px; border-radius: 12px; flex-wrap: wrap; gap: 8px; }
  .history-item-title { font-size: 14px; }
  .history-item-meta { font-size: 12px; }
  .history-item-scores { width: 100%; }

  /* 加载遮罩 */
  .loading-box { padding: 28px 24px; border-radius: 16px; margin: 0 20px; }
  .loading-text { font-size: 14px; }
}

/* ---------- 超小屏（iPhone SE 等） ---------- */
@media (max-width: 360px) {
  .view { padding: 12px 10px 40px; }
  .hero-title { font-size: 21px; }
  .hero-sub { font-size: 13px; }
  .q-title { font-size: 16px; }
  .question-card { padding: 18px 14px; }
  .card { padding: 16px 14px; }
  .auth-card { padding: 20px 14px; }
  .radar-card canvas { width: 260px !important; height: 240px !important; }
}
