:root {
  --ink: #15171c;
  --muted: #667085;
  --line: #d9e0ea;
  --surface: #ffffff;
  --surface-soft: #f6f8fb;
  --page: #e9edf3;
  --brand: #37251d;
  --brand-2: #6f2e22;
  --accent: #d98f21;
  --accent-strong: #b66e13;
  --teal: #0f766e;
  --teal-soft: #d8f7ef;
  --blue: #2754c5;
  color: var(--ink);
  background: var(--page);
  font-family:
    Inter, "Segoe UI", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  margin: 0;
  background:
    linear-gradient(180deg, #f1e6d8 0, #eef1f6 420px),
    var(--page);
}

.app-header {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid #d8c3ac;
  background:
    linear-gradient(115deg, rgba(255, 248, 231, 0.92) 0 26%, transparent 26% 100%),
    linear-gradient(135deg, #f7c35f 0, #e7783f 34%, #9d3e2f 62%, #263f67 100%);
  color: #1a1614;
}

.app-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.36) 0 12px,
      transparent 12px 28px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0 22px,
      rgba(32, 28, 24, 0.11) 22px 25px,
      transparent 25px 48px
    );
  clip-path: polygon(54% 0, 100% 0, 100% 100%, 39% 100%);
  opacity: 0.55;
}

.app-header::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -34px;
  width: 340px;
  height: 118px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 8px;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.52) 0 8px,
      rgba(42, 35, 31, 0.18) 8px 20px
    ),
    rgba(255, 255, 255, 0.12);
  transform: rotate(-7deg);
  opacity: 0.42;
}

.brand {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 28px 32px 24px;
}

h1 {
  margin: 0;
  color: #181411;
  font-size: 36px;
  line-height: 1;
  letter-spacing: 0;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.28);
}

main {
  max-width: 1440px;
  margin: 0 auto;
  padding: 18px 32px 42px;
}

.filters,
.result-bar,
.pagination,
.movie-card,
.empty-state {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 12px 28px rgba(25, 32, 44, 0.08);
}

.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
  border-top: 3px solid var(--accent);
}

input,
select,
button {
  height: 40px;
  border: 1px solid #c5cedb;
  border-radius: 6px;
  background: #ffffff;
  color: var(--ink);
  font: inherit;
}

input,
select {
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    background 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 3px rgba(39, 84, 197, 0.13);
}

input {
  width: 220px;
  padding: 0 12px;
}

select {
  min-width: 112px;
  padding: 0 34px 0 12px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, #5f6673 50%) calc(100% - 17px) 17px / 5px 5px no-repeat,
    linear-gradient(135deg, #5f6673 50%, transparent 50%) calc(100% - 12px) 17px / 5px 5px no-repeat,
    #ffffff;
  cursor: pointer;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 78px;
  padding: 0 14px;
  cursor: pointer;
  transition:
    border-color 0.15s ease,
    background 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

button:hover:not(:disabled) {
  border-color: var(--blue);
  color: var(--blue);
  box-shadow: 0 5px 14px rgba(39, 84, 197, 0.14);
  transform: translateY(-1px);
}

button:disabled,
select:disabled,
input:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #111318;
  font-weight: 800;
}

.primary-action:hover:not(:disabled) {
  border-color: var(--accent-strong);
  background: var(--accent-strong);
  color: #ffffff;
}

.ghost-action {
  color: #475467;
}

.filter-menu,
.page-size-control,
.page-jump {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  color: #4f5a6b;
  white-space: nowrap;
}

.filter-menu span,
.page-size-control span,
.page-jump span {
  font-size: 14px;
}

.view-toggle {
  display: inline-flex;
  height: 40px;
  padding: 3px;
  border: 1px solid #c5cedb;
  border-radius: 6px;
  background: #eceff4;
}

.toplist-actions {
  display: inline-flex;
  gap: 8px;
}

.top-list-button {
  min-width: 116px;
  border-color: #bfc8d6;
  background: #ffffff;
  color: #253145;
  font-weight: 750;
}

.top-list-button[aria-pressed="true"] {
  border-color: #1d2027;
  background: #1d2027;
  color: #ffffff;
}

.view-toggle button {
  height: 32px;
  min-width: 54px;
  padding: 0 12px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #606b7c;
  box-shadow: none;
  transform: none;
}

.view-toggle button:hover {
  box-shadow: none;
  transform: none;
}

.view-toggle button[aria-pressed="true"] {
  background: #1d2027;
  color: #ffffff;
}

.result-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0;
  padding: 12px;
  background: #fbfcfe;
}

