/* ============ 设计变量 ============ */
:root {
  --bg: #f4f7f5;
  --bg-soft: #eef3f0;
  --card: #ffffff;
  --card-2: #fafcfb;
  --line: #e3e9e6;
  --line-strong: #d3dcd8;
  --text: #0e1a17;
  --text-2: #475a54;
  --muted: #7c8f88;
  --primary: #10b981;
  --primary-strong: #059669;
  --primary-soft: #e7f8f1;
  --amber: #d97706;
  --amber-soft: #fef3e2;
  --danger: #dc2626;
  --danger-soft: #feeceb;
  --sky: #0284c7;
  --shadow-sm: 0 1px 2px rgba(16, 40, 32, 0.05);
  --shadow: 0 8px 24px rgba(16, 40, 32, 0.08);
  --radius: 16px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

html[data-theme='dark'] {
  --bg: #0a1210;
  --bg-soft: #0f1a17;
  --card: #111d19;
  --card-2: #142520;
  --line: #1f332c;
  --line-strong: #2a453c;
  --text: #e8f1ed;
  --text-2: #b3c6bf;
  --muted: #7e948c;
  --primary: #34d399;
  --primary-strong: #10b981;
  --primary-soft: #10352a;
  --amber: #fbbf24;
  --amber-soft: #3a2a10;
  --danger: #f87171;
  --danger-soft: #3a1a1a;
  --sky: #38bdf8;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
}

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

html,
body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei',
    'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

body {
  min-height: 100dvh;
}

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

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

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

input,
textarea {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--text);
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 16%, transparent);
}

input.invalid {
  border-color: var(--danger);
}

textarea {
  resize: vertical;
  min-height: 76px;
  line-height: 1.6;
}

::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.app {
  min-height: 100dvh;
  padding-bottom: calc(78px + var(--safe-b));
  max-width: 980px;
  margin: 0 auto;
}

.main {
  padding: 0 12px 20px;
}

/* ============ 顶部 ============ */
.header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
  padding: 10px 12px 8px;
}

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

.title-btn {
  text-align: left;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.title-btn h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 6px;
}

.practice-badge {
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: #8b5cf6;
  border-radius: 20px;
  padding: 1px 7px;
  letter-spacing: 0;
}

.saved {
  font-size: 11px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 5px;
}

.saved i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
}

.saved.err {
  color: var(--danger);
}

.saved.err i {
  background: var(--danger);
}

.saved.warn {
  color: var(--amber);
}

.saved.warn i {
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent);
}

.sync-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--primary-strong);
  background: var(--primary-soft);
  border-radius: 20px;
  padding: 1px 6px;
  letter-spacing: 0;
}

.sync-card {
  border: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 13px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.sync-head {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12.5px;
}

.sync-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent);
  flex: none;
}

.sync-card.offline .sync-dot {
  background: var(--amber);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--amber) 18%, transparent);
}

.sync-card.locked .sync-dot,
.sync-card.error .sync-dot {
  background: var(--danger);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger) 18%, transparent);
}

.sync-head em {
  margin-left: auto;
  font-style: normal;
  font-size: 10px;
  color: var(--muted);
}

.sync-card p {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 2px;
}

.icon-btn {
  position: relative;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--text-2);
  transition: background 0.15s;
}

.icon-btn:hover {
  background: var(--bg-soft);
}

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

.icon-btn.small {
  width: 32px;
  height: 32px;
  font-size: 14px;
  border-radius: 9px;
}

.count-badge,
.dot-badge {
  position: absolute;
  top: 2px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 9px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  border: 2px solid var(--bg);
}

.dot-badge {
  background: var(--line-strong);
  color: var(--text-2);
}

.dot-badge:empty {
  display: none;
}

.banner {
  margin-top: 8px;
  padding: 9px 12px;
  border-radius: 10px;
  font-size: 12.5px;
  line-height: 1.5;
}

.banner.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.practice-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 8px 12px 0;
  padding: 8px 12px;
  border-radius: 12px;
  background: #f3edff;
  color: #6d28d9;
  font-size: 12px;
  font-weight: 600;
}

html[data-theme='dark'] .practice-strip {
  background: #241a3d;
  color: #c4b5fd;
}

.practice-strip button {
  flex: none;
  background: #6d28d9;
  color: #fff;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
}

/* ============ 账单标签 ============ */
.batchbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0 4px;
  position: relative;
}

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 4px;
  flex: 1;
}

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

.chip-wrap {
  position: relative;
  flex: none;
  display: flex;
  align-items: center;
}

.chip {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 7px 12px;
  min-width: 92px;
  border-radius: 13px;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
  color: var(--text-2);
  text-align: left;
}

.chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 34%, transparent);
}

.chip.archived {
  border-style: dashed;
}

.chip-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.chip-meta {
  position: relative;
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 3px;
  background: color-mix(in srgb, currentColor 18%, transparent);
  overflow: hidden;
  margin-top: 1px;
}

.chip-meta i {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--primary);
}

.chip.active .chip-meta {
  background: rgba(255, 255, 255, 0.28);
}

.chip.active .chip-meta i {
  background: #fff;
}

.chip.add {
  min-width: auto;
  justify-content: center;
  align-items: center;
  border-style: dashed;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 12px;
}

.chip.active {
  padding-right: 28px;
}

