/* === ベースは元のデザインそのまま === */
:root {
  /* ====== テーマ変数 (デフォルト = 関西弁オレンジ) ======
     これらは [data-theme="..."] で上書きされる入力値 */
  --base-hue: #fdf6ec;       /* 背景のベース色 */
  --accent: #ff7043;          /* アクセント色 */
  --ink-base: #2b2620;        /* テキストのベース色 */

  --sans: 'Zen Maru Gothic', sans-serif;
  --display: 'Kaisei Decol', serif;
  --hand: 'Yomogi', cursive;
}

/* ====== 派生色の計算 ======
   :root ではなく :where(:root, body) に書くことで、
   <html data-theme="..."> でも <body data-theme="..."> でも
   テーマの上書きが派生色に確実に波及する。 */
:where(:root, body) {
  --bg: var(--base-hue);
  --bg-sub: color-mix(in srgb, var(--base-hue) 88%, #000 6%);
  --line: color-mix(in srgb, var(--base-hue) 75%, #6b5d4f 25%);
  --card: #ffffff;

  --ink: var(--ink-base);
  --ink-soft: color-mix(in srgb, var(--ink-base) 60%, var(--base-hue) 40%);
  --ink-mute: color-mix(in srgb, var(--ink-base) 35%, var(--base-hue) 65%);

  --accent-soft: color-mix(in srgb, var(--accent) 25%, #fff 75%);
  --highlight: color-mix(in srgb, var(--accent) 40%, #fff 60%);
}

/* ====== テーマ定義: data-theme属性で切り替え ====== */

/* 関西弁オレンジ (元と同じデフォルト) */
[data-theme="orange"] {
  --base-hue: #fdf6ec;
  --accent: #ff7043;
  --ink-base: #2b2620;
}

/* 薄い青 */
[data-theme="blue"] {
  --base-hue: #eef4fb;
  --accent: #4a90e2;
  --ink-base: #1f2a38;
}

/* ちょっと怪しげなグレー */
[data-theme="gray"] {
  --base-hue: #e8e6ea;
  --accent: #6b5b7e;
  --ink-base: #2a2530;
}

/* 赤っぽいデザイン */
[data-theme="red"] {
  --base-hue: #fbeeec;
  --accent: #d8423a;
  --ink-base: #2e1f1d;
}

/* 黄色っぽいデザイン */
[data-theme="yellow"] {
  --base-hue: #fdf6d8;
  --accent: #e0a823;
  --ink-base: #2e2810;
}

/* 淡い鶯色 */
[data-theme="uguisu"] {
  --base-hue: #eef2e0;
  --accent: #7a8b3f;
  --ink-base: #232a18;
}

/* ===== 以下、元のCSSの残りはそのまま ===== */

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

/* 画像+フォールバック共通: img-slotは画像ロード前にも崩れないように */
.img-slot { display: inline-block; line-height: 0; }
.img-slot img { display: inline-block; }

body {
  font-family: var(--sans);
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  overflow-x: hidden;
  overflow-y: hidden;   /* スクロールはサイドバーとメインがそれぞれ独立して行う */
  background-image:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--accent-soft) 60%, transparent), transparent 40%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--highlight) 50%, transparent), transparent 45%);
  transition: background-color .3s ease, color .3s ease;
}

.app { display: flex; height: 100vh; align-items: flex-start; }

/* ===== サイドバー =====
   高さを画面いっぱいに固定 (position: sticky; top:0; height: 100vh) し、
   内部の .sidebar-scroll だけが縦スクロールする。
   .user-bar は flex で外に出し、画面の一番下に常時固定。
   メイン側は body のスクロールに従うので、左右が別々にスクロールする形になる。 */
.sidebar {
  width: 280px;
  background: var(--bg-sub);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .25s, background-color .3s ease;
}
/* スクロールする中身 */
.sidebar-scroll {
  flex: 1;
  min-height: 0;        /* flex子で overflow を効かせるための定番 */
  overflow-y: auto;
  overflow-x: hidden;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.side-section { display: flex; flex-direction: column; }

/* モダンで控えめなスクロールバー (Firefox) */
.sidebar-scroll {
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--ink-mute) 45%, transparent) transparent;
}
/* モダンで控えめなスクロールバー (WebKit) */
.sidebar-scroll::-webkit-scrollbar { width: 6px; }
.sidebar-scroll::-webkit-scrollbar-track { background: transparent; }
.sidebar-scroll::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-mute) 35%, transparent);
  border-radius: 999px;
  transition: background .2s;
}
.sidebar-scroll:hover::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-mute) 60%, transparent);
}
.sidebar-scroll::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 60%, transparent);
}

