:root {
  color-scheme: dark;
  --primary: #1e6bff;
  --primary-bright: #5f92ff;
  --primary-deep: #0849c7;
  --night: #061b3a;
  --night-soft: #0a2540;
  --ink: #0a2540;
  --muted: #5a6b85;
  --surface: rgba(255, 255, 255, 0.94);
  --surface-muted: rgba(242, 247, 255, 0.9);
  --glass: rgba(231, 241, 255, 0.78);
  --glass-strong: rgba(241, 247, 255, 0.9);
  --line: rgba(168, 195, 236, 0.38);
  --line-light: rgba(255, 255, 255, 0.18);
  --white: #ffffff;
  --shadow-sm: 0 6px 20px rgba(2, 16, 45, 0.14);
  --shadow-lg: 0 24px 70px rgba(2, 13, 36, 0.34);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --page-gutter: 12px;
  --content-width: 1240px;
  --font-sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  --transition-fast: 160ms ease;
  --transition-base: 240ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--night);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: var(--font-sans);
  background:
    linear-gradient(180deg, rgba(4, 21, 50, 0.74) 0%, rgba(6, 27, 58, 0.84) 48%, rgba(5, 23, 50, 0.94) 100%),
    url("images/bg.jpg") center / cover no-repeat fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before,
body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
}

body::before {
  background:
    radial-gradient(circle at 10% 8%, rgba(30, 107, 255, 0.3), transparent 30%),
    radial-gradient(circle at 88% 40%, rgba(34, 192, 242, 0.12), transparent 34%),
    linear-gradient(120deg, rgba(2, 12, 33, 0.26), rgba(2, 17, 42, 0.72));
}

