/* ============================================================
   style.css —— 泡噜哒の萌萌Room · 顾客消费查询系统
   设计基调：浅色系蓝粉马卡龙，淡粉到淡蓝的渐变底 + 白卡片，数字使用等宽数字
   ============================================================ */

:root {
  --bg: #fbf6fa;
  --card: #ffffff;
  --ink: #333b48;
  --ink-2: #55606e;
  --muted: #8b96a4;
  --line: #e8eef6;
  --line-soft: #f2eff6;
  --jade: #4f79b8;
  --jade-dark: #3f6aa6;
  --jade-soft: #eaf2fc;
  --pink: #f4aac7;
  --pink-deep: #b24f75;
  --pink-soft: #fdeef4;
  --blue: #a9c6ef;
  --blue-soft: #edf4fd;
  --gold: #bd8a4c;
  --danger: #cf5568;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(80, 96, 120, 0.05), 0 10px 26px -20px rgba(120, 110, 150, 0.28);
}

* {
  box-sizing: border-box;
}

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

body {
  /* 垫底色与波点背景同色系（奶白 → 浅樱粉），只在边缘透出一点层次，衔接不跳色 */
  background: linear-gradient(160deg, #fef8fb 0%, #fcf1f7 58%, #f9e9f1 100%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 14px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 全站背景图：横屏用横版、竖屏用竖版；压得很淡，只做氛围，保证前景文字与卡片清晰 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: #fffdfe url("bg-landscape.png") center center / cover no-repeat;
  opacity: 0.88;
  pointer-events: none;
}

@media (orientation: portrait) {
  body::before {
    background-image: url("bg-portrait.png");
  }
}

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

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
}

a {
  color: var(--jade);
  text-decoration: none;
}

.hidden {
  display: none !important;
}

.app {
  display: flex;
  min-height: 100vh;
}

/* ================= 侧栏 ================= */

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  /* 侧栏/顶部条与背景波点同色系：奶白 → 浅樱粉，不再往淡蓝走 */
  background: linear-gradient(180deg, #fffbfd 0%, #fdf1f7 55%, #fbe9f1 100%);
  border-right: 1px solid #f6e4ee;
  color: #48525f;
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 6px 22px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 11px;
  background: #fde7ef;
  color: #6f3550;
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.5px;
  overflow: hidden;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #333b48;
  letter-spacing: 0.2px;
  line-height: 1.3;
}

.brand-sub {
  font-size: 9.5px;
  letter-spacing: 0.8px;
  color: #a6afbd;
  margin-top: 2px;
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  color: #5f6a78;
  padding: 10px 12px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 13.5px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  position: relative;
}

.nav-item:hover {
  background: rgba(244, 168, 198, 0.16);
  color: #333b48;
}

.nav-item.is-active {
  background: #ffffff;
  color: #b24f75;
  box-shadow: 0 6px 16px -12px rgba(150, 110, 140, 0.55);
}

.nav-item.is-active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  border-radius: 0 3px 3px 0;
  background: #f4aac7;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  opacity: 0.85;
}

.nav-item.is-active svg {
  opacity: 1;
}

.nav-label {
  flex: 1;
}

.nav-badge {
  font-size: 11px;
  color: #93a1b3;
  font-variant-numeric: tabular-nums;
}

.nav-badge-hot {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: #e8618f;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
}

/* ================= 挑款式入口（进选款宝宝端） ================= */

