/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  /* iOS 安全区适配 */
  padding-top: env(safe-area-inset-top);
  padding-bottom: env(safe-area-inset-bottom);
}

:root {
  /* 可爱风配色 */
  --bg: #FFF0F3;
  --card: #ffffff;
  --primary: #FF8FA3;
  --primary-dark: #E8768C;
  --primary-light: #FFB5C5;
  --text: #4A4A4A;
  --text-light: #9B8E92;
  --text-lighter: #C4B5B9;
  --border: #FFE0E5;
  --shadow: 0 2px 12px rgba(255, 143, 163, 0.10);
  --shadow-hover: 0 4px 20px rgba(255, 143, 163, 0.18);
  --radius: 16px;
  --radius-sm: 10px;
  --sidebar-w: 180px;

  /* 模块颜色 - 马卡龙色系 */
  --c-weight: #89C4E1;
  --c-fitness: #7EC8A3;
  --c-dance: #B8A9D4;
  --c-english: #FFB380;
  --c-work: #A8D8EA;
  --c-up: #FF6B6B;
  --c-down: #7EC8A3;

  /* 渐变 */
  --gradient-sidebar: linear-gradient(180deg, #FF8FA3 0%, #FFB5C5 100%);
  --gradient-card: linear-gradient(135deg, #FFF5F7 0%, #FFFFFF 100%);

  /* 兼容别名（部分模块误用 --bg-card/--bg-page，此处补全避免透明） */
  --bg-card: var(--card);
  --bg-page: var(--bg);
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; font-size: inherit; }

/* ===== Layout ===== */
#app {
  display: flex;
  min-height: 100vh;
}

#sidebar {
  width: var(--sidebar-w);
  background: var(--gradient-sidebar);
  color: #fff;
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  overflow: hidden;
}

.sidebar-header {
  padding: 20px 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  flex-shrink: 0;
}

.sidebar-logo { font-size: 26px; }
.sidebar-title { font-size: 15px; font-weight: 700; letter-spacing: 0.5px; }

#content {
  flex: 1;
  margin-left: var(--sidebar-w);
  padding: 16px;
  max-width: 900px;
}

/* ===== Tab Bar - 支持左右滑动 ===== */
#tab-bar {
  display: flex;
  flex-direction: column;
  padding: 8px;
  gap: 2px;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
}

/* Tab 滑动指示器（桌面端侧边栏不需要，移动端才有） */
.tab-scroll-indicator {
  display: none;
}

.tab-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: rgba(255,255,255,0.7);
  font-size: 14px;
  transition: all 0.25s;
  text-align: left;
  width: 100%;
  flex-shrink: 0;
}

