/* 拼豆计时管理系统 - 样式 */
:root {
  --yellow: #f8c21a;
  --yellow-dark: #e6a800;
  --blue: #4a90e2;
  --teal: #1abc9c;
  --green: #2ecc71;
  --red: #e74c3c;
  --purple: #9b59b6;
  --pink: #e91e63;
  --dark: #2c2c2c;
  --gray-bg: #ececec;
  --card-bg: #ffffff;
  --border: #1a1a1a;
  --text: #1a1a1a;
  --text-muted: #666;
  --shadow: 4px 4px 0 #1a1a1a;
  --radius: 14px;
  --nav-height: 52px;
  --sidebar-width: 272px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

#app {
  min-height: 100vh;
  position: relative;
  padding-bottom: var(--nav-height);
}

/* 背景装饰 */
.bg-decor {
  position: fixed;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 0;
}
.circle {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
}
.circle-yellow { width: 420px; height: 420px; background: #f8d84a; top: 8%; left: 2%; opacity: 0.45; }
.circle-teal { width: 360px; height: 360px; background: #7dd4c4; top: 42%; right: calc(var(--sidebar-width) + 40px); opacity: 0.35; }
.circle-blue { width: 320px; height: 320px; background: #8fa4c4; bottom: 12%; left: 28%; opacity: 0.3; }

#main-content {
  position: relative;
  z-index: 1;
  padding: 20px 24px 24px;
  min-height: calc(100vh - var(--nav-height));
}
#main-content.page-dashboard {
  max-width: none;
  padding-right: calc(var(--sidebar-width) + 48px);
}
#main-content.page-inner {
  max-width: 960px;
  margin: 0 auto;
}
#main-content.page-member,
#main-content.page-settings {
  max-width: none;
  padding: 0;
}

/* 底部导航 */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: #fff;
  border-top: 2px solid var(--border);
  display: flex;
  z-index: 100;
}
.bottom-nav button {
  flex: 1;
  border: none;
  background: none;
  font-size: 14px;
  color: var(--text);
  cursor: pointer;
  padding: 10px 4px 8px;
  position: relative;
  transition: color 0.2s;
}
.bottom-nav button.active {
  color: var(--yellow-dark);
  font-weight: 700;
}
.bottom-nav button.active::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 18px;
  background: var(--yellow);
  border-radius: 0 0 18px 18px;
  border: 2px solid var(--border);
  border-top: none;
}

