/* ============================================================
   比亚迪行程统计 v2.0.0 - 公共样式（高端浅色版）
   主题色：#007aff（雅致科技蓝），#f4f6f9（浅灰背景）
   设计语言：玻璃拟态卡片式 UI，移动端优先，最大宽度 480px
   ============================================================ */

:root {
  --bg-main: #f4f6f9;
  --bg-card: rgba(255, 255, 255, 0.85);
  --border-light: rgba(0, 0, 0, 0.04);
  --text-primary: #1e2530;
  --text-secondary: #657786;
  --theme-blue: #007aff;
  --theme-gold: #b58900;
  --theme-green: #34c759;
  --theme-pink: #ff2d55;
  /* 兼容旧变量名 */
  --primary: #007aff;
  --primary-dark: #0052d4;
  --primary-light: #6fb1fc;
  --bg: #f4f6f9;
  --card-bg: rgba(255, 255, 255, 0.85);
  --text: #1e2530;
  --text-muted: #999;
  --border: rgba(0, 0, 0, 0.06);
  --success: #34c759;
  --warning: #f5a623;
  --danger: #ff2d55;
  --shadow: 0 8px 24px rgba(149, 157, 165, 0.08);
  --shadow-lg: 0 12px 30px rgba(149, 157, 165, 0.15);
  --radius: 24px;
  --radius-sm: 18px;
  --radius-xs: 14px;
  --nav-height: 64px;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-main);
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
  overflow-x: hidden;
}

body {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 30px);
}

/* ===== 顶部导航栏（空气感微光悬浮） ===== */
.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  background: rgba(244, 246, 249, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.top-bar .title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.5px;
  color: var(--text-primary);
}

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

.top-bar .icons i {
  font-size: 18px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.3s;
}

.top-bar .icons i:hover {
  color: var(--theme-blue);
}

.top-bar .icons .top-login-text {
  font-size: 13px;
  color: var(--theme-blue);
  cursor: pointer;
  font-weight: 600;
  padding: 4px 12px;
  border: 1px solid var(--theme-blue);
  border-radius: 14px;
  line-height: 1.6;
  transition: all 0.2s;
}

.top-bar .icons .top-login-text:hover {
  background: var(--theme-blue);
  color: #fff;
}

/* ===== 无线采集标识 ===== */
.wireless-badge {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 14px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.3px;
  flex-shrink: 0;
  transition: background 0.3s;
}
.wireless-badge.online {
  background: rgba(52,199,89,0.12);
  color: var(--theme-green);
}
.wireless-badge.offline {
  background: rgba(245,158,11,0.12);
  color: var(--theme-orange, #f5a623);
}
.wireless-badge .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}

/* ===== 通用隐藏 ===== */
.hidden { display: none !important; }

/* ===== 内容容器 ===== */
.container {
  padding: 0px;
}

/* ===== 防止页面加载布局抖动 ===== */

/* 页面容器预设高度，防止切换时高度跳变 */
#page-content {
  min-height: 60vh;
  /* 用背景色覆盖 innerHTML 替换瞬间的空白，消除闪白 */
  background: var(--bg-main);
}

/* 数值显示元素：预设最小宽度，防止 "--" → "123.5" 时宽度跳动 */
.dash-key .num,
[id^="rm-"],
[id^="bill-"] {
  min-width: 48px;
  display: inline-block;
  white-space: nowrap;
  text-align: center;
}

/* 行程页卡片内的数值元素（排除行内 span 避免撑开间隙） */
#dash-cost, #dash-saved, #dash-distance, #dash-duration, #dash-score, #dash-trips,
#dash-batt, #dash-fuel, #dash-range {
  min-width: 48px;
  display: inline-block;
  white-space: nowrap;
  text-align: center;
}

/* 行内文字 span 不做块级限制 */
#dash-total-odo, #dash-cons {
  display: inline;
  min-width: 0;
  text-align: left;
  white-space: nowrap;
}

/* 页面内关键文本行，防止换行跳动 */
.vehicle-status .value,
.state-value {
  min-width: 42px;
  display: inline-block;
  white-space: nowrap;
  text-align: center;
}

/* ===== 卡片（牛奶玻璃通透感） ===== */
.card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card-title i {
  color: var(--theme-blue);
}

