:root {
  color-scheme: light;
  --ink: #172e30;
  --muted: #526864;
  --line: #d9e4de;
  --paper: #f1f5f1;
  --white: #fff;
  --accent: #076d5e;
  --mint: #bdf3d4;
  --dark: #183533;
  --gold: #f4cc7c;
  --error: #9e342c;
  font: 16px/1.55 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--paper); color: var(--ink); }
body:has(dialog[open]) { overflow: hidden; }
h1, h2, h3, p, dl, dd { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .38; }
:focus-visible { outline: 3px solid #299e84; outline-offset: 3px; }

.header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-inner, main {
  width: min(1144px, calc(100% - 64px));
  margin-inline: auto;
}
.header-inner {
  min-height: 73px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
}
.brand, .header-actions, .wallet {
  display: flex;
  align-items: center;
  gap: 12px;
}
.brand { font-weight: 700; font-size: 1.0625rem; white-space: nowrap; }
.brand-mark {
  width: 37px;
  height: 37px;
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 3px;
  padding-bottom: 9px;
  border-radius: 10px;
  background: var(--dark);
}
.brand-mark i { width: 4px; height: 8px; border-radius: 2px; background: var(--mint); }
.brand-mark i:nth-child(2) { height: 13px; }
.brand-mark i:nth-child(3) { height: 19px; }
.header-actions { gap: 18px; }
.wallet { gap: 8px; font-size: .875rem; color: var(--muted); white-space: nowrap; }
.wallet strong { color: var(--ink); }
.text-button { padding: 7px 1px; border: 0; background: none; color: var(--accent); font-weight: 650; }
.text-button:hover { text-decoration: underline; text-underline-offset: 4px; }
.header .text-button { color: var(--ink); font-size: .9rem; }
.header a.text-button { text-decoration: none; }
.header a.text-button:hover { text-decoration: underline; }
.header a.management-entry {
  flex-shrink: 0;
  margin-inline-start: auto;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  white-space: nowrap;
}
.header a.management-entry:hover { border-color: #8abfac; background: #f2faf5; text-decoration: none; }
.button {
  min-height: 44px;
  padding: 10px 19px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: var(--accent);
  color: var(--white);
  font-weight: 650;
}
.button:hover { background: #045b4f; }
.button-small { min-height: 40px; padding: 7px 14px; font-size: .875rem; white-space: nowrap; }

main { padding: 48px 0 55px; }
.page-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 25px;
}
h1 { font-size: clamp(2.05rem, 4.4vw, 3.4rem); line-height: 1.08; letter-spacing: -.055em; }
.demo-mark { font-size: .875rem; color: var(--muted); white-space: nowrap; }
.demo-mark::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #248773;
}
.user-pill, .admin-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 6px;
  background: #e1efe7;
  color: #375c50;
  font-size: .8125rem;
  white-space: nowrap;
}
.admin-tag { padding: 3px 7px; }
.auth-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .9fr);
  align-items: center;
  gap: clamp(28px, 8vw, 116px);
  width: min(910px, calc(100% - 48px));
  margin-top: clamp(20px, 9vh, 100px);
}
.auth-side h1 {
  max-width: 8em;
  margin: 13px 0 16px;
  font-size: clamp(2.7rem, 6.3vw, 5.3rem);
  line-height: 1.03;
}
.auth-side p { color: var(--muted); font-size: 1.04rem; }
.auth-card { padding: 30px; }
.auth-card h2 { font-size: 1.48rem; }
.auth-submit { width: 100%; margin-top: 18px; }
.auth-foot {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 9px;
  margin-top: 8px;
  font-size: .85rem;
}
.field-input {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 7px;
  padding: 8px 10px;
  border: 1px solid #cbdad2;
  border-radius: 7px;
  background: #f9fbf9;
}
.field-input::placeholder { color: #657a72; }
.tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 20px;
}
.tab {
  position: relative;
  min-height: 85px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 17px;
  border: 0;
  border-radius: 0;
  border-inline-end: 1px solid var(--line);
  background: transparent;
  text-align: start;
}
.tab:first-child { border-radius: 11px 0 0 11px; }
.tab:last-child { border-radius: 0 11px 11px 0; border-inline-end: 0; }
.tab:hover { background: #f4faf6; }
.tab[aria-selected="true"] { background: #e0f2e8; }
.tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  inset: auto 12px 0;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
}
.tab:focus-visible { z-index: 1; }
.tab-icon {
  flex: 0 0 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #edf3ed;
  color: var(--accent);
}
.tab[aria-selected="true"] .tab-icon { color: var(--white); background: var(--accent); }
.icon-live {
  width: 18px;
  height: 17px;
  background: currentColor;
  clip-path: polygon(0 68%, 22% 68%, 22% 100%, 0 100%, 0 68%, 39% 68%, 39% 36%, 61% 36%, 61% 100%, 39% 100%, 39% 68%, 78% 68%, 78% 0, 100% 0, 100% 100%, 78% 100%, 78% 68%);
}
.icon-play {
  width: 13px;
  height: 17px;
  margin-left: 2px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.icon-like { font-size: 1.3rem; line-height: 1; }
.icon-save {
  width: 13px;
  height: 17px;
  background: currentColor;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 73%, 0 100%);
}
.tab strong, .tab small { display: block; }
.tab strong { font-size: .96rem; }
.tab small { color: var(--muted); font-size: .8125rem; margin-top: 3px; }
.money, .number { font-variant-numeric: tabular-nums; }

.workspace { display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(310px, 1fr); align-items: start; gap: 20px; }
.entry, .receipt { min-width: 0; border-radius: 13px; }
.entry { padding: 26px 28px 23px; background: var(--white); border: 1px solid var(--line); }
h2 { font-size: 1.23rem; letter-spacing: -.025em; }
.entry h2 { margin-bottom: 21px; }
.field + .field { margin-top: 20px; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
label, .label { display: block; font-size: .9375rem; font-weight: 650; }
.field-heading .text-button { margin: -4px 0; font-size: .85rem; }
textarea, .stepper {
  background: #f9fbf9;
  border: 1px solid #cbdad2;
  border-radius: 8px;
}
textarea {
  display: block;
  width: 100%;
  min-height: 66px;
  margin-top: 8px;
  padding: 12px 13px;
  line-height: 1.5;
  resize: vertical;
}
textarea::placeholder { color: #657a72; }
.stepper {
  display: inline-grid;
  grid-template-columns: 42px minmax(76px, 125px) 42px;
  margin-top: 8px;
  min-height: 45px;
  max-width: 100%;
}
.stepper button { border: 0; background: transparent; font-size: 1.22rem; }
.stepper button:hover:not(:disabled) { background: #e8f3ec; }
.stepper input {
  width: 100%;
  min-width: 0;
  padding: 0 5px;
  text-align: center;
  border: 0;
  border-inline: 1px solid var(--line);
  background: var(--white);
}
.hint { margin-top: 6px; font-size: .825rem; color: var(--muted); }
.error { margin-top: 5px; font-size: .875rem; font-weight: 650; color: var(--error); }
textarea[aria-invalid="true"], .stepper:has(input[aria-invalid="true"]) { border-color: var(--error); }
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.preset {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--white);
  font-size: .875rem;
}
.preset:hover, .preset[aria-pressed="true"] { border-color: #8abfac; background: #e8f6ed; color: #065b4e; }

.receipt { background: var(--dark); color: var(--white); padding: 25px; }
.receipt h2 { margin-bottom: 18px; }
.receipt-label { color: #c1d8cf; font-size: .9rem; }
.total {
  margin: 4px 0 19px;
  color: #e5ffe9;
  font-size: clamp(2rem, 4.1vw, 3.2rem);
  font-weight: 650;
  line-height: 1.08;
  letter-spacing: -.045em;
  overflow-wrap: anywhere;
}
.summary-list { padding: 13px 0; border-block: 1px solid #51716a; }
.summary-list div, .review-list div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.summary-list div + div, .review-list div + div { margin-top: 7px; }
.summary-list dt { color: #c1d8cf; }
.summary-list dd, .review-list dd { text-align: end; min-width: 0; overflow-wrap: anywhere; }
.summary-list, .review-list { font-size: .92rem; }
.split { padding-top: 16px; }
.split h3 { font-size: .875rem; margin-bottom: 8px; font-weight: 650; }
.share-bar { display: grid; grid-template-columns: 1fr 4fr; gap: 4px; }
.share-bar span {
  border-radius: 4px;
  padding: 3px 4px;
  color: var(--dark);
  background: var(--gold);
  text-align: center;
  font-size: .8125rem;
  font-weight: 700;
}
.share-bar span + span { background: var(--mint); }
.split-counts { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; color: #d1e5dd; font-size: .8125rem; }
.split-counts strong { color: var(--white); white-space: nowrap; }
.receipt .button { width: 100%; margin-top: 20px; background: var(--mint); color: var(--dark); }
.receipt .button:hover { background: #d0ffe5; }
.receipt .button:focus-visible { outline-color: var(--mint); }

details { margin-top: 22px; padding-top: 13px; border-top: 1px solid var(--line); font-size: .875rem; }
summary { width: fit-content; cursor: pointer; color: var(--accent); font-weight: 650; }
.goods { display: grid; gap: 11px; margin-top: 13px; }
.goods-item { padding-left: 10px; border-left: 2px solid #a8ccbc; }
.goods-item h3 { font-size: .9rem; }
.goods-item p { margin-top: 2px; color: var(--muted); overflow-wrap: anywhere; }
.admin-grid { grid-template-columns: minmax(285px, .72fr) minmax(0, 1fr); }
.admin-goods { margin-top: 16px; }
.admin-goods .goods { grid-template-columns: repeat(auto-fit, minmax(225px, 1fr)); }
.search-form { display: flex; gap: 8px; margin-bottom: 10px; }
.search-form input { margin: 0; min-width: 0; }
.customers { list-style: none; display: grid; gap: 8px; margin: 0; padding: 0; }
.customer {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  text-align: start;
  font-size: .875rem;
}
.customer:hover, .customer[aria-pressed="true"] { background: #e8f6ed; border-color: #8abfac; }
.customer-current {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #e8f6ed;
}
.customer-current span, .customer-current strong { display: block; }
.customer-current .hint { margin-top: 0; }
.customer-current strong { margin-top: 3px; overflow-wrap: anywhere; }
.adjust-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; margin-bottom: 14px; }
.adjust-fields .field { margin-top: 0; }
.adjust-submit { margin-top: 13px; }
.adjust-status { margin: 11px 0 0; }
.adjust-history { border-top: 1px solid var(--line); padding-top: 15px; margin-top: 18px; }
.adjust-history h3 { margin-bottom: 7px; font-size: 1rem; }
.adjust-history .order-row { flex-wrap: wrap; }
.notification-panel { margin-top: 16px; scroll-margin-top: 16px; }
.notification-heading, .wecom-binding, .notice-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}
.notification-heading { margin-bottom: 10px; }
.notification-heading h2 { margin-bottom: 0; }
.wecom-binding {
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5faf6;
}
.wecom-binding .hint { margin-top: 1px; }
.wecom-qr { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-top: 12px; }
.wecom-qr img { max-width: 100%; height: auto; }
.wecom-qr p { color: var(--muted); font-size: .875rem; }
.notice-empty, .notice-list { margin-top: 14px; }
.notice-pill { display: inline-block; padding: 2px 8px; border-radius: 6px; background: #f0f4ed; font-size: .82rem; }
.notice-pill[data-state="sent"] { color: #0c634f; background: #dff3e7; }
.notice-pill[data-state="review"] { color: #8b4a17; background: #fbefdc; }

dialog {
  width: min(485px, calc(100% - 30px));
  max-height: calc(100dvh - 32px);
  padding: 23px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 18px 70px #081c1850;
}
dialog::backdrop { background: #102b28a8; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.dialog-close { width: 38px; height: 38px; border-radius: 7px; border: 0; background: #f1f5f2; font-size: 1.22rem; }
.dialog-close:hover { background: #e6eee9; }
dialog .button { width: 100%; margin-top: 17px; }
.review-list { padding: 14px 0; border-block: 1px solid var(--line); }
.review-list dt { color: var(--muted); flex: 0 0 auto; }
.dialog-total { color: var(--accent); font-weight: 700; }
.dialog-note { margin-top: 12px; color: var(--muted); font-size: .875rem; }
.top-up-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-top: 8px; }
.top-up-options .preset { min-height: 43px; padding-inline: 5px; font-weight: 650; }
.wechat-preview {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 13px;
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5faf6;
}
.qr-sample {
  position: relative;
  display: grid;
  place-items: center;
  flex: 0 0 66px;
  height: 66px;
  border: 1px dashed #8eb0a0;
  border-radius: 6px;
  color: var(--accent);
  background: var(--white);
  font-size: .72rem;
  font-weight: 650;
}
.qr-sample i {
  position: absolute;
  width: 10px;
  height: 10px;
  border: 2px solid var(--accent);
  border-radius: 1px;
}
.qr-sample i:nth-child(1) { inset: 7px auto auto 7px; }
.qr-sample i:nth-child(2) { inset: 7px 7px auto auto; }
.qr-sample i:nth-child(3) { inset: auto auto 7px 7px; }
.qr-sample i:nth-child(4) { inset: auto 7px 7px auto; }
.wechat-preview p { font-size: .825rem; color: var(--muted); margin-top: 3px; }
.order-list { list-style: none; margin: 0; padding: 0; }
.order-list li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.order-list li:first-child { border-top: 1px solid var(--line); }
.order-row { display: flex; justify-content: space-between; gap: 10px; font-weight: 650; }
.order-row span:last-child { overflow-wrap: anywhere; text-align: end; }
.order-list p { margin-top: 4px; color: var(--muted); font-size: .825rem; overflow-wrap: anywhere; }
.status { margin-bottom: 12px; padding: 9px 11px; background: #e7f7ed; border-radius: 6px; color: #065b4e; font-size: .9rem; }

@media (max-width: 880px) {
  .header-inner, main { width: calc(100% - 40px); }
  .workspace { grid-template-columns: minmax(0, 1fr) minmax(265px, .75fr); gap: 13px; }
  .tab { padding-inline: 10px; gap: 8px; }
  .tab-icon { flex-basis: 29px; height: 29px; }
  .entry, .receipt { padding: 19px; }
  .split-counts { flex-wrap: wrap; }
}

@media (max-width: 690px) {
  .header-inner, main { width: calc(100% - 28px); }
  .header-inner { min-height: 0; flex-wrap: wrap; gap: 9px; padding-block: 11px; }
  .header-actions { width: 100%; justify-content: space-between; gap: 5px; }
  .brand-mark { transform: scale(.9); transform-origin: left center; }
  main { padding-top: 27px; }
  .page-heading { margin-bottom: 17px; align-items: center; }
  .demo-mark { font-size: .8rem; }
  .tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 13px; }
  .tab { min-height: 70px; padding: 10px; border-radius: 0; }
  .tab:first-child { border-radius: 11px 0 0 0; }
  .tab:nth-child(2) { border-radius: 0 11px 0 0; border-inline-end: 0; }
  .tab:nth-child(3) { border-radius: 0 0 0 11px; }
  .tab:last-child { border-radius: 0 0 11px 0; }
  .tab:nth-child(n+3) { border-top: 1px solid var(--line); }
  .workspace { grid-template-columns: minmax(0, 1fr); }
  .auth-shell { grid-template-columns: minmax(0, 1fr); gap: 20px; margin-top: 12px; }
  .auth-side h1 { max-width: none; font-size: clamp(2.3rem, 12vw, 3.4rem); }
  .auth-side br { display: none; }
  .auth-card { padding: 20px; }
  .receipt { padding: 20px; }
  .split-counts { flex-wrap: nowrap; }
}

@media (max-width: 360px) {
  .page-heading { flex-wrap: wrap; }
  .tab-icon { display: none; }
  .wallet { gap: 4px; }
}
