/* RALLY 薄肌圈 · H5 design tokens */
:root {
    --bg: #0E0F0B;
    --bg-deep: #080906;
    --raised: #1B1E14;
    --raised-2: #242819;
    --line: #2C3122;
    --line-soft: #23261B;
    --text: #F7F8F3;
    --muted: #9AA08C;
    --faint: #6B7160;
    --accent: #C6F24E;
    --accent-ink: #14180A;
    --accent-soft: rgba(198, 242, 78, .12);
    --ai: #F97316;
    --ai-ink: #171006;
    --success: #4ADE80;
    --warning: #F5C542;
    --danger: #FF5A5F;
    --info: #6EC1FF;
    --gift: #FF7AB8;
    --gold: #E7C35A;
    --silver: #C4CBD3;
    --bronze: #CE8A5B;
    --r8: 8px;
    --r12: 12px;
    --r20: 20px;
    --r999: 999px;
    --page: 520px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg-deep);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font-family: inherit; font-size: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }

.app {
    width: 100%;
    max-width: var(--page);
    min-height: 100vh;
    margin: 0 auto;
    background: var(--bg);
    position: relative;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.app.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
.app.has-bottombar { padding-bottom: calc(76px + env(safe-area-inset-bottom)); }

.page { flex: 1; padding: 0 16px 24px; }
.page.flush { padding-left: 0; padding-right: 0; }

/* ---------- appbar ---------- */
.appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 10px;
    height: 52px;
    padding: 0 12px;
    background: rgba(14, 15, 11, .92);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line-soft);
}

.appbar.plain { background: var(--bg); border-bottom-color: transparent; }
.appbar .title { font-size: 16px; font-weight: 600; letter-spacing: .2px; flex: 1; text-align: center; }
.appbar .side { width: 72px; display: flex; align-items: center; gap: 8px; }
.appbar .side.right { justify-content: flex-end; }
.appbar .logo { font-weight: 800; letter-spacing: 2.4px; font-size: 17px; }
.appbar .logo b { color: var(--accent); }
.icon-btn {
    width: 32px; height: 32px; border-radius: var(--r999);
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent; border: 0; color: var(--text); position: relative;
}
.icon-btn:active { background: var(--raised); }
.icon-btn svg { width: 20px; height: 20px; }
.dot-badge {
    position: absolute; top: 4px; right: 3px; min-width: 8px; height: 8px;
    border-radius: var(--r999); background: var(--accent); border: 2px solid var(--bg);
}
.count-badge {
    position: absolute; top: 0; right: -2px; min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: var(--r999); background: var(--accent); color: var(--accent-ink);
    font-size: 10px; font-weight: 700; line-height: 16px; text-align: center;
}

