/* ===== CSS Variables ===== */
:root {
  --primary: #1a3a5c;
  --primary-light: #2563a8;
  --accent: #f59e0b;
  --accent-light: #fcd34d;
  --text: #1e293b;
  --text-muted: #64748b;
  --bg: #ffffff;
  --bg-subtle: #f8fafc;
  --bg-section: #eff6ff;
  --border: #e2e8f0;
  --success: #10b981;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 4px 12px rgba(0,0,0,.06);
  --shadow-lg: 0 8px 30px rgba(0,0,0,.12);
  --max-w: 1200px;
  --font: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Meiryo', sans-serif;
}

/* ===== Reset ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.7; }
img { max-width: 100%; display: block; }
a { color: var(--primary-light); text-decoration: none; }
a:hover { text-decoration: underline; }
ul, ol { padding-left: 1.5rem; }

/* ===== Header ===== */
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.site-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.site-logo .logo-accent { color: var(--accent); }
.site-logo .logo-icon { font-size: 1.4rem; }

.global-nav { display: flex; gap: .25rem; align-items: center; }
.global-nav a {
  color: rgba(255,255,255,.85);
  padding: .4rem .75rem;
  border-radius: var(--radius);
  font-size: .875rem;
  font-weight: 500;
  transition: background .15s, color .15s;
  white-space: nowrap;
}
.global-nav a:hover, .global-nav a.active {
  background: rgba(255,255,255,.15);
  color: #fff;
  text-decoration: none;
}

.hamburger { display: none; cursor: pointer; background: none; border: none; color: #fff; font-size: 1.5rem; padding: .25rem; }

/* ===== Hero ===== */
.hero {
  background: linear-gradient(135deg, var(--primary) 0%, #0f4c81 50%, #1a6eb5 100%);
  color: #fff;
  padding: 5rem 1.5rem 4rem;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(245,158,11,.15) 0%, transparent 60%);
}
.hero-inner { max-width: 860px; margin: 0 auto; position: relative; }
.hero-eyebrow {
  display: inline-block;
  background: rgba(245,158,11,.2);
  color: var(--accent-light);
  border: 1px solid rgba(245,158,11,.4);
  border-radius: 50px;
  padding: .25rem 1rem;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .05em;
  margin-bottom: 1.25rem;
}
.hero h1 { font-size: clamp(1.8rem, 4vw, 2.8rem); font-weight: 800; line-height: 1.3; margin-bottom: 1.25rem; }
.hero h1 .highlight { color: var(--accent); }
.hero p { font-size: 1.1rem; color: rgba(255,255,255,.85); max-width: 640px; margin: 0 auto 2rem; }
.hero-stats {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 2.5rem;
}
.stat-item { text-align: center; }
.stat-num { font-size: 2rem; font-weight: 800; color: var(--accent); line-height: 1; }
.stat-label { font-size: .8rem; color: rgba(255,255,255,.7); margin-top: .25rem; }

/* ===== Breadcrumb ===== */
.breadcrumb-bar {
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
  padding: .6rem 1.5rem;
}
.breadcrumb {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--primary-light); }
.breadcrumb .sep { color: var(--border); }
.breadcrumb .current { color: var(--text); font-weight: 500; }

/* ===== Page Layout ===== */
.page-wrapper { max-width: var(--max-w); margin: 0 auto; padding: 2.5rem 1.5rem 4rem; display: grid; grid-template-columns: 1fr 280px; gap: 2.5rem; }
.page-wrapper.full-width { grid-template-columns: 1fr; }

/* ===== Article / Main ===== */
.article-header { margin-bottom: 2rem; }
.article-category {
  display: inline-block;
  background: var(--bg-section);
  color: var(--primary-light);
  border-radius: 4px;
  padding: .2rem .65rem;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: .75rem;
  text-transform: uppercase;
}
.article-header h1 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 800; line-height: 1.35; margin-bottom: .75rem; }
.article-meta { display: flex; gap: 1rem; align-items: center; font-size: .8rem; color: var(--text-muted); flex-wrap: wrap; }
.article-meta .tag {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: .15rem .5rem;
}