.go-kutu {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 2px 0 16px;
  padding: 13px 15px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #fff7fa 0%, var(--pink-soft, #fdeef4) 100%);
  border: 1px solid #f6dbe6;
  text-decoration: none;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.go-kutu:hover {
  transform: translateY(-1px);
  border-color: #f0c4d7;
  box-shadow: 0 8px 20px rgba(178, 79, 117, 0.12);
}

.go-kutu-ico {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: 11px;
  background: #fff;
  color: var(--pink-deep, #b24f75);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 6px rgba(178, 79, 117, 0.1);
}

.go-kutu-ico svg {
  width: 19px;
  height: 19px;
}

.go-kutu-main {
  flex: 1;
  min-width: 0;
}

.go-kutu-main b {
  display: block;
  font-size: 14.5px;
  color: var(--pink-deep, #b24f75);
  letter-spacing: 0.2px;
}

.go-kutu-main span {
  display: block;
  margin-top: 2px;
  font-size: 12.5px;
  color: #8c7b85;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.go-kutu-go {
  flex: none;
  font-size: 12.5px;
  color: #fff;
  background: #e8618f;
  padding: 6px 13px;
  border-radius: 999px;
  white-space: nowrap;
}

/* 店主端「改款式」：页头右上角的小胶囊入口，登录后才出现 */
.kutu-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid #c9dbf2;
  background: #ffffff;
  color: #4f79b8;
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s;
}

.kutu-link svg {
  width: 13px;
  height: 13px;
}

.kutu-link:hover {
  background: #eff5fd;
  border-color: #a9c6e8;
}


.auth-box {
  margin-top: auto;
  padding: 12px 2px 10px;
}

/* 管理员身份和「退出」并成一行，省掉一整行高度 */
.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.auth-role {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 600;
  color: #b24f75;
}

.auth-role .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f19cba;
}

.auth-btn {
  flex: none;
  border: 1px solid #f2cfe0;
  background: #ffffff;
  color: #8a6079;
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.auth-btn:hover {
  background: #fdeef4;
  border-color: #f0bcd4;
}

.sidebar-foot {
  margin-top: 0;
  padding: 14px 8px 0;
  border-top: 1px solid #efdfe8;
  font-size: 11.5px;
  color: #98a3b2;
  line-height: 1.7;
}

.sidebar-foot strong {
  color: #55606e;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

/* ================= 主区域 ================= */

.main {
  flex: 1;
  min-width: 0;
  padding: 30px 38px 60px;
}

.main-inner {
  max-width: 1200px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 22px;
}

.page-title {
  font-size: 23px;
  letter-spacing: 0.3px;
}

.page-sub {
  margin: 5px 0 0;
  font-size: 13px;
  color: var(--muted);
}

.topbar-actions {
  display: flex;
  gap: 9px;
  flex: 0 0 auto;
  padding-top: 4px;
}

.alert {
  background: #fff6ec;
  border: 1px solid #f2ddc2;
  color: #8f6320;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 12.5px;
  margin-bottom: 16px;
}

/* 待审核提醒条：管理员侧任何页面都顶在最上面 */
.pending-banner {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 1px solid #f4b8ce;
  background: linear-gradient(96deg, #fff0f6 0%, #ffe8f1 100%);
  color: #a53b64;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  box-shadow: 0 4px 14px rgba(232, 97, 143, 0.12);
}

.pending-banner:hover {
  border-color: #eb86ac;
  box-shadow: 0 6px 18px rgba(232, 97, 143, 0.18);
}

.pending-banner-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #e8618f;
  flex: 0 0 auto;
  animation: pendingPulse 1.6s ease-in-out infinite;
}

@keyframes pendingPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(0.8); }
}

.pending-banner-text {
  flex: 1;
}

.pending-banner-go {
  flex: 0 0 auto;
  font-weight: 700;
}

.manage-card-hot {
  border-color: #f4b8ce;
  box-shadow: 0 8px 22px rgba(232, 97, 143, 0.12);
  background: linear-gradient(180deg, #fff8fb 0%, #ffffff 100%);
}

/* ================= 通用组件 ================= */

.btn {
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, color 0.15s, box-shadow 0.15s;
}

.btn-primary {
  background: linear-gradient(135deg, #f8bcd3, #f2a1c1);
  color: #6d3450;
  box-shadow: 0 6px 16px -10px rgba(226, 138, 175, 0.85);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #f5aecb, #ed91b4);
}

.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink-2);
}

.btn-ghost:hover {
  border-color: #cfdff2;
  color: var(--jade);
}

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: var(--ink-2);
  padding: 0 8px;
  height: 30px;
}

.btn-quiet:hover {
  color: var(--jade);
  background: var(--jade-soft);
}

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

.btn-danger:hover {
  background: #fdf0f2;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-sm {
  height: 32px;
  padding: 0 12px;
  font-size: 12.5px;
  border-radius: 8px;
}

.input,
.select {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  padding: 0 12px;
  font-size: 13.5px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  color: var(--ink);
}

.input::placeholder {
  color: #b3bcc9;
}

.input:focus,
.select:focus {
  border-color: #b7d2f0;
  box-shadow: 0 0 0 3px rgba(242, 161, 193, 0.22);
}

