/* ==========================================================
   接送计费 · 样式
   ========================================================== */

:root {
  --bg: #f4f6f9;
  --panel: #ffffff;
  --line: #e9eef4;
  --line-strong: #dde5ee;
  --text: #0f172a;
  --text-2: #5b6b80;
  --text-3: #94a3b8;
  --green: #22c55e;
  --green-deep: #15803d;
  --green-soft: #ecfdf3;
  --red: #ef4444;
  --red-deep: #b91c1c;
  --red-soft: #fef2f2;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --amber: #d97706;
  --radius-lg: 16px;
  --radius: 12px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .04);
  --shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 10px 30px -18px rgba(15, 23, 42, .22);
  --shadow-pop: 0 20px 60px -20px rgba(15, 23, 42, .35), 0 2px 8px rgba(15, 23, 42, .06);
}

* { box-sizing: border-box; }

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

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  padding-bottom: env(safe-area-inset-bottom);
}

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

button { cursor: pointer; border: none; background: none; }

/* ---------------- 顶栏 ---------------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 22px;
  background: rgba(255, 255, 255, .86);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, #34d399, #0f766e);
  box-shadow: 0 4px 12px -4px rgba(15, 118, 110, .5);
  flex: none;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
  min-width: 0;
}

.brand-text strong {
  font-size: 15px;
  letter-spacing: .2px;
}

.brand-text span {
  font-size: 11.5px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.month-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  background: #f1f4f8;
  border-radius: 999px;
  padding: 3px;
  flex: none;
}

.icon-btn {
  width: 30px;
  height: 30px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  transition: background .15s, color .15s;
}

.icon-btn:hover { background: #fff; color: var(--text); box-shadow: var(--shadow-sm); }
.icon-btn:active { transform: scale(.94); }

.month-label {
  min-width: 104px;
  padding: 0 6px;
  height: 30px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .2px;
  border-radius: 999px;
  color: var(--text);
  transition: background .15s;
}

.month-label:hover { background: #fff; }

.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 0;
  justify-content: flex-end;
}

.btn-ghost {
  height: 32px;
  padding: 0 13px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  background: #fff;
  transition: all .15s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-ghost:hover { color: var(--text); border-color: #c9d5e3; box-shadow: var(--shadow-sm); }
.btn-ghost:active { transform: scale(.97); }

/* ---------------- 布局 ---------------- */

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 22px 40px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 332px;
  grid-template-areas:
    "cal stat"
    "cal bill"
    "cal note";
  grid-template-rows: auto auto auto;
  gap: 14px;
  align-items: start;
}

.calendar-panel { grid-area: cal; }
.stat-panel { grid-area: stat; }
.bill-panel { grid-area: bill; }
.note-panel { grid-area: note; }

.panel {
  background: var(--panel);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  border: 1px solid rgba(233, 238, 244, .8);
}

/* ---------------- 日历 ---------------- */

.calendar-panel {
  padding: 16px 16px 12px;
}

.weekhead {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
  padding: 0 2px 10px;
}

.wk {
  text-align: center;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .5px;
  color: var(--text-3);
}

.wk-end { color: #c0a3a3; }

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

.cell {
  position: relative;
  min-height: 112px;
  min-width: 0;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #fff;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .12s, background .15s;
  overflow: hidden;
  text-align: left;
}

.cell:hover {
  border-color: #c8d6e6;
  box-shadow: 0 6px 18px -12px rgba(15, 23, 42, .4);
  transform: translateY(-1px);
}

.cell:active { transform: scale(.985); }

.cell-empty {
  background: transparent;
  border: none;
  cursor: default;
  pointer-events: none;
  min-height: 112px;
}

.cell-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.cell-num {
  font-size: 14px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 20px;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  transition: background .15s, color .15s;
}

.cell-weekend .cell-num { color: var(--text-3); }

.cell-today .cell-num {
  background: #0f172a;
  color: #fff;
  font-weight: 700;
}

.cell-today {
  border-color: #0f172a;
  box-shadow: 0 0 0 1px #0f172a inset;
}

/* 状态点 */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  flex: none;
}

