/* =====================================================================
   H5（微信服务号 / 企业微信内置浏览器）响应式样式
   适配 320px - 768px，竖屏触控优先
   ===================================================================== */

html,
body {
  min-height: 100%;
}

body.h5-body {
  background: #e7ecee;
  overscroll-behavior-y: none;
}

.h5-app {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  margin: 0 auto;
  background: var(--m-bg);
  box-shadow: 0 0 60px rgba(20, 26, 33, 0.12);
  overflow-x: hidden;
}

.h5-page {
  min-height: 100vh;
  padding-bottom: calc(86px + env(safe-area-inset-bottom));
  animation: h5-in 0.28s var(--m-ease);
}
@keyframes h5-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------------------------------------------------------------------
   Top bar
   --------------------------------------------------------------------- */
.h5-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 6px;
}
.h5-brand {
  display: flex;
  align-items: center;
  gap: 9px;
}
.h5-brand img {
  width: 30px;
  height: 30px;
  border-radius: 9px;
}
.h5-brand-name {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.h5-brand-sub {
  display: block;
  margin-top: 1px;
  color: var(--m-text-disabled);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.14em;
}
.h5-topbar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.h5-topbar .m-icon-btn {
  width: 34px;
  height: 34px;
}

/* ---------------------------------------------------------------------
   Greeting + hero
   --------------------------------------------------------------------- */
.h5-hello {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px 16px;
}
.h5-hello h1 {
  font-size: 22px;
  letter-spacing: -0.035em;
}
.h5-hello .sub {
  margin-top: 5px;
  color: var(--m-text-secondary);
  font-size: 11.5px;
}
.h5-hello .date {
  color: var(--m-text-disabled);
  font-size: 10px;
  font-weight: 600;
  white-space: nowrap;
}
.h5-avatar-btn {
  border: 0;
  background: none;
  padding: 0;
}

.h5-hero {
  position: relative;
  overflow: hidden;
  margin: 0 14px;
  padding: 21px 20px;
  border-radius: 22px;
  background: linear-gradient(125deg, #092b24 0%, #0a4d3d 52%, #00856d 100%);
  color: #fff;
  box-shadow: 0 18px 36px -22px rgba(0, 75, 80, 0.65);
  isolation: isolate;
}
.h5-hero::before {
  content: '';
  position: absolute;
  right: -70px;
  top: -120px;
  z-index: -1;
  width: 260px;
  height: 260px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.04), 0 0 0 64px rgba(255, 255, 255, 0.025);
}
.h5-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.h5-hero-label {
  color: rgba(255, 255, 255, 0.56);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.h5-hero-period {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-size: 9.5px;
}
.h5-hero-value {
  margin-top: 8px;
  font-size: 33px;
  font-weight: 700;
  letter-spacing: -0.045em;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.h5-hero-value .cny {
  margin-right: 2px;
  font-size: 16px;
  font-weight: 500;
  opacity: 0.7;
}
.h5-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.h5-hero-stat .label {
  color: rgba(255, 255, 255, 0.48);
  font-size: 9.5px;
}
.h5-hero-stat .value {
  margin-top: 3px;
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.h5-hero-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 16px;
  padding: 10px 12px;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.09);
  color: rgba(255, 255, 255, 0.78);
  font-size: 10.5px;
}
.h5-hero-cta button {
  display: inline-flex;
  height: 26px;
  align-items: center;
  gap: 3px;
  padding: 0 9px;
  border: 0;
  border-radius: 99px;
  background: #fff;
  color: #00594b;
  font-size: 9.5px;
  font-weight: 700;
}

/* ---------------------------------------------------------------------
   Quick actions
   --------------------------------------------------------------------- */
.h5-quick {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  margin: 14px;
  padding: 16px 8px;
  border: 1px solid var(--m-border);
  border-radius: 18px;
  background: var(--m-paper);
}
.h5-quick-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  border: 0;
  background: none;
  padding: 0;
  color: var(--m-text);
  font-size: 10.5px;
  font-weight: 600;
}
.h5-quick-icon {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
  transition: transform 0.15s var(--m-ease);
}
[data-theme='dark'] .h5-quick-icon {
  color: var(--m-primary-light);
}
.h5-quick-btn:active .h5-quick-icon {
  transform: scale(0.94);
}
.h5-quick-btn:nth-child(2) .h5-quick-icon {
  background: rgba(0, 184, 217, 0.11);
  color: #006c9c;
}
.h5-quick-btn:nth-child(3) .h5-quick-icon {
  background: rgba(255, 171, 0, 0.12);
  color: #b76e00;
}
.h5-quick-btn:nth-child(4) .h5-quick-icon {
  background: rgba(142, 51, 255, 0.1);
  color: #6a1fd0;
}
[data-theme='dark'] .h5-quick-btn:nth-child(2) .h5-quick-icon {
  color: #61f3f3;
}
[data-theme='dark'] .h5-quick-btn:nth-child(3) .h5-quick-icon {
  color: #ffd666;
}
[data-theme='dark'] .h5-quick-btn:nth-child(4) .h5-quick-icon {
  color: #c684ff;
}

/* ---------------------------------------------------------------------
   Sections and cards
   --------------------------------------------------------------------- */
.h5-section {
  margin: 18px 14px 0;
}
.h5-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 9px;
  padding: 0 4px;
}
.h5-section-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--m-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.h5-section-title .m-icon {
  color: var(--m-text-disabled);
}
.h5-section-more {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  border: 0;
  background: none;
  color: var(--m-text-secondary);
  font-size: 10.5px;
}
.h5-card {
  border: 1px solid var(--m-border);
  border-radius: 18px;
  background: var(--m-paper);
  box-shadow: var(--m-shadow-xs);
}
.h5-card-pad {
  padding: 16px;
}
.h5-task-empty {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 16px;
}
.h5-task-icon {
  display: flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: var(--m-primary-soft);
  color: var(--m-primary);
}
.h5-task-copy {
  flex: 1;
}
.h5-task-title {
  color: var(--m-text);
  font-size: 12px;
  font-weight: 700;
}
.h5-task-desc {
  margin-top: 3px;
  color: var(--m-text-disabled);
  font-size: 10px;
  line-height: 1.55;
}
.h5-task-arrow {
  color: var(--m-text-disabled);
}