.chip-more {
  position: absolute;
  right: 3px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chip-more:active {
  background: rgba(255, 255, 255, 0.3);
}

.chip-list,
.chip-arch {
  flex: none;
  font-size: 11.5px;
  color: var(--muted);
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 6px 9px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.chip-list em {
  font-style: normal;
  background: var(--bg-soft);
  border-radius: 6px;
  padding: 0 5px;
  font-size: 10px;
}

.chip-arch.on {
  color: var(--primary-strong);
  border-color: color-mix(in srgb, var(--primary) 40%, transparent);
}

/* ============ 汇总 ============ */
.summary {
  background: linear-gradient(160deg, var(--card) 0%, var(--card-2) 100%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px 10px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

.summary-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.summary-top > div {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.summary .label {
  font-size: 11px;
  color: var(--muted);
}

.summary b {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
  white-space: nowrap;
}

.green {
  color: var(--primary-strong);
}

.amber {
  color: var(--amber);
}

.progress {
  height: 6px;
  background: var(--bg-soft);
  border-radius: 6px;
  margin: 10px 0 6px;
  overflow: hidden;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--primary), #34d399);
  transition: width 0.35s ease;
}

.summary-sub {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
}

/* ============ 工具条 ============ */
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.seg {
  display: inline-flex;
  background: var(--bg-soft);
  border-radius: 11px;
  padding: 3px;
  gap: 2px;
  flex: none;
}

.seg button {
  padding: 6px 10px;
  border-radius: 8px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  font-weight: 600;
}

.seg button.on {
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}

.seg.small button {
  padding: 5px 9px;
  font-size: 11.5px;
}

.search {
  position: relative;
  flex: 1;
  min-width: 0;
}

.search input {
  padding: 8px 30px 8px 12px;
  border-radius: 11px;
  font-size: 13px;
  background: var(--card);
}

.search .clear {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted);
  font-size: 11px;
}

.quick-actions {
  display: flex;
  gap: 5px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
}

.quick-actions::-webkit-scrollbar {
  display: none;
}

.quick-actions button {
  flex: none;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.quick-actions button:active {
  background: var(--bg-soft);
}

/* ============ 房间卡片 ============ */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 9px;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 11px 8px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s, border-color 0.15s, background 0.15s;
  cursor: pointer;
  user-select: none;
  overflow: hidden;
}

.card:active {
  transform: scale(0.985);
}

.card.paid {
  background: linear-gradient(160deg, var(--primary-soft), var(--card));
  border-color: color-mix(in srgb, var(--primary) 42%, var(--line));
}

.card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 4px;
}

.room {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.2px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.bldg {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--sky);
  background: color-mix(in srgb, var(--sky) 12%, transparent);
  border-radius: 5px;
  padding: 1px 4px;
}

.check {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  flex: none;
}

.check.on {
  background: var(--primary);
  border-color: var(--primary);
}

.amt {
  font-size: 19px;
  font-weight: 780;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
  display: flex;
  align-items: baseline;
  gap: 1px;
}

.amt small {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-right: 1px;
}

.card.paid .amt {
  color: var(--primary-strong);
}

.manual-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  margin-left: 4px;
  align-self: center;
}

.meter {
  font-size: 11px;
  color: var(--text-2);
  display: flex;
  gap: 7px;
  margin-top: 2px;
  white-space: nowrap;
}

.meter.pending {
  color: var(--amber);
}

.muted {
  color: var(--muted);
}

.card-note {
  margin: 5px 0 0;
  font-size: 11.5px;
  color: var(--text-2);
  background: color-mix(in srgb, var(--amber) 10%, transparent);
  border-radius: 7px;
  padding: 3px 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line);
}

.pay-date {
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
}

.pay-date.paid {
  color: var(--primary-strong);
}

.card-tools {
  display: flex;
  gap: 1px;
}

.card-tools button {
  width: 26px;
  height: 24px;
  border-radius: 7px;
  font-size: 12px;
  opacity: 0.62;
}

.card-tools button.has {
  opacity: 1;
  background: color-mix(in srgb, var(--amber) 14%, transparent);
}

.card-tools button:hover {
  background: var(--bg-soft);
  opacity: 1;
}

/* ============ 空状态 ============ */
.empty {
  text-align: center;
  padding: 44px 16px;
  color: var(--muted);
}

.empty-icon {
  font-size: 34px;
  margin-bottom: 6px;
}

.empty p {
  margin: 0 0 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.empty small {
  font-size: 12px;
  color: var(--muted);
}

/* ============ 底部导航 ============ */
.bottomnav {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 980px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
  padding: 5px 4px calc(5px + var(--safe-b));
  z-index: 40;
}

.bottomnav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 5px 2px;
  border-radius: 11px;
  font-size: 10.5px;
  color: var(--muted);
  font-weight: 600;
  position: relative;
}

.bottomnav button span {
  font-size: 18px;
  line-height: 1.2;
}

.bottomnav button.on {
  color: var(--primary-strong);
}

.bottomnav button.on span {
  transform: translateY(-1px);
}

.nav-bell {
  position: relative;
  display: inline-block;
}

.nav-bell i {
  position: absolute;
  top: -3px;
  right: -8px;
  font-style: normal;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  border-radius: 8px;
  padding: 0 4px;
  line-height: 14px;
  min-width: 14px;
  font-weight: 700;
}

/* ============ Toast ============ */
.toast {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(74px + var(--safe-b));
  z-index: 120;
  display: flex;
  align-items: center;
  gap: 10px;
  background: #10201b;
  color: #f0fdf7;
  padding: 11px 12px;
  border-radius: 13px;
  box-shadow: var(--shadow);
  font-size: 12.5px;
  animation: toast-in 0.22s ease;
  max-width: 560px;
  margin: 0 auto;
}

html[data-theme='dark'] .toast {
  background: #e8f5ef;
  color: #0b1a15;
}

.toast span {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
}

.toast button {
  flex: none;
  font-size: 12px;
  font-weight: 700;
  color: #34d399;
  background: rgba(52, 211, 153, 0.12);
  padding: 5px 10px;
  border-radius: 8px;
}

html[data-theme='dark'] .toast button {
  color: #047857;
  background: rgba(4, 120, 87, 0.12);
}

.toast .toast-x {
  color: inherit;
  background: none;
  font-size: 12px;
  opacity: 0.6;
  padding: 2px 4px;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============ 弹层 ============ */
.sheet-mask {
  position: fixed;
  inset: 0;
  background: rgba(3, 15, 11, 0.5);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.18s ease;
  backdrop-filter: blur(2px);
}

.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  animation: sheet-up 0.24s cubic-bezier(0.2, 0.9, 0.3, 1);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.sheet-wide {
  max-width: 640px;
}

.sheet-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex: none;
}

