/*
Theme Name: Yingzhan Netdisk Movie
Theme URI: https://example.com/
Author: Yingzhan
Description: A WordPress theme for movie and TV netdisk resource publishing.
Version: 0.3.0
Requires at least: 6.0
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: yingzhan
*/

:root {
  --bg: #f5f6f1;
  --ink: #161b18;
  --muted: #667069;
  --line: #d9ded7;
  --brand: #117766;
  --accent: #df563f;
  --gold: #b8842e;
  --panel: #ffffff;
  --shadow: 0 16px 42px rgba(23, 32, 27, 0.12);
}

/* Kuakes-style resource portal skin */
:root {
  --bg: #f4f5f7;
  --ink: #252a32;
  --muted: #7b8490;
  --line: #edf0f3;
  --brand: #2677ff;
  --accent: #ff7a1a;
  --gold: #ffb400;
  --panel: #ffffff;
  --shadow: 0 8px 24px rgba(31, 42, 55, 0.06);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

.site-header {
  position: sticky;
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 3px 18px rgba(31, 42, 55, 0.04);
}

.header-inner {
  min-height: 68px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2677ff, #21c6a8);
  font-size: 22px;
}

.brand strong {
  color: #1f2937;
  font-size: 22px;
}

.brand small {
  color: #8a93a0;
}

.main-nav {
  flex: 1;
  justify-content: center;
  gap: 0;
}

.main-nav a {
  min-height: 68px;
  color: #2d3540;
  padding: 0 13px;
  font-size: 15px;
  font-weight: 700;
}

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

.top-links a {
  color: #6b7280;
  font-size: 13px;
}

.top-links a:first-child {
  border-radius: 999px;
  background: #eef5ff;
  color: var(--brand);
  padding: 8px 12px;
  font-weight: 700;
}

.nav-strip {
  background: #f9fafb;
}

.nav-strip-inner {
  min-height: 42px;
}

.nav-strip span,
.nav-strip a {
  font-size: 13px;
}

.hero {
  min-height: 260px;
  background: #f6f8fb;
}

.hero-media {
  background:
    linear-gradient(180deg, rgba(246, 248, 251, 0.55), rgba(246, 248, 251, 0.96)),
    radial-gradient(circle at 20% 20%, rgba(38, 119, 255, 0.18), transparent 34%),
    radial-gradient(circle at 80% 30%, rgba(255, 122, 26, 0.14), transparent 28%);
}

.hero-content {
  align-items: center;
  min-height: 260px;
  padding: 38px 0 32px;
  color: var(--ink);
  text-align: center;
}

.hero h1 {
  display: none;
}

.hero-copy {
  max-width: 760px;
  margin: 10px 0 20px;
  color: #4b5563;
  font-size: 18px;
}

.hero .eyebrow {
  color: var(--brand);
}

.search-row {
  width: min(720px, 100%);
  border: 1px solid #dbe5f2;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(38, 119, 255, 0.12);
}

.search-row input {
  color: var(--ink);
  padding: 17px 22px;
}

.search-row input::placeholder {
  color: #a1a9b4;
}

.search-row button {
  border-radius: 999px;
  background: var(--brand);
  margin: 6px;
  padding: 0 28px;
}

.hero-stats {
  justify-content: center;
}

.hero-stats span {
  border: 0;
  background: #fff;
  color: #667085;
  box-shadow: var(--shadow);
}

.hero-stats strong {
  color: var(--accent);
}

.toolbar {
  justify-content: center;
  padding: 18px 0 0;
}

.filter-group a,
.selects select {
  min-height: 34px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: #4b5563;
  box-shadow: 0 4px 14px rgba(31, 42, 55, 0.04);
}

.filter-group a.active {
  background: var(--brand);
  color: #fff;
}

.section {
  padding: 28px 0;
}

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

.movie-section,
.rank-card,
.topic-card,
.download-panel,
.feedback-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.movie-section {
  padding: 18px;
}

.kuakes-index {
  padding-top: 22px;
}

.kuakes-banner {
  min-height: 190px;
}

.kuakes-banner .hero-content {
  min-height: 190px;
}

.kuakes-cats {
  margin-top: -10px;
}

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

.post-row {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding: 12px 0;
}

.post-row:last-child {
  border-bottom: 0;
}

.row-cover {
  display: block;
  width: 72px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 6px;
  background: #eef2f6;
}

.row-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.row-body {
  min-width: 0;
}

.row-title {
  display: block;
  overflow: hidden;
  color: #1f2937;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  color: #98a2b3;
  font-size: 12px;
}

.row-meta a {
  color: var(--brand);
}

.row-meta em {
  color: var(--accent);
  font-style: normal;
}

.section-head.compact {
  align-items: center;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.section-head.compact h2 {
  color: #1f2937;
  font-size: 20px;
}

.section-head.compact h2::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 18px;
  margin-right: 8px;
  border-radius: 999px;
  background: var(--brand);
  vertical-align: -3px;
}

.section-head.compact a {
  color: #98a2b3;
}

.compact-grid,
.resource-grid {
  grid-template-columns: repeat(auto-fill, minmax(172px, 1fr));
  gap: 16px;
}

.resource-card {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.resource-card:hover {
  transform: none;
  box-shadow: none;
}

.poster {
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(31, 42, 55, 0.1);
}

.badge {
  background: rgba(38, 119, 255, 0.92);
}

.card-body {
  padding: 10px 2px 0;
}

.card-body h3 {
  min-height: 42px;
  font-size: 15px;
}

.meta {
  color: #8a93a0;
}

.tag-row span {
  border: 0;
  background: #f2f6fb;
  color: #667085;
}

.open-link,
.feedback-button {
  background: var(--brand);
}

.resource-card .open-link {
  min-height: 34px;
  border-radius: 999px;
  font-size: 13px;
}

.rank-card {
  top: 124px;
  padding: 18px;
}

.rank-list span {
  background: #fff2e5;
  color: var(--accent);
}

.section-band {
  background: transparent;
}

.topic-grid {
  grid-template-columns: repeat(6, 1fr);
}

.topic-card {
  min-height: 96px;
  border-left: 0;
  padding: 16px;
}

.topic-card strong {
  color: #1f2937;
  font-size: 17px;
}

.detail {
  grid-template-columns: 290px 1fr;
}

.breadcrumb {
  color: #98a2b3;
}

.detail-poster img {
  border-radius: 8px;
}

.detail h1 {
  color: #1f2937;
}

.download-panel {
  border-color: #dbeafe;
}

.site-footer {
  background: #fff;
}

@media (max-width: 980px) {
  .top-links {
    display: none;
  }

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

  .topic-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

img {
  max-width: 100%;
  height: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid rgba(223, 228, 221, 0.8);
  background: rgba(246, 247, 244, 0.94);
  backdrop-filter: blur(18px);
}

.header-inner,
.wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
}

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

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  font-weight: 800;
}

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

.brand small,
.eyebrow,
.result-count,
.meta {
  color: var(--muted);
  font-size: 13px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #334139;
  font-size: 15px;
}

.main-nav .menu-item {
  list-style: none;
}

.main-nav a {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  font-weight: 700;
}

.main-nav a:hover,
.nav-strip a:hover {
  color: var(--accent);
}

.nav-strip {
  border-top: 1px solid rgba(217, 222, 215, 0.72);
  background: rgba(255, 255, 255, 0.62);
}

.nav-strip-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 46px;
  overflow-x: auto;
  white-space: nowrap;
}

