/* ============================================================
   Gruu 预约簿 · 手机端样式
   ============================================================ */
:root {
  --paper: #f6f1ea;
  --paper-2: #f1e9df;
  --card: #ffffff;
  --ink: #241c17;
  --ink-2: #4a3a2f;
  --muted: #8d7c6d;
  --muted-2: #b3a496;
  --line: #ece1d4;
  --line-2: #e3d6c6;
  --brand: #b85e33;
  --brand-deep: #9a4a25;
  --brand-soft: #fbeade;
  --teal: #3e7c6a;
  --teal-soft: #e3f0eb;
  --gold: #c1913b;
  --gold-soft: #f8eed8;
  --danger: #b4453b;
  --danger-soft: #f9e6e3;
  --ok: #4c7a5c;
  --ok-soft: #e6f0e8;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 2px 10px rgba(60, 40, 25, 0.06), 0 12px 32px rgba(60, 40, 25, 0.05);
  --shadow-lg: 0 8px 40px rgba(50, 30, 18, 0.18);
  --safe-b: env(safe-area-inset-bottom, 0px);
  --tab-h: 62px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei", -apple-system, BlinkMacSystemFont,
    "Segoe UI", Roboto, sans-serif;
}

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

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper-2);
  background-image: radial-gradient(circle at 15% 0%, rgba(255, 236, 219, 0.9), transparent 40%),
    radial-gradient(circle at 90% 10%, rgba(233, 240, 234, 0.8), transparent 45%);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

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

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

.icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  display: block;
}

.hidden {
  display: none !important;
}

/* ---------- 布局 ---------- */
.shell {
  position: relative;
  max-width: 540px;
  margin: 0 auto;
  min-height: 100dvh;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px);
  background: var(--paper);
  box-shadow: 0 0 0 1px rgba(60, 40, 25, 0.04), 0 30px 80px rgba(40, 25, 15, 0.12);
}

@media (min-width: 700px) {
  body {
    padding: 24px 0;
  }
  .shell {
    min-height: calc(100dvh - 48px);
    border-radius: 28px;
    overflow: hidden;
    padding-bottom: calc(var(--tab-h) + 16px);
  }
  .topbar {
    border-radius: 28px 28px 0 0;
  }
  .tabbar {
    max-width: 540px;
    border-radius: 0 0 28px 28px;
  }
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 16px 12px;
  background: rgba(246, 241, 234, 0.92);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.brand-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  align-self: center;
  box-shadow: 0 0 0 3px var(--brand-soft);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.brand-sub {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 1px;
}

.store-switch {
  display: flex;
  padding: 3px;
  gap: 2px;
  background: rgba(36, 28, 23, 0.055);
  border-radius: 999px;
  flex: 0 0 auto;
}

.store-switch button {
  padding: 6px 11px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 999px;
  transition: 0.18s;
  font-weight: 500;
  white-space: nowrap;
}

.store-switch button.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 4px rgba(50, 30, 18, 0.14);
  font-weight: 600;
}

.view {
  padding: 4px 16px 26px;
}

/* ---------- 通用 ---------- */
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

h2.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 700;
  margin: 22px 2px 10px;
  letter-spacing: 0.2px;
}
h2.section-title .hint {
  font-size: 11px;
  font-weight: 400;
  color: var(--muted-2);
  letter-spacing: 0;
}

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.empty {
  text-align: center;
  padding: 34px 16px;
  color: var(--muted);
  font-size: 13px;
  border: 1px dashed var(--line-2);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.5);
}
.empty .empty-emoji {
  font-size: 26px;
  display: block;
  margin-bottom: 6px;
  filter: grayscale(0.2);
}

/* ---------- 今日 ---------- */
.today-hero {
  padding: 18px 18px 16px;
  border-radius: 22px;
  background: linear-gradient(135deg, #2f241d 0%, #4a3527 55%, #6b4530 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 12px 28px rgba(60, 35, 20, 0.22);
}
.today-hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -60px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(232, 184, 143, 0.35), transparent 65%);
}
.hero-date {
  font-size: 12px;
  letter-spacing: 2px;
  color: rgba(255, 255, 255, 0.66);
  display: flex;
  align-items: center;
  gap: 8px;
}
.hero-date .dot-sep {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
}
.hero-main {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-top: 10px;
  gap: 12px;
}
.hero-revenue-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}
.hero-revenue {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.5px;
  margin-top: 2px;
}
.hero-revenue small {
  font-size: 15px;
  font-weight: 600;
  opacity: 0.7;
  margin-right: 2px;
}
.hero-side {
  text-align: right;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.7;
}
.hero-side b {
  font-size: 17px;
  color: #fff;
  font-weight: 700;
  margin: 0 2px;
}
.hero-chips {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.hero-chip {
  font-size: 11px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.9);
  display: inline-flex;
  gap: 5px;
  align-items: center;
}
.hero-chip b {
  color: #fff;
}

