:root {
  --bg: #ffffff;
  --band: #faf8f3;
  --text: #171717;
  --muted: #707070;
  --line: #ece9e2;
  --accent: #1f6f5f;
  --page-width: 1280px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    "PingFang SC",
    "Hiragino Sans GB",
    "Noto Sans CJK SC",
    "Microsoft YaHei",
    "Helvetica Neue",
    Arial,
    sans-serif;
  font-weight: 300;
  overflow: hidden;
}

.subpage-body {
  overflow: auto;
}

.academic-body {
  background: #cccccc;
}

.brand,
.nav-card,
.top-nav a {
  color: inherit;
  text-decoration: none;
}

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

.home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.home-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.lang-switch {
  display: flex;
  gap: 10px;
}

.lang-button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.lang-button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(31, 111, 95, 0.03);
}

h1,
p {
  margin-top: 0;
}

.home-screen {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.top-band {
  background: var(--band);
  border-bottom: 1px solid var(--line);
}

.home-topbar {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 0 22px;
  flex-wrap: wrap;
}

.top-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
}

.top-nav a:hover {
  color: var(--accent);
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 1px;
  background: transparent;
  transition: background 180ms ease;
}

.top-nav a:hover::after {
  background: var(--accent);
}

.top-nav a.is-current {
  color: var(--accent);
}

.top-nav a.is-current::after {
  background: var(--accent);
}

.home-band {
  padding-top: 56px;
}

.home-container {
  padding-top: 44px;
  padding-bottom: 44px;
}

.home-hero {
  display: grid;
  gap: 18px;
  align-content: center;
  max-width: 1120px;
  margin-bottom: 22px;
}

html[lang="en"] .home-hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: -0.04em;
}

.home-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1120px;
}

.home-list-item {
  display: grid;
  gap: 6px;
  padding: 18px 0 20px;
  border-top: 1px solid #ddd7ca;
  text-decoration: none;
  color: #111111;
}

.home-list-item:last-child {
  border-bottom: 1px solid #ddd7ca;
}

.home-list-item:hover {
  border-top-color: #c7c0b3;
}

.home-list-item:hover + .home-list-item {
  border-top-color: #c7c0b3;
}

.home-list-title {
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    "Times New Roman",
    serif;
  font-size: 1.48rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.home-list-note {
  color: #6a6a6a;
  font-size: 0.95rem;
  line-height: 1.8;
}

.page-band {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 64px;
}

.page-shell {
  display: grid;
  gap: 40px;
}

.page-hero {
  display: grid;
  gap: 14px;
  width: 100%;
}

.page-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.page-intro {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.85;
}

.academic-top-band {
  background: transparent;
  border-bottom: 0;
}

.academic-topbar {
  background: #ffffff;
  padding-left: 24px;
  padding-right: 24px;
  border-bottom: 1px solid var(--line);
}

.page-index-bar {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  background: #ffffff;
  padding: 0 24px 14px;
}

.page-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #666666;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
}

.page-index a {
  color: #1f6f5f;
  text-decoration: none;
}

.page-index a:hover {
  text-decoration: underline;
}

.academic-band {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 48px;
}

.academic-container {
  background: #ffffff;
  padding: 36px 40px 56px;
}

