:root {
  --bg: #f5f8fb;
  --surface: #ffffff;
  --surface-soft: #edf6f5;
  --text: #17252f;
  --muted: #667780;
  --line: #dce6eb;
  --primary: #1b8a8f;
  --primary-dark: #11696d;
  --accent: #f27662;
  --tag-bg: #eef4f8;
  --shadow: 0 16px 42px rgba(23, 37, 47, 0.09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.75), rgba(245, 248, 251, 0.96)),
    var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", Arial, sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.page-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: end;
  padding: 24px 0 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  max-width: 760px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.14;
  letter-spacing: 0;
}

.intro {
  margin: 14px 0 0;
  max-width: 640px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.header-panel {
  min-width: 148px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel-number {
  display: block;
  color: var(--primary-dark);
  font-size: 36px;
  font-weight: 800;
  line-height: 1;
}

.panel-label {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 14px;
}

.filter-bar {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  padding: 18px;
}

.search-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 260px) auto;
  gap: 12px;
  align-items: end;
}

.search-box,
.select-box {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.search-box input,
.select-box select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  outline: none;
}

.search-box input {
  padding: 0 14px;
}

.select-box select {
  padding: 0 12px;
}

.search-box input:focus,
.select-box select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(27, 138, 143, 0.14);
}

.clear-button,
.open-button,
.copy-button,
.category-tab {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    transform 0.16s ease,
    border-color 0.16s ease,
    background 0.16s ease,
    color 0.16s ease;
}

.clear-button {
  height: 44px;
  padding: 0 16px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--muted);
  white-space: nowrap;
}

.clear-button:hover,
.category-tab:hover,
.open-button:hover,
.copy-button:hover {
  transform: translateY(-1px);
}

.category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.category-tab {
  padding: 0 14px;
  background: var(--surface-soft);
  color: var(--primary-dark);
  font-weight: 700;
}

.category-tab.active {
  background: var(--primary);
  color: #ffffff;
}

.result-meta {
  min-height: 28px;
  margin: 18px 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.result-meta p {
  margin: 0;
}

.poster-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
  align-items: start;
}

.poster-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(23, 37, 47, 0.07);
}

.poster-preview {
  position: relative;
  display: grid;
  aspect-ratio: 1284 / 2778;
  place-items: center;
  overflow: hidden;
  background: #f7fbfb;
}

.poster-preview img {
  display: block;
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-preview.has-image .poster-placeholder {
  display: none;
}

.poster-placeholder {
  position: absolute;
  inset: 22px;
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 10px;
  border: 1px dashed rgba(17, 105, 109, 0.36);
  border-radius: 8px;
  color: var(--primary-dark);
  text-align: center;
}

.placeholder-occasion {
  font-size: 30px;
  font-weight: 800;
}

.placeholder-category {
  color: var(--muted);
  font-size: 14px;
}

.poster-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.poster-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.poster-kicker span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--tag-bg);
}

.poster-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.35;
}

.poster-description {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  font-size: 14px;
  line-height: 1.7;
  min-height: 48px;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.tag {
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff4f1;
  color: #a34b3b;
  font-size: 12px;
  font-weight: 700;
}

.card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 4px;
}

.open-button,
.copy-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
}

.open-button {
  background: var(--primary);
  color: #ffffff;
}

.copy-button {
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary-dark);
}

.empty-state {
  margin-top: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 32px 24px;
  text-align: center;
}

.empty-state h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.empty-state p {
  margin: 0 auto;
  max-width: 620px;
  color: var(--muted);
  line-height: 1.7;
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10;
  padding: 12px 18px;
  border-radius: 8px;
  background: #17252f;
  color: #ffffff;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 920px) {
  .page-header,
  .search-row {
    grid-template-columns: 1fr;
  }

  .header-panel {
    justify-self: start;
  }

  .poster-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .app-shell {
    width: min(100% - 24px, 1180px);
    padding-top: 20px;
  }

  .page-header {
    gap: 18px;
  }

  .filter-bar {
    padding: 14px;
  }

  .category-tabs {
    gap: 8px;
  }

  .category-tab {
    flex: 1 1 calc(50% - 8px);
    padding: 0 10px;
  }

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

  .card-actions {
    grid-template-columns: 1fr;
  }

  .toast {
    right: 12px;
    bottom: 12px;
    left: 12px;
    text-align: center;
  }
}
