:root {
  --wine: #4a1822;
  --wine2: #6e2a3b;
  --gold: #aa8a51;
  --ink: #2a2728;
  --muted: #827a77;
  --cream: #faf7f2;
  --line: #e9e2d9;
  --green: #32735e;
  --red: #b34545;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font:
    14px/1.6 Arial,
    "Microsoft YaHei",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
a {
  transition: 0.18s;
}
button {
  cursor: pointer;
  border: 1px solid var(--line);
  background: white;
  padding: 9px 15px;
  border-radius: 7px;
  color: var(--ink);
}
button:hover {
  border-color: var(--gold);
  background: #faf5ed;
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
button.primary {
  background: var(--wine);
  color: white;
  border-color: var(--wine);
}
button.danger {
  color: var(--red);
}
a {
  color: var(--wine);
  text-decoration: none;
}
input,
select,
textarea {
  padding: 10px 12px;
  border: 1px solid #ded6cb;
  border-radius: 6px;
  background: white;
  color: var(--ink);
  max-width: 100%;
}
input:focus,
select:focus,
textarea:focus {
  outline: 2px solid #cdb79288;
  border-color: var(--gold);
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
}
label input,
label select,
label textarea {
  display: block;
  width: 100%;
  margin-top: 5px;
  color: var(--ink);
}
label.check {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
label.check input {
  width: auto;
  margin: 0;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
h1 {
  font:
    38px/1.3 Georgia,
    "Microsoft YaHei",
    serif;
  letter-spacing: -0.8px;
}
h2 {
  font-size: 22px;
}
h3 {
  font-size: 16px;
}
.eyebrow {
  color: var(--gold);
  letter-spacing: 3px;
  font-size: 11px;
  text-transform: uppercase;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.pill {
  display: inline-block;
  border-radius: 20px;
  background: #edf4ee;
  color: var(--green);
  padding: 3px 9px;
  font-size: 11px;
  white-space: nowrap;
}
.pill.warn {
  background: #fff0dd;
  color: #9a6728;
}
.pill.red {
  background: #fbe8e5;
  color: var(--red);
}
.demo {
  padding: 6px 20px;
  background: #eee2cc;
  color: #755728;
  text-align: center;
  font-size: 12px;
}
.topbar {
  background: #fffdf9;
  border-bottom: 1px solid var(--line);
  padding: 20px 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.logo {
  font:
    27px Georgia,
    serif;
  letter-spacing: 4px;
  color: var(--wine);
}
.logo small {
  display: block;
  font: 9px Arial;
  letter-spacing: 2px;
  color: var(--gold);
  margin-top: 3px;
}
.toplinks {
  display: flex;
  gap: 25px;
  align-items: center;
  font-size: 12px;
}
.public-wrap {
  max-width: 1450px;
  margin: auto;
  padding: 44px 5vw;
}
.hero {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: center;
  margin-bottom: 36px;
}
.hero h1 {
  margin: 10px 0 16px;
}
.hero p {
  color: var(--muted);
  max-width: 650px;
}
.hero-card {
  background: var(--wine);
  color: white;
  padding: 26px 28px;
  border-radius: 10px;
  position: relative;
  overflow: hidden;
}
.hero-card:after {
  content: "B";
  position: absolute;
  font: 170px Georgia;
  color: #ffffff09;
  right: -5px;
  bottom: -70px;
}
.hero-card strong {
  font: 36px Georgia;
  display: block;
}
.hero-card .muted {
  color: #d1b8b6;
}
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 18px 0;
}
.toolbar input.search {
  flex: 1;
  min-width: 220px;
}
.table-wrap {
  overflow: auto;
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
}
table {
  border-collapse: collapse;
  width: 100%;
  font-size: 13px;
}
th {
  text-align: left;
  background: #f3eee6;
  color: #827565;
  font-size: 11px;
  letter-spacing: 0.3px;
  font-weight: 600;
  padding: 13px 15px;
  white-space: nowrap;
}
td {
  padding: 16px 15px;
  border-bottom: 1px solid #f0ebe4;
  vertical-align: middle;
}
tr:last-child td {
  border-bottom: 0;
}
tbody tr:hover {
  background: #fffcf7;
}
.product-name {
  min-width: 215px;
  max-width: 350px;
  font-weight: 600;
}
.ean {
  font: 11px/1.8 monospace;
  color: var(--muted);
  margin-top: 4px;
}
.price {
  font-weight: 700;
  color: var(--wine);
  white-space: nowrap;
  font-size: 16px;
}
.right {
  text-align: right;
}
.nowrap {
  white-space: nowrap;
}
.table-action {
  font-size: 12px;
  padding: 6px 9px;
}
.footer {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 24px;
  font-size: 12px;
  color: var(--muted);
}

.public-footer {
  align-items: flex-start;
  gap: 34px;
  font-size: 14px;
  line-height: 1.65;
  color: #6f6560;
}
.public-footer > div {
  min-width: 0;
}
.footer-company {
  flex: 1.15;
}
.footer-company b,
.footer-company strong {
  display: block;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.5;
}
.footer-company p,
.footer-site-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.footer-contact {
  flex: 0.75;
}
.footer-contact span,
.footer-site-card span {
  display: block;
  margin-bottom: 4px;
  color: #8c817b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .2px;
}
.footer-contact b {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
}
.footer-wechat {
  margin-top: 14px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.footer-wechat img {
  display: block;
  width: 168px;
  height: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
}
.footer-wechat-copy {
  min-width: 125px;
}
.footer-wechat-copy strong {
  display: block;
  color: var(--wine);
  font-size: 15px;
  line-height: 1.45;
}
.footer-wechat-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.footer-sites {
  flex: 1.45;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.footer-site-card {
  padding-left: 16px;
  border-left: 2px solid #d8c7b5;
}
.footer-site-card a {
  display: inline-block;
  color: var(--wine);
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}
.footer-site-card a:hover {
  text-decoration: underline;
}

.footnote {
  font-size: 11px;
  margin-top: 20px;
  color: var(--muted);
}
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.sidebar {
  background: var(--wine);
  color: #dfc9c7;
  padding: 30px 18px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
.sidebar .logo {
  color: #fff;
  padding: 0 13px;
}
.sidebar nav {
  display: grid;
  gap: 7px;
}
.nav {
  border: 0;
  text-align: left;
  background: transparent;
  color: #d3bdbc;
  padding: 12px 15px;
}
.nav:hover,
.nav.active {
  background: #ffffff14;
  border-color: transparent;
  color: white;
}
.sidebar-bottom {
  margin-top: auto;
  padding: 14px;
  font-size: 12px;
}
.sidebar-bottom a {
  color: #e3c99f;
}
.admin-main {
  padding: 30px 36px;
  min-width: 0;
}
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 25px;
}
.page-head h1 {
  font:
    27px Georgia,
    "Microsoft YaHei",
    serif;
  margin: 4px 0 6px;
}
.page-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 22px;
}
.metric {
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px 22px;
}
.metric b {
  display: block;
  font: 29px Georgia;
  margin-top: 8px;
}
.metric span {
  color: var(--muted);
  font-size: 12px;
}
.card {
  background: white;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 25px;
  margin-bottom: 20px;
}
.notice {
  background: #f5ecde;
  border-left: 3px solid var(--gold);
  padding: 12px 16px;
  font-size: 12px;
  margin: 15px 0;
  color: #775f3f;
}
.grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}
.empty {
  text-align: center;
  padding: 60px;
  color: var(--muted);
}
.login-wrap {
  max-width: 430px;
  margin: 70px auto;
  padding: 36px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 12px;
}
.login-wrap label {
  margin-top: 18px;
}
.login-wrap button {
  width: 100%;
  margin-top: 24px;
}
dialog {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  width: 740px;
  max-width: 96vw;
  max-height: 92vh;
  color: var(--ink);
  box-shadow: 0 25px 100px #24131844;
}
dialog::backdrop {
  background: #22101466;
  backdrop-filter: blur(3px);
}
.modal-head {
  padding: 22px 28px;
  background: var(--cream);
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-head h2 {
  margin: 0;
  font-size: 21px;
}
.modal-body {
  padding: 26px 28px;
}
.modal-body label {
  margin-bottom: 15px;
}
.modal-wide {
  width: 1100px;
}
.mini-program-code-loading,
.mini-program-code-empty {
  padding: 34px 18px;
  text-align: center;
  color: var(--muted);
}
.mini-program-code-empty b {
  display: block;
  margin-bottom: 8px;
  color: var(--ink);
  font-size: 16px;
}
.mini-program-code-empty p {
  margin: 0;
}
.mini-program-code-panel {
  max-width: 430px;
  margin: 0 auto;
  text-align: center;
}
.mini-program-code-product {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .4px;
}
.mini-program-code-image {
  width: min(320px, 82vw);
  margin: 0 auto 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}
.mini-program-code-image img {
  display: block;
  width: 100%;
  height: auto;
}
.mini-program-code-title {
  color: var(--ink);
  font-size: 17px;
  font-weight: 700;
}
.mini-program-code-note {
  max-width: 390px;
  margin: 8px auto 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}
.line-input {
  width: 90px;
}
.line-name {
  min-width: 200px;
  width: 100%;
}
.toast {
  position: fixed;
  bottom: 26px;
  left: 50%;
  transform: translateX(-50%);
  padding: 12px 22px;
  color: white;
  background: var(--wine);
  border-radius: 8px;
  z-index: 100;
  max-width: 90vw;
  box-shadow: 0 5px 20px #0002;
}
.error {
  color: var(--red);
  font-size: 13px;
}
.stock-gap {
  color: var(--red);
  font-weight: bold;
}
.loading {
  padding: 60px;
  text-align: center;
  color: var(--muted);
}
.total {
  font-size: 24px;
  font-family: Georgia;
  color: var(--wine);
  text-align: right;
  margin: 20px 0;
}
.audit-detail {
  max-width: 700px;
  max-height: 200px;
  overflow: auto;
  white-space: pre-wrap;
  font: 11px monospace;
}
.mobile-only {
  display: none;
}
@media (max-width: 1000px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-card {
    display: none;
  }
  .admin-shell {
    grid-template-columns: 170px 1fr;
  }
  .admin-main {
    padding: 24px 16px;
  }
  .sidebar {
    padding: 24px 8px;
  }
  .sidebar .logo {
    font-size: 20px;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .grid3 {
    grid-template-columns: 1fr;
  }
  .toplinks {
    gap: 12px;
  }
  .public-wrap {
    padding: 30px 18px;
  }
}
@media (max-width: 650px) {
  .admin-shell {
    display: block;
  }
  .sidebar {
    padding: 14px;
  }
  .sidebar nav {
    display: flex;
    overflow: auto;
    gap: 4px;
  }
  .nav {
    white-space: nowrap;
    font-size: 12px;
    padding: 8px;
  }
  .sidebar-bottom {
    display: none;
  }
  .sidebar .logo {
    display: none;
  }
  .page-head {
    align-items: flex-start;
  }
  .page-head h1 {
    font-size: 22px;
  }
  .grid2 {
    grid-template-columns: 1fr;
  }
  .modal-body {
    padding: 18px;
  }
  .metrics {
    gap: 8px;
  }
  .metric {
    padding: 12px;
  }
  .footer {
    display: block;
  }
  .public-footer > div {
    margin-bottom: 18px;
  }
  .footer-wechat {
    align-items: flex-start;
  }
  .footer-wechat img {
    width: min(190px, 48vw);
  }
  .footer-sites {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
  }
  h1 {
    font-size: 30px;
  }
  .toplinks .hide-mobile {
    display: none;
  }
}

.pricing-panel {
  padding: 20px 24px;
}
.pricing-panel h3 {
  margin-bottom: 6px;
}
.pricing-controls {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.pricing-controls > label {
  min-width: 140px;
}
.pricing-controls button {
  margin-bottom: 0;
}
.rate-inputs {
  display: flex;
  gap: 16px;
  align-items: flex-end;
  flex: 1;
}
.rate-inputs label {
  flex: 1;
  min-width: 170px;
}
.base-price {
  background: #faf1e2;
}
.quote-input {
  width: 110px;
  padding: 7px;
  text-align: right;
  font-weight: 600;
  color: var(--wine);
}
.save-quote {
  display: block;
  margin: 6px 0 0 auto;
  font-size: 11px;
}
.currency-cell {
  min-width: 95px;
}
.mobile-currency {
  display: none;
}
.staff-products .price {
  font-size: 14px;
}
.staff-products th,
.staff-products td {
  padding-left: 10px;
  padding-right: 10px;
}
.staff-products .product-name {
  min-width: 200px;
}
.staff-products .brand-cell {
  min-width: 105px;
}
@media (max-width: 650px) {
  .pricing-controls,
  .rate-inputs {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }
}
.price-actions {
  display: flex;
  justify-content: flex-end;
  gap: 3px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.price-actions button {
  font-size: 10px;
  padding: 4px 6px;
  margin: 0;
}
.manual-tag {
  display: block;
  font-size: 10px;
  font-weight: 400;
  color: #9a6728;
}
.restore-quote {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 10px;
}
.staff-products .currency-cell {
  min-width: 124px;
}

#arrivalPricing {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  margin-top: 14px;
}
.arrival-price-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 16px;
}
#arrivalPricing:disabled {
  opacity: 0.65;
}
.arrival-price-grid .check {
  margin-top: 8px;
}
@media (max-width: 650px) {
  .arrival-price-grid {
    grid-template-columns: 1fr;
  }
}

