/* Apple HIG mobile经营首页; hidden on desktop so the existing Vue views are unchanged. */
.wx-mobile-home,
.wx-mobile-bottom-nav,
.wx-mobile-drawer,
.wx-mobile-toast {
  display: none;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 680px) {
  body.wx-mobile-drawer-open {
    overflow: hidden;
  }

  .app-shell.wx-mobile-enhanced {
    display: block;
    min-height: 100vh;
    padding-bottom: calc(80px + env(safe-area-inset-bottom));
  }

  .app-shell.wx-mobile-enhanced .mobile-nav {
    display: none !important;
  }

  .app-shell.wx-mobile-home-active .main-area > :not(.topbar):not(.wx-mobile-home) {
    display: none !important;
  }

  .app-shell.wx-mobile-enhanced:not(.wx-mobile-home-active) .wx-mobile-home {
    display: none;
  }

  .app-shell.wx-mobile-home-active .wx-mobile-home {
    display: block;
  }

  .wx-mobile-home {
    width: 100%;
    max-width: 680px;
    min-height: calc(100vh - 75px);
    margin: 0 auto;
    padding: 18px 14px calc(98px + env(safe-area-inset-bottom));
    color: #18343e;
  }

  .wx-mobile-home-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 14px;
  }

  .wx-mobile-home-header h1,
  .wx-mobile-section h2,
  .wx-mobile-quick-card h2,
  .wx-mobile-drawer-panel h2 {
    margin: 0;
    color: var(--ink, #18343e);
    letter-spacing: -0.045em;
  }

  .wx-mobile-home-header h1 {
    margin-top: 3px;
    font-size: clamp(28px, 8vw, 36px);
    line-height: 1.1;
  }

  .wx-mobile-home-header p:last-child,
  .wx-mobile-quick-card p,
  .wx-mobile-locked-section p,
  .wx-mobile-data-note,
  .wx-mobile-chart-note,
  .wx-mobile-error-card p,
  .wx-mobile-drawer-panel p {
    margin: 7px 0 0;
    color: #6f858b;
    font-size: 12px;
    line-height: 1.5;
  }

  .wx-mobile-eyebrow {
    margin: 0;
    color: var(--wx-season-accent, #2b9b8d);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.18em;
  }

  .wx-mobile-refresh,
  .wx-mobile-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    border: 1px solid var(--wx-season-line, #dcefed);
    border-radius: 16px;
    color: var(--wx-season-accent, #2b9b8d);
    background: rgba(255, 255, 255, 0.62);
    font-size: 22px;
    line-height: 1;
    box-shadow: 0 8px 24px rgba(54, 91, 96, 0.08);
  }

  .wx-mobile-refresh:active,
  .wx-mobile-quick-button:active,
  .wx-mobile-save-button:active,
  .wx-mobile-nav-button:active {
    transform: scale(0.97);
  }

  .wx-mobile-section,
  .wx-mobile-quick-card,
  .wx-mobile-locked-section,
  .wx-mobile-error-card,
  .wx-mobile-loading-card {
    margin-top: 12px;
    border: 1px solid rgba(231, 241, 239, 0.92);
    border-radius: 24px;
    background: var(--wx-season-surface, rgba(255, 255, 255, 0.88));
    box-shadow: 0 15px 40px rgba(57, 89, 95, 0.09);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .wx-mobile-section {
    padding: 18px 14px;
  }

  .wx-mobile-section-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 13px;
  }

  .wx-mobile-section h2,
  .wx-mobile-quick-card h2 {
    margin-top: 3px;
    font-size: 20px;
    line-height: 1.15;
  }

  .wx-mobile-range {
    flex: 0 0 auto;
    margin-top: 4px;
    color: #82959a;
    font-size: 10px;
    white-space: nowrap;
  }

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

  .wx-mobile-stat-card {
    display: grid;
    gap: 7px;
    min-width: 0;
    padding: 13px 12px;
    border: 1px solid rgba(232, 240, 238, 0.9);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.56);
  }

  .wx-mobile-stat-card span {
    color: #7b9095;
    font-size: 11px;
  }

  .wx-mobile-stat-card strong {
    overflow: hidden;
    color: #26434b;
    font-size: clamp(15px, 4.2vw, 20px);
    letter-spacing: -0.04em;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wx-mobile-stat-card.is-income strong {
    color: #16805d;
  }

  .wx-mobile-stat-card.is-expense strong {
    color: #c86c2e;
  }

  .wx-mobile-stat-card.is-loss strong {
    color: #c54754;
  }

  .wx-mobile-chart {
    margin-top: 15px;
    padding: 12px 10px 10px;
    border: 1px solid rgba(232, 240, 238, 0.82);
    border-radius: 19px;
    background: rgba(255, 255, 255, 0.46);
  }

  .wx-mobile-chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: #71868b;
    font-size: 10px;
  }

  .wx-mobile-chart-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }

  .wx-mobile-chart-legend i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
  }

  .wx-mobile-chart-legend .income,
  .wx-mobile-bar-income {
    background: #16805d;
  }

  .wx-mobile-chart-legend .expense,
  .wx-mobile-bar-expense {
    background: #c86c2e;
  }

  .wx-mobile-chart-legend .loss,
  .wx-mobile-bar-loss {
    background: #c54754;
  }

  .wx-mobile-week-bars {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: end;
    gap: 4px;
    min-height: 150px;
    margin-top: 12px;
  }

  .wx-mobile-day {
    display: grid;
    min-width: 0;
    text-align: center;
  }

  .wx-mobile-day-values {
    display: grid;
    min-height: 38px;
    color: #87999d;
    font-size: 7px;
    line-height: 1.25;
  }

  .wx-mobile-bars {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 2px;
    height: 104px;
    padding: 0 2px;
    border-bottom: 1px solid #dfe9e7;
  }

  .wx-mobile-bar {
    display: block;
    width: calc(33.333% - 2px);
    min-height: 3px;
    border-radius: 5px 5px 0 0;
  }

  .wx-mobile-day-label {
    display: block;
    margin-top: 7px;
    color: #71858a;
    font-size: 9px;
  }

  .wx-mobile-chart-note {
    margin-top: 10px;
    text-align: right;
    font-size: 10px;
  }

  .wx-mobile-data-note {
    margin-top: 12px;
    text-align: right;
    font-size: 10px;
  }

  .wx-mobile-quick-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 17px 14px;
    border-color: rgba(171, 226, 216, 0.94);
    background: linear-gradient(135deg, rgba(231, 250, 245, 0.94), rgba(255, 255, 255, 0.82));
  }

  .wx-mobile-quick-card h2 {
    color: #196f68;
  }

  .wx-mobile-quick-button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-width: 112px;
    min-height: 66px;
    padding: 7px 10px;
    border: 0;
    border-radius: 18px;
    color: #fff;
    background: linear-gradient(135deg, #65d2c6, #36aa9b);
    box-shadow: 0 12px 20px rgba(50, 159, 145, 0.21);
    font-weight: 800;
  }

  .wx-mobile-quick-button > :first-child {
    font-size: 24px;
    line-height: 1;
  }

  .wx-mobile-quick-button span {
    font-size: 11px;
    white-space: nowrap;
  }

  .wx-mobile-locked-section,
  .wx-mobile-error-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 14px;
  }

  .wx-mobile-locked-icon,
  .wx-mobile-error-icon {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    border-radius: 14px;
    color: #7b9196;
    background: #edf4f3;
    font-size: 20px;
  }

  .wx-mobile-locked-section strong,
  .wx-mobile-error-card strong {
    color: #405a62;
    font-size: 14px;
  }

  .wx-mobile-error-card {
    border-color: #f0d8d4;
    background: rgba(255, 248, 247, 0.88);
  }

  .wx-mobile-error-icon {
    color: #c54754;
    background: #fde8e7;
  }

  .wx-mobile-retry {
    min-height: 40px;
    margin-left: auto;
    padding: 0 12px;
    border: 1px solid #e7b8b3;
    border-radius: 13px;
    color: #b33f4b;
    background: #fff;
    font-size: 11px;
    font-weight: 800;
  }

  .wx-mobile-loading-card {
    display: grid;
    place-items: center;
    gap: 10px;
    min-height: 160px;
    color: #7b9095;
    font-size: 12px;
  }

  .wx-mobile-spinner {
    width: 25px;
    height: 25px;
    border: 3px solid #d9e8e7;
    border-top-color: var(--wx-season-accent, #35ab9b);
    border-radius: 50%;
    animation: wx-mobile-spin 0.8s linear infinite;
  }

  @keyframes wx-mobile-spin {
    to { transform: rotate(360deg); }
  }

  .wx-mobile-empty {
    padding: 18px 4px 7px;
    color: #819499;
    font-size: 12px;
    text-align: center;
  }

  .wx-mobile-entry-list {
    display: grid;
    gap: 6px;
    padding: 0;
    margin: 0;
    list-style: none;
  }

  .wx-mobile-entry-row {
    display: flex;
    align-items: center;
    gap: 9px;
    min-width: 0;
    padding: 9px 4px;
    border-bottom: 1px solid rgba(231, 240, 238, 0.8);
  }

  .wx-mobile-entry-row:last-child {
    border-bottom: 0;
  }

  .wx-mobile-entry-icon {
    display: grid;
    place-items: center;
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 800;
  }

  .wx-mobile-entry-icon.is-positive {
    color: #16805d;
    background: #e0f4eb;
  }

  .wx-mobile-entry-icon.is-orange {
    color: #c86c2e;
    background: #fff0e2;
  }

  .wx-mobile-entry-icon.is-negative {
    color: #c54754;
    background: #fde7e9;
  }

  .wx-mobile-entry-copy {
    display: grid;
    min-width: 0;
    flex: 1;
    gap: 3px;
  }

  .wx-mobile-entry-copy strong {
    overflow: hidden;
    color: #34525b;
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wx-mobile-entry-copy small {
    overflow: hidden;
    color: #8b9da1;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .wx-mobile-entry-amount {
    flex: 0 0 auto;
    font-size: 11px;
    white-space: nowrap;
  }

  .wx-mobile-entry-amount.is-positive { color: #16805d; }
  .wx-mobile-entry-amount.is-orange { color: #c86c2e; }
  .wx-mobile-entry-amount.is-negative { color: #c54754; }

  .wx-mobile-bottom-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: repeat(4, 1fr);
    gap: 3px;
    padding: 8px 12px max(8px, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(218, 235, 234, 0.9);
    background: rgba(255, 255, 255, 0.86);
    box-shadow: 0 -8px 25px rgba(23, 48, 66, 0.08);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
  }

  .app-shell.wx-mobile-enhanced ~ .wx-mobile-bottom-nav,
  body > .wx-mobile-bottom-nav {
    display: grid;
  }

  .wx-mobile-nav-button {
    display: grid;
    place-items: center;
    gap: 2px;
    min-height: 49px;
    padding: 3px;
    border: 0;
    border-radius: 15px;
    color: #8a9ca1;
    background: transparent;
    font-size: 10px;
  }

  .wx-mobile-nav-button span {
    font-size: 20px;
    line-height: 1;
  }

  .wx-mobile-nav-button.active {
    color: #17796f;
    background: rgba(225, 247, 243, 0.82);
    font-weight: 800;
  }

  .wx-mobile-drawer {
    position: fixed;
    z-index: 80;
    inset: 0;
  }

  .wx-mobile-drawer:not([hidden]) {
    display: flex;
    align-items: flex-end;
    justify-content: center;
  }

  .wx-mobile-drawer-scrim {
    position: absolute;
    inset: 0;
    background: rgba(22, 46, 57, 0.36);
  }

  .wx-mobile-drawer-panel {
    position: relative;
    z-index: 1;
    width: min(100%, 680px);
    max-height: min(92vh, 760px);
    overflow: auto;
    padding: 9px 18px calc(20px + env(safe-area-inset-bottom));
    border-radius: 29px 29px 0 0;
    background: rgba(255, 255, 255, 0.96);
    box-shadow: 0 -22px 70px rgba(26, 63, 77, 0.25);
    -webkit-backdrop-filter: blur(20px);
    backdrop-filter: blur(20px);
  }

  .wx-mobile-drawer-grabber {
    width: 42px;
    height: 5px;
    margin: 0 auto 14px;
    border-radius: 99px;
    background: #d8e5e4;
  }

  .wx-mobile-drawer-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 15px;
  }

  .wx-mobile-drawer-heading h2 {
    margin-top: 3px;
    font-size: 25px;
  }

  .wx-mobile-entry-form {
    display: grid;
    gap: 13px;
  }

  .wx-mobile-entry-form label {
    display: grid;
    gap: 7px;
    color: #526b73;
    font-size: 12px;
    font-weight: 700;
  }

  .wx-mobile-entry-form input,
  .wx-mobile-entry-form select,
  .wx-mobile-entry-form textarea {
    width: 100%;
    min-height: 47px;
    padding: 11px 13px;
    border: 1px solid #e0ebea;
    border-radius: 15px;
    outline: none;
    color: #24424a;
    background: #fbfefd;
    font-size: 15px;
    resize: vertical;
  }

  .wx-mobile-entry-form textarea {
    min-height: 70px;
  }

  .wx-mobile-entry-form input:focus,
  .wx-mobile-entry-form select:focus,
  .wx-mobile-entry-form textarea:focus,
  .wx-mobile-close:focus-visible,
  .wx-mobile-refresh:focus-visible,
  .wx-mobile-quick-button:focus-visible,
  .wx-mobile-save-button:focus-visible,
  .wx-mobile-type-button:focus-visible,
  .wx-mobile-nav-button:focus-visible,
  .wx-mobile-retry:focus-visible {
    outline: 3px solid rgba(53, 171, 155, 0.34);
    outline-offset: 2px;
  }

  .wx-mobile-type-tabs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 7px;
    padding: 0;
    margin: 0;
    border: 0;
  }

  .wx-mobile-type-button {
    min-height: 43px;
    border: 1px solid #dfeceb;
    border-radius: 14px;
    color: #7b9095;
    background: #f8fcfb;
    font-size: 12px;
    font-weight: 800;
  }

  .wx-mobile-type-button.active {
    border-color: #91d8cc;
    color: #17796f;
    background: #eafaf7;
  }

  .wx-mobile-form-error {
    min-height: 18px;
    margin: 0 !important;
    color: #c54754 !important;
    font-size: 12px !important;
  }

  .wx-mobile-save-button {
    min-height: 51px;
    border: 0;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, #65d2c6, #36aa9b);
    box-shadow: 0 12px 24px rgba(50, 159, 145, 0.18);
    font-size: 14px;
    font-weight: 800;
  }

  .wx-mobile-toast {
    display: block;
    position: fixed;
    z-index: 100;
    right: 16px;
    bottom: calc(88px + env(safe-area-inset-bottom));
    left: 16px;
    padding: 12px 15px;
    border: 1px solid #b9e5da;
    border-radius: 15px;
    color: #176f65;
    background: rgba(239, 253, 249, 0.96);
    box-shadow: 0 14px 30px rgba(45, 93, 89, 0.16);
    font-size: 12px;
    text-align: center;
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
  }

  .wx-mobile-toast.is-error {
    border-color: #efc5c3;
    color: #b33f4b;
    background: rgba(255, 245, 244, 0.96);
  }

  @media (max-width: 380px) {
    .wx-mobile-home {
      padding-right: 11px;
      padding-left: 11px;
    }

    .wx-mobile-section,
    .wx-mobile-quick-card,
    .wx-mobile-locked-section,
    .wx-mobile-error-card {
      border-radius: 21px;
    }

    .wx-mobile-section {
      padding: 16px 12px;
    }

    .wx-mobile-stat-card {
      padding: 11px 9px;
    }

    .wx-mobile-stat-card strong {
      font-size: 14px;
    }

    .wx-mobile-quick-card {
      padding: 15px 11px;
    }

    .wx-mobile-quick-button {
      min-width: 102px;
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .wx-mobile-spinner,
  .wx-mobile-refresh,
  .wx-mobile-quick-button,
  .wx-mobile-save-button,
  .wx-mobile-nav-button {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 680px) {
  .wx-mobile-home {
    padding-top: 13px;
  }

  .wx-mobile-home-header {
    margin-bottom: 9px;
  }

  .wx-mobile-home-header h1 {
    font-size: 30px;
  }

  .wx-mobile-section,
  .wx-mobile-quick-card,
  .wx-mobile-locked-section,
  .wx-mobile-error-card,
  .wx-mobile-loading-card {
    margin-top: 9px;
  }

  .wx-mobile-section {
    padding: 14px 12px;
  }

  .wx-mobile-section-heading {
    margin-bottom: 9px;
  }

  .wx-mobile-stat-card {
    padding: 10px 9px;
  }

  .wx-mobile-stat-card strong {
    font-size: 15px;
  }

  .wx-mobile-chart {
    margin-top: 10px;
    padding: 9px 8px 8px;
  }

  .wx-mobile-week-bars {
    min-height: 112px;
    margin-top: 8px;
  }

  .wx-mobile-day-values {
    min-height: 26px;
    font-size: 6px;
  }

  .wx-mobile-bars {
    height: 76px;
  }

  .wx-mobile-chart-note {
    margin-top: 6px;
  }

  .wx-mobile-month-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
  }

  .wx-mobile-month-grid .wx-mobile-stat-card {
    padding: 9px 6px;
    border-radius: 14px;
  }

  .wx-mobile-month-grid .wx-mobile-stat-card span {
    font-size: 10px;
  }

  .wx-mobile-month-grid .wx-mobile-stat-card strong {
    font-size: 12px;
    letter-spacing: -0.06em;
  }

  .wx-mobile-data-note {
    margin-top: 8px;
  }
}

@media (max-width: 680px) {
  .wx-mobile-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
  }

  .wx-mobile-header-entry {
    display: grid;
    place-items: center;
    gap: 0;
    min-width: 54px;
    min-height: 44px;
    padding: 5px 7px;
    border: 1px solid #a9ded4;
    border-radius: 16px;
    color: #17796f;
    background: rgba(231, 250, 245, 0.92);
    box-shadow: 0 8px 20px rgba(54, 143, 132, 0.12);
    font-weight: 800;
  }

  .wx-mobile-header-entry > span {
    font-size: 19px;
    line-height: 1;
  }

  .wx-mobile-header-entry small {
    font-size: 9px;
    line-height: 1.1;
  }

  .wx-mobile-header-entry:active {
    transform: scale(0.97);
  }

  .wx-mobile-header-entry:focus-visible {
    outline: 3px solid rgba(53, 171, 155, 0.34);
    outline-offset: 2px;
  }
}

@media (max-width: 680px) {
  .wx-mobile-inline-error {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid #efc5c3;
    border-radius: 16px;
    color: #b33f4b;
    background: rgba(255, 245, 244, 0.82);
    font-size: 12px;
  }

  .wx-mobile-inline-error .wx-mobile-retry {
    flex: 0 0 auto;
    margin-left: 0;
  }
}
