:root {
  color-scheme: light;
  font-family: system-ui, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: #172c2c;
  background: #f1f5f1;
  --ink: #172c2c;
  --muted: #485b55;
  --accent: #17604c;
  --line: #cfddd3;
  --paper: #fff;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.55; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1 { font-size: clamp(1.75rem, 4vw, 2.55rem); line-height: 1.2; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1rem; }
a { color: var(--accent); }
button, .button, input, select { font: inherit; }
button, .button {
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); background: white; color: var(--accent);
  padding: .5rem .78rem; border-radius: .55rem; cursor: pointer; text-decoration: none;
}
button:hover:not(:disabled), .button:hover { background: #e9f4ed; }
button:disabled { cursor: not-allowed; background: #edf0ed; color: #5d6861; }
.primary { background: var(--accent); color: white; border-color: var(--accent); font-weight: 700; }
.primary:hover:not(:disabled) { background: #114936; }
.quiet { background: transparent; }
:focus-visible { outline: 3px solid #c17525; outline-offset: 3px; }
input, select {
  min-width: 0; border: 1px solid #aebfb5; border-radius: .55rem;
  padding: .68rem .8rem; background: white; color: var(--ink);
}
.wrap { width: min(1320px, 100% - 3rem); margin-inline: auto; }
.top { background: #133b32; color: #fff; }
.bar, .account, .brand, .results-head, .actions, .pager {
  display: flex; align-items: center; gap: .65rem;
}
.bar { min-height: 70px; justify-content: space-between; padding-block: .6rem; }
.brand { font-weight: 760; color: inherit; text-decoration: none; }
.mark {
  display: grid; place-items: center; width: 2.35rem; height: 2.35rem;
  border-radius: .65rem; color: #143b32; background: #b9e4cc; font-size: 1.2rem;
}
.account { flex-wrap: wrap; justify-content: end; font-size: .88rem; }
.account button { color: white; border-color: #81a89a; }
.account button:hover:not(:disabled) { background: #215646; }
.quota { color: #d9eee4; font-variant-numeric: tabular-nums; }
.searchbox {
  margin-top: 1.6rem; padding: clamp(1rem, 3vw, 2.4rem);
  background: linear-gradient(125deg, #e6f3e9, #f9fbf4 78%);
  border: 1px solid var(--line); border-radius: 1.1rem;
}
.tabs { display: flex; gap: .35rem; margin: 1.1rem 0 .9rem; }
.tabs button { background: transparent; border-color: transparent; }
.tabs button[aria-selected="true"] { border-color: #abcbbb; background: #d5ebde; font-weight: 700; }
.searchrow { display: flex; gap: .55rem; max-width: 770px; }
.searchrow input { flex: 1; width: 1px; }
.searchrow button { flex-shrink: 0; }
.dropzone {
  display: flex; align-items: center; flex-wrap: wrap; gap: 1rem;
  margin-bottom: .75rem; padding: .9rem;
  border: 1px dashed #80a994; border-radius: .7rem; max-width: 770px;
}
.dropzone.dragging { background: #d5ebde; border-color: var(--accent); }
.dropzone img { width: 90px; height: 82px; object-fit: contain; background: white; border-radius: .45rem; }
.dropzone p, .muted, .footer { color: var(--muted); font-size: .88rem; }
.dropzone input { width: min(100%, 18rem); font-size: .85rem; padding: .4rem; }
.file-label { display: block; font-weight: 700; margin-bottom: .35rem; }
#image-help { margin-top: .5rem; }
.results { margin-top: 1.5rem; }
.results-head { justify-content: space-between; margin-bottom: .75rem; }
#total { color: var(--muted); }
.status { background: #fff; border: 1px solid var(--line); border-radius: .75rem; padding: 1.2rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 275px), 1fr)); gap: 1rem; }
.card { background: white; border: 1px solid var(--line); border-radius: .8rem; overflow: hidden; display: flex; flex-direction: column; }
.product-image { display: grid; place-items: center; background: #e9efe9; color: var(--muted); overflow: hidden; position: relative; }
.product-image img { width: 100%; height: 100%; object-fit: contain; position: absolute; }
.card > .product-image { aspect-ratio: 4 / 3; }
.card-body { padding: 1rem; display: flex; flex-direction: column; flex: 1; gap: .35rem; }
.card h3 { min-height: 3em; }
.price { font-size: 1.55rem; font-weight: 800; color: #965019; }
.metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 105px), 1fr)); gap: .55rem; margin-block: .55rem; }
.metrics div { background: #f2f6f1; padding: .38rem .55rem; border-radius: .38rem; overflow-wrap: anywhere; }
.metrics dt { font-size: .75rem; color: var(--muted); }
.metrics dd { font-size: .9rem; font-weight: 640; }
.tags { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .35rem; }
.tag { background: #e5f3e9; color: #184c3b; font-size: .72rem; padding: .14rem .45rem; border-radius: 1rem; }
.actions { flex-wrap: wrap; margin-top: auto; font-size: .84rem; }
.pager { margin-top: 1rem; justify-content: center; flex-wrap: wrap; }
.pager input { width: 4.5rem; padding: .25rem .45rem; }
.footer { padding-block: 1.5rem; }
dialog {
  position: fixed; inset: 0 0 0 auto; margin: 0; padding: 0;
  width: min(780px, 100%); max-width: 100%; height: 100%; max-height: 100%;
  background: #f6f8f4; color: var(--ink); border: 0; box-shadow: -10px 0 36px #0c28244a;
}
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #102b2590; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1.2rem; background: #fff; border-bottom: 1px solid var(--line); }
.drawer-body { overflow: auto; padding: 1.2rem; flex: 1; }
.drawer-body > * + * { margin-top: .9rem; }
.gallery { display: grid; gap: .5rem; }
.gallery-main .product-image { height: min(36vh, 300px); border-radius: .65rem; }
.thumbs { display: flex; gap: .4rem; overflow: auto; }
.thumbs button { padding: .2rem; }
.thumbs button[aria-pressed="true"] { border: 2px solid var(--accent); }
.thumbs .product-image { width: 3rem; height: 3rem; }
.detail-section { background: white; border: 1px solid var(--line); border-radius: .7rem; padding: .85rem; }
.detail-section > * + * { margin-top: .55rem; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; font-size: .85rem; }
th, td { text-align: left; border-bottom: 1px solid var(--line); padding: .4rem .55rem; }
th { background: #edf4ee; white-space: nowrap; }
td:nth-child(2) { min-width: 8rem; }
td .product-image { width: 48px; height: 48px; }
.upcoming { padding-bottom: 1rem; }
.toast { position: fixed; z-index: 2; bottom: 1.3rem; left: 50%; transform: translateX(-50%); background: #133b32; color: white; padding: .7rem .95rem; border-radius: .6rem; width: max-content; max-width: calc(100% - 2rem); }
.login-page { min-height: 100vh; background: radial-gradient(ellipse at 15% 15%, #c8e8d6, #edf5ea 58%, #f1f5f1); }
.login-layout { width: min(440px, 100% - 2rem); margin-inline: auto; padding-top: clamp(2rem, 14vh, 8rem); }
.login-card { border-radius: 1rem; padding: clamp(1.2rem, 5vw, 2.1rem); background: #fff; border: 1px solid var(--line); box-shadow: 0 1rem 3rem #24534318; }
.login-card h1 { margin-block: 1.45rem 1rem; font-size: 1.85rem; }
.login-card form { display: grid; gap: .55rem; }
.login-card label { font-size: .9rem; font-weight: 650; }
.login-card button { margin-top: .5rem; }
#login-status { color: #8b4718; }
@media (max-width: 600px) {
  .wrap { width: calc(100% - 1.2rem); }
  .bar { align-items: flex-start; flex-direction: column; gap: .4rem; }
  .account { justify-content: start; }
  .searchbox { margin-top: .7rem; }
  .drawer-body { padding: .65rem; }
}