/* 折りたたみ状態 */
.sidebar.collapsed { width: 56px; }
.sidebar.collapsed .sidebar-scroll { padding: 20px 8px; }
.sidebar.collapsed .logo,
.sidebar.collapsed .section-label,
.sidebar.collapsed .history-list,
.sidebar.collapsed .ai-name,
.sidebar.collapsed .ai-item span:not(.ai-emoji):not(.ai-name),
.sidebar.collapsed .user-name,
.sidebar.collapsed .side-section .history-list,
.sidebar.collapsed .article-item { display: none; }
.sidebar.collapsed .ai-item { justify-content: center; padding: 8px; }
.sidebar.collapsed .user-bar { justify-content: center; }

.sidebar-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 4px 6px;
}
.logo {
  font-family: var(--display); font-weight: 700; font-size: 22px;
  color: var(--ink); letter-spacing: .02em;
  cursor: pointer;
}
.logo .dot { color: var(--accent); }

.icon-btn {
  width: 32px; height: 32px;
  border: none; background: transparent; border-radius: 8px;
  cursor: pointer; display: grid; place-items: center;
  color: var(--ink-soft); transition: background .15s;
}
.icon-btn:hover { background: rgba(0,0,0,.05); }

.section-label {
  font-size: 11px; font-weight: 700; color: var(--ink-mute);
  letter-spacing: .12em; padding: 0 8px; margin-bottom: 6px;
}

.ai-list { display: flex; flex-direction: column; gap: 2px; }
.ai-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; cursor: pointer;
  font-size: 14px; font-weight: 500; color: var(--ink-soft);
  transition: background .15s, color .15s;
}
.ai-item:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.ai-item.active {
  background: var(--highlight); color: var(--ink); font-weight: 700;
}
.ai-name { display: inline-flex; align-items: center; min-width: 0; }
.ai-name .img-slot { display: inline-flex; align-items: center; }
.ai-name .side-img { max-height: 16px; max-width: 160px; vertical-align: middle; }
.ai-emoji {
  width: 28px; height: 28px;
  display: grid; place-items: center;
  font-size: 18px; background: var(--card);
  border-radius: 8px; flex-shrink: 0;
  overflow: hidden;
}
.ai-emoji img { width: 100%; height: 100%; object-fit: contain; }
.ai-item.active .ai-emoji { background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.06); }

.side-section + .side-section { /* セクション間の余白 (gap で吸収済みなので予約) */ }

.history-list {
  display: flex; flex-direction: column; gap: 2px;
}
.history-item {
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--ink-soft);
  cursor: pointer; white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
  transition: background .15s;
}
.history-item:hover { background: rgba(0,0,0,.04); }

/* 記事リンク: history-item と同じ見た目にしつつ、リンクとしての下線等を消す */
.article-item {
  display: block;
  color: var(--ink-soft);
  text-decoration: none;
}
.article-item:hover { color: var(--ink); background: rgba(0,0,0,.04); }

.user-bar {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  background: var(--bg-sub);
  position: relative;
  flex-shrink: 0;   /* スクロール領域に巻き込まれず、常にサイドバー下端に固定 */
}
.avatar {
  width: 32px; height: 32px; border: none;
  border-radius: 50%; background: var(--accent);
  color: #fff; display: grid; place-items: center;
  font-weight: 700; font-size: 14px; cursor: pointer;
}
.user-name { font-size: 14px; font-weight: 500; flex: 1; cursor: pointer; }

.popup-menu {
  position: absolute;
  bottom: 100%; left: 10px; right: 10px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
  gap: 2px;
  margin-bottom: 6px;
  z-index: 50;
}
.popup-menu[hidden] { display: none; }
.popup-menu a {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background .15s;
}
.popup-menu a:hover { background: var(--bg-sub); }

/* ===== メイン =====
   サイドバーとは別の縦スクロール領域。height:100vh + overflow-y:auto で
   メインだけが独立してスクロールする。
   align-items は stretch のまま (hero と footer を横幅いっぱいに使う) 。
   hero 自身が画面いっぱいの高さを持ち、その中で中央寄せする方式。
   フッターはその下に自然に押し出されるので、初期表示では画面外に出る。 */