.dot-green { background: var(--green); box-shadow: 0 0 0 3px rgba(34, 197, 94, .14); }
.dot-red { background: var(--red); box-shadow: 0 0 0 3px rgba(239, 68, 68, .12); }
.dot-ring {
  background: transparent;
  border: 1.6px solid #b8c6d6;
  width: 8px;
  height: 8px;
}
.dot-null {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #e6ebf1;
}

.legend-blank {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: 1px dashed #cbd6e2;
}

.cell-dot { margin-top: 6px; }

.cell-body {
  margin-top: 6px;
  flex: 1;
  min-width: 0;
}

.cell-tag {
  display: inline-block;
  max-width: 100%;
  font-size: 10.5px;
  line-height: 15px;
  padding: 0 6px;
  border-radius: 5px;
  background: #f1f5f9;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: top;
}

.cell-tag.tag-holiday { background: #f8fafc; color: #94a3b8; }
.cell-tag.tag-estimate { background: #fffbeb; color: #b45309; }

.cell-note {
  margin-top: 3px;
  font-size: 11px;
  line-height: 15px;
  color: var(--text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-all;
}

.cell-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 4px;
}

.cell-amount {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--green-deep);
  font-variant-numeric: tabular-nums;
}

.cell-amount.muted { color: var(--text-3); font-weight: 500; }

.cell-src {
  font-size: 9.5px;
  color: #b6c2d1;
  letter-spacing: .3px;
}

/* 状态配色 */
.cell-completed { background: linear-gradient(180deg, #ffffff, #f7fdf9); }
.cell-skipped { background: linear-gradient(180deg, #ffffff, #fffafa); }
.cell-rest { background: #fbfcfe; border-color: #eef2f7; }
.cell-rest .cell-num { color: #b9c4d2; font-weight: 500; }
.cell-pending { background: #fff; }

.cell-skipped .cell-note { color: #b91c1c; }

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 4px 2px;
  margin-top: 10px;
  border-top: 1px dashed var(--line);
  font-size: 11.5px;
  color: var(--text-2);
}

.legend > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-hint {
  margin-left: auto;
  color: var(--text-3);
}

/* ---------------- 侧栏 ---------------- */

.stat-panel { padding: 18px; }

.stat-hero-label {
  font-size: 12px;
  color: var(--text-3);
  letter-spacing: .4px;
}

.stat-hero-value {
  font-size: 34px;
  font-weight: 700;
  letter-spacing: -.8px;
  line-height: 1.15;
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.stat-hero-sub {
  font-size: 11.5px;
  color: var(--text-3);
  margin-top: 3px;
  min-height: 17px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.stat-cell {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.stat-num {
  font-size: 17px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
}

.stat-cap {
  font-size: 11px;
  color: var(--text-3);
}

.settle-zone { margin-top: 14px; }

.settle-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--green-soft);
  border: 1px solid #d3f2e0;
  border-radius: var(--radius-sm);
  padding: 9px 11px;
  font-size: 12px;
  color: #15803d;
}

.settle-badge strong { font-weight: 600; }

.settle-badge .undo {
  font-size: 11px;
  color: #3f8f63;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: .85;
  flex: none;
}

.settle-warn {
  margin-top: 8px;
  font-size: 11.5px;
  color: var(--amber);
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: var(--radius-sm);
  padding: 7px 10px;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: .2px;
  transition: transform .12s, background .15s, box-shadow .15s;
  box-shadow: 0 6px 16px -10px rgba(15, 23, 42, .9);
}

.btn-primary:hover { background: #1e293b; }
.btn-primary:active { transform: scale(.98); }
.btn-primary:disabled { background: #cbd5e1; color: #fff; cursor: not-allowed; box-shadow: none; }

.btn-block { width: 100%; margin-top: 16px; }

.btn-minor {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 13.5px;
  color: var(--text-2);
  text-decoration: none;
  transition: all .15s;
}

.btn-minor:hover { border-color: #c2d0e0; color: var(--text); }

.settle-btn {
  width: 100%;
  height: 38px;
  border-radius: 10px;
  background: #0f172a;
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  transition: all .15s;
}

.settle-btn:hover { background: #1e293b; }

/* 账单 */
.bill-panel { padding: 16px 16px 10px; }

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.panel-head h2 {
  font-size: 13px;
  font-weight: 600;
  margin: 0;
  letter-spacing: .3px;
  color: var(--text);
}

.link-btn {
  font-size: 11.5px;
  color: var(--text-3);
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 2px 0;
}

.link-btn:hover { color: var(--blue); }

.bill-totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px;
  background: #f8fafc;
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
}

.bill-totals div { display: flex; flex-direction: column; gap: 1px; }
.bill-totals .k { font-size: 10.5px; color: var(--text-3); }
.bill-totals .v { font-size: 14px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bill-totals .v.warn { color: #b91c1c; }

.bill-list {
  max-height: 320px;
  overflow-y: auto;
  margin: 0 -4px;
  padding: 0 4px;
}

.bill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .13s;
}

.bill-row:hover { background: #f6f9fc; }

.bill-row.current { background: var(--blue-soft); }

.bill-month {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: none;
  width: 62px;
}

.bill-mid {
  flex: 1;
  min-width: 0;
  font-size: 11px;
  color: var(--text-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bill-amt {
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex: none;
}

.bill-amt.paid { color: var(--text-3); font-weight: 500; }
.bill-amt.unpaid { color: #b91c1c; }

.bill-flag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--green-soft);
  color: var(--green-deep);
  flex: none;
}

/* 备注面板 */
.panel-sub {
  font-size: 11px;
  color: var(--text-3);
}

.note-panel { padding: 16px 16px 12px; }

.note-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 230px;
  overflow-y: auto;
}

.note-item {
  display: flex;
  gap: 9px;
  padding: 7px 6px;
  border-radius: 8px;
  cursor: pointer;
  transition: background .13s;
  align-items: flex-start;
}

.note-item:hover { background: #f6f9fc; }

.note-date {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  font-variant-numeric: tabular-nums;
  flex: none;
  width: 44px;
  padding-top: 1px;
}

.note-text {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.45;
  flex: 1;
  min-width: 0;
  word-break: break-all;
}

.note-text .reason-tag {
  display: inline-block;
  font-size: 10px;
  padding: 0 5px;
  border-radius: 4px;
  background: var(--red-soft);
  color: var(--red-deep);
  margin-right: 5px;
  vertical-align: 1px;
}

.note-empty {
  padding: 18px 0 14px;
  text-align: center;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.6;
}

/* ---------------- 弹窗 ---------------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(15, 23, 42, .42);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .18s ease;
}

.modal-backdrop[hidden] { display: none; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(10px) scale(.985); } to { opacity: 1; transform: none; } }

.modal {
  width: 100%;
  max-width: 440px;
  max-height: min(88vh, 780px);
  background: #fff;
  border-radius: 18px;
  box-shadow: var(--shadow-pop);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: popIn .2s cubic-bezier(.2, .8, .3, 1);
}

.modal-sm { max-width: 380px; }
.modal-wide { max-width: 600px; }

.modal-grab { display: none; }

.modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 12px;
}

.modal-head h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.2px;
}

.modal-head p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--text-3);
}

.close-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  color: var(--text-3);
  flex: none;
}

.close-btn:hover { background: #f1f5f9; color: var(--text); }

.modal-body {
  padding: 4px 20px 18px;
  overflow-y: auto;
  flex: 1;
}

.modal-foot {
  display: flex;
  gap: 10px;
  padding: 14px 20px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: #fcfdfe;
}

.modal-foot > * { flex: 1; }

/* 表单 */
.field { margin-bottom: 16px; }

.field-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 8px;
  letter-spacing: .2px;
}

.field-hint {
  margin: 7px 0 0;
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.5;
}

.seg {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: #f4f7fa;
  padding: 4px;
  border-radius: 11px;
}

.seg button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 34px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  transition: all .15s;
}

.seg button:hover { background: rgba(255, 255, 255, .7); }

.seg button.active {
  background: #fff;
  color: var(--text);
  font-weight: 600;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .12);
}

.seg button.active[data-status="completed"] { color: var(--green-deep); }
.seg button.active[data-status="skipped"] { color: var(--red-deep); }

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.chip {
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font-size: 12px;
  color: var(--text-2);
  transition: all .14s;
}

.chip:hover { border-color: #c0cfe0; }

.chip.active {
  background: var(--red-soft);
  border-color: #fbcaca;
  color: var(--red-deep);
  font-weight: 600;
}

textarea, input[type="text"], input[type="number"], input[type="date"],
input[type="month"], input[type="time"], select {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 11px;
  font-size: 13.5px;
  background: #fff;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
  -webkit-appearance: none;
  appearance: none;
}

textarea { resize: vertical; min-height: 66px; line-height: 1.55; }

textarea:focus, input:focus, select:focus {
  border-color: #94b3d6;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .09);
}

select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  padding-right: 32px;
}

.char-count {
  text-align: right;
  font-size: 10.5px;
  color: var(--text-3);
  margin-top: 3px;
}

/* 设置 */
.tabs {
  display: flex;
  gap: 2px;
  padding: 0 20px;
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar { display: none; }

.tabs button {
  padding: 9px 12px 11px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  white-space: nowrap;
  transition: color .15s, border-color .15s;
}

.tabs button:hover { color: var(--text-2); }

.tabs button.active {
  color: var(--text);
  font-weight: 600;
  border-bottom-color: #0f172a;
}

.tab-body { padding-top: 18px; }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 9px 0;
  border-bottom: 1px dashed #f0f4f8;
}

.form-row label {
  font-size: 13px;
  color: var(--text-2);
  flex: none;
}

.form-row input, .form-row select {
  width: 152px;
  flex: none;
  text-align: right;
}

.form-static {
  font-size: 12.5px;
  color: var(--text-3);
  text-align: right;
  line-height: 1.4;
  max-width: 60%;
}

.tip {
  margin: 12px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: var(--text-3);
  background: #f8fafc;
  border-radius: 9px;
  padding: 10px 12px;
}

.tip code {
  background: #eef2f7;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
  color: #475569;
}

.vac-form, .sp-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 14px;
}

.vac-form input[type="text"] { flex: 1; min-width: 120px; }
.vac-form input[type="date"] { width: 138px; flex: none; }
.sp-form input[type="date"] { width: 138px; flex: none; }
.sp-form select { width: 148px; flex: none; }
.sp-form input[type="text"] { flex: 1; min-width: 100px; }

.range-dash { font-size: 12px; color: var(--text-3); }

.vac-form .btn-primary, .sp-form .btn-primary {
  height: 38px;
  flex: none;
  padding: 0 18px;
}

.list {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
}

.list-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fcfdfe;
  font-size: 12.5px;
}

.list-row .lr-name { font-weight: 600; color: var(--text); }
.list-row .lr-range {
  color: var(--text-3);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.list-row .lr-spacer { flex: 1; }

.del-btn {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  color: #c3ccd8;
  flex: none;
  transition: all .14s;
}

.del-btn:hover { background: var(--red-soft); color: var(--red); }

.empty-hint {
  padding: 22px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-3);
}

.data-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.data-actions .btn-minor { flex: 1; min-width: 130px; }

.preset-note {
  margin-top: 16px;
  padding: 12px 14px;
  background: #fffbeb;
  border: 1px solid #fde9b8;
  border-radius: 10px;
}

.preset-note strong { font-size: 12px; color: #92400e; }

.preset-note p {
  margin: 5px 0 0;
  font-size: 11.5px;
  line-height: 1.65;
  color: #a16207;
}

/* 结算弹窗 */
.settle-summary {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.settle-summary .ss-cell {
  flex: 1;
  background: #f8fafc;
  border-radius: 10px;
  padding: 10px 12px;
}

.settle-summary .ss-k { font-size: 10.5px; color: var(--text-3); }
.settle-summary .ss-v {
  font-size: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.3px;
  margin-top: 1px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(12px);
  background: rgba(15, 23, 42, .93);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 200;
  opacity: 0;
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  max-width: 86vw;
  text-align: center;
}

.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ==========================================================
   响应式
   ========================================================== */

@media (max-width: 1024px) {
  .layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    padding: 16px;
    gap: 14px;
  }
  .cell { min-height: 100px; }
  .cell-empty { min-height: 100px; }
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "stat"
      "cal"
      "bill"
      "note";
    padding: 12px 12px 28px;
    gap: 12px;
  }

  /* 手机上统计卡变横向紧凑 */
  .stat-panel { padding: 14px 15px; }
  .stat-hero {
    display: flex;
    align-items: baseline;
    gap: 10px;
    flex-wrap: wrap;
  }
  .stat-hero-value { font-size: 26px; }
  .stat-hero-sub { margin-top: 0; flex: 1 1 100%; }
  .stat-row { margin-top: 10px; padding-top: 10px; }

  .bill-panel { padding: 14px 14px 10px; }
  .note-panel { padding: 14px 14px 8px; }
  .bill-list { max-height: none; }
  .note-list { max-height: none; }

  .topbar {
    padding: 11px 14px;
    gap: 8px;
  }
  .brand, .top-actions { flex: none; }
  .month-nav { flex: 1; justify-content: center; }
  .brand-sub-hide { display: none; }
  .brand-text { display: none; }
  .month-label { min-width: 92px; font-size: 13.5px; }
  .btn-icon-text span { display: none; }
  .btn-ghost { padding: 0 10px; }
  .btn-ghost#btnToday { padding: 0 12px; }

  .calendar-panel { padding: 12px 10px 8px; }
  .weekhead { gap: 4px; padding-bottom: 8px; }
  .grid { gap: 4px; }

  .cell {
    min-height: 62px;
    padding: 5px 5px 4px;
    border-radius: 9px;
  }
  .cell-empty { min-height: 62px; }

  .cell-num {
    font-size: 12.5px;
    width: 19px;
    height: 19px;
  }
  .cell-head { align-items: center; }
  .cell-dot { margin-top: 2px; }
  .dot { width: 6px; height: 6px; }
  .dot-ring { width: 6px; height: 6px; border-width: 1.3px; }
  .dot-green { box-shadow: 0 0 0 2px rgba(34, 197, 94, .14); }
  .dot-red { box-shadow: 0 0 0 2px rgba(239, 68, 68, .12); }

  .cell-body { margin-top: 3px; }
  .cell-note { display: none; }
  .cell-foot { margin-top: auto; }
  .cell-amount { font-size: 9.5px; }
  .cell-src { display: none; }

  .cell-tag {
    font-size: 9px;
    line-height: 13px;
    padding: 0 3px;
    border-radius: 4px;
    max-width: 100%;
  }

  .legend {
    gap: 12px;
    font-size: 11px;
    padding-top: 10px;
  }
  .legend-hint { display: none !important; }

  /* 弹窗改为底部抽屉 */
  .modal-backdrop {
    padding: 0;
    align-items: flex-end;
  }
  .modal {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 20px 20px 0 0;
    animation: slideUp .26s cubic-bezier(.22, .9, .3, 1);
  }
  @keyframes slideUp {
    from { transform: translateY(24px); opacity: .6; }
    to { transform: none; opacity: 1; }
  }
  .modal-grab {
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: #e2e8f0;
    margin: 8px auto 0;
  }
  .modal-head { padding: 12px 16px 10px; }
  .modal-head h2 { font-size: 16px; }
  .modal-body { padding: 4px 16px 16px; }
  .modal-foot { padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); }
  .tabs { padding: 0 16px; }

  .form-row input, .form-row select { width: 138px; }

  .vac-form input[type="date"], .sp-form input[type="date"] { width: calc(50% - 22px); }
  .sp-form select { width: 100%; }
}

@media (max-width: 380px) {
  .cell { min-height: 56px; }
  .cell-empty { min-height: 56px; }
  .cell-num { font-size: 11.5px; width: 17px; height: 17px; }
  .brand-text { display: none; }
}
