* { box-sizing: border-box; }
html { background: #111; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background: #f4f0ec;
  color: #181614;
}
button, input, select, textarea { font: inherit; }
button { border: 0; cursor: pointer; }
.app-shell {
  width: min(520px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
}
.view { display: none; }
.view.active { display: block; }
.top-card {
  background: #141414;
  color: #fff;
  border-radius: 20px;
  padding: 24px 22px;
  min-height: 172px;
}
.brand-line {
  color: #cfc7c0;
  font-size: 13px;
  font-weight: 800;
}
.top-card h1, .page-head h1, .profile-card h1 {
  margin: 8px 0;
  font-size: 30px;
  line-height: 1.15;
  letter-spacing: 0;
}
.top-card p, .page-head p, .profile-card p {
  margin: 0;
  color: #d8d0ca;
  line-height: 1.55;
}
.hero-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
}
.primary, .ghost, .notice-strip button, .action-card button, .text-btn {
  border-radius: 999px;
  padding: 11px 15px;
  font-weight: 800;
}
.primary { background: #141414; color: #fff; }
.ghost { background: #fff; color: #141414; }
.notice-strip, .card, .profile-card, .action-card, .form-card {
  background: #fff;
  border-radius: 18px;
  margin-top: 13px;
  padding: 18px;
}
.notice-strip, .action-card, .section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.notice-strip p, .action-card p {
  margin: 5px 0 0;
  color: #786d66;
  line-height: 1.45;
  font-size: 14px;
}
.notice-strip button, .action-card button, .text-btn {
  background: #f0e6df;
  color: #181614;
  white-space: nowrap;
}
.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 13px;
}
.quick-grid button {
  min-height: 116px;
  text-align: left;
  background: #fff;
  border-radius: 18px;
  padding: 14px;
}
.quick-grid b {
  display: block;
  margin-top: 12px;
  font-size: 17px;
}
.quick-grid em {
  display: block;
  margin-top: 4px;
  color: #7f746d;
  font-style: normal;
  font-size: 13px;
}
#installBtn {
  grid-column: 1 / -1;
  min-height: 76px;
}
.line-icon {
  position: relative;
  display: inline-block;
  width: 24px;
  height: 24px;
  color: currentColor;
}
.line-icon::before, .line-icon::after {
  content: "";
  position: absolute;
  border: 2px solid currentColor;
}
.icon-home::before { left: 4px; top: 9px; width: 16px; height: 12px; border-top: 0; }
.icon-home::after { left: 5px; top: 3px; width: 14px; height: 14px; transform: rotate(45deg); border-right: 0; border-bottom: 0; }
.icon-bag::before { left: 4px; top: 8px; width: 16px; height: 13px; border-radius: 3px; }
.icon-bag::after { left: 8px; top: 3px; width: 8px; height: 8px; border-bottom: 0; border-radius: 8px 8px 0 0; }
.icon-edit::before { left: 4px; top: 5px; width: 14px; height: 14px; border-radius: 3px; }
.icon-edit::after { left: 13px; top: 2px; width: 8px; height: 2px; transform: rotate(45deg); border-left: 0; border-right: 0; border-bottom: 0; }
.icon-user::before { left: 8px; top: 3px; width: 8px; height: 8px; border-radius: 50%; }
.icon-user::after { left: 4px; top: 14px; width: 16px; height: 7px; border-radius: 12px 12px 4px 4px; }
.icon-link::before { left: 3px; top: 9px; width: 10px; height: 7px; border-radius: 8px; transform: rotate(-28deg); }
.icon-link::after { right: 3px; top: 8px; width: 10px; height: 7px; border-radius: 8px; transform: rotate(-28deg); }
.section-title h2, .page-head h1 {
  margin: 0;
}
.section-title span {
  color: #8a7e77;
  font-size: 13px;
}
.batch-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.batch-pill {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 13px;
  border-radius: 14px;
  background: #f8f4f1;
}
.batch-pill span { color: #7f746d; }
.batch-pill.skeleton {
  color: #8a817b;
  background: #f4efeb;
}
.page-head {
  padding: 8px 4px 4px;
}
.page-head p {
  color: #786d66;
}
.search-box {
  margin-top: 14px;
}
.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 1px 2px;
  scrollbar-width: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.category-tab {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 9px 13px;
  background: #fff;
  color: #6e645d;
  font-weight: 800;
  white-space: nowrap;
}
.category-tab.active {
  background: #141414;
  color: #fff;
}
input, select, textarea {
  width: 100%;
  border: 0;
  border-radius: 14px;
  background: #f8f4f1;
  padding: 14px;
  color: #181614;
  outline: none;
}
textarea {
  min-height: 156px;
  line-height: 1.55;
  resize: vertical;
}
textarea.short { min-height: 82px; }
.form-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 13px;
}
label span, .address-title {
  display: block;
  margin-bottom: 7px;
  color: #3c3631;
  font-size: 14px;
  font-weight: 800;
}
.full, .address-title, .submit-btn { grid-column: 1 / -1; }
.address-title {
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid #eee5df;
  font-size: 18px;
}
.submit-btn {
  padding: 15px;
  border-radius: 16px;
}
.product-list, .series-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.series-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: #fff;
  border-radius: 18px;
  padding: 12px;
}
.series-cover {
  width: 118px;
  height: 118px;
  border-radius: 15px;
  object-fit: cover;
  background: #f0e6df;
}
.series-card h3 {
  margin: 0;
  font-size: 20px;
}
.series-card p {
  margin: 8px 0 0;
  color: #756a63;
  line-height: 1.45;
}
.series-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 2px;
}
.series-toolbar button {
  border-radius: 999px;
  padding: 8px 12px;
  background: #eee4dd;
  color: #181614;
  font-weight: 800;
}
.product-card {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  background: #fff;
  border-radius: 18px;
  padding: 12px;
}
.product-img {
  width: 104px;
  height: 104px;
  border-radius: 14px;
  object-fit: cover;
  background: #f0e6df;
}
.product-card h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
}
.product-card p {
  margin: 6px 0 0;
  color: #756a63;
  line-height: 1.4;
  font-size: 13px;
}
.profile-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.profile-card p { color: #756a63; }
.avatar-dot {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #141414;
  color: #fff;
  font-weight: 900;
}
.mini-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 13px;
}
.mini-stats div {
  background: #fff;
  border-radius: 16px;
  padding: 16px 8px;
  text-align: center;
}
.mini-stats b {
  display: block;
  font-size: 22px;
}
.mini-stats span {
  color: #7a7069;
  font-size: 13px;
}
.search-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 12px;
}
.small {
  border-radius: 14px;
  padding: 0 18px;
}
.orders-list { margin-top: 14px; }
.empty {
  color: #81766f;
  text-align: center;
  padding: 24px 10px;
  line-height: 1.6;
}
.order-card {
  background: #fff;
  border-top: 1px solid #eee5df;
  padding: 16px 0;
}
.order-top, .pay-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.order-batch {
  font-size: 20px;
  font-weight: 900;
}
.status {
  background: #141414;
  color: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  white-space: nowrap;
}
.status.pay { background: #8b4d3c; }
.status.active { background: #0b5f6b; }
.status.done { background: #0b7f43; }
.meta {
  margin-top: 6px;
  color: #70665f;
  font-size: 14px;
}
.progress-card, .goods {
  margin-top: 12px;
  padding: 13px;
  border-radius: 14px;
  background: #f8f4f1;
}
.progress-card div, .goods b { font-weight: 900; }
.progress-card p, .goods p {
  margin: 6px 0 0;
  color: #70665f;
  line-height: 1.5;
}
.goods b {
  display: block;
  word-break: break-all;
}
.pay-box {
  margin-top: 12px;
  background: #fff3eb;
  border-radius: 16px;
  padding: 15px;
}
.amount {
  color: #8b4d3c;
  font-size: 34px;
  font-weight: 900;
}
.copy-btn, .save-qr-btn, .bill-btn {
  background: #141414;
  color: #fff;
  border-radius: 999px;
  padding: 10px 13px;
  font-weight: 800;
}
.qr-box {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 12px;
  align-items: center;
}
.qr {
  width: 150px;
  height: 150px;
  border-radius: 12px;
  object-fit: cover;
  background: #fff;
}
.save-qr-btn { align-self: end; width: 100%; background: #0b7f43; }
.bill-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 12px;
}
.bill-btn {
  background: #fff;
  color: #8b4d3c;
  border-radius: 14px;
}
.no-qr {
  margin-top: 10px;
  color: #7b7068;
  font-size: 14px;
  line-height: 1.5;
}
.invoice-line {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-top: 9px;
  color: #4b433e;
}
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 8;
  width: min(520px, 100%);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid #ded6d0;
}
.nav-item {
  display: grid;
  justify-items: center;
  gap: 3px;
  background: transparent;
  color: #8a817b;
  padding: 6px 2px;
}
.nav-item .line-icon { width: 23px; height: 23px; }
.nav-item b { font-size: 12px; }
.nav-item.active { color: #141414; }
.modal, .copy-modal {
  position: fixed;
  inset: 0;
  z-index: 20;
  background: rgba(0,0,0,.45);
  padding: 18px;
  display: grid;
  place-items: end center;
}
.modal-card, .copy-card {
  width: min(520px, 100%);
  max-height: 82vh;
  overflow: auto;
  background: #fff;
  border-radius: 22px;
  padding: 20px;
}
.modal-close {
  float: right;
  background: #eee4dd;
  border-radius: 999px;
  padding: 9px 13px;
}
.formula {
  clear: both;
  margin-top: 18px;
  background: #141414;
  color: #fff;
  border-radius: 14px;
  padding: 14px;
  font-weight: 800;
  line-height: 1.5;
}
.rule-grid {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.rule-grid div {
  background: #f8f4f1;
  border-radius: 14px;
  padding: 14px;
}
.rule-grid p, .copy-card p {
  margin: 6px 0 0;
  color: #70665f;
  line-height: 1.55;
}
.copy-card pre {
  white-space: pre-wrap;
  word-break: break-word;
  background: #f8f4f1;
  border-radius: 14px;
  padding: 14px;
  line-height: 1.55;
  user-select: text;
  -webkit-user-select: text;
}
.copy-card button {
  width: 100%;
  margin-top: 10px;
  background: #141414;
  color: #fff;
  border-radius: 14px;
  padding: 13px;
  font-weight: 800;
}
.qr-save-card img {
  display: block;
  width: min(720px, 100%);
  height: auto;
  margin: 16px auto;
  border-radius: 16px;
  background: #f8f4f1;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(82px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  background: rgba(0,0,0,.84);
  color: #fff;
  border-radius: 999px;
  padding: 10px 16px;
  z-index: 30;
  max-width: calc(100% - 32px);
  text-align: center;
}
.hidden { display: none !important; }
@media (max-width: 560px) {
  .app-shell { padding-left: 10px; padding-right: 10px; }
  .top-card h1, .page-head h1, .profile-card h1 { font-size: 28px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid button:nth-child(3):not(.hidden) { grid-column: 1 / -1; min-height: 88px; }
  .form-card { grid-template-columns: 1fr; }
  .full, .address-title, .submit-btn { grid-column: auto; }
  .qr-box { grid-template-columns: 1fr; }
  .qr { width: 190px; height: 190px; }
  .pay-row { align-items: flex-start; flex-direction: column; }
  .copy-btn { width: 100%; }
}
