* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: #181818;
  background: #efefef;
}

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

button,
input,
textarea,
select {
  font: inherit;
}

button,
.ghost,
.list-card-actions a,
.dialog-actions a,
.close-btn {
  border: 0;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

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

.front-shell {
  width: 100%;
  padding: 0 0 28px;
}

.front-main {
  display: grid;
  gap: 0;
}

.eyebrow {
  margin: 0 0 8px;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: #005f2b;
}

.muted {
  color: rgba(0, 0, 0, 0.64);
}

.panel,
.hero {
  background: #ffffff;
}

.panel {
  padding: 10px;
}

.hero {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.hero h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 1;
}

.hero-copy p:last-child {
  margin-bottom: 0;
}

.ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  background: #ffffff;
  color: #222222;
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.list-grid,
.image-grid,
.folder-list {
  display: grid;
  gap: 12px;
}

.project-card-list {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

.list-card {
  display: grid;
  gap: 8px;
  border: 1px solid #dfe3eb;
  border-radius: 14px;
  padding: 14px;
  background: #ffffff;
}

.project-list-card {
  min-height: 180px;
  align-content: space-between;
}

.list-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.list-card-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: #0b57d0;
  color: #ffffff;
}

.project-hero {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  background: #ffffff;
}

.project-hero-cover {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 20, 20, 0.72) 0%, rgba(20, 20, 20, 0.48) 33%, rgba(20, 20, 20, 0.12) 64%, rgba(20, 20, 20, 0.06) 100%),
    linear-gradient(135deg, #dfdfdf, #f7f7f7);
  background-size: cover;
  background-position: center;
}

.project-summary {
  display: grid;
  gap: 22px;
  padding: 28px 34px 34px;
  background: #ffffff;
}

.project-summary-head {
  display: grid;
  gap: 10px;
}

.project-summary-head h1 {
  margin: 0;
  font-size: clamp(28px, 2vw, 32px);
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 700;
}

.project-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: baseline;
}

.project-metrics span {
  color: #b8b8b8;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
}

.project-metrics span strong {
  margin-right: 4px;
  color: #111111;
  font-size: 18px;
  font-weight: 700;
}

.project-folders {
  display: block;
  margin-top: 4px;
}

.folder-row {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}

.folder-chip {
  cursor: pointer;
  min-width: 92px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid #dfe3eb;
  background: #ffffff;
  color: #626873;
  text-align: center;
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease;
}

.folder-chip strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1;
}

.folder-chip.active,
.folder-chip:hover {
  border-color: #005f2b;
}

.folder-chip.active {
  background: #005f2b;
  color: #ffffff;
}

.front-gallery {
  padding: 24px 24px 0;
  background: #efefef;
}

#image-gallery.public-grid {
  display: grid;
  min-height: 220px;
  gap: 14px;
}

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

.gallery-empty {
  min-height: 160px;
  display: grid;
  place-items: center;
  border: 1px solid #e6e6e6;
  color: #8e8e8e;
  background: #fafafa;
}

.gallery-loading,
.gallery-sentinel {
  width: 100%;
}

.gallery-loading {
  display: grid;
  place-items: center;
  padding: 18px 0 8px;
  color: #6f7782;
  font-size: 14px;
}

.gallery-sentinel {
  height: 1px;
}

.gallery-row {
  display: flex;
  align-items: stretch;
}

.image-card {
  position: relative;
  display: block;
  padding: 0;
  background: #ffffff;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.image-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.08);
}

.image-card img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.04);
  cursor: zoom-in;
}

.image-card video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #0a0a0a;
  cursor: pointer;
}

.image-card.media-video::after {
  content: "VIDEO";
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 11px;
  letter-spacing: 0.08em;
}

.image-dialog {
  width: 100vw;
  height: 100vh;
  max-width: none;
  max-height: none;
  margin: 0;
  border: 0;
  padding: 0;
  background: #000000;
  color: #ffffff;
}

.image-dialog::backdrop {
  background: #000000;
}

.image-viewer {
  height: 100vh;
  display: grid;
  grid-template-rows: 44px minmax(0, 1fr) auto;
  background: #000000;
}

.image-viewer-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 8px 18px 2px;
}

.image-viewer-meta {
  display: flex;
  align-items: center;
  min-height: 32px;
}

.image-viewer-meta h2 {
  margin: 0;
  font-size: 16px;
  line-height: 32px;
  font-weight: 700;
  color: #ffffff;
}

