/* ===================================================
   変額保険販売資格試験 - メインスタイルシート
   リニューアル版 2024 | Google AdSense・SEO最適化済み
   =================================================== */

/* ---- CSS変数 ---- */
:root {
  --primary:    #1a4fa0;
  --primary-dk: #133880;
  --accent:     #e8630a;
  --accent-lt:  #fdf0e8;
  --bg:         #f5f7fa;
  --card:       #ffffff;
  --text:       #1e2533;
  --text-sub:   #5a6378;
  --border:     #dde3ed;
  --correct:    #1a7a4a;
  --wrong:      #c0392b;
  --radius:     8px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-md:  0 4px 20px rgba(0,0,0,.12);
  --font-main:  'Noto Sans JP', 'Hiragino Kaku Gothic ProN', Meiryo, sans-serif;
  --max-w:      1080px;
  --sidebar-w:  240px;
}

/* ---- リセット＆ベース ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  font-size: 15px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
}
a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--accent); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { padding-left: 1.5em; }

/* ---- レイアウト ---- */
#wrapper {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
}
#content {
  display: flex;
  gap: 24px;
  margin: 24px 0 40px;
  align-items: flex-start;
}
#contentInner {
  flex: 1;
  min-width: 0;
}

/* ---- ヘッダー ---- */
#site-header {
  background: linear-gradient(135deg, var(--primary-dk) 0%, var(--primary) 100%);
  color: #fff;
  padding: 0;
  box-shadow: var(--shadow-md);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}
.header-inner .site-logo img { height: 48px; width: auto; }
.header-inner .site-title {
  font-size: 13px;
  font-weight: 700;
  color: rgba(255,255,255,.9);
  line-height: 1.4;
}
.header-inner .site-subtitle {
  font-size: 11px;
  color: rgba(255,255,255,.65);
  margin-top: 2px;
}

/* ---- スマホナビ ---- */
#mobile-nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: #fff; font-size: 22px; padding: 8px;
  margin-left: auto;
}
#mobile-nav {
  background: var(--primary-dk);
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease;
}
#mobile-nav.open { max-height: 600px; }
#mobile-nav ul { list-style: none; padding: 8px 16px 16px; }
#mobile-nav ul li a {
  display: block; padding: 10px 0;
  color: rgba(255,255,255,.85); font-size: 14px;
  border-bottom: 1px solid rgba(255,255,255,.1);
}
#mobile-nav ul li a:hover { color: #fff; text-decoration: none; }

/* ---- PCナビゲーション ---- */
#pc-nav {
  background: var(--primary);
  border-top: 1px solid rgba(255,255,255,.15);
}
.pc-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 0;
  overflow-x: auto;
}
.pc-nav-inner a {
  display: block;
  padding: 12px 16px;
  color: rgba(255,255,255,.85);
  font-size: 13px;
  white-space: nowrap;
  transition: background .2s;
}
.pc-nav-inner a:hover,
.pc-nav-inner a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

/* ---- パンくず ---- */
.breadcrumb {
  font-size: 12px;
  color: var(--text-sub);
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}
.breadcrumb a { color: var(--text-sub); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: #b0b8c8; }

/* ---- カード ---- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}

/* ---- 見出し ---- */
h2.page-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-dk);
  border-left: 4px solid var(--accent);
  padding-left: 12px;
  margin-bottom: 16px;
  line-height: 1.4;
}
h3 {
  font-size: 17px;
  font-weight: 700;
  color: var(--primary);
  margin: 24px 0 10px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}
h4 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin: 16px 0 8px;
}

/* ---- トップ説明ボックス ---- */
.intro-box {
  background: linear-gradient(135deg, #eef4ff 0%, #f5f0ff 100%);
  border: 1px solid #c5d5f5;
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-bottom: 20px;
}
.intro-box p { margin-bottom: 8px; font-size: 14px; }
.intro-box p:last-child { margin-bottom: 0; }

/* ---- 使い方ボックス ---- */
.howto-box {
  background: var(--accent-lt);
  border: 1px solid #f5c99a;
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 16px 0;
  font-size: 14px;
}
.howto-box strong { color: var(--accent); }

/* ---- 問題一覧リスト ---- */
.question-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.question-list li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: #f8faff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  transition: background .2s, border-color .2s;
}
.question-list li a:hover {
  background: #eef3ff;
  border-color: var(--primary);
  text-decoration: none;
  color: var(--primary-dk);
}
.question-list li a .q-num {
  background: var(--primary);
  color: #fff;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  min-width: 52px;
  text-align: center;
  flex-shrink: 0;
}

