:root {
  --bg: #f6f1ea;
  --paper: #fffaf3;
  --ink: #241d18;
  --muted: #776b61;
  --line: #e3d7ca;
  --accent: #9b3f2f;
  --accent-dark: #6f2a20;
  --nav: #211814;
  --shadow: 0 24px 70px rgba(58, 39, 24, .09);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(194, 139, 69, .12), transparent 28%),
    linear-gradient(180deg, #fbf7f0 0%, var(--bg) 100%);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.7;
}

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

.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 {
  background: rgba(255, 253, 248, .96);
  border-bottom: 1px solid rgba(227, 215, 202, .75);
  backdrop-filter: blur(20px);
}

.header-inner {
  max-width: 1360px;
  height: 82px;
  margin: 0 auto;
  padding: 0 28px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 230px;
  align-items: center;
  gap: 18px;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  background:
    linear-gradient(135deg, #33241c, var(--accent-dark));
  color: #fff7ea;
  font-weight: 800;
  font-size: 23px;
  box-shadow: 0 14px 28px rgba(46, 31, 22, .22);
}

.brand-text {
  display: grid;
  line-height: 1.2;
}

.brand-text strong {
  font-size: 19px;
  letter-spacing: .04em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--accent);
  font-weight: 700;
  letter-spacing: .04em;
}

.main-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  color: #54483f;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  overflow: visible;
}

.main-nav a,
.nav-more button {
  position: relative;
  display: block;
  padding: 10px 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}

.main-nav a:hover,
.nav-more button:hover {
  background: #f4ece2;
  color: var(--accent-dark);
}

.main-nav .active {
  background: var(--nav);
  color: #fff8ec;
  box-shadow: 0 12px 24px rgba(33, 24, 20, .12);
}

.nav-more {
  position: relative;
}

.nav-more button::after {
  content: "⌄";
  margin-left: 4px;
  color: var(--muted);
  font-size: 11px;
}

.nav-menu {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 20;
  min-width: 128px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fffdf8;
  box-shadow: 0 18px 42px rgba(49, 31, 20, .14);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .18s ease, transform .18s ease;
}

.nav-more:hover .nav-menu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-menu a {
  padding: 8px 10px;
  border-radius: 10px;
}

