/* 手机端样式 - 竞技赛事签到系统(还原原型蓝色小程序风格) */
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { font-size: 16px; }
body {
    font-family: "PingFang SC", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    background: #f4f6fa;
    color: #2b3a4d;
    min-height: 100vh;
    padding-bottom: 70px;
}
img { display: block; }
a { text-decoration: none; color: inherit; }

/* ===== 顶部导航(仿小程序胶囊) ===== */
.m-nav {
    background: linear-gradient(135deg, #1f6feb 0%, #3d8bff 60%, #4a9fff 100%);
    color: #fff;
    padding: 14px 14px 16px;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 50;
    box-shadow: 0 4px 14px rgba(31, 111, 235, .25);
}
.m-nav .nav-back {
    width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
    font-size: 22px; color: #fff; border-radius: 50%;
}
.m-nav .nav-title { flex: 1; text-align: center; font-size: 17px; font-weight: 600; letter-spacing: .5px; }
.m-nav .nav-capsule {
    display: flex; align-items: center; gap: 10px;
    border: 1px solid rgba(255, 255, 255, .55); border-radius: 16px;
    padding: 4px 12px; font-size: 13px; color: #fff;
}
.m-nav .nav-capsule .dot { font-size: 16px; letter-spacing: 2px; }
.m-nav .nav-capsule .ring {
    width: 12px; height: 12px; border: 1.6px solid #fff; border-radius: 50%;
    position: relative;
}
.m-nav .nav-capsule .ring::after {
    content: ""; position: absolute; inset: 2.5px; background: #fff; border-radius: 50%;
}

/* ===== 赛事卡片 ===== */
.event-list { padding: 14px 12px; }
.event-card {
    display: flex;
    background: #fff;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 14px;
    box-shadow: 0 2px 10px rgba(30, 60, 120, .06);
}
.event-card .ev-cover {
    width: 116px; height: 128px; border-radius: 10px; object-fit: cover; flex-shrink: 0;
    background: #e8edf5;
}
.event-card .ev-body { flex: 1; margin-left: 12px; min-width: 0; }
.event-card .ev-name {
    font-size: 16px; font-weight: 700; color: #1c2b3a; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    margin-bottom: 8px;
}
.tag-row { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tag {
    display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 5px; line-height: 1.6;
}
.tag-blue { background: #2f7cf6; color: #fff; }
.tag-green { background: #22b07d; color: #fff; }
.tag-gray { background: #9aa5b1; color: #fff; }
.tag-red { background: #f0506e; color: #fff; }
.tag-orange { background: #ff8f1f; color: #fff; }
.tag-outline { background: #fff; color: #2f7cf6; border: 1px solid #7fb0f9; }
.ev-info { font-size: 12.5px; color: #7c8794; line-height: 1.9; }
.ev-info .row { display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-info svg { width: 13px; height: 13px; flex-shrink: 0; fill: #a4b0be; }

/* ===== 空状态 ===== */
.empty {
    text-align: center; padding: 70px 20px; color: #8a97a8; font-size: 14px;
}
.empty img { width: 150px; margin: 0 auto 18px; opacity: .9; }

/* ===== 详情页 ===== */
.detail-head {
    background: #fff; padding: 16px 14px; display: flex; gap: 12px;
}
.detail-head .ev-cover { width: 108px; height: 120px; border-radius: 10px; object-fit: cover; background: #e8edf5; }
.detail-head .ev-name { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 8px; }
.section {
    background: #fff; margin-top: 10px; padding: 16px 14px;
}
.section-title {
    font-size: 16px; font-weight: 700; color: #1c2b3a; margin-bottom: 14px;
    display: flex; align-items: center; justify-content: space-between;
}
.section-title .link { font-size: 13px; color: #2f7cf6; font-weight: 400; display: flex; align-items: center; gap: 3px; }
.info-grid { display: flex; align-items: center; justify-content: space-around; padding: 6px 0 2px; }
.info-grid .cell { flex: 1; min-width: 0; text-align: center; }
.info-grid .cell .num { font-size: 24px; font-weight: 700; color: #1c2b3a; }
.info-grid .cell .lbl { font-size: 12px; color: #7c8794; margin-top: 4px; }
.info-grid img.medal { width: 64px; flex: 0 0 64px; margin: 0 4px; }

.kv-list .kv {
    display: flex; font-size: 14px; padding: 9px 0; line-height: 1.6;
}
.kv-list .kv .k { width: 92px; color: #8a97a8; flex-shrink: 0; }
.kv-list .kv .v { flex: 1; color: #2b3a4d; }

.member-avatars { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.member-chip {
    display: inline-flex; align-items: center; gap: 6px; background: #f2f6fd;
    border-radius: 18px; padding: 5px 12px 5px 6px; font-size: 13px; color: #2b3a4d;
    max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.member-chip i {
    width: 26px; height: 26px; border-radius: 50%; background: linear-gradient(135deg, #1f6feb, #4a9fff);
    color: #fff; font-style: normal; font-size: 12px; display: inline-flex; align-items: center; justify-content: center;
}
.member-chip .done { color: #22b07d; font-size: 12px; }
.member-chip .undone { color: #9aa5b1; font-size: 12px; }

/* ===== 底部按钮条 ===== */
.bottom-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: #fff; padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    box-shadow: 0 -2px 12px rgba(30, 60, 120, .08);
    display: flex; gap: 10px;
}
.btn-primary {
    flex: 1; height: 46px; border: none; border-radius: 23px;
    background: linear-gradient(135deg, #1f6feb, #3d8bff); color: #fff;
    font-size: 16px; font-weight: 600; cursor: pointer;
    box-shadow: 0 6px 14px rgba(31, 111, 235, .3);
}
.btn-primary:disabled { background: #b8c4d2; box-shadow: none; }
.btn-outline {
    flex: 1; height: 46px; border-radius: 23px; border: 1px solid #2f7cf6;
    background: #fff; color: #2f7cf6; font-size: 15px; cursor: pointer;
}
.btn-danger-outline {
    flex: 1; height: 46px; border-radius: 23px; border: 1px solid #f0506e;
    background: #fff; color: #f0506e; font-size: 15px; cursor: pointer;
}

/* ===== 表单 ===== */
.form-card { background: #fff; margin-top: 10px; padding: 6px 14px 16px; }
.form-item { padding: 12px 0; border-bottom: 1px solid #f0f4f9; }
.form-item:last-child { border-bottom: none; }
.form-item label { display: block; font-size: 14px; color: #46586c; margin-bottom: 8px; font-weight: 600; }
.form-item label b { color: #f0506e; margin-right: 2px; }
.form-item input[type="text"], .form-item input[type="tel"], .form-item select {
    width: 100%; height: 44px; border: 1px solid #dde4ec; border-radius: 10px;
    padding: 0 12px; font-size: 14px; outline: none; background: #fafbfd;
}
.form-item input:focus, .form-item select:focus { border-color: #2f7cf6; background: #fff; }
.gender-row { display: flex; gap: 10px; }
.gender-row label {
    flex: 1; height: 40px; border: 1px solid #dde4ec; border-radius: 10px;
    display: flex; align-items: center; justify-content: center; font-size: 14px;
    color: #46586c; font-weight: 400; cursor: pointer; margin: 0; background: #fafbfd;
}
.gender-row input { display: none; }
.gender-row input:checked + label, .gender-row label.on {
    border-color: #2f7cf6; color: #2f7cf6; background: #eef5ff; font-weight: 600;
}

.group-picker { display: flex; flex-direction: column; gap: 10px; }
.group-option {
    border: 1px solid #dde4ec; border-radius: 12px; padding: 12px 14px;
    display: flex; align-items: center; justify-content: space-between; cursor: pointer;
    background: #fafbfd;
}
.group-option.on { border-color: #2f7cf6; background: #eef5ff; box-shadow: 0 0 0 2px rgba(47, 124, 246, .12); }
.group-option .g-name { font-size: 15px; font-weight: 600; }
.group-option .g-meta { font-size: 12px; color: #8a97a8; margin-top: 4px; }
.group-option .g-fee { font-size: 15px; color: #f0506e; font-weight: 700; }
.group-option.full { opacity: .5; }

.member-edit-row { display: flex; gap: 8px; margin-bottom: 8px; }
.member-edit-row input { flex: 1; height: 40px; border: 1px solid #dde4ec; border-radius: 10px; padding: 0 10px; font-size: 13px; background: #fafbfd; }
.member-edit-row .del {
    width: 40px; height: 40px; border: none; border-radius: 10px; background: #fdeef1; color: #f0506e; font-size: 16px; cursor: pointer;
}
.btn-add-member {
    width: 100%; height: 40px; border: 1px dashed #9db9e8; border-radius: 10px;
    background: #f5f9ff; color: #2f7cf6; font-size: 14px; cursor: pointer;
}

/* ===== 运动码页 ===== */
.code-hero {
    background-size: cover; background-position: center top;
    padding: 0 14px; position: relative; height: 190px;
}
.code-card {
    background: #fff; border-radius: 16px; margin: -120px 14px 0; position: relative;
    padding: 22px 18px 26px; text-align: center;
    box-shadow: 0 8px 24px rgba(30, 60, 120, .12);
}
.code-card h2 { font-size: 18px; color: #1c2b3a; margin-bottom: 4px; }
.code-card .code-user { font-size: 13px; color: #8a97a8; margin-bottom: 16px; }
.code-card .qrcode-box {
    width: 220px; height: 220px; margin: 0 auto 12px; padding: 10px;
    border: 1px solid #eef2f7; border-radius: 12px;
}
.code-card .qrcode-box img, .code-card .qrcode-box canvas { width: 100% !important; height: 100% !important; }
.code-card .code-num { font-size: 18px; letter-spacing: 3px; color: #1c2b3a; font-weight: 700; }
.code-tip {
    margin: 14px; background: #eaf3ff; border-radius: 12px; padding: 14px 16px;
    font-size: 13px; color: #5a7ca8; line-height: 1.9;
}
.code-tip b { color: #2b5a8c; }

/* ===== 我的 ===== */
.my-hero {
    background-size: cover; background-position: center;
    padding: 26px 18px 46px; display: flex; align-items: center; gap: 14px;
}
.my-hero .avatar {
    width: 64px; height: 64px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, .8);
    object-fit: cover; background: #f4e8d8;
}
.my-hero .my-name { font-size: 19px; font-weight: 700; color: #4a3b28; }
.my-hero .my-phone { font-size: 13px; color: #8a7a63; margin-top: 3px; }
.my-hero .verified {
    display: inline-flex; align-items: center; gap: 4px; margin-top: 6px;
    background: rgba(255, 255, 255, .55); border: 1px solid rgba(190, 160, 110, .4);
    color: #8a6d3b; font-size: 11px; padding: 2px 10px; border-radius: 12px;
}
.service-card {
    background: #fff; border-radius: 14px; margin: -28px 12px 0; padding: 18px 14px 8px;
    box-shadow: 0 2px 10px rgba(30, 60, 120, .06); position: relative;
}
.service-card h3 { font-size: 16px; margin-bottom: 12px; }
.service-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.service-grid a {
    display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 10px 0 16px; font-size: 12px; color: #46586c; min-width: 0;
}
.service-grid .svc-icon {
    width: 42px; height: 42px; border-radius: 13px;
    background: linear-gradient(135deg, #eef5ff, #dceaff);
    display: flex; align-items: center; justify-content: center;
}
.service-grid .svc-icon svg { width: 24px; height: 24px; fill: #2f7cf6; }
.service-grid .svc-icon.gold { background: linear-gradient(135deg, #fdf3e3, #fbe7c8); }
.service-grid .svc-icon.gold svg { fill: #c8973f; }
.service-grid .svc-icon.green { background: linear-gradient(135deg, #e6f9f1, #d2f3e4); }
.service-grid .svc-icon.green svg { fill: #22b07d; }
.service-grid .svc-icon.purple { background: linear-gradient(135deg, #f3edff, #e6dcff); }
.service-grid .svc-icon.purple svg { fill: #7a5af5; }

/* ===== 登录卡片 ===== */
.login-card { margin: 30px 14px; background: #fff; border-radius: 14px; padding: 24px 18px; }
.login-card h3 { text-align: center; margin-bottom: 18px; font-size: 17px; }

/* ===== 底部 TabBar ===== */
.tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 70;
    background: #fff; display: flex; height: 60px;
    box-shadow: 0 -2px 12px rgba(30, 60, 120, .1);
    padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    font-size: 11px; color: #9aa5b1; gap: 3px;
}
.tabbar a svg { width: 22px; height: 22px; fill: #9aa5b1; }
.tabbar a.on { color: #2f7cf6; }
.tabbar a.on svg { fill: #2f7cf6; }
.tabbar a.tab-code { position: relative; }
.tabbar a.tab-code .code-btn {
    width: 50px; height: 50px; border-radius: 50%; margin-top: -26px;
    background: linear-gradient(135deg, #1f6feb, #3d8bff);
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 6px 14px rgba(31, 111, 235, .4); border: 3px solid #fff;
}
.tabbar a.tab-code .code-btn svg { width: 24px; height: 24px; fill: #fff; }

/* ===== Toast / 弹层 ===== */
.toast {
    position: fixed; left: 50%; top: 45%; transform: translate(-50%, -50%);
    background: rgba(20, 30, 45, .88); color: #fff; font-size: 14px;
    padding: 12px 20px; border-radius: 10px; z-index: 999; max-width: 78%;
    text-align: center; line-height: 1.6;
}
.mask {
    position: fixed; inset: 0; top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 25, 40, .55); z-index: 90; display: flex; align-items: flex-end;
}
.sheet {
    background: #fff; width: 100%; border-radius: 18px 18px 0 0; padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    max-height: 76vh; overflow-y: auto;
}
.sheet h3 { font-size: 16px; text-align: center; margin-bottom: 16px; }
