/* ==============================
   电竞管理台 — 移动端卡片+弹窗
   ============================== */
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  margin: 0;
  font-family: 'PingFang SC','Microsoft YaHei',-apple-system,sans-serif;
  background: #f2f4f8;
  color: #1a1f2e;
  overscroll-behavior: none;
}
button,input,textarea,select { font: inherit; }

/* ===== 布局 ===== */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg,#1e2a4a,#0b1120);
  color: #fff; padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  backdrop-filter: blur(8px);
}
.header-back {
  font-size: 22px; line-height: 1; cursor: pointer;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,0.1); flex-shrink: 0;
}
.header-info { flex: 1; min-width: 0; }
.header-title {
  font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.header-sub { font-size: 11px; color: rgba(255,255,255,0.55); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.header-actions { display: flex; gap: 8px; flex-shrink: 0; }

/* ===== 主内容 ===== */
.main {
  flex: 1; overflow-y: auto; padding: 12px 14px 90px;
  -webkit-overflow-scrolling: touch;
}

/* ===== 卡片列表 ===== */
.card-list { display: flex; flex-direction: column; gap: 10px; }

/* 数据卡片 — 摘要视图 */
.data-card {
  background: #fff; border-radius: 14px; padding: 14px 16px;
  box-shadow: 0 2px 8px rgba(15,23,42,0.04);
  cursor: pointer; transition: .15s;
  display: flex; align-items: center; gap: 12px;
  border: 1px solid #eaedf4;
  position: relative;
}
.data-card:active { transform: scale(0.98); background: #f8f9ff; }
.data-card .card-icon {
  width: 44px; height: 44px; border-radius: 12px;
  background: linear-gradient(135deg,#eef2ff,#e0e7ff);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  overflow: hidden;
}
.data-card .card-icon img { width: 100%; height: 100%; object-fit: cover; display: block; }
.data-card .card-body { flex: 1; min-width: 0; }
.data-card .card-title { font-size: 14px; font-weight: 600; color: #111827; }
.data-card .card-sub { font-size: 12px; color: #6b7280; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.data-card .card-right { text-align: right; flex-shrink: 0; }
.data-card .card-badge {
  font-size: 11px; padding: 2px 8px; border-radius: 999px;
  background: #eef2ff; color: #4f62e0; font-weight: 600;
  display: inline-block;
}
.data-card .card-arrow { font-size: 18px; color: #cbd5e1; margin-left: 4px; }

/* 小号操作卡片（页面文本用） */
.text-card { padding: 12px 14px; min-height: 52px; }
.text-card .card-icon { width: 36px; height: 36px; font-size: 16px; border-radius: 10px; }

/* 用户分组卡片 */
.group-card { flex-direction: column; align-items: stretch; padding: 0; }
.group-card-head {
  padding: 14px 16px 8px;
  display: flex; justify-content: space-between; align-items: center;
}
.group-title { font-size: 14px; font-weight: 700; }
.group-body { padding: 0 16px 14px; }
.group-field-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 0; border-bottom: 1px solid #f0f2f7; gap: 10px;
}
.group-field-row:last-child { border-bottom: 0; }
.group-field-label { font-size: 12px; color: #6b7280; flex-shrink: 0; }
.group-field-value { font-size: 13px; font-weight: 500; color: #111827; text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.group-card-static { background: #fff; border: 1px solid #eaedf4; border-radius: 14px; padding: 8px 14px; }

/* 图片卡片 */
.image-card .card-icon { width: 52px; height: 52px; border-radius: 12px; overflow: hidden; }
.image-card .card-icon img { width: 100%; height: 100%; object-fit: cover; }
.image-card .card-icon.empty { background: #f3f4f6; font-size: 22px; color: #9ca3af; }

/* 登录页 */
.login-shell {
  min-height: calc(100vh - 140px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 0;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-radius: 18px;
  border: 1px solid #eaedf4;
  box-shadow: 0 16px 40px rgba(15,23,42,0.08);
  padding: 24px 18px 18px;
}
.login-title { font-size: 24px; font-weight: 800; color: #111827; text-align: center; }
.login-sub { font-size: 13px; color: #6b7280; text-align: center; margin-top: 8px; }
.login-form { display: flex; flex-direction: column; gap: 12px; margin-top: 22px; }

/* 用户管理 */
.user-tab-row { display: flex; gap: 8px; margin-bottom: 10px; }
.user-tab-btn {
  flex: 1;
  height: 38px;
  border: 1px solid #d8dfeb;
  border-radius: 999px;
  background: #fff;
  color: #6b7280;
  font-size: 13px;
  font-weight: 600;
}
.user-tab-btn.active {
  border-color: #4458ee;
  background: #eef2ff;
  color: #3341c9;
}
.user-summary {
  font-size: 12px;
  color: #6b7280;
  margin-bottom: 10px;
  padding: 0 2px;
}
.user-list-panel {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ===== 底部导航 ===== */
.tab-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  background: #fff; border-top: 1px solid #eaedf4;
  display: flex; padding: 6px 0 env(safe-area-inset-bottom,6px);
  box-shadow: 0 -4px 16px rgba(15,23,42,0.05);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 2px; padding: 6px 4px;
  font-size: 10px; color: #9ca3af; cursor: pointer; transition: .15s;
  border: 0; background: none;
}
.tab-item.active { color: #4f62e0; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { font-weight: 500; }
.tab-count {
  font-size: 9px; padding: 1px 6px; border-radius: 999px;
  background: #eef2ff; color: #4f62e0; font-weight: 700;
  margin-top: -2px;
}

/* ===== 弹窗 / Modal ===== */
.modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn .2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal-sheet {
  width: 90%; max-width: 480px;
  background: #f8f9fc; border-radius: 20px;
  max-height: 92vh; display: flex; flex-direction: column;
  animation: modalIn .2s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.95) translateY(10px); } to { opacity: 1; transform: scale(1) translateY(0); } }

.modal-head {
  padding: 16px 18px 12px;
  display: flex; justify-content: space-between; align-items: center;
  background: #fff; border-radius: 20px 20px 0 0;
  border-bottom: 1px solid #eaedf4;
  flex-shrink: 0;
}
.modal-head .modal-title { font-size: 16px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.modal-close {
  width: 32px; height: 32px; border-radius: 50%;
  background: #f3f4f6; border: 0; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: #6b7280;
}

/* ---- 护航图集（可视化缩略图） ---- */
.detail-gallery { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.detail-thumb {
  position: relative; width: 80px; height: 80px; border-radius: 10px;
  overflow: hidden; border: 1px solid #e2e6ef; flex-shrink: 0;
  background: #f8f9fc;
}
.detail-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.detail-del {
  position: absolute; top: -5px; right: -5px;
  width: 20px; height: 20px; border-radius: 50%;
  background: #ef4444; color: #fff; border: 2px solid #fff;
  font-size: 12px; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
.detail-add-btn {
  width: 80px; height: 80px; border-radius: 10px;
  border: 2px dashed #d1d5db; background: #f8f9fc;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: #9ca3af; cursor: pointer;
  transition: .15s; flex-shrink: 0;
}
.detail-add-btn:hover { border-color: #5b72ff; color: #5b72ff; background: #eef2ff; }

.modal-body {
  padding: 14px 18px 10px; overflow-y: auto;
  -webkit-overflow-scrolling: touch; flex: 1;
  display: flex; flex-direction: column; gap: 12px;
}

.modal-foot {
  padding: 12px 18px 18px; background: #fff;
  border-top: 1px solid #eaedf4;
  display: flex; gap: 10px; flex-shrink: 0;
  padding-bottom: calc(18px + env(safe-area-inset-bottom,0px));
}
.modal-foot .btn { flex: 1; height: 44px; font-size: 15px; border-radius: 12px; line-height: 1; }

/* 弹窗内的字段 */
.modal-field { display: flex; flex-direction: column; gap: 5px; }
.modal-field label { font-size: 12px; color: #374151; font-weight: 600; }
.modal-input, .modal-textarea, .modal-select {
  width: 100%; border: 1px solid #d1d5db; border-radius: 10px;
  padding: 11px 13px; background: #fff; color: #111827;
  font-size: 14px; transition: border .2s;
}
.modal-input:focus, .modal-textarea:focus {
  border-color: #5b72ff; outline: none; box-shadow: 0 0 0 3px rgba(91,114,255,0.12);
}
.modal-textarea { min-height: 80px; resize: vertical; line-height: 1.5; }

/* 内联行编辑器（考核规则） */
.modal-line-editor { display: flex; flex-direction: column; gap: 8px; }
.modal-line-row {
  display: flex; gap: 8px; align-items: flex-start;
}
.modal-line-row .modal-field { flex: 1; }
.modal-line-actions { display: flex; gap: 6px; padding-top: 18px; }

/* ===== 按钮 ===== */
.btn {
  height: 38px; padding: 0 16px; border-radius: 10px;
  cursor: pointer; font-size: 13px; font-weight: 600;
  border: 1px solid #d1d5db; background: #fff; color: #374151;
  display: inline-flex; align-items: center; justify-content: center;
  gap: 4px; transition: .15s; white-space: nowrap; line-height: 1; padding: 0;
}
.btn:active { opacity: .8; }
.btn-primary { background: linear-gradient(135deg,#5b72ff,#4458ee); color: #fff; border: 0; }
.btn-danger { background: #fff1f1; color: #b42318; border-color: #f1c4c4; }
.btn-danger:active { background: #fee2e2; }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11px; border-radius: 8px; line-height: 1; }
.btn-block { width: 100%; height: 44px; font-size: 15px; border-radius: 12px; line-height: 1; }
.btn-ghost { border: 1px solid #d1d5db; background: #fff; color: #374151; }
.btn-success { background: #059669; color: #fff; border: 0; }
.btn-danger-ghost { background: transparent; color: #b42318; border: 0; }

/* ===== 新增按钮条 ===== */
.add-bar {
  padding: 10px 0 4px;
  display: flex; justify-content: center;
}

/* ===== 图片上传（弹窗内） ===== */
.modal-upload-area { display: flex; gap: 12px; align-items: flex-start; flex-wrap: wrap; }
.modal-preview {
  width: 80px; height: 80px; border-radius: 10px;
  overflow: hidden; background: #f3f4f6;
  border: 1px dashed #cbd5e1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; color: #9ca3af;
}
.modal-preview.circle { border-radius: 50%; }
.modal-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }
.modal-upload-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ===== 结果弹窗 ===== */
.result-dialog-overlay {
  position: fixed; inset: 0; z-index: 220;
  background: rgba(15,23,42,0.46);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.result-dialog {
  width: 100%; max-width: 360px;
  background: #fff; border-radius: 18px;
  padding: 22px 18px 18px;
  box-shadow: 0 18px 40px rgba(15,23,42,0.18);
  display: flex; flex-direction: column; gap: 12px;
}
.result-dialog.success { border-top: 4px solid #10b981; }
.result-dialog.error { border-top: 4px solid #ef4444; }
.result-dialog.info { border-top: 4px solid #3b82f6; }
.result-dialog-title { font-size: 18px; font-weight: 700; color: #111827; }
.result-dialog-message { font-size: 14px; line-height: 1.7; color: #374151; }
.result-dialog-detail {
  padding: 10px 12px; border-radius: 12px;
  background: #f8fafc; color: #667085; font-size: 12px; line-height: 1.7;
  border: 1px solid #e5e7eb;
}

/* ===== 空状态 ===== */
.empty-state { padding: 40px 20px; text-align: center; color: #9ca3af; font-size: 14px; }
.empty-state .empty-icon { font-size: 40px; margin-bottom: 8px; display: block; }

/* ===== 保存进度 ===== */
.save-progress {
  position: fixed; bottom: 80px; left: 14px; right: 14px; z-index: 30;
  background: #fff; border-radius: 16px; padding: 14px 16px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  border: 1px solid #eaedf4;
}
.save-progress .progress-title { font-size: 13px; font-weight: 600; }
.save-progress .progress-bar {
  height: 5px; border-radius: 999px; background: #e5e7eb; overflow: hidden; margin: 8px 0 6px;
}
.save-progress .progress-fill {
  height: 100%; border-radius: 999px; background: linear-gradient(90deg,#5b72ff,#34d399);
  transition: width .3s ease;
}
.save-progress .progress-item { font-size: 11px; color: #6b7280; display: flex; align-items: center; gap: 5px; margin-top: 4px; }
.save-progress .progress-item.done { color: #059669; }
.save-progress .progress-item.done::before { content: '✓'; font-weight: 700; }
.save-progress .progress-item.fail { color: #dc2626; }
.save-progress .progress-item.fail::before { content: '✕'; font-weight: 700; }
.save-progress .progress-item::before { content: '○'; color: #9ca3af; }

/* ===== 分隔线 ===== */
.divider { border: 0; border-top: 1px solid #eaedf4; margin: 4px 0; }

/* ===== 小图标徽章 ===== */
.badge-dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  margin-right: 6px;
}
.badge-dot.green { background: #10b981; }
.badge-dot.orange { background: #f59e0b; }
