/* ============================================================
   pages/mbti-result.html 样式（P0-4-T17 <style> 块外联）
   - 页面 style="..." 与 on* 仍在本页（P0-4-T18 整改）
   ============================================================ */

/* Design Token：项目级 Glassmorphism 规范（与 topbar.8d4aa38f.css 一致） */
:root {
  --glass-bg-light:           rgba(255, 255, 255, 0.55);
  --glass-border-light:        rgba(15, 23, 42, 0.06);
  --glass-highlight-light:     rgba(255, 255, 255, 0.6);
  --glass-shadow-light:        rgba(15, 23, 42, 0.06);
  --glass-bg-dark:             rgba(10, 14, 39, 0.72);
  --glass-border-dark:         rgba(255, 255, 255, 0.06);
  --glass-highlight-dark:      rgba(255, 255, 255, 0.08);
  --glass-shadow-dark:         rgba(0, 0, 0, 0.32);
  --glass-blur:                blur(20px) saturate(180%);
}

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  body {
    font-family: "Inter", "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
    color: #e8eaf0;
    background:
      radial-gradient(ellipse 80% 60% at 50% 0%,  rgba(59,130,246,0.20) 0%, transparent 60%),
      radial-gradient(ellipse 50% 40% at 100% 100%, rgba(139,92,246,0.12) 0%, transparent 60%),
      #05071a;
    background-attachment: fixed;
    min-height: 100vh;
    line-height: 1.6;
  }
  a { color: inherit; text-decoration: none; }

  .wrap { max-width: 920px; margin: 0 auto; padding: 40px 24px 80px; }

  .err { text-align: center; padding: 80px 0; color: rgba(232,234,240,0.6); }

  /* 头部：4 字母大字 */
  .result-head {
    text-align: center;
    margin-bottom: 48px;
  }
  .result-eyebrow {
    font-size: 11px; letter-spacing: 0.4em;
    color: rgba(232,234,240,0.5); text-transform: uppercase;
    margin-bottom: 16px;
  }
  .result-mbti {
    font-size: 96px;
    font-weight: 700;
    letter-spacing: 16px;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    margin-bottom: 12px;
  }
  .result-name {
    font-size: 22px;
    color: #fff;
    margin-bottom: 6px;
  }
  .result-name .en { color: rgba(232,234,240,0.5); font-size: 14px; margin-left: 8px; letter-spacing: 0.1em; }
  .result-tagline {
    color: rgba(232,234,240,0.7);
    font-size: 16px;
    max-width: 640px;
    margin: 0 auto;
  }

  /* 4 维度百分比 */
  .dims-card {
    background: rgba(11,18,32,0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
  }
  .dims-card h2 { font-size: 18px; margin-bottom: 24px; color: #fff; }
  .dim-row {
    display: grid;
    grid-template-columns: 80px 1fr 60px;
    align-items: center;
    gap: 16px;
    margin-bottom: 18px;
  }
  .dim-row:last-child { margin-bottom: 0; }
  .dim-letters {
    display: flex; gap: 4px; align-items: center; justify-content: center;
    font-size: 22px; font-weight: 700;
  }
  .dim-letters .a { color: #3b82f6; }
  .dim-letters .b { color: #8b5cf6; }
  .dim-letters .sep { color: rgba(232,234,240,0.3); font-size: 16px; }
  .bar-wrap {
    position: relative; height: 24px;
    background: rgba(255,255,255,0.04);
    border-radius: 12px;
    overflow: hidden;
  }
  .bar-a, .bar-b {
    position: absolute; top: 0; height: 100%;
    display: flex; align-items: center; padding: 0 8px;
    font-size: 12px; font-weight: 600;
    color: #fff;
    transition: width 0.6s ease;
  }
  .bar-a { left: 0; background: linear-gradient(90deg, #3b82f6, #6366f1); }
  .bar-b { right: 0; background: linear-gradient(270deg, #8b5cf6, #a855f7); }
  .bar-a span, .bar-b span { white-space: nowrap; }
  .dim-pct {
    text-align: right; font-size: 13px; color: rgba(232,234,240,0.7);
    font-family: "Consolas", monospace;
  }

  /* 16 型描述 */
  .type-card {
    background: rgba(11,18,32,0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 12px;
    padding: 40px;
    margin-bottom: 24px;
  }
  .type-card h2 {
    font-size: 18px;
    margin-bottom: 20px;
    color: #fff;
    display: flex; align-items: baseline; gap: 12px;
  }
  .type-card h2 .en {
    font-size: 13px; color: rgba(232,234,240,0.5);
    letter-spacing: 0.05em; font-weight: 400;
  }
  .type-desc {
    color: rgba(232,234,240,0.85);
    font-size: 15px;
    line-height: 1.8;
    margin-bottom: 20px;
  }
  .type-section-title {
    font-size: 12px;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: rgba(232,234,240,0.5);
    margin: 20px 0 10px;
  }
  .type-section-title::before { content: '▸ '; color: #3b82f6; }
  .type-list {
    list-style: none; padding: 0;
  }
  .type-list li {
    color: rgba(232,234,240,0.8);
    padding: 4px 0;
    font-size: 14px;
  }
  .type-list li::before { content: '✓ '; color: #1abc9c; margin-right: 4px; }
  .growth li::before { content: '→ '; color: #f59e0b; }

  /* 操作按钮 */
  .actions {
    display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
    margin-top: 40px;
  }
  .btn {
    padding: 14px 28px;
    background: transparent;
    border: 1px solid rgba(59,130,246,0.3);
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.1em;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-flex; align-items: center; gap: 8px;
  }
  .btn:hover { background: rgba(59,130,246,0.15); border-color: #3b82f6; }
  .btn.primary {
    background: linear-gradient(135deg, #3b82f6, #6366f1);
    border-color: transparent;
  }
  .btn.primary:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(59,130,246,0.4); }

  .note {
    text-align: center; margin-top: 32px;
    font-size: 12px; color: rgba(232,234,240,0.4);
  }

  /* ===== P1：复测趋势对比卡（仅 mid 通道且历史 ≥2 次时渲染） ===== */
  .trend-card {
    background: rgba(11,18,32,0.65);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(59,130,246,0.25);
    border-radius: 12px;
    padding: 32px;
    margin-bottom: 24px;
  }
  .trend-card h2 {
    font-size: 18px; margin-bottom: 20px; color: #fff;
    display: flex; align-items: baseline; gap: 12px;
  }
  .trend-card h2 .sub {
    font-size: 12px; color: rgba(232,234,240,0.5);
    letter-spacing: 0.05em; font-weight: 400;
  }
  .trend-type-change {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 6px 14px; margin-bottom: 16px;
    background: rgba(245,158,11,0.10);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 6px;
    font-size: 13px; color: #f59e0b;
    letter-spacing: 0.05em;
  }
  .trend-type-change .arrow { color: rgba(245,158,11,0.7); }
  .trend-chart {
    position: relative; height: 240px;
    margin-bottom: 4px;
  }
  .trend-delta {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    margin-top: 14px; padding-top: 14px;
    border-top: 1px dashed rgba(232,234,240,0.12);
  }
  .trend-delta .dt-label {
    font-size: 12px; color: rgba(232,234,240,0.5);
    letter-spacing: 0.1em;
  }
  .trend-delta .dt {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 13px; font-weight: 600;
    font-family: "Consolas", monospace;
  }
  .trend-delta .dt.up   { color: #1abc9c; background: rgba(26,188,156,0.10); }
  .trend-delta .dt.down { color: #f59e0b; background: rgba(245,158,11,0.10); }
  .trend-delta .dt.flat { color: rgba(232,234,240,0.55); background: rgba(232,234,240,0.06); }

  /* ===== P2-B：首测发钻一次性提示条（quiz 页经 sessionStorage 传来） ===== */
  .first-bonus-tip {
    display: flex; align-items: center; justify-content: center; gap: 10px;
    padding: 12px 18px; margin-bottom: 24px;
    background: rgba(245,158,11,0.10);
    border: 1px solid rgba(245,158,11,0.35);
    border-radius: 8px;
    font-size: 14px; color: #fbbf24;
    letter-spacing: 0.05em;
  }
  .first-bonus-tip .fb-ico {
    font-size: 12px; color: rgba(251,191,36,0.75);
  }
  .first-bonus-tip b {
    font-family: "Consolas", monospace;
    font-size: 16px; color: #fde68a;
    padding: 0 2px;
  }

  @media (max-width: 720px) {
    .result-mbti { font-size: 64px; letter-spacing: 10px; }
    .result-name { font-size: 18px; }
    .dims-card, .type-card { padding: 24px; }
    .dim-row { grid-template-columns: 60px 1fr 50px; gap: 10px; }
    .dim-letters { font-size: 18px; }
    .trend-card { padding: 24px; }
    .trend-chart { height: 200px; }
  }