.select {
  padding-right: 30px;
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6'><path d='M1 1l4 4 4-4' stroke='%237c8a85' stroke-width='1.4' fill='none'/></svg>");
  background-repeat: no-repeat;
  background-position: right 11px center;
  cursor: pointer;
}

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

.field label {
  font-size: 12.5px;
  color: var(--ink-2);
  font-weight: 500;
}

.field .hint {
  font-size: 11.5px;
  color: var(--muted);
}

.field-error {
  font-size: 11.5px;
  color: var(--danger);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px 14px;
}

.section-title {
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
}

.section-note {
  font-size: 12px;
  color: var(--muted);
}

/* ================= 宝宝列表 / 流水 切换 ================= */

.seg {
  display: inline-flex;
  flex: none;
  padding: 3px;
  gap: 2px;
  background: #f2f5fa;
  border-radius: 999px;
}

.seg button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  color: #7b8698;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.seg button.is-on {
  background: #ffffff;
  color: #4f79b8;
  box-shadow: 0 1px 3px rgba(80, 96, 120, 0.12);
}

/* ================= KPI ================= */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 11px;
  margin-bottom: 14px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 13px 14px 12px;
  box-shadow: var(--shadow);
}

.kpi-label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.4px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.kpi-value {
  margin-top: 6px;
  font-size: 23px;
  font-weight: 650;
  letter-spacing: -0.2px;
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}

.kpi-value .unit {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 3px;
}

.kpi-foot {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

/* ================= 查询台 ================= */

.search-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px 20px;
  box-shadow: 0 2px 4px rgba(80, 96, 120, 0.04), 0 18px 40px -34px rgba(126, 116, 156, 0.45);
  margin-bottom: 16px;
}

.search-box {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-input-wrap {
  position: relative;
  flex: 1;
}

.search-input-wrap svg {
  position: absolute;
  left: 15px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #a4adba;
  pointer-events: none;
}

.search-input {
  width: 100%;
  height: 52px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 84px 0 44px;
  font-size: 15.5px;
  outline: none;
  background: #fff;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input::placeholder {
  color: #b3bcc9;
  font-size: 14px;
}

.search-input:focus {
  border-color: #b7d2f0;
  box-shadow: 0 0 0 4px rgba(242, 161, 193, 0.2);
}

.search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: #f5f2f8;
  color: #6f7b8a;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-clear:hover {
  background: #ecf1f7;
  color: var(--ink);
}

.search-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #f8f3f8;
  color: #5f6a78;
  font-size: 12px;
  border: 1px solid #edf2f8;
  cursor: pointer;
}

.chip:hover {
  background: var(--jade-soft);
  border-color: #dbe8f8;
  color: var(--jade);
}

/* 顾客端：当前登录账号的一行小字（原来是个像搜索框的横条，已简化） */
.me-note {
  font-size: 12.5px;
  color: var(--muted);
  padding: 0 2px 10px;
}

.me-note strong {
  color: var(--ink);
  font-weight: 600;
}

.chip.is-static {
  cursor: default;
}

.field .req {
  margin-left: 5px;
  font-size: 11.5px;
  color: #d4708f;
}

/* ---------- 顾客档案 ---------- */

.customer-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.customer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  padding: 24px 26px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: linear-gradient(180deg, #fdfbfd, #ffffff);
}

.customer-identity {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.avatar {
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  border-radius: 50%;
  background: var(--jade-soft);
  color: var(--jade);
  font-size: 18px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.customer-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.2px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.customer-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f5f2f8;
  color: #5f6a78;
  font-weight: 500;
  letter-spacing: 0.2px;
}

.badge-jade {
  background: var(--jade-soft);
  color: var(--jade);
}

.badge-gold {
  background: #fdf4e8;
  color: var(--gold);
}

.customer-total {
  text-align: right;
  flex: 0 0 auto;
}

.customer-total .label {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.6px;
}

.customer-total .value {
  font-size: 40px;
  font-weight: 650;
  letter-spacing: -1px;
  font-variant-numeric: tabular-nums;
  line-height: 1.12;
  margin-top: 2px;
  color: var(--ink);
}

.customer-total .value .currency {
  font-size: 20px;
  font-weight: 500;
  color: var(--muted);
  margin-right: 2px;
}

.customer-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-soft);
}

.customer-stats > div {
  padding: 16px 26px;
  border-right: 1px solid var(--line-soft);
}

.customer-stats > div:last-child {
  border-right: 0;
}