.main {
  flex: 1; position: relative;
  display: flex; flex-direction: column;
  padding: 40px 24px;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
}

/* メイン側もモダンで控えめなスクロールバー */
.main { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--ink-mute) 45%, transparent) transparent; }
.main::-webkit-scrollbar { width: 8px; }
.main::-webkit-scrollbar-track { background: transparent; }
.main::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-mute) 30%, transparent);
  border-radius: 999px;
  transition: background .2s;
}
.main:hover::-webkit-scrollbar-thumb {
  background: color-mix(in srgb, var(--ink-mute) 55%, transparent);
}
.main::-webkit-scrollbar-thumb:hover {
  background: color-mix(in srgb, var(--accent) 55%, transparent);
}

.corner-icon {
  position: absolute; top: 24px; right: 32px;
  font-size: 28px; opacity: .5;
}
.corner-icon .corner-img { width: 36px; height: 36px; vertical-align: middle; }
.corner-icon .corner-emoji { font-size: 28px; }

.hero {
  text-align: center; max-width: 640px; width: 100%;
  display: flex; flex-direction: column;
  align-items: center; gap: 18px;
  /* ファーストビュー (site-intro が無い場合) では hero がほぼ画面中央に来るよう、
     上下に余白を確保する。ただし justify-content:center は使わない。
     使うと site-intro を含めた hero 全体の中央寄せになってしまい、
     site-intro が長文の場合に title/入力ボックスが画面外まで押し上げられる。
     代わりに padding-top で初期表示の中央感を作り、コンテンツは自然に上から下へ流す。
     これによりテキストボックス → footnote → site-intro → フッター の順に
     上から下へきれいに並ぶ。 */
  padding-top: clamp(40px, 12vh, 140px);
  padding-bottom: 24px;
  margin: 0 auto;
}

.symbol {
  font-size: 64px; line-height: 1;
  filter: drop-shadow(0 4px 12px color-mix(in srgb, var(--accent) 25%, transparent));
  animation: float 4s ease-in-out infinite;
}
.symbol .img-slot { display: inline-block; }
.symbol img { width: 80px; height: 80px; vertical-align: middle; }
.symbol .symbol-emoji { font-size: 64px; line-height: 1; }
@keyframes float {
  0%,100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

.title {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(32px, 5vw, 44px); letter-spacing: .02em;
}
.title em { font-style: normal; color: var(--accent); }
.title .img-slot { display: inline-flex; align-items: center; }
.title img { max-height: 50px; max-width: 100%; vertical-align: middle; }

.desc {
  font-size: 15px; color: var(--ink-soft);
  margin-top: -8px;
}
.desc .img-slot { display: inline-flex; align-items: center; }
.desc img { max-height: 15px; max-width: 100%; vertical-align: middle; }

.handwritten {
  font-family: var(--hand); font-size: 17px;
  color: var(--accent); transform: rotate(-3deg);
  margin: 8px 0 4px; position: relative; padding: 0 16px;
}
.handwritten::before,
.handwritten::after {
  content: ''; position: absolute; top: 50%;
  width: 18px; height: 1.5px;
  background: var(--accent); opacity: .5;
}
.handwritten::before { left: -10px; transform: rotate(20deg); }
.handwritten::after { right: -10px; transform: rotate(-20deg); }

/* 質問入力 */
.input-box {
  width: 100%; background: var(--card);
  border: 1.5px solid var(--line); border-radius: 22px;
  padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 8px 24px rgba(43, 38, 32, .06);
  transition: border-color .15s, box-shadow .15s;
  margin-top: 8px; position: relative;
}
.input-box:focus-within {
  border-color: var(--accent);
  box-shadow: 0 8px 28px color-mix(in srgb, var(--accent) 18%, transparent);
}
.input-box input {
  flex: 1; border: none; outline: none;
  font-family: var(--sans); font-size: 15px;
  color: var(--ink); background: transparent; min-width: 0;
}
/* iOS Safari の入力欄フォーカス時自動ズーム対策: 16px以上にする */
.input-box input,
.input-box input[type="text"] {
  font-size: 16px;
}
.input-box input::placeholder { color: var(--ink-mute); }

.ai-switch {
  display: flex; align-items: center; gap: 4px;
  padding: 6px 10px; border-radius: 12px;
  cursor: pointer; color: var(--ink-mute);
  font-size: 13px; font-weight: 500;
  transition: background .15s; white-space: nowrap;
  position: relative;
}
.ai-switch:hover { background: var(--bg-sub); }
.switch-label { display: inline-flex; align-items: center; }
.switch-label .img-slot { display: inline-flex; align-items: center; }
.switch-label img { max-height: 15px; max-width: 120px; vertical-align: middle; }

.dropdown {
  position: absolute; top: 100%; right: 0; margin-top: 6px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px; padding: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.1);
  display: flex; flex-direction: column;
  gap: 2px; z-index: 30; min-width: 160px;
}
.dropdown[hidden] { display: none; }
.dropdown-item {
  padding: 8px 12px; border-radius: 8px;
  font-size: 13px; color: var(--ink);
  cursor: pointer; text-align: left;
  display: flex; align-items: center; gap: 8px;
}
.dropdown-item:hover { background: var(--bg-sub); }
.dropdown-item.active { background: var(--highlight); font-weight: 700; }
.dd-name { display: inline-flex; align-items: center; }
.dd-name .img-slot { display: inline-flex; align-items: center; }
.dd-name .pull-img { max-height: 13px; max-width: 140px; vertical-align: middle; }