#status {
  color: #475467;
  font-size: 14px;
  line-height: 1.5;
}

.pagination {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 8px;
}

.pagination-top {
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.pagination-bottom {
  width: fit-content;
  margin: 20px auto 0;
}

.pagination.is-hidden {
  display: none;
}

.page-size-control select {
  width: 84px;
  min-width: 84px;
}

.page-jump input {
  width: 76px;
  text-align: center;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(380px, 1fr));
  gap: 14px;
}

.movie-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.movie-card {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  overflow: hidden;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.movie-card:hover {
  border-color: #b9c3d2;
  box-shadow: 0 16px 34px rgba(25, 32, 44, 0.13);
  transform: translateY(-1px);
}

.movie-grid .movie-card {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 382px;
  padding: 12px;
}

.movie-list .movie-card {
  grid-template-columns: 76px minmax(0, 1fr);
  min-height: 120px;
  padding: 10px 12px;
  border-left: 4px solid transparent;
}

.movie-list .movie-card:hover {
  border-left-color: var(--accent);
}

.poster {
  position: relative;
  width: 104px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe5ee;
  color: inherit;
  text-decoration: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25);
}

.movie-list .poster {
  width: 76px;
}

.poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 10px;
  color: #788294;
  font-size: 13px;
  text-align: center;
}

.poster img[src] + .poster-empty {
  display: none;
}

.movie-link {
  color: inherit;
  text-decoration: none;
}

.movie-link:not(.is-disabled):hover {
  color: var(--accent-strong);
}

.movie-link.is-disabled {
  cursor: default;
}

.movie-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.movie-grid .movie-body {
  display: contents;
}

.movie-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  min-width: 0;
}

.movie-grid .movie-row {
  grid-column: 2;
}

.movie-list .movie-row {
  grid-template-columns: minmax(160px, 0.72fr) minmax(0, 3.2fr);
  gap: 20px;
}

.movie-main,
.movie-facts div {
  min-width: 0;
}

.movie-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

h2 {
  margin: 0;
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.title-link {
  font-weight: 800;
}

.rank {
  flex: 0 0 auto;
  padding: 3px 7px;
  border: 1px solid #e1e6ee;
  border-radius: 999px;
  background: #f6f8fb;
  color: #606b7c;
  font-size: 12px;
  line-height: 1;
}

.movie-list .rank {
  display: none;
}

.meta,
.overview {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.meta:empty {
  display: none;
}

.movie-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px 12px;
  margin: 0;
}

.movie-list .movie-facts {
  grid-template-columns: repeat(6, minmax(70px, 1fr));
}

.movie-facts dt {
  margin: 0 0 4px;
  color: #8994a6;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.movie-facts dd {
  min-width: 0;
  margin: 0;
  overflow: hidden;
  color: #2d3645;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
}

.movie-list .movie-facts dt {
  margin-bottom: 5px;
  font-size: 13.5px;
}

.movie-list .movie-facts dd {
  font-size: 14.4px;
  line-height: 1.3;
}

.domestic-boxoffice,
.global-boxoffice {
  color: #9a5b0f;
  font-weight: 850;
}

.ratings {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  overflow: visible;
  color: var(--teal);
  font-weight: 850;
}

.rating-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  color: var(--teal);
  text-decoration: none;
}

.rating-link:hover {
  color: #0a5f58;
}

.rating-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  height: 18px;
  padding: 0 4px;
  border-radius: 4px;
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 10px;
  font-weight: 850;
  line-height: 1;
}

.movie-list .rating-logo {
  min-width: 32px;
  height: 20px;
  font-size: 11px;
}

.overview {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #354052;
  padding-top: 10px;
  padding-right: 8px;
  border-top: 1px solid #e8edf4;
  scrollbar-color: #b8c3d2 transparent;
  scrollbar-width: thin;
}

.overview::-webkit-scrollbar {
  width: 8px;
}

.overview::-webkit-scrollbar-track {
  background: transparent;
}

.overview::-webkit-scrollbar-thumb {
  border: 2px solid transparent;
  border-radius: 999px;
  background: #b8c3d2;
  background-clip: content-box;
}

.overview:hover {
  scrollbar-color: #8c98aa transparent;
}

.overview:hover::-webkit-scrollbar-thumb {
  background: #8c98aa;
  background-clip: content-box;
}