.nav-strip span {
  color: var(--muted);
  font-size: 13px;
}

.nav-strip a {
  color: #344239;
  font-size: 14px;
  font-weight: 700;
}

.mini-search {
  margin-left: auto;
}

.mini-search input {
  width: 160px;
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 0 10px;
}

.hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  background: #101816;
}

.hero-media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(12, 18, 16, 0.92), rgba(12, 18, 16, 0.52), rgba(12, 18, 16, 0.18)),
    url("https://images.unsplash.com/photo-1489599849927-2ee91cede3ba?auto=format&fit=crop&w=1800&q=82") center / cover;
}

.hero-content {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 520px;
  padding: 56px 0 88px;
  color: #fff;
}

.eyebrow {
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0;
  font-size: clamp(56px, 8vw, 104px);
  line-height: 0.95;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 610px;
  margin: 22px 0 30px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 20px;
  line-height: 1.7;
}

.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-stats span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.82);
  padding: 0 12px;
}

.hero-stats strong {
  color: #fff;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(640px, 100%);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.12);
}

input,
select,
button {
  font: inherit;
}

.search-row input {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #fff;
  padding: 17px 18px;
  outline: 0;
}

.search-row input::placeholder {
  color: rgba(255, 255, 255, 0.62);
}

.search-row button,
.open-link,
.feedback-button {
  border: 0;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

.search-row button {
  padding: 0 24px;
}

.archive-search {
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(720px, 100%);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  margin: 0 0 22px;
}

.archive-search input {
  min-width: 0;
  border: 0;
  padding: 15px 16px;
  outline: 0;
}

.archive-search button {
  border: 0;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  padding: 0 22px;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 0 6px;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-group a,
.selects select {
  display: inline-grid;
  min-height: 40px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #26332c;
  padding: 0 14px;
}

.filter-group a.active {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.filter-secondary a {
  min-height: 34px;
  border-style: dashed;
  font-size: 13px;
}

.section {
  padding: 42px 0;
}

.section-band {
  width: 100%;
  background: #e9eee8;
}

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

.section-head.compact {
  margin-bottom: 14px;
}

.section-head.compact h2 {
  font-size: 22px;
}

.section-head.compact a {
  color: var(--brand);
  font-weight: 700;
}

.section h2,
.archive-title {
  margin: 0;
  font-size: 30px;
}

.resource-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

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

.home-layout {
  display: grid;
  grid-template-columns: 1fr 310px;
  gap: 24px;
  align-items: start;
}

.home-main {
  display: grid;
  gap: 34px;
}

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

.rank-card {
  position: sticky;
  top: 136px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 18px;
}

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

.rank-list li {
  display: grid;
  grid-template-columns: 28px 1fr auto;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.rank-list span {
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 6px;
  background: #eef3ef;
  color: var(--brand);
  font-size: 13px;
  font-weight: 800;
}

.rank-list a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-list em {
  color: var(--accent);
  font-style: normal;
  font-weight: 800;
}

.resource-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(23, 32, 27, 0.06);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.resource-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 28px rgba(23, 32, 27, 0.1);
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  background: #d7ded8;
}

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

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 6px;
  background: rgba(15, 123, 104, 0.92);
  color: #fff;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 700;
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  min-height: 48px;
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.4;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.tag-row span {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: #455248;
  padding: 4px 8px;
  font-size: 12px;
}

.open-link,
.feedback-button {
  display: inline-grid;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  padding: 0 14px;
}

.feedback-button.secondary {
  background: var(--brand);
}

.resource-card .open-link {
  width: 100%;
}

.topic-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.topic-card {
  display: grid;
  gap: 8px;
  min-height: 116px;
  align-content: center;
  border-left: 4px solid var(--gold);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.topic-card strong {
  font-size: 20px;
}

.topic-card span {
  color: var(--muted);
  line-height: 1.6;
}

.detail {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 34px;
  padding: 44px 0;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  padding-top: 22px;
  font-size: 14px;
}

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

.detail-poster img {
  width: 100%;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.detail h1 {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.15;
}

.detail-content {
  color: #4e5a53;
  line-height: 1.85;
}

.detail h2 {
  margin-top: 0;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.link-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.download-panel {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 20px;
}

.download-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.download-head h2 {
  margin: 0;
}

.download-head span {
  color: var(--muted);
  font-size: 13px;
}

.link-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.link-item strong {
  display: block;
}

.link-item small {
  color: var(--muted);
}

.notice {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 36px;
  border-top: 1px solid var(--line);
}

.notice p {
  color: var(--muted);
  line-height: 1.7;
}

.lead {
  max-width: 720px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.8;
}

.feedback-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
}

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

.feedback-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 22px;
}

.feedback-card strong {
  display: block;
  margin-bottom: 10px;
}

.feedback-card p {
  color: var(--muted);
  line-height: 1.75;
}

.feedback-form {
  display: grid;
  gap: 14px;
  max-width: 720px;
  margin-top: 24px;
}

.feedback-form label {
  display: grid;
  gap: 7px;
  color: #344239;
  font-weight: 700;
}

.feedback-form input,
.feedback-form select,
.feedback-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 13px 14px;
  outline: 0;
}

.feedback-form textarea {
  resize: vertical;
}

.form-message {
  border: 1px solid rgba(17, 119, 102, 0.22);
  border-radius: 8px;
  background: rgba(17, 119, 102, 0.08);
  color: var(--brand);
  padding: 12px 14px;
}

.site-footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 26px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 28px;
}

.footer-grid strong,
.footer-grid a {
  display: block;
}

.footer-grid strong {
  margin-bottom: 10px;
  color: var(--ink);
}

.footer-grid a {
  margin: 7px 0;
}

@media (max-width: 780px) {
  .main-nav {
    display: none;
  }

  .nav-strip-inner {
    width: 100%;
    padding: 0 16px;
  }

  .mini-search {
    display: none;
  }

  .hero,
  .hero-content {
    min-height: 500px;
  }

  .hero-copy {
    font-size: 17px;
  }

  .toolbar,
  .section-head,
  .notice,
  .detail,
  .download-head,
  .home-layout {
    display: block;
  }

  .rank-card {
    position: static;
    margin-top: 24px;
  }

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

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

  .search-row,
  .archive-search {
    grid-template-columns: 1fr;
  }

  .search-row button,
  .archive-search button {
    min-height: 48px;
  }

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

  .detail h1 {
    margin-top: 22px;
    font-size: 32px;
  }

  .link-item {
    grid-template-columns: 1fr;
  }
}

/* Portal layout: placed last so it reliably overrides the legacy theme layer. */
:root {
  --bg: #f5f6f8;
  --ink: #242832;
  --muted: #8a919c;
  --line: #eceef2;
  --brand: #2f74eb;
  --accent: #ff7828;
  --panel: #ffffff;
  --shadow: 0 5px 18px rgba(29, 40, 57, 0.05);
}

body {
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
}

.header-inner,
.wrap {
  width: min(1280px, calc(100% - 48px));
}

.site-header {
  position: relative;
  border-bottom: 1px solid #eceef1;
  background: #fff;
  box-shadow: none;
  backdrop-filter: none;
}

.header-inner {
  min-height: 70px;
  gap: 24px;
}

.brand {
  flex: 0 0 auto;
  gap: 9px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 5px;
  background: #2f74eb;
  font-size: 20px;
}

.brand strong {
  color: #222733;
  font-size: 22px;
  line-height: 1;
}

.main-nav {
  flex: 1;
  justify-content: flex-start;
  gap: 0;
}

.main-nav a {
  min-height: 70px;
  padding: 0 16px;
  color: #303640;
  font-size: 15px;
  font-weight: 500;
}

.main-nav a:hover {
  color: var(--brand);
}

.top-links {
  display: flex;
  align-items: center;
  gap: 11px;
  color: #777f8b;
  font-size: 13px;
}

.top-links a:first-child {
  border-radius: 0;
  background: transparent;
  color: #777f8b;
  padding: 0;
  font-weight: 400;
}

.top-links > a:nth-child(2) {
  border-radius: 3px;
  background: #356ee8;
  color: #fff;
  padding: 10px 17px;
}

.header-search {
  display: flex;
  overflow: hidden;
  width: 32px;
  height: 32px;
  margin-left: 2px;
  border-radius: 4px;
  transition: width 0.2s ease;
}

.header-search:focus-within {
  width: 190px;
  border: 1px solid #dde2e9;
}

.header-search input[type="search"] {
  min-width: 0;
  width: 0;
  border: 0;
  outline: 0;
}

.header-search:focus-within input[type="search"] {
  width: 150px;
  padding: 0 9px;
}

.header-search button {
  width: 32px;
  min-width: 32px;
  border: 0;
  background: #f1f3f6;
  color: #5f6874;
  cursor: pointer;
  font-size: 16px;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 100;
  transform: translateY(-150%);
  border-radius: 4px;
  background: #fff;
  color: var(--brand);
  padding: 10px 14px;
  box-shadow: var(--shadow);
}

.skip-link:focus {
  transform: translateY(0);
}

.mobile-nav {
  display: none;
}

.portal-home {
  min-height: 70vh;
}

.portal-search {
  display: grid;
  min-height: 172px;
  place-items: center;
  background:
    linear-gradient(90deg, rgba(236, 244, 255, 0.22), rgba(235, 247, 251, 0.25)),
    url("assets/site-cover.jpg") center 52% / cover;
}

.portal-search-inner {
  display: flex;
  justify-content: center;
}

.portal-search .search-row {
  width: min(720px, 100%);
  grid-template-columns: 1fr 90px;
  border: 0;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 10px 26px rgba(44, 76, 122, 0.12);
}

.portal-search .search-row input {
  min-height: 52px;
  border: 0;
  background: transparent;
  color: #323844;
  padding: 0 18px;
}

.portal-search .search-row input::placeholder {
  color: #a0a7b1;
}

.portal-search .search-row button {
  min-height: 52px;
  margin: 0;
  border-radius: 0 5px 5px 0;
  background: transparent;
  color: #303640;
  font-size: 25px;
}

.portal-content {
  padding: 24px 0 42px;
}

.top-panels {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 250px;
  gap: 16px;
  align-items: stretch;
}

.portal-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  padding: 0;
}

.portal-heading {
  display: flex;
  min-height: 34px;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 15px;
  border-bottom: 1px solid var(--line);
}

.portal-heading h2 {
  position: relative;
  margin: 0;
  padding: 0 0 12px;
  color: #242a35;
  font-size: 19px;
  font-weight: 600;
}

.portal-heading h2::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: var(--brand);
  content: "";
}

