:root {
  --ink: #25324a;
  --muted: #66728a;
  --cream: #fffaf0;
  --paper: #fffef9;
  --yellow: #ffd86b;
  --yellow-dark: #efb936;
  --pink: #ff9fb5;
  --pink-soft: #ffe1e9;
  --blue: #79c8f4;
  --blue-soft: #dff4ff;
  --green: #72d6ad;
  --green-soft: #dcf8ed;
  --purple: #a995e8;
  --purple-soft: #ece7ff;
  --orange: #ffae70;
  --shadow: 0 14px 0 rgba(59, 65, 97, 0.08);
  --border: 3px solid var(--ink);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 10% 8%, rgba(255, 255, 255, 0.9) 0 5px, transparent 6px),
    radial-gradient(circle at 85% 13%, rgba(255, 255, 255, 0.8) 0 4px, transparent 5px),
    linear-gradient(180deg, #cceeff 0 520px, var(--cream) 800px);
  font-family:
    "Microsoft YaHei", "PingFang SC", "Noto Sans CJK SC", system-ui, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 4px solid rgba(255, 174, 112, 0.55);
  outline-offset: 3px;
}

.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;
}

.sky-decor {
  position: absolute;
  inset: 0 0 auto;
  height: 530px;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.cloud {
  position: absolute;
  width: 150px;
  height: 48px;
  border: 3px solid rgba(37, 50, 74, 0.8);
  border-radius: 50px;
  background: #fff;
  opacity: 0.9;
  animation: cloud-drift 8s ease-in-out infinite;
}

.cloud::before,
.cloud::after {
  content: "";
  position: absolute;
  bottom: -3px;
  background: #fff;
  border: 3px solid rgba(37, 50, 74, 0.8);
  border-bottom: 0;
  border-radius: 80px 80px 0 0;
}

.cloud::before {
  left: 26px;
  width: 54px;
  height: 58px;
}

.cloud::after {
  right: 22px;
  width: 48px;
  height: 40px;
}

.cloud-one {
  top: 160px;
  left: -42px;
}

.cloud-two {
  top: 92px;
  right: -25px;
  transform: scale(0.78);
  animation-delay: -3s;
}

.star {
  position: absolute;
  color: #fff3a6;
  text-shadow: 2px 2px 0 var(--ink);
  animation: twinkle 2.4s ease-in-out infinite;
}

.star-one {
  top: 112px;
  left: 24%;
  font-size: 20px;
}

.star-two {
  top: 220px;
  right: 23%;
  font-size: 14px;
  animation-delay: -0.8s;
}

.star-three {
  top: 62px;
  right: 38%;
  font-size: 12px;
  animation-delay: -1.6s;
}

.site-header,
main,
.site-footer > * {
  width: min(1180px, calc(100% - 36px));
  margin-inline: auto;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 0 12px;
}

.brand {
  display: flex;
  gap: 13px;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

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

.brand strong {
  font-size: 22px;
  letter-spacing: 0.06em;
}

.brand small {
  margin-top: 2px;
  color: #53627a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.brand-mascot {
  position: relative;
  display: block;
  width: 54px;
  height: 54px;
  border: var(--border);
  border-radius: 50% 50% 44% 48%;
  background: var(--yellow);
  transform: rotate(-5deg);
  box-shadow: 4px 5px 0 rgba(37, 50, 74, 0.14);
}

.brand-mascot::before,
.brand-mascot::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 15px;
  height: 18px;
  border: var(--border);
  background: var(--yellow);
  z-index: -1;
}

.brand-mascot::before {
  left: 5px;
  border-radius: 70% 10% 50% 20%;
  transform: rotate(-30deg);
}

.brand-mascot::after {
  right: 4px;
  border-radius: 10% 70% 20% 50%;
  transform: rotate(30deg);
}

.mascot-eye {
  position: absolute;
  top: 21px;
  width: 5px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
}

.eye-left {
  left: 15px;
}

.eye-right {
  right: 15px;
}

.mascot-smile {
  position: absolute;
  top: 29px;
  left: 21px;
  width: 11px;
  height: 7px;
  border-bottom: 3px solid var(--ink);
  border-radius: 50%;
}

.header-badge {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 15px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  font-weight: 800;
  box-shadow: 3px 4px 0 rgba(37, 50, 74, 0.09);
}

.hero {
  display: grid;
  grid-template-columns: 0.92fr 1.08fr;
  gap: clamp(32px, 6vw, 88px);
  align-items: center;
  min-height: 450px;
  padding: 48px 4% 74px;
}

.hero > * {
  min-width: 0;
}

.eyebrow {
  margin: 0 0 10px;
  color: #ef6f8d;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
}

.hero h1,
.section-heading h2,
.collection h2 {
  margin: 0;
  line-height: 1.18;
  letter-spacing: 0.03em;
}

.hero h1 {
  max-width: 520px;
  font-size: clamp(42px, 5.3vw, 70px);
  text-shadow: 3px 4px 0 rgba(255, 255, 255, 0.74);
}

.hero-intro {
  max-width: 470px;
  margin: 21px 0 0;
  color: #53627a;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.8;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 10px 19px;
  border: 2px solid var(--ink);
  border-radius: 14px;
  color: var(--ink);
  font-weight: 900;
  box-shadow: 4px 5px 0 rgba(37, 50, 74, 0.16);
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.button:hover {
  transform: translateY(-2px) rotate(-1deg);
  box-shadow: 6px 8px 0 rgba(37, 50, 74, 0.13);
}

.button:active {
  transform: translateY(2px);
  box-shadow: 2px 2px 0 rgba(37, 50, 74, 0.14);
}

.button-primary {
  background: var(--yellow);
}

.button-soft {
  background: var(--pink-soft);
}

.button-outline {
  background: #fff;
}

.button-outline.is-active {
  background: var(--yellow);
}

.spotlight {
  position: relative;
  min-height: 300px;
  padding: 42px 42px 48px;
  border: var(--border);
  border-radius: 16px 19px 14px 20px;
  background:
    linear-gradient(rgba(125, 190, 228, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(125, 190, 228, 0.12) 1px, transparent 1px),
    var(--paper);
  background-size: 24px 24px;
  box-shadow: 12px 15px 0 rgba(37, 50, 74, 0.11);
  transform: rotate(1.5deg);
  transition: transform 260ms ease, opacity 180ms ease;
}

.spotlight.is-changing {
  opacity: 0.3;
  transform: rotate(-1deg) scale(0.97);
}

.spotlight::after {
  content: "";
  position: absolute;
  inset: 10px;
  border: 2px dashed rgba(239, 111, 141, 0.45);
  border-radius: 10px;
  pointer-events: none;
}

.spotlight-pin {
  position: absolute;
  top: -13px;
  width: 24px;
  height: 24px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 2px 3px 0 rgba(37, 50, 74, 0.15);
  z-index: 2;
}

.pin-left {
  left: 56px;
}

.pin-right {
  right: 56px;
  background: var(--blue);
}

.spotlight-label {
  position: relative;
  z-index: 1;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 7px 12px;
  border: 2px solid var(--ink);
  border-radius: 8px;
  background: var(--yellow);
  font-size: 12px;
  font-weight: 900;
  transform: rotate(-3deg);
}

.spotlight blockquote {
  position: relative;
  z-index: 1;
  margin: 25px 0 14px;
}

.spotlight-zh {
  margin: 0;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: clamp(22px, 2.3vw, 31px);
  font-weight: 800;
  line-height: 1.6;
}

.spotlight-en {
  margin: 12px 0 0;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  font-style: italic;
  line-height: 1.6;
}

.spotlight-author {
  position: relative;
  z-index: 1;
  padding-right: 44px;
  color: #53627a;
  font-weight: 900;
  text-align: right;
  overflow-wrap: anywhere;
}

.spotlight-doodle {
  position: absolute;
  right: 22px;
  bottom: 16px;
  font-size: 35px;
  transform: rotate(9deg);
  z-index: 1;
}

.explore {
  position: relative;
  padding: 42px clamp(18px, 4vw, 54px) 64px;
  border: var(--border);
  border-radius: 32px;
  background: rgba(255, 254, 249, 0.94);
  box-shadow: var(--shadow);
}

.explore::before {
  content: "";
  position: absolute;
  top: -13px;
  left: 10%;
  width: 120px;
  height: 29px;
  background: rgba(255, 216, 107, 0.72);
  transform: rotate(-2deg);
}

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

.section-heading h2,
.collection h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.result-count {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  gap: 14px;
  margin-top: 28px;
}

.search-box,
.friendly-switch,
.page-size {
  min-height: 54px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  box-shadow: 3px 4px 0 rgba(37, 50, 74, 0.08);
}

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 17px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 700;
}

.search-box input::placeholder {
  color: #98a1b1;
}

.friendly-switch {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 6px 14px;
  cursor: pointer;
}

.friendly-switch input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.switch-track {
  position: relative;
  width: 42px;
  height: 24px;
  flex: 0 0 auto;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #d6dce5;
  transition: background 180ms ease;
}

.switch-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: #fff;
  transition: transform 180ms ease;
}

.friendly-switch input:checked + .switch-track {
  background: var(--green);
}

.friendly-switch input:checked + .switch-track .switch-thumb {
  transform: translateX(18px);
}

.friendly-switch input:focus-visible + .switch-track {
  outline: 4px solid rgba(255, 174, 112, 0.55);
  outline-offset: 3px;
}

.friendly-switch strong,
.friendly-switch small {
  display: block;
}

.friendly-switch strong {
  font-size: 13px;
}

.friendly-switch small {
  color: var(--muted);
  font-size: 10px;
}

.page-size {
  display: flex;
  align-items: center;
  padding-left: 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.page-size select {
  align-self: stretch;
  border: 0;
  outline: 0;
  padding: 0 13px 0 7px;
  color: var(--ink);
  background: transparent;
  font-weight: 900;
}

.category-list {
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding: 3px 2px 9px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.category-button {
  flex: 0 0 auto;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 2px 3px 0 rgba(37, 50, 74, 0.1);
  transition: transform 150ms ease, background 150ms ease;
}

.category-button:hover {
  transform: translateY(-2px);
}

.category-button.is-active {
  background: var(--yellow);
}

.quote-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
  margin-top: 26px;
}

.quote-card {
  --card-accent: var(--blue);
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 330px;
  padding: 21px 21px 18px;
  overflow: hidden;
  border: var(--border);
  border-radius: 18px 18px 24px 18px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--card-accent) 17%, white), transparent 42%),
    var(--paper);
  box-shadow: 7px 9px 0 rgba(37, 50, 74, 0.1);
  animation: card-pop 350ms both;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.quote-card:nth-child(2n) {
  transform: rotate(0.5deg);
}

