/* ============================================================
   DESIGN TOKENS
   ============================================================ */
:root {
  /* ブランドカラー */
  --red:        #e05a00;
  --red-dk:     #b84400;
  --orange:     #ff6600;

  /* 背景 */
  --bg:         #f4f4f0;
  --surface:    #ffffff;
  --gray-50:    #fafafa;
  --gray-100:   #f0f0f0;

  /* ボーダー */
  --border:     #dddddd;

  /* テキスト */
  --text:       #1a1a1a;
  --text-sub:   #555555;
  --text-muted: #999999;

  /* リンク */
  --link:       #0066cc;

  /* フォント */
  --font: 'Hiragino Kaku Gothic ProN', 'Noto Sans JP', 'Yu Gothic', sans-serif;

  /* 角丸 */
  --r:    3px;
  --r-md: 6px;

  /* シャドウ */
  --shadow:    0 1px 4px rgba(0,0,0,.08);
  --shadow-md: 0 4px 16px rgba(0,0,0,.12);

  /* ランクカラー */
  --gold:   #d4a000;
  --silver: #888888;
  --bronze: #c07850;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 14px; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
ul, ol { list-style: none; }
img { display: block; max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* ============================================================
   CONTAINER
   ============================================================ */
.container {
  max-width: 1000px;
  margin: 0 auto;
  padding: 0 8px;
}
@media (min-width: 640px) {
  .container { padding: 0 16px; }
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--red);
  border-bottom: 3px solid var(--red-dk);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px 8px;
}
.logo {
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  line-height: 1;
  text-decoration: none;
}
.logo:hover { text-decoration: none; }
.logo span {
  font-size: 11px;
  font-weight: 400;
  display: block;
  letter-spacing: 0;
  margin-top: 2px;
  color: rgba(255,255,255,0.85);
}
.header-right { display: flex; align-items: center; gap: 8px; }
.header-btn {
  background: rgba(255,255,255,0.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.35);
  padding: 5px 12px;
  border-radius: var(--r);
  font-size: 12px;
  cursor: pointer;
  font-family: var(--font);
}
.header-btn.primary {
  background: #fff;
  color: var(--red);
  font-weight: 700;
}
.search-bar { background: var(--red-dk); padding: 8px 16px 10px; }
.search-inner { display: flex; gap: 6px; max-width: 600px; }
.search-inner input {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--r) 0 0 var(--r);
  font-size: 14px;
  outline: none;
  font-family: var(--font);
}
.search-inner button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 0 var(--r) var(--r) 0;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  font-family: var(--font);
  transition: background 0.15s;
}
.search-inner button:hover { background: #e55a00; }

/* ============================================================
   NAVIGATION BAR
   ============================================================ */
.nav-bar {
  background: #222;
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-bar::-webkit-scrollbar { display: none; }
.nav-item {
  color: #ddd;
  padding: 8px 14px;
  font-size: 13px;
  white-space: nowrap;
  border-right: 1px solid #333;
  transition: background 0.15s;
  text-decoration: none;
  display: block;
}
.nav-item:hover { background: #333; color: #fff; text-decoration: none; }
.nav-item.active { color: var(--orange); font-weight: 700; }

/* ============================================================
   BREADCRUMB
   ============================================================ */
.breadcrumb-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 6px 0;
}
.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.breadcrumb a { color: var(--link); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb [aria-current="page"] { color: var(--text-sub); }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  background: linear-gradient(135deg, #0d0d1a 0%, #1a1a3a 50%, #2a1a00 100%);
  padding: 28px 0;
}
.hero-inner { max-width: 720px; }
.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(212,160,0,0.2);
  color: #f0c040;
  border: 1px solid rgba(212,160,0,0.4);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 2px;
  margin-bottom: 10px;
}
.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 12px;
}
.hero-title-accent {
  color: #f0c040;
  font-size: 36px;
}
.hero-desc {
  font-size: 14px;
  color: rgba(255,255,255,0.8);
  line-height: 1.7;
  margin-bottom: 12px;
  max-width: 600px;
}
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: rgba(255,255,255,0.5);
}
.hero-meta span, .hero-meta time {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ============================================================
   LAYOUT
   ============================================================ */
.layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 12px 0 40px;
  align-items: start;
}
@media (min-width: 768px) {
  .layout { grid-template-columns: 1fr 260px; }
}

/* ============================================================
   SECTION CARD
   ============================================================ */
.section-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 12px;
}
.section-card:last-child { margin-bottom: 0; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 2px solid var(--red);
  background: var(--gray-50);
}
.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--red);
  display: flex;
  align-items: center;
  gap: 6px;
}
.update-date { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   ランキング概要カード
   ============================================================ */
.rank-summary { padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }

.rank-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  text-decoration: none;
  transition: box-shadow 0.15s, background 0.15s;
}
.rank-card:hover {
  box-shadow: var(--shadow-md);
  background: var(--gray-50);
  text-decoration: none;
}

