﻿:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --ink: #16181d;
  --ink-2: #4b515a;
  --muted: #8b929c;
  --line: #eef0f3;
  --line-strong: #e2e5ea;
  --expense: #e5484d;
  --income: #0f9d63;
  --accent: #2f6fed;
  --radius: 12px;
  --radius-lg: 18px;
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}

body.no-scroll {
  overflow: hidden;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  cursor: pointer;
}

input,
select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

input:focus,
select:focus,
button:focus {
  outline: none;
}

.app {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--surface);
}

/* ---------- 顶部汇总 ---------- */

.summary {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: calc(env(safe-area-inset-top, 0px) + 4px) 16px 7px;
  background: rgba(255, 255, 255, 0.94);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.summary-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  gap: 8px;
}

.month-nav {
  display: flex;
  align-items: center;
  margin-left: -10px;
}

.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--ink-2);
  font-size: 22px;
  line-height: 1;
}

.icon-btn:active {
  background: var(--surface-2);
}

.month-label {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 4px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}

.today-back {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: #edf2ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
}

.totals {
  display: grid;
  grid-template-columns: 1.05fr 1fr 1fr;
  gap: 8px;
  margin-top: 1px;
}

.total {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.t-label {
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: 0.2px;
}

.t-value {
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.4px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.t-value.expense {
  color: var(--expense);
}

.t-value.income {
  color: var(--income);
}

.today-line {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
}

.today-line .neg {
  color: var(--expense);
}

.today-line .pos {
  color: var(--income);
}

/* ---------- 主区域 ---------- */

.main {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 12px 16px 122px;
}

/* ---------- 搜索与筛选 ---------- */

.tools {
  display: flex;
  flex-direction: column;
}

.search {
  position: relative;
}

.search svg {
  position: absolute;
  top: 50%;
  left: 14px;
  transform: translateY(-50%);
  pointer-events: none;
}

.search input {
  width: 100%;
  height: 46px;
  padding: 0 14px 0 41px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 14px;
  color: var(--ink);
  appearance: none;
  transition: border-color 0.16s, box-shadow 0.16s, background 0.16s;
}

.search input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.search input::placeholder {
  color: var(--muted);
}

.search input:focus {
  border-color: #c1d3fb;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}

.seg {
  display: flex;
  flex: 1;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.seg button {
  flex: 1;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
  transition: background 0.16s, color 0.16s;
}

.seg button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.09);
}

.select-wrap {
  position: relative;
  flex: 0 0 124px;
}

.select-wrap::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 13px;
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(45deg);
  pointer-events: none;
}

.select-wrap select {
  width: 100%;
  height: 46px;
  padding: 0 30px 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
  font-size: 13px;
  color: var(--ink-2);
  appearance: none;
  text-overflow: ellipsis;
}

/* ---------- 通用卡片 ---------- */

.card {
  padding: 13px 14px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.03);
}

/* ---------- 统计 ---------- */

.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.stats-title {
  margin: 0;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stats-seg {
  display: flex;
  flex: 0 0 auto;
  gap: 2px;
  padding: 3px;
  border-radius: 10px;
  background: var(--surface-2);
}

.stats-seg button {
  height: 44px;
  padding: 0 13px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.stats-seg button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08);
}

.stats-body {
  margin-top: 4px;
}

.stat-row {
  padding-top: 9px;
}

.stat-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
}

.stat-name {
  display: flex;
  flex: 1;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: var(--ink-2);
  font-size: 13px;
}

.stat-name i {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 3px;
}

