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

:root {
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --success: #16a34a;
  --danger: #dc2626;
  --warning: #d97706;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-300: #cbd5e1;
  --gray-400: #94a3b8;
  --gray-500: #64748b;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-900: #0f172a;
  --bg-body: #f8fafc;
  --surface: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 8px 24px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
  --radius: 12px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Noto Sans', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Noto Sans JP', sans-serif;
  background: var(--bg-body);
  color: var(--gray-900);
  line-height: 1.6;
  min-height: 100vh;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--gray-900);
  color: #fff;
  padding: 8px 12px;
  border-radius: 8px;
  text-decoration: none;
  z-index: 100;
}

.skip-link:focus { top: 12px; }

header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--gray-200);
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.logo-link {
  display: inline-flex;
  border-radius: 8px;
}

.logo-link:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

header .logo {
  display: block;
  width: min(280px, 78vw);
  height: auto;
}

.menu-toggle,
.menu-close {
  width: 44px;
  height: 44px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--surface);
  color: var(--gray-900);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.menu-toggle {
  flex-direction: column;
  gap: 5px;
}

.menu-toggle-line {
  width: 18px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
}

.menu-close svg {
  width: 20px;
  height: 20px;
}

.menu-toggle:hover,
.menu-close:hover {
  background: var(--gray-50);
  border-color: var(--gray-300);
  box-shadow: var(--shadow-sm);
}

.menu-toggle:focus-visible,
.menu-close:focus-visible,
.site-menu-nav a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  transition: opacity 0.2s ease;
}

body.menu-open .menu-backdrop {
  opacity: 1;
}

.site-menu {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  width: min(360px, 86vw);
  background: var(--surface);
  border-left: 1px solid var(--gray-200);
  padding: 20px;
  transform: translateX(100%);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
  pointer-events: none;
}

/* 閉じた状態では左方向の影がビューポート内に残るため、開いているときだけ付与 */
body.menu-open .site-menu {
  transform: translateX(0);
  pointer-events: auto;
  box-shadow: -14px 0 36px rgba(15, 23, 42, 0.14);
}

.site-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.site-menu-header p {
  font-size: 18px;
  font-weight: 800;
  color: var(--gray-900);
}

.site-menu-nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.site-menu-nav a {
  color: var(--gray-900);
  text-decoration: none;
  font-size: 16px;
  font-weight: 700;
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 14px 16px;
  min-height: 48px;
  display: flex;
  align-items: center;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.site-menu-nav a:hover,
.site-menu-nav a[aria-current="page"] {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: var(--primary);
}

.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

#main-content:focus {
  outline: none;
}

.page-view[hidden] {
  display: none;
}

.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(37, 99, 235, 0.35);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(24px, 5vw, 36px);
  font-weight: 700;
  color: var(--gray-900);
  margin-top: 6px;
  margin-bottom: 16px;
  line-height: 1.25;
  letter-spacing: 0.01em;
}

.hero p {
  color: var(--gray-600);
  font-size: 16px;
  max-width: 680px;
  margin: 0 auto;
}