.rank-1 { border-left: 5px solid var(--gold); }
.rank-2 { border-left: 5px solid var(--silver); }
.rank-3 { border-left: 5px solid var(--bronze); }
.rank-4 { border-left: 5px solid #607d8b; }
.rank-5 { border-left: 5px solid #0288d1; }

.rank-num {
  font-size: 28px;
  font-weight: 700;
  line-height: 1;
  min-width: 44px;
  text-align: center;
  flex-shrink: 0;
}
.rank-1 .rank-num { color: var(--gold); }
.rank-2 .rank-num { color: var(--silver); }
.rank-3 .rank-num { color: var(--bronze); }
.rank-4 .rank-num { color: #607d8b; }
.rank-5 .rank-num { color: #0288d1; }

.rank-num span { font-size: 14px; font-weight: 400; }

.rank-info { flex: 1; }
.rank-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.rank-tag-row { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 4px; }
.rank-income { font-size: 12px; color: var(--text-muted); }
.rank-income strong { color: var(--red); font-size: 13px; }

.rank-arrow {
  color: var(--text-muted);
  font-size: 16px;
  flex-shrink: 0;
}

/* タグ */
.card-tag {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 2px;
  white-space: nowrap;
}
.tag-free     { background: #e8f5e9; color: #2e7d32; border: 1px solid #a5d6a7; }
.tag-point    { background: #fff3e0; color: #e65100; border: 1px solid #ffcc80; }
.tag-security { background: #e3f2fd; color: #1565c0; border: 1px solid #90caf9; }
.tag-pay      { background: #f3e5f5; color: #6a1b9a; border: 1px solid #ce93d8; }
.tag-travel   { background: #e8eaf6; color: #283593; border: 1px solid #9fa8da; }
.tag-gold     { background: #fffde7; color: #f57f17; border: 1px solid #fff176; }
.tag-premium  { background: #212121; color: #ffd700; border: 1px solid #ffd700; }
.tag-family   { background: #fce4ec; color: #880e4f; border: 1px solid #f48fb1; }

/* ============================================================
   資格詳細
   ============================================================ */
.cert-detail { padding: 16px 14px; }

/* メダル・ランクバッジ */
.medal { font-size: 20px; }
.rank-badge-4 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #607d8b;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.rank-badge-5 {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: #0288d1;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}

/* スペックグリッド */
.cert-spec-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
  background: var(--gray-50);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
}
@media (max-width: 480px) {
  .cert-spec-grid { grid-template-columns: repeat(2, 1fr); }
}
.cert-spec-item { text-align: center; }
.spec-label {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.spec-value { font-size: 12px; font-weight: 700; color: var(--text); }
.diff-high { color: var(--red); }
.diff-mid  { color: var(--orange); }
.diff-low  { color: #2e7d32; }

/* 資格詳細本文 */
.cert-body { display: flex; flex-direction: column; gap: 14px; }
.cert-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.cert-body p {
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
}
.cert-body p strong { color: var(--text); }

/* アピールボックス */
.appeal-box { display: flex; flex-direction: column; gap: 8px; }
.appeal-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.appeal-icon {
  font-size: 20px;
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-50);
  border-radius: 50%;
}
.appeal-item strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 3px;
}
.appeal-item p { font-size: 12px; color: var(--text-sub); line-height: 1.6; }

/* 学習ロードマップ */
.study-roadmap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  counter-reset: none;
}
.study-roadmap li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--text-sub);
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  line-height: 1.55;
}
.roadmap-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
}

/* おすすめシーン */
.recommend-scene { }
.scene-list { display: flex; flex-direction: column; gap: 6px; }
.scene-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  color: var(--text-sub);
  padding: 7px 10px;
  border-left: 3px solid var(--orange);
  background: #fff9f5;
  border-radius: 0 var(--r) var(--r) 0;
  line-height: 1.5;
}
.scene-list li span { color: var(--orange); font-weight: 700; flex-shrink: 0; }

/* ============================================================
   IT資格テーブル
   ============================================================ */
.it-cert-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.it-cert-table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 12px;
}
.it-cert-table caption {
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
  padding: 4px 0;
  caption-side: top;
}
.it-cert-table thead th {
  background: var(--gray-100);
  color: var(--text);
  font-weight: 700;
  padding: 8px 10px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.it-cert-table tbody td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-sub);
  vertical-align: middle;
}
.it-cert-table tbody tr:last-child td { border-bottom: none; }
.it-cert-table tbody tr:hover { background: var(--gray-50); }
.it-cert-table tr.recommended { background: #fff9e6; }
.it-cert-table .highlight { color: var(--red); font-weight: 700; }

/* ============================================================
   比較テーブル（全体）
   ============================================================ */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.compare-table {
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  font-size: 13px;
}
.compare-table caption {
  font-size: 11px;
  color: var(--text-muted);
  text-align: left;
  padding: 8px 12px 4px;
  caption-side: top;
}
.compare-table thead th {
  background: var(--gray-100);
  color: var(--text);
  font-weight: 700;
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--border);
  white-space: nowrap;
}
.compare-table tbody td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--gray-100);
  color: var(--text-sub);
  vertical-align: middle;
}
.compare-table tbody tr:last-child td { border-bottom: none; }
.compare-table tbody tr:hover { background: var(--gray-50); }
.compare-table tr.recommended { background: #fff9e6; }
.compare-table tr.recommended:hover { background: #fff3cc; }
.compare-table .highlight { color: var(--red); font-weight: 700; }
.table-note {
  font-size: 11px;
  color: var(--text-muted);
  padding: 6px 12px 10px;
  line-height: 1.6;
}

/* ============================================================
   資格選び方ガイド
   ============================================================ */
.choose-guide { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.choose-item {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
}
.choose-num {
  width: 32px;
  height: 32px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.choose-body h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 5px;
}
.choose-body p {
  font-size: 12px;
  color: var(--text-sub);
  line-height: 1.65;
}
.choose-body p strong { color: var(--text); }

/* ============================================================
   FAQアコーディオン
   ============================================================ */
.faq-list { padding: 8px 0; }
.faq-item { border-bottom: 1px solid var(--gray-100); }
.faq-item:last-child { border-bottom: none; }
.faq-q {
  display: flex;
  align-items: center;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
  gap: 10px;
  transition: background 0.15s;
}
.faq-q::-webkit-details-marker { display: none; }
.faq-q:hover { background: var(--gray-50); }
.faq-q::before {
  content: 'Q';
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  border-radius: 50%;
  flex-shrink: 0;
}
.faq-q::after {
  content: '▼';
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}
details[open] .faq-q::after { transform: rotate(180deg); }
.faq-a {
  padding: 0 14px 14px 46px;
  font-size: 13px;
  color: var(--text-sub);
  line-height: 1.75;
}

/* ============================================================
   DISCLAIMER BOX
   ============================================================ */
.disclaimer-box {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 4px;
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: 12px;
}
.sidebar-widget:last-child { margin-bottom: 0; }
.sidebar-widget-head {
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  border-left: 3px solid var(--red);
  background: var(--gray-50);
  border-bottom: 1px solid var(--border);
}
.sidebar-widget-head--warn {
  border-left-color: #c84f14;
  color: #c84f14;
}
.sidebar-widget-body { padding: 10px 12px; }

/* 難易度バー */
.diff-list { display: flex; flex-direction: column; gap: 8px; }
.diff-item { display: flex; align-items: center; gap: 8px; }
.diff-name { font-size: 11px; color: var(--text-sub); white-space: nowrap; min-width: 80px; }
.diff-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--gray-100);
  border-radius: 4px;
  overflow: hidden;
}
.diff-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--red) 0%, var(--orange) 100%);
  border-radius: 4px;
}
.diff-label {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 18px;
  text-align: right;
}
.diff-label.low  { color: #2e7d32; }
.diff-label.mid  { color: var(--orange); }
.diff-label.high { color: var(--red); }

/* 目的別おすすめリスト */
.purpose-list { display: flex; flex-direction: column; gap: 0; }
.purpose-item {
  padding: 8px 4px;
  border-bottom: 1px solid var(--gray-100);
}
.purpose-item:last-child { border-bottom: none; }
.purpose-label { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.purpose-cert { font-size: 12px; font-weight: 700; color: var(--red); }

/* 関連記事 */
.related-list { display: flex; flex-direction: column; gap: 0; }
.related-list li { border-bottom: 1px solid var(--gray-100); }
.related-list li:last-child { border-bottom: none; }
.related-list a {
  display: block;
  padding: 8px 4px;
  font-size: 12px;
  color: var(--link);
  line-height: 1.5;
  transition: color 0.15s;
}
.related-list a:hover { color: var(--red); text-decoration: underline; }

/* 免責 */
.sidebar-disclaimer {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.7;
}

/* CTAボタン */
.btn-apply {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: var(--r);
  text-decoration: none;
  transition: background 0.15s;
  font-family: var(--font);
}
.btn-apply:hover { background: #e55a00; color: #fff; text-decoration: none; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: #222;
  color: #aaa;
  text-align: center;
  padding: 20px 16px;
  font-size: 12px;
  line-height: 1.8;
  margin-top: 20px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin-bottom: 10px;
}
.footer-links a { color: #aaa; font-size: 12px; }
.footer-links a:hover { color: #fff; text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 767px) {
  .hero-title { font-size: 22px; }
  .hero-title-accent { font-size: 28px; }
  .layout-side { order: -1; }
  .cert-spec-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 479px) {
  .hero { padding: 20px 0; }
  .hero-title { font-size: 20px; }
  .hero-title-accent { font-size: 24px; }
  .cert-detail { padding: 10px; }
  .rank-card { padding: 10px; }
  .rank-num { font-size: 22px; min-width: 36px; }
}
