/* =========================================================================
   外卖点单平台 —— 统一设计系统
   三端共用：顾客 H5 / 商家后台 / 平台后台
   规则：颜色、字号、圆角、间距、阴影全部走变量，组件不得写死数值。
   ========================================================================= */

:root {
  /* 品牌 */
  --brand: #f4622b;
  --brand-hover: #e4551f;
  --brand-soft: #fff1ea;
  --brand-ring: rgba(244, 98, 43, 0.16);

  /* 中性色 */
  --ink: #15181d;
  --text: #22262d;
  --text-2: #4a515c;
  --muted: #7c8492;
  --faint: #a4abb6;
  --line: #e8eaee;
  --line-soft: #f1f3f6;
  --bg: #f6f7f9;
  --card: #ffffff;

  /* 语义色 */
  --green: #12915a;
  --green-soft: #e7f6ee;
  --red: #d93843;
  --red-soft: #fdecec;
  --blue: #2c6bed;
  --blue-soft: #ecf2ff;
  --amber: #a86a12;
  --amber-soft: #fdf4e5;

  /* 深色侧栏 */
  --shell: #101419;
  --shell-text: #9aa3ae;

  /* 圆角 */
  --r-xs: 6px;
  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* 间距 */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;

  /* 阴影 */
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.05);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, 0.07);
  --shadow-lg: 0 18px 48px rgba(16, 24, 40, 0.16);

  /* 字号 */
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-base: 14px;
  --fs-md: 14px;
  --fs-lg: 15px;
  --fs-xl: 17px;
  --fs-2xl: 20px;
  --fs-3xl: 26px;

  --font: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
}

/* ---------------------------------------------------------------- reset */
* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  font-size: var(--fs-base);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  color: var(--ink);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
}

h1 {
  font-size: var(--fs-2xl);
}
h2 {
  font-size: var(--fs-xl);
}
h3 {
  font-size: var(--fs-lg);
}

p {
  margin: 0 0 8px;
}

p:last-child {
  margin-bottom: 0;
}

button,
input,
textarea,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  padding: 0;
}

a {
  color: var(--brand);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

.hidden {
  display: none !important;
}

::selection {
  background: var(--brand-soft);
  color: var(--brand-hover);
}

/* ---------------------------------------------------------------- icons */
.ico {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: inherit;
  line-height: 0;
}

.ico svg {
  display: block;
  width: 1em;
  height: 1em;
  stroke-width: 1.7;
}

/* ---------------------------------------------------------------- layout */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 12px 14px 96px;
}

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}

.col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.spacer {
  flex: 1;
}

.grow {
  flex: 1;
  min-width: 0;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-3);
}

@media (max-width: 560px) {
  .grid-3 {
    grid-template-columns: 1fr 1fr;
  }
}

.divider {
  height: 1px;
  background: var(--line);
  margin: var(--sp-3) 0;
}

.ellipsis {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.muted {
  color: var(--muted);
}
.small {
  font-size: var(--fs-sm);
}
.tiny {
  font-size: var(--fs-xs);
}
.strong {
  font-weight: 600;
  color: var(--ink);
}
.num {
  font-variant-numeric: tabular-nums;
}

.price {
  color: var(--brand);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.strike {
  text-decoration: line-through;
  color: var(--faint);
  font-weight: 400;
}

/* ---------------------------------------------------------------- topbar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  min-height: 52px;
  padding: 0 16px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

@media (min-width: 760px) {
  .topbar {
    padding-left: calc(50% - 360px + 14px);
    padding-right: calc(50% - 360px + 14px);
  }
}

.topbar h1 {
  font-size: var(--fs-xl);
  font-weight: 600;
}

.topbar .sub {
  color: var(--muted);
  font-size: var(--fs-sm);
}

.topbar .icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  font-size: 18px;
  background: transparent;
}

.topbar .icon-btn:hover {
  background: var(--line-soft);
}

/* ---------------------------------------------------------------- cards */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: var(--sp-4);
  box-shadow: var(--shadow-sm);
}

.card + .card {
  margin-top: var(--sp-3);
}

.card-title {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  margin: 0 0 var(--sp-3);
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
}

.card-title .ico {
  color: var(--muted);
  font-size: 16px;
}

/* ---------------------------------------------------------------- buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 16px;
  border-radius: var(--r-md);
  background: var(--line-soft);
  color: var(--text);
  font-size: var(--fs-base);
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  background: #e9ecf1;
}

.btn:active {
  transform: translateY(0.5px);
}

.btn .ico {
  font-size: 16px;
}

.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 2px rgba(244, 98, 43, 0.28);
}

.btn.primary:hover {
  background: var(--brand-hover);
}

.btn.green {
  background: var(--green);
  color: #fff;
}

.btn.danger {
  background: var(--red-soft);
  color: var(--red);
}

.btn.ghost {
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-2);
}

.btn.ghost:hover {
  background: var(--line-soft);
}

.btn.block {
  width: 100%;
}

.btn.sm {
  height: 32px;
  padding: 0 12px;
  border-radius: var(--r-sm);
  font-size: var(--fs-sm);
}

.btn.lg {
  height: 46px;
  font-size: var(--fs-lg);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ---------------------------------------------------------------- forms */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: var(--sp-3);
}

