:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
  color: #1d2032;
  background: #f5f6fa;
  font-synthesis: none;
  --muted: #626981;
  --line: #e4e6ef;
  --accent: #4938ba;
  --accent-dark: #392898;
  --card: #fff;
  --ease: cubic-bezier(.22, .72, .25, 1);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
h1, h2, p { margin: 0; }
button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button:enabled { cursor: pointer; }
button:disabled { cursor: default; }
a { color: inherit; text-decoration: none; }
:is(a, button, input, textarea):focus-visible { outline: 2px solid #6a56d7; outline-offset: 3px; }

.shell { width: min(1176px, calc(100% - 64px)); margin-inline: auto; }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { height: 68px; display: flex; align-items: center; justify-content: space-between; }
.brand, .home-link { display: inline-flex; align-items: center; gap: 10px; }
.brand { font-size: 13px; font-weight: 800; letter-spacing: .16em; }
.brand-mark {
  width: 29px; height: 29px; display: grid; place-items: center; letter-spacing: 0;
  color: white; border-radius: 8px; background: #272640; font-size: 14px;
}
.home-link { font-size: 13px; font-weight: 650; color: var(--muted); transition: color .2s; }
.home-link:hover { color: var(--accent); }

main.shell { padding-block: 34px 58px; animation: arrive .38s var(--ease) both; }
.overview { display: grid; grid-template-columns: minmax(0, 2fr) minmax(298px, 1fr); gap: 16px; }
.hero, .exports { min-width: 0; border: 1px solid var(--line); border-radius: 21px; }
.hero {
  position: relative; isolation: isolate; display: flex; align-items: center;
  min-height: 254px; overflow: hidden; padding: 36px 40px;
  border-color: #e2def6;
  background: radial-gradient(ellipse at 88% 100%, #eadfff 0%, transparent 58%), linear-gradient(118deg, #f7f2ff 20%, #e9eaff 100%);
}
.hero-copy { z-index: 1; }
.hero-context { margin-bottom: 12px; color: #5243a6; font-size: 13px; font-weight: 750; letter-spacing: .14em; }
.hero h1 { font-size: clamp(43px, 5.6vw, 68px); line-height: 1.1; font-weight: 800; letter-spacing: -.05em; }
.hero-description { margin-top: 17px; color: #555978; font-size: 15px; line-height: 1.65; }
.hero-art { position: absolute; inset: 0 1% 0 auto; width: 46%; min-width: 245px; pointer-events: none; }
.art-orbit {
  position: absolute; width: 106%; height: 66%; left: -1%; top: 19%; border: 1px solid #8e72d460;
  border-radius: 50%; transform: rotate(-26deg);
}
.art-orbit::after {
  content: ""; position: absolute; top: 19%; right: 8%; width: 7px; aspect-ratio: 1;
  border-radius: 50%; background: #9f87ee; box-shadow: 0 0 0 5px #a48df029;
}
.art-tile {
  position: absolute; display: grid; place-items: center; aspect-ratio: 1; background: #ffffffa6;
  border: 1px solid white; border-radius: 25%; box-shadow: 0 15px 35px #55469e22;
  transform: rotate(var(--rotation)); animation: art-in .58s var(--ease) both;
}
.art-tile img { display: block; width: 80%; height: 80%; object-fit: contain; filter: drop-shadow(0 9px 9px #43377336); }
.art-rose { width: 29%; top: 16%; left: 5%; --rotation: -13deg; }
.art-lion { width: 41%; top: 23%; left: 35%; --rotation: 9deg; animation-delay: .055s; }
.art-heart { width: 23%; top: 57%; left: 67%; --rotation: -9deg; animation-delay: .11s; }

.exports { display: grid; align-content: center; gap: 20px; padding: 25px; background: var(--card); }
.exports h2, .catalog h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.025em; }
.exports p { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--muted); }
.export-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.export-actions button, .secondary-button {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 44px;
  padding: 0 12px; border: 1px solid #dcdeea; border-radius: 10px; background: var(--card);
  color: #34364d; font-size: 13px; font-weight: 680;
  transition: background .18s, border-color .18s, color .18s, translate .18s;
}
.export-actions button:enabled:hover, .secondary-button:not(:disabled):hover { background: #f2efff; border-color: #c4b9f5; color: var(--accent-dark); }
.export-actions button:enabled:active, .secondary-button:enabled:active { translate: 0 1px; }
.export-actions button > span:first-child { font-family: "IBM Plex Mono", Consolas, monospace; color: var(--accent); font-size: 15px; }
.export-actions button .csv-icon { font-size: 20px; }
.export-actions .prompt-button { grid-column: 1 / -1; justify-content: flex-start; padding-inline: 14px; background: var(--accent); border-color: var(--accent); color: #fff; }
.export-actions .prompt-button:enabled:hover { background: var(--accent-dark); border-color: var(--accent-dark); color: #fff; }
.export-actions .prompt-button > span:first-child { color: inherit; }
.prompt-format { margin-left: auto; color: #eee9ff; font-size: 11px; font-weight: 500; }
.export-actions button:disabled, .secondary-button:disabled { opacity: .55; }

.catalog { margin-top: 36px; }
.catalog-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.catalog h2 { font-size: 24px; }
.search { position: relative; width: min(300px, 100%); }
.search input { width: 100%; min-height: 44px; padding: 0 13px 0 39px; border-radius: 11px; border: 1px solid var(--line); background: var(--card); color: inherit; font-size: 14px; }
.search input::placeholder { color: var(--muted); }
.search-icon { position: absolute; top: 14px; left: 15px; width: 13px; height: 13px; border: 1.6px solid var(--muted); border-radius: 50%; pointer-events: none; }
.search-icon::after { position: absolute; content: ""; width: 6px; height: 1.5px; background: var(--muted); bottom: -2px; right: -4px; transform: rotate(46deg); }
.categories { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.categories:empty { display: none; }
.category-button {
  min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--card); color: #4b5168; font-size: 13px; font-weight: 650;
  transition: background .18s, color .18s, border-color .18s;
}
.category-button:hover { border-color: #bfb4f0; }
.category-button[aria-pressed="true"] { background: #eae5ff; border-color: #dacefb; color: #412ca6; }
.category-count { margin-left: 6px; color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.category-button[aria-pressed="true"] .category-count { color: #5138ae; }
.results { margin: 18px 0 10px; color: var(--muted); font-size: 13px; line-height: 1.5; font-variant-numeric: tabular-nums; }
.gift-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 158px), 1fr)); gap: 12px; padding: 0; margin: 0; list-style: none; }
.gift-grid > li { min-width: 0; animation: arrive .26s var(--ease) both; animation-delay: var(--delay, 0ms); }
.gift-card {
  display: grid; grid-template-rows: auto auto 1fr; align-content: start; gap: 6px; width: 100%; height: 100%;
  min-width: 0; padding: 9px 9px 13px; text-align: left; color: inherit;
  background: var(--card); border: 1px solid var(--line); border-radius: 15px;
  transition: border-color .2s, box-shadow .2s, translate .2s var(--ease);
}
.gift-card:hover { translate: 0 -2px; border-color: #cdbff4; box-shadow: 0 9px 20px #39356612; }
.gift-picture, .detail-preview { display: grid; place-items: center; height: 103px; background: #f0eefb; border-radius: 10px; }
.gift-picture img, .detail-preview img { object-fit: contain; filter: drop-shadow(0 6px 7px #45377522); transition: scale .2s var(--ease); }
.gift-card:hover img { scale: 1.08; }
[data-platform="kuaishou"] { background: #fff0e6; }
[data-platform="tiktok"] { background: #e9f4f2; }
[data-platform="builtin"] { background: #edf0f5; }
.gift-name { padding: 3px 3px 0; overflow-wrap: anywhere; font-size: 14px; font-weight: 740; }
.gift-meta { display: flex; align-self: end; justify-content: space-between; align-items: center; gap: 4px 8px; flex-wrap: wrap; padding-inline: 3px; font-size: 11px; }
.gift-category, .missing-picture { color: var(--muted); }
.missing-picture { font-size: 12px; }
.gift-price { color: #4d3ba7; font-weight: 725; font-variant-numeric: tabular-nums; }
.pagination { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 13px; margin-top: 24px; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }

dialog {
  width: min(445px, calc(100% - 32px)); max-height: calc(100% - 40px); padding: 22px;
  border: 1px solid var(--line); border-radius: 19px; background: var(--card); color: inherit;
  box-shadow: 0 25px 85px #26224738;
}
dialog[open] { animation: arrive .24s var(--ease) both; }
dialog::backdrop { background: #211c40a8; }
.dialog-top { display: flex; justify-content: flex-end; margin: -9px -9px 6px 0; }
.close-button { width: 38px; height: 38px; border: 0; border-radius: 8px; color: #535975; background: #f3f3f8; font-size: 22px; }
.close-button:hover { color: var(--accent); background: #e9e4fd; }
.detail-preview { height: 160px; margin-bottom: 16px; }
.detail-category, #copy-dialog p { margin-top: 6px; color: var(--muted); font-size: 13px; }
.detail-fields { margin-block: 15px; }
.detail-fields > div { display: grid; grid-template-columns: 114px minmax(0, 1fr); gap: 6px 10px; padding-block: 10px; border-top: 1px solid var(--line); font-size: 13px; }
.detail-fields dt { color: var(--muted); }
.detail-fields dd { margin: 0; overflow-wrap: anywhere; }
.dialog-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.detail-status:not(:empty) { margin-top: 8px; color: var(--accent); font-size: 13px; }
#copy-content { width: 100%; height: 170px; margin-top: 13px; padding: 9px; resize: vertical; border: 1px solid var(--line); border-radius: 8px; color: inherit; background: #f8f8fc; font-family: "IBM Plex Mono", Consolas, monospace; font-size: 12px; }
.toast {
  position: fixed; max-width: calc(100% - 32px); bottom: 22px; left: 50%; z-index: 1; translate: -50% 8px;
  padding: 11px 16px; border-radius: 10px; background: #292343; color: white; font-size: 14px;
  box-shadow: 0 6px 20px #241b4533; opacity: 0; pointer-events: none; transition: opacity .2s, translate .2s;
}
.toast.visible { translate: -50% 0; opacity: 1; }

@keyframes arrive { from { opacity: 0; translate: 0 7px; } }
@keyframes art-in { from { opacity: 0; translate: 0 13px; scale: .96; } }

@media (min-width: 1000px) {
  .gift-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
}
@media (max-width: 880px) {
  .shell { width: calc(100% - 40px); }
  .overview { grid-template-columns: minmax(0, 1fr); }
  .hero-art { right: 6%; width: min(42%, 310px); }
  .exports { grid-template-columns: minmax(0, 1fr) minmax(270px, 1fr); align-items: center; }
}
@media (max-width: 570px) {
  .shell { width: calc(100% - 28px); }
  .header-inner { height: 56px; }
  main.shell { padding-top: 16px; }
  .overview { gap: 11px; }
  .hero { min-height: 190px; padding: 22px; }
  .hero h1 { font-size: 39px; }
  .hero-description { max-width: 12.5em; font-size: 13px; margin-top: 10px; }
  .hero-art { min-width: 0; width: 44%; right: -1%; }
  .art-rose { top: 19%; left: 20%; }
  .art-lion { top: 38%; left: 35%; width: 55%; }
  .art-heart { top: 65%; left: 63%; width: 27%; }
  .exports { grid-template-columns: 1fr; gap: 14px; padding: 17px; }
  .catalog { margin-top: 25px; }
  .catalog-heading { align-items: stretch; flex-direction: column; }
  .search { width: 100%; }
  .categories { gap: 6px; margin-top: 10px; }
  .category-button { padding-inline: 8px; }
  .gift-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .gift-picture { height: 94px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
