/* ========== 全局设计变量 ========== */
:root {
  --navy: #1a365d;
  --navy-light: #254b7c;
  --teal: #2ec4b6;
  --teal-dark: #2a9d8f;
  --pink: #e86b85;
  --pink-light: #f8b4b4;
  --bg: #f0f4f8;
  --card: #ffffff;
  --text-dark: #1d2939;
  --text-body: #475467;
  --text-gray: #94a3b8;
  --border-gray: #e2e8f0;
}

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

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text-body);
  font-size: 15px;
}

.phone-frame {
  max-width: 420px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  background: var(--bg);
}

/* ========== 背景地图纹理 ========== */
.map-bg {
  position: absolute;
  inset: 0;
  background-image:
    /* 经纬虚线 */
    repeating-linear-gradient(0deg, transparent 0px, transparent 24px, rgba(100, 149, 237, 0.08) 24px, rgba(100, 149, 237, 0.08) 25px),
    repeating-linear-gradient(90deg, transparent 0px, transparent 24px, rgba(100, 149, 237, 0.08) 24px, rgba(100, 149, 237, 0.08) 25px);
  pointer-events: none;
  z-index: 0;
}

/* ========== 顶部渐变头部 ========== */
.header-banner {
  position: relative;
  background: linear-gradient(135deg, #0f2544 0%, #1a365d 40%, #2a9d8f 100%);
  padding: 50px 24px 120px;
  overflow: hidden;
}

.header-banner::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 80px;
  background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
}

.header-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.1;
  margin-bottom: 12px;
  position: relative;
  z-index: 1;
}

.header-title .pink { color: var(--pink); }
.header-title .white { color: #ffffff; }

.header-subtitle {
  color: rgba(255,255,255,0.9);
  font-size: 16px;
  position: relative;
  z-index: 1;
}

.header-act-sub {
  color: var(--pink-light);
  font-size: 14px;
  margin-top: 10px;
  position: relative;
  z-index: 1;
}

.rank-btn-top {
  position: absolute;
  top: 50px;
  right: 24px;
  z-index: 2;
  padding: 10px 24px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 999px;
  color: #fff;
  font-size: 15px;
  background: transparent;
  cursor: pointer;
}

/* ========== 主内容区 ========== */
.main-content {
  position: relative;
  z-index: 1;
  padding: 0 16px 40px;
}

/* ========== 卡片通用样式 ========== */
.card {
  background: var(--card);
  border-radius: 24px;
  padding: 24px 20px;
  margin-bottom: 20px;
  position: relative;
  box-shadow:
    0 8px 24px rgba(26, 54, 93, 0.10),
    0 2px 6px rgba(26, 54, 93, 0.06);
}

/* 标题装饰：——◆ 标题 ◆—— */
.section-title {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.section-title::before,
.section-title::after {
  content: '';
  width: 40px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--teal));
}

.section-title::after {
  background: linear-gradient(90deg, var(--teal), transparent);
}

.section-title .diamond {
  color: var(--teal);
  font-size: 14px;
}

/* ========== 进度卡片 ========== */
.progress-card {
  text-align: center;
}

.progress-label {
  font-size: 18px;
  color: var(--text-dark);
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-number {
  font-size: 72px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 20px;
  font-family: "DIN Alternate", "Helvetica Neue", monospace;
}

.progress-bar-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.flag-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.progress-bar {
  flex: 1;
  height: 36px;
  background: var(--teal);
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 16px;
}

.progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  color: var(--text-body);
}

.progress-info .team { font-weight: 500; }
.progress-info .time { font-family: "DIN Alternate", monospace; font-weight: 600; }

/* ========== 打卡点网格 ========== */
.check-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.check-item {
  aspect-ratio: 1;
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border: 2px solid var(--border-gray);
  background: #fff;
  position: relative;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.05);
  transition: all 0.2s ease;
}

.check-item .point-name {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-dark);
}