.customer-stats .label {
  font-size: 12px;
  color: var(--muted);
}

.customer-stats .value {
  font-size: 16.5px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

/* ---------- 月度图表 ---------- */

.chart-block {
  padding: 18px 26px 18px;
  border-bottom: 1px solid var(--line-soft);
}

.chart-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.chart-title h3 {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

.chart-title span {
  font-size: 11.5px;
  color: var(--muted);
}

.chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 96px;
  padding-top: 8px;
}

.chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: 5px;
  min-width: 0;
}

.chart-bar {
  width: 100%;
  max-width: 44px;
  background: linear-gradient(180deg, #f8c3d7, #adcbf0);
  border-radius: 5px 5px 2px 2px;
  min-height: 2px;
  transition: height 0.3s ease;
  position: relative;
}

.chart-bar.is-empty {
  background: #edf2f8;
  min-height: 2px;
}

.chart-bar:hover {
  filter: brightness(1.08);
}

.chart-x {
  font-size: 10.5px;
  color: var(--muted);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

/* ---------- 明细表 ---------- */

.records-block {
  padding: 6px 0 0;
}

.records-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px 6px;
}

.records-head h3 {
  font-size: 13px;
  color: var(--ink-2);
  font-weight: 600;
}

.table-wrap {
  overflow-x: auto;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

table.data th {
  text-align: left;
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  background: #fdfcfe;
  white-space: nowrap;
}

table.data th.sortable {
  cursor: pointer;
  user-select: none;
}

table.data th.sortable:hover {
  color: var(--jade);
}

table.data th .arrow {
  display: inline-block;
  margin-left: 3px;
  font-size: 10px;
  color: #c2c9d4;
}

table.data th.is-sorted .arrow {
  color: var(--jade);
}

table.data td {
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--ink-2);
  vertical-align: middle;
}

table.data td.strong {
  color: var(--ink);
  font-weight: 500;
}

table.data tr:last-child td {
  border-bottom: 0;
}

table.data tbody tr:hover {
  background: #fbf8fc;
}

.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

table.data th.num {
  text-align: right;
}

.cell-name {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 130px;
}

.cell-avatar {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  background: #f4f1f8;
  color: #5f6a78;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
}

.cell-name .name {
  color: var(--ink);
  font-weight: 500;
}

.cell-name .sub {
  font-size: 11.5px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.amount-positive {
  color: var(--jade);
  font-weight: 600;
}

.amount-negative {
  color: var(--danger);
  font-weight: 600;
}

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

/* ---------- 工具栏 / 分页 ---------- */

.toolbar {
  display: flex;
  align-items: center;
  gap: 9px;
  flex-wrap: wrap;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line-soft);
}

.toolbar .grow {
  flex: 1;
}

.toolbar .input {
  width: 180px;
}

.toolbar .select {
  min-width: 118px;
}

.toolbar .range-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
}

.toolbar .range-inputs .input {
  width: 138px;
}

.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 22px;
  border-top: 1px solid var(--line-soft);
  font-size: 12.5px;
  color: var(--muted);
}

.pager-btns {
  display: flex;
  gap: 5px;
}

.pager-btns button {
  min-width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink-2);
  font-size: 12.5px;
  cursor: pointer;
  padding: 0 8px;
}

.pager-btns button:hover:not(:disabled) {
  border-color: #cfdff2;
  color: var(--jade);
}

.pager-btns button.is-current {
  background: var(--jade);
  border-color: var(--jade);
  color: #fff;
}

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

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

.empty {
  text-align: center;
  padding: 52px 24px;
  color: var(--muted);
}

.empty-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #f5f2f8;
  color: #a9b6c7;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}

.empty-title {
  font-size: 14.5px;
  color: var(--ink-2);
  font-weight: 500;
  margin-bottom: 5px;
}

.empty-text {
  font-size: 12.5px;
  color: var(--muted);
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.7;
}

.empty-actions {
  margin-top: 16px;
  display: flex;
  gap: 9px;
  justify-content: center;
}

/* ---------- 数据管理 ---------- */

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

.manage-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.manage-card h3 {
  font-size: 14px;
  font-weight: 600;
}

.manage-card p {
  margin: 0;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.7;
}

.manage-card .actions {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.manage-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 4px;
}

/* 数据管理：一行一项，标题和说明并排，按钮在右 */
.manage-rows {
  padding: 2px 22px 8px;
}