.send-btn {
  width: 38px; height: 38px;
  border: none; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  cursor: pointer; flex-shrink: 0;
  transition: transform .15s, background .15s;
}
.send-btn:hover {
  background: color-mix(in srgb, var(--accent) 85%, #000 15%);
  transform: scale(1.05);
}
.send-btn:disabled { background: var(--ink-mute); cursor: not-allowed; transform: none; }

/* 質問例 */
.examples {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 10px; width: 100%; margin-top: 8px;
}
.example {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px; border: 1.5px solid var(--line);
  border-radius: 18px; background: rgba(255,255,255,.5);
  font-size: 13px; color: var(--ink-soft);
  cursor: pointer; text-align: left;
  font-family: var(--sans);
  transition: background .15s, border-color .15s, transform .15s;
}
.example:hover {
  background: #fff; border-color: var(--accent-soft);
  transform: translateY(-1px);
}
.example-icon { font-size: 18px; flex-shrink: 0; }

.footnote {
  font-size: 12px; color: var(--ink-mute);
  margin-top: 8px;
}

/* ===== 回答画面 =====
   hero と同様に、自身を .main の中で水平中央に置く。
   .main は flex-direction:column なので、子要素は align-items のデフォルト stretch で
   左いっぱいに広がってしまう。margin: 0 auto で水平中央寄せに矯正する。
   .main 自体は height:100vh / overflow-y:auto なので、ここで height を奪わない限り
   左右別々のスクロールは保たれる。
   また min-height で hero と同じくファーストビューぶんの高さを確保しておくと、
   回答ビューに切り替えた直後でも main のスクロール領域が安定して残り、
   右側がスクロール不能に見える状態を防げる。 */
.answer-view {
  width: 100%; max-width: 720px;
  margin: 0 auto;
  min-height: calc(100vh - 80px);
  display: flex; flex-direction: column; gap: 20px;
}
.answer-view .user-q {
  background: var(--bg-sub); padding: 14px 18px;
  border-radius: 16px; font-size: 15px; align-self: flex-end;
  max-width: 80%;
}
.answer-card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 20px 22px;
  font-size: 15px; line-height: 1.85;
  box-shadow: 0 4px 16px rgba(43,38,32,.04);
}
.answer-card h1, .answer-card h2, .answer-card h3 { margin: 12px 0 6px; font-family: var(--display); }
.answer-card h1 { font-size: 22px; }
.answer-card h2 { font-size: 19px; }
.answer-card h3 { font-size: 16px; }
.answer-card p { margin: 8px 0; }
.answer-card ul, .answer-card ol { margin: 8px 0 8px 24px; }
.answer-card li { margin: 4px 0; }
.answer-card strong { color: var(--accent); font-weight: 700; }
.answer-card em { font-style: italic; color: var(--ink-soft); }
.answer-card code {
  background: var(--bg-sub); padding: 2px 6px;
  border-radius: 4px; font-size: 13px;
}
.answer-card blockquote {
  border-left: 3px solid var(--accent);
  padding: 4px 12px; margin: 10px 0;
  color: var(--ink-soft);
}