body::after {
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(123, 169, 239, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(123, 169, 239, 0.06) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: linear-gradient(to bottom, black, transparent 70%);
}

body.viewer-open {
  position: fixed;
  width: 100%;
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

img {
  display: block;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 10px;
  left: 12px;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 14px;
  color: var(--night);
  font-weight: 700;
  text-decoration: none;
  background: var(--white);
  border-radius: var(--radius-sm);
  transform: translateY(-150%);
  transition: transform var(--transition-fast);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-shell {
  width: min(100%, var(--content-width));
  min-height: 100vh;
  margin: 0 auto;
  padding:
    max(30px, env(safe-area-inset-top))
    var(--page-gutter)
    calc(26px + env(safe-area-inset-bottom));
}

.hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  min-height: 220px;
  padding: clamp(22px, 5vw, 54px) clamp(2px, 2vw, 24px) clamp(25px, 4vw, 44px);
}

.hero__content {
  max-width: 760px;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  gap: 9px;
  margin: 0 0 14px;
  color: #bcd4ff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.hero__eyebrow-line {
  width: 28px;
  height: 1px;
  background: linear-gradient(90deg, var(--primary-bright), transparent);
}

.hero h1 {
  margin: 0;
  color: var(--white);
  font-size: clamp(36px, 7.2vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.055em;
  text-shadow: 0 4px 32px rgba(0, 8, 24, 0.3);
}

.hero h1 span {
  display: block;
  margin-top: 6px;
  color: transparent;
  font-size: 0.62em;
  font-weight: 700;
  letter-spacing: 0.12em;
  background: linear-gradient(90deg, #ffffff 8%, #86b0ff 56%, #48d7ff 100%);
  background-clip: text;
  -webkit-background-clip: text;
}

.hero__intro {
  max-width: 630px;
  margin: 20px 0 0;
  color: rgba(225, 238, 255, 0.74);
  font-size: clamp(13px, 1.7vw, 15px);
  line-height: 1.75;
}

.hero__mark {
  display: none;
  width: 150px;
  padding-left: 20px;
  color: rgba(223, 236, 255, 0.55);
  border-left: 1px solid rgba(188, 212, 255, 0.24);
}

.hero__mark span,
.hero__mark small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.18em;
}

.hero__mark strong {
  display: block;
  margin: 2px 0 0;
  color: var(--white);
  font-size: 45px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -0.04em;
}

.search-panel {
  position: sticky;
  z-index: 20;
  top: 0;
  padding: max(10px, env(safe-area-inset-top)) 10px 10px;
  background: rgba(10, 37, 74, 0.54);
  border: 1px solid rgba(222, 236, 255, 0.2);
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 40px rgba(1, 11, 31, 0.28);
  backdrop-filter: blur(20px) saturate(145%);
  -webkit-backdrop-filter: blur(20px) saturate(145%);
}

.search-panel__controls {
  display: grid;
  grid-template-columns: minmax(108px, 0.42fr) minmax(0, 1fr);
  gap: 8px;
}

.field {
  position: relative;
  display: block;
  min-width: 0;
}

.field select,
.field input {
  width: 100%;
  min-height: 48px;
  margin: 0;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid transparent;
  border-radius: 10px;
  outline: none;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.52) inset;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background-color var(--transition-fast);
}

.field select:hover,
.field input:hover {
  background: var(--white);
}

.field select:focus,
.field input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(30, 107, 255, 0.24);
}

.field select {
  padding: 0 38px 0 14px;
  appearance: none;
}

.field input {
  padding: 0 48px 0 43px;
}

.field input::placeholder {
  color: #7586a0;
  font-weight: 500;
}

.field input::-webkit-search-cancel-button {
  display: none;
}

.field__chevron {
  position: absolute;
  top: 50%;
  right: 12px;
  width: 20px;
  height: 20px;
  color: #5d7090;
  pointer-events: none;
  transform: translateY(-50%);
}

.field__search-icon {
  position: absolute;
  z-index: 1;
  top: 50%;
  left: 14px;
  width: 18px;
  height: 18px;
  color: #6c7f9c;
  pointer-events: none;
  transform: translateY(-50%);
}

.field__clear {
  position: absolute;
  top: 50%;
  right: 2px;
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  color: #627693;
  cursor: pointer;
  background: transparent;
  border: 0;
  border-radius: 50%;
  place-items: center;
  transform: translateY(-50%);
}

.field__clear svg {
  width: 19px;
  height: 19px;
}

.field__clear:hover {
  color: var(--ink);
  background: rgba(10, 37, 64, 0.08);
}

.search-panel__summary {
  margin: 8px 4px 0;
  color: rgba(226, 238, 255, 0.76);
  font-size: 11px;
  letter-spacing: 0.04em;
}

.gallery-section {
  padding-top: 27px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  padding: 0 3px 15px;
}

.section-heading__label {
  margin: 0 0 4px;
  color: #7ea8ff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.2em;
}

.section-heading h2 {
  margin: 0;
  color: var(--white);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.section-heading > p {
  margin: 0 0 2px;
  color: rgba(218, 233, 255, 0.56);
  font-size: 11px;
}

.section-heading__aside {
  display: flex;
  align-items: flex-end;
  flex-direction: column;
  gap: 7px;
}

.section-heading__aside p {
  margin: 0;
  color: rgba(218, 233, 255, 0.56);
  font-size: 11px;
}

.view-switch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  color: #dce9ff;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(208, 227, 255, 0.17);
  border-radius: 999px;
  transition: background-color var(--transition-fast), border-color var(--transition-fast);
}

.view-switch:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(208, 227, 255, 0.32);
}

.view-switch:focus-visible {
  outline: 2px solid #8ab4ff;
  outline-offset: 3px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--page-gutter);
  padding: 0;
  margin: 0;
  list-style: none;
}

.gallery__item {
  min-width: 0;
}

.photo-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  background: var(--surface);
  border: 1px solid rgba(255, 255, 255, 0.44);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition:
    transform var(--transition-base),
    box-shadow var(--transition-base),
    opacity var(--transition-fast);
}

