.gallery-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #ffffff, var(--base-color-sand-150));
}

.gallery-nav {
  position: sticky;
  top: 0;
  z-index: 120;
  min-height: 80px;
  padding: 14px 24px;
  display: grid;
  grid-template-columns: auto minmax(280px, 1fr) auto;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(200, 200, 193, 0.75);
}

.nav-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1.2px;
}

.nav-logo span {
  color: var(--base-color-red-500);
}

.nav-center {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.nav-tab {
  min-height: 36px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  color: var(--base-color-plum-900);
  font-size: 14px;
  font-weight: 500;
}

.nav-tab:hover,
.nav-tab.active {
  background: var(--base-color-sand-300);
}

.nav-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.search-box {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--base-color-sand-200);
  border: 1px solid transparent;
  border-radius: 24px;
  padding: 0 16px;
  min-width: min(520px, 100%);
}

.search-box:focus-within {
  border-color: var(--base-color-focus);
  box-shadow: 0 0 0 3px rgba(67, 94, 229, 0.12);
}

.search-box span {
  color: var(--base-color-olive-700);
  font-size: 14px;
}

.search-box input {
  width: 100%;
  border: 0;
  background: transparent;
  color: var(--base-color-plum-900);
  font-size: 14px;
  outline: none;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.user-avatar,
.author-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--base-color-white);
  font-size: 12px;
  font-weight: 700;
}

.user-name {
  font-size: 14px;
  font-weight: 600;
}

#guestBtns {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 46px 0 28px;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  align-items: stretch;
}

.hero-text {
  padding: 28px 8px 0;
}

.hero-text h1 {
  margin: 0;
  max-width: 660px;
  font-size: clamp(42px, 8vw, 70px);
  font-weight: 600;
  line-height: 1;
  color: var(--base-color-plum-900);
}

.hero-text h1 em {
  color: var(--base-color-red-500);
  font-style: normal;
}

.hero-sub {
  max-width: 560px;
  margin: 16px 0 0;
  color: var(--base-color-olive-700);
  font-size: 16px;
}

.hero::after {
  content: "";
  display: block;
  background:
    linear-gradient(135deg, rgba(230, 0, 35, 0.08), transparent 55%),
    linear-gradient(180deg, rgba(246, 246, 243, 0.98), rgba(229, 229, 224, 0.78));
  border: 8px solid var(--base-color-white);
  border-radius: 32px;
  min-height: 380px;
  box-shadow: var(--surface-shadow);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.hero-stats > div {
  padding: 16px 18px;
  border-radius: 20px;
  background: var(--base-color-white);
  border: 1px solid rgba(200, 200, 193, 0.75);
}

.stat-num {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -1px;
}

.stat-label {
  margin-top: 6px;
  color: var(--base-color-olive-700);
  font-size: 12px;
}

.filters-bar {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto 20px;
  padding: 16px;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--base-color-white);
  border: 1px solid rgba(200, 200, 193, 0.75);
  border-radius: 24px;
}

.filter-chip {
  min-height: 36px;
  padding: 7px 14px;
  border-radius: var(--radius-md);
  background: var(--base-color-sand-300);
  color: var(--base-color-plum-900);
  font-size: 12px;
  font-weight: 500;
}

.filter-chip.active,
.filter-chip:hover {
  background: var(--base-color-red-500);
  color: var(--base-color-white);
}

.grid-container {
  width: min(1480px, calc(100% - 24px));
  margin: 0 auto;
  padding: 0 0 42px;
  columns: 6 220px;
  column-gap: 16px;
}

.work-card {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: 16px;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  background: transparent;
  box-shadow: none;
}

.work-card:hover .card-image {
  transform: translateY(-2px);
}

.card-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  border-radius: 20px;
  border: 8px solid var(--base-color-white);
  background: var(--base-color-sand-200);
  transition: transform 0.18s ease;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-image-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: inherit;
  font-size: 64px;
  color: var(--base-color-olive-500);
}

.teacher-comment-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  padding: 6px 10px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.95);
  color: var(--base-color-red-500);
  font-size: 12px;
  font-weight: 700;
}

.card-body {
  padding: 12px 2px 0;
}

.card-title {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.3;
}

.card-author {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--base-color-olive-700);
  font-size: 14px;
}

.card-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  padding: 5px 10px;
}

.card-footer {
  padding: 12px 2px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card-stats {
  display: flex;
  gap: 12px;
}

.stat-item {
  color: var(--base-color-olive-700);
  font-size: 12px;
}

@media (max-width: 1180px) {
  .gallery-nav {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .nav-center,
  .nav-right {
    justify-content: flex-start;
  }

  .search-box {
    min-width: 100%;
  }

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

  .hero::after {
    min-height: 260px;
  }
}

@media (max-width: 760px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .grid-container {
    columns: 2 160px;
  }
}

@media (max-width: 520px) {
  .gallery-nav {
    padding: 12px 16px;
  }

  .hero,
  .filters-bar {
    width: min(100%, calc(100% - 20px));
  }

  .grid-container {
    width: calc(100% - 16px);
    columns: 1 100%;
  }
}