.manage-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line-soft);
}

.manage-row:last-child {
  border-bottom: 0;
}

.manage-row-hot {
  background: linear-gradient(90deg, rgba(253, 238, 244, 0.75), rgba(255, 255, 255, 0));
  border-radius: 10px;
  padding-left: 10px;
  padding-right: 10px;
  margin: 0 -10px;
}

.manage-row-main {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.manage-row-main b {
  flex: none;
  font-size: 13.5px;
  font-weight: 600;
  color: #3d4a58;
}

.manage-row-main span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  word-break: break-all;
}

.manage-row > .btn {
  flex: none;
}

.manage-stats > div .label {
  font-size: 11.5px;
  color: var(--muted);
}

.manage-stats > div .value {
  font-size: 20px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

/* ================= 弹窗 ================= */

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 88, 110, 0.32);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 40;
  animation: fade 0.15s ease;
}

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

.modal {
  background: #fff;
  border-radius: 18px;
  width: 780px;
  max-width: 100%;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 30px 80px -20px rgba(74, 88, 110, 0.42);
  animation: pop 0.18s ease;
}

@keyframes pop {
  from {
    transform: translateY(8px) scale(0.99);
    opacity: 0.7;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.modal.narrow {
  width: 520px;
}

.modal-head {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--line-soft);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.modal-title {
  font-size: 16.5px;
  font-weight: 600;
}

.modal-sub {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 3px;
}

.modal-close {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: #f7f3f9;
  color: var(--ink);
}

.modal-body {
  padding: 20px 24px;
  overflow-y: auto;
}

.modal-foot {
  padding: 14px 24px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: #fdfcfe;
  border-radius: 0 0 18px 18px;
}

.modal-foot .grow {
  flex: 1;
  font-size: 12.5px;
  color: var(--muted);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
}

.form-grid .full {
  grid-column: 1 / -1;
}

/* 宝宝端登记 / 设密码：手机上也要保持两列，不然五个字段竖排太长 */
.form-grid-tight {
  gap: 11px 12px;
}

.reg-card {
  padding: 22px 24px;
}

.reg-head {
  font-size: 16px;
  font-weight: 650;
  color: #3d4a58;
  letter-spacing: 0.2px;
}

.reg-sub {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
}

.reg-foot {
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--muted);
}

/* 导入拖拽区 */

.dropzone {
  border: 1.5px dashed #dce7f6;
  border-radius: 14px;
  padding: 34px 20px;
  text-align: center;
  background: #fdfbfd;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.dropzone:hover,
.dropzone.is-over {
  border-color: var(--jade);
  background: #f6fafe;
}

.dropzone-title {
  font-size: 14px;
  color: var(--ink-2);
  font-weight: 500;
}

.dropzone-text {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
}

.dropzone-formats {
  margin-top: 12px;
  display: flex;
  gap: 6px;
  justify-content: center;
}

.file-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--jade-soft);
  color: var(--jade);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  margin-top: 14px;
}

/* 列映射 */

.map-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 14px;
}

.map-field label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.map-field .req {
  color: var(--danger);
  font-size: 11px;
}

.map-field select {
  width: 100%;
}

.mapping-note {
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
}

.preview-table {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

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

.preview-table th,
.preview-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
  white-space: nowrap;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.preview-table th {
  background: #fbf8fc;
  color: var(--muted);
  font-weight: 500;
  font-size: 11.5px;
}

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

/* 导入结果 */

.result-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.result-stat {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px 16px;
  background: #fdfbfd;
}

.result-stat .label {
  font-size: 12px;
  color: var(--muted);
}

.result-stat .value {
  font-size: 22px;
  font-weight: 600;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.result-stat.is-warn .value {
  color: var(--gold);
}

.error-list {
  margin-top: 16px;
  border: 1px solid #f6e6d2;
  background: #fffaf4;
  border-radius: 10px;
  padding: 12px 16px;
  max-height: 180px;
  overflow-y: auto;
  font-size: 12.5px;
  color: #8a6329;
}

.error-list li {
  margin: 3px 0;
}

/* ================= Toast ================= */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%) translateY(10px);
  background: #333b48;
  color: #fff;
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  box-shadow: 0 10px 30px -10px rgba(74, 88, 110, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: 80vw;
}

.toast.is-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.is-error {
  background: #9c3a48;
}

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

@media (max-width: 1024px) {
  .main {
    padding: 24px 24px 48px;
  }
  .kpi-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-bottom: 12px;
  }
  .kpi {
    padding: 10px 10px 9px;
  }
  .kpi-label {
    font-size: 11.5px;
  }
  .kpi-value {
    margin-top: 4px;
    font-size: 18px;
  }
  .kpi-value .unit {
    font-size: 12px;
  }
  .kpi-foot {
    margin-top: 3px;
    font-size: 11px;
  }
  .customer-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .customer-stats > div:nth-child(2) {
    border-right: 0;
  }
}

