:root {
  --bg: #ffffd3;
  --hero-bg: #fff176;
  --paper: #fcfae3;
  --card: #ffffff;
  --text: #38392a;
  --muted: #656464;
  --ink: #656464;
  --accent: #6f6600;
  --highlight: #fcee73;
  --line-soft: #bbbaa6;
  --hero-dash: rgba(101, 100, 100, 0.42);
  --top-nav-height: 42px;
  color-scheme: light;
}

html {
  scroll-padding-top: calc(var(--top-nav-height) + 10px);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Segoe UI", Arial, sans-serif;
  line-height: 1.6;
  position: relative;
  scroll-behavior: smooth;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.12;
  background-image: radial-gradient(var(--text) 0.5px, transparent 0.5px);
  background-size: 12px 12px;
}

.top-hero {
  background: var(--hero-bg);
  border-bottom: none;
  padding: 0 20px 0;
}

.top-nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  min-height: var(--top-nav-height);
  max-width: none;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 18px;
  background: transparent;
  border-bottom: 1px dashed transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background-color 0.28s ease, box-shadow 0.28s ease, border-color 0.28s ease,
    backdrop-filter 0.28s ease;
}

body:not(.is-past-hero) .top-nav {
  background-color: transparent;
  border-bottom-color: transparent;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

body.is-past-hero .top-nav {
  background: rgba(255, 253, 231, 0.55);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px dashed var(--hero-dash);
  box-shadow: 0 6px 22px rgba(56, 57, 42, 0.06);
}

.top-nav-brand {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.95rem;
  font-weight: 300;
  letter-spacing: 0.12em;
  color: var(--accent);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
  white-space: nowrap;
}

body.is-past-hero .top-nav-brand {
  opacity: 1;
  visibility: visible;
}

.left-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.78rem;
}

.left-nav a {
  text-decoration: none;
  font-weight: 400;
  color: var(--text);
  border-bottom: 1px solid transparent;
}

.left-nav a:hover {
  border-bottom-color: rgba(101, 100, 100, 0.45);
}

.language-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.lang-btn {
  border: 1px solid rgba(101, 100, 100, 0.38);
  border-radius: 999px;
  background: rgba(255, 253, 231, 0.35);
  color: var(--text);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 300;
  cursor: pointer;
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.lang-btn.is-active {
  background: rgba(252, 238, 115, 0.55);
  color: #605800;
  border-color: rgba(111, 102, 0, 0.45);
}

body:not(.is-past-hero) .lang-btn {
  background-color: transparent;
}

body:not(.is-past-hero) .lang-btn.is-active {
  background: rgba(252, 238, 115, 0.32);
  border-color: rgba(101, 100, 100, 0.32);
}

.hero-content {
  width: calc(100% + 40px);
  margin: 0 -20px 0;
  position: relative;
  z-index: 1;
}

.hero-visual {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 6.8;
  min-height: 300px;
  max-height: 620px;
  display: block;
  padding: clamp(14px, 2.2vw, 24px);
  border-top: 1px dashed var(--hero-dash);
  border-bottom: 1px dashed var(--hero-dash);
  background-image: linear-gradient(to top, rgba(255, 255, 211, 0.3), rgba(255, 255, 211, 0.08)),
    url("./assets/page_top.png");
  background-image: linear-gradient(to top, rgba(255, 255, 211, 0.3), rgba(255, 255, 211, 0.08)),
    image-set(url("./assets/page_top.webp") type("image/webp"), url("./assets/page_top.png") type("image/png"));
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  filter: saturate(0.88);
  overflow: hidden;
}

.site-slogan {
  position: absolute;
  left: 50%;
  top: 79%;
  transform: translate(-50%, -50%);
  margin: 0;
  width: min(90%, 760px);
  text-align: center;
  font-size: clamp(1.05rem, 2.2vw, 1.72rem);
  color: #fffde7;
  font-weight: 300;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 6px rgba(56, 57, 42, 0.42);
}

.site-subline {
  position: absolute;
  right: clamp(10px, 2.2vw, 24px);
  bottom: clamp(4px, 1.2vw, 10px);
  margin: 0;
  max-width: min(68%, 680px);
  color: #fffde7;
  font-size: clamp(0.68rem, 1.15vw, 0.84rem);
  line-height: 1.4;
  text-align: right;
  text-shadow: 0 2px 6px rgba(56, 57, 42, 0.42);
}

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 24px 20px 40px;
  position: relative;
  z-index: 1;
  font-size: 0.875rem;
}

.section {
  margin-top: 22px;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px 14px 20px 12px / 12px 24px 14px 18px;
  padding: 20px;
  box-shadow: 4px 4px 0 rgba(56, 57, 42, 0.1);
  scroll-margin-top: calc(var(--top-nav-height) + 12px);
}

.section h2 {
  margin-top: 0;
  margin-bottom: 14px;
  font-size: 1.125rem;
  color: var(--accent);
  letter-spacing: 0.2px;
}