/* 考え中ドット */
.thinking { display: flex; gap: 6px; padding: 18px; }
.thinking span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent); animation: blink 1.2s infinite;
}
.thinking span:nth-child(2) { animation-delay: .2s; }
.thinking span:nth-child(3) { animation-delay: .4s; }
@keyframes blink {
  0%,100% { opacity: .3; transform: scale(.8); }
  50% { opacity: 1; transform: scale(1); }
}

.cursor { display: inline-block; animation: blink 1s infinite; opacity: .6; }

/* ===== モバイル ===== */
@media (max-width: 768px) {
  /* 画面幅を絶対に超えさせない安全策 */
  html, body {
    width: 100%;
    max-width: 100vw;
    overflow-x: hidden;
  }
  .app {
    width: 100%;
    max-width: 100vw;
    min-width: 0;
  }

  /* サイドバー (モバイルではヘッダー的な扱い) の横幅を画面いっぱいに揃える */
  .sidebar {
    width: 100vw;
    max-width: 100vw;
    min-width: 0;
    box-sizing: border-box;
  }
  .sidebar-scroll {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }
  .sidebar-head,
  .user-bar {
    width: 100%;
    box-sizing: border-box;
  }

  /* モバイルでは body の通常スクロールに戻す (左右独立スクロールはPCのみ) */
  body { overflow-y: auto; }
  .app { flex-direction: column; height: auto; }

  .sidebar {
    width: 100%;
    position: static;       /* sticky を解除 */
    height: auto;
    flex-direction: row; flex-wrap: wrap;
    border-right: none; border-bottom: 1px solid var(--line);
  }
  .sidebar-scroll {
    width: 100%;
    flex-direction: row; flex-wrap: wrap;
    overflow-y: visible; overflow-x: auto;
    padding: 12px; gap: 12px;
  }
  .sidebar.collapsed { width: 100%; }
  .sidebar.collapsed .sidebar-scroll { padding: 12px; }
  .sidebar.collapsed .ai-item span:not(.ai-emoji) { display: inline; }
  .sidebar-head { width: 100%; }
  .section-label, .history-list, .side-section { display: none; }
  /* AI一覧だけは横スクロール可能な状態で残す */
  .side-section:has(.ai-list) { display: flex; width: 100%; }
  .ai-list {
    flex-direction: row; overflow-x: auto;
    width: 100%; gap: 6px; padding-bottom: 4px;
  }
  .ai-item { flex-shrink: 0; padding: 8px 12px; font-size: 13px; }
  .user-bar { width: 100%; border-top: 1px solid var(--line); padding: 8px; }
  /* モバイルではサイドバーが上に積まれて高さが可変になるため、
     ピクセル決め打ちではなく flex で残り高さを埋める方式に切り替える。
     .app は column flex で min-height:100vh なので、
     .main を flex:1 にすればサイドバーの残りを取り、
     さらに hero に flex:1 を渡せば画面縦幅いっぱい (footer の前まで) になる。 */
  .main {
    padding: 32px 18px 48px;
    height: auto;
    overflow: visible;
    min-height: 0;
    flex: 1;
    justify-content: flex-start;
    width: 100%;
    min-width: 0;
    max-width: 100vw;
  }
  .hero {
    min-height: 0;
    flex: 1;
    /* hero 内部の縦中央寄せは PC と同じ justify-content:center を継承 */
  }
  .corner-icon { font-size: 22px; top: 12px; right: 16px; }
  .symbol { font-size: 52px; }
  .examples { grid-template-columns: 1fr; }
}

/* ===== サイト説明 (mdから変換されたHTMLが挿入される領域) =====
   blog.css の .article-body と同じ方針の装飾を、index 側のテーマ変数 / 角丸 /
   雰囲気に合わせて移植したもの。サーバー側で {{ intro_html|safe }} などとして
   挿入される変換済みHTMLを、ここで初めて装飾する。
   .hero の中に置かれることを想定しているので、左寄せ・最大幅は親 (hero) に従う。 */