@media (max-width: 820px) {
  .app {
    flex-direction: column;
  }
  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 10px;
    row-gap: 6px;
    width: 100%;
    flex: 0 0 auto;
    height: auto;
    position: static;
    padding: 14px 12px 10px;
    /* 顶部条与页面底色同色系，底边淡出，避免和下方背景出现一条硬边 */
    /* 顶部条不再压一块底色，直接让全站波点底图透上来，和下方完全连续 */
    background: transparent;
    border-right: 0;
  }
  .brand {
    grid-column: 1 / -1;
    padding-bottom: 4px;
  }
  /* 导航和「管理员 · 退出」并排，省一整行 */
  .auth-box {
    grid-column: 2;
    margin: 0;
    padding: 0;
  }
  .auth-row {
    justify-content: flex-end;
    gap: 8px;
  }
  .nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 5px;
  }
  .nav-item {
    white-space: nowrap;
    padding: 7px 11px;
  }
  .nav-item.is-active::before {
    display: none;
  }
  .nav-badge {
    display: none;
  }
  .sidebar-foot {
    display: none;
  }
  .topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 8px;
    margin-bottom: 10px;
  }
  /* 筛选条在手机上收一收，四样东西能挤在一两行 */
  .toolbar {
    padding: 12px 14px;
    gap: 8px;
  }
  .toolbar .input {
    width: 148px;
  }
  .toolbar .select {
    min-width: 104px;
  }
  /* 「挑款式 / 改款式」那张卡在手机上压扁，别占太多首屏 */
  .go-kutu {
    padding: 10px 12px;
    gap: 10px;
    margin-bottom: 12px;
  }
  .go-kutu-ico {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }
  .go-kutu-ico svg {
    width: 17px;
    height: 17px;
  }
  .go-kutu-main b {
    font-size: 13.5px;
  }
  .go-kutu-main span {
    font-size: 11.5px;
    margin-top: 1px;
  }
  .go-kutu-go {
    padding: 5px 11px;
    font-size: 12px;
  }
  .topbar-actions {
    padding-top: 0;
  }
  .customer-head {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
  }
  .customer-total {
    text-align: left;
  }
  .manage-grid,
  .form-grid,
  .map-grid,
  .result-summary {
    grid-template-columns: 1fr;
  }
  /* 例外：宝宝端这两个小表单保持两列 */
  .form-grid-tight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reg-card {
    padding: 18px 16px;
  }
  .modal {
    max-height: 92vh;
  }
}

/* ---------- customer submit + admin review ---------- */
.submit-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 14px 0 4px;
}

/* 宝宝端：被驳回提示 */
.reject-tip {
  margin: 12px 0 2px;
  padding: 14px 16px;
  border: 1px solid #f2c9a6;
  border-radius: 14px;
  background: #fff7ee;
}

.reject-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.reject-badge {
  flex: 0 0 auto;
  padding: 2px 10px;
  border-radius: 10px;
  background: #ffe3cb;
  color: #b1641f;
  font-size: 12px;
  font-weight: 700;
}

.reject-title {
  color: #7a4a22;
  font-size: 14.5px;
  font-weight: 700;
}

.reject-row {
  padding: 10px 0;
  border-top: 1px dashed #f0d8c0;
}

.reject-what {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px;
  color: #4a3b46;
}

.reject-what strong {
  font-size: 16px;
}

.reject-what span {
  color: #96756a;
  font-size: 12.5px;
}

.reject-why {
  margin-top: 4px;
  color: #8a5a3a;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.reject-row-foot {
  margin-top: 8px;
}

.reject-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed #f0d8c0;
}

.reject-foot .section-note {
  flex: 1 1 180px;
}