.sheet-title-wrap {
  min-width: 0;
}

.sheet-head h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.2px;
}

.sheet-sub {
  margin: 3px 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

.x-btn {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--bg-soft);
  font-size: 12px;
  flex: none;
}

.sheet-body {
  padding: 14px 16px;
  overflow-y: auto;
  overscroll-behavior: contain;
  flex: 1;
}

.sheet-foot {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  padding: 10px 16px calc(12px + var(--safe-b));
  border-top: 1px solid var(--line);
  background: var(--card);
}

.sheet-foot .checkline {
  margin-right: auto;
}

@keyframes sheet-up {
  from {
    transform: translateY(24px);
    opacity: 0.6;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ============ 表单 ============ */
.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
  min-width: 0;
}

.field-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
}

.field-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.three-col {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 10px 16px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid transparent;
  transition: transform 0.1s, filter 0.15s;
}

.btn:active {
  transform: scale(0.98);
}

.btn.primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 32%, transparent);
}

.btn.primary:hover {
  filter: brightness(1.04);
}

.btn.ghost {
  background: var(--card);
  border-color: var(--line-strong);
  color: var(--text-2);
}

.btn.danger {
  background: var(--danger);
  color: #fff;
}

.btn.tiny {
  padding: 6px 10px;
  font-size: 11.5px;
  border-radius: 9px;
}

.btn.block {
  width: 100%;
  margin: 8px 0;
}

.btn-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.danger-text {
  color: var(--danger);
}

.link {
  font-size: 12px;
  font-weight: 650;
  color: var(--primary-strong);
  padding: 2px 0;
}

.switchline,
.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
}

.switchline {
  margin: 4px 0 12px;
}

.switchline input,
.checkline input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  flex: none;
}

.checkcard {
  display: flex;
  gap: 10px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg-soft);
  cursor: pointer;
  margin-top: 4px;
}

.checkcard input {
  width: 17px;
  height: 17px;
  accent-color: var(--primary);
  margin-top: 1px;
  flex: none;
}

.checkcard b {
  display: block;
  font-size: 13px;
}

.checkcard small {
  display: block;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 3px;
}

.meter-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: var(--bg-soft);
  border-radius: 14px;
  padding: 11px 11px 2px;
  margin-bottom: 12px;
}

.mini-label {
  font-size: 11px;
  font-weight: 750;
  color: var(--text-2);
  display: block;
  margin-bottom: 6px;
}

.calc-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  background: color-mix(in srgb, var(--sky) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--sky) 22%, transparent);
  border-radius: 13px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.calc-box > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text-2);
}

.calc-box b {
  font-variant-numeric: tabular-nums;
}

.calc-total {
  border-top: 1px dashed color-mix(in srgb, var(--sky) 30%, transparent);
  padding-top: 6px;
  font-weight: 700;
}

.calc-total b {
  color: var(--primary-strong);
  font-size: 15px;
}

.big-textarea {
  min-height: 140px;
  font-size: 14px;
}

.paste-area {
  min-height: 150px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  margin-bottom: 8px;
}

.hint-card {
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 10px 12px;
  margin-bottom: 12px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.6;
}

.hint-card b {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.hint-card p {
  margin: 0 0 6px;
}

.hint-card small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-top: 4px;
}

.hint-card code {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 7px;
  font-size: 11.5px;
  margin: 3px 0;
  overflow-x: auto;
  white-space: pre;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
  color: var(--text-2);
  margin: 10px 0 6px;
}

.preview-table {
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
}

.preview-table table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.preview-table th,
.preview-table td {
  padding: 6px 9px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.preview-table th {
  background: var(--bg-soft);
  color: var(--muted);
  font-weight: 600;
  font-size: 11px;
}

.preview-table tr:last-child td {
  border-bottom: none;
}

.more-hint,
.warn-text {
  font-size: 11px;
  color: var(--muted);
  margin: 6px 0 0;
}

.warn-text {
  color: var(--amber);
}

/* ============ 菜单列表 ============ */
.menu-list {
  display: flex;
  flex-direction: column;
  margin: 0 -6px;
}

.menu-row {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  width: 100%;
  border-radius: 8px;
}

.menu-row:last-child {
  border-bottom: none;
}

.menu-row:hover {
  background: var(--bg-soft);
}

.menu-icon {
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex: none;
}

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

.menu-text b {
  font-size: 13.5px;
  font-weight: 650;
}

.menu-text small {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.45;
}

.chev {
  color: var(--muted);
  font-size: 18px;
  flex: none;
}

.menu-row.danger .menu-text b,
.menu-row.danger .menu-icon {
  color: var(--danger);
}

/* ============ 统计 / 欠租 / 历史 ============ */
.stat-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.stat-cards > div {
  background: var(--bg-soft);
  border-radius: 13px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.stat-cards span {
  font-size: 11px;
  color: var(--muted);
}

.stat-cards b {
  font-size: 17px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.3px;
}

.stat-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.stat-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 9px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: var(--card);
  text-align: left;
}

.stat-row:hover {
  border-color: var(--line-strong);
}

.stat-row-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: 12.5px;
}

.stat-row-top b {
  display: flex;
  align-items: center;
  gap: 5px;
}

.stat-row-top span {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}

.bar {
  height: 5px;
  border-radius: 5px;
  background: var(--bg-soft);
  overflow: hidden;
}

.bar i {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 5px;
}

.stat-row-sub {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  color: var(--muted);
}

.mini-tag {
  font-style: normal;
  font-size: 9.5px;
  background: var(--bg-soft);
  color: var(--muted);
  border-radius: 4px;
  padding: 0 4px;
  font-weight: 600;
}

.arrear-group {
  margin-bottom: 14px;
}

.arrear-group h4 {
  margin: 0 0 6px;
  font-size: 12.5px;
  display: flex;
  justify-content: space-between;
  color: var(--text-2);
}

