@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&family=Zen+Kaku+Gothic+New:wght@400;500;700&display=swap');

:root {
  --primary: #e08ea8;
  --primary-hover: #d47a96;
  --primary-light: #f7e6ec;
  --secondary: #9b8ec4;
  --secondary-hover: #8a7bb7;
  --secondary-light: #e8e4f0;
  --accent: #f5c3c3;
  --accent-light: #fce8e8;
  --bg: #faf8f7;
  --card: #ffffff;
  --text: #4a3a3a;
  --text-light: #8a7a7a;
  --muted: #b0a0a0;
  --border: #ece4e4;
  --shadow: 0 2px 8px rgba(120, 80, 80, 0.06);
  --shadow-hover: 0 4px 16px rgba(120, 80, 80, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, 'Hiragino Maru Gothic Pro', 'Yu Gothic', sans-serif;
  --font-heading: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
}

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  margin: 0;
  padding: 0;
  line-height: 1.8;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--text);
  font-weight: 600;
  margin: 0 0 0.65rem;
  line-height: 1.4;
}

h1 { font-size: 1.55rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
h4 { font-size: 0.95rem; }

p { margin: 0 0 0.65rem; line-height: 1.8; }
small { font-size: 0.82rem; }

/* ── Header ── */
header {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.6rem 1rem;
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
}

header nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.2rem;
}

header nav ul li strong a.logo {
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}
.logo-mark {
  width: 28px;
  height: 28px;
  display: block;
}

header nav ul li a {
  color: var(--text-light);
  text-decoration: none;
  padding: 0.35rem 0.7rem;
  border-radius: 20px;
  font-size: 0.82rem;
  font-weight: 500;
  transition: background 0.2s, color 0.2s;
}

header nav ul li a:hover {
  background: var(--primary-light);
  color: var(--primary);
}

header nav ul li a.active {
  background: var(--primary);
  color: #fff;
}

/* ── Layout ── */
main.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
  min-height: 55vh;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover { color: var(--primary-hover); }

/* ── Article / Card ── */
article {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
article:hover { box-shadow: var(--shadow-hover); }

/* ── Buttons ── */
button, [role="button"], input[type="submit"], .btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 0.55rem 1.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  line-height: 1.4;
}
button:hover, [role="button"]:hover, input[type="submit"]:hover, .btn:hover {
  background: var(--primary-hover);
  color: #fff;
  transform: translateY(-1px);
}

button.secondary, [role="button"].secondary, .btn.secondary {
  background: var(--secondary);
}
button.secondary:hover, [role="button"].secondary:hover, .btn.secondary:hover {
  background: var(--secondary-hover);
}

button.outline, [role="button"].outline, .btn.outline {
  background: transparent;
  border: 2px solid var(--primary);
  color: var(--primary);
}
button.outline:hover, [role="button"].outline:hover, .btn.outline:hover {
  background: var(--primary-light);
  color: var(--primary-hover);
  transform: none;
}

button.small, [role="button"].small, .btn.small {
  font-size: 0.78rem;
  padding: 0.3rem 1rem;
  border-radius: 16px;
}

/* ── Grid ── */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.grid > * { min-width: 0; }

/* ── Form ── */
input, select, textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font);
  background: var(--card);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}

label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.3rem;
  display: block;
}