.dlg-input {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 12px;
  border: 1px solid #e4dee8;
  border-radius: 10px;
  font-size: 14px;
  font-family: inherit;
  color: #333b48;
  background: #fbfafc;
}

.dlg-input:focus {
  outline: none;
  border-color: #e79fbe;
  background: #fff;
}

.proof-drop {
  border: 1px dashed #edc6d9;
  border-radius: 12px;
  background: #fffafc;
  padding: 14px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.proof-drop:hover {
  border-color: #e79fbe;
  background: #fff4f8;
}

.proof-drop img {
  max-width: 100%;
  max-height: 160px;
  border-radius: 8px;
  display: block;
  margin: 0 auto 8px;
}

.proof-plus {
  font-size: 26px;
  color: #dd9bb8;
  line-height: 1.2;
}

.proof-hint {
  font-size: 12px;
  color: #9aa3b2;
  margin-top: 4px;
}

.pending-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pending-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid #f3e3ec;
  border-radius: 12px;
  background: #fffdfe;
}

.pending-thumb {
  width: 76px;
  height: 76px;
  flex: 0 0 76px;
  border-radius: 10px;
  overflow: hidden;
  background: #f7f1f6;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #aab2c0;
}

.pending-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* 顾客端：多张支付凭证 */
.proof-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.proof-thumb {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid #f3e3ec;
  background: #f7f1f6;
}

.proof-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proof-remove {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 0;
  background: rgba(44, 52, 68, 0.62);
  color: #fff;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.proof-add {
  width: 104px;
  height: 104px;
  border-radius: 10px;
  border: 1px dashed #edc6d9;
  background: #fffafc;
  color: #d189ad;
  font-size: 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.proof-add:hover {
  border-color: #e79fbe;
  background: #fff4f8;
}

.proof-add span {
  font-size: 11px;
  color: #9aa3b2;
}

/* 管理员端：凭证缩略图与大图查看 */
.pending-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 0 0 auto;
  max-width: 190px;
}

button.pending-thumb {
  border: 0;
  padding: 0;
  cursor: zoom-in;
}

.zoom-layer {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(20, 18, 26, 0.86);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  cursor: zoom-out;
}

.zoom-layer img {
  max-width: 96vw;
  max-height: 88vh;
  border-radius: 10px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
}

.zoom-hint {
  color: #f6f1f6;
  font-size: 12px;
  margin-top: 10px;
}

.pending-main {
  flex: 1 1 auto;
  min-width: 0;
}

.pending-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #2c3444;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.pending-amount {
  color: #b24f75;
  font-weight: 700;
}

.pending-actions {
  display: flex;
  gap: 8px;
  flex: 0 0 auto;
}

.wechat-banner {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f4f9f3;
  border: 1px solid #d8e8d6;
  color: #3f6b46;
  font-size: 12.5px;
  line-height: 1.7;
}

.wechat-banner strong {
  color: #2f5f3a;
}

@media (max-width: 640px) {
  .pending-item {
    flex-wrap: wrap;
  }
  .pending-actions {
    width: 100%;
    justify-content: flex-end;
  }
}

/* 补录弹窗：账号查找行 */
.lookup-row{display:flex;gap:8px;align-items:center}
.lookup-row .input{flex:1}

