:root {
  color-scheme: light;
  --bg: #eef2f8;
  --surface: #ffffff;
  --text: #121212;
  --muted: #6f7485;
  --accent: #021843;
  --border: #d8e2ef;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
}

.container {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding: 18px 0;
}

.brand {
  display: inline-grid;
  gap: 4px;
}

.brand-name {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.brand-tag {
  font-size: 0.95rem;
  color: var(--muted);
}

.site-nav {
  display: flex;
  gap: 24px;
  justify-content: flex-end;
  align-items: center;
}

.nav-link {
  font-size: 0.95rem;
  color: var(--muted);
  padding: 6px 0;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link.active,
.nav-link:hover {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  margin-bottom: 5px;
  background: var(--text);
  border-radius: 999px;
}

.nav-toggle span:last-child {
  margin-bottom: 0;
}

/* Hero */
.hero {
  padding: 72px 0 48px;
  text-align: center;
}

.eyebrow {
  margin: 0 auto 16px;
  color: var(--accent);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.85rem;
}

.hero h1 {
  margin: 0 auto;
  font-size: clamp(2.8rem, 4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.04em;
  max-width: 760px;
}

.hero-text {
  margin: 24px auto 0;
  max-width: 680px;
  color: var(--muted);
  font-size: 1.05rem;
}

/* Common */
.section {
  padding: 80px 0 56px;
}

h1,
h2,
h3 {
  margin: 0 0 18px;
  color: var(--text);
}

h1 + p,
h2 + p,
h3 + p,
h1 + ul,
h2 + ul,
h3 + ul {
  margin-left: 1.1rem;
}

h1 {
  font-size: clamp(2rem, 3vw, 2.8rem);
}

h2 {
  font-size: clamp(1.4rem, 2vw, 1.8rem);
}

.section h2:not(:first-of-type) {
  margin-top: 40px;
}

.plain-list {
  margin: 20px 0 0;
  padding-left: 1.2rem;
  color: var(--text);
}

.plain-list li {
  margin-bottom: 10px;
}

/* Home / Research common tags */
.interest-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 20px;
  margin-left: 1.5rem;
}

.interest-card {
  display: inline-flex;
  align-items: center;
  padding: 10px 18px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  border-radius: 999px;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.interest-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* Home - Research Direction image cards */
.direction-title {
  margin-top: 56px;
}

.direction-visual-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-top: 20px;
  margin-left: 1.5rem;
  max-width: 920px;
}

.direction-visual-card {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--border);
  background: #0f172a;
  min-height: 180px;
  max-width: 285px;
  margin: 0 auto;
  box-shadow: 0 10px 24px rgba(2, 24, 67, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.direction-visual-card img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  display: block;
  object-fit: cover;
  filter: saturate(0.92) contrast(0.95) brightness(0.82);
  transform: scale(1.01);
  transition: transform 0.18s ease;
}

.direction-visual-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(7, 12, 24, 0.82) 10%,
    rgba(7, 12, 24, 0.30) 50%,
    rgba(7, 12, 24, 0.08) 100%
  );
}

.direction-visual-content {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 2;
}

.direction-visual-num {
  display: inline-block;
  margin-bottom: 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.72);
}

.direction-visual-content h3 {
  margin: 0;
  color: #ffffff;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.direction-visual-card:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 24, 67, 0.18);
  box-shadow: 0 14px 28px rgba(2, 24, 67, 0.12);
}

.direction-visual-card:hover img {
  transform: scale(1.03);
}

/* Research page */
.research-items {
  margin-left: 1.5rem;
}

.research-items p {
  margin: 0 0 12px;
}

.research-interest-block {
  margin-top: 20px;
  margin-left: 1.5rem;
  max-width: 980px;
}

.research-line {
  margin: 0 0 16px;
  line-height: 1.9;
  color: var(--text);
  font-weight: 400;
}

.research-line strong {
  font-weight: 400;
  color: inherit;
}

.research-accent {
  color: var(--text);
  font-weight: 700;
}

.research-detail-card,
.research-direction-card {
  margin-top: 24px;
  margin-left: 1.1rem;
  max-width: 980px;
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(2, 24, 67, 0.05);
}

.research-detail-card .research-interest-block,
.research-direction-card .research-direction-block {
  margin-top: 0;
  margin-left: 0;
  max-width: none;
}

.research-detail-card .research-line:last-child,
.research-direction-line:last-child {
  margin-bottom: 0;
}

.research-direction-title {
  margin-top: 56px;
}

.research-direction-block {
  display: grid;
  gap: 16px;
}

.research-direction-line {
  margin: 0;
  line-height: 1.9;
  color: var(--text);
}

.research-direction-line strong {
  font-weight: 700;
  color: var(--text);
}

/* Research tabs */
.topic-tab {
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
}

.topic-tab.active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(2, 24, 67, 0.06);
}

.topic-tab:focus-visible {
  outline: none;
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(2, 24, 67, 0.06);
}