.h5-budget {
  padding: 16px;
}
.h5-budget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.h5-budget-title {
  color: var(--m-text);
  font-size: 12px;
  font-weight: 700;
}
.h5-budget-rate {
  color: var(--m-primary);
  font-size: 14px;
  font-weight: 700;
}
.h5-budget-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--m-text-disabled);
  font-size: 9.5px;
}
.h5-budget-bar {
  margin-top: 12px;
}

.h5-service-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.h5-service {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--m-border);
  border-radius: 14px;
  background: var(--m-paper);
  text-align: left;
}
.h5-service-icon {
  display: flex;
  width: 32px;
  height: 32px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--m-grey-100);
  color: var(--m-text-secondary);
}
[data-theme='dark'] .h5-service-icon {
  background: #28323d;
}
.h5-service-copy {
  display: block;
  min-width: 0;
  flex: 1;
}
.h5-service-title {
  display: block;
  overflow: hidden;
  color: var(--m-text);
  font-size: 11.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h5-service-sub {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--m-text-disabled);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.h5-service .m-icon:last-child {
  color: var(--m-text-disabled);
}

/* ---------------------------------------------------------------------
   Bottom tabbar
   --------------------------------------------------------------------- */
.h5-tabbar {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 80;
  display: grid;
  width: 100%;
  max-width: 560px;
  grid-template-columns: repeat(4, 1fr);
  padding: 7px 10px calc(7px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--m-border);
  background: color-mix(in srgb, var(--m-paper) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.15);
  transform: translateX(-50%);
}
.h5-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--m-text-disabled);
  font-size: 9px;
  font-weight: 600;
  transition: color 0.16s var(--m-ease);
}
.h5-tab .m-icon {
  width: 21px;
  height: 21px;
}
.h5-tab.is-active {
  color: var(--m-primary);
}
.h5-tab.is-active .m-icon {
  filter: drop-shadow(0 3px 6px rgba(0, 167, 111, 0.28));
}