.arrear-group h4 span {
  color: var(--amber);
  font-weight: 600;
}

.arrear-items {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.arrear-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 6px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--card);
  min-width: 72px;
}

.arrear-item b {
  font-size: 13px;
}

.arrear-item span {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.celebrate {
  text-align: center;
  padding: 40px 0;
}

.celebrate div {
  font-size: 42px;
}

.celebrate p {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-2);
}

.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.history-list li {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.history-list time {
  font-size: 10.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.history-list p {
  margin: 2px 0 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.section-title {
  font-size: 12px;
  font-weight: 750;
  color: var(--muted);
  text-transform: none;
  margin: 18px 0 8px;
  letter-spacing: 0.2px;
}

.backup-actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.backup-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.backup-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.backup-list b {
  display: block;
  font-size: 12.5px;
}

.backup-list span {
  font-size: 11px;
  color: var(--muted);
}

.backup-btns {
  display: flex;
  gap: 6px;
  flex: none;
}

.sync-msg {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-2);
  background: var(--bg-soft);
  border-radius: 8px;
  padding: 7px 10px;
}

.confirm-body {
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-2);
  white-space: pre-line;
}

/* ============ 房源备忘 ============ */
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 10px;
}

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

.panel-head h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
}

.panel-hint {
  margin: 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
}

.global-memo textarea {
  min-height: 64px;
  border: none;
  background: var(--bg-soft);
  border-radius: 11px;
  padding: 9px 11px;
  font-size: 12.5px;
  transition: min-height 0.2s;
}

.global-memo textarea.tall {
  min-height: 170px;
}

.memo-toolbar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 10px;
}

.tag-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tag-filters > button {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 5px 9px;
}

.tag-filters > button.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.tag-filters .checkline {
  font-size: 11.5px;
  margin-left: auto;
}

.memo-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.memo-card {
  cursor: pointer;
}

.memo-card.has-memo {
  border-color: color-mix(in srgb, var(--primary) 32%, var(--line));
}

.tags-mini {
  display: flex;
  gap: 3px;
}

.tag {
  font-size: 10px;
  border-radius: 5px;
  padding: 1px 4px;
  background: var(--bg-soft);
  color: var(--text-2);
}

.tag-vacant {
  background: color-mix(in srgb, #8b5cf6 13%, transparent);
  color: #7c3aed;
}

.tag-prereturn {
  background: color-mix(in srgb, #f59e0b 15%, transparent);
  color: #b45309;
}

.tag-change {
  background: color-mix(in srgb, #0ea5e9 14%, transparent);
  color: #0369a1;
}

html[data-theme='dark'] .tag-vacant {
  color: #c4b5fd;
}
html[data-theme='dark'] .tag-prereturn {
  color: #fcd34d;
}
html[data-theme='dark'] .tag-change {
  color: #7dd3fc;
}

.tenant {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 4px;
  font-size: 12px;
  flex-wrap: wrap;
}

.tenant b {
  font-size: 13px;
}

.tenant a {
  color: var(--sky);
  font-size: 11.5px;
  text-decoration: none;
}

.memo-line {
  margin: 4px 0 0;
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.45;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-picker {
  display: flex;
  gap: 6px;
}

.tag-pick {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 650;
  color: var(--text-2);
  background: var(--card);
}

.tag-pick.on {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-strong);
}

.change-list {
  list-style: none;
  margin: 6px 0 0;
  padding: 0;
}

.change-list li {
  display: grid;
  grid-template-columns: 78px 1fr 28px;
  align-items: start;
  gap: 8px;
  padding: 7px 0;
  border-top: 1px solid var(--line);
}

.change-list time {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  padding-top: 2px;
}

.change-list p {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}

.year-group {
  margin-bottom: 12px;
}

.year-title {
  font-size: 11px;
  font-weight: 750;
  color: var(--muted);
  margin: 6px 0 4px;
  letter-spacing: 0.4px;
}

.batch-row {
  display: flex;
  align-items: center;
  gap: 4px;
  border-bottom: 1px solid var(--line);
}

.batch-row.dim {
  opacity: 0.55;
}

.batch-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
  padding: 8px 4px;
}

.batch-row-main b {
  font-size: 13px;
}

.batch-row-main span {
  font-size: 11px;
  color: var(--muted);
}

/* ============ 帮助 ============ */
.help section {
  margin-bottom: 16px;
}

.help h4 {
  margin: 0 0 5px;
  font-size: 13px;
  font-weight: 750;
}

.help ul {
  margin: 0;
  padding-left: 18px;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.help li {
  margin-bottom: 3px;
}

/* ============ 桌面 ============ */
@media (min-width: 720px) {
  .header {
    padding: 12px 20px 8px;
  }
  .main {
    padding: 0 20px 24px;
  }
  .title-btn h1 {
    font-size: 19px;
  }
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
    gap: 11px;
  }
  .sheet-mask {
    align-items: center;
  }
  .sheet {
    border-radius: 20px;
    max-height: 84vh;
  }
  .toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    width: auto;
    min-width: 320px;
  }
}

@media (max-width: 380px) {
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .amt {
    font-size: 17px;
  }
  .quick-actions button {
    font-size: 11.5px;
    padding: 6px 8px;
  }
  .stat-cards {
    grid-template-columns: 1fr 1fr;
  }
}

/* ============ 只读分享页 ============ */
.viewer {
  min-height: 100dvh;
  padding-bottom: calc(78px + var(--safe-b));
  max-width: 980px;
  margin: 0 auto;
}

.viewer-head {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 14px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.viewer-title h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 750;
  display: flex;
  align-items: center;
  gap: 6px;
  letter-spacing: -0.2px;
}

.ro-badge {
  font-size: 9.5px;
  font-weight: 700;
  color: var(--sky);
  background: color-mix(in srgb, var(--sky) 12%, transparent);
  border-radius: 20px;
  padding: 1px 6px;
}

.viewer .board {
  padding: 10px 12px 0;
}

.viewer-bar {
  padding: 8px 12px 0;
  margin: 0;
}

.viewer-nav {
  grid-template-columns: 1fr 1fr;
}

.viewer-foot {
  text-align: center;
  font-size: 11px;
  color: var(--muted);
  margin: 22px 0 6px;
}

.card.readonly {
  cursor: default;
}

.card.readonly:active {
  transform: none;
}

.readonly-memo {
  margin: 0;
  white-space: pre-wrap;
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--text-2);
}