.interest-card:active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(2, 24, 67, 0.06);
}

.topic-panels {
  margin-top: 24px;
}

.topic-default-panel {
  margin-top: 24px;
}

.topic-default-panel.hidden {
  display: none;
}

.topic-panel {
  display: none;
}

.topic-panel.active {
  display: block;
}

.topic-intro {
  margin: 0 0 18px;
  color: var(--text);
  line-height: 1.8;
  font-weight: 600;
}

.plain-title {
  color: var(--accent);
  font-weight: 700;
}

.topic-empty {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

.publication-description {
  margin: 8px 0 0;
  color: var(--text);
  font-size: 0.95rem;
  line-height: 1.7;
}

.publication-title.no-link {
  color: var(--text);
  cursor: default;
  text-decoration: none;
}

/* Members - Professor/Students group cards */
.member-section-stack {
  display: grid;
  gap: 22px;
  margin-top: 24px;
  margin-left: 1.1rem;
  max-width: 980px;
}

.member-section-card {
  padding: 20px 22px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(2, 24, 67, 0.05);
}

.member-section-card h2 {
  margin-bottom: 18px;
}

.member-list {
  display: flex;
  flex-direction: column;
  gap: 28px;
  margin-top: 0;
}

.member-item {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.profile-photo {
  width: 120px;
  flex-shrink: 0;
  overflow: hidden;
  border-radius: 12px;
  background: #f3f6fb;
}

.profile-photo img {
  width: 120px;
  height: 156px;
  object-fit: cover;
  display: block;
}

.member-info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.member-name {
  margin: 0;
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.member-role {
  margin: 0;
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--muted);
}

.member-contact {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--muted);
}

.member-contact a {
  color: inherit;
  text-decoration: none;
}

.member-contact a:hover {
  text-decoration: underline;
}

/* Upload / preview */
.upload-panel {
  display: grid;
  gap: 18px;
  padding: 18px 0;
  border: none;
  border-radius: 0;
  background: transparent;
}

.upload-panel:hover,
.upload-panel.drag-over {
  border-color: transparent;
  background: transparent;
}

.upload-label {
  display: block;
  padding: 24px;
  border: none;
  border-radius: 0;
  text-align: center;
  color: var(--accent);
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

.upload-label:hover {
  background: rgba(15, 33, 82, 0.04);
}

.upload-panel input {
  display: block;
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
}

.upload-note {
  color: var(--muted);
  font-size: 0.95rem;
}

.image-preview-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.preview-item {
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}

.preview-item img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 10px;
}

/* News */
.news-list {
  display: grid;
  gap: 0;
  margin-top: 24px;
  margin-left: 1.1rem;
}

.news-year-group {
  margin-top: 40px;
}

.news-year-group:first-child {
  margin-top: 0;
}

.news-year-group h3 {
  margin: 0 0 16px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.news-year-group .news-item {
  margin-left: 1.1rem;
}

.news-item {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.75;
  box-shadow: 0 8px 24px rgba(2, 24, 67, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.news-item + .news-item {
  margin-top: 14px;
}

.news-item:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 24, 67, 0.14);
  box-shadow: 0 12px 28px rgba(2, 24, 67, 0.08);
}

.news-item span,
.news-date {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.news-title {
  font-weight: 500;
  line-height: 1.6;
}

.news-related {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.7;
}

/* Contact */
.address-label {
  margin-left: 1.2rem;
  color: var(--text);
  font-weight: 700;
}

.indent-text {
  margin-left: 2.4rem;
}

.contact-detail {
  color: var(--muted);
}

.map-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 24px;
}

.map-frame {
  width: 100%;
  min-height: 260px;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
}

.map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}

.contact-card-stack {
  display: grid;
  gap: 18px;
  margin-top: 24px;
  margin-left: 1.1rem;
  max-width: 980px;
}

.contact-card {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(2, 24, 67, 0.05);
}

.contact-card h2 {
  margin-bottom: 14px;
}

.contact-card h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.contact-card p {
  margin: 0 0 10px;
  line-height: 1.8;
}

.contact-card .map-grid {
  margin-top: 18px;
}

.contact-card .map-frame {
  border-radius: 14px;
}

/* Publications */
.publication-list {
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
}

.publication-item {
  padding: 18px 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(2, 24, 67, 0.05);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.publication-item:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 24, 67, 0.14);
  box-shadow: 0 12px 28px rgba(2, 24, 67, 0.08);
}

.publication-title {
  display: inline-block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--accent);
  text-decoration: none;
  line-height: 1.5;
}

.publication-title:hover {
  text-decoration: underline;
}

.publication-meta {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.7;
}

/* Optional utility grids */
.profile-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.student-grid {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.student-grid span {
  display: block;
  padding: 14px 0;
  text-align: center;
  border: 1px solid var(--border);
  color: var(--text);
  background: #ffffff;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
}

.footer-inner {
  padding: 20px 0 32px;
  color: var(--muted);
}

/* Tablet */
@media (max-width: 980px) {
  .direction-visual-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 620px;
  }
}

