:root {
  --blue: #637cff;
  --violet: #8c7bff;
  --bg: #f5f7ff;
  --card: #ffffff;
  --ink: #202538;
  --muted: #7a8298;
  --line: #edf0f7;
  --primary: #5967e8;
  --yellow: #ffd21c;
  --red: #ff3f6f;
  --shadow: 0 18px 48px rgba(75, 92, 185, 0.14);
  font-family:
    Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(91, 120, 255, 0.97) 0, rgba(129, 124, 255, 0.86) 205px, rgba(226, 232, 255, 0.55) 370px, rgba(255, 255, 255, 0.96) 575px, #fff 680px),
    linear-gradient(135deg, rgba(255, 255, 255, 0.2) 0 1px, transparent 1px 96px),
    linear-gradient(45deg, rgba(255, 255, 255, 0.12) 0 1px, transparent 1px 128px),
    var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

.hero {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 30;
  width: 100%;
  height: 74px;
  padding-top: 8px;
  background: linear-gradient(180deg, rgba(91, 120, 255, 0.97), rgba(129, 124, 255, 0.9));
  box-shadow: 0 12px 28px rgba(85, 93, 210, 0.08);
}

.topbar {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 30px;
  align-items: center;
  width: min(930px, calc(100% - 40px));
  margin: 0 auto;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 58px;
}

.brand img {
  display: block;
  width: 228px;
  height: auto;
}

.media-tabs {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.media-tab {
  padding: 7px 14px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
}

.media-tab.is-active {
  color: var(--primary);
  background: #fff;
}

.layout {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  width: min(980px, calc(100% - 20px));
  margin: 84px auto 44px;
}

.sidebar,
.ranking-panel {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(255, 255, 255, 0.94));
  border-radius: 9px 9px 0 0;
  box-shadow: 0 20px 54px rgba(91, 108, 198, 0.06);
}

.sidebar {
  position: sticky;
  top: 86px;
  z-index: 12;
  align-self: start;
  min-height: 493px;
  padding: 20px 18px;
}

.sidebar-title {
  margin: 0 0 24px;
  color: var(--primary);
  font-size: 16px;
  font-weight: 800;
}

.filter-group + .filter-group {
  margin-top: 24px;
}

.update-group {
  display: none;
}

.filter-group h2 {
  margin: 0 0 10px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.side-link {
  display: block;
  width: 100%;
  padding: 3px 0;
  color: var(--ink);
  text-align: left;
  background: transparent;
  border: 0;
  font-size: 13px;
  line-height: 1.55;
}

.side-link.is-active,
.side-link:hover {
  color: var(--primary);
  font-weight: 800;
}

.ranking-panel {
  min-height: 493px;
  padding: 22px 34px 0 22px;
}

.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  min-height: 24px;
  padding-bottom: 0;
}

.breadcrumb {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.panel-head h1,
.panel-head h2 {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.period-badge {
  color: #7f88db;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.ranking-list {
  display: grid;
}

.rank-item {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) 86px 104px;
  gap: 10px;
  align-items: center;
  min-height: 111px;
  padding: 9px 0;
  color: inherit;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition:
    background 0.2s ease,
    transform 0.2s ease;
}

.rank-item:hover {
  background: rgba(246, 248, 255, 0.42);
}

.poster {
  position: relative;
  width: 70px;
  height: 96px;
  overflow: hidden;
  background:
    radial-gradient(circle at 42% 25%, rgba(255, 255, 255, 0.75), transparent 17px),
    linear-gradient(135deg, #ffb35f, #3f57bc 72%);
  background-position: center;
  background-size: cover;
  border-radius: 8px;
}

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

.rank-item:nth-child(2) .poster {
  background:
    radial-gradient(circle at 40% 24%, rgba(255, 255, 255, 0.74), transparent 17px),
    linear-gradient(135deg, #89b5ff, #1b244a 72%);
}

.rank-item:nth-child(3) .poster {
  background:
    radial-gradient(circle at 38% 24%, rgba(255, 255, 255, 0.72), transparent 17px),
    linear-gradient(135deg, #ff8e56, #632323 72%);
}

.rank-item:nth-child(4) .poster {
  background:
    radial-gradient(circle at 40% 24%, rgba(255, 255, 255, 0.7), transparent 17px),
    linear-gradient(135deg, #ffd5df, #b55c74 72%);
}

.rank-badge {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  color: #fff;
  background: var(--yellow);
  border-radius: 0 0 7px;
  font-size: 11px;
  font-weight: 900;
}

.rank-item:first-child .rank-badge {
  background: var(--red);
}

.rank-content {
  min-width: 0;
  padding-right: 10px;
}

.rank-content h3 {
  margin: 0 0 6px;
  overflow: hidden;
  color: #1d2233;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.meta,
.description {
  margin: 0;
  color: #5f6678;
  font-size: 12px;
  line-height: 1.62;
}

.description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
}

.more-link {
  color: #3f63ff;
  font-size: 12px;
  font-weight: 700;
  justify-self: end;
  padding-right: 10px;
  text-align: right;
  white-space: nowrap;
}

.more-link:hover {
  color: #2446dc;
  text-decoration: underline;
}

.heat {
  display: grid;
  justify-items: center;
  gap: 5px;
  min-height: 78px;
  align-content: center;
  color: #a7adbc;
  border-left: 1px solid #eef1f8;
}

.heat strong {
  color: #9299aa;
  font-size: 14px;
  font-weight: 800;
}

.heat span {
  font-size: 12px;
}

.empty-state {
  margin: 52px 0;
  color: var(--muted);
  text-align: center;
  font-size: 13px;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 40px;
  color: #7b84a0;
  font-size: 13px;
}

.seo-copy {
  max-width: 720px;
  margin-top: 22px;
  color: #8a91a4;
  font-size: 12px;
  line-height: 1.8;
}

.seo-copy p {
  margin: 0;
}

.detail-layout .sidebar {
  min-height: 360px;
}

.detail-panel {
  padding-bottom: 28px;
}

.detail-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.detail-top .breadcrumb {
  text-align: right;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  color: #3f63ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.detail-main {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  margin-top: 20px;
}

.detail-poster {
  width: 112px;
  height: 150px;
}

.detail-main h1 {
  margin: 0 0 12px;
  color: #1d2233;
  font-size: 26px;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.detail-tags span {
  padding: 6px 10px;
  color: #5360d9;
  background: rgba(246, 248, 255, 0.96);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.detail-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.detail-heat,
.detail-rating {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: #8a91a4;
}

.detail-heat strong,
.detail-rating strong {
  color: var(--primary);
  font-size: 28px;
}

.detail-rating strong {
  color: #ffb800;
}

.detail-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.detail-section h2 {
  margin: 0 0 14px;
  color: #1d2233;
  font-size: 18px;
}

.watch-grid {
  display: grid;
  grid-template-columns: minmax(180px, 260px);
  gap: 10px;
}

.watch-grid a {
  position: relative;
  min-height: 74px;
  padding: 14px 38px 12px 14px;
  color: #1f2434;
  background: linear-gradient(180deg, #fff4b7, #ffd21c);
  border: 1px solid rgba(255, 210, 28, 0.72);
  border-radius: 14px;
  box-shadow: 0 10px 22px rgba(255, 194, 0, 0.14);
}

.watch-grid strong,
.watch-grid span {
  display: block;
}

.watch-grid strong {
  font-size: 16px;
}

.watch-grid span {
  margin-top: 5px;
  color: rgba(31, 36, 52, 0.66);
  font-size: 12px;
}

.watch-note {
  margin: 10px 0 0;
  color: #8a91a4;
  font-size: 12px;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.detail-meta-grid div {
  padding: 12px;
  background: rgba(246, 248, 255, 0.72);
  border-radius: 12px;
}

.detail-meta-grid dt {
  color: #8a91a4;
  font-size: 12px;
}

.detail-meta-grid dd {
  margin: 6px 0 0;
  color: #4f586d;
  font-size: 13px;
  font-weight: 800;
}

.detail-description {
  max-width: 640px;
  margin: 0;
  color: #4f586d;
  font-size: 14px;
  line-height: 1.8;
}

.related-list {
  display: grid;
  gap: 10px;
}

.related-list a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  color: #4f586d;
  background: rgba(246, 248, 255, 0.72);
  border-radius: 12px;
}

.related-list strong {
  color: var(--primary);
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 34px;
  padding: 0 13px;
  color: #5360d9;
  background: rgba(246, 248, 255, 0.94);
  border: 1px solid rgba(89, 103, 232, 0.12);
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.page-btn.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 8px 18px rgba(89, 103, 232, 0.22);
}

.page-btn:not(.is-active):not(.page-btn-disabled):hover {
  color: #fff;
  background: #7480ff;
  border-color: #7480ff;
}

.page-btn-disabled {
  color: #b2b8c9;
  background: rgba(246, 248, 255, 0.58);
  border-color: rgba(141, 150, 176, 0.12);
  box-shadow: none;
}

.page-more {
  color: #8d95aa;
  font-weight: 800;
}

@media (max-width: 760px) {
  body {
    background:
      linear-gradient(180deg, rgba(89, 115, 255, 0.98) 0, rgba(140, 123, 255, 0.86) 220px, transparent 360px),
      var(--bg);
  }

  .hero {
    position: relative;
    left: auto;
    top: auto;
    z-index: auto;
    width: auto;
    height: auto;
    padding: 18px 14px 14px;
    background: transparent;
    box-shadow: none;
  }

  .topbar {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 12px;
    width: 100%;
  }

  .brand {
    grid-column: 1;
    justify-content: flex-start;
    height: 44px;
    padding: 0;
    background: transparent;
    border: 0;
  }

  .brand img {
    width: 176px;
  }

  .media-tabs {
    grid-row: 1;
    grid-column: 2;
    justify-content: flex-end;
    align-self: center;
    gap: 8px;
  }

  .media-tab {
    padding: 7px 12px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 12px;
  }

  .media-tab.is-active {
    background: #fff;
  }

  .layout {
    display: block;
    width: calc(100% - 24px);
    margin: 0 auto 28px;
  }

  .detail-layout {
    margin-top: 0;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: auto;
    margin: 0 -12px;
    padding: 8px 12px 0;
    background: linear-gradient(180deg, rgba(112, 119, 255, 0.94), rgba(142, 125, 255, 0.88));
    border-radius: 0;
    backdrop-filter: blur(12px);
    box-shadow: 0 10px 24px rgba(85, 93, 210, 0.12);
  }

  .detail-layout .sidebar {
    min-height: auto;
  }

  .sidebar-title {
    display: none;
  }

  .filter-group + .filter-group {
    margin-top: 0;
  }

  .update-group {
    display: none;
  }

  .filter-group {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 0 0 10px;
    scrollbar-width: none;
  }

  .filter-group::-webkit-scrollbar {
    display: none;
  }

  .filter-group h2 {
    display: none;
  }

  .side-link {
    flex: 0 0 auto;
    width: auto;
    padding: 9px 14px;
    color: rgba(255, 255, 255, 0.88);
    background: rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    font-weight: 800;
    line-height: 1;
  }

  .side-link.is-active {
    color: var(--primary);
    background: #fff;
  }

  .ranking-panel {
    margin-top: 0;
    padding: 16px 14px 18px;
    border-radius: 14px;
  }

  .panel-head {
    align-items: flex-start;
    padding-bottom: 4px;
  }

  .breadcrumb {
    margin-bottom: 6px;
  }

  .panel-head h2 {
    font-size: 20px;
  }

  .period-badge {
    padding: 6px 9px;
    background: #f4f6ff;
    border-radius: 999px;
  }

  .rank-item {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    min-height: 0;
    padding: 14px 0;
  }

  .poster {
    width: 68px;
    height: 92px;
  }

  .rank-content h3 {
    font-size: 16px;
  }

  .description {
    -webkit-line-clamp: 2;
  }

  .more-link {
    display: none;
  }

  .heat {
    grid-column: 2;
    display: flex;
    justify-content: flex-start;
    min-height: auto;
    color: var(--muted);
    border-left: 0;
  }

  .heat strong {
    color: var(--primary);
  }

  .pagination {
    display: none;
  }

  .seo-copy {
    margin-top: 18px;
  }

  .detail-main {
    grid-template-columns: 74px minmax(0, 1fr);
    gap: 12px;
    margin-top: 14px;
  }

  .detail-poster {
    width: 68px;
    height: 92px;
  }

  .detail-main h1 {
    font-size: 20px;
  }

  .detail-back {
    order: 1;
    display: inline-flex;
    width: fit-content;
    margin-top: 0;
    margin-left: 0;
  }

  .detail-top .breadcrumb {
    order: 2;
    display: inline-block;
    max-width: calc(100% - 120px);
    overflow: hidden;
    margin-left: auto;
    text-align: right;
    text-overflow: ellipsis;
    vertical-align: middle;
    white-space: nowrap;
  }

  .detail-top {
    gap: 8px;
  }

  .detail-tags {
    gap: 6px;
    margin-bottom: 10px;
  }

  .detail-tags span {
    padding: 5px 8px;
    font-size: 11px;
  }

  .detail-stats {
    gap: 10px;
  }

  .detail-heat strong,
  .detail-rating strong {
    font-size: 22px;
  }

  .watch-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .watch-grid a {
    min-height: 68px;
    padding: 12px 36px 10px 12px;
  }

  .detail-section {
    margin-top: 18px;
    padding-top: 16px;
  }

  .detail-section h2 {
    font-size: 16px;
  }

  .detail-meta-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .related-list a {
    padding: 11px 12px;
  }

  .page-btn {
    flex: 0 0 auto;
    min-width: 34px;
    height: 32px;
    padding: 0 12px;
  }
}