.sub-nav-wrap {
  border-top: 0;
  background:
    linear-gradient(90deg, #1f1713, #32231c 54%, #4a2b20);
}

.sub-nav {
  max-width: 1360px;
  margin: 0 auto;
  padding: 13px 28px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.sub-nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.sub-nav-links::-webkit-scrollbar {
  display: none;
}

.sub-nav-links a {
  position: relative;
  border-radius: 10px;
  color: #dfd0c1;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}

.sub-nav-links a:hover {
  background: rgba(255, 255, 255, .1);
  color: #fff8ec;
}

.sub-nav-links a.active {
  background: #fff8ec;
  color: #211814;
  box-shadow: 0 10px 20px rgba(0, 0, 0, .14);
}

.search {
  display: grid;
  grid-template-columns: 1fr auto;
  border: 1px solid #d8cbbb;
  border-radius: 12px;
  background: #fff;
  padding: 5px;
  box-shadow: 0 10px 24px rgba(57, 39, 25, .05);
}

.search input[type="search"] {
  min-width: 0;
  border: 0;
  outline: none;
  padding: 0 10px;
  background: transparent;
  color: var(--ink);
  font-size: 14px;
}

.search button {
  border: 0;
  border-radius: 10px;
  background: var(--nav);
  color: #fff;
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
}

.page {
  max-width: 1360px;
  margin: 0 auto;
  padding: 26px 28px 72px;
}

.breadcrumb {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 18px;
}

.breadcrumb a:hover {
  color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.main-column {
  min-width: 0;
}

.review-card,
.tag-cloud,
.side-card {
  background: rgba(255, 250, 243, .92);
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

.review-card {
  overflow: hidden;
}

.hero {
  display: grid;
  grid-template-columns: 172px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 42px 44px;
  background:
    radial-gradient(circle at 86% 18%, rgba(194, 139, 69, .16), transparent 30%),
    linear-gradient(135deg, #fffdf8 0%, #fbf0e1 100%);
}

.cover-wrap {
  width: 172px;
  height: 172px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.cover-wrap img {
  width: 168px;
  height: 168px;
  object-fit: contain;
}

h1 {
  margin: 0;
  color: #1d1713;
  font-size: 50px;
  line-height: 1.12;
  letter-spacing: -.04em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary {
  max-width: 720px;
  margin: 16px 0 0;
  color: #4f443c;
  font-size: 17px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tags a {
  display: inline-flex;
  align-items: center;
  border: 1px solid #eadbc9;
  border-radius: 10px;
  background: #fffaf3;
  color: var(--accent-dark);
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 800;
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.tags a:hover {
  border-color: rgba(155, 63, 47, .35);
  background: #fff3e4;
  color: var(--accent);
  transform: translateY(-1px);
}

.resource-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 28px;
  align-items: center;
  padding: 24px 44px;
  border-top: 1px solid #e7dacd;
  border-bottom: 1px solid #e7dacd;
  background:
    linear-gradient(90deg, #fffaf3, #fff5e7);
}

.resource-line dl {
  display: grid;
  grid-template-columns: .72fr .8fr 1.15fr .9fr;
  gap: 0;
  margin: 0;
}

.resource-line dl div {
  min-width: 0;
  padding: 0 20px;
  border-left: 1px solid #e4d6c7;
}

.resource-line dl div:first-child {
  border-left: 0;
  padding-left: 0;
}

.resource-line dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.resource-line dd {
  margin: 4px 0 0;
  color: #1f1813;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.download {
  display: grid;
  place-items: center;
  min-height: 54px;
  border-radius: 16px;
  background:
    linear-gradient(135deg, var(--accent-dark), var(--accent));
  color: #fffaf2;
  font-weight: 900;
  box-shadow: 0 16px 32px rgba(155, 63, 47, .22);
}

.resource-content {
  counter-reset: section;
}

.resource-content h2 {
  counter-increment: section;
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  align-items: start;
  margin: 0;
  padding: 34px 44px 8px;
  color: #211914;
  font-size: 25px;
  letter-spacing: -.02em;
}

.resource-content h2::before {
  content: counter(section, decimal-leading-zero);
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
}

.resource-content p {
  margin: 0;
  padding: 0 44px 30px 116px;
  color: #4f463f;
  font-size: 16px;
  border-bottom: 1px solid var(--line);
}

.tag-cloud {
  margin-top: 26px;
  padding: 26px 32px 30px;
  background: #fffaf3;
}

.tag-cloud h3 {
  margin: 0 0 16px;
  color: var(--accent-dark);
  font-size: 18px;
  letter-spacing: -.01em;
}

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

.tag-cloud a {
  max-width: 130px;
  padding: 7px 12px;
  border: 1px solid #eadfd1;
  border-radius: 999px;
  background: #fffaf3;
  color: #5f5148;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-cloud a:hover {
  border-color: rgba(155, 63, 47, .35);
  color: var(--accent-dark);
}

.side-card {
  padding: 24px;
  margin-bottom: 22px;
}

.side-card.warm {
  background: #fff5e7;
}

.side-title strong {
  display: block;
  margin-top: 6px;
  font-size: 23px;
  line-height: 1.2;
}

.review-list {
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.review-list li + li {
  border-top: 1px solid var(--line);
}

.review-list li {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 12px;
  padding: 15px 0;
}

.review-list span {
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-weight: 800;
}

.review-name {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 800;
  transition: color .2s ease;
}

.review-name:hover {
  color: var(--accent);
}

.review-list small {
  display: flex;
  gap: 6px;
  min-width: 0;
  margin-top: 7px;
}

.review-list small a {
  display: block;
  max-width: 82px;
  padding: 3px 7px;
  border: 1px solid #eadfd1;
  border-radius: 999px;
  color: var(--muted);
  background: #fffaf3;
  font-size: 12px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.review-list small a:hover {
  border-color: rgba(155, 63, 47, .32);
  color: var(--accent-dark);
}

.category-hero {
  margin-bottom: 26px;
  padding: 34px 42px;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 88% 10%, rgba(178, 101, 54, .16), transparent 32%),
    linear-gradient(135deg, #fffaf2 0%, #fff6e9 54%, #fffdf7 100%);
  box-shadow: var(--shadow);
}

.category-hero h1 {
  margin: 0;
  font-size: 44px;
  line-height: 1.12;
  letter-spacing: -.04em;
}

.category-hero p {
  max-width: 760px;
  margin: 14px 0 0;
  color: #51463f;
  font-size: 17px;
  line-height: 1.9;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.category-layout {
  align-items: start;
}

.category-card {
  margin-bottom: 26px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 250, 243, .86);
  box-shadow: var(--shadow);
}

.category-section-title {
  margin-bottom: 22px;
}

.category-section-title h2 {
  margin: 7px 0 0;
  font-size: 28px;
  line-height: 1.2;
}

.row-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
}

.resource-list {
  display: grid;
  gap: 0;
}

.resource-item {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) 108px;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--line);
}

.resource-item:first-child {
  padding-top: 0;
  border-top: 0;
}

.resource-thumb {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  background: #fff7eb;
  display: grid;
  place-items: center;
  overflow: hidden;
}

.resource-thumb img {
  width: 86px;
  height: 86px;
  object-fit: contain;
}

.resource-info {
  min-width: 0;
}

.resource-info h3 {
  margin: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  line-height: 1.25;
}

.resource-info h3 a {
  transition: color .2s ease;
}

.resource-info h3 a:hover {
  color: var(--accent);
}

.resource-info p {
  margin: 8px 0 0;
  color: #51463f;
  font-size: 14px;
  line-height: 1.7;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.resource-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}

.resource-meta a {
  max-width: 92px;
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border: 1px solid #eadfd1;
  border-radius: 999px;
  color: var(--muted);
  background: #fffaf3;
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.resource-meta a:hover {
  border-color: rgba(155, 63, 47, .35);
  background: #fff3e4;
  color: var(--accent);
  transform: translateY(-1px);
}

.resource-action {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 40px;
  border-radius: 999px;
  background: var(--accent-dark);
  color: #fff8ec;
  font-size: 13px;
  font-weight: 900;
  white-space: nowrap;
}

.resource-action:hover {
  background: var(--nav);
}

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

.pagination a,
.pagination span {
  min-width: 38px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid #eadfd1;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #554941;
  background: rgba(255, 255, 255, .72);
  font-weight: 800;
}

.pagination .active,
.pagination a:hover {
  border-color: var(--nav);
  background: var(--nav);
  color: #fff8ec;
}

.site-footer {
  max-width: 1360px;
  margin: 0 auto;
  padding: 28px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 14px;
}

.site-footer nav {
  display: flex;
  gap: 22px;
}

.site-footer p {
  margin: 0;
}

.page-404 {
  min-height: calc(100vh - 154px);
  display: grid;
  align-items: center;
  padding-top: 40px;
  padding-bottom: 56px;
}

.error-shell {
  max-width: 760px;
  margin: 0 auto;
  padding: 52px 56px;
  border: 1px solid var(--line);
  border-radius: 36px;
  background:
    radial-gradient(circle at 88% 12%, rgba(194, 139, 69, .16), transparent 30%),
    linear-gradient(135deg, #fffdf8 0%, #fbf2e5 100%);
  box-shadow: var(--shadow);
  text-align: center;
}

.error-code {
  margin: 0;
  color: var(--accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 72px;
  line-height: 1;
  letter-spacing: .04em;
}

.error-shell h1 {
  margin: 18px 0 0;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -.04em;
  white-space: normal;
}

.error-shell p {
  max-width: 520px;
  margin: 18px auto 0;
  color: #51463f;
  font-size: 16px;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}

.error-actions a {
  min-width: 148px;
  height: 48px;
  padding: 0 24px;
  border: 1px solid #e1d2c2;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .82);
  color: #4b4038;
  font-weight: 800;
  transition: border-color .2s ease, background .2s ease, color .2s ease, transform .2s ease;
}

.error-actions a:hover {
  border-color: rgba(155, 63, 47, .35);
  background: #fff3e4;
  color: var(--accent);
  transform: translateY(-1px);
}

.error-actions .primary {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff8ec;
}

.error-actions .primary:hover {
  border-color: var(--nav);
  background: var(--nav);
  color: #fff8ec;
}

@media (max-width: 1100px) {
  .header-inner {
    grid-template-columns: 220px 1fr;
  }

  .main-nav {
    justify-content: flex-end;
    overflow-x: auto;
  }

  .search {
    display: none;
  }

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

  .sidebar {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

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

  .resource-item {
    grid-template-columns: 80px minmax(0, 1fr);
  }

  .resource-thumb {
    width: 80px;
    height: 80px;
    border-radius: 20px;
  }

  .resource-thumb img {
    width: 72px;
    height: 72px;
  }

  .resource-action {
    grid-column: 2;
    justify-self: start;
  }

  .page-404 {
    min-height: auto;
  }

  .error-shell {
    padding: 42px 28px;
  }

  .error-shell h1 {
    font-size: 34px;
  }
}
