/* とんとん受付 使い方ガイド 共通スタイル */
/* カラーは docs/ui-design.md のパレットに準拠 */

:root {
  --primary: #1e40af;
  --primary-light: #3b82f6;
  --primary-dark: #1e3a8a;
  --success: #16a34a;
  --error: #dc2626;
  --warning: #d97706;
  --info: #2563eb;
  --bg: #ffffff;
  --surface: #f9fafb;
  --border: #e5e7eb;
  --text: #111827;
  --text-sub: #6b7280;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* 固定ヘッダー分のアンカーオフセット */
  scroll-padding-top: 72px;
}

body {
  font-family:
    "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo,
    ui-sans-serif, system-ui, sans-serif;
  color: var(--text);
  background: var(--surface);
  line-height: 1.8;
}

/* ===== ヘッダー ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--primary);
  color: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.site-header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 4px 16px;
  min-height: 56px;
}

.brand {
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  font-weight: 700;
  white-space: nowrap;
  padding: 8px 0;
}

.brand span {
  font-size: 13px;
  font-weight: 500;
  opacity: 0.85;
  margin-left: 8px;
}

.global-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.global-nav a {
  color: #fff;
  text-decoration: none;
  font-size: 13.5px;
  padding: 8px 10px;
  border-radius: 6px;
  opacity: 0.85;
  white-space: nowrap;
}

.global-nav a:hover {
  background: rgba(255, 255, 255, 0.15);
  opacity: 1;
}

.global-nav a.current {
  background: rgba(255, 255, 255, 0.22);
  opacity: 1;
  font-weight: 600;
}

/* ===== 本文レイアウト ===== */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 32px 20px 64px;
}

.page-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.page-lead {
  color: var(--text-sub);
  margin-bottom: 28px;
}

/* ページ内目次 */
.toc {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 22px;
  margin-bottom: 36px;
}

.toc-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-sub);
  margin-bottom: 8px;
}

.toc ol {
  margin-left: 22px;
}

.toc a {
  color: var(--primary);
  text-decoration: none;
}

.toc a:hover {
  text-decoration: underline;
}

/* セクション */
section.step {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px 32px;
  margin-bottom: 28px;
}

section.step > h2 {
  font-size: 21px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--primary);
  margin-bottom: 20px;
}

.step-no {
  flex-shrink: 0;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 17px;
  display: flex;
  align-items: center;
  justify-content: center;
}

section.step h3 {
  font-size: 17px;
  margin: 24px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--primary-light);
}

section.step p {
  margin-bottom: 12px;
}

section.step ul,
section.step ol {
  margin: 0 0 14px 26px;
}

section.step li {
  margin-bottom: 4px;
}

/* 操作手順リスト */
ol.flow {
  counter-reset: flow;
  list-style: none;
  margin-left: 0 !important;
}

ol.flow > li {
  counter-increment: flow;
  position: relative;
  padding: 10px 14px 10px 46px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
}

ol.flow > li::before {
  content: counter(flow);
  position: absolute;
  left: 12px;
  top: 12px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* スクリーンショット */
figure.screenshot {
  margin: 18px 0 22px;
  text-align: center;
}

figure.screenshot img {
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

figure.screenshot.tablet img {
  max-width: 560px;
  width: 100%;
}

figure.screenshot.portrait img {
  max-width: 380px;
}

figure.screenshot figcaption {
  font-size: 13px;
  color: var(--text-sub);
  margin-top: 8px;
}

/* 横並びスクリーンショット */
.shot-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.shot-row figure.screenshot {
  flex: 1 1 300px;
  max-width: 480px;
}

/* 対象者バッジ */
.audience {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 6px 18px;
  font-size: 13.5px;
  font-weight: 600;
  margin-bottom: 24px;
}

.audience::before {
  content: "👤";
}

/* コールアウト */
.note,
.warn,
.tip {
  border-radius: 8px;
  padding: 12px 16px 12px 44px;
  margin: 14px 0;
  position: relative;
  font-size: 14.5px;
}

.note::before,
.warn::before,
.tip::before {
  position: absolute;
  left: 14px;
  top: 11px;
  font-size: 16px;
}

.note {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.note::before {
  content: "ℹ️";
}

.warn {
  background: #fef2f2;
  border: 1px solid #fecaca;
}

.warn::before {
  content: "⚠️";
}

.tip {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
}

.tip::before {
  content: "💡";
}

/* テーブル */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 14px 0 18px;
  font-size: 14px;
  background: var(--bg);
}

th,
td {
  border: 1px solid var(--border);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface);
  font-weight: 600;
  white-space: nowrap;
}

.table-scroll {
  overflow-x: auto;
}

/* インライン UI 名 */
kbd.ui {
  display: inline-block;
  font-family: inherit;
  font-size: 0.92em;
  background: var(--surface);
  border: 1px solid #d1d5db;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 8px;
  white-space: nowrap;
}

/* リンク */
main a {
  color: var(--primary);
}

/* 次ページへの誘導 */
.next-page {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.next-page a {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 8px;
}

.next-page a:hover {
  background: var(--primary-dark);
}

/* ===== index ページ用 ===== */
.hero {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  margin-bottom: 28px;
}

.hero h1 {
  font-size: 30px;
  margin-bottom: 12px;
}

.hero p {
  margin-bottom: 10px;
}

/* 導入ステップ図 */
.intro-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0;
}

.intro-step {
  flex: 1 1 200px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  position: relative;
}

.intro-step .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 8px;
}

.intro-step h3 {
  font-size: 15.5px;
  margin-bottom: 6px;
}

.intro-step p {
  font-size: 13.5px;
  color: var(--text-sub);
  margin: 0;
}

/* 目次カード */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
  margin-top: 8px;
}

.guide-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  text-decoration: none;
  color: var(--text);
  transition:
    box-shadow 0.15s,
    border-color 0.15s;
}

.guide-card:hover {
  border-color: var(--primary-light);
  box-shadow: 0 4px 14px rgba(30, 64, 175, 0.12);
}

.guide-card .card-label {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: #eff6ff;
  border-radius: 999px;
  padding: 2px 12px;
  margin-bottom: 10px;
}

.guide-card h3 {
  font-size: 17px;
  margin-bottom: 8px;
}

.guide-card p {
  font-size: 13.5px;
  color: var(--text-sub);
  margin: 0;
}

/* ===== FAQ ページ用 ===== */
.faq-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 20px 24px;
  margin-bottom: 14px;
}

.faq-item h3 {
  font-size: 16.5px;
  margin-bottom: 10px;
  padding-left: 30px;
  position: relative;
}

.faq-item h3::before {
  content: "Q";
  position: absolute;
  left: 0;
  top: 1px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.faq-item p,
.faq-item ul {
  font-size: 14.5px;
}

.faq-item ul {
  margin: 6px 0 6px 24px;
}

/* ===== フッター ===== */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--bg);
  padding: 24px 20px;
  text-align: center;
  font-size: 13px;
  color: var(--text-sub);
}

.site-footer a {
  color: var(--primary);
}

/* 印刷 */
@media print {
  .site-header,
  .next-page {
    display: none;
  }

  section.step,
  .faq-item {
    break-inside: avoid;
    border: none;
    padding: 8px 0;
  }
}

@media (max-width: 640px) {
  section.step {
    padding: 20px 16px;
  }

  .page-title {
    font-size: 23px;
  }
}
