:root {
  --bg: #f5f6f4;
  --card: #ffffff;
  --ink: #171a19;
  --muted: #8b918e;
  --line: #ebeeeb;
  --accent: #0f9d76;
  --accent-dark: #0b7f5f;
  --soft: #e8f6f0;
  --danger: #e2574c;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(23, 26, 25, 0.04), 0 8px 24px rgba(23, 26, 25, 0.04);
}

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

html,
body {
  margin: 0;
  padding: 0;
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
}

body.locked {
  overflow: hidden;
}

#app {
  max-width: 520px;
  margin: 0 auto;
  padding: 8px 16px 96px;
  min-height: 100vh;
}

h1,
h2,
h3,
p,
ul,
ol {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

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

a {
  color: inherit;
  text-decoration: none;
}

/* ---------- 通用 ---------- */
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px 8px;
}

.brand {
  font-size: 19px;
  font-weight: 650;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 7px;
}

.logo {
  font-size: 20px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: var(--muted);
  background: #fff;
  box-shadow: var(--shadow);
}

.muted {
  color: var(--muted);
}
.small {
  font-size: 12.5px;
  line-height: 1.5;
}
.link {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.link.danger,
.danger {
  color: var(--danger);
}
.link.strong {
  font-size: 15px;
}
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13.5px;
  font-weight: 600;
  color: #4a504d;
  margin-bottom: 12px;
  gap: 8px;
}
.spacer {
  height: 20px;
}
.empty {
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
  padding: 18px 0;
}

/* ---------- 月份条 ---------- */
.monthbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 2px 0 10px;
  font-size: 15px;
  font-weight: 600;
}
.monthbar .icon-btn {
  background: #fff;
  font-size: 18px;
  color: #5a605d;
}