.field > label {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--text-2);
}

.input,
textarea.input,
select.input {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: #fff;
  color: var(--text);
  font-size: var(--fs-base);
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.input::placeholder {
  color: var(--faint);
}

.input:hover {
  border-color: #d9dde5;
}

.input:focus,
textarea.input:focus,
select.input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-ring);
}

textarea.input {
  height: auto;
  min-height: 84px;
  padding: 10px 12px;
  line-height: 1.6;
  resize: vertical;
}

select.input {
  appearance: none;
  padding-right: 34px;
  background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237c8492' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--sp-3);
}

@media (max-width: 520px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

/* ---------------------------------------------------------------- badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--r-xs);
  font-size: var(--fs-xs);
  font-weight: 600;
  background: var(--line-soft);
  color: var(--muted);
  white-space: nowrap;
}

.badge.brand {
  background: var(--brand-soft);
  color: var(--brand-hover);
}
.badge.green {
  background: var(--green-soft);
  color: var(--green);
}
.badge.red {
  background: var(--red-soft);
  color: var(--red);
}
.badge.blue {
  background: var(--blue-soft);
  color: var(--blue);
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------------------------------------------- avatar */
.avatar {
  width: 52px;
  height: 52px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--line-soft);
  color: var(--faint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 16px;
  flex-shrink: 0;
  overflow: hidden;
  border: 1px solid var(--line);
}

.avatar.sm {
  width: 36px;
  height: 36px;
  font-size: 13px;
  border-radius: var(--r-sm);
}

.avatar.lg {
  width: 68px;
  height: 68px;
  font-size: 20px;
  border-radius: var(--r-lg);
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------------------------------------------------------------- tabs */
.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 0;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab,
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 32px;
  padding: 0 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  transition: 0.15s;
}

.tab:hover,
.cat-chip:hover {
  border-color: #d9dde5;
}

.tab.active,
.cat-chip.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}

.cat-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: var(--sp-3);
}

/* ---------------------------------------------------------------- list */
.list-item {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.list-item:last-child {
  border-bottom: none;
}

.loading {
  display: block;
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 48px 16px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.7;
}

.empty .big {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  background: var(--line-soft);
  color: var(--faint);
  font-size: 28px;
}

.empty-address {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 1px dashed #d9dde5;
  border-radius: var(--r-md);
  padding: 18px;
  text-align: center;
  color: var(--muted);
  font-size: var(--fs-sm);
  cursor: pointer;
}

/* ---------------------------------------------------------------- switch */
.switch {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: #d5dae2;
  transition: 0.2s;
  flex-shrink: 0;
  cursor: pointer;
}

.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: 0.2s;
}

.switch.on {
  background: var(--green);
}

.switch.on::after {
  left: 23px;
}

/* ---------------------------------------------------------------- table */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: #fff;
}

table.table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--fs-sm);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

table.table th,
table.table td {
  padding: 11px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
}

.card .table-wrap {
  border: none;
  background: transparent;
}

.card .table-wrap table.table th:first-child,
.card .table-wrap table.table td:first-child {
  padding-left: 0;
}