.memo-time {
  margin-top: 6px;
  font-size: 10px;
  color: var(--muted);
}

.phone-text {
  font-size: 11.5px;
  color: var(--sky);
}

.link-box {
  display: flex;
  gap: 6px;
  margin: 6px 0 10px;
}

.link-box input {
  font-size: 12px;
  padding: 9px 10px;
  background: var(--bg-soft);
}

.link-box .btn {
  flex: none;
  padding: 9px 14px;
}


/* ==================================================================
   2026 视觉改版：米色底 + 深绿顶栏 + 绿色渐变汇总 + 表格
   ================================================================== */
:root {
  --bg: #f6f0e6;
  --bg-soft: #efe6d7;
  --card: #fffdf8;
  --card-2: #fbf6ec;
  --line: #e7dccb;
  --line-strong: #d9cab4;
  --text: #22312c;
  --text-2: #4d5f58;
  --muted: #88968f;
  --primary: #2f9e8f;
  --primary-strong: #237f72;
  --primary-soft: #e4f3ee;
  --amber: #c47f27;
  --amber-soft: #f9ecd9;
  --sky: #3b7f8f;
  --danger: #c05245;
  --danger-soft: #f9e7e3;
  --shadow-sm: 0 1px 2px rgba(80, 60, 30, 0.05);
  --shadow: 0 10px 28px rgba(60, 45, 25, 0.1);
  --radius: 14px;
  --topbar: #2f9e8f;
  --topbar-deep: #26897c;
}

html[data-theme='dark'] {
  --bg: #121a17;
  --bg-soft: #18241f;
  --card: #19251f;
  --card-2: #1e2b25;
  --line: #2a3a33;
  --line-strong: #38493f;
  --text: #eaf2ed;
  --text-2: #b6c6be;
  --muted: #7f9188;
  --primary: #34b7a4;
  --primary-strong: #5ed0bd;
  --primary-soft: #12332c;
  --amber: #e0a04a;
  --amber-soft: #3a2a12;
  --sky: #5fb3c4;
  --danger: #e0705f;
  --danger-soft: #3a1c18;
  --topbar: #1d5f56;
  --topbar-deep: #174c45;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB',
    'Microsoft YaHei', 'Segoe UI', sans-serif;
  letter-spacing: 0.01em;
}

.app {
  max-width: none;
  padding-bottom: 0;
}

.main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}

/* ---------------- 顶栏 ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(180deg, var(--topbar), var(--topbar-deep));
  color: #fff;
  box-shadow: 0 2px 10px rgba(30, 70, 60, 0.12);
}

.topbar-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-align: left;
  min-width: 0;
}

.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

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

.brand-text b {
  font-size: 17px;
  font-weight: 750;
  letter-spacing: 0.3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sync-state {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 10.5px;
  font-style: normal;
  opacity: 0.82;
  letter-spacing: 0.2px;
}

.sync-state i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #bff3e6;
  box-shadow: 0 0 0 3px rgba(191, 243, 230, 0.18);
}

.sync-state.warn i {
  background: #ffe0a3;
}

.sync-state.bad i {
  background: #ffc4bb;
}

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

.practice-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  white-space: nowrap;
}

.practice-chip.on {
  background: #fff;
  color: var(--primary-strong);
  border-color: #fff;
}

.period {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.13);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.period-label {
  font-size: 11px;
  opacity: 0.78;
  white-space: nowrap;
}

.period-select {
  position: relative;
  display: flex;
  align-items: center;
}

.period-select select {
  appearance: none;
  -webkit-appearance: none;
  background: transparent;
  border: none;
  box-shadow: none;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  padding: 2px 18px 2px 0;
  width: auto;
  max-width: 170px;
  cursor: pointer;
}

.period-select select option {
  color: var(--text);
  background: #fff;
}

.period-select svg {
  position: absolute;
  right: 0;
  pointer-events: none;
  opacity: 0.75;
}

.period-more {
  color: rgba(255, 255, 255, 0.82);
  display: flex;
  align-items: center;
  padding: 2px;
  border-radius: 6px;
}

.period-more:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.top-icons {
  display: flex;
  align-items: center;
  gap: 2px;
}

.top-icon {
  position: relative;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  opacity: 0.92;
}

.top-icon:hover {
  background: rgba(255, 255, 255, 0.13);
  opacity: 1;
}

.top-badge {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 15px;
  height: 15px;
  padding: 0 4px;
  border-radius: 8px;
  background: #e4573f;
  color: #fff;
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  line-height: 15px;
  text-align: center;
  border: 2px solid var(--topbar);
}

/* ---------------- 顶部两个大 Tab ---------------- */
.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
  margin-bottom: 16px;
}

.tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 650;
  color: #6f7f77;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.tabs button.on {
  background: var(--card);
  color: var(--text);
  box-shadow: 0 2px 8px rgba(80, 60, 30, 0.08);
}

/* ---------------- 绿色渐变汇总 ---------------- */
.summary-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #3aa892 0%, #2b8a7a 100%);
  color: #fff;
  border-radius: 14px;
  padding: 16px 20px 14px;
  box-shadow: 0 12px 26px rgba(43, 138, 122, 0.22);
}

.summary-card::after {
  content: '';
  position: absolute;
  right: -60px;
  top: -80px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

.summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  position: relative;
  z-index: 1;
}

.summary-eyebrow {
  margin: 0 0 3px;
  font-size: 12px;
  opacity: 0.85;
  letter-spacing: 0.3px;
}

