:root {
  --bg: #f4efe6;
  --panel: rgba(255, 255, 255, 0.92);
  --ink: #1f2b25;
  --muted: #64746a;
  --accent: #0f766e;
  --accent-strong: #0b4f52;
  --accent-soft: #dcefeb;
  --line: rgba(15, 118, 110, 0.14);
  --shadow: 0 24px 60px rgba(26, 39, 31, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(232, 210, 179, 0.56), transparent 26%),
    radial-gradient(circle at top right, rgba(197, 230, 220, 0.66), transparent 24%),
    linear-gradient(180deg, #f7f0e7 0%, #edf6f2 100%);
  font-family: "Avenir Next", "PingFang SC", "Microsoft YaHei", sans-serif;
}

.page-shell {
  width: min(1440px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.hero,
.toolbar,
.chips-shell,
.status-bar,
.preview-card {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.7fr 1fr;
  gap: 20px;
  border-radius: 28px;
  padding: 24px;
}

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

.hero h1 {
  margin: 0;
  font-size: clamp(32px, 6vw, 56px);
  line-height: 0.95;
}

.hero-copy {
  max-width: 48rem;
  line-height: 1.6;
  color: var(--muted);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stat-card {
  border-radius: 20px;
  background: linear-gradient(180deg, rgba(255,255,255,0.96), rgba(238, 248, 245, 0.95));
  border: 1px solid var(--line);
  padding: 16px;
}

.stat-card strong {
  display: block;
  font-size: 24px;
  color: var(--accent-strong);
}

.stat-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.toolbar,
.chips-shell,
.status-bar {
  margin-top: 18px;
  border-radius: 22px;
  padding: 16px;
}

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
}

.search-box,
.sort-box {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.search-box input,
.sort-box select {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 12px 14px;
  font: inherit;
  background: rgba(255,255,255,0.9);
}

.action-box,
.preview-actions {
  display: flex;
  gap: 10px;
  align-items: end;
}

button,
.primary-button,
.ghost-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: transform 160ms ease, opacity 160ms ease;
}

button:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: linear-gradient(135deg, #0f766e, #1a4d7a);
  color: #fff;
}

.ghost-button {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.chips-shell {
  display: flex;
  gap: 10px;
  align-items: center;
  overflow: hidden;
}

.chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.chip {
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.78);
  color: var(--muted);
}

.chip.active {
  background: var(--accent-strong);
  color: #fff;
}

.status-bar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 14px;
  color: var(--muted);
}

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

.card {
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 16px 38px rgba(31, 43, 37, 0.08);
}

.thumb-button {
  display: block;
  width: 100%;
  background: #e5eee9;
  padding: 0;
}

.thumb-button img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.4;
}

.card-meta {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.card-actions {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: center;
  margin-top: 14px;
}

.select-box {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
}

.footer-actions {
  display: flex;
  justify-content: center;
  margin-top: 24px;
}

.preview-dialog {
  border: 0;
  padding: 0;
  background: transparent;
  width: min(980px, calc(100% - 24px));
}

.preview-dialog::backdrop {
  background: rgba(18, 24, 24, 0.52);
  backdrop-filter: blur(6px);
}

.preview-card {
  position: relative;
  display: grid;
  grid-template-columns: 1.2fr 0.9fr;
  gap: 0;
  border-radius: 26px;
  overflow: hidden;
}

.preview-card img {
  width: 100%;
  height: 100%;
  min-height: 360px;
  object-fit: cover;
  background: #dceae5;
}

.preview-meta {
  padding: 24px;
}

.preview-meta h2 {
  margin-top: 0;
  font-size: 28px;
  line-height: 1.1;
}

.preview-meta p {
  color: var(--muted);
  line-height: 1.7;
}

.close-button {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
}

@media (max-width: 960px) {
  .hero,
  .toolbar,
  .preview-card {
    grid-template-columns: 1fr;
  }

  .hero-stats {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 720px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 16px;
  }

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

  .status-bar,
  .action-box,
  .preview-actions {
    flex-direction: column;
    align-items: stretch;
  }
}
