:root {
  --gb-ink: #102018;
  --gb-muted: #6a746f;
  --gb-faint: #8c9691;
  --gb-page: #f3f6f4;
  --gb-panel: #ffffff;
  --gb-line: rgba(16, 32, 24, 0.1);
  --gb-green: #188653;
  --gb-green-dark: #0f5f3d;
  --gb-mint: #e8f5ee;
  --gb-orange: #f97316;
  --gb-red: #e11d48;
  --gb-sky: #0ea5e9;
  --gb-shadow: 0 16px 48px rgba(16, 32, 24, 0.12);
  --gb-soft-shadow: 0 8px 28px rgba(16, 32, 24, 0.07);
}

html {
  background: #101714;
}

body {
  background: #101714;
  color: var(--gb-ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

a {
  text-decoration: none;
}

.phone-frame {
  width: min(430px, 100vw) !important;
  max-width: 100vw !important;
  background: var(--gb-page) !important;
  color: var(--gb-ink);
  box-shadow: var(--gb-shadow);
}

/* For pages using a fixed "phone shell" with an internal scroll area,
   give the shell a real viewport height and let the main section own scrolling. */
.phone-frame.flex.flex-col.relative.overflow-hidden {
  height: 100dvh !important;
  min-height: 100dvh !important;
}

.phone-frame.flex.flex-col.relative.overflow-hidden > main.flex-1.overflow-y-auto,
.phone-frame.flex.flex-col.relative.overflow-hidden > .flex-1.overflow-y-auto {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.mobile-shell {
  background: var(--gb-page) !important;
}

.phone-frame .rounded-2xl,
.phone-frame .rounded-xl,
.phone-frame .rounded-lg {
  border-radius: 8px !important;
}

.phone-frame .shadow-sm,
.phone-frame .shadow-lg,
.phone-frame .shadow-2xl {
  box-shadow: var(--gb-soft-shadow) !important;
}

.text-dark,
.text-gray-900 {
  color: var(--gb-ink) !important;
}

.text-primary {
  color: var(--gb-green) !important;
}

.text-secondary {
  color: var(--gb-green) !important;
}

.bg-primary {
  background-color: var(--gb-green) !important;
}

.bg-secondary {
  background-color: var(--gb-green) !important;
}

.bg-blue-500,
.bg-blue-600,
.bg-blue-700,
.hover\:bg-blue-700:hover {
  background-color: var(--gb-green) !important;
}

.bg-blue-50,
.bg-blue-100,
.hover\:bg-blue-100:hover {
  background-color: var(--gb-mint) !important;
}

.text-blue-500,
.text-blue-600,
.text-blue-700,
.text-blue-800 {
  color: var(--gb-green) !important;
}

.border-blue-100,
.border-blue-200,
.border-blue-500 {
  border-color: rgba(24, 134, 83, 0.18) !important;
}

.from-blue-500 {
  --tw-gradient-from: #176b48 var(--tw-gradient-from-position) !important;
  --tw-gradient-to: rgba(23, 107, 72, 0) var(--tw-gradient-to-position) !important;
  --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to) !important;
}

.to-blue-600 {
  --tw-gradient-to: #0f5f3d var(--tw-gradient-to-position) !important;
}

.to-purple-500 {
  --tw-gradient-to: #d86c20 var(--tw-gradient-to-position) !important;
}

.border-primary {
  border-color: var(--gb-green) !important;
}

.focus\:ring-primary:focus {
  --tw-ring-color: rgba(24, 134, 83, 0.38) !important;
}

.focus\:ring-blue-400:focus,
.focus\:ring-blue-500:focus {
  --tw-ring-color: rgba(24, 134, 83, 0.38) !important;
}

.btn-primary,
.gb-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  background: var(--gb-green);
  color: #fff !important;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(24, 134, 83, 0.2);
}

.gb-secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 8px;
  background: #eef3f0;
  color: var(--gb-ink);
  font-weight: 650;
}

.gb-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.gb-page-pad {
  padding: 18px 16px 92px;
}

.gb-page-top {
  padding: 22px 18px 14px;
}

.gb-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  color: var(--gb-green);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gb-title {
  margin: 0;
  color: var(--gb-ink);
  font-size: 26px;
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: 0;
}

.gb-subtitle {
  margin-top: 8px;
  color: var(--gb-muted);
  font-size: 14px;
  line-height: 1.55;
}

.gb-panel {
  border: 1px solid var(--gb-line);
  border-radius: 8px;
  background: var(--gb-panel);
  box-shadow: var(--gb-soft-shadow);
}

.gb-card {
  border: 1px solid var(--gb-line);
  border-radius: 8px;
  background: var(--gb-panel);
  box-shadow: var(--gb-soft-shadow);
  overflow: hidden;
}

.gb-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--gb-mint);
  color: var(--gb-green-dark);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
}

.gb-chip--orange {
  background: #fff1e8;
  color: #c2410c;
}

.gb-chip--gray {
  background: #edf1ef;
  color: #5f6b65;
}

.gb-price {
  color: var(--gb-red);
  font-weight: 850;
}

.gb-shell-bg,
.bg-gray-50,
.bg-gray-100 {
  background-color: var(--gb-page) !important;
}