/* ---------- 预约卡片 ---------- */
.agenda {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.bk {
  position: relative;
  display: flex;
  gap: 12px;
  padding: 13px 14px;
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: left;
  width: 100%;
  transition: transform 0.12s;
}
.bk:active {
  transform: scale(0.988);
}
.bk .time-col {
  flex: 0 0 52px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-top: 1px;
}
.bk .time-col b {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
}
.bk .time-col span {
  font-size: 10px;
  color: var(--muted-2);
}
.bk .body {
  flex: 1;
  min-width: 0;
}
.bk .row1 {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.bk .name {
  font-weight: 700;
  font-size: 15px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk .items {
  color: var(--ink-2);
  font-size: 13px;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bk .meta {
  display: flex;
  gap: 10px;
  margin-top: 5px;
  font-size: 11px;
  color: var(--muted);
  flex-wrap: wrap;
}
.bk .amount {
  font-weight: 700;
  color: var(--brand-deep);
}
.bk.important {
  background: linear-gradient(180deg, #fffdf9, #fff8ee);
  box-shadow: 0 0 0 1px #f0dbc0, var(--shadow);
}
.bk.important .time-col b {
  color: var(--brand-deep);
}
.bk .status-dot {
  position: absolute;
  left: 0;
  top: 16px;
  bottom: 16px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--line-2);
}
.bk[data-status="booked"] .status-dot {
  background: var(--brand);
}
.bk[data-status="completed"] .status-dot {
  background: var(--ok);
}
.bk[data-status="no_show"] .status-dot {
  background: var(--gold);
}
.bk[data-status="postponed"] .status-dot {
  background: #9b8bb5;
}
.bk[data-status="cancelled"] .status-dot {
  background: var(--muted-2);
}
.bk.cancelled .name,
.bk.cancelled .items {
  text-decoration: line-through;
  color: var(--muted-2);
}

.badge {
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 999px;
  font-weight: 600;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.badge.new {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.badge.old {
  background: var(--teal-soft);
  color: var(--teal);
}
.badge.imp {
  background: var(--gold-soft);
  color: #8a6320;
}
.badge.status-booked {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.badge.status-completed {
  background: var(--ok-soft);
  color: var(--ok);
}
.badge.status-no_show {
  background: var(--gold-soft);
  color: #8a6320;
}
.badge.status-postponed {
  background: #efe9f6;
  color: #6e5b8a;
}
.badge.status-cancelled {
  background: #eee8e2;
  color: var(--muted);
}

/* ---------- 日历 ---------- */
.cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 4px 12px;
}
.cal-nav .ym {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.3px;
}
.cal-nav .btns {
  display: flex;
  gap: 6px;
}
.cal-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  color: var(--ink-2);
}
.cal-btn:active {
  background: var(--paper-2);
}
.cal-today-btn {
  height: 32px;
  padding: 0 12px;
  border-radius: 10px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 12px;
  color: var(--ink-2);
  font-weight: 600;
}

.cal-weekdays,
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}
.cal-weekdays {
  padding: 4px 0 6px;
  font-size: 10px;
  color: var(--muted-2);
  text-align: center;
  letter-spacing: 1px;
}
.cal-grid {
  gap: 3px;
}
.cal-cell {
  aspect-ratio: 1 / 1.08;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  background: transparent;
  font-size: 14px;
  color: var(--ink-2);
}
.cal-cell.out {
  color: var(--muted-2);
  opacity: 0.45;
}
.cal-cell.today {
  color: var(--brand-deep);
  font-weight: 800;
  background: var(--brand-soft);
}
.cal-cell.sel {
  background: var(--ink);
  color: #fff;
  box-shadow: 0 6px 16px rgba(40, 25, 15, 0.24);
}
.cal-cell .dots {
  display: flex;
  gap: 3px;
  height: 5px;
}
.cal-cell .dots i {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--brand);
  display: block;
}
.cal-cell.sel .dots i {
  background: #f3c9a8;
}
.cal-cell .cnt {
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  color: var(--muted);
  font-weight: 600;
}
.cal-cell.sel .cnt {
  color: rgba(255, 255, 255, 0.8);
}

.cal-legend {
  display: flex;
  gap: 14px;
  justify-content: center;
  margin: 12px 0 4px;
  font-size: 10px;
  color: var(--muted);
}
.cal-legend i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 4px;
}

/* ---------- 营收 ---------- */
.seg {
  display: flex;
  background: rgba(36, 28, 23, 0.055);
  border-radius: 12px;
  padding: 3px;
  gap: 2px;
}
.seg button {
  flex: 1;
  padding: 7px 4px;
  font-size: 12px;
  color: var(--muted);
  border-radius: 9px;
  font-weight: 500;
}
.seg button.on {
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(50, 30, 18, 0.12);
}

.stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 0 12px;
  gap: 10px;
}
.period-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.period-nav button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  background: var(--card);
  box-shadow: var(--shadow);
}
.period-label {
  font-size: 14px;
  font-weight: 700;
  min-width: 96px;
  text-align: center;
}

