/* ==========================================================================
   MyrvaneCom — "Mint Soft" editorial theme (mobile-first)
   Colour system, layout and components for index / allList / detail pages.
   ========================================================================== */

:root {
  /* palette — soft mint green */
  --bg: #eef8f2;
  --bg-2: #e4f3ea;
  --surface: #f7fcf9;
  --surface-2: #dcefe4;
  --ink: #1b2b24;
  --muted: #5f7368;
  --accent: #5db87a;
  --accent-2: #3d9b7a;
  --accent-soft: #b8e6c8;
  --on-accent: #0f2a1a;
  --line: rgba(27, 43, 36, 0.1);
  --line-strong: rgba(27, 43, 36, 0.16);
  --danger: #e5484d;

  /* radii / shadows */
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 18px 44px rgba(27, 43, 36, 0.08);

  /* display type */
  --display: "Arial Black", "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  --sans: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;

  /* legacy variable names kept so older partials keep working */
  --body: #eef8f2;
  --nav: #f7fcf9;
  --btn: #5db87a;
  --font: #1b2b24;
  --a: #1b2b24;
  --title: #14241c;
  --category-bg: #5db87a;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  color-scheme: light;
}

body {
  position: relative;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
  margin: 0;
  line-height: 1.6;
  color: var(--ink);
  font-family: var(--sans);
  -webkit-tap-highlight-color: transparent;
  background-color: var(--bg);
  background-image:
    radial-gradient(1100px 620px at 8% -12%, rgba(93, 184, 122, 0.18), transparent 60%),
    radial-gradient(900px 520px at 102% -4%, rgba(61, 155, 122, 0.12), transparent 58%);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

a {
  text-decoration: none;
  color: var(--a);
  line-height: inherit;
}

a:hover,
a:active {
  text-decoration: none;
}

img {
  object-fit: cover;
  background-repeat: no-repeat;
  background-size: 100%;
  max-width: 100%;
}

strong {
  font-weight: bolder;
}

h1,
h2,
h3,
h4 {
  font-family: var(--display);
  letter-spacing: -0.02em;
}

::selection {
  background: var(--accent);
  color: var(--on-accent);
}

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* --------------------------------------------------------------------------
   Small legacy utility helpers
   -------------------------------------------------------------------------- */
.fx-r {
  display: flex;
  flex-direction: row;
}
.fx-h {
  display: flex;
  flex-direction: column;
}
.fx-ac {
  justify-content: center;
}
.fx-bc {
  align-items: center;
}
.flex-1 {
  flex: 1;
}
.jb {
  justify-content: space-between;
}
.hideText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h-full {
  height: 100%;
}
.w-full {
  width: 100%;
}
.grid {
  display: grid;
}
.grid-cols-1 {
  grid-template-columns: repeat(1, minmax(0, 1fr));
}
.grid-cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.9);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
}

header .brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}

/* 新 logo 自带色块，不再垫浅色底板 */
header .brand img {
  width: 40px;
  height: 40px;
  aspect-ratio: 1/1;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0;
  object-fit: cover;
  transition: transform 0.3s ease;
}

header .brand:hover img {
  transform: rotate(-6deg) scale(1.04);
}

header .brand-name {
  font-family: var(--display);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* desktop nav — hidden on mobile-first, revealed at >= 900px */
nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

nav a {
  position: relative;
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 600;
  padding: 9px 14px;
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
}

nav a:hover {
  color: var(--ink);
  background: rgba(27, 43, 36, 0.05);
}

nav a::after {
  display: none;
}

.pc-show {
  display: none;
}

/* hamburger */
.mobile-menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease;
}

.mobile-menu-btn:hover {
  background: rgba(93, 184, 122, 0.14);
  border-color: var(--accent);
  color: var(--accent);
}

/* --------------------------------------------------------------------------
   Mobile menu (full-screen)
   -------------------------------------------------------------------------- */