.card .table-wrap table.table th:last-child,
.card .table-wrap table.table td:last-child {
  padding-right: 0;
}

table.table th {
  color: var(--muted);
  font-weight: 600;
  font-size: var(--fs-xs);
  letter-spacing: 0.02em;
  background: #fbfcfd;
}

table.table tbody tr:last-child td {
  border-bottom: none;
}

table.table tbody tr:hover td {
  background: #fbfcfd;
}

/* ---------------------------------------------------------------- modal */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 22, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(2px);
}

@media (min-width: 640px) {
  .modal-mask {
    align-items: center;
    padding: 24px;
  }
}

.modal {
  background: #fff;
  width: 100%;
  max-width: 520px;
  max-height: 88vh;
  overflow: auto;
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  padding: 20px;
  animation: slideUp 0.22s ease;
}

@media (min-width: 640px) {
  .modal {
    border-radius: var(--r-xl);
    box-shadow: var(--shadow-lg);
  }
}

@keyframes slideUp {
  from {
    transform: translateY(20px);
    opacity: 0.5;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

.modal h3 {
  margin: 0 0 var(--sp-4);
  font-size: var(--fs-xl);
}

.modal-actions {
  display: flex;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.modal-actions .btn {
  flex: 1;
}

/* ---------------------------------------------------------------- toast */
#toast-root {
  position: fixed;
  left: 50%;
  top: 16%;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}

.toast {
  max-width: 82vw;
  background: rgba(21, 24, 29, 0.94);
  color: #fff;
  padding: 10px 16px;
  border-radius: var(--r-md);
  font-size: var(--fs-sm);
  line-height: 1.5;
  box-shadow: var(--shadow-md);
  animation: fadeIn 0.18s ease;
}

.toast.error {
  background: rgba(217, 56, 67, 0.96);
}
.toast.success {
  background: rgba(18, 145, 90, 0.96);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* =========================================================================
   顾客端 H5
   ========================================================================= */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xl);
  padding: 22px 20px;
  margin-bottom: var(--sp-3);
  color: #fff;
  background: linear-gradient(135deg, #ff7a45 0%, #f4622b 55%, #e4551f 100%);
}

.hero h2 {
  margin: 0 0 6px;
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: #fff;
}

.hero p {
  margin: 0;
  font-size: var(--fs-sm);
  color: rgba(255, 255, 255, 0.86);
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
}

.search {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 42px;
  padding: 0 14px;
  margin-bottom: var(--sp-3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  color: var(--faint);
}

.search input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-size: var(--fs-base);
  color: var(--text);
}

.search .ico {
  font-size: 18px;
}

.merchant-card {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: 12px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: border-color 0.15s;
}

.merchant-card:hover {
  border-color: #dcdfe5;
}

.merchant-card:active {
  transform: scale(0.997);
}

.merchant-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.stars {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: #f0a020;
  font-size: var(--fs-sm);
  font-variant-numeric: tabular-nums;
}

.shop-head {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: var(--sp-3);
  box-shadow: var(--shadow-sm);
}

.shop-cover {
  position: relative;
  height: 120px;
  background: linear-gradient(135deg, #ffe9dc, #ffd5bd);
}

.shop-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-cover .shop-logo {
  position: absolute;
  left: 16px;
  bottom: -22px;
  width: 62px;
  height: 62px;
  border-radius: var(--r-lg);
  border: 3px solid #fff;
  background: #fff;
  box-shadow: var(--shadow-sm);
}

.shop-info {
  padding: 30px 16px 14px;
}

.shop-info h2 {
  margin: 0 0 4px;
  font-size: var(--fs-xl);
}

.shop-body {
  display: flex;
  align-items: flex-start;
}

.cat-nav {
  width: 92px;
  flex-shrink: 0;
  padding: 6px;
  background: var(--line-soft);
  border-radius: var(--r-md);
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 180px);
  overflow-y: auto;
}

.cat-nav button {
  display: block;
  width: 100%;
  padding: 9px 8px;
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  text-align: left;
  font-size: var(--fs-sm);
  color: var(--muted);
}

.cat-nav button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

.menu-list {
  flex: 1;
  padding-left: var(--sp-3);
  min-width: 0;
}

.menu-cat-title {
  margin: 14px 0 6px;
  font-size: var(--fs-md);
  font-weight: 600;
}

.product {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-soft);
}

.product-img {
  width: 72px;
  height: 72px;
  flex-shrink: 0;
  border-radius: var(--r-md);
  background: var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: var(--fs-xs);
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-main {
  flex: 1;
  min-width: 0;
}

.product-name {
  margin-bottom: 2px;
  font-size: var(--fs-md);
  font-weight: 600;
}

.product-desc {
  margin-bottom: 8px;
  font-size: var(--fs-sm);
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.qty {
  display: flex;
  align-items: center;
  gap: 8px;
}

.qty button {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: #fff;
  font-size: 15px;
}

.qty button.minus {
  background: var(--line-soft);
  color: var(--text-2);
}

.qty button:disabled {
  opacity: 0.35;
}

.cart-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  max-width: 720px;
  margin: 0 auto;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(21, 24, 29, 0.97);
  backdrop-filter: blur(8px);
  color: #fff;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

@media (max-width: 760px) {
  .cart-bar {
    border-radius: 0;
  }
}

.cart-bar .cart-total {
  font-size: var(--fs-xl);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.cart-bar .cart-hint {
  font-size: var(--fs-xs);
  color: #a9b0ba;
}

.cart-bar .btn {
  height: 42px;
  padding: 0 24px;
}

.status-steps {
  display: flex;
  margin: 12px 0 4px;
}

.status-steps div {
  position: relative;
  flex: 1;
  padding-top: 16px;
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--muted);
}

.status-steps div::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: #dfe3ea;
}

.status-steps div.done {
  color: var(--green);
}

.status-steps div.done::before {
  background: var(--green);
}

.order-card {
  padding: 14px;
  margin-bottom: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.order-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 6px;
  font-size: var(--fs-base);
  font-variant-numeric: tabular-nums;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: var(--fs-base);
}

.pay-option.active {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.pay-option input {
  accent-color: var(--brand);
}

.login-wrap {
  max-width: 420px;
  margin: 40px auto;
}

.login-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 600;
  color: var(--ink);
}

.profile-name {
  font-size: var(--fs-xl);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
}

.code-panel {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--line-soft);
  text-align: center;
}

.code-panel .code {
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Consolas, monospace;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--ink);
  line-height: 1.4;
}

