/* ============================================================
   竞技宝 - 全局样式（移动端 / 响应式）
   ============================================================ */
:root {
    --app-max: 480px;
    --blue: #2E6DB4;
    --blue-dark: #265e9c;
    --primary-grad: linear-gradient(180deg, #4a86c9 0%, #3a6fb5 100%);
    --app-bg-top: #bfe0f7;
    --app-bg-bottom: #eaf4fc;
    --card: #ffffff;
    --text: #1f2430;
    --text-dim: #8a93a3;
    --radius: 16px;
    --shadow: 0 6px 18px rgba(40, 90, 150, .10);
    --nav-h: 60px;
}

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

html, body {
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
        "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
    color: var(--text);
    background: #d6e7f5;
}

body { display: flex; justify-content: center; }

img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }

/* ---------- 移动端容器 ---------- */
.app {
    position: relative;
    width: 100%;
    max-width: var(--app-max);
    min-height: 100vh;
    min-height: 100dvh;
    overflow-x: hidden;
    background: linear-gradient(180deg, var(--app-bg-top) 0%, var(--app-bg-bottom) 28%, #f3f8fd 100%);
}
.app.has-nav { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px)); }

/* ============================================================
   登录 / 注册
   ============================================================ */
.auth {
    min-height: 100vh; min-height: 100dvh;
    background: url("../images/auth-bg.png") center top / cover no-repeat, #2f6fc2;
    display: flex; flex-direction: column; justify-content: center;
    padding: 40px 22px;
}
.auth__title {
    color: #fff; font-size: 34px; font-weight: 800; letter-spacing: 4px;
    text-align: center; margin-bottom: 28px;
    text-shadow: 0 3px 10px rgba(0, 0, 0, .25);
}
.auth__card {
    background: #fff; border-radius: 22px;
    padding: 26px 22px 30px; box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
}
.auth__tabs { display: flex; gap: 30px; margin-bottom: 22px; }
.auth__tab {
    font-size: 19px; font-weight: 700; color: #9aa3b2; position: relative; padding-bottom: 8px;
}
.auth__tab.active { color: var(--blue); }
.auth__tab.active::after {
    content: ""; position: absolute; left: 50%; transform: translateX(-50%);
    bottom: 0; width: 46px; height: 4px; border-radius: 2px; background: var(--blue);
}
.field {
    display: flex; align-items: center; gap: 10px;
    background: #f1f2f4; border-radius: 12px; padding: 0 14px;
    height: 52px; margin-bottom: 14px;
}
.field svg { width: 22px; height: 22px; flex: none; color: #59616e; }
.field label { font-size: 16px; font-weight: 600; color: #3a414e; white-space: nowrap; }
.field input {
    flex: 1; border: none; outline: none; background: transparent;
    font-size: 15px; color: #2a2f3a; min-width: 0;
}
.field input::placeholder { color: #b5bcc7; }
.btn-primary {
    width: 100%; height: 52px; margin-top: 10px;
    background: var(--primary-grad); color: #fff;
    font-size: 18px; font-weight: 700; border-radius: 12px;
    box-shadow: 0 8px 18px rgba(58, 111, 181, .35);
}
.btn-primary:active { transform: translateY(1px); }

/* ============================================================
   通用：顶部条 / 标题栏
   ============================================================ */
.statusbar { height: env(safe-area-inset-top, 0px); }

.topbar {
    display: flex; align-items: center; gap: 10px;
    padding: 14px 16px 12px;
}
.topbar__logo { font-size: 21px; font-weight: 900; color: #16324f; letter-spacing: 1px; }
.topbar__mail {
    flex: 1; font-size: 12px; color: #2c3e52; opacity: .8;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.icon-btn {
    width: 38px; height: 38px; border-radius: 50%; flex: none;
    display: flex; align-items: center; justify-content: center; color: #16324f;
}
.icon-btn svg { width: 24px; height: 24px; }

/* 子页面标题栏（交易明细 / 设置） */
.headerbar {
    position: sticky; top: 0; z-index: 20;
    display: flex; align-items: center; height: 50px;
    padding: 0 8px; background: var(--primary-grad); color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.headerbar__back { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; color: #fff; }
.headerbar__back svg { width: 24px; height: 24px; }
.headerbar__title { flex: 1; text-align: center; font-size: 18px; font-weight: 700; }
.headerbar__spacer { width: 44px; }

/* ============================================================
   首页
   ============================================================ */
.section { padding: 0 16px; }
.banner { border-radius: 14px; overflow: hidden; margin: 4px 16px 0; box-shadow: var(--shadow); }
.banner img { width: 100%; }

/* 账户行 */
.acct {
    display: flex; align-items: center; gap: 12px;
    margin: 16px 16px 0; padding: 6px 2px;
}
.acct__avatar {
    width: 62px; height: 62px; border-radius: 50%; flex: none;
    background: radial-gradient(circle at 50% 35%, #cdd9e6, #aab8c9);
    display: flex; align-items: flex-end; justify-content: center; overflow: hidden;
    border: 2px solid #fff; box-shadow: var(--shadow); color: #7d8b9c;
}
.acct__avatar svg { width: 44px; height: 44px; }
.acct__info { flex: 1; min-width: 0; }
.acct__title { font-size: 18px; font-weight: 800; color: #1d2a3a; }
.acct__sub { font-size: 12px; color: #6b7686; margin-top: 3px; }

/* 快捷入口 */
.quick { display: flex; }
.quick--home { gap: 6px; }
.qa { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: 1; }
.qa__icon {
    width: 50px; height: 50px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; color: #fff;
    box-shadow: 0 6px 14px rgba(0, 0, 0, .12);
}
.qa__icon svg { width: 28px; height: 28px; }
.qa__label { font-size: 13px; color: #2c3a4c; font-weight: 600; }
.g-orange { background: linear-gradient(135deg, #ffb241, #ff7f11); }
.g-blue   { background: linear-gradient(135deg, #5aa0ff, #2f6fe0); }
.g-cyan   { background: linear-gradient(135deg, #38cce8, #14a7d6); }
.g-red    { background: linear-gradient(135deg, #ff7a7a, #e83b3b); }
.g-purple { background: linear-gradient(135deg, #b07cff, #7b46e0); }
.g-green  { background: linear-gradient(135deg, #57d39a, #28a96f); }
.g-teal   { background: linear-gradient(135deg, #4fd6c4, #1fb0a0); }
.g-pink   { background: linear-gradient(135deg, #ff8fb3, #f0588a); }
.g-gold   { background: linear-gradient(135deg, #ffcf6a, #f0a020); }
.g-indigo { background: linear-gradient(135deg, #7aa0ff, #4763e0); }

/* 体育列表卡片 */
.sport-card {
    position: relative; margin: 14px 16px 0; height: 116px;
    border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
    background: #eef3fa;
}
.sport-card img.bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.sport-card__inner { position: relative; display: flex; align-items: center; gap: 12px; padding: 16px 18px; height: 100%; }
.sport-card__logo { width: 46px; height: 46px; flex: none; object-fit: contain; }
.sport-card__txt .cn { font-size: 19px; font-weight: 800; color: #1f2a3a; display: flex; align-items: center; gap: 8px; }
.sport-card__txt .en { font-size: 12px; color: #5a6678; font-weight: 700; margin-top: 4px; letter-spacing: 1px; }
.hot { font-size: 11px; }

/* ============================================================
   我的
   ============================================================ */
.mine-hero {
    display: flex; align-items: center; gap: 14px;
    background: #fff; margin: 6px 16px 0; padding: 16px;
    border-radius: var(--radius); box-shadow: var(--shadow);
}
.mine-hero__avatar {
    width: 58px; height: 58px; border-radius: 50%; flex: none;
    background: radial-gradient(circle at 50% 35%, #d7e0ea, #b3c0d0);
    display: flex; align-items: flex-end; justify-content: center; overflow: hidden; color: #889;
}
.mine-hero__avatar svg { width: 42px; height: 42px; }
.mine-hero__info { flex: 1; }
.mine-hero__hi { font-size: 14px; color: #6b7686; }
.mine-hero__name { font-size: 18px; font-weight: 800; color: #1d2a3a; margin-top: 2px; }
.mine-hero__login {
    background: linear-gradient(135deg, #9cc0ec, #6f9fd8); color: #fff;
    font-size: 14px; font-weight: 700; padding: 8px 14px; border-radius: 16px 16px 16px 4px;
    white-space: nowrap;
}

.member-banner {
    position: relative; margin: 14px 16px 0; height: 64px;
    border-radius: 12px; overflow: hidden; box-shadow: var(--shadow);
    display: flex; align-items: center;
}
.member-banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.member-banner__txt { position: relative; padding-left: 16px; font-size: 17px; font-weight: 800; color: #6a4a14; flex: 1; }
.member-banner__btn {
    position: relative; margin-right: 12px; background: rgba(255, 255, 255, .35);
    border: 1px solid rgba(120, 80, 20, .35); color: #5c3f10; font-weight: 700;
    font-size: 13px; padding: 6px 12px; border-radius: 16px;
}

.panel { background: #fff; margin: 14px 16px 0; border-radius: var(--radius); padding: 18px 8px; box-shadow: var(--shadow); }
.quick--mine { padding: 4px 6px; }

.bank-card {
    position: relative; margin: 14px 16px 0; height: 96px; border-radius: 14px;
    overflow: hidden; box-shadow: var(--shadow); color: #f3e3c0;
}
.bank-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bank-card__row { position: relative; display: flex; align-items: center; height: 50%; padding: 0 16px; }
.bank-card__name { font-size: 18px; font-weight: 800; color: #ffe9b8; flex: 1; }
.bank-card__detail { font-size: 12px; color: #ffe9b8; opacity: .85; }
.bank-card__sub { font-size: 13px; color: #ffe9b8; flex: 1; }
.bank-card__btn {
    background: linear-gradient(135deg, #ffe19a, #f0b53e); color: #5a3d05;
    font-weight: 800; font-size: 13px; padding: 6px 14px; border-radius: 16px;
}

/* 功能宫格 */
.grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px 4px;
}
.gitem { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.gitem__icon {
    width: 46px; height: 46px; border-radius: 14px;
    display: flex; align-items: center; justify-content: center; color: #fff;
}
.gitem__icon svg { width: 26px; height: 26px; }
.gitem__label { font-size: 13px; color: #2c3a4c; font-weight: 600; }

/* ============================================================
   交易明细 / 设置 子页
   ============================================================ */
.subpage { min-height: 100vh; min-height: 100dvh; background: linear-gradient(180deg, #dcebf8, #f3f8fd 30%); }
.subpage__body { padding: 16px; }

.empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 90px 0 40px; color: #9aa6b5; gap: 14px;
}
.empty svg { width: 76px; height: 76px; opacity: .5; }
.empty p { font-size: 15px; }

/* 设置项 */
.settings-group { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 16px; }
.settings-group__title { font-size: 13px; color: #8a93a3; padding: 14px 16px 6px; }
.srow {
    display: flex; align-items: center; gap: 12px; padding: 15px 16px;
    border-top: 1px solid #f1f3f6;
}
.srow:first-child { border-top: none; }
.srow__icon { width: 34px; height: 34px; border-radius: 9px; display: flex; align-items: center; justify-content: center; color: #fff; flex: none; }
.srow__icon svg { width: 20px; height: 20px; }
.srow__label { flex: 1; font-size: 15px; color: #2a3340; }
.srow__value { font-size: 14px; color: #9aa6b5; }
.srow__chev { color: #c4ccd6; width: 18px; height: 18px; }

/* 开关 */
.switch { position: relative; width: 48px; height: 28px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
    position: absolute; inset: 0; background: #d5dbe3; border-radius: 999px; transition: .25s;
}
.switch .track::before {
    content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px;
    background: #fff; border-radius: 50%; transition: .25s; box-shadow: 0 1px 3px rgba(0, 0, 0, .25);
}
.switch input:checked + .track { background: var(--blue); }
.switch input:checked + .track::before { transform: translateX(20px); }

/* ============================================================
   底部导航
   ============================================================ */
.bottom-nav {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: var(--app-max);
    height: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #fff; border-top: 1px solid #eef1f5;
    display: flex; z-index: 50; box-shadow: 0 -3px 12px rgba(40, 90, 150, .07);
}
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; }
.nav-item img { width: 30px; height: 30px; object-fit: contain; }
.nav-item span { font-size: 11px; color: #97a1b0; }
.nav-item.active span { color: var(--blue); font-weight: 700; }

/* ============================================================
   自定义弹窗
   ============================================================ */
.modal-mask {
    position: fixed; inset: 0; background: rgba(20, 30, 45, .45);
    display: flex; align-items: center; justify-content: center; z-index: 999;
    opacity: 0; pointer-events: none; transition: opacity .2s;
    padding: 0 40px;
}
.modal-mask.show { opacity: 1; pointer-events: auto; }
.modal {
    width: 100%; max-width: 300px; background: #fff; border-radius: 16px;
    padding: 26px 20px 0; text-align: center; transform: scale(.92); transition: transform .2s;
}
.modal-mask.show .modal { transform: scale(1); }
.modal__icon {
    width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 14px;
    display: flex; align-items: center; justify-content: center;
    background: #fdeaea; color: #e23b3b;
}
.modal__icon svg { width: 32px; height: 32px; }
.modal__msg { font-size: 16px; color: #2a3340; line-height: 1.5; padding-bottom: 22px; }
.modal__btn {
    width: 100%; height: 50px; border-top: 1px solid #f0f2f5;
    color: var(--blue); font-size: 17px; font-weight: 700;
}
