﻿/* aegise Management Console ユーザーマニュアル スタイル */

:root {
  --primary-color: #1976d2;
  --accent-color: #0288d1;
  --text-color: #212121;
  --bg-color: #fafafa;
  --surface-color: #ffffff;
  --border-color: #e0e0e0;
  --code-bg: #f5f5f5;
  --warning-bg: #fff8e1;
  --warning-border: #f9a825;
  --info-bg: #e3f2fd;
  --info-border: #1976d2;
  --sidebar-width: 280px;
  --content-max-width: 860px;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
  color: var(--text-color);
  background-color: var(--bg-color);
  line-height: 1.75;
  margin: 0;
  padding: 0;
}

/* ===== LAYOUT ===== */
.page-wrapper {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: var(--sidebar-width);
  background-color: #263238;
  color: #eceff1;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  padding: 1.5rem 0;
  flex-shrink: 0;
  z-index: 100;
}

.sidebar-logo {
  padding: 0 1.25rem 1rem;
  border-bottom: 1px solid #37474f;
  margin-bottom: 0;
}

.sidebar-logo h1 {
  font-size: 0.9rem;
  font-weight: 700;
  color: #80cbc4;
  margin: 0;
  line-height: 1.4;
}

.sidebar nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.sidebar nav ul li a {
  display: block;
  padding: 0.55rem 1.25rem;
  color: #b0bec5;
  text-decoration: none;
  font-size: 0.875rem;
  transition: background-color 0.15s, color 0.15s;
}

.sidebar nav ul li a:hover,
.sidebar nav ul li a.active {
  background-color: #37474f;
  color: #ffffff;
}

.main-content {
  margin-left: var(--sidebar-width);
  padding: 2.5rem 3rem;
  max-width: calc(var(--content-max-width) + var(--sidebar-width));
  width: 100%;
}

.content-body {
  max-width: var(--content-max-width);
}

/* ===== TYPOGRAPHY ===== */
h1 {
  font-size: 1.875rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-top: 0;
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 3px solid var(--primary-color);
}

h2 {
  font-size: 1.375rem;
  font-weight: 700;
  color: #263238;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  padding-left: 0.75rem;
  border-left: 4px solid var(--primary-color);
}

h3 {
  font-size: 1.125rem;
  font-weight: 600;
  color: #37474f;
  margin-top: 1.75rem;
  margin-bottom: 0.75rem;
}

h4 {
  font-size: 1rem;
  font-weight: 600;
  color: #455a64;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
}

p {
  margin-top: 0;
  margin-bottom: 1rem;
}

a {
  color: var(--accent-color);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ===== TABLE ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
  font-size: 0.9rem;
}

th {
  background-color: #00695c;
  color: #ffffff;
  padding: 0.6rem 0.9rem;
  text-align: left;
  font-weight: 600;
}

td {
  padding: 0.55rem 0.9rem;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
}


tr:hover td {
  background-color: #e8f4fd;
}

/* ===== 表キャプション ===== */
/* テーブル直前のstrong要素のみの段落 = 表キャプション */
p:has(> strong:only-child) + table,
p strong:only-child {
  /* No override needed; caption text handled via .table-caption class below */
}

.table-caption {
  font-weight: 600;
  font-size: 0.9rem;
  color: #37474f;
  margin-bottom: 0.4rem;
  margin-top: 1.25rem;
}

/* ===== 画像キャプション ===== */
/* img直後のp > em:only-child を画像キャプションとして扱う */
img + p > em:only-child,
p > em.caption {
  display: block;
  text-align: center;
  font-size: 0.85rem;
  color: #546e7a;
  margin-top: -0.5rem;
  margin-bottom: 1.5rem;
  font-style: normal;
}

/* ===== BLOCKQUOTE (NOTE / WARNING / TIP) ===== */
blockquote {
  margin: 1.25rem 0;
  padding: 0.9rem 1.25rem;
  background-color: var(--info-bg);
  border-left: 4px solid var(--info-border);
  border-radius: 0 4px 4px 0;
  font-size: 0.9rem;
}

blockquote p {
  margin: 0;
}

blockquote strong {
  color: var(--primary-color);
}

/* 💡 ポイント（グレー系・参照PDFに準拠） */
blockquote.tip {
  background-color: #f5f5f5;
  border-left-color: #607d8b;
}
blockquote.tip strong {
  color: #37474f;
}

/* 💡 ポイント（強調） — md 側で {.important} を付与した箇所のみ注意ブロックと同じ黄色にする */
blockquote.tip.important {
  background-color: var(--warning-bg);
  border-left-color: var(--warning-border);
}
blockquote.tip.important strong {
  color: #e65100;
}

/* ⚠️ 注意（オレンジ系） */
blockquote.warning {
  background-color: var(--warning-bg);
  border-left-color: var(--warning-border);
}
blockquote.warning strong {
  color: #e65100;
}

