:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #eef3f1;
  --text: #17211d;
  --muted: #63716b;
  --line: #d9e2de;
  --accent: #0e7c66;
  --accent-strong: #095c4b;
  --shadow: 0 16px 40px rgba(19, 35, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

body.viewer-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 34px clamp(18px, 4vw, 56px) 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  position: sticky;
  top: 0;
  z-index: 5;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.08;
  letter-spacing: 0;
}

main {
  padding: 24px clamp(18px, 4vw, 56px) 56px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.icon-button:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 420px) 1fr;
  align-items: center;
  gap: 16px;
  margin-bottom: 22px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.filter-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.filter-tabs button {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
}

.filter-tabs button[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}

body.compact .gallery {
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.shot {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 4px 18px rgba(19, 35, 30, 0.06);
}

.shot button {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: var(--surface-soft);
  cursor: zoom-in;
}

.shot img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: contain;
  background: var(--surface-soft);
}

.shot-meta {
  padding: 14px 14px 15px;
}

.shot-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 7px;
}

.shot h2 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  letter-spacing: 0;
}

.shot-tag {
  flex: 0 0 auto;
  max-width: 45%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e3ece8;
  color: var(--accent-strong);
  font-size: 12px;
}

.shot p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.empty-state {
  max-width: 620px;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.empty-state h2 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 20px;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #e9eeeb;
  color: var(--text);
}

.viewer {
  width: calc(100vw - 24px);
  height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.viewer::backdrop {
  background: rgba(10, 18, 15, 0.68);
}

.viewer-topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.viewer-tag {
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 700;
}

.viewer h2 {
  margin: 0;
  font-size: 20px;
}

.viewer img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  background: var(--surface-soft);
}

.viewer-description {
  margin: 0;
  padding: 12px 18px 0;
  color: var(--muted);
  line-height: 1.6;
}

@media (max-width: 780px) {
  .site-header {
    position: static;
    padding-top: 24px;
  }

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

@media (max-width: 520px) {
  .site-header {
    align-items: flex-start;
  }

  .gallery,
  body.compact .gallery {
    grid-template-columns: 1fr;
  }

  .shot-title-row {
    display: block;
  }

  .shot-tag {
    display: inline-block;
    max-width: 100%;
    margin-top: 8px;
  }

  .viewer {
    width: 100vw;
    height: 100dvh;
    border-radius: 0;
  }

  .viewer-topbar {
    padding: 12px;
  }

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

  .viewer-description {
    padding: 10px 12px 0;
    font-size: 13px;
  }

}
