/* ============================================================
   Trillion Game Reports 共通スタイル
   デザイントークン（:root）の SSOT はこのファイル。トップ・索引・日次ページは
   <link rel="stylesheet"> でこのファイルを参照する。
   週次レポート HTML はインライン <style> にこの :root を複製する規約
   （CLAUDE.md「週次レポート HTML の構造規約」）なので、トークンを変えたら
   以後に生成される週次の複製元も変わる。既存の週次ファイルは書き換えない。
   ============================================================ */
:root {
  color-scheme: light dark;
  --bg: #f5f6f8; /* ページ背景（薄いグレー） */
  --surface: #ffffff; /* カード背景 */
  --fg: #1b1e24; /* 本文 */
  --muted: #646b76; /* 補足テキスト */
  --accent: #0b62c4; /* リンク・見出しアクセント */
  --accent-weak: rgba(11, 98, 196, 0.08); /* アクセントの淡色背景 */
  --border: #e3e5e9; /* 罫線 */
  --radius: 12px; /* カード角丸 */
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.06); /* カード影 */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #101216;
    --surface: #191d23;
    --fg: #e6e8eb;
    --muted: #98a0ab;
    --accent: #6ab0ff;
    --accent-weak: rgba(106, 176, 255, 0.12);
    --border: #2a3038;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
  }
}

* {
  box-sizing: border-box;
}
body {
  margin: 0 auto;
  max-width: 640px;
  padding: 3rem 1.25rem 4rem;
  background: var(--bg);
  color: var(--fg);
  font-family:
    system-ui,
    -apple-system,
    "Hiragino Sans",
    sans-serif;
  line-height: 1.75;
}
/* 日次レポート本体は表を含むので幅を広げる */
body.report {
  max-width: 860px;
}
a {
  color: var(--accent);
}

/* ヘッダー */
.eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}
h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
p.description {
  margin: 0 0 2.5rem;
  color: var(--muted);
  font-size: 0.9rem;
}

/* セクション */
section {
  margin: 0 0 2.5rem;
}
section > h2 {
  margin: 0 0 0.25rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}
section h3 {
  margin: 1.5rem 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 700;
}
section > p.section-note {
  margin: 0 0 0.9rem;
  color: var(--muted);
  font-size: 0.82rem;
}

/* エントリ一覧: 生成側が挿入する素の <li><a href="...">...</a></li> を
   CSS だけでカード化する（li にクラスを付けない規約はこの前提に依存する） */
ul.entries {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}
ul.entries li:not(.empty-message) {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
}
ul.entries li:not(.empty-message):hover {
  border-color: var(--accent);
  background: var(--accent-weak);
}
ul.entries li:not(.empty-message) a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.1rem;
  color: var(--fg);
  text-decoration: none;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
ul.entries li:not(.empty-message) a::after {
  content: "→";
  color: var(--muted);
  font-weight: 400;
  transition: color 0.15s ease;
}
ul.entries li:not(.empty-message):hover a::after {
  color: var(--accent);
}
ul.entries li a .sub {
  color: var(--muted);
  font-weight: 400;
  font-size: 0.8rem;
  overflow-wrap: anywhere;
}

/* 空状態メッセージ: エントリが 1 件も無いときだけ表示する。
   生成側は追記だけすればよく、このメッセージを消す必要はない */
.empty-message {
  display: none;
  color: var(--muted);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.5rem 1.1rem;
  text-align: center;
  font-size: 0.9rem;
}
ul.entries:not(:has(li:not(.empty-message))) li.empty-message {
  display: list-item;
}
/* 日次索引は月ごとの <section> を並べるので、月の節が 1 つも無いときに表示する */
.months:not(:has(section)) > .empty-message {
  display: block;
}

/* 日次レポート本体 */
nav.report-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  margin: 0 0 2rem;
  font-size: 0.9rem;
}
.report table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
}
.report th,
.report td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.report th {
  color: var(--muted);
  font-weight: 600;
}
.report code {
  padding: 0.05rem 0.3rem;
  background: var(--accent-weak);
  border-radius: 4px;
  font-size: 0.85em;
}
/* 表は狭幅で横スクロールさせ、本文の幅を崩さない */
.table-wrap {
  overflow-x: auto;
}

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

/* モバイル調整（375px 幅で崩れないこと） */
@media (max-width: 480px) {
  body {
    padding: 2rem 1rem 3rem;
  }
  h1 {
    font-size: 1.5rem;
  }
  /* 狭幅では補足ラベルを次行に落として矢印の見切れを防ぐ */
  ul.entries li:not(.empty-message) a {
    flex-wrap: wrap;
    gap: 0.15rem 0.75rem;
  }
  ul.entries li:not(.empty-message) a::after {
    order: 1;
  }
  ul.entries li a .sub {
    order: 2;
    flex-basis: 100%;
  }
}
