/* ============================================================
   Chimera Test Lab - 共通スタイルシート (common.css)
   ============================================================ */

/* --- リセット & 基本設定 --- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  background-image: radial-gradient(#cbd5e1 1.2px, transparent 1.2px);
  background-size: 24px 24px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

/* --- レイアウトコンテナ --- */
.container {
  width: 100%;
  max-width: 680px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

/* メインのカード枠（診断ページ共通） */
#quiz-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 24px 24px 28px;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  text-align: center;
}

/* --- 共通ナビゲーションヘッダー（左：トップへ戻る / 右：Clerk認証） --- */
#test-nav-header {
  width: 100%;
  margin-bottom: 24px;
}

.global-nav-header {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  width: 100%;
  min-height: 36px;
}

.nav-header-left {
  display: flex;
  align-items: center;
}

.nav-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-auth-login {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 6px 14px;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4338ca;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
  line-height: 1.4;
  white-space: nowrap;
}

.btn-auth-login:hover {
  background: #eef2ff;
  border-color: #a5b4fc;
  color: #3730a3;
  transform: translateY(-1px);
}

/* --- ページ上部・ヘッダー要素 --- */




/* --- 共通ピル型バッジ・フォント統一スタイル --- */
.intro-badge {
  background-color: #eef2ff !important;
  color: #4f46e5 !important;
  font-size: 0.75rem !important;
  font-weight: 800 !important;
  letter-spacing: 0.04em !important;
  padding: 4px 12px !important;
  border-radius: 9999px !important;
  display: inline-block !important;
  border: none !important;
  box-shadow: none !important;
  outline: none !important;
  -webkit-font-smoothing: antialiased !important;
}





.intro-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.35;
  margin-bottom: 10px;
}

/* 診断イントロのビジュアルイメージ */
.intro-visual-wrap {
  width: 100%;
  max-width: 540px;
  margin: 16px auto 20px;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  aspect-ratio: 1200 / 630;
}

.intro-visual-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.intro-desc {
  font-size: 0.88rem;
  color: #64748b;
  line-height: 1.6;
  margin-bottom: 24px;
}

/* イントロのメタボックス */
.intro-meta-box {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-bottom: 24px;
}

.intro-meta-item {
  flex: 1;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.meta-label {
  display: block;
  font-size: 0.7rem;
  font-weight: 700;
  color: #64748b;
  margin-bottom: 2px;
}

.meta-val {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
}

/* --- 共通ボタンスタイル --- */
.start-btn-primary,
.quiz-btn.primary-btn,
#start-btn.quiz-btn {
  display: inline-block;
  width: 100%;
  background: #4f46e5;
  color: #ffffff;
  font-size: 1rem;
  font-weight: 800;
  padding: 14px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  font-family: inherit;
}

.start-btn-primary:hover,
.quiz-btn.primary-btn:hover,
#start-btn.quiz-btn:hover {
  background: #4338ca;
  box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
  transform: translateY(-1px);
}

.start-btn-primary:active,
.quiz-btn.primary-btn:active,
#start-btn.quiz-btn:active {
  transform: translateY(0);
}

/* --- 設問表示ボックス --- */
.question-box {
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  border-radius: 12px;
  margin-bottom: 24px;
}

.question-text {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  line-height: 1.5;
}

.card-header,
.quiz-header {
  margin-bottom: 20px;
}

.progress-text,
.quiz-progress {
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.options-group,
.options-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.option-btn,
.quiz-option {
  display: block;
  width: 100%;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #1e293b;
  text-align: left;
  cursor: pointer;
  line-height: 1.45;
  transition: all 0.15s ease;
  font-family: inherit;
}

.option-btn:hover,
.quiz-option:hover {
  background: #f8fafc;
  border-color: #6366f1;
  color: #4f46e5;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.option-btn:active,
.quiz-option:active {
  background: #eef2ff;
  transform: translateY(0);
}

/* --- 結果画面スタイル --- */
.result-image-wrap {
  width: 100%;
  max-width: 480px;
  margin: 0 auto 20px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.06);
  aspect-ratio: 1200 / 630;
  background: #f8fafc;
}

.result-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.result-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  margin-bottom: 24px;
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.65;
  color: #334155;
}

.result-box p {
  margin-bottom: 12px;
}

