:root {
  color-scheme: light;
  --ink: #1d2228;
  --quiet: #58636b;
  --line: #dce0e2;
  --paper: #fff;
  --ground: #f2f3f4;
  --green: #21624a;
  font-family: Inter, "Microsoft YaHei", "PingFang SC", sans-serif;
  color: var(--ink);
  background: var(--ground);
}
* { box-sizing: border-box; }
body { margin: 0 auto; max-width: 1504px; padding: 20px clamp(14px, 3.4vw, 52px) 32px; }
a { color: inherit; text-decoration: none; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid #397cac; outline-offset: 3px; }
.topbar, .panel { background: var(--paper); border: 1px solid var(--line); box-shadow: 0 3px 12px #18202908; }
.topbar { min-height: 64px; display: flex; align-items: center; gap: 15px; padding: 9px 15px 9px 19px; border-radius: 40px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 700 25px/1 Georgia, serif; letter-spacing: -.8px; }
.brand b { display: grid; place-items: center; height: 36px; width: 36px; background: #20282b; color: white; border-radius: 50%; font: italic 700 23px/1 Georgia, serif; }
.divider { width: 1px; height: 21px; background: var(--line); }
.store-name { font-size: 14px; font-weight: 650; }
nav { display: flex; align-items: center; margin-left: auto; gap: 20px; font-size: 13px; font-weight: 600; }
nav a:hover { text-decoration: underline; }
nav button, #search button, .primary { border: 0; background: var(--ink); color: white; border-radius: 22px; padding: 10px 18px; font-size: 13px; font-weight: 650; }
nav button:hover, #search button:hover, .primary:hover { background: #3b454a; }
main { display: grid; grid-template-columns: minmax(223px, .86fr) minmax(0, 2.25fr); align-items: start; gap: 22px; margin-top: 24px; }
.panel { border-radius: 22px; padding: clamp(18px, 2.15vw, 30px); }
.eyebrow { font: 650 10px/1.3 "IBM Plex Mono", Consolas, monospace; text-transform: uppercase; letter-spacing: .17em; color: var(--quiet); margin: 0 0 8px; }
h1, h2 { margin: 0; line-height: 1.25; letter-spacing: -.04em; }
h1 { font-size: clamp(23px, 2.3vw, 34px); overflow-wrap: anywhere; }
h2 { font-size: 23px; }
.sidebar h2 { padding-bottom: 19px; border-bottom: 1px solid var(--line); }
#categories { display: flex; flex-direction: column; gap: 3px; margin: 13px -4px -4px; }
.category { display: flex; align-items: center; gap: 9px; width: 100%; padding: 10px 12px; background: transparent; border: 0; border-radius: 13px; text-align: left; font-size: 14px; line-height: 1.45; }
.category:hover { background: #f4f5f5; }
.category[aria-pressed="true"] { background: #e8eeeb; color: #1f503c; font-weight: 700; }
.category .n { margin-left: auto; padding: 1px 6px; min-width: 24px; border-radius: 12px; text-align: center; color: var(--quiet); background: #f0f2f2; font: 12px/1.6 Consolas, monospace; }
.category[aria-pressed="true"] .n { color: var(--green); background: white; }
.category.child { padding-left: 26px; font-size: 13px; }
.catalog-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; justify-content: space-between; }
.catalog-head > div { flex: 1 1 175px; }
#search { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 25px; padding: 3px; background: #fafbfb; }
#query { border: 0; background: transparent; min-width: 0; width: clamp(112px, 11vw, 180px); padding: 6px 8px 6px 12px; font-size: 13px; }
.summary, footer { display: flex; justify-content: space-between; align-items: center; gap: 12px; color: var(--quiet); font-size: 12px; }
.summary { margin: 24px 1px 10px; }
#refresh { border: 0; background: transparent; color: var(--quiet); padding: 4px; font-size: 12px; }
#refresh:hover { text-decoration: underline; }
.table-wrap { border: 1px solid var(--line); border-radius: 13px; overflow: hidden; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 12px; }
th { font-size: 12px; font-weight: 600; color: var(--quiet); background: #f5f6f6; }
td { border-top: 1px solid var(--line); font-size: 14px; }
td:first-child { width: 56%; }
td:not(:first-child) { white-space: nowrap; }
.product { display: flex; align-items: center; gap: 12px; text-align: left; background: transparent; padding: 0; border: 0; }
.cover { position: relative; flex: 0 0 auto; height: 45px; width: 45px; border-radius: 10px; overflow: hidden; background: #e9eeec; color: #315b49; font: 650 18px/45px Georgia, serif; text-align: center; }
.cover img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.name { font-size: 14px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
.product:hover .name { text-decoration: underline; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.tag { display: inline-block; background: #eff2f3; color: #4b5961; border-radius: 5px; padding: 1px 5px; font-size: 11px; line-height: 1.6; }
.tag.delivery { color: #34604a; background: #edf3ed; }
.money { font-variant-numeric: tabular-nums; font-weight: 700; }
.stock { font-size: 12px; color: var(--quiet); }
.more { border: 1px solid var(--line); border-radius: 20px; background: white; font-weight: 650; font-size: 12px; padding: 8px 11px; }
.more:hover { border-color: var(--ink); }
.empty { padding: 22px 4px 10px; color: var(--quiet); text-align: center; font-size: 14px; }
footer { margin: 20px 4px 0; }
dialog { width: min(420px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 22px; padding: 24px; color: var(--ink); box-shadow: 0 18px 90px #18202930; }
dialog::backdrop { background: #101a225e; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dialog-head .eyebrow { margin: 0; }
.close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: #f0f2f2; line-height: 1; font-size: 21px; }
dialog h2 { font-size: 22px; line-height: 1.45; overflow-wrap: anywhere; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 18px 0; border-block: 1px solid var(--line); font-size: 14px; }
dt { color: var(--quiet); } dd { text-align: right; margin: 0; font-weight: 600; }
.dialog-note { font-size: 13px; color: var(--quiet); line-height: 1.7; }
.primary { display: inline-block; width: 100%; text-align: center; padding: 12px 16px; }
.primary:disabled { background: #e6e9e9; color: #546169; }
.sr-only { position: absolute; overflow: hidden; clip-path: inset(50%); width: 1px; height: 1px; }
@media (max-width: 850px) {
  body { padding: 12px; }
  main { gap: 14px; grid-template-columns: minmax(186px,.8fr) minmax(0,2fr); }
  .panel { padding: 18px; }
  th,td { padding: 10px 8px; }
  .cover { height: 35px; width: 35px; line-height: 35px; }
}
@media (max-width: 680px) {
  .topbar { gap: 7px; min-height: 54px; padding: 6px 9px; }
  .brand { font-size: 21px; gap: 6px; } .brand b { width: 29px; height: 29px; font-size: 18px; }
  .store-name,nav { font-size: 12px; } nav { gap: 9px; } nav button { font-size: 12px; padding: 9px 10px; }
  main { grid-template-columns: minmax(0,1fr); margin-top: 14px; }
  .panel { padding: 16px; border-radius: 18px; }
  .sidebar h2 { border: 0; padding: 0; font-size: 18px; }
  #categories { flex-direction: row; overflow-x: auto; overscroll-behavior-inline: contain; padding: 3px 4px 5px; margin-top: 8px; }
  .category,.category.child { width: auto; flex: none; font-size: 12px; padding: 7px 10px; gap: 5px; background: #f4f5f5; }
  .category span:first-child { max-width: 11em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .catalog-head { gap: 12px; }
  #search { width: 100%; } #query { flex: 1; }
  .summary { margin-top: 13px; }
  .table-wrap { border: 0; border-radius: 0; } thead { display: none; }
  tbody,tr { display: block; }
  tbody tr { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); padding: 14px 0; }
  td,td:first-child { border: 0; padding: 0; width: auto; }
  td:first-child { grid-column: 1/-1; }
  .cover { width: 39px; height: 39px; line-height: 39px; }
  footer { align-items: flex-start; flex-wrap: wrap; }
}
@media (max-width: 360px) { .brand b, .divider { display: none; } }