/* ---------- typography ---------- */
.display { font-size: 40px; line-height: 1.1; font-weight: 800; letter-spacing: -1px; }
.h1 { font-size: 28px; line-height: 1.2; font-weight: 700; letter-spacing: -.4px; }
.h2 { font-size: 22px; line-height: 1.27; font-weight: 700; }
.h3 { font-size: 17px; line-height: 1.4; font-weight: 600; }
.body { font-size: 15px; line-height: 1.47; }
.caption { font-size: 11px; line-height: 1.27; letter-spacing: .4px; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.accent { color: var(--accent); }
.success { color: var(--success); }
.warning { color: var(--warning); }
.danger { color: var(--danger); }
.info { color: var(--info); }
.gift { color: var(--gift); }
.center { text-align: center; }
.mono { font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.nowrap { white-space: nowrap; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- layout helpers ---------- */
.stack { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.between { display: flex; align-items: center; justify-content: space-between; }
.gap4 { gap: 4px; } .gap6 { gap: 6px; } .gap8 { gap: 8px; } .gap10 { gap: 10px; }
.gap12 { gap: 12px; } .gap16 { gap: 16px; }
.grow { flex: 1; min-width: 0; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; } .mt20 { margin-top: 20px; } .mt24 { margin-top: 24px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; } .mb16 { margin-bottom: 16px; }
.mb20 { margin-bottom: 20px; } .mb24 { margin-bottom: 24px; }
.section { margin-top: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.section-head .caption { margin-bottom: 2px; }
.divider { height: 1px; background: var(--line-soft); margin: 16px 0; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    height: 44px; padding: 0 18px; border-radius: var(--r12);
    background: var(--raised); border: 1px solid var(--line); color: var(--text);
    font-size: 15px; font-weight: 600; transition: transform .06s ease, opacity .15s ease;
}
.btn:active { transform: scale(.985); opacity: .9; }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn.ghost { background: transparent; }
.btn.danger { background: rgba(255, 90, 95, .12); color: var(--danger); border-color: rgba(255, 90, 95, .3); }
.btn.block { display: flex; width: 100%; }
.btn.lg { height: 48px; font-size: 16px; }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: var(--r8); }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; border-radius: var(--r999); }
.btn[disabled], .btn.disabled { opacity: .45; pointer-events: none; }
.btn.pill { border-radius: var(--r999); }
.link-btn { background: none; border: 0; color: var(--accent); font-size: 13px; padding: 4px 0; }
.text-link { color: var(--accent); font-weight: 600; }

/* ---------- cards ---------- */
.card {
    background: var(--raised);
    border: 1px solid var(--line-soft);
    border-radius: var(--r20);
    padding: 16px;
}
.card.tight { padding: 12px; border-radius: var(--r12); }
.card.flat { background: var(--bg); border-color: var(--line); }
.card.accent-glow { border-color: rgba(198, 242, 78, .35); box-shadow: 0 0 0 1px rgba(198, 242, 78, .08) inset, 0 0 24px rgba(198, 242, 78, .06); }
.card + .card { margin-top: 12px; }
.card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.card-title { font-size: 16px; font-weight: 600; }

/* ---------- form ---------- */
.field { margin-bottom: 14px; }
.field > label, .field-label { display: block; font-size: 12px; letter-spacing: .4px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; }
.input, .textarea, .select {
    width: 100%; border: 1px solid var(--line); background: var(--bg);
    border-radius: var(--r12); padding: 12px 14px; color: var(--text); outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.input:focus, .textarea:focus, .select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input::placeholder, .textarea::placeholder { color: var(--faint); }
.textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.input-group { display: flex; gap: 8px; }
.input-group .input { flex: 1; }
.hint { font-size: 12px; color: var(--faint); margin-top: 6px; line-height: 1.4; }
.counter { font-size: 11px; color: var(--faint); text-align: right; margin-top: 4px; }
.checkbox { display: flex; align-items: flex-start; gap: 10px; font-size: 13px; color: var(--muted); }
.checkbox input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.switch { position: relative; width: 44px; height: 26px; flex: 0 0 auto; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: var(--r999); background: var(--line); transition: background .18s ease; pointer-events: none; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: var(--text); transition: transform .18s ease; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); background: var(--accent-ink); }

.radio-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.radio-row:last-child { border-bottom: 0; }
.radio-row input { width: 18px; height: 18px; accent-color: var(--accent); }

/* ---------- chips & segments ---------- */
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 0; }
.chips::-webkit-scrollbar { display: none; }
.chip {
    flex: 0 0 auto; height: 32px; padding: 0 14px; border-radius: var(--r999);
    background: var(--raised); border: 1px solid var(--line); color: var(--muted);
    display: inline-flex; align-items: center; gap: 5px; font-size: 13px; white-space: nowrap;
}
.chip.active { background: var(--accent-soft); border-color: rgba(198, 242, 78, .45); color: var(--accent); }
.segment { display: flex; gap: 4px; padding: 4px; border-radius: var(--r999); background: var(--raised); }
.segment button {
    flex: 1; height: 34px; border: 0; border-radius: var(--r999); background: transparent;
    color: var(--muted); font-size: 14px; font-weight: 600;
}
.segment button.active { background: var(--text); color: #10120B; }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: var(--r999); background: var(--raised-2); color: var(--muted); font-size: 11px; }
.tag.accent { background: var(--accent-soft); color: var(--accent); }
.tag.success { background: rgba(74, 222, 128, .12); color: var(--success); }
.tag.warning { background: rgba(245, 197, 66, .12); color: var(--warning); }
.tag.danger { background: rgba(255, 90, 95, .12); color: var(--danger); }
.tag.info { background: rgba(110, 193, 255, .12); color: var(--info); }
.tag.gift { background: rgba(255, 122, 184, .12); color: var(--gift); }
.topic { color: var(--info); font-size: 13px; }

/* ---------- avatar ---------- */
.avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; background: var(--raised-2); flex: 0 0 auto; }
.avatar.sm { width: 28px; height: 28px; }
.avatar.lg { width: 56px; height: 56px; }
.avatar.xl { width: 88px; height: 88px; border: 3px solid var(--bg); }
.avatar-stack { display: flex; }
.avatar-stack .avatar { width: 24px; height: 24px; border: 2px solid var(--raised); margin-left: -8px; }
.avatar-stack .avatar:first-child { margin-left: 0; }

/* ---------- list ---------- */
.list { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r20); overflow: hidden; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
.list-row:last-child { border-bottom: 0; }
.list-row:active { background: var(--raised-2); }
.list-row .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.list-row .chevron { color: var(--faint); font-size: 18px; }
.rank-num { width: 26px; text-align: center; font-weight: 800; font-size: 15px; font-variant-numeric: tabular-nums; color: var(--muted); }
.rank-num.top1 { color: var(--gold); }
.rank-num.top2 { color: var(--silver); }
.rank-num.top3 { color: var(--bronze); }

/* ---------- tabbar ---------- */
.tabbar {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: var(--page);
    z-index: 60;
    display: flex;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    background: rgba(14, 15, 11, .94);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-soft);
}
.tabbar a {
    flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
    padding: 5px 0; color: var(--faint); font-size: 10px; letter-spacing: .3px;
}
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.active { color: var(--accent); }
.tabbar a .tab-dot { position: absolute; }

.bottombar {
    position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
    width: 100%; max-width: var(--page); z-index: 60;
    display: flex; align-items: center; gap: 10px;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(14, 15, 11, .95);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--line-soft);
}
.fab {
    position: fixed; right: calc(50% - var(--page) / 2 + 16px); bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 55; width: 56px; height: 56px; border-radius: 50%;
    background: var(--accent); color: var(--accent-ink); border: 0;
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 8px 24px rgba(198, 242, 78, .28);
}
.fab svg { width: 26px; height: 26px; }
@media (max-width: 560px) {
    .fab { right: 16px; }
}

