/* ================= 基础 ================= */
html { -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', 'Segoe UI', sans-serif;
  font-size: 16px;
  color: #1e293b;
  background: #f5f5f7;
}

/* ================= 状态标签 ================= */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  padding: 3px 9px;
  border-radius: 9999px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}
.badge-yes { background: #d1fae5; color: #047857; }
.badge-no { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: #f1f5f9; color: #64748b; }
.badge-pending { background: #fef3c7; color: #b45309; }

/* ================= 是/否 切换按钮组 ================= */
.seg {
  display: flex;
  gap: 8px;
}
.seg-btn {
  flex: 1;
  height: 44px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #64748b;
  font-size: 15px;
  font-weight: 500;
  transition: all .15s;
}
.seg-btn.on-yes { border-color: #10b981; background: #ecfdf5; color: #047857; font-weight: 600; }
.seg-btn.on-no { border-color: #ef4444; background: #fef2f2; color: #b91c1c; font-weight: 600; }
.seg-btn:active { opacity: .75; }

/* ================= 弹窗 ================= */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: none;
  align-items: flex-end;
  justify-content: center;
  background: rgba(15, 23, 42, .55);
}
.modal.show { display: flex; }
.modal-panel {
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .22s ease;
  overflow: hidden;
}
.modal.show .modal-panel { transform: translateY(0); }

@media (min-width: 640px) {
  .modal { align-items: center; padding: 24px; }
  .modal-panel { border-radius: 20px; max-height: 88vh; }
}
.modal-body { overflow-y: auto; -webkit-overflow-scrolling: touch; flex: 1; }
.modal-body::-webkit-scrollbar, .scroll-thin::-webkit-scrollbar { display: none; }

/* ================= 表单控件 ================= */
.field-label { display: block; font-size: 14px; font-weight: 500; color: #475569; margin-bottom: 6px; }
.field-input, .field-select, .field-textarea {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
  color: #1e293b;
  outline: none;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.field-textarea { height: auto; min-height: 44px; padding: 10px 14px; resize: vertical; }
.field-input:focus, .field-select:focus, .field-textarea:focus { border-color: #c8102e; }
.field-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='%2394a3b8'%3E%3Cpath d='M4 6l4 4 4-4z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
/* 数字输入隐藏上下箭头 */
input[type='number']::-webkit-outer-spin-button,
input[type='number']::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input[type='number'] { -moz-appearance: textfield; appearance: textfield; }
input[type='date'] { -webkit-appearance: none; appearance: none; }

/* ================= 登录页 Tab ================= */
.login-tab-btn {
  flex: 1;
  height: 40px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  color: #64748b;
  transition: all .15s;
}
.login-tab-btn.active {
  background: #fff;
  color: #c8102e;
  box-shadow: 0 1px 4px rgba(15, 23, 42, .08);
}

/* ================= 顶部导航 Tab ================= */
.tab-btn {
  position: relative;
  padding: 8px 16px;
  font-size: 15px;
  font-weight: 500;
  color: #64748b;
  border-radius: 10px;
  transition: all .15s;
}
.tab-btn.active { color: #c8102e; background: #fef2f2; font-weight: 700; }

/* ================= 账号卡片操作按钮 ================= */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  color: #475569;
  transition: all .15s;
}
.icon-btn:active { background: #f1f5f9; }
.icon-btn.primary { border-color: #c8102e; color: #c8102e; background: #fff; }
.icon-btn.danger { color: #dc2626; }
.icon-btn.ghost { border: none; background: #f1f5f9; }

/* ================= 桌面表格 ================= */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  text-align: left;
  font-size: 13px;
  font-weight: 600;
  color: #94a3b8;
  padding: 12px 14px;
  border-bottom: 1px solid #f1f5f9;
  white-space: nowrap;
}
.data-table td {
  padding: 14px;
  font-size: 15px;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.data-table tr:hover td { background: #fafafa; }

/* ================= 利润色 ================= */
.profit-pos { color: #047857; font-weight: 700; }
.profit-neg { color: #b91c1c; font-weight: 700; }
.profit-zero { color: #64748b; }
/* 统计横幅（深红渐变背景）内使用白色系利润色 */
.profit-banner-pos { color: #ffffff; }
.profit-banner-neg { color: #fecaca; }
.profit-banner-zero { color: #ffffff; }

/* ================= 其他 ================= */
.hide-scrollbar::-webkit-scrollbar { display: none; }
.hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

.fab {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 40;
  height: 52px;
  padding: 0 22px;
  border-radius: 9999px;
  background: #c8102e;
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  box-shadow: 0 8px 20px rgba(200, 16, 46, .35);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fab:active { opacity: .85; transform: scale(.97); }

/* 批量新增悬浮按钮（位于主 FAB 上方） */
.fab-batch {
  position: fixed;
  right: 16px;
  bottom: calc(80px + env(safe-area-inset-bottom));
  z-index: 40;
  height: 46px;
  padding: 0 18px;
  border-radius: 9999px;
  background: #fff;
  color: #c8102e;
  font-size: 14px;
  font-weight: 600;
  border: 1.5px solid rgba(200, 16, 46, .35);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .12);
  display: flex;
  align-items: center;
  gap: 6px;
}
.fab-batch:active { opacity: .85; transform: scale(.97); }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn .25s ease; }

/* 可点击徽章（黑号/注销，点击展开天数详情） */
.badge-tap { cursor: pointer; transition: filter .15s; }
.badge-tap:active { filter: brightness(.92); }

/* ================= markdown 文章内容（快捷按钮弹窗） ================= */
.md-content { font-size: 15px; line-height: 1.75; color: #334155; }
.md-content h2 { font-size: 19px; font-weight: 700; color: #1e293b; margin: 18px 0 8px; padding-bottom: 6px; border-bottom: 1px solid #eef2f7; }
.md-content h2:first-child { margin-top: 0; }
.md-content h3 { font-size: 16px; font-weight: 600; color: #1e293b; margin: 14px 0 6px; }
.md-content p { margin: 8px 0; }
.md-content ul, .md-content ol { margin: 8px 0; padding-left: 22px; }
.md-content ul { list-style: disc; }
.md-content ol { list-style: decimal; }
.md-content li { margin: 4px 0; }
.md-content blockquote { margin: 10px 0; padding: 8px 14px; border-left: 3px solid #c8102e; background: #fdf2f3; border-radius: 8px; color: #475569; }
.md-content code { background: #f1f5f9; color: #be123c; padding: 1px 6px; border-radius: 5px; font-size: 13px; font-family: Consolas, Menlo, monospace; }
.md-content a { color: #c8102e; text-decoration: underline; word-break: break-all; }
.md-content .md-blank { height: 12px; }