/* 通用卡片 */
.card {
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* 按钮 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.1s, opacity 0.2s;
  box-shadow: 2px 2px 0 var(--border);
}
.btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }
.btn-yellow { background: var(--yellow); color: var(--text); }
.btn-blue { background: var(--blue); color: #fff; }
.btn-teal { background: var(--teal); color: #fff; }
.btn-green { background: var(--green); color: #fff; }
.btn-red { background: var(--red); color: #fff; }
.btn-purple { background: var(--purple); color: #fff; }
.btn-gray { background: #e0e0e0; color: var(--text); }
.btn-outline { background: #fff; color: var(--text); }
.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-block { width: 100%; }
.btn-link { background: none; border: none; box-shadow: none; color: var(--blue); font-weight: 500; }

/* ========== 桌台看板 ========== */
.dashboard-layout {
  position: relative;
  min-height: calc(100vh - var(--nav-height) - 44px);
}
.dashboard-main { width: 100%; }
.dashboard-sidebar {
  position: fixed;
  top: 20px;
  right: 24px;
  width: var(--sidebar-width);
  z-index: 2;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-btn {
  padding: 7px 16px;
  border: 2px solid var(--border);
  border-radius: 24px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: 2px 2px 0 var(--border);
}
.filter-btn:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--border); }
.filter-btn:active { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--border); }
.filter-btn.active {
  background: var(--border);
  color: #fff;
  box-shadow: 2px 2px 0 var(--border);
}
.filter-btn .count { margin-left: 2px; opacity: 0.85; font-weight: 600; }

.table-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-content: flex-start;
}

.table-card {
  width: 260px;
  background: var(--card-bg);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px 18px 16px;
  min-height: 190px;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
  position: relative;
}
.table-card:hover {
  transform: translate(-2px, -2px);
  box-shadow: 6px 6px 0 var(--border);
}
.table-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}
.table-card-num {
  font-size: 28px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 8px;
  line-height: 1;
}
.table-card-capacity {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 3px;
  padding-top: 4px;
}
.table-card-body {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 8px 0 28px;
}
.table-card-footer {
  position: absolute;
  right: 18px;
  bottom: 16px;
}
.table-card .price { color: var(--yellow-dark); font-size: 20px; font-weight: 800; }
.table-card .timer { color: var(--yellow-dark); font-size: 32px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.5px; }
.table-card .status-text { font-size: 26px; font-weight: 800; letter-spacing: 1px; }
.table-card .status-text.paused { color: var(--blue); }
.table-card .session-pkg {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 4px;
}
.table-card .action-btn {
  width: 100%;
  max-width: 200px;
  padding: 14px 16px;
  font-size: 16px;
  font-weight: 700;
}

.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  vertical-align: middle;
  margin-top: 2px;
}
.status-badge.idle { background: #d4f5f0; color: #0d9488; }
.status-badge.occupied { background: #fff3cd; color: #b8860b; }
.status-badge.cleaning { background: #fff3cd; color: #b8860b; }
.status-badge.paused { background: #dbeafe; color: var(--blue); }
.status-badge.overtime { background: #fee2e2; color: var(--red); }
.status-badge.help { background: #fee2e2; color: var(--red); }
.status-badge.relocate { background: #ede9fe; color: var(--purple); }

.grid-empty {
  width: 100%;
  padding: 60px 20px;
  text-align: center;
  color: var(--text-muted);
  font-size: 15px;
}

/* 侧边栏 */
.sidebar-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.shop-header {
  background: var(--yellow);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 2px solid var(--border);
}
.shop-logo {
  width: 38px;
  height: 38px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 17px;
  flex-shrink: 0;
}
.shop-name { flex: 1; font-weight: 700; font-size: 14px; line-height: 1.3; }
.shop-logout {
  cursor: pointer;
  font-size: 20px;
  opacity: 0.6;
  line-height: 1;
  padding: 4px;
}
.shop-logout:hover { opacity: 1; }

.sidebar-section { padding: 16px; }
.sidebar-section + .sidebar-section { border-top: 1.5px solid #eee; }
.sidebar-section-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sidebar-section-title .eye-toggle {
  cursor: pointer;
  opacity: 0.5;
  font-size: 16px;
  padding: 2px 4px;
}
.sidebar-section-title .eye-toggle:hover { opacity: 1; }
.stats-row {
  display: flex;
  gap: 10px;
}
.stat-box {
  flex: 1;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 2px 2px 0 var(--border);
}
.stat-value { font-size: 22px; font-weight: 800; color: var(--yellow-dark); }
.stat-value.hidden { filter: blur(6px); user-select: none; }
.stat-label { font-size: 11px; color: var(--text-muted); margin-top: 6px; font-weight: 500; }

.todo-list { list-style: none; }
.todo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: var(--gray-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.15s;
}
.todo-item:hover { background: #fff9e6; }
.todo-item .todo-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--yellow);
  flex-shrink: 0;
}
.todo-item .todo-text { flex: 1; font-weight: 500; }
.todo-item .todo-badge {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}

.empty-state {
  text-align: center;
  padding: 28px 16px;
  color: var(--text-muted);
  font-size: 13px;
}
.empty-state .icon { font-size: 36px; margin-bottom: 10px; opacity: 0.8; }

/* ========== 数据报表 ========== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.page-title {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
}

.report-section {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}
.report-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.report-section-title .dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
}
.dot-pink { background: var(--pink); }
.dot-yellow { background: var(--yellow); }
.dot-blue { background: var(--blue); }
.dot-purple { background: var(--purple); }

.time-range-btns {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.time-range-btns .filter-btn { border-radius: 8px; }

.overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.overview-card {
  background: var(--gray-bg);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}
.overview-card .label { font-size: 12px; color: var(--text-muted); margin-bottom: 8px; }
.overview-card .value { font-size: 28px; font-weight: 700; color: var(--yellow-dark); }
.overview-card .unit { font-size: 12px; color: var(--text-muted); }

.history-row {
  display: flex;
  text-align: center;
}
.history-item { flex: 1; padding: 16px; }
.history-item + .history-item { border-left: 1.5px solid var(--border); }
.history-item .value { font-size: 32px; font-weight: 700; color: var(--yellow-dark); }
.history-item .label { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.history-item .unit { font-size: 12px; color: var(--text-muted); }

.trend-list { display: flex; flex-direction: column; gap: 8px; }
.trend-item {
  display: flex;
  align-items: center;
  gap: 12px;
}
.trend-date { width: 40px; font-size: 13px; color: var(--text-muted); flex-shrink: 0; }
.trend-bar-wrap { flex: 1; height: 28px; background: var(--gray-bg); border: 1px solid #ddd; border-radius: 4px; overflow: hidden; position: relative; }
.trend-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--pink), var(--yellow));
  border-radius: 3px;
  min-width: 0;
  transition: width 0.3s;
}
.trend-value { width: 70px; text-align: right; font-size: 13px; font-weight: 600; color: var(--yellow-dark); flex-shrink: 0; }

.pkg-pref-item { margin-bottom: 16px; }
.pkg-pref-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
  font-size: 13px;
}
.pkg-pref-bar {
  height: 24px;
  background: var(--gray-bg);
  border: 1px solid #ddd;
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.pkg-pref-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--purple), var(--pink));
  border-radius: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: #fff;
  font-weight: 600;
  min-width: 30px;
}

/* ========== 会员中心 ========== */
.member-page {
  background: var(--yellow);
  padding: 20px 24px 32px;
  min-height: calc(100vh - var(--nav-height));
}
.member-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.member-profile {
  text-align: center;
  margin-bottom: 24px;
}
.member-shop-icon { font-size: 48px; margin-bottom: 8px; }
.member-shop-name { font-size: 18px; font-weight: 700; }
.member-trial {
  display: inline-block;
  background: rgba(0,0,0,0.1);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  margin-top: 8px;
}
.member-trial-days { font-size: 12px; color: rgba(0,0,0,0.6); margin-top: 4px; }

.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.plan-card {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  position: relative;
}
.plan-card.recommended { border-color: var(--red); border-width: 3px; }
.plan-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.plan-header {
  padding: 16px;
  color: #fff;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}
.plan-header.monthly { background: var(--blue); }
.plan-header.yearly { background: var(--pink); }
.plan-header.permanent { background: #4a4a4a; }
.plan-body { padding: 16px; text-align: center; }
.plan-price { font-size: 36px; font-weight: 700; }
.plan-price.monthly { color: var(--blue); }
.plan-price.yearly { color: var(--pink); }
.plan-price.permanent { color: #333; }
.plan-original { font-size: 14px; color: var(--text-muted); text-decoration: line-through; }
.plan-validity { font-size: 13px; color: var(--text-muted); margin: 8px 0; }
.plan-daily { font-size: 12px; color: var(--text-muted); margin-bottom: 12px; }
.plan-feature {
  padding: 8px;
  border-radius: 6px;
  font-size: 12px;
  margin-bottom: 8px;
}
.plan-feature.all { background: #d4edda; color: #155724; }
.plan-feature.basic { background: #e9ecef; color: #666; }
.plan-coupon { font-size: 12px; margin-bottom: 12px; }
.plan-coupon.available { color: var(--red); }
.plan-coupon.unavailable { color: var(--text-muted); }
.plan-btn {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 2px 2px 0 var(--border);
}
.plan-btn.monthly { background: var(--blue); color: #fff; }
.plan-btn.yearly { background: var(--pink); color: #fff; }
.plan-btn.permanent { background: #4a4a4a; color: #fff; }

.member-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  box-shadow: var(--shadow);
}
.member-grid-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
}
.member-grid-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.member-grid-icon.green { background: #d4edda; }
.member-grid-icon.blue { background: #d6e9f8; }
.member-grid-icon.yellow { background: #fff3cd; }
.member-grid-icon.purple { background: #e8daef; }
.member-grid-text .title { font-weight: 600; font-size: 14px; }
.member-grid-text .sub { font-size: 11px; color: var(--text-muted); }
.invite-code { color: var(--yellow-dark); font-weight: 700; }

/* ========== 系统设置 ========== */
.settings-page {
  background: var(--dark);
  padding: 20px 24px 32px;
  min-height: calc(100vh - var(--nav-height));
  color: #fff;
}
.settings-page .page-title { color: #fff; margin-bottom: 20px; }
.settings-section {
  background: rgba(255,255,255,0.08);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.settings-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.settings-section-title { font-size: 16px; font-weight: 600; }

.table-mgmt-card {
  background: rgba(255,255,255,0.95);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.table-mgmt-info { display: flex; align-items: center; gap: 16px; }
.table-mgmt-num { font-size: 20px; font-weight: 700; }
.table-mgmt-actions { display: flex; gap: 6px; }

.package-mgmt-card {
  background: rgba(255,255,255,0.95);
  color: var(--text);
  border: 2px solid var(--border);
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.package-mgmt-info .name { font-weight: 600; }
.package-mgmt-info .detail { font-size: 13px; color: var(--text-muted); }
.package-mgmt-actions { display: flex; align-items: center; gap: 8px; }

.toggle-switch {
  width: 44px;
  height: 24px;
  background: #ccc;
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
}
.toggle-switch.on { background: var(--blue); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: #fff;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle-switch.on::after { transform: translateX(20px); }

.fee-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.fee-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
  border: 1.5px solid;
}
.fee-tag.income { background: #d4edda; border-color: #28a745; color: #155724; }
.fee-tag.deduction { background: #f8d7da; border-color: #dc3545; color: #721c24; }
.fee-tag .remove { cursor: pointer; opacity: 0.6; font-size: 16px; }

/* ========== 弹窗 ========== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s;
}
.modal-overlay.bottom-sheet {
  align-items: flex-end;
  padding: 0;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--border);
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp 0.25s;
}
.modal-overlay.bottom-sheet .modal {
  max-width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
  animation: slideUpBottom 0.3s;
}
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }
@keyframes slideUpBottom { from { transform: translateY(100%); } }

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid #eee;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-close {
  width: 32px;
  height: 32px;
  border: none;
  background: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
}
.modal-body { padding: 20px; }
.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #eee;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* 桌台详情弹窗 */
.detail-modal { max-width: 700px; }
.detail-header { font-size: 18px; font-weight: 700; }
.detail-timer-section {
  text-align: center;
  padding: 16px;
  background: var(--gray-bg);
  border-radius: 8px;
  margin-bottom: 16px;
}
.detail-package { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.detail-timer { font-size: 36px; font-weight: 700; color: var(--yellow-dark); font-variant-numeric: tabular-nums; }
.detail-paused { font-size: 24px; font-weight: 700; color: var(--blue); }
.detail-actions {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-actions .btn { flex: 1; padding: 14px; font-size: 15px; }

.detail-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.detail-section-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.fee-list { list-style: none; }
.fee-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid #eee;
  font-size: 14px;
}
.record-section { margin-bottom: 12px; }
.record-section .title { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.record-section .empty { font-size: 12px; color: var(--text-muted); }

.detail-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 2px solid var(--border);
  margin-top: 16px;
}
.detail-total .label { font-size: 14px; }
.detail-total .amount { font-size: 28px; font-weight: 700; color: var(--yellow-dark); }
.detail-checkout { padding: 14px 40px; font-size: 16px; }

/* 表单 */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 13px; color: var(--text-muted); margin-bottom: 6px; }
.form-input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s;
}
.form-input:focus { border-color: var(--yellow); }

.type-toggle {
  display: flex;
  gap: 8px;
}
.type-toggle button {
  flex: 1;
  padding: 14px;
  border: 2px solid #ddd;
  border-radius: 8px;
  background: #f5f5f5;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.type-toggle button.active.income { background: var(--green); color: #fff; border-color: var(--green); }
.type-toggle button.active.deduction { background: #f5f5f5; color: var(--text); }

/* 套餐选择 */
.package-list { list-style: none; }
.package-list li {
  padding: 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  font-size: 16px;
  transition: background 0.15s;
}
.package-list li:hover { background: var(--gray-bg); }
.package-list li.selected { background: #fff9e6; border: 2px solid var(--yellow); border-radius: 8px; margin: 4px 0; }

/* 记账标签选择 */
.tag-select-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
}
.tag-select-item:hover { background: var(--gray-bg); }
.tag-select-item .tag-name { font-weight: 600; }
.tag-select-item .tag-type { font-size: 12px; }
.tag-select-item .tag-type.income { color: var(--green); }
.tag-select-item .tag-amount { font-weight: 700; color: var(--yellow-dark); }

/* 确认对话框 */
.confirm-dialog {
  text-align: center;
  padding: 24px;
  max-width: 320px;
}
.confirm-dialog p { font-size: 16px; margin-bottom: 20px; }
.confirm-actions { display: flex; justify-content: center; gap: 24px; }

/* 二维码 */
.qr-container { text-align: center; padding: 20px; }
.qr-container canvas { margin: 0 auto 12px; }
.qr-table-id { font-size: 12px; color: var(--text-muted); word-break: break-all; }

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  z-index: 300;
  animation: toastIn 0.3s;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -50%) scale(0.9); } }

/* API 状态栏 */
.status-bar {
  position: relative;
  z-index: 50;
  padding: 10px 16px;
  font-size: 14px;
  text-align: center;
}
.status-bar.loading { background: #fff3cd; color: #856404; border-bottom: 2px solid var(--border); }
.status-bar.error { background: #fee2e2; color: #721c24; border-bottom: 2px solid var(--border); }
.status-bar.error button {
  margin-left: 12px;
  padding: 4px 12px;
  border: 1.5px solid #721c24;
  border-radius: 6px;
  background: #fff;
  cursor: pointer;
  font-size: 13px;
}
body.is-loading { cursor: wait; }
body.is-loading .btn { pointer-events: none; opacity: 0.7; }

/* 响应式 */
@media (max-width: 900px) {
  #main-content.page-dashboard {
    padding-right: 24px;
  }
  .dashboard-sidebar {
    position: static;
    width: 100%;
    margin-top: 24px;
  }
  .circle-teal { right: -40px; }
}

@media (max-width: 768px) {
  #main-content { padding: 16px; }
  .detail-columns { grid-template-columns: 1fr; }
  .plan-cards { grid-template-columns: 1fr; }
  .table-card { width: calc(50% - 10px); min-width: 150px; }
  .filter-btn { padding: 6px 12px; font-size: 13px; }
}

@media (max-width: 480px) {
  .table-card { width: 100%; }
}

@media (min-width: 769px) {
  .member-page, .settings-page { border-radius: 0; }
}

/* ========== 登录/注册页 ========== */
.auth-body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  background: var(--bg-light, #f5f6f8);
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: #fff;
  border: 3px solid #1a1a2e;
  border-radius: 16px;
  padding: 32px 24px;
  box-shadow: 6px 6px 0 rgba(0,0,0,0.15);
  position: relative;
  z-index: 1;
}

.auth-logo {
  width: 56px;
  height: 56px;
  background: var(--yellow, #ffd233);
  border: 2px solid #1a1a2e;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: #1a1a2e;
  margin-bottom: 16px;
}

.auth-title {
  font-size: 24px;
  font-weight: 800;
  color: #1a1a2e;
  margin: 0 0 8px;
}

.auth-subtitle {
  font-size: 13px;
  color: var(--text-muted, #888);
  margin: 0 0 24px;
}

.auth-input { width: 100%; }

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

.sms-row .auth-input { flex: 1; }

.btn-sms {
  flex-shrink: 0;
  white-space: nowrap;
  padding: 0 12px;
  font-size: 13px;
}

.auth-submit { margin-top: 8px; font-size: 16px; padding: 14px; }

.auth-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.auth-link {
  color: var(--yellow-dark, #e6a800);
  font-weight: 600;
  margin-left: 4px;
}

.auth-third { margin-top: 20px; }

.auth-third-divider {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  position: relative;
}

.auth-third-divider::before,
.auth-third-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: #ddd;
}

.auth-third-divider::before { left: 0; }
.auth-third-divider::after { right: 0; }

.auth-wechat {
  display: block;
  text-align: center;
  text-decoration: none;
  padding: 12px;
}

.required { color: #e74c3c; }

/* ========== 会员弹窗 ========== */
.order-modal .modal { max-width: 360px; }

.order-dialog { padding: 8px 0; }

.order-dialog-title {
  font-size: 18px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 20px;
}

.order-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

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

.order-value { font-weight: 600; font-size: 15px; }

.order-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
}

.order-amount-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 20px 0;
  padding-top: 16px;
  border-top: 1px dashed #eee;
}

.order-amount {
  font-size: 28px;
  font-weight: 800;
  color: var(--yellow-dark, #e6a800);
}

.order-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}

.order-pay-btn { width: 100%; padding: 14px; font-size: 16px; }

.logout-dialog {
  padding: 8px 0;
  text-align: center;
}

.logout-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 24px;
}

.logout-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.btn-outline {
  background: #fff;
  border: 2px solid #1a1a2e;
  color: #1a1a2e;
  padding: 10px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger {
  background: #e74c3c;
  border: none;
  color: #fff;
  padding: 10px 28px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
}

.member-grid-item[data-action] { cursor: pointer; }

.member-loading {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 8px;
}

.member-guest {
  text-align: center;
  padding: 40px 24px;
}

.member-guest .btn-block { max-width: 280px; margin: 24px auto 0; }

.order-list-body { max-height: 60vh; overflow-y: auto; }

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

.order-list-item {
  padding: 12px 0;
  border-bottom: 1px solid #eee;
}

.order-list-title { font-weight: 600; margin-bottom: 4px; }

.order-list-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