.site-intro {
  width: 100%;
  margin-top: 16px;
  padding: 4px 8px;
  text-align: left;       /* hero は center 揃えなので、本文だけ左寄せに戻す */
  color: var(--ink);
  font-size: 14px;
  line-height: 1.8;
}
.site-intro h1 {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 700;
  margin: 8px 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--accent-soft);
}
.site-intro h2 {
  font-family: var(--display);
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 10px;
  padding-left: 10px;
  border-left: 4px solid var(--accent);
}
.site-intro h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 18px 0 6px;
  color: var(--ink);
}
.site-intro p { margin: 10px 0; color: var(--ink-soft); }
.site-intro strong { color: var(--ink); font-weight: 700; }
.site-intro em { font-style: italic; color: var(--ink-soft); }
.site-intro a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
}
.site-intro a:hover { border-bottom-style: solid; }
.site-intro ul, .site-intro ol { margin: 10px 0 10px 24px; color: var(--ink-soft); }
.site-intro li { margin: 4px 0; }
.site-intro li > ul, .site-intro li > ol { margin: 4px 0 4px 18px; }
.site-intro blockquote {
  border-left: 3px solid var(--accent);
  background: var(--bg-sub);
  padding: 10px 14px;
  margin: 14px 0;
  color: var(--ink-soft);
  border-radius: 0 8px 8px 0;
}
.site-intro hr {
  border: none;
  border-top: 1px dashed var(--line);
  margin: 24px 0;
}
.site-intro code {
  background: var(--bg-sub);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .92em;
  font-family: "SFMono-Regular", Consolas, "Menlo", monospace;
}
.site-intro pre {
  background: #2b2620;
  color: #f5ecdb;
  padding: 14px 18px;
  border-radius: 10px;
  overflow-x: auto;
  margin: 14px 0;
  font-size: 13px;
  line-height: 1.6;
}
.site-intro pre code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.site-intro del { color: var(--ink-mute); }
.site-intro dl { margin: 10px 0; }
.site-intro dt { font-weight: 700; margin-top: 10px; color: var(--ink); }
.site-intro dd { margin-left: 18px; color: var(--ink-soft); }
.site-intro img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  margin: 8px 0;
}
/* 表 */
.site-intro table {
  border-collapse: collapse;
  margin: 14px 0;
  width: 100%;
  font-size: 13px;
  /* 横にはみ出すほど長い表でも崩れないように、ブロック化して横スクロール */
  display: block;
  overflow-x: auto;
}
.site-intro th,
.site-intro td {
  border: 1px solid var(--line);
  padding: 8px 12px;
  text-align: left;
  vertical-align: top;
}
.site-intro th {
  background: var(--bg-sub);
  font-weight: 700;
  color: var(--ink);
}
.site-intro tbody tr:nth-child(even) td {
  background: rgba(0, 0, 0, .02);
}

/* ===== ログイン/静的ページ ===== */
.simple-page {
  max-width: 420px; margin: 60px auto;
  background: var(--card); border: 1px solid var(--line);
  border-radius: 18px; padding: 28px;
  box-shadow: 0 8px 24px rgba(43,38,32,.06);
}
.simple-page h1 {
  font-family: var(--display); font-size: 24px;
  margin-bottom: 16px; text-align: center;
}
.simple-page label {
  display: block; font-size: 13px;
  color: var(--ink-soft); margin: 12px 0 4px;
}
.simple-page input {
  width: 100%; padding: 10px 12px;
  border: 1.5px solid var(--line); border-radius: 10px;
  font-family: var(--sans); font-size: 14px;
  outline: none;
}
.simple-page input:focus { border-color: var(--accent); }
.simple-page button {
  width: 100%; margin-top: 16px;
  padding: 12px; border: none;
  background: var(--accent); color: #fff;
  border-radius: 12px; font-family: var(--sans);
  font-size: 14px; font-weight: 700; cursor: pointer;
}
.simple-page .err {
  background: #ffe6e0; color: #c8442a;
  padding: 10px 12px; border-radius: 10px;
  font-size: 13px; margin-bottom: 12px;
}
.simple-page .back {
  display: block; text-align: center;
  margin-top: 16px; font-size: 13px;
  color: var(--ink-soft); text-decoration: none;
}
.simple-page p { font-size: 14px; line-height: 1.8; color: var(--ink-soft); }

@media (max-width: 768px) {
  /* 画像や埋め込みが画面幅を超えないように */
  img, video, iframe, table, pre {
    max-width: 100%;
  }
}