.revenue-card {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(140deg, #fffdfa, #fdf3e6);
  border: 1px solid #f1e1cc;
  box-shadow: var(--shadow);
}
.revenue-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.revenue-label {
  font-size: 12px;
  color: var(--muted);
}
.revenue-value {
  font-size: 38px;
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-top: 4px;
}
.revenue-value small {
  font-size: 16px;
  margin-right: 3px;
  font-weight: 600;
  color: var(--brand-deep);
}
.delta {
  font-size: 12px;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--ok-soft);
  color: var(--ok);
  white-space: nowrap;
}
.delta.down {
  background: var(--danger-soft);
  color: var(--danger);
}
.delta.flat {
  background: #f0ebe5;
  color: var(--muted);
}
.revenue-sub {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px dashed #ebd9c3;
}
.revenue-sub div {
  text-align: center;
}
.revenue-sub span {
  display: block;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}
.revenue-sub b {
  font-size: 15px;
  font-weight: 700;
}

.chart-card {
  padding: 16px 12px 10px;
  margin-top: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0 4px 8px;
}
.chart-head b {
  font-size: 13px;
}
.chart-head span {
  font-size: 10px;
  color: var(--muted-2);
}
.chart svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}
/* 图表明细条：点柱子后在下方显示当期各店拆分（手机上唯一的查看方式） */
.chart-detail {
  position: relative;
  margin: 8px 2px 0;
  padding: 7px 24px 7px 9px;
  border-radius: 10px;
  background: var(--paper-2);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.chart-detail.on {
  background: var(--brand-soft);
  color: var(--brand-deep);
  cursor: pointer;
}
.chart-detail-x {
  position: absolute;
  top: 50%;
  right: 9px;
  transform: translateY(-50%);
  color: var(--muted-2);
  font-size: 12px;
  line-height: 1;
}
.chart-bar {
  cursor: pointer;
}
.chart-bar.on .chart-bar-rect {
  stroke: var(--brand-deep);
  stroke-width: 1.2;
}
/* 选中某根柱子后，其他柱子淡化，一眼看出当前看的是哪个月 */
.chart.has-sel .chart-bar:not(.on) .chart-bar-rect {
  opacity: 0.55;
}
.chart.has-sel .chart-bar:not(.on) text {
  opacity: 0.62;
}

.rank-card {
  margin-top: 14px;
  padding: 14px 16px 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.rank-card h3 {
  margin: 0 0 10px;
  font-size: 13px;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.rank-card h3 span {
  font-size: 10px;
  color: var(--muted-2);
  font-weight: 400;
}
.rank-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  padding: 6px 0;
  font-size: 12px;
  align-items: center;
}
.rank-row .bar {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 4px;
  background: #f3ece4;
  overflow: hidden;
}
.rank-row .bar i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(90deg, #d9a06f, #b85e33);
}
.rank-row .n {
  color: var(--ink-2);
  font-weight: 500;
}
.rank-row .v {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.split-card {
  margin-top: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  padding: 4px 16px;
}
.split-card > .g-title {
  padding: 6px 0 0;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 1.4px;
  font-weight: 600;
}
.split-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 0;
  font-size: 13px;
  border-bottom: 1px solid #f6efe7;
}
.split-row:last-child {
  border-bottom: 0;
}
.split-row .k {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  min-width: 0;
}
.split-row .v {
  margin-left: auto;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.split-row .v small {
  font-weight: 400;
  color: var(--muted);
  margin-left: 5px;
}
/* 门店营收占比：一条 100% 堆叠条 + 右侧百分比 */
.share-bar {
  display: flex;
  gap: 3px;
  height: 9px;
  margin: 10px 0 2px;
  border-radius: 6px;
  overflow: hidden;
}
.share-bar i {
  display: block;
  height: 100%;
  min-width: 4px;
  border-radius: 4px;
}
.split-row .pct {
  min-width: 48px;
  text-align: right;
  font-size: 12px;
  font-weight: 700;
  color: var(--brand-deep);
  font-variant-numeric: tabular-nums;
}
.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.footnote {
  margin: 14px 6px 0;
  font-size: 10px;
  color: var(--muted-2);
  line-height: 1.6;
}

/* ---------- 设置 ---------- */
.profile {
  padding: 18px;
  border-radius: 22px;
  background: linear-gradient(135deg, #2f241d, #55402f);
  color: #fff;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 12px 28px rgba(60, 35, 20, 0.2);
}
.avatar {
  width: 46px;
  height: 46px;
  border-radius: 15px;
  background: rgba(255, 255, 255, 0.14);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 20px;
  flex: 0 0 46px;
}
.profile b {
  display: block;
  font-size: 16px;
}
.profile span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.62);
}

.settings-group {
  margin-top: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.settings-group > .g-title {
  padding: 13px 16px 5px;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 1.4px;
  font-weight: 600;
}
.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 13px 16px;
  border-bottom: 1px solid #f6efe7;
  text-align: left;
  font-size: 14px;
  color: var(--ink);
}
.settings-item:last-child {
  border-bottom: 0;
}
.settings-item .ico {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--paper);
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex: 0 0 30px;
}
.settings-item .ico .icon {
  width: 17px;
  height: 17px;
}
.settings-item .txt {
  flex: 1;
  min-width: 0;
}
.settings-item .txt b {
  display: block;
  font-weight: 600;
  font-size: 13.5px;
}
.settings-item .txt span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 1px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.settings-item .chev {
  color: var(--muted-2);
  font-size: 16px;
}
.settings-item.danger .txt b {
  color: var(--danger);
}

/* ---------- 表单 ---------- */
.field {
  margin-bottom: 14px;
}
.field-label {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin: 0 2px 6px;
  letter-spacing: 0.4px;
}
.input,
.textarea,
.select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: #fffdfa;
  outline: none;
  font-size: 14px;
  transition: 0.15s;
}
.input:focus,
.textarea:focus,
.select:focus {
  border-color: #d8ab86;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(184, 94, 51, 0.1);
}
.textarea {
  resize: vertical;
  min-height: 64px;
}
.row2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.row3 {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 8px;
}
.quick-days {
  display: flex;
  gap: 6px;
  margin: -4px 0 12px;
}
.quick-days button {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--paper);
  color: var(--muted);
  border: 1px solid var(--line);
}
.quick-days button.on {
  background: var(--brand-soft);
  color: var(--brand-deep);
  border-color: #f0d3bd;
  font-weight: 600;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  font-size: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fffdfa;
  color: var(--ink-2);
  transition: 0.12s;
}
.chip:active {
  transform: scale(0.97);
}
.chip.on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  font-weight: 600;
}
.chip.on.brand {
  background: var(--brand);
  border-color: var(--brand);
}
.chip-price {
  font-size: 9px;
  opacity: 0.6;
  margin-left: 3px;
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #fffdfa;
  border: 1px solid var(--line-2);
  border-radius: 12px;
}
.switch-row .sw-txt b {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 5px;
}
.switch-row .sw-txt span {
  font-size: 10px;
  color: var(--muted);
}
.switch {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 999px;
  background: #ddd2c6;
  flex: 0 0 46px;
  transition: 0.18s;
}
.switch::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: 0.18s;
}
.switch.on {
  background: var(--brand);
}
.switch.on::after {
  transform: translateX(19px);
}