.summary-amount {
  margin: 0;
  font-size: 30px;
  font-weight: 750;
  letter-spacing: -0.6px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.summary-amount span {
  font-size: 15px;
  font-weight: 500;
  opacity: 0.72;
  letter-spacing: 0;
}

.summary-pill {
  flex: none;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}

.summary-bar {
  position: relative;
  z-index: 1;
  height: 5px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.24);
  margin: 14px 0 8px;
  overflow: hidden;
}

.summary-bar i {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: #fff;
  transition: width 0.35s ease;
}

.summary-foot {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 11.5px;
  opacity: 0.82;
  letter-spacing: 0.2px;
}

/* ---------------- 工具条 ---------------- */
.action-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 10px;
}

.act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--text-2);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(80, 60, 30, 0.04);
  transition: border-color 0.15s, color 0.15s, background 0.15s;
}

.act:hover {
  border-color: var(--primary);
  color: var(--primary-strong);
}

.act.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.act.primary:hover {
  background: var(--primary-strong);
  color: #fff;
}

.act.add {
  border-style: dashed;
  background: transparent;
}

.act:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.sub-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.search-inline {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 10px;
  border-radius: 9px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--muted);
  flex: 1;
  max-width: 300px;
}

.search-inline input {
  border: none;
  background: transparent;
  box-shadow: none;
  padding: 0;
  height: 32px;
  font-size: 12.5px;
  width: 100%;
}

.search-inline input:focus {
  box-shadow: none;
  border: none;
}

.search-inline .clear {
  color: var(--muted);
  font-size: 11px;
  padding: 2px 4px;
}

/* ---------------- 筛选胶囊 ---------------- */
.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 14px;
}

.filter-row button {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
}

.filter-row button.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.filter-row em {
  font-style: normal;
  font-size: 10.5px;
  opacity: 0.72;
}

/* ---------------- 桌面表格 ---------------- */
.room-table {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(80, 60, 30, 0.04);
}

.room-table-head,
.room-row {
  display: grid;
  grid-template-columns: 34px 96px minmax(150px, 1fr) 150px 92px 80px 84px 84px 92px;
  align-items: center;
  gap: 6px;
  padding: 0 14px;
}

.room-table-head {
  height: 40px;
  background: #f3ebdd;
  color: #7d8b84;
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

html[data-theme='dark'] .room-table-head {
  background: #1d2a24;
}

.room-table-head .num {
  text-align: left;
}

.room-row {
  height: 54px;
  border-bottom: 1px solid #f1e9db;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.12s;
}

html[data-theme='dark'] .room-row {
  border-bottom-color: #24332c;
}

.room-row:last-child {
  border-bottom: none;
}

.room-row:hover {
  background: #fbf7ef;
}

html[data-theme='dark'] .room-row:hover {
  background: #1e2c26;
}

.room-row.paid {
  background: #edf7f2;
}

html[data-theme='dark'] .room-row.paid {
  background: #16302a;
}

.room-row.paid:hover {
  background: #e4f3ec;
}

.row-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1.5px solid #cbd6d0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex: none;
}

.room-row:not(.paid) .row-check {
  border-color: #d9a441;
}

.row-check.on {
  background: var(--primary);
  border-color: var(--primary);
}

.r-room {
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--text);
}

.r-tag {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  color: #2f6f8f;
  background: #e3f0f5;
  border-radius: 4px;
  padding: 0 4px;
}

.r-note {
  color: #7a887f;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 5px;
}

