* {
  box-sizing: border-box;
}

:root {
  --primary: #8b5cf6;
  --accent: #ff79b8;
  --blue: #58bdf7;
  --ink: #27213f;
  --muted: #6d6683;
  --line: #eadff8;
  --paper: rgba(255, 255, 255, 0.9);
  --hero-bg-height: 720px;
  --hero-fade-start: 58%;
  --hero-image-position: center top;
}

body {
  position: relative;
  isolation: isolate;
  margin: 0;
  color: var(--ink);
  font-family: Arial, "Microsoft YaHei", sans-serif;
  line-height: 1.65;
  background:
    radial-gradient(circle at 8% 28%, rgba(255, 255, 255, 0.78) 0 2px, transparent 3px),
    radial-gradient(circle at 88% 18%, rgba(255, 121, 184, 0.28) 0 3px, transparent 4px),
    radial-gradient(circle at 76% 70%, rgba(88, 189, 247, 0.24) 0 3px, transparent 4px),
    radial-gradient(circle at 12% 10%, rgba(255, 121, 184, 0.18), transparent 26%),
    linear-gradient(180deg, #fff3fb 0%, #f4f8ff 48%, #fffaf0 100%);
  cursor: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M5 3L21 14L14 16L11 24L5 3Z' fill='%23ffffff' stroke='%238b5cf6' stroke-width='2'/%3E%3Ccircle cx='20' cy='7' r='3' fill='%23ff79b8'/%3E%3C/svg%3E") 4 3, auto;
}

body::before,
body::after {
  position: absolute;
  inset: 0 0 auto;
  height: var(--hero-bg-height);
  content: "";
  pointer-events: none;
}

body::before {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(39, 33, 63, 0.68), rgba(139, 92, 246, 0.18) 46%, rgba(255, 255, 255, 0.02)),
    url("/templates/anime-girl/assets/hero.jpg") var(--hero-image-position) / cover no-repeat;
}

body::after {
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(255, 243, 251, 0) 0%, rgba(255, 243, 251, 0) var(--hero-fade-start), rgba(255, 243, 251, 0.7) 82%, #fff3fb 100%);
}

a {
  color: var(--primary);
  text-decoration: none;
}

a,
button,
.tag-list a {
  cursor: url("data:image/svg+xml,%3Csvg width='28' height='28' viewBox='0 0 28 28' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M14 3L17.4 10.2L25 11.1L19.4 16.2L20.8 24L14 20L7.2 24L8.6 16.2L3 11.1L10.6 10.2L14 3Z' fill='%23ff79b8' stroke='%23ffffff' stroke-width='2'/%3E%3C/svg%3E") 14 14, pointer;
}

.anime-top {
  z-index: 1;
  min-height: 590px;
  display: flex;
  align-items: flex-end;
  position: relative;
  overflow: hidden;
}

.anime-top::before,
.anime-top::after {
  position: absolute;
  content: "";
  pointer-events: none;
}

.anime-top::before {
  inset: 0;
  background:
    radial-gradient(circle at 22% 24%, rgba(255, 255, 255, 0.9) 0 2px, transparent 3px),
    radial-gradient(circle at 32% 38%, rgba(255, 227, 143, 0.78) 0 3px, transparent 4px),
    radial-gradient(circle at 74% 30%, rgba(255, 255, 255, 0.72) 0 2px, transparent 3px),
    radial-gradient(circle at 86% 58%, rgba(255, 121, 184, 0.55) 0 3px, transparent 5px);
}

.anime-top::after {
  left: 7%;
  bottom: 34%;
  width: 86px;
  height: 86px;
  background: rgba(255, 255, 255, 0.46);
  clip-path: polygon(50% 0, 61% 36%, 100% 36%, 68% 58%, 80% 96%, 50% 72%, 20% 96%, 32% 58%, 0 36%, 39% 36%);
}

.anime-top-inner {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 0 16px 132px;
  color: #fff;
}

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

.hero-brand h1 {
  max-width: 620px;
  margin: 0;
  font-size: 56px;
  line-height: 1.12;
  text-shadow: 0 4px 18px rgba(39, 33, 63, 0.35);
}

.anime-top-inner p {
  max-width: 560px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

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

.top-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  color: #fff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  text-shadow: 0 2px 10px rgba(39, 33, 63, 0.22);
}

.top-tags span::before {
  content: "✦";
  margin-right: 5px;
  color: #ffe38f;
}

.top-search {
  display: grid;
  grid-template-columns: minmax(0, 280px) auto;
  gap: 8px;
  width: min(420px, 100%);
  margin-top: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  backdrop-filter: blur(8px);
}

