:root {
  --red: #e60012;
  --red-dark: #b8000e;
  --ink: #222;
  --muted: #666;
  --line: #ddd;
  --bg: #fff;
  --soft: #f5f5f5;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, sans-serif;
  line-height: 1.7;
}
a { color: inherit; }

/* サンプル表示の注意書き */
.sample-banner {
  background: #fff6e0; border-bottom: 1px solid #f0d58a;
  font-size: 13px; padding: 6px 16px; text-align: center;
}

/* ヘッダー */
.site-header { border-bottom: 1px solid var(--line); background: #fff; position: relative; z-index: 10; }
.site-header .inner {
  max-width: 1200px; margin: 0 auto; padding: 0 16px;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.logo { font-weight: bold; font-size: 18px; letter-spacing: .05em; text-decoration: none; }
.logo span { color: var(--red); }
.gnav { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.gnav > li { position: relative; }
.gnav > li > a, .gnav > li > button {
  display: block; padding: 24px 14px; font-size: 15px; text-decoration: none;
  background: none; border: 0; cursor: pointer; font-family: inherit; color: inherit;
}
.gnav > li > a:hover, .gnav > li > button:hover { color: var(--red); }
.gnav .dropdown {
  display: none; position: absolute; top: 100%; right: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--line); border-top: 3px solid var(--red);
  list-style: none; margin: 0; padding: 6px 0; box-shadow: 0 6px 16px rgba(0,0,0,.08);
}
.gnav li:hover > .dropdown, .gnav li:focus-within > .dropdown { display: block; }
.gnav .dropdown a { display: block; padding: 10px 18px; text-decoration: none; font-size: 14px; }
.gnav .dropdown a:hover, .gnav .dropdown a[aria-current="page"] { background: var(--soft); color: var(--red); }

/* ページ本体 */
.page-title { background: var(--soft); padding: 40px 16px; text-align: center; }
.page-title h1 { margin: 0; font-size: 28px; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 14px; }
main { max-width: 1200px; margin: 0 auto; padding: 40px 16px 80px; }
.section-title {
  position: relative; font-size: 24px; margin: 0 0 28px; padding: 6px 0 0 30px;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: 0;
  border-style: solid; border-width: 10px 10px 0 0; border-color: var(--red) transparent transparent transparent;
}

/* ① カタログ */
.catalog-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 40px 24px; margin-bottom: 64px;
}
@media (max-width: 960px) { .catalog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .catalog-grid { grid-template-columns: 1fr; } }
.catalog-card .cover {
  width: 142px; height: 200px; margin: 0 auto 20px; border: 1px solid var(--line);
  display: flex; align-items: flex-start; justify-content: center; text-align: center;
  font-size: 13px; font-weight: bold; padding: 16px 8px 0; color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.4);
}
.catalog-card h3 {
  font-size: 16px; margin: 0 0 14px; padding-bottom: 8px;
  border-bottom: 1px solid var(--line); position: relative;
}
.catalog-card h3::after {
  content: ""; position: absolute; left: 0; bottom: -1px; width: 80px; border-bottom: 1px solid #333;
}
.btn-group { display: flex; flex-direction: column; gap: 8px; }
.btn-pdf {
  display: block; text-align: center; padding: 8px 12px; border-radius: 999px;
  background: var(--red); color: #fff; font-weight: bold; font-size: 15px; text-decoration: none;
  border: 2px solid var(--red);
}
.btn-pdf:hover { background: var(--red-dark); border-color: var(--red-dark); }
.btn-pdf.sub { background: #fff; color: var(--red); }
.btn-pdf.sub:hover { background: #fff0f1; }
.btn-pdf.disabled { background: #eee; border-color: #eee; color: #999; pointer-events: none; }

/* ② 試験成績書・SDS */
.search-box {
  display: flex; gap: 8px; max-width: 560px; margin: 0 0 12px;
}
.search-box input {
  flex: 1; font-size: 16px; padding: 10px 14px; border: 1px solid #bbb; border-radius: 4px; font-family: inherit;
}
.search-box button {
  font-size: 15px; padding: 0 22px; border: 0; border-radius: 4px; background: var(--red);
  color: #fff; font-weight: bold; cursor: pointer; font-family: inherit;
}
.search-box button.clear { background: #888; }
.search-hint { font-size: 13px; color: var(--muted); margin: 0 0 32px; }
.result-count { font-size: 18px; font-weight: bold; margin: 0 0 12px; }
.result-count em { color: var(--red); font-style: normal; }
.empty { padding: 24px; background: var(--soft); text-align: center; color: var(--muted); }

.acc { border-top: 1px solid var(--line); }
.acc details { border-bottom: 1px solid var(--line); }
.acc summary {
  list-style: none; cursor: pointer; padding: 16px 12px; font-size: 17px; font-weight: bold;
  display: flex; align-items: center; gap: 10px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary::before {
  content: "▶"; color: var(--red); font-size: 12px; transition: transform .15s;
}
.acc details[open] summary::before { transform: rotate(90deg); }
.acc summary:hover { background: #fafafa; }
.acc summary .count { color: var(--muted); font-weight: normal; font-size: 15px; }
.acc .acc-body { padding: 0 12px 20px; }

.doc-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.doc-table th, .doc-table td { border: 1px solid var(--line); padding: 10px 12px; vertical-align: middle; }
.doc-table th { background: #333; color: #fff; font-weight: normal; text-align: center; }
.doc-table th:first-child { text-align: left; }
.doc-table td.files { width: 26%; text-align: center; }
.doc-table tr:nth-child(even) td { background: #fafafa; }
.doc-table .none { color: #aaa; }
.file-link {
  display: inline-flex; align-items: center; gap: 6px; margin: 2px 0;
  padding: 3px 12px; border: 1px solid var(--red); border-radius: 4px;
  color: var(--red); text-decoration: none; font-size: 13px; font-weight: bold; background: #fff;
}
.file-link:hover { background: var(--red); color: #fff; }
.file-link .label { color: var(--ink); font-weight: normal; }
.file-link:hover .label { color: #fff; }
.files .file-link + .file-link { margin-left: 4px; }
@media (max-width: 600px) {
  .doc-table td.files { width: auto; }
  .files .file-link { display: flex; justify-content: center; }
  .files .file-link + .file-link { margin-left: 0; }
}

.search-box input { min-width: 0; }

/* スマートフォン幅 */
@media (max-width: 720px) {
  .site-header .inner { height: auto; flex-wrap: wrap; padding: 8px 16px; }
  .gnav { flex-wrap: wrap; }
  .gnav > li > a, .gnav > li > button { padding: 10px 8px; font-size: 14px; }
  .gnav .dropdown { right: auto; left: 0; }
  .page-title { padding: 28px 16px; }
  .page-title h1 { font-size: 22px; }
  .doc-table { font-size: 14px; }
  .doc-table th, .doc-table td { padding: 8px 6px; }
  .search-box button { padding: 0 14px; }
}

/* PDFリンクを押したときの通知（サンプル用） */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%);
  background: #333; color: #fff; padding: 10px 18px; border-radius: 6px; font-size: 14px;
  opacity: 0; transition: opacity .2s; pointer-events: none; max-width: calc(100% - 32px);
}
.toast.show { opacity: 1; }

.site-footer { background: #333; color: #ccc; text-align: center; padding: 24px 16px; font-size: 13px; }
