/* ===== 全局重置 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: #f5f7fa;
  color: #2c3e50;
  line-height: 1.6;
  font-size: 15px;
}

/* ===== 收集表容器 ===== */
.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 12px 12px 200px;
}
.header {
  text-align: center;
  padding: 12px 0 10px;
}
.header h1 {
  font-size: 19px;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.header .sub {
  font-size: 12px;
  color: #888;
}

/* ===== 卡片 ===== */
.card {
  background: #fff;
  border-radius: 12px;
  padding: 14px 14px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.card-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.card-title .badge {
  background: #4f7cff;
  color: #fff;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
  font-weight: 500;
}
.card-desc {
  font-size: 11px;
  color: #999;
  margin-bottom: 10px;
}

/* ===== 表单项 ===== */
.field {
  margin-bottom: 12px;
}
.field:last-child { margin-bottom: 0; }
.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: #333;
  margin-bottom: 6px;
}
.field label .req { color: #e74c3c; margin-left: 2px; }
.field label .opt { color: #bbb; font-weight: 400; font-size: 12px; margin-left: 4px; }

input[type="date"],
input[type="text"],
select {
  width: 100%;
  padding: 10px 12px;
  font-size: 14px;
  border: 1.5px solid #e6e9ef;
  border-radius: 9px;
  background: #fafbfc;
  color: #2c3e50;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  transition: all 0.15s;
}
input[type="date"]:focus,
select:focus {
  border-color: #4f7cff;
  background: #fff;
}
select {
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23999' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

/* ===== 复选框组 ===== */
.checkbox-group {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.checkbox-item {
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1.5px solid #e6e9ef;
  border-radius: 9px;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.15s;
}
.checkbox-item:active { background: #f0f3ff; }
.checkbox-item input { margin-right: 8px; width: 17px; height: 17px; accent-color: #4f7cff; }
.checkbox-item.checked {
  border-color: #4f7cff;
  background: #f0f3ff;
}
.checkbox-item span { font-size: 13px; }

/* ===== 图片上传 ===== */
.upload-box {
  position: relative;
  display: block;
  border: 1.5px dashed #cfd6e4;
  border-radius: 9px;
  padding: 12px;
  text-align: center;
  background: #fafbfc;
  cursor: pointer;
  transition: all 0.15s;
}
.upload-box:active { border-color: #4f7cff; background: #f0f3ff; }
.upload-box .icon {
  font-size: 22px;
  color: #bbb;
  margin-bottom: 2px;
}
.upload-box .text {
  font-size: 12px;
  color: #888;
}
.upload-box input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.upload-preview {
  margin-top: 8px;
  position: relative;
}
.upload-preview img {
  width: 100%;
  max-height: 120px;
  object-fit: cover;
  border-radius: 8px;
  display: block;
  background: #f0f2f5;
}
.upload-preview .remove {
  position: absolute;
  top: 8px; right: 8px;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 26px; height: 26px;
  font-size: 16px;
  cursor: pointer;
}

/* ===== 提交按钮 ===== */
.submit-btn {
  width: 100%;
  padding: 15px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #4f7cff, #6b5cff);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79,124,255,0.35);
  transition: all 0.15s;
  min-height: 52px;
}
.submit-btn:active { transform: scale(0.98); }
.submit-btn:disabled { opacity: 0.6; }

/* ===== 弹窗 ===== */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999;
  padding: 20px;
}
.modal-mask.show { display: flex; }
.modal {
  background: #fff;
  border-radius: 18px;
  padding: 28px 22px 22px;
  width: 100%;
  max-width: 360px;
  text-align: center;
  animation: pop 0.25s ease;
}
@keyframes pop {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.modal .emoji { font-size: 40px; margin-bottom: 8px; }
.modal h3 {
  font-size: 17px;
  color: #1a1a1a;
  margin-bottom: 18px;
}
.modal .stat {
  background: #f5f7fa;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}
.modal .stat-label {
  font-size: 13px;
  color: #888;
  margin-bottom: 4px;
}
.modal .stat-value {
  font-size: 26px;
  font-weight: 700;
  color: #4f7cff;
}
.modal .stat-value.bonus { color: #e67e22; }
.modal .tip {
  font-size: 13px;
  color: #999;
  margin: 12px 0 18px;
}
.modal .monthly-summary {
  background: #f5f7fa;
  border-radius: 10px;
  padding: 12px 14px;
  margin: 10px 0;
  text-align: left;
}
.modal .monthly-summary .ms-title {
  font-size: 14px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid #e6e9ef;
}
.modal .monthly-summary .ms-title span {
  color: #888;
  font-weight: 400;
  font-size: 12px;
  margin-left: 4px;
}
.modal .monthly-summary .ms-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: #555;
  padding: 3px 0;
}
.modal .monthly-summary .ms-row .hl {
  color: #e67e22;
  font-weight: 600;
}
.modal .modal-btn {
  width: 100%;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #4f7cff;
  border: none;
  border-radius: 10px;
  cursor: pointer;
}

/* ===== Toast ===== */
.toast {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(0,0,0,0.8);
  color: #fff;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 1000;
  display: none;
}
.toast.show { display: block; }

/* ===== 后台 ===== */
.admin-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 20px;
}
.admin-header {
  background: #fff;
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.admin-header h1 {
  font-size: 20px;
  color: #1a1a1a;
  margin-bottom: 6px;
}
.admin-header .meta {
  font-size: 13px;
  color: #888;
}
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0;
  align-items: center;
}
.filter-bar select,
.filter-bar input {
  width: auto;
  min-width: 130px;
  padding: 8px 12px;
  font-size: 13px;
}
.filter-bar .btn {
  padding: 8px 16px;
  font-size: 13px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 500;
}
.filter-bar .btn-primary { background: #4f7cff; color: #fff; }
.filter-bar .btn-default { background: #f0f3ff; color: #4f7cff; }
.filter-bar .btn-export { background: #27ae60; color: #fff; }

.summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 14px 0;
}
.summary-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.summary-card .label { font-size: 12px; color: #888; margin-bottom: 6px; }
.summary-card .value { font-size: 22px; font-weight: 700; color: #1a1a1a; }
.summary-card .value.blue { color: #4f7cff; }
.summary-card .value.orange { color: #e67e22; }
.summary-card .value.green { color: #27ae60; }
.summary-card .sub { font-size: 12px; color: #aaa; margin-top: 4px; }

.coach-summary {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 16px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
.coach-summary h3 { font-size: 15px; margin-bottom: 10px; color: #1a1a1a; }
.coach-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 10px;
}
.coach-item {
  background: #f5f7fa;
  border-radius: 10px;
  padding: 12px;
}
.coach-item .name { font-size: 14px; font-weight: 600; color: #1a1a1a; margin-bottom: 6px; }
.coach-item .row { font-size: 12px; color: #666; display: flex; justify-content: space-between; }

/* 表格 */
.table-wrap {
  background: #fff;
  border-radius: 14px;
  overflow: auto;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  min-width: 1200px;
}
thead th {
  background: #f5f7fa;
  padding: 12px 10px;
  text-align: left;
  font-weight: 600;
  color: #555;
  border-bottom: 2px solid #eef0f4;
  white-space: nowrap;
  position: sticky;
  top: 0;
}
tbody td {
  padding: 10px;
  border-bottom: 1px solid #f0f2f5;
  color: #333;
  vertical-align: top;
}
tbody tr:hover { background: #fafbfc; }
.thumb {
  width: 50px;
  height: 50px;
  object-fit: cover;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid #eee;
}
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
}
.tag-good { background: #e6f9ed; color: #27ae60; }
.tag-bad { background: #fdeaea; color: #e74c3c; }
.tag-warn { background: #fff5e6; color: #e67e22; }
.tag-neutral { background: #f0f3ff; color: #4f7cff; }

.score-cell { font-weight: 600; }
.bonus-cell { font-weight: 600; color: #e67e22; }
.zero { color: #e74c3c; }

.empty {
  text-align: center;
  padding: 40px;
  color: #999;
  font-size: 14px;
}

/* 登录页 */
.login-wrap {
  max-width: 360px;
  margin: 80px auto 0;
  padding: 20px;
}
.login-card {
  background: #fff;
  border-radius: 14px;
  padding: 28px 22px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.04);
  text-align: center;
}
.login-card h2 { font-size: 18px; margin-bottom: 6px; }
.login-card p { font-size: 13px; color: #888; margin-bottom: 18px; }
.login-card input {
  margin-bottom: 12px;
  text-align: center;
}
.login-card .btn {
  width: 100%;
  padding: 12px;
  background: #4f7cff;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

/* 图片预览大图 */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1001;
  padding: 20px;
  cursor: zoom-out;
}
.lightbox.show { display: flex; }
.lightbox img {
  max-width: 95%;
  max-height: 90vh;
  border-radius: 8px;
}

@media (max-width: 640px) {
  .admin-wrap { padding: 12px; }
  table { font-size: 12px; min-width: 900px; }
  thead th, tbody td { padding: 8px 6px; }
}

/* ===== 本月战绩面板 ===== */
.stats-panel {
  background: linear-gradient(135deg, #fff 0%, #f5f7ff 100%);
  border: 1.5px solid #e0e6ff;
}
.stats-panel .card-title {
  color: #4f7cff;
}
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin: 14px 0 10px;
}
.stats-item {
  background: #fff;
  border-radius: 10px;
  padding: 14px 10px;
  text-align: center;
  box-shadow: 0 1px 4px rgba(79,124,255,0.08);
}
.stats-num {
  font-size: 24px;
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 4px;
}
.stats-num.blue { color: #4f7cff; }
.stats-num.orange { color: #e67e22; }
.stats-num.green { color: #27ae60; }
.stats-num.purple { color: #9b59b6; }
.stats-lbl {
  font-size: 12px;
  color: #888;
}
.stats-tip {
  text-align: center;
  font-size: 13px;
  color: #4f7cff;
  font-weight: 500;
  padding: 8px 0 2px;
}

/* ===== 全员榜 ===== */
.lb-list {
  margin-top: 12px;
}
.lb-row {
  display: flex;
  align-items: center;
  padding: 12px 10px;
  border-radius: 10px;
  background: #fff;
  margin-bottom: 8px;
  box-shadow: 0 1px 4px rgba(79,124,255,0.08);
}
.lb-row.lb-empty {
  opacity: 0.5;
  background: #f9fafb;
}
.lb-rank {
  width: 44px;
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #4f7cff;
  flex-shrink: 0;
}
.lb-info {
  flex: 1;
  padding: 0 12px;
  min-width: 0;
}
.lb-name {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 2px;
}
.lb-sub {
  font-size: 11px;
  color: #888;
}
.lb-bonus {
  font-size: 18px;
  font-weight: 700;
  color: #e67e22;
  flex-shrink: 0;
}
.lb-empty-tip {
  text-align: center;
  padding: 16px;
  font-size: 13px;
  color: #4f7cff;
  font-weight: 500;
}
.back-lb-btn {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 9px;
  background: #f0f3ff;
  color: #4f7cff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.back-lb-btn:active { background: #e0e6ff; }

/* ===== 顶部龙虎榜横条 ===== */
.topbar {
  position: relative;
  background: linear-gradient(135deg, #2c3e50 0%, #4a3a1f 100%);
  padding: 6px 12px 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topbar-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #ffd700;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 4px;
}
.topbar-title .tb-icon { font-size: 14px; }
.topbar-title .tb-month {
  margin-left: auto;
  color: #aaa;
  font-size: 10px;
  font-weight: 400;
}
.topbar-list {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.topbar-list::-webkit-scrollbar { display: none; }
.tb-cell {
  flex: 1;
  min-width: 0;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,215,0,0.2);
  border-radius: 7px;
  padding: 5px 4px;
  text-align: center;
  cursor: pointer;
  transition: all 0.15s;
}
.tb-cell:active {
  background: rgba(255,215,0,0.2);
  transform: scale(0.96);
}
.tb-cell-empty {
  opacity: 0.5;
}
.tb-rank {
  font-size: 14px;
  line-height: 1;
  margin-bottom: 1px;
}
.tb-name {
  color: #fff;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.tb-bonus {
  color: #ffd700;
  font-size: 12px;
  font-weight: 700;
  margin-top: 1px;
}

/* 个人战绩弹层 */
.personal-modal .pm-rank {
  text-align: center;
  font-size: 13px;
  color: #4f7cff;
  font-weight: 600;
  margin: -4px 0 12px;
}
.personal-modal .stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}

.pm-avatar { font-size: 28px; color: #4f7cff; font-weight: 700; margin-bottom: 8px; }

.pm-title { font-size: 22px; margin: 8px 0 4px; color: #1a1a1a; }


/* 固定底部提交栏 */
.submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px 14px calc(14px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid #e6e9ef;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.06);
  z-index: 40;
}
.submit-bar .submit-btn {
  margin: 0 auto;
  max-width: 520px;
  padding: 16px;
  min-height: 52px;
  box-shadow: 0 4px 14px rgba(79,124,255,0.35);
}

/* ===== 九宫格密码键盘 ===== */
.pin-display {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 18px 0 22px;
}
.pin-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #d0d4dc;
  background: #fff;
  transition: all 0.15s;
}
.pin-dot.filled {
  background: #4f7cff;
  border-color: #4f7cff;
  transform: scale(1.1);
}
.pin-dot.error {
  background: #e74c3c;
  border-color: #e74c3c;
  animation: pinShake 0.4s;
}
@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-6px); }
  40%, 80% { transform: translateX(6px); }
}

.pin-pad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  max-width: 320px;
  margin: 0 auto;
}
.pin-key {
  height: 56px;
  border: none;
  border-radius: 14px;
  background: #f5f7fa;
  font-size: 24px;
  font-weight: 500;
  color: #1a1a1a;
  cursor: pointer;
  transition: all 0.1s;
  user-select: none;
  -webkit-user-select: none;
  font-family: -apple-system, "SF Pro Display", "Segoe UI", sans-serif;
}
.pin-key:active {
  background: #e0e6ff;
  transform: scale(0.94);
}
.pin-key.fn {
  background: transparent;
  color: #888;
  font-size: 16px;
}
.pin-key.fn:active {
  background: #f0f2f5;
}
.pin-key.blank {
  background: transparent;
  cursor: default;
  pointer-events: none;
}

/* 登录页九宫格布局 */
.login-card .pin-display { margin: 22px 0 26px; }
.login-card .pin-pad { margin-bottom: 18px; }
.login-card h2 { font-size: 18px; margin-bottom: 4px; }
.login-card .pin-tip {
  font-size: 13px; color: #888; margin-bottom: 4px;
}

/* 删除弹窗九宫格（紧凑版） */
#delModal .pin-display { margin: 14px 0 18px; }
#delModal .pin-pad { gap: 8px; }
#delModal .pin-key { height: 48px; font-size: 20px; border-radius: 11px; }