.mini-tag {
  font-style: normal;
  font-size: 9.5px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.mini-tag.purple {
  color: #7752a8;
  background: #efe8f8;
}

.mini-tag.amber {
  color: #a76a1d;
  background: #f9ecd9;
}

.r-amt {
  display: flex;
  align-items: center;
  gap: 3px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.r-amt .bolt {
  color: #d99a2b;
  flex: none;
}

.paid-mark {
  font-style: normal;
  font-size: 9.5px;
  color: #8aa197;
  font-weight: 500;
  margin-left: 2px;
}

.num {
  font-variant-numeric: tabular-nums;
  color: #4f5f57;
}

html[data-theme='dark'] .num {
  color: var(--text-2);
}

.r-tools {
  display: flex;
  gap: 2px;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.15s;
}

.room-row:hover .r-tools {
  opacity: 1;
}

.r-tools button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: #7d8b84;
  display: flex;
  align-items: center;
  justify-content: center;
}

.r-tools button:hover {
  background: #e9f2ee;
  color: var(--primary-strong);
}

.r-tools button.has {
  color: var(--amber);
  background: #fbf1e2;
}

/* ---------------- 移动端卡片微调 ---------------- */
.grid {
  grid-template-columns: repeat(auto-fill, minmax(162px, 1fr));
  gap: 10px;
}

.card {
  background: var(--card);
  border-color: var(--line);
  border-radius: 12px;
  padding: 11px 12px 8px;
  box-shadow: 0 1px 3px rgba(80, 60, 30, 0.05);
}

.card.paid {
  background: linear-gradient(160deg, #e7f5ef, var(--card));
  border-color: #b9dfd0;
}

.card .room {
  color: var(--text);
}

.card .amt {
  color: var(--text);
  font-size: 20px;
}

.card.paid .amt {
  color: var(--primary-strong);
}

.card .pay-date.paid {
  color: var(--primary-strong);
}

/* ---------------- 练习模式条 ---------------- */
.practice-strip {
  max-width: 1100px;
  margin: 10px auto 0;
  background: #efe6fa;
  color: #6b46a8;
  border: 1px solid #ddcdf3;
}

html[data-theme='dark'] .practice-strip {
  background: #241a38;
  border-color: #3b2a56;
  color: #c9b6f0;
}

/* ---------------- Toast 位置（无底栏） ---------------- */
.toast {
  bottom: 24px;
}

/* ---------------- 深色下的部分覆盖 ---------------- */
html[data-theme='dark'] .tabs {
  background: #16211c;
}

html[data-theme='dark'] .tabs button.on {
  background: #22322a;
}

html[data-theme='dark'] .card {
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

html[data-theme='dark'] .card.paid {
  background: linear-gradient(160deg, #143029, var(--card));
  border-color: #23564a;
}

/* ---------------- 响应式 ---------------- */
@media (max-width: 860px) {
  .main {
    padding: 12px 12px 40px;
  }

  .topbar-inner {
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
  }

  .brand-text b {
    font-size: 15px;
  }

  .sync-state {
    font-size: 10px;
  }

  .top-actions {
    gap: 6px;
    margin-left: auto;
  }

  .practice-chip {
    display: none;
  }

  .period {
    height: 30px;
  }

  .period-select select {
    font-size: 12px;
    max-width: 130px;
  }

  .top-icon {
    width: 30px;
    height: 30px;
  }

  .summary-card {
    padding: 14px 16px 12px;
  }

  .summary-amount {
    font-size: 25px;
  }

  .summary-pill {
    font-size: 11px;
    padding: 4px 9px;
  }

  .action-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .action-bar::-webkit-scrollbar {
    display: none;
  }

  .act {
    flex: none;
    height: 32px;
    font-size: 12px;
    padding: 0 10px;
  }

  .sub-bar {
    margin-bottom: 8px;
  }

  .search-inline {
    max-width: none;
  }

  .filter-row {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .filter-row::-webkit-scrollbar {
    display: none;
  }

  .filter-row button {
    flex: none;
  }
}


/* 只读分享页适配新主题 */
.viewer {
  max-width: none;
  padding-bottom: 0;
}

.viewer-main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 20px 48px;
}

.viewer-topbar .brand-text b {
  display: flex;
  align-items: center;
  gap: 6px;
}

.viewer-topbar .ro-badge {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.viewer-refresh {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}

.viewer-refresh:hover {
  background: rgba(255, 255, 255, 0.16);
}

.viewer .board {
  padding: 0;
}

.viewer-bar {
  padding: 0;
  margin: 0 0 12px;
}

.viewer .viewer-foot {
  margin-bottom: 0;
}

@media (max-width: 860px) {
  .viewer-main {
    padding: 12px 12px 36px;
  }
}


.summary-amount {
  white-space: nowrap;
}

@media (max-width: 860px) {
  .summary-amount {
    font-size: 21px;
    letter-spacing: -0.4px;
  }
  .summary-amount span {
    font-size: 12.5px;
  }
}


/* 十巷分组 */
.room-group-label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  background: #f7efe2;
  border-top: 1px solid #eadfce;
  border-bottom: 1px solid #eadfce;
  color: #8a7761;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.room-group-label span {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.grid-group-label {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 2px;
  color: #8a7761;
  font-size: 11.5px;
  font-weight: 700;
}

.grid-group-label span {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 10px;
}

.grid-group-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line);
}

html[data-theme='dark'] .room-group-label {
  background: #1d2a24;
  border-color: #2a3a33;
  color: #b6c6be;
}


.period-more {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 7px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  font-size: 11px;
  font-weight: 600;
}

.period-more:hover {
  background: rgba(255, 255, 255, 0.22);
}

@media (max-width: 480px) {
  .period-more span {
    display: none;
  }
}


/* 隐藏 Netlify 免费版右下角角标 */
#nl-badge-frame,
iframe#nl-badge-frame {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


/* 隐藏 Netlify AI 助手浮标 */
#apollo-everywhere-overlay-icon,
[id^='apollo-everywhere'],
[class*='apollo-everywhere'] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}


.file-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 22px 16px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  background: var(--card);
  cursor: pointer;
  text-align: center;
}
.file-box input {
  display: none;
}
.file-icon {
  font-size: 28px;
  line-height: 1;
}
.file-box b {
  font-size: 14px;
}
.file-box small {
  font-size: 11.5px;
  color: var(--muted);
}


.viewer-line {
  margin: 8px 0;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
}

.viewer-line b {
  font-size: 20px;
  color: var(--primary-strong);
  margin-right: 6px;
}

.paid-text {
  color: #2f9e8f;
  font-weight: 700;
}

.unpaid-text {
  color: #c9821a;
  font-weight: 700;
}


.bolt-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 3px;
  margin-right: 2px;
  border-radius: 6px;
  cursor: pointer;
  vertical-align: middle;
}

.bolt-btn:hover {
  background: rgba(47, 158, 143, 0.12);
}


/* 水电抄表：电一行两个、水一行两个 */
.meter-box {
  display: flex !important;
  flex-direction: column;
  gap: 10px;
}

.meter-box .meter-col {
  display: grid;
  grid-template-columns: 58px 1fr 1fr;
  gap: 10px;
  align-items: end;
}

.meter-box .mini-label {
  display: block;
  grid-column: auto;
  margin-bottom: 8px;
}


/* 只读房间明细卡片 */
.detail-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(18, 32, 27, 0.45);
  backdrop-filter: blur(4px);
}

.detail-card {
  width: min(92vw, 420px);
  max-height: 86vh;
  overflow: auto;
  padding: 20px 20px 22px;
  border-radius: 22px;
  background: var(--card);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

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

.detail-eyebrow {
  font-size: 11px;
  letter-spacing: 1px;
  color: var(--muted);
}

.detail-head h2 {
  margin: 2px 0 0;
  font-size: 26px;
  line-height: 1.2;
}

.detail-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
}

.detail-amount-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 6px;
}

.detail-amount {
  font-size: 34px;
  font-weight: 800;
  color: var(--primary-strong);
  letter-spacing: -0.5px;
}

.detail-amount small {
  font-size: 17px;
  margin-right: 2px;
}

.detail-status {
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.detail-status.paid {
  background: #e6f6ef;
  color: #2f9e8f;
}

.detail-status.unpaid {
  background: #fdf1dd;
  color: #c9821a;
}

.detail-base {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
  font-size: 12.5px;
  color: var(--muted);
}

.detail-meters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.detail-meter {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--bg-soft);
}