.academic-header {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.academic-intro {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.85;
}

.academic-header h1 {
  font-family: "Times New Roman", Times, serif;
  font-size: 2.1rem;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0;
}

.academic-section {
  margin-top: 26px;
}

.academic-section-title {
  margin: 0 0 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #111111;
}

.academic-rule {
  width: 100%;
  height: 1px;
  background: #1f6f5f;
  margin-bottom: 16px;
}

.academic-content {
  width: 100%;
}

.academic-content p {
  margin: 0 0 10px;
  color: #222222;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.75;
  max-width: none;
}

.publication-list-plain p {
  margin-bottom: 12px;
}

.contact-list-plain a {
  color: #1f6f5f;
  text-decoration: none;
}

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

.contact-item {
  margin-bottom: 18px;
}

.contact-item:last-child {
  margin-bottom: 0;
}

.contact-item-label {
  margin: 0 0 4px;
  color: #222222;
  font-weight: 700;
}

.contact-item-value {
  margin: 0;
}

.writing-container {
  padding-bottom: 44px;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 6px;
}

.writing-card {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  text-decoration: none;
  color: #111111;
  background-color: #ffffff;
  background-size: 72%;
  background-repeat: no-repeat;
  background-position: center;
  border: 1px solid var(--line);
}

.visual-card {
  background-image: url("./assets/camera.png");
}

.text-card {
  background-image: url("./assets/paperpen.png");
}

.side-card {
  background-image: url("./assets/trophy.png");
}

.writing-card-shade {
  position: absolute;
  inset: 0;
  background: transparent;
}

.writing-card-title {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 1;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.28rem;
  font-weight: 400;
  letter-spacing: 0.03em;
  line-height: 1.25;
  color: #111111;
  text-shadow: none;
  text-align: center;
  width: calc(100% - 32px);
}

html[lang="en"] .writing-card-title {
  font-family:
    "Iowan Old Style",
    "Palatino Linotype",
    "Book Antiqua",
    Georgia,
    serif;
  font-weight: 400;
  letter-spacing: 0.04em;
}

.writing-card:hover .writing-card-shade {
  opacity: 1;
}

.text-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.text-article-list {
  display: grid;
  gap: 0;
}

.text-article-entry {
  display: grid;
  gap: 10px;
  padding: 18px 0 22px;
  border-top: 1px solid #e6e1d6;
  text-decoration: none;
  color: #111111;
}

.text-article-entry:last-child {
  border-bottom: 1px solid #e6e1d6;
}

.text-article-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.text-article-entry-title {
  margin: 0;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 1.45;
}

.text-entry-purpose {
  margin: 0;
  color: #8b847a;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.9rem;
  line-height: 1.75;
}

.text-article-entry-intro {
  margin: 0;
  color: #5a5a5a;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.75;
  max-width: none;
}

.text-language-note[hidden] {
  display: none;
}

.text-language-note {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(79, 107, 85, 0.18);
  color: #4f6b55;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.92rem;
  line-height: 1.8;
  max-width: none;
  width: 100%;
}

.text-article-body {
  max-width: none;
}

.markdown-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.markdown-layout.is-no-toc {
  grid-template-columns: minmax(0, 1fr);
}

.markdown-toc-shell[hidden] {
  display: none;
}

.markdown-toc-shell {
  position: sticky;
  top: 28px;
}

.markdown-toc {
  padding-top: 4px;
}

.markdown-toc-title {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: "Times New Roman", Times, serif;
  font-size: 0.98rem;
  font-weight: 700;
  line-height: 1.4;
}

.markdown-toc-list {
  display: grid;
  gap: 8px;
}

.markdown-toc-link {
  color: var(--accent);
  text-decoration: none;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.95rem;
  line-height: 1.5;
}

.markdown-toc-link:hover {
  color: #174f44;
  text-decoration: underline;
}

.markdown-toc-link.is-sub {
  padding-left: 14px;
  font-size: 0.9rem;
}

.markdown-body {
  color: #1c1c1c;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.04rem;
  line-height: 1.9;
}

.markdown-body.is-plain-text {
  max-width: none;
  width: 100%;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.7em 0 0.55em;
  font-family: "Times New Roman", Times, serif;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 1.9rem;
}

.markdown-body h2 {
  font-size: 1.48rem;
}

.markdown-body h3 {
  font-size: 1.22rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body blockquote,
.markdown-body pre {
  margin: 0 0 1em;
}

.markdown-body ul {
  padding-left: 1.4em;
}

.markdown-body li {
  margin-bottom: 0.45em;
}

.markdown-body blockquote {
  padding-left: 1em;
  border-left: 2px solid #d8d2c6;
  color: #5f5a52;
}

.markdown-body code {
  padding: 0.08em 0.34em;
  background: #f6f3ed;
  border: 1px solid #ece6da;
  font-family: "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  padding: 16px 18px;
  overflow: auto;
  background: #f8f5ef;
  border: 1px solid #ece6da;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  border: none;
}

.markdown-body a {
  color: #1f6f5f;
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-inline-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.1em auto 1.3em;
}

.research-markdown-body h1 {
  margin: 2.8em 0 1em;
  padding-top: 1.15em;
  border-top: 2px solid #111111;
  font-size: 1.72rem;
  font-weight: 700;
}

.research-markdown-body {
  width: 100%;
  max-width: none;
}

.research-markdown-body h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.research-markdown-body h2 {
  margin: 1.2em 0 0.85em;
  padding-bottom: 0.42em;
  border-bottom: 1px solid #111111;
  font-size: 1.2rem;
  font-weight: 700;
}

.research-markdown-body h1 + h2 {
  margin-top: 0.7em;
}

.research-markdown-body h3,
.research-markdown-body h4,
.research-markdown-body h5,
.research-markdown-body h6 {
  margin-top: 1.2em;
}

.research-markdown-body p,
.research-markdown-body ul,
.research-markdown-body blockquote,
.research-markdown-body pre {
  max-width: none;
}

.research-markdown-body p,
.research-markdown-body ul {
  color: #2b2b2b;
}

.research-markdown-body blockquote {
  margin: 1em 0 1.7em;
  padding: 0.9em 1.1em;
  border-left: 2px solid #111111;
  background: #f7f5ef;
  color: #2b2b2b;
}

.research-markdown-body blockquote p {
  margin: 0;
}

.research-markdown-body blockquote strong {
  color: #111111;
}

.visual-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.visual-featured-entry {
  width: 100%;
  margin: 28px auto 0;
}

.visual-featured-grid {
  grid-template-columns: 1fr;
  gap: 34px;
}

.visual-featured-grid .visual-single-card {
  grid-column: 1 / -1;
  gap: 12px;
}

.visual-featured-grid .visual-thumb {
  aspect-ratio: auto !important;
  height: auto;
  background: transparent;
  border: none;
  overflow: visible;
}

.visual-featured-grid .visual-thumb-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.visual-subgrid .academic-section {
  margin-top: 0;
}

.visual-mode-grid {
  margin-top: 8px;
}

.visual-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px 20px;
  width: 100%;
  max-width: none;
  align-items: start;
}

.visual-gallery-grid[data-gallery-kind="collection"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-masonry-grid {
  display: block;
  column-width: 300px;
  column-gap: 22px;
  width: 100%;
  max-width: none;
}

.visual-entry-card,
.visual-single-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.visual-masonry-grid .visual-single-card {
  break-inside: avoid;
  margin: 0 0 30px;
}

[data-gallery-kind="collection"] .visual-entry-card {
  align-content: start;
}

.visual-single-card .visual-thumb {
  background: transparent;
  border: none;
  overflow: visible;
}

.visual-thumb {
  position: relative;
  width: 100%;
  background: #f8f7f3;
  border: 1px solid #ddd7ca;
  overflow: hidden;
}

[data-gallery-kind="collection"] .visual-thumb {
  aspect-ratio: 3 / 2;
}

.visual-thumb-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #f8f7f3;
}

.visual-single-card .visual-thumb-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fbfaf7;
}

