/*
 * 利用規約・プライバシーポリシー共通のスタイル。
 * 版ごとの HTML は公開後に書き換えないため、後から変わる表示 (旧版の告知) はこのファイルで切り替える。
 */

:root {
  --bg: #ffffff;
  --text: #1f2328;
  --muted: #555c66;
  --border: #d5d9de;
  --link: #1f6bbf;
  --notice-bg: #fff4d6;
  --notice-border: #c98a00;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15171a;
    --text: #e6e8eb;
    --muted: #a9b0b8;
    --border: #3a3f46;
    --link: #5ba0e8;
    --notice-bg: #3a2f10;
    --notice-border: #e0b040;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, "Hiragino Sans",
    "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Noto Sans SC", "PingFang SC",
    "Microsoft YaHei", Meiryo, sans-serif;
  font-size: 1rem;
  line-height: 1.7;
  overflow-wrap: anywhere;
}

/* 中国語は簡体字のフォントを先に当てる (日本語のフォントだと句読点の位置と字形が日本語のものになる) */
:lang(zh) {
  font-family:
    -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
}

.page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
}

a {
  color: var(--link);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.site-name {
  display: inline-block;
  font-size: 0.875rem;
  color: var(--muted);
  padding: 0.5rem 0;
}

h1 {
  font-size: 1.625rem;
  line-height: 1.4;
  margin: 0.5rem 0 0.25rem;
}

h2 {
  font-size: 1.1875rem;
  line-height: 1.5;
  margin: 2.25rem 0 0.5rem;
  break-after: avoid;
  page-break-after: avoid;
}

p {
  margin: 0 0 0.75rem;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-bottom: 1rem;
}

/* 旧版の告知。既定は hidden 属性で隠し、旧版になった版だけ下の「旧版の指定」で表示する。
   CSS が読めないときは表示されない (有効な版に誤って出さない) 側に倒す。 */
.superseded-notice[hidden] {
  display: none;
}

.superseded-notice {
  background: var(--notice-bg);
  border-left: 4px solid var(--notice-border);
  padding: 0.75rem 1rem;
  margin: 0 0 1rem;
}

.toc {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0 1rem;
  margin: 0 0 1.5rem;
}

.toc summary {
  cursor: pointer;
  padding: 0.75rem 0;
  min-height: 44px;
}

.toc ol {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

.toc li {
  padding: 0.25rem 0;
}

/* 項・号の番号は本文の文字として持つ (コピーや引用で落ちないように)。 */
ol.items {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
}

/* 番号を左の余白に置き、折り返した行を本文の書き出しにそろえる (番号の幅がフォントで変わっても崩れない)。 */
ol.items > li {
  position: relative;
  padding-left: 1.75em;
  margin-bottom: 0.5rem;
}

ol.items > li > .num {
  position: absolute;
  left: 0;
}

ol.items ol.items {
  margin-top: 0.5rem;
}

ol.items ol.items > li {
  padding-left: 2.25em;
}

.versions {
  list-style: none;
  margin: 1rem 0;
  padding: 0;
}

.versions > li {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
}

.versions h2 {
  margin: 0 0 0.5rem;
  font-size: 1.0625rem;
}

.read-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 0.25rem;
}

.back-to-toc {
  margin-top: 2.5rem;
}

/* 404 ページ: 日本語・英語・中国語の案内を区切って縦に並べる */
.not-found section + section {
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}

.not-found section + section h2 {
  margin-top: 1.5rem;
}

.not-found .contact {
  margin-top: 2rem;
  color: var(--muted);
  font-size: 0.9375rem;
}

.print-only {
  display: none;
}

@media print {
  :root {
    --bg: #ffffff;
    --text: #000000;
    --muted: #333333;
    --link: #000000;
    color-scheme: light;
  }

  .page {
    max-width: none;
    padding: 0;
  }

  .toc,
  .back-to-toc,
  .site-name {
    display: none;
  }

  .print-only {
    display: block;
  }
}

/* ---- 旧版の指定 ----
 * 新しい版を公表するときに、旧版になった版をここに追加する (版ごとの HTML は書き換えない)。
 * 例:
 * html[data-document="terms-of-service"][data-version="v1.0"] .superseded-notice[hidden] {
 *   display: block;
 * }
 */