/* ---------- feed ---------- */
.feed-card { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r20); padding: 14px; margin-bottom: 12px; }
.feed-card .head { display: flex; align-items: center; gap: 10px; }
.feed-card .body { margin-top: 10px; font-size: 15px; line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.feed-media { display: grid; gap: 4px; margin-top: 10px; border-radius: var(--r12); overflow: hidden; }
.feed-media.n1 { grid-template-columns: 1fr; }
.feed-media.n2 { grid-template-columns: 1fr 1fr; }
.feed-media.n3, .feed-media.n4 { grid-template-columns: 1fr 1fr; }
.feed-media img { width: 100%; height: 100%; max-height: 240px; object-fit: cover; background: var(--raised-2); }
.feed-actions { display: flex; align-items: center; gap: 18px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.feed-actions button { display: inline-flex; align-items: center; gap: 5px; background: none; border: 0; color: inherit; padding: 2px; }
.feed-actions button.liked { color: var(--accent); }
.feed-actions svg { width: 18px; height: 18px; }
.feed-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.season-banner {
    display: flex; align-items: center; gap: 10px; margin: 12px 0;
    padding: 12px 14px; border-radius: var(--r12);
    background: linear-gradient(100deg, rgba(198, 242, 78, .14), rgba(198, 242, 78, .03));
    border: 1px solid rgba(198, 242, 78, .22);
}
.checkin-strip { display: flex; gap: 8px; margin: 12px 0; }
.checkin-pill {
    flex: 1; display: flex; align-items: center; justify-content: center; gap: 5px;
    height: 38px; border-radius: var(--r999); background: var(--raised); border: 1px solid var(--line);
    font-size: 12px; color: var(--muted);
}
.checkin-pill.done { border-color: rgba(198, 242, 78, .4); color: var(--accent); background: var(--accent-soft); }
.checkin-pill:disabled { opacity: .6; }

/* ---------- season ---------- */
.season-hero { position: relative; padding: 18px; border-radius: var(--r20); overflow: hidden; background: radial-gradient(120% 100% at 20% 0%, #2B3318 0%, #171B10 55%, #12140D 100%); border: 1px solid rgba(198, 242, 78, .18); }
.season-hero::after { content: ""; position: absolute; right: -40px; top: -50px; width: 180px; height: 180px; border-radius: 50%; background: radial-gradient(circle, rgba(198, 242, 78, .18), transparent 65%); }
.season-hero .code { font-size: 12px; letter-spacing: 3px; color: var(--accent); font-weight: 700; }
.season-hero .display { font-size: 34px; margin: 6px 0 2px; }
.my-squad-card { margin-top: 12px; display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r12); background: rgba(198, 242, 78, .08); border: 1px solid rgba(198, 242, 78, .2); }
.podium { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; align-items: end; margin-top: 12px; }
.podium .p { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r12); padding: 12px 8px; text-align: center; }
.podium .p.first { padding-top: 18px; border-color: rgba(231, 195, 90, .4); background: linear-gradient(180deg, rgba(231, 195, 90, .12), var(--raised)); }
.podium .medal { font-size: 20px; }
.leader-row { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid var(--line-soft); }
.leader-row:last-child { border-bottom: 0; }
.leader-row.me { background: var(--accent-soft); border-radius: var(--r8); }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r12); padding: 12px; text-align: center; }
.stat .v { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .k { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ---------- pk ---------- */
.pk-hero { display: flex; flex-direction: column; align-items: center; padding: 20px 0 8px; }
.pk-blob {
    width: 200px; height: 200px; border-radius: 50%;
    background: radial-gradient(circle at 32% 28%, #E8FF9B 0%, #C6F24E 35%, #7FA82A 78%, #3E5313 100%);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    color: var(--accent-ink); border: 0; font-weight: 800; letter-spacing: .5px;
    box-shadow: 0 0 60px rgba(198, 242, 78, .22), inset 0 -12px 30px rgba(0, 0, 0, .18);
}
.pk-blob:active { transform: scale(.98); }
.pk-blob .big { font-size: 30px; line-height: 1.1; }
.pk-blob .small { font-size: 12px; font-weight: 700; opacity: .72; margin-top: 4px; }
.pk-template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pk-template { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r12); padding: 14px; display: flex; flex-direction: column; gap: 6px; }
.pk-template:active { border-color: rgba(198, 242, 78, .4); }
.pk-template .emoji { font-size: 22px; }
.pk-template .name { font-weight: 600; font-size: 14px; }
.pk-template .desc { font-size: 11px; color: var(--muted); }
.vs-header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 18px 4px; }
.vs-person { flex: 1; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.vs-mark { font-size: 22px; font-weight: 900; color: var(--accent); letter-spacing: 1px; }
.evidence-card { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r12); padding: 12px; flex: 1; }
.evidence-card .val { font-size: 26px; font-weight: 800; margin-top: 2px; }
.evidence-card.win { border-color: rgba(74, 222, 128, .45); }
.chat-list { display: flex; flex-direction: column; gap: 10px; }
.chat-item { display: flex; flex-direction: column; align-items: flex-start; }
.chat-item.mine { align-items: flex-end; }
.chat-author { font-size: 10px; color: var(--faint); margin-bottom: 3px; }
.chat-bubble { max-width: 78%; padding: 8px 12px; border-radius: 14px; background: var(--raised-2); font-size: 13px; line-height: 1.45; }
.chat-bubble.mine { align-self: flex-end; background: var(--accent-soft); border: 1px solid rgba(198, 242, 78, .25); }
.chat-meta { font-size: 10px; color: var(--faint); margin-top: 3px; }
.quick-phrases { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
.quick-phrases::-webkit-scrollbar { display: none; }
.quick-phrases button { flex: 0 0 auto; height: 28px; padding: 0 10px; border-radius: var(--r999); border: 1px solid var(--line); background: transparent; color: var(--muted); font-size: 12px; }
.progress-bar { height: 8px; border-radius: var(--r999); background: var(--raised-2); overflow: hidden; }
.progress-bar > i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

/* ---------- me ---------- */
.identity { position: relative; margin: -16px -16px 0; padding: 0 16px; }
.identity .cover { height: 120px; border-radius: 0 0 var(--r20) var(--r20); background: linear-gradient(135deg, #2C3519 0%, #1B2011 50%, #101208 100%); position: relative; overflow: hidden; }
.identity .cover::after { content: "RALLY"; position: absolute; right: 16px; bottom: -10px; font-size: 64px; font-weight: 900; letter-spacing: 4px; color: rgba(198, 242, 78, .07); }
.identity .info { display: flex; align-items: flex-end; gap: 12px; margin-top: -30px; position: relative; padding-bottom: 4px; }
.identity .name { font-size: 22px; font-weight: 700; }
.ledger-card { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r16, 16px); padding: 14px 16px; display: flex; align-items: center; gap: 12px; }
.ledger-card .icon { width: 36px; height: 36px; border-radius: var(--r12); display: flex; align-items: center; justify-content: center; font-size: 17px; }
.ledger-card .value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.grid-4 a { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: var(--r12); font-size: 11px; color: var(--muted); }
.grid-4 a:active { background: var(--raised); }
.grid-4 .ic { font-size: 20px; }
.menu-group { background: var(--raised); border: 1px solid var(--line-soft); border-radius: var(--r20); overflow: hidden; margin-top: 12px; }
.menu-group .list-row { padding: 14px; }
.menu-group .caption { padding: 12px 14px 0; }

/* ---------- auth ---------- */
.auth-page { min-height: 100vh; display: flex; flex-direction: column; padding: 24px 22px calc(28px + env(safe-area-inset-bottom)); }
.auth-logo { font-size: 22px; font-weight: 900; letter-spacing: 3px; }
.auth-logo b { color: var(--accent); }
.auth-spacer { flex: 1; }
.auth-title { font-size: 30px; line-height: 1.2; font-weight: 800; letter-spacing: -.6px; margin-top: 18px; }
.auth-sub { color: var(--muted); margin-top: 10px; font-size: 14px; line-height: 1.55; }
.progress-steps { display: flex; gap: 6px; margin-bottom: 20px; }
.progress-steps i { flex: 1; height: 3px; border-radius: var(--r999); background: var(--line); }
.progress-steps i.on { background: var(--accent); }
.splash { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 24px; }
.splash .mark { font-size: 46px; font-weight: 900; letter-spacing: 8px; }
.splash .mark b { color: var(--accent); }
.school-option { display: flex; align-items: center; gap: 12px; padding: 14px; border-bottom: 1px solid var(--line-soft); }
.school-option:last-child { border-bottom: 0; }
.school-option.selected { background: var(--accent-soft); }
.school-badge { width: 38px; height: 38px; border-radius: var(--r12); background: var(--raised-2); display: flex; align-items: center; justify-content: center; font-weight: 800; color: var(--accent); font-size: 13px; }
.code-inputs { display: flex; gap: 8px; margin-top: 8px; }
.code-inputs input { flex: 1; height: 54px; text-align: center; font-size: 22px; font-weight: 700; border-radius: var(--r12); border: 1px solid var(--line); background: var(--bg); outline: none; }
.code-inputs input:focus { border-color: var(--accent); }

/* ---------- notifications / rows ---------- */
.notice-row { display: flex; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); position: relative; }
.notice-row.unread { background: rgba(198, 242, 78, .035); }
.notice-row.unread::before { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 2px; border-radius: 2px; background: var(--accent); }
.notice-row .body { font-size: 13px; color: var(--muted); margin-top: 2px; }
.notice-icon { width: 38px; height: 38px; border-radius: 50%; background: var(--raised-2); display: flex; align-items: center; justify-content: center; font-size: 17px; flex: 0 0 auto; }

/* ---------- toast / sheet / modal ---------- */
.toast-host { position: fixed; left: 50%; bottom: 96px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: 90vw; }
.toast {
    background: rgba(247, 248, 243, .96); color: #10120B; font-size: 13px; font-weight: 600;
    padding: 10px 16px; border-radius: var(--r999); opacity: 0; transform: translateY(8px);
    transition: opacity .2s ease, transform .2s ease; max-width: 88vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast.error { background: var(--danger); color: #fff; }
.toast.success { background: var(--accent); color: var(--accent-ink); }

.mask { position: fixed; inset: 0; z-index: 150; background: rgba(4, 5, 3, .62); opacity: 0; transition: opacity .2s ease; }
.mask.show { opacity: 1; }
.sheet {
    position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 100%);
    width: 100%; max-width: var(--page); z-index: 160; background: var(--raised);
    border-radius: var(--r20) var(--r20) 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom));
    transition: transform .24s cubic-bezier(.22, .8, .3, 1); max-height: 82vh; overflow-y: auto;
}
.sheet.show { transform: translate(-50%, 0); }
.sheet-handle { width: 40px; height: 4px; border-radius: 4px; background: var(--line); margin: 0 auto 14px; }
.sheet .sheet-title { font-size: 17px; font-weight: 700; margin-bottom: 4px; }
.modal {
    position: fixed; left: 50%; top: 50%; transform: translate(-50%, -46%) scale(.97);
    width: calc(100% - 48px); max-width: 360px; z-index: 160; background: var(--raised);
    border-radius: var(--r20); padding: 20px; opacity: 0; pointer-events: none;
    transition: opacity .18s ease, transform .18s ease; border: 1px solid var(--line);
}
.modal.show { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }

/* ---------- empty / loading ---------- */
.empty { padding: 48px 24px; text-align: center; color: var(--muted); }
.empty .big { font-size: 34px; margin-bottom: 10px; }
.empty .t { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.empty .d { font-size: 13px; line-height: 1.5; }
.skeleton { background: linear-gradient(90deg, var(--raised) 25%, var(--raised-2) 50%, var(--raised) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--r8); }
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.load-more { text-align: center; color: var(--faint); font-size: 12px; padding: 16px 0; }

/* ---------- misc ---------- */
.pill-count { min-width: 20px; height: 20px; padding: 0 6px; border-radius: var(--r999); background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.bar-list { display: flex; flex-direction: column; gap: 10px; }
.bar-item .bar-head { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.footer-note { text-align: center; color: var(--faint); font-size: 11px; padding: 22px 0 8px; letter-spacing: .3px; }
.hero-art { font-size: 44px; line-height: 1; }
.sticky-head { position: sticky; top: 52px; z-index: 30; background: var(--bg); padding: 8px 0; }
@media (min-width: 561px) {
    body { background: radial-gradient(120% 55% at 50% 0%, #12140D 0%, #080906 62%); }
    .app { border-left: 1px solid var(--line-soft); border-right: 1px solid var(--line-soft); min-height: 100vh; }
}

/* ---------- light theme ---------- */
[data-theme="light"] {
    color-scheme: light;
    --bg: #F6F7F2;
    --bg-deep: #EDEFE6;
    --raised: #FFFFFF;
    --raised-2: #EFF2E6;
    --line: #DCE0D0;
    --line-soft: #E8EBDE;
    --text: #161A12;
    --muted: #5E6656;
    --faint: #8A9180;
    --accent: #5F8F0F;
    --accent-ink: #FFFFFF;
    --accent-soft: rgba(95, 143, 15, .1);
    --success: #178A4A;
    --warning: #A97116;
    --danger: #D63939;
    --info: #1D6FC0;
    --gift: #C03F7C;
    --gold: #A9821B;
    --silver: #77808B;
    --bronze: #A05C2C;
}

[data-theme="light"] .appbar { background: rgba(246, 247, 242, .92); }
[data-theme="light"] .tabbar { background: rgba(246, 247, 242, .94); }
[data-theme="light"] .bottombar { background: rgba(246, 247, 242, .95); }
[data-theme="light"] .appbar.plain { background: var(--bg); }
[data-theme="light"] .segment button.active { background: var(--text); color: var(--bg); }
[data-theme="light"] .btn.primary { box-shadow: 0 6px 16px rgba(95, 143, 15, .18); }
[data-theme="light"] .card.accent-glow { border-color: rgba(95, 143, 15, .32); box-shadow: 0 0 0 1px rgba(95, 143, 15, .06) inset, 0 8px 24px rgba(95, 143, 15, .08); }
[data-theme="light"] .season-hero {
    background: radial-gradient(120% 100% at 20% 0%, #F1F8DC 0%, #FBFCF5 55%, #F6F7F2 100%);
    border-color: rgba(95, 143, 15, .22);
}
[data-theme="light"] .season-hero::after { background: radial-gradient(circle, rgba(95, 143, 15, .14), transparent 65%); }
[data-theme="light"] .my-squad-card { background: rgba(95, 143, 15, .07); border-color: rgba(95, 143, 15, .22); }
[data-theme="light"] .podium .p.first { background: linear-gradient(180deg, rgba(169, 130, 27, .12), var(--raised)); }
[data-theme="light"] .identity .cover {
    background: linear-gradient(135deg, #E7EFD2 0%, #F3F6E9 50%, #FDFDFB 100%);
}
[data-theme="light"] .identity .cover::after { color: rgba(95, 143, 15, .12); }
[data-theme="light"] .pk-blob {
    background: radial-gradient(circle at 32% 28%, #EDFFB8 0%, #C6F24E 35%, #93C13B 78%, #658B24 100%);
    color: #14180A;
    box-shadow: 0 10px 44px rgba(95, 143, 15, .22), inset 0 -12px 30px rgba(0, 0, 0, .12);
}
[data-theme="light"] .toast { background: rgba(22, 26, 18, .94); color: #F7F8F3; }
[data-theme="light"] .toast.error { background: var(--danger); color: #fff; }
[data-theme="light"] .toast.success { background: #2C4A08; color: #F2FCDD; }
[data-theme="light"] .mask { background: rgba(20, 24, 12, .38); }
[data-theme="light"] .notice-row.unread { background: rgba(95, 143, 15, .045); }
[data-theme="light"] .feed-media img { background: var(--raised-2); }
[data-theme="light"] .fab { box-shadow: 0 8px 24px rgba(95, 143, 15, .26); }
[data-theme="light"] .skeleton { background: linear-gradient(90deg, #EDF0E5 25%, #F7F8F2 50%, #EDF0E5 75%); background-size: 200% 100%; }
[data-theme="light"] .chat-bubble.mine { border-color: rgba(95, 143, 15, .28); }
[data-theme="light"] .code-inputs input { background: var(--raised); }

@media (min-width: 561px) {
    [data-theme="light"] body { background: radial-gradient(120% 55% at 50% 0%, #EFF2E6 0%, #E4E7DA 62%); }
}

/* ---------- preference pickers ---------- */
.pref-bar { display: flex; flex-direction: column; gap: 10px; margin-top: 16px; }
.pref-pill {
    display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px;
    border-radius: var(--r999); border: 1px solid var(--line); background: transparent;
    color: var(--muted); font-size: 12px; font-weight: 600;
}
.pref-pill.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.pref-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: .55; }
.pref-pill.active .dot { opacity: 1; }
.pref-group { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pref-label { font-size: 11px; letter-spacing: .4px; text-transform: uppercase; color: var(--faint); width: 100%; margin-bottom: 2px; }
.pref-option {
    height: 34px; padding: 0 14px; border-radius: var(--r999); border: 1px solid var(--line);
    background: var(--raised); color: var(--muted); font-size: 13px; font-weight: 600;
}
.pref-option.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--line); display: inline-block; vertical-align: -2px; margin-right: 4px; }
.theme-swatch.dark { background: #14160F; }
.theme-swatch.light { background: #F6F7F2; }
.theme-swatch.system { background: linear-gradient(90deg, #14160F 50%, #F6F7F2 50%); }

/* ---------- aismart coach ---------- */
.coach-app { padding-bottom: calc(112px + env(safe-area-inset-bottom)); }
.coach-page { padding-top: 4px; }
.coach-hero {
    position: relative; overflow: hidden; padding: 18px; border-radius: var(--r20);
    background: radial-gradient(120% 120% at 12% 0%, #2B3318 0%, #171B10 58%, #12140D 100%);
    border: 1px solid rgba(198, 242, 78, .18);
}
.coach-hero::after {
    content: ""; position: absolute; right: -40px; top: -60px; width: 180px; height: 180px;
    border-radius: 50%; background: radial-gradient(circle, rgba(198, 242, 78, .14), transparent 65%);
    pointer-events: none;
}
.coach-hero-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; position: relative; z-index: 1; }
.coach-mark {
    display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: var(--r999);
    background: var(--accent); color: var(--accent-ink); font-size: 12px; font-weight: 800;
    letter-spacing: .8px; box-shadow: 0 4px 14px rgba(198, 242, 78, .22);
}
.coach-quota { font-size: 11px; color: var(--muted); white-space: nowrap; }
.coach-quota.low { color: var(--warning); }
.coach-title { margin-top: 14px; font-size: 22px; line-height: 1.25; font-weight: 800; letter-spacing: .2px; position: relative; z-index: 1; }
.coach-sub { margin-top: 6px; font-size: 13px; line-height: 1.55; color: var(--muted); position: relative; z-index: 1; }
.coach-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 16px; position: relative; z-index: 1; }
.coach-stat {
    padding: 9px 6px; border-radius: var(--r12); background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .05); text-align: center; min-width: 0;
}
.coach-stat-value { display: block; font-size: 18px; line-height: 1.15; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; white-space: nowrap; }
.coach-stat-value small { font-size: 10px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.coach-stat-label { display: block; margin-top: 3px; font-size: 10px; line-height: 1.3; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.coach-thread { margin-top: 18px; gap: 14px; }
.coach-item .coach-bubble { max-width: 88%; }
.coach-author { display: flex; align-items: center; gap: 5px; font-size: 10px; letter-spacing: .3px; color: var(--faint); }
.coach-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(198, 242, 78, .12); }
.coach-live { margin-left: 2px; color: var(--accent); font-size: 9px; letter-spacing: .6px; text-transform: uppercase; opacity: .9; }
.coach-bubble {
    padding: 11px 14px; border-radius: 16px; border-top-left-radius: 5px; background: var(--raised-2);
    font-size: 14px; line-height: 1.6; white-space: pre-line; word-break: break-word;
}
.coach-intro { border: 1px solid rgba(198, 242, 78, .14); }
.coach-item.mine .coach-bubble {
    border-top-left-radius: 16px; border-top-right-radius: 5px; background: var(--accent-soft);
    border: 1px solid rgba(198, 242, 78, .25); color: var(--text); font-size: 14px; line-height: 1.55; white-space: pre-line;
}
.coach-typing .coach-bubble { padding: 13px 16px; }
.typing-dots { display: inline-flex; align-items: center; gap: 4px; height: 6px; }
.typing-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: coach-blink 1.2s infinite ease-in-out; }
.typing-dots i:nth-child(2) { animation-delay: .18s; }
.typing-dots i:nth-child(3) { animation-delay: .36s; }
@keyframes coach-blink {
    0%, 80%, 100% { opacity: .25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-2px); }
}

.coach-suggest { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.coach-chip {
    max-width: 100%; min-height: 32px; padding: 6px 12px; border-radius: var(--r999);
    border: 1px solid var(--line); background: var(--raised); color: var(--muted);
    font-size: 12px; line-height: 1.4; text-align: left;
}
.coach-chip:active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.coach-note { margin-top: 18px; font-size: 11px; line-height: 1.6; color: var(--faint); }

.coach-composer {
    position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: var(--page); padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(180deg, rgba(14, 15, 11, 0) 0%, var(--bg) 22%); z-index: 30;
}
.coach-composer-inner {
    display: flex; align-items: flex-end; gap: 8px; padding: 6px 6px 6px 14px;
    border-radius: 18px; background: var(--raised); border: 1px solid var(--line);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .28);
}
.coach-input {
    flex: 1; min-height: 32px; max-height: 120px; padding: 6px 0; border: 0; outline: 0;
    resize: none; background: transparent; font-size: 14px; line-height: 1.45; color: var(--text);
    scrollbar-width: none;
}
.coach-input::-webkit-scrollbar { width: 0; height: 0; }
.coach-input::placeholder { color: var(--faint); }
.coach-send {
    flex: 0 0 auto; width: 38px; height: 38px; border: 0; border-radius: 13px;
    background: var(--accent); color: var(--accent-ink); display: inline-flex; align-items: center;
    justify-content: center; transition: opacity .15s ease, transform .06s ease;
}
.coach-send svg { width: 18px; height: 18px; transform: translateX(-1px); }
.coach-send:active { transform: scale(.96); }
.coach-send[disabled] { opacity: .42; }
.coach-hint { margin-top: 6px; text-align: center; font-size: 10px; color: var(--faint); letter-spacing: .2px; }

[data-theme="light"] .coach-hero { background: radial-gradient(120% 120% at 12% 0%, #F1F8DC 0%, #FBFCF5 58%, #F6F7F2 100%); border-color: rgba(95, 143, 15, .22); }
[data-theme="light"] .coach-hero::after { background: radial-gradient(circle, rgba(95, 143, 15, .12), transparent 65%); }
[data-theme="light"] .coach-stat { background: rgba(95, 143, 15, .055); border-color: rgba(95, 143, 15, .12); }
[data-theme="light"] .coach-composer { background: linear-gradient(180deg, rgba(246, 247, 242, 0) 0%, var(--bg) 22%); }
[data-theme="light"] .coach-composer-inner { box-shadow: 0 8px 24px rgba(60, 70, 40, .1); }
[data-theme="light"] .coach-dot { box-shadow: 0 0 0 3px rgba(95, 143, 15, .12); }
[data-theme="light"] .coach-item.mine .coach-bubble { border-color: rgba(95, 143, 15, .25); }

@media (max-width: 380px) {
    .coach-stats { gap: 4px; }
    .coach-stat { padding: 8px 3px; }
    .coach-stat-value { font-size: 16px; }
    .coach-stat-label { font-size: 9px; }
    .coach-title { font-size: 20px; }
}

/* ---------- aismart feed entry ---------- */
.coach-cta {
    display: flex; align-items: center; gap: 12px;
    background: linear-gradient(120deg, rgba(249, 115, 22, .13) 0%, rgba(249, 115, 22, .04) 46%, var(--raised) 100%);
    border-color: rgba(249, 115, 22, .34);
    box-shadow: 0 0 0 1px rgba(249, 115, 22, .06) inset, 0 8px 24px -14px rgba(249, 115, 22, .55);
}
.coach-cta-mark {
    flex: 0 0 auto; display: inline-flex; align-items: center; gap: 5px; height: 28px; padding: 0 10px;
    border-radius: var(--r999); background: var(--ai); color: var(--ai-ink);
    font-size: 11px; font-weight: 800; letter-spacing: .6px;
    box-shadow: 0 4px 16px rgba(249, 115, 22, .34), inset 0 0 0 1px rgba(255, 255, 255, .2);
}
.coach-cta-mark svg { width: 12px; height: 12px; flex: 0 0 auto; }
[data-theme="light"] .coach-cta {
    background: linear-gradient(120deg, rgba(234, 88, 12, .08) 0%, #FFFFFF 52%);
    border-color: rgba(234, 88, 12, .28);
    box-shadow: 0 0 0 1px rgba(234, 88, 12, .04) inset, 0 8px 24px -16px rgba(234, 88, 12, .4);
}
[data-theme="light"] .coach-cta-mark { box-shadow: 0 4px 14px rgba(234, 88, 12, .26); }
.coach-cta-copy { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.coach-cta-copy b { font-size: 14px; font-weight: 700; line-height: 1.35; }
.coach-cta-copy span { font-size: 11px; line-height: 1.35; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coach-cta .tag { flex: 0 0 auto; white-space: nowrap; }