.film-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 7px;
  border: 1px solid #d0c8bb;
  background: rgba(255, 255, 255, 0.84);
  color: #655f55;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.visual-entry-meta,
.visual-caption-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 2px;
  border-bottom: 1px solid #ece6da;
}

.visual-entry-title {
  margin: 0;
  color: #111111;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.45;
}

.visual-entry-action {
  color: #6a645b;
  text-decoration: none;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.88rem;
  white-space: nowrap;
}

.visual-entry-action:hover {
  color: #1f6f5f;
  text-decoration: underline;
}

.visual-entry-text {
  margin: 0;
  color: #555555;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: none;
}

.visual-caption {
  display: grid;
  gap: 10px;
}

.visual-page-tip {
  margin: 0 0 22px;
  color: #6f685d;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.94rem;
  line-height: 1.75;
}

.visual-page-tip strong {
  font-weight: 400;
  color: #4d473f;
}

.visual-thumb-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.visual-thumb-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: #6f685d;
  font-family: "Times New Roman", Times, serif;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.work-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.work-field-card {
  display: block;
  border: 1px solid var(--line);
  padding: 22px 20px 20px;
  text-decoration: none;
  color: #111111;
  background: #ffffff;
}

.work-field-card:hover {
  border-color: #d8d2c6;
}

.work-field-card h3 {
  margin: 0 0 10px;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: #111111;
}

.work-field-card p {
  margin: 0;
  color: #555555;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.75;
}

.field-entry {
  margin-bottom: 18px;
}

.field-entry:last-child {
  margin-bottom: 0;
}

.field-entry-title {
  margin: 0 0 6px;
  color: #111111;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.02rem;
  line-height: 1.7;
}

.field-entry-summary {
  margin: 0;
  color: #555555;
  font-family: "Times New Roman", Times, serif;
  font-size: 1rem;
  line-height: 1.75;
}

.inline-page-link {
  color: #1f6f5f;
  text-decoration: none;
}

.inline-page-link:hover {
  text-decoration: underline;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .home-screen {
    min-height: auto;
  }

  .hero-band {
    padding: 44px 0 28px;
  }

  .academic-container {
    padding: 28px 28px 40px;
  }

  .writing-grid {
    grid-template-columns: 1fr;
  }

  .text-topic-grid {
    grid-template-columns: 1fr;
  }

  .markdown-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .markdown-toc-shell {
    position: static;
  }

  .visual-subgrid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .visual-gallery-grid,
  .visual-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .visual-masonry-grid {
    column-width: 240px;
  }

  .visual-gallery-grid[data-gallery-kind="collection"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-field-grid {
    grid-template-columns: 1fr;
  }

  .home-band {
    padding-top: 28px;
  }

  .home-container {
    padding-top: 28px;
    padding-bottom: 30px;
  }
}

@media (max-width: 640px) {
  .visual-gallery-grid {
    grid-template-columns: 1fr;
  }

  .visual-masonry-grid {
    column-count: 1;
    column-width: auto;
  }

  .hero-band,
  .home-topbar,
  .page-band {
    width: min(100% - 20px, 1080px);
  }

  .home-topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 18px;
    padding: 18px 0 16px;
  }

  .top-nav {
    gap: 12px 18px;
  }

  .top-nav a::after {
    bottom: -4px;
  }

  .home-hero {
    gap: 14px;
  }

  .hero-band {
    padding: 28px 0 24px;
  }

  .page-band {
    padding: 24px 0 32px;
  }

  .page-shell {
    gap: 28px;
  }

  .academic-topbar {
    padding-left: 0;
    padding-right: 0;
  }

  .page-index-bar {
    width: min(100% - 20px, 1080px);
    padding: 0 0 12px;
  }

  .academic-container {
    padding: 22px 16px 30px;
  }

  .academic-section-title {
    font-size: 1.2rem;
  }

  .academic-content p {
    line-height: 1.8;
  }

  .writing-grid {
    gap: 14px;
  }

  .writing-card-title {
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    font-size: 1.32rem;
  }
}
