:root {
  color-scheme: light;
  --background: #f6fbff;
  --foreground: #18365f;
  --card: #ffffff;
  --primary: #ce3866;
  --primary-foreground: #ffffff;
  --secondary: #e5f5fc;
  --secondary-foreground: #126889;
  --muted: #eef6fc;
  --muted-foreground: #62718a;
  --destructive: #c72c49;
  --border: #d7e7f2;
  --input: #cbdde9;
  --ring: #188eb9;
  --brand-sky: #1485ae;
  --brand-sky-soft: #e5f5fc;
  --brand-pink: #f7719b;
  --brand-pink-soft: #fff0f5;
  --brand-shadow: 0 8px 28px #29497509;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
body { margin: 0; background-color: var(--background); color: var(--foreground); line-height: 1.5; }
body.dialog-open { overflow: hidden; }
h1, h2, h3, p, ol, ul { margin: 0; }
ol, ul { padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, textarea { font: inherit; }
button:not(:disabled) { cursor: pointer; }
button:disabled { cursor: wait; opacity: .65; }
button:focus-visible, input:focus-visible, textarea:focus-visible { outline: 3px solid var(--ring); outline-offset: 3px; }
.icon-definitions { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { width: 16px; height: 16px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.site-shell { max-width: 1120px; min-height: 100vh; padding-inline: 24px; margin-inline: auto; display: flex; flex-direction: column; }
.site-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 28px 14px; }
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup h1 { font-size: 20px; }
main { display: flex; flex-direction: column; gap: 20px; padding-bottom: 40px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 10px 18px; border: 1px solid transparent; border-radius: 24px; background: var(--primary); color: white; font-size: 14px; font-weight: 600; line-height: 1.5; white-space: nowrap; box-shadow: 0 3px 0 #af3057; }
.button:hover { filter: brightness(.96); }
.button-outline { color: var(--foreground); background: var(--background); border-color: var(--border); box-shadow: 0 1px 2px #18365f08; }
.button-ghost { color: var(--foreground); background: transparent; box-shadow: none; }
.header-space { min-height: 36px; padding: 7px 12px; font-size: 13px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border: 1px solid var(--border); border-radius: 12px; color: var(--foreground); font-size: 11px; font-weight: 600; line-height: 1.5; }
.badge .icon { width: 12px; height: 12px; }
.badge-blue { color: var(--secondary-foreground); background: var(--secondary); border-color: transparent; }

/* 所有壁纸均免费；顶部只区分可直接领取的作品，采用紧凑目录样式。 */
.free-section { scroll-margin-top: 24px; }
.free-section .wallpaper-card { max-width: 240px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h2 { font-size: 21px; font-weight: 700; letter-spacing: .02em; }
.section-heading p { margin-top: 4px; color: var(--muted-foreground); font-size: 13px; }
.button-direct { background: #147b9f; }
.collection-label { margin-top: 8px; }

.collection-section, .claim-section { scroll-margin-top: 24px; }
.collection-heading { position: relative; margin-bottom: 20px; }
.collection-count { position: absolute; right: 14px; top: 0; line-height: 44px; font-size: 12px; color: var(--muted-foreground); pointer-events: none; }
.search-box { display: flex; align-items: center; position: relative; width: 100%; }
.search-box .icon { position: absolute; left: 14px; pointer-events: none; color: var(--muted-foreground); }
.search-box input { min-width: 0; width: 100%; height: 44px; padding: 10px 84px 10px 40px; border: 1px solid var(--input); border-radius: 12px; background: var(--card); color: var(--foreground); font-size: 14px; }
.search-box input::placeholder { color: var(--muted-foreground); }
.result-heading { font-size: 14px; font-weight: 400; color: var(--muted-foreground); margin: 20px 0; }
.wallpaper-card { min-width: 0; display: flex; flex-direction: column; gap: 12px; overflow: hidden; border-radius: 16px; background: var(--card); border: 1px solid var(--border); }
.card-header { padding: 0 14px; }
.card-title { font-size: 16px; line-height: 1.5; min-height: 3em; }
.card-footer { display: flex; gap: 8px; padding: 0 14px 14px; margin-top: auto; }
.card-footer .button { flex: 1; min-width: 0; padding-inline: 8px; border-radius: 11px; box-shadow: none; }
.wallpaper-placeholder { display: grid; place-items: center; aspect-ratio: 16/9; color: var(--muted-foreground); }
.wallpaper-placeholder .icon { width: 36px; height: 36px; }
.empty-state { display: flex; flex-direction: column; align-items: center; gap: 18px; padding: 40px 24px; border: 1px dashed var(--border); border-radius: 22px; background: var(--card); text-align: center; }
.empty-state h3 { font-size: 18px; }
.empty-state p { font-size: 14px; color: var(--muted-foreground); overflow-wrap: anywhere; }
.claim-heading > .icon, .step-icon > .icon { width: 20px; height: 20px; }
.site-footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-block: 24px; margin-top: auto; }
.site-footer > span { display: flex; align-items: center; gap: 8px; }
.unlock-dialog { padding: 24px; width: calc(100% - 32px); max-width: 448px; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow-y: auto; border-radius: 24px; background: var(--background); color: var(--foreground); font-size: 14px; }
.unlock-dialog::backdrop, .dialog-backdrop { background: #0008; backdrop-filter: blur(4px); }
.dialog-backdrop { position: fixed; inset: 0; z-index: 49; }
.unlock-dialog.dialog-fallback { position: fixed; z-index: 50; inset: 0; margin: auto; height: fit-content; }
.close-button { position: absolute; top: 6px; right: 6px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; color: var(--muted-foreground); background: transparent; }
.close-button:hover { background: var(--muted); }
.close-button:focus-visible { outline-width: 2px; outline-offset: -6px; }
.unlock-heading { display: flex; align-items: center; gap: 12px; padding-right: 20px; margin-bottom: 16px; }
.unlock-heading h2 { font-size: 16px; font-weight: 600; }
.unlock-heading p { color: var(--muted-foreground); margin-top: 4px; }
#unlock-cover { width: 56px; height: 56px; flex-shrink: 0; }
#unlock-cover img, #unlock-cover .wallpaper-placeholder { width: 100%; height: 100%; min-height: 0; border-radius: 10px; object-fit: cover; }
#unlock-content { display: flex; flex-direction: column; gap: 14px; margin-top: 18px; }
.status-message { padding: 24px 0; text-align: center; color: var(--muted-foreground); }
.status-message .icon { vertical-align: middle; margin-right: 6px; }
.spinner { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.unlock-checklist { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 15px; background: var(--muted); }
.unlock-checklist li { display: flex; align-items: center; gap: 8px; color: var(--muted-foreground); }
.unlock-checklist li.done { color: var(--foreground); }
.unlock-checklist .done .icon { color: var(--primary); }
.unlock-checklist small { margin-left: auto; font-size: 12px; }
.unlock-actions { display: flex; gap: 8px; }
.unlock-actions .button { flex: 1; }
.helper-text { font-size: 12px; line-height: 1.8; color: var(--muted-foreground); }
.success-text { color: var(--primary); }
.pan-links { display: flex; flex-direction: column; gap: 12px; }
.pan-link-card { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 16px; }
.pan-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.pan-row .button { padding-inline: 12px; }
#copy-feedback { margin-top: 14px; font-size: 12px; }
#copy-feedback textarea { width: 100%; min-height: 90px; margin-top: 8px; padding: 10px; border: 1px solid var(--input); border-radius: 10px; color: var(--foreground); background: var(--card); }

/* 壁纸酱：蓝白底、莓粉行动按钮、轻量贴纸感。 */
body {
  background-image: radial-gradient(var(--border) 0.8px, transparent 0.8px);
  background-size: 20px 20px;
}
a,
button,
input {
  -webkit-tap-highlight-color: transparent;
}
a:focus-visible {
  outline: 3px solid var(--ring);
  outline-offset: 5px;
  border-radius: 6px;
}
.skip-link {
  position: fixed;
  top: -100px;
  left: 1rem;
  padding: 0.7rem 1rem;
  background: var(--card);
}
.skip-link:focus {
  top: 1rem;
  z-index: 60;
}
.brand-avatar {
  border: 3px solid var(--card);
  border-radius: 15px;
  box-shadow: 0 2px 0 var(--border);
}
.brand-caption {
  display: block;
  margin-top: 3px;
  color: var(--muted-foreground);
  font-size: 11px;
  letter-spacing: 0.04em;
}
.wallpaper-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}
.wallpaper-card {
  padding-top: 0;
  box-shadow: var(--brand-shadow);
  transition:
    box-shadow 180ms,
    transform 180ms;
}
.card-media {
  position: relative;
  aspect-ratio: 16 / 9;
  flex-shrink: 0;
  overflow: hidden;
  background: var(--muted);
}
.card-media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.wallpaper-placeholder {
  background: linear-gradient(135deg, var(--secondary), var(--brand-pink-soft));
}
.wallpaper-card .card-footer {
  background: var(--card);
}
.wallpaper-card .card-title {
  font-weight: 700;
}
.mascot-empty {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--brand-shadow);
}
.empty-avatar {
  border: 5px solid var(--card);
  border-radius: 26px;
  box-shadow: 0 4px 0 var(--border);
  transform: rotate(-6deg);
}
.claim-section {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 24px;
  box-shadow: var(--brand-shadow);
}
.claim-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 24px;
}
.claim-heading > svg {
  color: var(--brand-sky);
}
.claim-heading h2 {
  font-weight: 700;
  font-size: 17px;
}
.claim-heading > span {
  font-size: 12px;
  color: var(--muted-foreground);
  margin-left: auto;
}
.claim-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}
.claim-steps > li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.step-icon {
  position: relative;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--secondary);
  color: var(--secondary-foreground);
}
.step-icon > span {
  position: absolute;
  font-size: 9px;
  top: -6px;
  right: -4px;
  padding: 0 4px;
  border-radius: 5px;
  color: var(--secondary-foreground);
  background: var(--card);
  border: 1px solid var(--border);
  font-weight: 600;
}
.claim-steps > li:nth-child(2) .step-icon {
  background: var(--brand-pink-soft);
  color: var(--primary);
}
.claim-steps h3 {
  font-size: 14px;
  font-weight: 650;
  margin-bottom: 7px;
}
.claim-steps p {
  font-size: 12px;
  color: var(--muted-foreground);
  line-height: 1.8;
}
.claim-steps .step-detail {
  font-size: 11px;
  margin-top: 2px;
}
.site-footer {
  border-top: 1px dashed var(--input);
  color: var(--muted-foreground);
  font-size: 11px;
}
.site-footer svg {
  color: var(--primary);
}
.unlock-dialog {
  border: 1px solid var(--border);
  box-shadow: 0 20px 80px #16396320;
}
.unlock-mascot-note {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--secondary);
  border-radius: 13px;
  padding: 10px;
  margin-top: 8px;
}
.unlock-mascot-note img {
  flex-shrink: 0;
  border-radius: 12px;
  width: 38px;
  height: 38px;
}
.unlock-mascot-note p {
  font-size: 12px;
  color: var(--secondary-foreground);
  line-height: 1.7;
}
.unlock-checklist {
  border: 1px dashed var(--border);
}
.pan-link-card {
  border: 1px solid var(--border);
  background: var(--card);
}
.pan-link-card code {
  border-radius: 6px;
  background: var(--secondary);
  padding: 3px 6px;
}
@media (min-width: 640px) and (max-width: 850px) {
  .card-header { padding-inline: 10px; }
  .card-title { font-size: 14px; }
  .card-footer { padding-inline: 10px; gap: 6px; }
  .card-footer .button { font-size: 12px; padding-inline: 5px; gap: 4px; }
  .card-footer .icon { display: none; }
}
@media (max-width: 639px) {
  .brand-lockup {
    gap: 9px;
  }
  .brand-avatar {
    width: 39px;
    height: 39px;
  }
  .brand-caption {
    font-size: 10px;
    letter-spacing: 0;
  }

  .wallpaper-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 12px;
  }
  .wallpaper-card { gap: 10px; border-radius: 13px; }
  .card-header { padding-inline: 10px; }
  .card-title { font-size: 14px; }
  .card-footer { gap: 6px; padding: 0 8px 10px; }
  .card-footer .button { font-size: 12px; padding: 9px 4px; border-radius: 9px; }
  .card-footer .icon { display: none; }
  .claim-section {
    padding: 20px;
  }
  .claim-heading {
    flex-wrap: wrap;
    row-gap: 4px;
    margin-bottom: 22px;
  }
  .claim-heading > span {
    display: none;
  }
  .claim-steps {
    grid-template-columns: 1fr;
    gap: 23px;
  }
}
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
  @media (hover: hover) {
    .wallpaper-card:hover {
      box-shadow: 0 12px 30px #29497514;
      transform: translateY(-3px);
    }
  }
}
@media (prefers-reduced-motion: reduce) {
  .button,
  .unlock-dialog,
  .wallpaper-card,
  .unlock-dialog .spinner {
    animation: none;
    transition: none;
  }
}

@media (max-width: 639px) {
  .site-shell { padding-inline: 16px; }
  .site-header { gap: 10px; padding-top: 20px; }
  .brand-lockup h1 { font-size: 16px; }
  .section-heading h2 { font-size: 18px; }
  .section-heading p { font-size: 12px; }
  .search-box input { font-size: 12px; padding-right: 62px; }
  .unlock-actions { flex-direction: column; }
  .unlock-actions .button { flex: none; width: 100%; }
  .site-footer { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 359px) {
  .brand-lockup h1 { font-size: 14px; }
  .brand-caption { font-size: 9px; }
  .header-space { padding-inline: 8px; }

}

/* 视频标题由 B 站返回，允许长标题换行。 */
.card-title, .unlock-heading h2 { overflow-wrap: anywhere; }
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; }
.unlock-heading > div:last-child { min-width: 0; }
.video-notice { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; padding: 10px 14px; margin-bottom: 16px; background: var(--secondary); border-radius: 12px; color: var(--secondary-foreground); font-size: 13px; }
.video-notice > span { display: flex; align-items: center; gap: 8px; }
.video-notice .button { font-size: 12px; padding: 8px; }