.check-item .point-cname {
  font-size: 10px;
  color: var(--text-gray);
  max-width: 92%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.check-item .point-status {
  font-size: 12px;
  color: var(--text-gray);
}

/* 已完成状态：填充青绿色 */
.check-item.completed-filled {
  background: var(--teal);
  border-color: var(--teal);
}

.check-item.completed-filled .point-name,
.check-item.completed-filled .point-cname,
.check-item.completed-filled .point-status {
  color: #fff;
}

/* 已打卡状态：青绿色边框 */
.check-item.completed-bordered {
  border-color: var(--teal);
}

.check-item.completed-bordered .point-status {
  color: var(--teal);
}

/* ========== 活动规则 ========== */
.rule-text {
  font-size: 15px;
  line-height: 1.8;
  color: var(--text-body);
}

/* ========== 主按钮 ========== */
.btn-primary {
  display: block;
  width: 100%;
  padding: 18px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
}

.btn-outline {
  display: block;
  width: 100%;
  padding: 18px;
  background: transparent;
  color: var(--navy);
  border: 2px solid var(--navy);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  margin-top: 8px;
}

/* ========== 排行榜页面 ========== */
.rank-header {
  background: linear-gradient(135deg, #0f2544 0%, #1a365d 100%);
  padding: 50px 24px 100px;
  position: relative;
  overflow: hidden;
}

.rank-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
}

.rank-title {
  font-size: 36px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
}

.close-btn {
  position: absolute;
  top: 50px;
  right: 24px;
  z-index: 2;
  width: 44px;
  height: 44px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 我的成绩卡片 */
.my-score-card {
  position: relative;
  z-index: 1;
  margin-top: -60px;
}

.my-score-title {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 16px;
}

.my-score-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 16px;
}

.my-score-row .label {
  color: var(--text-body);
}

.my-score-row .value {
  font-weight: 600;
  color: var(--text-dark);
}

.flag-corner {
  position: absolute;
  right: 20px;
  bottom: 20px;
  width: 32px;
  height: 32px;
}

/* TOP3 卡片 */
.top3-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 20px;
}

.top-card {
  border-radius: 20px;
  padding: 16px 10px;
  text-align: center;
  position: relative;
  box-shadow: 0 6px 20px rgba(26, 54, 93, 0.12);
}

.top-card.rank1 {
  background: var(--navy);
  color: #fff;
}

.top-card.rank2,
.top-card.rank3 {
  background: var(--pink-light);
  color: #fff;
}

.top-rank-label {
  font-size: 18px;
  font-weight: 700;
  margin-bottom: 8px;
}

.top-team-name {
  font-size: 14px;
  margin-bottom: 4px;
}

.top-time {
  font-size: 14px;
  opacity: 0.9;
}

/* 列表项 */
.rank-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rank-item {
  background: #fff;
  border-radius: 999px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 16px rgba(26, 54, 93, 0.08);
}

.rank-item.self {
  background: var(--pink-light);
}

.rank-item .team-name {
  font-weight: 600;
  color: var(--text-dark);
}

.rank-item .rank-info {
  font-size: 14px;
  color: var(--text-body);
}

/* ========== 弹窗遮罩 ========== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

/* 打卡成功弹窗 */
.success-popup {
  background: #fff;
  border-radius: 24px;
  padding: 60px 30px 30px;
  width: 100%;
  max-width: 340px;
  position: relative;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.badge-shield {
  position: absolute;
  top: -30px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: #fff;
  border: 3px solid var(--navy);
  border-radius: 12px 12px 50% 50% / 12px 12px 30% 30%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: var(--navy);
  font-size: 16px;
}

.success-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 12px;
}

.success-number {
  font-size: 72px;
  font-weight: 800;
  color: var(--navy);
  line-height: 1;
  margin-bottom: 20px;
  font-family: "DIN Alternate", monospace;
}

.success-cp-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--teal-dark);
  margin-bottom: 10px;
}

.success-cp-main {
  font-size: 30px;
  font-weight: 800;
  color: var(--navy);
  margin-bottom: 20px;
  line-height: 1.3;
  word-break: break-word;
}

.success-desc {
  font-size: 15px;
  color: var(--text-body);
  margin-bottom: 40px;
}

.btn-success {
  width: 100%;
  padding: 16px;
  background: var(--teal);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
}

/* 报名弹窗 */
.signup-popup {
  background: #fff;
  border-radius: 24px;
  padding: 40px 24px 30px;
  width: 100%;
  max-width: 340px;
  position: relative;
  border: 4px solid var(--navy);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2);
}

.flag-topper {
  position: absolute;
  top: -28px;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 40px;
}

.signup-title {
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.signup-subtitle {
  text-align: center;
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 24px;
}

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

.form-label {
  display: block;
  font-size: 15px;
  color: var(--text-body);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--navy);
  border-radius: 12px;
  font-size: 16px;
  outline: none;
  background: #fff;
}

.form-input::placeholder {
  color: var(--text-gray);
}

.btn-signup {
  width: 100%;
  padding: 16px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: 999px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 8px;
}

/* 页面切换 */
.page { display: none; }
.page.active { display: block; }

/* 隐藏弹窗 */
.hidden { display: none !important; }

/* ========== 管理端通用 ========== */
.admin-header {
  background: linear-gradient(135deg, #0f2544 0%, #1a365d 100%);
  padding: 50px 24px 70px;
  position: relative;
  overflow: hidden;
}

.admin-header::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 40px;
  background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
}

.admin-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  text-align: center;
  position: relative;
  z-index: 1;
}

.admin-subtitle {
  text-align: center;
  color: rgba(255,255,255,0.7);
  font-size: 13px;
  margin-top: 6px;
  position: relative;
  z-index: 1;
}

