/* AdSense slot */
.ad-slot {
  margin: 28px auto;
  max-width: 1200px;
  min-height: 90px;
  text-align: center;
}
.ad-slot ins.adsbygoogle {
  display: block;
}

:root {
  color-scheme: light;
  --bg: #f6f0e7;
  --surface: #fffaf2;
  --surface-strong: #fff5e4;
  --ink: #24211d;
  --muted: #6d6256;
  --line: #e4d4bf;
  --accent: #8f4b27;
  --accent-dark: #633219;
  --accent-soft: #f0d8c8;
  --good: #2f6f52;
  --warn: #9b5a15;
  --shadow: 0 18px 60px rgba(83, 54, 27, 0.14);
  font-family: "Yu Gothic", "Yu Gothic UI", "Hiragino Sans", "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(143, 75, 39, 0.16), transparent 30rem),
    linear-gradient(180deg, #f8efe2 0%, var(--bg) 34rem, #fbf7f0 100%);
  line-height: 1.75;
}

a {
  color: var(--accent-dark);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
}

.site-hero {
  padding: 64px 20px 42px;
}

.hero-inner,
main,
.site-footer {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-inner {
  padding: 42px;
  border: 1px solid rgba(99, 50, 25, 0.16);
  border-radius: 28px;
  background: rgba(255, 250, 242, 0.82);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.hero-visual {
  margin: 0 0 28px;
  overflow: hidden;
  border: 1px solid rgba(99, 50, 25, 0.14);
  border-radius: 22px;
  background: var(--surface-strong);
  box-shadow: 0 16px 42px rgba(83, 54, 27, 0.16);
}

.hero-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2rem, 6vw, 4.3rem);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 12px;
  font-size: clamp(1.35rem, 3vw, 2rem);
  line-height: 1.35;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.05rem;
}

.lead {
  max-width: 760px;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-actions,
.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-dark);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  background: var(--accent);
  color: #fffaf2;
}

.button.ghost {
  background: rgba(255, 255, 255, 0.48);
}

.button.compact {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 0.92rem;
}

main {
  display: grid;
  gap: 22px;
  padding-bottom: 56px;
}

.notice-panel,
.controls-card,
.score-card,
.request-card,
.table-card,
.data-guide {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 250, 242, 0.92);
  box-shadow: 0 10px 36px rgba(83, 54, 27, 0.08);
}

.notice-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 24px;
}

.notice-panel p,
.score-card p,
.request-card p,
.guide-grid p,
.site-footer p {
  margin-bottom: 0;
  color: var(--muted);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.stats-grid div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-strong);
}

.stats-grid dt {
  color: var(--muted);
  font-size: 0.84rem;
}

.stats-grid dd {
  margin: 2px 0 0;
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
}

.controls-card {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  padding: 20px;
}

.search-wide {
  grid-column: span 2;
}

.control-group {
  display: grid;
  gap: 6px;
}

.control-group label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fffdf8;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(143, 75, 39, 0.24);
  outline-offset: 2px;
}

.score-card,
.request-card,
.data-guide {
  padding: 24px;
}

.score-formula {
  margin-top: 14px;
}

.score-details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 245, 228, 0.34);
}

.score-details summary {
  padding: 11px 14px;
  color: var(--accent-dark);
  font-weight: 800;
  cursor: pointer;
}

.score-details summary:hover {
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.score-details[open] summary {
  border-bottom: 1px solid var(--line);
}

.formula-box {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 16px;
  padding: 16px;
}

.formula-box h3 {
  margin-bottom: 6px;
  color: var(--accent-dark);
}

.formula-code {
  padding: 0.12em 0.42em;
  border-radius: 999px;
  background: rgba(143, 75, 39, 0.1);
  color: var(--accent-dark);
  font-weight: 800;
  white-space: nowrap;
}

.formula-weights ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.formula-weights li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 10px;
  border: 1px solid rgba(228, 212, 191, 0.82);
  border-radius: 999px;
  background: rgba(255, 253, 248, 0.72);
  color: var(--muted);
  font-size: 0.86rem;
}

.formula-weights strong {
  color: var(--accent-dark);
}

.request-card {
  display: block;
}

.section-kicker {
  margin-bottom: 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.request-actions {
  display: grid;
  justify-items: start;
  gap: 10px;
}

.request-note {
  font-size: 0.86rem;
}

.table-card {
  overflow: hidden;
}

.table-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 24px 24px 12px;
}

.table-header p {
  margin-bottom: 0;
  color: var(--muted);
}

.table-scroll {
  overflow-x: auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 24px 16px;
}

.pagination.bottom {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
}

.pagination:empty {
  display: none;
}