.login-logo .brand-mark {
  width: 36px;
  height: 36px;
  border-radius: var(--r-md);
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  display: flex;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
  backdrop-filter: blur(10px);
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}

@media (max-width: 760px) {
  .bottom-nav {
    border-radius: 0;
  }
}

.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 8px 0 9px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 500;
}

.bottom-nav a .ico {
  font-size: 22px;
}

.bottom-nav a.active {
  color: var(--brand);
}

/* =========================================================================
   商家 / 平台后台外壳
   ========================================================================= */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  width: 224px;
  padding: 18px 12px;
  background: var(--shell);
  color: #fff;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 8px 20px;
  font-size: var(--fs-lg);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.01em;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: var(--r-sm);
  background: linear-gradient(135deg, #ff7a45, #e4551f);
  color: #fff;
  box-shadow: 0 4px 12px rgba(228, 85, 31, 0.32);
  flex: 0 0 auto;
}

.brand-mark .ico {
  font-size: 18px;
}

.sidebar nav a {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  margin-bottom: 2px;
  border-radius: var(--r-sm);
  color: var(--shell-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sidebar nav a .ico {
  font-size: 18px;
}

.sidebar nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #e7eaee;
}

.sidebar nav a.active {
  background: rgba(244, 98, 43, 0.15);
  color: #fff;
}

.sidebar nav a.active .ico {
  color: #ff8b5e;
}

.sidebar .foot,
.sidebar .shop-mini {
  margin-top: auto;
  padding: 14px 10px 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: var(--fs-sm);
  color: #8a929d;
}

.sidebar .foot a,
.sidebar .shop-mini a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: #8a929d;
}

.sidebar .foot a:hover,
.sidebar .shop-mini a:hover {
  color: #d7dbe0;
}

.sidebar .shop-mini .shop-name {
  color: #fff;
  font-weight: 600;
  font-size: 13px;
}