/* ---------------------------------------------------------------------
   Inner page headers
   --------------------------------------------------------------------- */
.h5-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px 10px;
}
.h5-page-head h1 {
  font-size: 22px;
  letter-spacing: -0.035em;
}
.h5-page-head .sub {
  margin-top: 4px;
  color: var(--m-text-secondary);
  font-size: 10.5px;
}
.h5-segmented {
  display: flex;
  gap: 4px;
  margin: 4px 14px 0;
  padding: 3px;
  border-radius: 11px;
  background: var(--m-grey-200);
}
[data-theme='dark'] .h5-segmented {
  background: #28323d;
}
.h5-segmented button {
  flex: 1;
  height: 32px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--m-text-secondary);
  font-size: 11px;
  font-weight: 600;
}
.h5-segmented button.is-active {
  background: var(--m-paper);
  color: var(--m-text);
  box-shadow: var(--m-shadow-xs);
}
.h5-list {
  margin-top: 12px;
  overflow: hidden;
  border: 1px solid var(--m-border);
  border-radius: 16px;
  background: var(--m-paper);
}
.h5-list-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 15px;
  border-bottom: 1px solid var(--m-divider);
}
.h5-list-item:last-child {
  border-bottom: 0;
}
.h5-list-icon {
  display: flex;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: var(--m-grey-100);
  color: var(--m-text-secondary);
}
[data-theme='dark'] .h5-list-icon {
  background: #28323d;
}
.h5-list-copy {
  min-width: 0;
  flex: 1;
}
.h5-list-title {
  color: var(--m-text);
  font-size: 12px;
  font-weight: 600;
}
.h5-list-sub {
  margin-top: 2px;
  color: var(--m-text-disabled);
  font-size: 9.5px;
}
.h5-list-value {
  color: var(--m-text-secondary);
  font-size: 10px;
}
.h5-list-item .m-icon:last-child {
  color: var(--m-text-disabled);
}

/* ---------------------------------------------------------------------
   Empty state in H5
   --------------------------------------------------------------------- */
.h5-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 38px 20px;
  text-align: center;
}
.h5-empty-icon {
  display: flex;
  width: 58px;
  height: 58px;
  align-items: center;
  justify-content: center;
  border-radius: 19px;
  background: var(--m-primary-soft);
  color: var(--m-primary);
}
.h5-empty h3 {
  margin-top: 14px;
  font-size: 13px;
}
.h5-empty p {
  max-width: 250px;
  margin-top: 5px;
  color: var(--m-text-secondary);
  font-size: 10.5px;
  line-height: 1.7;
}
.h5-empty .m-btn {
  margin-top: 15px;
}

/* ---------------------------------------------------------------------
   Approvals
   --------------------------------------------------------------------- */
