:root { --visible-height: 100dvh; --viewport-top: 0px; }
html { -webkit-tap-highlight-color: transparent; -webkit-text-size-adjust: 100%; }
/* 主屏幕应用允许单指横/竖滚动，不启用页面捏合或双击缩放。 */
html.ledger-standalone, html.ledger-standalone body, html.ledger-standalone .sheet { touch-action: pan-x pan-y; }
button, uni-button, [role="button"] { touch-action: manipulation; -webkit-user-select: none; user-select: none; }
input, textarea { caret-color: var(--ledger-accent); }
::selection { color: var(--ledger-ink); background: var(--ledger-accent-soft); }
/* 16px prevents Safari from zooming and shifting the entire page on focus. */
input, textarea, .uni-input-input, .uni-textarea-textarea { font-size: max(16px, 1em); }
/* 目标表单：原生输入层与占位层继承同一字号、同一纵向中心，避免输入后跳字。 */
.goals-page .uni-input-wrapper { display: flex; align-items: center; justify-content: center; }
.goals-page .uni-input-input, .goals-page .uni-input-placeholder { font-size: inherit; line-height: normal; }
.goals-page .uni-input-input { height: 100%; padding: 0; margin: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; text-align: inherit; }
/* Target the real H5 input outside Vue's scoped styles: only its rounded shell draws focus. */
.auth-page .uni-input-input, .auth-page .uni-input-input:focus,
.deletion-page .uni-input-input, .deletion-page .uni-input-input:focus {
  appearance: none; -webkit-appearance: none; border: 0; outline: none; box-shadow: none;
  border-radius: 0; background: transparent; padding: 0; margin: 0; font-size: 16px;
}
.auth-page .uni-input-placeholder, .deletion-page .uni-input-placeholder { font-size: 16px; }
.auth-page .uni-input-input:-webkit-autofill, .deletion-page .uni-input-input:-webkit-autofill { -webkit-text-fill-color: var(--ledger-ink); caret-color: var(--ledger-ink); box-shadow: inset 0 0 0 1000px var(--ledger-surface2); }
.auth-page .uni-input-wrapper, .deletion-page .uni-input-wrapper { color-scheme: light; }
/* Asset labels/help text are outside the focused shell; native H5 inputs draw no second box. */
.assets-page .uni-input-input, .assets-page .uni-input-input:focus,
.assets-page .uni-textarea-textarea, .assets-page .uni-textarea-textarea:focus {
  appearance: none; -webkit-appearance: none; border: 0; outline: none; box-shadow: none;
  border-radius: 0; background: transparent; padding: 0; margin: 0; font-size: 16px;
}
.assets-page .asset-money-shell .uni-input-input { font-size: 30px; }
.assets-page .uni-input-placeholder, .assets-page .uni-textarea-placeholder { font-size: 16px; }
[data-ledger-theme="night"] .auth-page .uni-input-wrapper, [data-ledger-theme="night"] .deletion-page .uni-input-wrapper { color-scheme: dark; }
.sheet-mask {
  top: var(--viewport-top) !important;
  bottom: auto !important;
  height: var(--visible-height) !important;
  z-index: 1000 !important;
  padding-top: max(12px, env(safe-area-inset-top));
}
.sheet-mask .sheet {
  max-height: calc(var(--visible-height) - 24px - env(safe-area-inset-top)) !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
.sheet-mask .sheet-list { max-height: none; }
.sheet-mask .sheet:focus { outline: none; }
.sheet-mask .sheet.theme-sheet.is-sorting { overflow-y: hidden !important; }
.keyboard-open uni-tabbar { display: none !important; }
.keyboard-open .sheet { padding-bottom: 24px; }
@media (display-mode: standalone) {
  html { background: var(--ledger-bg, #f5f5f3); }
}
/* 桌面（≥1024px）：app 收进 430px 居中画布（App.vue），画布内的固定层（sheet、批量条、
   撤销条、隐私胶囊）也按画布边缘对齐，避免横贯整个窗口。选择器用 !important 压过
   scoped 样式的 (0,2,0) 零重要度规则。 */
@media (min-width: 1024px) {
  .sheet-mask {
    left: calc(50% - 215px) !important;
    right: calc(50% - 215px) !important;
    width: auto !important;
  }
  .sheet-mask .sheet { max-width: none !important; }
  /* 其余全窗固定层（自绘日期滚轮、框架 picker 弹层、操作表）同样收进画布。 */
  .date-picker-mask,
  .uni-picker,
  .uni-picker-container,
  uni-actionsheet .uni-actionsheet {
    left: calc(50% - 215px) !important;
    right: calc(50% - 215px) !important;
    width: auto !important;
  }
  .date-picker-panel { max-width: none !important; }
  .batch-bar {
    left: calc(50% - 215px) !important;
    right: calc(50% - 215px) !important;
  }
  .bill-undo {
    left: calc(50% - 197px) !important;
    right: calc(50% - 197px) !important;
    max-width: none !important;
  }
  .privacy-float { right: calc(50% - 199px) !important; }
  .privacy-float.above-tabbar { right: calc(50% - 203px) !important; }
  /* 430 画布约等于一台手机：首页收支大数字回到手机比例（66rpx ≈ 38px），不再用 44px。 */
  .big-money { font-size: 38px !important; }
}