.photo-card:hover {
  box-shadow: 0 14px 34px rgba(2, 14, 38, 0.26);
  transform: translateY(-3px);
}

.photo-card:active {
  opacity: 0.9;
  transform: scale(0.98);
}

.photo-card:focus-visible {
  outline: 3px solid #8ab4ff;
  outline-offset: 3px;
}

.photo-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background:
    linear-gradient(145deg, #dfe9f8, #f8fbff);
}

.photo-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 420ms cubic-bezier(0.2, 0.75, 0.25, 1);
}

.photo-card:hover .photo-card__image {
  transform: scale(1.025);
}

.photo-card__fallback {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 150px;
  padding: 16px;
  color: #6880a2;
  font-size: 11px;
  text-align: center;
  background:
    radial-gradient(circle at 50% 35%, rgba(30, 107, 255, 0.12), transparent 40%),
    linear-gradient(145deg, #dfe9f8, #f8fbff);
}

.photo-card__fallback strong {
  display: grid;
  width: 48px;
  height: 48px;
  color: var(--white);
  font-size: 21px;
  background: var(--primary);
  border-radius: 50%;
  place-items: center;
}

.region-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.04em;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
  background: var(--badge-color, var(--primary));
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 10, 28, 0.17);
}

.photo-card__badge {
  position: absolute;
  top: 8px;
  left: 8px;
}

.photo-card__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 46px;
  padding: 9px 11px 10px;
  background: rgba(255, 255, 255, 0.96);
}

.photo-card__name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.photo-card__number {
  flex: 0 0 auto;
  color: #8a9ab0;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.photo-card--name-only {
  position: relative;
  display: flex;
  align-items: flex-start;
  flex-direction: column;
  justify-content: space-between;
  min-height: 112px;
  padding: 13px;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(231, 241, 255, 0.94));
}

.photo-card--name-only::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--badge-color, var(--primary));
  content: "";
}

.photo-card--name-only .region-badge {
  position: static;
}

.name-card__name {
  display: block;
  width: 100%;
  margin-top: 16px;
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(17px, 4.6vw, 21px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.name-list-page .gallery {
  align-items: stretch;
}

.name-list-page .site-footer span {
  min-width: 20px;
}

.empty-state {
  width: min(100%, 460px);
  padding: 44px 24px;
  margin: 22px auto;
  text-align: center;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.empty-state__icon {
  display: grid;
  width: 62px;
  height: 62px;
  margin: 0 auto 16px;
  color: var(--primary);
  background: rgba(30, 107, 255, 0.09);
  border-radius: 50%;
  place-items: center;
}

.empty-state__icon svg {
  width: 30px;
  height: 30px;
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 18px;
}

.empty-state p {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}

.button {
  min-height: 44px;
  padding: 0 22px;
  cursor: pointer;
  border: 0;
  border-radius: 10px;
}

.button--primary {
  color: var(--white);
  font-weight: 700;
  background: linear-gradient(135deg, var(--primary), var(--primary-deep));
  box-shadow: 0 8px 20px rgba(30, 107, 255, 0.25);
}

.button--primary:hover {
  filter: brightness(1.08);
}

.site-footer {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 38px 6px calc(4px + env(safe-area-inset-bottom));
  color: rgba(207, 223, 247, 0.5);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.site-footer p {
  margin: 0;
  white-space: nowrap;
}

.site-footer span {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(195, 217, 249, 0.22), transparent);
}

.viewer {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding:
    max(14px, env(safe-area-inset-top))
    14px
    max(14px, env(safe-area-inset-bottom));
  margin: 0;
  color: var(--white);
  background: rgba(3, 12, 30, 0.96);
  border: 0;
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  overscroll-behavior: contain;
}

.viewer:not([open]) {
  display: none;
}

.viewer[open] {
  animation: viewer-fade-in 200ms ease both;
}

.viewer::backdrop {
  background: transparent;
}

.viewer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(100%, 1120px);
  margin: 0 auto;
}

.viewer__identity {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 10px;
}

.viewer__identity h2 {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  font-size: clamp(17px, 2.8vw, 22px);
  font-weight: 700;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer__close,
.viewer__nav {
  display: grid;
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  padding: 0;
  color: rgba(239, 246, 255, 0.92);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 50%;
  transition: background-color var(--transition-fast), transform var(--transition-fast), opacity var(--transition-fast);
  place-items: center;
}

.viewer__close:hover,
.viewer__nav:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.15);
}

.viewer__close:active,
.viewer__nav:active:not(:disabled) {
  transform: scale(0.94);
}

.viewer__close:focus-visible,
.viewer__nav:focus-visible {
  outline: 2px solid var(--primary-bright);
  outline-offset: 3px;
}

.viewer__close svg,
.viewer__nav svg {
  width: 23px;
  height: 23px;
}

.viewer__media {
  position: relative;
  display: grid;
  min-height: 0;
  padding: 12px 0;
  overflow: hidden;
  touch-action: none;
  place-items: center;
}

.viewer__media img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.43);
  will-change: transform, opacity;
}