.result-box p:last-child {
  margin-bottom: 0;
}

.share-box {
  margin-bottom: 4px;
}

.share-btn-primary,
.share-btn,
.quiz-btn.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  padding: 13px;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
  margin-bottom: 20px;
  transition: all 0.2s ease;
  font-family: inherit;
}

.share-btn-primary:hover,
.share-btn:hover,
.quiz-btn.share-btn:hover {
  background: #1e293b;
  transform: translateY(-1px);
}

/* --- ページ遷移リンク & 戻るナビ --- */
.nav-links-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
}

.main-link,
.sub-link,
.footer-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #4f46e5;
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 6px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.main-link:hover,
.sub-link:hover,
.footer-nav-link:hover {
  background: #eef2ff;
  border-color: #c7d2fe;
}

@media (max-width: 640px) {
  .container {
    padding: 16px 12px 32px;
  }
  #quiz-card {
    padding: 20px 16px;
    border-radius: 14px;
  }
  .intro-title {
    font-size: 1.35rem;
  }
  .option-btn,
  .quiz-option {
    padding: 12px 14px;
    font-size: 0.88rem;
  }
}


/* ========================================================
   全ページ共通ヘッダー2段化＆スマホ横スクロール防止
   ======================================================== */
html, body {
  overflow-x: hidden;
}

@media (max-width: 640px) {
  /* ヘッダー全体コンテナ */
  #test-nav-header,
  #test-nav-header .global-nav-header {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: space-between !important;
    align-items: center !important;
    width: 100% !important;
    row-gap: 12px !important;
    margin-bottom: 14px !important;
    box-sizing: border-box !important;
  }

  /* 左右のラッパーdivの境界をなくす */
  #test-nav-header .nav-header-left,
  #test-nav-header .nav-header-right {
    display: contents !important;
  }

  /* 【上段】ログインボタン / ユーザーアイコン（幅100%・右寄せ） */
  #test-nav-header #clerk-auth-slot {
    order: 1 !important;
    width: 100% !important;
    display: flex !important;
    justify-content: flex-end !important;
    align-items: center !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  #test-nav-header #btn-open-signin,
  #test-nav-header #clerk-auth-slot .cl-userButton-root {
    flex: 0 0 auto !important;
    white-space: nowrap !important;
  }

  /* 【下段・左】← テスト一覧 */
  #test-nav-header a.main-link,
  #test-nav-header .nav-header-left a {
    order: 2 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: fit-content !important;
    white-space: nowrap !important;
    font-size: 0.8rem !important;
    padding: 6px 14px !important;
    margin: 0 !important;
  }

  /* 【下段・右】📊 マイページ */
  #test-nav-header .nav-header-right > a,
  #test-nav-header a[href*="mypage"] {
    order: 3 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    max-width: fit-content !important;
    white-space: nowrap !important;
    font-size: 0.8rem !important;
    padding: 6px 14px !important;
    margin: 0 !important;
  }
}

/* ========================================================
   トップページヘッダー最適化（マイページ右寄せ＆ロゴ左右固定）
   ======================================================== */
@media (max-width: 640px) {
  /* マイページボタンを常に右寄せ（トップページの下段でも右端に配置） */
  #test-nav-header a[href*="mypage"] {
    margin-left: auto !important;
  }

  /* トップページ（左がロゴテキストの場合）：1行目の左右を確実に安定化 */
  #test-nav-header:has(.nav-header-left span) .nav-header-left span {
    order: 0 !important;
    display: inline-flex !important;
    align-items: center !important;
  }
  #test-nav-header:has(.nav-header-left span) #clerk-auth-slot {
    width: auto !important;
    flex: 0 0 auto !important;
  }
}

/* ========================================================
   Tool-led SEO & Ecosystem 共通ナビゲーション / フッター
   ======================================================== */

/* ヘッダー内 エコシステムリンク（親ドメイン & 姉妹サイト導線） */
.nav-ecosystem-links {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 10px;
}
.eco-pill {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #64748b;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 9999px;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1.2;
}
.eco-pill:hover {
  color: #4f46e5;
  background: #eef2ff;
  border-color: #c7d2fe;
}
@media (max-width: 640px) {
  .nav-ecosystem-links {
    display: none; /* スマホ幅ではフッターに集約しヘッダーの混雑を防ぐ */
  }
}