.top-search input {
  min-width: 0;
  background: rgba(255, 255, 255, 0.9);
}

.top-search button {
  min-width: 74px;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1120px;
  margin: 0 auto;
  padding: 16px;
}

.site-logo {
  width: 54px;
  height: 54px;
  border: 3px solid rgba(255, 255, 255, 0.78);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(39, 33, 63, 0.22);
}

.main-nav {
  position: absolute;
  top: 28px;
  right: max(16px, calc((100vw - 1120px) / 2 + 16px));
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  max-width: min(520px, calc(100% - 32px));
}

.main-nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 13px;
  color: rgba(255, 255, 255, 0.96);
  font-size: 15px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(39, 33, 63, 0.12);
  text-shadow: 0 3px 12px rgba(39, 33, 63, 0.28);
  backdrop-filter: blur(8px);
}

.main-nav a::before {
  margin-right: 6px;
  color: rgba(255, 121, 184, 0.82);
  content: "✦";
  font-size: 13px;
}

.main-nav a::after {
  position: absolute;
  left: 50%;
  bottom: -6px;
  width: 4px;
  height: 3px;
  content: "";
  background: linear-gradient(90deg, var(--accent), #fff, var(--blue));
  border-radius: 999px;
  transform: translateX(-50%);
  transition: width 0.16s ease;
}

.main-nav a:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.main-nav a:hover::after {
  width: 100%;
}

.site-main {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  min-height: 70vh;
  margin: -108px auto 0;
  padding: 0 16px 42px;
}

input,
button {
  min-height: 40px;
  border: 1px solid rgba(139, 92, 246, 0.18);
  border-radius: 999px;
  padding: 0 14px;
  font: inherit;
}

input:focus {
  border-color: rgba(139, 92, 246, 0.72);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.12);
  outline: none;
}

button {
  position: relative;
  color: #fff;
  cursor: pointer;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 8px 18px rgba(255, 121, 184, 0.26);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

button::before {
  content: "✦";
  margin-right: 6px;
}

button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 121, 184, 0.34);
}

.hero {
  position: relative;
  display: block;
  margin-bottom: 24px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 34px rgba(76, 54, 124, 0.1);
}

.hero::after {
  position: absolute;
  right: 18px;
  top: 16px;
  width: 44px;
  height: 44px;
  content: "";
  background: #ffe38f;
  clip-path: polygon(50% 0, 61% 36%, 100% 36%, 68% 58%, 80% 96%, 50% 72%, 20% 96%, 32% 58%, 0 36%, 39% 36%);
  opacity: 0.72;
}

.hero-kicker {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  margin-bottom: 8px;
  padding: 0 10px;
  color: #fff;
  background: var(--primary);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.hero h1,
.article-detail h1 {
  margin: 0 0 8px;
  color: var(--ink);
  font-size: 34px;
  line-height: 1.25;
}

.hero p {
  margin: 0;
  color: var(--muted);
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

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

.content-panel,
.sidebar section,
.article-detail,
section:not(.hero):not(.layout-grid) {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px;
  box-shadow: 0 10px 34px rgba(76, 54, 124, 0.1);
}

.content-panel::before,
.sidebar section::before {
  position: absolute;
  top: 14px;
  right: 16px;
  color: rgba(255, 121, 184, 0.55);
  content: "✧";
  font-size: 18px;
}

.section-title h2,
.sidebar h2 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: 21px;
}

.section-title h2::before,
.sidebar h2::before {
  content: "✦ ";
  color: var(--accent);
}

.article-list {
  display: grid;
  gap: 18px;
}

.article-item {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding: 0 0 18px;
  border-bottom: 1px dashed rgba(139, 92, 246, 0.2);
}

.article-item:hover .article-cover,
.article-item:hover h2 a {
  transform: translateY(-1px);
}

.article-item h2 a,
.article-cover {
  transition: transform 0.15s ease, color 0.15s ease;
}

.article-item:last-child {
  border-bottom: 0;
}

.article-item-no-cover {
  grid-template-columns: 1fr;
}

.article-cover-link {
  display: block;
}

.article-cover,
.article-detail-cover {
  display: block;
  width: 100%;
  object-fit: cover;
  border: 3px solid #fff;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(76, 54, 124, 0.16);
}

.article-cover {
  aspect-ratio: 16 / 9;
}

.article-detail-cover {
  max-height: 420px;
  margin: 22px 0;
}

.preview-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin: 0 0 12px;
  padding: 0 10px;
  color: #7c3aed;
  background: #f2e8ff;
  border: 1px solid #dec7ff;
  border-radius: 999px;
  font-size: 14px;
}

