/*
 * @作者: Gemini
 * @日期: 2024-04-06 15:56:01
 * @最后修改者: Gemini
 * @最后修改时间: 2024-04-06 15:56:01
 * @文件描述: 全局样式文件
 */

:root {
  --bg: #f5efe5;
  --bg-soft: rgba(255, 250, 243, 0.72);
  --card: rgba(255, 249, 240, 0.84);
  --line: rgba(107, 84, 58, 0.18);
  --text: #33281f;
  --muted: #7d6750;
  --accent: #9f6b39;
  --accent-soft: rgba(159, 107, 57, 0.12);
  --shadow: 0 24px 60px rgba(76, 53, 30, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: Georgia, 'Times New Roman', 'Noto Serif SC', serif;
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.55), transparent 35%),
    linear-gradient(180deg, #f7f1e8 0%, #efe2d0 48%, #ead8c2 100%);
  color: var(--text);
  min-height: 100vh;
  transition: background 0.3s ease, color 0.3s ease;
}

:root[data-theme='dark'] {
  --bg: #1a1a1a;
  --bg-soft: rgba(26, 26, 26, 0.72);
  --card: #242424;
  --line: rgba(255, 255, 255, 0.12);
  --text: #f1f1f1;
  --muted: #a1a1a1;
  --accent: #e5b84b;
  --accent-soft: rgba(229, 184, 75, 0.15);
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

:root[data-theme='dark'] body {
  background: radial-gradient(circle at top, rgba(255, 255, 255, 0.05), transparent 35%),
    linear-gradient(180deg, #282420 0%, #1a1816 100%);
}

a {
  color: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 56px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 18px;
  padding: 14px 18px;
  border-radius: 20px;
  background: rgba(255, 249, 240, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: 0 10px 24px rgba(82, 58, 36, 0.08);
  backdrop-filter: blur(8px);
}

.brand {
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--text);
}

.topnav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.topnav a {
  text-decoration: none;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  font-size: 13px;
}

.topnav button {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.hero {
  position: relative;
  overflow: hidden;
  padding: 40px 28px 32px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255, 248, 239, 0.88), rgba(239, 226, 208, 0.78));
  box-shadow: var(--shadow);
}

.hero:before,
.hero:after {
  content: '';
  position: absolute;
  border-radius: 999px;
  filter: blur(8px);
  opacity: 0.55;
  pointer-events: none;
}

.hero:before {
  width: 220px;
  height: 220px;
  top: -80px;
  right: -50px;
  background: rgba(182, 132, 86, 0.18);
}

.hero:after {
  width: 180px;
  height: 180px;
  bottom: -72px;
  left: -40px;
  background: rgba(130, 112, 92, 0.14);
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}

h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 500;
  line-height: 1.06;
}

.intro {
  max-width: 700px;
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.85;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.meta-chip {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.44);
  color: var(--muted);
  font-size: 13px;
}

.filters {
  margin-top: 24px;
  padding: 20px;
  border-radius: 24px;
  background: var(--bg-soft);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 12px 28px rgba(82, 58, 36, 0.08);
  backdrop-filter: blur(10px);
}

.filters-row + .filters-row {
  margin-top: 16px;
}

.filters-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 200px;
  gap: 12px;
  margin-bottom: 18px;
}

.search-input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  outline: none;
}

.search-input:focus {
  border-color: rgba(159, 107, 57, 0.4);
  box-shadow: 0 0 0 4px rgba(159, 107, 57, 0.08);
}

.sortbox {
  position: relative;
}

.sort-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.68);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sort-trigger:focus-visible {
  outline: none;
  border-color: rgba(159, 107, 57, 0.4);
  box-shadow: 0 0 0 4px rgba(159, 107, 57, 0.08);
}

.sort-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sort-value {
  flex: 1;
  text-align: left;
}

.sort-caret {
  color: var(--muted);
  transition: transform 0.2s ease;
}

.sortbox.open .sort-caret {
  transform: rotate(180deg);
}

.sort-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 20;
  display: none;
  padding: 8px;
  border-radius: 18px;
  border: 1px solid rgba(107, 84, 58, 0.14);
  background: rgba(255, 249, 240, 0.96);
  box-shadow: 0 18px 36px rgba(65, 44, 24, 0.12);
  backdrop-filter: blur(10px);
}

.sortbox.open .sort-menu {
  display: block;
}