/* 共通グローバルフッター */
.chimera-global-footer {
  width: 100%;
  max-width: 760px;
  margin: 48px auto 0;
  padding: 32px 16px 24px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 0.85rem;
  line-height: 1.6;
}
.chimera-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 24px;
  margin-bottom: 24px;
}
.chimera-footer-brand {
  flex: 1 1 300px;
}
.chimera-footer-logo {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.chimera-footer-desc {
  font-size: 0.8rem;
  color: #64748b;
  margin: 0;
}
.chimera-footer-desc a {
  color: #4f46e5;
  text-decoration: underline;
  font-weight: 600;
}
.chimera-footer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.chimera-footer-nav-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: #94a3b8;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 2px;
}
.chimera-footer-nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.chimera-footer-nav-links a {
  color: #475569;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  transition: color 0.15s ease;
}
.chimera-footer-nav-links a:hover {
  color: #4f46e5;
  text-decoration: underline;
}
.chimera-footer-nav-links a.is-current {
  color: #4f46e5;
  font-weight: 700;
}
.chimera-footer-bottom {
  text-align: center;
  padding-top: 16px;
  border-top: 1px dashed #e2e8f0;
  font-size: 0.75rem;
  color: #94a3b8;
}

/* 結果画面の「開発者クレジット・考察記事直結」導線 */
.result-dev-link-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  margin-top: 16px;
  text-align: left;
}
.result-dev-link-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.result-dev-link-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 10px;
  line-height: 1.5;
}
.result-dev-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  color: #4338ca;
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.15s ease;
}
.result-dev-link-btn:hover {
  background: #4338ca;
  color: #ffffff;
}

/* ========================================================
   Thin Content 回避用：ツール一体型詳細解説セクション
   ======================================================== */
.tool-article-wrap {
  margin-top: 36px;
  padding-top: 32px;
  border-top: 1px solid #e2e8f0;
  text-align: left;
  line-height: 1.8;
  color: #334155;
}
.article-section {
  margin-bottom: 32px;
}
.article-h2 {
  font-size: 1.25rem;
  font-weight: 800;
  color: #0f172a;
  border-left: 4px solid #4f46e5;
  padding-left: 10px;
  margin-bottom: 14px;
  line-height: 1.4;
}
.article-h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: #1e293b;
  margin: 18px 0 8px;
  line-height: 1.4;
}
.article-p {
  font-size: 0.92rem;
  margin-bottom: 14px;
  line-height: 1.85;
}
.article-list {
  margin: 0 0 16px 20px;
  padding: 0;
  font-size: 0.9rem;
  line-height: 1.7;
}
.article-list li {
  margin-bottom: 6px;
}
.article-highlight-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 18px;
  margin: 16px 0;
}
.article-highlight-title {
  font-size: 0.95rem;
  font-weight: 800;
  color: #1e293b;
  margin-bottom: 6px;
}

/* タイプ比較グリッド */
.type-compare-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
  margin: 18px 0;
}
.type-compare-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}
.type-compare-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.type-compare-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  background: #eef2ff;
  color: #4f46e5;
}
.type-compare-name {
  font-size: 0.98rem;
  font-weight: 800;
  color: #0f172a;
}
.type-compare-desc {
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.6;
  margin: 0;
}

/* FAQアコーディオン / リスト */
.faq-wrap {
  margin: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.faq-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 16px 18px;
}
.faq-question {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 6px;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}
.faq-q-mark {
  color: #4f46e5;
  font-size: 1.05rem;
  line-height: 1.2;
}
.faq-answer {
  font-size: 0.88rem;
  color: #475569;
  line-height: 1.7;
  margin: 0;
  padding-left: 20px;
}

/* 著者・運営クレジットカード */
.article-author-card {
  display: flex;
  align-items: center;
  gap: 16px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px 20px;
  margin-top: 24px;
}
.author-avatar {
  font-size: 2rem;
  line-height: 1;
}
.author-meta {
  flex: 1;
}
.author-name {
  font-size: 0.92rem;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 2px;
}
.author-role {
  font-size: 0.78rem;
  color: #64748b;
  margin-bottom: 6px;
}
.author-bio {
  font-size: 0.82rem;
  color: #475569;
  margin: 0;
  line-height: 1.5;
}