/* ---------- 概览 ---------- */
.hero {
  background: linear-gradient(155deg, #10a97f 0%, #0b8a67 100%);
  color: #fff;
  padding: 20px 18px 18px;
  box-shadow: 0 10px 26px rgba(15, 157, 118, 0.24);
}
.hero-label {
  font-size: 13px;
  opacity: 0.82;
}
.hero-amount {
  font-size: 42px;
  font-weight: 680;
  letter-spacing: -1px;
  line-height: 1.15;
  margin: 2px 0 4px;
}
.hero-amount .cny {
  font-size: 22px;
  margin-right: 3px;
  opacity: 0.9;
}
.hero-sub {
  font-size: 12.5px;
  opacity: 0.85;
}
.delta {
  display: inline-block;
  margin-top: 10px;
  font-size: 11.5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}
.quick {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.quick-btn {
  flex: 1;
  height: 46px;
  border-radius: 14px;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  color: #3c4340;
  box-shadow: var(--shadow);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.quick-btn.primary {
  background: #171a19;
  color: #fff;
}
.row-btns {
  display: flex;
  gap: 8px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.row-btns .quick-btn {
  height: 40px;
  flex: 1 1 30%;
  font-size: 13px;
}

/* ---------- 柱状 ---------- */
.bars {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 78px;
  padding-top: 4px;
}
.bar-col {
  flex: 1;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.bar {
  width: 100%;
  border-radius: 5px;
  background: linear-gradient(180deg, #28b78c, #0f9d76);
  opacity: 0.92;
}
.bars-x {
  display: flex;
  gap: 6px;
  margin-top: 6px;
  font-size: 11px;
  color: var(--muted);
}
.bars-x span {
  flex: 1;
  text-align: center;
}

/* ---------- 账单列表 ---------- */
.tx-list {
  display: flex;
  flex-direction: column;
}
.tx {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.tx:last-child {
  border-bottom: 0;
}
.tx-ico {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: #f3f5f3;
  display: grid;
  place-items: center;
  font-size: 17px;
  flex: none;
}
.tx-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.tx-name {
  font-size: 14.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-sub {
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tx-amt {
  font-size: 15.5px;
  font-weight: 620;
  flex: none;
}
.tx-amt.in {
  color: var(--accent);
}
.day-group {
  margin-bottom: 10px;
}
.day-head {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 4px 2px;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 14px 16px;
}
.summary-row > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.summary-row .muted {
  font-size: 11.5px;
}
.summary-row b {
  font-size: 18px;
  font-weight: 640;
}
.summary-row b.in {
  color: var(--accent);
}

/* ---------- 分段 ---------- */
.seg {
  display: inline-flex;
  background: #eceeec;
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  padding: 5px 13px;
  border-radius: 9px;
  font-size: 13px;
  color: #6b716e;
  font-weight: 550;
}
.seg button.on {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
.seg.small button {
  padding: 4px 12px;
  font-size: 12.5px;
}

/* ---------- 统计 ---------- */
.chart-card {
  padding: 16px 10px;
}
.chart-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.chart-legend {
  flex: 1;
  min-width: 0;
}
.donut {
  flex: none;
}
.donut-num {
  font-size: 17px;
  font-weight: 650;
  fill: var(--ink);
}
.donut-cap {
  font-size: 9px;
  fill: var(--muted);
}
.cat-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 0;
  font-size: 12.5px;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex: none;
}
.cat-ico {
  font-size: 13px;
}
.cat-name {
  flex: none;
  max-width: 62px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cat-bar {
  flex: 1;
  height: 5px;
  background: #f0f2f0;
  border-radius: 3px;
  overflow: hidden;
  min-width: 20px;
}
.cat-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.cat-num {
  flex: none;
  color: #4a504d;
}
.cat-pct {
  flex: none;
  width: 34px;
  text-align: right;
  color: var(--muted);
  font-size: 11.5px;
}
.daybars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 72px;
}
.daybars i {
  flex: 1;
  background: #cfe9df;
  border-radius: 2px;
  min-height: 2px;
}
.daybars i.zero {
  background: #f0f2f0;
}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  font-size: 10.5px;
  color: var(--muted);
  text-align: center;
  margin-bottom: 4px;
}
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-cell {
  aspect-ratio: 1;
  border-radius: 8px;
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #4a504d;
}
.cal-cell.blank {
  background: transparent;
}
.cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  font-weight: 700;
}

.ai-card {
  background: linear-gradient(180deg, #ffffff, #fbfdfc);
  border: 1px solid #e3f1eb;
}
.ai-summary {
  font-size: 13.5px;
  line-height: 1.65;
  color: #39403d;
}
.tips {
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.tips li {
  font-size: 13px;
  line-height: 1.55;
  padding-left: 18px;
  position: relative;
  color: #39403d;
}
.tips li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: var(--accent);
}
.flags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.flag {
  font-size: 11.5px;
  background: var(--soft);
  color: var(--accent-dark);
  padding: 3px 9px;
  border-radius: 999px;
}

/* ---------- 我的 ---------- */
.field {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}
.field > span {
  width: 74px;
  flex: none;
  font-size: 13px;
  color: var(--muted);
}
.field input,
.field select {
  flex: 1;
  border: 0;
  background: transparent;
  font-size: 13.5px;
  padding: 4px 0;
  min-width: 0;
  outline: none;
}
.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f0f2f0;
  color: var(--muted);
}
.badge.ok {
  background: var(--soft);
  color: var(--accent-dark);
}
.new-cat {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.new-cat input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.new-cat select {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 6px;
  font-size: 13px;
  background: #fff;
}
.new-cat .quick-btn {
  flex: none;
  width: 66px;
  height: auto;
  font-size: 13px;
  background: var(--soft);
  color: var(--accent-dark);
  box-shadow: none;
  border-radius: 10px;
}
.cat-manage li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.cat-manage li:last-child {
  border-bottom: 0;
}
.cat-manage .cat-name {
  flex: 1;
  max-width: none;
}
.steps {
  padding-left: 18px;
  list-style: decimal;
  font-size: 12.5px;
  color: #4a504d;
  line-height: 1.8;
}
.steps code {
  background: #f2f4f2;
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 11.5px;
  word-break: break-all;
}
.file-btn {
  position: relative;
  overflow: hidden;
}

/* ---------- 对话 ---------- */
.chat-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 6px 0 90px;
}
.msg {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.msg.me {
  justify-content: flex-end;
}
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--soft);
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: none;
}
.bubble {
  max-width: 78%;
  padding: 10px 13px;
  border-radius: 15px;
  font-size: 14px;
  line-height: 1.6;
  background: #fff;
  box-shadow: var(--shadow);
}
.msg.me .bubble {
  background: #171a19;
  color: #fff;
}
.typing {
  color: var(--muted);
}
.chat-empty {
  padding: 24px 4px;
  color: var(--muted);
  font-size: 13px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.chip {
  padding: 8px 13px;
  border-radius: 14px;
  background: #fff;
  font-size: 12.5px;
  color: #4a504d;
  box-shadow: var(--shadow);
}
.chat-input {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  display: flex;
  gap: 8px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: rgba(245, 246, 244, 0.92);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.chat-input input {
  flex: 1;
  height: 42px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 14px;
  font-size: 14px;
  outline: none;
}
.send {
  width: 62px;
  border-radius: 13px;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
}
.send:disabled {
  opacity: 0.4;
}

/* ---------- 底部导航 ---------- */
.tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 520px;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  z-index: 30;
}
.tabbar > button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10.5px;
  color: #9aa09d;
}
.tabbar > button span {
  font-size: 19px;
  filter: grayscale(1);
  opacity: 0.55;
}
.tabbar > button.on {
  color: var(--accent);
  font-weight: 600;
}
.tabbar > button.on span {
  filter: none;
  opacity: 1;
}
.tabbar .fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  justify-self: center;
  margin-top: -18px;
  box-shadow: 0 8px 18px rgba(15, 157, 118, 0.36);
  justify-content: center;
}

/* ---------- 记账面板 ---------- */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(20, 24, 22, 0.32);
  z-index: 40;
  animation: fade 0.18s ease;
}
.sheet {
  position: fixed;
  inset: 0;
  z-index: 41;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  padding: calc(6px + env(safe-area-inset-top)) 16px calc(10px + env(safe-area-inset-bottom));
  animation: slideUp 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}
@keyframes fade {
  from {
    opacity: 0;
  }
}
@keyframes slideUp {
  from {
    transform: translateY(14px);
    opacity: 0.4;
  }
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 0 10px;
}
.sheet-head-right {
  display: flex;
  align-items: center;
  gap: 14px;
}
.smart {
  display: flex;
  gap: 8px;
  margin-bottom: 4px;
}
.smart input {
  flex: 1;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  font-size: 14px;
  outline: none;
}
.smart input:focus {
  border-color: var(--accent);
}
.parse-btn {
  width: 66px;
  border-radius: 12px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 13.5px;
  font-weight: 600;
}
.hint {
  height: 16px;
  font-size: 11.5px;
  color: var(--muted);
  padding-left: 2px;
}
.amount-line {
  text-align: right;
  font-size: 40px;
  font-weight: 680;
  letter-spacing: -1px;
  padding: 4px 4px 8px;
  line-height: 1.2;
  overflow: hidden;
}
.amount-line .cny {
  font-size: 22px;
  color: var(--muted);
  margin-right: 4px;
}
.cat-grid {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  align-content: start;
  padding: 2px 0 10px;
  -webkit-overflow-scrolling: touch;
}
.cat-cell {
  background: #fff;
  border-radius: 14px;
  padding: 10px 4px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  border: 1.5px solid transparent;
}
.cat-cell .ico {
  font-size: 21px;
  line-height: 1;
}
.cat-cell .nm {
  font-size: 11.5px;
  color: #4a504d;
}
.cat-cell.on {
  border-color: var(--accent);
  background: var(--soft);
}
.cat-cell.on .nm {
  color: var(--accent-dark);
  font-weight: 600;
}
.meta {
  display: flex;
  gap: 8px;
  padding: 6px 0;
}
.meta input {
  flex: 1;
  height: 38px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  min-width: 0;
}
.meta input[type="date"] {
  flex: none;
  width: 138px;
}
.keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding-top: 4px;
}
.key {
  height: 46px;
  border-radius: 12px;
  background: #fff;
  font-size: 19px;
  font-weight: 500;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}
.key:active {
  background: #eef1ee;
}

/* ---------- toast ---------- */
#toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 12px);
  background: rgba(23, 26, 25, 0.9);
  color: #fff;
  font-size: 13px;
  padding: 9px 16px;
  border-radius: 12px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.22s ease;
  z-index: 99;
  max-width: 80vw;
  text-align: center;
}
#toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (min-width: 560px) {
  #app {
    padding-top: 20px;
  }
}