.movie-grid .overview {
  grid-column: 1 / -1;
  max-height: 160px;
}

.movie-list .overview {
  margin-top: 9px;
  padding-top: 8px;
  max-height: 48px;
  font-size: 14px;
  line-height: 1.42;
}

.empty-state {
  margin: 0;
  padding: 36px;
  color: var(--muted);
  text-align: center;
}

.top-movie-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 9px;
}

.top-movie-row {
  display: grid;
  grid-template-columns: 54px 62px minmax(0, 1fr) minmax(126px, 0.18fr);
  align-items: center;
  gap: 16px;
  min-width: 0;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-left: 4px solid transparent;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(25, 32, 44, 0.07);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease,
    transform 0.15s ease;
}

.top-movie-row:hover {
  border-left-color: var(--accent);
  box-shadow: 0 14px 30px rgba(25, 32, 44, 0.12);
  transform: translateY(-1px);
}

.top-poster {
  position: relative;
  display: block;
  width: 54px;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 6px;
  background: #dfe5ee;
  color: inherit;
  text-decoration: none;
}

.top-poster img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.top-poster img[src] + .poster-empty {
  display: none;
}

.top-rank {
  color: #8b520f;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

.top-summary {
  min-width: 0;
}

.top-title {
  color: #111827;
  text-decoration: none;
}

.top-title:hover {
  color: var(--accent-strong);
}

.top-meta,
.top-overview,
.top-quote,
.top-votes,
.top-domestic-boxoffice,
.top-global-boxoffice {
  margin: 5px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.top-overview {
  display: -webkit-box;
  color: #354052;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.top-overview:empty,
.top-quote:empty,
.top-votes:empty {
  display: none;
}

.top-score {
  min-width: 0;
  text-align: right;
}

.top-rating {
  display: block;
  color: var(--teal);
  font-size: 16px;
  line-height: 1.2;
}

.top-domestic-boxoffice,
.top-global-boxoffice {
  display: block;
  color: #8b520f;
  font-weight: 800;
}

@media (max-width: 980px) {
  .result-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .pagination-top {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .movie-list .movie-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .movie-list .movie-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .top-movie-row {
    grid-template-columns: 48px 54px minmax(0, 1fr);
  }

  .top-score {
    grid-column: 3;
    text-align: left;
  }
}

@media (max-width: 720px) {
  body {
    background:
      linear-gradient(180deg, #f4e4d2 0, #eef1f6 360px),
      var(--page);
  }

  .brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding: 24px 18px 18px;
  }

  h1 {
    font-size: 32px;
  }

  main {
    padding: 14px 14px 32px;
  }

  .filters {
    position: static;
    align-items: stretch;
    flex-direction: column;
  }

  input,
  select,
  button,
  .filter-menu,
  .filter-menu select {
    width: 100%;
  }

  .filter-menu {
    justify-content: space-between;
  }

  .result-bar {
    gap: 12px;
    padding: 12px;
  }

  #status {
    font-size: 13px;
  }

  .view-toggle {
    width: 100%;
  }

  .toplist-actions {
    width: 100%;
  }

  .top-list-button {
    flex: 1;
    min-width: 0;
  }

  .view-toggle button {
    flex: 1;
  }

  .pagination {
    width: 100%;
    flex-wrap: wrap;
  }

  .pagination button {
    flex: 1 1 120px;
  }

  .page-size-control,
  .page-jump {
    flex: 1 1 100%;
    justify-content: center;
  }

  .page-size-control select {
    width: 96px;
    min-width: 96px;
  }

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

  .movie-card,
  .movie-grid .movie-card,
  .movie-list .movie-card {
    grid-template-columns: 78px minmax(0, 1fr);
    min-height: 0;
    padding: 10px;
  }

  .poster,
  .movie-list .poster {
    width: 78px;
  }

  .movie-row,
  .movie-list .movie-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

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

  .movie-list .movie-facts dt {
    font-size: 12.5px;
  }

  .movie-list .movie-facts dd {
    font-size: 13.5px;
  }

  .movie-grid .overview,
  .movie-list .overview {
    grid-column: 1 / -1;
    max-height: 86px;
  }

  .top-movie-row {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 10px 12px;
    padding: 10px;
  }

  .top-poster {
    display: none;
  }

  .top-rank {
    font-size: 18px;
  }

  .top-score {
    grid-column: 2;
  }
}