.quote-card:nth-child(3n) {
  transform: rotate(-0.45deg);
}

.quote-card:hover {
  transform: translateY(-6px) rotate(0);
  box-shadow: 10px 14px 0 rgba(37, 50, 74, 0.09);
}

.quote-card::before {
  content: "“";
  position: absolute;
  top: 38px;
  right: 18px;
  color: color-mix(in srgb, var(--card-accent) 36%, white);
  font-family: Georgia, serif;
  font-size: 100px;
  font-weight: 900;
  line-height: 1;
  pointer-events: none;
}

.card-topline {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-pill {
  padding: 6px 10px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: color-mix(in srgb, var(--card-accent) 48%, white);
  font-size: 11px;
  font-weight: 900;
}

.favorite-button {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  color: var(--ink);
  background: #fff;
  font-size: 23px;
  line-height: 1;
  transition: transform 160ms ease, background 160ms ease;
}

.favorite-button:hover {
  transform: rotate(12deg) scale(1.08);
}

.favorite-button.is-favorite {
  background: var(--yellow);
}

.quote-card blockquote {
  position: relative;
  z-index: 1;
  flex: 1;
  margin: 24px 0 20px;
}

.quote-primary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  font-family: "KaiTi", "STKaiti", "Microsoft YaHei", sans-serif;
  font-size: 20px;
  font-weight: 800;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
}