.gb-hero {
  margin: 12px 14px 0;
  padding: 18px;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #11271d 0%, #176b48 58%, #d86c20 100%);
  box-shadow: 0 18px 38px rgba(18, 74, 49, 0.18);
}

.gb-hero__label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.gb-hero__title {
  margin-top: 12px;
  color: #fff;
  font-size: 26px;
  font-weight: 850;
  line-height: 1.12;
  letter-spacing: 0;
}

.gb-hero__text {
  margin-top: 8px;
  max-width: 290px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  line-height: 1.5;
}

.gb-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.gb-stat {
  min-height: 86px;
  padding: 12px 10px;
  border: 1px solid var(--gb-line);
  border-radius: 8px;
  background: #fff;
}

.gb-stat__label {
  color: var(--gb-muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
}

.gb-stat__value {
  margin-top: 8px;
  color: var(--gb-ink);
  font-size: 20px;
  font-weight: 850;
  line-height: 1.05;
}

.gb-stat__note {
  margin-top: 6px;
  color: var(--gb-green);
  font-size: 10px;
  font-weight: 700;
}

.gb-bottom-nav,
.bottom-tabbar {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(430px, 100vw);
  transform: translateX(-50%);
  z-index: 20;
  border-top: 1px solid var(--gb-line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -8px 28px rgba(16, 32, 24, 0.08);
  backdrop-filter: blur(12px);
}

.phone-frame > footer {
  border-top: 1px solid var(--gb-line) !important;
  background: rgba(255, 255, 255, 0.96) !important;
  box-shadow: 0 -8px 28px rgba(16, 32, 24, 0.08) !important;
  backdrop-filter: blur(12px);
}

.bottom-tabbar.fixed {
  position: fixed !important;
}

.gb-bottom-nav nav,
.bottom-tabbar > div,
.bottom-tabbar nav {
  display: flex;
  justify-content: space-around;
  align-items: center;
  min-height: 64px;
}

.nav-item,
.bottom-tabbar a {
  min-width: 56px;
  color: #8b9691;
  font-size: 11px;
}

.nav-item i,
.bottom-tabbar i {
  font-size: 18px;
  margin-bottom: 3px;
}

.active-menu,
.nav-item.active,
.bottom-tabbar .active {
  color: var(--gb-green) !important;
}

.landing-screen {
  min-height: 100vh;
  padding: 22px 18px 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.landing-visual {
  position: relative;
  height: 220px;
  border-radius: 8px;
  overflow: hidden;
  background: #dfe7e2;
  box-shadow: var(--gb-soft-shadow);
}

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

.landing-visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(16, 32, 24, 0.08), rgba(16, 32, 24, 0.58));
}

.landing-visual__caption {
  position: absolute;
  right: 14px;
  bottom: 14px;
  left: 14px;
  z-index: 1;
  color: #fff;
}

.landing-visual__caption strong {
  display: block;
  font-size: 20px;
  line-height: 1.15;
}

.landing-visual__caption span {
  display: block;
  margin-top: 6px;
  color: rgba(255, 255, 255, 0.8);
  font-size: 12px;
}

.role-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--gb-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--gb-soft-shadow);
  color: var(--gb-ink);
}

.role-card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--gb-mint);
  color: var(--gb-green);
  flex: 0 0 auto;
}

.role-card--buyer .role-card__icon {
  background: #fff1e8;
  color: var(--gb-orange);
}

.role-card h3 {
  color: var(--gb-ink);
  font-size: 16px;
  font-weight: 800;
}

.role-card p {
  margin-top: 4px;
  color: var(--gb-muted);
  font-size: 12px;
}

.group-card-modern,
.product-card-modern {
  border: 1px solid var(--gb-line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--gb-soft-shadow);
  overflow: hidden;
}

.product-thumb {
  background: #e9efec;
  border-radius: 8px;
  overflow: hidden;
}

.cart-bar {
  border-top: 1px solid var(--gb-line);
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 -12px 32px rgba(16, 32, 24, 0.12);
  backdrop-filter: blur(12px);
}

.gb-field,
.gb-textarea {
  width: 100%;
  border: 1px solid rgba(16, 32, 24, 0.12);
  border-radius: 8px;
  background: #fff;
  color: var(--gb-ink);
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.gb-field:focus,
.gb-textarea:focus {
  border-color: rgba(24, 134, 83, 0.55);
  box-shadow: 0 0 0 4px rgba(24, 134, 83, 0.11);
}

.product-card.selected {
  border-color: var(--gb-green) !important;
  background: #f2faf5 !important;
}

.product-card.selected .check-box {
  border-color: var(--gb-green) !important;
  background: var(--gb-green) !important;
}

.product-card.editing {
  border-color: var(--gb-orange) !important;
  background: #fff8f1 !important;
}

@media (min-width: 640px) {
  .phone-frame {
    min-height: calc(100vh - 40px) !important;
    border-radius: 20px;
    overflow: hidden;
  }

  .phone-frame.flex.flex-col.relative.overflow-hidden {
    height: calc(100vh - 40px) !important;
    min-height: calc(100vh - 40px) !important;
  }
}
