:root { --bg: #fafaf7; --fg: #1a1a1a; --muted: #6b6b6b; --line: #e4e2da; --accent: #1677ff; --note: #f1efe6; --card: #fff; --price: #e4572e; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #141414; --fg: #ececec; --muted: #9a9a9a; --line: #333; --accent: #4c96ff; --note: #242320; --card: #1d1d1d; --price: #ff7a50; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); line-height: 1.6;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; }
.wrap { max-width: 36rem; margin: 0 auto; padding: 0 16px 48px; }
header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 20px 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 6px; font-size: 1.2rem; font-weight: 700; color: var(--fg); text-decoration: none; }
.brand .mark { padding: 0 7px; border-radius: 6px; background: #1f2937; color: #fbbf24; }
nav { display: flex; align-items: center; gap: 14px; }
nav form { margin: 0; }
a { color: var(--accent); }
h1 { font-size: 1.5rem; margin: 8px 0 16px; }
.muted { color: var(--muted); }
.note { background: var(--note); padding: 10px 14px; border-radius: 6px; margin: 0 0 16px; }
.note form { display: inline; }
.item { border-top: 1px solid var(--line); padding: 16px 0; }
.item h2 { font-size: 1.1rem; margin: 0; }
.item p { margin: 4px 0 10px; }
.row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
label { display: block; margin-bottom: 12px; }
input[type=email], input[type=password], input[type=text], textarea { display: block; width: 100%; padding: 9px 10px; margin-top: 4px; font: inherit;
  color: var(--fg); background: transparent; border: 1px solid var(--line); border-radius: 6px; }
textarea { resize: vertical; }
input[type=file] { display: block; margin-top: 4px; font: inherit; }
.preview { display: block; max-width: 200px; border-radius: 6px; margin-bottom: 8px; }
label.check { display: flex; align-items: center; gap: 8px; }
.wrap.wide { max-width: 64rem; }
.subnav { display: flex; align-items: center; gap: 14px; margin: 0 0 16px; }
.scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: 8px 12px 8px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .85rem; }
.delivery a { word-break: break-all; }
/* Bigger tap targets for the header links. */
header { padding: 10px 0; }
nav a, nav button.link, .subnav a { padding: 10px 0; }
@media (max-width: 640px) {
  /* Wide admin tables become one card per row on phones. */
  table.cards, table.cards tbody, table.cards tr, table.cards td { display: block; }
  table.cards tr:first-child { display: none; }
  table.cards tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  table.cards td { padding: 2px 0; border: 0; white-space: normal; word-break: break-all; }
  table.cards td[data-label]::before { content: attr(data-label) "："; color: var(--muted); }
}
button { font: inherit; padding: 8px 18px; color: #fff; background: var(--accent); border: 0; border-radius: 6px; cursor: pointer; }
button.link { padding: 0; color: var(--accent); background: none; text-decoration: underline; }
.center { text-align: center; }
.delivery { white-space: pre-wrap; word-break: break-word; background: var(--note); padding: 12px 14px; border-radius: 6px; }
/* Storefront */
header { border-bottom: 1px solid var(--line); margin-bottom: 20px; }
.hero h1 { font-size: 1.5rem; margin: 4px 0 2px; }
.hero p { margin: 0 0 18px; }
.tabs { display: flex; gap: 8px; overflow-x: auto; margin: 0 0 18px; padding-bottom: 2px; }
.tabs a { flex: none; padding: 5px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); text-decoration: none; }
.tabs a.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.grid { display: flex; flex-direction: column; gap: 12px; }
.card { display: flex; flex-direction: row; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 12px; }
.cover { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.cover.blank { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #1f2937, #374151); color: #fbbf24; font-size: 1.4rem; font-weight: 700; }
.card-body { display: flex; flex: 1; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.card h2 { font-size: 1.05rem; margin: 0; }
.chip { align-self: flex-start; padding: 0 8px; border-radius: 999px; background: var(--note); color: var(--muted); font-size: .78rem; }
.desc { margin: 0; font-size: .92rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .row { margin-top: auto; padding-top: 8px; }
.card form { margin: 0; }
.price { color: var(--price); font-size: 1.15rem; font-weight: 700; }
footer { margin-top: 40px; padding-top: 14px; border-top: 1px solid var(--line); font-size: .85rem; }
.card h2 a { color: inherit; text-decoration: none; }
.detail-cover { border-radius: 12px; margin-bottom: 14px; }
.detail-desc { white-space: pre-wrap; word-break: break-word; margin: 16px 0; }
.buy-row { margin: 4px 0 8px; }
.card > a { display: block; flex: none; align-self: center; width: 200px; }
@media (max-width: 520px) { .card > a { width: 112px; } }
/* Sign-in pages */
.auth { max-width: 400px; margin: 28px auto 0; padding: 28px 24px 24px; background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 8px 28px rgba(0, 0, 0, .06); }
.auth .logo { display: flex; justify-content: center; margin-bottom: 12px; }
.auth .logo span { padding: 4px 12px; border-radius: 10px; background: #1f2937; color: #fbbf24; font-size: 1.2rem; font-weight: 700; }
.auth h1 { margin: 0 0 4px; text-align: center; font-size: 1.4rem; }
.auth .sub { margin: 0 0 20px; text-align: center; color: var(--muted); font-size: .95rem; }
.auth label { margin-bottom: 14px; color: var(--muted); font-size: .92rem; }
.auth input[type=email], .auth input[type=password] { height: 46px; margin-top: 6px; padding: 0 14px; border-radius: 10px; background: var(--bg); font-size: 16px; }
.auth input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(22, 119, 255, .18); }
.auth button { width: 100%; height: 46px; margin-top: 4px; border-radius: 10px; font-size: 1rem; }
/* WeChat QR next to the brand */
.brand-row { position: relative; display: flex; align-items: center; gap: 10px; }
.wx summary { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #07c160; cursor: pointer; list-style: none; }
.wx summary::-webkit-details-marker { display: none; }
.tg { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: #229ed9; }
.qr-pop { position: absolute; left: 0; top: 40px; z-index: 10; width: 212px; padding: 14px 14px 10px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, .12); text-align: center; }
.qr-pop img { display: block; width: 180px; height: 180px; margin: 0 auto; background: #fff; }
.qr-pop p { margin: 8px 0 0; font-size: .9rem; }
.qr-pop p.muted { margin-top: 2px; font-size: .78rem; line-height: 1.4; }
.stock { margin-left: 8px; color: var(--muted); font-size: .82rem; }
/* Intro dialog on homepage */
#intro-dialog { max-width: 28rem; width: calc(100% - 32px); padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--fg); box-shadow: 0 8px 28px rgba(0, 0, 0, .18); }
#intro-dialog::backdrop { background: rgba(0, 0, 0, .45); }
#intro-dialog h2 { margin: 0 0 10px; font-size: 1.1rem; }
#intro-dialog p { margin: 0 0 16px; }
#intro-dialog form { margin: 0; text-align: right; }
button:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
/* Buttons for standalone links */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 7px 18px; border: 1px solid var(--accent); border-radius: 6px; background: var(--accent); color: #fff; line-height: 1.6; text-decoration: none; white-space: nowrap; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: rgba(22, 119, 255, .08); }
.btn-light { background: var(--note); border-color: var(--line); color: var(--fg); }
.btn-sm, nav a.btn { padding: 3px 12px; font-size: .9rem; }
.btn-block { display: flex; width: 100%; height: 46px; margin-top: 12px; border-radius: 10px; }
.auth .forgot { margin: -6px 0 12px; text-align: right; font-size: .9rem; }
.auth .forgot a { text-decoration: none; }
.search { display: flex; gap: 8px; margin: 0 0 16px; }
.search input[type=text] { flex: 1; max-width: 320px; margin: 0; }
/* Hype-style theme (warm paper, terracotta accent, black pill buttons) */
:root { --bg: #f6f5f1; --fg: #191816; --muted: #6b675f; --line: #e5e1d8; --accent: #c8623f; --note: #efece6; --card: #fff; --price: #c8623f; }
@media (prefers-color-scheme: dark) {
  :root { --bg: #151413; --fg: #efece6; --muted: #a09b91; --line: #34312c; --accent: #e07a55; --note: #25231f; --card: #1e1d1b; --price: #e8895f; }
}
body { font-size: 15px; line-height: 1.6; }
header { border-bottom: 0; }
.brand .mark { background: var(--fg); color: var(--bg); border-radius: 8px; }
a { color: var(--accent); }
.hero h1 { font-size: 1.7rem; letter-spacing: -.01em; }
button, .btn { background: var(--fg); border-color: var(--fg); color: var(--bg); border-radius: 999px; font-weight: 600; }
button.link { background: none; color: var(--accent); }
.btn-outline { background: transparent; color: var(--fg); border-color: var(--fg); }
.btn-outline:hover { background: var(--note); }
.btn-light { background: var(--note); color: var(--fg); border-color: var(--line); }
.btn-block, .auth button, .auth input[type=email], .auth input[type=password] { border-radius: 12px; }
.auth input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(200, 98, 63, .2); }
.auth, #intro-dialog, .qr-pop { border-radius: 18px; box-shadow: 0 1px 2px rgba(25, 24, 22, .04), 0 8px 24px rgba(25, 24, 22, .06); }
.note { border-radius: 12px; }
.tabs a { border-radius: 999px; background: var(--card); }
.tabs a.on { background: var(--fg); border-color: var(--fg); color: var(--bg); }
.grid { gap: 0; background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: 0 1px 2px rgba(25, 24, 22, .04), 0 8px 24px rgba(25, 24, 22, .05); }
.card { align-items: center; gap: 16px; padding: 14px 18px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.card:last-child { border-bottom: 0; }
.card > a { width: 112px; }
.cover { border-radius: 12px; }
.card-body { padding: 0; }
.card .row { padding-top: 4px; }
.price { font-size: 1.2rem; }
@media (max-width: 520px) { .card { gap: 12px; padding: 12px; } .card > a { width: 88px; } }
/* Limited-time promo banners */
.promo { display: flex; overflow: hidden; margin: 0 0 12px; border-radius: 18px; color: #fff7f2;
  background: radial-gradient(130% 160% at 100% 0%, #7a2a1c 0%, #b4401f 35%, #d9582a 62%, #ef7a3a 100%);
  box-shadow: 0 1px 2px rgba(60, 20, 10, .14), 0 20px 44px -20px rgba(180, 64, 31, .6); }
.promo-art { display: flex; flex: none; align-items: center; justify-content: center; width: 148px; background: #1c1917; color: #fbbf24; font-size: 1.2rem; font-weight: 700; text-decoration: none; }
.promo-art img { display: block; width: 100%; object-fit: contain; }
.promo-body { display: flex; flex: 1; flex-direction: column; gap: 10px; min-width: 0; padding: 18px 22px; }
.promo-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.promo-tag { padding: 2px 12px; border-radius: 999px; background: #fdba5c; color: #5a2a05; font-size: .85rem; font-weight: 700; }
.promo-timer { display: flex; flex-direction: column; align-items: flex-end; padding: 3px 14px; border: 1px solid rgba(255, 255, 255, .35); border-radius: 18px; background: rgba(60, 15, 8, .35); font-weight: 700; font-size: .9rem; text-align: right; }
.promo-timer small { font-size: .68rem; font-weight: 400; opacity: .8; }
.promo-title { color: inherit; font-size: 1.25rem; font-weight: 700; text-decoration: none; }
.promo-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-top: auto; }
.promo-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.promo-price s { opacity: .7; }
.promo-price b { font-size: 1.9rem; line-height: 1.2; }
.promo-price em { padding: 0 8px; border-radius: 6px; background: #fdba5c; color: #5a2a05; font-size: .8rem; font-style: normal; font-weight: 700; }
.promo form { margin: 0; }
.promo-cta { display: inline-flex; align-items: center; padding: 9px 22px; border: 0; border-radius: 12px; background: #fbf3ea; color: #b4401f; font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap; }
.promo-cta.off { opacity: .7; }
.was { color: var(--muted); font-size: .85rem; }
@media (max-width: 520px) {
  .promo-art { width: 84px; }
  .promo-body { padding: 12px; }
  .promo-top { flex-direction: column; align-items: flex-start; gap: 6px; }
  .promo-timer { align-items: flex-start; text-align: left; }
  .promo-title { font-size: 1rem; }
  .promo-price b { font-size: 1.4rem; }
  .promo-cta { padding: 8px 14px; }
}
/* Inbox */
.code { font-size: 1.8rem; font-weight: 700; letter-spacing: .15em; margin: 0 0 4px; }
.mailbody { white-space: pre-wrap; word-break: break-word; max-height: 16rem; overflow: auto; background: var(--note); padding: 10px 12px; border-radius: 6px; }
.bind { display: flex; align-items: center; gap: 6px; margin: 0; }
.bind input[type=text] { width: 8rem; margin: 0; padding: 5px 8px; }
.mail { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 16px 20px; margin: 0 0 16px; }
.mail p { margin: 2px 0 10px; }
.code { font-size: 2rem; margin: 0 0 10px; }
.code span { user-select: all; }
.code button { font-size: .9rem; letter-spacing: 0; vertical-align: middle; }
.linkrow { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; }
.linkrow .url { flex: 1; min-width: 0; max-height: 5.5rem; overflow: auto; word-break: break-all; user-select: all; background: var(--note); padding: 8px 10px; border-radius: 8px; }
.linkrow .btn, .linkrow button { flex: none; }
.mail .mailbody { max-height: 24rem; margin-top: 10px; }
@media (max-width: 640px) { .linkrow { flex-wrap: wrap; } .linkrow .url { flex-basis: 100%; } }
.filter { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; }
.filter input[type=text] { flex: 1; margin: 0; }
#intro-dialog .notice { white-space: pre-wrap; word-break: break-word; max-height: 60vh; overflow: auto; }
.danger { margin-top: 28px; padding-top: 12px; border-top: 1px solid var(--line); }
.danger summary { cursor: pointer; color: #c0392b; }
button.danger-btn { background: #c0392b; border-color: #c0392b; color: #fff; }
.bind input[name=last4] { width: 5.5rem; }
/* Admin section links as large pill buttons */
.subnav { flex-wrap: wrap; gap: 8px; }
.subnav a { padding: 9px 20px; font-size: 1rem; font-weight: 600; text-decoration: none; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
.subnav a:hover { background: var(--note); }
/* Header nav links (后台/收件箱/我的订单/退出) as pill buttons like the admin section links */
nav a:not(.btn), nav button.link { padding: 7px 16px; font-size: .95rem; font-weight: 600; text-decoration: none; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 999px; }
nav a:not(.btn):hover, nav button.link:hover { background: var(--note); }
nav { gap: 8px; flex-wrap: wrap; }
tr[hidden] { display: none !important; }  /* the phone card layout sets rows to display:block */
.bind select { font: inherit; padding: 5px 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--card); color: var(--fg); }
/* Recent sales on the storefront */
.sales { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 12px 18px; margin: 0 0 16px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px 24px; }
.sales > div + div { border-left: 1px solid var(--line); padding-left: 24px; }
@media (max-width: 640px) { .sales { grid-template-columns: 1fr; } .sales > div + div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); padding-top: 10px; } }
.sales-total { margin: 0 0 6px; font-size: 1rem; }
.sales-total b { color: var(--price); font-size: 1.2rem; }
.sales ul { list-style: none; margin: 0; padding: 0; max-height: 7.5rem; overflow: auto; font-size: .9rem; }
.sales li { padding: 3px 0; border-top: 1px dashed var(--line); }
.sales li:first-child { border-top: 0; }

.clock { font-size: .72rem; line-height: 1.25; color: var(--muted, #6b7280); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Announcement dialog: accent top bar, numbered items, highlighted key phrases */
#intro-dialog { padding: 22px 22px 18px; border: 0; background: linear-gradient(var(--accent), var(--accent)) top / 100% 4px no-repeat, var(--card); animation: intro-in .25s ease-out; }
@keyframes intro-in { from { opacity: 0; transform: translateY(10px); } }
@media (prefers-reduced-motion: reduce) { #intro-dialog { animation: none; } }
#intro-dialog .intro-head { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; }
#intro-dialog .intro-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; font-size: 1.1rem; background: color-mix(in srgb, var(--accent) 14%, transparent); }
#intro-dialog h2 { margin: 0; font-size: 1.3rem; font-weight: 800; letter-spacing: .02em; }
#intro-dialog ol.notice { list-style: none; counter-reset: n; margin: 0 0 16px; padding: 0; white-space: normal; font-size: .95rem; line-height: 1.65; }
#intro-dialog ol.notice li { counter-increment: n; position: relative; margin: 0 0 11px; padding-left: 32px; }
#intro-dialog ol.notice li::before { content: counter(n); position: absolute; left: 0; top: .2em; display: grid; place-items: center; width: 21px; height: 21px; border-radius: 50%; background: var(--accent); color: #fff; font-size: .75rem; font-weight: 700; line-height: 1; }
#intro-dialog strong { font-weight: 700; color: var(--accent); background: linear-gradient(transparent 62%, color-mix(in srgb, var(--accent) 22%, transparent) 62%); }
#intro-dialog a { color: var(--accent); text-underline-offset: 2px; word-break: break-all; }
#intro-dialog form button { padding: 9px 28px; }

.clock-box { display: flex; flex-direction: column; align-items: flex-start; }
.lookup { font-size: .72rem; line-height: 1.25; color: var(--accent); text-decoration: none; white-space: nowrap; }
.lookup:hover { text-decoration: underline; }
/* Support chat */
.thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow: auto; margin: 0 0 14px; padding: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.msg { max-width: 80%; }
.msg.mine { align-self: flex-end; text-align: right; }
.bubble { display: inline-block; padding: 9px 13px; border-radius: 14px; background: var(--note); white-space: pre-wrap; word-break: break-word; text-align: left; }
.msg.mine .bubble { background: var(--accent); color: #fff; }
.msg.mine .bubble a { color: #fff; }
.msg .meta { font-size: .75rem; margin-top: 2px; }
.reply textarea { margin: 0 0 8px; }
/* Support button beside the clock */
.support-btn { display: inline-flex; align-items: center; padding: 8px 18px; font-size: 1rem; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; text-decoration: none; white-space: nowrap; box-shadow: 0 2px 6px rgba(0, 0, 0, .12); }
.support-btn:hover { filter: brightness(1.08); }
.reassign { margin-top: 4px; }
.reassign summary { cursor: pointer; font-size: .85rem; color: var(--accent); }
.reassign form { margin: 6px 0 0; }