.quote-secondary {
  display: -webkit-box;
  margin: 13px 0 0;
  overflow: hidden;
  color: var(--muted);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 13px;
  font-style: italic;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}

.quote-card footer {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 10px;
  align-items: center;
  padding-top: 14px;
  border-top: 2px dashed rgba(37, 50, 74, 0.23);
}

.author-avatar {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: color-mix(in srgb, var(--card-accent) 42%, white);
}

.author-avatar::before {
  content: "●‿●";
  font-size: 9px;
  font-weight: 900;
}

.author-name {
  font-size: 12px;
  font-weight: 900;
  line-height: 1.4;
}

.card-number {
  position: absolute;
  right: 9px;
  bottom: 2px;
  color: rgba(37, 50, 74, 0.13);
  font-family: Georgia, serif;
  font-size: 45px;
  font-weight: 900;
  pointer-events: none;
}

.empty-state {
  padding: 54px 20px 24px;
  text-align: center;
}

.empty-state div {
  font-size: 64px;
}

.empty-state h3 {
  margin: 12px 0 6px;
  font-size: 22px;
}

.empty-state p {
  margin: 0 0 20px;
  color: var(--muted);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin-top: 36px;
}

.page-button {
  min-width: 42px;
  height: 42px;
  padding: 0 10px;
  border: 2px solid var(--ink);
  border-radius: 12px;
  color: var(--ink);
  background: #fff;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 2px 3px 0 rgba(37, 50, 74, 0.1);
}