.card-title small {
  font-weight: 500;
  font-size: 11px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* ===== 底部导航栏（悬浮白金质感） ===== */
.bottom-nav {
  position: fixed;
  bottom: 14px;
  left: 16px;
  right: 16px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 22px;
  display: flex;
  justify-content: space-around;
  padding: 10px 0;
  z-index: 1000;
  max-width: 448px;
  margin: 0 auto;
  box-shadow: 0 10px 30px rgba(160, 175, 190, 0.25);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  font-size: 10px;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s;
  width: 50px;
  font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}

.nav-item i {
  font-size: 18px;
  margin-bottom: 4px;
  transition: transform 0.2s;
}

.nav-item.active {
  color: var(--theme-blue);
}

.nav-item.active i {
  transform: translateY(-2px);
  color: var(--theme-blue);
}

/* ===== 登录页面 ===== */
.login-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  backdrop-filter: blur(4px);
}

.login-overlay.hidden {
  display: none;
}

.login-overlay-inner {
  background: linear-gradient(135deg, #1e3a5f 0%, #2d5a87 100%);
  border-radius: 20px;
  padding: 40px 24px;
  width: 100%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
}

.login-logo {
  width: 90px;
  height: 90px;
  background: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.login-logo .logo-text {
  font-size: 40px;
  font-weight: 700;
  color: var(--primary);
}

.login-title {
  color: #fff;
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 8px;
}

.login-subtitle {
  color: rgba(255, 255, 255, 0.7);
  font-size: 13px;
  margin-bottom: 30px;
}

.login-form {
  width: 100%;
  max-width: 360px;
  background: rgba(255, 255, 255, 0.95);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}

/* 登录方式切换标签 */
.login-type-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
.login-type-tab {
  flex: 1;
  padding: 8px 0;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
  background: rgba(0,0,0,0.04);
  color: var(--text-secondary);
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.2s;
  text-align: center;
}
.login-type-tab.active {
  background: var(--theme-blue);
  color: #fff;
  border-color: var(--theme-blue);
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid #e0e0e0;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
  background: #fafafa;
}

.form-input:focus {
  border-color: var(--primary);
  background: #fff;
}

.btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-secondary {
  background: #fff;
  color: var(--text-secondary);
  border: 1px solid #ddd;
  margin-top: 12px;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
  width: auto;
}

.error-message {
  color: var(--danger);
  font-size: 12px;
  margin-top: 10px;
  text-align: center;
  min-height: 18px;
}

.toggle-mode {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.toggle-mode a {
  color: var(--primary);
  cursor: pointer;
  text-decoration: none;
  font-weight: 500;
}

/* ===== 加载状态 ===== */
.loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  color: var(--text-muted);
}

.loading .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e0e0e0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin-bottom: 12px;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* ===== 空状态 ===== */
.empty-state {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 14px;
}

.empty-state i {
  font-size: 48px;
  margin-bottom: 12px;
  display: block;
  opacity: 0.4;
}

/* ===== Toast 提示 ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  padding: 10px 20px;
  border-radius: 20px;
  font-size: 13px;
  z-index: 300;
  animation: toastIn 0.3s ease;
  max-width: 90%;
  text-align: center;
}

.toast.success {
  background: rgba(52, 168, 83, 0.9);
}

.toast.error {
  background: rgba(239, 68, 68, 0.9);
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
  to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ===== 管理员页面通用样式 ===== */
.admin-card {
  background: var(--bg-card);
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
  box-shadow: var(--shadow);
}

.admin-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.admin-card-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
}

/* 徽章 */
.badge {
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 600;
  display: inline-block;
}
.badge.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.badge.green { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.badge.blue { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.badge.orange { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.badge.purple { background: rgba(139, 92, 246, 0.15); color: #8b5cf6; }

/* 管理员按钮 */
.admin-btn {
  padding: 6px 14px;
  border: none;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.admin-btn:active { transform: scale(0.96); }
.admin-btn.approve { background: #10b981; color: #fff; }
.admin-btn.reject { background: #ef4444; color: #fff; }
.admin-btn.edit { background: #3b82f6; color: #fff; }
.admin-btn.delete { background: #9ca3af; color: #fff; }
.admin-btn.generate { background: #8b5cf6; color: #fff; }
.admin-btn.trips { background: #6366f1; color: #fff; }
.admin-btn.batch-approve { background: #16a34a; color: #fff; }
.admin-btn.batch-reject { background: #dc2626; color: #fff; }

/* 数据统计网格 */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}
.stats-grid .stat-item {
  background: rgba(0, 0, 0, 0.02);
  border-radius: 12px;
  padding: 12px 4px;
  text-align: center;
}
.stats-grid .stat-item .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--theme-blue);
}
.stats-grid .stat-item .num.green { color: #10b981; }
.stats-grid .stat-item .num.orange { color: #f59e0b; }
.stats-grid .stat-item .num.purple { color: #8b5cf6; }
.stats-grid .stat-item .label {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* 审核请求列表 */
.req-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  margin-bottom: 6px;
  gap: 10px;
}
.req-item:last-child { margin-bottom: 0; }
.req-item .checkbox {
  width: 18px;
  height: 18px;
  accent-color: #3b82f6;
  flex-shrink: 0;
  cursor: pointer;
}
.req-item .info { flex: 1; min-width: 0; }
.req-item .info .id {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}
.req-item .info .meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.req-item .actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* 审批批量操作栏 */
.req-batch {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.req-batch label {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.req-batch label input {
  width: 16px;
  height: 16px;
  accent-color: #3b82f6;
  cursor: pointer;
}
.batch-count {
  font-size: 11px;
  color: #f59e0b;
  font-weight: 600;
}

/* 设备管理 */
.device-tabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.device-tabs .tab-btn {
  padding: 5px 14px;
  border-radius: 14px;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.04);
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  transition: all 0.2s;
}
.device-tabs .tab-btn.active {
  background: var(--theme-blue);
  color: #fff;
}

.device-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  margin-bottom: 6px;
  gap: 10px;
}
.device-item:last-child { margin-bottom: 0; }
.device-item .status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.device-item .status-dot.online {
  background: #10b981;
  box-shadow: 0 0 6px rgba(16, 185, 129, 0.5);
}
.device-item .status-dot.offline { background: #9ca3af; }
.device-item .info { flex: 1; min-width: 0; }
.device-item .info .id {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  word-break: break-all;
}
.device-item .info .detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.device-item .tag {
  font-size: 10px;
  padding: 2px 10px;
  border-radius: 10px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
}
.device-item .tag.activated {
  background: rgba(16, 185, 129, 0.12);
  color: #10b981;
}
.device-item .tag.pending {
  background: rgba(245, 158, 11, 0.12);
  color: #f59e0b;
}
.device-item .tag.rejected {
  background: rgba(239, 68, 68, 0.12);
  color: #ef4444;
}
.device-item .actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* 用户管理 */
.user-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: rgba(0, 0, 0, 0.02);
  border-radius: 10px;
  margin-bottom: 6px;
  gap: 10px;
}
.user-item:last-child { margin-bottom: 0; }
.user-item .user-info { flex: 1; min-width: 0; }
.user-item .user-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
}
.user-item .user-detail {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
}
.user-item .user-status {
  font-size: 11px;
  margin-top: 2px;
}
.user-item .user-status.approved { color: #10b981; }
.user-item .user-status.imported { color: #3b82f6; }
.user-item .user-status.pending { color: #f59e0b; }
.user-item .user-status.rejected { color: #ef4444; }
.user-item .user-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

/* 版本推送 */
.push-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.push-row select,
.push-row input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
  min-width: 80px;
  outline: none;
}
.push-btn {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 8px;
  background: var(--theme-blue);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.push-btn:active { transform: scale(0.98); }

/* 日志抓取 */
.log-row {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.log-row select {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 13px;
  background: rgba(0, 0, 0, 0.02);
  min-width: 80px;
  outline: none;
}
.log-display {
  background: #1e293b;
  color: #e2e8f0;
  padding: 12px;
  border-radius: 8px;
  font-size: 11px;
  font-family: 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
  line-height: 1.6;
}
.log-display .time { color: #60a5fa; }
.log-display .log-tag {
  display: inline-block;
  padding: 0 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
}
.log-display .log-tag.data { background: #3b82f6; color: #fff; }
.log-display .log-tag.heartbeat { background: #10b981; color: #fff; }
.log-display .log-tag.cmd { background: #8b5cf6; color: #fff; }

/* 系统设置 */
.setting-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.setting-row:last-child { border-bottom: none; }
.setting-row .label {
  font-size: 13px;
  color: var(--text-secondary);
}
.setting-row .value {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}
.setting-row .value input {
  width: 80px;
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  text-align: right;
  outline: none;
}
.setting-row .value select {
  padding: 4px 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 6px;
  outline: none;
}

/* 搜索框 */
.search-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
}
.search-row input {
  flex: 1;
  padding: 6px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 12px;
  outline: none;
  background: rgba(0, 0, 0, 0.02);
}

/* 模态框 */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
  backdrop-filter: blur(4px);
}
.modal-overlay.active { display: flex; }
.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.modal-title {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
}
.modal-close {
  float: right;
  font-size: 22px;
  cursor: pointer;
  color: var(--text-secondary);
  background: none;
  border: none;
  line-height: 1;
}
.modal-body {
  margin-top: 8px;
}

/* 响应式 */
@media (max-width: 400px) {
  .container { padding: 8px; }
  .card { padding: 14px; margin-bottom: 12px; }
  .top-bar { padding: 10px 12px; }
  .top-bar .title { font-size: 18px; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .req-item { flex-wrap: wrap; }
  .req-item .actions { width: 100%; justify-content: flex-end; }
  .device-item { flex-wrap: wrap; }
  .device-item .actions { width: 100%; justify-content: flex-end; }
  .push-row { flex-direction: column; }
  .log-row { flex-direction: column; }
}

/* ===== 通知系统 ===== */

/* 铃铛容器 */
.bell-wrap {
  position: relative;
  cursor: pointer;
}
.bell-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  background: var(--theme-pink);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}

/* 通知面板遮罩 */
.notify-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 400;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  overflow-y: auto;
}

/* 通知面板 */
.notify-panel {
  margin-top: 60px;
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
  overflow: hidden;
}

/* Tab 切换 */
.notify-tabs {
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(0, 0, 0, 0.06);
  padding: 0 12px;
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}
.notify-tab {
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  background: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}
.notify-tab.active {
  color: var(--theme-blue);
  border-bottom-color: var(--theme-blue);
}
.notify-close {
  margin-left: auto;
  font-size: 20px;
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
}

/* Tab 内容 */
.notify-tab-content {
  overflow-y: auto;
  max-height: 55vh;
}

/* 通知操作栏 */
.notify-actions {
  padding: 8px 12px;
  display: flex;
  gap: 8px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

/* 通知列表 */
.notify-items {
  padding: 0;
}

.notify-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 14px;
}

/* 单条通知 */
.notify-item {
  display: flex;
  align-items: flex-start;
  padding: 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}
.notify-item:hover {
  background: rgba(0, 0, 0, 0.02);
}
.notify-item.unread {
  background: rgba(0, 122, 255, 0.04);
}
.notify-item .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--theme-blue);
  flex-shrink: 0;
  margin-top: 5px;
}
.notify-item.read .dot {
  background: transparent;
}
.notify-item .notify-body {
  flex: 1;
  min-width: 0;
}
.notify-item .notify-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.notify-item .notify-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.4;
  word-break: break-all;
}
.notify-item .notify-time {
  font-size: 11px;
  color: #999;
  margin-top: 4px;
}
.notify-item .notify-del {
  font-size: 16px;
  color: #ccc;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.notify-item .notify-del:hover {
  color: var(--theme-pink);
}

/* 提醒列表 */
.reminder-items {
  padding: 0;
}
.reminder-item {
  padding: 14px 12px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.reminder-item .reminder-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.reminder-item .reminder-meta {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}
.reminder-item .reminder-note {
  font-size: 12px;
  color: #999;
  margin-bottom: 6px;
}
.reminder-item .reminder-link-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 8px;
}
.reminder-item .reminder-link {
  font-size: 11px;
  color: var(--theme-blue);
  background: rgba(0, 122, 255, 0.06);
  padding: 3px 8px;
  border-radius: 4px;
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: monospace;
}
.reminder-item .reminder-actions {
  display: flex;
  gap: 8px;
}
.reminder-item .btn-sm {
  font-size: 11px;
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
}
.reminder-item .btn-sm.btn-danger {
  color: var(--theme-pink);
  border-color: rgba(255, 45, 85, 0.2);
}
.reminder-item .btn-sm:hover {
  opacity: 0.8;
}

/* 新建提醒表单 */
.reminder-form-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}
.reminder-form-card .form-group {
  margin-bottom: 12px;
}
.reminder-form-card .form-label {
  font-size: 13px;
  color: var(--text-secondary);
  display: block;
  margin-bottom: 4px;
}
.reminder-form-card .form-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  font-size: 14px;
  outline: none;
  background: rgba(0, 0, 0, 0.02);
  color: var(--text-primary);
}
.reminder-form-card .form-input:focus {
  border-color: var(--theme-blue);
}
.reminder-form-card .btn-full {
  width: 100%;
  margin-top: 8px;
}
.reminder-form-card .error-message {
  color: var(--theme-pink);
  font-size: 12px;
  margin-bottom: 8px;
  min-height: 18px;
}

/* 通用小按钮 */
.btn-sm {
  font-size: 12px;
  padding: 5px 14px;
  border-radius: 8px;
  border: 1px solid rgba(0, 0, 0, 0.1);
  background: #fff;
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.15s;
  font-weight: 500;
}
.btn-sm.btn-primary {
  background: var(--theme-blue);
  color: #fff;
  border-color: var(--theme-blue);
}
.btn-sm:hover { opacity: 0.85; }

.btn-full {
  width: 100%;
}

/* ===== 微信小程序 web-view 适配 ===== */
body.in-miniapp {
  padding-bottom: calc(var(--nav-height) + var(--safe-bottom) + 10px);
}