:root {
  color-scheme: light;
  --bg: #f3f4f4;
  --ink: #171717;
  --muted: #6d6d6d;
  --line: #e4e4e4;
  --paper: #ffffff;
  --price: #9d2c2c;
  --ok: #1b6b45;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}
h1 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.3; }
h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; }
a { color: var(--ink); }
p { line-height: 1.6; }
.top, .bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 72px;
  padding: 0 32px;
  background: var(--paper);
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.eyebrow { margin: 0 0 4px; color: var(--muted); font-size: 13px; letter-spacing: 0; }
nav { display: flex; gap: 22px; flex-wrap: wrap; align-items: center; }
nav a { color: var(--ink); text-decoration: none; font-size: 14px; }
.brand { color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 600; }
.mark { display: none; }
body > main, .narrow {
  width: min(920px, calc(100% - 48px));
  margin: 40px auto 80px;
}
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.panel { background: transparent; border: 0; padding: 0; margin-top: 36px; }
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px 18px;
}
.card p, .panel p { color: var(--muted); }
.price { color: var(--price); font-weight: 600; font-variant-numeric: tabular-nums; }
form { display: grid; gap: 12px; }
label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
input, select, textarea {
  border: 1px solid #d8d8d8;
  border-radius: 8px;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: var(--paper);
}
button {
  justify-self: start;
  width: auto;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: white;
  padding: 9px 18px;
  font: inherit;
  cursor: pointer;
}
button:disabled { background: #bdbdbd; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.secret {
  font-family: Consolas, "Microsoft YaHei UI", monospace;
  background: #f6f6f6;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  overflow-wrap: anywhere;
}
.muted, .message { color: var(--muted); }
.notice { margin: 0 0 28px; color: var(--muted); font-size: 14px; }
.search-row { display: flex; gap: 8px; }
.search-row input { flex: 1; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.tab { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.tab.active { background: var(--ink); color: white; }
.badge {
  display: inline-block;
  margin: 0 0 8px;
  padding: 2px 8px;
  border-radius: 8px;
  background: #f3f3f3;
  color: var(--muted);
  font-size: 12px;
}
.card .offers p { margin: 0 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.card .offers p:last-child { border-bottom: 0; margin-bottom: 0; padding-bottom: 0; }

body.shop { overflow-x: clip; }
.bar .search { margin-left: auto; }
.bar .search input { width: min(280px, 36vw); background: var(--paper); }
.shell {
  width: min(1080px, calc(100% - 48px));
  margin: 0 auto;
  padding: 36px 0 88px;
}
.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 18px;
}
.toolbar p, .meta, .item p { color: var(--muted); margin: 0; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-bottom: 8px; }
.filters button {
  background: transparent;
  color: var(--muted);
  padding: 6px 0;
  border-radius: 0;
  border-bottom: 1px solid transparent;
}
.filters button.active { color: var(--ink); border-bottom-color: var(--ink); font-weight: 600; }
.goods { margin-top: 12px; }
.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}
.item h2 { margin: 0 0 4px; font-size: 17px; font-weight: 600; overflow-wrap: anywhere; }
.meta { font-size: 13px; }
.item-buy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
  min-width: 0;
}
.item-buy .price { margin-right: auto; font-size: 18px; }
.item-buy button { min-width: 84px; }
.lookup {
  display: grid;
  gap: 12px;
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.lookup-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 10px; align-items: end; }
.lookup-row label { min-width: 0; }
.empty { padding: 36px 0; color: var(--muted); }
dialog {
  width: min(440px, calc(100% - 32px));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
  color: var(--ink);
}
dialog::backdrop { background: rgba(23, 23, 23, .28); }
.dialog-head, .actions, .secret-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.dialog-head h2 { margin: 0; font-size: 18px; }
.dialog-head button, .secret-row button, #copy-all, .stepper button {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid #d8d8d8;
}
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper input { width: 72px; text-align: center; }
.stepper button { width: 36px; padding: 8px 0; }
.due { margin: 4px 0; font-size: 15px; }
.due strong { font-size: 20px; }
.receipt { width: min(640px, calc(100% - 48px)); margin: 48px auto 88px; }
.status { margin: 0 0 10px; font-size: 13px; font-weight: 600; }
.status-delivered { color: var(--ok); }
.status-failed, .warn { color: var(--price); }
.receipt .price { font-size: 26px; margin: 12px 0 0; }
.meta-list { display: grid; gap: 10px; margin: 28px 0; }
.meta-list div { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; overflow-wrap: anywhere; }
.actions { margin: 8px 0 16px; justify-content: flex-start; flex-wrap: wrap; }
.secrets { display: grid; gap: 8px; }
.secret-row code { flex: 1; min-width: 0; }
.admin-main { width: min(840px, calc(100% - 48px)); margin: 40px auto 88px; }
.admin-main > h2 { margin-top: 40px; padding-top: 28px; border-top: 1px solid var(--line); }
.admin-main > h2:first-of-type { margin-top: 0; padding-top: 0; border-top: 0; }
.page-label { margin: 0 0 28px; font-size: 22px; font-weight: 600; }
@media (min-width: 860px) {
  .item { grid-template-columns: minmax(0, 1fr) 220px; padding: 26px 0; }
  .item-buy { display: grid; justify-items: end; align-content: center; }
  .item-buy .price { margin-right: 0; }
}
@media (max-width: 720px) {
  .top, .bar { flex-wrap: wrap; min-height: 64px; padding: 14px 16px; }
  .bar .search, .bar .search input, .shell { width: min(1080px, calc(100% - 32px)); }
  .lookup-row, .meta-list div { grid-template-columns: 1fr; }
  .item-buy .price { margin-right: auto; }
}