.dialog-caption {
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.5;
  font-size: 14px;
  min-height: 21px;
}

.image-viewer-stage {
  min-height: 0;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 0 10px 0;
}

.image-viewer-canvas {
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 0 12px 0;
  transform: translateY(-20px);
}

.image-viewer-canvas img {
  max-width: 100%;
  max-height: calc(100vh - 178px);
  object-fit: contain;
  background: transparent;
}

.image-viewer-canvas video {
  max-width: 100%;
  max-height: calc(100vh - 178px);
  background: #000000;
}

.viewer-icon-btn,
.viewer-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #ffffff;
  padding: 0;
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.viewer-icon-btn:hover,
.viewer-nav-btn:hover {
  transform: scale(1.04);
}

.viewer-icon-btn:focus,
.viewer-icon-btn:focus-visible,
.viewer-nav-btn:focus,
.viewer-nav-btn:focus-visible,
.dialog-thumb:focus,
.dialog-thumb:focus-visible,
.dialog-actions a:focus,
.dialog-actions a:focus-visible {
  outline: none;
  box-shadow: none;
}

.viewer-icon-btn:disabled,
.viewer-nav-btn:disabled {
  opacity: 0.32;
  cursor: default;
}

.close-btn {
  width: 32px;
  height: 32px;
}

.close-btn img {
  display: block;
  width: 32px;
  height: 32px;
}

.viewer-nav-btn {
  width: 32px;
  height: 32px;
  margin: 0 2px;
}

.viewer-nav-btn img {
  display: block;
  width: 32px;
  height: 32px;
}

.viewer-nav-prev img {
  transform: rotate(180deg);
}

.image-viewer-footer {
  display: grid;
  gap: 8px;
  padding: 0 18px 14px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.dialog-actions a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: transparent;
  color: #ffffff;
  transition: border-color 0.18s ease, background-color 0.18s ease;
}

.dialog-actions a:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.08);
}

.dialog-thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 2px 2px 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.52) transparent;
}

.dialog-thumbs::-webkit-scrollbar {
  height: 8px;
}

.dialog-thumbs::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.42);
}

.dialog-thumb {
  flex: 0 0 auto;
  width: 128px;
  height: 80px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: #050505;
  overflow: hidden;
  position: relative;
}

.dialog-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 1;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.dialog-thumb video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: #050505;
}

.dialog-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  transition: background-color 0.18s ease;
}

.dialog-thumb:hover::after {
  background: rgba(0, 0, 0, 0.24);
}

.dialog-thumb.active {
  border-color: #ffffff;
}

.dialog-thumb.active::after {
  background: transparent;
}

@media (max-width: 980px) {
  .hero {
    align-items: start;
    flex-direction: column;
  }

  .project-summary,
  .front-gallery {
    padding-left: 16px;
    padding-right: 16px;
  }

  .project-summary {
    padding-top: 22px;
    padding-bottom: 26px;
  }

  .public-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
}

@media (max-width: 640px) {
  .front-shell {
    width: 100%;
    padding-top: 0;
  }

  .front-main {
    gap: 14px;
  }

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

  .project-summary-head h1 {
    font-size: 28px;
  }

  .folder-row {
    gap: 10px;
  }

  .folder-chip {
    min-width: 78px;
    height: 32px;
    padding: 0 14px;
  }

  .folder-chip strong {
    font-size: 13px;
  }

  .image-viewer-topbar {
    padding: 8px 12px 2px;
  }

  .image-viewer-meta h2 {
    font-size: 16px;
  }

  .image-viewer-stage {
    gap: 10px;
    padding: 0 6px;
  }

  .viewer-nav-btn {
    width: 32px;
    height: 32px;
  }

  .viewer-nav-btn img {
    width: 32px;
    height: 32px;
  }

  .image-viewer-canvas {
    padding: 0;
    transform: translateY(-20px);
  }

  .image-viewer-canvas img {
    max-height: calc(100vh - 172px);
  }

  .image-viewer-footer {
    gap: 10px;
    padding: 0 12px 12px;
  }

  .dialog-actions {
    justify-content: start;
  }

  .dialog-actions a {
    min-height: 38px;
    padding: 0 14px;
    font-size: 13px;
  }

  .dialog-thumb {
    width: 92px;
    height: 60px;
  }
}