.h5-approval-card {
  padding: 15px;
  border: 1px solid var(--m-border);
  border-radius: 16px;
  background: var(--m-paper);
}
.h5-approval-top {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}
.h5-approval-title {
  flex: 1;
  color: var(--m-text);
  font-size: 12.5px;
  font-weight: 700;
}
.h5-approval-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 9px;
  color: var(--m-text-disabled);
  font-size: 9.5px;
}
.h5-approval-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px dashed var(--m-divider);
}
.h5-approval-amount {
  color: var(--m-text);
  font-size: 16px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------------------------------------------------------------------
   Invoice pool
   --------------------------------------------------------------------- */
.h5-scan-card {
  position: relative;
  overflow: hidden;
  margin: 4px 14px 0;
  padding: 22px;
  border: 1px dashed rgba(0, 167, 111, 0.36);
  border-radius: 18px;
  background: linear-gradient(135deg, var(--m-primary-soft), rgba(0, 184, 217, 0.05));
  text-align: center;
}
.h5-scan-card::after {
  content: '';
  position: absolute;
  left: 10%;
  right: 10%;
  top: 24px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--m-primary), transparent);
  opacity: 0.28;
  animation: h5-scan 3s ease-in-out infinite;
}
@keyframes h5-scan {
  0%, 100% { transform: translateY(0); opacity: 0.12; }
  50% { transform: translateY(82px); opacity: 0.38; }
}
.h5-scan-icon {
  display: flex;
  width: 54px;
  height: 54px;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  border-radius: 17px;
  background: var(--m-paper);
  color: var(--m-primary);
  box-shadow: var(--m-shadow-sm);
}
.h5-scan-title {
  margin-top: 12px;
  color: var(--m-text);
  font-size: 13px;
  font-weight: 700;
}
.h5-scan-desc {
  margin-top: 4px;
  color: var(--m-text-secondary);
  font-size: 10px;
}
.h5-scan-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 14px;
}
.h5-invoice-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin: 14px;
  overflow: hidden;
  border: 1px solid var(--m-border);
  border-radius: 16px;
  background: var(--m-paper);
}
.h5-invoice-stat {
  padding: 14px 8px;
  text-align: center;
}
.h5-invoice-stat + .h5-invoice-stat {
  border-left: 1px solid var(--m-divider);
}
.h5-invoice-stat strong {
  display: block;
  color: var(--m-text);
  font-size: 19px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.h5-invoice-stat span {
  display: block;
  margin-top: 2px;
  color: var(--m-text-disabled);
  font-size: 9px;
}

/* ---------------------------------------------------------------------
   Profile
   --------------------------------------------------------------------- */
.h5-profile-hero {
  position: relative;
  overflow: hidden;
  margin: 4px 14px 0;
  padding: 22px 20px;
  border-radius: 22px;
  background: linear-gradient(125deg, #092b24 0%, #0a4d3d 55%, #00856d 100%);
  color: #fff;
}
.h5-profile-hero::after {
  content: '';
  position: absolute;
  right: -46px;
  top: -56px;
  width: 170px;
  height: 170px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.035);
}
.h5-profile-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 13px;
}
.h5-profile-main .m-avatar {
  border: 2px solid rgba(255, 255, 255, 0.35);
}
.h5-profile-name {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.h5-profile-role {
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.56);
  font-size: 10px;
}
.h5-profile-badges {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 17px;
}
.h5-profile-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.72);
  font-size: 9px;
}
.h5-profile-section {
  margin: 14px 14px 0;
}
.h5-profile-card {
  overflow: hidden;
  border: 1px solid var(--m-border);
  border-radius: 16px;
  background: var(--m-paper);
}
.h5-profile-row {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 14px 15px;
  border: 0;
  border-bottom: 1px solid var(--m-divider);
  background: transparent;
  text-align: left;
}
.h5-profile-row:last-child {
  border-bottom: 0;
}
.h5-profile-row .m-icon:last-child {
  margin-left: auto;
  color: var(--m-text-disabled);
}
.h5-profile-row-label {
  flex: 1;
  color: var(--m-text);
  font-size: 12px;
  font-weight: 500;
}
.h5-profile-row-value {
  color: var(--m-text-disabled);
  font-size: 10px;
}
.h5-logout {
  margin: 18px 14px 0;
}
.h5-logout .m-btn {
  color: var(--m-error);
}

/* ---------------------------------------------------------------------
   Login
   --------------------------------------------------------------------- */
