:root {
  color-scheme: dark;
  --background: #0b0b0c;
  --foreground: #eee8dd;
  --muted: #b8aea0;
  --primary: #d8b76b;
  --on-primary: #19150c;
  --accent: #e6d5ac;
  --border: #463b2d;
  --surface: #161414;
  --ring: #edcf8e;
  --font-serif: "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", SimSun, serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --background: #f7f4ed;
  --foreground: #292722;
  --muted: #615a4d;
  --primary: #735720;
  --on-primary: #fff9e9;
  --accent: #8f7136;
  --border: #d6c8ae;
  --surface: #efebe2;
  --ring: #735720;
}
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-padding-top: 80px; }
body {
  margin: 0; min-height: 100svh; display: flex; flex-direction: column;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--foreground); background: var(--background);
}
main { flex: 1; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
button, input, textarea { font: inherit; }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 4px; }
h1, h2, h3 { font-family: var(--font-serif); font-weight: 500; }
.site-header {
  position: sticky; top: 0; z-index: 5; border-bottom: 1px solid var(--border);
  background: var(--background);
}
.header-inner, .hero-inner, .site-footer {
  width: min(1280px, calc(100% - 88px)); margin-inline: auto;
}
.header-inner { position: relative; min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; gap: 10px; flex: none; align-items: center; color: var(--primary); }
.brand svg { width: 34px; height: 34px; }
.brand span { color: var(--foreground); font: 500 22px/1.05 var(--font-serif); letter-spacing: .08em; }
.brand small {
  display: block; margin-top: 5px; color: var(--muted); font: 400 9px/1.15 system-ui, sans-serif;
  letter-spacing: .15em;
}
.site-nav {
  position: absolute; z-index: 1; top: calc(100% + 1px); right: 0;
  width: min(240px, 100%); padding: 12px; background: var(--background);
  border: 1px solid var(--border); border-radius: 5px; display: grid;
  max-height: calc(100svh - 76px); overflow-y: auto;
}
.site-nav a, .text-control { min-height: 38px; display: flex; align-items: center; font-size: 14px; white-space: nowrap; }
.site-nav a { padding-inline: 8px; }
.site-nav a[aria-current="page"] { color: var(--primary); background: var(--surface); border-radius: 5px; }
.menu-settings { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--border); }
.menu-settings .text-control { font-size: 12px; }
.text-control {
  border: 1px solid var(--border); border-radius: 5px; color: var(--foreground);
  background: var(--background); padding: 0 10px; cursor: pointer;
}
.menu-toggle { min-width: 44px; min-height: 44px; justify-content: center; padding: 0; }
.text-control:hover:not(:disabled) { border-color: var(--primary); color: var(--primary); }
.text-control:disabled { cursor: default; color: var(--muted); }
.hero { position: relative; isolation: isolate; overflow: hidden; min-height: max(560px, calc(100svh - 76px - 72px)); }
.stellar-sky { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.stellar-sky canvas { display: block; width: 100%; height: 100%; mask-image: linear-gradient(#000 82%, transparent); }
.hero-inner { position: relative; pointer-events: none; }
.hero-copy { width: min(500px, 48%); padding: clamp(76px, 14vh, 150px) 0 70px; pointer-events: auto; }
.hero h1 { margin: 0 0 26px; font-size: clamp(57px, 6.2vw, 92px); letter-spacing: .01em; line-height: 1.24; white-space: nowrap; }
.hero .hero-generate { min-height: 64px; padding-inline: 36px; font-size: 20px; }
.hero-price { margin: 10px 0 0; color: var(--muted); font-size: 14px; }
.wallpaper-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: stretch; }
.caption input, .complaint-form input, .complaint-form textarea, .secondary {
  background: var(--surface); color: var(--foreground); border: 1px solid var(--border); border-radius: 5px;
}
.caption input, .complaint-form input { width: 100%; height: 52px; padding: 0 12px; font-size: 16px; }
.caption input::placeholder, .complaint-form input::placeholder { color: var(--muted); opacity: 1; }
.primary, .secondary {
  min-height: 47px; padding: 0 17px; display: inline-flex; align-items: center; justify-content: center;
  gap: 18px; border-radius: 5px; font-weight: 500; white-space: nowrap; cursor: pointer;
}
.primary { color: var(--on-primary); background: var(--primary); border: 1px solid var(--primary); }
.primary:hover { color: var(--on-primary); background: color-mix(in srgb, var(--primary) 84%, var(--foreground)); }
.primary:disabled, .secondary:disabled { opacity: .62; cursor: default; }
.wallpaper-result { border-block: 1px solid var(--border); padding: clamp(28px, 6vw, 78px) 22px; }
.result-inner { width: min(360px, 100%); margin-inline: auto; display: grid; gap: 14px; }
.result-inner > * { min-width: 0; }
.text-page h1 { margin: 0; font-size: clamp(34px, 4.3vw, 56px); line-height: 1.2; }
.result-product { padding: 20px; border: 1px solid var(--border); border-radius: 5px; overflow-wrap: anywhere; }
.result-product h2 { margin: 0; font-size: 22px; }
.result-product .product-price { margin: 6px 0; }
.result-spec, .result-links, #result-status { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.6; }
.result-links a { text-decoration: underline; text-underline-offset: .18em; }
.result-frame {
  width: min(200px, 56%); justify-self: center; aspect-ratio: 520 / 1130; background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; overflow: hidden;
}
.result-frame img { width: 100%; height: 100%; display: block; object-fit: contain; }
.text-page { width: min(710px, calc(100% - 44px)); margin-inline: auto; padding: clamp(54px, 10vw, 112px) 0; }
.text-page h1 { margin-bottom: 35px; }
.text-page h2 { margin: 28px 0 8px; font-size: 24px; }
.text-page p { margin: 0 0 15px; color: var(--muted); font-size: 16px; line-height: 1.9; }
.text-page ul, .text-page ol {
  margin: 0 0 15px; padding-inline-start: 1.45em; color: var(--muted); font-size: 16px; line-height: 1.9;
}
.text-page .product-price, .result-product .product-price { color: var(--primary); font: 500 28px/1.4 var(--font-serif); }
.inline-link { text-decoration: underline; text-underline-offset: .18em; }
.purchase-link { margin-top: 8px; }
.support-qr { display: block; width: 220px; max-width: 100%; height: auto; border: 1px solid var(--border); border-radius: 5px; }
.complaint-form { display: grid; gap: 14px; }
.complaint-form label { display: block; color: var(--muted); font-size: 14px; }
.complaint-form input, .complaint-form textarea { display: block; margin-top: 6px; }
.complaint-form textarea { width: 100%; padding: 12px; font-size: 16px; resize: vertical; }
.complaint-form .primary { justify-self: start; }
#result-status:empty, .complaint-status:empty {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%);
}
.site-footer { padding: 20px 0 24px; border-top: 1px solid var(--border); color: var(--muted); }
.footer-small { margin: 0; font-size: 13px; line-height: 1.6; }
.footer-small a { display: inline-block; text-decoration: underline; text-underline-offset: .18em; }

@media (max-width: 960px) {
  .header-inner, .hero-inner, .site-footer { width: calc(100% - 48px); }
  .header-inner { min-height: 64px; gap: 12px; }
  .site-nav { width: 100%; max-height: calc(100svh - 64px); }
  .hero { min-height: max(560px, calc(100svh - 64px - 72px)); }
  .hero-copy { width: min(460px, 100%); padding: 62px 0 0; }
  .site-footer { padding: 12px 0 14px; }
}
@media (max-width: 620px) {
  html { scroll-padding-top: 66px; }
  .header-inner, .hero-inner, .site-footer { width: calc(100% - 40px); }
  .site-nav a { min-height: 44px; }
  .brand svg { width: 28px; height: 28px; }
  .brand span { font-size: 20px; }
  .brand { gap: 7px; }
  .brand small { font-size: 8px; }
  .hero-copy { padding-top: 50px; }
  .hero h1 { font-size: clamp(42px, 11.5vw, 58px); }
  .hero .hero-generate { width: 100%; max-width: 360px; }
  .wallpaper-form { grid-template-columns: minmax(0, 1fr); }
}

@media (min-width: 900px) {
  .result-inner { width: min(760px, 100%); grid-template-columns: 260px minmax(0, 1fr); column-gap: 44px; align-content: start; }
  .result-frame { grid-column: 1; grid-row: 1 / span 6; width: 260px; justify-self: start; }
  .result-inner > :not(.result-frame) { grid-column: 2; }
}

.sample-strip { width: min(620px, calc(100% - 44px)); margin: 0 auto; padding: 8px 0 44px; }
.sample-strip ul, .text-page .sample-gallery { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.sample-strip ul { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.sample-strip img, .sample-gallery img {
  width: 100%; height: auto; aspect-ratio: 520 / 1130; object-fit: cover; display: block;
  border: 1px solid var(--border); border-radius: 6px; background: var(--surface);
}
.text-page .sample-gallery { grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); margin: 0 0 15px; padding: 0; }
.sample-gallery figure { margin: 0; }
.sample-gallery figcaption { margin-top: 6px; color: var(--muted); font-size: 13px; line-height: 1.4; text-align: center; }
