/* No web fonts on purpose: system CJK fonts load instantly and nothing is blocked in China. */
:root {
  --bg: #16171a;
  --panel: #212227;
  --line: #303139;
  --text: #ececef;
  --muted: #9a9ba3;
  --accent: #6183ff;
  --wechat: #07c160;
  --alipay: #1677ff;
  --ok: #3fb950;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
}
a { color: var(--accent); }
img { max-width: 100%; display: block; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 0.9em; }
h1 { font-size: 1.6rem; line-height: 1.3; margin: 0 0 0.4rem; }
h2 { font-size: 1rem; margin: 1.5rem 0 0.4rem; color: var(--muted); font-weight: 600; }

.top, main, .foot { max-width: 1040px; margin: 0 auto; padding: 0 16px; }
.top { display: flex; justify-content: space-between; align-items: center; height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; text-decoration: none; }
.brand-logo { width: 28px; height: auto; flex-shrink: 0; }
.nav { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.foot { margin-top: 64px; padding-bottom: 32px; border-top: 1px solid var(--line); font-size: 0.85rem; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 1em 0; }
.foot-row p { margin: 0; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--text); }
.foot-links > * + *::before, .foot-company > * + *::before {
  content: "\00b7"; display: inline-block; margin: 0 0.5em; color: var(--muted); }

/* Privacy and terms pages */
.legal { max-width: 720px; padding-top: 16px; }
.legal h2 { font-size: 1.1rem; color: var(--text); margin: 2rem 0 0.5rem; }
.legal h3 { font-size: 1rem; margin: 1.25rem 0 0.25rem; }
.legal p, .legal li { line-height: 1.75; }
.legal ul { padding-left: 1.2em; }
.company { font-style: normal; line-height: 1.75; }
.order-help { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }

/* Language dropdown: <details> so it works without JavaScript. Opens upward, right aligned. */
.langs { position: relative; flex-shrink: 0; }
.langs summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); user-select: none; }
.langs summary::-webkit-details-marker { display: none; }
.langs summary::after { content: ""; width: 5px; height: 5px; margin: -3px 2px 0 2px;
  border: solid currentColor; border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.langs[open] summary::after { transform: rotate(-135deg); margin-top: 3px; }
.langs summary:hover, .langs[open] summary { color: var(--text); border-color: var(--muted); }
.langs summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.langs ul { position: absolute; right: 0; bottom: calc(100% + 6px); z-index: 10; min-width: 100%;
  margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45); }
.langs li a, .langs li span { display: block; padding: 7px 12px; border-radius: 6px; white-space: nowrap; text-decoration: none; }
.langs li a { color: var(--text); }
.langs li a:hover, .langs li a:focus-visible { background: var(--line); outline: none; }
.langs [aria-current] { color: var(--accent); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.intro { padding: 24px 0 8px; }
.intro p { color: var(--muted); margin: 0; }

.grid { list-style: none; padding: 0; margin: 24px 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card { display: block; background: var(--panel); border-radius: 12px; overflow: hidden;
  text-decoration: none; color: var(--text); border: 1px solid var(--line); }
.card img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; }
.card-body { display: flex; justify-content: space-between; gap: 8px; padding: 12px 14px; }
.card-name { font-weight: 600; }
.card-price { color: var(--accent); white-space: nowrap; }

.product { display: grid; gap: 32px; padding-top: 16px; }
@media (min-width: 760px) { .product { grid-template-columns: 1fr 1fr; align-items: start; } }
.product-preview { border-radius: 12px; border: 1px solid var(--line); width: 100%; }
.price { font-size: 1.5rem; color: var(--accent); font-weight: 700; margin: 0.5rem 0; }
.desc { white-space: pre-line; }
.files { padding-left: 1.2em; margin: 0; color: var(--muted); }

.pay { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0 8px; }
.btn { display: inline-block; border: 0; border-radius: 10px; padding: 12px 22px; font: inherit;
  font-weight: 600; color: #fff; background: var(--accent); cursor: pointer; text-decoration: none; }
.btn-wechat { background: var(--wechat); }
.btn-alipay { background: var(--alipay); }
.btn:hover { filter: brightness(1.08); }

.notice { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.notice.ok { border-color: var(--ok); }

.order { max-width: 520px; padding-top: 16px; }
.order-id { user-select: all; word-break: break-all; }
.qr { background: #fff; padding: 12px; border-radius: 12px; width: 240px; height: 240px; }
.downloads { list-style: none; padding: 0; display: grid; gap: 10px; }
.lookup { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.lookup label { width: 100%; color: var(--muted); }
.lookup input { flex: 1; min-width: 0; padding: 11px 12px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font: inherit; }

/* Receipt on the order page */
.receipt { margin-top: 2rem; padding: 4px 16px 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; }
.receipt h2 { color: var(--text); font-size: 1.05rem; margin: 0.9rem 0 0.6rem; }
.receipt dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.receipt dt { color: var(--muted); }
.receipt dd { margin: 0; overflow-wrap: anywhere; }

/* Printing or saving the order page as PDF: black on white, no buttons or navigation. */
@media print {
  :root { --bg: #fff; --panel: #fff; --line: #bbb; --text: #000; --muted: #555; --accent: #000; }
  .no-print, .nav, .langs, .foot-links, .foot > p:first-child { display: none; }
  .foot { margin-top: 24px; }
  .receipt { border-color: var(--line); break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
}