.h5-login {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
  background: var(--m-bg);
}
.h5-login-hero {
  position: relative;
  overflow: hidden;
  padding: 54px 26px 72px;
  border-radius: 0 0 34px 34px;
  background: linear-gradient(140deg, #08241e 0%, #0a4d3d 55%, #00856d 100%);
  color: #fff;
  isolation: isolate;
}
.h5-login-hero::before {
  content: '';
  position: absolute;
  right: -80px;
  top: -110px;
  z-index: -1;
  width: 280px;
  height: 280px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  box-shadow: 0 0 0 38px rgba(255, 255, 255, 0.04), 0 0 0 80px rgba(255, 255, 255, 0.022);
}
.h5-login-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.h5-login-brand img {
  width: 38px;
  height: 38px;
}
.h5-login-brand strong {
  display: block;
  font-size: 17px;
}
.h5-login-brand span {
  display: block;
  margin-top: 1px;
  color: rgba(255, 255, 255, 0.45);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.16em;
}
.h5-login-title {
  max-width: 300px;
  margin-top: 34px;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: -0.04em;
}
.h5-login-title .accent {
  color: #77ed8b;
}
.h5-login-desc {
  max-width: 310px;
  margin-top: 10px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 11px;
  line-height: 1.75;
}
.h5-login-card {
  position: relative;
  z-index: 2;
  margin: -44px 16px 0;
  padding: 24px 20px;
  border: 1px solid var(--m-border);
  border-radius: 22px;
  background: var(--m-paper);
  box-shadow: var(--m-shadow-md);
}
.h5-login-card h2 {
  font-size: 20px;
  letter-spacing: -0.03em;
}
.h5-login-card p {
  margin-top: 4px;
  color: var(--m-text-secondary);
  font-size: 10.5px;
}
.h5-login-form {
  display: flex;
  flex-direction: column;
  gap: 13px;
  margin-top: 20px;
}
.h5-login-form .m-input {
  min-height: 46px;
}
.h5-login-form .m-btn {
  height: 46px;
  border-radius: 11px;
}
.h5-login-error {
  display: none;
  align-items: flex-start;
  gap: 7px;
  padding: 9px 11px;
  border-radius: 8px;
  background: rgba(255, 86, 48, 0.08);
  color: #b71d18;
  font-size: 10.5px;
}
.h5-login-error.is-visible {
  display: flex;
}
.h5-login-hint {
  margin-top: 16px;
  padding: 10px 11px;
  border: 1px dashed var(--m-border-strong);
  border-radius: 9px;
  color: var(--m-text-secondary);
  font-size: 9.5px;
  line-height: 1.7;
}
.h5-login-hint code {
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--m-primary-soft);
  color: var(--m-primary-dark);
  font-family: var(--m-mono);
  font-size: 9px;
}
.h5-login-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 22px 20px 30px;
  color: var(--m-text-disabled);
  font-size: 9px;
  text-align: center;
}

/* ---------------------------------------------------------------------
   Action sheet
   --------------------------------------------------------------------- */
.h5-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 1002;
  width: 100%;
  max-width: 560px;
  padding: 8px 14px calc(16px + env(safe-area-inset-bottom));
  border-radius: 24px 24px 0 0;
  background: var(--m-paper);
  box-shadow: var(--m-shadow-lg);
  transform: translateX(-50%);
  animation: h5-sheet-in 0.24s var(--m-ease);
}
@keyframes h5-sheet-in {
  from { transform: translate(-50%, 100%); }
  to { transform: translate(-50%, 0); }
}
.h5-sheet-handle {
  width: 34px;
  height: 4px;
  margin: 0 auto 12px;
  border-radius: 99px;
  background: var(--m-grey-300);
}
.h5-sheet-title {
  padding: 0 4px 8px;
  color: var(--m-text-secondary);
  font-size: 10.5px;
  text-align: center;
}
.h5-sheet-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 12px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  text-align: left;
}
.h5-sheet-item:active {
  background: var(--m-grey-100);
}
.h5-sheet-item .m-icon:last-child {
  margin-left: auto;
  color: var(--m-text-disabled);
}
.h5-sheet-item strong {
  display: block;
  color: var(--m-text);
  font-size: 12px;
}
.h5-sheet-item small {
  display: block;
  margin-top: 1px;
  color: var(--m-text-disabled);
  font-size: 9.5px;
}

/* ---------------------------------------------------------------------
   Desktop preview / tablets
   --------------------------------------------------------------------- */