.mobile-menu-panel {
  position: fixed;
  inset: 0;
  z-index: 1002;
  display: flex;
  flex-direction: column;
  padding: 22px;
  background:
    radial-gradient(700px 420px at 100% 0%, rgba(93, 184, 122, 0.16), transparent 60%),
    rgba(247, 252, 249, 0.98);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  transform: translateY(-100%);
  opacity: 0;
  visibility: hidden;
  transition: transform 0.42s cubic-bezier(0.2, 0.85, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-panel.active {
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-menu-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.mobile-menu-header span {
  font-family: var(--display);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.mobile-menu-close {
  width: 42px;
  height: 42px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.mobile-menu-close:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mobile-menu-links {
  display: flex;
  flex-direction: column;
  padding: 22px 0;
  counter-reset: mlink;
}

.mobile-menu-links a {
  counter-increment: mlink;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-family: var(--display);
  font-size: clamp(22px, 7vw, 32px);
  font-weight: 900;
  letter-spacing: -0.03em;
  transition: color 0.25s ease, padding-left 0.25s ease;
}

.mobile-menu-links a::before {
  content: counter(mlink, decimal-leading-zero);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.mobile-menu-links a:hover {
  color: var(--accent);
  padding-left: 8px;
}

/* 打开菜单时链接逐条滑入 */
.mobile-menu-panel.active .mobile-menu-links a {
  animation: menu-link-in 0.5s cubic-bezier(0.2, 0.85, 0.2, 1) both;
}

.mobile-menu-panel.active .mobile-menu-links a:nth-child(1) {
  animation-delay: 0.06s;
}

.mobile-menu-panel.active .mobile-menu-links a:nth-child(2) {
  animation-delay: 0.12s;
}

.mobile-menu-panel.active .mobile-menu-links a:nth-child(3) {
  animation-delay: 0.18s;
}

.mobile-menu-panel.active .mobile-menu-links a:nth-child(4) {
  animation-delay: 0.24s;
}

.mobile-menu-panel.active .mobile-menu-links a:nth-child(5) {
  animation-delay: 0.3s;
}

.mobile-menu-panel.active .mobile-menu-links a:nth-child(6) {
  animation-delay: 0.36s;
}

@keyframes menu-link-in {
  from {
    transform: translateY(18px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.mobile-menu-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.mobile-menu-copy {
  font-size: 12px;
  color: var(--muted);
}

.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  z-index: 1001;
  background: rgba(0, 0, 0, 0.55);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-menu-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* --------------------------------------------------------------------------
   Layout shell
   -------------------------------------------------------------------------- */
main {
  flex: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 22px 18px 56px;
  position: relative;
}

/* --------------------------------------------------------------------------
   Hero (home only)
   -------------------------------------------------------------------------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 34px 0 30px;
  border-bottom: 1px solid var(--line);
}

/* 装饰性网格纹理 */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(ellipse at 16% 0%, #000 0%, transparent 72%);
  mask-image: radial-gradient(ellipse at 16% 0%, #000 0%, transparent 72%);
  pointer-events: none;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero-kicker::before {
  content: "";
  width: 26px;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
}

.hero-title {
  margin: 0;
  font-size: clamp(34px, 10vw, 62px);
  font-weight: 900;
  line-height: 1.02;
  letter-spacing: -0.045em;
  color: var(--ink);
  text-wrap: balance;
}

.hero-title em {
  font-style: normal;
  color: transparent;
  background: linear-gradient(100deg, var(--accent) 12%, var(--accent-2) 92%);
  -webkit-background-clip: text;
  background-clip: text;
}

.hero-lead {
  margin: 0;
  max-width: 60ch;
  font-size: 15px;
  line-height: 1.7;
  color: var(--muted);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 4px;
}

.btn-primary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  transition: transform 0.22s ease, background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 14px 34px rgba(93, 184, 122, 0.24);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #7dcb94;
}

.btn-ghost {
  border: 1px solid var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
}

/* --------------------------------------------------------------------------
   Section header
   -------------------------------------------------------------------------- */
.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 20px;
  padding: 34px 0 16px;
  border-bottom: 1px solid var(--line);
  min-height: 60px;
}

.section-title-wrapper {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.section-title-wrapper::before {
  content: "";
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px rgba(93, 184, 122, 0.18);
}

.section-header h3 {
  margin: 0;
  font-size: clamp(22px, 6.4vw, 34px);
  font-weight: 900;
  letter-spacing: -0.035em;
  text-transform: capitalize;
  color: var(--ink);
  min-width: 60px;
  text-wrap: balance;
}

.section-divider {
  display: none;
}

.view-all {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.view-all:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   Article grid + cards
   -------------------------------------------------------------------------- */
.per-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  min-height: 200px;
}

/* JS 未填充内容时的占位提示（allList / 推荐文章容器初始为空） */
.per-section:empty::after {
  content: "Loading…";
  display: block;
  padding: 46px 0;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  letter-spacing: 0.1em;
}

.article-card-wrapper {
  display: block;
  color: inherit;
}

.article-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  grid-template-areas:
    "thumb title"
    "thumb desc";
  column-gap: 14px;
  row-gap: 7px;
  align-content: start;
  padding: 16px 0;
  cursor: pointer;
}

.article-card img.lazy-image {
  grid-area: thumb;
  align-self: start;
  width: 108px;
  aspect-ratio: 1/1;
  border-radius: 14px;
  object-fit: cover;
  background: var(--surface);
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1), filter 0.45s ease;
}

.article-card:hover img.lazy-image {
  transform: scale(1.04);
  filter: saturate(1.08);
}

.article-title {
  grid-area: title;
  margin: 0;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.38;
  letter-spacing: -0.01em;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.25s ease;
}

.article-card:hover .article-title {
  color: var(--accent);
}

/* 触屏按下反馈 */
.article-card:active .article-title {
  color: var(--accent);
}

.article-card:active img.lazy-image {
  transform: scale(0.97);
}

.article-card p {
  grid-area: desc;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* skeleton */
@media screen and (max-width: 619px) {
  .per-section > .article-card-wrapper + .article-card-wrapper {
    border-top: 1px solid var(--line);
  }
}

/* skeleton：模拟「左缩略图 + 右标题/摘要」的行布局 */
.skeleton-card {
  position: relative;
  height: 108px;
  margin: 14px 0;
}

.skeleton-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 108px;
  height: 108px;
  border-radius: 14px;
  background: var(--surface-2);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  left: 122px;
  top: 26px;
  right: 18%;
  height: 15px;
  border-radius: 8px;
  background: var(--surface-2);
  box-shadow: 0 27px 0 var(--surface-2);
  animation: skeleton-pulse 1.6s ease-in-out infinite;
}

@keyframes skeleton-pulse {
  0%,
  100% {
    opacity: 1;
  }
  50% {
    opacity: 0.45;
  }
}

.placeholder {
  color: transparent;
}

/* --------------------------------------------------------------------------
   Pagination
   -------------------------------------------------------------------------- */
.pagination-container {
  margin: 40px auto 0;
  max-width: 760px;
  padding: 0;
}

.pagination-info {
  margin-bottom: 16px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding: 20px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.page-btn,
.page-number {
  min-width: 44px;
  padding: 11px 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.page-btn:hover,
.page-number:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

.page-btn:disabled {
  opacity: 0.42;
  cursor: not-allowed;
  transform: none;
}

.page-number.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  font-weight: 800;
}

.page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.page-jump {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
}

.page-jump input {
  width: 72px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-2);
  color: var(--ink);
  text-align: center;
  font-size: 14px;
}

.page-jump input:focus {
  outline: none;
  border-color: var(--accent);
}

.page-jump button {
  padding: 10px 18px;
  border: none;
  border-radius: 10px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.22s ease;
}

.page-jump button:hover {
  background: #7dcb94;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
footer {
  width: 100%;
  margin-top: 64px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(93, 184, 122, 0.1), transparent 42%), var(--bg-2);
}

.footer-container {
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  padding: 42px 18px 24px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  gap: 30px;
  padding-bottom: 30px;
  border-bottom: 1px solid var(--line);
}

.footer-brand {
  flex: 1;
  min-width: 0;
}

.footer-name {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 44px);
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1;
  color: var(--ink);
}

.footer-brand > .fx-r {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-logo {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: transparent;
  padding: 0;
  object-fit: cover;
}

.footer-description {
  margin: 12px 0 0;
  max-width: 380px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--muted);
}

.footer-links-container {
  display: flex;
  flex-wrap: wrap;
  gap: 34px;
}

.footer-links-group {
  min-width: 150px;
}

.footer-links-group h4 {
  position: relative;
  margin: 0 0 16px;
  padding-bottom: 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
}

.footer-links-group h4::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 28px;
  height: 2px;
  background: var(--accent);
}

.footer-links-group ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-links-group ul li {
  margin-bottom: 11px;
}

.footer-links-group a {
  color: var(--muted);
  font-size: 14px;
  transition: color 0.22s ease;
}

.footer-links-group a:hover {
  color: var(--accent);
}

.footer-resources {
  display: block;
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.social-links {
  display: flex;
  gap: 12px;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted);
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease, transform 0.22s ease;
}

.social-link:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
  transform: translateY(-3px);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  padding-top: 22px;
}

.footer-copyright {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}

/* --------------------------------------------------------------------------
   Back to top
   -------------------------------------------------------------------------- */
#backToTop {
  position: fixed;
  right: 16px;
  bottom: 20px;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: none;
  border-radius: 50%;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(93, 184, 122, 0.3);
  transition: transform 0.22s ease, background 0.22s ease;
}

#backToTop.show {
  display: flex;
}

#backToTop:hover {
  background: #7dcb94;
  transform: translateY(-3px);
}

#backToTop:active {
  transform: scale(0.92);
}

/* --------------------------------------------------------------------------
   Lazy image states
   -------------------------------------------------------------------------- */
.lazy-image {
  opacity: 1;
  transition: opacity 0.35s ease-in-out;
  position: relative;
}

.lazy-image-loading {
  opacity: 0.55;
}

.lazy-image-loading::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 26px;
  height: 26px;
  border: 3px solid rgba(27, 43, 36, 0.12);
  border-top-color: var(--accent);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  animation: spin 0.9s linear infinite;
  z-index: 1;
}