.tab-item:hover { color: #fff; background: rgba(255,255,255,0.12); transform: scale(1.02); }

.tab-item.active {
  color: #fff;
  background: rgba(255,255,255,0.22);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.tab-icon { font-size: 18px; flex-shrink: 0; }

/* ===== Tab 拖拽排序 ===== */
.tab-item.dragging {
  opacity: 0.3;
  transform: scale(0.95);
  transition: none;
}

.drag-ghost {
  background: var(--primary);
  color: #fff;
  font-weight: 700;
  border-radius: 12px;
  box-shadow: 0 8px 30px rgba(255, 143, 163, 0.5);
  transform: scale(1.12);
  transition: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  z-index: 9999;
}
.drag-ghost .tab-icon { font-size: inherit; }
.drag-ghost .tab-label { font-size: inherit; }

/* ===== Tab Panels ===== */
.tab-panel { display: none; animation: fadeIn 0.25s ease; }
.tab-panel.active { display: block; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== Cards ===== */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
}

.card-title {
  font-size: 14px;
  color: var(--text-light);
  margin-bottom: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== Date Header ===== */
.date-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 16px;
}

.date-header .date {
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
}

.date-header .weekday {
  font-size: 14px;
  color: var(--text-light);
}

/* ===== Buttons ===== */
.btn {
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(255, 143, 163, 0.3);
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 14px rgba(255, 143, 163, 0.4); }
.btn-primary:active { transform: scale(0.97); }

.btn-outline { border: 1.5px solid var(--border); color: var(--text); background: #fff; }
.btn-outline:hover { border-color: var(--primary); color: var(--primary); }
.btn-icon { padding: 9px 12px; border: 1.5px solid var(--border); background: #fff; color: var(--text-light); font-size: 13px; border-radius: var(--radius-sm); }
.btn-icon:active { background: #f0f0f0; }

.btn-danger { color: var(--c-up); }
.btn-danger:hover { background: #FFF0F3; }

.btn-sm { padding: 5px 12px; font-size: 12px; border-radius: 8px; }

/* ===== Forms ===== */
.input-group {
  display: flex;
  gap: 8px;
  align-items: center;
}

.input {
  padding: 9px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  outline: none;
  transition: all 0.2s;
  background: #fff;
  color: var(--text);
}

.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(255, 143, 163, 0.12); }

.input-number { width: 100px; text-align: center; font-size: 18px; font-weight: 700; }

.select {
  padding: 7px 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}

/* ===== Stat Display ===== */
.stat-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stat-item {
  flex: 1;
  min-width: 100px;
  text-align: center;
  padding: 14px 8px;
  background: linear-gradient(135deg, #FFF5F7, #FFF0F3);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

.stat-value {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--primary);
}

.stat-label {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}

.stat-value.up { color: var(--c-up); }
.stat-value.down { color: var(--c-down); }

/* ===== Big Number Display ===== */
.big-number {
  font-size: 52px;
  font-weight: 700;
  text-align: center;
  line-height: 1.1;
  color: var(--primary);
}

.big-number .unit { font-size: 18px; color: var(--text-light); font-weight: 400; }

.change-indicator {
  text-align: center;
  font-size: 14px;
  margin-top: 8px;
  font-weight: 600;
}

.change-indicator.up { color: var(--c-up); }
.change-indicator.down { color: var(--c-down); }
.change-indicator.flat { color: var(--text-light); }

/* ===== Check-in Button ===== */
.checkin-btn {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  font-size: 16px;
  font-weight: 600;
  transition: all 0.3s;
  border: 3px solid;
  position: relative;
}

.checkin-btn .checkin-icon { font-size: 36px; margin-bottom: 4px; }

.checkin-btn:not(.done) {
  border-color: var(--check-color, var(--primary));
  color: var(--check-color, var(--primary));
  background: #fff;
}

.checkin-btn:not(.done):hover {
  background: var(--check-color, var(--primary));
  color: #fff;
  transform: scale(1.05);
  box-shadow: 0 4px 16px rgba(255, 143, 163, 0.3);
}

.checkin-btn:not(.done):active { transform: scale(0.95); }

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

.checkin-btn.done {
  background: var(--c-down);
  border-color: var(--c-down);
  color: #fff;
}

.checkin-btn.done .checkin-icon::after { content: " ✓"; }

/* ===== Form Row ===== */
.form-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.form-label {
  font-size: 13px;
  color: var(--text-light);
  min-width: 36px;
}

/* ===== Streak Display ===== */
.streak-display {
  text-align: center;
  padding: 18px 0;
}

.streak-number {
  font-size: 42px;
  font-weight: 700;
  color: var(--c-fitness);
}

.streak-label {
  font-size: 13px;
  color: var(--text-light);
}

/* ===== Progress Bar ===== */
.progress-bar {
  width: 100%;
  height: 8px;
  background: #FFE0E5;
  border-radius: 10px;
  overflow: hidden;
}

.progress-bar .fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.4s ease;
  background: var(--primary);
}

/* ===== Calendar ===== */
.calendar {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.calendar .cal-header {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  padding: 4px 0;
  font-weight: 600;
}

.calendar .cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 8px;
  background: #FFF5F7;
  color: var(--text-light);
  position: relative;
}

.calendar .cal-day.has-data {
  background: var(--check-color, var(--c-fitness));
  color: #fff;
  font-weight: 700;
}

.calendar .cal-day.today {
  outline: 2.5px solid var(--primary);
  outline-offset: -2px;
}

.calendar .cal-day.empty { background: transparent; }

/* ===== Task List ===== */
.task-input-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.task-input-row .input { flex: 1; }

.task-list { list-style: none; }

.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}

.task-item:hover { background: #FFF5F7; }

.task-checkbox {
  width: 22px;
  height: 22px;
  border: 2px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.task-checkbox.checked {
  background: var(--c-down);
  border-color: var(--c-down);
}

.task-checkbox.checked::after {
  content: "✓";
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.task-text { flex: 1; font-size: 14px; }

.task-item.completed .task-text {
  text-decoration: line-through;
  color: var(--text-lighter);
}

.task-actions {
  display: flex;
  gap: 4px;
  opacity: 0;
  transition: opacity 0.2s;
}

.task-item:hover .task-actions { opacity: 1; }

.task-action-btn {
  padding: 4px 8px;
  font-size: 12px;
  border-radius: 6px;
  color: var(--text-light);
}

.task-action-btn:hover { background: #FFF0F3; color: var(--text); }

/* ===== Empty State ===== */
.empty-state {
  text-align: center;
  padding: 44px 20px;
  color: var(--text-lighter);
  font-size: 14px;
}

.empty-state .empty-icon { font-size: 44px; margin-bottom: 10px; }

/* ===== Chart Container ===== */
.chart-container {
  position: relative;
  height: 170px;
  margin: 8px 0;
}

.chart-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 8px;
}

.chart-tab {
  padding: 5px 14px;
  font-size: 12px;
  border-radius: 20px;
  background: #FFF0F3;
  color: var(--text-light);
  transition: all 0.2s;
  font-weight: 500;
}

.chart-tab.active { background: var(--primary); color: #fff; }

/* ===== History List ===== */
.history-list {
  max-height: 130px;
  overflow-y: auto;
}

.history-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}

.history-item:last-child { border-bottom: none; }

.history-date { color: var(--text-light); font-size: 13px; }
.history-value { font-weight: 700; }
.history-change { font-size: 12px; margin-left: 8px; }

/* ===== Section Divider ===== */
.section-divider {
  font-size: 14px;
  color: var(--primary);
  margin: 20px 0 10px;
  font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}

/* ===== Settings ===== */
.setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

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

.setting-label { font-size: 14px; font-weight: 500; }
.setting-desc { font-size: 12px; color: var(--text-light); margin-top: 2px; }

/* Toggle Switch */
.toggle {
  position: relative;
  width: 46px;
  height: 26px;
  background: #ddd;
  border-radius: 13px;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle.on { background: var(--primary); }

.toggle::after {
  content: "";
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.toggle.on::after { transform: translateX(20px); }

/* ===== Toast ===== */
#toast-container {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  pointer-events: none;
}

.toast {
  background: rgba(255, 143, 163, 0.94);
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  margin-top: 8px;
  animation: toastIn 0.3s ease;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(255, 143, 163, 0.3);
}

.toast.success { background: rgba(126, 200, 163, 0.94); }
.toast.warn { background: rgba(255, 107, 107, 0.94); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ===== 更新横幅 — 放底部，避开灵动岛 ===== */
.update-banner {
  position: fixed;
  bottom: -80px;
  left: 12px;
  right: 12px;
  z-index: 10000;
  background: linear-gradient(135deg, #FF8FA3, #FF6B8A);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(255, 143, 163, 0.5);
  transition: bottom 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
.update-banner.show {
  bottom: max(80px, calc(80px + env(safe-area-inset-bottom)));
}
.update-banner button {
  background: #fff;
  color: #FF6B8A;
  border: none;
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: transform 0.15s;
}
.update-banner button:active {
  transform: scale(0.95);
}

/* ===== Dashboard — 桌面摆件风 ===== */
.dash-desk {
  position: relative;
}

/* 总览页提醒指示器 */
.reminder-indicator {
  display: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 10px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--border);
  animation: fadeSlideDown 0.3s ease;
}
@keyframes fadeSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.reminder-indicator .ri-done {
  font-size: 13px;
  color: var(--c-down);
  font-weight: 600;
}
.reminder-indicator .ri-title {
  font-size: 12px;
  color: var(--c-up);
  margin-bottom: 6px;
  font-weight: 600;
}
.reminder-indicator .ri-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.reminder-indicator .ri-tag {
  display: inline-block;
  background: #FFE0E5;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 500;
}

/* 日期行 */
.dash-date-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 8px;
}
.dash-date-big {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  letter-spacing: -0.5px;
}
.dash-weekday-tag {
  font-size: 14px;
  color: var(--primary-light);
  font-weight: 500;
}

/* 激励语便签 */
.dash-quote-sticky {
  background: linear-gradient(135deg, #FFF9DB 0%, #FFF3C4 100%);
  border-radius: 4px 16px 4px 16px;
  padding: 10px 16px;
  margin-bottom: 14px;
  box-shadow: 2px 3px 8px rgba(0,0,0,0.06), inset 0 0 0 1px rgba(255,200,50,0.3);
  position: relative;
  transform: rotate(-0.5deg);
  transition: transform 0.3s;
}
.dash-quote-sticky:hover { transform: rotate(0deg) translateY(-1px); }
.dash-quote-sticky::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  width: 20px;
  height: 14px;
  background: rgba(255,180,100,0.5);
  border-radius: 2px;
  transform: translateX(-50%) rotate(2deg);
}
.dash-quote-text {
  font-size: 13px;
  color: #8B6914;
  font-style: italic;
  line-height: 1.5;
  margin: 0;
}
.dash-quote-author {
  font-size: 10px;
  color: #B8962E;
  text-align: right;
  margin-top: 4px;
}

/* 进度环区域 */
.dash-ring-section {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
  padding: 10px 0;
}
.dash-ring-wrap {
  position: relative;
  width: 90px;
  height: 90px;
  flex-shrink: 0;
}
.dash-ring-svg {
  transform: rotate(-90deg);
  width: 90px;
  height: 90px;
}
.dash-ring-bg {
  fill: none;
  stroke: var(--border);
  stroke-width: 6;
}
.dash-ring-fill {
  fill: none;
  stroke: var(--primary);
  stroke-width: 6;
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease;
}
.dash-ring-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  line-height: 1;
}
.dash-ring-pct {
  font-size: 22px;
  font-weight: 800;
  color: var(--primary);
  display: block;
}
.dash-ring-sub {
  font-size: 10px;
  color: var(--text-light);
}
.dash-ring-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.dash-ring-status {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.dash-ring-detail {
  font-size: 11px;
  color: var(--text-light);
  list-style: none;
  padding: 0;
}
.dash-ring-detail li {
  padding: 1px 0;
}
.dash-ring-detail .done-dot { color: var(--c-down); }
.dash-ring-detail .pend-dot { color: var(--text-lighter); }

/* 摆件区 — 不对称网格 */
.dash-widgets {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
}

/* 基础摆件卡片 */
.dash-widget {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1.2);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}
.dash-widget:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px) scale(1.02);
}
.dash-widget:active { transform: scale(0.97); }

/* 摆件尺寸变体 */
.dash-widget.wide { grid-column: span 2; }
.dash-widget.full { grid-column: span 3; }

/* 摆件风格变体 */
.dash-widget.paper {
  border-radius: 2px 14px 2px 14px;
  background: linear-gradient(135deg, #fff 0%, #FFF5F7 100%);
  transform: rotate(-0.8deg);
}
.dash-widget.paper:hover { transform: rotate(0deg) translateY(-3px); }
.dash-widget.paper:nth-child(even) { transform: rotate(0.6deg); }
.dash-widget.paper:nth-child(even):hover { transform: rotate(0deg) translateY(-3px); }

.dash-widget.folder {
  border-left: 4px solid var(--primary-light);
  border-radius: 6px 14px 14px 6px;
  background: linear-gradient(135deg, #FFFBFB 0%, #FFF0F3 100%);
}

/* 相纸库存摆件 — 横跨整行，醒目 */
.dash-widget.paper-stock-widget {
  grid-column: 1 / -1;
  border-radius: 14px;
  background: linear-gradient(135deg, #EAFBF0 0%, #fff 100%);
  border: 1px solid #B7E4C7;
}
.dash-widget.paper-stock-widget.paper-warn {
  background: linear-gradient(135deg, #FFF8E6 0%, #fff 100%);
  border-color: #FFE08A;
}
.dash-widget.paper-stock-widget.paper-low {
  background: linear-gradient(135deg, #FFE9EC 0%, #fff 100%);
  border-color: #FF8A9B;
  animation: paperFlash 1.2s ease-in-out infinite;
}
@keyframes paperFlash {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,80,107,0.0); }
  50% { box-shadow: 0 0 0 6px rgba(255,80,107,0.18); }
}
.paper-stock-header { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.paper-stock-icon { font-size: 18px; }
.paper-stock-label { font-weight: 600; color: var(--text); }
.paper-stock-status { margin-left: auto; font-size: 11px; padding: 2px 8px; border-radius: 10px; background: var(--primary-light); color: #fff; }
.paper-stock-widget.paper-warn .paper-stock-status { background: #F0A500; }
.paper-stock-widget.paper-low .paper-stock-status { background: #FF506B; }
.paper-stock-number { font-size: 34px; font-weight: 800; color: var(--text); margin: 4px 0 2px; line-height: 1; }
.paper-stock-number small { font-size: 14px; font-weight: 600; color: var(--text-2); }
.paper-stock-widget.paper-low .paper-stock-number { color: #FF506B; }
.paper-stock-sub { font-size: 11px; color: var(--text-2); line-height: 1.5; }

/* 相纸低库存横幅 */
.paper-low-banner {
  background: linear-gradient(90deg, #FF506B, #FF7A8A);
  color: #fff; font-size: 14px; font-weight: 600; text-align: center;
  padding: 10px 14px; border-radius: 12px; margin-bottom: 12px;
  box-shadow: 0 4px 14px rgba(255,80,107,0.35);
  animation: paperFlash 1.2s ease-in-out infinite;
}
.paper-low-banner b { font-size: 18px; }

/* 相纸管理弹窗 */
.paper-modal-title { font-size: 18px; font-weight: 700; margin-bottom: 12px; color: var(--text); }
.paper-modal-current { text-align: center; padding: 14px; border-radius: 12px; background: linear-gradient(135deg, #EAFBF0, #fff); border: 1px solid #B7E4C7; margin-bottom: 16px; }
.paper-modal-current.low { background: linear-gradient(135deg, #FFE9EC, #fff); border-color: #FF8A9B; }
.pmc-num { font-size: 40px; font-weight: 800; color: var(--text); line-height: 1; }
.pmc-num small { font-size: 16px; color: var(--text-2); font-weight: 600; }
.pmc-sub { font-size: 13px; color: var(--text-2); margin-top: 4px; }
.pmc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; }
.pmc-titles { text-align: left; }
.pmc-titles .pmc-num { text-align: left; }
.pm-refresh-btn {
  flex: 0 0 auto;
  align-self: center;
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 10px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, background 0.12s, opacity 0.12s;
  white-space: nowrap;
}
.pm-refresh-btn:active { transform: scale(0.95); background: var(--primary); color: #fff; }
.pm-refresh-btn:disabled { opacity: 0.6; }
.paper-modal-section { margin-bottom: 18px; }
.pms-head { font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.paper-form-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.paper-form-row label { width: 88px; font-size: 13px; color: var(--text-2); flex-shrink: 0; }
.paper-form-row input { flex: 1; padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px; font-size: 14px; background: var(--bg); color: var(--text); }
.paper-btn { width: 100%; padding: 10px; border: none; border-radius: 10px; background: var(--primary-light); color: #fff; font-size: 14px; font-weight: 600; cursor: pointer; margin-top: 4px; }
.paper-btn.primary { background: var(--primary); }
.paper-btn.warn { background: #fff3cd; color: #8a6d3b; }
.paper-btn:active { transform: scale(0.98); }
.paper-divider { height: 1px; background: var(--border); margin: 12px 0; }
.paper-restock-list { list-style: none; padding: 0; margin: 0; }
.paper-restock-list li { display: flex; justify-content: space-between; font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.paper-restock-list li.paper-empty { justify-content: center; color: var(--text-2); border: none; }

/* 相纸消耗复盘时间线 */
.paper-timeline-list { list-style: none; padding: 0; margin: 0; max-height: 320px; overflow-y: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-page); }
.ptl-row { display: grid; grid-template-columns: 64px 1fr auto auto 26px; align-items: center; gap: 6px; padding: 8px 10px; border-bottom: 1px solid var(--border); font-size: 13px; }
.ptl-act { display: flex; justify-content: flex-end; }
.ptl-del { border: none; background: transparent; color: #e74c3c; font-size: 15px; padding: 2px 3px; cursor: pointer; line-height: 1; -webkit-tap-highlight-color: transparent; }
.ptl-del:active { opacity: 0.5; }
.ptl-excluded { opacity: 0.5; }
.ptl-excluded .ptl-qty { text-decoration: line-through; }
.ptl-row:last-child { border-bottom: none; }
.ptl-date { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.ptl-src { font-size: 12px; color: var(--text-2); }
.ptl-src.is-staff { color: #C2185B; font-weight: 700; }
.ptl-src.is-staff::before { content: '🛰 '; }
.ptl-qty { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptl-qty.base { color: var(--text-2); }
.ptl-qty.plus { color: #1aa179; }
.ptl-qty.minus { color: #d9534f; }
.ptl-bal { font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ptl-base { background: rgba(0,0,0,0.03); }
.ptl-restock { background: rgba(26,161,121,0.06); }
.ptl-consume { background: rgba(217,83,79,0.05); }
.ptl-formula { font-size: 13px; font-weight: 700; color: var(--text); background: var(--bg-page); border: 1px dashed var(--border); border-radius: 8px; padding: 8px 10px; margin-bottom: 8px; font-variant-numeric: tabular-nums; }
.ptl-note { font-size: 11px; color: var(--text-2); margin-top: 8px; line-height: 1.5; }

/* 体重摆件 — 像个小秤 */
.dash-widget.weight-widget {
  background: linear-gradient(135deg, #F0F7FB 0%, #fff 100%);
  border: 1.5px dashed #89C4E1;
  border-radius: 50% 50% 16px 16px;
  padding: 16px 14px 12px;
  text-align: center;
  min-height: auto;
}
.weight-icon-row {
  font-size: 28px;
  margin-bottom: 4px;
  animation: weightBounce 2s ease-in-out infinite;
}
@keyframes weightBounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}
.weight-number {
  font-size: 24px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.weight-number small {
  font-size: 12px;
  font-weight: 400;
  color: var(--text-light);
}
.weight-change {
  font-size: 12px;
  font-weight: 600;
  margin-top: 4px;
}
.weight-change.up { color: var(--c-up); }
.weight-change.down { color: var(--c-down); }
.weight-change.flat { color: var(--text-light); }
.weight-hint {
  font-size: 10px;
  color: var(--text-lighter);
  margin-top: 3px;
}

/* 习惯打卡摆件 — 便利贴风格 */
.dash-widget.habit-widget {
  padding: 12px 10px;
  text-align: center;
  min-height: auto;
}
.habit-w-icon {
  font-size: 30px;
  display: block;
  margin-bottom: 4px;
}
.habit-w-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.habit-w-status {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
  display: inline-block;
}
.habit-w-status.done {
  background: #E8F8E8;
  color: #4CAF50;
}
.habit-w-status.pending {
  background: #FFF0F0;
  color: #E88B8B;
}
.habit-w-streak {
  font-size: 10px;
  color: var(--text-lighter);
  margin-top: 3px;
}
.habit-w-detail {
  font-size: 10px;
  color: var(--text-lighter);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 工作摆件 — 文件夹风格 */
.dash-widget.work-widget {
  padding: 14px;
  min-height: auto;
}
.work-w-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.work-w-icon {
  font-size: 22px;
}
.work-w-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.work-w-progress {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  margin-bottom: 8px;
  overflow: hidden;
}
.work-w-bar {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--primary-light), var(--primary));
  transition: width 0.5s ease;
}
.work-w-bar.done-bar {
  background: linear-gradient(90deg, #7EC8A3, #5BAF7E);
}
.work-w-stats {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--text-light);
}
.work-w-stats .warn {
  color: var(--c-up);
  font-weight: 600;
}

/* ===== 首页桌宠 ===== */
.pet-anchor {
  position: relative;
  width: 100%;
  height: 110px;
  margin-top: 10px;
  pointer-events: none;
}
.pet-desktop {
  position: absolute;
  right: 12px;
  bottom: 8px;
  z-index: 10;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  pointer-events: auto;
}
.pet-desktop.dragging {
  cursor: grabbing;
}
.pet-facing {
  width: 100%;
  height: 100%;
  transition: transform 0.3s ease;
}
.pet-frame {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #F5D5A3;
  box-shadow: 0 4px 16px rgba(228,165,75,0.3);
  background: #FFF8F0;
  position: relative;
  animation: petBreath 3s ease-in-out infinite;
  transition: border-color 0.4s, box-shadow 0.4s;
}
.pet-desktop.dragging .pet-frame { animation: none; }
.pet-photo {
  width: 100%; height: 100%;
  object-fit: cover; object-position: center top;
  pointer-events: none;
}
.pet-video { display: block; background: #FFF8F0; }
.pet-video::-webkit-media-controls, .pet-video::-webkit-media-controls-panel { display: none !important; }
.pet-photo-fallback { display: none; }
.pet-frame.sleeping { border-color: #B8A9D4; box-shadow: 0 4px 16px rgba(184,169,212,0.35); }
.pet-frame.sleeping .pet-photo { filter: brightness(0.85) saturate(0.8); }
.pet-frame.eating { border-color: #7EC8A3; box-shadow: 0 4px 16px rgba(126,200,163,0.3); }
.pet-frame.playing { border-color: #FF8FA3; box-shadow: 0 4px 16px rgba(255,143,163,0.4); }
.pet-frame.greeting { border-color: #FFD166; box-shadow: 0 4px 16px rgba(255,209,102,0.4); }
.pet-frame.belly_up { border-color: #FFB5C5; box-shadow: 0 4px 16px rgba(255,181,197,0.4); }
.pet-bubble {
  position: absolute; bottom: calc(100% + 6px); left: 50%;
  transform: translateX(-50%);
  background: #fff; border: 2px solid #FFB5C5;
  border-radius: 14px 14px 14px 4px; padding: 5px 12px;
  font-size: 11px; font-weight: 600; color: #E0607E;
  white-space: nowrap; max-width: 160px; overflow: hidden; text-overflow: ellipsis;
  box-shadow: 0 2px 8px rgba(255,143,163,0.15);
  z-index: 2; pointer-events: none;
  animation: petBubblePop 0.35s ease;
}
.pet-bubble::after {
  content: ''; position: absolute; bottom: -7px; left: 16px;
  width: 0; height: 0;
  border-left: 7px solid transparent; border-right: 7px solid transparent;
  border-top: 7px solid #FFB5C5;
}
@keyframes petBubblePop {
  0% { opacity: 0; transform: translateX(-50%) scale(0.7); }
  60% { transform: translateX(-50%) scale(1.05); }
  100% { opacity: 1; transform: translateX(-50%) scale(1); }
}
.pet-zzz {
  position: absolute; top: -6px; right: -2px;
  display: flex; flex-direction: column; align-items: center; z-index: 3;
}
.pet-z {
  font-size: 12px; font-weight: 800; color: #B8A9D4;
  opacity: 0; animation: zzzFloat 2s ease-in-out infinite;
}
@keyframes zzzFloat {
  0% { opacity: 0; transform: translateY(0) scale(0.6); }
  40% { opacity: 1; transform: translateY(-6px) scale(1); }
  100% { opacity: 0; transform: translateY(-12px) scale(0.8); }
}
@keyframes petBreath {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.04); }
}
@keyframes petBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.15) translateY(-10px); }
  60% { transform: scale(0.92) translateY(3px); }
  100% { transform: scale(1) translateY(0); }
}
@keyframes petSquish {
  0%, 100% { transform: scale(1, 1); }
  40% { transform: scale(1.2, 0.8); }
  70% { transform: scale(0.9, 1.1); }
}
@keyframes petWiggle {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-10deg); }
  75% { transform: rotate(10deg); }
}
@keyframes petHappy {
  0%, 100% { transform: scale(1) rotate(0); }
  30% { transform: scale(1.1) rotate(-5deg); }
  60% { transform: scale(0.95) rotate(5deg); }
}

/* 桌面端：更宽敞 */
@media (min-width: 768px) {
  .dash-widgets {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 12px;
  }
  .dash-widget.full { grid-column: span 4; }
  .dash-widget.wide { grid-column: span 2; }

  .dash-ring-wrap { width: 100px; height: 100px; }
  .dash-ring-svg { width: 100px; height: 100px; }
  .dash-ring-pct { font-size: 26px; }
  .dash-ring-section { gap: 24px; }
}

/* 移动端适配 */
@media (max-width: 767px) {
  .dash-date-big { font-size: 22px; }
  .dash-quote-sticky { padding: 8px 12px; margin-bottom: 10px; }
  .dash-quote-text { font-size: 12px; }
  .dash-ring-wrap { width: 80px; height: 80px; }
  .dash-ring-svg { width: 80px; height: 80px; }
  .dash-ring-pct { font-size: 20px; }
  .dash-ring-section { gap: 10px; margin-bottom: 12px; }
  .dash-widgets {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
  }
  .dash-widget { padding: 10px; }
  .dash-widget.full { grid-column: span 3; }
  .dash-widget.wide { grid-column: span 3; }
  .habit-w-icon { font-size: 24px; }
  .work-w-label { font-size: 13px; }
}

/* ===== Work Stats ===== */
.work-stat-row {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.work-stat {
  flex: 1;
  text-align: center;
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
}

.work-stat .num { font-size: 24px; font-weight: 700; display: block; }
.work-stat.done { background: #EAFBF1; color: var(--c-down); }
.work-stat.pending { background: #FFF0F3; color: var(--c-up); }
.work-stat.total { background: #F5F0FF; color: #B8A9D4; }

/* ===== Guest Management ===== */
.guest-form {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.guest-form .input { flex: 1; min-width: 100px; font-size: 14px; }
.guest-form .btn { flex-shrink: 0; }

.event-type-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.event-type-hint {
  font-size: 11px;
  color: var(--text-lighter);
}
.event-theme-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.event-theme-hint {
  font-size: 11px;
  color: var(--text-lighter);
}
.event-theme {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  padding: 3px 0 4px;
}
.event-role {
  font-size: 12px;
  background: #F3E8FF;
  color: #7B1FA2;
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
}
.switch-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--text);
}
.switch-label input {
  display: none;
}
.switch-slider {
  width: 42px;
  height: 24px;
  background: #E0E0E0;
  border-radius: 24px;
  position: relative;
  transition: background 0.2s;
}
.switch-slider::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.switch-label input:checked + .switch-slider {
  background: #FF9800;
}
.switch-label input:checked + .switch-slider::after {
  transform: translateX(18px);
}
.switch-text {
  font-weight: 600;
}

.guest-list { }
.guest-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  gap: 8px;
  flex-wrap: wrap;
}
.guest-item:last-child { border-bottom: none; }
.guest-info { flex: 1; min-width: 0; }
.guest-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
  display: block;
}
.guest-date {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 2px;
}
.guest-countdown {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  background: #FFF0F7;
  color: var(--primary);
  white-space: nowrap;
  font-weight: 600;
}
.guest-countdown.critical {
  background: #FFE0E5;
  color: var(--c-up);
  font-weight: 700;
}
.guest-overdue {
  font-size: 11px;
  color: var(--text-lighter);
}
.guest-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
  flex-wrap: wrap;
}
.guest-script-btn {
  font-size: 11px;
  padding: 5px 12px;
  border-radius: 14px;
  border: 1.5px solid var(--primary);
  background: #FFF0F7;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  font-weight: 600;
}
.guest-script-btn:hover { background: #FFE0EB; }
.guest-done-btn { font-size: 11px; white-space: nowrap; }
.guest-del-btn { background: none; border: none; cursor: pointer; font-size: 14px; padding: 2px; opacity: 0.5; }
.guest-del-btn:hover { opacity: 1; }

/* Urgency Banner */
.guest-urgency-banner {
  border-left: 4px solid var(--c-up);
  background: linear-gradient(135deg, #FFF5F7, #FFF0F3);
}
.guest-urgency-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.guest-urgency-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px dashed #FFE0E5;
  font-size: 13px;
}
.guest-urgency-item:last-child { border-bottom: none; }
.guest-urgency-name { font-weight: 700; color: var(--text); }
.guest-urgency-date { color: var(--text-light); font-size: 12px; }
.guest-urgency-countdown {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 12px;
  background: #FFF0F3;
  color: var(--c-up);
  font-weight: 700;
}
.guest-urgency-countdown.critical {
  background: #FFE0E5;
  animation: pulse-warn 1.5s infinite;
}
@keyframes pulse-warn {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

/* ===== Calendar View ===== */
.cal-card {
  margin-bottom: 12px;
}
.cal-header {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 10px;
}
.cal-nav-btn {
  width: 34px; height: 34px;
  border: 1.5px solid var(--border);
  border-radius: 50%;
  background: var(--card);
  font-size: 14px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
  color: var(--primary);
}
.cal-nav-btn:hover { background: #FFF0F7; border-color: var(--primary); }
.cal-month-label {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  min-width: 100px;
  text-align: center;
}
.cal-poster-bar {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}
.cal-poster-bar .btn {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: 20px;
}
.cal-stats {
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.cal-grid {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  color: var(--text-lighter);
  font-weight: 700;
  padding: 4px 0;
}
.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}
.cal-day {
  position: relative;
  padding: 2px;
  border-radius: 5px;
  background: #FFF5F7;
  min-height: 42px;
  display: flex;
  flex-direction: column;
  cursor: default;
  transition: background 0.15s;
  overflow: hidden;
}
.cal-day-empty {
  background: transparent;
  min-height: 0;
}
.cal-day-num {
  position: absolute;
  top: 1px;
  left: 3px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  z-index: 1;
}
.cal-today {
  background: #FFF0F7;
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.cal-today .cal-day-num {
  color: var(--primary);
}
.cal-has-events {
  background: #FFF0F5;
}
.cal-day-mahjong {
  background: #FFF8E1 !important;
  border: 1.5px solid #FF9800;
}
.cal-day-mahjong.cal-today {
  outline: 2px solid #FF9800;
}
/* 地下偶像一日店长：实心霓虹粉整格 + 白字加粗，区别于麻将浅黄 */
.cal-day-ugstore {
  background: #E91E8C !important;
  border: 2px solid #C2185B;
}
.cal-day-ugstore .cal-day-num,
.cal-day-ugstore .cal-event-name,
.cal-day-ugstore .cal-day-theme,
.cal-day-ugstore .cal-event-role {
  color: #fff !important;
  font-weight: 800;
}
.cal-day-ugstore.cal-today {
  outline: 3px solid #fff;
  box-shadow: 0 0 0 2px #C2185B;
}
.cal-day-ugstore .cal-guests {
  background: rgba(255,255,255,0.12);
  border-radius: 6px;
  padding: 2px 4px;
}
.event-item.event-ugstore {
  border-left: 4px solid #E91E8C;
  background: #FCE4F1;
}
.event-item.event-ugstore .event-guest-name {
  color: #C2185B;
  font-weight: 700;
}
.fin-date-card-ugstore {
  border: 2px solid #E91E8C;
  background: linear-gradient(180deg, #FFF0F7 0%, var(--bg-card) 40px);
}
.fin-date-card-ugstore .fin-date-label {
  color: #C2185B;
  font-weight: 800;
}
.fin-ugstore-row {
  background: #E91E8C;
  color: #fff;
  font-weight: 700;
  font-size: 12px;
  padding: 7px 10px;
  border-radius: 8px;
  margin-bottom: 8px;
}
.fin-date-theme-ugstore {
  background: #E91E8C !important;
  color: #fff !important;
  border-color: #C2185B !important;
}
.fin-date-totals-ugstore .fin-date-total-item.highlight strong,
.fin-date-totals-ugstore .fin-date-total-item.highlight span {
  color: #C2185B;
}
.fin-guest-row-ugstore {
  background: #FCE4F1;
  border-radius: 8px;
}
.fin-guest-row-ugstore .fin-guest-name {
  color: #C2185B;
  font-weight: 700;
}
.cal-legend-item .lg-ugstore {
  background: #E91E8C;
  border-color: #C2185B;
}
.cal-day-body {
  margin-top: 10px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
}
.cal-day-theme {
  color: #8B5CF6;
  font-weight: 600;
  line-height: 1.15;
  word-break: break-all;
}
.cal-guests {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.cal-event {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 2px 5px;
  border-radius: 6px;
  background: #E8F8EF;
  word-break: break-all;
  line-height: 1.2;
}
.cal-event-name {
  font-weight: 600;
  font-size: 11px;
  color: #2E7D5B;
  white-space: normal;
  word-break: break-all;
}
.cal-event-role {
  font-size: 9px;
  font-weight: 400;
  color: #95B8A6;
  white-space: normal;
  word-break: break-all;
  line-height: 1.1;
  margin-top: 1px;
}
.cal-event.mahjong {
  background: #FFF3E0;
}
.cal-event.mahjong .cal-event-name {
  color: #BF360C;
}
.cal-event.mahjong .cal-event-role {
  color: #D89958;
}
.cal-event.normal {
  background: #EAFBF1;
  color: #3D8B5F;
}
.cal-day-clickable {
  cursor: pointer;
}
.cal-day-clickable:active {
  background: #FFE0EC;
}
.cal-day-status-mark {
  font-size: 7px;
  margin-left: 1px;
}

/* ===== 每周密度档：按本周单日最大人数缩字号，全部显示不隐藏 ===== */
.cal-w-low .cal-day-num { font-size: 10px; }
.cal-w-low .cal-day-theme { font-size: 8px; }
.cal-w-low .cal-event-name { font-size: 9px; }
.cal-w-low .cal-event-role { font-size: 7px; }

.cal-w-mid .cal-day-num { font-size: 10px; }
.cal-w-mid .cal-day-theme { font-size: 7.5px; }
.cal-w-mid .cal-event-name { font-size: 8px; }
.cal-w-mid .cal-event-role { font-size: 6.5px; }

.cal-w-high .cal-day-num { font-size: 9px; }
.cal-w-high .cal-day-theme { font-size: 7px; }
.cal-w-high .cal-event-name { font-size: 7px; }
.cal-w-high .cal-event-role { font-size: 6px; }
.cal-w-high .cal-day { min-height: 50px; }

.cal-w-xl .cal-day-num { font-size: 8px; }
.cal-w-xl .cal-day-theme { font-size: 6.5px; }
.cal-w-xl .cal-event-name { font-size: 6.5px; }
.cal-w-xl .cal-event-role { font-size: 5.5px; }
.cal-w-xl .cal-day { min-height: 56px; }

/* ===== Calendar Day Detail Modal ===== */
.cal-detail-theme-edit {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cal-detail-theme-edit .input { font-size: 14px; }
.cal-detail-guests {}
.cal-guest-lib { display: flex; }
.cal-guest-chip {
  font-size: 11px;
  padding: 4px 10px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  transition: all .15s;
}
.cal-guest-chip:active { transform: scale(0.95); }
.cal-guest-chip-count {
  margin-left: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: var(--primary);
  border-radius: 9px;
  padding: 1px 6px;
  line-height: 1.4;
}
.cal-guest-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-soft, #fff0f5);
}
.cal-guest-chip.selected {
  border-color: var(--primary);
  color: #fff;
  background: var(--primary);
  font-weight: 600;
}
.cal-guest-chip.selected .cal-guest-chip-count {
  background: rgba(255, 255, 255, 0.85);
  color: var(--primary);
}
.cal-detail-guest {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 0;
  border-bottom: 1px solid var(--border-light, #F5F0F5);
}
.cal-detail-guest:last-child { border-bottom: none; }
.cal-detail-name {
  font-size: 14px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-detail-guest.mahjong .cal-detail-name {
  color: #E65100;
}
.cal-detail-role {
  font-size: 11px;
  color: #8B5CF6;
  background: #F3EBFF;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-detail-norole {
  font-size: 11px;
  color: var(--text-lighter);
  flex-shrink: 0;
}
.cal-detail-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
  margin-left: 4px;
}
.cal-detail-actions .btn {
  font-size: 11px;
  padding: 4px 8px;
  border-radius: 6px;
}
.cal-detail-empty {
  padding: 12px 8px;
  text-align: center;
  color: var(--text-lighter);
  font-size: 13px;
}
.cal-detail-card .script-modal-header { padding: 12px 16px; }
.cal-detail-card .script-modal-body { padding: 12px 16px 16px; }

/* ===== Event List ===== */
.event-list {}
.event-group {
  margin-bottom: 10px;
}
.event-date-header {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 6px;
}
.event-past .event-date-header {
  color: var(--text-lighter);
}
.event-past-badge {
  font-size: 10px;
  background: #F0F0F0;
  color: var(--text-lighter);
  padding: 2px 8px;
  border-radius: 12px;
  font-weight: 600;
}
.event-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 8px;
  font-size: 14px;
  background: #FFF5F7;
  margin-bottom: 3px;
}
.event-past .event-item {
  opacity: 0.55;
}
.event-item.event-mahjong {
  background: #FFF3E0;
}
.event-item.event-mahjong .event-guest-name {
  color: #E65100;
}
.event-guest-name {
  font-weight: 700;
  color: var(--text);
  flex: 1;
}
.event-note {
  font-size: 12px;
  color: var(--text-lighter);
  background: #F5F0FF;
  padding: 2px 10px;
  border-radius: 12px;
}

/* Script Modal */
.script-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  backdrop-filter: blur(2px);
}
.script-modal-card {
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 420px;
  max-height: calc(100vh - 40px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.script-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  padding-top: max(16px, env(safe-area-inset-top));
  border-bottom: 1.5px solid var(--border);
  font-weight: 700;
  font-size: 14px;
}
.script-modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: var(--text-light);
  line-height: 1;
  padding: 0 4px;
  margin-top: env(safe-area-inset-top);
}
.script-modal-body {
  padding: 16px 20px 20px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  flex: 1 1 auto;
  min-height: 0;
}

/* ===== 嘉宾找齐状态 ===== */
.cal-day-short {
  background: #FFD6D6 !important;
  border: 1.5px solid #FF3333 !important;
}
/* 提前场次：蓝色提醒底色（声明在 short/mahjong 之后，同优先级 !important 时胜出，
   确保「提前+麻将」或「提前+未找齐」当天仍以蓝色提示时间变更为准） */
.cal-day-early {
  background: #E3F2FD !important;
  border: 1.5px solid #2196F3 !important;
}
.cal-day-early.cal-today {
  outline: 2px solid #2196F3 !important;
}
.cal-day-early-mark {
  font-size: 9px;
  margin-left: 1px;
  line-height: 1;
}
.cal-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-2);
}
.cal-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}
.cal-legend-item .lg {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 3px;
  border: 1px solid rgba(0,0,0,0.12);
}
.cal-legend-item .lg-mahjong { background: #FFF8E1; border-color: #FF9800; }
.cal-legend-item .lg-early { background: #E3F2FD; border-color: #2196F3; }
.cal-legend-item .lg-short { background: #FFD6D6; border-color: #FF3333; }
.cal-day-ready {
  /* 已找齐不再单独变蓝，保持和普通活动日/麻将场统一颜色，只保留 ✅ 小标记 */
}
.cal-day-status-mark {
  font-size: 7px;
  margin-left: 1px;
}

/* ===== 连场行程分摊 ===== */
.cal-detail-trip { margin: 6px 0; padding-top: 8px; border-top: 1px solid var(--border); }
.trip-section-title { font-size: 12px; color: var(--primary); font-weight: 600; margin-bottom: 6px; }
.trip-card { background: var(--bg-card); border: 1px solid var(--primary); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; }
.trip-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.trip-title { font-size: 13px; font-weight: 600; }
.trip-dates { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 6px; }
.trip-chip { font-size: 10px; padding: 2px 6px; border-radius: 6px; background: #fff; border: 1px solid var(--border); color: var(--text-lighter); }
.trip-chip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.trip-row { display: flex; align-items: center; gap: 8px; margin: 4px 0; }
.trip-row label { font-size: 11px; color: var(--text-secondary); white-space: nowrap; width: 120px; }
.trip-row .input { flex: 1; font-size: 12px; padding: 5px 7px; }
.trip-src { font-size: 10px; color: var(--primary); }
.trip-note { font-size: 10px; color: var(--text-lighter); margin-top: 4px; }
.trip-set { display: flex; align-items: center; justify-content: space-between; gap: 8px; background: var(--bg-card); border: 1px dashed var(--border); border-radius: 8px; padding: 6px 8px; margin-bottom: 6px; font-size: 11px; color: var(--text-secondary); }
.fin-trip-badge { font-size: 10px; color: var(--primary); background: #EAF1FF; border: 1px solid #C9DBFF; border-radius: 6px; padding: 3px 6px; margin-top: 4px; display: inline-block; cursor: pointer; }
.fin-trip-locked { opacity: .85; cursor: pointer; }
/* 酒店名单导入预览 */
.hotel-prev-list { display: flex; flex-direction: column; gap: 8px; max-height: 320px; overflow-y: auto; }
.hotel-prev-item { border: 1px solid var(--border); border-radius: 8px; padding: 8px; background: var(--bg-card); }
.hotel-prev-name { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.hotel-prev-name small { font-size: 10px; color: var(--text-lighter); font-weight: 400; margin-left: 4px; }
.hotel-prev-match { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--text-secondary); }
.hotel-prev-match select { flex: 1; font-size: 12px; padding: 5px; }
.hotel-prev-ok { color: #2E9E5B; font-size: 11px; white-space: nowrap; }
.hotel-prev-warn { color: #E08A00; font-size: 11px; white-space: nowrap; }
.hotel-prev-run { font-size: 10px; color: var(--text-lighter); margin-top: 4px; }
.hotel-prev-run.warn { color: #E08A00; }
.script-modal-card.modal-not-ready {
  background: #FFF5F5;
  border: 2px solid #FF3333;
  box-shadow: 0 8px 32px rgba(255,51,51,0.25);
}
.cal-detail-single-role {
  margin: 8px 0;
  padding: 8px 10px;
  background: #F5F0FA;
  border-radius: 8px;
}
.cal-detail-single-role .switch-label {
  font-size: 13px;
}
.cal-detail-single-role .switch-text {
  font-size: 13px;
}
.cal-detail-status {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0;
  padding: 10px 0;
  border-top: 1px solid var(--border, #eee);
  border-bottom: 1px solid var(--border, #eee);
}
.status-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text, #333);
  white-space: nowrap;
}
.status-btns {
  display: flex;
  gap: 8px;
}
.status-btn {
  padding: 5px 14px;
  border-radius: 16px;
  border: 1.5px solid #ddd;
  background: #fff;
  font-size: 12px;
  color: var(--text-light, #888);
  cursor: pointer;
  transition: all 0.2s;
}
.status-btn.active.short-on {
  background: #FF3333;
  border-color: #FF3333;
  color: #fff;
}
.status-btn.active.ready-on {
  background: #4CAF50;
  border-color: #4CAF50;
  color: #fff;
}

/* ===== 下拉刷新指示器 ===== */
.pull-refresh-indicator {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translate(-50%, 0);
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-light, #888);
  background: rgba(255,255,255,0.95);
  padding: 6px 16px;
  border-radius: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.1);
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
  pointer-events: none;
  z-index: 100;
}
.pull-refresh-icon {
  font-size: 14px;
  transition: transform 0.2s;
  display: inline-block;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
.script-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: #FFF5F7;
  padding: 18px;
  border-radius: 14px;
  white-space: pre-wrap;
  word-break: break-word;
}
.script-modal-footer {
  padding: 12px 20px 18px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* 活动流程海报编辑器 */
.flow-tab {
  color: var(--text-light);
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.flow-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
  background: rgba(233, 30, 99, 0.06);
  font-weight: 600;
}
.flow-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 13px;
  background: #fff;
  color: var(--text);
  outline: none;
}
.flow-input:focus {
  border-color: var(--primary);
}
.flow-input:disabled {
  background: #f0f0f0;
  color: #999;
}
#flow-poster-modal .poster-preview-img {
  max-width: 100%;
  max-height: 58vh;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

/* Divider in side work panel */
.work-side-divider {
  text-align: center;
  margin: 20px 0 10px;
  font-size: 13px;
  color: var(--primary);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}
.work-side-divider::before,
.work-side-divider::after {
  content: '';
  flex: 1;
  height: 1.5px;
  background: var(--border);
}

/* ===== Push ===== */
.push-header {
  margin-bottom: 12px;
}
.push-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--primary);
}

.push-card.push-done {
  border-left: 3px solid var(--c-down);
}

.push-video-info {
  padding: 4px 0;
}
.push-video-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}
.push-video-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-light);
  flex-wrap: wrap;
}
.push-tip {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px dashed var(--border);
}

/* ===== 百词斩式单词卡片 ===== */
.vocab-progress-bar {
  width: 100%;
  height: 5px;
  background: #FFE0E5;
  border-radius: 3px;
  margin-bottom: 6px;
  overflow: hidden;
}
.vocab-progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 3px;
  transition: width 0.3s ease;
}
.vocab-progress-text {
  text-align: center;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 14px;
}

.vocab-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 20px;
  padding: 28px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.3s ease;
  min-height: 150px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.vocab-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 20px rgba(255, 143, 163, 0.15);
}
.vocab-card:active {
  transform: scale(0.98);
}
.vocab-card.revealed {
  border-color: var(--c-down);
  background: #FAFFFC;
  cursor: default;
}

.vocab-card-front,
.vocab-card-back {
  transition: opacity 0.2s;
}

.vocab-word-en {
  font-size: 30px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.vocab-speak-btn {
  font-size: 22px;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
  display: inline-flex;
  align-items: center;
}
.vocab-speak-btn:hover {
  opacity: 1;
}
.vocab-hint {
  margin-top: 14px;
  font-size: 13px;
  color: var(--text-lighter);
}
.vocab-word-zh {
  font-size: 20px;
  color: var(--c-down);
  font-weight: 700;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--border);
}

/* 认识/不认识 按钮 */
.vocab-btns {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}
.vocab-btns button {
  flex: 1;
  padding: 12px;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 700;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}
.vocab-btn-know {
  background: #EAFBF1;
  color: #3D8B5F;
}
.vocab-btn-know:hover {
  background: #D4F0E0;
}
.vocab-btn-know:active {
  transform: scale(0.96);
}
.vocab-btn-unknown {
  background: #FFE0E5;
  color: #D94A5A;
}
.vocab-btn-unknown:hover {
  background: #FFD0D8;
}
.vocab-btn-unknown:active {
  transform: scale(0.96);
}

/* 结果页 */
.vocab-result {
  text-align: center;
  padding: 12px 0;
}
.vocab-result-icon {
  font-size: 52px;
  margin-bottom: 10px;
}
.vocab-result-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 16px;
  color: var(--text);
}
.vocab-result-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-bottom: 4px;
}
.vrs-item {
  text-align: center;
}
.vrs-num {
  font-size: 28px;
  font-weight: 700;
}
.vrs-label {
  font-size: 12px;
  color: var(--text-light);
}

/* ===== Archive ===== */
.archive-month {
  font-size: 14px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 2px solid var(--border);
}

.archive-entry {
  display: flex;
  justify-content: space-between;
  padding: 7px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
}

/* ===== 排单提醒确认按钮 ===== */
.guest-reminder-confirm {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  font-size: 11px;
  border-radius: 14px;
  background: #FFF0F7;
  color: var(--primary);
  border: 1.5px solid var(--primary);
  cursor: pointer;
  font-weight: 700;
  transition: all 0.2s;
}
.guest-reminder-confirm:hover {
  background: var(--primary);
  color: #fff;
}

/* ===== Responsive: Mobile ===== */
@media (max-width: 767px) {
  :root { --sidebar-w: 0px; }

  #sidebar {
    width: 100%;
    height: auto;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    top: auto;
    flex-direction: row;
    align-items: center;
    padding: 0;
    border-top: 1px solid rgba(255,255,255,0.15);
    background: var(--gradient-sidebar);
    z-index: 100;
  }

  .sidebar-header { display: none; }

  /* 移动端 Tab Bar — 全部显示，不滚动 */
  #tab-bar {
    flex-direction: row;
    width: 100%;
    padding: 5px 4px;
    gap: 1px;
    overflow: visible;
    touch-action: manipulation; /* 防止触发iOS回退手势 */
    -webkit-overflow-scrolling: auto;
  }

  .tab-item {
    flex-direction: column;
    gap: 1px;
    padding: 4px 1px;
    font-size: 9px;
    min-width: 0;
    flex: 1;
    justify-content: center;
    align-items: center;
    flex-shrink: 1;
    border-radius: 10px;
    touch-action: manipulation;
  }

  .tab-icon { font-size: 17px; }
  .tab-label { font-size: 9px; white-space: nowrap; }

  /* 移动端拖拽 ghost */
  .drag-ghost {
    flex-direction: column !important;
    font-size: 9px !important;
    border-radius: 10px !important;
    padding: 4px 1px !important;
  }
  .drag-ghost .tab-icon { font-size: 17px !important; }
  .drag-ghost .tab-label { font-size: 9px !important; }

  /* 内容区 — 固定高度，内部滚动，左右滑动由 JS 手势检测处理 */
  #content {
    margin-left: 0;
    padding: 8px 10px 12px;
    position: fixed;
    top: env(safe-area-inset-top);
    bottom: calc(52px + env(safe-area-inset-bottom));
    left: 0;
    right: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    overscroll-behavior: contain;
    user-select: none;
    -webkit-user-select: none;
  }

  /* 滑动切换过渡动画 */
  .tab-panel.swipe-in-left {
    animation: swipeFromLeft 0.22s ease-out;
  }
  .tab-panel.swipe-in-right {
    animation: swipeFromRight 0.22s ease-out;
  }

  @keyframes swipeFromLeft {
    from { opacity: 0; transform: translateX(-30px); }
    to { opacity: 1; transform: translateX(0); }
  }
  @keyframes swipeFromRight {
    from { opacity: 0; transform: translateX(30px); }
    to { opacity: 1; transform: translateX(0); }
  }

  .dash-grid { grid-template-columns: 1fr; }

  .dash-row { grid-template-columns: 1fr; }
  .dash-row-3 { grid-template-columns: 1fr 1fr 1fr; }

  .stat-row { flex-direction: row; }
  .stat-item { min-width: 80px; }

  .big-number { font-size: 38px; }

  .task-actions { opacity: 1; }

  #toast-container { bottom: 110px; }

  .guest-item { flex-direction: column; align-items: flex-start; }
  .guest-actions { width: 100%; justify-content: flex-end; }
  .guest-form { flex-direction: column; }
  .guest-form .input { width: 100%; }

  /* ===== 全页面紧凑化 — 确保一屏内显示 ===== */
  .card { padding: 10px; margin-bottom: 6px; }
  .card-title { font-size: 13px; margin-bottom: 6px; }
  .stat-item { padding: 8px 4px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 11px; }
  .big-number { font-size: 30px; }
  .checkin-btn { width: 88px; height: 88px; font-size: 13px; }
  .checkin-btn .checkin-icon { font-size: 26px; }
  .streak-display { padding: 6px 0; }
  .streak-number { font-size: 28px; }
  .form-row { margin-bottom: 4px; }
  .input { padding: 6px 10px; font-size: 13px; }
  .input-number { font-size: 16px; }
  .btn { padding: 6px 14px; font-size: 13px; }
  .section-divider { margin: 6px 0 4px; font-size: 13px; padding-bottom: 4px; }
  .empty-state { padding: 16px 8px; }
  .empty-state .empty-icon { font-size: 30px; margin-bottom: 6px; }
  .dash-quote-sticky { padding: 6px 10px; margin-bottom: 6px; }
  .dash-ring-section { margin-bottom: 6px; padding: 2px 0; }
  .dash-widgets { gap: 6px; }
  .dash-widget { padding: 8px; }
  .pet-anchor { height: 70px; margin-top: 4px; }
  .cal-day { min-height: 44px; }
  .cal-w-high .cal-day { min-height: 54px; }
  .cal-w-xl .cal-day { min-height: 62px; }
}

/* ===== Responsive: Tablet ===== */
@media (min-width: 768px) and (max-width: 1024px) {
  #content { max-width: 700px; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #FFD0D8; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #FFB5C5; }

/* ===== Finance 记账系统 ===== */

/* 垫资总览卡片 */
.fin-advance-card {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
}
.fin-advance-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.fin-advance-balance { flex: 1; }
.fin-advance-label { font-size: 13px; opacity: 0.85; }
.fin-advance-amount { font-size: 28px; font-weight: 800; margin-top: 2px; }
.fin-advance-amount.pos { color: #FFEB3B; }
.fin-advance-amount.zero { color: #fff; opacity: 0.6; }
.fin-advance-stats { text-align: right; }
.fin-stat {
  display: flex;
  flex-direction: column;
  font-size: 12px;
  opacity: 0.85;
  margin-bottom: 4px;
}
.fin-stat-label { font-size: 11px; }
.fin-stat-val.cost { color: #FFCDD2; }
.fin-stat-val.rev { color: #C8E6C9; }
.fin-advance-actions { display: flex; gap: 8px; margin-top: 14px; }
.fin-advance-actions .btn { flex: 1; }

/* 月度汇总 */
.fin-summary {
  display: flex;
  justify-content: space-around;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.fin-summary-item { text-align: center; }
.fin-summary-label {
  display: block;
  font-size: 11px;
  color: var(--text-lighter);
  margin-bottom: 2px;
}
.fin-summary-val { display: block; font-size: 16px; font-weight: 700; }
.fin-summary-val.cost { color: #e74c3c; }
.fin-summary-val.rev { color: #2980b9; }
.fin-summary-val.profit { color: #27ae60; }
.fin-summary-val.loss { color: #e74c3c; }

/* 活动账目卡片 */
.fin-date-card { padding: 14px; }
.fin-date-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.fin-date-label { font-size: 14px; font-weight: 700; }
.fin-date-theme { font-size: 11px; color: #8B5CF6; font-weight: 600; }

/* 嘉宾费用行 — 两行结构，防止溢出 */
.fin-guest-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
}
.fin-guest-row.settled {
  background: #E8F8F0;
  border-radius: 8px;
  padding: 8px 6px;
  margin: 0 -6px;
  border-bottom: none;
}
.fin-guest-row.settled .fin-guest-name {
  color: #27ae60;
}
.fin-settle-btn {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 10px;
  border: 1px solid var(--border, #eee);
  background: #fff;
  color: var(--text-lighter, #999);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
}
.fin-settle-btn.settled {
  background: #27ae60;
  color: #fff;
  border-color: #27ae60;
}
.fin-guest-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fin-guest-name {
  font-size: 13px;
  font-weight: 600;
}
.fin-guest-name small {
  display: inline;
  font-size: 10px;
  font-weight: 400;
  color: var(--text-lighter);
  margin-left: 4px;
}
.fin-guest-sub {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  flex-shrink: 0;
}
.fin-fee-inputs { display: flex; gap: 3px; width: 100%; }
.fin-fee-item { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.fin-fee-item label { font-size: 9px; color: var(--text-lighter); margin-bottom: 2px; text-align: center; }
.fin-fee-item .input {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 3px 2px;
  font-size: 11px;
  text-align: center;
}

/* 常用嘉宾快选 */
.freq-guests-section {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(0,0,0,0.06);
}
.freq-guests-title {
  font-size: 11px;
  color: var(--text-lighter);
  margin-bottom: 6px;
}
.freq-guests-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}
.freq-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 4px 10px;
  border-radius: 14px;
  background: rgba(0,0,0,0.04);
  font-size: 12px;
  color: var(--text-secondary);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  user-select: none;
}
.freq-tag small {
  font-size: 9px;
  color: var(--text-lighter);
  font-weight: 400;
}
.freq-tag.selected {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.freq-tag.selected small {
  color: rgba(255,255,255,0.8);
}
.freq-guests-batch {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 日期卡片底部 */
.fin-date-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 2px solid var(--border);
  flex-wrap: wrap;
}
.fin-cost-total { font-size: 12px; color: var(--text-light); }
.fin-cost-total strong { color: #e74c3c; font-size: 14px; }
.fin-revenue-row { display: flex; align-items: center; gap: 4px; }
.fin-revenue-row label { font-size: 12px; color: var(--text-light); white-space: nowrap; }
.fin-revenue-row .input { width: 90px; padding: 4px 8px; font-size: 13px; text-align: center; }
.fin-profit {
  font-size: 15px;
  font-weight: 800;
  padding: 4px 12px;
  border-radius: 8px;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 5px;
}
.fin-profit.profit { color: #27ae60; background: #E8F8F0; }
.fin-profit.loss { color: #e74c3c; background: #FDECEA; }
.fin-profit-label { font-size: 11px; font-weight: 600; opacity: 0.75; }
.fin-profit-formula { flex-basis: 100%; font-size: 9px; font-weight: 400; opacity: 0.7; text-align: right; margin-top: 1px; line-height: 1.1; }
.fin-profit-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}
.fin-profit-row.sm { gap: 6px; }
.fin-profit-row.sm .fin-profit { font-size: 13px; padding: 3px 8px; }

/* 单日费用分类合计 */
.fin-date-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: var(--bg-page);
  border-radius: 10px;
}
.fin-date-settle {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-lighter, #999);
  padding: 6px 8px;
  background: #FAF7FA;
  border-radius: 8px;
  margin-top: 6px;
}
.fin-date-settle.all {
  background: #E8F8F0;
  color: #27ae60;
  font-weight: 600;
}
.fin-date-settle-ico { font-size: 14px; }
.fin-date-total-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--text-light);
}
.fin-date-total-item strong {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}
.fin-date-total-item.highlight strong {
  color: var(--primary);
}

/* 每周汇总 */
.fin-week-card { padding: 12px; }
.fin-week-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
}
.fin-week-row:last-child { border-bottom: none; }
.fin-week-range {
  font-weight: 600;
  color: var(--text-main);
  min-width: 80px;
}
.fin-week-rev {
  color: #27ae60;
  font-weight: 700;
}
.fin-week-profit {
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
}
.fin-week-profit.profit { color: #27ae60; background: #E8F8F0; }
.fin-week-profit.loss { color: #e74c3c; background: #FDECEA; }
.fin-week-subrow {
  padding: 4px 0 10px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 12px;
}
.fin-week-subrow:last-child { border-bottom: none; padding-bottom: 0; }
.fin-week-tf-label {
  color: var(--text-light);
  font-weight: 600;
}
.fin-week-tf-sum {
  color: var(--primary);
  font-weight: 800;
  font-size: 13px;
}
/* 每周合并汇总（一日店长 + 地下偶像）网格 */
.fin-week-block { padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,0.05); }
.fin-week-block:last-child { border-bottom: none; padding-bottom: 0; }
.fin-week-head { font-weight: 700; color: var(--text-main); font-size: 13px; margin-bottom: 8px; }
.fin-week-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; }
.fwg-item { display: flex; flex-direction: column; background: var(--bg-card); border-radius: 8px; padding: 6px 8px; }
.fwg-label { font-size: 11px; color: var(--text-light); margin-bottom: 2px; }
.fwg-val { font-size: 14px; font-weight: 800; }
.fwg-val.rev { color: #27ae60; }
.fwg-val.profit { color: #27ae60; }
.fwg-val.loss { color: #e74c3c; }
.fwg-tf .fwg-val { color: var(--primary); }
.fwg-total { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; background: rgba(255,122,158,0.12); }
.fwg-total .fwg-label { margin-bottom: 0; font-size: 13px; font-weight: 700; color: var(--text-main); }
.fwg-total .fwg-val { font-size: 16px; }
.fin-week-cur {
  background: rgba(255, 122, 158, 0.10);
  border-radius: 8px;
  font-weight: 600;
}
.fin-week-total {
  border-top: 1px solid var(--border);
  margin-top: 8px;
  padding-top: 8px;
  font-weight: 700;
}

/* 薪酬分红 */
.fin-payroll-profit {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}
.fin-payroll-profit label {
  font-size: 12px;
  color: var(--text-light);
  font-weight: 600;
}
.fin-payroll-profit input {
  font-size: 16px;
  font-weight: 700;
  color: var(--primary);
}
.fin-payroll-card { padding: 12px; margin-bottom: 10px; }
.fin-payroll-head {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}
.fin-payroll-name {
  font-size: 16px;
  font-weight: 700;
  flex: 1;
}
.fin-payroll-equity {
  display: flex;
  align-items: center;
  gap: 4px;
}
.fin-payroll-equity label {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
}
.fin-payroll-equity input {
  width: 70px;
  text-align: right;
  font-weight: 700;
}
.fin-payroll-section-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  margin: 12px 0 6px;
  padding-left: 7px;
  border-left: 3px solid var(--primary);
}
.fin-payroll-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}
.fin-payroll-grid.sessions {
  grid-template-columns: repeat(3, 1fr);
}
.fin-payroll-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.fin-payroll-cell label {
  font-size: 11px;
  color: var(--text-light);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fin-payroll-cell input {
  font-size: 14px;
  padding: 8px;
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
}
.fin-payroll-cell.disabled {
  opacity: 0.45;
  pointer-events: none;
}
.fin-payroll-result {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(0,0,0,0.05);
}
.fin-payroll-res {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--bg-card);
}
.fin-payroll-res span { color: var(--text-light); }
.fin-payroll-res strong { font-weight: 700; color: var(--text-main); }
.fin-payroll-res.total {
  grid-column: 1 / -1;
  background: rgba(255, 122, 158, 0.12);
  font-size: 14px;
}
.fin-payroll-res.total strong { color: var(--primary); font-size: 16px; }
.fin-payroll-tip {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-lighter);
  text-align: right;
}
.fin-payroll-note-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed rgba(0,0,0,0.08);
}
.fin-payroll-note-wrap label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
  flex: 0 0 auto;
}
.fin-payroll-note-wrap .fin-payroll-note {
  flex: 1 1 auto;
  min-width: 0;
  font-size: 13px;
}
.fin-payroll-total {
  background: var(--card-bg);
  margin-top: 4px;
}
.fin-payroll-total-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 15px;
  font-weight: 700;
}
.fin-payroll-total-row strong { color: var(--primary); font-size: 18px; }

/* 薪酬总表 */
.fin-payroll-summary { padding: 12px; margin-top: 4px; }
.fin-payroll-summary-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 8px;
}
.fin-payroll-table-wrap { width: 100%; }
.fin-payroll-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 10px;
}
.fin-payroll-table th,
.fin-payroll-table td {
  padding: 5px 1px;
  text-align: right;
  white-space: nowrap;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.fin-payroll-table th {
  color: var(--text-light);
  font-weight: 600;
  font-size: 9px;
}
.fin-payroll-table td.fp-name,
.fin-payroll-table th:first-child {
  text-align: left;
  font-weight: 700;
  color: var(--text-main);
}
.fin-payroll-table td.fp-total {
  color: var(--primary);
  font-weight: 700;
}
.fin-payroll-table tfoot td {
  border-top: 2px solid rgba(0,0,0,0.12);
  border-bottom: none;
  font-weight: 700;
  color: var(--text-main);
}
.fin-payroll-table tr.fp-sub td {
  font-weight: 700;
  color: var(--text-main);
  background: rgba(255,122,158,0.07);
  border-top: 1px solid rgba(0,0,0,0.12);
}
.fin-payroll-table tr.fp-sub td.fp-name {
  font-size: 10px;
}

/* 垫资流水列表 */
.fin-advance-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(0,0,0,0.04);
  font-size: 13px;
}
.fin-adv-type { font-weight: 600; min-width: 60px; }
.fin-adv-date { color: var(--text-lighter); font-size: 12px; min-width: 40px; }
.fin-adv-amount { font-weight: 700; min-width: 80px; text-align: right; }
.fin-adv-amount.cost { color: #e74c3c; }
.fin-adv-amount.rev { color: #27ae60; }
.fin-adv-note {
  flex: 1;
  font-size: 12px;
  color: var(--text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fin-adv-note.empty { color: var(--text-lighter); opacity: 0.5; }
.fin-adv-del { flex-shrink: 0; }

/* 弹窗表单 */
.fin-modal-row { margin-bottom: 12px; }
.fin-modal-row label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
  font-weight: 600;
}

/* 移动端适配 */
@media (max-width: 480px) {
  .fin-advance-row { flex-direction: column; align-items: flex-start; }
  .fin-advance-stats { text-align: left; display: flex; gap: 16px; }
  .fin-stat { flex-direction: row; align-items: center; gap: 4px; }
}

/* ===== 经期记录 ===== */
.period-card { border-left: 3px solid #E879B0; }
.period-mark-btn {
  width: 100%;
  padding: 10px;
  border: 1.5px dashed #E879B0;
  border-radius: 10px;
  background: #FDF0F7;
  color: #C2185B;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
  transition: all 0.2s;
}
.period-mark-btn:active { transform: scale(0.97); }
.period-mark-btn.done {
  border-style: solid;
  background: #F0F0F0;
  color: var(--text-light);
  cursor: default;
}
.period-stats {
  display: flex;
  justify-content: space-around;
  margin: 8px 0;
  padding: 8px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.period-stat { text-align: center; }
.period-stat-val {
  font-size: 16px;
  font-weight: 700;
  color: #C2185B;
}
.period-stat-val.soon { color: #e74c3c; }
.period-stat-label {
  font-size: 10px;
  color: var(--text-lighter);
  margin-top: 2px;
}
.period-list {
  margin-top: 6px;
}
.period-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px solid rgba(0,0,0,0.03);
}
.period-date {
  flex: 1;
  color: var(--text);
  font-weight: 600;
}
.period-cycle {
  font-size: 11px;
  color: var(--text-lighter);
  background: #FDF0F7;
  padding: 1px 6px;
  border-radius: 8px;
}
.period-del { flex-shrink: 0; }

/* 账本子标签 */
.fin-subtabs {
  display: flex;
  gap: 0;
  margin-bottom: 8px;
  background: var(--card);
  border-radius: var(--radius-sm);
  padding: 3px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.fin-subtab {
  flex: 1;
  padding: 7px 0;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  color: var(--text-light);
  transition: all 0.2s;
  text-align: center;
}
.fin-subtab.active {
  background: var(--primary);
  color: #fff;
}

/* ===== 数据同步 ===== */
.sync-key-row {
  display: flex;
  gap: 8px;
  margin-bottom: 10px;
}
.sync-btn-row {
  display: flex;
  gap: 8px;
}
.sync-status {
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 8px;
  line-height: 1.6;
}

/* ========== 嘉宾资料库 ========== */
.profile-summary-card {
  background: linear-gradient(135deg, var(--primary-bg, #FFE0EC), var(--bg-card));
}
.profile-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: space-between;
}
.profile-summary-item {
  flex: 1;
  min-width: 80px;
  text-align: center;
}
.profile-summary-label {
  display: block;
  font-size: 10px;
  color: var(--text-lighter);
  margin-bottom: 2px;
}
.profile-summary-val {
  display: block;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.profile-summary-val.profit { color: var(--c-up, #27ae60); }

.profile-section-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  margin: 12px 0 6px;
  padding-left: 2px;
}

.profile-card {
  background: var(--bg-card);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 8px;
  border: 1px solid var(--border, #eee);
}
.profile-card.annual {
  border-color: var(--primary, #FF8FA3);
  border-width: 1.5px;
}
.profile-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  cursor: pointer;
}
.profile-card-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 15px;
  font-weight: 700;
}
.profile-card-quote {
  font-size: 13px;
  color: var(--text-light);
  font-weight: 600;
}
.profile-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.annual-badge { background: var(--primary, #FF8FA3); color: white; }
.normal-badge { background: var(--bg-hover, #f0f0f0); color: var(--text-light); }
.mahjong-badge { background: var(--c-warn-bg, #FFF3E0); color: #E65100; }

.profile-card-stats {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}
.profile-stat {
  flex: 1;
  text-align: center;
}
.profile-stat-label {
  display: block;
  font-size: 9px;
  color: var(--text-lighter);
}
.profile-stat-val {
  display: block;
  font-size: 13px;
  font-weight: 700;
}
.profile-stat-val.warn { color: var(--c-down, #e74c3c); }
.profile-stat-val.profit { color: var(--c-up, #27ae60); }

.profile-progress-bar {
  height: 4px;
  background: var(--bg-hover, #f0f0f0);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 8px;
}
.profile-progress-fill {
  height: 100%;
  background: var(--primary, #FF8FA3);
  border-radius: 2px;
  transition: width 0.3s;
}

.profile-card-roles {
  font-size: 12px;
  margin-bottom: 6px;
  line-height: 1.5;
}
.profile-roles-label {
  color: var(--text-lighter);
}
.profile-roles-text {
  color: var(--text-light);
}

.profile-card-actions {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

/* 嘉宾资料表单 */
.profile-form-row {
  margin-bottom: 12px;
}
.profile-form-row label {
  display: block;
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 4px;
}
.profile-form-row > label.switch-label {
  display: flex;
  align-items: center;
  margin-bottom: 0;
}
.profile-form-inline {
  display: flex;
  gap: 8px;
}
.profile-form-inline label {
  margin-bottom: 4px;
}

/* 排期推荐 */
.sched-section {
  margin-bottom: 16px;
}
.sched-section-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border, #eee);
}
.sched-empty {
  font-size: 12px;
  color: var(--text-lighter);
  padding: 8px 0;
}
.sched-birthday-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--border, #eee);
}
.sched-birthday-info {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sched-char-name {
  font-size: 14px;
  font-weight: 700;
}
.sched-char-game {
  font-size: 11px;
  color: var(--text-lighter);
  background: var(--bg-hover, #f0f0f0);
  padding: 1px 6px;
  border-radius: 4px;
}
.sched-char-date {
  font-size: 11px;
  color: var(--primary, #FF8FA3);
  font-weight: 600;
}
.sched-matched {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sched-guest-tag {
  font-size: 11px;
  background: var(--primary-bg, #FFE0EC);
  color: var(--primary, #FF8FA3);
  padding: 2px 8px;
  border-radius: 10px;
}
.sched-no-match {
  font-size: 11px;
  color: var(--text-lighter);
}

.sched-plan-item {
  background: var(--bg-card);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 8px;
  border: 1px solid var(--border, #eee);
}
.sched-plan-item.mahjong {
  background: #FFF8E1;
  border-color: #FFE082;
}
.sched-plan-header {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}
.sched-plan-date {
  font-size: 14px;
  font-weight: 700;
}
.sched-type-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 600;
}
.sched-type-badge.normal { background: var(--primary-bg, #FFE0EC); color: var(--primary, #FF8FA3); }
.sched-type-badge.mahjong { background: #FFE0B2; color: #E65100; }
.sched-birthday-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: #E3F2FD;
  color: #1565C0;
}
.sched-past-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  background: var(--bg-hover, #f0f0f0);
  color: var(--text-lighter);
}
.sched-plan-theme {
  font-size: 12px;
  color: var(--primary, #FF8FA3);
  font-weight: 600;
  margin-bottom: 4px;
}
.sched-plan-guests {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 6px;
}
.sched-plan-note {
  font-size: 11px;
  color: var(--c-down, #e74c3c);
  margin-bottom: 4px;
}

.sched-usage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  border-bottom: 1px solid var(--border, #eee);
}
.sched-usage-name {
  font-size: 13px;
}
.sched-usage-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-light);
}
.sched-usage-count.warn {
  color: var(--c-down, #e74c3c);
}

/* 酒店只读输入框 */
.fin-fee-hotel {
  cursor: pointer;
}
.fin-fee-hotel:focus {
  outline: none;
}

/* ===== 海报编辑面板 - 横向分页轮播 ===== */
.poster-edit-carousel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}
.poster-edit-title {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  flex-shrink: 0;
  text-align: center;
}
.poster-edit-track {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  transition: transform 0.25s ease;
  touch-action: pan-y;
}
.poster-edit-page {
  flex: 0 0 100%;
  padding: 0 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: hidden;
}
.poster-edit-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}
.poster-edit-guest-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}
.poster-edit-guest-role {
  font-size: 11px;
  color: var(--text-light);
}
.poster-edit-slider-row {
  flex-shrink: 0;
}
.poster-edit-slider-label {
  font-size: 11px;
  color: var(--text-light);
  display: flex;
  justify-content: space-between;
  margin-bottom: 3px;
}
.poster-edit-page input[type="range"] {
  width: 100%;
  -webkit-appearance: auto;
  appearance: auto;
  height: 22px;
}
.poster-edit-hint {
  font-size: 11px;
  color: var(--text-lighter);
  text-align: center;
  margin-top: auto;
  padding-top: 4px;
  flex-shrink: 0;
}
.poster-edit-dots {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  flex-shrink: 0;
}
.poster-edit-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--text-lighter);
  border: none;
  padding: 0;
  transition: all 0.2s;
  opacity: 0.5;
}
.poster-edit-dot.active {
  width: 14px;
  border-radius: 3px;
  background: var(--primary);
  opacity: 1;
}
.poster-edit-footer {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  flex-shrink: 0;
}

/* ===== 总览页功能弹窗（体重/健身/舞蹈/英语） ===== */
.dash-feature-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dash-feature-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.dash-feature-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 1;
  /* iOS 安全区：避开顶部状态栏 + 灵动岛，否则返回键会被盖住无法点击 */
  padding-top: calc(env(safe-area-inset-top) + 6px);
}
.dash-feature-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card-bg);
}
.dash-feature-modal-back {
  background: var(--primary);
  border: none;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  padding: 10px 20px;
  line-height: 1;
  box-shadow: 0 2px 10px rgba(255, 122, 158, 0.4);
  -webkit-tap-highlight-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.dash-feature-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.dash-feature-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}
.dash-feature-modal-body .tab-panel {
  display: block !important;
  animation: none;
}

@media (min-width: 769px) {
  .dash-feature-modal-content {
    width: 520px;
    height: 85%;
    max-height: 700px;
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  }
}

/* ===== 地下偶像场地租赁 ===== */
.ug-tip {
  font-size: 11px;
  color: var(--text-lighter);
  line-height: 1.5;
  padding: 8px 0 2px;
}
.ug-day-fee {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  line-height: 1.3;
}
.ug-day-sub {
  font-size: 11px;
  color: var(--text-lighter);
  line-height: 1.3;
}
.ug-sum-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-top: 8px;
}
.ug-sum-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  background: var(--bg-page);
  border-radius: 10px;
}
.ug-sum-item span {
  font-size: 12px;
  color: var(--text-light);
}
.ug-sum-item strong {
  font-size: 18px;
  color: var(--c-down);
}
.ug-sum-item strong.ug-cost {
  color: var(--text-light);
  font-size: 16px;
}
.ug-sum-item.highlight {
  background: var(--primary-soft, #F3EBFF);
  border: 1px solid var(--primary);
}
.ug-sum-item.highlight strong {
  color: var(--primary);
}

/* 单日明细弹窗 */
.ug-modal {
  position: fixed;
  inset: 0;
  z-index: 1100;
  display: flex;
  flex-direction: column;
}
.ug-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}
.ug-modal-card {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  /* iOS 安全区：避开顶部状态栏 + 灵动岛 */
  padding-top: calc(env(safe-area-inset-top) + 6px);
}
.ug-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--card-bg);
}
.ug-modal-back {
  background: var(--primary);
  border: none;
  border-radius: 20px;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  padding: 10px 20px;
  -webkit-tap-highlight-color: transparent;
  box-shadow: 0 2px 10px rgba(255, 122, 158, 0.4);
  display: inline-flex;
  align-items: center;
  gap: 2px;
}
.ug-modal-title {
  font-size: 15px;
  font-weight: 700;
}
.ug-modal-close {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--text-light);
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}
.ug-modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px;
}
.ug-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}
.ug-field label {
  font-size: 13px;
  color: var(--text-light);
}
.ug-field-row {
  display: flex;
  gap: 10px;
}
.ug-field-row .ug-field {
  flex: 1;
}
.ug-fee-preview {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 6px;
}
.ug-fee-preview strong {
  color: var(--c-down);
  font-size: 15px;
}
.ug-fee-preview small {
  display: block;
  font-size: 11px;
  color: var(--text-lighter);
  margin-top: 2px;
}
.ug-total-bar {
  text-align: center;
  font-size: 15px;
  color: var(--text-light);
  padding: 12px;
  background: var(--primary-soft, #F3EBFF);
  border-radius: 10px;
  margin-top: 4px;
}
.ug-total-bar strong {
  color: var(--primary);
  font-size: 18px;
}
.ug-modal-actions {
  display: flex;
  gap: 10px;
  margin: 12px 0 4px;
}
.ug-modal-actions .btn {
  flex: 1;
}

/* ===== 真·净利卡片 ===== */
.fin-trueprofit-card {
  border: 1.5px solid var(--accent, #ff6b9d);
  background: linear-gradient(180deg, rgba(255,107,157,0.06), rgba(255,255,255,0));
}
.fin-tp-title {
  font-size: 15px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text, #222);
}
.fin-tp-title small { font-weight: 400; color: var(--text-lighter, #999); font-size: 11px; }
.fin-tp-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  padding: 5px 0;
  color: var(--text, #333);
}
.fin-tp-row.minus { color: var(--text-lighter, #888); }
.fin-tp-row span:last-child { font-variant-numeric: tabular-nums; font-weight: 600; }
.fin-tp-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #eee);
  font-size: 17px;
  font-weight: 800;
}
.fin-tp-total.profit { color: #2bb673; }
.fin-tp-total.loss { color: #e74c3c; }
.fin-tp-sub {
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-lighter, #999);
  line-height: 1.5;
}

/* ===== 每场额外成本输入行 ===== */
.fin-cost-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border, #eee);
}
.fin-cost-item2 {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fin-cost-item2 label {
  font-size: 11px;
  color: var(--text-lighter, #999);
}
.fin-cost-item2 input { width: 100%; min-width: 0; }

/* 每场成本明细条 */
.fin-cost-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 8px;
  font-size: 12px;
  color: var(--text-lighter, #888);
}
.fin-cost-detail .fin-cost-detail-total {
  color: var(--text, #333);
  font-weight: 600;
}
.fin-date-subnet {
  margin-top: 6px;
  font-size: 11px;
  color: var(--text-lighter, #999);
  text-align: right;
}

/* 每周卡片头部说明 */
.fwg-rent {
  display: block;
  font-size: 10px;
  color: var(--text-lighter, #999);
  margin-top: 2px;
  font-weight: normal;
}

/* ===== 账目月汇总 6 行卡（总流水/嘉宾/NPC/物料/人力/净利）===== */
.fin-breakdown-card {
  padding: 14px 16px 12px;
}
.fin-bd-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 9px 0;
  border-bottom: 1px solid var(--border-soft, #f3f3f3);
}
.fin-bd-label {
  font-size: 13px;
  color: var(--text-lighter, #888);
  flex-shrink: 0;
}
.fin-bd-val {
  font-size: 16px;
  font-weight: 600;
  color: var(--text, #222);
  text-align: right;
  line-height: 1.4;
}
.fin-bd-val small {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-lighter, #999);
  margin-top: 1px;
}
.fin-bd-val.rev { color: #1aa179; }
.fin-bd-val.cost { color: #d9534f; }
.fin-bd-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
  padding: 14px 0 4px;
  border-top: 2px solid var(--border, #eee);
}
.fin-bd-total .fin-bd-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text, #333);
}
.fin-bd-total .fin-bd-val {
  font-size: 22px;
  font-weight: 800;
}
.fin-bd-total.profit .fin-bd-val { color: #1aa179; }
.fin-bd-total.loss .fin-bd-val { color: #d9534f; }
.fin-bd-sub {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px dashed var(--border, #eee);
  font-size: 11px;
  color: var(--text-lighter, #999);
  line-height: 1.7;
  text-align: center;
}
.fin-bd-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

/* 每场卡：地下偶像租场行 + 空嘉宾提示 */
.fin-ug-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, rgba(108, 92, 231, 0.08), rgba(108, 92, 231, 0.02));
  border: 1px dashed rgba(108, 92, 231, 0.35);
  border-radius: 8px;
  padding: 7px 10px;
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  color: #5b4bc4;
}
.fin-ug-row small {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-lighter, #999);
}
.fin-guest-empty {
  padding: 16px 0;
  text-align: center;
  font-size: 12px;
  color: var(--text-lighter, #999);
}
.fin-ug-only-note {
  margin-top: 8px;
  padding: 8px 10px;
  background: rgba(108, 92, 231, 0.05);
  border-radius: 8px;
  font-size: 11px;
  color: var(--text-lighter, #888);
  text-align: center;
}

/* ===== 真·净利参数卡（设置页） ===== */
.tp-input { width: 90px; text-align: right; }
.tp-labor-block { margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--border, #eee); }
.tp-labor-title { font-size: 12px; font-weight: 600; color: var(--text, #333); margin-bottom: 6px; }
.tp-labor-edit-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 5px 0; border-bottom: 1px solid var(--border-soft, #f2f2f2);
}
.tp-labor-name { font-size: 13px; font-weight: 600; width: 42px; flex-shrink: 0; }
.tp-labor-edit-row label {
  font-size: 11px; color: var(--text-lighter, #999);
  display: inline-flex; align-items: center; gap: 3px;
}
.tp-labor-input { width: auto; }
.tp-staff-link { margin-top: 4px; }
.tp-staff-link .setting-desc { margin-top: 4px; }


/* ===== 账本：周手风琴嵌套（月份总卡 + 周折叠 + 每天明细） ===== */
.fin-week-acc {
  margin-top: 10px;
  border-radius: 14px;
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.fin-week-acc-head {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  padding: 12px 14px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  transition: background 0.15s;
}
.fin-week-acc-head:active { background: rgba(0,0,0,0.04); }
.fin-week-acc-head-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fin-acc-caret {
  font-size: 12px;
  color: var(--text-lighter);
  width: 14px;
  text-align: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.fin-week-acc-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
  flex: 1;
}
.fin-week-acc-metrics {
  display: flex;
  justify-content: space-between;
  gap: 6px;
}
.fwm-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  flex: 1;
  min-width: 0;
}
.fwm-label {
  font-size: 11px;
  color: var(--text-lighter);
  margin-bottom: 2px;
}
.fwm-val {
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
}
.fwm-val.profit { color: #27ae60; }
.fwm-val.loss { color: #e74c3c; }
.fwm-formula {
  font-size: 9px;
  color: var(--text-lighter);
  margin-top: 1px;
  line-height: 1.12;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.fin-week-acc-body {
  padding: 0 10px 10px;
}
.fin-week-grid-card {
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-page);
}
.fin-week-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
.fin-week-grid .fwg-item { background: var(--bg-card); }

/* ===== 账本吸顶实时汇总条（当月/本周/当天，改数即时刷新+闪烁） ===== */
.fin-live-tracker {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  gap: 4px;
  padding: 8px 5px;
  margin-bottom: 10px;
  background: var(--bg-card);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.14);
}
.flt-seg {
  flex: 1;
  min-width: 0;
  background: var(--bg-page);
  border-radius: 10px;
  padding: 6px 6px;
  text-align: center;
}
.flt-seg-label {
  font-size: 9px;
  color: var(--text-lighter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}
.flt-seg-vals {
  display: flex;
  flex-direction: column;
  gap: 1px;
  line-height: 1.18;
}
.flt-net {
  font-size: 16px;
  font-weight: 800;
}
.flt-net.profit { color: #27ae60; }
.flt-net.loss { color: #e74c3c; }
.flt-rev {
  font-size: 10px;
  color: var(--text-lighter);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@keyframes finFlash {
  0%   { background: rgba(255,193,7,0.7); box-shadow: 0 0 0 2px rgba(255,193,7,0.55); }
  100% { background: transparent; box-shadow: none; }
}
.fin-flash {
  animation: finFlash 0.9s ease-out;
  border-radius: 6px;
}

/* 吸顶条增强：实底边框 + 净利/流水小标签 */
.fin-live-tracker { border: 1px solid var(--border); }
.flt-k { font-style: normal; font-size: 10px; font-weight: 600; color: var(--text-light); margin-right: 2px; }

/* 吸顶条「↓ 定位」按钮 */
.flt-locate {
  flex: 0 0 auto;
  align-self: stretch;
  width: 36px;
  margin-left: 2px;
  border: none;
  border-radius: 10px;
  background: var(--primary);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  font-weight: 700;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s, opacity 0.12s;
}
.flt-locate:active { opacity: 0.82; transform: scale(0.94); }

/* 吸顶条「纯利」小行 + 跳到日期选择器（替换原 ↓ 按钮） */
.flt-sub {
  font-size: 9px;
  font-weight: 600;
  line-height: 1.18;
  white-space: nowrap;
}
.flt-sub.profit { color: #27ae60; }
.flt-sub.loss { color: #e74c3c; }
.flt-oper {
  font-size: 10px;
  font-weight: 600;
  line-height: 1.18;
  white-space: nowrap;
}
.flt-oper.profit { color: #27ae60; }
.flt-oper.loss { color: #e74c3c; }
.flt-jump {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  margin-left: 2px;
  min-width: 48px;
}
.flt-jump-label {
  font-size: 9px;
  color: var(--text-lighter);
  text-align: center;
  margin-bottom: 2px;
}
.flt-jump-select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 4px;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.flt-jump-select:active { opacity: 0.85; }