.pagination-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.pagination-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.pagination-button {
  min-width: 42px;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffdf8;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.86rem;
  font-weight: 800;
  cursor: pointer;
}

.pagination-button:hover:not(:disabled),
.pagination-button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fffaf2;
}

.pagination-button:disabled {
  color: rgba(109, 98, 86, 0.5);
  cursor: not-allowed;
  opacity: 0.72;
}

.table-notes {
  display: grid;
  gap: 6px;
  padding: 14px 24px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 245, 228, 0.42);
  color: var(--muted);
  font-size: 0.86rem;
}

.table-notes p {
  margin: 0;
}

.table-notes strong {
  color: var(--accent-dark);
}

table {
  width: 100%;
  min-width: 1280px;
  border-collapse: collapse;
  font-size: 0.94rem;
}

th,
td {
  padding: 13px 14px;
  border-top: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.cover-cell {
  width: 150px;
  min-width: 150px;
  text-align: center;
}

.cover-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.cover-image {
  width: 126px;
  height: 177px;
  object-fit: cover;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.18);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cover-link:hover .cover-image {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.24);
}

.cover-placeholder {
  display: inline-flex;
  width: 126px;
  height: 177px;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.3;
  background: rgba(255, 245, 228, 0.55);
}

.metric-wide {
  width: 150px;
  min-width: 150px;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f5e7d5;
  color: #4a3729;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  letter-spacing: inherit;
  cursor: pointer;
}

.sort-button:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 0.18em;
}

.sort-button.active {
  color: var(--accent-dark);
}

.sort-indicator {
  display: inline-block;
  min-width: 1em;
  color: var(--accent);
}

tbody tr:nth-child(even) {
  background: rgba(255, 245, 228, 0.55);
}

.work-title {
  display: grid;
  gap: 4px;
  min-width: 220px;
}

.work-title strong {
  font-size: 1rem;
  line-height: 1.45;
}

.work-meta,
.metric-note {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.score-pill,
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  white-space: nowrap;
}

.score-pill {
  min-width: 58px;
  padding: 7px 10px;
  background: var(--accent-dark);
  color: #fff8ed;
}

.badge {
  padding: 4px 9px;
  border: 1px solid var(--line);
  background: #fffdf8;
  color: var(--muted);
  font-size: 0.78rem;
}

.badge.good {
  border-color: rgba(47, 111, 82, 0.24);
  background: rgba(47, 111, 82, 0.1);
  color: var(--good);
}

.badge.warn {
  border-color: rgba(155, 90, 21, 0.24);
  background: rgba(155, 90, 21, 0.1);
  color: var(--warn);
}

.badge.request {
  border-color: rgba(143, 75, 39, 0.26);
  background: rgba(143, 75, 39, 0.1);
  color: var(--accent-dark);
}

.badge.candidate {
  border-color: rgba(114, 86, 51, 0.22);
  background: rgba(114, 86, 51, 0.08);
  color: rgba(77, 58, 35, 0.82);
}

.link-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  white-space: nowrap;
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.guide-grid article {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface-strong);
}

.related-reading {
  max-width: 1120px;
  margin: 18px auto 0;
  padding: 18px 2px 0;
  border-top: 1px solid rgba(114, 86, 51, 0.16);
  color: var(--muted);
  font-size: 0.88rem;
}

.related-reading-title {
  margin: 0 0 8px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(114, 86, 51, 0.72);
}

.related-reading ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.related-reading li {
  display: block;
}

.related-reading a {
  color: rgba(77, 58, 35, 0.78);
  text-decoration: none;
  text-underline-offset: 3px;
}

.related-reading a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.site-footer {
  padding: 24px 0 40px;
  font-size: 0.9rem;
}

.error-box {
  padding: 18px;
  border: 1px solid rgba(155, 90, 21, 0.3);
  border-radius: 16px;
  background: rgba(155, 90, 21, 0.08);
  color: var(--warn);
}

@media (max-width: 900px) {
  .hero-inner {
    padding: 28px;
  }

  .hero-visual {
    margin-bottom: 22px;
    border-radius: 18px;
  }

  .notice-panel,
  .formula-box,
  .request-card,
  .controls-card,
  .guide-grid {
    grid-template-columns: 1fr;
  }

  .search-wide {
    grid-column: auto;
  }

  .table-header {
    flex-direction: column;
  }

  .pagination {
    align-items: flex-start;
    flex-direction: column;
  }

  .pagination-buttons {
    justify-content: flex-start;
  }
}

@media (max-width: 560px) {
  .site-hero {
    padding-top: 28px;
  }

  .hero-inner,
  .notice-panel,
  .controls-card,
  .score-card,
  .request-card,
  .data-guide {
    border-radius: 18px;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .related-reading li {
    margin-top: 8px;
  }
}
