:root {
  --primary: #1a6b3e;
  --primary-dark: #115530;
  --primary-soft: #e8f3ec;
  --secondary: #2563eb;
  --secondary-soft: #eaf0ff;
  --danger: #d63838;
  --warning: #c97a16;
  --text: #1c1c1c;
  --text-light: #5a5a5a;
  --text-soft: #9a9a9a;
  --bg: #f3f4f4;
  --bg-card: #ffffff;
  --border: #dcdcdc;
  --border-soft: #ececec;
  --radius: 6px;
  --radius-sm: 4px;
  --tap: 40px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
.container { max-width: 720px; margin: 0 auto; padding: 0 14px; }
.main-content { padding-top: 12px; padding-bottom: 80px; }
.site-header {
  background: var(--primary);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 50;
}
.header-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
}
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand-logo {
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 700;
  flex-shrink: 0;
}
.brand-text { min-width: 0; }
.brand-title { font-size: 16px; font-weight: 600; line-height: 1.2; }
.brand-subtitle { font-size: 12px; opacity: 0.85; margin-top: 2px; line-height: 1.2; }
.track-btn {
  font-size: 13px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  transition: background 0.15s;
  white-space: nowrap;
}
.track-btn:hover { background: rgba(255, 255, 255, 0.25); }
.notice-bar {
  background: #fff8e1;
  border-bottom: 1px solid #f0e2b0;
  color: #7a5a00;
  font-size: 12px;
  padding: 6px 0;
}
.notice-bar.warn {
  background: #fdf0e0;
  border-bottom-color: #f3d8a8;
  color: #8a4a00;
}
.section { margin-bottom: 16px; }
.section-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.detail-card {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-left: 3px solid var(--primary);
  border-radius: var(--radius);
  padding: 12px 14px;
}
.detail-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 1px dashed var(--border);
}
.detail-content {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.7;
  white-space: pre-wrap;
}
.product-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 640px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}
.product-card {
  background: var(--bg-card);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.product-card:hover { border-color: var(--primary); }
.product-card.focused {
  border-color: var(--primary);
  background: var(--primary-soft);
  box-shadow: 0 0 0 3px rgba(26, 107, 62, 0.12);
}
.product-card.focused::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 12px;
  width: 22px; height: 22px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
}
.product-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding-right: 28px;
}
.product-name { font-size: 15px; font-weight: 600; color: var(--text); }
.product-tags { display: flex; gap: 4px; flex-wrap: wrap; flex-shrink: 0; }
.tag {
  font-size: 11px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--secondary-soft);
  color: var(--secondary);
  font-weight: 500;
}
.product-desc {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}
.product-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: auto;
}
.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--danger);
}
.product-price .unit { font-size: 11px; font-weight: 500; margin-left: 2px; }
.product-stock { font-size: 11px; color: var(--text-soft); }
.qty-control {
  display: inline-flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.qty-btn {
  width: 32px; height: 32px;
  font-size: 16px;
  color: var(--text);
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  cursor: pointer;
}
.qty-btn:hover:not(:disabled) { background: var(--bg); }
.qty-btn:disabled { color: var(--text-soft); cursor: not-allowed; }
.qty-input {
  width: 44px;
  height: 32px;
  text-align: center;
  border: none;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.product-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--tap);
  padding: 0 18px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: background 0.15s, opacity 0.15s;
  white-space: nowrap;
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover:not(:disabled) { background: var(--primary-dark); }
.btn-primary:disabled {
  background: #c8c8c8;
  color: #fff;
  cursor: not-allowed;
}
.btn-secondary {
  background: var(--primary-soft);
  color: var(--primary-dark);
}
.btn-secondary:hover { background: #d8ebe0; }
.btn-ghost {
  background: transparent;
  color: var(--text-light);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }
.btn-large { font-size: 15px; }
.btn-full { width: 100%; }
.btn-mini { height: 30px; padding: 0 12px; font-size: 12px; }
.btn-add { padding: 0 14px; height: 32px; font-size: 13px; }
.cart-count { color: var(--primary); font-weight: 700; font-size: 16px; }
.cart-list {
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  overflow: hidden;
}
.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-soft);
}
.cart-item:last-child { border-bottom: none; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 14px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
.cart-item-sub { font-size: 12px; color: var(--text-light); }
.cart-item-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.cart-item .qty-control .qty-btn { width: 28px; height: 28px; font-size: 14px; }
.cart-item .qty-control .qty-input { width: 38px; height: 28px; font-size: 13px; }
.cart-remove {
  width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
  color: var(--text-soft);
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
  cursor: pointer;
}
.cart-remove:hover { background: #fdecec; color: var(--danger); }
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  background: var(--bg-card);
  border: 1px solid var(--border-soft);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 10px 12px;
  font-size: 13px;
  color: var(--text-light);
}
.cart-total-value { font-size: 18px; font-weight: 700; color: var(--danger); }
.order-form { background: var(--bg-card); border-radius: var(--radius); padding: 12px; }
.order-form.compact { padding: 10px; }
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.form-row .form-group { margin-bottom: 0; }
.form-group { margin-bottom: 8px; }
.form-group:last-child { margin-bottom: 0; }
.form-label { display: block; font-size: 12px; font-weight: 500; color: var(--text); margin-bottom: 3px; }
.required { color: var(--danger); }
.optional { color: var(--text-soft); font-weight: 400; }
.form-input {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  transition: border-color 0.15s;
  outline: none;
  resize: vertical;
}
.form-input:focus { border-color: var(--primary); }
.form-input.error { border-color: var(--danger); }
textarea.form-input { min-height: 48px; line-height: 1.5; }
.form-error { font-size: 11px; color: var(--danger); margin-top: 2px; min-height: 12px; }
.order-form .btn-primary { margin-top: 6px; }
.order-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border-soft);
  margin-bottom: 14px;
}
.order-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px dashed var(--border);
  gap: 12px;
}
.order-label { font-size: 11px; color: var(--text-light); margin-bottom: 2px; }
.order-id {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.order-amount-wrap { text-align: right; }
.order-amount { font-size: 20px; font-weight: 700; color: var(--danger); }
.order-card-body { padding-top: 8px; }
.order-items {
  margin: 6px 0;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 13px;
}
.order-items .item-row {
  display: flex;
  justify-content: space-between;
  padding: 3px 0;
}
.order-items .item-name { color: var(--text); }
.order-items .item-qty { color: var(--text-light); margin: 0 8px; }
.order-items .item-sub { color: var(--text-light); }
.order-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  font-size: 13px;
}
.order-key { color: var(--text-light); white-space: nowrap; }
.order-val { color: var(--text); text-align: right; word-break: break-all; }
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
  overflow: hidden;
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-light);
  background: #fff;
  transition: background 0.15s, color 0.15s;
  min-height: 46px;
  justify-content: center;
  cursor: pointer;
}
.tab + .tab { border-left: 1px solid var(--border); }
.tab.active { background: var(--primary); color: #fff; }
.tab-tag { font-size: 10px; font-weight: 400; opacity: 0.85; }
.tab.active .tab-tag { opacity: 0.95; }
.pay-panel {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border-soft);
}
.qr-wrap { text-align: center; margin-bottom: 14px; }
.qr-box {
  width: 200px; height: 200px;
  margin: 0 auto;
  padding: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.qr-box canvas, .qr-box img, .qr-box > div { width: 184px !important; height: 184px !important; }
.qr-hint { margin-top: 8px; font-size: 11px; color: var(--text-light); }
.address-block { margin-bottom: 12px; }
.address-label, .amount-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}
.address-row, .amount-row {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.address-text {
  flex: 1;
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 12px;
  word-break: break-all;
  color: var(--text);
  line-height: 1.4;
}
.amount-value { flex: 1; font-size: 18px; font-weight: 700; color: var(--danger); }
.btn-copy { height: 32px; min-width: 60px; padding: 0 10px; font-size: 12px; }
.btn-copy.copied { background: var(--primary-soft); color: var(--primary-dark); }
.address-note { margin-top: 6px; font-size: 11px; color: var(--warning); line-height: 1.5; }
.amount-block { padding-top: 10px; border-top: 1px dashed var(--border); }
.help-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 12px;
  border: 1px solid var(--border-soft);
}
.help-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.help-list { margin-left: 18px; font-size: 12px; color: var(--text-light); line-height: 1.7; }
.help-list strong { color: var(--text); }
.track-form {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 14px;
  border: 1px solid var(--border-soft);
}
.track-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  outline: none;
}
.track-input:focus { border-color: var(--primary); }
.track-actions { display: flex; gap: 8px; margin-top: 10px; }
.track-tip {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-light);
  line-height: 1.6;
}
.site-footer {
  text-align: center;
  padding: 14px 16px;
  color: var(--text-soft);
  font-size: 11px;
}
.loading {
  text-align: center;
  padding: 30px 0;
  color: var(--text-light);
  font-size: 13px;
}
.error-box {
  background: #fdecec;
  border: 1px solid #f5c2c2;
  color: var(--danger);
  padding: 14px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 13px;
}
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(28, 28, 28, 0.92);
  color: #fff;
  padding: 8px 16px;
  border-radius: 18px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.25s;
  z-index: 200;
  max-width: calc(100vw - 32px);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal[hidden] { display: none; }
.modal-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
}
.modal-panel {
  position: relative;
  background: #fff;
  border-radius: var(--radius);
  padding: 22px 20px;
  width: 100%;
  max-width: 340px;
  text-align: center;
}
.modal-icon { font-size: 36px; margin-bottom: 8px; }
.modal-title { font-size: 16px; font-weight: 700; margin-bottom: 6px; }
.modal-text { font-size: 13px; color: var(--text-light); margin-bottom: 16px; line-height: 1.6; }