.lazy-image-loaded {
  opacity: 1;
  transition: opacity 0.45s ease-in-out;
}

.lazy-image-error {
  border: 2px solid var(--danger);
  background-color: rgba(255, 107, 107, 0.14);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--danger);
  font-weight: bold;
}

@keyframes spin {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  100% {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* --------------------------------------------------------------------------
   Reserved ad slots (build tool injects banner code between the markers)
   -------------------------------------------------------------------------- */
.ad-slot {
  width: 100%;
  margin: 4px 0;
}

/* --------------------------------------------------------------------------
   Scrollbar
   -------------------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

::-webkit-scrollbar-thumb {
  border-radius: 8px;
  background: rgba(27, 43, 36, 0.18);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(27, 43, 36, 0.28);
}

/* ==========================================================================
   Tablet / desktop enhancements (mobile-first: everything above is phone)
   ========================================================================== */
@media screen and (min-width: 620px) {
  header {
    padding: 16px 26px;
  }

  main {
    padding: 26px 26px 64px;
  }

  .per-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 26px 22px;
  }

  .article-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0;
  }

  .article-card img.lazy-image {
    align-self: stretch;
    width: 100%;
    aspect-ratio: 4/3;
    border-radius: var(--radius);
  }

  .article-title {
    margin-top: 14px;
    font-size: 16.5px;
  }

  .article-card p {
    margin-top: 9px;
    font-size: 13.5px;
  }

  .skeleton-card {
    height: auto;
    aspect-ratio: 4/3;
    margin: 0;
    border-radius: var(--radius);
    background: var(--surface-2);
    animation: skeleton-pulse 1.6s ease-in-out infinite;
  }

  .skeleton-card::before,
  .skeleton-card::after {
    display: none;
  }

  .pagination {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    padding: 22px;
  }

  .pagination-info {
    margin-bottom: 20px;
  }

  .footer-top {
    flex-direction: row;
    justify-content: space-between;
  }

  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
  }

  .footer-copyright {
    text-align: left;
  }
}