/* ---------- 修正 ---------- */
.no-tabbar .tabbar {
  display: none;
}
.no-tabbar .chat-input {
  z-index: 35;
}
.row-btns .quick-btn {
  background: #f4f6f4;
  box-shadow: none;
}
.row-btns .quick-btn.danger {
  background: #fdf1f0;
}
.ai-card .quick-btn {
  background: #f2f6f4;
  box-shadow: none;
  color: var(--accent-dark);
}
.ai-card .quick-btn.primary {
  background: #171a19;
  color: #fff;
}

.chart-row.center {
  justify-content: center;
}
.chart-legend.full {
  margin-top: 12px;
}
.chart-legend.full .cat-name {
  max-width: 74px;
}

/* ---------- 按天账单 ---------- */
.day-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 4px 16px 2px;
  margin-bottom: 10px;
  box-shadow: var(--shadow);
}
.day-head {
  display: flex;
  align-items: baseline;
  gap: 7px;
  padding: 11px 0 7px;
  border-bottom: 1px solid var(--line);
}
.day-date {
  font-size: 14.5px;
  font-weight: 650;
  color: var(--ink);
}
.day-week {
  font-size: 11.5px;
  color: var(--muted);
}
.day-count {
  font-size: 11px;
  color: var(--muted);
  background: #f2f4f2;
  padding: 1px 6px;
  border-radius: 6px;
}
.day-sum {
  margin-left: auto;
  font-size: 13px;
  font-weight: 620;
  color: #3c4340;
}
.day-card .tx {
  padding: 10px 0;
}
.day-card .tx:last-child {
  border-bottom: 0;
}
.cal-btn {
  position: relative;
  overflow: hidden;
}
.day-picker {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  padding: 0;
}
.filter-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--soft);
  color: var(--accent-dark);
  font-size: 12.5px;
  padding: 8px 12px;
  border-radius: 12px;
  margin: 0 2px 10px;
}
.filter-chip button {
  margin-left: auto;
  font-size: 12px;
  color: var(--accent-dark);
  text-decoration: underline;
}
.cal-cell {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}
.cal-cell:active {
  transform: scale(0.94);
}

