/* ==========================================================
   快乐蚂蚁射手榜 - 前台 H5 样式（移动优先）
   ========================================================== */
:root {
    --green: #0fa968;
    --green-2: #14c07c;
    --green-dark: #0a8352;
    --green-soft: #e6f7ef;
    --orange: #ff8a3d;
    --orange-soft: #fff2e7;
    --red: #e5484d;
    --red-soft: #fdecec;
    --blue: #3b82f6;
    --blue-soft: #eaf1fe;
    --ink: #16211c;
    --text: #26332c;
    --muted: #78857e;
    --bg: #f2f5f3;
    --card: #ffffff;
    --line: #e6ece9;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 4px 18px rgba(18, 45, 33, .07);
    --shadow-lg: 0 10px 30px rgba(18, 45, 33, .12);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg);
    color: var(--text);
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--green-dark); text-decoration: none; }
img { max-width: 100%; display: block; }

.app {
    max-width: 520px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--bg);
    padding-bottom: 84px;
    position: relative;
    overflow-x: hidden;
}

.page { padding: 0 14px 20px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: rgba(255, 255, 255, .92);
    backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid var(--line);
}

.topbar .tb-title { font-size: 17px; font-weight: 700; letter-spacing: .2px; }
.topbar .tb-sub { font-size: 12px; color: var(--muted); }
.topbar .tb-right { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.tb-back {
    width: 30px; height: 30px; border-radius: 50%;
    display: grid; place-items: center;
    background: var(--bg); color: var(--text);
    font-size: 16px; line-height: 1;
}

/* ---------------- 首页 Hero ---------------- */
.hero {
    margin: 12px 14px 0;
    padding: 20px 18px;
    border-radius: 20px;
    color: #fff;
    background: linear-gradient(135deg, #0a8352 0%, #0fa968 45%, #22c98a 100%);
    box-shadow: 0 12px 26px rgba(15, 169, 104, .28);
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    right: -40px; top: -50px;
    width: 170px; height: 170px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
}
.hero::before {
    content: "";
    position: absolute;
    right: 30px; bottom: -70px;
    width: 130px; height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
}
.hero h1 { margin: 0; font-size: 21px; letter-spacing: .5px; }
.hero .hero-sub { opacity: .88; font-size: 12.5px; margin-top: 2px; }
.hero-stats { display: flex; gap: 18px; margin-top: 16px; position: relative; z-index: 2; }
.hero-stats div span { display: block; font-size: 11.5px; opacity: .85; }
.hero-stats div b { font-size: 20px; font-weight: 700; }

/* ---------------- 卡片 ---------------- */
.card {
    background: var(--card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 16px;
    margin-bottom: 14px;
}
.card.tight { padding: 12px 14px; }
.card-flush { padding: 0; overflow: hidden; }

.card-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}
.card-head h3 { margin: 0; font-size: 15.5px; font-weight: 700; }
.card-head .more { margin-left: auto; font-size: 12.5px; color: var(--muted); }
.section-title {
    font-size: 14px; font-weight: 700; color: var(--muted);
    margin: 18px 2px 8px; letter-spacing: .5px;
}

/* ---------------- 按钮 ---------------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    padding: 10px 16px;
    border-radius: 999px;
    border: 1px solid transparent;
    background: var(--green);
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: .15s;
    line-height: 1.2;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green); box-shadow: 0 6px 16px rgba(15, 169, 104, .25); }
.btn-outline { background: #fff; color: var(--green-dark); border-color: var(--green); }
.btn-gray { background: #eef1ef; color: var(--text); }
.btn-danger { background: var(--red-soft); color: var(--red); }
.btn-orange { background: var(--orange); box-shadow: 0 6px 16px rgba(255, 138, 61, .25); }
.btn-sm { padding: 7px 13px; font-size: 13px; }
.btn-block { width: 100%; display: flex; }
.btn[disabled], .btn.disabled { background: #e6eae8; color: #9aa5a0; box-shadow: none; cursor: not-allowed; }

/* ---------------- 标签 ---------------- */
.badge {
    display: inline-block;
    padding: 2px 9px;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 600;
    line-height: 1.7;
}
.badge.green { background: var(--green-soft); color: var(--green-dark); }
.badge.blue { background: var(--blue-soft); color: #2563eb; }
.badge.orange { background: var(--orange-soft); color: #c2621a; }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.gray { background: #eef1ef; color: #6b7772; }

/* ---------------- 列表 ---------------- */
.list { margin: 0; padding: 0; list-style: none; }
.list-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: 0; }
.list-item .li-main { flex: 1; min-width: 0; }
.list-item .li-title { font-weight: 600; font-size: 14.5px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.list-item .li-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.list-item .li-right { text-align: right; font-size: 12.5px; color: var(--muted); white-space: nowrap; }

.avatar {
    width: 40px; height: 40px; flex: 0 0 40px;
    border-radius: 12px;
    display: grid; place-items: center;
    color: #fff; font-weight: 700; font-size: 16px;
}
.avatar.sm { width: 32px; height: 32px; flex-basis: 32px; border-radius: 10px; font-size: 13px; }

.jersey {
    min-width: 34px; height: 34px;
    border-radius: 10px;
    background: var(--green-soft);
    color: var(--green-dark);
    display: grid; place-items: center;
    font-weight: 800; font-size: 14px;
    font-variant-numeric: tabular-nums;
}

/* ---------------- 场次卡 ---------------- */
.match-card { position: relative; }
.match-card .mc-top { display: flex; align-items: flex-start; gap: 12px; }
.match-card .mc-date {
    flex: 0 0 66px;
    text-align: center;
    background: linear-gradient(160deg, #0fa968, #14c07c);
    color: #fff;
    border-radius: 12px;
    padding: 8px 4px;
}
.match-card .mc-date b { display: block; font-size: 21px; line-height: 1.1; }
.match-card .mc-date span { font-size: 11.5px; opacity: .9; }
.match-card .mc-info { flex: 1; min-width: 0; }
.match-card .mc-title { font-weight: 700; font-size: 15.5px; margin-bottom: 4px; }
.match-card .mc-meta { font-size: 12.5px; color: var(--muted); }
.match-card .mc-meta i { font-style: normal; color: var(--text); font-weight: 600; }
.match-card .mc-foot {
    display: flex; align-items: center; gap: 10px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px dashed var(--line);
}
.match-card .mc-foot .btn { margin-left: auto; }

/* ---------------- 进度条 ---------------- */
.progress { height: 6px; border-radius: 99px; background: #edf1ef; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, #14c07c, #0fa968); border-radius: 99px; }
.progress.orange i { background: linear-gradient(90deg, #ffb37a, #ff8a3d); }

/* ---------------- 数据格 ---------------- */
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.stat-grid.c3 { grid-template-columns: repeat(3, 1fr); }
.stat-grid.c2 { grid-template-columns: repeat(2, 1fr); }
.stat-item {
    background: #f7faf8;
    border-radius: 12px;
    padding: 10px 6px;
    text-align: center;
}
.stat-item b { display: block; font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--ink); }
.stat-item span { font-size: 11.5px; color: var(--muted); }
.stat-item.hl { background: var(--green-soft); }
.stat-item.hl b { color: var(--green-dark); }

/* ---------------- 表单 ---------------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 5px; }
.input, .select, .textarea {
    width: 100%;
    padding: 11px 13px;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    background: #fbfdfc;
    font-size: 15px;
    font-family: inherit;
    color: var(--text);
    outline: none;
    transition: .15s;
}
.input:focus, .select:focus, .textarea:focus {
    border-color: var(--green);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(15, 169, 104, .1);
}
.textarea { min-height: 76px; resize: vertical; line-height: 1.5; }
.field-row { display: flex; gap: 10px; }
.field-row > * { flex: 1; }

/* 录数据用的紧凑表单 */
.num-input { width: 100%; padding: 8px 4px; text-align: center; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; font-weight: 700; background: #fbfdfc; }

/* ---------------- 表格 ---------------- */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -16px; padding: 0 16px; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.tbl th, table.tbl td { padding: 9px 8px; text-align: left; white-space: nowrap; border-bottom: 1px solid var(--line); }
table.tbl th { font-size: 12px; color: var(--muted); font-weight: 600; background: #fafcfb; position: sticky; top: 0; }
table.tbl td.num, table.tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.tbl tr.me td { background: var(--green-soft); }
table.tbl tbody tr:last-child td { border-bottom: 0; }

/* ---------------- 排行榜 ---------------- */
.rank-row { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.rank-row:last-child { border-bottom: 0; }
.rank-no {
    width: 26px; height: 26px; flex: 0 0 26px;
    border-radius: 8px; display: grid; place-items: center;
    font-size: 12.5px; font-weight: 800; background: #f0f3f1; color: #77837d;
    font-variant-numeric: tabular-nums;
}
.rank-no.n1 { background: linear-gradient(135deg, #ffd76e, #f0a500); color: #fff; }
.rank-no.n2 { background: linear-gradient(135deg, #d7dee4, #9aa8b3); color: #fff; }
.rank-no.n3 { background: linear-gradient(135deg, #f0b995, #c47b45); color: #fff; }
.rank-row .rk-main { flex: 1; min-width: 0; }
.rank-row .rk-name { font-weight: 600; font-size: 14.5px; }
.rank-row .rk-sub { font-size: 12px; color: var(--muted); }
.rank-row .rk-val { text-align: right; }
.rank-row .rk-val b { font-size: 19px; font-weight: 800; color: var(--green-dark); font-variant-numeric: tabular-nums; }
.rank-row .rk-val span { display: block; font-size: 11.5px; color: var(--muted); }

/* ---------------- 选项卡 ---------------- */
.tabs {
    display: flex; gap: 6px; overflow-x: auto;
    padding: 4px; margin-bottom: 14px;
    background: #eaeff0; border-radius: 999px;
    scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
    flex: 1 0 auto;
    text-align: center;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 13.5px;
    color: #63706a;
    white-space: nowrap;
    font-weight: 600;
}
.tabs a.active { background: #fff; color: var(--green-dark); box-shadow: 0 2px 8px rgba(0, 0, 0, .06); }

/* ---------------- 底部导航 ---------------- */
.tabbar {
    position: fixed; bottom: 0; left: 0; right: 0;
    max-width: 520px; margin: 0 auto;
    display: flex;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(12px);
    border-top: 1px solid var(--line);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    z-index: 40;
}
.tabbar a {
    flex: 1;
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    font-size: 11px;
    color: #8d9993;
    padding: 4px 0;
}
.tabbar a.active { color: var(--green); font-weight: 700; }
.tabbar svg { width: 22px; height: 22px; }

/* ---------------- 空状态 / 提示 ---------------- */
.empty { text-align: center; color: var(--muted); padding: 38px 16px; font-size: 13.5px; }
.empty b { display: block; font-size: 15px; color: var(--text); margin-bottom: 4px; }

.toast {
    margin: 0 0 12px;
    padding: 11px 14px;
    border-radius: 12px;
    font-size: 13.5px;
    font-weight: 500;
}
.toast-ok { background: var(--green-soft); color: var(--green-dark); }
.toast-warn { background: var(--orange-soft); color: #c2621a; }
.toast-error { background: var(--red-soft); color: var(--red); }

.notice {
    font-size: 12.5px;
    color: #8a6d3b;
    background: #fff9e8;
    border: 1px solid #f6e6bd;
    border-radius: 12px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

/* ---------------- 接龙 ---------------- */
.relay { counter-reset: relay; }
.relay-item {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 0;
    border-bottom: 1px dashed var(--line);
}
.relay-item:last-child { border-bottom: 0; }
.relay-item .seq {
    width: 22px; height: 22px; flex: 0 0 22px;
    border-radius: 50%;
    background: var(--green-soft); color: var(--green-dark);
    font-size: 11.5px; font-weight: 800;
    display: grid; place-items: center;
}
.relay-item.me .seq { background: var(--green); color: #fff; }
.relay-item .rl-name { flex: 1; font-size: 14px; min-width: 0; }
.relay-item .rl-name em { font-style: normal; font-weight: 700; }
.relay-item .rl-tag { font-size: 11.5px; }

/* ---------------- 详情页信息行 ---------------- */
.info-line { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.info-line:last-child { border-bottom: 0; }
.info-line .lb { color: var(--muted); flex: 0 0 76px; font-size: 13.5px; }
.info-line .vl { flex: 1; font-weight: 500; }

.footer-note { text-align: center; color: #a6b0ab; font-size: 11.5px; padding: 18px 0 4px; }

@media (min-width: 560px) {
    body { background: #e9edeb; }
    .app { box-shadow: 0 0 40px rgba(0, 0, 0, .06); min-height: 100vh; }
    .tabbar { box-shadow: 0 -6px 20px rgba(0, 0, 0, .05); }
}