.stat-name span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stat-amt {
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.stat-pct {
  width: 38px;
  color: var(--muted);
  font-size: 11.5px;
  text-align: right;
}

.track {
  height: 5px;
  margin-top: 6px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.fill {
  height: 100%;
  border-radius: 99px;
  transition: width 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.stats-empty {
  padding: 18px 4px 8px;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

/* ---------- 流水列表 ---------- */

.list {
  display: flex;
  flex-direction: column;
}

.group-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 2px 4px;
  color: var(--muted);
  font-size: 12px;
}

.group-head .g-date {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.group-head strong {
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 600;
}

.group-head .g-sub {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.group-head .g-sub .neg {
  color: var(--expense);
}

.group-head .g-sub .pos {
  color: var(--income);
}

.row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 60px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.row:active {
  background: var(--surface-2);
}

.row.is-editing {
  border-bottom-color: transparent;
}

.row-main {
  min-width: 0;
}

.row-name {
  color: var(--ink);
  font-size: 14px;
  font-weight: 500;
  line-height: 1.35;
}

.row-note {
  display: block;
  margin-top: 1px;
  color: var(--muted);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.row-amt {
  padding-left: 6px;
  font-size: 20px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.row-amt.expense {
  color: var(--expense);
}

.row-amt.income {
  color: var(--income);
}

.cat-dot {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 11px;
}

.cat-dot b {
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.row.flash {
  animation: flash-bg 1.5s ease;
}

@keyframes flash-bg {
  0% {
    background: #fff3cd;
  }
  60% {
    background: #fff8e1;
  }
  100% {
    background: transparent;
  }
}

/* ---------- 行内编辑 ---------- */

.inline-editor {
  margin: 2px 0 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
}

.ie-amount-row {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding-bottom: 3px;
  border-bottom: 1px solid var(--line-strong);
}

.ie-amount-row .cur {
  color: var(--muted);
  font-size: 17px;
}

.ie-amount {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 26px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.5px;
}

.ie-amount:focus {
  outline: none;
}

.ie-cats {
  display: flex;
  gap: 7px;
  margin: 9px -2px 0;
  padding: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.ie-cats::-webkit-scrollbar {
  display: none;
}

.ie-cats .cat-chip {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}

.ie-cats .cat-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.ie-cats .cat-chip.active {
  border-color: var(--accent);
  background: #eff4ff;
  color: var(--accent);
  font-weight: 600;
}

.ie-fields {
  display: flex;
  gap: 8px;
  margin-top: 9px;
}

.ie-date {
  flex: 0 0 132px;
  height: 44px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 12.5px;
  color: var(--ink-2);
}

.ie-note {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 13px;
}

.ie-note:focus,
.ie-date:focus {
  border-color: #c1d3fb;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

.ie-error {
  margin: 7px 0 0;
  color: var(--expense);
  font-size: 12px;
}

.ie-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.ie-actions .spacer {
  flex: 1;
}

.ie-actions button {
  height: 44px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}

.ie-actions .danger {
  border-color: transparent;
  background: transparent;
  color: var(--expense);
  padding-left: 4px;
}

.ie-actions .save {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

/* ---------- 空状态 ---------- */

.empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 40px 16px 36px;
  text-align: center;
}

.empty-mark {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 12px;
  border-radius: 18px;
  background: var(--surface-2);
  color: #b6bcc6;
  font-size: 24px;
  font-weight: 700;
}

.empty h3 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 15px;
  font-weight: 600;
}

.empty p {
  max-width: 290px;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.empty .empty-reset {
  height: 44px;
  margin-top: 14px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 500;
}

/* ---------- 页脚 ---------- */

.page-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 0 2px;
}

.clear-btn {
  height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #a3a9b2;
  font-size: 12.5px;
}

.clear-btn:active {
  color: var(--expense);
}

.foot-note {
  color: #bcc2ca;
  font-size: 11.5px;
}

/* ---------- 底部主按钮 ---------- */

.bottom {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 30;
  display: flex;
  justify-content: center;
  padding: 12px 16px calc(env(safe-area-inset-bottom, 0px) + 10px);
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.97) 45%,
    rgba(255, 255, 255, 0.82) 72%,
    rgba(255, 255, 255, 0)
  );
  pointer-events: none;
}

.bottom .inner {
  width: 100%;
  max-width: 448px;
  pointer-events: auto;
}

body.sheet-open .bottom,
body.modal-open .bottom {
  opacity: 0;
  visibility: hidden;
}

.add-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: 100%;
  height: 54px;
  padding: 0;
  border: 0;
  border-radius: 16px;
  background: var(--accent);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.3px;
  box-shadow: 0 8px 20px rgba(47, 111, 237, 0.28);
}

.add-btn:active {
  transform: translateY(1px);
  box-shadow: 0 4px 12px rgba(47, 111, 237, 0.24);
}

.add-btn .plus {
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
}

/* ---------- 抽屉 ---------- */

.backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(15, 23, 42, 0.38);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.26s ease;
}

.backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.sheet {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-width: 480px;
  max-height: 90vh;
  max-height: 90dvh;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
  transform: translateY(102%);
  visibility: hidden;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0.3s;
}

.sheet.open {
  transform: translateY(0);
  visibility: visible;
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 0s;
}

.sheet-grab {
  flex: 0 0 auto;
  width: 38px;
  height: 4px;
  margin: 8px auto 0;
  border-radius: 99px;
  background: var(--line-strong);
}

.sheet-head {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  padding: 2px 8px 2px 16px;
}

.sheet-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.close-btn {
  font-size: 17px;
  color: var(--muted);
}

.sheet-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 0 16px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.amount-box {
  display: flex;
  align-items: baseline;
  gap: 5px;
  padding: 8px 2px 4px;
  border-bottom: 2px solid var(--line-strong);
  transition: border-color 0.16s;
}

.amount-box.invalid {
  border-bottom-color: var(--expense);
  animation: shake 0.3s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.amount-box .currency {
  color: var(--ink-2);
  font-size: 21px;
  font-weight: 500;
}

.amount-input {
  flex: 1;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 40px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -1.2px;
  line-height: 1.25;
}

.amount-input::placeholder {
  color: #cbd0d7;
  font-weight: 600;
}

.amount-input:focus {
  outline: none;
}

.form-error {
  margin: 6px 0 0;
  color: var(--expense);
  font-size: 12px;
}

.type-seg {
  display: flex;
  gap: 3px;
  margin-top: 12px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-2);
}

.type-seg button {
  flex: 1;
  height: 44px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
  transition: background 0.16s, color 0.16s;
}

.type-seg button.active {
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(16, 24, 40, 0.09);
}

.field-label {
  margin: 14px 0 7px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.2px;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.cat-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 60px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-size: 12px;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cat-cell i {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

.cat-cell.active {
  border-color: var(--accent);
  background: #f1f5ff;
  color: var(--accent);
  font-weight: 600;
}

.cat-cell.active i {
  box-shadow: inset 0 0 0 3px #fff;
}

.date-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-chip {
  flex: 0 0 auto;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
}

.date-chip.active {
  border-color: var(--accent);
  background: #eff4ff;
  color: var(--accent);
  font-weight: 600;
}

.date-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 9px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink-2);
  font-size: 13px;
}

.date-input:focus {
  border-color: #c1d3fb;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

.text-input {
  width: 100%;
  height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  font-size: 14px;
}

.text-input:focus {
  border-color: #c1d3fb;
  box-shadow: 0 0 0 3px rgba(47, 111, 237, 0.1);
}

.btn-primary {
  border: 0;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn-save {
  width: 100%;
  height: 52px;
  margin-top: 16px;
  border-radius: 14px;
  font-size: 16px;
  box-shadow: 0 6px 16px rgba(47, 111, 237, 0.24);
}

.btn-save:active {
  transform: translateY(1px);
}

/* ---------- 删除确认 ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, 0.42);
}

.modal-backdrop.open {
  display: grid;
}

.modal {
  width: 100%;
  max-width: 320px;
  padding: 20px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.28);
  animation: pop 0.18s ease;
}

@keyframes pop {
  from { transform: scale(0.96); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal h3 {
  margin: 0 0 6px;
  font-size: 16px;
  font-weight: 600;
}

.modal p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}

.modal-actions .danger {
  border-color: var(--expense);
  background: var(--expense);
  color: #fff;
  font-weight: 600;
}

/* ---------- Toast ---------- */

.toast {
  position: fixed;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 70;
  padding: 9px 16px;
  border-radius: 999px;
  background: rgba(22, 24, 29, 0.92);
  color: #fff;
  font-size: 13px;
  white-space: nowrap;
  opacity: 0;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}

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

/* ---------- 安装到手机提示条 ---------- */

.install-bar {
  position: fixed;
  bottom: calc(80px + env(safe-area-inset-bottom, 0px));
  left: 50%;
  z-index: 35;
  display: flex;
  align-items: center;
  gap: 6px;
  width: calc(100% - 32px);
  max-width: 448px;
  height: 52px;
  padding: 0 4px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 6px 24px rgba(16, 24, 40, 0.12);
  transform: translateX(-50%);
}

.install-bar[hidden] {
  display: none;
}

body.sheet-open .install-bar,
body.modal-open .install-bar {
  display: none;
}

body.install-open .toast {
  bottom: calc(142px + env(safe-area-inset-bottom, 0px));
}

.install-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12.5px;
  line-height: 1.35;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.install-go {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
}

.install-go:active {
  transform: translateY(1px);
}

.install-x {
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
}

/* ---------- iOS 输入防缩放 ---------- */
@supports (-webkit-touch-callout: none) {
  .search input,
  .text-input,
  .date-input,
  .ie-note,
  .ie-date,
  .select-wrap select {
    font-size: 16px;
  }
}

/* ---------- 桌面端 ---------- */
@media (min-width: 700px) {
  body {
    padding: 26px 20px 0;
  }

  .app {
    min-height: calc(100vh - 26px);
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(16, 24, 40, 0.05), 0 24px 60px rgba(16, 24, 40, 0.08);
  }

  .summary {
    padding-right: 20px;
    padding-left: 20px;
    border-radius: 22px 22px 0 0;
  }

  .main {
    padding: 16px 20px 132px;
  }

  .bottom {
    padding-bottom: 22px;
    background: linear-gradient(
      to top,
      rgba(244, 245, 247, 0.98) 30%,
      rgba(244, 245, 247, 0.85) 60%,
      rgba(244, 245, 247, 0)
    );
  }

  .bottom .inner {
    max-width: 480px;
  }

  .install-bar {
    bottom: 88px;
    max-width: 480px;
  }

  .backdrop {
    background: rgba(15, 23, 42, 0.32);
  }

  .sheet {
    top: 50%;
    right: auto;
    bottom: auto;
    left: 50%;
    width: 440px;
    max-height: 88vh;
    padding-bottom: 0;
    border-radius: 20px;
    opacity: 0;
    transform: translate(-50%, -46%) scale(0.98);
    transition: transform 0.24s ease, opacity 0.24s ease, visibility 0s linear 0.24s;
  }

  .sheet.open {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
    transition: transform 0.24s ease, opacity 0.24s ease, visibility 0s linear 0s;
  }

  .sheet-grab {
    display: none;
  }

  .sheet-head {
    padding-top: 14px;
  }

  .sheet .icon-btn:hover {
    background: var(--surface-2);
  }
}