.monthbar {
  position: relative;
}
.monthbar .cal-btn {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
}

/* ---------- 分类详情 ---------- */
.cat-list li[data-act] {
  cursor: pointer;
}
.cat-list li[data-act]:active {
  opacity: 0.6;
}
.cat-arrow {
  color: #c3c9c6;
  font-size: 15px;
  margin-left: 2px;
}
.section-title {
  font-size: 13px;
  color: var(--muted);
  padding: 4px 6px 8px;
  font-weight: 600;
}

/* ---------- 分类下的备注排行 ---------- */
.note-list li {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  font-size: 12.5px;
}
.note-name {
  flex: none;
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.note-bar {
  flex: 1;
  height: 5px;
  background: #f0f2f0;
  border-radius: 3px;
  overflow: hidden;
  min-width: 24px;
}
.note-bar i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 3px;
}
.note-count {
  flex: none;
  color: var(--muted);
  font-size: 11px;
  width: 40px;
  text-align: right;
}
.note-num {
  flex: none;
  width: 72px;
  text-align: right;
  color: #3c4340;
}

/* ---------- 分类内搜索/排序 ---------- */
.cat-tools {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 2px 2px 10px;
}
.cat-search {
  flex: 1;
  height: 36px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0 12px;
  font-size: 13px;
  outline: none;
  min-width: 0;
  -webkit-appearance: none;
  appearance: none;
}
.cat-search:focus {
  border-color: var(--accent);
}
.cat-tools .seg {
  flex: none;
}

.month-label {
  position: relative;
  cursor: pointer;
}

/* ---------- 首次打开 ---------- */
.welcome {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px calc(40px + env(safe-area-inset-bottom));
  gap: 6px;
}
.welcome-logo {
  font-size: 52px;
  line-height: 1;
  margin-bottom: 6px;
}
.welcome h1 {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: 1px;
}
.welcome-sub {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 6px;
  max-width: 300px;
  line-height: 1.7;
}
.welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  margin-top: 28px;
}
.welcome-actions .quick-btn {
  flex: none;
  height: 50px;
  font-size: 15px;
}
.welcome-hint {
  margin-top: 18px;
  font-size: 12px;
  color: #a8aeab;
  max-width: 280px;
  line-height: 1.6;
}

/* ---------- 导入预览 ---------- */
.imp-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  background: var(--bg);
  border-radius: 22px 22px 0 0;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.22s cubic-bezier(0.22, 0.9, 0.3, 1);
}
.imp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 10px;
}
.imp-title {
  font-weight: 650;
  font-size: 15px;
}
.imp-body {
  overflow-y: auto;
  padding: 0 18px 12px;
  -webkit-overflow-scrolling: touch;
}
.imp-file {
  font-size: 12.5px;
  color: var(--muted);
  margin-bottom: 10px;
  word-break: break-all;
}
.imp-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 14px 16px;
}
.imp-stats > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.imp-stats .muted {
  font-size: 11.5px;
}
.imp-stats b {
  font-size: 16px;
  font-weight: 640;
}
.imp-list {
  margin-top: 12px;
  background: #fff;
  border-radius: 16px;
  padding: 4px 14px;
}
.imp-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.imp-list li:last-child {
  border-bottom: 0;
}
.imp-cat {
  color: var(--muted);
  flex: none;
}
.imp-note {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #4a504d;
}
.imp-list b {
  flex: none;
}
.warn-line {
  font-size: 12.5px;
  color: #8a5a00;
  background: #fff7ea;
  border-radius: 12px;
  padding: 10px 12px;
  margin-top: 10px;
  line-height: 1.6;
}
.imp-foot {
  padding: 10px 18px calc(16px + env(safe-area-inset-bottom));
}
.imp-foot .quick-btn {
  width: 100%;
  height: 48px;
}