.card {
  background: var(--surface);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.info-page {
  max-width: 760px;
  margin: 0 auto;
}

.info-page h1 {
  font-size: clamp(25px, 5vw, 36px);
  line-height: 1.25;
  color: var(--gray-900);
  margin: 12px 0 24px;
}

.info-card {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.info-card h2 {
  font-size: 19px;
  line-height: 1.4;
  color: var(--gray-900);
  padding-top: 8px;
}

.info-card p,
.info-card li {
  font-size: 16px;
  color: var(--gray-700);
  line-height: 1.75;
}

.info-card ul,
.info-card ol {
  padding-left: 1.4em;
}

.info-card a {
  color: var(--primary);
  font-weight: 700;
  text-underline-offset: 3px;
}

.info-card a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
  border-radius: 4px;
}

.form-group {
  margin-bottom: 20px;
}

label {
  display: block;
  font-size: 15px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 6px;
}

label .required {
  color: var(--danger);
  margin-left: 4px;
}

label .optional {
  color: var(--gray-500);
  font-weight: 400;
  margin-left: 4px;
  font-size: 12px;
}

input[type="url"] {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  font-size: 16px;
  color: var(--gray-900);
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
  background: #fff;
}

input[type="url"]:hover:not(:disabled) { border-color: var(--gray-400); }

input[type="url"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

input[type="url"]::placeholder {
  color: var(--gray-400);
}

.input-hint {
  font-size: 13px;
  color: var(--gray-600);
  margin-top: 5px;
}

.btn-primary {
  width: 100%;
  padding: 13px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover:not(:disabled) { background: var(--primary-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-primary:active:not(:disabled) { transform: scale(0.99); }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-primary:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* Error */
.alert-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: var(--danger);
  padding: 12px 16px;
  font-size: 14px;
  margin-bottom: 16px;
}

/* Result overall */
.result-overall {
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  box-shadow: var(--shadow);
}

.result-overall.ok    { background: #f0fdf4; border: 1px solid #bbf7d0; }
.result-overall.ng    { background: #fef2f2; border: 1px solid #fecaca; }
.result-overall.caution { background: #fffbeb; border: 1px solid #fde68a; }

.overall-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.7);
}

.overall-icon svg { width: 24px; height: 24px; }
.result-overall.ok .overall-icon { color: var(--success); }
.result-overall.ng .overall-icon { color: var(--danger); }
.result-overall.caution .overall-icon { color: var(--warning); }

.overall-title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
}

.result-overall.ok    .overall-title { color: var(--success); }
.result-overall.ng    .overall-title { color: var(--danger); }
.result-overall.caution .overall-title { color: var(--warning); }

.overall-comment { font-size: 16px; color: var(--gray-700); line-height: 1.65; }

/* NG summary */
.ng-summary {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  padding: 2em;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}

.ng-summary h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--danger);
  margin-bottom: 10px;
}

.ng-summary ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ng-summary li {
  font-size: 16px;
  color: var(--gray-700);
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.ng-icon {
  color: var(--danger);
  line-height: 1;
  margin-top: 2px;
  flex-shrink: 0;
}

/* Category sections */
.category-title {
  font-size: 19px;
  font-weight: 800;
  color: var(--gray-700);
  letter-spacing: 0.01em;
  margin: 28px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--gray-200);
}

/* Check item */
.check-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 12px;
  padding: 16px 0;
  border-bottom: 1px solid var(--gray-200);
  align-items: start;
}

.check-item:last-child { border-bottom: none; }

.item-label {
  font-size: 16px;
  font-weight: 600;
  color: var(--gray-900);
  margin-bottom: 3px;
}

.item-comment {
  font-size: 16px;
  color: var(--gray-600);
  line-height: 1.5;
  grid-column: 1 / -1;
}

.status-badge {
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

.status-ok      { background: #dcfce7; color: var(--success); }
.status-ng      { background: #fee2e2; color: var(--danger); }
.status-unknown { background: var(--gray-100); color: var(--gray-500); }
.status-caution { background: #fef9c3; color: var(--warning); }

/* CTA */
.cta-card {
  background: linear-gradient(135deg, #eff6ff 0%, #e0f2fe 52%, #eef2ff 100%);
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}

.cta-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--gray-900);
  margin-bottom: 8px;
}

.cta-card p {
  font-size: 16px;
  color: var(--gray-600);
  margin-bottom: 18px;
}

.cta-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 12px;
}

.btn-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background 0.15s, box-shadow 0.15s, transform 0.15s;
}

.btn-cta:hover { background: var(--primary-dark); box-shadow: var(--shadow-md); transform: translateY(-1px); }
.btn-cta:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.22);
}

.meta {
  font-size: 12px;
  color: var(--gray-600);
  margin-top: 12px;
}

footer {
  text-align: center;
  padding: 24px;
  font-size: 14px;
  color: var(--gray-600);
  border-top: 1px solid var(--gray-200);
}

#result-section { display: none; }

.download-bar {
  display: flex;
  gap: 10px;
  margin-bottom: 28px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.btn-download {
  padding: 8px 16px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  min-height: 40px;
}

.btn-download:hover { background: var(--gray-50); border-color: var(--gray-500); box-shadow: var(--shadow-sm); }
.btn-download:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-download:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.16);
}

.btn-download-icon,
.btn-cta-icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.btn-cta-icon svg,
.btn-download-icon svg {
  width: 100%;
  height: 100%;
}

@media (max-width: 480px) {
  header { padding: 12px 16px; }
  header .logo { width: min(230px, calc(100vw - 84px)); }
  .container { padding: 32px 16px 64px; }
  .hero { margin-bottom: 28px; }
  .hero h1 { font-size: clamp(22px, 7.2vw, 28px); line-height: 1.3; }
  .hero h1 br { display: none; }
  .hero p { font-size: 15px; }
  .card { padding: 18px; }
  .site-menu { padding: 16px; }
  .result-overall { flex-direction: column; gap: 8px; }
  .download-bar { justify-content: stretch; }
  .btn-download { flex: 1; justify-content: center; }
  .cta-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .cta-actions .btn-cta {
    justify-content: center;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