/* 历史累计徽标 */
.badge-warm{background:#fbf1dd;color:#8a6320;border-color:#ecd9b3}
.check-line{display:flex;gap:8px;align-items:flex-start;font-size:13px;color:#5a4d55;line-height:1.6}
.check-line input{margin-top:2px}

/* 存钱罐：锁定月份标记 */
.attr-tag {
  margin-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
  color: #8a6b7d;
  background: #fdf1f6;
  border: 1px solid #f2dbe6;
  border-radius: 6px;
  padding: 1px 6px;
  display: inline-block;
  white-space: normal;
}

.attr-hint {
  margin-top: 10px;
  font-size: 12px;
  line-height: 1.6;
  color: #8c7a85;
}

/* ================= 手机端：带备注的明细表改成卡片式 =================
   窄屏时 5、6 列表格会把「备注」压到不足两个字宽，中文按字换行看着像竖排；
   这里在 ≤720px 把每行拆成上下两段，备注独占一整行。 */

@media (max-width: 720px) {
  .table-wrap.is-stack {
    overflow-x: visible;
  }

  .table-wrap.is-stack table.data thead {
    display: none;
  }

  .table-wrap.is-stack table.data {
    font-size: 13px;
  }

  .table-wrap.is-stack table.data tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 10px;
    row-gap: 4px;
    padding: 11px 2px;
    border-bottom: 1px solid var(--line-soft);
  }

  .table-wrap.is-stack table.data tr:last-child {
    border-bottom: 0;
  }

  .table-wrap.is-stack table.data td {
    border: 0;
    padding: 0;
    vertical-align: top;
    min-width: 0;
  }

  .table-wrap.is-stack table.data td .cell-name {
    align-items: center;
  }

  /* 第一行：日期 / 金额 */
  .table-wrap.is-stack table.data td:nth-child(1) {
    grid-area: 1 / 1;
    color: var(--muted);
    font-size: 12.5px;
    white-space: nowrap;
  }

  .table-wrap.is-stack table.data td:nth-child(2) {
    grid-area: 2 / 1 / 3 / 3;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }

  .table-wrap.is-stack table.data td:nth-child(3) {
    grid-area: 1 / 2;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
  }
}

/* 宝宝档案里的小表格：日期 / 备注 / 金额 / 来源 / 操作（没有第 2 列宝宝） */
@media (max-width: 720px) {
  .records-block .table-wrap.is-detail table.data tr {
    grid-template-areas:
      "date amount"
      "note note"
      "src action";
  }

  .records-block .table-wrap.is-detail table.data td:nth-child(1) {
    grid-area: date;
  }

  .records-block .table-wrap.is-detail table.data td:nth-child(2) {
    grid-area: note;
  }

  .records-block .table-wrap.is-detail table.data td:nth-child(3) {
    grid-area: amount;
  }

  .records-block .table-wrap.is-detail table.data td:nth-child(4) {
    grid-area: src;
    text-align: left;
    justify-self: start;
  }

  .records-block .table-wrap.is-detail table.data td:nth-child(5) {
    grid-area: action;
    text-align: right;
  }
}

/* 投喂明细：日期 / 宝宝 / 金额 / 备注 / 来源 / 操作 */
@media (max-width: 720px) {
  #txnTableWrap .table-wrap.is-stack table.data tr {
    grid-template-areas:
      "date amount"
      "who who"
      "note note"
      "src action";
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(1) {
    grid-area: date;
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(2) {
    grid-area: who;
    white-space: normal;
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(3) {
    grid-area: amount;
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(4) {
    grid-area: note;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(5) {
    grid-area: src;
    text-align: left;
    justify-self: start;
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(6) {
    grid-area: action;
    text-align: right;
    white-space: nowrap;
  }

  /* 备注是空的时候别单独占一行，一条记录能短一截 */
  #txnTableWrap .table-wrap.is-stack table.data td.is-blank {
    display: none;
  }

  /* 名字和账号并成一行，别上下各占一行 */
  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(2) .cell-name > div {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
  }

  #txnTableWrap .table-wrap.is-stack table.data td:nth-child(2) .sub {
    margin-top: 0;
  }

  #txnTableWrap .table-wrap.is-stack table.data tr {
    row-gap: 3px;
    padding: 9px 2px;
  }
}

/* 弹窗里的三列表（日期 / 备注 / 金额） */
@media (max-width: 720px) {
  .table-wrap.is-simple table.data tr {
    grid-template-areas:
      "date amount"
      "note note";
  }

  .table-wrap.is-simple table.data td:nth-child(1) {
    grid-area: date;
  }

  .table-wrap.is-simple table.data td:nth-child(2) {
    grid-area: note;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }

  .table-wrap.is-simple table.data td:nth-child(3) {
    grid-area: amount;
  }
}

/* 存钱罐变动（日期 / 类型 / 金额 / 备注） */
@media (max-width: 720px) {
  .table-wrap.is-wallet table.data tr {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas:
      "date amount"
      "type note";
  }

  .table-wrap.is-wallet table.data td:nth-child(1) {
    grid-area: date;
  }

  .table-wrap.is-wallet table.data td:nth-child(2) {
    grid-area: type;
    white-space: nowrap;
    justify-self: start;
  }

  .table-wrap.is-wallet table.data td:nth-child(3) {
    grid-area: amount;
  }

  .table-wrap.is-wallet table.data td:nth-child(4) {
    grid-area: note;
    text-align: right;
    white-space: normal;
    word-break: normal;
    overflow-wrap: anywhere;
    line-height: 1.5;
  }
}
