:root {
  color-scheme: light;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  --brand: #0369a1;
  --brand-dark: #1f5f94;
  --cyan: #0891b2;
  --green: #16a34a;
  --orange: #ea7a2a;
  --yellow: #eab308;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --soft: #f5f7fa;
  --card: #ffffff;
  --danger: #dc2626;
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #eef2f7;
  color: var(--text);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

.phone {
  width: min(100vw, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--soft);
  position: relative;
  overflow-x: hidden;
}

.topbar {
  height: calc(56px + env(safe-area-inset-top));
  padding-top: env(safe-area-inset-top);
  background: #fff;
  display: grid;
  grid-template-columns: 112px 1fr 112px;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.05);
}

.topbar.brand-top {
  background: var(--brand);
  color: #fff;
}

.nav-pill {
  margin-left: 16px;
  width: 88px;
  height: 36px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  display: inline-flex;
  align-items: center;
  justify-content: space-around;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.08);
}

.brand-top .nav-pill {
  background: rgba(255, 255, 255, 0.2);
}

.nav-icon {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  color: #0f172a;
  font-size: 20px;
  line-height: 30px;
  text-align: center;
}

.brand-top .nav-icon {
  color: #fff;
}

.top-title {
  text-align: center;
  font-size: 21px;
  font-weight: 700;
  white-space: nowrap;
}

.content {
  min-height: calc(100vh - 56px);
  padding: 14px 13px 92px;
}

.no-tab .content {
  padding-bottom: 26px;
}

.hero-banner {
  margin: -14px -13px 14px;
  min-height: 140px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(135deg, #2f6fa3 0%, #34a6ba 100%);
  color: #fff;
  display: grid;
  place-items: center;
  text-align: center;
}

.hero-title {
  font-size: 25px;
  font-weight: 800;
  margin-bottom: 10px;
}

.hero-sub {
  font-size: 16px;
  opacity: 0.92;
}

.card {
  background: var(--card);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.shortcut-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 18px 12px;
  margin-bottom: 22px;
}

.shortcut {
  display: grid;
  justify-items: center;
  gap: 9px;
  color: #1f2937;
}

.shortcut-symbol {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 800;
  font-size: 24px;
  position: relative;
}

.shortcut-symbol.order {
  background: var(--brand);
}

.shortcut-symbol.team {
  background: var(--cyan);
}

.shortcut-symbol.withdraw {
  background: #43a047;
}

.shortcut-symbol.payment {
  background: var(--orange);
}

.badge {
  position: absolute;
  top: -3px;
  right: -7px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 11px;
  line-height: 18px;
}

.section-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 10px 6px 12px;
}

.section-title {
  font-size: 20px;
  font-weight: 800;
}