@media screen and (min-width: 900px) {
  .pc-show {
    display: flex;
  }

  .mobile-menu-btn,
  .mobile-menu-panel,
  .mobile-menu-overlay {
    display: none !important;
  }

  nav a {
    font-size: 15px;
  }

  main {
    padding: 30px 30px 80px;
  }

  .per-section {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 30px 26px;
  }

  /* editorial feature: first card becomes a wide, image-overlay lead story */
  .per-section > .article-card-wrapper:first-child {
    grid-column: span 2;
    grid-row: span 2;
    height: 100%;
  }

  .per-section > .article-card-wrapper:first-child .article-card {
    position: relative;
    display: block;
    height: 100%;
    min-height: 380px;
    border-radius: var(--radius);
    overflow: hidden;
    padding: 0;
  }

  .per-section > .article-card-wrapper:first-child .article-card img.lazy-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
    border-radius: 0;
  }

  .per-section > .article-card-wrapper:first-child .article-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(8, 9, 12, 0.05) 30%, rgba(8, 9, 12, 0.92) 100%);
    pointer-events: none;
  }

  .per-section > .article-card-wrapper:first-child .article-title {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 54px;
    z-index: 2;
    margin: 0;
    font-size: clamp(20px, 2.2vw, 27px);
    color: #fff;
    -webkit-line-clamp: 2;
  }

  .per-section > .article-card-wrapper:first-child .article-card p {
    position: absolute;
    left: 24px;
    right: 24px;
    bottom: 22px;
    z-index: 2;
    margin: 0;
    color: rgba(255, 255, 255, 0.74);
    -webkit-line-clamp: 1;
  }

  .per-section > .article-card-wrapper:first-child .article-card:hover img.lazy-image {
    transform: scale(1.05);
  }

  .hero {
    padding: 46px 0 40px;
  }
}

/* ==========================================================================
   Environment adaptations
   ========================================================================== */

/* 触屏设备：去掉粘滞 hover 位移，避免点按后残留悬浮态 */
@media (hover: none) {
  .article-card:hover img.lazy-image,
  .per-section > .article-card-wrapper:first-child .article-card:hover img.lazy-image {
    transform: none;
    filter: none;
  }

  .btn-primary:hover,
  .btn-ghost:hover,
  .view-all:hover,
  .page-btn:hover,
  .page-number:hover,
  .social-link:hover,
  #backToTop:hover {
    transform: none;
  }

  header .brand:hover img {
    transform: none;
  }
}

/* 用户偏好减弱动效时关闭动画与过渡 */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}