.portal-heading > a,
.more-link {
  margin-left: auto;
  color: #a0a6af;
  font-size: 13px;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  align-items: center;
  margin-top: 26px;
  border-top: 1px solid var(--line);
  padding-top: 18px;
  color: #8a919c;
  font-size: 13px;
}

.footer-bottom a:hover,
.footer-grid a:hover {
  color: var(--brand);
}

.page-shell {
  max-width: 960px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumbs a:hover {
  color: var(--brand);
}

.page-content {
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: clamp(24px, 5vw, 52px);
}

.page-content h1,
.error-page h1 {
  margin: 0 0 24px;
  color: #222733;
  font-size: 32px;
}

.page-content h2 {
  margin: 34px 0 12px;
  color: #29313d;
  font-size: 21px;
}

.page-content p,
.page-content li {
  color: #596370;
  line-height: 1.9;
}

.page-content ul {
  padding-left: 20px;
}

.sitemap-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.sitemap-links a {
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fafbfc;
  padding: 12px 14px;
}

.sitemap-links a:hover {
  border-color: #bed2fa;
  color: var(--brand);
}

.sitemap-resources {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 32px;
  margin: 0;
  padding: 0 !important;
  list-style: none;
}

.sitemap-resources li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding: 10px 0;
}

.sitemap-resources time {
  flex: 0 0 auto;
  color: #a0a7b1;
  font-size: 12px;
}