.article-item h2 {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.35;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 14px;
}

.article-meta span::before {
  content: "· ";
}

.article-summary {
  color: #4f4966;
}

.article-content {
  margin-top: 24px;
  font-size: 16px;
}

.article-content p {
  margin: 0 0 16px;
}

.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px dashed rgba(139, 92, 246, 0.2);
}

.article-nav a {
  display: grid;
  gap: 4px;
  min-height: 72px;
  padding: 12px;
  color: var(--ink);
  background: #fff4fb;
  border-radius: 14px;
}

.article-nav a:last-child {
  text-align: right;
}

.article-nav span,
.empty-text {
  color: var(--muted);
}

.article-nav strong {
  font-size: 16px;
  line-height: 1.4;
}

mark {
  padding: 0 2px;
  background: #ffe4a8;
}

.cursor-sparkle {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  pointer-events: none;
  font-size: 16px;
  font-weight: 800;
  text-shadow: 0 2px 8px rgba(76, 54, 124, 0.22);
  transform: translate(-50%, -50%);
  animation: cursor-sparkle-fade 760ms ease-out forwards;
  will-change: transform, opacity;
}

@keyframes cursor-sparkle-fade {
  0% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(0.82) rotate(0deg);
  }

  100% {
    opacity: 0;
    transform: translate(calc(-50% + var(--spark-x)), calc(-50% + var(--spark-y))) scale(1.28) rotate(var(--spark-rotate));
  }
}

.sidebar {
  display: grid;
  gap: 16px;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: hot-rank;
}

.link-list li {
  counter-increment: hot-rank;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  margin: 0 0 10px;
}

.link-list li::before {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: #fff;
  content: counter(hot-rank);
  font-size: 13px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--primary));
  border: 2px solid #fff;
  border-radius: 10px 10px 10px 4px;
  box-shadow: 0 6px 14px rgba(139, 92, 246, 0.2);
}

.link-list a {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.link-list a:hover {
  color: var(--primary);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list a,
.pagination a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  color: var(--ink);
  background: #f5eefe;
  border: 1px solid rgba(139, 92, 246, 0.15);
  border-radius: 999px;
}

.tag-list a::before {
  content: "#";
  margin-right: 3px;
  color: var(--accent);
  font-weight: 800;
}

.tag-list a:hover,
.pagination a:hover {
  color: #fff;
  background: var(--primary);
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
  margin-top: 18px;
}

.term-card {
  position: relative;
  display: grid;
  gap: 8px;
  min-height: 136px;
  padding: 18px;
  overflow: hidden;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(76, 54, 124, 0.1);
}

.term-card::after {
  position: absolute;
  right: 14px;
  top: 12px;
  color: rgba(255, 121, 184, 0.5);
  content: "✦";
}

.term-card:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.term-card strong {
  font-size: 21px;
}

.term-card span {
  color: var(--muted);
}

.term-card em {
  align-self: end;
  color: var(--muted);
  font-style: normal;
  font-size: 14px;
}

.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 24px;
}

.friend-links {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto 18px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 18px;
  box-shadow: 0 18px 42px rgba(76, 54, 124, 0.1);
  backdrop-filter: blur(12px);
}

.friend-links h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: 18px;
}

.friend-link-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.friend-link-item {
  display: inline-flex;
  align-items: center;
  max-width: 250px;
  min-height: 42px;
  gap: 8px;
  padding: 8px 12px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(255, 121, 184, 0.22);
  border-radius: 999px;
}

.friend-link-item:hover {
  color: var(--primary);
  transform: translateY(-1px);
}

.friend-link-item img {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  object-fit: cover;
  border-radius: 50%;
}

.friend-link-item span {
  display: grid;
  min-width: 0;
}

.friend-link-item strong,
.friend-link-item em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.friend-link-item em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.site-footer {
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 760px) {
  :root {
    --hero-bg-height: 560px;
    --hero-fade-start: 54%;
    --hero-image-position: center top;
  }

  .anime-top {
    min-height: 470px;
  }

  .anime-top-inner {
    padding-top: 92px;
    padding-bottom: 70px;
  }

  .hero-brand h1 {
    font-size: 38px;
  }

  .hero-brand {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .top-search {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .site-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .main-nav {
    top: 16px;
    right: 16px;
    gap: 8px;
    width: min(360px, calc(100% - 32px));
    justify-content: flex-end;
  }

  .main-nav a {
    min-height: 32px;
    padding: 0 10px;
    font-size: 14px;
  }

  .site-main {
    margin-top: -64px;
  }

  .hero,
  .layout-grid,
  .article-nav {
    grid-template-columns: 1fr;
  }

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