* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
input, textarea, button { font-family: inherit; }
button { touch-action: manipulation; }
::-webkit-scrollbar { width: 0; height: 0; }

.page, .sub-page { animation: fadeIn 0.18s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
#toast.show { animation: toastIn 0.22s ease; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.92); } to { opacity: 1; transform: translate(-50%, -50%) scale(1); } }

.brand-logo {
  display: flex;
  width: 86px;
  height: 86px;
  align-items: center;
  justify-content: center;
  border-radius: 20px;
  background: #f11208;
  color: #fffb00;
  font-size: 30px;
  font-weight: 1000;
  letter-spacing: 0;
  box-shadow: 0 18px 35px rgba(241, 18, 8, 0.22);
}
.mini-logo, .avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  background: #f11208;
  color: #fffb00;
  font-weight: 1000;
}
.mini-logo { width: 42px; height: 42px; border-radius: 12px; font-size: 23px; }
.avatar { width: 56px; height: 56px; border-radius: 18px; font-size: 28px; }

.form-label { display: block; margin-bottom: 8px; color: #475569; font-size: 14px; font-weight: 700; }
.form-input {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  padding: 13px 14px;
  font-size: 16px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.form-input:focus { border-color: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12); }

.primary-btn, .secondary-btn, .outline-btn, .task-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 900;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.primary-btn:active, .secondary-btn:active, .outline-btn:active, .task-btn:active { transform: scale(0.98); }
.primary-btn { min-height: 48px; background: linear-gradient(135deg, #ef1f12, #f97316); color: #fff; box-shadow: 0 12px 24px rgba(239, 68, 68, 0.22); }
.secondary-btn { min-height: 40px; padding: 0 18px; background: #111827; color: #fff; }
.outline-btn { min-height: 48px; border: 1px solid #fecaca; background: #fff; color: #dc2626; }
.task-btn { width: 100%; min-height: 54px; background: linear-gradient(135deg, #18c566, #0ea35a); color: #fff; font-size: 20px; box-shadow: 0 14px 28px rgba(16, 185, 129, 0.24); }

.app-header {
  min-height: 178px;
  padding: 26px 18px 62px;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 214, 102, 0.28), transparent 24%),
    linear-gradient(135deg, #b91c1c 0%, #ef1f12 48%, #f97316 100%);
}
.balance-card, .task-card, .panel, .profile-card {
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(226, 232, 240, 0.8);
}
.balance-card { padding: 20px; }
.task-card {
  padding: 20px;
  background:
    linear-gradient(180deg, rgba(255, 247, 237, 0.92), rgba(255, 255, 255, 1)),
    #fff;
}
.panel, .profile-card { padding: 16px; }

.download-float {
  position: fixed;
  left: max(8px, calc((100vw - 430px) / 2 + 8px));
  bottom: 96px;
  z-index: 45;
  width: 76px;
  min-height: 58px;
  border: 2px solid #fff;
  border-radius: 0 14px 14px 0;
  background: #f11208;
  color: #fff;
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.34);
  font-weight: 1000;
  line-height: 1.05;
}
.download-float span,
.download-float b {
  display: block;
}
.download-float span {
  font-size: 14px;
}
.download-float b {
  margin-top: 2px;
  font-size: 17px;
  letter-spacing: 0;
}
.download-float:active {
  transform: scale(0.98);
}

.quick-card {
  min-height: 96px;
  border-radius: 18px;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);
  border: 1px solid #eef2f7;
}
.quick-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 1000;
}

#home-banner-wrap:not(.hidden) { display: block; }
#home-banner-wrap img.home-banner-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.invite-poster {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  padding: 26px 18px 18px;
  background:
    radial-gradient(circle at 50% 88%, rgba(255, 225, 128, 0.38), transparent 25%),
    linear-gradient(160deg, #9f1239 0%, #dc2626 52%, #f97316 100%);
  box-shadow: 0 20px 45px rgba(220, 38, 38, 0.22);
}
.invite-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(45deg, rgba(255,255,255,0.08) 25%, transparent 25%),
    linear-gradient(-45deg, rgba(255,255,255,0.08) 25%, transparent 25%);
  background-size: 28px 28px;
  opacity: 0.35;
}
.qrcode-box {
  display: inline-flex;
  min-width: 196px;
  min-height: 196px;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #fff;
  padding: 6px;
}
.poster-stat {
  min-height: 58px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}
.poster-stat b { font-size: 18px; line-height: 1.1; }
.poster-stat span { margin-top: 3px; font-size: 12px; color: rgba(255, 255, 255, 0.78); }
.rate-pill {
  min-height: 58px;
  border-radius: 14px;
  background: #fff7ed;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.rate-pill b { color: #991b1b; font-size: 13px; }
.rate-pill span { color: #ea580c; font-size: 16px; font-weight: 1000; }

.team-row, .transaction-row, .menu-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 16px;
  background: #f8fafc;
}
.team-row { padding: 12px; }
.transaction-row { padding: 13px; }
.menu-row { width: 100%; padding: 15px 4px; background: transparent; border-bottom: 1px solid #f1f5f9; font-weight: 800; }
.menu-row:last-child { border-bottom: 0; }
.menu-row b { color: #94a3b8; font-size: 22px; line-height: 1; }
.customer-panel { text-align: center; }
.customer-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.customer-avatar {
  display: flex;
  width: 58px;
  height: 58px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: #fee2e2;
  color: #dc2626;
  font-size: 25px;
  font-weight: 1000;
}
.customer-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-radius: 16px;
  background: #f8fafc;
  padding: 14px;
}
.customer-info span {
  flex: 0 0 auto;
  color: #64748b;
  font-size: 14px;
  font-weight: 800;
}
.customer-info strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: #111827;
  font-size: 18px;
  font-weight: 1000;
}
.customer-qrcode-wrap {
  margin-top: 20px;
  border-radius: 20px;
  background: #fff7ed;
  padding: 16px;
  border: 1px solid #fed7aa;
}
.customer-qrcode-img {
  display: block;
  width: min(260px, 100%);
  max-height: 320px;
  margin: 0 auto;
  border-radius: 16px;
  background: #fff;
  object-fit: contain;
}
.transaction-type {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 900;
}
.transaction-type.income { background: #fee2e2; color: #dc2626; }
.transaction-type.expense { background: #e2e8f0; color: #334155; }

.sub-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sub-head h2 { font-size: 20px; font-weight: 1000; }
.back-btn {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  font-size: 32px;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
}

.tab-btn {
  min-height: 46px;
  border-radius: 16px;
  color: #94a3b8;
  font-size: 14px;
  font-weight: 900;
}
.tab-btn.active { background: #fff1f2; color: #dc2626; }

@media (min-width: 520px) {
  #app, #tab-bar > div { max-width: 430px; margin-left: auto; margin-right: auto; }
  body { background: #e8edf5; }
}

@media (max-width: 360px) {
  .download-float {
    width: 68px;
    min-height: 54px;
  }
  .download-float span { font-size: 12px; }
  .download-float b { font-size: 15px; }
}