.category-nav { display: flex; flex-wrap: wrap; gap: 10px 20px; margin: 0 0 10px; }
.category-nav a { color: var(--ink); text-decoration: none; font-size: 15px; }
.category-list { display: grid; grid-template-columns: 1fr; }
.category-link {
  display: grid;
  gap: 4px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  min-width: 0;
}
.category-link strong { font-size: 17px; font-weight: 600; }
.category-link span { color: var(--muted); font-size: 13px; }
.category-edit {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.back-link { margin: 0 0 14px; }
.back-link a { color: var(--muted); text-decoration: none; font-size: 13px; }
@media (min-width: 860px) {
  .category-list { grid-template-columns: 1fr 1fr; column-gap: 48px; }
  .category-edit { grid-template-columns: minmax(120px, 1.2fr) minmax(140px, 1.6fr) 88px 96px auto auto; align-items: end; }
}


.store .bar { padding: 0; }
.bar-inner {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  min-height: 64px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.store .bar nav { margin-left: auto; gap: 4px; }
.store .bar nav a,
.store .bar nav .nav-btn {
  background: transparent;
  color: var(--ink);
  border: 0;
  border-radius: 8px;
  padding: 8px 10px;
  text-decoration: none;
  font-size: 14px;
}
.store .bar nav a:hover,
.store .bar nav .nav-btn:hover { background: #f2f2f2; }
.store .bar nav a.active { background: #171717; color: #fff; }
.kicker { margin: 0 0 4px; color: var(--muted); font-size: 12px; }
.shop-layout {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 28px 0 88px;
}
.side { padding-right: 24px; min-width: 0; }
.side h2 { font-size: 16px; margin-bottom: 8px; }
.catalog {
  min-width: 0;
  padding-left: 28px;
  border-left: 1px solid var(--line);
}
.catalog h1, .item-page h1, .tool h1, .reading h1 { font-size: 22px; font-weight: 600; }
.catalog-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 16px;
  margin-bottom: 16px;
}
form.search-combo { display: flex; align-items: center; gap: 8px; }
form.search-combo input { width: 220px; }
form.search-combo button { flex: 0 0 auto; }
.tree a, .tree .empty { min-width: 0; }
.tree a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0 10px 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.tree a.child { padding-left: 22px; }
.tree a em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.tree a.active { font-weight: 600; box-shadow: inset 2px 0 0 #171717; }
.mobile-cats { display: none; }
.rail { display: flex; gap: 8px; overflow-x: auto; }
.rail a {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 12px;
  background: #fff;
  color: var(--ink);
  text-decoration: none;
  font-size: 14px;
}
.rail a.active { background: #171717; color: #fff; border-color: #171717; }
.catalog-table { width: 100%; border-collapse: collapse; }
.catalog-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  padding: 0 8px 10px;
  border-bottom: 1px solid var(--line);
}
.catalog-table td {
  padding: 16px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.catalog-table .meta { margin-top: 4px; }
.col-price { width: 120px; }
.col-stock { width: 88px; }
.col-action { width: 156px; }
.price-cell, .stock-cell { white-space: nowrap; font-variant-numeric: tabular-nums; }
.is-out { color: var(--price); }
.action-cell { text-align: right; white-space: nowrap; }
.text-link { color: var(--muted); text-decoration: none; font-size: 14px; margin-right: 10px; }
.product-name { color: var(--ink); font-weight: 600; text-decoration: none; overflow-wrap: anywhere; }
.product-name:hover, .text-link:hover { text-decoration: underline; }
.catalog-table td.empty { color: var(--muted); padding: 42px 8px; }
.item-page, .tool, .reading {
  width: min(760px, calc(100% - 40px));
  margin: 0 auto;
  padding: 32px 0 88px;
}
.item-page { width: min(1180px, calc(100% - 48px)); }
.item-head {
  display: grid;
  gap: 16px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.item-page .item-buy { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.item-page .price { font-size: 28px; }
.detail, #help-body, .notice-body, #buy-notice-text { white-space: pre-wrap; line-height: 1.75; }
.detail, #help-body { margin-top: 22px; color: var(--ink); }
.lookup-form { max-width: 460px; }
.otp-panel { margin-top: 8px; }
.otp-digits { display: flex; gap: 8px; min-height: 52px; }
.otp-digits span {
  width: 42px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  font-size: 28px;
  font-variant-numeric: tabular-nums;
}
.buy-notice { padding: 8px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.buy-notice p { margin: 0 0 8px; color: var(--ink); }
.check { display: flex; grid-template-columns: auto 1fr; align-items: center; gap: 8px; color: var(--ink); }
.check input { width: 16px; height: 16px; padding: 0; }
.service-link {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 20;
  background: #171717;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  min-width: 72px;
  text-align: center;
  padding: 12px 16px;
}
.listing-edit textarea, #site-form textarea { min-height: 96px; }
@media (min-width: 860px) {
  .item-head { grid-template-columns: minmax(0, 1fr) 220px; align-items: start; }
  .item-page .item-buy { display: grid; justify-items: end; }
  .category-edit { grid-template-columns: minmax(120px, 1fr) minmax(140px, 1.2fr) 120px 72px 88px auto auto; }
}
@media (max-width: 800px) {
  .bar-inner { width: min(1180px, calc(100% - 32px)); flex-wrap: wrap; padding: 10px 0; }
  .store .bar nav { width: 100%; margin-left: 0; }
  .shop-layout { grid-template-columns: 1fr; width: min(1180px, calc(100% - 32px)); padding-top: 18px; }
  .side { display: none; }
  .catalog { border-left: 0; padding-left: 0; }
  .mobile-cats { display: grid; gap: 8px; margin-bottom: 14px; }
  .catalog-head { flex-direction: column; align-items: stretch; }
  form.search-combo { width: 100%; }
  form.search-combo input { flex: 1; width: auto; min-width: 0; }
  .catalog-table thead { display: none; }
  .catalog-table, .catalog-table tbody, .catalog-table tr, .catalog-table td { display: block; width: auto; }
  .catalog-table tr { padding: 14px 0; border-bottom: 1px solid var(--line); }
  .catalog-table td { border: 0; padding: 0; }
  .price-cell, .stock-cell { display: inline-block; width: auto; margin: 8px 16px 0 0; }
  .action-cell { margin-top: 10px; text-align: left; }
  .item-page { width: min(1180px, calc(100% - 32px)); }
}

#notice-dialog { width: min(560px, calc(100% - 32px)); max-height: min(72vh, 640px); overflow: auto; }
.mobile-cats[hidden] { display: none !important; }
@media (max-width: 900px) {
  .bar-inner { flex-wrap: wrap; padding: 10px 0; }
  .store .bar nav { width: 100%; margin-left: 0; justify-content: flex-start; }
}

body.store { background: #fff; }
dialog {
  width: min(440px, calc(100vw - 32px));
  max-width: calc(100vw - 32px);
}
#notice-dialog { width: min(520px, calc(100vw - 32px)); }
.dialog-head { align-items: center; }
.dialog-head h2 { min-width: 0; overflow-wrap: anywhere; }
.dialog-head button {
  flex: 0 0 auto;
  padding: 6px 10px;
  background: transparent;
  border: 0;
  color: var(--muted);
}
.catalog-table th:nth-child(2),
.catalog-table th:nth-child(3),
.price-cell,
.stock-cell { text-align: right; }
.item-page .item-buy button { justify-self: end; }
.only-mobile { display: none; }
form.search-combo { flex-wrap: nowrap; }
@media (max-width: 800px) {
  .only-mobile { display: inline; }
  .price-cell, .stock-cell { text-align: left; }
  form.search-combo button { padding: 9px 12px; }
}

body.store { min-height: 100vh; background: #fff; }
html:has(body.store) { background: #fff; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: #111111;
  text-decoration: none;
}
.logo {
  width: 36px;
  height: 36px;
  display: block;
  flex: 0 0 36px;
}
.brand-copy { display: grid; gap: 2px; min-width: 0; }
.brand-name, .brand > span[data-site-name] {
  font-family: "Palatino Linotype", "Songti SC", "STSong", "SimSun", serif;
  font-size: 18px;
  font-weight: 600;
  line-height: 1.1;
  color: #111111;
}
.brand-sign {
  font-size: 10px;
  line-height: 1;
  color: #6d6d6d;
}
.store .bar { border-bottom: 1px solid #111111; background: #fff; }
.store .bar nav a,
.store .bar nav .nav-btn {
  border-radius: 0;
  background: transparent;
  color: #3a3a3a;
}
.store .bar nav a:hover,
.store .bar nav .nav-btn:hover { background: transparent; color: #111111; }
.store .bar nav a.active {
  background: transparent;
  color: #111111;
  box-shadow: inset 0 -1px 0 #111111;
}
.shop-layout { padding-top: 36px; }
.side h2, .catalog h1, .item-page h1, .tool h1, .reading h1 {
  font-family: "Palatino Linotype", "Songti SC", "STSong", "SimSun", serif;
  font-weight: 600;
}
.catalog-table th { letter-spacing: 0; }
.catalog-table td { padding: 18px 8px; }
.product-name { font-size: 15px; }
form.search-combo button {
  background: #fff;
  color: #111;
  border: 1px solid #111;
}
.action-cell button, .item-page .item-buy button {
  min-width: 72px;
  padding: 7px 14px;
}
.tree a.active { box-shadow: inset 2px 0 0 #111111; }
.site-foot {
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding: 22px 0 40px;
  border-top: 1px solid #e6e6e6;
  display: flex;
  align-items: center;
  gap: 8px;
  color: #6d6d6d;
  font-size: 13px;
}
.site-foot img { width: 18px; height: 18px; display: block; }
.service-link { border-radius: 0; }
@media (max-width: 800px) {
  .logo { width: 32px; height: 32px; flex-basis: 32px; }
  .brand-name, .brand > span[data-site-name] { font-size: 16px; }
  .site-foot { width: min(1180px, calc(100% - 32px)); }
}

.store button, .store .service-link { border-radius: 0; }
.store .rail a { border-radius: 8px; }

.catalog-sub {
  margin: 6px 0 0;
  color: #6d6d6d;
  font-family: "Segoe UI", "Microsoft YaHei UI", "PingFang SC", sans-serif;
  font-size: 13px;
  font-weight: 400;
}
.catalog-head { margin-bottom: 20px; align-items: end; }
.catalog-table tbody tr:hover td { background: #fafafa; }
.action-cell button {
  min-height: 32px;
  padding: 6px 14px;
}
.catalog-table .meta { font-size: 12px; }
.product-name { font-size: 16px; }
@media (max-width: 800px) {
  .catalog-table tbody tr:hover td { background: transparent; }
}

.catalog-title-block { min-width: 0; }
.catalog-head { align-items: end; }
.action-cell { display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.action-cell .text-link { margin-right: 0; }
@media (max-width: 800px) {
  .catalog-head { align-items: stretch; }
  .action-cell { display: flex; justify-content: flex-start; }
}

.catalog-table td.action-cell {
  display: table-cell;
  text-align: right;
  vertical-align: middle;
  white-space: nowrap;
}
.action-cell .text-link { margin-right: 12px; vertical-align: middle; }
.action-cell button { vertical-align: middle; }
@media (max-width: 800px) {
  .catalog-table td.action-cell { display: flex; text-align: left; }
}
