:root {
  --bg: #eef3f8;
  --panel: #ffffff;
  --panel-soft: #f6f9fc;
  --line: #d5deea;
  --line-strong: #c4d2e2;
  --text: #182433;
  --muted: #667588;
  --accent: #1f9d68;
  --accent-deep: #14734c;
  --accent-soft: #e7f7ef;
  --navy: #23364a;
  --shadow: 0 18px 48px rgba(27, 46, 73, 0.08);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  font-family: "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(62, 127, 214, 0.12), transparent 22rem),
    linear-gradient(180deg, #f4f8fc 0%, #eef3f8 14rem, #eaf0f7 100%);
  line-height: 1.65;
}

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

img {
  display: block;
  max-width: 100%;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header,
.page,
.site-footer nav,
.site-footer p {
  width: min(1440px, calc(100% - 40px));
  margin-left: auto;
  margin-right: auto;
}

.site-header {
  padding: 28px 0 0;
}

.header-top,
.header-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.header-top {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
}

.header-bottom {
  margin-top: 18px;
  padding: 16px 20px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 14px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 88px;
  height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--navy), #365579);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-copy strong,
.brand-copy small {
  display: block;
}

.brand-copy strong {
  font-size: 1.3rem;
}

.brand-copy small {
  color: var(--muted);
}

.search {
  display: flex;
  align-items: center;
  width: min(470px, 100%);
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 28px rgba(34, 54, 74, 0.06);
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0 18px;
  font: inherit;
  color: var(--text);
  outline: none;
}

.search button,
.download-button {
  border: 0;
  font: inherit;
  cursor: pointer;
}

.search button {
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.main-nav,
.utility-nav,
.tag-row,
.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.main-nav a,
.utility-nav a,
.site-footer nav a {
  transition: all 0.2s ease;
}

.utility-nav {
  justify-content: center;
  gap: 14px;
  padding: 12px 24px;
  border: 1px solid rgba(213, 222, 234, 0.9);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: 0 10px 24px rgba(31, 55, 87, 0.06);
  color: var(--muted);
  font-size: 1.08rem;
}

.utility-nav a {
  padding: 0 2px;
  border-radius: 0;
  color: var(--navy);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.utility-nav span {
  color: #9aabbe;
}

.utility-nav a:hover {
  color: var(--accent-deep);
}

.utility-nav a.active {
  margin: -6px -8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted);
  font-weight: 600;
}

.main-nav a.active,
.main-nav a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.page {
  padding: 28px 0 64px;
}

.page-home .page {
  padding-top: 16px;
}

.page-home .content-grid {
  margin-top: 0;
}

.hero-card,
.info-section,
.side-card {
  border: 1px solid rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.hero-card {
  padding: 24px;
  border-radius: 30px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.94rem;
  color: var(--muted);
}

.hero-main {
  display: grid;
  grid-template-columns: 256px minmax(0, 1fr) 290px;
  grid-template-areas:
    "cover copy download"
    "cover meta meta";
  align-items: start;
  gap: 24px;
  margin-top: 20px;
}

.cover-shell {
  grid-area: cover;
  padding: 18px;
  border-radius: 24px;
  background: linear-gradient(180deg, #f7fbff 0%, #edf4fb 100%);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
}

.hero-copy {
  grid-area: copy;
}

.cover-frame {
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 20px;
  overflow: hidden;
  flex: 0 0 auto;
}

.cover {
  width: 100%;
  height: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  object-position: center;
  display: block;
}

.hero-copy h1 {
  margin: 0 0 14px;
  font-size: clamp(2rem, 3vw, 2.8rem);
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lead {
  margin: 0;
  color: #344457;
  font-size: 1.02rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row {
  margin-top: 18px;
}

.tag-row a,
.tag-cloud a {
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4c5c70;
  font-size: 0.94rem;
}

.meta-grid {
  grid-area: meta;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin-top: 0;
}

.meta-grid div {
  padding: 18px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: linear-gradient(180deg, #f9fbfe 0%, #eef4fb 100%);
  box-shadow: 0 10px 24px rgba(31, 55, 87, 0.05);
}

.meta-grid span,
.intro-section .resource-content b {
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.meta-grid strong,
.intro-section .resource-content span {
  display: block;
  margin-top: 10px;
  font-size: 1.08rem;
  line-height: 1.2;
}

.download-panel {
  grid-area: download;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: start;
  min-height: 176px;
  padding: 14px;
  border: 1px solid #dbe7e2;
  border-radius: 26px;
  background:
    radial-gradient(circle at top center, rgba(41, 167, 110, 0.18), transparent 58%),
    linear-gradient(180deg, #f8fcfa 0%, #edf7f1 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.85);
  position: relative;
  overflow: hidden;
}

.download-panel::after {
  content: "";
  position: absolute;
  inset: auto -18% -34% auto;
  width: 210px;
  height: 210px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(36, 160, 103, 0.12), rgba(36, 160, 103, 0));
  pointer-events: none;
}

.download-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  width: min(100%, 208px);
  border-radius: 18px;
  font-weight: 800;
  position: relative;
  z-index: 1;
}

.download-button {
  background: var(--accent);
  color: #fff;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.main-column,
.sidebar {
  display: grid;
  gap: 24px;
  align-content: start;
}

.info-section,
.side-card {
  padding: 24px;
  border-radius: 26px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-head span {
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.section-head h2,
.section-head h3 {
  margin: 0;
  font-size: 1.45rem;
}

.intro-section .resource-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.intro-section .resource-content > article {
  padding: 22px 24px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.94) 100%);
  box-shadow: 0 10px 24px rgba(31, 55, 87, 0.04);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

.recommend-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-soft);
}

.recommend-card span {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.recommend-thumb {
  display: block;
}

.recommend-card img {
  border-radius: 16px;
}

.recommend-card b,
.recommend-card small {
  display: block;
}

.recommend-title {
  display: block;
  min-width: 0;
  color: var(--ink);
}

.recommend-card b {
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recommend-card small,
.rank-list small {
  color: var(--muted);
}

.recommend-tags,
.rank-tags {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.recommend-tags a,
.rank-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 10px;
  margin-right: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
}

.recommend-tags a:hover,
.rank-tags a:hover,
.rank-title:hover,
.recommend-title:hover {
  color: var(--accent-deep);
}

.rank-list {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-card,
.rank-list > li > a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 18px;
  background: var(--panel-soft);
  border: 1px solid var(--line);
}

.rank-card span,
.rank-list > li > a span {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.rank-list i {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: #fff;
  color: var(--accent-deep);
  font-style: normal;
  font-weight: 800;
}

.rank-list .top i {
  background: linear-gradient(135deg, #ffd87a, #ffb44f);
  color: #693c00;
}

.rank-list b {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-title {
  display: block;
  min-width: 0;
  color: var(--ink);
}

.site-footer {
  padding: 0 0 54px;
}

.site-footer nav {
  padding-top: 6px;
  justify-content: center;
}

.site-footer nav a {
  color: var(--muted);
}

.site-footer p {
  margin: 12px auto 0;
  color: var(--muted);
  text-align: center;
}

.error-panel {
  display: grid;
  justify-items: center;
  gap: 18px;
  padding: 72px 32px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 32px;
  background:
    radial-gradient(circle at top center, rgba(41, 167, 110, 0.12), transparent 32rem),
    rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-mark {
  font-size: clamp(4rem, 10vw, 7rem);
  line-height: 1;
  font-weight: 900;
  letter-spacing: 0.06em;
  color: var(--navy);
}

.error-panel h1 {
  margin: 0;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.1;
}

.error-panel p {
  margin: 0;
  max-width: 760px;
  color: #3c4e62;
  font-size: 1.04rem;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.error-actions .download-button {
  width: auto;
  min-width: 156px;
  padding: 0 26px;
}


.category-hero {
  padding: 24px;
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: var(--shadow);
}

.category-hero-main {
  display: block;
  margin-top: 18px;
}

.category-kicker {
  display: inline-block;
  color: var(--accent-deep);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.category-copy h1 {
  margin: 10px 0 14px;
  font-size: clamp(1.1rem, 1.7vw, 1.6rem);
  line-height: 1.1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-copy p {
  margin: 0;
  color: #3c4e62;
  font-size: 1.04rem;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

.category-filter a {
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4c5c70;
  font-size: 0.95rem;
}

.category-filter a.active,
.category-filter a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.category-section {
  min-width: 0;
}

.category-list {
  display: grid;
  gap: 16px;
}

.category-card {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(244, 249, 255, 0.94) 100%);
  box-shadow: 0 10px 24px rgba(31, 55, 87, 0.04);
}

.category-card img {
  aspect-ratio: 1 / 1;
  border-radius: 18px;
  object-fit: cover;
}

.category-card-body {
  min-width: 0;
}

.category-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  min-width: 0;
}

.category-card h3 {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.2;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card-meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.category-card-meta,
.category-card .tag-row {
  display: none;
}

.category-card-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  background: #eef4fb;
  border: 1px solid #d7e3ef;
  color: var(--navy);
  font-size: 0.92rem;
  font-weight: 600;
}

.category-card p {
  margin: 12px 0 0;
  color: #3c4e62;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card .tag-row {
  margin-top: 14px;
}

.category-card .tag-row span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: #4c5c70;
  font-size: 0.92rem;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 22px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  min-height: 42px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  color: #4c5c70;
}

.pagination a.active,
.pagination a:hover {
  background: var(--accent-soft);
  color: var(--accent-deep);
}

@media (max-width: 1180px) {
  .hero-main {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-areas:
      "cover copy"
      "download download"
      "meta meta";
  }

  .download-panel {
    grid-column: auto;
  }

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

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

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

  .category-card-meta {
    justify-content: flex-start;
  }
}

@media (max-width: 860px) {
  .header-top,
  .header-bottom,
  .hero-main,
  .sidebar,
  .intro-section .resource-content,
  .recommend-grid,
  .meta-grid {
    grid-template-columns: 1fr;
    display: grid;
  }

  .header-top,
  .header-bottom {
    gap: 16px;
  }

  .hero-main {
    grid-template-areas:
      "cover"
      "copy"
      "download"
      "meta";
  }

  .utility-nav {
    justify-content: flex-start;
  }

  .site-header,
  .page,
  .site-footer nav,
  .site-footer p {
    width: min(100% - 24px, 1440px);
  }

  .search,
  .cover-shell {
    width: 100%;
  }

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