/* ── Table ── */
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
table th, table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
}
table th {
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
}
table thead th {
  background: var(--bg);
  border-bottom: 2px solid var(--border);
}
table tbody tr:hover { background: #faf5f5; }

/* ── Hero ── */
.hero {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: linear-gradient(135deg, #fce8e8, #f7e6ec, #e8e4f0);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 160px; height: 160px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
}
.hero::after {
  content: '';
  position: absolute;
  bottom: -30px; left: -30px;
  width: 100px; height: 100px;
  border-radius: 50%;
  background: rgba(155,142,196,0.15);
}
.hero h1 {
  font-size: 1.7rem;
  margin-bottom: 0.5rem;
  color: var(--text);
  position: relative;
}
.hero-sub {
  font-size: 0.95rem;
  color: var(--text-light);
  margin-bottom: 1.25rem;
  line-height: 1.6;
  position: relative;
}
.hero .btn-group {
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  position: relative;
}

/* ── Features ── */
.features { margin-top: 1.5rem; }
.features article {
  text-align: center;
  padding: 1.5rem 1.25rem;
  border-top: 3px solid transparent;
}
.features article:nth-child(1) { border-top-color: var(--primary); }
.features article:nth-child(2) { border-top-color: var(--secondary); }
.features article:nth-child(3) { border-top-color: var(--accent); }
.features article h3 {
  color: var(--text);
  font-size: 1rem;
  margin-bottom: 0.4rem;
}
.features article p {
  color: var(--text-light);
  font-size: 0.88rem;
  line-height: 1.7;
}

/* ── Recent-card ── */
.recent-card {
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.5rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--secondary);
  transition: transform 0.15s, box-shadow 0.2s;
}
.recent-card:hover {
  transform: translateX(3px);
  box-shadow: var(--shadow);
}
.recent-card small { color: var(--muted); font-size: 0.78rem; }
.recent-card p { margin: 0.2rem 0 0; color: var(--text-light); font-size: 0.85rem; }

/* ── Result ── */
.result-card { text-align: center; }
.result-category { font-size: 1rem; color: var(--muted); margin-bottom: 1.25rem; }
.result-text {
  text-align: left;
  background: var(--bg);
  padding: 1.25rem;
  border-radius: var(--radius);
  line-height: 1.9;
  white-space: pre-wrap;
  margin-bottom: 1rem;
  font-size: 0.9rem;
  border: 1px solid var(--border);
}

/* ── Notice / Flash ── */
.notice {
  background: var(--secondary-light);
  border: 1px solid var(--secondary);
}
.notice h3, .notice h4 { color: var(--secondary); }

.flash-message {
  background: #fce8e8;
  border: 1px solid #f5c3c3;
  color: #d47a96;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
}
.error-messages {
  background: #fff0f0;
  border: 1px solid #f0ccc4;
  color: #c0392b;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.85rem;
  font-size: 0.85rem;
}

/* ── Stats ── */
.stat-card { text-align: center; padding: 0.8rem; }
.stat-card h3 { font-size: 0.82rem; color: var(--muted); margin-bottom: 0.3rem; }
.stat-number { font-size: 1.7rem; font-weight: 700; color: var(--primary); }

/* ── Heatmap ── */
.heatmap {
  width: 100%;
  border-collapse: collapse;
}
.heatmap th, .heatmap td {
  text-align: center;
  padding: 0.4rem 0.3rem;
  border: 1px solid var(--border);
  font-size: 0.8rem;
}
.heatmap th {
  background: var(--bg);
  font-weight: 600;
  color: var(--text-light);
  font-size: 0.75rem;
}
.heatmap td:first-child { font-weight: 600; color: var(--text); background: var(--bg); }
.heat-0 { background: #fff; }
.heat-1 { background: #f7e6ec; }
.heat-2 { background: #f0d0dc; }
.heat-3 { background: #e8b5c8; color: #fff; }
.heat-4 { background: #d490aa; color: #fff; }
.heat-5 { background: #c0708a; color: #fff; }

/* ── Footer ── */
footer {
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 2rem 0 1.5rem;
}
footer .footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}
footer h4 {
  font-family: var(--font-heading);
  font-size: 0.9rem;
  color: var(--text);
  margin-bottom: 0.5rem;
}
footer p { font-size: 0.8rem; color: var(--muted); line-height: 1.7; }
footer ul { list-style: none; padding: 0; margin: 0; }
footer ul li { margin-bottom: 0.35rem; }
footer ul li a {
  color: var(--text-light);
  text-decoration: none;
  font-size: 0.8rem;
  transition: color 0.2s;
}
footer ul li a:hover { color: var(--primary); }
footer hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 0;
}

/* ── Utilities ── */
.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ── Pagination ── */
.pagination ul {
  display: flex;
  gap: 0.35rem;
  list-style: none;
  padding: 0;
  justify-content: center;
  margin: 1.25rem 0;
}
.pagination ul li a {
  display: block;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  text-decoration: none;
  color: var(--text);
  font-size: 0.8rem;
  transition: border-color 0.2s, background 0.2s;
}
.pagination ul li a:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.pagination ul li a.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ── Section heading ── */
.section-title {
  font-size: 1.15rem;
  padding-left: 0.6rem;
  border-left: 3px solid var(--primary);
  margin-bottom: 0.75rem;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  header nav {
    flex-direction: column;
    gap: 0.3rem;
  }
  header nav ul { flex-wrap: wrap; justify-content: center; }
  .hero { padding: 1.5rem 1rem; }
  .hero h1 { font-size: 1.35rem; }
  .grid { grid-template-columns: 1fr; }
  article { padding: 1rem; }
  main.container { padding: 1rem 0.75rem; }
}