.sidebar .shop-mini .shop-state {
  margin-top: 8px;
  font-size: var(--fs-sm);
}

.main {
  flex: 1;
  min-width: 0;
  margin-left: 224px;
}

.main-head {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  height: 56px;
  padding: 0 24px;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.main-head h1 {
  font-size: var(--fs-xl);
  font-weight: 600;
}

.content {
  padding: 24px;
  max-width: 1200px;
}

.mobile-tabs {
  display: none;
}

/* 统计卡 */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--sp-3);
  margin-bottom: var(--sp-4);
}

.stat-grid.cols-3 {
  grid-template-columns: repeat(3, 1fr);
}

.stat-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.stat-card .label {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: var(--fs-sm);
}

.stat-card .label .ico {
  font-size: 14px;
}

.stat-card .value {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

/* 趋势柱状 */
.trend {
  display: flex;
  align-items: flex-end;
  gap: var(--sp-3);
  height: 160px;
  padding-top: 10px;
}

.trend .bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}

.trend .bar {
  width: 100%;
  max-width: 46px;
  min-height: 4px;
  border-radius: 6px 6px 3px 3px;
  background: linear-gradient(180deg, #ff9a6c, #f4622b);
  transition: height 0.4s;
}

.trend .day {
  font-size: var(--fs-xs);
  color: var(--muted);
}

/* 登录页 */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: radial-gradient(1200px 600px at 20% 0%, #1d232b 0%, #0f1318 55%, #0b0e12 100%);
}

.login-card {
  width: 100%;
  max-width: 388px;
  padding: 32px 28px 26px;
  background: #fff;
  border-radius: var(--r-xl);
  box-shadow: var(--shadow-lg);
}

.login-card h2 {
  margin: 0 0 4px;
  font-size: var(--fs-2xl);
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.login-brand .brand-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-sm);
}

.login-brand .name {
  font-size: var(--fs-lg);
  font-weight: 600;
  color: var(--ink);
}

.login-brand .sub {
  font-size: var(--fs-sm);
  color: var(--muted);
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: var(--sp-3);
}

.filter-bar .field {
  margin: 0;
  min-width: 130px;
}

.filter-bar .input {
  height: 36px;
  font-size: var(--fs-sm);
}

/* 商家订单卡 */
.order-box {
  padding: 14px 16px;
  margin-bottom: var(--sp-3);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.order-box .head {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.order-box .head .no {
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.order-box .body {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: var(--sp-3);
  margin-top: 10px;
}

.order-items {
  font-size: var(--fs-base);
}

.order-items > div {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
  color: var(--text-2);
}

.order-addr {
  font-size: var(--fs-sm);
  color: var(--muted);
  line-height: 1.8;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}

/* 商家菜单卡 */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: var(--sp-3);
}

.product-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
}

.product-card .pic {
  height: 132px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--line-soft);
  color: var(--faint);
  font-size: 22px;
}

.product-card .pic img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card .info {
  flex: 1;
  padding: 12px;
}

.product-card .name {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 2px;
}

.product-card .ops {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1100px) {
  .stat-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .sidebar {
    display: none;
  }

  .main {
    margin-left: 0;
    padding-bottom: 68px;
  }

  .content {
    padding: 14px;
  }

  .main-head {
    height: 52px;
    padding: 0 14px;
  }

  .stat-grid,
  .stat-grid.cols-3 {
    grid-template-columns: 1fr 1fr;
  }

  .order-box .body {
    grid-template-columns: 1fr;
  }

  .mobile-tabs {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    display: flex;
    overflow-x: auto;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
    backdrop-filter: blur(10px);
    scrollbar-width: none;
  }

  .mobile-tabs::-webkit-scrollbar {
    display: none;
  }

  .mobile-tabs a {
    flex: 1;
    min-width: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    padding: 8px 0 7px;
    color: var(--muted);
    font-size: var(--fs-xs);
    font-weight: 500;
    white-space: nowrap;
  }

  .mobile-tabs a .ico {
    font-size: 20px;
  }

  .mobile-tabs a.active {
    color: var(--brand);
  }
}

@media (max-width: 480px) {
  .stat-card .value {
    font-size: 22px;
  }

  .content {
    padding: 12px;
  }
}
