/* 色・アニメーション・一覧表は司法省日誌（shiho-nisshi.github.io/style.css）と同じ */
:root {
  --accent:      #2563eb;
  --accent-soft: #eff6ff;
  --border:      #e5e7eb;
  --muted:       #4b5563;
  --card-bg:     #ffffff;
  --ink:         #111827;
  --shadow:      0 1px 2px rgba(0,0,0,0.05);
}

@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-down { animation: fadeDown 0.4s ease-out; }

/* Tailwind の preflight（a { color: inherit }）より後に効くよう、範囲を絞って指定する */
.browse-table a, .entry a { color: var(--accent); text-decoration: none; }
.browse-table a:hover, .entry a:hover { text-decoration: underline; }

/* ── 収録辞書の一覧表 ── */
.browse-table { width: 100%; border-collapse: collapse; font-size: 0.9375rem; }
.browse-table .col-year { width: 64px; }
.browse-table .col-dir { width: 104px; }
.browse-table .col-status { width: 84px; }
.browse-table .col-count { width: 72px; text-align: right; }
.browse-table th {
  text-align: left;
  font-size: 0.8125rem;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.browse-table td { padding: 8px 10px; border-bottom: 1px solid var(--border); }
.browse-table .num-cell { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.browse-table .muted-cell { color: var(--muted); }

/* ── 検索欄 ── */
.search-panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
}
.search-row { display: flex; gap: 8px; }
#q {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 1rem;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
}
#q:focus { outline: 2px solid var(--accent); outline-offset: -1px; border-color: transparent; }
#q::-webkit-search-cancel-button { display: none; }
#clear {
  font: inherit;
  width: 44px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  color: var(--muted);
  cursor: pointer;
}
#clear:hover { background: #f3f4f6; }

.options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 20px;
  margin-top: 12px;
  font-size: 0.875rem;
}
.options label { cursor: pointer; white-space: nowrap; }
.options input { accent-color: var(--accent); }
.mode, .dicts { display: flex; flex-wrap: wrap; gap: 4px 14px; }
.dicts { flex-basis: 100%; color: var(--muted); }
.hint { margin: 10px 0 0; font-size: 0.75rem; color: var(--muted); line-height: 1.6; }

#status.error { color: #b91c1c; }

