/* ============================================================
   HD Decode Pro - Main Stylesheet
   Extracted from index.html for better caching & maintainability
   ============================================================ */

  /* ══════════════════════════════════════════
     HD Decode Pro - 基礎樣式
     完整樣式會從原始版本遷移過來
     ══════════════════════════════════════════ */

  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { overflow-x: hidden; }
  body {
    font-family: 'Noto Sans TC', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', sans-serif;
    -webkit-text-size-adjust: 100%;
    overflow-x: hidden;
    width: 100%;
    background: #0a1018;
    background-image:
      radial-gradient(ellipse 90% 50% at 10% 0%, rgba(60,100,160,0.12) 0%, transparent 60%),
      radial-gradient(ellipse 70% 40% at 90% 100%, rgba(40,100,120,0.08) 0%, transparent 60%);
    color: #dce6f0;
    min-height: 100vh;
    font-size: 15px;
    line-height: 1.6;
  }
  @media (max-width: 768px) {
    /* html font-size 控制所有 rem 單位，是真正放大手機文字的關鍵 */
    html { font-size: 17px; }
    body { font-size: 17px; }
    /* 主要閱讀區塊：配合較大字體加大行高，提升舒適度 */
    .dg-tab-content          { line-height: 1.92; }
    .dgp-result-body         { line-height: 1.82; }
    .dgp-insight-text        { line-height: 1.78; }
    .landing-hook-box p      { line-height: 1.9 !important; }
    .landing-edu-box p,
    .landing-guide-box p     { line-height: 1.85 !important; }
    .card-body p             { line-height: 1.78; }
    /* 確保報告說明文字有足夠寬鬆感 */
    .output-card .card-body  { line-height: 1.75; }
  }
  /* 超小螢幕（≤360px）安全網：避免文字溢出 */
  @media (max-width: 360px) {
    html { font-size: 16px; }
    body { font-size: 16px; }
  }

  .hidden { display: none !important; }

  /* ── Header ── */
  .site-header {
    background: linear-gradient(160deg, #060a12 0%, #0b1520 40%, #101e2e 70%, #152438 100%);
    padding: 38px 20px 34px;
    text-align: center;
    border-bottom: 1px solid rgba(74,130,188,0.15);
    position: relative;
    overflow: hidden;
  }
  @media (max-width: 480px) {
    .site-header {
      padding: 24px 12px 20px;
    }
    .site-header h1 {
      font-size: 1.25rem;
      line-height: 1.2;
    }
    .site-header .header-brand {
      font-size: 0.65rem;
      margin-bottom: 8px;
    }
    .site-header .subtitle {
      font-size: 0.75rem;
    }
    .site-header .header-divider {
      margin: 8px auto 8px;
      max-width: 240px;
    }
  }
  .site-header::before {
    content: '';
    position: absolute;
    top: -60px; left: 50%; transform: translateX(-50%);
    width: 520px; height: 180px;
    background: radial-gradient(ellipse, rgba(80,160,220,0.12) 0%, transparent 70%);
    pointer-events: none;
  }
  .site-header::after {
    content: '';
    position: absolute;
    bottom: 0; left: 10%; right: 10%;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100,180,255,0.25), rgba(180,220,255,0.4), rgba(100,180,255,0.25), transparent);
  }
  .site-header .header-brand {
    font-size: 0.75rem; font-weight: 500; letter-spacing: 0.38em;
    color: rgba(140,200,240,0.6);
    text-transform: uppercase;
    margin-bottom: 10px;
  }
  .site-header h1 {
    font-size: 1.75rem; font-weight: 200; letter-spacing: 0.22em;
    background: linear-gradient(135deg, #ffffff 0%, #d8eeff 30%, #b0d8f8 60%, #a0e8dc 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 0;
    line-height: 1.3;
  }
  .site-header .header-divider {
    display: flex; align-items: center; justify-content: center;
    gap: 10px; margin: 12px auto 10px;
    max-width: 280px;
  }
  .site-header .header-divider::before,
  .site-header .header-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(120,180,220,0.35));
  }
  .site-header .header-divider::after {
    background: linear-gradient(90deg, rgba(120,180,220,0.35), transparent);
  }
  .site-header .header-divider span {
    font-size: 0.65rem; color: rgba(140,200,240,0.5); letter-spacing: 0.2em;
  }
  .site-header .subtitle {
    font-size: 0.8rem; color: rgba(160,200,225,0.5); margin-top: 2px;
    letter-spacing: 0.12em;
  }

  @keyframes headerGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
  }

  /* ── Navigation ── */
  .site-nav {
    display: flex; justify-content: center; gap: 6px;
    padding: 10px 16px;
    background: #080e18;
    border-bottom: 1px solid rgba(60,100,150,0.18);
    flex-wrap: wrap;
    overflow-x: auto;
  }
  .site-nav a {
    color: #5a7e9a;
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.03em;
    padding: 10px 15px;
    border-radius: 20px;
    border: 1px solid transparent;
    background: transparent;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }
  @media (max-width: 480px) {
    .site-nav {
      padding: 8px 8px;
      gap: 4px;
      -webkit-overflow-scrolling: touch;
    }
    .site-nav a {
      padding: 8px 12px;
      font-size: 0.75rem;
      min-height: 44px;
    }
  }
  .site-nav a:hover {
    background: rgba(60,110,160,0.14);
    border-color: rgba(70,130,190,0.25);
    color: #8abcda;
  }
  .site-nav a.active {
    background: linear-gradient(135deg, #102030, #162840);
    border-color: rgba(80,160,220,0.35);
    color: #90d0f0;
    box-shadow: 0 1px 8px rgba(40,120,200,0.15), inset 0 1px 0 rgba(120,200,255,0.06);
  }
  .site-nav a:active {
    transform: scale(0.96);
    opacity: 0.85;
  }
  /* emoji 字號微調，讓它和文字等高感更一致 */
  .site-nav a .nav-emoji { font-size: 0.9em; }

  /* ── Auth Bar ── */
  .auth-bar {
    display: flex; justify-content: flex-end; align-items: center;
    padding: 12px 20px; gap: 12px;
    background: #080e18;
    font-size: 0.8rem;
    flex-wrap: wrap;
  }
  .auth-bar .user-email { color: #6090b0; }
  .auth-bar button {
    background: #1a2838; color: #70a8c8; border: 1px solid #2a4060;
    padding: 8px 16px; border-radius: 16px; font-size: 0.78rem;
    cursor: pointer; transition: all 0.2s;
    min-height: 44px;
    min-width: 44px;
  }
  .auth-bar button:hover { background: #2a3848; }
  @media (max-width: 480px) {
    .auth-bar {
      padding: 8px 12px;
      gap: 8px;
      justify-content: flex-end;
    }
    .auth-bar .user-email {
      display: none;
    }
    .auth-bar button {
      padding: 8px 16px;
      font-size: 0.75rem;
    }
  }

  /* ── App Sections ── */
  .app-section {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
  @supports (padding: max(0px)) {
    body {
      padding-left: max(0px, env(safe-area-inset-left));
      padding-right: max(0px, env(safe-area-inset-right));
    }
  }

  /* ── Input Sidebar (in home page) ── */
  .input-sidebar {
    max-width: 560px;
    margin: 0 auto;
  }

  /* ── Loading ── */
  .loading-state {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 300px; gap: 16px;
  }
  .loading-spinner {
    width: 40px; height: 40px;
    border: 3px solid #1a2838; border-top-color: #70a8c8;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
  }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes pulse-glow {
    0% { box-shadow: 0 0 0 0 rgba(208,168,80,0.4); }
    50% { box-shadow: 0 0 18px 6px rgba(208,168,80,0.25); }
    100% { box-shadow: 0 0 0 0 rgba(208,168,80,0); }
  }
  .loading-text { color: #6090b0; font-size: 0.85rem; }

  /* ── Error & Empty States ── */
  .error-state, .empty-reports, .auth-prompt {
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; min-height: 300px; gap: 12px;
    text-align: center;
  }
  .error-icon, .empty-icon, .auth-icon { font-size: 3rem; }
  .error-title, .empty-title, .auth-title {
    font-size: 1.2rem; font-weight: 700; color: #c0d0e0;
  }
  .error-desc, .empty-desc, .auth-desc {
    font-size: 0.85rem; color: #6090b0; max-width: 400px;
  }

  /* ── Buttons ── */
  .btn-back, .btn-create, .btn-login, .btn-create-new {
    background: linear-gradient(135deg, #1a3050, #2a4060);
    color: #90c8e0; border: 1px solid #3a5878;
    padding: 12px 24px; border-radius: 10px;
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: all 0.2s;
    text-decoration: none;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  .btn-back:hover, .btn-create:hover, .btn-login:hover, .btn-create-new:hover {
    background: linear-gradient(135deg, #2a4060, #3a5878);
    transform: translateY(-1px);
  }
  @media (max-width: 480px) {
    .btn-back, .btn-create, .btn-login, .btn-create-new {
      padding: 12px 20px;
      font-size: 0.8rem;
      width: 100%;
    }
  }

  /* ── Report Header ── */
  .report-header {
    text-align: center; padding: 24px 0 20px;
    border-bottom: 1px solid #1a2838; margin-bottom: 20px;
  }
  .report-brand {
    font-size: 1.3rem; font-weight: 700;
    background: linear-gradient(135deg, #e8f2ff, #b8e8dc);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  }
  .report-name {
    font-size: 1rem; color: #a0b8d0; margin-top: 6px;
  }
  .report-meta {
    display: flex; justify-content: center; gap: 12px; margin-top: 10px;
  }
  .report-tier-badge {
    font-size: 0.72rem; font-weight: 700; padding: 3px 12px;
    border-radius: 20px;
  }
  .tier-free { background: #142820; color: #50b080; }
  .tier-standard { background: #2a1808; color: #e0a050; }
  .report-date { font-size: 0.75rem; color: #5a7090; }

  /* ── Freq Toggle ── */
  .freq-toggle-bar {
    display: flex; justify-content: center; gap: 8px;
    margin-bottom: 20px;
  }
  .freq-btn {
    background: #141c28; color: #5a7890; border: 1px solid #1e2838;
    padding: 8px 20px; border-radius: 20px;
    font-size: 0.82rem; cursor: pointer; transition: all 0.2s;
  }
  .freq-btn.active {
    background: #1a3050; color: #90c8e0; border-color: #3a5878;
  }

  /* ── Output Cards (沿用原始設計) ── */
  .output-card {
    background: #0e1420;
    border: 1px solid #1e2838;
    border-radius: 14px;
    margin-bottom: 16px;
    overflow: hidden;
  }
  .card-header {
    display: flex; align-items: center; gap: 12px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #101824, #141e2c);
    border-bottom: 1px solid #1e2838;
  }
  .card-icon { font-size: 1.3rem; flex-shrink: 0; }
  .card-title { font-size: 1rem; font-weight: 700; color: #c0d0e0; }
  .card-subtitle { font-size: 0.72rem; color: #5a7898; margin-top: 1px; }
  .card-body { padding: 16px; }
  #app-report .card-body.collapsed {
    display: none !important;
  }
  .card-body.collapsed { display: none; }

  /* ── 報告頁容器：限制行寬提升閱讀性 ── */
  #app-report {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 16px 48px;
  }
  #app-report .card-body {
    line-height: 1.82;
  }

  /* ── 報告頁卡片樣式（#app-report 限定，覆蓋 input-panel.css 的全域衝突） ── */
  #app-report .output-card {
    overflow: hidden;
  }
  #app-report .card-header {
    display: flex !important; align-items: center !important; gap: 12px !important;
    padding: 14px 16px !important;
    overflow: visible !important;
    position: relative !important;
    cursor: pointer; user-select: none; transition: background 0.15s;
  }
  #app-report .card-header:hover { filter: brightness(1.1); }
  #app-report .card-header:active { filter: brightness(0.95); }
  #app-report .card-header::after { display: none !important; }
  #app-report .card-header > * {
    visibility: visible !important; opacity: 1 !important;
  }
  #app-report .card-header .card-icon {
    display: flex !important; align-items: center !important; justify-content: center !important;
    width: 42px !important; height: 42px !important; flex-shrink: 0 !important;
    min-width: 42px !important;
  }
  #app-report .card-header .card-title {
    display: block !important; color: #c0d0e0 !important;
  }
  #app-report .card-header .card-subtitle {
    display: block !important;
  }
  #app-report .card-collapse-btn {
    position: static !important;
    transform: none !important;
    background: rgba(50,80,110,0.6) !important; border: 1px solid rgba(100,160,220,0.35) !important;
    color: #90c8e8 !important; font-size: 1.1rem !important; font-weight: 700; cursor: pointer;
    padding: 4px 12px !important; border-radius: 8px !important;
    transition: all 0.2s; flex-shrink: 0 !important;
    display: inline-flex !important; align-items: center; justify-content: center;
    min-width: 48px !important; min-height: 48px !important; /* WCAG 2.5.5 觸控目標最小值 */
    box-shadow: 0 2px 8px rgba(0,0,0,0.25);
    width: auto !important; height: auto !important;
    right: auto !important; top: auto !important;
    -webkit-tap-highlight-color: transparent;
  }
  #app-report .card-collapse-btn:hover {
    background: rgba(70,110,150,0.7) !important; color: #b0e0ff !important;
    border-color: rgba(120,180,240,0.5) !important;
    box-shadow: 0 3px 12px rgba(40,100,180,0.3);
    transform: scale(1.08) !important;
  }

  /* ── 漸進式揭露（Progressive Disclosure）── */
  .hd-summary-block {
    margin-bottom: 4px;
  }
  .hd-summary-text {
    font-size: 0.92rem;
    color: #c8d8e8;
    line-height: 1.82;
    margin: 0 0 12px 0;
  }
  .hd-detail-toggle {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(40,70,110,0.35);
    border: 1px solid rgba(80,130,200,0.3);
    color: #7aabcc;
    font-size: 0.8rem; font-weight: 600;
    padding: 6px 14px; border-radius: 20px;
    cursor: pointer; transition: all 0.2s;
    margin-bottom: 4px;
    white-space: nowrap;
  }
  .hd-detail-toggle:hover {
    background: rgba(50,90,140,0.5);
    border-color: rgba(100,160,230,0.5);
    color: #a0d0f0;
    box-shadow: 0 2px 8px rgba(40,100,180,0.2);
  }
  .hd-toggle-arrow { font-size: 0.75rem; transition: transform 0.2s; }
  .hd-detail-block {
    display: none;
    animation: hdFadeIn 0.25s ease;
  }
  .hd-detail-block.hd-detail-open { display: block; }
  @keyframes hdFadeIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  /* ── 生活呼應盒 ── */
  .hd-resonate-box {
    margin-top: 20px;
    padding: 18px 20px 16px;
    background: linear-gradient(135deg, rgba(200,160,50,0.07), rgba(160,120,30,0.04));
    border: 1px solid rgba(200,160,60,0.28);
    border-radius: 12px;
    position: relative;
  }
  .hd-resonate-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(200,160,60,0.45), transparent);
  }
  .hrb-header {
    display: flex; align-items: center; gap: 6px; margin-bottom: 10px;
  }
  .hrb-emoji { font-size: 0.9rem; }
  .hrb-label {
    font-size: 0.62rem; letter-spacing: 0.22em; font-weight: 700;
    color: #c09040; text-transform: uppercase;
  }
  .hrb-question {
    font-size: 1rem; color: #e8dfc8; line-height: 1.7;
    margin-bottom: 14px; font-weight: 500;
  }
  .hrb-options {
    display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 0;
  }
  .hrb-opt {
    padding: 6px 14px; border-radius: 20px;
    border: 1px solid rgba(200,160,60,0.22);
    font-size: 0.875rem; color: #a08868;
    cursor: pointer; transition: all 0.18s;
    background: rgba(200,160,60,0.04);
    font-family: inherit; line-height: 1.4;
    -webkit-tap-highlight-color: transparent;
  }
  .hrb-opt:hover {
    border-color: rgba(200,160,60,0.5); color: #d4a840;
    background: rgba(200,160,60,0.10);
  }
  .hrb-opt.hrb-selected {
    border-color: #c09040; color: #e8c060;
    background: rgba(200,160,60,0.14);
    font-weight: 600;
  }
  .hrb-feedback-wrap {
    display: none;
    margin-top: 14px;
    padding: 14px 16px;
    background: rgba(200,160,60,0.06);
    border-left: 2px solid rgba(200,160,60,0.5);
    border-radius: 0 8px 8px 0;
    animation: hrb-fadein 0.22s ease;
  }
  .hrb-feedback {
    font-size: 0.95rem; color: #d8c898; line-height: 1.75;
  }
  @keyframes hrb-fadein {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ── 共鳴計數器 ── */
  .hd-resonate-counter {
    display: none;
    align-items: center; justify-content: center; gap: 8px;
    margin: 32px 0 0;
    padding: 12px 20px;
    background: linear-gradient(135deg, rgba(167,139,250,0.08), rgba(120,90,200,0.05));
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 10px;
    font-size: 0.85rem; color: #b0a8d0; text-align: center;
  }
  .hrc-num {
    font-size: 1.4rem; font-weight: 800;
    color: #c4b5fd; line-height: 1;
  }

  /* ── 動態共鳴 CTA ── */
  .hd-resonate-cta {
    display: none;
    margin: 20px 0 0;
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(30,20,60,0.7), rgba(20,15,48,0.5));
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 12px;
  }
  .hrb-cta-inner {
    display: flex; gap: 12px; align-items: flex-start;
  }
  .hrb-cta-icon {
    font-size: 1rem; color: #a78bfa; flex-shrink: 0; margin-top: 2px;
  }
  .hrb-cta-text {
    font-size: 0.86rem; color: #c4b5fd; line-height: 1.7;
  }
  .hrb-cta-text strong { color: #e0d0ff; }

  @media (max-width: 640px) {
    .hrb-opt { font-size: 0.75rem; padding: 5px 12px; }
    .hrb-question { font-size: 0.86rem; }
  }

  /* ── 章節導覽列（Part Nav）── */
  .report-chapter-nav {
    display: flex; gap: 0;
    border-radius: 10px; overflow: hidden;
    border: 1px solid rgba(167,139,250,0.15);
    margin: 20px 0 0;
  }
  .report-chapter-nav-item {
    flex: 1; padding: 10px 6px; text-align: center;
    font-size: 0.72rem; color: #607888;
    background: rgba(22, 30, 55, 0.60);
    cursor: pointer; transition: all 0.2s;
    border: none; border-right: 1px solid rgba(167,139,250,0.10);
    border-radius: 0; outline: none;
    line-height: 1.3; text-decoration: none;
    display: block; font-family: inherit;
  }
  .report-chapter-nav-item:last-child { border-right: none; }
  .report-chapter-nav-item:hover {
    background: rgba(167,139,250,0.08);
    color: #a78bfa;
  }
  .report-chapter-nav-item.rcn-active {
    background: rgba(167,139,250,0.12);
    color: #c4b5fd;
    font-weight: 600;
  }
  .report-chapter-nav-item.rcn-pro { color: #c0944a; }
  .report-chapter-nav-item.rcn-pro:hover,
  .report-chapter-nav-item.rcn-pro.rcn-active {
    background: rgba(212,168,64,0.10);
    color: #d0a850;
  }
  .rcn-num {
    font-size: 0.60rem; color: rgba(96,120,136,0.6);
    margin-bottom: 2px; letter-spacing: 0.08em;
  }
  .report-chapter-nav-item.rcn-pro .rcn-num { color: rgba(192,148,74,0.55); }

  /* ── 章節分隔（Chapter Break）── */
  .report-chapter-break {
    margin: 44px 0 0;
    padding: 22px 22px 18px;
    background: rgba(14, 20, 44, 0.88);
    border-radius: 14px;
    border: 1px solid rgba(200,160,60,0.22);
    position: relative;
    overflow: hidden;
    scroll-margin-top: 12px;
  }
  .report-chapter-break::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, transparent, rgba(200,160,60,0.55), rgba(210,170,70,0.85), rgba(200,160,60,0.55), transparent);
  }
  .report-chapter-break.rcb-pro {
    border-color: rgba(200,160,60,0.35);
  }
  .rcb-icon {
    position: absolute; right: 18px; top: 50%; transform: translateY(-50%);
    font-size: 1.9rem; opacity: 0.14; pointer-events: none;
  }
  .rcb-part-label {
    font-size: 0.62rem; letter-spacing: 0.28em; color: #c09040;
    text-transform: uppercase; margin-bottom: 7px; font-weight: 700;
  }
  .rcb-title {
    font-size: 1.15rem; font-weight: 700; color: #f0eaff; margin-bottom: 6px;
  }
  .rcb-summary {
    font-size: 0.82rem; color: #90b8d8; line-height: 1.6;
    padding-right: 40px;
  }

  /* ── 閱讀進度條 ── */
  .report-reading-progress {
    position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 9990;
    background: rgba(255,255,255,0.04);
    pointer-events: none;
  }
  .report-reading-progress-bar {
    height: 100%; width: 0%;
    background: linear-gradient(90deg, #a78bfa, #d4a840);
    transition: width 0.12s linear;
  }

  @media (max-width: 640px) {
    .report-chapter-break { padding: 18px 16px 14px; }
    .rcb-title { font-size: 1.0rem; }
    .rcb-icon { display: none; }
    .report-chapter-nav-item { font-size: 0.65rem; padding: 8px 4px; }
  }

  /* 全域展開/收起按鈕 */
  .hd-expand-all-btn {
    display: inline-flex; align-items: center; gap: 6px;
    background: rgba(30,50,80,0.5);
    border: 1px solid rgba(80,130,200,0.25);
    color: #6090b0; font-size: 0.75rem; font-weight: 600;
    padding: 5px 12px; border-radius: 14px;
    cursor: pointer; transition: all 0.2s;
    margin-top: 8px;
  }
  .hd-expand-all-btn:hover {
    background: rgba(40,70,110,0.6);
    border-color: rgba(100,160,220,0.4);
    color: #90c0e0;
  }
  /* 底部收起按鈕 */
  .hd-bottom-close-wrap {
    display: flex; justify-content: center;
    padding: 20px 0 4px;
    border-top: 1px solid rgba(74,130,188,0.12);
    margin-top: 16px;
  }
  .hd-bottom-close-btn {
    display: inline-flex; align-items: center; gap: 5px;
    background: rgba(20,38,60,0.55);
    border: 1px solid rgba(74,130,188,0.22);
    color: #6090b0; font-size: 0.74rem; font-weight: 600;
    padding: 5px 14px; border-radius: 14px;
    cursor: pointer; transition: all 0.2s;
    letter-spacing: 0.02em;
  }
  .hd-bottom-close-btn:hover {
    background: rgba(40,70,110,0.65);
    border-color: rgba(100,160,220,0.38);
    color: #90c0e0;
  }

  /* ── 報告頁浮動導航按鈕 ── */
  .report-fab {
    position: fixed; bottom: 24px; right: 20px; z-index: 802; /* 高於 TOC 模糊背景幕(799)和 toc-list(801) */
    display: flex; flex-direction: column; align-items: flex-end; gap: 0;
    bottom: max(24px, calc(24px + env(safe-area-inset-bottom)));
    right: max(20px, calc(20px + env(safe-area-inset-right)));
  }
  @media (max-width: 480px) {
    .report-fab {
      bottom: max(16px, calc(16px + env(safe-area-inset-bottom)));
      right: max(12px, calc(12px + env(safe-area-inset-right)));
    }
  }
  .report-fab-toggle {
    width: 56px; height: 56px; border-radius: 50%;
    background: linear-gradient(135deg, #1e3a60, #2a4a70);
    border: 1px solid rgba(100,180,255,0.45);
    color: #a0d0f0; font-size: 1.3rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.4);
    transition: all 0.2s;
    min-width: 56px;
    min-height: 56px;
  }
  .report-fab-toggle:hover {
    background: linear-gradient(135deg, #223858, #2a4868);
    border-color: rgba(100,180,255,0.4);
    transform: scale(1.05);
  }
  @media (max-width: 480px) {
    .report-fab-toggle {
      width: 52px;
      height: 52px;
      min-width: 52px;
      min-height: 52px;
      bottom: 20px;
      right: 16px;
    }
  }
  .report-fab-menu {
    display: none; flex-direction: column; gap: 6px;
    margin-bottom: 10px; align-items: flex-end;
  }
  .report-fab.open .report-fab-menu { display: flex; }
  .report-fab-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 10px;
    background: rgba(16,28,48,0.97); border: 1px solid rgba(80,130,180,0.45);
    color: #b0d0e8; font-size: 0.78rem; font-weight: 600;
    cursor: pointer; white-space: nowrap;
    box-shadow: 0 2px 12px rgba(0,0,0,0.3);
    transition: all 0.15s; backdrop-filter: blur(8px);
  }
  .report-fab-item:hover {
    background: rgba(26,40,60,0.95); color: #b0d8f0;
    border-color: rgba(100,160,220,0.4);
  }
  .report-fab-item .fab-icon { font-size: 1rem; flex-shrink: 0; }

  /* TOC 子選單 */
  .fab-toc-list {
    display: none; flex-direction: column; gap: 4px;
    margin-top: 6px; margin-right: 4px;
    max-height: 55vh; overflow-y: auto;
    background: rgba(8,16,28,0.97); border-radius: 12px;
    padding: 8px; border: 1px solid rgba(80,130,200,0.4);
    box-shadow: 0 8px 32px rgba(0,0,0,0.6);
    position: relative; z-index: 801; /* 確保在背景幕之上 */
  }
  .fab-toc-list.open { display: flex; }

  /* TOC 模糊背景幕（由 JS 動態建立，這裡只做說明） */
  /* #toc-blur-backdrop { z-index: 799 } — 見 router.js */
  .fab-toc-item {
    padding: 7px 12px; border-radius: 8px;
    background: rgba(14,26,44,0.95); border: 1px solid rgba(70,120,170,0.4);
    color: #a0c8e0; font-size: 0.76rem; font-weight: 600;
    cursor: pointer; transition: all 0.15s;
  }
  .fab-toc-item:hover { background: rgba(24,44,70,0.97); color: #c0e0ff; border-color: rgba(100,170,240,0.5); }

  .header-type { background: linear-gradient(135deg, #141020 0%, #1a1430 50%, #201840 100%); }
  .header-authority { background: linear-gradient(135deg, #0d1824 0%, #142030 50%, #18283c 100%); }
  .header-role { background: linear-gradient(135deg, #141020 0%, #1a1430 50%, #1e1840 100%); }
  .header-definition { background: linear-gradient(135deg, #0d1820 0%, #102028 50%, #142830 100%); }

  /* ── Tags & Info Rows ── */
  .info-row { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
  .tag {
    font-size: 0.78rem; font-weight: 600; padding: 3px 10px;
    border-radius: 20px; display: inline-block;
  }
  .tag-strategy { background: #182840; color: #70a8d8; }
  .tag-percent { background: #1a2028; color: #8898a8; }
  .tag-nonself { background: #281820; color: #d08080; }

  .section-label {
    font-size: 0.7rem; font-weight: 700; color: #5a7898;
    letter-spacing: 0.1em; margin: 12px 0 6px;
    text-transform: uppercase;
  }

  .trait-list { display: flex; flex-direction: column; gap: 6px; }
  .trait-item {
    display: flex; align-items: flex-start; gap: 8px;
    font-size: 0.84rem; color: #b0c0d0; line-height: 1.55;
  }
  .trait-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #4a90c0; margin-top: 7px; flex-shrink: 0;
  }

  .advice-box {
    border-left: 3px solid #2a7050; background: #182820;
    border-radius: 0 8px 8px 0; padding: 10px 14px;
    font-size: 0.84rem; color: #a0c8b0; line-height: 1.6;
  }

  .decision-steps { display: flex; flex-direction: column; gap: 8px; }
  .step {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.84rem; color: #b0c0d0; line-height: 1.55;
  }
  .step-num {
    background: #1a3050; color: #70a8c8;
    width: 22px; height: 22px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; flex-shrink: 0;
  }

  /* ── Upgrade Prompt ── */
  .upgrade-prompt {
    background: linear-gradient(135deg, #1a1408, #201810, #180e20);
    border: 1px solid #3a3020;
    border-radius: 16px;
    padding: 32px 24px;
    text-align: center;
    margin: 24px 0;
  }
  .upgrade-icon { font-size: 2.5rem; margin-bottom: 12px; }
  .upgrade-title {
    font-size: 1.2rem; font-weight: 700; color: #e0c070;
    margin-bottom: 8px;
  }
  .upgrade-desc {
    font-size: 0.85rem; color: #a09080; margin-bottom: 16px;
    line-height: 1.6;
  }
  .upgrade-features {
    text-align: left; max-width: 400px; margin: 0 auto 20px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .upgrade-feature {
    font-size: 0.82rem; color: #c0a880; padding: 4px 0;
  }
  .upgrade-btn {
    background: linear-gradient(135deg, #b08030, #d0a040);
    color: #1a1408; border: none;
    padding: 12px 32px; border-radius: 10px;
    font-size: 0.95rem; font-weight: 700;
    cursor: pointer; transition: all 0.2s;
  }
  .upgrade-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(200,160,60,0.3);
  }
  .upgrade-invite {
    margin-top: 12px; font-size: 0.78rem; color: #706050;
  }
  .upgrade-invite a { color: #a08060; }

  /* ── 主題切換提醒 Banner ── */
  .report-theme-tip {
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
    margin: 8px 0 16px;
    padding: 12px 14px 12px 16px;
    background: rgba(60,100,160,0.07);
    border: 1px solid rgba(80,140,220,0.18);
    border-radius: 10px;
    font-size: 0.8rem;
    line-height: 1.55;
    transition: opacity 0.28s ease, transform 0.28s ease;
  }
  .rtt-body {
    display: flex; align-items: flex-start; gap: 10px; flex: 1;
  }
  .rtt-icon {
    font-size: 0.9rem; flex-shrink: 0; opacity: 0.7; margin-top: 1px;
  }
  .rtt-text {
    color: #7a9ab8;
  }
  .rtt-text strong {
    color: #90b8d8; font-weight: 600;
  }
  .rtt-close {
    background: none; border: none; cursor: pointer;
    color: #507090; font-size: 0.9rem; padding: 0 2px;
    flex-shrink: 0; line-height: 1; opacity: 0.6;
    transition: opacity 0.15s;
  }
  .rtt-close:hover { opacity: 1; }
  /* 淺色版 Banner（Morning Mist 系統）*/
  body.theme-light .report-theme-tip {
    background: rgba(80,110,200,0.05);
    border-color: rgba(80,110,200,0.14);
  }
  body.theme-light .rtt-text  { color: #384060; }
  body.theme-light .rtt-text strong { color: #3a5098; }
  body.theme-light .rtt-close { color: #6878a8; }

  /* ── Report Footer ── */
  .report-footer {
    text-align: center; padding: 24px 0;
    border-top: 1px solid #1a2838; margin-top: 24px;
  }
  .report-share { margin-bottom: 8px; color: #6090b0; font-size: 0.85rem; }
  .share-btn {
    background: #1a2838; color: #70a8c8; border: 1px solid #2a4060;
    padding: 6px 16px; border-radius: 20px; font-size: 0.8rem;
    cursor: pointer; transition: all 0.2s;
  }
  .share-btn:hover { background: #2a3848; }
  .report-permalink {
    font-size: 0.72rem; color: #3a5068;
    font-family: monospace; margin-top: 8px;
  }

  /* ── My Reports List ── */
  .my-reports-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 20px;
  }
  .my-reports-header h2 {
    font-size: 1.2rem; color: #c0d0e0;
  }
  .reports-list {
    display: flex; flex-direction: column; gap: 8px;
  }
  .report-list-item {
    display: flex; justify-content: space-between; align-items: center;
    background: #0e1420; border: 1px solid #1e2838;
    border-radius: 10px; padding: 14px 18px;
    cursor: pointer; transition: all 0.2s;
  }
  .report-list-item:hover {
    background: #141c28; border-color: #2a4060;
  }
  .report-list-name {
    font-weight: 700; color: #c0d0e0; font-size: 0.92rem;
  }
  .report-list-info {
    font-size: 0.78rem; color: #6090b0; margin-top: 2px;
  }
  .report-list-meta {
    display: flex; align-items: center; gap: 10px;
  }
  .report-list-date {
    font-size: 0.72rem; color: #4a6080;
  }
  .report-delete-btn {
    background: transparent; border: 1px solid transparent;
    color: #4a5868; font-size: 0.9rem; cursor: pointer;
    padding: 4px 8px; border-radius: 8px; transition: all 0.2s;
    line-height: 1; flex-shrink: 0;
  }
  .report-delete-btn:hover {
    background: rgba(160,50,50,0.15); border-color: rgba(200,80,80,0.3);
    color: #e07070;
  }

  /* ── Login Modal ── */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000;
  }
  .modal-box {
    background: #0e1824; border: 1px solid #2a3848;
    border-radius: 16px; padding: 32px 28px;
    max-width: 400px; width: 90%;
  }
  .modal-title {
    font-size: 1.1rem; font-weight: 700; color: #c0d0e0;
    text-align: center; margin-bottom: 20px;
  }
  .modal-input {
    width: 100%; padding: 10px 14px;
    background: #141c28; border: 1px solid #2a3848;
    border-radius: 8px; color: #c0d0e0;
    font-size: 0.9rem; margin-bottom: 12px;
  }
  .modal-input:focus {
    outline: none; border-color: #4a6888;
  }
  .modal-btn {
    width: 100%; padding: 10px;
    background: linear-gradient(135deg, #1a3050, #2a4060);
    color: #90c8e0; border: 1px solid #3a5878;
    border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    cursor: pointer; margin-bottom: 8px;
    transition: all 0.2s;
  }
  .modal-btn:hover { background: linear-gradient(135deg, #2a4060, #3a5878); }
  .modal-btn-google {
    background: #fff; color: #333; border: 1px solid #ddd;
  }
  .modal-btn-google:hover { background: #f5f5f5; }
  .modal-close {
    text-align: center; margin-top: 12px;
  }
  .modal-close a {
    color: #5a7890; font-size: 0.82rem; text-decoration: none;
    cursor: pointer;
  }

  /* ── Toast ── */
  .toast {
    position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%);
    background: #1a2a20; color: #60c890;
    border: 1px solid #2a5038; border-radius: 10px;
    padding: 10px 20px; font-size: 0.82rem; font-weight: 600;
    z-index: 20000; box-shadow: 0 4px 16px rgba(0,0,0,0.4);
    transition: opacity 0.5s;
    max-width: min(90vw, 480px); text-align: center; line-height: 1.4;
  }
  .toast.fade-out { opacity: 0; }
  .toast.toast-error {
    background: #2a1010; color: #f08080;
    border-color: #5a2828;
    box-shadow: 0 4px 20px rgba(200,60,60,0.25);
  }
  .toast.toast-warn {
    background: #211808; color: #e0a840;
    border-color: #4a3010;
    box-shadow: 0 4px 20px rgba(200,140,40,0.2);
  }

  /* ── 登入 Modal 錯誤訊息 ── */
  .login-error-msg {
    display: none;
    background: rgba(200,60,60,0.1);
    border: 1px solid rgba(200,60,60,0.3);
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 0.82rem;
    color: #e08080;
    margin-bottom: 10px;
    text-align: center;
    line-height: 1.5;
  }

  /* ── PRO Badge ── */
  .pro-badge {
    display: inline-block;
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    padding: 2px 7px;
    border-radius: 4px;
    background: linear-gradient(135deg, #b08030, #d0a040);
    color: #1a1408;
    vertical-align: middle;
    margin-left: 6px;
    position: relative;
    top: -1px;
  }
  .pro-hint {
    font-size: 0.75rem;
    color: #a09060;
    background: rgba(180,140,60,0.08);
    border: 1px solid rgba(180,140,60,0.15);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 10px;
    line-height: 1.5;
  }

  /* ── Responsive ── */
  /* ── Landing Page Grid ── */
  .landing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

  /* ── 手機全面優化 ── */

  /* 導航列：手機觸控友善 */
  @media (max-width: 768px) {
    .site-nav {
      gap: 4px;
      padding: 8px 6px;       /* 左右收小，讓五個標籤有更多空間 */
      justify-content: center; /* 置中分佈，左右均衡 */
      flex-wrap: nowrap;
      overflow-x: auto;        /* 極小螢幕仍可橫滑 */
      -webkit-overflow-scrolling: touch;
      scrollbar-width: none;
    }
    .site-nav::-webkit-scrollbar { display: none; }
    .site-nav a {
      font-size: 0.75rem;      /* 17px base × 0.75 = 12.75px，保持緊湊五欄版型 */
      padding: 8px 9px;
      white-space: nowrap;
      flex-shrink: 0;
      min-height: 38px;
      display: inline-flex;
      align-items: center;
      gap: 3px;
    }
    .auth-bar {
      padding: 8px 12px;
      flex-wrap: wrap;
      justify-content: center;
      gap: 8px;
    }
    .auth-bar button {
      padding: 8px 16px;
      min-height: 36px;
      font-size: 0.82rem;
    }
    .app-section { padding: 14px 12px; }
    .modal-box { padding: 24px 20px; width: 94%; }
    .modal-input { padding: 12px 14px; font-size: 1rem; }
    .modal-btn { padding: 12px; font-size: 0.95rem; min-height: 44px; }
    .report-meta { flex-wrap: wrap; }
    .report-list-item { padding: 14px; flex-direction: column; align-items: flex-start; gap: 8px; }
    .report-list-meta { align-self: flex-end; }
    .my-reports-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .freq-toggle-bar { flex-wrap: wrap; }
    .freq-btn { padding: 10px 16px; min-height: 40px; font-size: 0.84rem; }
    .upgrade-prompt { padding: 24px 16px; }
    .upgrade-btn { padding: 14px 28px; font-size: 1rem; min-height: 48px; width: 100%; }
  }

  @media (max-width: 600px) {
    .site-header { padding: 28px 16px 24px; }
    .site-header h1 { font-size: 1.3rem; letter-spacing: 0.14em; }
    .site-header .header-brand { font-size: 0.68rem; }
    .output-card { border-radius: 10px; }
    .card-header { padding: 12px 14px; }
    .card-body { padding: 14px; }
    .landing-grid { grid-template-columns: 1fr; }
    .app-section { padding: 10px 8px; }
  }

  @media (max-width: 420px) {
    .site-header { padding: 22px 12px 20px; }
    .site-header h1 { font-size: 1.15rem; letter-spacing: 0.1em; }
    .site-header .subtitle { font-size: 0.72rem; }
    .site-nav { gap: 3px; padding: 7px 4px; }
    .site-nav a { padding: 7px 8px; font-size: 0.74rem; }
    .output-card { margin-bottom: 12px; }
    .card-header { gap: 8px; }
    .card-icon { font-size: 1.1rem; }
    .card-title { font-size: 0.92rem; }
    .card-subtitle { font-size: 0.68rem; }
    .card-body { padding: 12px; }
    .upgrade-prompt { padding: 20px 12px; margin: 16px 0; }
    .upgrade-title { font-size: 1.05rem; }
    .upgrade-desc { font-size: 0.82rem; }
    .btn-back, .btn-create, .btn-login, .btn-create-new {
      padding: 12px 20px;
      font-size: 0.9rem;
      min-height: 44px;
      width: 100%;
      text-align: center;
    }
    .report-header { padding: 16px 0 14px; }
    .report-brand { font-size: 1.1rem; }
    .toast { left: 12px; right: 12px; transform: none; text-align: center; }
  }

  /* 確保所有互動元素有最小觸控尺寸 */
  @media (pointer: coarse) {
    .site-nav a,
    .freq-btn,
    .share-btn,
    .auth-bar button,
    .btn-back, .btn-create, .btn-login,
    .modal-btn, .modal-close a,
    .card-collapse-btn {
      min-height: 48px;
      min-width: 48px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    /* report-list-item 單獨處理：只加 min-height，不覆蓋 flex 佈局 */
    .report-list-item {
      min-height: 48px;
    }
  }

  /* Safe area insets for notch devices */
  @supports (padding: max(0px)) {
    .site-header { padding-top: max(28px, env(safe-area-inset-top, 0px)); }
    .site-nav { padding-left: max(10px, env(safe-area-inset-left, 0px)); padding-right: max(10px, env(safe-area-inset-right, 0px)); }
    .toast { bottom: max(20px, env(safe-area-inset-bottom, 0px)); }
  }

  /* ══════════════════════════════════════════
     PHS 參考卡片 — 取得圖表頁
     ══════════════════════════════════════════ */
  .phs-ref-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 10px;
    margin-bottom: 10px;
  }
  .phs-ref-card {
    border-radius: 10px;
    padding: 10px;
    text-align: center;
  }
  .phs-ref-green { background: #081410; border: 1px solid #1a3020; }
  .phs-ref-blue  { background: #0a0e1a; border: 1px solid #1a2848; }
  .phs-ref-orange{ background: #140e0a; border: 1px solid #3a2818; }
  .phs-ref-title {
    font-size: 0.65rem; font-weight: 700; margin-bottom: 6px;
    letter-spacing: 0.05em;
  }
  .phs-ref-items {
    font-size: 0.72rem; line-height: 1.7;
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 2px 6px;
  }
  .phs-ref-items span {
    white-space: nowrap;   /* ← 防止單一項目被截斷 */
  }

  /* 手機版：改為垂直堆疊，內容橫向排列 */
  @media (max-width: 600px) {
    .phs-ref-grid {
      grid-template-columns: 1fr;
      gap: 8px;
    }
    .phs-ref-card {
      display: flex;
      align-items: baseline;
      gap: 10px;
      padding: 10px 14px;
      text-align: left;
    }
    .phs-ref-title {
      flex-shrink: 0;
      min-width: 86px;        /* 配合較大字級，稍微加寬避免換行 */
      font-size: 0.64rem;
      margin-bottom: 0;
    }
    .phs-ref-items {
      justify-content: flex-start;
      font-size: 0.8rem;
      gap: 2px 8px;
    }
  }

  /* ══════════════════════════════════════════
     Landing Page - 手機友善優化樣式
     ══════════════════════════════════════════ */
  .landing-wrap {
    max-width: 680px; margin: 0 auto; padding: 20px;
  }
  /* ── Hero 區塊 ── */
  .landing-hero {
    text-align: center; padding: 28px 0 24px;
    position: relative;
  }
  /* 背景徑向光暈 */
  .landing-hero-glow {
    position: absolute; top: 0; left: 50%;
    transform: translateX(-50%);
    width: 600px; height: 400px;
    background: radial-gradient(ellipse at 50% 40%, rgba(139,92,246,0.1) 0%, rgba(80,50,160,0.05) 45%, transparent 70%);
    pointer-events: none; z-index: 0;
  }
  .landing-hero > *:not(.landing-hero-glow) { position: relative; z-index: 1; }

  /* SVG Icon */
  .landing-hero-icon {
    margin-bottom: 16px;
    animation: lhi-breathe 5s ease-in-out infinite;
  }
  .lhi-svg { display: block; margin: 0 auto; }
  @keyframes lhi-breathe {
    0%, 100% { filter: drop-shadow(0 0 18px rgba(139,92,246,0.28)) drop-shadow(0 0 6px rgba(200,190,255,0.15)); }
    50%       { filter: drop-shadow(0 0 34px rgba(139,92,246,0.52)) drop-shadow(0 0 14px rgba(200,190,255,0.28)); }
  }

  /* 標題兩層重量 */
  .landing-hero-title {
    line-height: 1.55; letter-spacing: 0.12em; margin: 0;
  }
  .lht-lead {
    font-size: 1.05rem; font-weight: 200; letter-spacing: 0.18em;
    background: linear-gradient(135deg, rgba(180,195,220,0.75), rgba(140,160,200,0.65));
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    display: inline;
  }
  .lht-main {
    font-size: 2rem; font-weight: 700; letter-spacing: 0.1em;
    background: linear-gradient(135deg, #ffffff 0%, #ede9fe 40%, #c4b5fd 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    display: inline;
  }
  .lht-sub {
    font-size: 1.3rem; font-weight: 200; letter-spacing: 0.15em;
    background: linear-gradient(135deg, #dde8f8, #b8cce8);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
    display: inline;
  }

  .landing-hero-desc {
    font-size: 0.92rem; color: #7098b8; margin-top: 16px; line-height: 1.85;
    max-width: 480px; margin-left: auto; margin-right: auto;
  }

  /* CTA 主按鈕 — 紫色漸層 + 光暈 */
  .landing-cta-btn {
    margin-top: 30px; padding: 16px 48px; font-size: 1.02rem; font-weight: 600;
    background: linear-gradient(135deg, #6d28d9 0%, #7c3aed 50%, #8b5cf6 100%);
    color: #fff;
    border: 1px solid rgba(167,139,250,0.45); border-radius: 12px; cursor: pointer;
    transition: all 0.3s ease; letter-spacing: 0.08em; min-height: 52px;
    box-shadow: 0 0 24px rgba(139,92,246,0.3), 0 4px 20px rgba(0,0,0,0.28);
    -webkit-tap-highlight-color: transparent;
  }
  .landing-cta-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 42px rgba(139,92,246,0.52), 0 8px 30px rgba(0,0,0,0.32);
    background: linear-gradient(135deg, #7c3aed 0%, #8b5cf6 50%, #a78bfa 100%);
  }
  .landing-cta-btn:active {
    transform: scale(0.98); opacity: 0.9;
  }

  /* 次要 CTA */
  .landing-cta-secondary {
    display: inline-block; margin-top: 16px;
    padding: 10px 28px; font-size: 0.88rem; font-weight: 500;
    background: transparent; color: #7aaccc;
    border: 1px solid rgba(100,160,220,0.22); border-radius: 10px;
    cursor: pointer; transition: all 0.25s; letter-spacing: 0.05em;
    min-height: 44px; -webkit-tap-highlight-color: transparent;
  }
  .landing-cta-secondary:hover {
    border-color: rgba(100,180,255,0.38); color: #90c8e8;
    background: rgba(60,120,200,0.07);
  }

  .landing-hero-note {
    font-size: 0.75rem; color: #506878; margin-top: 14px; letter-spacing: 0.04em;
  }

  /* 數據區 */
  .landing-stats {
    display: flex; justify-content: center; align-items: center; gap: 24px;
    padding: 16px 0 8px; margin-bottom: 12px;
  }
  .landing-stat-item { text-align: center; }
  .landing-stat-num { font-size: 1.4rem; font-weight: 700; color: #90c8e0; }
  .landing-stat-label { font-size: 0.7rem; color: #506878; letter-spacing: 0.05em; }
  .landing-stat-divider { width: 1px; height: 36px; background: rgba(100,160,220,0.15); }

  /* 中間數據項 featured */
  .landing-stat-featured {
    background: rgba(139,92,246,0.08);
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 12px;
    padding: 10px 22px;
  }
  .landing-stat-featured .landing-stat-num {
    font-size: 1.75rem; color: #c4b5fd;
  }
  .landing-stat-featured .landing-stat-label {
    color: #7a6aaa;
  }

  /* ── 今日太陽閘門 Hook 卡片 ── */
  .landing-gate-hook {
    position: relative;
    background: linear-gradient(145deg, rgba(28,18,52,0.92), rgba(16,10,36,0.88));
    border: 1px solid rgba(212,168,64,0.22);
    border-radius: 20px;
    padding: 24px 26px;
    margin-bottom: 28px;
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(212,168,64,0.06),
      0 8px 32px rgba(0,0,0,0.35),
      inset 0 1px 0 rgba(255,255,255,0.04);
  }
  /* 頂部金色光邊 */
  .landing-gate-hook::before {
    content: '';
    position: absolute; top: 0; left: 10%; right: 10%; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(212,168,64,0.55), rgba(212,168,64,0.75), rgba(212,168,64,0.55), transparent);
    pointer-events: none;
  }
  /* 背景光暈球 */
  .lgh-bg-glow {
    position: absolute;
    width: 220px; height: 220px; border-radius: 50%;
    background: radial-gradient(circle, rgba(212,168,64,0.1) 0%, transparent 70%);
    left: -40px; top: 50%; transform: translateY(-50%);
    pointer-events: none;
  }
  .lgh-bg-glow--2 {
    width: 160px; height: 160px;
    background: radial-gradient(circle, rgba(167,139,250,0.08) 0%, transparent 70%);
    left: auto; right: -30px; top: 30%; transform: none;
  }
  /* 標題列 */
  .lgh-live-row {
    display: flex; align-items: center; gap: 7px; margin-bottom: 18px;
  }
  .lgh-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: #d4a840;
    box-shadow: 0 0 8px rgba(212,168,64,0.9), 0 0 16px rgba(212,168,64,0.4);
    animation: lghPulse 2.2s ease-in-out infinite;
    flex-shrink: 0;
  }
  @keyframes lghPulse {
    0%, 100% { opacity: 1; transform: scale(1); box-shadow: 0 0 8px rgba(212,168,64,0.9), 0 0 16px rgba(212,168,64,0.4); }
    50% { opacity: 0.5; transform: scale(0.6); box-shadow: 0 0 4px rgba(212,168,64,0.5); }
  }
  .lgh-live-label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: 0.18em;
    color: rgba(212,168,64,0.65); text-transform: uppercase;
  }
  /* 主體佈局：左圓環 + 右文字 */
  .lgh-body {
    display: flex; align-items: center; gap: 24px;
  }
  /* 閘門數字圓環 */
  .lgh-gate-ring-wrap {
    flex-shrink: 0;
  }
  .lgh-gate-ring {
    width: 96px; height: 96px; border-radius: 50%;
    border: 1.5px solid rgba(212,168,64,0.35);
    background: radial-gradient(circle at 40% 35%, rgba(212,168,64,0.14) 0%, rgba(28,18,52,0.6) 65%);
    box-shadow:
      0 0 20px rgba(212,168,64,0.12),
      inset 0 0 16px rgba(212,168,64,0.07);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    position: relative;
  }
  /* 外環裝飾弧 */
  .lgh-gate-ring::before {
    content: '';
    position: absolute; inset: -4px; border-radius: 50%;
    border: 1px solid rgba(212,168,64,0.1);
  }
  .lgh-sun-icon {
    font-size: 0.72rem; line-height: 1;
    color: rgba(212,168,64,0.55);
    margin-bottom: 2px;
  }
  .lgh-gate-num {
    font-size: 2.6rem; font-weight: 300; line-height: 1;
    color: #e0b84a;
    letter-spacing: -0.03em;
    text-shadow: 0 0 24px rgba(212,168,64,0.5), 0 0 8px rgba(212,168,64,0.3);
  }
  .lgh-gate-ring-label {
    font-size: 0.6rem; font-weight: 700; letter-spacing: 0.16em;
    color: rgba(212,168,64,0.4); text-transform: uppercase;
    margin-top: 2px;
  }
  /* 右側文字區 */
  .lgh-content {
    flex: 1; min-width: 0;
  }
  .lgh-gate-name {
    font-size: 1.08rem; font-weight: 700;
    color: #e8d898; line-height: 1.3;
    margin-bottom: 6px;
    text-shadow: 0 0 12px rgba(212,168,64,0.2);
  }
  .lgh-prompt {
    font-size: 0.85rem; color: #c8b478; font-weight: 400;
    line-height: 1.6; margin-bottom: 10px;
  }
  .lgh-desc {
    font-size: 0.73rem; color: rgba(144,130,96,0.8);
    line-height: 1.65; margin-bottom: 16px;
  }
  .lgh-actions {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  }
  /* 主要按鈕 */
  .lgh-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 9px 20px; font-size: 0.82rem; font-weight: 700;
    background: linear-gradient(135deg, rgba(212,168,64,0.18) 0%, rgba(160,120,40,0.22) 100%);
    color: #e0b84a;
    border: 1px solid rgba(212,168,64,0.4);
    border-radius: 10px; cursor: pointer; transition: all 0.25s;
    white-space: nowrap; letter-spacing: 0.03em;
    -webkit-tap-highlight-color: transparent;
    box-shadow: 0 2px 12px rgba(212,168,64,0.08);
  }
  .lgh-btn:hover {
    background: linear-gradient(135deg, rgba(212,168,64,0.28) 0%, rgba(180,136,48,0.32) 100%);
    border-color: rgba(212,168,64,0.65);
    transform: translateY(-2px);
    box-shadow: 0 4px 18px rgba(212,168,64,0.18);
    color: #f0cc60;
  }
  /* 次要文字按鈕 */
  .lgh-personal-btn {
    font-size: 0.73rem; color: rgba(180,152,88,0.7);
    background: none; border: none; cursor: pointer; padding: 0;
    text-align: left; line-height: 1.55;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
  }
  .lgh-personal-btn::after {
    content: ' →';
    opacity: 0;
    transition: opacity 0.2s, transform 0.2s;
    display: inline-block; transform: translateX(-4px);
  }
  .lgh-personal-btn:hover {
    color: rgba(212,168,64,0.95);
  }
  .lgh-personal-btn:hover::after {
    opacity: 1; transform: translateX(0);
  }
  /* 手機版 */
  @media (max-width: 480px) {
    .landing-gate-hook { padding: 20px 18px; }
    .lgh-body { gap: 16px; }
    .lgh-gate-ring { width: 82px; height: 82px; }
    .lgh-gate-num { font-size: 2.2rem; }
    .lgh-gate-name { font-size: 0.98rem; }
    .lgh-prompt { font-size: 0.82rem; }
    .lgh-actions { flex-direction: column; align-items: flex-start; gap: 10px; }
    .lgh-btn { width: 100%; justify-content: center; }
  }

  /* ── 回訪用戶識別 bar ── */
  .lgh-returning-bar {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    background: linear-gradient(135deg, rgba(20,25,55,0.7), rgba(15,18,45,0.55));
    border: 1px solid rgba(120,100,220,0.22);
    border-radius: 12px; padding: 12px 18px; margin-bottom: 16px;
  }
  .lgh-ret-icon { font-size: 0.8rem; color: rgba(160,130,255,0.5); flex-shrink: 0; }
  .lgh-ret-text { font-size: 0.78rem; color: #8880b8; flex: 1; min-width: 0; }
  .lgh-ret-btn {
    padding: 6px 14px; font-size: 0.78rem; font-weight: 600;
    background: linear-gradient(135deg, rgba(60,40,120,0.8), rgba(80,55,150,0.7));
    color: #c0b0f0; border: 1px solid rgba(120,90,200,0.35);
    border-radius: 8px; cursor: pointer; white-space: nowrap;
    transition: all 0.2s; flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
  }
  .lgh-ret-btn:hover {
    background: linear-gradient(135deg, rgba(80,55,150,0.9), rgba(100,70,180,0.8));
    border-color: rgba(140,110,220,0.55);
    transform: translateY(-1px);
  }
  @media (max-width: 480px) {
    .lgh-returning-bar { gap: 8px; }
    .lgh-ret-text { font-size: 0.74rem; }
    .lgh-ret-btn { width: 100%; text-align: center; }
  }

  .landing-hook-box {
    background: linear-gradient(135deg, rgba(25,40,60,0.6), rgba(15,25,40,0.4));
    border: 1px solid rgba(100,160,220,0.1); border-radius: 16px;
    padding: 28px 24px; margin: 20px 0 36px; text-align: center;
  }
  .landing-section-divider {
    display: flex; align-items: center; gap: 14px; margin: 8px 0 36px;
  }
  .landing-section-divider::before,
  .landing-section-divider::after {
    content: ''; flex: 1; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(100,160,220,0.2));
  }
  .landing-section-divider::after {
    background: linear-gradient(90deg, rgba(100,160,220,0.2), transparent);
  }
  .landing-section-divider span {
    font-size: 0.65rem; color: rgba(100,160,220,0.35); letter-spacing: 0.3em; white-space: nowrap;
  }
  .landing-feature-card {
    background: linear-gradient(135deg, rgba(20,35,55,0.8), rgba(15,25,40,0.6));
    border: 1px solid rgba(80,140,200,0.12); border-radius: 14px; padding: 20px 18px;
  }
  .landing-feature-icon { font-size: 1.4rem; margin-bottom: 8px; }
  .landing-feature-title { font-size: 0.88rem; font-weight: 600; color: #b0d0e8; margin-bottom: 6px; }
  .landing-feature-desc { font-size: 0.78rem; color: #6898b8; line-height: 1.6; }

  .landing-pro-box {
    background: linear-gradient(135deg, rgba(50,38,15,0.3), rgba(30,22,8,0.2));
    border: 1px solid rgba(200,160,60,0.15); border-radius: 16px;
    padding: 24px 22px; margin-bottom: 36px;
  }
  .landing-pro-tag {
    font-size: 0.75rem; color: #b0a070; background: rgba(180,140,50,0.1);
    padding: 4px 12px; border-radius: 20px; border: 1px solid rgba(180,140,50,0.15);
    white-space: nowrap;
  }

  .landing-edu-box {
    background: linear-gradient(135deg, rgba(15,28,22,0.6), rgba(12,22,18,0.4));
    border: 1px solid rgba(80,180,140,0.12); border-radius: 16px;
    padding: 28px 24px; margin-bottom: 36px;
  }
  .landing-edu-card {
    background: rgba(10,20,16,0.5); border: 1px solid rgba(80,180,140,0.1);
    border-radius: 12px; padding: 16px; margin-bottom: 12px;
  }
  .landing-guide-box {
    background: linear-gradient(135deg, rgba(25,35,55,0.7), rgba(18,28,42,0.5));
    border: 1px solid rgba(100,160,220,0.15); border-radius: 16px;
    padding: 28px 24px; margin-bottom: 36px;
  }
  .landing-step-circle {
    width: 28px; height: 28px; border-radius: 50%;
    background: linear-gradient(135deg, #1a3050, #2a4060);
    border: 1px solid rgba(100,160,220,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.72rem; font-weight: 700; color: #70a8c8; flex-shrink: 0;
  }
  .landing-step-circle-lg {
    width: 36px; height: 36px; font-size: 0.8rem;
  }
  .landing-external-link {
    display: inline-block; padding: 12px 32px; font-size: 0.92rem; font-weight: 600;
    background: linear-gradient(135deg, #1e3a58, #2a5078); color: #90d0f0;
    border: 1px solid rgba(100,180,255,0.3); border-radius: 10px;
    text-decoration: none; transition: all 0.3s; letter-spacing: 0.05em;
    min-height: 44px; -webkit-tap-highlight-color: transparent;
  }
  .landing-external-link:hover {
    transform: translateY(-2px); box-shadow: 0 6px 20px rgba(60,140,220,0.2);
  }
  .landing-external-link:active {
    transform: scale(0.98); opacity: 0.9;
  }

  /* ── Landing Page 手機適配 ── */
  @media (max-width: 768px) {
    .landing-wrap { padding: 16px 14px; }
    .landing-hero { padding: 20px 0 16px; }
    .landing-hero-icon { }
    .lhi-svg { width: 72px; height: 72px; }
    .lht-lead { font-size: 0.92rem; }
    .lht-main { font-size: 1.65rem; }
    .lht-sub { font-size: 1.1rem; }
    .landing-hero-desc { font-size: 0.86rem; line-height: 1.7; }
    .landing-hero-desc br { display: none; }
    .landing-cta-btn {
      padding: 15px 28px; font-size: 0.95rem;
      width: 100%; max-width: 320px;
    }
    .landing-stats { gap: 12px; }
    .landing-stat-num { font-size: 1.2rem; }
    .landing-stat-label { font-size: 0.68rem; }
    .landing-stat-featured { padding: 8px 14px; }
    .landing-stat-featured .landing-stat-num { font-size: 1.45rem; }
    .landing-hook-box { padding: 22px 16px; margin: 16px 0 28px; }
    .landing-hook-box p { font-size: 0.88rem !important; line-height: 1.85 !important; }
    .landing-section-divider { margin: 8px 0 24px; }
    .landing-feature-card { padding: 16px 14px; }
    .landing-pro-box { padding: 18px 16px; }
    .landing-pro-box .landing-pro-tag { font-size: 0.72rem; padding: 3px 10px; }
    .landing-edu-box { padding: 22px 16px; }
    .landing-edu-card { padding: 14px 12px; }
    .landing-guide-box { padding: 22px 16px; }
  }

  @media (max-width: 420px) {
    .landing-wrap { padding: 12px 10px; }
    .lhi-svg { width: 62px; height: 62px; }
    .lht-lead { font-size: 0.82rem; letter-spacing: 0.14em; }
    .lht-main { font-size: 1.45rem; letter-spacing: 0.08em; }
    .lht-sub { font-size: 0.95rem; letter-spacing: 0.1em; }
    .landing-hero-desc { font-size: 0.82rem; }
    .landing-cta-btn { padding: 14px 20px; font-size: 0.92rem; width: 100%; }
    .landing-stats { gap: 8px; padding: 12px 0 6px; }
    .landing-stat-num { font-size: 1.05rem; }
    .landing-stat-label { font-size: 0.6rem; letter-spacing: 0; }
    .landing-stat-featured { padding: 6px 10px; }
    .landing-stat-featured .landing-stat-num { font-size: 1.25rem; }
    .landing-hook-box p { font-size: 0.82rem !important; }
    .landing-feature-card { padding: 14px 12px; }
    .landing-feature-desc { font-size: 0.75rem; }
    .landing-edu-box p, .landing-guide-box p { font-size: 0.8rem !important; }
    .landing-external-link { padding: 12px 24px; font-size: 0.88rem; width: 100%; text-align: center; }
  }

  /* ── 今日閘門 ── */
  .landing-daily-gate {
    background: linear-gradient(135deg, rgba(14,10,30,0.85), rgba(10,8,22,0.7));
    border: 1px solid rgba(140,80,220,0.18);
    border-radius: 18px;
    padding: 24px 22px;
    margin-bottom: 36px;
    position: relative;
    overflow: hidden;
  }
  .landing-daily-gate::before {
    content: '';
    position: absolute;
    top: -60px; right: -60px;
    width: 180px; height: 180px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(140,80,220,0.08) 0%, transparent 70%);
    pointer-events: none;
  }
  .ldg-header {
    display: flex; align-items: center; gap: 8px;
    font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em;
    color: rgba(160,100,255,0.5); text-transform: uppercase;
    margin-bottom: 18px;
  }
  .ldg-body { display: flex; align-items: center; gap: 20px; }
  .ldg-gate-badge {
    flex-shrink: 0;
    width: 72px; height: 72px;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(100,50,180,0.3), rgba(60,20,120,0.2));
    border: 1px solid rgba(140,80,220,0.25);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
  }
  .ldg-gate-label { font-size: 0.6rem; color: rgba(160,100,255,0.5); letter-spacing: 0.1em; margin-bottom: 2px; }
  .ldg-gate-num { font-size: 1.8rem; font-weight: 900; color: #c090ff; line-height: 1; }
  .ldg-gate-name { font-size: 1rem; font-weight: 700; color: #d0b0ff; margin-bottom: 2px; }
  .ldg-gate-en { font-size: 0.68rem; color: rgba(160,100,255,0.45); letter-spacing: 0.08em; margin-bottom: 8px; }
  .ldg-gate-prompt { font-size: 0.82rem; color: #9080b0; line-height: 1.65; }
  .ldg-date { font-size: 0.68rem; color: rgba(120,90,180,0.4); margin-top: 8px; }
  @media (max-width: 480px) {
    .ldg-body { gap: 14px; }
    .ldg-gate-badge { width: 62px; height: 62px; border-radius: 12px; }
    .ldg-gate-num { font-size: 1.5rem; }
  }

  /* ── PRO 試閱 ── */
  .landing-pro-preview {
    margin-bottom: 36px;
  }
  .lpv-demo-banner {
    display: flex; align-items: center; justify-content: space-between;
    background: linear-gradient(135deg, rgba(40,28,8,0.7), rgba(28,20,6,0.5));
    border: 1px solid rgba(180,140,50,0.2);
    border-radius: 12px 12px 0 0;
    padding: 10px 16px;
    font-size: 0.75rem;
  }
  .lpv-demo-label { color: rgba(200,160,60,0.6); letter-spacing: 0.08em; font-weight: 700; }
  .lpv-demo-name { color: rgba(200,160,60,0.45); }
  .lpv-card {
    border: 1px solid rgba(180,140,50,0.15);
    border-top: none;
    background: rgba(8,14,24,0.6);
    overflow: hidden;
  }
  .lpv-card:last-of-type { border-radius: 0 0 12px 12px; }
  .lpv-card-header {
    display: flex; align-items: center; gap: 10px;
    padding: 12px 16px;
    background: linear-gradient(135deg, rgba(26,20,8,0.9), rgba(20,16,6,0.8));
    border-bottom: 1px solid rgba(80,60,20,0.3);
  }
  .lpv-card-header-blue {
    background: linear-gradient(135deg, rgba(10,18,32,0.9), rgba(8,14,24,0.8));
    border-bottom: 1px solid rgba(40,80,140,0.3);
  }
  .lpv-card-icon { font-size: 1.1rem; }
  .lpv-card-title { font-size: 0.9rem; font-weight: 700; color: #c0a060; }
  .lpv-card-title-blue { color: #7ab0d8; }
  .lpv-pro-badge {
    font-size: 0.58rem; font-weight: 800; padding: 2px 6px;
    border-radius: 3px; background: linear-gradient(135deg,#b08030,#d4a840);
    color: #1a1408; letter-spacing: 0.08em; margin-left: 4px; vertical-align: middle;
  }
  .lpv-card-body { padding: 14px 16px 16px; }
  .lpv-gate-grid {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px; margin-bottom: 14px;
  }
  .lpv-gate-cell {
    border-radius: 8px; padding: 9px 11px;
  }
  .lpv-gate-cell-label { font-size: 0.64rem; color: rgba(180,150,70,0.5); margin-bottom: 3px; }
  .lpv-gate-cell-num { font-size: 1rem; font-weight: 900; margin-bottom: 1px; }
  .lpv-gate-cell-name { font-size: 0.72rem; font-weight: 600; }
  .lpv-phs-row {
    display: flex; gap: 8px; margin-bottom: 10px; flex-wrap: wrap;
  }
  .lpv-phs-chip {
    padding: 5px 12px; border-radius: 20px;
    font-size: 0.74rem; font-weight: 700;
  }
  .lpv-body-text {
    font-size: 0.8rem; color: #7090a8; line-height: 1.7;
  }
  .lpv-cta-bar {
    text-align: center;
    padding: 16px 0 4px;
    border-top: 1px solid rgba(180,140,50,0.1);
    margin-top: 4px;
  }
  .lpv-cta-note { font-size: 0.72rem; color: #5a7080; margin-bottom: 10px; }

  /* 禮物數量選擇器 */
  .gift-qty-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
  }
  .gift-qty-btn {
    padding: 12px;
    text-align: center;
    border: 2px solid rgba(100,160,220,0.3);
    border-radius: 10px;
    background: linear-gradient(135deg,#1a3050,#2a4060);
    color: #90d0f0;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    cursor: pointer;
  }
  @media (max-width: 480px) {
    .gift-qty-grid {
      grid-template-columns: repeat(5, minmax(0, 1fr));
      gap: 5px;
    }
    .gift-qty-btn {
      padding: 10px 4px;
      font-size: 0.78rem;
      border-radius: 8px;
    }
  }

  /* ══════════════════════════════════════════
     HD WIZARD SYSTEM — 步驟式引導
     ══════════════════════════════════════════ */

  /* Wizard nav bar (injected by JS after autofill.js runs) */
  #hd-wizard-bar {
    display: none;
    position: sticky;
    top: 0;
    z-index: 40;
    background: linear-gradient(180deg, #08101c 0%, #0a1420 100%);
    border: 1px solid rgba(74,130,188,0.18);
    border-radius: 14px;
    padding: 14px 16px 12px;
    margin-bottom: 16px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  }

  /* Wizard progress dots */
  .wiz-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .wiz-progress::-webkit-scrollbar { display: none; }
  .wiz-dot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 42px;
    cursor: pointer;
    transition: opacity 0.2s;
  }
  .wiz-dot-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 700;
    background: #141e2c;
    border: 1.5px solid #1e3048;
    color: #3a5070;
    transition: all 0.2s;
  }
  .wiz-dot-label {
    font-size: 0.58rem;
    color: #3a5068;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    transition: color 0.2s;
  }
  .wiz-dot-line {
    width: 18px;
    height: 1.5px;
    background: #1a2a3c;
    flex-shrink: 0;
    margin-bottom: 14px;
  }
  .wiz-dot.wiz-dot-active .wiz-dot-num {
    background: linear-gradient(135deg, #1a4a80, #2468b0);
    border-color: #4a90d0;
    color: #fff;
    box-shadow: 0 0 8px rgba(80,150,220,0.4);
  }
  .wiz-dot.wiz-dot-active .wiz-dot-label { color: #70b0e0; }
  .wiz-dot.wiz-dot-done .wiz-dot-num {
    background: linear-gradient(135deg, #0e3020, #1a4830);
    border-color: #2a7050;
    color: #40b870;
  }
  .wiz-dot.wiz-dot-done .wiz-dot-label { color: #40b870; }
  .wiz-dot.wiz-dot-done .wiz-dot-line { background: #2a5040; }

  /* 付費編輯模式：鎖定的步驟圓點 */
  .wiz-dot.wiz-dot-locked {
    cursor: not-allowed !important;
    pointer-events: none;
    opacity: 0.35;
  }
  .wiz-dot.wiz-dot-locked .wiz-dot-num {
    background: rgba(20,20,30,0.6);
    border-color: rgba(60,70,90,0.5);
    color: #404858;
  }
  .wiz-dot.wiz-dot-locked .wiz-dot-label { color: #3a4858; }

  /* Wizard step header */
  .wiz-step-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
  }
  .wiz-step-num-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 800;
    background: linear-gradient(135deg, #1a4a80, #2468b0);
    color: #fff;
    flex-shrink: 0;
  }
  .wiz-step-title-text {
    font-size: 1rem;
    font-weight: 700;
    color: #90c0e8;
    letter-spacing: 0.04em;
  }
  .wiz-autofilled-tag {
    font-size: 0.66rem;
    color: #40b870;
    background: #0a2018;
    border: 1px solid #1a4828;
    border-radius: 99px;
    padding: 2px 8px;
    margin-left: 6px;
    font-weight: 600;
  }

  /* Wizard footer nav */
  .wiz-footer {
    display: flex;
    gap: 10px;
    justify-content: space-between;
  }
  .wiz-btn-back,
  .wiz-btn-next {
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 40px;
  }
  .wiz-btn-back {
    background: transparent;
    border: 1px solid #1e3048;
    color: #4a7090;
  }
  .wiz-btn-back:hover { border-color: #2a4870; color: #6a90b0; }
  /* 重置資訊按鈕：只在 Step 1 顯示，其他步驟隱藏 */
  .wiz-btn-reset {
    padding: 10px 20px;
    border-radius: 9px;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s;
    min-height: 40px;
    background: transparent;
    border: 1px solid rgba(180,60,60,0.3);
    color: #8a5050;
    white-space: nowrap;
    display: none; /* 預設隱藏，只在 step 1 + autofillDone 時顯示 */
  }
  .wiz-btn-reset:hover { border-color: rgba(200,80,80,0.5); color: #c07070; }
  .wiz-btn-next {
    flex: 1;
    background: linear-gradient(135deg, #1a4a80, #2468b0);
    border: none;
    color: #fff;
    box-shadow: 0 2px 10px rgba(50,120,200,0.3);
  }
  .wiz-btn-next:hover { opacity: 0.9; transform: translateY(-1px); }
  .wiz-btn-next:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

  /* Skip note */
  .wiz-skip-note {
    font-size: 0.68rem;
    color: #3a5068;
    text-align: center;
    margin-top: 6px;
  }

  /* ── Wizard active: override autofill.js sidebar structure ── */
  #input-sidebar.wiz-active #hd-wizard-bar { display: block; }

  #input-sidebar.wiz-active #hd-manual-section { display: block !important; }
  #input-sidebar.wiz-active #hd-manual-header { display: none !important; }
  #input-sidebar.wiz-active #hd-protect-note { display: none !important; }
  #input-sidebar.wiz-active #hd-manual-body {
    display: block !important;
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
  }

  /* Hide original structural elements in wizard mode */
  #input-sidebar.wiz-active #progress-bar { display: none !important; }
  #input-sidebar.wiz-active .step-header { display: none !important; }
  #input-sidebar.wiz-active .btn-example { display: none !important; }
  #input-sidebar.wiz-active .btn-reset { display: none !important; }
  /* Hide the intermediate create-report button between step-2 and step-3 */
  #input-sidebar.wiz-active #wiz-mid-btn { display: none !important; }
  #input-sidebar.wiz-active .btn-create { display: none !important; }

  /* Hide all step sections by default in wizard mode */
  #input-sidebar.wiz-active #step-1 { display: none !important; }
  #input-sidebar.wiz-active #step-2 { display: none !important; }
  #input-sidebar.wiz-active #step-3 { display: none !important; }

  /* Hide payment sections by default in wizard mode */
  #input-sidebar.wiz-active #wiz-pay { display: none !important; }
  #input-sidebar.wiz-active #wiz-free { display: none !important; }

  /* Inside step-3: hide all children by default in wizard mode */
  #input-sidebar.wiz-active #step-3 .step-body > * { display: none !important; }

  /* ── Per-step visibility rules ── */

  /* Step 1: Birth date input */
  #input-sidebar.wiz-step-1 #hd-birth-panel { display: block !important; }
  #input-sidebar.wiz-step-1 #hd-manual-section { display: none !important; }
  /* 巫師模式下隱藏計算結果預覽（已有「已自動填入」標籤作為回饋） */
  #input-sidebar.wiz-active #hd-result-area { display: none !important; }
  #input-sidebar.wiz-active #hd-protect-note { display: none !important; }

  /* Steps 2-7: hide birth panel */
  #input-sidebar.wiz-active:not(.wiz-step-1) #hd-birth-panel { display: none !important; }

  /* Step 2: Basic info */
  #input-sidebar.wiz-step-2 #step-1 { display: block !important; }
  #input-sidebar.wiz-step-2 #step-1 .step-body { display: block !important; }
  #input-sidebar.wiz-step-2 #step-1 .step-body > * { display: block !important; }

  /* Step 3: Centers */
  #input-sidebar.wiz-step-3 #step-2 { display: block !important; }
  #input-sidebar.wiz-step-3 #step-2 .step-body { display: block !important; }
  #input-sidebar.wiz-step-3 #step-2 .step-body > * { display: block !important; }
  /* Show free-report shortcut button at step 3 */
  #input-sidebar.wiz-step-3 #step-2 .step-body > #wiz-step3-free-btn { display: block !important; }

  /* Step 4: Channels — use high-specificity selectors to override the > * rule */
  #input-sidebar.wiz-step-4 #step-3 { display: block !important; }
  #input-sidebar.wiz-step-4 #step-3 .step-body { display: block !important; }
  #input-sidebar.wiz-step-4 #step-3 .step-body > #wiz-ch { display: block !important; }

  /* Step 5: Arrows */
  #input-sidebar.wiz-step-5 #step-3 { display: block !important; }
  #input-sidebar.wiz-step-5 #step-3 .step-body { display: block !important; }
  #input-sidebar.wiz-step-5 #step-3 .step-body > #wiz-ar { display: block !important; }

  /* Step 6: Cross + Nodes + PHS + Gates */
  #input-sidebar.wiz-step-6 #step-3 { display: block !important; }
  #input-sidebar.wiz-step-6 #step-3 .step-body { display: block !important; }
  #input-sidebar.wiz-step-6 #step-3 .step-body > #wiz-cross { display: block !important; }
  #input-sidebar.wiz-step-6 #step-3 .step-body > #wiz-nodes { display: block !important; }
  #input-sidebar.wiz-step-6 #step-3 .step-body > #wiz-phs { display: block !important; }
  #input-sidebar.wiz-step-6 #step-3 .step-body > #wiz-gates { display: block !important; }

  /* Step 7: Create report */
  #input-sidebar.wiz-step-7 #wiz-pay { display: block !important; }
  #input-sidebar.wiz-step-7 #wiz-free { display: block !important; }

  /* Step-section wrapper: transparent in wizard mode */
  #input-sidebar.wiz-active .step-section {
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    margin: 0 !important;
  }
  #input-sidebar.wiz-active .step-body {
    border: none !important;
  }

  /* Wizard padding - ensure content has breathing room */
  #input-sidebar.wiz-active #step-1 .step-body > *,
  #input-sidebar.wiz-active #step-2 .step-body > * {
    margin-bottom: 0;
  }

  /* Step title above content */
  .wiz-content-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4a7090;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 12px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .wiz-content-title::before {
    content: '';
    flex: 1;
    height: 1px;
    background: #1a2a3c;
  }

  /* ── Mobile wizard optimizations ── */
  @media (max-width: 480px) {
    #hd-wizard-bar {
      padding: 10px 12px 10px;
      margin: 0 -12px 0;
    }
    .wiz-dot { min-width: 36px; }
    .wiz-dot-num { width: 22px; height: 22px; font-size: 0.65rem; }
    .wiz-dot-label { font-size: 0.57rem; }
    .wiz-dot-line { width: 12px; }
    .wiz-step-title-text { font-size: 0.9rem; }
    .wiz-btn-back, .wiz-btn-next { padding: 9px 14px; font-size: 0.82rem; }
  }

  /* ══════════════════════════════════════════
     DAILY GATE PAGE  /daily-gate
     ══════════════════════════════════════════ */

  /* ── 動畫 ── */
  @keyframes dg-twinkle { from { opacity: 0.1; } to { opacity: 0.7; } }
  @keyframes dg-float-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

  /* ── 後端 API 載入中狀態 ── */
  .dg-api-loading {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 100px 20px; gap: 16px;
  }
  .dg-api-loading-icon {
    font-size: 2.6rem; color: #a78bfa;
    animation: dg-pulse-ring 2.5s ease-in-out infinite;
  }
  .dg-api-loading-text {
    font-size: 0.85rem; color: #607888; letter-spacing: 0.08em;
  }
  @keyframes dg-pulse-ring { 0%,100%{transform:scale(1);opacity:1} 50%{transform:scale(1.04);opacity:.8} }
  @keyframes dg-hero-num-glow { 0%,100%{text-shadow:0 0 40px rgba(167,139,250,.5)} 50%{text-shadow:0 0 80px rgba(167,139,250,.9),0 0 120px rgba(139,92,246,.4)} }

  /* ── Daily Gate 頁面：移除 .app-section 的 padding/max-width 限制，讓 dg-page 全寬 ── */
  #app-daily-gate {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
  }

  /* ── 整頁容器 ── */
  .dg-page {
    min-height: 100vh; background: #09071a; color: #e2d9f3;
    overflow-x: hidden; max-width: 100%; width: 100%;
  }

  /* ── Hero ── */
  .dg-hero {
    position: relative;
    overflow: hidden;
    padding: 60px 24px 56px;
    text-align: center;
    background: linear-gradient(160deg, #12093a 0%, #1a0a4a 40%, #0e082e 100%);
    /* 確保 iOS Safari 上不產生橫向溢出 */
    max-width: 100%;
    box-sizing: border-box;
  }
  .dg-hero-bg {
    position: absolute; inset: 0;
    background: radial-gradient(ellipse 70% 60% at 50% 30%, rgba(139,92,246,.18) 0%, transparent 70%);
    pointer-events: none;
  }
  .dg-stars {
    position: absolute; inset: 0; overflow: hidden;
    pointer-events: none;
  }
  .dg-hero-inner {
    position: relative; z-index: 1;
    max-width: 700px; width: 100%; margin: 0 auto;
    box-sizing: border-box;
    animation: dg-float-in .6s ease;
  }
  .dg-hero-tag {
    display: inline-block;
    font-size: 0.72rem; letter-spacing: .14em; text-transform: uppercase;
    color: #a78bfa; border: 1px solid rgba(167,139,250,.35);
    padding: 5px 14px; border-radius: 20px; margin-bottom: 28px;
    background: rgba(139,92,246,.08);
  }
  .dg-hero-gate-wrap {
    display: flex; align-items: center; justify-content: center;
    gap: 28px; margin-bottom: 20px; flex-wrap: wrap;
  }
  .dg-hero-num {
    font-size: clamp(72px, 18vw, 130px); font-weight: 900; line-height: 1;
    flex-shrink: 0;
    /* 移除 filter（iOS Safari 上 drop-shadow + background-clip 組合會撐破容器）*/
    background: linear-gradient(135deg, #e2d9f3 0%, #a78bfa 60%, #7c3aed 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  }
  .dg-hero-names { text-align: left; min-width: 0; }
  @media (max-width: 480px) {
    .dg-hero-gate-wrap { flex-direction: column; gap: 12px; }
    .dg-hero-names { text-align: center; }
    .dg-hero-num { font-size: clamp(64px, 20vw, 90px); }
  }
  .dg-hero-name-zh { font-size: clamp(1.4rem, 4vw, 2rem); font-weight: 700; color: #e2d9f3; letter-spacing: .04em; }
  .dg-hero-name-en { font-size: 0.92rem; color: #a78bfa; letter-spacing: .08em; margin: 4px 0 10px; }
  .dg-hero-hex {
    display: inline-block; font-size: 0.78rem; color: #c4b5fd;
    background: rgba(139,92,246,.15); border: 1px solid rgba(167,139,250,.25);
    padding: 4px 12px; border-radius: 12px; letter-spacing: .05em;
  }
  .dg-hero-line-badge {
    display: inline-block; margin-top: 6px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: .08em;
    color: #fbbf24;
    background: rgba(251,191,36,.08);
    border: 1px solid rgba(251,191,36,.28);
    padding: 3px 12px; border-radius: 12px;
  }
  .dg-hero-prompt {
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    line-height: 1.75; color: #d4c8f0;
    max-width: 560px; margin: 0 auto 18px;
    font-style: italic;
  }
  .dg-hero-date { font-size: 0.78rem; color: #7a6aaa; letter-spacing: .06em; }

  /* ── 探索模式提示條 ── */
  .dg-explore-banner {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(90deg, rgba(139,92,246,.12), rgba(109,40,217,.08));
    border-bottom: 1px solid rgba(167,139,250,.25);
    animation: dg-float-in .3s ease;
  }
  .dg-explore-info { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
  .dg-explore-label {
    font-size: 0.7rem; font-weight: 700; letter-spacing: .1em; color: #a78bfa;
    background: rgba(139,92,246,.15); border: 1px solid rgba(167,139,250,.3);
    padding: 3px 10px; border-radius: 20px;
  }
  .dg-explore-gate { font-size: 0.88rem; font-weight: 700; color: #e2d9f3; }
  .dg-explore-en { font-size: 0.75rem; color: #7a6aaa; }
  .dg-explore-back {
    flex-shrink: 0;
    font-size: 0.78rem; color: #a78bfa; background: none;
    border: 1px solid rgba(167,139,250,.3); border-radius: 20px;
    padding: 6px 14px; cursor: pointer; transition: all .2s; white-space: nowrap;
  }
  .dg-explore-back:hover { background: rgba(139,92,246,.15); border-color: #a78bfa; }

  /* ── 使用說明條 ── */
  .dg-guide-bar {
    background: rgba(139,92,246,.06);
    border-bottom: 1px solid rgba(167,139,250,.1);
  }
  .dg-guide-toggle {
    width: 100%; display: flex; align-items: center; gap: 10px;
    padding: 14px 24px; background: none; border: none; cursor: pointer;
    color: #a78bfa; font-size: 0.82rem; text-align: left;
  }
  .dg-guide-toggle:hover { background: rgba(139,92,246,.06); }
  .dg-guide-icon { font-size: 0.7rem; opacity: .7; }
  .dg-guide-q { font-weight: 600; letter-spacing: .04em; }
  .dg-guide-arr {
    margin-left: auto; font-size: 0.65rem; opacity: .6;
    transition: transform .25s;
  }
  .dg-guide-bar.open .dg-guide-arr { transform: rotate(180deg); }
  .dg-guide-body {
    display: none;
    padding: 0 24px 20px;
    max-width: 1060px; margin: 0 auto;
  }
  .dg-guide-bar.open .dg-guide-body { display: block; }
  .dg-guide-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  @media (max-width: 600px) { .dg-guide-grid { grid-template-columns: 1fr; } }
  .dg-guide-item {
    display: flex; gap: 12px; align-items: flex-start;
    background: rgba(255,255,255,.03); border: 1px solid rgba(167,139,250,.1);
    border-radius: 12px; padding: 14px;
  }
  .dg-guide-emoji { font-size: 1.2rem; flex-shrink: 0; margin-top: 1px; }
  .dg-guide-title { font-size: 0.82rem; font-weight: 700; color: #c4b5fd; margin-bottom: 4px; }
  .dg-guide-text { font-size: 0.78rem; color: #8070b0; line-height: 1.7; }

  /* ── 主內容雙欄佈局 ── */
  .dg-content {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 20px;
    max-width: 1060px;
    margin: 32px auto;
    padding: 0 20px;
    box-sizing: border-box;
    width: 100%;
  }
  /* Grid 子元素預設 min-width:auto 會撐破 1fr，必須設為 0 */
  .dg-main, .dg-sidebar { min-width: 0; }
  @media (max-width: 780px) {
    .dg-content { grid-template-columns: 1fr; padding: 0 16px; }
    .dg-card { padding: 18px 16px; }   /* 字大了，外距稍減，保持版心 */
  }

  /* ── 通用卡片 ── */
  .dg-card {
    background: rgba(255,255,255,.04);
    border: 1px solid rgba(167,139,250,.15);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    animation: dg-float-in .5s ease both;
    /* 確保卡片不超出父容器 */
    min-width: 0; max-width: 100%; box-sizing: border-box; overflow: hidden;
  }
  .dg-card-title {
    font-size: 0.78rem; text-transform: uppercase; letter-spacing: .1em;
    color: #a78bfa; margin-bottom: 14px;
  }

  /* ── Tab 解讀卡 ── */
  .dg-tabs-header {
    display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px;
  }
  .dg-tab {
    padding: 7px 16px; border-radius: 20px; border: 1px solid rgba(167,139,250,.25);
    background: transparent; color: #8070b0; font-size: 0.82rem; cursor: pointer;
    transition: all .2s;
  }
  .dg-tab:hover { border-color: #a78bfa; color: #c4b5fd; }
  .dg-tab.active { background: rgba(139,92,246,.2); border-color: #a78bfa; color: #e2d9f3; font-weight: 600; }
  .dg-tab-content { line-height: 1.85; color: #c8bce8; font-size: 0.92rem; }
  .dg-tab-content p { margin: 0; }
  .dg-tab-content.hidden { display: none; }

  /* ── 深入閱讀 toggle ── */
  .dg-deep-read {
    border-radius: 12px;
    border: 1px solid rgba(167,139,250,.14);
    overflow: hidden;
    margin-bottom: 16px;
    background: rgba(255,255,255,.025);
  }
  .dg-deep-read-toggle {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    padding: 14px 20px; background: transparent;
    border: none; cursor: pointer; text-align: left;
    transition: background .2s;
  }
  .dg-deep-read-toggle:hover { background: rgba(139,92,246,.06); }
  .dg-deep-read-title {
    font-size: 0.82rem; font-weight: 600; color: #a78bfa; letter-spacing: .04em;
  }
  .dg-deep-read-hint {
    font-size: 0.75rem; color: #7060a0;
  }
  .dg-deep-chevron {
    display: inline-block; transition: transform .25s; margin-left: 4px;
  }
  .dg-deep-chevron-open { transform: rotate(180deg); }
  .dg-deep-read-body {
    padding: 0 20px 20px;
    border-top: 1px solid rgba(167,139,250,.1);
  }
  .dg-deep-read-body.hidden { display: none; }
  .dg-deep-section { margin-top: 18px; }
  .dg-deep-label {
    font-size: 0.78rem; color: #9080c0; letter-spacing: .04em; margin-bottom: 8px;
  }
  .dg-deep-text {
    font-size: 0.92rem; color: #c8bce8; line-height: 1.85; margin: 0;
  }

  /* ── 閘門背景 collapsible ── */
  .dg-channel-toggle {
    width: 100%; display: flex; justify-content: space-between; align-items: center;
    flex-wrap: wrap; gap: 6px;
    background: none; border: none; cursor: pointer; padding: 0; text-align: left;
  }
  .dg-channel-toggle-hint {
    font-size: 0.72rem; color: #6858a0; display: flex; align-items: center; gap: 4px;
  }
  .dg-channel-chevron {
    display: inline-block; transition: transform .25s; margin-left: 2px; font-size: 0.7rem;
  }
  .dg-channel-card:not(.dg-channel-collapsed) .dg-channel-chevron { transform: rotate(180deg); }
  .dg-channel-body { }
  .dg-channel-body.hidden { display: none; }

  /* ── 通道 & 卦象 卡片（舊三格式已移除，改用 dg-ctx-* 系列）── */

  /* ── 環形圖 ── */
  .dg-ring-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; }
  .dg-ring-svg { animation: dg-pulse-ring 4s ease-in-out infinite; }
  .dg-ring-legend { font-size: 0.75rem; color: #7a6aaa; text-align: center; line-height: 1.6; }

  /* ── 周視圖 ── */
  .dg-week-scroll {
    display: flex; gap: 8px; overflow-x: auto;
    padding-bottom: 6px; scrollbar-width: thin; scrollbar-color: rgba(167,139,250,.2) transparent;
  }
  .dg-week-cell {
    flex: 0 0 80px; border-radius: 12px;
    border: 1px solid rgba(167,139,250,.18);
    background: rgba(255,255,255,.03);
    padding: 10px 8px; text-align: center; cursor: pointer;
    transition: all .2s; display: flex; flex-direction: column; gap: 3px;
  }
  .dg-week-cell:hover { border-color: #a78bfa; background: rgba(139,92,246,.1); }
  .dg-week-cell.today { border-color: rgba(167,139,250,.5); background: rgba(139,92,246,.12); }
  .dg-week-cell.active { border-color: #a78bfa; background: rgba(139,92,246,.22); }
  .dg-week-date { font-size: 0.68rem; color: #7a6aaa; }
  .dg-week-label { font-size: 0.65rem; color: #a78bfa; font-weight: 600; letter-spacing: .04em; }
  .dg-week-num { font-size: 1.3rem; font-weight: 800; color: #e2d9f3; line-height: 1; }
  .dg-week-name { font-size: 0.66rem; color: #9080c0; }

  /* ── 64 閘門探索格 ── */
  .dg-explorer-section {
    max-width: 1060px; margin: 0 auto 40px; padding: 0 20px;
    animation: dg-float-in .6s ease .2s both;
  }
  .dg-section-title {
    font-size: 1.1rem; font-weight: 700; color: #e2d9f3;
    margin-bottom: 6px; letter-spacing: .03em;
  }
  .dg-section-sub { font-size: 0.8rem; color: #7a6aaa; margin-bottom: 18px; }
  .dg-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
  }
  @media (max-width: 600px) {
    .dg-grid { grid-template-columns: repeat(8, 1fr); gap: 5px; }
  }
  @media (max-width: 480px) {
    /* 減少閘門格 gap，讓每個格子稍微更大，改善觸控目標 */
    .dg-grid { gap: 3px; }
  }
  .dg-grid-cell {
    aspect-ratio: 1; border-radius: 10px;
    border: 1px solid rgba(167,139,250,.15);
    background: rgba(255,255,255,.03);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all .18s; position: relative;
  }
  .dg-grid-cell:hover { border-color: #a78bfa; background: rgba(139,92,246,.15); transform: scale(1.08); z-index: 1; }
  .dg-grid-cell.today { border-color: rgba(167,139,250,.55); background: rgba(139,92,246,.15); }
  .dg-grid-cell.active { border-color: #a78bfa; background: rgba(139,92,246,.3); box-shadow: 0 0 12px rgba(139,92,246,.4); }
  .dg-grid-num { font-size: clamp(0.6rem, 1.8vw, 0.82rem); font-weight: 700; color: #c4b5fd; }
  .dg-grid-legend { margin-top: 12px; font-size: 0.75rem; color: #7a6aaa; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
  .dg-legend-dot {
    display: inline-block; width: 12px; height: 12px; border-radius: 3px;
    border: 1px solid rgba(167,139,250,.4);
  }
  .dg-legend-dot.today { background: rgba(139,92,246,.15); }
  .dg-legend-dot.active { background: rgba(139,92,246,.3); border-color: #a78bfa; }

  /* ── 底部 CTA ── */
  /* ── 今日過境個人化 ── */
  .dg-personal-section {
    max-width: 720px; margin: 0 auto 0; padding: 48px 24px 20px;
  }
  .dg-personal-header { text-align: center; margin-bottom: 32px; }
  .dg-personal-icon { font-size: 1.4rem; color: #a78bfa; margin-bottom: 10px; }
  .dg-personal-title {
    font-size: clamp(1.2rem, 3vw, 1.6rem); font-weight: 700;
    color: #e2d9f3; letter-spacing: .03em; margin-bottom: 8px;
  }
  .dg-personal-sub { font-size: 0.88rem; color: #7a98b0; line-height: 1.6; }

  /* 表單 */
  .dg-personal-form {
    background: linear-gradient(135deg, rgba(30,20,60,0.6), rgba(20,15,45,0.4));
    border: 1px solid rgba(167,139,250,0.2); border-radius: 16px;
    padding: 28px 24px;
  }
  .dg-pf-row { display: flex; gap: 20px; flex-wrap: wrap; margin-bottom: 12px; }
  .dg-pf-group { flex: 1; min-width: 200px; }
  .dg-pf-label { display: block; font-size: 0.78rem; color: #7a98b0; letter-spacing: .06em; margin-bottom: 8px; }
  .dg-pf-date-row { display: flex; align-items: center; gap: 6px; }
  .dg-pf-input {
    background: rgba(10,14,26,0.8); border: 1px solid rgba(167,139,250,0.25);
    border-radius: 8px; color: #e2d9f3; font-size: 0.95rem;
    padding: 10px 10px; text-align: center; transition: border-color .2s;
    -moz-appearance: textfield;
  }
  .dg-pf-input::-webkit-inner-spin-button,
  .dg-pf-input::-webkit-outer-spin-button { -webkit-appearance: none; }
  .dg-pf-input:focus { outline: none; border-color: #a78bfa; }
  .dg-pf-year  { width: 72px; }
  .dg-pf-month { width: 50px; }
  .dg-pf-day   { width: 50px; }
  .dg-pf-hour  { width: 50px; }
  .dg-pf-minute{ width: 50px; }
  .dg-pf-sep { color: #4a5a7a; font-size: 1rem; }
  .dg-pf-hint { font-size: 0.74rem; color: #506878; margin-bottom: 18px; }
  .dg-pf-btn {
    width: 100%; padding: 14px; border-radius: 10px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff; font-size: 0.95rem; font-weight: 700; letter-spacing: .04em;
    border: none; cursor: pointer;
    box-shadow: 0 6px 24px rgba(139,92,246,.35);
    transition: all .2s;
  }
  .dg-pf-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 32px rgba(139,92,246,.5); }

  /* 載入中 */
  .dg-personal-loading {
    text-align: center; padding: 40px;
    display: flex; flex-direction: column; align-items: center; gap: 14px;
  }
  .dg-personal-spinner {
    width: 36px; height: 36px; border-radius: 50%;
    border: 3px solid rgba(167,139,250,0.2);
    border-top-color: #a78bfa;
    animation: dg-spin .8s linear infinite;
  }
  @keyframes dg-spin { to { transform: rotate(360deg); } }
  .dg-personal-loading-text { color: #7a98b0; font-size: 0.88rem; }

  /* 結果共用 */
  .dgp-result {
    border-radius: 16px; padding: 28px 24px; margin-top: 4px;
    border: 1px solid rgba(167,139,250,0.15);
  }
  .dgp-result-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 700; letter-spacing: .1em;
    border-radius: 20px; padding: 4px 14px; margin-bottom: 16px;
  }
  .dgp-result-headline {
    font-size: clamp(1.1rem, 3vw, 1.5rem); font-weight: 700;
    color: #e2d9f3; line-height: 1.4; margin-bottom: 6px;
  }
  .dgp-gate-num {
    font-size: 1.3em; font-weight: 800; letter-spacing: -.01em;
  }
  .dgp-gate-name { font-size: 0.82rem; color: #7a98b0; margin-bottom: 18px; }
  .dgp-result-body {
    font-size: 0.9rem; color: #c0d0e0; line-height: 1.75;
    margin-bottom: 20px;
  }
  .dgp-insight {
    background: rgba(10,14,26,0.5); border-radius: 10px;
    padding: 16px 18px; margin-bottom: 18px;
    border: 1px solid rgba(167,139,250,0.1);
  }
  .dgp-insight-label { font-size: 0.75rem; color: #a78bfa; letter-spacing: .08em; margin-bottom: 8px; }
  .dgp-insight-text  { font-size: 0.88rem; color: #d0d8e8; line-height: 1.7; }
  .dgp-center-tag {
    display: inline-block; font-size: 0.74rem; color: #a78bfa;
    border: 1px solid rgba(167,139,250,.25); border-radius: 20px;
    padding: 3px 12px; margin-top: 4px;
  }
  .dgp-result-nudge {
    font-size: 0.82rem; color: #607888; line-height: 1.65; margin-top: 12px;
  }

  /* Case 1：命中 */
  .dgp-result--hit {
    background: linear-gradient(135deg, rgba(40,20,80,0.7), rgba(60,20,100,0.4));
    border-color: rgba(167,139,250,0.3);
  }
  .dgp-badge--hit { background: rgba(167,139,250,0.15); color: #c4b5fd; }
  .dgp-result--hit .dgp-gate-num { color: #c4b5fd; }

  /* Case 2：通道補完 */
  .dgp-result--channel {
    background: linear-gradient(135deg, rgba(20,50,40,0.7), rgba(10,40,30,0.4));
    border-color: rgba(80,200,140,0.25);
  }
  .dgp-badge--channel { background: rgba(80,200,140,0.12); color: #60c890; }
  .dgp-result--channel .dgp-gate-num { color: #60d0a0; }
  .dgp-channel-visual {
    display: flex; align-items: center; justify-content: center; gap: 16px;
    margin-top: 16px; flex-wrap: wrap;
  }
  .dgp-ch-gate {
    background: rgba(10,14,26,0.6); border-radius: 12px;
    padding: 12px 20px; text-align: center; font-size: 1.4rem; font-weight: 800;
    line-height: 1.3; min-width: 90px; border: 1px solid rgba(80,200,140,0.2);
  }
  .dgp-ch-gate small { font-size: 0.65rem; font-weight: 400; color: #7a98b0; display: block; }
  .dgp-ch-gate--yours { color: #60d0a0; border-color: rgba(80,200,140,0.3); }
  .dgp-ch-gate--sun   { color: #d0a850; border-color: rgba(200,160,60,0.3); }
  .dgp-ch-arrow { font-size: 1.4rem; color: #a0c0a8; }

  /* Case 3：無交集 */
  .dgp-result--none {
    background: linear-gradient(135deg, rgba(15,20,40,0.6), rgba(10,15,35,0.4));
    border-color: rgba(100,120,160,0.2);
  }
  .dgp-badge--none { background: rgba(100,120,160,0.1); color: #7a98b0; }
  .dgp-result--none .dgp-gate-num { color: #90b0d0; }

  /* CTA */
  .dgp-cta-wrap {
    margin-top: 24px; text-align: center;
    padding: 24px; border-radius: 14px;
    background: linear-gradient(135deg, rgba(60,30,120,0.4), rgba(40,20,80,0.3));
    border: 1px solid rgba(167,139,250,0.2);
  }
  .dgp-cta-text { font-size: 0.9rem; color: #b0a0d0; margin-bottom: 16px; line-height: 1.6; }
  .dgp-cta-btn {
    display: inline-block; width: 100%;
    padding: 16px 28px; border-radius: 12px; border: none; cursor: pointer;
    background: linear-gradient(135deg, #b08030, #d4a840);
    color: #1a1408; font-size: 1rem; font-weight: 800; letter-spacing: .03em;
    box-shadow: 0 6px 24px rgba(180,140,40,.35);
    transition: all .2s; margin-bottom: 10px;
  }
  .dgp-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 32px rgba(180,140,40,.5); }
  .dgp-price {
    display: inline-block; margin-left: 10px;
    background: rgba(26,20,8,0.4); border-radius: 6px;
    padding: 2px 8px; font-size: 0.82rem;
  }
  .dgp-cta-hint { font-size: 0.74rem; color: #6a7888; }
  .dgp-reinput-row {
    text-align: center; margin-top: 12px; padding-top: 12px;
    border-top: 1px solid rgba(255,255,255,0.05);
  }
  .dgp-reinput-btn {
    background: none; border: none; cursor: pointer; padding: 4px 8px;
    font-size: 0.72rem; color: #4a5868;
    transition: color 0.2s;
    -webkit-tap-highlight-color: transparent;
  }
  .dgp-reinput-btn:hover { color: #7090a8; text-decoration: underline; text-underline-offset: 2px; }
  .dgp-error { color: #e08080; font-size: 0.88rem; text-align: center; padding: 16px; }

  /* ── 已登入用戶問候列 ── */
  .dg-personal-user-banner {
    display: flex; align-items: center; gap: 10px;
    background: linear-gradient(135deg, rgba(30,20,60,0.7), rgba(20,15,50,0.5));
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 12px; padding: 14px 20px; margin-bottom: 20px;
  }
  .dgp-user-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: linear-gradient(135deg, rgba(167,139,250,0.3), rgba(100,80,200,0.2));
    border: 1px solid rgba(167,139,250,0.3);
    display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; color: #a78bfa; flex-shrink: 0;
  }
  .dgp-user-name { font-size: 0.9rem; font-weight: 600; color: #c4b5fd; }
  .dgp-user-tag  {
    font-size: 0.74rem; color: #7a98b0;
    margin-left: auto;
    background: rgba(167,139,250,0.08);
    border: 1px solid rgba(167,139,250,0.15);
    border-radius: 20px; padding: 3px 10px;
  }

  /* ── 無報告引導 ── */
  .dgp-no-report {
    text-align: center; padding: 32px 16px;
    border: 1px dashed rgba(167,139,250,0.2);
    border-radius: 12px; background: rgba(20,15,40,0.4);
  }
  .dgp-no-report-icon { font-size: 2rem; margin-bottom: 14px; opacity: 0.7; }
  .dgp-no-report-text {
    font-size: 0.9rem; color: #90b0d0;
    margin-bottom: 20px; line-height: 1.6;
  }

  .dg-cta-section {
    background: linear-gradient(135deg, #1a0a4a 0%, #2d1060 50%, #1a0a4a 100%);
    padding: 56px 24px;
    text-align: center;
    border-top: 1px solid rgba(167,139,250,.15);
  }
  .dg-cta-inner { max-width: 500px; margin: 0 auto; }
  .dg-cta-title { font-size: clamp(1.3rem, 3.5vw, 1.8rem); font-weight: 700; color: #e2d9f3; margin-bottom: 12px; line-height: 1.4; }
  .dg-cta-sub { font-size: 0.9rem; color: #a78bfa; margin-bottom: 28px; }
  .dg-cta-btn {
    display: inline-block;
    padding: 16px 36px; border-radius: 50px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff; font-size: 1rem; font-weight: 700; letter-spacing: .04em;
    text-decoration: none;
    box-shadow: 0 8px 30px rgba(139,92,246,.45);
    transition: all .25s;
  }
  .dg-cta-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 40px rgba(139,92,246,.65); }

  /* ── 閘門背景資訊卡（主頁）── */
  .dg-ctx-list { display: flex; flex-direction: column; gap: 0; }
  .dg-ctx-row {
    display: flex; align-items: flex-start; gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(167,139,250,.08);
  }
  .dg-ctx-row:last-child { border-bottom: none; padding-bottom: 0; }
  .dg-ctx-icon {
    font-size: 1.3rem; line-height: 1;
    flex-shrink: 0; width: 28px; text-align: center;
    margin-top: 2px;
  }
  .dg-ctx-body { min-width: 0; flex: 1; }
  .dg-ctx-label {
    font-size: 0.68rem; text-transform: uppercase; letter-spacing: .1em;
    color: #7a6aaa; margin-bottom: 3px;
  }
  .dg-ctx-main {
    font-size: 0.95rem; font-weight: 700; color: #e2d9f3;
    margin-bottom: 4px;
  }
  .dg-ctx-sub {
    font-size: 0.8rem; color: #9080c0; line-height: 1.55;
  }

  /* 六爻提示行 */
  .dg-line-hint {
    margin-top: 14px; padding-top: 14px;
    border-top: 1px solid rgba(167,139,250,.08);
    font-size: 0.82rem; color: #8070b0; line-height: 1.7;
    font-style: italic;
  }
  .dg-line-hint-label {
    display: block;
    font-size: 0.68rem; font-weight: 700; font-style: normal;
    text-transform: uppercase; letter-spacing: .1em;
    color: #7a6aaa; margin-bottom: 6px;
  }

  /* ── 彈窗：標籤列 + 中心說明 ── */
  .dg-popup-meta-tags {
    display: flex; flex-wrap: wrap; gap: 6px;
    margin-bottom: 10px; padding-bottom: 14px;
    border-bottom: 1px solid rgba(167,139,250,.12);
  }
  .dg-popup-tag {
    font-size: 0.75rem; color: #c4b5fd;
    background: rgba(139,92,246,.1);
    border: 1px solid rgba(167,139,250,.2);
    border-radius: 20px; padding: 3px 10px;
    white-space: nowrap;
  }
  .dg-popup-center-desc {
    font-size: 0.8rem; color: #9080c0; line-height: 1.55;
    margin-bottom: 16px;
    padding: 8px 12px;
    background: rgba(139,92,246,.05);
    border-radius: 8px;
    border-left: 2px solid rgba(167,139,250,.25);
  }
  .dg-popup-ctx-block {
    margin-bottom: 16px; padding-bottom: 16px;
    border-bottom: 1px solid rgba(167,139,250,.12);
    display: flex; flex-direction: column; gap: 8px;
  }
  .dg-popup-ctx-row {
    display: flex; gap: 8px; align-items: flex-start;
  }
  .dg-popup-ctx-label {
    flex-shrink: 0; width: 44px;
    font-size: 0.66rem; font-weight: 700; letter-spacing: .07em;
    color: #7a6aaa; text-transform: uppercase;
    margin-top: 2px;
  }
  .dg-popup-ctx-text {
    font-size: 0.8rem; color: #9080c0; line-height: 1.55;
  }
  .dg-popup-hint-label {
    font-weight: 700; font-style: normal;
    color: #7a6aaa; font-size: 0.75rem;
  }

  /* ── 閘門泡泡彈窗 ── */
  .dg-popup-overlay {
    position: fixed; inset: 0; z-index: 1000;
    background: rgba(5, 3, 20, 0.72);
    backdrop-filter: blur(6px);
    display: flex; align-items: flex-end; justify-content: center;
    opacity: 0; transition: opacity .25s ease;
    pointer-events: none;
  }
  .dg-popup-overlay.open {
    opacity: 1; pointer-events: auto;
  }
  .dg-popup-overlay.hidden { display: none; }

  /* 桌機：置中彈窗 */
  @media (min-width: 640px) {
    .dg-popup-overlay { align-items: center; }
    .dg-popup-card {
      border-radius: 20px !important;
      max-width: 480px !important;
      width: 92% !important;
      max-height: 82vh !important;
      transform: translateY(20px);
      transition: transform .25s ease !important;
    }
    .dg-popup-overlay.open .dg-popup-card { transform: translateY(0) !important; }
  }

  /* 卡片本體 */
  .dg-popup-card {
    position: relative;
    width: 100%;
    max-width: 600px;
    max-height: 88vh;
    overflow-y: auto;
    background: linear-gradient(160deg, #1a0f3a 0%, #12092e 60%, #0e0826 100%);
    border: 1px solid rgba(167,139,250,.25);
    border-bottom: none;
    border-radius: 24px 24px 0 0;
    padding: 28px 24px 32px;
    box-shadow: 0 -8px 40px rgba(109,40,217,.25);
    box-sizing: border-box;
    transform: translateY(100%);
    transition: transform .28s cubic-bezier(.22,.68,0,1.2);
    /* 滑動條美化 */
    scrollbar-width: thin; scrollbar-color: rgba(167,139,250,.2) transparent;
  }
  .dg-popup-overlay.open .dg-popup-card { transform: translateY(0); }

  /* 拖動把手（手機視覺提示）*/
  .dg-popup-card::before {
    content: '';
    display: block;
    width: 40px; height: 4px;
    background: rgba(167,139,250,.3);
    border-radius: 2px;
    margin: 0 auto 20px;
  }

  /* 關閉按鈕 */
  .dg-popup-close {
    position: absolute; top: 16px; right: 18px;
    background: rgba(255,255,255,.06); border: 1px solid rgba(167,139,250,.2);
    color: #a78bfa; border-radius: 50%;
    width: 30px; height: 30px;
    font-size: 0.75rem; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all .18s;
  }
  .dg-popup-close:hover { background: rgba(139,92,246,.2); border-color: #a78bfa; }

  /* 彈窗 Header */
  .dg-popup-header {
    display: flex; align-items: center; gap: 18px;
    margin-bottom: 14px;
  }
  .dg-popup-num {
    font-size: 3.8rem; font-weight: 900; line-height: 1;
    flex-shrink: 0;
    background: linear-gradient(135deg, #e2d9f3 0%, #a78bfa 60%, #7c3aed 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
  }
  .dg-popup-names { min-width: 0; }
  .dg-popup-name-zh { font-size: 1.3rem; font-weight: 700; color: #e2d9f3; line-height: 1.3; }
  .dg-popup-name-en { font-size: 0.82rem; color: #a78bfa; letter-spacing: .07em; margin: 3px 0 6px; }
  .dg-popup-today-badge {
    display: inline-block;
    font-size: 0.68rem; font-weight: 700; letter-spacing: .08em;
    color: #fbbf24; background: rgba(251,191,36,.1);
    border: 1px solid rgba(251,191,36,.3); border-radius: 12px;
    padding: 2px 10px;
  }

  /* Meta 行 */
  .dg-popup-meta {
    display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
    margin-bottom: 16px; padding-bottom: 16px;
    border-bottom: 1px solid rgba(167,139,250,.12);
  }
  .dg-popup-meta-item { font-size: 0.78rem; color: #c4b5fd; }
  .dg-popup-meta-sep { font-size: 0.7rem; color: rgba(167,139,250,.3); }

  /* 內容段落 */
  .dg-popup-section { margin-bottom: 14px; }
  .dg-popup-section-label {
    font-size: 0.68rem; font-weight: 700; letter-spacing: .1em;
    color: #a78bfa; text-transform: uppercase;
    margin-bottom: 6px;
  }
  .dg-popup-shadow-label { color: #94a3b8; }
  .dg-popup-section-text {
    font-size: 0.88rem; line-height: 1.7; color: #c4b5fd;
  }
  .dg-popup-hint {
    font-size: 0.78rem; color: #7a6aaa; font-style: italic;
    line-height: 1.6; margin-bottom: 16px;
    padding: 10px 14px;
    background: rgba(139,92,246,.06); border-radius: 10px;
    border-left: 2px solid rgba(167,139,250,.3);
  }
  .dg-popup-prompt {
    font-size: 0.95rem; line-height: 1.75; color: #d4c8f0;
    font-style: italic; text-align: center;
    padding: 16px 0 8px;
  }

  /* 底部 CTA */
  .dg-popup-footer { margin-top: 18px; text-align: center; }
  .dg-popup-cta {
    display: inline-block;
    padding: 12px 28px; border-radius: 40px;
    background: linear-gradient(135deg, #7c3aed, #a855f7);
    color: #fff; font-size: 0.88rem; font-weight: 700;
    border: none; cursor: pointer; letter-spacing: .03em;
    box-shadow: 0 6px 20px rgba(139,92,246,.4);
    transition: all .22s;
  }
  .dg-popup-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(139,92,246,.6); }


/* 本機報告刪除按鈕 hover 效果 */
.local-report-del-btn:hover {
  background: rgba(200, 80, 80, 0.15) !important;
  border-color: rgba(200, 80, 80, 0.5) !important;
  color: #e07070 !important;
}


/* ═══════════════════════════════════════════════════
   主題切換按鈕（深/淺色模式）
   ═══════════════════════════════════════════════════ */
.hd-theme-toggle {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 20px;
  border: 1px solid rgba(100, 160, 220, 0.3);
  background: rgba(30, 50, 80, 0.4);
  color: #7aabcc; font-size: 0.75rem; font-weight: 600;
  cursor: pointer; transition: all 0.2s; font-family: inherit;
}
.hd-theme-toggle:hover {
  background: rgba(50, 80, 120, 0.5);
  border-color: rgba(100, 160, 220, 0.5); color: #a0d0f0;
}

/* ═══════════════════════════════════════════════════════════════
   深色模式 — 重構元件基礎樣式（原本為 inline style，現改為 CSS class）
   這些元件在深色模式下的外觀定義，確保不受瀏覽器預設值影響
   ═══════════════════════════════════════════════════════════════ */

/* ── 輪迴交叉：閘門對「能量交織」說明框 ── */
.cross-gate-weave {
  background: rgba(0,0,0,0.2);  /* 深色模式：深色遮罩，讓說明框與卡片背景有層次感 */
}

/* ── PRO 區塊分隔線 ── */
.pro-section-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 40px 0 24px;
}
.psd-line {
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200,160,60,0.5), rgba(200,160,60,0.7));
}
.psd-line.psd-line-r {
  background: linear-gradient(90deg, rgba(200,160,60,0.7), rgba(200,160,60,0.5), transparent);
}
.psd-badge-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}
.psd-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  background: linear-gradient(135deg, #b08030, #d4a840);
  color: #fff8e0;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}
.psd-label {
  font-size: 0.78rem;
  color: rgba(210,170,80,0.75);
  font-weight: 600;
  letter-spacing: 0.05em;
}

/* ── 升級橫幅（免費用戶） ── */
.upgrade-inline-banner {
  background: rgba(20,30,60,0.6);
  border: 1px solid rgba(160,130,50,0.25);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 16px 0;
  text-align: center;
}
.uib-text {
  font-size: 0.88rem;
  color: #c4b5fd;
  margin-bottom: 14px;
  line-height: 1.6;
}
.uib-gift {
  margin-top: 10px;
  font-size: 0.78rem;
  color: rgba(160,180,220,0.55);
}
.uib-gift-link {
  color: rgba(160,180,220,0.7);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.uib-gift-link:hover { color: #c4b5fd; }

/* ── 已解鎖橫幅（付費用戶） ── */
.upgrade-unlocked-banner {
  background: rgba(20,60,30,0.5);
  border: 1px solid rgba(60,160,80,0.25);
  border-radius: 10px;
  padding: 12px 18px;
  margin: 16px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #60b880;
  font-weight: 600;
}

/* ── 試閱提示橫幅（免費用戶） ── */
.upgrade-teaser-banner {
  background: rgba(20,25,50,0.5);
  border: 1px solid rgba(100,130,200,0.2);
  border-radius: 10px;
  padding: 14px 18px;
  margin: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: #90b8d8;
  line-height: 1.6;
}

/* ── 底部最終升級 CTA（免費用戶） ── */
.upgrade-final-cta {
  background: linear-gradient(135deg, rgba(30,20,60,0.6), rgba(20,15,45,0.4));
  border: 1px solid rgba(167,139,250,0.18);
  border-radius: 16px;
  padding: 32px 24px;
  margin: 32px 0;
  text-align: center;
  box-shadow: 0 4px 24px rgba(100,60,200,0.1);
}
.ufc-eyebrow {
  font-size: 0.72rem;
  color: rgba(180,160,220,0.5);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 10px;
}
.ufc-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #e2d9f3;
  line-height: 1.5;
  margin-bottom: 12px;
}
.ufc-desc {
  font-size: 0.85rem;
  color: #90b8d8;
  line-height: 1.7;
  margin-bottom: 20px;
}
.ufc-gift {
  margin-top: 12px;
  font-size: 0.78rem;
  color: rgba(160,180,220,0.55);
}

/* ── 完讀區塊（付費用戶） ── */
.report-completion-block {
  border-top: 1px solid rgba(100,130,200,0.15);
  margin: 40px 0 0;
  padding: 36px 20px;
  text-align: center;
}
.rcb-icon {
  font-size: 1.6rem;
  color: rgba(180,150,60,0.6);
  margin-bottom: 12px;
}
.rcb-title {
  font-size: 1rem;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 10px;
}
.rcb-desc {
  font-size: 0.88rem;
  color: #90b8d8;
  line-height: 1.7;
  margin-bottom: 20px;
}
.rcb-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.rcb-share-hint {
  font-size: 0.78rem;
  color: rgba(160,180,220,0.5);
}
.rcb-btn-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}
.rcb-btn-toc,
.rcb-btn-gift {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 22px;
  border-radius: 10px;
  border: 1px solid rgba(140,120,200,0.3);
  background: rgba(60,40,120,0.25);
  color: #c4b5fd;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.rcb-btn-toc:hover,
.rcb-btn-gift:hover {
  background: rgba(80,60,160,0.35);
  border-color: rgba(167,139,250,0.5);
  color: #e2d9f3;
  transform: translateY(-1px);
}

/* ═══════════════════════════════════════════════════════════════
   淺色模式 (Light Mode) — "Morning Mist" 設計系統

   設計哲學：晨霧玻璃感 × 冷藍灰精品質感
   靈感：Linear / Notion / 高端 SaaS 精品

   色彩 Token:
   ──────────────────────────────────────────
   底色  #e8edf8 → #edf2fa  冷藍灰漸層
   卡片  rgba(255,255,255,0.70)  玻璃白
   邊框  rgba(100,130,200,0.16)
   主文字  #202840  深靛藍黑
   副文字  #384060  靛藍灰
   弱文字  #6878a8  霧藍
   強調色  #3a5098 / #4a68c0  靛藍
   ──────────────────────────────────────────
   ════════════════════════════════════════════════════════════════ */

/* ── 頁面底色 ── */
body.theme-light {
  background: linear-gradient(160deg, #e8edf8 0%, #edf2fa 100%) !important;
  color: #202840 !important;
}

/* ── 導覽列 ── */
body.theme-light .site-nav {
  background: rgba(232,237,248,0.88) !important;
  border-bottom-color: rgba(100,130,200,0.18) !important;
  backdrop-filter: blur(12px);
}
body.theme-light .site-nav a        { color: #384060; }
body.theme-light .site-nav a:hover  { color: #202840; background: rgba(80,110,200,0.08); }
body.theme-light .site-nav a.active { color: #202840; background: rgba(80,110,200,0.12); font-weight: 600; }
body.theme-light .nav-auth-btn      { color: #3a5098 !important; border-color: rgba(80,110,200,0.28) !important; }

/* ── 報告頁標頭 ── */
body.theme-light .report-header { border-bottom-color: rgba(100,130,200,0.14); }
body.theme-light .report-brand {
  background: linear-gradient(135deg, rgba(255,255,255,0.7), rgba(240,244,255,0.5)) !important;
  border-color: rgba(100,130,200,0.15) !important;
  backdrop-filter: blur(8px);
}
body.theme-light .report-name { color: #202840 !important; }
body.theme-light .report-date { color: #6878a8 !important; }

/* ── 徽章 ── */
body.theme-light .tier-free                       { background: rgba(60,120,180,0.08); color: #2a5098; border-color: rgba(60,120,180,0.2); }
body.theme-light .tier-standard                   { background: rgba(180,148,20,0.1); color: #7a5208; border-color: rgba(180,148,20,0.2); }
body.theme-light .report-tier-badge.tier-free     { background: rgba(60,120,180,0.08); color: #2a5098; border-color: rgba(60,120,180,0.18); }
body.theme-light .report-tier-badge.tier-standard { background: rgba(180,148,20,0.1); color: #7a5208; border-color: rgba(180,148,20,0.18); }

/* ── 佈局容器 ── */
body.theme-light .report-layout { background: transparent !important; }
body.theme-light .report-sidebar {
  background: rgba(255,255,255,0.55) !important;
  border-color: rgba(100,130,200,0.16) !important;
  box-shadow: 0 2px 16px rgba(60,80,160,0.06) !important;
  backdrop-filter: blur(8px);
}
body.theme-light .sidebar-section { border-bottom-color: rgba(100,130,200,0.1) !important; }
body.theme-light .sidebar-label   { color: #6878a8 !important; }
body.theme-light .sidebar-value   { color: #202840 !important; }

/* ── 目錄 ── */
body.theme-light .report-toc-wrap {
  background: rgba(255,255,255,0.55) !important;
  border-color: rgba(100,130,200,0.16) !important;
  backdrop-filter: blur(8px);
}
body.theme-light .toc-title          { color: #202840 !important; }
body.theme-light .toc-item           { color: #384060 !important; border-bottom-color: rgba(100,130,200,0.08) !important; }
body.theme-light .toc-item:hover     { background: rgba(80,110,200,0.06) !important; color: #202840 !important; }
body.theme-light .toc-item.active    { color: #3a5098 !important; font-weight: 600; }
body.theme-light .toc-item-number    { color: #6878a8 !important; }

/* ── 主題切換按鈕 ── */
body.theme-light .hd-theme-toggle {
  background: rgba(255,255,255,0.7) !important;
  border-color: rgba(100,130,200,0.25) !important;
  color: #3a5098 !important;
}
body.theme-light .hd-theme-toggle:hover {
  background: rgba(255,255,255,0.9) !important;
  border-color: rgba(80,110,200,0.4) !important;
  color: #202840 !important;
}

/* ── 浮動操作按鈕 (FAB) ── */
body.theme-light .report-fab-toggle {
  background: linear-gradient(135deg, rgba(255,255,255,0.92), rgba(235,240,255,0.88)) !important;
  border-color: rgba(80,110,200,0.30) !important;
  color: #3a5098 !important;
  box-shadow: 0 4px 20px rgba(60,80,160,0.15) !important;
}
body.theme-light .report-fab-toggle:hover {
  background: linear-gradient(135deg, rgba(255,255,255,1), rgba(225,232,255,0.95)) !important;
  border-color: rgba(80,110,200,0.5) !important;
  box-shadow: 0 6px 24px rgba(60,80,160,0.22) !important;
}
body.theme-light .report-fab-item {
  background: rgba(255,255,255,0.94) !important;
  border-color: rgba(80,110,200,0.22) !important;
  color: #384060 !important;
  box-shadow: 0 2px 12px rgba(60,80,160,0.10) !important;
}
body.theme-light .report-fab-item:hover {
  background: rgba(240,244,255,0.98) !important;
  border-color: rgba(80,110,200,0.40) !important;
  color: #202840 !important;
}
body.theme-light .fab-toc-list {
  background: rgba(255,255,255,0.97) !important;
  border-color: rgba(80,110,200,0.20) !important;
  box-shadow: 0 8px 32px rgba(60,80,160,0.14) !important;
}
body.theme-light .fab-toc-item {
  background: rgba(245,248,255,0.95) !important;
  border-color: rgba(80,110,200,0.15) !important;
  color: #384060 !important;
}
body.theme-light .fab-toc-item:hover {
  background: rgba(80,110,200,0.10) !important;
  border-color: rgba(80,110,200,0.35) !important;
  color: #202840 !important;
}

/* ── 章節分隔 ── */
body.theme-light .report-chapter-break {
  background: rgba(255,255,255,0.45) !important;
  border: 1px solid rgba(100,130,200,0.14) !important;
  box-shadow: 0 2px 16px rgba(60,80,160,0.05) !important;
}
body.theme-light .rcb-part-label { color: #6878a8 !important; }
body.theme-light .rcb-title      { color: #202840 !important; }
body.theme-light .rcb-icon       { color: #6878a8 !important; }
body.theme-light .rcb-summary    { color: #384060 !important; }

/* ── 輸出卡片 ── */
body.theme-light .output-card {
  background: rgba(255,255,255,0.70) !important;
  border-color: rgba(100,130,200,0.16) !important;
  box-shadow: 0 2px 20px rgba(60,80,160,0.07) !important;
  backdrop-filter: blur(8px);
}

/* ── 卡片標頭文字（高優先度）── */
body.theme-light #app-report .card-header .card-title    { color: #202840 !important; font-weight: 700; }
body.theme-light #app-report .card-header .card-subtitle { color: #6878a8 !important; }

/* ── 卡片標頭色系（語意色）── */

/* 通用 fallback */
body.theme-light #app-report .card-header {
  background: rgba(255,255,255,0.60) !important;
  border-bottom-color: rgba(100,130,200,0.13) !important;
  border-left: none !important;
}

/* 類型卡：暖金調 */
body.theme-light #app-report .header-type,
body.theme-light #app-report #card-type .card-header {
  background: linear-gradient(135deg, rgba(220,200,140,0.25) 0%, rgba(240,220,160,0.15) 100%) !important;
  border-bottom-color: rgba(180,150,40,0.18) !important;
}
body.theme-light #app-report .header-type .card-title,
body.theme-light #app-report #card-type .card-header .card-title    { color: #4a3410 !important; }
body.theme-light #app-report .header-type .card-subtitle,
body.theme-light #app-report #card-type .card-header .card-subtitle { color: #8a6830 !important; }

/* 權威卡：鼠尾草綠 */
body.theme-light #app-report .header-authority,
body.theme-light #app-report #card-auth .card-header {
  background: linear-gradient(135deg, rgba(140,200,160,0.22) 0%, rgba(160,220,180,0.13) 100%) !important;
  border-bottom-color: rgba(60,140,80,0.18) !important;
}
body.theme-light #app-report .header-authority .card-title,
body.theme-light #app-report #card-auth .card-header .card-title    { color: #1a4828 !important; }
body.theme-light #app-report .header-authority .card-subtitle,
body.theme-light #app-report #card-auth .card-header .card-subtitle { color: #3a7850 !important; }

/* 輪廓卡：玫瑰赤陶 */
body.theme-light #app-report .header-role,
body.theme-light #app-report #card-role .card-header {
  background: linear-gradient(135deg, rgba(210,150,130,0.2) 0%, rgba(230,170,150,0.12) 100%) !important;
  border-bottom-color: rgba(170,80,60,0.18) !important;
}
body.theme-light #app-report .header-role .card-title,
body.theme-light #app-report #card-role .card-header .card-title    { color: #6a2818 !important; }
body.theme-light #app-report .header-role .card-subtitle,
body.theme-light #app-report #card-role .card-header .card-subtitle { color: #9a4838 !important; }

/* 定義卡：天青石藍 */
body.theme-light #app-report .header-definition,
body.theme-light #app-report #card-def .card-header {
  background: linear-gradient(135deg, rgba(120,160,230,0.2) 0%, rgba(140,180,240,0.12) 100%) !important;
  border-bottom-color: rgba(60,110,200,0.18) !important;
}
body.theme-light #app-report .header-definition .card-title,
body.theme-light #app-report #card-def .card-header .card-title    { color: #1a3870 !important; }
body.theme-light #app-report .header-definition .card-subtitle,
body.theme-light #app-report #card-def .card-header .card-subtitle { color: #2a58a8 !important; }

/* 能量中心卡：靛藍調 */
body.theme-light #app-report #card-centers .card-header {
  background: linear-gradient(135deg, rgba(100,130,220,0.18) 0%, rgba(120,150,230,0.1) 100%) !important;
  border-bottom-color: rgba(80,110,200,0.16) !important;
}
body.theme-light #app-report #card-centers .card-header .card-title    { color: #1e2a60 !important; }
body.theme-light #app-report #card-centers .card-header .card-subtitle { color: #4858a0 !important; }

/* PRO 卡：古金 */
body.theme-light #app-report #card-channels      .card-header,
body.theme-light #app-report #card-roles-channels .card-header,
body.theme-light #app-report #card-arrows        .card-header,
body.theme-light #app-report #card-cross         .card-header,
body.theme-light #app-report #card-nodes         .card-header,
body.theme-light #app-report #card-phs           .card-header,
body.theme-light #app-report #card-extra-gates   .card-header {
  background: linear-gradient(135deg, rgba(220,200,100,0.22) 0%, rgba(240,220,130,0.13) 100%) !important;
  border-bottom-color: rgba(180,148,10,0.22) !important;
}
body.theme-light #app-report #card-channels      .card-header .card-title,
body.theme-light #app-report #card-roles-channels .card-header .card-title,
body.theme-light #app-report #card-arrows        .card-header .card-title,
body.theme-light #app-report #card-cross         .card-header .card-title,
body.theme-light #app-report #card-nodes         .card-header .card-title,
body.theme-light #app-report #card-phs           .card-header .card-title,
body.theme-light #app-report #card-extra-gates   .card-header .card-title { color: #3c2c08 !important; }
body.theme-light #app-report #card-channels      .card-header .card-subtitle,
body.theme-light #app-report #card-roles-channels .card-header .card-subtitle,
body.theme-light #app-report #card-arrows        .card-header .card-subtitle,
body.theme-light #app-report #card-cross         .card-header .card-subtitle,
body.theme-light #app-report #card-nodes         .card-header .card-subtitle,
body.theme-light #app-report #card-phs           .card-header .card-subtitle,
body.theme-light #app-report #card-extra-gates   .card-header .card-subtitle { color: #9a7820 !important; }

/* ── card collapse btn ── */
body.theme-light #app-report .card-collapse-btn {
  background: rgba(80,110,200,0.07) !important;
  border-color: rgba(80,110,200,0.22) !important;
  color: #3a5098 !important;
}
body.theme-light #app-report .card-collapse-btn:hover {
  background: rgba(80,110,200,0.14) !important;
  color: #202840 !important;
}

/* ── card body ── */
body.theme-light .card-title    { color: #202840 !important; }
body.theme-light .card-subtitle { color: #6878a8 !important; }
body.theme-light #app-report .card-header { border-bottom-color: rgba(100,130,200,0.13) !important; }
body.theme-light .card-body { color: #384060; }

/* ── Tags ── */
body.theme-light .tag-strategy { background: rgba(80,110,200,0.07); color: #3a5098; border-color: rgba(80,110,200,0.18); }
body.theme-light .tag-percent  { background: rgba(100,130,160,0.07); color: #3a5878; border-color: rgba(80,110,150,0.16); }
body.theme-light .tag-nonself  { background: rgba(180,80,80,0.07); color: #803030; border-color: rgba(160,60,60,0.16); }
body.theme-light #app-report .tag-strategy { background: rgba(80,110,200,0.07) !important; color: #3a5098 !important; border-color: rgba(80,110,200,0.18) !important; }
body.theme-light #app-report .tag-percent  { background: rgba(100,130,160,0.07) !important; color: #3a5878 !important; border-color: rgba(80,110,150,0.16) !important; }
body.theme-light #app-report .tag-nonself  { background: rgba(180,80,80,0.07) !important; color: #803030 !important; border-color: rgba(160,60,60,0.16) !important; }

/* ── Section Labels & Text ── */
body.theme-light .section-label    { color: #3a5098; font-weight: 700; letter-spacing: 0.04em; }
body.theme-light .trait-item       { color: #384060; }
body.theme-light .trait-dot        { background: #4a68c0; }
body.theme-light .hd-summary-text  { color: #384060; }
body.theme-light .hd-detail-toggle {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(80,110,200,0.28) !important;
  color: #3a5098 !important;
  font-weight: 600;
}
body.theme-light .hd-detail-toggle:hover {
  background: rgba(80,110,200,0.10) !important;
  border-color: rgba(80,110,200,0.45) !important;
  color: #202840 !important;
}
body.theme-light .hd-bottom-close-btn {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(80,110,200,0.28) !important;
  color: #3a5098 !important;
}
body.theme-light .hd-bottom-close-btn:hover {
  background: rgba(80,110,200,0.10) !important;
  border-color: rgba(80,110,200,0.45) !important;
  color: #202840 !important;
}
body.theme-light .hd-bottom-close-wrap {
  border-top-color: rgba(80,110,200,0.12) !important;
}

/* ── Advice Boxes（含 class-level 繼承色 + inline style 雙重覆蓋）── */
body.theme-light .advice-box,
body.theme-light #app-report .advice-box {
  background: rgba(80,110,200,0.07) !important;
  color: #202840 !important;
  border-left-color: #4a70c8 !important;
  border-left-width: 3px !important;
}
/* 確保所有子元素（含 class CSS 繼承色）都可讀 */
body.theme-light .advice-box *,
body.theme-light #app-report .advice-box * {
  color: #202840 !important;
}

/* ── 章節導覽列 light mode ── */
body.theme-light .report-chapter-nav {
  background: transparent !important;
  border-color: rgba(100,130,200,0.2) !important;
}
body.theme-light .report-chapter-nav-item {
  background: rgba(255,255,255,0.55) !important;
  color: #384060 !important;
  border-right-color: rgba(100,130,200,0.15) !important;
}
body.theme-light .report-chapter-nav-item:hover {
  background: rgba(80,110,200,0.1) !important;
  color: #202840 !important;
}
body.theme-light .report-chapter-nav-item.rcn-active {
  background: rgba(80,110,200,0.14) !important;
  color: #202840 !important;
  font-weight: 600;
}
body.theme-light .report-chapter-nav-item.rcn-pro {
  color: #7a5808 !important;
}
body.theme-light .report-chapter-nav-item.rcn-pro:hover,
body.theme-light .report-chapter-nav-item.rcn-pro.rcn-active {
  background: rgba(180,148,10,0.1) !important;
  color: #4a3005 !important;
}
body.theme-light .rcn-num { color: #6878a8 !important; }
body.theme-light .report-chapter-nav-item.rcn-pro .rcn-num { color: #9a7820 !important; }

/* ── 閱讀進度條 ── */
body.theme-light .report-reading-progress {
  background: rgba(100,130,200,0.1) !important;
}
body.theme-light .report-reading-progress-bar {
  background: linear-gradient(90deg, #4a68c0, #6a88e0) !important;
}

/* ── 分享 & 複製連結按鈕 ── */
body.theme-light .share-btn {
  background: rgba(255,255,255,0.7) !important;
  color: #3a5098 !important;
  border-color: rgba(80,110,200,0.24) !important;
}
body.theme-light .share-btn:hover {
  background: rgba(80,110,200,0.1) !important;
  color: #202840 !important;
}
body.theme-light .report-share { color: #384060 !important; }
body.theme-light .report-permalink { color: #6878a8 !important; }

/* ── Decision Steps ── */
body.theme-light .step     { color: #384060; }
body.theme-light .step-num { background: rgba(80,110,200,0.12); color: #3a5098; border-color: rgba(80,110,200,0.2); }

/* ── Center Cards ── */
body.theme-light .center-card-defined {
  background: rgba(60,130,180,0.1) !important;
  border-color: rgba(60,130,180,0.25) !important;
}
body.theme-light .center-card-open {
  background: rgba(255,255,255,0.4) !important;
  border-color: rgba(100,130,200,0.14) !important;
}
body.theme-light .center-name-defined { color: #1a3870 !important; }
body.theme-light .center-name-open    { color: #6878a8 !important; }
body.theme-light .center-label        { color: #4858a0 !important; }
body.theme-light .center-desc         { color: #384060 !important; }

/* ── Channels ── */
body.theme-light .channel-item {
  background: rgba(255,255,255,0.5) !important;
  border-color: rgba(100,130,200,0.16) !important;
}
body.theme-light .channel-name    { color: #202840 !important; }
body.theme-light .channel-gates   { color: #6878a8 !important; }
body.theme-light .channel-circuit { color: #4858a0 !important; }
body.theme-light .channel-desc    { color: #384060 !important; }

/* ── Gate List ── */
body.theme-light .gate-item {
  background: rgba(255,255,255,0.5) !important;
  border-color: rgba(100,130,200,0.14) !important;
  color: #384060 !important;
}
body.theme-light .gate-number { color: #3a5098 !important; font-weight: 700; }
body.theme-light .gate-name   { color: #202840 !important; }
body.theme-light .gate-planet { color: #6878a8 !important; }

/* ── 展開所有細節按鈕 ── */
body.theme-light .hd-expand-all-btn {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(80,110,200,0.28) !important;
  color: #3a5098 !important;
}
body.theme-light .hd-expand-all-btn:hover {
  background: rgba(80,110,200,0.1) !important;
  border-color: rgba(80,110,200,0.45) !important;
  color: #202840 !important;
}

/* ── Resonate Boxes ── */
body.theme-light .hd-resonate-box {
  background: rgba(255,255,255,0.55) !important;
  border-color: rgba(80,110,200,0.16) !important;
}
/* 隱藏金色頂部光暈線 */
body.theme-light .hd-resonate-box::before {
  background: linear-gradient(90deg, transparent, rgba(80,110,200,0.25), transparent) !important;
}
body.theme-light .hrb-question { color: #202840 !important; }
body.theme-light .hrb-header   { color: #6878a8 !important; border-bottom-color: rgba(80,110,200,0.12) !important; }
/* 生活呼應選項按鈕（含 .hrb-opt class 直接覆蓋）*/
body.theme-light .hrb-opt,
body.theme-light .hrb-options button {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(80,110,200,0.22) !important;
  color: #384060 !important;
}
body.theme-light .hrb-opt:hover,
body.theme-light .hrb-options button:hover {
  background: rgba(80,110,200,0.09) !important;
  border-color: rgba(80,110,200,0.38) !important;
  color: #202840 !important;
}
/* 選中狀態 */
body.theme-light .hrb-opt.hrb-selected {
  background: rgba(80,110,200,0.13) !important;
  border-color: rgba(80,110,200,0.5) !important;
  color: #202840 !important;
  font-weight: 600;
}

/* 展開的回饋文字 */
body.theme-light .hrb-feedback-wrap {
  background: rgba(80,110,200,0.06) !important;
  border-left-color: rgba(80,110,200,0.35) !important;
}
body.theme-light .hrb-feedback {
  color: #202840 !important;
}
body.theme-light .hrb-label { color: #3a5098 !important; }

/* ── 引言框 (renderQuoteBox) — rgba 背景抓不到需直接覆蓋 ── */
body.theme-light .hd-quote-box {
  background: rgba(80,110,200,0.06) !important;
  border-color: rgba(80,110,200,0.18) !important;
}
body.theme-light .hd-quote-box * { color: #384060 !important; }

/* ── PRO section divider ── */
body.theme-light .pro-section-divider .psd-line {
  background: linear-gradient(90deg, transparent, rgba(180,148,10,0.4), transparent) !important;
}
body.theme-light .pro-section-divider .psd-badge {
  background: linear-gradient(135deg, #b08030, #d4a840) !important;
  color: #fff8e0 !important;
}
body.theme-light .pro-section-divider .psd-label { color: #8a6818 !important; }

/* ── Upgrade Banners ── */
body.theme-light .upgrade-inline-banner {
  background: rgba(255,255,255,0.55) !important;
  border-color: rgba(100,130,200,0.18) !important;
}
body.theme-light .uib-text { color: #384060 !important; }
body.theme-light .uib-gift { color: #6878a8 !important; }
body.theme-light .uib-gift-link { color: #3a5098 !important; }

body.theme-light .upgrade-unlocked-banner {
  background: rgba(60,130,180,0.08);
  border-color: rgba(60,130,180,0.2);
  color: #1a3870;
}

body.theme-light .upgrade-teaser-banner {
  background: rgba(255,255,255,0.5);
  border-color: rgba(100,130,200,0.16);
  color: #384060;
}

body.theme-light .upgrade-final-cta {
  background: rgba(255,255,255,0.55);
  border-color: rgba(100,130,200,0.18);
  box-shadow: 0 4px 24px rgba(60,80,160,0.07);
}
body.theme-light .ufc-eyebrow { color: #6878a8; }
body.theme-light .ufc-title   { color: #202840; }
body.theme-light .ufc-desc    { color: #384060; }
body.theme-light .ufc-gift    { color: #3a5098; }

/* ── 輪迴交叉：閘門對「能量交織」說明框 ── */
body.theme-light .cross-gate-weave {
  background: rgba(80,110,200,0.07) !important;
  color: #384060 !important;
}
body.theme-light .cross-gate-weave strong { color: #3a5098 !important; }

/* ── 付費完成區塊 ── */
body.theme-light .report-completion-block { border-top-color: rgba(100,130,200,0.14); }
body.theme-light .rcb-title      { color: #202840; }
body.theme-light .rcb-desc       { color: #384060; }
body.theme-light .rcb-share-hint { color: #6878a8; }
body.theme-light .rcb-btn-toc {
  background: rgba(80,110,200,0.08); border-color: rgba(80,110,200,0.24); color: #3a5098;
}
body.theme-light .rcb-btn-toc:hover  { background: rgba(80,110,200,0.14); border-color: rgba(80,110,200,0.4); }
body.theme-light .rcb-btn-gift {
  background: rgba(80,110,200,0.08); border-color: rgba(80,110,200,0.24); color: #3a5098;
}
body.theme-light .rcb-btn-gift:hover { background: rgba(80,110,200,0.14); border-color: rgba(80,110,200,0.4); }

/* ── PDF 按鈕 ── */
body.theme-light #report-pdf-btn {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(100,130,200,0.22) !important;
  box-shadow: 0 2px 12px rgba(60,80,160,0.06) !important;
}
body.theme-light #report-pdf-btn * { color: #384060 !important; }
body.theme-light #report-pdf-btn button,
body.theme-light #report-pdf-btn [style] {
  background: rgba(255,255,255,0.9) !important;
  color: #3a5098 !important;
  border-color: rgba(80,110,200,0.24) !important;
}
body.theme-light #report-pdf-btn button:hover {
  background: rgba(80,110,200,0.1) !important;
}

/* ── 保存報告 CTA ── */
body.theme-light #save-report-cta .save-report-banner {
  background: rgba(255,255,255,0.6) !important;
  border-color: rgba(100,130,200,0.18) !important;
  box-shadow: 0 4px 20px rgba(60,80,160,0.07) !important;
}
body.theme-light #save-report-cta .srb-title    { color: #202840 !important; }
body.theme-light #save-report-cta .srb-desc     { color: #384060 !important; }
body.theme-light #save-report-cta .srb-note     { color: #6878a8 !important; }
body.theme-light #save-report-cta .srb-footnote { color: #8898c0 !important; }
body.theme-light #save-report-cta .srb-btn {
  background: linear-gradient(135deg, #3a5098, #4a68c0) !important;
  color: #f0f4ff !important;
  box-shadow: 0 4px 16px rgba(60,80,200,0.22) !important;
}
body.theme-light #save-report-cta .srb-btn:hover {
  background: linear-gradient(135deg, #2e4080, #3a58b0) !important;
  box-shadow: 0 6px 20px rgba(60,80,200,0.3) !important;
}

/* ── Gift 兌換連結 ── */
body.theme-light a[data-invite-slug]       { color: #3a5098 !important; }
body.theme-light a[data-invite-slug]:hover { color: #202840 !important; }

/* ══════════════════════════════════════════════════════════════
   淺色模式：修復 inline style 深色背景 / 淺色文字不可見問題
   ══════════════════════════════════════════════════════════════ */

body.theme-light #app-report [data-lm-bg] {
  background: rgba(80,110,200,0.05) !important;
  color: #384060 !important; /* 防止繼承的深色模式 CSS 文字色在淺底上不可讀 */
}
body.theme-light #app-report .card-body [data-lm-bg] {
  border-color: rgba(80,110,200,0.1) !important;
  border-left-color: rgba(80,110,200,0.28) !important;
}
body.theme-light #app-report [data-lm-text="1"]    { color: #384060 !important; }
body.theme-light #app-report [data-lm-text="warm"] { color: #202840 !important; }

/* Advice box — 強制所有子元素文字可讀（最高優先）*/
body.theme-light #app-report .advice-box {
  background: rgba(80,110,200,0.07) !important;
  color: #202840 !important;
  border-left-color: #3a70c0 !important;
}
body.theme-light #app-report .advice-box *,
body.theme-light #app-report .advice-box strong,
body.theme-light #app-report .advice-box em,
body.theme-light #app-report .advice-box div,
body.theme-light #app-report .advice-box span {
  color: #202840 !important;
}

/* ── Edit Data 區塊（inline 樣式覆蓋）── */
body.theme-light .edit-data-label  { color: rgba(80,110,200,0.5) !important; }
body.theme-light .edit-data-desc   { color: #384060 !important; }
body.theme-light .edit-data-note   { color: #6878a8 !important; }
body.theme-light .edit-data-divider > div { background: linear-gradient(90deg,transparent,rgba(80,110,200,0.2)) !important; }
body.theme-light [data-edit-slug] {
  background: rgba(80,110,200,0.08) !important;
  color: #3a5098 !important;
  border-color: rgba(80,110,200,0.24) !important;
}
body.theme-light [data-edit-slug]:hover {
  background: rgba(80,110,200,0.15) !important;
  color: #202840 !important;
}


/* ── Tags（高優先度確保覆蓋）── */
body.theme-light #app-report .tag-strategy { background: rgba(80,110,200,0.07) !important; color: #3a5098 !important; border-color: rgba(80,110,200,0.18) !important; }
body.theme-light #app-report .tag-percent  { background: rgba(100,130,160,0.07) !important; color: #3a5878 !important; border-color: rgba(80,110,150,0.16) !important; }
body.theme-light #app-report .tag-nonself  { background: rgba(180,80,80,0.07) !important; color: #803030 !important; border-color: rgba(160,60,60,0.16) !important; }

/* ── Report footer ── */
body.theme-light .report-footer {
  border-top-color: rgba(100,130,200,0.12) !important;
  color: #6878a8 !important;
}

/* ── 報告已保存 Banner（動態注入，深色版）── */
.report-saved-banner {
  background: linear-gradient(135deg, rgba(20,50,30,0.6), rgba(15,40,25,0.4));
  border: 1px solid rgba(80,200,120,0.3);
  border-radius: 16px; padding: 24px 20px; text-align: center;
}
.rsb-title {
  font-size: 0.95rem; font-weight: 700; color: #80d8a0; margin-bottom: 8px;
}
.rsb-desc {
  font-size: 0.8rem; color: #70a888; margin-bottom: 16px; line-height: 1.6;
}
.rsb-btn {
  display: inline-block; width: 100%; max-width: 320px;
  padding: 12px 36px; border-radius: 12px; border: none;
  background: linear-gradient(135deg, #2a6848, #3a8860);
  color: #e0fff0; font-weight: 700; font-size: 0.9rem;
  cursor: pointer; transition: all 0.2s;
  box-shadow: 0 4px 16px rgba(40,120,80,0.3);
  font-family: inherit;
}
.rsb-btn:hover { background: linear-gradient(135deg, #2a7850, #4a9870); transform: translateY(-1px); }

/* 淺色版覆蓋 */
body.theme-light .report-saved-banner {
  background: rgba(255,255,255,0.72) !important;
  border-color: rgba(100,130,200,0.22) !important;
  box-shadow: 0 4px 20px rgba(60,80,160,0.08) !important;
}
body.theme-light .rsb-title { color: #202840 !important; }
body.theme-light .rsb-desc  { color: #384060 !important; }
body.theme-light .rsb-btn {
  background: linear-gradient(135deg, #3a5098, #4a68c0) !important;
  color: #f0f4ff !important;
  box-shadow: 0 4px 16px rgba(60,80,200,0.22) !important;
}
body.theme-light .rsb-btn:hover {
  background: linear-gradient(135deg, #2e4080, #3a58b0) !important;
}

/* ── 已解鎖 / 保存 banners ── */
body.theme-light .save-report-banner {
  background: rgba(255,255,255,0.6);
  border-color: rgba(100,130,200,0.18);
  box-shadow: 0 4px 20px rgba(60,80,160,0.07);
}
body.theme-light .srb-title    { color: #202840; }
body.theme-light .srb-desc     { color: #384060; }
body.theme-light .srb-note     { color: #6878a8; }
body.theme-light .srb-footnote { color: #8898c0; }
body.theme-light .srb-btn {
  background: linear-gradient(135deg, #3a5098, #4a68c0);
  color: #f0f4ff;
  box-shadow: 0 4px 16px rgba(60,80,200,0.22);
}
body.theme-light .srb-btn:hover {
  background: linear-gradient(135deg, #2e4080, #3a58b0);
  box-shadow: 0 6px 20px rgba(60,80,200,0.3);
}

/* ── 刪除確認 Overlay ── */
body.theme-light #delete-confirm-overlay > div {
  background: rgba(255,255,255,0.98) !important;
  border-color: rgba(180,50,50,0.2) !important;
  box-shadow: 0 8px 40px rgba(0,0,0,0.1), 0 2px 8px rgba(0,0,0,0.05) !important;
}

/* ── My Reports inline 文字修正 ── */
body.theme-light #app-my-reports div[style*="color:#90b8d8"] { color: #3a5098 !important; }
body.theme-light #app-my-reports div[style*="color:#607888"] { color: #384060 !important; }
body.theme-light #app-my-reports div[style*="color:#506878"] { color: #6878a8 !important; }

/* ── 行動版 ── */
@media (max-width: 640px) {
  body.theme-light .hd-theme-toggle { font-size: 0.7rem; padding: 4px 10px; }
}