.dm-label {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.detail-meter b {
  font-size: 21px;
  line-height: 1.2;
}

.detail-meter small {
  font-size: 11px;
  color: var(--muted);
}

.detail-notes {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  font-size: 13px;
}

.detail-notes p {
  display: flex;
  gap: 10px;
  margin: 0;
}

.detail-notes b {
  flex: 0 0 62px;
  font-weight: 600;
  color: var(--muted);
}

.detail-empty {
  margin: 10px 0;
  color: var(--muted);
  font-size: 13px;
}


.year-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  scrollbar-width: none;
}

.year-strip::-webkit-scrollbar {
  display: none;
}

.year-chip {
  flex: 0 0 auto;
  padding: 6px 13px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.year-chip.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}


/* 照片网格 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.photo-grid a,
.photo-item {
  position: relative;
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
  background: var(--bg-soft);
}

.photo-grid img,
.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 11px;
  cursor: pointer;
}

.detail-photos {
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.detail-photos-title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}


.detail-fees {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 12px 0 10px;
}

.detail-fee {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 12px;
  border-radius: 14px;
  background: var(--bg-soft);
}

.detail-fee span {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--muted);
}

.detail-fee b {
  font-size: 20px;
  line-height: 1.2;
}

.room-jump {
  margin: 2px 0 10px;
}

.room-jump select {
  width: 100%;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 13px;
}


.photo-thumb {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  width: 100%;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 10px;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.92);
}

.photo-lightbox img {
  max-width: 96vw;
  max-height: 92vh;
  object-fit: contain;
  border-radius: 6px;
}


.room-tag {
  display: inline-block;
  margin-left: 5px;
  padding: 1px 6px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 600;
  vertical-align: middle;
  background: var(--bg-soft);
  color: var(--muted);
}

.room-tag.tag-vacant {
  background: #f3e8ff;
  color: #7c3aed;
}

.room-tag.tag-prereturn {
  background: #fef3c7;
  color: #b45309;
}

.room-tag.tag-change {
  background: #e0f2fe;
  color: #0369a1;
}

.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.detail-tag {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-soft);
  color: var(--muted);
}

.detail-tag.tag-vacant {
  background: #f3e8ff;
  color: #7c3aed;
}

.detail-tag.tag-prereturn {
  background: #fef3c7;
  color: #b45309;
}

.detail-tag.tag-change {
  background: #e0f2fe;
  color: #0369a1;
}


/* 已收金额加斜杠 */
.room-row.paid .r-amt,
.card.paid .amt,
.card.readonly.paid .amt {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: rgba(90, 110, 100, 0.55);
  color: var(--muted) !important;
}

.detail-amount.paid {
  text-decoration: line-through;
  text-decoration-thickness: 3px;
  text-decoration-color: rgba(90, 110, 100, 0.5);
  color: var(--muted);
}


/* 卡片美化和状态图标 */
.card {
  border-radius: 18px;
  border: 1px solid #ece3d4;
  box-shadow: 0 4px 16px rgba(80, 100, 90, 0.06);
  transition: box-shadow 0.15s, transform 0.15s;
}

.card:active {
  transform: scale(0.995);
}

.card.paid {
  background: linear-gradient(180deg, #f7fcfa 0%, #edf7f2 100%);
  border-color: #cfe9dd;
}

.card .room {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 20px;
  font-weight: 800;
}

.card-top .check {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #d9cfc0;
  border-radius: 50%;
  background: #fff;
  font-size: 14px;
  line-height: 1;
}

.card-top .check.on {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(47, 158, 143, 0.35);
}

.card.paid .amt {
  font-size: 26px;
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding-top: 9px;
  border-top: 1px dashed #e8ddcc;
}

.pay-date {
  font-size: 12px;
  font-weight: 700;
  color: #c9821a;
}

.pay-date.paid {
  color: #2f9e8f;
}

.room-tag {
  margin-left: 4px;
  padding: 2px 7px;
  font-size: 10.5px;
  font-weight: 700;
  border-radius: 999px;
}

.filter-row button {
  transition: background 0.12s, color 0.12s;
}

.filter-row button em {
  font-style: normal;
  margin-left: 2px;
  opacity: 0.72;
}

.r-tools button {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: var(--muted);
}

.r-tools button:hover {
  background: rgba(47, 158, 143, 0.1);
  color: var(--primary-strong);
}


@media (max-width: 640px) {
  .card-foot {
    flex-wrap: nowrap;
    gap: 4px;
  }

  .pay-date {
    white-space: nowrap;
    font-size: 10.5px;
    letter-spacing: -0.2px;
  }

  .card-tools {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
  }

  .card-tools button {
    width: 20px;
    height: 20px;
    padding: 0;
    font-size: 12px;
    border-radius: 6px;
  }
}


/* 收紧卡片，避免图标挤掉内容 */
.card .room {
  font-size: 17px;
  font-weight: 750;
  gap: 3px;
}

.card.paid .amt,
.card .amt {
  font-size: 22px;
}

.card-top .check {
  width: 22px;
  height: 22px;
  border-width: 1.5px;
  font-size: 12px;
}

.room-tag {
  font-size: 9.5px;
  padding: 1px 5px;
  margin-left: 3px;
}

.card-foot {
  margin-top: 6px;
  padding-top: 6px;
}

.pay-date {
  font-size: 10px;
}

.card-tools button {
  width: 22px;
  height: 22px;
  font-size: 11px;
}

@media (max-width: 640px) {
  .card {
    padding: 9px 10px 7px;
  }

  .card-tools button {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
}


/* 再收紧一点 */
.card .room {
  font-size: 16px;
}

.card .amt,
.card.paid .amt {
  font-size: 20px;
}

.card-top .check {
  width: 20px;
  height: 20px;
  font-size: 11px;
}

.room-tag {
  font-size: 9px;
  padding: 1px 4px;
}

.card-tools button {
  width: 18px;
  height: 18px;
  font-size: 10px;
}

@media (max-width: 640px) {
  .card {
    padding: 8px 9px 6px;
  }

  .pay-date {
    font-size: 9.5px;
  }
}