@media (min-width: 768px) {
  body.h5-body {
    background: radial-gradient(circle at 20% 0%, #d8e3e0, #edf1f2 55%);
  }
  .h5-app {
    min-height: calc(100vh - 32px);
    margin: 16px auto;
    border-radius: 26px;
    overflow: hidden;
  }
  .h5-tabbar {
    bottom: 16px;
    border-radius: 0 0 26px 26px;
  }
  .h5-login {
    min-height: calc(100vh - 32px);
  }
}

@media (max-width: 360px) {
  .h5-hero {
    margin: 0 10px;
    padding: 18px 16px;
  }
  .h5-hero-value {
    font-size: 29px;
  }
  .h5-quick {
    margin: 12px 10px;
    padding: 14px 5px;
  }
  .h5-quick-icon {
    width: 38px;
    height: 38px;
  }
  .h5-section,
  .h5-profile-section {
    margin-left: 10px;
    margin-right: 10px;
  }
  .h5-login-card {
    margin-left: 12px;
    margin-right: 12px;
    padding: 20px 16px;
  }
  .h5-page-head {
    padding-left: 14px;
    padding-right: 14px;
  }
  .h5-hello {
    padding-left: 14px;
    padding-right: 14px;
  }
}

/* H5 资金明细 */
.h5-fund-row, .h5-journal-row { display: flex; align-items: center; gap: 10px; padding: 12px 0; }
.h5-fund-row + .h5-fund-row, .h5-journal-row + .h5-journal-row { border-top: 1px solid var(--m-border); }
.h5-fund-icon { width: 32px; height: 32px; border-radius: 9px; background: var(--m-primary-soft); color: var(--m-primary); display: inline-flex; align-items: center; justify-content: center; flex: none; }
.h5-fund-copy { min-width: 0; flex: 1; }
.h5-fund-name { font-size: 12px; font-weight: 600; color: var(--m-text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-fund-sub { margin-top: 2px; font-size: 9.5px; color: var(--m-text-disabled); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.h5-fund-amount { flex: none; font-family: var(--m-font-mono, monospace); font-size: 12px; font-weight: 600; color: var(--m-text); }
.h5-journal-amount { flex: none; text-align: right; display: flex; flex-direction: column; gap: 2px; }
.h5-journal-amount strong { font-family: var(--m-font-mono, monospace); font-size: 12px; }
.h5-journal-amount span { color: var(--m-text-disabled); font-size: 9.5px; }

/* H5 审批 / 票夹阶段三 */
.h5-approval-list, .h5-invoice-list { display: flex; flex-direction: column; gap: 9px; }
.h5-approval-card, .h5-invoice-card { background: var(--m-paper); border: 1px solid var(--m-border); border-radius: 12px; padding: 13px 14px; box-shadow: var(--m-shadow-xs); }
.h5-approval-head, .h5-invoice-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.h5-approval-type { font-family: var(--m-font-mono, monospace); font-size: 9.5px; color: var(--m-text-secondary); }
.h5-approval-title { margin-top: 8px; font-size: 13px; font-weight: 600; color: var(--m-text); line-height: 1.45; }
.h5-approval-meta { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; color: var(--m-text-disabled); font-size: 9.5px; }
.h5-approval-foot { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 10px; padding-top: 9px; border-top: 1px dashed var(--m-border); }
.h5-approval-foot strong { font-family: var(--m-font-mono, monospace); font-size: 15px; color: var(--m-text); }
.h5-approval-foot span { color: var(--m-text-disabled); font-size: 9px; }
.h5-approval-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 10px; }
.h5-approval-types { display: flex; flex-direction: column; gap: 7px; }
.h5-approval-detail { display: flex; flex-direction: column; gap: 10px; }
.h5-approval-timeline { display: flex; flex-direction: column; gap: 9px; padding-top: 4px; }
.h5-approval-step { display: flex; gap: 9px; }
.h5-approval-step > span { width: 7px; height: 7px; margin-top: 5px; border-radius: 50%; background: var(--m-primary); flex: none; }
.h5-approval-step strong { display: block; font-size: 11px; }
.h5-approval-step em { display: block; margin-top: 2px; font-style: normal; font-size: 9px; color: var(--m-text-disabled); }
.h5-approval-step p { margin: 4px 0 0; font-size: 10px; color: var(--m-text-secondary); }
.h5-invoice-seller { margin-top: 8px; font-size: 12px; font-weight: 600; color: var(--m-text); }
.h5-invoice-card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; }
.h5-invoice-card-foot span { font-size: 9.5px; color: var(--m-text-disabled); }
.h5-invoice-card-foot strong { font-family: var(--m-font-mono, monospace); font-size: 15px; }
.h5-invoice-card-actions { display: flex; justify-content: flex-end; gap: 6px; margin-top: 8px; }
.h5-invoice-detail-rows { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 9px; }
.h5-invoice-detail-rows > div { background: var(--m-surface-muted); border-radius: 7px; padding: 8px 9px; }
.h5-invoice-detail-rows span { display: block; color: var(--m-text-disabled); font-size: 9px; }
.h5-invoice-detail-rows strong { display: block; margin-top: 3px; font-family: var(--m-font-mono, monospace); font-size: 11px; }
:root { --m-warning-soft: rgba(255, 171, 0, 0.12); --m-info-soft: rgba(0, 184, 217, 0.12); --m-font-mono: 'SFMono-Regular','Cascadia Code',Consolas,monospace; }
.h5-budget-row { padding: 11px 0; border-bottom: 1px solid var(--m-border); }
.h5-budget-row:last-child { border-bottom: 0; }
.h5-budget-row-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.h5-budget-row-head strong { display: block; font-size: 11.5px; color: var(--m-text); }
.h5-budget-row-head span { display: block; margin-top: 2px; font-size: 9px; color: var(--m-text-disabled); }
.h5-budget-row-head em { font-style: normal; font-family: var(--m-font-mono, monospace); font-size: 12px; font-weight: 600; }
.h5-budget-bar { height: 5px; border-radius: 3px; background: var(--m-surface-muted); margin-top: 8px; overflow: hidden; }
.h5-budget-bar i { display: block; height: 100%; border-radius: 3px; background: var(--m-primary); }
.h5-budget-row-foot { display: flex; justify-content: space-between; gap: 6px; margin-top: 5px; font-size: 8.5px; color: var(--m-text-disabled); }
.h5-simple-list { display: flex; flex-direction: column; gap: 8px; }
.h5-simple-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 12px; border: 1px solid var(--m-border); border-radius: 9px; background: var(--m-paper); }
.h5-simple-row strong { display: block; font-size: 12px; color: var(--m-text); }
.h5-simple-row span { display: block; margin-top: 3px; font-size: 9px; color: var(--m-text-disabled); }
.h5-simple-amount { text-align: right; font-family: var(--m-font-mono); font-size: 12px; font-weight: 700; color: var(--m-text); white-space: nowrap; }
.h5-simple-amount small { display: block; margin-top: 3px; font-family: inherit; font-size: 9px; font-weight: 400; color: var(--m-text-secondary); }
.h5-notification-row { position: relative; display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 11px 12px; border: 1px solid var(--m-border); border-radius: 9px; background: var(--m-paper); text-align: left; font-family: inherit; }
.h5-notification-row.is-unread { border-color: color-mix(in srgb, var(--m-primary) 20%, var(--m-border)); background: var(--m-primary-soft); }
.h5-notification-row strong { display: block; font-size: 11.5px; color: var(--m-text); }
.h5-notification-row span { display: block; margin-top: 3px; font-size: 10px; line-height: 1.55; color: var(--m-text-secondary); }
.h5-notification-row small { display: block; margin-top: 4px; font-family: var(--m-font-mono); font-size: 8.5px; color: var(--m-text-disabled); }
.h5-notification-row .notification-unread-dot { position: absolute; top: 12px; right: 10px; width: 5px; height: 5px; border-radius: 50%; background: var(--m-primary); }