.back-btn {
  position: absolute;
  top: 50px;
  left: 20px;
  z-index: 2;
  width: 40px;
  height: 40px;
  border: 2px solid rgba(255,255,255,0.5);
  border-radius: 999px;
  background: transparent;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 管理端表单 */
.admin-form-group {
  margin-bottom: 18px;
}

.admin-form-label {
  display: block;
  font-size: 14px;
  color: var(--text-body);
  margin-bottom: 8px;
  font-weight: 500;
}

.admin-form-input {
  width: 100%;
  padding: 14px 16px;
  border: 2px solid var(--border-gray);
  border-radius: 12px;
  font-size: 15px;
  outline: none;
  background: #fff;
  transition: border-color 0.2s;
}

.admin-form-input:focus {
  border-color: var(--navy);
}

.admin-form-input::placeholder {
  color: var(--text-gray);
}

textarea.admin-form-input {
  resize: vertical;
  min-height: 80px;
}

/* 状态标签 */
.status-tag {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}

.status-wait { background: #eef2ff; color: var(--navy); }
.status-running { background: #d1fae5; color: #065f46; }
.status-end { background: #fee2e2; color: #991b1b; }

/* 活动列表项 */
.act-list-item {
  background: #fff;
  border-radius: 16px;
  padding: 18px 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.06);
}

.act-item-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.act-item-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-dark);
}

.act-item-subtitle {
  font-size: 13px;
  color: var(--text-body);
  margin: -2px 0 8px;
}

.act-item-meta {
  font-size: 13px;
  color: var(--text-gray);
  margin-bottom: 12px;
}

.act-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-weight: 500;
}

.btn-sm-primary { background: var(--navy); color: #fff; }
.btn-sm-outline { background: transparent; color: var(--navy); border: 1.5px solid var(--navy); }
.btn-sm-warning { background: #f59e0b; color: #fff; }
.btn-sm-success { background: var(--teal); color: #fff; }

/* 二维码网格 */
.qr-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.qr-item {
  background: #fff;
  border-radius: 12px;
  padding: 10px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.06);
}

.qr-placeholder {
  width: 100%;
  aspect-ratio: 1;
  background: #f1f5f9;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  border: 2px dashed #cbd5e1;
  color: var(--text-gray);
  font-size: 12px;
}

.qr-no {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
}

.qr-status {
  font-size: 11px;
  color: var(--text-gray);
}

.qr-status.bound { color: var(--teal-dark); }

/* 打卡点绑定行 */
.point-bind-row {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border-gray);
}

.point-bind-row:last-child { border-bottom: none; }

.point-bind-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.point-name-input {
  margin: 10px 0 6px;
  padding: 10px 12px;
  font-size: 14px;
}

.point-bind-name { font-weight: 600; color: var(--text-dark); }
.point-bind-qr { font-size: 12px; color: var(--text-gray); margin-top: 2px; }
.point-bind-qr.bound { color: var(--teal-dark); }

/* 管理端排行榜展开 */
.admin-rank-item {
  background: #fff;
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(26, 54, 93, 0.06);
}

.admin-rank-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
}

.admin-rank-team { font-weight: 600; color: var(--text-dark); font-size: 15px; }
.admin-rank-meta { font-size: 13px; color: var(--text-gray); margin-top: 2px; }

.expand-icon {
  font-size: 18px;
  color: var(--text-gray);
  transition: transform 0.2s;
}

.expand-icon.open { transform: rotate(180deg); }

.admin-rank-detail {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-gray);
  display: none;
}

.admin-rank-detail.open { display: block; }

.detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 6px 0;
  color: var(--text-body);
}

.detail-row .pt { font-weight: 500; }

/* 管理端底部Tab */
.admin-tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 420px;
  background: #fff;
  border-top: 1px solid var(--border-gray);
  display: flex;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
}

.admin-tab {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--text-gray);
  cursor: pointer;
  padding: 4px 0;
}

.admin-tab.active { color: var(--navy); font-weight: 600; }
.admin-tab .tab-icon { font-size: 20px; display: block; margin-bottom: 2px; }

/* 管理端内容区底部留白 */
.admin-content {
  position: relative;
  z-index: 1;
  padding: 0 16px 80px;
  margin-top: -40px;
}

/* ===== 活动注册码弹窗 ===== */
.code-line {
  font-size: 15px;
  color: var(--text-body);
  text-align: center;
  margin-bottom: 8px;
}

.code-line b { color: var(--navy); letter-spacing: 1px; }

.copy-btn {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--teal);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}

.code-url {
  font-size: 12px;
  color: var(--text-gray);
  text-align: center;
  word-break: break-all;
}

/* ===== 单页应用滚动适配 ===== */
.phone-frame{overflow:visible;}
#app{min-height:100vh;}