/* 📌 お問い合わせ（紫系） */
blockquote.contact {
  background-color: #f3e5f5;
  border-left-color: #8e24aa;
}
blockquote.contact strong {
  color: #6a1b9a;
}

/* ===== CODE ===== */
code {
  font-family: "Consolas", "Courier New", monospace;
  background-color: var(--code-bg);
  padding: 0.15em 0.4em;
  border-radius: 3px;
  font-size: 0.875em;
  color: #c62828;
}

pre {
  background-color: var(--code-bg);
  border: 1px solid var(--border-color);
  border-radius: 4px;
  padding: 1rem 1.25rem;
  overflow-x: auto;
  margin-bottom: 1.25rem;
}

pre code {
  background: none;
  padding: 0;
  color: var(--text-color);
  font-size: 0.875rem;
}

/* ===== ORDERED & UNORDERED LIST ===== */
ol, ul {
  margin-bottom: 1rem;
  padding-left: 1.5rem;
}

li {
  margin-bottom: 0.35rem;
}

/* ===== IMAGE ===== */
img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  margin: 1rem 0 0.25rem;
  display: block;
}

/* ライトボックス内の拡大画像はグローバルのimg装飾を打ち消す */
#lb-img {
  border: none;
  box-shadow: none;
  margin: 0;
  border-radius: 0;
}

/* ===== HORIZONTAL RULE ===== */
hr {
  border: none;
  height: 1px;
  background: linear-gradient(to right, var(--primary-color) 0%, var(--border-color) 40%, transparent 100%);
  margin: 2.5rem 0;
}

/* ===== NAVIGATION FOOTER ===== */
.page-nav {
  margin-top: 3rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
}

/* ===== BACK TO TOP ===== */
#back-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--primary-color);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease, background 0.15s;
  z-index: 1000;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

#back-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

#back-top:hover {
  background: var(--accent-color);
}

/* ===== MOBILE HAMBURGER BUTTON ===== */
#nav-toggle {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 42px;
  height: 42px;
  background: #263238;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
}

#nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: #eceff1;
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.25s ease;
  pointer-events: none;
}

/* ===== MOBILE NAV OVERLAY ===== */
#nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 99;
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}

/* ===== SIDEBAR DIVIDER ===== */
.sidebar-divider {
  height: 1px;
  background-color: #37474f;
  margin: 0.5rem 1.25rem;
  list-style: none;
  padding: 0;
}

/* ===== PRINT ===== */
@media print {
  .sidebar, #nav-toggle, #back-top {
    display: none;
  }
  .main-content {
    margin-left: 0;
    padding: 1cm 2cm;
  }
  h1, h2 {
    page-break-after: avoid;
  }
  table, img {
    page-break-inside: avoid;
  }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.28s cubic-bezier(.4,0,.2,1);
    z-index: 150;
  }

  body.nav-open .sidebar {
    transform: translateX(0);
  }

  body.nav-open #nav-overlay {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: 1.5rem;
    padding-top: 4rem;
  }

  #nav-toggle {
    display: flex;
  }

  body.nav-open #nav-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.nav-open #nav-toggle span:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
  }

  body.nav-open #nav-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ===== 必須列のセンタリング ===== */
.table-required th:nth-child(2),
.table-required td:nth-child(2) {
  text-align: center;
}

/* ===== 検索機能 ===== */
.search-container {
  padding: 14px 16px;
  position: relative;
  border-bottom: 1px solid #37474f;
}
#search-input {
  width: 100%;
  box-sizing: border-box;
  padding: 7px 10px;
  border: 1px solid #546e7a;
  border-radius: 4px;
  font-size: 13px;
  outline: none;
  font-family: inherit;
  background: #37474f;
  color: #eceff1;
}
#search-input::placeholder {
  color: #90a4ae;
}
#search-input:focus {
  border-color: #80cbc4;
  box-shadow: 0 0 0 2px rgba(128,203,196,.2);
}
#search-results {
  position: absolute;
  left: 16px;
  right: 16px;
  top: calc(100% - 10px);
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,.2);
  z-index: 200;
  max-height: 320px;
  overflow-y: auto;
}
.search-results-hidden { display: none; }
.search-result-item {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  color: #333;
  border-bottom: 1px solid #f0f0f0;
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: #f0f6ff; }
.search-result-title { font-size: 13px; font-weight: 600; color: var(--primary-color, #1976d2); }
.search-result-page { font-size: 11px; color: #90a4ae; margin-top: 1px; }
.search-result-snippet { font-size: 12px; color: #546e7a; margin-top: 3px; line-height: 1.5; }
.search-no-results { padding: 10px 12px; color: #999; font-size: 13px; }
/* 検索キーワードハイライト */
.search-result-item mark {
  background: #fff176;
  color: inherit;
  padding: 0 1px;
  border-radius: 2px;
  font-style: normal;
}