.section.intro {
  position: relative;
}

.intro-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(88px, 104px);
  gap: 12px 16px;
  align-items: start;
}

.intro-copy p {
  margin: 0;
  white-space: pre-line;
}

.intro-copy p + p {
  margin-top: 12px;
}

.intro-qr {
  margin: 0;
  width: 100%;
  max-width: 104px;
  justify-self: end;
  text-align: center;
}

.intro-qr img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: #fff;
}

.intro-qr figcaption {
  margin-top: 6px;
  font-size: 0.68rem;
  line-height: 1.35;
  color: var(--muted);
}

@media (max-width: 560px) {
  .intro-main {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .intro-qr {
    justify-self: center;
    max-width: 120px;
    margin-top: 4px;
  }
}

.about-text p[data-i18n="aboutText"] {
  white-space: pre-line;
  line-height: 1.75;
}

.project-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.project-item {
  display: grid;
  grid-template-columns: minmax(240px, 34%) 1fr;
  gap: 28px;
  align-items: center;
  border: 2px dashed var(--ink);
  border-radius: 14px;
  background: #ffffff;
  padding: 24px;
}

.project-image-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid var(--line-soft);
}

.project-image-link img {
  width: 100%;
  height: 100%;
  min-height: 150px;
  object-fit: cover;
  display: block;
}

.project-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
}

.project-copy h3 {
  margin: 0 0 8px;
  font-size: 0.92rem;
  color: var(--text);
}

.project-copy p {
  margin: 0;
  color: var(--muted);
}

.arch-layout,
.about-layout {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 16px;
}

.arch-layout {
  align-items: start;
}

.about-layout {
  align-items: center;
}

.arch-layout-single {
  grid-template-columns: 1fr;
  gap: 14px;
}

.architecture-figure-wrap {
  width: 50%;
  margin: 0 auto;
  border: 2px dashed var(--ink);
  border-radius: 12px;
  background: transparent;
  padding: 0;
  overflow: hidden;
}

.architecture-image-trigger {
  display: block;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
}

.architecture-image {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  object-fit: contain;
  border-radius: 0;
  border: 0;
  background: transparent;
}

.architecture-image.is-missing {
  min-height: 260px;
  border: 2px dashed var(--ink);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.image-lightbox[hidden] {
  display: none;
}

.lightbox-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: zoom-out;
}

.lightbox-image {
  position: relative;
  z-index: 1;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
  width: auto;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.lightbox-content {
  position: relative;
  z-index: 1;
  width: fit-content;
  max-width: min(96vw, 1400px);
  max-height: 92vh;
}

.lightbox-x {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.arch-text {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.placeholder-box {
  min-height: 220px;
  border: 2px dashed var(--ink);
  background: var(--hero-bg);
  border-radius: 12px;
}

.about-photo-wrap {
  border: 2px dashed var(--ink);
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  min-height: 160px;
}

.about-photo-img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 160px;
  object-fit: cover;
}

.arch-text p,
.about-text p {
  margin-top: 0;
}

#contact a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

/* 备案号与 Copyright 行统一为页脚正文字色与字重 */
.footer a {
  color: inherit;
  font-weight: inherit;
  font-size: inherit;
  font-family: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer {
  margin-top: 24px;
  border-top: 3px dashed var(--ink);
  background: linear-gradient(to top, #f6f5dc 0%, #ffffd3 100%);
  padding: 16px 20px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 0.875rem;
}

.footer p {
  margin: 4px 0;
}

.footer-gongan {
  margin: 6px 0 4px;
}

.footer-gongan-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.footer-gongan-icon {
  flex-shrink: 0;
  display: block;
  width: 20px;
  height: 20px;
}

@media (max-width: 840px) {
  :root {
    --top-nav-height: 48px;
  }

  .top-nav {
    flex-wrap: wrap;
    row-gap: 4px;
    padding: 5px 12px;
  }

  .left-nav {
    gap: 10px;
    font-size: 0.74rem;
  }

  .lang-btn {
    font-size: 0.68rem;
    padding: 2px 6px;
  }

  .top-nav-brand {
    font-size: 0.86rem;
    letter-spacing: 0.1em;
  }

  .hero-visual {
    aspect-ratio: 16 / 10;
    min-height: 240px;
  }

  .site-slogan {
    top: 82%;
    font-size: clamp(0.92rem, 4.2vw, 1.32rem);
  }

  .site-subline {
    max-width: 92%;
    font-size: 0.68rem;
  }

  .arch-layout,
  .about-layout {
    grid-template-columns: 1fr;
  }

  .architecture-image {
    max-height: none;
  }

  .architecture-figure-wrap {
    width: 100%;
  }

  .project-item {
    grid-template-columns: 1fr;
    align-items: stretch;
    gap: 16px;
    padding: 20px;
  }

  .project-copy {
    justify-content: flex-start;
  }
}