.sort-option {
  width: 100%;
  text-align: left;
  padding: 11px 12px;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.sort-option:hover,
.sort-option.active {
  background: rgba(159, 107, 57, 0.1);
  color: var(--accent);
}

.filters-label {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 13px;
  letter-spacing: 0.08em;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.chip {
  padding: 10px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
  font: inherit;
  font-size: 14px;
}

.chip:hover,
.chip:focus-visible {
  border-color: rgba(159, 107, 57, 0.45);
  transform: translateY(-1px);
  outline: none;
}

.chip.active {
  background: var(--accent);
  color: #fffaf3;
  border-color: var(--accent);
  box-shadow: 0 10px 25px rgba(159, 107, 57, 0.22);
}

.summary-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 28px 2px 14px;
  color: var(--muted);
  font-size: 14px;
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 22px 0 0;
}

.stat-card {
  padding: 18px;
  border-radius: 22px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.stat-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.stat-value {
  margin-top: 10px;
  font-size: clamp(24px, 3.2vw, 34px);
  line-height: 1;
}

.stat-note {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.showcase {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 18px;
  margin-top: 22px;
}

.showcase-card {
  padding: 20px;
  border-radius: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.showcase-title {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 500;
}

.showcase-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  font-size: 14px;
}

.year-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.year-chip {
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.6);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.year-chip.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fffaf3;
  box-shadow: 0 10px 25px rgba(159, 107, 57, 0.18);
}

.to-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(107, 84, 58, 0.18);
  background: rgba(255, 249, 240, 0.9);
  color: var(--text);
  box-shadow: 0 14px 26px rgba(65, 44, 24, 0.12);
  backdrop-filter: blur(8px);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  transform: translateY(8px);
  font-size: 20px;
}

.to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.showcase-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.card {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.52);
  background: var(--card);
  box-shadow: 0 16px 35px rgba(65, 44, 24, 0.08);
  cursor: pointer;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 24px 44px rgba(65, 44, 24, 0.12);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 0.74;
  background: linear-gradient(180deg, rgba(169, 136, 95, 0.22), rgba(87, 70, 53, 0.12));
  overflow: hidden;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.poster-fallback {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
  color: rgba(51, 40, 31, 0.75);
  font-size: 14px;
  line-height: 1.6;
}

.rating {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(34, 25, 18, 0.72);
  color: #fff;
  font-size: 12px;
  letter-spacing: 0.03em;
  backdrop-filter: blur(4px);
}

.content {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 12px;
}

.title {
  margin: 0;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.25;
}

.type-badge {
  flex: 0 0 auto;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12px;
  border: 1px solid rgba(159, 107, 57, 0.16);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}

.blurb,
.subline {
  margin: 0;
  color: var(--muted);
  line-height: 1.75;
  font-size: 14px;
}

.blurb {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 74px;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: auto;
  padding-top: 2px;
}

.card-link {
  color: var(--accent);
  font-size: 13px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.empty {
  padding: 44px 24px;
  text-align: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.5);
  border: 1px dashed rgba(107, 84, 58, 0.25);
  color: var(--muted);
}

dialog {
  width: min(900px, calc(100% - 24px));
  padding: 0;
  border: none;
  border-radius: 30px;
  background: #fbf6ef;
  color: var(--text);
  box-shadow: 0 30px 80px rgba(28, 20, 14, 0.3);
}

dialog::backdrop {
  background: rgba(34, 27, 21, 0.55);
  backdrop-filter: blur(5px);
}

.dialog-body {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 0;
}

.dialog-poster {
  min-height: 100%;
  background: linear-gradient(180deg, rgba(167, 128, 84, 0.18), rgba(78, 58, 41, 0.08));
}

.dialog-poster img,
.dialog-poster .poster-fallback {
  width: 100%;
  height: 100%;
  min-height: 100%;
  object-fit: cover;
  display: block;
}

.dialog-content {
  padding: 28px 28px 24px;
}

.dialog-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
}

.dialog-title {
  margin: 6px 0 0;
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.08;
  font-weight: 500;
}

.dialog-close {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  font-size: 20px;
  cursor: pointer;
}

.dialog-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.dialog-block {
  margin-top: 22px;
}

.dialog-label {
  margin: 0 0 8px;
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}

.dialog-text {
  margin: 0;
  color: var(--text);
  line-height: 1.85;
  font-size: 15px;
  white-space: pre-wrap;
}

@media (max-width: 1080px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .showcase {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .dialog-body {
    grid-template-columns: 1fr;
  }
  .dialog-poster {
    max-height: 420px;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
  }
  .topbar {
    align-items: start;
    flex-direction: column;
  }
  .hero {
    padding: 24px 18px;
    border-radius: 22px;
  }
  .filters {
    padding: 16px;
    border-radius: 20px;
  }
  .stats {
    grid-template-columns: 1fr;
  }
  .filters-tools {
    grid-template-columns: 1fr;
  }
  .grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .dialog-content {
    padding: 20px 18px;
  }
  .title {
    font-size: 20px;
  }
  .summary-bar {
    align-items: start;
    flex-direction: column;
  }
  .to-top {
    right: 16px;
    bottom: 16px;
  }
}
