/* ================= 共通スタイル ================= */
:root {
  --fg: #1f2328;
  --muted: #59636e;
  --accent: #0b5cad;
  --bg: #ffffff;
  --bg-sub: #f6f8fa;
  --border: #d1d9e0;
}
@media (prefers-color-scheme: dark) {
  :root {
    --fg: #e6edf3;
    --muted: #9198a1;
    --accent: #58a6ff;
    --bg: #0d1117;
    --bg-sub: #161b22;
    --border: #30363d;
  }
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: "Helvetica Neue", Arial, "Hiragino Sans", "Noto Sans JP", Meiryo, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.7;
}
a { color: var(--accent); }

/* ---------- Header ---------- */
header {
  background: var(--bg-sub);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.profile-photo {
  width: 140px;
  height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid var(--border);
  flex-shrink: 0;
}
.name-ja { font-size: 2rem; font-weight: 700; margin: 0; }
.name-en { font-size: 1.15rem; color: var(--muted); margin: 0 0 8px; }
.affiliation { margin: 0; color: var(--muted); }

/* ---------- Navigation ---------- */
nav {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
}
nav a {
  padding: 8px 16px;
  text-decoration: none;
  color: var(--muted);
  border-bottom: 3px solid transparent;
  font-weight: 600;
}
nav a:hover { color: var(--fg); }
nav a.active { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 600px) {
  .header-inner { flex-direction: column; text-align: center; }
  nav { justify-content: center; }
}

/* ---------- Main ---------- */
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
h2 {
  font-size: 1.5rem;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 4px;
  margin-top: 40px;
}
main > h2:first-child { margin-top: 8px; }

/* ---------- About page ---------- */
dl.profile-table {
  display: grid;
  grid-template-columns: 8em 1fr;
  gap: 6px 16px;
  margin: 0;
}
dl.profile-table dt { font-weight: 600; color: var(--muted); }
dl.profile-table dd { margin: 0; }
ul.timeline { list-style: none; padding: 0; margin: 0; }
ul.timeline li { display: grid; grid-template-columns: 8em 1fr; gap: 16px; padding: 4px 0; }
ul.timeline .when { color: var(--muted); }
@media (max-width: 600px) {
  dl.profile-table, ul.timeline li { grid-template-columns: 1fr; gap: 0 0; }
  ul.timeline li { padding: 6px 0; }
}

/* ---------- Publications page ---------- */
details.pub-section {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 12px;
  background: var(--bg);
}
details.pub-section > summary {
  list-style: none;              /* 既定の三角を消す */
  cursor: pointer;
  padding: 10px 16px;
  font-size: 1.1rem;
  font-weight: 700;
  background: var(--bg-sub);
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 10px;
  user-select: none;
}
details.pub-section > summary::-webkit-details-marker { display: none; }
details.pub-section > summary::before {
  content: "";
  width: 0; height: 0;
  border-left: 7px solid var(--muted);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform 0.15s;
}
details.pub-section[open] > summary::before { transform: rotate(90deg); }
details.pub-section[open] > summary { border-radius: 8px 8px 0 0; border-bottom: 1px solid var(--border); }
summary .count { color: var(--muted); font-weight: 400; font-size: 0.95rem; }

ol.pub-list { padding: 12px 16px 4px 3em; margin: 0; }
ol.pub-list li { margin-bottom: 10px; }
.me { font-weight: 700; text-decoration: underline; }
.pub-title { font-weight: 600; }
.pub-venue { font-style: italic; }
.status { color: var(--muted); }
.error { color: #cf222e; }

footer {
  text-align: center;
  color: var(--muted);
  font-size: 0.85rem;
  padding: 24px 16px;
  border-top: 1px solid var(--border);
}