.stepper {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  overflow: hidden;
  background: #fffdfa;
}
.stepper button {
  width: 38px;
  height: 40px;
  font-size: 18px;
  color: var(--muted);
  background: #fbf6ef;
}
.stepper button:active {
  background: var(--paper-2);
}
.stepper input {
  flex: 1;
  width: 100%;
  border: 0;
  text-align: center;
  background: transparent;
  outline: none;
  font-weight: 700;
  font-size: 15px;
}

.amount-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.amount-row .prefix {
  font-weight: 700;
  color: var(--muted);
}
.amount-row .input {
  font-weight: 700;
  font-size: 17px;
}

/* ---------- 底部弹层 ---------- */
.sheet-wrap {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.sheet-mask {
  position: absolute;
  inset: 0;
  background: rgba(30, 20, 12, 0.42);
  opacity: 0;
  transition: opacity 0.22s;
  backdrop-filter: blur(2px);
}
.sheet-wrap.open .sheet-mask {
  opacity: 1;
}
.sheet {
  position: relative;
  width: 100%;
  max-width: 540px;
  max-height: 92dvh;
  overflow-y: auto;
  background: var(--paper);
  border-radius: 24px 24px 0 0;
  padding: 8px 18px calc(24px + var(--safe-b));
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.32, 0.72, 0, 1);
  box-shadow: var(--shadow-lg);
}
.sheet-wrap.open .sheet {
  transform: translateY(0);
}
.sheet-grab {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: #d9cabb;
  margin: 4px auto 14px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.sheet-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
}
.sheet-head .close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  color: var(--muted);
}
.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}
.btn {
  border-radius: 13px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: 0.15s;
}
.btn:active {
  transform: scale(0.985);
  opacity: 0.9;
}
.btn.primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(184, 94, 51, 0.28);
}
.btn.primary:active {
  background: var(--brand-deep);
}
.btn.ghost {
  background: var(--card);
  color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.btn.danger {
  background: var(--danger-soft);
  color: var(--danger);
}
.btn.block {
  width: 100%;
}
.btn.sm {
  padding: 8px 12px;
  font-size: 12px;
  border-radius: 10px;
}
.btn:disabled {
  opacity: 0.45;
}

/* ---------- 悬浮按钮 / 底部导航 ---------- */
.fab {
  position: fixed;
  right: max(18px, calc(50vw - 270px + 18px));
  bottom: calc(var(--tab-h) + var(--safe-b) + 18px);
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 26px rgba(184, 94, 51, 0.4);
  z-index: 40;
  transition: transform 0.15s;
}
.fab:active {
  transform: scale(0.94);
}
.fab .icon {
  width: 26px;
  height: 26px;
  stroke-width: 2.2;
}

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  margin: 0 auto;
  width: 100%;
  max-width: 540px;
  height: calc(var(--tab-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  background: rgba(252, 249, 244, 0.94);
  backdrop-filter: saturate(150%) blur(14px);
  -webkit-backdrop-filter: saturate(150%) blur(14px);
  border-top: 1px solid rgba(60, 40, 25, 0.07);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.3px;
}
.tab .icon {
  width: 21px;
  height: 21px;
}
.tab.on {
  color: var(--brand-deep);
  font-weight: 700;
}
.tab.on .icon {
  stroke-width: 2.1;
}

/* ---------- 登录 ---------- */
.login {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(160deg, #f6f1ea 0%, #f0e6da 55%, #eadfd2 100%);
}
.login-card {
  width: 100%;
  max-width: 360px;
  text-align: center;
  padding: 6px 0 10px;
}
.brand-mark {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 20px;
  background: linear-gradient(135deg, #b85e33, #8a4423);
  color: #fff;
  font-size: 30px;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 16px 34px rgba(140, 70, 35, 0.32);
  letter-spacing: -1px;
}
.login-title {
  margin: 0;
  font-size: 25px;
  font-weight: 800;
  letter-spacing: 0.5px;
}
.login-sub {
  margin: 6px 0 26px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.5px;
}
.login-form {
  text-align: left;
  background: rgba(255, 255, 255, 0.6);
  padding: 18px;
  border-radius: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(6px);
}
.login-error {
  min-height: 18px;
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--danger);
  text-align: center;
}
/* ---------- toast ---------- */
.toast-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(var(--tab-h) + var(--safe-b) + 76px);
  z-index: 120;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
  padding: 0 20px;
}
.toast {
  background: rgba(36, 28, 23, 0.94);
  color: #fff;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 12px;
  box-shadow: var(--shadow-lg);
  animation: toast-in 0.2s ease-out;
  max-width: 100%;
  text-align: center;
}
.toast.ok {
  background: rgba(52, 102, 72, 0.96);
}
.toast.err {
  background: rgba(160, 58, 48, 0.96);
}
.toast.warn {
  background: rgba(150, 110, 40, 0.96);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* ---------- 骨架 / 加载 ---------- */
.skeleton {
  background: linear-gradient(90deg, #f1e9df 25%, #f8f2ea 37%, #f1e9df 63%);
  background-size: 400% 100%;
  animation: shimmer 1.2s infinite;
  border-radius: 12px;
}
@keyframes shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- 过渡与入场动画 ---------- */
#view.view-enter {
  animation: viewIn 0.32s cubic-bezier(0.22, 0.8, 0.32, 1);
}
@keyframes viewIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.agenda .bk {
  animation: itemIn 0.42s cubic-bezier(0.22, 0.8, 0.32, 1) backwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
@keyframes itemIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.badge.imp {
  animation: impGlow 2.8s ease-in-out infinite;
}
@keyframes impGlow {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(193, 145, 59, 0);
  }
  50% {
    box-shadow: 0 0 10px rgba(193, 145, 59, 0.32);
  }
}

.cal-cell {
  transition: background-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}
.cal-cell:active {
  transform: scale(0.9);
}
.cal-cell.today {
  animation: todayPop 0.55s cubic-bezier(0.22, 0.8, 0.32, 1);
}
@keyframes todayPop {
  from {
    transform: scale(0.82);
    opacity: 0.35;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

/* 只让柱子生长（scaleY 作用在 rect 自己的 fill-box 上），
   数字/月份标签单独淡入——否则 scaleY 会把文字一起拉扁 */
.chart-bar-rect {
  transform-box: fill-box;
  transform-origin: bottom center;
  animation: barGrow 0.5s cubic-bezier(0.22, 0.8, 0.32, 1) backwards;
  animation-delay: calc(var(--i, 0) * 14ms);
}
.chart-bar text {
  animation: barLabelIn 0.26s ease 0.1s backwards;
}
@keyframes barGrow {
  from {
    transform: scaleY(0);
  }
  to {
    transform: scaleY(1);
  }
}
@keyframes barLabelIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.tab .icon {
  transition: transform 0.18s ease;
}
.tab.on .icon {
  transform: translateY(-1px);
}

@media (hover: hover) {
  .bk:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(60, 40, 25, 0.1), var(--shadow);
  }
  .cal-btn:hover,
  .cal-today-btn:hover {
    background: #fff;
  }
}

/* ---------- 项目数量 ---------- */
.custom-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.custom-row .input {
  flex: 1;
  padding: 9px 10px;
  font-size: 13px;
}
.selected-items {
  margin-top: 8px;
}
.item-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  margin-bottom: 6px;
  background: #fffdfa;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 13px;
}
.item-name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--ink-2);
}
.item-qty {
  display: flex;
  align-items: center;
  gap: 2px;
  background: var(--paper);
  border-radius: 8px;
  padding: 2px;
  flex: 0 0 auto;
}
.item-qty button {
  width: 26px;
  height: 26px;
  border-radius: 6px;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1;
}
.item-qty button:active {
  background: var(--paper-2);
}
.item-qty b {
  min-width: 22px;
  text-align: center;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.item-sum {
  flex: 0 0 52px;
  text-align: right;
  font-weight: 700;
  color: var(--brand-deep);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.item-del {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  color: var(--muted-2);
  font-size: 12px;
  flex: 0 0 24px;
}
.item-del:active {
  background: var(--paper-2);
}

/* ---------- 成员管理 ---------- */
.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-bottom: 1px solid #f6efe7;
}
.member-row:last-child {
  border-bottom: 0;
}
.member-avatar {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--brand-soft);
  color: var(--brand-deep);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 15px;
  flex: 0 0 36px;
}
.member-row.off .member-avatar {
  background: #eee8e2;
  color: var(--muted);
}
.member-info {
  flex: 1;
  min-width: 0;
}
.member-info b {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
}
.member-info span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.member-actions {
  display: flex;
  gap: 4px;
  flex: 0 0 auto;
}
.member-actions button {
  font-size: 11px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--line);
}
.member-actions button.warn {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: #f2d2cd;
}
.badge.role-owner {
  background: var(--brand-soft);
  color: var(--brand-deep);
}
.badge.role-staff {
  background: var(--teal-soft);
  color: var(--teal);
}
.badge.off {
  background: #eee8e2;
  color: var(--muted);
}
.perm-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid #f6efe7;
}
.perm-row .perm-txt b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
}
.perm-row .perm-txt span {
  display: block;
  font-size: 10.5px;
  color: var(--muted);
  margin-top: 2px;
}