.page-button:hover:not(:disabled) {
  background: var(--blue-soft);
}

.page-button.is-active {
  background: var(--yellow);
}

.page-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
}

.page-ellipsis {
  padding-inline: 4px;
  color: var(--muted);
  font-weight: 900;
}

.collection {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 22px;
  align-items: center;
  margin-top: 38px;
  padding: 30px clamp(22px, 5vw, 50px);
  border: var(--border);
  border-radius: 25px;
  background: var(--purple-soft);
  box-shadow: var(--shadow);
}

.collection-icon {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: var(--border);
  border-radius: 28px 24px 31px 22px;
  background: var(--yellow);
  font-size: 35px;
  box-shadow: 5px 6px 0 rgba(37, 50, 74, 0.12);
  transform: rotate(-6deg);
}

.collection h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.collection p:not(.eyebrow) {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.site-footer {
  position: relative;
  margin-top: 80px;
  padding: 65px 0 35px;
  overflow: hidden;
  color: #fff;
  background: #5bb98f;
  text-align: center;
}

.site-footer::before {
  content: "";
  position: absolute;
  top: -46px;
  left: -4%;
  width: 108%;
  height: 80px;
  border: 3px solid var(--ink);
  border-radius: 50%;
  background: #79d3a9;
}

.footer-hills {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: space-around;
  max-width: 650px;
  margin-bottom: 16px;
  font-size: 35px;
}

.site-footer p,
.site-footer small {
  position: relative;
  z-index: 1;
}

.site-footer p {
  margin: 0 0 8px;
  font-weight: 900;
  letter-spacing: 0.06em;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  z-index: 10;
  padding: 11px 18px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--yellow);
  font-size: 13px;
  font-weight: 900;
  box-shadow: 4px 5px 0 rgba(37, 50, 74, 0.18);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 22px);
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes cloud-drift {
  0%,
  100% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(18px);
  }
}

@keyframes twinkle {
  0%,
  100% {
    opacity: 0.45;
    transform: scale(0.85) rotate(-8deg);
  }
  50% {
    opacity: 1;
    transform: scale(1.15) rotate(8deg);
  }
}

@keyframes card-pop {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
  }
}

@media (max-width: 920px) {
  .hero {
    grid-template-columns: 1fr;
    padding-block: 45px 70px;
  }

  .hero-copy {
    text-align: center;
  }

  .hero-intro {
    margin-inline: auto;
  }

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

  .spotlight {
    max-width: 700px;
    margin-inline: auto;
    transform: rotate(0.8deg);
  }

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

  .search-box {
    grid-column: 1 / -1;
  }

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

@media (max-width: 650px) {
  .site-header {
    padding-top: 16px;
  }

  .header-badge {
    display: none;
  }

  .hero {
    padding: 30px 0 58px;
  }

  .hero h1 {
    font-size: clamp(36px, 10.8vw, 48px);
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
    max-width: 310px;
    margin-inline: auto;
  }

  .hero-actions .button {
    width: 100%;
  }

  .spotlight {
    width: 100%;
    min-height: 0;
    padding: 34px 27px 42px;
    overflow: hidden;
  }

  .spotlight p {
    overflow-wrap: anywhere;
  }

  .spotlight-pin {
    width: 20px;
    height: 20px;
  }

  .explore {
    padding: 34px 16px 48px;
    border-radius: 24px;
  }

  .section-heading {
    display: block;
  }

  .result-count {
    margin-top: 10px;
  }

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

  .search-box {
    grid-column: auto;
  }

  .page-size {
    justify-content: space-between;
  }

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

  .quote-card {
    min-height: 305px;
  }

  .collection {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .collection-icon {
    margin-inline: auto;
  }

  .collection .button {
    justify-self: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