.error-page {
  min-height: 560px;
  padding-top: 92px;
  text-align: center;
}

.error-page > p {
  color: var(--muted);
}

.error-search {
  display: grid;
  grid-template-columns: 1fr auto;
  width: min(560px, 100%);
  margin: 28px auto 18px;
}

.error-search input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 4px 0 0 4px;
  padding: 13px 15px;
}

.error-search button {
  border-radius: 0 4px 4px 0;
}

.error-actions {
  display: flex;
  justify-content: center;
  gap: 24px;
  color: var(--brand);
}

@media (max-width: 1060px) {
  .main-nav a {
    padding: 0 10px;
    font-size: 14px;
  }
}

@media (max-width: 780px) {
  .header-inner,
  .wrap {
    width: min(100% - 28px, 1280px);
  }

  .site-header {
    overflow: hidden;
  }

  .header-inner {
    min-height: 62px;
  }

  .mobile-nav {
    display: flex;
    overflow-x: auto;
    gap: 22px;
    border-top: 1px solid var(--line);
    padding: 0 14px;
    scrollbar-width: none;
  }

  .mobile-nav::-webkit-scrollbar {
    display: none;
  }

  .mobile-nav a {
    flex: 0 0 auto;
    min-height: 42px;
    padding-top: 12px;
    color: #4e5662;
    font-size: 13px;
  }

  .sitemap-links,
  .sitemap-resources {
    grid-template-columns: 1fr;
  }

  .page-content {
    padding: 24px 20px;
  }

  .page-content h1,
  .error-page h1 {
    font-size: 27px;
  }

  .footer-bottom {
    display: grid;
  }
}