/* ---- 問題カード ---- */
.mondai-section {
  margin-bottom: 20px;
}
.mondai-type-label {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 3px;
  margin-bottom: 10px;
  letter-spacing: .05em;
}
.label-seigo { background: #e3f0ff; color: #1a4fa0; }
.label-goku  { background: #fff0e0; color: #b05000; }
.label-keisan { background: #e8f8ee; color: #1a7a4a; }

/* ---- 正誤問題 ---- */
.seigo-item {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 10px;
}
.seigo-item .q-text { font-size: 14px; line-height: 1.7; margin-bottom: 10px; }
.seigo-item .q-num-inline {
  font-weight: 700; color: var(--primary-dk); margin-right: 6px;
}

/* ---- 語句・計算問題 ---- */
.sentaku-item {
  background: #fafbff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.sentaku-item .q-label { font-weight: 700; font-size: 13px; color: var(--text-sub); margin-bottom: 6px; }
.sentaku-item .q-body { font-size: 14px; line-height: 1.7; }
.goku-box {
  background: #f0f4ff;
  border: 1px dashed #a0b4d8;
  border-radius: 4px;
  padding: 10px 14px;
  margin: 10px 0;
  font-size: 13px;
}

/* ---- チェックボタン ---- */
.btn-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  padding: 8px 18px;
  font-size: 14px;
  font-family: var(--font-main);
  cursor: pointer;
  transition: background .2s, transform .1s;
  margin: 8px 0;
}
.btn-check:hover { background: var(--primary-dk); transform: translateY(-1px); }
.btn-check:active { transform: translateY(0); }

/* ---- 解答エリア ---- */
.answer-area {
  display: none;
  margin-top: 10px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 14px;
  line-height: 1.7;
  animation: fadeIn .25s ease;
}
.answer-area.correct {
  background: #e8f8ee;
  border-left: 4px solid var(--correct);
}
.answer-area.wrong {
  background: #fdf0ee;
  border-left: 4px solid var(--wrong);
}
.answer-area .result-label {
  font-weight: 700;
  font-size: 15px;
  margin-bottom: 6px;
}
.answer-area.correct .result-label { color: var(--correct); }
.answer-area.wrong .result-label { color: var(--wrong); }
.answer-area .explanation { color: var(--text); }

/* 語句・計算の答え */
.answer-area.goku-ans {
  background: #fff8e8;
  border-left: 4px solid var(--accent);
}
.answer-area.goku-ans .result-label { color: var(--accent); }

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

/* ---- ページナビ ---- */
.page-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin: 20px 0;
}
.page-nav a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--primary);
  font-size: 14px;
  transition: background .2s, border-color .2s;
}
.page-nav a:hover {
  background: #eef3ff;
  border-color: var(--primary);
  text-decoration: none;
}
.page-nav .center-link { text-align: center; }

/* ---- サイドバー ---- */
aside {
  width: var(--sidebar-w);
  flex-shrink: 0;
}
.sidebar-widget {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.sidebar-widget h4 {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  border-bottom: 2px solid var(--border);
  padding-bottom: 8px;
  margin-bottom: 10px;
  margin-top: 0;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.sidebar-widget ul { list-style: none; padding: 0; }
.sidebar-widget ul li { border-bottom: 1px solid #f0f2f5; }
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a {
  display: block;
  padding: 8px 4px;
  font-size: 13px;
  color: var(--text);
  transition: color .2s;
}
.sidebar-widget ul li a:hover { color: var(--primary); text-decoration: none; }
.sidebar-widget ul li.active > a { color: var(--accent); font-weight: 700; }

/* ---- 試験特徴ボックス ---- */
.feature-list {
  list-style: none;
  padding: 0;
}
.feature-list li {
  padding: 8px 0 8px 28px;
  position: relative;
  font-size: 14px;
  border-bottom: 1px solid #f0f2f5;
}
.feature-list li:last-child { border-bottom: none; }
.feature-list li::before {
  content: '✓';
  position: absolute;
  left: 4px;
  color: var(--correct);
  font-weight: 700;
}
.red  { color: var(--accent); font-weight: 700; }
.blue { color: var(--primary); font-weight: 700; }

/* ---- 広告エリア ---- */
.ads-wrap { margin: 16px 0; text-align: center; line-height: 1; }
.ads-wrap ins { display: block; margin: 0 auto; }

/* ---- SNSシェアボタン ---- */
.sns-wrap {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.sns-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  text-decoration: none !important;
  transition: opacity .2s;
}
.sns-btn:hover { opacity: .85; }
.sns-x    { background: #000; }
.sns-line { background: #06c755; }
.sns-fb   { background: #1877f2; }

/* ---- フッター ---- */
footer {
  background: var(--primary-dk);
  color: rgba(255,255,255,.75);
  text-align: center;
  padding: 28px 16px;
  font-size: 13px;
  margin-top: 40px;
}
footer .ft-title { color: rgba(255,255,255,.9); font-weight: 700; margin-bottom: 6px; }
footer .ft-links { margin-bottom: 8px; }
footer .ft-links a {
  color: rgba(255,255,255,.6);
  margin: 0 8px;
  font-size: 12px;
}
footer .ft-links a:hover { color: #fff; }

/* ---- ページトップボタン ---- */
#page-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 100;
}
#page-top a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  font-size: 18px;
  box-shadow: var(--shadow-md);
  transition: background .2s, transform .2s;
  text-decoration: none;
}
#page-top a:hover { background: var(--primary-dk); transform: translateY(-2px); }

/* ---- スコアバー ---- */
.score-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.score-bar .score-label { color: var(--text-sub); }
.score-bar .score-val { font-weight: 700; font-size: 16px; color: var(--primary); }
.score-progress {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  min-width: 80px;
}
.score-progress-inner {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width .5s ease;
}

/* テーブル（計算問題内） */
.card table, .sentaku-item table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
  margin: 8px 0;
}
.card table th, .card table td,
.sentaku-item table th, .sentaku-item table td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: center;
}
.card table th, .sentaku-item table th {
  background: #eef3ff;
  font-weight: 700;
}

/* ---- レスポンシブ ---- */
@media (max-width: 767px) {
  #content { flex-direction: column; }
  aside { width: 100%; }
  #pc-nav { display: none; }
  #mobile-nav-toggle { display: block; }
  .header-inner .site-title { font-size: 12px; }
  h2.page-title { font-size: 17px; }
  .card { padding: 16px; }
  .page-nav a { padding: 9px 12px; font-size: 13px; }
  #page-top { right: 12px; bottom: 12px; }
  aside { order: 2; }
  #contentInner { order: 1; }
}