/* Small tablet */
@media (max-width: 840px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    position: relative;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 1px);
    left: 0;
    right: 0;
    z-index: 30;
    display: none;
    flex-direction: column;
    gap: 16px;
    padding: 20px 24px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
  }

  .site-nav.open {
    display: flex;
  }

  .nav-toggle {
    display: inline-flex;
    justify-self: end;
    align-self: center;
    flex-direction: column;
  }

  .map-grid,
  .student-grid,
  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 560px) {
  .header-inner {
    grid-template-columns: 1fr auto;
    row-gap: 0;
  }

  .hero {
    padding-top: 40px;
  }

  .interest-grid,
  .direction-visual-grid,
  .research-interest-block,
  .research-detail-card,
  .research-direction-card,
  .news-list,
  .contact-card-stack,
  .member-section-stack {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
  }

  .direction-visual-grid {
    grid-template-columns: 1fr;
    max-width: 320px;
  }

  .direction-visual-card,
  .direction-visual-card img {
    min-height: 170px;
  }

  .student-grid,
  .map-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .member-section-card,
  .research-detail-card,
  .research-direction-card {
    padding: 18px 16px;
  }

  .member-item {
    flex-direction: column;
    align-items: center;
    gap: 18px;
    text-align: center;
  }

  .profile-photo {
    width: 132px;
    margin: 0 auto;
  }

  .profile-photo img {
    width: 132px;
    height: 170px;
  }

  .member-info {
    width: 100%;
    padding-top: 0;
    align-items: center;
    gap: 6px;
  }

  .research-line,
  .research-direction-line {
    line-height: 1.7;
  }

  .interest-card {
    font-size: 0.88rem;
    padding: 9px 14px;
  }

  .news-year-group .news-item {
    margin-left: 0;
  }

  .news-item,
  .publication-item {
    padding: 16px 16px;
    border-radius: 14px;
  }

  .contact-card {
    padding: 16px 16px;
    border-radius: 14px;
  }
}

@media (max-width: 560px) {
  .research-detail-card,
  .research-direction-card {
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    padding: 18px 16px;
  }
}

/* ===== Gallery ===== */
.gallery-page-head {
  margin-bottom: 32px;
}

.gallery-intro {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.8;
}

.gallery-year-section {
  margin-top: 48px;
  max-width: 760px;
}

.gallery-year-title {
  margin: 0 0 20px;
  padding-bottom: 12px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  border-bottom: 2px solid var(--border);
}

/* Album card */
.gallery-album {
  margin-bottom: 20px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 8px 24px rgba(2, 24, 67, 0.05);
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gallery-album:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 24, 67, 0.14);
  box-shadow: 0 12px 28px rgba(2, 24, 67, 0.08);
}

.gallery-album summary {
  list-style: none;
  cursor: pointer;
  padding: 24px 24px 20px;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.gallery-album summary::-webkit-details-marker {
  display: none;
}

.gallery-album-summary {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

/* Header row: title block + toggle arrow */
.gallery-album-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.gallery-album-date {
  margin: 0;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.gallery-album-info h3 {
  margin: 6px 0 8px;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  line-height: 1.4;
}

.gallery-album-desc {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Toggle arrow */
.gallery-album-toggle {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
  background: #ffffff;
  transition: transform 0.25s ease, background 0.2s ease;
}

.gallery-album-toggle::before {
  content: "";
  width: 7px;
  height: 7px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform 0.25s ease;
}

.gallery-album[open] .gallery-album-toggle {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.gallery-album[open] .gallery-album-toggle::before {
  transform: translateY(2px) rotate(-135deg);
}

/* Cover photo - preserves aspect ratio, no cropping */
.gallery-album-cover {
  overflow: hidden;
  border-radius: 12px;
  background: #f3f6fb;
}

.gallery-album-cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #ffffff;
}

/* Hide cover completely when expanded */
.gallery-album[open] .gallery-album-cover {
  display: none;
}

/* Photo list when expanded */
.gallery-album-body {
  padding: 4px 24px 24px;
  border-top: 1px solid var(--border);
}

.gallery-album-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding-top: 20px;
}

.gallery-photo-card {
  display: block;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 14px rgba(2, 24, 67, 0.04);
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.gallery-photo-card:hover {
  transform: translateY(-2px);
  border-color: rgba(2, 24, 67, 0.14);
  box-shadow: 0 10px 22px rgba(2, 24, 67, 0.08);
}

.gallery-photo-card img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #ffffff;
}

/* Responsive */
@media (max-width: 560px) {
  .gallery-intro,
  .gallery-year-section {
    margin-left: 0.25rem;
    margin-right: 0.25rem;
  }

  .gallery-album summary {
    padding: 20px 18px 18px;
  }

  .gallery-album-body {
    padding: 4px 18px 20px;
  }

  .gallery-album-info h3 {
    font-size: 1.08rem;
  }

  .gallery-album-cover img {
    max-height: 360px;
  }
}