.poster-grid {
  display: grid;
  gap: 16px;
}

.poster-grid-five {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.poster-grid-six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.home-card {
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(35, 45, 60, 0.06);
  padding-bottom: 9px;
}

.home-poster {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border-radius: 8px 8px 0 0;
  background: #edf0f4;
}

.home-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.home-card:hover .home-poster img {
  transform: scale(1.025);
}

.score-badge {
  position: absolute;
  right: 5px;
  bottom: 5px;
  border-radius: 3px;
  background: rgba(247, 104, 28, 0.93);
  color: #fff;
  padding: 3px 6px;
  font-size: 11px;
}

.home-card h3 {
  overflow: hidden;
  margin: 9px 10px 5px;
  color: #303641;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.4;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #a1a7b0;
  font-size: 12px;
  padding: 0 10px;
}

.home-card-meta a {
  color: #6c91d5;
}

.rank-card {
  position: static;
  top: auto;
  padding: 0;
}

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

.rank-list li {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  align-items: center;
  min-height: 36px;
  border-bottom: 1px dashed #eceef1;
}

.rank-list li:last-child {
  border-bottom: 0;
}

.rank-list span {
  display: grid;
  width: 19px;
  height: 19px;
  place-items: center;
  border-radius: 2px;
  background: #eff2f6;
  color: #8b929c;
  font-size: 11px;
}

.rank-list li:nth-child(-n + 3) span {
  background: #ff7a28;
  color: #fff;
}

.rank-list a {
  overflow: hidden;
  color: #4a515d;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.resource-section {
  margin-top: 16px;
}

.heading-with-tags {
  align-items: flex-start;
}

.section-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding-top: 2px;
  color: #8b929c;
  font-size: 13px;
}

