* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  background: #f5f6f8;
  color: #1a1a1a;
  touch-action: manipulation;
}

#main {
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
}

.app-shell {
  padding-bottom: 72px;
}

.nav-bar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  background: #07c160;
  color: #fff;
  font-weight: 600;
}

.nav-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-action {
  flex-shrink: 0;
  margin-left: auto;
  padding: 6px 10px;
  border: none;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.nav-action:active {
  background: rgba(255, 255, 255, 0.32);
}

.nav-back {
  margin-right: 8px;
  padding: 8px 12px;
  border: none;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  touch-action: manipulation;
}

.card {
  margin: 12px;
  padding: 16px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat-label {
  font-size: 13px;
  color: #888;
}

.stat-value {
  font-size: 20px;
  font-weight: 600;
  margin-top: 4px;
}

.list-item {
  display: block;
  width: 100%;
  text-align: left;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  font-size: 16px;
  color: #333;
  cursor: pointer;
  touch-action: manipulation;
}

.list-item:active {
  background: #f5f5f5;
}

.tab-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  display: flex;
  background: #fff;
  border-top: 1px solid #eee;
  padding-bottom: env(safe-area-inset-bottom, 0);
}

.tab-btn {
  flex: 1;
  min-height: 52px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #666;
  cursor: pointer;
  touch-action: manipulation;
}

.tab-btn.active {
  color: #07c160;
  font-weight: 600;
}

.error-banner {
  margin: 12px;
  padding: 12px;
  background: #fff2f0;
  color: #cf1322;
  border-radius: 8px;
  font-size: 14px;
}

.loading {
  text-align: center;
  padding: 24px;
  color: #999;
}

.stat-row {
  display: flex;
  gap: 12px;
  margin: 12px;
}

.stat-box {
  flex: 1;
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.stat-box .stat-value {
  font-size: 22px;
  font-weight: 600;
  color: #07c160;
}

.stat-box .stat-value.accent {
  color: #06ad56;
}

.chart-card {
  padding: 0;
  overflow: hidden;
}

.chart-title {
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid #ededed;
}

.chart-svg {
  display: block;
  margin: 8px auto;
}

.chart-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 12px 12px;
  font-size: 11px;
  color: #999;
}

.detail-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f5;
  font-size: 14px;
}

.detail-label {
  color: #999;
}

.detail-value {
  color: #333;
  text-align: right;
  max-width: 60%;
  word-break: break-all;
}

.btn-primary {
  display: block;
  width: calc(100% - 24px);
  margin: 12px;
  padding: 12px 16px;
  border: none;
  border-radius: 8px;
  background: #07c160;
  color: #fff;
  font-size: 16px;
  cursor: pointer;
}

.link-btn {
  margin-top: 8px;
  border: none;
  background: none;
  color: #07c160;
  font-size: 14px;
  cursor: pointer;
  padding: 0;
}

.merchant-row {
  display: flex;
  align-items: center;
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid #f0f0f0;
  background: #fff;
  text-align: left;
  cursor: pointer;
}

.merchant-logo {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  margin-right: 12px;
}

.merchant-logo-ph {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  margin-right: 12px;
  background: #e8e8e8;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
}

.merchant-meta {
  flex: 1;
}

.merchant-no {
  font-size: 14px;
  color: #333;
}

.merchant-time {
  font-size: 12px;
  color: #999;
  margin-top: 4px;
}

.chevron {
  color: #ccc;
  font-size: 20px;
}

.empty {
  text-align: center;
  padding: 32px 16px;
  color: #999;
}

.hint {
  margin: 0 12px 12px;
  padding: 10px 12px;
  font-size: 12px;
  color: #666;
  background: #f0faf4;
  border-radius: 8px;
  border-left: 3px solid #07c160;
}

.month-block {
  border-bottom: 1px solid #f0f0f0;
}

.month-bar {
  padding: 10px 16px;
  background: rgba(7, 193, 96, 0.08);
  font-size: 13px;
}

.month-title {
  font-weight: 600;
}

.order-item {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  font-size: 14px;
  border-bottom: 1px solid #f2f2f2;
  list-style: none;
}

.order-amt {
  color: #06ad56;
  font-weight: 600;
}

.form-card label {
  display: block;
  font-size: 14px;
  margin: 12px 0 4px;
  color: #333;
}

.form-card input,
.form-card select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 14px;
}

.title-lg {
  font-size: 18px;
  font-weight: 600;
}

.muted {
  color: #999;
  font-size: 13px;
}

.break-all {
  word-break: break-all;
}

.qr-row {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: center;
}

.qr-box {
  text-align: center;
}

.qr-img {
  width: 180px;
  height: 180px;
  border: 1px solid #eee;
  border-radius: 8px;
}

.section-title {
  margin: 16px 12px 8px;
  font-size: 15px;
  font-weight: 500;
}

.legacy-frame-wrap {
  position: fixed;
  top: 48px;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 480px;
  margin: 0 auto;
  background: #fff;
}

.app-shell--legacy .legacy-frame-wrap {
  top: 0;
}

.app-shell--legacy {
  padding-bottom: 0;
}

.huiban-list-wrap {
  padding: 12px;
}

.huiban-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin-bottom: 8px;
  padding: 12px 14px;
  border: 1px solid #ededed;
  border-radius: 8px;
  background: #fff;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.huiban-row-thumb {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.huiban-row-thumb-ph {
  width: 56px;
  height: 56px;
  border-radius: 8px;
  flex-shrink: 0;
  background: #eee;
  color: #bbb;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.huiban-row-body {
  flex: 1;
  min-width: 0;
}

.huiban-row-title {
  font-size: 15px;
  font-weight: 600;
  color: #222;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.huiban-row-meta {
  margin-top: 4px;
  font-size: 12px;
  color: #888;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.huiban-row-chevron {
  color: #ccc;
  flex-shrink: 0;
  font-size: 18px;
}

.legacy-frame {
  width: 100%;
  height: 100%;
  border: none;
}

.app-shell:has(.legacy-frame-wrap) .tab-bar {
  display: none;
}