/* ===== Section Headers in Content ===== */
.content h2 {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary);
  margin: 2.5rem 0 1rem;
  padding-bottom: .5rem;
  border-bottom: 2px solid var(--bg-section);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.content h2::before { content: ''; display: inline-block; width: 4px; height: 1.2em; background: var(--accent); border-radius: 2px; }
.content h3 { font-size: 1.1rem; font-weight: 700; color: var(--primary); margin: 2rem 0 .75rem; }
.content p { margin-bottom: 1.2rem; }
.content ul, .content ol { margin-bottom: 1.2rem; }
.content li { margin-bottom: .4rem; }
.content strong { color: var(--primary); }

/* ===== Cards ===== */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.25rem; margin: 1.5rem 0; }
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.card-icon { font-size: 2rem; margin-bottom: .75rem; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: .5rem; color: var(--primary); }
.card p { font-size: .875rem; color: var(--text-muted); margin: 0; }
.card a { display: block; color: inherit; text-decoration: none; }
.card a:hover { text-decoration: none; }

/* ===== Info Box ===== */
.info-box {
  background: var(--bg-section);
  border-left: 4px solid var(--primary-light);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0;
}
.info-box.warning { background: #fffbeb; border-color: var(--accent); }
.info-box.success { background: #f0fdf4; border-color: var(--success); }
.info-box h4 { font-size: .9rem; font-weight: 700; margin-bottom: .5rem; color: var(--primary); }
.info-box p, .info-box li { font-size: .9rem; color: var(--text); }
.info-box p:last-child { margin-bottom: 0; }

/* ===== Table ===== */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { background: var(--primary); color: #fff; padding: .75rem 1rem; text-align: left; font-weight: 600; }
td { padding: .7rem 1rem; border-bottom: 1px solid var(--border); }
tr:nth-child(even) td { background: var(--bg-subtle); }
tr:hover td { background: var(--bg-section); }

/* ===== Sidebar ===== */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
.sidebar-widget {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.sidebar-widget h3 {
  font-size: .85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: .5rem;
  border-bottom: 1px solid var(--border);
}
.sidebar-widget ul { list-style: none; padding: 0; margin: 0; }
.sidebar-widget li { border-bottom: 1px solid var(--border); }
.sidebar-widget li:last-child { border-bottom: none; }
.sidebar-widget a {
  display: block;
  padding: .6rem 0;
  font-size: .875rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: .4rem;
}
.sidebar-widget a:hover { color: var(--primary-light); text-decoration: none; }
.sidebar-widget a::before { content: '›'; color: var(--accent); font-weight: 700; }

.toc ol { list-style: decimal; padding-left: 1.25rem; font-size: .875rem; }
.toc li { margin-bottom: .35rem; }
.toc a { color: var(--text-muted); }
.toc a:hover { color: var(--primary-light); }

/* ===== Category Top ===== */
.cat-hero {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 3rem 1.5rem 2.5rem;
}
.cat-hero-inner { max-width: var(--max-w); margin: 0 auto; }
.cat-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; margin-bottom: .75rem; }
.cat-hero p { color: rgba(255,255,255,.85); max-width: 600px; }

/* ===== Section Dividers ===== */
.section { padding: 3.5rem 1.5rem; }
.section-inner { max-width: var(--max-w); margin: 0 auto; }
.section-title { font-size: 1.6rem; font-weight: 800; color: var(--primary); margin-bottom: .5rem; }
.section-sub { color: var(--text-muted); margin-bottom: 2rem; }
.section.bg-subtle { background: var(--bg-subtle); }
.section.bg-section { background: var(--bg-section); }

/* ===== CTA Banner ===== */
.cta-banner {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: #fff;
  padding: 3rem 2rem;
  text-align: center;
  border-radius: var(--radius);
  margin: 2.5rem 0;
}
.cta-banner h2 { font-size: 1.4rem; font-weight: 700; margin-bottom: .75rem; }
.cta-banner p { color: rgba(255,255,255,.85); margin-bottom: 1.5rem; }
.btn {
  display: inline-block;
  background: var(--accent);
  color: var(--primary);
  font-weight: 700;
  padding: .75rem 2rem;
  border-radius: 50px;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { background: var(--accent-light); transform: translateY(-1px); text-decoration: none; color: var(--primary); }
.btn-outline {
  background: transparent;
  border: 2px solid rgba(255,255,255,.6);
  color: #fff;
  margin-left: .75rem;
}
.btn-outline:hover { background: rgba(255,255,255,.1); color: #fff; }

/* ===== News List ===== */
.news-list { list-style: none; padding: 0; margin: 0; }
.news-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding: 1.25rem 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}
.news-item:last-child { border-bottom: none; }
.news-date { font-size: .8rem; color: var(--text-muted); white-space: nowrap; padding-top: .15rem; }
.news-item h3 { font-size: .95rem; font-weight: 600; margin-bottom: .25rem; }
.news-item h3 a { color: var(--text); }
.news-item h3 a:hover { color: var(--primary-light); }
.news-tag {
  display: inline-block;
  background: var(--bg-section);
  color: var(--primary-light);
  border-radius: 4px;
  padding: .1rem .5rem;
  font-size: .75rem;
  font-weight: 600;
}

/* ===== FAQ ===== */
.faq-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: .75rem;
  overflow: hidden;
}
.faq-q {
  padding: 1.1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-subtle);
  user-select: none;
  gap: 1rem;
}
.faq-q:hover { background: var(--bg-section); }
.faq-q .q-icon { color: var(--primary-light); font-weight: 800; font-size: 1.2rem; flex-shrink: 0; transition: transform .2s; }
.faq-item.open .q-icon { transform: rotate(45deg); }
.faq-a {
  padding: 0 1.25rem;
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s;
  font-size: .95rem;
  color: var(--text);
}
.faq-item.open .faq-a { max-height: 500px; padding: 1.1rem 1.25rem; }

/* ===== Comparison Table ===== */
.compare-table th:first-child { width: 160px; }
.compare-table .good { color: var(--success); font-weight: 700; }
.compare-table .bad { color: #ef4444; font-weight: 700; }
.compare-table .mid { color: var(--accent); font-weight: 700; }

/* ===== Footer ===== */
.site-footer {
  background: var(--primary);
  color: rgba(255,255,255,.75);
  padding: 3rem 1.5rem 1.5rem;
  margin-top: 4rem;
}
.footer-inner { max-width: var(--max-w); margin: 0 auto; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand .site-logo { font-size: 1rem; margin-bottom: .75rem; }
.footer-brand p { font-size: .85rem; line-height: 1.7; }
.footer-col h4 { color: #fff; font-size: .85rem; font-weight: 700; margin-bottom: .75rem; }
.footer-col ul { list-style: none; padding: 0; }
.footer-col li { margin-bottom: .4rem; }
.footer-col a { color: rgba(255,255,255,.65); font-size: .85rem; }
.footer-col a:hover { color: #fff; text-decoration: none; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .8rem;
  flex-wrap: wrap;
  gap: .5rem;
}

/* ===== Progress Bar ===== */
.progress-bar-wrap { background: var(--border); border-radius: 50px; overflow: hidden; height: 10px; margin: .5rem 0; }
.progress-bar { height: 100%; border-radius: 50px; background: linear-gradient(90deg, var(--primary-light), var(--accent)); }

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .page-wrapper { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .global-nav { display: none; }
  .global-nav.open { display: flex; flex-direction: column; position: absolute; top: 64px; left: 0; right: 0; background: var(--primary); padding: 1rem; gap: 0; box-shadow: 0 4px 12px rgba(0,0,0,.2); }
  .global-nav.open a { padding: .75rem 1rem; border-radius: 0; border-bottom: 1px solid rgba(255,255,255,.1); }
  .hamburger { display: block; }
  .footer-grid { grid-template-columns: 1fr; }
  .hero { padding: 3rem 1rem 2.5rem; }
  .hero-stats { gap: 1.25rem; }
}