.section-more {
  color: #64748b;
  font-size: 14px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-card {
  overflow: hidden;
}

.product-thumb {
  aspect-ratio: 1 / 1.16;
  background: linear-gradient(135deg, #eef2f7, #f8fafc);
  display: grid;
  place-items: center;
  color: #94a3b8;
  font-size: 13px;
}

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

.product-info {
  padding: 12px 14px 14px;
}

.product-name {
  font-size: 17px;
  font-weight: 700;
  margin-bottom: 8px;
}

.price {
  color: #df3d3d;
  font-weight: 800;
  font-size: 18px;
}

.user-header {
  background: var(--brand-dark);
  color: #fff;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 14px;
}

.user-main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.avatar {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.86);
  background: linear-gradient(135deg, #e8f0f9, #a9bdd1);
  display: grid;
  place-items: center;
  color: #356287;
  font-size: 24px;
  font-weight: 800;
  overflow: hidden;
}

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

.login-copy {
  font-size: 22px;
  font-weight: 800;
}

.user-name {
  font-size: 22px;
  font-weight: 800;
}

.phone-line {
  margin-top: 4px;
  font-size: 16px;
  opacity: 0.9;
}

.invite-tag {
  margin-top: 7px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 5px;
  padding: 4px 7px;
  background: rgba(255, 255, 255, 0.17);
  font-size: 13px;
}

.mini-btn {
  min-height: 24px;
  border-radius: 5px;
  padding: 0 8px;
  background: rgba(255, 255, 255, 0.26);
  color: #fff;
}

.asset-summary {
  margin-top: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  text-align: center;
  overflow: hidden;
}

.asset-item {
  padding: 14px 5px 13px;
  color: #fff;
}

.asset-number {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.08;
  word-break: break-word;
}

.asset-label {
  margin-top: 7px;
  font-size: 13px;
}

.menu-group {
  margin-top: 12px;
  padding: 14px 16px 6px;
}

.menu-title {
  color: #334155;
  font-size: 16px;
  margin-bottom: 4px;
}

.menu-item {
  display: grid;
  grid-template-columns: 30px 1fr 18px;
  align-items: center;
  gap: 7px;
  min-height: 58px;
  width: 100%;
  text-align: left;
  border-top: 1px solid #f1f5f9;
  color: #111827;
}

.menu-item:first-of-type {
  border-top: 0;
}

.menu-symbol {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.menu-symbol.blue {
  background: var(--brand);
}

.menu-symbol.cyan {
  background: var(--cyan);
}

.menu-symbol.green {
  background: var(--green);
}

.menu-symbol.yellow {
  background: var(--yellow);
}

.menu-symbol.slate {
  background: #475569;
}

.chevron {
  color: #cbd5e1;
  font-size: 26px;
}

.logout-btn,
.primary-btn,
.ghost-btn,
.danger-btn {
  width: 100%;
  min-height: 54px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 800;
}

.primary-btn {
  background: linear-gradient(90deg, var(--brand), #75abd3);
  color: #fff;
}

.ghost-btn {
  border: 1px dashed #6c9bb7;
  color: var(--brand-dark);
  background: #fff;
}

.danger-btn {
  color: #b91c1c;
  background: #fff;
}

.logout-btn {
  margin: 26px 0 8px;
  background: #fff;
  color: #b91c1c;
  font-size: 17px;
}

.tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(100vw, 430px);
  height: calc(68px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: #fff;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid #e5e7eb;
  z-index: 25;
}

.tab {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 3px;
  color: #6b7280;
  font-size: 13px;
}

.tab.active {
  color: var(--brand);
  font-weight: 700;
}

.tab-mark {
  width: 24px;
  height: 24px;
  border-radius: 7px;
  border: 2px solid currentColor;
  display: grid;
  place-items: center;
  font-size: 12px;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.stat-card {
  padding: 18px 12px;
  text-align: center;
}

.stat-value {
  color: var(--brand);
  font-size: 23px;
  font-weight: 800;
}

.stat-name {
  color: #475569;
  margin-top: 8px;
  font-size: 13px;
}

.invite-card,
.table-card,
.form-card,
.order-card,
.record-card,
.payment-card,
.detail-card {
  padding: 16px;
  margin-top: 12px;
}

.invite-code {
  margin-top: 10px;
  border-radius: 8px;
  background: #eff6ff;
  color: var(--brand-dark);
  padding: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 800;
}

.hint {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.table-head,
.table-row {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr 0.9fr 0.6fr;
  gap: 6px;
  align-items: center;
}

.table-head {
  color: #64748b;
  font-size: 13px;
  padding-bottom: 9px;
  border-bottom: 1px solid #eef2f7;
}

.table-row {
  min-height: 50px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
}

.segment {
  background: #fff;
  border-radius: 8px;
  padding: 8px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.segment button {
  min-height: 35px;
  border-radius: 7px;
  color: #475569;
  white-space: nowrap;
}

.segment button.active {
  color: #fff;
  background: var(--brand);
  font-weight: 800;
}

.order-card {
  text-align: left;
}

.order-top,
.record-top,
.payment-top,
.detail-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.order-no {
  font-weight: 800;
  color: #0f172a;
  word-break: break-all;
}

.status {
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #64748b;
  white-space: nowrap;
}

.status.pending {
  background: #eab308;
}

.status.paid {
  background: #0ea5e9;
}

.status.done {
  background: #16a34a;
}

.status.bad {
  background: #dc2626;
}

.order-name {
  font-size: 17px;
  font-weight: 800;
  margin: 12px 0 5px;
}

.order-meta {
  color: #64748b;
  font-size: 14px;
  line-height: 1.8;
}

.order-money {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 12px;
  gap: 8px;
}

.metric {
  background: #f8fafc;
  border-radius: 8px;
  padding: 10px;
}

.metric-label {
  color: #64748b;
  font-size: 12px;
}

.metric-value {
  margin-top: 4px;
  font-weight: 800;
  color: #334155;
}

.banner-state {
  margin: -14px -13px 12px;
  padding: 28px 20px;
  background: var(--brand-dark);
  color: #fff;
  border-radius: 0 0 8px 8px;
}

.banner-state h2 {
  margin: 0 0 10px;
  font-size: 24px;
}

.detail-card h3,
.form-card h3 {
  margin: 0 0 14px;
  font-size: 18px;
}

.detail-row {
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
}

.detail-row span:first-child {
  color: #64748b;
}

.detail-row strong,
.detail-row span:last-child {
  text-align: right;
  max-width: 66%;
  word-break: break-word;
}

.voucher {
  margin-top: 12px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #eef2f7;
  background: #f8fafc;
}

.voucher img {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: contain;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 800;
  color: #1f2937;
}

.field input,
.field textarea,
.field select {
  width: 100%;
  min-height: 47px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 13px;
  outline: none;
}

.field textarea {
  min-height: 88px;
  padding-top: 12px;
  resize: vertical;
}

.money-input {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
}

.money-input input {
  border: 0;
  padding: 0;
}

.tips {
  margin: 12px 0 18px;
  color: #64748b;
  line-height: 1.8;
  font-size: 13px;
}

.record-card {
  display: grid;
  gap: 8px;
}

.record-amount {
  color: #16a34a;
  font-size: 18px;
  font-weight: 800;
}

.record-order,
.record-time {
  color: #64748b;
  font-size: 13px;
}

.payment-image {
  width: 138px;
  height: 168px;
  border-radius: 4px;
  background: #eff6ff;
  display: grid;
  place-items: center;
  overflow: hidden;
  margin: 12px 0;
  color: #64748b;
  border: 1px solid #dbeafe;
}

.payment-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.pill-btn {
  min-height: 40px;
  border-radius: 999px;
  padding: 0 16px;
  background: #f3f6fb;
  color: var(--brand-dark);
  font-weight: 700;
}

.pill-btn.danger {
  color: #dc2626;
}

.empty {
  margin: 40px auto;
  text-align: center;
  color: #94a3b8;
  font-size: 15px;
}

.drawer-mask,
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  z-index: 45;
  display: none;
}

.drawer-mask.show,
.sheet-mask.show {
  display: block;
}

.drawer {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: min(320px, 82vw);
  transform: translateX(-215px);
  background: #fff;
  padding: calc(22px + env(safe-area-inset-top)) 18px 22px;
  box-shadow: 16px 0 30px rgba(15, 23, 42, 0.18);
}

.drawer h3 {
  margin: 0 0 16px;
}

.drawer button {
  width: 100%;
  min-height: 46px;
  text-align: left;
  border-bottom: 1px solid #eef2f7;
  color: #1f2937;
}

.sheet {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(100vw, 430px);
  transform: translateX(-50%);
  max-height: 88vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  background: #fff;
  padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
}

.sheet h2 {
  margin: 0 0 8px;
  text-align: center;
}

.sheet-sub {
  margin: 0 0 24px;
  color: #64748b;
}

.type-switch {
  display: flex;
  gap: 10px;
}

.type-switch button {
  min-width: 78px;
  min-height: 42px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  color: #334155;
}

.type-switch button.active {
  border-color: var(--brand);
  color: var(--brand);
  background: #eff6ff;
}

.upload-box {
  min-height: 132px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #94a3b8;
  overflow: hidden;
  background: #fff;
}

.upload-box img {
  width: 100%;
  max-height: 220px;
  object-fit: contain;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  transform: translateX(-50%) translateY(20px);
  min-width: 160px;
  max-width: min(86vw, 360px);
  padding: 11px 14px;
  background: rgba(15, 23, 42, 0.88);
  color: #fff;
  border-radius: 999px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.18s ease;
  z-index: 80;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.muted {
  color: var(--muted);
}

.danger-text {
  color: var(--danger);
}

.nowrap {
  white-space: nowrap;
}

@media (min-width: 700px) {
  body {
    background:
      radial-gradient(circle at 20% 0, rgba(14, 165, 233, 0.18), transparent 30%),
      linear-gradient(135deg, #e2e8f0, #f8fafc);
  }

  .phone {
    box-shadow: 0 30px 80px rgba(15, 23, 42, 0.16);
  }

  .drawer {
    transform: translateX(-215px);
  }
}