.viewer__media.is-next img {
  animation: viewer-slide-from-right 200ms ease both;
}

.viewer__media.is-prev img {
  animation: viewer-slide-from-left 200ms ease both;
}

.viewer__fallback {
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  width: min(100%, 420px);
  aspect-ratio: 3 / 4;
  color: rgba(218, 233, 255, 0.62);
  font-size: 13px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
}

.viewer__fallback svg {
  width: 48px;
  height: 48px;
  opacity: 0.7;
}

.viewer__footer {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  align-items: center;
  gap: 14px;
  width: min(100%, 520px);
  margin: 0 auto;
}

.viewer__counter {
  min-width: 0;
  text-align: center;
}

.viewer__counter strong {
  display: block;
  margin-bottom: 3px;
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.viewer__counter span {
  display: block;
  overflow: hidden;
  color: rgba(207, 224, 247, 0.54);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.viewer__nav:disabled {
  cursor: default;
  opacity: 0.28;
}

.noscript {
  position: fixed;
  z-index: 200;
  right: 16px;
  bottom: 16px;
  left: 16px;
  padding: 12px;
  margin: 0;
  color: var(--ink);
  text-align: center;
  background: var(--white);
  border-radius: var(--radius-md);
}

@keyframes viewer-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes viewer-slide-from-right {
  from {
    opacity: 0;
    transform: translateX(18px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes viewer-slide-from-left {
  from {
    opacity: 0;
    transform: translateX(-18px) scale(0.995);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@media (min-width: 520px) {
  :root {
    --page-gutter: 16px;
  }

  .site-shell {
    padding-right: 20px;
    padding-left: 20px;
  }

  .hero__mark {
    display: block;
  }

  .search-panel {
    padding: 12px;
  }

  .search-panel__controls {
    grid-template-columns: minmax(150px, 0.35fr) minmax(240px, 1fr);
  }
}

@media (min-width: 640px) {
  .gallery {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .search-panel__summary {
    margin-top: 9px;
  }
}

@media (min-width: 960px) {
  .site-shell {
    padding-right: 30px;
    padding-left: 30px;
  }

  .hero {
    min-height: 280px;
  }

  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
  }

  .photo-card__meta {
    min-height: 50px;
    padding: 10px 13px 11px;
  }

  .photo-card__name {
    font-size: 15px;
  }

  .viewer {
    padding-right: 28px;
    padding-left: 28px;
  }
}

@media (max-width: 359px) {
  .hero h1 {
    font-size: 33px;
  }

  .search-panel__controls {
    grid-template-columns: 105px minmax(0, 1fr);
  }

  .field select {
    padding-left: 10px;
    font-size: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