/* ── 検索結果カード（司法省日誌の巻ページの記事カードと同じ作り） ── */
.entry {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.entry.focus { outline: 3px solid #eda100; outline-offset: 2px; }

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.badge {
  display: inline-block;
  padding: 0 8px;
  border-radius: 9999px;
  border: 1px solid #d1d5db;
  font-size: 0.75rem;
  line-height: 1.25rem;
  color: #374151;
  white-space: nowrap;
}
.entry a.badge-solid {
  border-color: #1f2937;
  background: #1f2937;
  color: #fff;
}
.entry a.badge-solid:hover { background: #374151; text-decoration: none; }
.entry-meta .source { margin-left: auto; font-size: 0.75rem; }

.hw-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.hw { margin: 0; font-size: 1.125rem; font-weight: 700; color: var(--ink); }
.col, .reading { color: var(--muted); font-size: 0.9375rem; }

.trans { margin: 6px 0 0; font-size: 0.9375rem; }
.trans div { display: flex; gap: 8px; }
.trans dt { flex: none; color: var(--muted); font-size: 0.8125rem; width: 1.5em; padding-top: 1px; }
.trans dd { margin: 0; }

.def {
  margin-top: 8px;
  font-size: 1rem;
  line-height: 1.9;
  color: var(--ink);
  white-space: pre-line;
  word-break: break-all;
}
.def .kwic { display: block; margin: 2px 0; }
.def .kwic::before { content: "… "; color: var(--muted); }
.def .kwic::after { content: " …"; color: var(--muted); }
.def .note { font-size: 0.8125rem; color: var(--muted); }
.toggle {
  font: inherit;
  font-size: 0.8125rem;
  color: var(--accent);
  background: none;
  border: none;
  padding: 0;
  margin-left: 6px;
  cursor: pointer;
}
.toggle:hover { text-decoration: underline; }

.rel {
  margin-top: 10px;
  padding-top: 6px;
  border-top: 1px dashed var(--border);
  font-size: 0.875rem;
}
.rel-caption { color: #6b7280; }
.rel a { margin-right: 10px; }

mark { background: #fef08a; color: inherit; padding: 0 1px; border-radius: 2px; }

.more-wrap { text-align: center; margin: 16px 0; }
#more {
  font: inherit;
  font-size: 0.875rem;
  padding: 8px 24px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--card-bg);
  box-shadow: var(--shadow);
  cursor: pointer;
}
#more:hover { background: #f3f4f6; }

/* ── 辞書ごとの一覧ページ（docs/*.html）。項目カードは検索結果と共通 ── */
.doc-back { margin: 0 0 8px; font-size: 0.875rem; }
.doc-back a, .doc-source, .doc-toc a { color: var(--accent); text-decoration: none; }
.doc-back a:hover, .doc-source:hover, .toc-part a:hover { text-decoration: underline; }

.doc-toc {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin-bottom: 24px;
}
.doc-toc summary { cursor: pointer; padding: 12px 16px; font-weight: 500; }
.toc-body { padding: 0 16px 14px; }
.toc-part { margin: 10px 0 6px; font-size: 0.8125rem; color: var(--muted); }
.toc-part:first-child { margin-top: 0; }
.toc-grid { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.toc-grid a {
  display: inline-block;
  min-width: 2.25em;
  padding: 2px 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-align: center;
}
.toc-grid a:hover { background: var(--accent-soft); }

/* 数千件のカードを並べるので、画面外のカードは描画を省く */
.doc-entry { content-visibility: auto; contain-intrinsic-size: auto 160px; scroll-margin-top: 16px; }
.doc-entry:target { outline: 3px solid #eda100; outline-offset: 2px; }

/* ── 訳語比較ページ（docs/compare.html） ── */
.intro-links { margin: 16px 0 0; font-size: 0.9375rem; }
.intro-links p { margin: 0 0 4px; color: var(--muted); }
.intro-links ul { margin: 0; padding: 0 0 0 1em; list-style: none; line-height: 1.8; }
.intro-links a, .cmp-table a { color: var(--accent); text-decoration: none; }
.intro-links a:hover, .cmp-table a:hover { text-decoration: underline; }

.cmp-stats { font-size: 1rem; }
.cmp-stats th { font-size: 0.875rem; }
.cmp-stats td:first-child { white-space: nowrap; }
.cmp-stats .cmp-total td { font-weight: 500; color: var(--ink); border-bottom: none; }

.cmp-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  margin-bottom: 12px;
  font-size: 0.9375rem;
  color: var(--muted);
}
.cmp-filter select, .cmp-filter input {
  font: inherit;
  color: var(--ink);
  padding: 4px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  background: #fff;
  max-width: 100%;
}
.cmp-filter input { width: 10em; }
.cmp-count { margin-left: auto; font-variant-numeric: tabular-nums; }

/* 列幅は中身によらず、フランス語の列のほかは辞書ごとに等分する */
.cmp-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 1.0625rem;
}
.cmp-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f3f4f6;
  text-align: left;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--muted);
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
}
.cmp-year { font-weight: 400; }
.cmp-table tbody th, .cmp-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  text-align: left;
}
.cmp-table thead th:first-child { width: 22%; }
.cmp-table tbody th { font-weight: 400; }
.cmp-words li { overflow-wrap: anywhere; }
.cmp-key-word { display: block; font-weight: 700; color: var(--ink); word-break: break-word; }
.cmp-reading { display: block; font-size: 0.8125rem; color: var(--muted); }
.cmp-status { display: block; margin-top: 2px; font-size: 0.8125rem; }
.cmp-all { color: #15803d; }
.cmp-some { color: #b45309; }
.cmp-none { color: #b91c1c; }
.cmp-empty { color: #9ca3af; }

.cmp-words { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.cmp-words li, .cmp-key {
  padding: 1px 8px;
  border-left: 3px solid;
  border-radius: 3px;
}
.cmp-key { display: inline-block; margin: 0 2px; padding: 0 6px; line-height: 1.5; }
.cmp-words .match, .cmp-key.match { background: #f0fdf4; border-color: #16a34a; }
.cmp-words .diff, .cmp-key.diff { background: #fffbeb; border-color: #d97706; }
/* 同じ訳語の別の項目（2つ目以降）へのリンク */
.cmp-also { font-size: 0.75rem; margin-left: 3px; }

/* 日本語からの比較：1項目が1行。仏語を色分けし、英語・独語は下に灰色で添える */
.cmp-foreign li { border-left: none; padding: 0; }
.cmp-foreign .match, .cmp-foreign .diff {
  display: inline-block;
  margin-right: 4px;
  padding: 1px 8px;
  border-left: 3px solid;
  border-radius: 3px;
}
.cmp-others { display: block; margin: 2px 0 0 4px; font-size: 0.875rem; color: #6b7280; }
.cmp-lang { font-size: 0.75rem; }

.cmp-tabs { display: flex; gap: 4px; margin-top: 14px; border-bottom: 1px solid var(--border); }
.cmp-tabs a {
  margin-bottom: -1px;
  padding: 6px 14px;
  font-size: 0.9375rem;
  color: var(--accent);
  text-decoration: none;
  border: 1px solid transparent;
  border-bottom: none;
  border-radius: 6px 6px 0 0;
}
.cmp-tabs a:hover { text-decoration: underline; }
.cmp-tabs a[aria-current] { color: var(--ink); font-weight: 500; background: var(--card-bg); border-color: var(--border); }
.cmp-tabs a[aria-current]:hover { text-decoration: none; }
.cmp-note { margin: 8px 0 0; font-size: 0.8125rem; color: var(--muted); line-height: 1.6; }

/* 狭い画面では1行を1枚のカードにし、セルの前に辞書名を出す */
@media (max-width: 640px) {
  .cmp-table, .cmp-table tbody, .cmp-table tr, .cmp-table tbody th, .cmp-table td { display: block; width: auto; }
  .cmp-table thead { display: none; }
  .cmp-table tr { border-bottom: 1px solid var(--border); padding: 4px 0; }
  .cmp-table tbody th, .cmp-table td { border-bottom: none; padding: 4px 12px; }
  .cmp-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.8125rem;
    color: var(--muted);
    margin-bottom: 2px;
  }
  .cmp-count { margin-left: 0; }
}

/* ── 法律情報基盤（law-platform.jp）と同じヘッダー・フッター ── */
.lp-header { background-color: #002060; }
.lp-header-inner {
  display: flex;
  align-items: stretch;
  max-width: 1024px;
  min-height: 3.25rem;
  margin: 0 auto;
}
.lp-header .title-box { padding: 0.5rem 1rem 0 0.5rem; }
.lp-header .lp-title,
.lp-header .lp-subtitle { display: inline-block; margin: 0; line-height: 1; }
.lp-header .lp-title { font-size: 2rem; font-weight: 600; }
.lp-header .lp-title a { font-family: "HG教科書体"; font-weight: normal; }
.lp-header .lp-subtitle {
  font-size: 1.25rem;
  font-weight: 400;
  font-family: "Times New Roman";
  font-style: italic;
  margin-left: 1em;
}
.lp-header .lp-title a,
.lp-header .lp-subtitle a { color: white; text-decoration: none; }

.lp-footer {
  margin-top: 3rem;
  padding: 10px;
  background-color: #fafafa;
  color: #4a4a4a;
  font-family: BlinkMacSystemFont, -apple-system, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Fira Sans", "Droid Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  text-align: center;
}
.lp-footer-inner { max-width: 960px; margin: 0 auto; }
.lp-footer p { margin: 0; }
.lp-footer p:not(:last-child) { margin-bottom: 1em; }
.lp-footer a { color: #485fc7; text-decoration: none; }
.lp-footer a:hover { color: #363636; }
.lp-footer img { display: inline; height: auto; max-width: 100%; vertical-align: baseline; }