.portal-note {
  display: flex;
  gap: 18px;
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: #7f8791;
  padding: 18px 20px;
  line-height: 1.7;
}

.portal-note strong {
  flex: 0 0 auto;
  color: #414854;
}

.portal-note p {
  margin: 0;
}

@media (max-width: 980px) {
  .header-inner {
    gap: 12px;
  }

  .main-nav a {
    padding: 0 9px;
  }

  .top-links {
    display: none;
  }

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

  .poster-grid-six {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .rank-card {
    margin-top: 0;
  }
}

@media (max-width: 780px) {
  .header-inner,
  .wrap {
    width: min(100% - 24px, 1200px);
  }

  .header-inner {
    min-height: 58px;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  .brand strong {
    font-size: 19px;
  }

  .main-nav {
    display: none;
  }

  .portal-search {
    min-height: 128px;
  }

  .portal-search .search-row {
    grid-template-columns: 1fr 66px;
  }

  .portal-search .search-row input,
  .portal-search .search-row button {
    min-height: 46px;
  }

  .portal-search .search-row button {
    border-radius: 0 5px 5px 0;
  }

  .portal-content {
    padding-top: 12px;
  }

  .portal-panel {
    padding: 13px;
  }

  .top-panels {
    display: grid;
    gap: 12px;
  }

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

  .featured-panel .home-card:nth-child(5) {
    display: none;
  }

  .section-tags {
    display: none;
  }

  .resource-section {
    margin-top: 12px;
  }

  .portal-heading {
    margin-bottom: 12px;
  }

  .portal-heading h2 {
    font-size: 17px;
  }

  .home-card h3 {
    font-size: 13px;
  }

  .portal-note {
    display: block;
    padding: 15px;
  }

  .portal-note strong {
    display: block;
    margin-bottom: 6px;
  }
}

/* Balanced thumbnail crop across home, archive, search, taxonomy, and detail views. */
.home-poster,
.poster,
.row-cover,
.detail-poster {
  aspect-ratio: 4 / 5;
}

.poster {
  display: block;
  overflow: hidden;
}

.detail-poster {
  align-self: start;
  overflow: hidden;
  border-radius: 8px;
  background: #edf0f4;
}

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